PSCF v1.1
Public Member Functions | List of all members
Util::ParamComposite Class Reference

An object that can read multiple parameters from file. More...

#include <ParamComposite.h>

Inheritance diagram for Util::ParamComposite:
Util::ParamComponent Util::Serializable Util::MpiFileIo Pscf::MixtureTmpl< Polymer, Solvent > Pscf::MixtureTmpl< Polymer< D >, Solvent< D > > Pscf::PolymerTmpl< Block< D > > Pscf::SweepTmpl< DArray< System::WField > > Pscf::SweepTmpl< BasisFieldState< D > > Pscf::Fd1d::Domain Pscf::Fd1d::Iterator Pscf::Fd1d::System Pscf::Homogeneous::Mixture Pscf::Homogeneous::Molecule Pscf::Interaction Pscf::MixtureTmpl< TP, TS > Pscf::PolymerTmpl< Block > Pscf::Pspc::Domain< D > Pscf::Pspc::Iterator< D > Pscf::Pspc::Mask< D > Pscf::Pspc::System< D > Pscf::Pspc::WFieldContainer< D > Pscf::Pspg::Domain< D > Pscf::Pspg::Iterator< D > Pscf::Pspg::System< D > Pscf::Pspg::WFieldContainer< D > Pscf::SolventDescriptor Pscf::SweepTmpl< State > Util::AutoCorr< Data, Product > Util::AutoCorrArray< Data, Product > Util::AutoCorrelation< Data, Product > Util::Average Util::Distribution Util::FileMaster Util::IntDistribution Util::Manager< Data > Util::MeanSqDispArray< Data > Util::Random Util::SymmTensorAverage Util::TensorAverage

Public Member Functions

 ParamComposite ()
 Constructor. More...
 
 ParamComposite (const ParamComposite &other)
 Copy constructor. More...
 
 ParamComposite (int capacity)
 Constructor. More...
 
virtual ~ParamComposite ()
 Virtual destructor. More...
 
void resetParam ()
 Resets ParamComposite to its empty state. More...
 
Read and write functions for the composite
virtual void readParam (std::istream &in)
 Read the parameter file block. More...
 
virtual void readParamOptional (std::istream &in)
 Read optional parameter file block. More...
 
virtual void readParameters (std::istream &in)
 Read the body of parameter block, without begin and end lines. More...
 
virtual void writeParam (std::ostream &out) const
 Write all parameters to an output stream. More...
 
Serialization: Load and save functions for this composite
virtual void load (Serializable::IArchive &ar)
 Load all parameters from an input archive. More...
 
virtual void loadOptional (Serializable::IArchive &ar)
 Load an optional ParamComposite. More...
 
virtual void loadParameters (Serializable::IArchive &ar)
 Load state from archive, without adding Begin and End lines. More...
 
virtual void save (Serializable::OArchive &ar)
 Saves all parameters to an archive. More...
 
void saveOptional (Serializable::OArchive &ar)
 Saves isActive flag, and then calls save() iff isActive is true. More...
 
read* functions for child components

Each of these functions creates a new instance of a particular subclass of ParamComponent, invokes the readParam() function of the new object to read the associated line or block of a parameter file, and adds the object to the format.

void readParamComposite (std::istream &in, ParamComposite &child, bool next=true)
 Add and read a required child ParamComposite. More...
 
void readParamCompositeOptional (std::istream &in, ParamComposite &child, bool next=true)
 Add and attempt to read an optional child ParamComposite. More...
 
template<typename Type >
ScalarParam< Type > & read (std::istream &in, const char *label, Type &value)
 Add and read a new required ScalarParam < Type > object. More...
 
template<typename Type >
ScalarParam< Type > & readOptional (std::istream &in, const char *label, Type &value)
 Add and read a new optional ScalarParam < Type > object. More...
 
template<typename Type >
CArrayParam< Type > & readCArray (std::istream &in, const char *label, Type *value, int n)
 Add and read a required C array parameter. More...
 
template<typename Type >
CArrayParam< Type > & readOptionalCArray (std::istream &in, const char *label, Type *value, int n)
 Add and read an optional C array parameter. More...
 
template<typename Type >
DArrayParam< Type > & readDArray (std::istream &in, const char *label, DArray< Type > &array, int n)
 Add and read a required DArray < Type > parameter. More...
 
template<typename Type >
DArrayParam< Type > & readOptionalDArray (std::istream &in, const char *label, DArray< Type > &array, int n)
 Add and read an optional DArray < Type > parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & readFArray (std::istream &in, const char *label, FArray< Type, N > &array)
 Add and read a required FArray < Type, N > array parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & readOptionalFArray (std::istream &in, const char *label, FArray< Type, N > &array)
 Add and read an optional FArray < Type, N > array parameter. More...
 
template<typename Type , int N>
FSArrayParam< Type, N > & readFSArray (std::istream &in, const char *label, FSArray< Type, N > &array, int size)
 Add and read a required FSArray < Type, N > array parameter. More...
 
template<typename Type , int N>
FSArrayParam< Type, N > & readOptionalFSArray (std::istream &in, const char *label, FSArray< Type, N > &array, int size)
 Add and read an optional FSArray < Type, N > array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & readCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np)
 Add and read a required CArray2DParam < Type > 2D C-array. More...
 
template<typename Type >
CArray2DParam< Type > & readOptionalCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np)
 Add and read an optional CArray2DParam < Type > 2D C-array parameter. More...
 
template<typename Type >
DMatrixParam< Type > & readDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and read a required DMatrix < Type > matrix parameter. More...
 
template<typename Type >
DMatrixParam< Type > & readOptionalDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and read an optional DMatrix < Type > matrix parameter. More...
 
template<typename Type >
DSymmMatrixParam< Type > & readDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n)
 Add and read a required symmetrix DMatrix. More...
 
template<typename Type >
DSymmMatrixParam< Type > & readOptionalDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n)
 Add and read an optional DMatrix matrix parameter. More...
 
BeginreadBegin (std::istream &in, const char *label, bool isRequired=true)
 Add and read a class label and opening bracket. More...
 
EndreadEnd (std::istream &in)
 Add and read the closing bracket. More...
 
BlankreadBlank (std::istream &in)
 Add and read a new Blank object, representing a blank line. More...
 
load* functions for child components

Load parameters from an Archive, for restarting.

Each of these functions creates a new instance of a subclass of ParamComponent, and invokes the load() function of that new object to load the associated parameter value, and adds the ParamComponent to the format list. These functions are used to load parameters when a program is restarted from a checkpoint file.

void loadParamComposite (Serializable::IArchive &ar, ParamComposite &child, bool next=true)
 Add and load a required child ParamComposite. More...
 
