Chombo + EB + MF  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 call viewFAB on FArrayBox.
533 */
534 void viewBFIV(const BaseFab<IntVect>* a_dataPtr);
535 
536 ///
537 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
538 */
539 void viewBFRV(const BaseFab<RealVect>* a_dataPtr);
540 
541 ///
542 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
543 */
544 void viewIVSFAB(const IVSFAB<Real>* a_dataPtr);
545 
546 ///
547 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
548 */
549 void viewIVSFABI(const IVSFAB<int>* a_dataPtr);
550 
551 ///
552 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
553 */
554 void viewIVSFABIV(const IVSFAB<IntVect>* a_dataPtr);
555 
556 ///
557 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
558 */
559 void viewIVSFABRV(const IVSFAB<RealVect>* a_dataPtr);
560 
561 ///
562 /** Make a copy of *a_dataPtr as FArrayBox, then call viewFAB on FArrayBox.
563 */
564 void viewCFAB(const CFArrayBox* a_dataPtr);
565 
566 ///
567 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
568  and then running chombobrowser with a python script which brings up a data
569  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
570  but for a single FArrayBox. This is useful for debugging.
571 */
572 void browseFAB(const FArrayBox* a_dataPtr);
573 
574 ///
575 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but
576  for a BaseFab<Real>. This is useful for debugging. *a_dataPtr is written
577  to a file named fab.hdf5
578 */
579 void
580 writeBFR(const BaseFab<Real>* a_dataPtr);
581 
582 ///
583 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
584  and then running VisIt with a python script which brings up a data
585  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
586  but for a single BaseFab<Real>. This is useful for debugging.
587 */
588 void
589 viewBFR(const BaseFab<Real>* a_dataPtr);
590 
591 ///
592 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but
593  for a FArrayBox. This is useful for debugging. *a_dataPtr is written
594  to the file given by a_filename. If a non-empty Vector of strings is
595  given, they are used as the component names in the HDF5 header; else
596  the names are set to "component_0", "component_1", ....
597 */
598 void
599 writeFABname(const FArrayBox * a_dataPtr,
600  const char * a_filename,
601  const Vector<string> & a_compNames = Vector<string>(),
602  const Real & a_dx = 1.0);
603 ///
604 /** Writes a plotfile using the same format as WriteAMRHierarchyHDF5, but
605  for a CFArrayBox. This is useful for debugging. *a_dataPtr is written
606  to the file given by a_filename. It has two components named "real"
607  and "imaginary"
608 */
609 void
610 writeCFABname(const CFArrayBox * a_dataPtr,
611  const char * a_filename);
612 ///
613 /** View a modified version of *a_dataPtr where the data are set to zero
614  on the grids of *a_dataFinePtr coarsened by a_refRatio.
615  Write the results to an HDF5 plotfile (to a temporary file)
616  and then run VisIt with a python script which brings up a data
617  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
618  but for a single LevelData<FArrayBox>. This is useful for debugging.
619 */
620 void
621 viewLevelNoFine(const LevelData<FArrayBox>* a_dataPtr,
622  const LevelData<FArrayBox>* a_dataFinePtr,
623  int a_refRatio);
624 
625 ///
626 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
627  for a single LevelData<FArrayBox>. Useful for debugging. *a_dataPtr is
628  written to a file named LDF.hdf5.
629 */
630 void
631 writeLevel(const LevelData<FArrayBox>* a_dataPtr);
632 
633 ///
634 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
635  and then running VisIt with a python script which brings up a data
636  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
637  but for a single LevelData<FArrayBox>. This is useful for debugging.
638 */
639 void
640 viewLevel(const LevelData<FArrayBox>* a_dataPtr);
641 
642 ///
643 /** View fluxBoxes stored by *a_dataPtr by writing them to an HDF5 plotfile (to a temporary file)
644  and then running VisIt with a python script which brings up a data
645  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
646  but for a single LevelData<FArrayBox>. This is useful for debugging.
647  NOTE: the components of \a a_dataPtr are stored in dimension-major order.
648 */
649 void
650 viewFluxLevel(const LevelData<FluxBox>* a_dataPtr);
651 
652 ///
653 /** View *a_dataPtr by writing it 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 */
658 void
659 browseLevel(const LevelData<FArrayBox>* a_dataPtr);
660 
661 ///
662 /** View *a_dataPtr by writing only the interior values (no ghost cell
663  values) 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 viewLevelNoGhost(const LevelData<FArrayBox>* a_dataPtr);
670 
671 ///
672 /** View the multilevel dataset *a_dataPtr by writing a to an (temporary)
673  HDF5 plotfile using the same format as WriteAMRHierarchyHDF5,
674  for a Vector<LevelData<FArrayBox>*>, and then running VisIt from a
675  python script to look at the data. Useful for debugging.
676 */
677 void
678 viewVectorLevel(const Vector<LevelData<FArrayBox>*>* a_dataPtr,
679  const Vector<int>* a_refRatios);
680 
681 ///
682 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
683  for a single LevelData<FArrayBox>. Useful for debugging. *a_dataPtr is
684  written to the file given by a_filename.
685 */
686 void
687 writeLevelname(const LevelData<FArrayBox>* a_dataPtr,
688  const char* a_filename);
689 
690 ///
691 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
692  for a Vector<LevelData<FArrayBox>*>. Useful for debugging. *a_dataPtr is
693  written to the file given by a_filename.
694 */
695 void
697  const Vector<int>* a_refRatios,
698  const char* a_filename);
699 
700 ///
701 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
702  for a single DisjointBoxLayout (do this by creating a LevelData<FArrayBox>
703  and then calling writeLevel. Useful for debugging. *a_dataPtr is
704  written to a file named DBL.hdf5.
705 */
706 void
707 writeDBL(const DisjointBoxLayout* a_dataPtr);
708 
709 ///
710 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
711  and then running VisIt with a python script which brings up a data
712  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
713  but for a single DisjointBoxLayout (do this by creating a
714  LevelData<FArrayBox> and then calling writeLevel. This is useful
715  for debugging.
716 */
717 void
718 viewDBL(const DisjointBoxLayout* a_dataPtr);
719 
720 ///
721 /** View *a_dataPtr by writing it to an HDF5 plotfile (to a temporary file)
722  and then running VisIt with a python script which brings up a data
723  browser by default. The file has the same format as WriteAMRHierarchyHDF5,
724  but for a single LevelData<BaseFab<int> >. This is useful for debugging.
725 */
726 void
727 viewLevelBFI(const LevelData<BaseFab<int> >* a_dataPtr);
728 
729 void writeCopier(const Copier* a_copier);
730 
731 void viewCopier(const Copier* a_copier);
732 
733 ///
734 /** Write a plotfile using the same format as WriteAMRHierarchyHDF5, but
735  for a single DisjointBoxLayout (do this by creating a LevelData<FArrayBox>
736  and then calling writeLevel. Useful for debugging. *a_dataPtr is
737  written to the file given by a_filename.
738 */
739 void
740 writeDBLname(const DisjointBoxLayout* a_dataPtr,
741  const char* a_filename);
742 
743 ///
744 /** Write a plotfile with levels that don't necessarily begin with
745 0 (will translate things so that lBase comes out as level 0, etc)
746 Levels in Vector arguments should correspond with actual levels.
747 (and so should be defined for a_levels.begin() through a_levels.end().
748  {\bf Arguments:}\\
749  filename : file to output to.\\
750  a_vectGrids : grids at each level.\\
751  a_vectData : data at each level.\\
752  a_vectNames: names of variables.\\
753  a_domain : domain at base level (given by a_levels.begin()).\\
754  a_dx : grid spacing at base level.\\
755  a_dt : time step at base level.\\
756  a_time : time.\\
757  a_vectRatio : refinement ratio at all levels
758  (ith entry is refinement ratio between levels i and i + 1).\\
759  a_numLevels : number of levels to output.\\
760 This is blocking.
761 
762 */
763 void
764 WritePartialAMRHierarchyHDF5(const string& filename,
765  const Vector<DisjointBoxLayout>& a_vectGrids,
766  const Vector<LevelData<FArrayBox>* > & a_vectData,
767  const Vector<string>& a_vectNames,
768  const Box& a_baseDomain,
769  const Real& a_baseDx,
770  const Real& a_dt,
771  const Real& a_time,
772  const Vector<int>& a_vectRatio,
773  const Interval& a_levels);
774 
775 #endif // CH_USE_HDF5
776 
777 #include "NamespaceFooter.H"
778 
779 #endif
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 viewVectorLevel(const Vector< LevelData< FArrayBox > * > *a_dataPtr, const Vector< int > *a_refRatios)
void viewCFAB(const CFArrayBox *a_dataPtr)
void viewLevelNoGhost(const LevelData< FArrayBox > *a_dataPtr)
void writeFAB(const FArrayBox *a_dataPtr)
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:152
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 writeVectorLevelName(const Vector< LevelData< FArrayBox > * > *a_dataPtr, const Vector< int > *a_refRatios, const char *a_filename)
void viewIVSFABIV(const IVSFAB< IntVect > *a_dataPtr)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
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:292
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 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 viewLevel(const LevelData< FArrayBox > *a_dataPtr)