Chombo + EB  3.2
AMRIO.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 // DTGraves, Fri, Dec 3, 1999
12 
13 #ifndef _AMRIO_H_
14 #define _AMRIO_H_
15 
16 #include "REAL.H"
17 
18 #ifndef WRAPPER
19 #include "LevelData.H"
20 #include "REAL.H"
21 #include "Vector.H"
22 #include "FArrayBox.H"
23 #include "CFArrayBox.H"
24 #include "FluxBox.H"
25 #include "IntVectSet.H"
26 #include "IVSFAB.H"
27 #include "RealVect.H"
28 #include <string>
29 #include "NamespaceHeader.H"
30 using std::string;
31 using std::istream;
32 #endif
33 
34 #ifdef CH_USE_HDF5
35 ///
36 /**
37  Writes hierarchy of levels in HDF5 format. Only available if the
38  preprocessor macro HDF5 is defined at compilation.
39 
40  {\bf Arguments:}\\
41  filename : file to output to.\\
42  a_vectGrids : grids at each level.\\
43  a_vectData : data at each level.\\
44  a_vectNames: names of variables.\\
45  a_domain : domain at coarsest level.\\
46  a_dx : grid spacing at coarsest level.\\
47  a_dt : time step at coarsest level.\\
48  a_time : time.\\
49  a_vectRatio : refinement ratio at all levels
50  (ith entry is refinement ratio between levels i and i + 1).\\
51  a_numLevels : number of levels to output.\\
52 This is blocking.
53 
54 */
55 void
56 WriteAMRHierarchyHDF5(const string& filename,
57  const Vector<DisjointBoxLayout>& a_vectGrids,
58  const Vector<LevelData<FArrayBox>* > & a_vectData,
59  const Vector<string>& a_vectNames,
60  const Box& a_domain,
61  const Real& a_dx,
62  const Real& a_dt,
63  const Real& a_time,
64  const Vector<int>& a_vectRatio,
65  const int& a_numLevels);
66 
67 ///
68 /**
69  Writes hierarchy of levels in HDF5 format. Only available if the
70  preprocessor macro HDF5 is defined at compilation.
71 
72  {\bf Arguments:}\\
73  filename : file to output to.\\
74  a_vectGrids : grids at each level.\\
75  a_vectData : data at each level.\\
76  a_vectNames: names of variables.\\
77  a_domain : domain at coarsest level.\\
78  a_dx : grid spacing in each direction at coarsest level.\\
79  a_dt : time step at coarsest level.\\
80  a_time : time.\\
81  a_vectRatio : refinement ratio in each direction at all levels
82  (ith entry is refinement ratio in each direction between levels i and i + 1).\\
83  a_numLevels : number of levels to output.\\
84 This is blocking.
85 
86 */
87 void
89  const string& filename,
90  const Vector<DisjointBoxLayout>& a_vectGrids,
91  const Vector<LevelData<FArrayBox>* > & a_vectData,
92  const Vector<string>& a_vectNames,
93  const Box& a_domain,
94  const RealVect& a_dx,
95  const Real& a_dt,
96  const Real& a_time,
97  const Vector<IntVect>& a_vectRatios,
98  const int& a_numLevels);
99 
100 ///
101 /**
102  Writes hierarchy of levels in HDF5 format. Only available if the
103  preprocessor macro HDF5 is defined at compilation.
104 
105  {\bf Arguments:}\\
106 handle : handle to output to.\\
107  a_vectGrids : grids at each level.\\
108  a_vectData : data at each level.\\
109  a_vectNames: names of variables.\\
110  a_domain : domain at coarsest level.\\
111  a_dx : grid spacing at coarsest level.\\
112  a_dt : time step at coarsest level.\\
113  a_time : time.\\
114  a_vectRatio : refinement ratio at all levels
115  (ith entry is refinement ratio between levels i and i + 1).\\
116  a_numLevels : number of levels to output.\\
117 This is not blocking.
118 
119 */
120 void
122  const Vector<DisjointBoxLayout>& a_vectGrids,
123  const Vector<LevelData<FArrayBox>* > & a_vectData,
124  const Vector<string>& a_vectNames,
125  const Box& a_domain,
126  const Real& a_dx,
127  const Real& a_dt,
128  const Real& a_time,
129  const Vector<int>& a_vectRatio,
130  const int& a_numLevels);
131 
132 //
133 /**
134  Writes hierarchy of levels in HDF5 format. Only available if the
135  preprocessor macro HDF5 is defined at compilation.
136 
137  {\bf Arguments:}\\
138 handle : handle to output to.\\
139  a_vectGrids : grids at each level.\\
140  a_vectData : data at each level.\\
141  a_vectNames: names of variables.\\
142  a_domain : domain at coarsest level.\\
143  a_dx : grid spacing in each direction at coarsest level.\\
144  a_dt : time step at coarsest level.\\
145  a_time : time.\\
146  a_vectRatio : refinement ratio in each direction at all levels
147  (ith entry is refinement ratio between levels i and i + 1).\\
148  a_numLevels : number of levels to output.\\
149 This is not blocking.
150 
151 */
152 void
154  HDF5Handle& handle,
155  const Vector<DisjointBoxLayout>& a_vectGrids,
156  const Vector<LevelData<FArrayBox>* > & a_vectData,
157  const Vector<string>& a_vectNames,
158  const Box& a_domain,
159  const RealVect& a_dx,
160  const Real& a_dt,
161  const Real& a_time,
162  const Vector<IntVect>& a_vectRatios,
163  const int& a_numLevels);
164 
165 ///
166 /**
167  Writes hierarchy of levels in HDF5 format. Only available if the
168  preprocessor macro HDF5 is defined at compilation.
169 
170  {\bf Arguments:}\\
171  filename : file to output to.\\
172  a_vectGrids : grids at each level.\\
173  a_vectData : data at each level.\\
174  a_domain : domain at coarsest level.\\
175  a_vectRatio : refinement ratio at all levels
176  (ith entry is refinement ratio between levels i and i + 1).\\
177  a_numLevels : number of levels to output.\\
178 This is blocking.
179 */
180 void
181 WriteAMRHierarchyHDF5(const string& filename,
182  const Vector<DisjointBoxLayout>& a_vectGrids,
183  const Vector<LevelData<FArrayBox>* > & a_vectData,
184  const Box& a_domain,
185  const Vector<int>& a_vectRatio,
186  const int& a_numLevels);
187 
188 ///
189 /**
190  Writes hierarchy of levels in HDF5 format. Only available if the
191  preprocessor macro HDF5 is defined at compilation.
192 
193  {\bf Arguments:}\\
194  handle : handle to output to.\\
195  a_vectGrids : grids at each level.\\
196  a_vectData : data at each level.\\
197  a_domain : domain at coarsest level.\\
198  a_vectRatio : refinement ratio at all levels
199  (ith entry is refinement ratio between levels i and i + 1).\\
200  a_numLevels : number of levels to output.\\
201 This is not blocking.
202 */
203 void
205  const Vector<DisjointBoxLayout>& a_vectGrids,
206  const Vector<LevelData<FArrayBox>* > & a_vectData,
207  const Box& a_domain,
208  const Vector<int>& a_vectRatio,
209  const int& a_numLevels);
210 
211 #ifndef WRAPPER
212 ///
213 /**
214  Reads hierarchy of levels in HDF5 format. Only available if the
215  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
216 
217  {\bf Arguments:}\\
218 filename : file to input from.\\
219 a_vectGrids : grids at each level.\\
220 a_vectData : data at each level.\\
221 a_vectNames: names of variables.\\
222 a_domain : domain at coarsest level.\\
223 a_dx : grid spacing at coarsest level.\\
224 a_dt : time step at coarsest level.\\
225 a_time : time.\\
226 a_vectRatio : refinement ratio at all levels
227 (ith entry is refinement ratio between levels i and i + 1).\\
228 a_numLevels : number of levels to read.\\
229 
230 {\bf Returns:} \\
231 status code with values:\\
232 0: success \\
233 -1: bogus number of levels \\
234 -2: bogus number of components \\
235 -3: error in readlevel \\
236 -4: file open failed \\
237 This is blocking
238 */
239 int
240 ReadAMRHierarchyHDF5(const string& filename,
241  Vector<DisjointBoxLayout>& a_vectGrids,
242  Vector<LevelData<FArrayBox>* > & a_vectData,
243  Vector<string>& a_vectNames,
244  Box& a_domain,
245  Real& a_dx,
246  Real& a_dt,
247  Real& a_time,
248  Vector<int>& a_refRatio,
249  int& a_numLevels);
250 
251 ///
252 /**
253  Reads hierarchy of levels in HDF5 format. Only available if the
254  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
255 
256  {\bf Arguments:}\\
257 handle : handle to input from.\\
258 a_vectGrids : grids at each level.\\
259 a_vectData : data at each level.\\
260 a_vectNames: names of variables.\\
261 a_domain : domain at coarsest level.\\
262 a_dx : grid spacing at coarsest level.\\
263 a_dt : time step at coarsest level.\\
264 a_time : time.\\
265 a_vectRatio : refinement ratio at all levels
266 (ith entry is refinement ratio between levels i and i + 1).\\
267 a_numLevels : number of levels to read.\\
268 
269 {\bf Returns:} \\
270 status code with values:\\
271 0: success \\
272 -1: bogus number of levels \\
273 -2: bogus number of components \\
274 -3: error in readlevel \\
275 -4: file open failed \\
276 This is not blocking
277 */
278 int
280  Vector<DisjointBoxLayout>& a_vectGrids,
281  Vector<LevelData<FArrayBox>* > & a_vectData,
282  Vector<string>& a_vectNames,
283  Box& a_domain,
284  Real& a_dx,
285  Real& a_dt,
286  Real& a_time,
287  Vector<int>& a_refRatio,
288  int& a_numLevels);
289 
290 ///
291 /**
292  Reads hierarchy of levels in HDF5 format. Only available if the
293  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
294 
295  {\bf Arguments:}\\
296 filename : file to input from.\\
297 a_vectGrids : grids at each level.\\
298 a_vectData : data at each level.\\
299 a_domain : domain at coarsest level.\\
300 a_vectRatio : refinement ratio at all levels
301 (ith entry is refinement ratio between levels i and i + 1).\\
302 a_numLevels : number of levels to read.\\
303 
304 {\bf Returns:} \\
305 status code with values:\\
306 0: success \\
307 -1: bogus number of levels \\
308 -2: bogus number of components \\
309 -3: error in readlevel \\
310 -4: file open failed \\
311 This is blocking.
312 */
313 int
314 ReadAMRHierarchyHDF5(const string& filename,
315  Vector<DisjointBoxLayout>& a_vectGrids,
316  Vector<LevelData<FArrayBox>* > & a_vectData,
317  Box& a_domain,
318  Vector<int>& a_refRatio,
319  int& a_numLevels);
320 
321 ///
322 /**
323  Reads hierarchy of levels in HDF5 format. Only available if the
324  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
325 
326  {\bf Arguments:}\\
327 handle : handle to input from.\\
328 a_vectGrids : grids at each level.\\
329 a_vectData : data at each level.\\
330 a_domain : domain at coarsest level.\\
331 a_vectRatio : refinement ratio at all levels
332 (ith entry is refinement ratio between levels i and i + 1).\\
333 a_numLevels : number of levels to read.\\
334 
335 {\bf Returns:} \\
336 status code with values:\\
337 0: success \\
338 -1: bogus number of levels \\
339 -2: bogus number of components \\
340 -3: error in readlevel \\
341 -4: file open failed \\
342 This is not blocking.
343 */
344 int
346  Vector<DisjointBoxLayout>& a_vectGrids,
347  Vector<LevelData<FArrayBox>* > & a_vectData,
348  Box& a_domain,
349  Vector<int>& a_refRatio,
350  int& a_numLevels);
351 
352 ///
353 /**
354  Reads hierarchy of levels in ANISOTROPIC HDF5 format. Only available if the
355  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
356 
357  {\bf Arguments:}\\
358 filename : file to input from.\\
359 a_vectGrids : grids at each level.\\
360 a_vectData : data at each level.\\
361 a_vectNames: names of variables.\\
362 a_domain : domain at coarsest level.\\
363 a_dx : grid spacing at coarsest level.\\
364 a_dt : time step at coarsest level.\\
365 a_time : time.\\
366 a_vectRatio : refinement ratio at all levels
367 (ith entry is refinement ratio between levels i and i + 1).\\
368 a_numLevels : number of levels to read.\\
369 
370 {\bf Returns:} \\
371 status code with values:\\
372 0: success \\
373 -1: bogus number of levels \\
374 -2: bogus number of components \\
375 -3: error in readlevel \\
376 -4: file open failed \\
377 This is blocking
378 */
379 int
380 ReadAnisotropicAMRHierarchyHDF5(const string& filename,
381  Vector<DisjointBoxLayout>& a_vectGrids,
382  Vector<LevelData<FArrayBox>* > & a_vectData,
383  Vector<string>& a_vectNames,
384  Box& a_domain,
385  RealVect& a_dx,
386  Real& a_dt,
387  Real& a_time,
388  Vector<IntVect>& a_refRatio,
389  int& a_numLevels);
390 
391 ///
392 /**
393  Reads hierarchy of levels in ANISOTROPIC HDF5 format. Only available if the
394  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
395 
396  {\bf Arguments:}\\
397 handle : handle to input from.\\
398 a_vectGrids : grids at each level.\\
399 a_vectData : data at each level.\\
400 a_vectNames: names of variables.\\
401 a_domain : domain at coarsest level.\\
402 a_dx : grid spacing at coarsest level.\\
403 a_dt : time step at coarsest level.\\
404 a_time : time.\\
405 a_vectRatio : refinement ratio at all levels
406 (ith entry is refinement ratio between levels i and i + 1).\\
407 a_numLevels : number of levels to read.\\
408 
409 {\bf Returns:} \\
410 status code with values:\\
411 0: success \\
412 -1: bogus number of levels \\
413 -2: bogus number of components \\
414 -3: error in readlevel \\
415 -4: file open failed \\
416 This is not blocking
417 */
418 int
420  Vector<DisjointBoxLayout>& a_vectGrids,
421  Vector<LevelData<FArrayBox>* > & a_vectData,
422  Vector<string>& a_vectNames,
423  Box& a_domain,
424  RealVect& a_dx,
425  Real& a_dt,
426  Real& a_time,
427  Vector<IntVect>& a_refRatio,
428  int& a_numLevels);
429 
430 ///
431 /**
432  Reads hierarchy of levels in ANISOTROPIC HDF5 format. Only available if the
433  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
434 
435  {\bf Arguments:}\\
436 filename : file to input from.\\
437 a_vectGrids : grids at each level.\\
438 a_vectData : data at each level.\\
439 a_domain : domain at coarsest level.\\
440 a_vectRatio : refinement ratio at all levels
441 (ith entry is refinement ratio between levels i and i + 1).\\
442 a_numLevels : number of levels to read.\\
443 
444 {\bf Returns:} \\
445 status code with values:\\
446 0: success \\
447 -1: bogus number of levels \\
448 -2: bogus number of components \\
449 -3: error in readlevel \\
450 -4: file open failed \\
451 This is blocking.
452 */
453 int
454 ReadAnisotropicAMRHierarchyHDF5(const string& filename,
455  Vector<DisjointBoxLayout>& a_vectGrids,
456  Vector<LevelData<FArrayBox>* > & a_vectData,
457  Box& a_domain,
458  Vector<IntVect>& a_refRatio,
459  int& a_numLevels);
460 
461 ///
462 /**
463  Reads hierarchy of levels in HDF5 format. Only available if the
464  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
465 
466  {\bf Arguments:}\\
467 handle : handle to input from.\\
468 a_vectGrids : grids at each level.\\
469 a_vectData : data at each level.\\
470 a_domain : domain at coarsest level.\\
471 a_vectRatio : refinement ratio at all levels
472 (ith entry is refinement ratio between levels i and i + 1).\\
473 a_numLevels : number of levels to read.\\
474 
475 {\bf Returns:} \\
476 status code with values:\\
477 0: success \\
478 -1: bogus number of levels \\
479 -2: bogus number of components \\
480 -3: error in readlevel \\
481 -4: file open failed \\
482 This is not blocking.
483 */
484 int
486  Vector<DisjointBoxLayout>& a_vectGrids,
487  Vector<LevelData<FArrayBox>* > & a_vectData,
488  Box& a_domain,
489  Vector<IntVect>& a_refRatio,
490  int& a_numLevels);
491 
492 #endif
493 
494 ///
495 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
496  and then running VisIt with a python script which brings up a data
497  browser by default. The file created uses the Boxes that underlie the
498  IntVectSet. If a_domain is 0, then the domain used in the file is the
499  minBox of a_dataPtr.
500 */
501 void viewIVS(const IntVectSet* a_dataPtr);
502 
503 ///
504 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
505  and then running VisIt with a python script which brings up a data
506  browser by default. If a_domain is 0, then the domain used in the file is the
507  minBox of a_dataPtr.
508 */
509 void viewVectorBox(const Vector<Box>* a_dataPtr);
510 
511 ///
512 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but
513  for a FArrayBox. This is useful for debugging. *a_dataPtr is written
514  to a file named fab.hdf5
515 */
516 void writeFAB(const FArrayBox* a_dataPtr);
517 
518 ///
519 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
520  and then running VisIt with a python script which brings up a data
521  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
522  but for a single FArrayBox. This is useful for debugging.
523 */
524 void viewFAB(const FArrayBox* a_dataPtr);
525 
526 ///
527 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
528 */
529 void viewBFI(const BaseFab<int>* a_dataPtr);
530 
531 ///
532 /** Make a copy of *a_dataPtr as FArrayBox, then write to a_filename.
533 */
534 void writeBFCname(const BaseFab<char>* a_dataPtr,
535  const char* a_filename);
536 
537 ///
538 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
539 */
540 void viewBFIV(const BaseFab<IntVect>* a_dataPtr);
541 
542 ///
543 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
544 */
545 void viewBFRV(const BaseFab<RealVect>* a_dataPtr);
546 
547 ///
548 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
549 */
550 void viewIVSFAB(const IVSFAB<Real>* a_dataPtr);
551 
552 ///
553 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
554 */
555 void viewIVSFABI(const IVSFAB<int>* a_dataPtr);
556 
557 ///
558 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
559 */
560 void viewIVSFABIV(const IVSFAB<IntVect>* a_dataPtr);
561 
562 ///
563 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
564 */
565 void viewIVSFABRV(const IVSFAB<RealVect>* a_dataPtr);
566 
567 ///
568 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
569 */
570 void viewCFAB(const CFArrayBox* a_dataPtr);
571 
572 ///
573 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
574  and then running chombobrowser with a python script which brings up a data
575  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
576  but for a single FArrayBox. This is useful for debugging.
577 */
578 void browseFAB(const FArrayBox* a_dataPtr);
579 
580 ///
581 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but
582  for a BaseFab<Real>. This is useful for debugging. *a_dataPtr is written
583  to a file named fab.hdf5
584 */
585 void
586 writeBFR(const BaseFab<Real>* a_dataPtr);
587 
588 void
589 writeBFRname(const BaseFab<Real>* a_dataPtr,
590  const char* a_filename);
591 
592 ///
593 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
594  and then running VisIt with a python script which brings up a data
595  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
596  but for a single BaseFab<Real>. This is useful for debugging.
597 */
598 void
599 viewBFR(const BaseFab<Real>* a_dataPtr);
600 
601 ///
602 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but
603  for a FArrayBox. This is useful for debugging. *a_dataPtr is written
604  to the file given by a_filename. If a non-empty Vector of strings is
605  given, they are used as the component names in the HDF5 header; else
606  the names are set to "component_0", "component_1", ....
607 */
608 void
609 writeFABname(const FArrayBox * a_dataPtr,
610  const char * a_filename,
611  const Vector<string> & a_compNames = Vector<string>(),
612  const Real & a_dx = 1.0);
613 ///
614 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but
615  for a CFArrayBox. This is useful for debugging. *a_dataPtr is written
616  to the file given by a_filename. It has two components named "real"
617  and "imaginary"
618 */
619 void
620 writeCFABname(const CFArrayBox * a_dataPtr,
621  const char * a_filename);
622 ///
623 /** View a modified version of *a_dataPtr where the data are set to zero
624  on the grids of *a_dataFinePtr coarsened by a_refRatio.
625  Write the results to an HDF5 plotfile (to a temporary file)
626  and then run VisIt with a python script which brings up a data
627  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
628  but for a single LevelData<FArrayBox>. This is useful for debugging.
629 */
630 void
631 viewLevelNoFine(const LevelData<FArrayBox>* a_dataPtr,
632  const LevelData<FArrayBox>* a_dataFinePtr,
633  int a_refRatio);
634 
635 ///
636 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
637  for a single LevelData<FArrayBox>. Useful for debugging. *a_dataPtr is
638  written to a file named LDF.hdf5.
639 */
640 void
641 writeLevel(const LevelData<FArrayBox>* a_dataPtr);
642 
643 ///
644 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
645  and then running VisIt with a python script which brings up a data
646  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
647  but for a single LevelData<FArrayBox>. This is useful for debugging.
648 */
649 void
650 viewLevel(const LevelData<FArrayBox>* a_dataPtr);
651 
652 ///
653 /** View fluxBoxes stored by *a_dataPtr by writing them to an HDF5 plotfile (to a temporary file)
654  and then running VisIt with a python script which brings up a data
655  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
656  but for a single LevelData<FArrayBox>. This is useful for debugging.
657  NOTE: the components of \a a_dataPtr are stored in dimension-major order.
658 */
659 void
660 viewFluxLevel(const LevelData<FluxBox>* a_dataPtr);
661 
662 ///
663 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
664  and then running VisIt with a python script which brings up a data
665  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
666  but for a single LevelData<FArrayBox>. This is useful for debugging.
667 */
668 void
669 browseLevel(const LevelData<FArrayBox>* a_dataPtr);
670 
671 ///
672 /** View *a_dataPtr by writing only the interior values (no ghost cell
673  values) to an HDF5 plotfile (to a temporary file)
674  and then running VisIt with a python script which brings up a data
675  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
676  but for a single LevelData<FArrayBox>. This is useful for debugging.
677 */
678 void
679 viewLevelNoGhost(const LevelData<FArrayBox>* a_dataPtr);
680 
681 ///
682 /** View the multilevel dataset *a_dataPtr by writing a to an (temporary)
683  HDF5 plotfile using the same format as WriteAMRHierarchyHDF5,
684  for a Vector<LevelData<FArrayBox>*>, and then running VisIt from a
685  python script to look at the data. Useful for debugging.
686 */
687 void
688 viewVectorLevel(const Vector<LevelData<FArrayBox>*>* a_dataPtr,
689  const Vector<int>* a_refRatios);
690 
691 ///
692 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
693  for a single LevelData<FArrayBox>. Useful for debugging. *a_dataPtr is
694  written to the file given by a_filename.
695 */
696 void
697 writeLevelname(const LevelData<FArrayBox>* a_dataPtr,
698  const char* a_filename);
699 
700 ///
701 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
702  for a Vector<LevelData<FArrayBox>*>. Useful for debugging. *a_dataPtr is
703  written to the file given by a_filename.
704 */
705 void
707  const Vector<int>* a_refRatios,
708  const char* a_filename);
709 
710 ///
711 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
712  for a single DisjointBoxLayout (do this by creating a LevelData<FArrayBox>
713  and then calling writeLevel. Useful for debugging. *a_dataPtr is
714  written to a file named DBL.hdf5.
715 */
716 void
717 writeDBL(const DisjointBoxLayout* a_dataPtr);
718 
719 ///
720 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
721  and then running VisIt with a python script which brings up a data
722  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
723  but for a single DisjointBoxLayout (do this by creating a
724  LevelData<FArrayBox> and then calling writeLevel. This is useful
725  for debugging.
726 */
727 void
728 viewDBL(const DisjointBoxLayout* a_dataPtr);
729 
730 ///
731 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
732  and then running VisIt with a python script which brings up a data
733  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
734  but for a single LevelData<BaseFab<int> >. This is useful for debugging.
735 */
736 void
737 viewLevelBFI(const LevelData<BaseFab<int> >* a_dataPtr);
738 
739 void writeCopier(const Copier* a_copier);
740 
741 void viewCopier(const Copier* a_copier);
742 
743 ///
744 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
745  for a single DisjointBoxLayout (do this by creating a LevelData<FArrayBox>
746  and then calling writeLevel. Useful for debugging. *a_dataPtr is
747  written to the file given by a_filename.
748 */
749 void
750 writeDBLname(const DisjointBoxLayout* a_dataPtr,
751  const char* a_filename);
752 
753 ///
754 /** Write a plotfile with levels that don't necessarily begin with
755 0 (will translate things so that lBase comes out as level 0, etc)
756 Levels in Vector arguments should correspond with actual levels.
757 (and so should be defined for a_levels.begin() through a_levels.end().
758  {\bf Arguments:}\\
759  filename : file to output to.\\
760  a_vectGrids : grids at each level.\\
761  a_vectData : data at each level.\\
762  a_vectNames: names of variables.\\
763  a_domain : domain at base level (given by a_levels.begin()).\\
764  a_dx : grid spacing at base level.\\
765  a_dt : time step at base level.\\
766  a_time : time.\\
767  a_vectRatio : refinement ratio at all levels
768  (ith entry is refinement ratio between levels i and i + 1).\\
769  a_numLevels : number of levels to output.\\
770 This is blocking.
771 
772 */
773 void
774 WritePartialAMRHierarchyHDF5(const string& filename,
775  const Vector<DisjointBoxLayout>& a_vectGrids,
776  const Vector<LevelData<FArrayBox>* > & a_vectData,
777  const Vector<string>& a_vectNames,
778  const Box& a_baseDomain,
779  const Real& a_baseDx,
780  const Real& a_dt,
781  const Real& a_time,
782  const Vector<int>& a_vectRatio,
783  const Interval& a_levels);
784 
785 #endif // CH_USE_HDF5
786 
787 #include "NamespaceFooter.H"
788 
789 #endif
void writeBFRname(const BaseFab< Real > *a_dataPtr, const char *a_filename)
void writeCopier(const Copier *a_copier)
void viewLevelNoFine(const LevelData< FArrayBox > *a_dataPtr, const LevelData< FArrayBox > *a_dataFinePtr, int a_refRatio)
void viewBFR(const BaseFab< Real > *a_dataPtr)
void viewCopier(const Copier *a_copier)
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
void viewCFAB(const CFArrayBox *a_dataPtr)
void viewLevelNoGhost(const LevelData< FArrayBox > *a_dataPtr)
void writeFAB(const FArrayBox *a_dataPtr)
void writeBFCname(const BaseFab< char > *a_dataPtr, const char *a_filename)
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:145
void writeDBL(const DisjointBoxLayout *a_dataPtr)
void viewIVSFAB(const IVSFAB< Real > *a_dataPtr)
void viewBFI(const BaseFab< int > *a_dataPtr)
void browseLevel(const LevelData< FArrayBox > *a_dataPtr)
void writeCFABname(const CFArrayBox *a_dataPtr, const char *a_filename)
Definition: IVSFAB.H:31
void browseFAB(const FArrayBox *a_dataPtr)
void viewIVSFABI(const IVSFAB< int > *a_dataPtr)
void viewBFIV(const BaseFab< IntVect > *a_dataPtr)
Structure for passing component ranges in code.
Definition: Interval.H:23
int ReadAMRHierarchyHDF5(const string &filename, Vector< DisjointBoxLayout > &a_vectGrids, Vector< LevelData< FArrayBox > * > &a_vectData, Vector< string > &a_vectNames, Box &a_domain, Real &a_dx, Real &a_dt, Real &a_time, Vector< int > &a_refRatio, int &a_numLevels)
void writeDBLname(const DisjointBoxLayout *a_dataPtr, const char *a_filename)
void WriteAnisotropicAMRHierarchyHDF5(const string &filename, const Vector< DisjointBoxLayout > &a_vectGrids, const Vector< LevelData< FArrayBox > * > &a_vectData, const Vector< string > &a_vectNames, const Box &a_domain, const RealVect &a_dx, const Real &a_dt, const Real &a_time, const Vector< IntVect > &a_vectRatios, const int &a_numLevels)
double Real
Definition: REAL.H:33
void viewVectorBox(const Vector< Box > *a_dataPtr)
void writeFABname(const FArrayBox *a_dataPtr, const char *a_filename, const Vector< string > &a_compNames=Vector< string >(), const Real &a_dx=1.0)
void viewLevelBFI(const LevelData< BaseFab< int > > *a_dataPtr)
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
void viewIVSFABRV(const IVSFAB< RealVect > *a_dataPtr)
void viewIVSFABIV(const IVSFAB< IntVect > *a_dataPtr)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
void viewFAB(const FArrayBox *a_dataPtr)
void writeLevel(const LevelData< FArrayBox > *a_dataPtr)
void writeBFR(const BaseFab< Real > *a_dataPtr)
Handle to a particular group in an HDF file.
Definition: CH_HDF5.H:294
Definition: FArrayBox.H:45
void WritePartialAMRHierarchyHDF5(const string &filename, const Vector< DisjointBoxLayout > &a_vectGrids, const Vector< LevelData< FArrayBox > * > &a_vectData, const Vector< string > &a_vectNames, const Box &a_baseDomain, const Real &a_baseDx, const Real &a_dt, const Real &a_time, const Vector< int > &a_vectRatio, const Interval &a_levels)
void viewBFRV(const BaseFab< RealVect > *a_dataPtr)
void viewDBL(const DisjointBoxLayout *a_dataPtr)
Definition: CFArrayBox.H:38
void viewIVS(const IntVectSet *a_dataPtr)
int ReadAnisotropicAMRHierarchyHDF5(const string &filename, Vector< DisjointBoxLayout > &a_vectGrids, Vector< LevelData< FArrayBox > * > &a_vectData, Vector< string > &a_vectNames, Box &a_domain, RealVect &a_dx, Real &a_dt, Real &a_time, Vector< IntVect > &a_refRatio, int &a_numLevels)
void writeLevelname(const LevelData< FArrayBox > *a_dataPtr, const char *a_filename)
void writeVectorLevelName(const Vector< LevelData< FArrayBox > *> *a_dataPtr, const Vector< int > *a_refRatios, const char *a_filename)
void WriteAMRHierarchyHDF5(const string &filename, const Vector< DisjointBoxLayout > &a_vectGrids, const Vector< LevelData< FArrayBox > * > &a_vectData, const Vector< string > &a_vectNames, const Box &a_domain, const Real &a_dx, const Real &a_dt, const Real &a_time, const Vector< int > &a_vectRatio, const int &a_numLevels)
void viewFluxLevel(const LevelData< FluxBox > *a_dataPtr)
void viewVectorLevel(const Vector< LevelData< FArrayBox > *> *a_dataPtr, const Vector< int > *a_refRatios)
void viewLevel(const LevelData< FArrayBox > *a_dataPtr)