void loadParamCompositeOptional (Serializable::IArchive &ar, ParamComposite &child, bool next=true)
 Add and load an optional child ParamComposite if isActive. More...
 
template<typename Type >
ScalarParam< Type > & loadParameter (Serializable::IArchive &ar, const char *label, Type &value, bool isRequired)
 Add and load a new ScalarParam < Type > object. More...
 
template<typename Type >
ScalarParam< Type > & loadParameter (Serializable::IArchive &ar, const char *label, Type &value)
 Add and load new required ScalarParam < Type > object. More...
 
template<typename Type >
CArrayParam< Type > & loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n, bool isRequired)
 Add a C array parameter and load its elements. More...
 
template<typename Type >
CArrayParam< Type > & loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n)
 Add and load a required CArrayParam< Type > array parameter. More...
 
template<typename Type >
DArrayParam< Type > & loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n, bool isRequired)
 Add an load a DArray < Type > array parameter. More...
 
template<typename Type >
DArrayParam< Type > & loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n)
 Add and load a required DArray< Type > array parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array, bool isRequired)
 Add and load an FArray < Type, N > fixed-size array parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array)
 Add and load a required FArray < Type > array parameter. More...
 
template<typename Type , int N>
FSArrayParam< Type, N > & loadFSArray (Serializable::IArchive &ar, const char *label, FSArray< Type, N > &array, int size, bool isRequired)
 Add and load an FSArray < Type, N > array parameter. More...
 
template<typename Type , int N>
FSArrayParam< Type, N > & loadFSArray (Serializable::IArchive &ar, const char *label, FSArray< Type, N > &array, int size)
 Add and load a required FSArray < Type > array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np, bool isRequired)
 Add and load a CArray2DParam < Type > C 2D array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np)
 Add and load a required < Type > matrix parameter. More...
 
template<typename Type >
DMatrixParam< Type > & loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired)
 Add and load a DMatrixParam < Type > matrix parameter. More...
 
template<typename Type >
DMatrixParam< Type > & loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and load a required DMatrixParam < Type > matrix parameter. More...
 
template<typename Type >
DSymmMatrixParam< Type > & loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n, bool isRequired)
 Add and load a symmetric DSymmMatrixParam < Type > matrix parameter. More...
 
template<typename Type >
DSymmMatrixParam< Type > & loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n)
 Add and load a required DSymmMatrixParam < Type > matrix parameter. More...
 
add* functions for child components

These functions add a ParamComponent to the format array, but do not read data.

void addParamComposite (ParamComposite &child, bool next=true)
 Add a child ParamComposite object to the format array. More...
 
BeginaddBegin (const char *label)
 Add a Begin object representing a class name and bracket. More...
 
EndaddEnd ()
 Add a closing bracket. More...
 
BlankaddBlank ()
 Create and add a new Blank object, representing a blank line. More...
 
- Public Member Functions inherited from Util::ParamComponent
virtual ~ParamComponent ()
 Destructor. More...
 
virtual void readParam (std::istream &in)=0
 Read parameter(s) from file. More...
 
virtual void writeParam (std::ostream &out) const =0
 Read parameter(s) to file. More...
 
virtual void load (Serializable::IArchive &ar)
 Load internal state from an archive. More...
 
virtual void save (Serializable::OArchive &ar)
 Save internal state to an archive. 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...
 
virtual void save (OArchive &ar)=0
 Save to an archive. More...
 
virtual void load (IArchive &ar)=0
 Load from an archive. 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...
 

Accessors

std::string className () const
 Get class name string. More...
 
bool isRequired () const
 Is this ParamComposite required in the input file? More...
 
bool isActive () const
 Is this parameter active? More...
 
void setClassName (const char *className)
 Set class name string. More...
 
void setIsRequired (bool isRequired)
 Set or unset the isActive flag. More...
 
void setIsActive (bool isActive)
 Set or unset the isActive flag. More...
 
void setParent (ParamComponent &param, bool next=true)
 Set this to the parent of a child component. More...
 
void addComponent (ParamComponent &param, bool isLeaf=true)
 Add a new ParamComponent object to the format array. More...
 
template<typename Type >
ScalarParam< Type > & add (std::istream &in, const char *label, Type &value, bool isRequired=true)
 Add a new required ScalarParam < Type > object. More...
 
template<typename Type >
CArrayParam< Type > & addCArray (std::istream &in, const char *label, Type *value, int n, bool isRequired=true)
 Add (but do not read) a required C array parameter. More...
 
template<typename Type >
DArrayParam< Type > & addDArray (std::istream &in, const char *label, DArray< Type > &array, int n, bool isRequired=true)
 Add (but do not read) a DArray < Type > parameter. More...
 
template<typename Type , int N>
FArrayParam< Type, N > & addFArray (std::istream &in, const char *label, FArray< Type, N > &array, bool isRequired=true)
 Add (but do not read) a FArray < Type, N > array parameter. More...
 
template<typename Type , int N>
FSArrayParam< Type, N > & addFSArray (std::istream &in, const char *label, FSArray< Type, N > &array, int size, bool isRequired=true)
 Add (but do not read) a FSArray < Type, N > array parameter. More...
 
template<typename Type >
CArray2DParam< Type > & addCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np, bool isRequired=true)
 Add (but do not read) a CArray2DParam < Type > 2D C-array. More...
 
template<typename Type >
DMatrixParam< Type > & addDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired=true)
 Add and read a required DMatrix < Type > matrix parameter. 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::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...
 
- Protected Member Functions inherited from Util::ParamComponent
 ParamComponent ()
 Constructor. More...
 
 ParamComponent (const ParamComponent &other)
 Copy constructor. More...
 

Detailed Description

An object that can read multiple parameters from file.

Any class that reads a block of parameters from a parameter file must be derived from ParamComposite. Each such class must implement either the readParameters() function or the readParam() function, but not both. The readParameters(), if reimplemented, should read the body of the associated parameter file block, without opening or closing lines. The readParam() function reads the the entire block, including opening line and closing lines. The default implementation of readParam() reads the opening line of the block, calls readParameters() to read the body of the block, and then reads the closing line. Most subclasses of ParamComposite re-implement the readParameters() function, and rely on the default implementation of readParam() to add the Begin and End lines.

The writeParam() function, if called after readParam(), writes the associated parameter block using the same file format as that used to read the data in the earlier call to readParam().

Implementation details:

After parameter file block is read from file, the file format is stored as a private array of ParaComponent* pointers. We will refer to this in what follows as the format_ array. Each pointer in this array may point to a Parameter, ParamComposite, Begin, End, or Blank object. Pointers to these objects are added to the format array as the associated objects are read from file, and are stored in the same order as they appear in the parameter file. The default implementation of the writeParam() function simply calls the writeParam() function of each child ParamComponent.

Subclass implementation details:

