Simpatico  v1.10
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
Util::ParamComponent Class Referenceabstract

Detailed Description

Abstract base class for classes that input and ouput parameters to file.

The readParam method reads a parameter or parameter list from iostream. The writeParam method writes a parameter or parameter list to an ostream. The same io format should be used by write and read methods.

Definition at line 31 of file ParamComponent.h.

#include <ParamComponent.h>

Inheritance diagram for Util::ParamComponent:
Util::Serializable Util::MpiFileIo Util::Begin Util::Blank Util::End Util::ParamComposite Util::Parameter Util::AutoCorr< double, double > Util::AutoCorr< std::complex< double >, std::complex< double > > Util::AutoCorrArray< Util::Tensor, double > Util::AutoCorrArray< Util::Vector, double > Util::AutoCorrelation< Tensor, double > Util::AutoCorrelation< Util::Tensor, double > DdMd::Analyzer DdMd::AtomCollector DdMd::AtomDistributor DdMd::AtomStorage DdMd::Buffer DdMd::ConfigIo DdMd::Domain DdMd::GroupCollector< N > DdMd::GroupDistributor< N > DdMd::GroupStorage< N > DdMd::Integrator DdMd::Modifier DdMd::Potential DdMd::Simulation DdMd::GroupStorage< 2 > DdMd::GroupStorage< 3 > DdMd::GroupStorage< 4 > Util::Manager< Analyzer > Util::Manager< Command > Util::Manager< McMove > Util::Manager< Modifier > Util::Manager< Simp::Species > McMd::Analyzer McMd::AnglePotential McMd::BondPotential McMd::ColVar McMd::Command McMd::CvBias McMd::DihedralPotential McMd::ExternalPotential McMd::LinkMaster McMd::McMove McMd::McPairPotential McMd::MdCoulombPotential McMd::MdIntegrator McMd::MdPairPotential McMd::PairList McMd::Perturbation McMd::ReplicaMove McMd::Simulation McMd::SpecialPotential McMd::System Util::MeanSqDispArray< Util::Vector > Simp::BoundaryEnsemble Simp::BoxExternal Simp::CompensatedPair< BarePair, LinkPotential > Simp::CompositeBond< BareBond, BarePair > Simp::CosineAngle Simp::CosineDihedral Simp::CosineSqAngle Simp::DpdPair Simp::EnergyEnsemble Simp::EwaldInteraction Simp::FeneBond Simp::GeneralPeriodicExternal Simp::HarmonicAngle Simp::HarmonicBond Simp::HarmonicL0Bond Simp::LamellarOrderingExternal Simp::LJPair Simp::LocalLamellarOrderingExternal Simp::MultiHarmonicDihedral Simp::NucleationExternal Simp::OrthoBoxExternal Simp::PeriodicExternal Simp::SimplePeriodicExternal Simp::SlitExternal Simp::Species Simp::SpeciesEnsemble Simp::SphericalTabulatedExternal Tools::Analyzer Tools::ChainMaker Tools::ConfigReader Tools::Configuration Tools::ConfigWriter Tools::TrajectoryReader 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 Util::CArray2DParam< Type > Util::CArrayParam< Type > Util::DArrayParam< Type > Util::DMatrixParam< Type > Util::DSymmMatrixParam< Type > Util::FArrayParam< Type, N > Util::ScalarParam< Type >

Public Member Functions

virtual ~ParamComponent ()
 Destructor. More...
 
virtual void readParam (std::istream &in)=0
 Read parameter(s) from file. More...
 
virtual void writeParam (std::ostream &out)=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...
 
- 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...
 

Static Public Member Functions

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

 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...
 

Constructor & Destructor Documentation

Util::ParamComponent::~ParamComponent ( )
virtual

Destructor.

Definition at line 36 of file ParamComponent.cpp.

Util::ParamComponent::ParamComponent ( )
protected

Constructor.

Protected to prevent instantiation of a conceptually abstract class.

On return the indent string is empty. If UTIL_MPI is defined, no communicator is set upon construction.

Definition at line 20 of file ParamComponent.cpp.

Referenced by resetParam().

Util::ParamComponent::ParamComponent ( const ParamComponent other)
protected

Copy constructor.

Definition at line 28 of file ParamComponent.cpp.

Member Function Documentation

virtual void Util::ParamComponent::readParam ( std::istream &  in)
pure virtual
virtual void Util::ParamComponent::writeParam ( std::ostream &  out)
pure virtual
virtual void Util::ParamComponent::load ( Serializable::IArchive ar)
inlinevirtual

Load internal state from an archive.

The default implementation is empty. This default is used by the Begin, End, and Blank subclasses.

Implements Util::Serializable.

Reimplemented in Util::ParamComposite, Util::Parameter, McMd::McNVTChemicalPotential, Util::AutoCorrelation< Data, Product >, Util::AutoCorrelation< Tensor, double >, and Util::AutoCorrelation< Util::Tensor, double >.

Definition at line 61 of file ParamComponent.h.

virtual void Util::ParamComponent::save ( Serializable::OArchive ar)
inlinevirtual

