00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _OCS_READ_WRITE_TOOLS_HH_
00015 #define _OCS_READ_WRITE_TOOLS_HH_
00016
00017 #ifndef _OCS_READ_WRITE_ENUMERATORS_
00018 #define _OCS_READ_WRITE_ENUMERATORS_
00019
00020 enum BoundsFlagEnumerator { LOWER_ONLY = 1, UPPER_ONLY = 2,
00021 LOWER_AND_UPPER = 3, NO_BOUNDS = 4};
00022
00023
00024 enum InputParameterOptionsEnumerator { MANDATORY = 1, OPTIONAL_WARNING = 2,
00025 OPTIONAL_NO_WARNING = 3};
00026
00027
00028 #endif
00029
00030 #ifndef _OCS_TYPE_SIMULATION_
00031 #define _OCS_TYPE_SIMULATION_
00032
00033 enum typeSimulation { SCALAR = 1, VECTOR = 2 };
00034
00035 #endif
00036
00037 #ifndef _OCS_SYSTEM_HDRS_
00038 #define _OCS_SYSTEM_HDRS_
00039
00040 #include <iostream.h>
00041 #include <string.h>
00042 #include <math.h>
00043 #include <fstream.h>
00044 #include <complex.h>
00045 #include <stdlib.h>
00046 #include <stdio.h>
00047 #include <strstream>
00048
00049 #include <string>
00050 using namespace std;
00051
00052
00053
00054 #endif
00055
00056 #include "ocsConst.hh"
00057 #include "ocsReducedModelTools.hh"
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 int ReadInt(string ParameterName, string UnitsString,
00093 int LowerBound,int UpperBound,
00094 BoundsFlagEnumerator BoundsFlag,
00095 InputParameterOptionsEnumerator InputParameterOption,
00096 int DefaultValue,
00097 ifstream * InFile, bool DebugLevel);
00098
00099 long ReadLongInt(string ParameterName, string UnitsString,
00100 int LowerBound,int UpperBound,
00101 BoundsFlagEnumerator BoundsFlag,
00102 InputParameterOptionsEnumerator InputParameterOption,
00103 int DefaultValue,
00104 ifstream * InFile, bool DebugLevel);
00105
00106 double ReadDouble(string ParameterName, string UnitsString,
00107 double LowerBound, double UpperBound,
00108 BoundsFlagEnumerator BoundsFlag,
00109 InputParameterOptionsEnumerator InputParameterOption,
00110 double DefaultValue,
00111 ifstream * InFile, bool DebugLevel);
00112
00113 string ReadString(string ParameterName,
00114 InputParameterOptionsEnumerator InputParameterOption,
00115 string DefaultValue,
00116 ifstream * InFile, bool DebugLevel);
00117
00118
00119
00120
00121 int ReadInt(string ParameterName, string UnitsString,
00122 int LowerBound,int UpperBound,
00123 BoundsFlagEnumerator BoundsFlag,
00124 InputParameterOptionsEnumerator InputParameterOption,
00125 int DefaultValue,
00126 ifstream * InFile);
00127
00128 long ReadLongInt(string ParameterName, string UnitsString,
00129 int LowerBound,int UpperBound,
00130 BoundsFlagEnumerator BoundsFlag,
00131 InputParameterOptionsEnumerator InputParameterOption,
00132 int DefaultValue,
00133 ifstream * InFile);
00134
00135 double ReadDouble(string ParameterName, string UnitsString,
00136 double LowerBound, double UpperBound,
00137 BoundsFlagEnumerator BoundsFlag,
00138 InputParameterOptionsEnumerator InputParameterOption,
00139 double DefaultValue,
00140 ifstream * InFile);
00141
00142 string ReadString(string ParameterName,
00143 InputParameterOptionsEnumerator InputParameterOption,
00144 string DefaultValue,
00145 ifstream * InFile);
00146
00147
00148
00149
00150 int ReadInt(string ParameterName, string UnitsString,
00151 int LowerBound,int UpperBound,
00152 BoundsFlagEnumerator BoundsFlag,
00153 InputParameterOptionsEnumerator InputParameterOption,
00154 ifstream * InFile, bool DebugLevel);
00155
00156 long ReadLongInt(string ParameterName, string UnitsString,
00157 int LowerBound,int UpperBound,
00158 BoundsFlagEnumerator BoundsFlag,
00159 InputParameterOptionsEnumerator InputParameterOption,
00160 ifstream * InFile, bool DebugLevel);
00161
00162 double ReadDouble(string ParameterName, string UnitsString,
00163 double LowerBound, double UpperBound,
00164 BoundsFlagEnumerator BoundsFlag,
00165 InputParameterOptionsEnumerator InputParameterOption,
00166 ifstream * InFile, bool DebugLevel);
00167
00168 string ReadString(string ParameterName,
00169 InputParameterOptionsEnumerator InputParameterOption,
00170 ifstream * InFile, bool DebugLevel);
00171
00172
00173 void MissingParameter(string ParameterName,
00174 InputParameterOptionsEnumerator InputParameterOption,
00175 bool DebugLevel);
00176
00177 int ReadInt(string ParameterName, string UnitsString,
00178 int LowerBound,int UpperBound,
00179 BoundsFlagEnumerator BoundsFlag,
00180 InputParameterOptionsEnumerator InputParameterOption,
00181 ifstream * InFile);
00182
00183 long ReadLongInt(string ParameterName, string UnitsString,
00184 int LowerBound,int UpperBound,
00185 BoundsFlagEnumerator BoundsFlag,
00186 InputParameterOptionsEnumerator InputParameterOption,
00187 ifstream * InFile);
00188
00189 double ReadDouble(string ParameterName, string UnitsString,
00190 double LowerBound, double UpperBound,
00191 BoundsFlagEnumerator BoundsFlag,
00192 InputParameterOptionsEnumerator InputParameterOption,
00193 ifstream * InFile);
00194
00195 string ReadString(string ParameterName,
00196 InputParameterOptionsEnumerator InputParameterOption,
00197 ifstream * InFile);
00198
00199
00200 void MissingParameter(string ParameterName,
00201 InputParameterOptionsEnumerator InputParameterOption);
00202
00203
00204
00205
00206 int ReadInt(string ParameterName, string UnitsString,
00207 int LowerBound,int UpperBound,
00208 BoundsFlagEnumerator BoundsFlag, ifstream * InFile,
00209 bool DebugLevel);
00210
00211 long ReadLongInt(string ParameterName, string UnitsString,
00212 long LowerBound, long UpperBound,
00213 BoundsFlagEnumerator BoundsFlag, ifstream * InFile,
00214 bool DebugLevel);
00215
00216
00217
00218 double ReadDouble(string ParameterName, string UnitsString,
00219 double LowerBound, double UpperBound,
00220 BoundsFlagEnumerator BoundsFlag, ifstream * InFile,
00221 bool DebugLevel);
00222
00223 string ReadString(string ParameterName, ifstream * InFile,
00224 bool DebugLevel);
00225
00226 int ReadInt(string ParameterName, string UnitsString,
00227 int LowerBound,int UpperBound,
00228 BoundsFlagEnumerator BoundsFlag, ifstream * InFile);
00229
00230 long ReadLongInt(string ParameterName, string UnitsString,
00231 long LowerBound, long UpperBound,
00232 BoundsFlagEnumerator BoundsFlag, ifstream * InFile);
00233
00234
00235
00236 double ReadDouble(string ParameterName, string UnitsString,
00237 double LowerBound, double UpperBound,
00238 BoundsFlagEnumerator BoundsFlag, ifstream * InFile);
00239
00240 string ReadString(string ParameterName, ifstream * InFile);
00241
00242 void cerror(char * msg);
00243 void LogFileSeparator();
00244 void LogFileStars();
00245 void LogFileAbortWithErrorMsg(string ErrorMsg);
00246
00247 string WriteTypeSimulation(typeSimulation TypeSimulation);
00248
00249
00250 double* ReadVectorOfDoubles(string ParameterName, string UnitsString,
00251 double LowerBound, double UpperBound,
00252 BoundsFlagEnumerator BoundsFlag,
00253 InputParameterOptionsEnumerator InputParameterOption,
00254 double DefaultValue,unsigned NumbersOfElements,
00255 ifstream * InFile);
00256
00257 double* ReadVectorOfDoubles(string ParameterName, string UnitsString,
00258 double LowerBound, double UpperBound,
00259 BoundsFlagEnumerator BoundsFlag,
00260 InputParameterOptionsEnumerator InputParameterOption,
00261 double DefaultValue, unsigned NumberOfElements,
00262 ifstream * InFile, bool DebugLevel);
00263 void WrongTypeParameter(string ParameterName);
00264 void WrongTypeParameter(string ParameterName, bool DebugLevel);
00265
00266 unsigned ReadUnsignedInt(string ParameterName, string UnitsString,
00267 unsigned LowerBound,unsigned UpperBound,
00268 BoundsFlagEnumerator BoundsFlag,
00269 InputParameterOptionsEnumerator InputParameterOption,
00270 unsigned DefaultValue,
00271 ifstream * InFile, bool DebugLevel);
00272
00273 unsigned ReadUnsignedInt(string ParameterName, string UnitsString,
00274 unsigned LowerBound,unsigned UpperBound,
00275 BoundsFlagEnumerator BoundsFlag,
00276 InputParameterOptionsEnumerator InputParameterOption,
00277 unsigned DefaultValue,
00278 ifstream * InFile);
00279
00280
00281
00282
00283
00284
00285 #endif