Simpatico
v1.10
|
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>
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... | |
![]() | |
virtual | ~Serializable () |
Destructor. More... | |
![]() | |
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 | |
![]() | |
typedef BinaryFileOArchive | OArchive |
Type of output archive used by save method. More... | |
typedef BinaryFileIArchive | IArchive |
Type of input archive used by load method. More... | |
|
virtual |
Destructor.
Definition at line 36 of file ParamComponent.cpp.
|
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().
|
protected |
Copy constructor.
Definition at line 28 of file ParamComponent.cpp.
|
pure virtual |
Read parameter(s) from file.
in | input stream |
Implemented in DdMd::Simulation, Util::ParamComposite, Util::Parameter, McMd::McSimulation, McMd::MdSimulation, Util::Manager< Data >, Util::Manager< Command >, Util::Manager< Modifier >, Util::Manager< McMove >, Util::Manager< Analyzer >, Util::Manager< Simp::Species >, Simp::SpeciesEnsemble, Util::Begin, Util::Blank, Util::End, and Tools::ChainMaker.
Referenced by serialize().
|
pure virtual |
Read parameter(s) to file.
out | output stream |
Implemented in Util::ParamComposite, Simp::MultiHarmonicDihedral, Util::CArray2DParam< Type >, Util::ScalarParam< Type >, Util::Begin, Util::DMatrixParam< Type >, Util::DSymmMatrixParam< Type >, Util::Blank, Util::End, Util::FArrayParam< Type, N >, Util::DArrayParam< Type >, and Util::CArrayParam< Type >.
Referenced by Util::Parameter::load(), Util::Parameter::readParam(), and serialize().
|
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.
|
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.
|
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.
parent | parent ParamComponent object |
next | If 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 |
Return indent string for this object (string of spaces).
Definition at line 42 of file ParamComponent.cpp.
Referenced by Util::Parameter::load(), Util::ParamComposite::loadOptional(), Util::Begin::readParam(), Util::Parameter::readParam(), resetParam(), setIndent(), Util::CArrayParam< Type >::writeParam(), Util::DArrayParam< Type >::writeParam(), Util::FArrayParam< Type, N >::writeParam(), Util::End::writeParam(), Util::DSymmMatrixParam< Type >::writeParam(), Util::Begin::writeParam(), Util::DMatrixParam< Type >::writeParam(), Util::ScalarParam< Type >::writeParam(), Util::CArray2DParam< Type >::writeParam(), and Simp::Species::writeStructure().
void Util::ParamComponent::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
Serialize this ParamComponent as a string.
ar | saving or loading archive |
version | version id for archive |
Definition at line 177 of file ParamComponent.h.
References readParam(), and writeParam().
Referenced by resetParam(), and Tools::Species::size().
|
static |
Initialize static echo member to false.
Definition at line 77 of file ParamComponent.cpp.
Referenced by Util::initStatic(), and resetParam().
|
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.
echo | set 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().
|
static |
Get echo parameter.
Definition at line 68 of file ParamComponent.cpp.
Referenced by Util::Manager< Data >::endReadManager(), Util::Parameter::load(), Util::ParamComposite::load(), Util::ParamComposite::loadOptional(), Util::Factory< Data >::readObject(), Util::Blank::readParam(), Util::End::readParam(), Util::Begin::readParam(), Util::Parameter::readParam(), resetParam(), and setEcho().