00001 00005 class SimResFile 00006 00007 { 00008 FieldWriter* writer; 00009 FieldReader* reader; 00010 00011 String dataset_basename; 00012 bool append_to_dataset; 00013 00014 Format_type field_format; 00015 Format_type grid_format; 00016 00017 void updateWriter(); 00018 void updateReader(); 00019 00020 void close(); 00021 00022 public: 00023 00024 SimResFile (); 00025 SimResFile (const String& filename, const bool append = false); 00026 ~SimResFile (); 00027 00028 00029 void open (const String& filename, const bool append = false); 00030 00031 String getDatasetName () const; 00032 bool ok () const; 00033 void checkState () const; 00034 00035 void setStorageMode (Format_type field_format, Format_type grid_format); 00036 void getStorageMode (Format_type& field_format, Format_type& grid_format); 00037 00038 int getNoFields(); 00039 00040 int locateField 00041 ( 00042 const String& fieldname, 00043 real& time, 00044 int& nsd, 00045 String& fieldtype, 00046 int& component, 00047 int& maxcomponent 00048 ); 00049 00050 int locateField 00051 ( 00052 const int fieldnum, 00053 String& fieldname, 00054 real& time, 00055 int& nsd, 00056 String& fieldtype, 00057 int& component, 00058 int& maxcomponent 00059 ); 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 int write 00070 ( 00071 Field& field, 00072 const String& fieldname, 00073 const real time, 00074 const String& description, 00075 const int component = 1, 00076 const int maxcomponent = 1 00077 ); 00078 00079 bool read 00080 ( 00081 Handle(Field)& field, 00082 const String& fieldname, 00083 real& time, 00084 String& fieldtype, 00085 int& component, 00086 int& maxcomponent 00087 ); 00088 00089 bool read 00090 ( 00091 Handle(Field)& field, 00092 const int fieldnum, 00093 String& fieldname, 00094 real& time, 00095 String& fieldtype, 00096 int& component, 00097 int& maxcomponent 00098 ); 00099 00100 00101 00102 00103 int write 00104 ( 00105 Fields& fields, 00106 const String& fieldname, 00107 const real time, 00108 const String& description 00109 ); 00110 00111 bool read 00112 ( 00113 Handle(Fields)& fields, 00114 const String& fieldname, 00115 real& time, 00116 String& fieldtype 00117 ); 00118 00119 bool read 00120 ( 00121 Handle(Fields)& fields, 00122 const int fieldnum, 00123 String& fieldname, 00124 real& time, 00125 String& fieldtype 00126 ); 00127 00128 00129 00130 00131 00132 static void writeField 00133 ( 00134 FieldFV& fv, 00135 SimResFile& file, 00136 const String& fieldname, 00137 const real time, 00138 const String& description 00139 ); 00140 00141 static void writeFields 00142 ( 00143 FieldsFV& fvs, 00144 SimResFile& file, 00145 const String& fieldname, 00146 const real time, 00147 const String& description 00148 ); 00149 00150 static void writeField 00151 ( 00152 FieldFE& fe, 00153 SimResFile& file, 00154 const String& fieldname, 00155 const real time, 00156 const String& description 00157 ); 00158 00159 static void writeFields 00160 ( 00161 FieldsFE& fes, 00162 SimResFile& file, 00163 const String& fieldname, 00164 const real time, 00165 const String& description 00166 ); 00167 00168 00169 static void writeField 00170 ( 00171 FieldPiWisConst& fsd, 00172 SimResFile& file, 00173 const String& fieldname, 00174 const real time, 00175 const String& description 00176 ); 00177 00178 static void writeFields 00179 ( 00180 FieldsPiWisConst& fsds, 00181 SimResFile& file, 00182 const String& fieldname, 00183 const real time, 00184 const String& description 00185 ); 00186 00187 00188 static void writeField 00189 ( 00190 FieldLattice& fd, 00191 SimResFile& file, 00192 const String& fieldname, 00193 const real time, 00194 const String& description 00195 ); 00196 00197 static void writeFields 00198 ( 00199 FieldsLattice& fds, 00200 SimResFile& file, 00201 const String& fieldname, 00202 const real time, 00203 const String& description 00204 ); 00205 00206 00207 static bool readField 00208 ( 00209 FieldFV& fv, 00210 SimResFile& file, 00211 const String& fieldname, 00212 real& time, 00213 bool enable_time_mismatch_warning = false 00214 ); 00215 00216 static bool readFields 00217 ( 00218 FieldsFV& fvs, 00219 SimResFile& file, 00220 const String& fieldname, 00221 real& time, 00222 bool enable_time_mismatch_warning = false 00223 ); 00224 00225 static bool readFields 00226 ( 00227 FieldsFV& fes, 00228 SimResFile& file, 00229 const int fieldnum 00230 ); 00231 00232 static bool readField 00233 ( 00234 FieldFE& fe, 00235 SimResFile& file, 00236 const String& fieldname, 00237 real& time, 00238 bool enable_time_mismatch_warning = false 00239 ); 00240 00241 static bool readFields 00242 ( 00243 FieldsFE& fes, 00244 SimResFile& file, 00245 const String& fieldname, 00246 real& time, 00247 bool enable_time_mismatch_warning = false 00248 ); 00249 00250 static bool readFields 00251 ( 00252 FieldsFE& fes, 00253 SimResFile& file, 00254 const int fieldnum 00255 ); 00256 00257 00258 00259 static bool readField 00260 ( 00261 FieldPiWisConst& fsd, 00262 SimResFile& file, 00263 const String& fieldname, 00264 real& time, 00265 bool enable_time_mismatch_warning = false 00266 ); 00267 00268 static bool readFields 00269 ( 00270 FieldsPiWisConst& fsds, 00271 SimResFile& file, 00272 const String& fieldname, 00273 real& time, 00274 bool enable_time_mismatch_warning = false 00275 ); 00276 00277 static bool readFields 00278 ( 00279 FieldsPiWisConst& fsds, 00280 SimResFile& file, 00281 const int fieldnum 00282 ); 00283 00284 }; 00285 00286