Chombo + EB  3.0
UGIO.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 _UGIO_H_
12 #define _UGIO_H_
13 
14 #include <string>
15 using std::string;
16 using std::istream;
17 
18 #include "LevelData.H"
19 #include "REAL.H"
20 #include "Vector.H"
21 #include "FArrayBox.H"
22 #include "IntVectSet.H"
23 #include "NamespaceHeader.H"
24 
25 #ifdef CH_USE_HDF5
26 /// Write single-level of 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  \b Arguments:
32  - \b a_filename: file to output to.
33  - \b a_grid : grids
34  - \b a_data : data
35  - \b a_names : names of variables.
36  - \b a_domain : domain of level.
37 */
38 void WriteUGHDF5(const string& a_filename,
39  const DisjointBoxLayout& a_grids,
40  const LevelData<FArrayBox>& a_data,
41  const Box& a_domain);
42 
43 /// Write a single level of data in HDF5 format.
44 /**
45  Writes a single level in HDF5 format. Only available if the preprocessor
46  macro HDF5 is defined at compilation. This is the hdf5 handle version and
47  is not blocking.
48 
49  \b Arguments:
50  - \b a_handle: handle to output to.
51  - \b a_grid : grids
52  - \b a_data : data
53  - \b a_names : names of variables.
54  - \b a_domain: domain of level.
55 
56 */
57 void WriteUGHDF5(HDF5Handle& a_handle,
58  const DisjointBoxLayout& a_grids,
59  const LevelData<FArrayBox>& a_data,
60  const Box& a_domain);
61 
62 /// Reads a level of data in HDF5 format.
63 /**
64  Only available if the preprocessor macro HDF5 is defined at compilation.
65  Returns 0 on success. This is blocking.
66 
67  \b Arguments:
68  - \b a_filename: file to input from.
69  - \b a_grids : grids
70  - \b a_data : data
71  - \b a_domain : domain
72 
73  \b Returns:
74  - status code with values:
75  - 0: success
76  - -1: bogus number of levels
77  - -2: bogus number of components
78  - -3: error in readlevel
79  - -4: file open failed
80 */
81 int ReadUGHDF5(const string& a_filename,
82  DisjointBoxLayout& a_grids,
83  LevelData<FArrayBox>& a_data,
84  Box& a_domain);
85 
86 /// This is the handle version of ReadUGHDF5.
87 /**
88  This is not blocking.
89  Reads a level of data in HDF5 format. Only available if the
90  preprocessor macro HDF5 is defined at compilation. Returns 0 on success.
91 
92  \b Arguments:
93  - \b a_handle: hdf5 handle to input from.
94  - \b a_grids : grids
95  - \b a_data : data
96  - \b a_domain: domain
97 
98  \b Returns:
99  - status code with values:
100  - 0: success
101  - -1: bogus number of levels
102  - -2: bogus number of components
103  - -3: error in readlevel
104  - -4: file open failed
105 */
106 int
107 ReadUGHDF5(HDF5Handle& a_handle,
108  DisjointBoxLayout& a_grids,
109  LevelData<FArrayBox>& a_data,
110  Box& a_domain);
111 #endif
112 
113 #include "NamespaceFooter.H"
114 #endif
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
Handle to a particular group in an HDF file.
Definition: CH_HDF5.H:267
void WriteUGHDF5(const string &a_filename, const DisjointBoxLayout &a_grids, const LevelData< FArrayBox > &a_data, const Box &a_domain)
Write single-level of data in HDF5 format.
int ReadUGHDF5(const string &a_filename, DisjointBoxLayout &a_grids, LevelData< FArrayBox > &a_data, Box &a_domain)
Reads a level of data in HDF5 format.