The readParameters() function of each subclass of ParamComposite should be implemented using protected member functions of ParamComposite with names that begin with "read". The read<T>() function template can be used to read an individual parameter, while readParamComposite reads the nested subblock associated with a child ParamComposite. There are also more specialized methods (e.g., readDArray<T>to read different types of arrays and matrices of parameters, and to read optional parameters. See the users manual for further details.

The setClassName() and className() functions may be used to set and get a std::string containing the subclass name. The setClassName() function should be called in the constructor of each subclass of ParamComposite. The class name set in the constructor of a subclass will replace any name set by a base class, because of the order in which constructors are called. The default implementation of ParamComposite::readParam() checks if the class name that appears in the opening line of a parameter block agrees with the class name returned by the className() function, and throws an exception if it does not.

Definition at line 90 of file ParamComposite.h.

Constructor & Destructor Documentation

◆ ParamComposite() [1/3]

Util::ParamComposite::ParamComposite ( )

Constructor.

Definition at line 23 of file ParamComposite.cpp.

◆ ParamComposite() [2/3]

Util::ParamComposite::ParamComposite ( const ParamComposite other)

Copy constructor.

Definition at line 55 of file ParamComposite.cpp.

◆ ParamComposite() [3/3]

Util::ParamComposite::ParamComposite ( int  capacity)

Constructor.

Reserve space for capacity elements in the format array.

Parameters
capacitymaximum length of parameter list

Definition at line 36 of file ParamComposite.cpp.

References UTIL_THROW.

◆ ~ParamComposite()

Util::ParamComposite::~ParamComposite ( )
virtual

Virtual destructor.

Definition at line 68 of file ParamComposite.cpp.

Member Function Documentation

◆ resetParam()

void Util::ParamComposite::resetParam ( )
virtual

Resets ParamComposite to its empty state.

This function deletes Parameter, Begin, End, and Blank objects in the format array (i.e., all "leaf" objects in the format tree), invokes the resetParam() function of any child ParamComposite in the format array, and clears the format array.

Reimplemented from Util::ParamComponent.

Definition at line 209 of file ParamComposite.cpp.

◆ readParam()

void Util::ParamComposite::readParam ( std::istream &  in)
virtual

Read the parameter file block.

Inherited from ParamComponent. This function reads the entire parameter block for this ParamComposite, including an opening line, which is of the form "ClassName{", and the closing line, which contains only a closing bracket, "}". The default implementation reads the opening line (a Begin object), calls the virtual readParameters function to read the body of the block, and reads the closing line (an End object).

Exceptions
Throwsif the string in the opening line does not match the string returned by the classname() function.
Parameters
ininput stream for reading

Implements Util::ParamComponent.

Reimplemented in Pscf::Fd1d::System, Pscf::Pspc::System< D >, Pscf::Pspg::System< D >, and Util::Manager< Data >.

Definition at line 88 of file ParamComposite.cpp.

References readBegin(), readEnd(), and readParameters().

Referenced by readParamComposite().

◆ readParamOptional()

void Util::ParamComposite::readParamOptional ( std::istream &  in)
virtual

Read optional parameter file block.

Read an optional ParamComposite. This function must use a Label() object to read the opening "ClassName{" line, and then continues to read the rest of the block if and only if the class name in the opening line matches the string returned by the classname() function.

If the first line matches, the default implementation calls the readParameters() member function to read the body of the block, and then reads the ending line.

Parameters
ininput stream for reading

Reimplemented in Util::Manager< Data >.

Definition at line 101 of file ParamComposite.cpp.

References Util::Begin::isActive(), readBegin(), readEnd(), and readParameters().

Referenced by readParamCompositeOptional().

◆ readParameters()

virtual void Util::ParamComposite::readParameters ( std::istream &  in)
inlinevirtual

Read the body of parameter block, without begin and end lines.

Most subclasses of ParamComposite should re-implement this function, which has an empty default implementation. Every subclass of Paramcomposite must either: (1) Re-implement this function and rely on the default implementation of readParam(), which calls this function. (2) Re-implement readParam() itself. Option (1) is far more common. Option (2) is required only for classes that require a non-standard treatment of the beginning and ending lines (e.g., the Manager class template).

Parameters
ininput stream for reading

Reimplemented in Pscf::Fd1d::Domain, Pscf::Fd1d::BinaryRelaxIterator, Pscf::Fd1d::NrIterator, Pscf::Fd1d::Mixture, Pscf::Fd1d::LinearSweep, Pscf::Fd1d::Sweep, Pscf::Fd1d::System, Pscf::SolventDescriptor, Pscf::Homogeneous::Mixture, Pscf::Homogeneous::Molecule, Pscf::Interaction, Pscf::MixtureTmpl< TP, TS >, Pscf::MixtureTmpl< Polymer, Solvent >, Pscf::MixtureTmpl< Polymer< D >, Solvent< D > >, Pscf::PolymerTmpl< Block >, Pscf::PolymerTmpl< Block< D > >, Pscf::SweepTmpl< State >, Pscf::SweepTmpl< DArray< System::WField > >, Pscf::SweepTmpl< BasisFieldState< D > >, Pscf::Pspc::Domain< D >, Pscf::Pspc::FilmIteratorBase< D, IteratorType >, Pscf::Pspc::FilmIteratorBase< 1, IteratorType >, Pscf::Pspc::FilmIteratorBase< 2, IteratorType >, Pscf::Pspc::FilmIteratorBase< 3, IteratorType >, Pscf::Pspc::Mixture< D >, Pscf::Pspc::LinearSweep< D >, Pscf::Pspc::Sweep< D >, Pscf::Pspc::System< D >, Pscf::Pspg::Domain< D >, Pscf::Pspg::Mixture< D >, Pscf::Pspg::LinearSweep< D >, Pscf::Pspg::Sweep< D >, Pscf::Pspg::System< D >, Util::AutoCorr< Data, Product >, Util::AutoCorrArray< Data, Product >, Util::AutoCorrelation< Data, Product >, Util::Average, Util::Distribution, Util::IntDistribution, Util::MeanSqDispArray< Data >, Util::RadialDistribution, Util::SymmTensorAverage, Util::TensorAverage, Util::FileMaster, Util::Manager< Data >, and Util::Random.

Definition at line 181 of file ParamComposite.h.

Referenced by readParam(), and readParamOptional().

◆ writeParam()

void Util::ParamComposite::writeParam ( std::ostream &  out) const
virtual

Write all parameters to an output stream.

The default implementation iterates through the format array, and calls the readParam() member function of each ParamComponent in the array. This is sufficient for most subclasses.

Parameters
outoutput stream for reading

Implements Util::ParamComponent.

Definition at line 119 of file ParamComposite.cpp.

Referenced by Pscf::Fd1d::Sweep::outputSolution(), Pscf::Fd1d::System::readCommands(), and Pscf::Fd1d::System::writeParamNoSweep().

◆ load()

void Util::ParamComposite::load ( Serializable::IArchive ar)
virtual

Load all parameters from an input archive.

This function is inherited from Serializable. The default implementation of ParamComposite::load() calls loadParameters, and adds Begin and End lines to the format array.. All subclasses of ParamComposite should overload the virtual loadParameters member function.

Parameters
arinput/loading archive.

Reimplemented from Util::ParamComponent.

Reimplemented in Util::AutoCorrelation< Data, Product >.

Definition at line 131 of file ParamComposite.cpp.

References addBegin(), addEnd(), Util::ParamComponent::echo(), Util::Log::file(), Util::MpiFileIo::isIoProcessor(), loadParameters(), Util::Begin::writeParam(), and Util::End::writeParam().

Referenced by loadOptional(), and loadParamComposite().

◆ loadOptional()

void Util::ParamComposite::loadOptional ( Serializable::IArchive ar)
virtual

◆ loadParameters()

virtual void Util::ParamComposite::loadParameters ( Serializable::IArchive ar)
inlinevirtual

Load state from archive, without adding Begin and End lines.

This function should be re-implemented by all subclasses that have an internal state that should be saved in a restart file. The default implementation is empty. Subclass implementations should load the entire internal state from the archive, including parameters that appear in the parameter file and any persistent private member variables that do not appear in the parameter file.

Parameters
arinput/loading archive.

Reimplemented in Util::AutoCorr< Data, Product >, Util::AutoCorrArray< Data, Product >, Util::Average, Util::Distribution, Util::IntDistribution, Util::MeanSqDispArray< Data >, Util::RadialDistribution, Util::SymmTensorAverage, Util::TensorAverage, Util::FileMaster, Util::Manager< Data >, and Util::Random.

Definition at line 234 of file ParamComposite.h.

Referenced by load().

◆ save()

void Util::ParamComposite::save ( Serializable::OArchive ar)
virtual

Saves all parameters to an archive.

The default implementation simply calls the save function for all items in the parameter file format array. This is often not sufficient. Specifically, it is not sufficient for classes that contain any persistent member variables that do not appear in the parameter file format.

If a class also defines a serialize function template, which allows instances to be serialized to any type of archive, then the save function can often be implemented as follows:

{ ar & *this; }
Saving / output archive for binary ostream.
virtual void save(Serializable::OArchive &ar)
Saves all parameters to an archive.
Parameters
aroutput/saving archive.

Reimplemented from Util::ParamComponent.

Reimplemented in Util::AutoCorr< Data, Product >, Util::AutoCorrArray< Data, Product >, Util::AutoCorrelation< Data, Product >, Util::Average, Util::Distribution, Util::IntDistribution, Util::MeanSqDispArray< Data >, Util::RadialDistribution, Util::SymmTensorAverage, Util::TensorAverage, Util::FileMaster, Util::Manager< Data >, and Util::Random.

Definition at line 188 of file ParamComposite.cpp.

Referenced by saveOptional().

◆ saveOptional()

void Util::ParamComposite::saveOptional ( Serializable::OArchive ar)

Saves isActive flag, and then calls save() iff isActive is true.

Parameters
aroutput/saving archive.

Definition at line 198 of file ParamComposite.cpp.

References save().

◆ readParamComposite()

void Util::ParamComposite::readParamComposite ( std::istream &  in,
ParamComposite child,
bool  next = true 
)

Add and read a required child ParamComposite.

Parameters
ininput stream for reading
childchild ParamComposite object
nexttrue if the indent level is one higher than parent.

Definition at line 260 of file ParamComposite.cpp.

References addParamComposite(), and readParam().

Referenced by Pscf::Fd1d::System::readParameters(), and Pscf::Homogeneous::Mixture::readParameters().

◆ readParamCompositeOptional()

void Util::ParamComposite::readParamCompositeOptional ( std::istream &  in,
ParamComposite child,
bool  next = true 
)

Add and attempt to read an optional child ParamComposite.

Parameters
ininput stream for reading
childchild ParamComposite object
nexttrue if the indent level is one higher than parent.

Definition at line 271 of file ParamComposite.cpp.

References addParamComposite(), and readParamOptional().

◆ read()

template<typename Type >
ScalarParam< Type > & Util::ParamComposite::read ( std::istream &  in,
const char *  label,
Type &  value 
)

◆ readOptional()

template<typename Type >
ScalarParam< Type > & Util::ParamComposite::readOptional ( std::istream &  in,
const char *  label,
Type &  value 
)
inline

Add and read a new optional ScalarParam < Type > object.

This is equivalent to ScalarParam<Type>(in, label, value, false).

Parameters
ininput stream for reading
labelLabel string
valuereference to new ScalarParam< Type >

Definition at line 1256 of file ParamComposite.h.

Referenced by Pscf::Fd1d::Domain::readParameters(), Pscf::Fd1d::NrIterator::readParameters(), and Pscf::SolventDescriptor::readParameters().

◆ readCArray()

template<typename Type >
CArrayParam< Type > & Util::ParamComposite::readCArray ( std::istream &  in,
const char *  label,
Type *  value,
int  n 
)
inline

Add and read a required C array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
valuepointer to array
nnumber of elements
Returns
reference to the new CArrayParam<Type> object

Definition at line 1323 of file ParamComposite.h.

◆ readOptionalCArray()

template<typename Type >
CArrayParam< Type > & Util::ParamComposite::readOptionalCArray ( std::istream &  in,
const char *  label,
Type *  value,
int  n 
)
inline

Add and read an optional C array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
valuepointer to array
nnumber of elements
Returns
reference to the new CArrayParam<Type> object

Definition at line 1332 of file ParamComposite.h.

◆ readDArray()

template<typename Type >
DArrayParam< Type > & Util::ParamComposite::readDArray ( std::istream &  in,
const char *  label,
DArray< Type > &  array,
int  n 
)
inline

Add and read a required DArray < Type > parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayDArray object
nnumber of elements
Returns
reference to the new DArrayParam<Type> object

Definition at line 1400 of file ParamComposite.h.

◆ readOptionalDArray()

template<typename Type >
DArrayParam< Type > & Util::ParamComposite::readOptionalDArray ( std::istream &  in,
const char *  label,
DArray< Type > &  array,
int  n 
)
inline

Add and read an optional DArray < Type > parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayDArray object
nnumber of elements
Returns
reference to the new DArrayParam<Type> object

Definition at line 1410 of file ParamComposite.h.

◆ readFArray()

template<typename Type , int N>
FArrayParam< Type, N > & Util::ParamComposite::readFArray ( std::istream &  in,
const char *  label,
FArray< Type, N > &  array 
)
inline

Add and read a required FArray < Type, N > array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayFArray object
Returns
reference to the new FArrayParam<Type, N> object

Definition at line 1480 of file ParamComposite.h.

◆ readOptionalFArray()

template<typename Type , int N>
FArrayParam< Type, N > & Util::ParamComposite::readOptionalFArray ( std::istream &  in,
const char *  label,
FArray< Type, N > &  array 
)
inline

Add and read an optional FArray < Type, N > array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayFArray object
Returns
reference to the new FArrayParam<Type, N> object

Definition at line 1490 of file ParamComposite.h.

◆ readFSArray()

template<typename Type , int N>
FSArrayParam< Type, N > & Util::ParamComposite::readFSArray ( std::istream &  in,
const char *  label,
FSArray< Type, N > &  array,
int  size 
)
inline

Add and read a required FSArray < Type, N > array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayFSArray object
sizelogical size of array
Returns
reference to the new FSArrayParam<Type, N> object

Definition at line 1551 of file ParamComposite.h.

◆ readOptionalFSArray()

template<typename Type , int N>
FSArrayParam< Type, N > & Util::ParamComposite::readOptionalFSArray ( std::istream &  in,
const char *  label,
FSArray< Type, N > &  array,
int  size 
)
inline

Add and read an optional FSArray < Type, N > array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayFSArray object
sizelogical size of array
Returns
reference to the new FSArrayParam<Type, N> object

Definition at line 1561 of file ParamComposite.h.

◆ readCArray2D()

template<typename Type >
CArray2DParam< Type > & Util::ParamComposite::readCArray2D ( std::istream &  in,
const char *  label,
Type *  value,
int  m,
int  n,
int  np 
)
inline

Add and read a required CArray2DParam < Type > 2D C-array.

Parameters
ininput stream for reading
labelLabel string for new array
valuepointer to array
mnumber of rows (1st dimension)
nlogical number of columns (2nd dimension)
npphysical number of columns (elements allocated per row)
Returns
reference to the CArray2DParam<Type> object

Definition at line 1625 of file ParamComposite.h.

◆ readOptionalCArray2D()

template<typename Type >
CArray2DParam< Type > & Util::ParamComposite::readOptionalCArray2D ( std::istream &  in,
const char *  label,
Type *  value,
int  m,
int  n,
int  np 
)
inline

Add and read an optional CArray2DParam < Type > 2D C-array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
valuepointer to array
mnumber of rows (1st dimension)
nlogical number of columns (2nd dimension)
npphysical number of columns (elements allocated per row)
Returns
reference to the CArray2DParam<Type> object

Definition at line 1634 of file ParamComposite.h.

◆ readDMatrix()

template<typename Type >
DMatrixParam< Type > & Util::ParamComposite::readDMatrix ( std::istream &  in,
const char *  label,
DMatrix< Type > &  matrix,
int  m,
int  n 
)
inline

Add and read a required DMatrix < Type > matrix parameter.

Parameters
ininput stream for reading
labelLabel string for new array
matrixDMatrix object
mnumber of rows (1st dimension)
nnumber of columns (2nd dimension)
Returns
reference to the DMatrixParam<Type> object

Definition at line 1707 of file ParamComposite.h.

◆ readOptionalDMatrix()

template<typename Type >
DMatrixParam< Type > & Util::ParamComposite::readOptionalDMatrix ( std::istream &  in,
const char *  label,
DMatrix< Type > &  matrix,
int  m,
int  n 
)
inline

Add and read an optional DMatrix < Type > matrix parameter.

Parameters
ininput stream for reading
labelLabel string for new array
matrixDMatrix object
mnumber of rows (1st dimension)
nnumber of columns (2nd dimension)
Returns
reference to the DMatrixParam<Type> object

Definition at line 1716 of file ParamComposite.h.

◆ readDSymmMatrix()

template<typename Type >
DSymmMatrixParam< Type > & Util::ParamComposite::readDSymmMatrix ( std::istream &  in,
const char *  label,
DMatrix< Type > &  matrix,
int  n 
)
inline

Add and read a required symmetrix DMatrix.

Parameters
ininput stream for reading
labelLabel string for new array
matrixDMatrix object
nnumber of rows or columns
Returns
reference to the DMatrixParam<Type> object

Definition at line 1772 of file ParamComposite.h.

Referenced by Pscf::Interaction::readParameters().

◆ readOptionalDSymmMatrix()

template<typename Type >
DSymmMatrixParam< Type > & Util::ParamComposite::readOptionalDSymmMatrix ( std::istream &  in,
const char *  label,
DMatrix< Type > &  matrix,
int  n 
)
inline

Add and read an optional DMatrix matrix parameter.

Parameters
ininput stream for reading
labelLabel string for new array
matrixDMatrix object
nnumber of rows or columns
Returns
reference to the DMatrixParam<Type> object

Definition at line 1783 of file ParamComposite.h.

◆ readBegin()

Begin & Util::ParamComposite::readBegin ( std::istream &  in,
const char *  label,
bool  isRequired = true 
)

Add and read a class label and opening bracket.

Parameters
ininput stream for reading
labelclass name string, without trailing bracket
isRequiredIs this the beginning of a required element?
Returns
reference to the new Begin object

Definition at line 316 of file ParamComposite.cpp.

References addComponent(), Util::Begin::isActive(), isRequired(), Util::Begin::readParam(), and setParent().

Referenced by Pscf::Fd1d::System::readParam(), readParam(), and readParamOptional().

◆ readEnd()

End & Util::ParamComposite::readEnd ( std::istream &  in)

Add and read the closing bracket.

Parameters
ininput stream for reading
Returns
reference to the new End object

Definition at line 344 of file ParamComposite.cpp.

References addEnd(), and Util::End::readParam().

Referenced by Pscf::Fd1d::System::readParam(), readParam(), and readParamOptional().

◆ readBlank()

Blank & Util::ParamComposite::readBlank ( std::istream &  in)

Add and read a new Blank object, representing a blank line.

Parameters
ininput stream for reading
Returns
reference to the new Blank object

Definition at line 367 of file ParamComposite.cpp.

References addBlank(), and Util::Blank::readParam().

◆ loadParamComposite()

void Util::ParamComposite::loadParamComposite ( Serializable::IArchive ar,
ParamComposite child,
bool  next = true 
)

Add and load a required child ParamComposite.

Parameters
arinput archive for loading
childchild ParamComposite object
nexttrue if the indent level is one higher than parent.

Definition at line 282 of file ParamComposite.cpp.

References addParamComposite(), and load().

Referenced by Util::Factory< Data >::loadObject().

◆ loadParamCompositeOptional()

void Util::ParamComposite::loadParamCompositeOptional ( Serializable::IArchive ar,
ParamComposite child,
bool  next = true 
)

Add and load an optional child ParamComposite if isActive.

This functional loads the isActive flag, and then calls the load function of the child iff isActive is true.

Parameters
arinput archive for loading
childchild ParamComposite object
nexttrue if the indent level is one higher than parent.

Definition at line 293 of file ParamComposite.cpp.

References addParamComposite(), and loadOptional().

◆ loadParameter() [1/2]

template<typename Type >
ScalarParam< Type > & Util::ParamComposite::loadParameter ( Serializable::IArchive ar,
const char *  label,
Type &  value,
bool  isRequired 
)

Add and load a new ScalarParam < Type > object.

An optional parameter is indicated by setting isRequired = false. Optional parameters must be saved using the Parameter::saveOptional() static member function.

Parameters
ararchive for loading
labelLabel string
valuereference to the Type variable
isRequiredIs this a required parameter?
Returns
reference to the new ScalarParam < Type > object

Definition at line 1265 of file ParamComposite.h.

References addComponent(), isRequired(), Util::Parameter::load(), and setParent().

◆ loadParameter() [2/2]

template<typename Type >
ScalarParam< Type > & Util::ParamComposite::loadParameter ( Serializable::IArchive ar,
const char *  label,
Type &  value 
)
inline

Add and load new required ScalarParam < Type > object.

Equivalent to loadParameter < Type > (ar, label, value, true).

Parameters
ararchive for loading
labellabel string
valuereference to the Type variable
Returns
reference to the new ScalarParam < Type > object

Definition at line 1281 of file ParamComposite.h.

◆ loadCArray() [1/2]

template<typename Type >
CArrayParam< Type > & Util::ParamComposite::loadCArray ( Serializable::IArchive ar,
const char *  label,
Type *  value,
int  n,
bool  isRequired 
)

Add a C array parameter and load its elements.

Parameters
ararchive for loading
labellabel string for new array
valuepointer to array
nnumber of elements
isRequiredIs this a required parameter?
Returns
reference to the new CArrayParam<Type> object

Definition at line 1341 of file ParamComposite.h.

References addComponent(), isRequired(), Util::ArrayParam< Type >::load(), and setParent().

◆ loadCArray() [2/2]

template<typename Type >
CArrayParam< Type > & Util::ParamComposite::loadCArray ( Serializable::IArchive ar,
const char *  label,
Type *  value,
int  n 
)
inline

Add and load a required CArrayParam< Type > array parameter.

Equivalent to loadCArray < Type > (ar, label, value, n, true).

Parameters
ararchive for loading
labellabel string for new array
valuepointer to array
nnumber of elements
Returns
reference to the new CArrayParam<Type> object

Definition at line 1357 of file ParamComposite.h.

◆ loadDArray() [1/2]

template<typename Type >
DArrayParam< Type > & Util::ParamComposite::loadDArray ( Serializable::IArchive ar,
const char *  label,
DArray< Type > &  array,
int  n,
bool  isRequired 
)

Add an load a DArray < Type > array parameter.

Parameters
ararchive for loading
labelLabel string for new array
arrayDArray object
nnumber of elements (logical size)
isRequiredIs this a required parameter?
Returns
reference to the new DArrayParam<Type> object

Definition at line 1419 of file ParamComposite.h.

References addComponent(), isRequired(), Util::ArrayParam< Type >::load(), and setParent().

◆ loadDArray() [2/2]

template<typename Type >
DArrayParam< Type > & Util::ParamComposite::loadDArray ( Serializable::IArchive ar,
const char *  label,
DArray< Type > &  array,
int  n 
)
inline

Add and load a required DArray< Type > array parameter.

Equivalent to loadDArrayParam < Type > (ar, label, array, n, true).

Parameters
ararchive for loading
labelLabel string for new array
arrayDArray object
nnumber of elements (logical size)
Returns
reference to the new DArrayParam<Type> object

Definition at line 1435 of file ParamComposite.h.

◆ loadFArray() [1/2]

template<typename Type , int N>
FArrayParam< Type, N > & Util::ParamComposite::loadFArray ( Serializable::IArchive ar,
const char *  label,
FArray< Type, N > &  array,
bool  isRequired 
)

Add and load an FArray < Type, N > fixed-size array parameter.

Parameters
ararchive for loading
labellabel string for new array
arrayFArray object
isRequiredIs this a required parameter?
Returns
reference to the new FArrayParam<Type, N> object

Definition at line 1499 of file ParamComposite.h.

References addComponent(), isRequired(), Util::ArrayParam< Type >::load(), and setParent().

◆ loadFArray() [2/2]

template<typename Type , int N>
FArrayParam< Type, N > & Util::ParamComposite::loadFArray ( Serializable::IArchive ar,
const char *  label,
FArray< Type, N > &  array 
)
inline

Add and load a required FArray < Type > array parameter.

Equivalent to loadFArrayParam < Type > (ar, label, array, true).

Parameters
ararchive for loading
labellabel string for new array
arrayFArray object
Returns
reference to the new FArrayParam<Type, N> object

Definition at line 704 of file ParamComposite.h.

◆ loadFSArray() [1/2]

template<typename Type , int N>
FSArrayParam< Type, N > & Util::ParamComposite::loadFSArray ( Serializable::IArchive ar,
const char *  label,
FSArray< Type, N > &  array,
int  size,
bool  isRequired 
)

Add and load an FSArray < Type, N > array parameter.

Parameters
ararchive for loading
labellabel string for new array
arrayFSArray object
sizelogical size of array (number of elements)
isRequiredIs this a required parameter?
Returns
reference to the new FSArrayParam<Type, N> object

Definition at line 1572 of file ParamComposite.h.

References addComponent(), isRequired(), Util::ArrayParam< Type >::load(), and setParent().

◆ loadFSArray() [2/2]

template<typename Type , int N>
FSArrayParam< Type, N > & Util::ParamComposite::loadFSArray ( Serializable::IArchive ar,
const char *  label,
FSArray< Type, N > &  array,
int  size 
)
inline

Add and load a required FSArray < Type > array parameter.

Equivalent to loadFSArrayParam < Type > (ar, label, array, size, true).

Parameters
ararchive for loading
labellabel string for new array
arrayFSArray object
sizelogical size of array (number of elements)
Returns
reference to the new FSArrayParam<Type, N> object

Definition at line 736 of file ParamComposite.h.

◆ loadCArray2D() [1/2]

template<typename Type >
CArray2DParam< Type > & Util::ParamComposite::loadCArray2D ( Serializable::IArchive ar,
const char *  label,
Type *  value,
int  m,
int  n,
int  np,
bool  isRequired 
)

Add and load a CArray2DParam < Type > C 2D array parameter.

Parameters
ararchive for loading
labelLabel string for new array
valuepointer to array
mnumber of rows (1st dimension)
nlogical number of columns (2nd dimension)
npphysical number of columns (elements allocated per row)
isRequiredIs this a required parameter?
Returns
reference to the CArray2DParam<Type> object

Definition at line 1644 of file ParamComposite.h.

References addComponent(), isRequired(), Util::MatrixParam< Type >::load(), and setParent().

◆ loadCArray2D() [2/2]

template<typename Type >
CArray2DParam< Type > & Util::ParamComposite::loadCArray2D ( Serializable::IArchive ar,
const char *  label,
Type *  value,
int  m,
int  n,
int  np 
)

Add and load a required < Type > matrix parameter.

Equivalent to loadCArray2DParam < Type > (ar, label, value, m, n, np, true).

Parameters
ararchive for loading
labelLabel string for new array
valuepointer to array
mnumber of rows (1st dimension)
nlogical number of columns (2nd dimension)
npphysical number of columns (elements allocated per row)
Returns
reference to the CArray2DParam<Type> object

Definition at line 1662 of file ParamComposite.h.

◆ loadDMatrix() [1/2]

template<typename Type >
DMatrixParam< Type > & Util::ParamComposite::loadDMatrix ( Serializable::IArchive ar,
const char *  label,
DMatrix< Type > &  matrix,
int  m,
int  n,
bool  isRequired 
)

Add and load a DMatrixParam < Type > matrix parameter.

Parameters
ararchive for loading
labelLabel string for new array
matrixDMatrix object
mnumber of rows (1st dimension)
nnumber of columns (2nd dimension)
isRequiredIs this a required parameter?
Returns
reference to the DMatrixParam<Type> object

Definition at line 1725 of file ParamComposite.h.

References addComponent(), isRequired(), Util::MatrixParam< Type >::load(), and setParent().

◆ loadDMatrix() [2/2]

template<typename Type >
DMatrixParam< Type > & Util::ParamComposite::loadDMatrix ( Serializable::IArchive ar,
const char *  label,
DMatrix< Type > &  matrix,
int  m,
int  n 
)
inline

Add and load a required DMatrixParam < Type > matrix parameter.

Parameters
ararchive for loading
labelLabel string for new array
matrixDMatrix object
mnumber of rows (1st dimension)
nnumber of columns (2nd dimension)
Returns
reference to the DMatrixParam<Type> object

Definition at line 1742 of file ParamComposite.h.

◆ loadDSymmMatrix() [1/2]

template<typename Type >
DSymmMatrixParam< Type > & Util::ParamComposite::loadDSymmMatrix ( Serializable::IArchive ar,
const char *  label,
DMatrix< Type > &  matrix,
int  n,
bool  isRequired 
)

Add and load a symmetric DSymmMatrixParam < Type > matrix parameter.

Parameters
ararchive for loading
labelLabel string for new array
matrixDMatrix object
nnumber of rows or columns
isRequiredIs this a required parameter?
Returns
reference to the DMatrixParam<Type> object

Definition at line 1794 of file ParamComposite.h.

References addComponent(), isRequired(), Util::MatrixParam< Type >::load(), and setParent().

◆ loadDSymmMatrix() [2/2]

template<typename Type >
DSymmMatrixParam< Type > & Util::ParamComposite::loadDSymmMatrix ( Serializable::IArchive ar,
const char *  label,
DMatrix< Type > &  matrix,
int  n 
)
inline

Add and load a required DSymmMatrixParam < Type > matrix parameter.

Parameters
ararchive for loading
labelLabel string for new array
matrixDMatrix object
nnumber of rows or columns
Returns
reference to the DMatrixParam<Type> object

Definition at line 1813 of file ParamComposite.h.

◆ addParamComposite()

void Util::ParamComposite::addParamComposite ( ParamComposite child,
bool  next = true 
)

Add a child ParamComposite object to the format array.

Parameters
childchild ParamComposite object
nexttrue if the indent level is one higher than parent.

Definition at line 249 of file ParamComposite.cpp.

References addComponent(), and setParent().

Referenced by loadParamComposite(), loadParamCompositeOptional(), Util::Factory< Data >::readObject(), readParamComposite(), and readParamCompositeOptional().

◆ addBegin()

Begin & Util::ParamComposite::addBegin ( const char *  label)

Add a Begin object representing a class name and bracket.

Parameters
labelclass name string, without trailing bracket
Returns
reference to the new begin object.

Definition at line 305 of file ParamComposite.cpp.

References addComponent(), and setParent().

Referenced by load().

◆ addEnd()

End & Util::ParamComposite::addEnd ( )

Add a closing bracket.

Returns
reference to the new End object.

Definition at line 333 of file ParamComposite.cpp.

References addComponent(), and setParent().

Referenced by load(), and readEnd().

◆ addBlank()

Blank & Util::ParamComposite::addBlank ( )

Create and add a new Blank object, representing a blank line.

Returns
reference to the new Blank object

Definition at line 356 of file ParamComposite.cpp.

References addComponent(), and setParent().

Referenced by readBlank().

◆ className()

std::string Util::ParamComposite::className ( ) const
inline

◆ isRequired()

bool Util::ParamComposite::isRequired ( ) const
inline

◆ isActive()

bool Util::ParamComposite::isActive ( ) const
inline

Is this parameter active?

Definition at line 1207 of file ParamComposite.h.

Referenced by setIsActive().

◆ setClassName()

void Util::ParamComposite::setClassName ( const char *  className)
protected

Set class name string.

Should be set in subclass constructor.

Definition at line 377 of file ParamComposite.cpp.

References className().

Referenced by Util::AutoCorr< Data, Product >::AutoCorr(), Util::AutoCorrArray< Data, Product >::AutoCorrArray(), Util::Average::Average(), Pscf::Fd1d::BinaryRelaxIterator::BinaryRelaxIterator(), Util::Distribution::Distribution(), Pscf::Fd1d::Domain::Domain(), Pscf::Pspc::Domain< D >::Domain(), Pscf::Pspg::Domain< D >::Domain(), Util::FileMaster::FileMaster(), Pscf::Pspc::FilmIterator< 1, IteratorType >::FilmIterator(), Pscf::Pspc::FilmIterator< 2, IteratorType >::FilmIterator(), Pscf::Pspc::FilmIterator< 3, IteratorType >::FilmIterator(), Pscf::Pspc::FilmIteratorBase< D, IteratorType >::FilmIteratorBase(), Util::IntDistribution::IntDistribution(), Pscf::Interaction::Interaction(), Pscf::Fd1d::Iterator::Iterator(), Pscf::Pspc::Iterator< D >::Iterator(), Pscf::Pspg::Iterator< D >::Iterator(), Pscf::Fd1d::Mixture::Mixture(), Pscf::Homogeneous::Mixture::Mixture(), Pscf::Pspc::Mixture< D >::Mixture(), Pscf::Pspg::Mixture< D >::Mixture(), Pscf::Homogeneous::Molecule::Molecule(), Pscf::Fd1d::NrIterator::NrIterator(), Pscf::Fd1d::Polymer::Polymer(), Pscf::PolymerTmpl< Block >::PolymerTmpl(), Util::RadialDistribution::RadialDistribution(), Util::Random::Random(), Pscf::Fd1d::Solvent::Solvent(), Pscf::Pspc::Solvent< D >::Solvent(), Pscf::SolventDescriptor::SolventDescriptor(), Pscf::Fd1d::Sweep::Sweep(), Pscf::SweepTmpl< State >::SweepTmpl(), Util::SymmTensorAverage::SymmTensorAverage(), Pscf::Fd1d::System::System(), Pscf::Pspc::System< D >::System(), Pscf::Pspg::System< D >::System(), and Util::TensorAverage::TensorAverage().

◆ setIsRequired()

void Util::ParamComposite::setIsRequired ( bool  isRequired)
protected

Set or unset the isActive flag.

Required to re-implement readParam[Optional].

Parameters
isRequiredflag to set true or false.

Definition at line 383 of file ParamComposite.cpp.

References isRequired().

◆ setIsActive()

void Util::ParamComposite::setIsActive ( bool  isActive)
protected

Set or unset the isActive flag.

Required to re-implement readParam[Optional].

Parameters
isActiveflag to set true or false.

Definition at line 394 of file ParamComposite.cpp.

References isActive(), and UTIL_THROW.

◆ setParent()

void Util::ParamComposite::setParent ( ParamComponent param,
bool  next = true 
)
protected

Set this to the parent of a child component.

This function sets the indent and (ifdef UTIL_MPI) the ioCommunicator of the child component.

Parameters
paramchild ParamComponent
nextif true, set indent level one higher than for parent.

Definition at line 224 of file ParamComposite.cpp.

References Util::MpiFileIo::hasIoCommunicator(), Util::MpiFileIo::ioCommunicator(), Util::ParamComponent::setIndent(), and Util::MpiFileIo::setIoCommunicator().

Referenced by add(), addBegin(), addBlank(), addCArray(), addCArray2D(), addDArray(), addDMatrix(), addEnd(), addFArray(), addFSArray(), addParamComposite(), loadCArray(), loadCArray2D(), loadDArray(), loadDMatrix(), loadDSymmMatrix(), loadFArray(), loadFSArray(), loadParameter(), and readBegin().

◆ addComponent()

void Util::ParamComposite::addComponent ( ParamComponent param,
bool  isLeaf = true 
)
protected

◆ add()

template<typename Type >
ScalarParam< Type > & Util::ParamComposite::add ( std::istream &  in,
const char *  label,
Type &  value,
bool  isRequired = true 
)
protected

Add a new required ScalarParam < Type > object.

Parameters
ininput stream for reading
labelLabel string
valuereference to new ScalarParam< Type >
isRequiredIs this a required parameter?
Returns
reference to the new ScalarParam<Type> object

Definition at line 1233 of file ParamComposite.h.

References addComponent(), isRequired(), and setParent().

◆ addCArray()

template<typename Type >
CArrayParam< Type > & Util::ParamComposite::addCArray ( std::istream &  in,
const char *  label,
Type *  value,
int  n,
bool  isRequired = true 
)
protected

Add (but do not read) a required C array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
valuepointer to array
nnumber of elements
isRequiredIs this a required parameter?
Returns
reference to the new CArrayParam<Type> object

Definition at line 1308 of file ParamComposite.h.

References addComponent(), isRequired(), and setParent().

◆ addDArray()

template<typename Type >
DArrayParam< Type > & Util::ParamComposite::addDArray ( std::istream &  in,
const char *  label,
DArray< Type > &  array,
int  n,
bool  isRequired = true 
)
protected

Add (but do not read) a DArray < Type > parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayDArray object
nnumber of elements
isRequiredIs this a required parameter?
Returns
reference to the new DArrayParam<Type> object

Definition at line 1384 of file ParamComposite.h.

References addComponent(), isRequired(), and setParent().

◆ addFArray()

template<typename Type , int N>
FArrayParam< Type, N > & Util::ParamComposite::addFArray ( std::istream &  in,
const char *  label,
FArray< Type, N > &  array,
bool  isRequired = true 
)
protected

Add (but do not read) a FArray < Type, N > array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayFArray object
isRequiredIs this a required parameter?
Returns
reference to the new FArrayParam<Type, N> object

Definition at line 1464 of file ParamComposite.h.

References addComponent(), isRequired(), and setParent().

◆ addFSArray()

template<typename Type , int N>
FSArrayParam< Type, N > & Util::ParamComposite::addFSArray ( std::istream &  in,
const char *  label,
FSArray< Type, N > &  array,
int  size,
bool  isRequired = true 
)
protected

Add (but do not read) a FSArray < Type, N > array parameter.

Parameters
ininput stream for reading
labelLabel string for new array
arrayFSArray object
sizelogical size (number of elements)
isRequiredIs this a required parameter?
Returns
reference to the new FSArrayParam<Type, N> object

Definition at line 1534 of file ParamComposite.h.

References addComponent(), isRequired(), and setParent().

◆ addCArray2D()

template<typename Type >
CArray2DParam< Type > & Util::ParamComposite::addCArray2D ( std::istream &  in,
const char *  label,
Type *  value,
int  m,
int  n,
int  np,
bool  isRequired = true 
)
protected

Add (but do not read) a CArray2DParam < Type > 2D C-array.

Parameters
ininput stream for reading
labelLabel string for new array
valuepointer to array
mnumber of rows (1st dimension)
nlogical number of columns (2nd dimension)
npphysical number of columns (elements allocated per row)
isRequiredIs this a required parameter?
Returns
reference to the CArray2DParam<Type> object

Definition at line 1609 of file ParamComposite.h.

References addComponent(), isRequired(), and setParent().

◆ addDMatrix()

template<typename Type >
DMatrixParam< Type > & Util::ParamComposite::addDMatrix ( std::istream &  in,
const char *  label,
DMatrix< Type > &  matrix,
int  m,
int  n,
bool  isRequired = true 
)
protected

Add and read a required DMatrix < Type > matrix parameter.

Parameters
ininput stream for reading
labelLabel string for new array
matrixDMatrix object
mnumber of rows (1st dimension)
nnumber of columns (2nd dimension)
isRequiredIs this a required parameter?
Returns
reference to the DMatrixParam<Type> object

Definition at line 1691 of file ParamComposite.h.

References addComponent(), isRequired(), and setParent().


The documentation for this class was generated from the following files: