Block-Structured AMR Software Framework
AMReX_VectorIO.H
Go to the documentation of this file.
1 #ifndef AMREX_VECTORIO_H_
2 #define AMREX_VECTORIO_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_FPC.H>
6 #include <AMReX_FabConv.H>
7 #include <AMReX_IntConv.H>
8 
9 #include <iosfwd>
10 
11 namespace amrex {
12 
22  void writeIntData (const int* data, std::size_t size, std::ostream& os,
23  const IntDescriptor& id = FPC::NativeIntDescriptor());
24 
30  void readIntData (int* data, std::size_t size, std::istream& is, const IntDescriptor& id);
31 
37  void writeLongData (const Long* data, std::size_t size, std::ostream& os,
38  const IntDescriptor& id = FPC::NativeLongDescriptor());
39 
45  void readLongData (Long* data, std::size_t size, std::istream& is, const IntDescriptor& id);
46 
52  void writeRealData (const Real* data, std::size_t size, std::ostream& os,
53  const RealDescriptor& rd = FPC::NativeRealDescriptor());
54 
60  void readRealData (Real* data, std::size_t size, std::istream& is,
61  const RealDescriptor& rd);
62 
68  void writeFloatData (const float* data, std::size_t size, std::ostream& os,
69  const RealDescriptor& rd = FPC::Native32RealDescriptor());
70 
76  void readFloatData(float* data, std::size_t size, std::istream& is,
77  const RealDescriptor& rd);
78 
84  void writeDoubleData (const double* data, std::size_t size, std::ostream& os,
85  const RealDescriptor& rd = FPC::Native64RealDescriptor());
86 
92  void readDoubleData (double* data, std::size_t size, std::istream& is,
93  const RealDescriptor& rd);
94 
95  inline void writeData (int const* data, std::size_t size, std::ostream& os)
96  {
97  writeIntData(data, size, os);
98  }
99 
100  inline void writeData (Long const* data, std::size_t size, std::ostream& os)
101  {
102  writeLongData(data, size, os);
103  }
104 
105  inline void writeData (float const* data, std::size_t size, std::ostream& os)
106  {
107  writeFloatData(data, size, os);
108  }
109 
110  inline void writeData (double const* data, std::size_t size, std::ostream& os)
111  {
112  writeDoubleData(data, size, os);
113  }
114 
115  inline void readData (int * data, std::size_t size, std::istream& is)
116  {
118  }
119 
120  inline void readData (Long * data, std::size_t size, std::istream& is)
121  {
123  }
124 
125  inline void readData (float * data, std::size_t size, std::istream& is)
126  {
128  }
129 
130  inline void readData (double * data, std::size_t size, std::istream& is)
131  {
133  }
134 }
135 
136 #endif
static const RealDescriptor & Native64RealDescriptor()
Definition: AMReX_FPC.cpp:137
static const RealDescriptor & Native32RealDescriptor()
NativeRealDescriptor is equivalent to Native32RealDescriptor if BL_FLOAT is used. Otherwise,...
Definition: AMReX_FPC.cpp:124
static const IntDescriptor & NativeLongDescriptor()
Returns a constant reference to an IntDescriptor describing the native "Long" under which AMReX was c...
Definition: AMReX_FPC.cpp:89
static const IntDescriptor & NativeIntDescriptor()
Returns a constant reference to an IntDescriptor describing the native "int" under which AMReX was co...
Definition: AMReX_FPC.cpp:76
static const RealDescriptor & NativeRealDescriptor()
Returns a constant reference to a RealDescriptor describing the native Real under which AMReX was com...
Definition: AMReX_FPC.cpp:103
AMREX_GPU_HOST_DEVICE Long size(T const &b) noexcept
integer version
Definition: AMReX_GpuRange.H:26
Definition: AMReX_Amr.cpp:49
void writeIntData(const From *data, std::size_t size, std::ostream &os, const amrex::IntDescriptor &id)
Definition: AMReX_IntConv.H:23
void readFloatData(float *data, std::size_t size, std::istream &is, const RealDescriptor &rd)
Definition: AMReX_VectorIO.cpp:120
void writeFloatData(const float *data, std::size_t size, std::ostream &os, const RealDescriptor &rd=FPC::Native32RealDescriptor())
Definition: AMReX_VectorIO.cpp:114
void readData(int *data, std::size_t size, std::istream &is)
Definition: AMReX_VectorIO.H:115
void writeLongData(const Long *data, std::size_t size, std::ostream &os, const IntDescriptor &id=FPC::NativeLongDescriptor())
Definition: AMReX_VectorIO.cpp:54
void writeDoubleData(const double *data, std::size_t size, std::ostream &os, const RealDescriptor &rd=FPC::Native64RealDescriptor())
Definition: AMReX_VectorIO.cpp:126
void readLongData(Long *data, std::size_t size, std::istream &is, const IntDescriptor &id)
Definition: AMReX_VectorIO.cpp:78
void readRealData(Real *data, std::size_t size, std::istream &is, const RealDescriptor &rd)
Definition: AMReX_VectorIO.cpp:108
void writeData(int const *data, std::size_t size, std::ostream &os)
Definition: AMReX_VectorIO.H:95
void readDoubleData(double *data, std::size_t size, std::istream &is, const RealDescriptor &rd)
Definition: AMReX_VectorIO.cpp:132
void readIntData(To *data, std::size_t size, std::istream &is, const amrex::IntDescriptor &id)
Definition: AMReX_IntConv.H:36
void writeRealData(const Real *data, std::size_t size, std::ostream &os, const RealDescriptor &rd=FPC::NativeRealDescriptor())
Definition: AMReX_VectorIO.cpp:102