1 #ifndef UTIL_CARRAY_2D_PARAM_H 2 #define UTIL_CARRAY_2D_PARAM_H 11 #include <util/param/Parameter.h> 108 template <
class Type>
120 template <
class Type>
124 for (i = 0; i < m_; ++i) {
125 for (j = 0; j < n_; ++j) {
126 in >> ptr_[i*np_ + j];
134 template <
class Type>
136 { ar.
unpack(ptr_, m_, n_, np_); }
141 template <
class Type>
143 { ar.
pack(ptr_, m_, n_, np_); }
149 template <
class Type>
157 template <
class Type>
164 for (i = 0; i < m_; ++i) {
170 for (j = 0; j < n_; ++j) {
171 out << std::right << std::scientific
std::string label() const
Return label string.
Label label_
Label object that contains parameter label string.
A single variable in a parameter file.
virtual void saveValue(Serializable::OArchive &ar)
Save 2D array to an archive.
virtual void readValue(std::istream &in)
Read 2D array parameter from an input stream.
File containing preprocessor macros for error handling.
A Parameter associated with a 2D built-in C array.
Saving / output archive for binary ostream.
void pack(const T &data)
Pack one object of type T.
MPI::Intracomm & ioCommunicator() const
Get the MPI communicator by reference.
virtual void loadValue(Serializable::IArchive &ar)
Load 2D array from an archive.
Utility classes for scientific computation.
virtual void bcastValue()
Broadcast 2D array within the ioCommunicator.
static const int Precision
Precision for io of floating point data field.
bool isActive() const
Is this parameter active?
CArray2DParam(const char *label, Type *ptr, int m, int n, int np, bool isRequired=true)
Constructor.
A label string in a file format.
void unpack(T &data)
Unpack a single T object.
Saving archive for binary istream.
static const int Width
Width of output field for a scalar variable.
This file contains templates for global functions send<T>, recv<T> and bcast<T>.
bool isRequired() const
Is this an optional parameter?
void writeParam(std::ostream &out)
Write 2D C array to file.
std::string indent() const
Return indent string for this object (string of spaces).