PSCF v1.3
Pscf::PolymerModel Namespace Reference

Enumeration and functions to specify a model for polymer chains. More...

Enumerations

enum  Type
 Scoped enumeration of polymer model types. More...

Functions

void setModel (PolymerModel::Type model)
 Set the global polymer model enumeration value.
void lock ()
 Make the polymer model immutable.
Type model ()
 Get the global polymer model type enumeration value.
bool isThread ()
 Is the thread model in use ?
bool isBead ()
 Is the bead model in use ?
bool isLocked ()
 Has the model type been locked (i.e., made immutable) ?
int nSet ()
 How many times has setModel been called?
std::istream & operator>> (std::istream &in, PolymerModel::Type &model)
 Input stream extractor for a PolymerModel::Type enumeration.
std::ostream & operator<< (std::ostream &out, PolymerModel::Type const &model)
 Output stream inserter for a PolymerModel::Type enumeration.
template<class Archive>
void serialize (Archive &ar, PolymerModel::Type &data, const unsigned int version)
 Serialize a PolymerModel::Type enumeration.

Detailed Description

Enumeration and functions to specify a model for polymer chains.

PSCF allows the use of either a continuous "thread" or a discrete "bead" model for chain conformations. The PolymerModel::Type enumeration type has two allowed values of PolymerModel::Thread and PolymerModel::Bead that identify these two models.

Functions defined in the PolymerModel namespace can be used to set and query a globally accessible pseudo private variable of type PolymerModel::Type that specifies which of these two models is being used throughout a program. This model type variable is initialized to PolymerModel::Thread by default. In PSCF programs that can support either thread or bead models, a choice of model should be set in the early stages of program execution and not changed again before the program terminates.

Function Documentation

◆ setModel()

void Pscf::PolymerModel::setModel ( PolymerModel::Type model)

Set the global polymer model enumeration value.

Parameters
modelpolymer model type enumeration value

Definition at line 45 of file PolymerModel.cpp.

References model(), and UTIL_CHECK.

Referenced by Pscf::Rpc::System< D >::readParameters(), and Pscf::Rpg::System< D >::readParameters().

◆ lock()

void Pscf::PolymerModel::lock ( )

Make the polymer model immutable.

Locking the polymer model is irreversible - there is no unlock function.

Advice: Lock the model shortly after it is set in the execution path of the main program for PSCF executable programs. Do not lock the model in unit tests, so that a unit test runner can run different tests that test the thread and bead model.

Definition at line 55 of file PolymerModel.cpp.

Referenced by Pscf::Rpc::run().

◆ model()

PolymerModel::Type Pscf::PolymerModel::model ( )

Get the global polymer model type enumeration value.

Definition at line 63 of file PolymerModel.cpp.

Referenced by setModel().

◆ isThread()

◆ isBead()

◆ isLocked()

bool Pscf::PolymerModel::isLocked ( )

Has the model type been locked (i.e., made immutable) ?

Definition at line 81 of file PolymerModel.cpp.

Referenced by Pscf::Rpc::System< D >::readParameters(), and Pscf::Rpg::System< D >::readParameters().

◆ nSet()

int Pscf::PolymerModel::nSet ( )

How many times has setModel been called?

This returns a counter that is initialized to zero, and is incremented every times setModel is invoked. It can be used confirm that polymer model was not changed within a section of code..

Definition at line 87 of file PolymerModel.cpp.

Referenced by Pscf::Rpc::System< D >::readParameters(), and Pscf::Rpg::System< D >::readParameters().