00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 // DTGraves, Fri, Dec 3, 1999 00012 00013 #ifndef _AMRIO_H_ 00014 #define _AMRIO_H_ 00015 00016 #include "REAL.H" 00017 00018 #ifndef WRAPPER 00019 #include "LevelData.H" 00020 #include "REAL.H" 00021 #include "Vector.H" 00022 #include "FArrayBox.H" 00023 #include "CFArrayBox.H" 00024 #include "FluxBox.H" 00025 #include "IntVectSet.H" 00026 #include "IVSFAB.H" 00027 #include "RealVect.H" 00028 #include <string> 00029 #include "NamespaceHeader.H" 00030 using std::string; 00031 using std::istream; 00032 #endif 00033 00034 #ifdef CH_USE_HDF5 00035 /// 00036 /** 00037 Writes hierarchy of levels in HDF5 format. Only available if the 00038 preprocessor macro HDF5 is defined at compilation. 00039 00040 {\bf Arguments:}\\ 00041 filename : file to output to.\\ 00042 a_vectGrids : grids at each level.\\ 00043 a_vectData : data at each level.\\ 00044 a_vectNames: names of variables.\\ 00045 a_domain : domain at coarsest level.\\ 00046 a_dx : grid spacing at coarsest level.\\ 00047 a_dt : time step at coarsest level.\\ 00048 a_time : time.\\ 00049 a_vectRatio : refinement ratio at all levels 00050 (ith entry is refinement ratio between levels i and i + 1).\\ 00051 a_numLevels : number of levels to output.\\ 00052 This is blocking. 00053 00054 */ 00055 void 00056 WriteAMRHierarchyHDF5(const string& filename, 00057 const Vector<DisjointBoxLayout>& a_vectGrids, 00058 const Vector<LevelData<FArrayBox>* > & a_vectData, 00059 const Vector<string>& a_vectNames, 00060 const Box& a_domain, 00061 const Real& a_dx, 00062 const Real& a_dt, 00063 const Real& a_time, 00064 const Vector<int>& a_vectRatio, 00065 const int& a_numLevels); 00066 00067 /// 00068 /** 00069 Writes hierarchy of levels in HDF5 format. Only available if the 00070 preprocessor macro HDF5 is defined at compilation. 00071 00072 {\bf Arguments:}\\ 00073 filename : file to output to.\\ 00074 a_vectGrids : grids at each level.\\ 00075 a_vectData : data at each level.\\ 00076 a_vectNames: names of variables.\\ 00077 a_domain : domain at coarsest level.\\ 00078 a_dx : grid spacing in each direction at coarsest level.\\ 00079 a_dt : time step at coarsest level.\\ 00080 a_time : time.\\ 00081 a_vectRatio : refinement ratio in each direction at all levels 00082 (ith entry is refinement ratio in each direction between levels i and i + 1).\\ 00083 a_numLevels : number of levels to output.\\ 00084 This is blocking. 00085 00086 */ 00087 void 00088 WriteAnisotropicAMRHierarchyHDF5( 00089 const string& filename, 00090 const Vector<DisjointBoxLayout>& a_vectGrids, 00091 const Vector<LevelData<FArrayBox>* > & a_vectData, 00092 const Vector<string>& a_vectNames, 00093 const Box& a_domain, 00094 const RealVect& a_dx, 00095 const Real& a_dt, 00096 const Real& a_time, 00097 const Vector<IntVect>& a_vectRatios, 00098 const int& a_numLevels); 00099 00100 /// 00101 /** 00102 Writes hierarchy of levels in HDF5 format. Only available if the 00103 preprocessor macro HDF5 is defined at compilation. 00104 00105 {\bf Arguments:}\\ 00106 handle : handle to output to.\\ 00107 a_vectGrids : grids at each level.\\ 00108 a_vectData : data at each level.\\ 00109 a_vectNames: names of variables.\\ 00110 a_domain : domain at coarsest level.\\ 00111 a_dx : grid spacing at coarsest level.\\ 00112 a_dt : time step at coarsest level.\\ 00113 a_time : time.\\ 00114 a_vectRatio : refinement ratio at all levels 00115 (ith entry is refinement ratio between levels i and i + 1).\\ 00116 a_numLevels : number of levels to output.\\ 00117 This is not blocking. 00118 00119 */ 00120 void 00121 WriteAMRHierarchyHDF5(HDF5Handle& handle, 00122 const Vector<DisjointBoxLayout>& a_vectGrids, 00123 const Vector<LevelData<FArrayBox>* > & a_vectData, 00124 const Vector<string>& a_vectNames, 00125 const Box& a_domain, 00126 const Real& a_dx, 00127 const Real& a_dt, 00128 const Real& a_time, 00129 const Vector<int>& a_vectRatio, 00130 const int& a_numLevels); 00131 00132 // 00133 /** 00134 Writes hierarchy of levels in HDF5 format. Only available if the 00135 preprocessor macro HDF5 is defined at compilation. 00136 00137 {\bf Arguments:}\\ 00138 handle : handle to output to.\\ 00139 a_vectGrids : grids at each level.\\ 00140 a_vectData : data at each level.\\ 00141 a_vectNames: names of variables.\\ 00142 a_domain : domain at coarsest level.\\ 00143 a_dx : grid spacing in each direction at coarsest level.\\ 00144 a_dt : time step at coarsest level.\\ 00145 a_time : time.\\ 00146 a_vectRatio : refinement ratio in each direction at all levels 00147 (ith entry is refinement ratio between levels i and i + 1).\\ 00148 a_numLevels : number of levels to output.\\ 00149 This is not blocking. 00150 00151 */ 00152 void 00153 WriteAnisotropicAMRHierarchyHDF5( 00154 HDF5Handle& handle, 00155 const Vector<DisjointBoxLayout>& a_vectGrids, 00156 const Vector<LevelData<FArrayBox>* > & a_vectData, 00157 const Vector<string>& a_vectNames, 00158 const Box& a_domain, 00159 const RealVect& a_dx, 00160 const Real& a_dt, 00161 const Real& a_time, 00162 const Vector<IntVect>& a_vectRatios, 00163 const int& a_numLevels); 00164 00165 /// 00166 /** 00167 Writes hierarchy of levels in HDF5 format. Only available if the 00168 preprocessor macro HDF5 is defined at compilation. 00169 00170 {\bf Arguments:}\\ 00171 filename : file to output to.\\ 00172 a_vectGrids : grids at each level.\\ 00173 a_vectData : data at each level.\\ 00174 a_domain : domain at coarsest level.\\ 00175 a_vectRatio : refinement ratio at all levels 00176 (ith entry is refinement ratio between levels i and i + 1).\\ 00177 a_numLevels : number of levels to output.\\ 00178 This is blocking. 00179 */ 00180 void 00181 WriteAMRHierarchyHDF5(const string& filename, 00182 const Vector<DisjointBoxLayout>& a_vectGrids, 00183 const Vector<LevelData<FArrayBox>* > & a_vectData, 00184 const Box& a_domain, 00185 const Vector<int>& a_vectRatio, 00186 const int& a_numLevels); 00187 00188 /// 00189 /** 00190 Writes hierarchy of levels in HDF5 format. Only available if the 00191 preprocessor macro HDF5 is defined at compilation. 00192 00193 {\bf Arguments:}\\ 00194 handle : handle to output to.\\ 00195 a_vectGrids : grids at each level.\\ 00196 a_vectData : data at each level.\\ 00197 a_domain : domain at coarsest level.\\ 00198 a_vectRatio : refinement ratio at all levels 00199 (ith entry is refinement ratio between levels i and i + 1).\\ 00200 a_numLevels : number of levels to output.\\ 00201 This is not blocking. 00202 */ 00203 void 00204 WriteAMRHierarchyHDF5(HDF5Handle& handle, 00205 const Vector<DisjointBoxLayout>& a_vectGrids, 00206 const Vector<LevelData<FArrayBox>* > & a_vectData, 00207 const Box& a_domain, 00208 const Vector<int>& a_vectRatio, 00209 const int& a_numLevels); 00210 00211 #ifndef WRAPPER 00212 /// 00213 /** 00214 Reads hierarchy of levels in HDF5 format. Only available if the 00215 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00216 00217 {\bf Arguments:}\\ 00218 filename : file to input from.\\ 00219 a_vectGrids : grids at each level.\\ 00220 a_vectData : data at each level.\\ 00221 a_vectNames: names of variables.\\ 00222 a_domain : domain at coarsest level.\\ 00223 a_dx : grid spacing at coarsest level.\\ 00224 a_dt : time step at coarsest level.\\ 00225 a_time : time.\\ 00226 a_vectRatio : refinement ratio at all levels 00227 (ith entry is refinement ratio between levels i and i + 1).\\ 00228 a_numLevels : number of levels to read.\\ 00229 00230 {\bf Returns:} \\ 00231 status code with values:\\ 00232 0: success \\ 00233 -1: bogus number of levels \\ 00234 -2: bogus number of components \\ 00235 -3: error in readlevel \\ 00236 -4: file open failed \\ 00237 This is blocking 00238 */ 00239 int 00240 ReadAMRHierarchyHDF5(const string& filename, 00241 Vector<DisjointBoxLayout>& a_vectGrids, 00242 Vector<LevelData<FArrayBox>* > & a_vectData, 00243 Vector<string>& a_vectNames, 00244 Box& a_domain, 00245 Real& a_dx, 00246 Real& a_dt, 00247 Real& a_time, 00248 Vector<int>& a_refRatio, 00249 int& a_numLevels); 00250 00251 /// 00252 /** 00253 Reads hierarchy of levels in HDF5 format. Only available if the 00254 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00255 00256 {\bf Arguments:}\\ 00257 handle : handle to input from.\\ 00258 a_vectGrids : grids at each level.\\ 00259 a_vectData : data at each level.\\ 00260 a_vectNames: names of variables.\\ 00261 a_domain : domain at coarsest level.\\ 00262 a_dx : grid spacing at coarsest level.\\ 00263 a_dt : time step at coarsest level.\\ 00264 a_time : time.\\ 00265 a_vectRatio : refinement ratio at all levels 00266 (ith entry is refinement ratio between levels i and i + 1).\\ 00267 a_numLevels : number of levels to read.\\ 00268 00269 {\bf Returns:} \\ 00270 status code with values:\\ 00271 0: success \\ 00272 -1: bogus number of levels \\ 00273 -2: bogus number of components \\ 00274 -3: error in readlevel \\ 00275 -4: file open failed \\ 00276 This is not blocking 00277 */ 00278 int 00279 ReadAMRHierarchyHDF5(HDF5Handle& handle, 00280 Vector<DisjointBoxLayout>& a_vectGrids, 00281 Vector<LevelData<FArrayBox>* > & a_vectData, 00282 Vector<string>& a_vectNames, 00283 Box& a_domain, 00284 Real& a_dx, 00285 Real& a_dt, 00286 Real& a_time, 00287 Vector<int>& a_refRatio, 00288 int& a_numLevels); 00289 00290 /// 00291 /** 00292 Reads hierarchy of levels in HDF5 format. Only available if the 00293 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00294 00295 {\bf Arguments:}\\ 00296 filename : file to input from.\\ 00297 a_vectGrids : grids at each level.\\ 00298 a_vectData : data at each level.\\ 00299 a_domain : domain at coarsest level.\\ 00300 a_vectRatio : refinement ratio at all levels 00301 (ith entry is refinement ratio between levels i and i + 1).\\ 00302 a_numLevels : number of levels to read.\\ 00303 00304 {\bf Returns:} \\ 00305 status code with values:\\ 00306 0: success \\ 00307 -1: bogus number of levels \\ 00308 -2: bogus number of components \\ 00309 -3: error in readlevel \\ 00310 -4: file open failed \\ 00311 This is blocking. 00312 */ 00313 int 00314 ReadAMRHierarchyHDF5(const string& filename, 00315 Vector<DisjointBoxLayout>& a_vectGrids, 00316 Vector<LevelData<FArrayBox>* > & a_vectData, 00317 Box& a_domain, 00318 Vector<int>& a_refRatio, 00319 int& a_numLevels); 00320 00321 /// 00322 /** 00323 Reads hierarchy of levels in HDF5 format. Only available if the 00324 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00325 00326 {\bf Arguments:}\\ 00327 handle : handle to input from.\\ 00328 a_vectGrids : grids at each level.\\ 00329 a_vectData : data at each level.\\ 00330 a_domain : domain at coarsest level.\\ 00331 a_vectRatio : refinement ratio at all levels 00332 (ith entry is refinement ratio between levels i and i + 1).\\ 00333 a_numLevels : number of levels to read.\\ 00334 00335 {\bf Returns:} \\ 00336 status code with values:\\ 00337 0: success \\ 00338 -1: bogus number of levels \\ 00339 -2: bogus number of components \\ 00340 -3: error in readlevel \\ 00341 -4: file open failed \\ 00342 This is not blocking. 00343 */ 00344 int 00345 ReadAMRHierarchyHDF5(HDF5Handle& handle, 00346 Vector<DisjointBoxLayout>& a_vectGrids, 00347 Vector<LevelData<FArrayBox>* > & a_vectData, 00348 Box& a_domain, 00349 Vector<int>& a_refRatio, 00350 int& a_numLevels); 00351 00352 /// 00353 /** 00354 Reads hierarchy of levels in ANISOTROPIC HDF5 format. Only available if the 00355 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00356 00357 {\bf Arguments:}\\ 00358 filename : file to input from.\\ 00359 a_vectGrids : grids at each level.\\ 00360 a_vectData : data at each level.\\ 00361 a_vectNames: names of variables.\\ 00362 a_domain : domain at coarsest level.\\ 00363 a_dx : grid spacing at coarsest level.\\ 00364 a_dt : time step at coarsest level.\\ 00365 a_time : time.\\ 00366 a_vectRatio : refinement ratio at all levels 00367 (ith entry is refinement ratio between levels i and i + 1).\\ 00368 a_numLevels : number of levels to read.\\ 00369 00370 {\bf Returns:} \\ 00371 status code with values:\\ 00372 0: success \\ 00373 -1: bogus number of levels \\ 00374 -2: bogus number of components \\ 00375 -3: error in readlevel \\ 00376 -4: file open failed \\ 00377 This is blocking 00378 */ 00379 int 00380 ReadAnisotropicAMRHierarchyHDF5(const string& filename, 00381 Vector<DisjointBoxLayout>& a_vectGrids, 00382 Vector<LevelData<FArrayBox>* > & a_vectData, 00383 Vector<string>& a_vectNames, 00384 Box& a_domain, 00385 RealVect& a_dx, 00386 Real& a_dt, 00387 Real& a_time, 00388 Vector<IntVect>& a_refRatio, 00389 int& a_numLevels); 00390 00391 /// 00392 /** 00393 Reads hierarchy of levels in ANISOTROPIC HDF5 format. Only available if the 00394 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00395 00396 {\bf Arguments:}\\ 00397 handle : handle to input from.\\ 00398 a_vectGrids : grids at each level.\\ 00399 a_vectData : data at each level.\\ 00400 a_vectNames: names of variables.\\ 00401 a_domain : domain at coarsest level.\\ 00402 a_dx : grid spacing at coarsest level.\\ 00403 a_dt : time step at coarsest level.\\ 00404 a_time : time.\\ 00405 a_vectRatio : refinement ratio at all levels 00406 (ith entry is refinement ratio between levels i and i + 1).\\ 00407 a_numLevels : number of levels to read.\\ 00408 00409 {\bf Returns:} \\ 00410 status code with values:\\ 00411 0: success \\ 00412 -1: bogus number of levels \\ 00413 -2: bogus number of components \\ 00414 -3: error in readlevel \\ 00415 -4: file open failed \\ 00416 This is not blocking 00417 */ 00418 int 00419 ReadAnisotropicAMRHierarchyHDF5(HDF5Handle& handle, 00420 Vector<DisjointBoxLayout>& a_vectGrids, 00421 Vector<LevelData<FArrayBox>* > & a_vectData, 00422 Vector<string>& a_vectNames, 00423 Box& a_domain, 00424 RealVect& a_dx, 00425 Real& a_dt, 00426 Real& a_time, 00427 Vector<IntVect>& a_refRatio, 00428 int& a_numLevels); 00429 00430 /// 00431 /** 00432 Reads hierarchy of levels in ANISOTROPIC HDF5 format. Only available if the 00433 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00434 00435 {\bf Arguments:}\\ 00436 filename : file to input from.\\ 00437 a_vectGrids : grids at each level.\\ 00438 a_vectData : data at each level.\\ 00439 a_domain : domain at coarsest level.\\ 00440 a_vectRatio : refinement ratio at all levels 00441 (ith entry is refinement ratio between levels i and i + 1).\\ 00442 a_numLevels : number of levels to read.\\ 00443 00444 {\bf Returns:} \\ 00445 status code with values:\\ 00446 0: success \\ 00447 -1: bogus number of levels \\ 00448 -2: bogus number of components \\ 00449 -3: error in readlevel \\ 00450 -4: file open failed \\ 00451 This is blocking. 00452 */ 00453 int 00454 ReadAnisotropicAMRHierarchyHDF5(const string& filename, 00455 Vector<DisjointBoxLayout>& a_vectGrids, 00456 Vector<LevelData<FArrayBox>* > & a_vectData, 00457 Box& a_domain, 00458 Vector<IntVect>& a_refRatio, 00459 int& a_numLevels); 00460 00461 /// 00462 /** 00463 Reads hierarchy of levels in HDF5 format. Only available if the 00464 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00465 00466 {\bf Arguments:}\\ 00467 handle : handle to input from.\\ 00468 a_vectGrids : grids at each level.\\ 00469 a_vectData : data at each level.\\ 00470 a_domain : domain at coarsest level.\\ 00471 a_vectRatio : refinement ratio at all levels 00472 (ith entry is refinement ratio between levels i and i + 1).\\ 00473 a_numLevels : number of levels to read.\\ 00474 00475 {\bf Returns:} \\ 00476 status code with values:\\ 00477 0: success \\ 00478 -1: bogus number of levels \\ 00479 -2: bogus number of components \\ 00480 -3: error in readlevel \\ 00481 -4: file open failed \\ 00482 This is not blocking. 00483 */ 00484 int 00485 ReadAnisotropicAMRHierarchyHDF5(HDF5Handle& handle, 00486 Vector<DisjointBoxLayout>& a_vectGrids, 00487 Vector<LevelData<FArrayBox>* > & a_vectData, 00488 Box& a_domain, 00489 Vector<IntVect>& a_refRatio, 00490 int& a_numLevels); 00491 00492 #endif 00493 00494 /// 00495 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00496 and then running VisIt with a python script which brings up a data 00497 browser by default. The file created uses the Boxes that underlie the 00498 IntVectSet. If a_domain is 0, then the domain used in the file is the 00499 minBox of a_dataPtr. 00500 */ 00501 void viewIVS(const IntVectSet* a_dataPtr); 00502 00503 /// 00504 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00505 and then running VisIt with a python script which brings up a data 00506 browser by default. If a_domain is 0, then the domain used in the file is the 00507 minBox of a_dataPtr. 00508 */ 00509 void viewVectorBox(const Vector<Box>* a_dataPtr); 00510 00511 /// 00512 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but 00513 for a FArrayBox. This is useful for debugging. *a_dataPtr is written 00514 to a file named fab.hdf5 00515 */ 00516 void writeFAB(const FArrayBox* a_dataPtr); 00517 00518 /// 00519 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00520 and then running VisIt with a python script which brings up a data 00521 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00522 but for a single FArrayBox. This is useful for debugging. 00523 */ 00524 void viewFAB(const FArrayBox* a_dataPtr); 00525 00526 /// 00527 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00528 */ 00529 void viewBFI(const BaseFab<int>* a_dataPtr); 00530 00531 /// 00532 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00533 */ 00534 void viewBFIV(const BaseFab<IntVect>* a_dataPtr); 00535 00536 /// 00537 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00538 */ 00539 void viewBFRV(const BaseFab<RealVect>* a_dataPtr); 00540 00541 /// 00542 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00543 */ 00544 void viewIVSFAB(const IVSFAB<Real>* a_dataPtr); 00545 00546 /// 00547 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00548 */ 00549 void viewIVSFABI(const IVSFAB<int>* a_dataPtr); 00550 00551 /// 00552 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00553 */ 00554 void viewIVSFABIV(const IVSFAB<IntVect>* a_dataPtr); 00555 00556 /// 00557 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00558 */ 00559 void viewIVSFABRV(const IVSFAB<RealVect>* a_dataPtr); 00560 00561 /// 00562 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox. 00563 */ 00564 void viewCFAB(const CFArrayBox* a_dataPtr); 00565 00566 /// 00567 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00568 and then running chombobrowser with a python script which brings up a data 00569 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00570 but for a single FArrayBox. This is useful for debugging. 00571 */ 00572 void browseFAB(const FArrayBox* a_dataPtr); 00573 00574 /// 00575 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but 00576 for a BaseFab<Real>. This is useful for debugging. *a_dataPtr is written 00577 to a file named fab.hdf5 00578 */ 00579 void 00580 writeBFR(const BaseFab<Real>* a_dataPtr); 00581 00582 /// 00583 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00584 and then running VisIt with a python script which brings up a data 00585 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00586 but for a single BaseFab<Real>. This is useful for debugging. 00587 */ 00588 void 00589 viewBFR(const BaseFab<Real>* a_dataPtr); 00590 00591 /// 00592 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but 00593 for a FArrayBox. This is useful for debugging. *a_dataPtr is written 00594 to the file given by a_filename. If a non-empty Vector of strings is 00595 given, they are used as the component names in the HDF5 header; else 00596 the names are set to "component_0", "component_1", .... 00597 */ 00598 void 00599 writeFABname(const FArrayBox * a_dataPtr, 00600 const char * a_filename, 00601 const Vector<string> & a_compNames = Vector<string>(), 00602 const Real & a_dx = 1.0); 00603 /// 00604 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but 00605 for a CFArrayBox. This is useful for debugging. *a_dataPtr is written 00606 to the file given by a_filename. It has two components named "real" 00607 and "imaginary" 00608 */ 00609 void 00610 writeCFABname(const CFArrayBox * a_dataPtr, 00611 const char * a_filename); 00612 /// 00613 /** View a modified version of *a_dataPtr where the data are set to zero 00614 on the grids of *a_dataFinePtr coarsened by a_refRatio. 00615 Write the results to an HDF5 plotfile (to a temporary file) 00616 and then run VisIt with a python script which brings up a data 00617 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00618 but for a single LevelData<FArrayBox>. This is useful for debugging. 00619 */ 00620 void 00621 viewLevelNoFine(const LevelData<FArrayBox>* a_dataPtr, 00622 const LevelData<FArrayBox>* a_dataFinePtr, 00623 int a_refRatio); 00624 00625 /// 00626 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but 00627 for a single LevelData<FArrayBox>. Useful for debugging. *a_dataPtr is 00628 written to a file named LDF.hdf5. 00629 */ 00630 void 00631 writeLevel(const LevelData<FArrayBox>* a_dataPtr); 00632 00633 /// 00634 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00635 and then running VisIt with a python script which brings up a data 00636 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00637 but for a single LevelData<FArrayBox>. This is useful for debugging. 00638 */ 00639 void 00640 viewLevel(const LevelData<FArrayBox>* a_dataPtr); 00641 00642 /// 00643 /** View fluxBoxes stored by *a_dataPtr by writing them to an HDF5 plotfile (to a temporary file) 00644 and then running VisIt with a python script which brings up a data 00645 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00646 but for a single LevelData<FArrayBox>. This is useful for debugging. 00647 NOTE: the components of \a a_dataPtr are stored in dimension-major order. 00648 */ 00649 void 00650 viewFluxLevel(const LevelData<FluxBox>* a_dataPtr); 00651 00652 /// 00653 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00654 and then running VisIt with a python script which brings up a data 00655 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00656 but for a single LevelData<FArrayBox>. This is useful for debugging. 00657 */ 00658 void 00659 browseLevel(const LevelData<FArrayBox>* a_dataPtr); 00660 00661 /// 00662 /** View *a_dataPtr by writing only the interior values (no ghost cell 00663 values) to an HDF5 plotfile (to a temporary file) 00664 and then running VisIt with a python script which brings up a data 00665 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00666 but for a single LevelData<FArrayBox>. This is useful for debugging. 00667 */ 00668 void 00669 viewLevelNoGhost(const LevelData<FArrayBox>* a_dataPtr); 00670 00671 /// 00672 /** View the multilevel dataset *a_dataPtr by writing a to an (temporary) 00673 HDF5 plotfile using the same format as WriteAMRHierarchyHDF5, 00674 for a Vector<LevelData<FArrayBox>*>, and then running VisIt from a 00675 python script to look at the data. Useful for debugging. 00676 */ 00677 void 00678 viewVectorLevel(const Vector<LevelData<FArrayBox>*>* a_dataPtr, 00679 const Vector<int>* a_refRatios); 00680 00681 /// 00682 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but 00683 for a single LevelData<FArrayBox>. Useful for debugging. *a_dataPtr is 00684 written to the file given by a_filename. 00685 */ 00686 void 00687 writeLevelname(const LevelData<FArrayBox>* a_dataPtr, 00688 const char* a_filename); 00689 00690 /// 00691 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but 00692 for a Vector<LevelData<FArrayBox>*>. Useful for debugging. *a_dataPtr is 00693 written to the file given by a_filename. 00694 */ 00695 void 00696 writeVectorLevelName(const Vector<LevelData<FArrayBox>*>* a_dataPtr, 00697 const Vector<int>* a_refRatios, 00698 const char* a_filename); 00699 00700 /// 00701 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but 00702 for a single DisjointBoxLayout (do this by creating a LevelData<FArrayBox> 00703 and then calling writeLevel. Useful for debugging. *a_dataPtr is 00704 written to a file named DBL.hdf5. 00705 */ 00706 void 00707 writeDBL(const DisjointBoxLayout* a_dataPtr); 00708 00709 /// 00710 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00711 and then running VisIt with a python script which brings up a data 00712 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00713 but for a single DisjointBoxLayout (do this by creating a 00714 LevelData<FArrayBox> and then calling writeLevel. This is useful 00715 for debugging. 00716 */ 00717 void 00718 viewDBL(const DisjointBoxLayout* a_dataPtr); 00719 00720 /// 00721 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file) 00722 and then running VisIt with a python script which brings up a data 00723 browser by default. The file has the same format as WriteAMRHierarchyHDF5, 00724 but for a single LevelData<BaseFab<int> >. This is useful for debugging. 00725 */ 00726 void 00727 viewLevelBFI(const LevelData<BaseFab<int> >* a_dataPtr); 00728 00729 void writeCopier(const Copier* a_copier); 00730 00731 void viewCopier(const Copier* a_copier); 00732 00733 /// 00734 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but 00735 for a single DisjointBoxLayout (do this by creating a LevelData<FArrayBox> 00736 and then calling writeLevel. Useful for debugging. *a_dataPtr is 00737 written to the file given by a_filename. 00738 */ 00739 void 00740 writeDBLname(const DisjointBoxLayout* a_dataPtr, 00741 const char* a_filename); 00742 00743 /// 00744 /** Write a plotfile with levels that don't necessarily begin with 00745 0 (will translate things so that lBase comes out as level 0, etc) 00746 Levels in Vector arguments should correspond with actual levels. 00747 (and so should be defined for a_levels.begin() through a_levels.end(). 00748 {\bf Arguments:}\\ 00749 filename : file to output to.\\ 00750 a_vectGrids : grids at each level.\\ 00751 a_vectData : data at each level.\\ 00752 a_vectNames: names of variables.\\ 00753 a_domain : domain at base level (given by a_levels.begin()).\\ 00754 a_dx : grid spacing at base level.\\ 00755 a_dt : time step at base level.\\ 00756 a_time : time.\\ 00757 a_vectRatio : refinement ratio at all levels 00758 (ith entry is refinement ratio between levels i and i + 1).\\ 00759 a_numLevels : number of levels to output.\\ 00760 This is blocking. 00761 00762 */ 00763 void 00764 WritePartialAMRHierarchyHDF5(const string& filename, 00765 const Vector<DisjointBoxLayout>& a_vectGrids, 00766 const Vector<LevelData<FArrayBox>* > & a_vectData, 00767 const Vector<string>& a_vectNames, 00768 const Box& a_baseDomain, 00769 const Real& a_baseDx, 00770 const Real& a_dt, 00771 const Real& a_time, 00772 const Vector<int>& a_vectRatio, 00773 const Interval& a_levels); 00774 00775 #endif // CH_USE_HDF5 00776 00777 #include "NamespaceFooter.H" 00778 00779 #endif