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