Save internal state to an archive.

The default implementation is empty. This default is used by the Begin, End, and Blank subclasses.

Implements Util::Serializable.

Reimplemented in DdMd::Buffer, Util::ParamComposite, Util::FileMaster, DdMd::Simulation, McMd::Simulation, Util::Parameter, Simp::Species, McMd::MdSimulation, McMd::McSimulation, McMd::IntraStructureFactor, McMd::StructureFactorP, DdMd::PairPotential, Util::Manager< Data >, Util::Manager< Command >, Util::Manager< Modifier >, Util::Manager< McMove >, Util::Manager< Analyzer >, Util::Manager< Simp::Species >, DdMd::Analyzer, McMd::VanHove, DdMd::VanHove, DdMd::AtomStorage, DdMd::StructureFactor, Simp::OrthoBoxExternal, DdMd::PairPotentialImpl< Interaction >, Simp::LocalLamellarOrderingExternal, DdMd::GroupStorage< N >, DdMd::GroupStorage< 2 >, DdMd::GroupStorage< 3 >, DdMd::GroupStorage< 4 >, Simp::BoxExternal, McMd::IntraStructureFactorGrid, McMd::BlockRadiusGyration, Simp::SlitExternal, McMd::ReplicaMove, Simp::LamellarOrderingExternal, Util::AutoCorrArray< Data, Product >, DdMd::StructureFactorGrid, Util::AutoCorrArray< Util::Vector, double >, Util::AutoCorrArray< Util::Tensor, double >, Simp::GeneralPeriodicExternal, Simp::NucleationExternal, Simp::PeriodicExternal, Simp::SimplePeriodicExternal, McMd::StructureFactorGrid, McMd::StructureFactorPGrid, McMd::PairList, DdMd::DihedralPotentialImpl< Interaction >, Util::AutoCorr< Data, Product >, Simp::MultiHarmonicDihedral, Util::AutoCorr< double, double >, Util::AutoCorr< std::complex< double >, std::complex< double > >, Util::Average, Simp::FeneBond, McMd::Analyzer, McMd::RadiusGyration, DdMd::BondPotentialImpl< Interaction >, DdMd::ExternalPotentialImpl< Interaction >, McMd::IntraPairAutoCorr, Simp::CosineDihedral, McMd::StructureFactor, McMd::MdPairPotentialImpl< Interaction >, Util::MeanSqDispArray< Data >, Simp::HarmonicBond, Simp::SphericalTabulatedExternal, McMd::CompositionProfile, DdMd::OrderParamNucleation, DdMd::Domain, Util::MeanSqDispArray< Util::Vector >, Simp::CosineAngle, Simp::HarmonicAngle, Simp::LJPair, McMd::IntraBondTensorAutoCorr< SystemType >, McMd::IntraBondTensorAutoCorr< MdSystem >, McMd::IntraBondTensorAutoCorr< McSystem >, Simp::CosineSqAngle, McMd::MdEwaldPotential, McMd::MdSpmePotential, McMd::MdEwaldPairPotentialImpl< Interaction >, Simp::HarmonicL0Bond, Util::Distribution, Util::TensorAverage, Simp::EwaldInteraction, Util::SymmTensorAverage, Util::Random, Simp::DpdPair, Util::IntDistribution, McMd::Command, DdMd::AnglePotentialImpl< Interaction >, McMd::NphIntegrator, McMd::Perturbation, McMd::DihedralPotentialImpl< Interaction >, DdMd::TrajectoryWriter, McMd::AnglePotentialImpl< Interaction >, McMd::ExternalPotentialImpl< Interaction >, McMd::McMuExchange, McMd::NvtDpdVvIntegrator, McMd::BondPotentialImpl< Interaction >, DdMd::SymmTensorAverageAnalyzer, DdMd::TensorAverageAnalyzer, Util::RadialDistribution, Simp::EnergyEnsemble, McMd::ClusterHistogram, McMd::RDF, McMd::MdMove, McMd::NvtNhIntegrator, DdMd::AverageAnalyzer, Simp::BoundaryEnsemble, McMd::McNVTChemicalPotential, McMd::NvtLangevinIntegrator, DdMd::EnergyAnalyzer, DdMd::ConfigWriter, McMd::McEnergyAnalyzer, McMd::MdEnergyAnalyzer, McMd::MdPairEnergyCoefficients, McMd::IntraBondStressAutoCorr< SystemType >, McMd::LinearRouseAutoCorr, McMd::CfbLinear, McMd::IntraBondStressAutoCorr< MdSystem >, McMd::IntraBondStressAutoCorr< McSystem >, McMd::BennettsMethod, McMd::DpdMove, McMd::McPairPotentialImpl< Interaction >, DdMd::NvtLangevinIntegrator, McMd::McMove, McMd::McMoveManager, McMd::RingRouseAutoCorr, McMd::HybridNphMdMove, McMd::McVirialStressTensorAverage, McMd::MdVirialStressTensorAverage, DdMd::AutoCorrAnalyzer< Data, Product >, DdMd::AutoCorrAnalyzer< Tensor, double >, McMd::ComMSD, McMd::ConfigWriter, DdMd::LogEnergy, DdMd::VirialStressTensorAverage, McMd::HybridMdMove, McMd::RingTetraRebridgeMove, McMd::McPairEnergyAverage, McMd::PressureAverage< SystemType >, McMd::StressAutoCorr< SystemType >, McMd::HarmonicCvBias, McMd::CfbRebridgeBase, McMd::CfbReptateMove, McMd::LinearSG, DdMd::OutputPairEnergies, DdMd::OutputPressure, DdMd::StressAutoCorr, DdMd::VirialStressTensor, McMd::PressureAverage< MdSystem >, McMd::PressureAverage< McSystem >, McMd::StressAutoCorr< MdSystem >, McMd::StressTensorAverage< SystemType >, McMd::LinearCvBias, McMd::EndSwapMove, McMd::CfbRingRebridgeMove, McMd::HomopolymerSG, DdMd::ExternalEnergyAverage, DdMd::OutputEnergy, DdMd::OutputTemperature, DdMd::PairEnergyAverage, DdMd::OutputBoxdim, DdMd::Integrator, McMd::CfbReptationMove, DdMd::OutputStressTensor, DdMd::NptIntegrator, McMd::AnalyzerManager, McMd::TypeDistribution, McMd::BondLengthDist, McMd::CfbRebridgeMove, DdMd::AnalyzerManager, DdMd::PairEnergyAnalyzer, McMd::CfbLinearEndMove, DdMd::NveIntegrator, Util::AutoCorrelation< Data, Product >, McMd::SemiGrandDistribution, McMd::AtomMSD, McMd::RigidDisplaceMove, McMd::CfbEndMove, McMd::RingOctaRebridgeMove, Util::AutoCorrelation< Tensor, double >, Util::AutoCorrelation< Util::Tensor, double >, McMd::McEnergyOutput, McMd::AverageAnalyzer< SystemType >, McMd::CfbDoubleRebridgeMove, DdMd::NvtIntegrator, McMd::AverageAnalyzer< McSystem >, McMd::MdEnergyOutput, McMd::MdKineticEnergyAverage, McMd::BoundaryAverage, McMd::NveVvIntegrator, DdMd::DdMdGroupTrajectoryWriter, DdMd::NphIntegrator, Simp::Homopolymer, McMd::MdPotentialEnergyAverage, McMd::PerturbDerivative, McMd::AtomDisplaceMove, McMd::LammpsDumpWriter, McMd::TrajectoryWriter, McMd::HomopolymerSemiGrandMove, Simp::HomoRing, Simp::Diblock, Simp::Multiblock, and Simp::Point.

