00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _BLOCKWRITE_H_
00012 #define _BLOCKWRITE_H_
00013
00014 #ifdef CH_USE_HDF5 // if you don't have CH_USE_HDF5, then this file is useless
00015
00016 #include "CH_HDF5.H"
00017
00018 #include <iostream>
00019
00020 using std::endl;
00021
00022 #ifdef CH_MPI
00023 #include "mpi.h"
00024 #endif
00025
00026 #include "LevelData.H"
00027 #include "HDF5Portable.H"
00028 #include <string>
00029 #include <map>
00030 #include "RealVect.H"
00031 #include "CH_Timer.H"
00032 #include "LoadBalance.H"
00033 #include "LayoutIterator.H"
00034 #include "Vector.H"
00035 #include "memtrack.H"
00036 #include "FluxBox.H"
00037 #include "CH_HDF5.H"
00038
00039 #include "NamespaceHeader.H"
00040
00041
00042 template <class T> int
00043 blockReadLevel(HDF5Handle& a_handle,
00044 const int& a_level,
00045 LevelData<T>& a_data,
00046 Real& a_dx,
00047 Real& a_dt,
00048 Real& a_time,
00049 Box& a_domain,
00050 int& a_refRatio,
00051 const Interval& a_comps,
00052 bool setGhost);
00053
00054
00055 template <class T> int
00056 blockWriteLevel(HDF5Handle& a_handle,
00057 const int& a_level,
00058 const LevelData<T>& a_data,
00059 const Real& a_dx,
00060 const Real& a_dt,
00061 const Real& a_time,
00062 const Box& a_domain,
00063 const int& a_refRatio,
00064 const IntVect& outputGhost,
00065 const Interval& comps);
00066
00067
00068 template <class T> int
00069 blockWrite(HDF5Handle& a_handle,
00070 const BoxLayoutData<T>& a_data,
00071 const std::string& a_name,
00072 const IntVect& a_outputGhost,
00073 const Interval& a_comps);
00074
00075
00076 template <class T>
00077 int
00078 blockWrite(HDF5Handle& a_handle,
00079 const LevelData<T>& a_data,
00080 const std::string& a_name,
00081 const IntVect& a_outputGhost,
00082 const Interval& a_in_comps);
00083
00084
00085 template <class T> void
00086 blockLocalOffsets(Vector<long long>& a_localOffsets,
00087 long long & a_localTotalSize,
00088 Vector<Box> & a_localBoxes,
00089 const BoxLayoutData<T>& a_data,
00090 const Interval& a_comps,
00091 const IntVect& a_outputGhost);
00092
00093
00094 template <class T> void
00095 blockWriteToBuffer(void* a_buffer,
00096 const BoxLayoutData<T>& a_data,
00097 const Interval& a_comps,
00098 const IntVect& a_outputGhost);
00099
00100
00101 int
00102 gatherBoxesAndOffsets(long long& a_offsetThisProc,
00103 long long& a_allProcSize,
00104 Vector<long long>& a_globalOffsets,
00105 Vector<Box>& a_globalBoxes,
00106 const Vector<long long>& a_localOffsets,
00107 const Vector<Box>& a_localBoxes,
00108 const long long& a_localSize);
00109
00110
00111 int
00112 blockWriteBufferToFile(HDF5Handle& a_handle,
00113 void* a_buffer,
00114 const std::string& a_name,
00115 Vector<Box>& a_boxes,
00116 Vector<long long>& a_offsets,
00117 const Vector<hid_t>& a_types,
00118 const BoxLayout& a_layout,
00119 const long long& a_thisprocsize);
00120
00121
00122
00123
00124
00125
00126
00127
00128 template <class T>
00129 int blockRead(HDF5Handle& a_handle,
00130 BoxLayoutData<T>& a_data,
00131 const std::string& a_name,
00132 const BoxLayout& a_layout,
00133 const Interval& a_comps = Interval(),
00134 bool redefineData = true);
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 template <class T>
00159 int blockRead(HDF5Handle& a_handle,
00160 LevelData<T>& a_data,
00161 const std::string& a_name,
00162 const DisjointBoxLayout& a_layout,
00163 const Interval& a_comps = Interval(),
00164 bool redefineData = true);
00165
00166
00167 #include "BlockWriteI.H"
00168
00169 #endif //ifdef CH_USE_HDF5
00170 #endif //ifndef __BlockWrite__