|
Simpatico
v1.10
|
A Parameter associated with a 2D built-in C array.
Definition at line 29 of file CArray2DParam.h.
#include <CArray2DParam.h>
Public Member Functions | |
| CArray2DParam (const char *label, Type *ptr, int m, int n, int np, bool isRequired=true) | |
| Constructor. More... | |
| void | writeParam (std::ostream &out) |
| Write 2D C array to file. More... | |
Public Member Functions inherited from Util::Parameter | |
| Parameter (const char *label, bool isRequired=true) | |
| Constructor. More... | |
| virtual | ~Parameter () |
| Destructor. More... | |
| virtual void | readParam (std::istream &in) |
| Read a label and (if the label matches) a parameter value. More... | |
| virtual void | load (Serializable::IArchive &ar) |
| Load from an archive. More... | |
| virtual void | save (Serializable::OArchive &ar) |
| Save to an archive. More... | |
| std::string | label () const |
| Return label string. More... | |
| bool | isRequired () const |
| Is this an optional parameter? More... | |
| bool | isActive () const |
| Is this parameter active? More... | |
Public Member Functions inherited from Util::ParamComponent | |
| virtual | ~ParamComponent () |
| Destructor. More... | |
| virtual void | resetParam () |
| Nontrivial implementation provided by ParamComposite subclass. More... | |
| void | setIndent (const ParamComponent &parent, bool next=true) |
| Set indent level. More... | |
| std::string | indent () const |
| Return indent string for this object (string of spaces). More... | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
| Serialize this ParamComponent as a string. More... | |
Public Member Functions inherited from Util::Serializable | |
| virtual | ~Serializable () |
| Destructor. More... | |
Public Member Functions inherited from Util::MpiFileIo | |
| MpiFileIo () | |
| Constructor. More... | |
| MpiFileIo (const MpiFileIo &other) | |
| Copy constructor. More... | |
| bool | isIoProcessor () const |
| Can this processor do file I/O ? More... | |
| void | setIoCommunicator (MPI::Intracomm &communicator) |
| Set the communicator. More... | |
| void | clearCommunicator () |
| Clear (nullify) the communicator. More... | |
| bool | hasIoCommunicator () const |
| Does this object have an associated MPI communicator? More... | |
| MPI::Intracomm & | ioCommunicator () const |
| Get the MPI communicator by reference. More... | |
Protected Member Functions | |
| virtual void | readValue (std::istream &in) |
| Read 2D array parameter from an input stream. More... | |
| virtual void | loadValue (Serializable::IArchive &ar) |
| Load 2D array from an archive. More... | |
| virtual void | saveValue (Serializable::OArchive &ar) |
| Save 2D array to an archive. More... | |
| virtual void | bcastValue () |
| Broadcast 2D array within the ioCommunicator. More... | |
Protected Member Functions inherited from Util::ParamComponent | |
| ParamComponent () | |
| Constructor. More... | |
| ParamComponent (const ParamComponent &other) | |
| Copy constructor. More... | |
Additional Inherited Members | |
Public Types inherited from Util::Serializable | |
| typedef BinaryFileOArchive | OArchive |
| Type of output archive used by save method. More... | |
| typedef BinaryFileIArchive | IArchive |
| Type of input archive used by load method. More... | |
Static Public Member Functions inherited from Util::Parameter | |
| template<class Type > | |
| static void | saveOptional (Serializable::OArchive &ar, Type &value, bool isActive) |
| Save an optional parameter value to an output archive. More... | |
| template<class Type > | |
| static void | saveOptionalCArray (Serializable::OArchive &ar, Type *ptr, int n, bool isActive) |
| Save an optional C-array of n values to an output archive. More... | |
| template<class Type > | |
| static void | saveOptionalCArray2D (Serializable::OArchive &ar, Type *ptr, int m, int n, int np, bool isActive) |
| Save an optional two-dimensional C array to an output archive. More... | |
Static Public Member Functions inherited from Util::ParamComponent | |
| static void | initStatic () |
| Initialize static echo member to false. More... | |
| static void | setEcho (bool echo=true) |
| Enable or disable echoing for all subclasses of ParamComponent. More... | |
| static bool | echo () |
| Get echo parameter. More... | |
Static Public Attributes inherited from Util::Parameter | |
| static const int | Width = 20 |
| Width of output field for a scalar variable. More... | |
| static const int | Precision = 12 |
| Precision for io of floating point data field. More... | |
Protected Attributes inherited from Util::Parameter | |
| Label | label_ |
| Label object that contains parameter label string. More... | |
| bool | isActive_ |
| Is this parameter active (always true if isRequired). More... | |
| Util::CArray2DParam< Type >::CArray2DParam | ( | const char * | label, |
| Type * | ptr, | ||
| int | m, | ||
| int | n, | ||
| int | np, | ||
| bool | isRequired = true |
||
| ) |
Constructor.
Example: A 2 X 2 matrix stored in an oversized 3 x 3 C array.
| label | parameter label (usually a literal C-string) |
| ptr | pointer to first element of first row of 2D array |
| m | logical number of rows |
| n | logical number of columns |
| np | physical number of columns (allocated elements per row). |
| isRequired | Is this a required parameter? |
Definition at line 109 of file CArray2DParam.h.
|
virtual |
Write 2D C array to file.
Implements Util::ParamComponent.
Definition at line 158 of file CArray2DParam.h.
References Util::ParamComponent::indent(), Util::Parameter::isActive(), Util::Parameter::label_, Util::Parameter::Precision, and Util::Parameter::Width.
|
protectedvirtual |
Read 2D array parameter from an input stream.
| in | input stream from which to read |
Reimplemented from Util::Parameter.
Definition at line 121 of file CArray2DParam.h.
|
protectedvirtual |
Load 2D array from an archive.
| ar | input archive from which to load |
Reimplemented from Util::Parameter.
Definition at line 135 of file CArray2DParam.h.
References Util::BinaryFileIArchive::unpack().
|
protectedvirtual |
Save 2D array to an archive.
| ar | output archive to which to save |
Reimplemented from Util::Parameter.
Definition at line 142 of file CArray2DParam.h.
References Util::BinaryFileOArchive::pack().
|
protectedvirtual |
Broadcast 2D array within the ioCommunicator.
Reimplemented from Util::Parameter.
Definition at line 150 of file CArray2DParam.h.
References Util::MpiFileIo::ioCommunicator().
1.8.11