Definition at line 70 of file ParamComponent.h.

virtual void Util::ParamComponent::resetParam ( )
inlinevirtual

Nontrivial implementation provided by ParamComposite subclass.

The default implementation is empty. This default is used by all leaf nodes (all other than ParamComposite and subclasses).

Reimplemented in Util::ParamComposite, Util::Begin, and Util::End.

Definition at line 79 of file ParamComponent.h.

References echo(), indent(), initStatic(), ParamComponent(), serialize(), setEcho(), and setIndent().

void Util::ParamComponent::setIndent ( const ParamComponent parent,
bool  next = true 
)

Set indent level.

If next=true (default) set indent level one higher than that of parent. If next=false, set indent level the same as parent.

Parameters
parentparent ParamComponent object
nextIf true, set level one higher than for parent.

Definition at line 48 of file ParamComponent.cpp.

References indent().

Referenced by Util::Factory< Data >::readObject(), Simp::CompensatedPair< BarePair, LinkPotential >::readParameters(), Simp::CompositeBond< BareBond, BarePair >::readParameters(), resetParam(), and Util::ParamComposite::setParent().

std::string Util::ParamComponent::indent ( ) const
template<class Archive >
void Util::ParamComponent::serialize ( Archive &  ar,
const unsigned int  version 
)

Serialize this ParamComponent as a string.

Parameters
arsaving or loading archive
versionversion id for archive

Definition at line 177 of file ParamComponent.h.

References readParam(), and writeParam().

Referenced by resetParam(), and Tools::Species::size().

void Util::ParamComponent::initStatic ( )
static

Initialize static echo member to false.

Definition at line 77 of file ParamComponent.cpp.

Referenced by Util::initStatic(), and resetParam().

void Util::ParamComponent::setEcho ( bool  echo = true)
static

Enable or disable echoing for all subclasses of ParamComponent.

When echoing is enabled, all parameters are echoed to a log file immediately after being read. This is useful as an aid to debugging the parameter file, by showing where the error occurred.

Parameters
echoset true to enable echoing, false to disable.

Definition at line 62 of file ParamComponent.cpp.

References echo().

Referenced by resetParam(), Tools::Processor::setOptions(), McMd::MdSimulation::setOptions(), McMd::McSimulation::setOptions(), and DdMd::Simulation::setOptions().

bool Util::ParamComponent::echo ( )
static

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