Chombo + EB + MF  3.2
mappedGridIO.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 #ifndef _MAPPEDGRIDIO_H_
12 #define _MAPPEDGRIDIO_H_
13 
14 #include "FourthOrderCoordSys.H"
15 #include "AMRIO.H"
16 #include "NodeAMRIO.H"
17 #include "REAL.H"
18 #include <string>
19 #include "NamespaceHeader.H"
20 using std::string;
21 using std::istream;
22 
23 
24 #ifdef CH_USE_HDF5
25 /// Write single-level of mapped-grid data in HDF5 format
26 /**
27  Writes a single level in HDF5 format. Only available if the preprocessor
28  macro HDF5 is defined at compilation. This is blocking.
29 
30  Opens and writes to 2 files:
31  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
32  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
33  (which is the real-space locations of the nodes in mapped space.)
34 
35  \b Arguments:
36  - \b a_fileRoot: root of files to output to.
37  - \b a_grids : grids
38  - \b a_data : data
39  - \b a_names : names of variables.
40  - \b a_CoordSys: coordinate system
41 */
42 void WriteMappedUGHDF5(const string& a_fileRoot,
43  const DisjointBoxLayout& a_grids,
44  const LevelData<FArrayBox>& a_data,
45  const FourthOrderCoordSys& a_CoordSys);
46 
47 
48 
49 
50 ///
51 /**
52  Writes hierarchy of mapped levels in HDF5 format. Only available if the
53  preprocessor macro HDF5 is defined at compilation.
54 
55  Opens and writes to 2 files:
56  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
57  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
58  (which is the real-space locations of the nodes in mapped space.)
59 
60  {\bf Arguments:}\\
61  fileRoot : root of files to output to.\\
62  a_vectGrids : grids at each level.\\
63  a_vectData : data at each level.\\
64  a_vectNames: names of variables.\\
65  a_vectCoordSys: coordinate systems for each AMR level. \\
66  a_dt : time step at coarsest level.\\
67  a_time : time.\\
68  a_vectRatio : refinement ratio at all levels
69  (ith entry is refinement ratio between levels i and i + 1).\\
70  a_numLevels : number of levels to output.\\
71 
72  This is blocking.
73 
74 */
75 void
76 WriteMappedAMRHierarchyHDF5(const string& fileRoot,
77  const Vector<DisjointBoxLayout>& a_vectGrids,
78  const Vector<LevelData<FArrayBox>* > & a_vectData,
79  const Vector<string>& a_vectNames,
80  const Vector<const FourthOrderCoordSys* >& a_vectCoordsys,
81  const Real& a_dt,
82  const Real& a_time,
83  const Vector<int>& a_vectRatio,
84  const int& a_numLevels);
85 
86 
87 ///
88 /**
89  Writes hierarchy of levels in HDF5 format. Only available if the
90  preprocessor macro HDF5 is defined at compilation.
91 
92  Opens and writes to 2 files:
93  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
94  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
95  (which is the real-space locations of the nodes in mapped space.)
96 
97  {\bf Arguments:}\\
98  fileRoot : root of files to output to.\\
99  a_vectGrids : grids at each level.\\
100  a_vectData : data at each level.\\
101  a_vectCoordSys: coordinate systems for each AMR level. \\
102  a_vectRatio : refinement ratio at all levels
103  (ith entry is refinement ratio between levels i and i + 1).\\
104  a_numLevels : number of levels to output.\\
105  This is blocking.
106 */
107 void
108 WriteMappedAMRHierarchyHDF5(const string& fileRoot,
109  const Vector<DisjointBoxLayout>& a_vectGrids,
110  const Vector<LevelData<FArrayBox>* > & a_vectData,
111  const Vector<const FourthOrderCoordSys* >& a_vectCoordsys,
112  const Vector<int>& a_vectRatio,
113  const int& a_numLevels);
114 
115 
116 #endif // CH_USE_HDF5
117 
118 
119 #include "NamespaceFooter.H"
120 
121 #endif
void WriteMappedAMRHierarchyHDF5(const string &fileRoot, const Vector< DisjointBoxLayout > &a_vectGrids, const Vector< LevelData< FArrayBox > * > &a_vectData, const Vector< string > &a_vectNames, const Vector< const FourthOrderCoordSys * > &a_vectCoordsys, const Real &a_dt, const Real &a_time, const Vector< int > &a_vectRatio, const int &a_numLevels)
Virtual base class encapsulating fourth-order CoordSys.
Definition: FourthOrderCoordSys.H:36
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
void WriteMappedUGHDF5(const string &a_fileRoot, const DisjointBoxLayout &a_grids, const LevelData< FArrayBox > &a_data, const FourthOrderCoordSys &a_CoordSys)
Write single-level of mapped-grid data in HDF5 format.