Chombo + EB + MF  3.2
newMappedGridIO.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 _NEWMAPPEDGRIDIO_H_
12 #define _NEWMAPPEDGRIDIO_H_
13 
14 #include "NewCoordSys.H"
15 #include "MultiBlockCoordSys.H"
16 #include "AMRIO.H"
17 #include "NodeAMRIO.H"
18 #include "REAL.H"
19 #include <string>
20 #include "NamespaceHeader.H"
21 using std::string;
22 using std::istream;
23 
24 
25 #ifdef CH_USE_HDF5
26 /// Write single-level of mapped-grid data in HDF5 format
27 /**
28  Writes a single level in HDF5 format. Only available if the preprocessor
29  macro HDF5 is defined at compilation. This is blocking.
30 
31  Opens and writes to 2 files:
32  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
33  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
34  (which is the real-space locations of the nodes in mapped space.)
35 
36  \b Arguments:
37  - \b a_fileRoot: root of files to output to.
38  - \b a_grids : grids
39  - \b a_data : data
40  - \b a_names : names of variables.
41  - \b a_CoordSys: coordinate system
42 */
43 void WriteMappedUGHDF5(const string& a_fileRoot,
44  const DisjointBoxLayout& a_grids,
45  const LevelData<FArrayBox>& a_data,
46  const NewCoordSys& a_CoordSys,
47  const Box& a_domainBox,
48  const Real& a_time);
49 
50 
51 
52 
53 ///
54 /**
55  Writes hierarchy of mapped levels in HDF5 format. Only available if the
56  preprocessor macro HDF5 is defined at compilation.
57 
58  Opens and writes to 2 files:
59  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
60  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
61  (which is the real-space locations of the nodes in mapped space.)
62 
63  {\bf Arguments:}\\
64  fileRoot : root of files to output to.\\
65  a_vectGrids : grids at each level.\\
66  a_vectData : data at each level.\\
67  a_vectNames: names of variables.\\
68  a_vectCoordSys: coordinate systems for each AMR level. \\
69  a_dt : time step at coarsest level.\\
70  a_time : time.\\
71  a_vectRatio : refinement ratio at all levels
72  (ith entry is refinement ratio between levels i and i + 1).\\
73  a_numLevels : number of levels to output.\\
74 
75  This is blocking.
76 
77 */
78 void
79 WriteMappedAMRHierarchyHDF5(const string& fileRoot,
80  const Vector<DisjointBoxLayout>& a_vectGrids,
81  const Vector<LevelData<FArrayBox>* > & a_vectData,
82  const Vector<string>& a_vectNames,
83  const Vector<const NewCoordSys* >& a_vectCoordsys,
84  const Box& a_baseDomainBox,
85  const Real& a_dt,
86  const Real& a_time,
87  const Vector<int>& a_vectRatio,
88  const int& a_numLevels);
89 
90 
91 ///
92 /**
93  Writes hierarchy of levels in HDF5 format. Only available if the
94  preprocessor macro HDF5 is defined at compilation.
95 
96  Opens and writes to 2 files:
97  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
98  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
99  (which is the real-space locations of the nodes in mapped space.)
100 
101  {\bf Arguments:}\\
102  fileRoot : root of files to output to.\\
103  a_vectGrids : grids at each level.\\
104  a_vectData : data at each level.\\
105  a_vectCoordSys: coordinate systems for each AMR level. \\
106  a_vectRatio : refinement ratio at all levels
107  (ith entry is refinement ratio between levels i and i + 1).\\
108  a_numLevels : number of levels to output.\\
109  This is blocking.
110 */
111 void
112 WriteMappedAMRHierarchyHDF5(const string& fileRoot,
113  const Vector<DisjointBoxLayout>& a_vectGrids,
114  const Vector<LevelData<FArrayBox>* > & a_vectData,
115  const Vector<const NewCoordSys* >& a_vectCoordsys,
116  const Box& a_baseDomainBox,
117  const Vector<int>& a_vectRatio,
118  const int& a_numLevels,
119  const Real& a_time);
120 
121 
122 
123 /// Write single-level of multiblock mapped-grid data in HDF5 format
124 /**
125  Writes a single level in HDF5 format. Only available if the preprocessor
126  macro HDF5 is defined at compilation. This is blocking.
127 
128  Opens and writes to 2 files:
129  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
130  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
131  (which is the real-space locations of the nodes in mapped space.)
132 
133  \b Arguments:
134  - \b a_fileRoot: root of files to output to.
135  - \b a_grids : grids
136  - \b a_data : data
137  - \b a_names : names of variables.
138  - \b a_CoordSys: multiblock coordinate system
139 */
140 void WriteMappedUGHDF5(const string& a_fileRoot,
141  const DisjointBoxLayout& a_grids,
142  const LevelData<FArrayBox>& a_data,
143  const MultiBlockCoordSys& a_CoordSys,
144  const Box& a_domainBox,
145  const Real& a_time);
146 
147 
148 void WriteMappedUGHDF5(const string& a_fileRoot,
149  const DisjointBoxLayout& a_grids,
150  const LevelData<FArrayBox>& a_data,
151  const MultiBlockCoordSys& a_CoordSys,
152  const Box& a_domainBox,
153  const Vector<string>& outputNames,
154  const Real& a_time);
155 
156 
157 ///
158 /**
159  Writes hierarchy of multiblock mapped levels in HDF5 format.
160  Only available if the preprocessor macro HDF5 is defined at compilation.
161 
162 
163  Opens and writes to 2 files:
164  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
165  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
166 b
167  (which is the real-space locations of the nodes in mapped space.)
168 
169  {\bf Arguments:}\\
170  fileRoot : root of files to output to.\\
171  a_vectGrids : grids at each level.\\
172  a_vectData : data at each level.\\
173  a_vectNames: names of variables.\\
174  a_vectCoordSys: multiblock coordinate systems for each AMR level. \\
175  a_dt : time step at coarsest level.\\
176  a_time : time.\\
177  a_vectRatio : refinement ratio at all levels
178  (ith entry is refinement ratio between levels i and i + 1).\\
179  a_numLevels : number of levels to output.\\
180 
181  This is blocking.
182 
183 */
184 void
185 WriteMappedAMRHierarchyHDF5(const string& fileRoot,
186  const Vector<DisjointBoxLayout>& a_vectGrids,
187  const Vector<LevelData<FArrayBox>* > & a_vectData,
188  const Vector<string>& a_vectNames,
189  const Vector<const MultiBlockCoordSys* >& a_vectCoordsys,
190  const Box& a_baseDomainBox,
191  const Real& a_dt,
192  const Real& a_time,
193  const Vector<int>& a_vectRatio,
194  const int& a_numLevels);
195 
196 
197 ///
198 /**
199  Writes hierarchy of levels in HDF5 format. Only available if the
200  preprocessor macro HDF5 is defined at compilation.
201 
202  Opens and writes to 2 files:
203  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
204  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
205  (which is the real-space locations of the nodes in mapped space.)
206 
207  {\bf Arguments:}\\
208  fileRoot : root of files to output to.\\
209  a_vectGrids : grids at each level.\\
210  a_vectData : data at each level.\\
211  a_vectCoordSys: coordinate systems for each AMR level. \\
212  a_vectRatio : refinement ratio at all levels
213  (ith entry is refinement ratio between levels i and i + 1).\\
214  a_numLevels : number of levels to output.\\
215  This is blocking.
216 */
217 void
218 WriteMappedAMRHierarchyHDF5(const string& fileRoot,
219  const Vector<DisjointBoxLayout>& a_vectGrids,
220  const Vector<LevelData<FArrayBox>* > & a_vectData,
221  const Vector<const MultiBlockCoordSys* >& a_vectCoordsys,
222  const Box& a_baseDomainBox,
223  const Vector<int>& a_vectRatio,
224  const int& a_numLevels,
225  const Real& a_time);
226 
227 
228 ///
229 /**
230  Writes hierarchy of levels in HDF5 format. Only available if the
231  preprocessor macro HDF5 is defined at compilation.
232 
233  Opens and writes to 2 files:
234  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
235  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
236  (which is the real-space locations of the nodes in mapped space.)
237 
238  {\bf Arguments:}\\
239  fileRoot : root of files to output to.\\
240  a_vectGrids : grids at each level.\\
241  a_vectData : data at each level.\\
242  a_vectCoordSys: coordinate systems for each AMR level. \\
243  a_vectRatios: refinement ratio in each direction at all levels
244  (ith entry is refinement ratio between levels i and i + 1).\\
245  a_numLevels : number of levels to output.\\
246  This is blocking.
247 */
248 void
250  const string& fileRoot,
251  const Vector<DisjointBoxLayout>& a_vectGrids,
252  const Vector<LevelData<FArrayBox>* > & a_vectData,
253  const Vector<const MultiBlockCoordSys* >& a_vectCoordsys,
254  const Box& a_baseDomainBox,
255  const Vector<IntVect>& a_vectRatios,
256  const int& a_numLevels,
257  const Real& a_time);
258 
259 
260 ///
261 /**
262  Writes hierarchy of multiblock mapped levels in HDF5 format.
263  Only available if the preprocessor macro HDF5 is defined at compilation.
264 
265 
266  Opens and writes to 2 files:
267  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
268  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
269  (which is the real-space locations of the nodes in mapped space.)
270 
271  {\bf Arguments:}\\
272  fileRoot : root of files to output to.\\
273  a_vectGrids : grids at each level.\\
274  a_vectData : data at each level.\\
275  a_vectNames: names of variables.\\
276  a_vectCoordSys: multiblock coordinate systems for each AMR level. \\
277  a_dt : time step at coarsest level.\\
278  a_time : time.\\
279  a_vectRatios: refinement ratio in each direction at all levels
280  (ith entry is refinement ratio between levels i and i + 1).\\
281  a_numLevels : number of levels to output.\\
282 
283  This is blocking.
284 
285 */
286 void
288  const string& fileRoot,
289  const Vector<DisjointBoxLayout>& a_vectGrids,
290  const Vector<LevelData<FArrayBox>* > & a_vectData,
291  const Vector<string>& a_vectNames,
292  const Vector<const MultiBlockCoordSys* >& a_vectCoordsys,
293  const Box& a_baseDomainBox,
294  const Real& a_dt,
295  const Real& a_time,
296  const Vector<IntVect>& a_vectRatio,
297  const int& a_numLevels);
298 
299 
300 ///
301 /**
302  Writes hierarchy of mapped levels in HDF5 format. Only available if the
303  preprocessor macro HDF5 is defined at compilation.
304 
305  Opens and writes to 2 files:
306  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
307  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
308  (which is the real-space locations of the nodes in mapped space.)
309 
310  {\bf Arguments:}\\
311  fileRoot : root of files to output to.\\
312  a_vectGrids : grids at each level.\\
313  a_vectData : data at each level.\\
314  a_vectNames: names of variables.\\
315  a_vectCoordSys: coordinate systems for each AMR level. \\
316  a_dt : time step at coarsest level.\\
317  a_time : time.\\
318  a_vectRatio : refinement ratio in each direction at all levels
319  (ith entry is refinement ratio between levels i and i + 1).\\
320  a_numLevels : number of levels to output.\\
321 
322  This is blocking.
323 
324 */
325 void
327  const string& fileRoot,
328  const Vector<DisjointBoxLayout>& a_vectGrids,
329  const Vector<LevelData<FArrayBox>* > & a_vectData,
330  const Vector<string>& a_vectNames,
331  const Vector<const NewCoordSys* >& a_vectCoordsys,
332  const Box& a_baseDomainBox,
333  const Real& a_dt,
334  const Real& a_time,
335  const Vector<IntVect>& a_vectRatios,
336  const int& a_numLevels);
337 
338 
339 ///
340 /**
341  Writes hierarchy of levels in HDF5 format. Only available if the
342  preprocessor macro HDF5 is defined at compilation.
343 
344  Opens and writes to 2 files:
345  fileRoot.<DIM>d.hdf5 contains the cell-centered dataset, while
346  fileRoot.map.<DIM>d.hdf5 contains the node-centered mapped-grid information
347  (which is the real-space locations of the nodes in mapped space.)
348 
349  {\bf Arguments:}\\
350  fileRoot : root of files to output to.\\
351  a_vectGrids : grids at each level.\\
352  a_vectData : data at each level.\\
353  a_vectCoordSys: coordinate systems for each AMR level. \\
354  a_vectRatio : refinement ratio in each direction at all levels
355  (ith entry is refinement ratio between levels i and i + 1).\\
356  a_numLevels : number of levels to output.\\
357  This is blocking.
358 */
359 void
361  const string& fileRoot,
362  const Vector<DisjointBoxLayout>& a_vectGrids,
363  const Vector<LevelData<FArrayBox>* > & a_vectData,
364  const Vector<const NewCoordSys* >& a_vectCoordsys,
365  const Box& a_baseDomainBox,
366  const Vector<IntVect>& a_vectRatios,
367  const int& a_numLevels, const Real& a_time);
368 
369 
370 #endif // CH_USE_HDF5
371 
372 
373 #include "NamespaceFooter.H"
374 
375 #endif
void WriteMappedUGHDF5(const string &a_fileRoot, const DisjointBoxLayout &a_grids, const LevelData< FArrayBox > &a_data, const NewCoordSys &a_CoordSys, const Box &a_domainBox, const Real &a_time)
Write single-level of mapped-grid data in HDF5 format.
double Real
Definition: REAL.H:33
void WriteMappedAMRHierarchyHDF5(const string &fileRoot, const Vector< DisjointBoxLayout > &a_vectGrids, const Vector< LevelData< FArrayBox > * > &a_vectData, const Vector< string > &a_vectNames, const Vector< const NewCoordSys * > &a_vectCoordsys, const Box &a_baseDomainBox, const Real &a_dt, const Real &a_time, const Vector< int > &a_vectRatio, const int &a_numLevels)
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Virtual base class encapsulating mapped-grid coordinate systems.
Definition: NewCoordSys.H:30
void WriteAnisotropicMappedAMRHierarchyHDF5(const string &fileRoot, const Vector< DisjointBoxLayout > &a_vectGrids, const Vector< LevelData< FArrayBox > * > &a_vectData, const Vector< const MultiBlockCoordSys * > &a_vectCoordsys, const Box &a_baseDomainBox, const Vector< IntVect > &a_vectRatios, const int &a_numLevels, const Real &a_time)