00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _UGIO_H_ 00012 #define _UGIO_H_ 00013 00014 #include <string> 00015 using std::string; 00016 using std::istream; 00017 00018 #include "LevelData.H" 00019 #include "REAL.H" 00020 #include "Vector.H" 00021 #include "FArrayBox.H" 00022 #include "IntVectSet.H" 00023 #include "NamespaceHeader.H" 00024 00025 #ifdef CH_USE_HDF5 00026 /// Write single-level of data in HDF5 format 00027 /** 00028 Writes a single level in HDF5 format. Only available if the preprocessor 00029 macro HDF5 is defined at compilation. This is blocking. 00030 00031 \b Arguments: 00032 - \b a_filename: file to output to. 00033 - \b a_grid : grids 00034 - \b a_data : data 00035 - \b a_names : names of variables. 00036 - \b a_domain : domain of level. 00037 */ 00038 void WriteUGHDF5(const string& a_filename, 00039 const DisjointBoxLayout& a_grids, 00040 const LevelData<FArrayBox>& a_data, 00041 const Box& a_domain); 00042 00043 /// Write a single level of data in HDF5 format. 00044 /** 00045 Writes a single level in HDF5 format. Only available if the preprocessor 00046 macro HDF5 is defined at compilation. This is the hdf5 handle version and 00047 is not blocking. 00048 00049 \b Arguments: 00050 - \b a_handle: handle to output to. 00051 - \b a_grid : grids 00052 - \b a_data : data 00053 - \b a_names : names of variables. 00054 - \b a_domain: domain of level. 00055 00056 */ 00057 void WriteUGHDF5(HDF5Handle& a_handle, 00058 const DisjointBoxLayout& a_grids, 00059 const LevelData<FArrayBox>& a_data, 00060 const Box& a_domain); 00061 00062 /// Reads a level of data in HDF5 format. 00063 /** 00064 Only available if the preprocessor macro HDF5 is defined at compilation. 00065 Returns 0 on success. This is blocking. 00066 00067 \b Arguments: 00068 - \b a_filename: file to input from. 00069 - \b a_grids : grids 00070 - \b a_data : data 00071 - \b a_domain : domain 00072 00073 \b Returns: 00074 - status code with values: 00075 - 0: success 00076 - -1: bogus number of levels 00077 - -2: bogus number of components 00078 - -3: error in readlevel 00079 - -4: file open failed 00080 */ 00081 int ReadUGHDF5(const string& a_filename, 00082 DisjointBoxLayout& a_grids, 00083 LevelData<FArrayBox>& a_data, 00084 Box& a_domain); 00085 00086 /// This is the handle version of ReadUGHDF5. 00087 /** 00088 This is not blocking. 00089 Reads a level of data in HDF5 format. Only available if the 00090 preprocessor macro HDF5 is defined at compilation. Returns 0 on success. 00091 00092 \b Arguments: 00093 - \b a_handle: hdf5 handle to input from. 00094 - \b a_grids : grids 00095 - \b a_data : data 00096 - \b a_domain: domain 00097 00098 \b Returns: 00099 - status code with values: 00100 - 0: success 00101 - -1: bogus number of levels 00102 - -2: bogus number of components 00103 - -3: error in readlevel 00104 - -4: file open failed 00105 */ 00106 int 00107 ReadUGHDF5(HDF5Handle& a_handle, 00108 DisjointBoxLayout& a_grids, 00109 LevelData<FArrayBox>& a_data, 00110 Box& a_domain); 00111 #endif 00112 00113 #include "NamespaceFooter.H" 00114 #endif