PSCF v1.1
|
Main class in SCFT simulation of one system. More...
#include <System.h>
Public Types | |
typedef DArray< double > | Field |
Generic Field type. More... | |
typedef DArray< double > | WField |
Monomer chemical potential field type. More... | |
typedef DArray< double > | CField |
Monomer concentration / volume fraction field type. More... | |
![]() | |
typedef BinaryFileOArchive | OArchive |
Type of output archive used by save method. More... | |
typedef BinaryFileIArchive | IArchive |
Type of input archive used by load method. More... | |
Public Member Functions | |
Construction and Destruction | |
System () | |
Constructor. More... | |
~System () | |
Destructor. More... | |
Lifetime (Actions) | |
void | setOptions (int argc, char **argv) |
Process command line options. More... | |
virtual void | readParam (std::istream &in) |
Read input parameters (with opening and closing lines). More... | |
void | readParam () |
Read input parameters from default param file. More... | |
virtual void | readParameters (std::istream &in) |
Read input parameters (without opening and closing lines). More... | |
void | readCommands (std::istream &in) |
Read command script. More... | |
void | readCommands () |
Read commands from default command file. More... | |
Primary SCFT Computations <br> | |
void | compute () |
Solve the modified diffusion equation once, without iteration. More... | |
int | iterate (bool isContinuation=false) |
Iteratively solve a SCFT problem. More... | |
void | sweep () |
Sweep in parameter space, solving an SCF problem at each point. More... | |
Thermodynamic Properties | |
void | computeFreeEnergy () |
Compute free energy density and pressure for current fields. More... | |
double | fHelmholtz () const |
Get precomputed Helmholtz free energy per monomer / kT. More... | |
double | pressure () const |
Get precomputed pressure x monomer volume kT. More... | |
Thermodynamic Data Output | |
void | writeParamNoSweep (std::ostream &out) const |
Write parameter file to an ostream, omitting any Sweep block. More... | |
void | writeThermo (std::ostream &out) |
Write thermodynamic properties to a file. More... | |
Field Output <br> | |
void | writeW (std::string const &filename) |
Write chemical potential fields in symmetrized basis format. More... | |
void | writeC (std::string const &filename) |
Write concentration fields in symmetrized basis format. More... | |
void | writeBlockC (std::string const &filename) |
Write c-fields for all blocks and solvents in r-grid format. More... | |
void | writeQSlice (std::string const &filename, int polymerId, int blockId, int directionId, int segmentId) const |
Write slice of a propagator at fixed s in r-grid format. More... | |
void | writeQTail (std::string const &filename, int polymerId, int blockId, int directionId) const |
Write the final slice of a propagator in r-grid format. More... | |
void | writeQ (std::string const &filename, int polymerId, int blockId, int directionId) const |
Write one propagator for one block, in r-grid format. More... | |
void | writeQAll (std::string const &basename) |
Write all propagators of all blocks, each to a separate file. More... | |
Field Accessors | |
DArray< WField > & | wFields () |
Get array of all chemical potential fields. More... | |
WField & | wField (int monomerId) |
Get chemical potential field for a specific monomer type. More... | |
DArray< CField > & | cFields () |
Get array of all chemical potential fields. More... | |
CField & | cField (int monomerId) |
Get chemical potential field for a specific monomer type. More... | |
Member object accessors | |
Mixture & | mixture () |
Get Mixture by reference. More... | |
Mixture const & | mixture () const |
Get Mixture by reference. More... | |
Interaction & | interaction () |
Get interaction (i.e., excess free energy) by reference. More... | |
Interaction const & | interaction () const |
Get interaction (i.e., excess free energy) by const reference. More... | |
Domain & | domain () |
Get spatial domain (including grid info) by reference. More... | |
Iterator & | iterator () |
Get the Iterator by reference. More... | |
Homogeneous::Mixture & | homogeneous () |
Get homogeneous mixture (for reference calculations). More... | |
FileMaster & | fileMaster () |
Get FileMaster by reference. More... | |
![]() | |
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... | |
virtual void | readParamOptional (std::istream &in) |
Read optional parameter file block. More... | |
virtual void | writeParam (std::ostream &out) const |
Write all parameters to an output stream. More... | |
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... | |
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... | |
Begin & | readBegin (std::istream &in, const char *label, bool isRequired=true) |
Add and read a class label and opening bracket. More... | |
End & | readEnd (std::istream &in) |
Add and read the closing bracket. More... | |
Blank & | readBlank (std::istream &in) |
Add and read a new Blank object, representing a blank line. More... | |
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... | |
void | addParamComposite (ParamComposite &child, bool next=true) |
Add a child ParamComposite object to the format array. More... | |
Begin & | addBegin (const char *label) |
Add a Begin object representing a class name and bracket. More... | |
End & | addEnd () |
Add a closing bracket. More... | |
Blank & | addBlank () |
Create and add a new Blank object, representing a blank line. More... | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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 ¶m, bool next=true) |
Set this to the parent of a child component. More... | |
void | addComponent (ParamComponent ¶m, 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... | |
![]() | |
ParamComponent () | |
Constructor. More... | |
ParamComponent (const ParamComponent &other) | |
Copy constructor. More... | |
Main class in SCFT simulation of one system.
A System has (among other components):
A system may also optionally contain a Sweep object.
A minimal main program that uses this class to implement a program might look something like this:
The actual main program is given in the file pscf_fd.cpp.
Definition at line 62 of file fd1d/System.h.
typedef DArray<double> Pscf::Fd1d::System::Field |
Generic Field type.
Definition at line 68 of file fd1d/System.h.
typedef DArray<double> Pscf::Fd1d::System::WField |
Monomer chemical potential field type.
Definition at line 71 of file fd1d/System.h.
typedef DArray<double> Pscf::Fd1d::System::CField |
Monomer concentration / volume fraction field type.
Definition at line 74 of file fd1d/System.h.
Pscf::Fd1d::System::System | ( | ) |
Constructor.
Definition at line 40 of file fd1d/System.cpp.
References Pscf::Fd1d::FieldIo::associate(), Util::BracketPolicy::set(), and Util::ParamComposite::setClassName().
Pscf::Fd1d::System::~System | ( | ) |
Destructor.
Definition at line 77 of file fd1d/System.cpp.
void Pscf::Fd1d::System::setOptions | ( | int | argc, |
char ** | argv | ||
) |
Process command line options.
Definition at line 99 of file fd1d/System.cpp.
References Util::Log::file(), fileMaster(), Util::FileMaster::setCommandFileName(), Util::ParamComponent::setEcho(), Util::FileMaster::setInputPrefix(), Util::FileMaster::setOutputPrefix(), Util::FileMaster::setParamFileName(), and UTIL_THROW.
|
virtual |
Read input parameters (with opening and closing lines).
in | input parameter stream |
Reimplemented from Util::ParamComposite.
Definition at line 216 of file fd1d/System.cpp.
References Util::ParamComposite::className(), Util::ParamComposite::readBegin(), Util::ParamComposite::readEnd(), and readParameters().
void Pscf::Fd1d::System::readParam | ( | ) |
Read input parameters from default param file.
Definition at line 226 of file fd1d/System.cpp.
References fileMaster(), and readParam().
Referenced by readParam().
|
virtual |
Read input parameters (without opening and closing lines).
in | input parameter stream |
Reimplemented from Util::ParamComposite.
Definition at line 171 of file fd1d/System.cpp.
References Util::ParamComposite::className(), domain(), interaction(), mixture(), Pscf::MixtureTmpl< TP, TS >::nMonomer(), Pscf::MixtureTmpl< TP, TS >::nPolymer(), Pscf::MixtureTmpl< TP, TS >::nSolvent(), Util::Factory< Data >::readObject(), Util::Factory< Data >::readObjectOptional(), Util::ParamComposite::readParamComposite(), Pscf::Homogeneous::Mixture::setNMolecule(), Pscf::Homogeneous::Mixture::setNMonomer(), Pscf::Interaction::setNMonomer(), Pscf::Fd1d::SystemAccess::setSystem(), and UTIL_THROW.
Referenced by readParam().
void Pscf::Fd1d::System::readCommands | ( | std::istream & | in | ) |
Read command script.
in | command script file. |
Definition at line 269 of file fd1d/System.cpp.
References cFields(), compute(), Pscf::Fd1d::HomogeneousComparison::compute(), Pscf::Fd1d::FieldIo::extend(), Util::Log::file(), fileMaster(), iterate(), Util::FileMaster::openOutputFile(), Pscf::Fd1d::HomogeneousComparison::output(), Pscf::Fd1d::FieldIo::readFields(), Pscf::Fd1d::FieldIo::remesh(), sweep(), UTIL_CHECK, wFields(), Pscf::Fd1d::FieldIo::writeBlockCFields(), Pscf::Fd1d::FieldIo::writeFields(), Util::ParamComposite::writeParam(), writeQ(), writeQAll(), writeQSlice(), writeQTail(), writeThermo(), and Pscf::Fd1d::FieldIo::writeVertexQ().
void Pscf::Fd1d::System::readCommands | ( | ) |
Read commands from default command file.
Definition at line 435 of file fd1d/System.cpp.
References fileMaster(), readCommands(), and UTIL_THROW.
Referenced by readCommands().
void Pscf::Fd1d::System::compute | ( | ) |
Solve the modified diffusion equation once, without iteration.
This function calls the Mixture::compute() function to solve the statistical mechanics problem for a non-interacting system subjected to the currrent chemical potential fields (wFields). This requires solution of the modified diffusion equation for all polymers, computation of Boltzmann weights for all solvents, computation of molecular partition functions for all species, computation of concentration fields for blocks and solvents, and computation of overall concentrations for all monomer types. This function does not compute the canonical (Helmholtz) free energy or grand-canonical free energy (i.e., pressure). Upon return, the flag hasCFields is set true.
Definition at line 457 of file fd1d/System.cpp.
References Pscf::Fd1d::Mixture::compute(), and wFields().
Referenced by readCommands().
int Pscf::Fd1d::System::iterate | ( | bool | isContinuation = false | ) |
Iteratively solve a SCFT problem.
This function calls the iterator to attempt to solve the SCFT problem for the current mixture and system parameters, using the current chemical potential fields (wFields) as initial guesses.
isContinuation | true if continuation within a sweep. |
Definition at line 470 of file fd1d/System.cpp.
References computeFreeEnergy(), Util::Log::file(), iterator(), Pscf::Fd1d::Iterator::solve(), and writeThermo().
Referenced by readCommands(), and Pscf::Fd1d::Sweep::solve().
void Pscf::Fd1d::System::sweep | ( | ) |
Sweep in parameter space, solving an SCF problem at each point.
This function uses a Sweep object that was initialized in the parameter file to solve the SCF problem at a sequence of points along a line in parameter space. The nature of this sequence of points is determined by implementation of a subclass of Sweep and the parameters passed to the sweep object in the parameter file. The Iterator that is initialized in the parameter file is called at each state point.
Definition at line 493 of file fd1d/System.cpp.
References Util::Log::file(), Pscf::SweepTmpl< State >::sweep(), and UTIL_CHECK.
Referenced by pscfpp.output.Sweep::__getitem__(), pscfpp.output.Sweep::__init__(), pscfpp.output.Sweep::__len__(), readCommands(), pscfpp.output.Sweep::summary(), and pscfpp.output.Sweep::summaryString().
void Pscf::Fd1d::System::computeFreeEnergy | ( | ) |
Compute free energy density and pressure for current fields.
This function should be called after a successful call of iterator().solve(). Resulting values are returned by the freeEnergy() and pressure() accessor functions.
Definition at line 508 of file fd1d/System.cpp.
References Util::DArray< Data >::allocate(), domain(), Pscf::Interaction::fHelmholtz(), Pscf::Fd1d::Domain::innerProduct(), interaction(), Util::DArray< Data >::isAllocated(), Pscf::PolymerTmpl< Block >::length(), mixture(), Pscf::Species::mu(), Pscf::MixtureTmpl< TP, TS >::nMonomer(), Pscf::MixtureTmpl< TP, TS >::nPolymer(), Pscf::MixtureTmpl< TP, TS >::nSolvent(), Pscf::Fd1d::Domain::nx(), Pscf::Species::phi(), Pscf::MixtureTmpl< TP, TS >::polymer(), Pscf::SolventDescriptor::size(), Pscf::MixtureTmpl< TP, TS >::solvent(), and Pscf::Fd1d::Domain::spatialAverage().
Referenced by iterate(), Pscf::Fd1d::BinaryRelaxIterator::solve(), and Pscf::Fd1d::NrIterator::solve().
|
inline |
Get precomputed Helmholtz free energy per monomer / kT.
The value retrieved by this function is computed by the computeFreeEnergy() function.
Definition at line 622 of file fd1d/System.h.
Referenced by pscfpp.output.Thermo::__init__(), Pscf::Fd1d::HomogeneousComparison::output(), Pscf::Fd1d::Sweep::outputSummary(), pscfpp.output.Thermo::read(), and writeThermo().
|
inline |
Get precomputed pressure x monomer volume kT.
The value retrieved by this function is computed by the computeFreeEnergy() function.
Definition at line 628 of file fd1d/System.h.
Referenced by pscfpp.output.Thermo::__init__(), Pscf::Fd1d::HomogeneousComparison::output(), Pscf::Fd1d::Sweep::outputSummary(), pscfpp.output.Thermo::read(), and writeThermo().
void Pscf::Fd1d::System::writeParamNoSweep | ( | std::ostream & | out | ) | const |
Write parameter file to an ostream, omitting any Sweep block.
out | output stream |
Definition at line 232 of file fd1d/System.cpp.
References Util::ParamComposite::writeParam().
void Pscf::Fd1d::System::writeThermo | ( | std::ostream & | out | ) |
Write thermodynamic properties to a file.
This function outputs Helmholtz free energy per monomer, pressure (in units of kT per monomer volume), and the volume fraction phi and chemical potential mu of each species.
out | output stream |
Definition at line 682 of file fd1d/System.cpp.
References fHelmholtz(), mixture(), Pscf::MixtureTmpl< TP, TS >::nPolymer(), Pscf::MixtureTmpl< TP, TS >::nSolvent(), and pressure().
Referenced by iterate(), Pscf::Fd1d::Sweep::outputSolution(), and readCommands().
void Pscf::Fd1d::System::writeW | ( | std::string const & | filename | ) |
Write chemical potential fields in symmetrized basis format.
filename | name of output file |
Definition at line 733 of file fd1d/System.cpp.
References wFields(), and Pscf::Fd1d::FieldIo::writeFields().
void Pscf::Fd1d::System::writeC | ( | std::string const & | filename | ) |
Write concentration fields in symmetrized basis format.
filename | name of output file |
Definition at line 742 of file fd1d/System.cpp.
References cFields(), and Pscf::Fd1d::FieldIo::writeFields().
void Pscf::Fd1d::System::writeBlockC | ( | std::string const & | filename | ) |
Write c-fields for all blocks and solvents in r-grid format.
Writes concentrations for all blocks of all polymers and all solvent species in r-grid format. Columns associated with blocks appear ordered by polymer id and then by block id, followed by solvent species ordered by solvent id.
filename | name of output file |
Definition at line 752 of file fd1d/System.cpp.
References Pscf::Fd1d::FieldIo::writeBlockCFields().
void Pscf::Fd1d::System::writeQSlice | ( | std::string const & | filename, |
int | polymerId, | ||
int | blockId, | ||
int | directionId, | ||
int | segmentId | ||
) | const |
Write slice of a propagator at fixed s in r-grid format.
filename | name of output file |
polymerId | integer id of the polymer |
blockId | integer id of the block within the polymer |
directionId | integer id of the direction (0 or 1) |
segmentId | integer integration step index |
Definition at line 761 of file fd1d/System.cpp.
References Pscf::PolymerTmpl< Block >::nBlock(), Pscf::MixtureTmpl< TP, TS >::nPolymer(), Pscf::MixtureTmpl< TP, TS >::polymer(), Pscf::PolymerTmpl< Block >::propagator(), Pscf::Fd1d::Propagator::q(), UTIL_CHECK, and Pscf::Fd1d::FieldIo::writeField().
Referenced by readCommands().
void Pscf::Fd1d::System::writeQTail | ( | std::string const & | filename, |
int | polymerId, | ||
int | blockId, | ||
int | directionId | ||
) | const |
Write the final slice of a propagator in r-grid format.
filename | name of output file |
polymerId | integer id of the polymer |
blockId | integer id of the block within the polymer |
directionId | integer id of the direction (0 or 1) |
Definition at line 782 of file fd1d/System.cpp.
References Pscf::PolymerTmpl< Block >::nBlock(), Pscf::MixtureTmpl< TP, TS >::nPolymer(), Pscf::MixtureTmpl< TP, TS >::polymer(), Pscf::PolymerTmpl< Block >::propagator(), UTIL_CHECK, and Pscf::Fd1d::FieldIo::writeField().
Referenced by readCommands().
void Pscf::Fd1d::System::writeQ | ( | std::string const & | filename, |
int | polymerId, | ||
int | blockId, | ||
int | directionId | ||
) | const |
Write one propagator for one block, in r-grid format.
filename | name of output file |
polymerId | integer id of the polymer |
blockId | integer id of the block within the polymer |
directionId | integer id of the direction (0 or 1) |
Definition at line 801 of file fd1d/System.cpp.
References Pscf::PolymerTmpl< Block >::nBlock(), Pscf::MixtureTmpl< TP, TS >::nPolymer(), Pscf::Fd1d::Propagator::ns(), Pscf::Fd1d::Domain::nx(), Util::FileMaster::openOutputFile(), Pscf::MixtureTmpl< TP, TS >::polymer(), Pscf::PolymerTmpl< Block >::propagator(), Pscf::Fd1d::Propagator::q(), UTIL_CHECK, and Pscf::Fd1d::FieldIo::writeField().
Referenced by readCommands(), and writeQAll().
void Pscf::Fd1d::System::writeQAll | ( | std::string const & | basename | ) |
Write all propagators of all blocks, each to a separate file.
Write all propagators for both directions for all blocks of all polymers, with each propagator in a separate file. The function writeQ is called internally for each propagator, and is passed an automatically generated file name. The file name for each propagator is given by a string of the form (basename)_(ip)_(ib)_(id), where (basename) denotes the value of the std::string function parameter basename, and where (ip), (ib), and (id) denote the string representations of a polymer indiex ip, a block index ib, and direction index id, with id = 0 or 1. For example, if basename == "out/q", then the file name of the propagator for direction 1 of block 2 of polymer 0 would be "out/q_0_2_1".
basename | common prefix for output file names |
Definition at line 839 of file fd1d/System.cpp.
References Pscf::MixtureTmpl< TP, TS >::nPolymer(), Pscf::MixtureTmpl< TP, TS >::polymer(), Util::toString(), and writeQ().
Referenced by readCommands().
|
inline |
Get array of all chemical potential fields.
The array capacity is equal to the number of monomer types.
Definition at line 596 of file fd1d/System.h.
Referenced by compute(), readCommands(), Pscf::Fd1d::SystemAccess::wFields(), and writeW().
|
inline |
Get chemical potential field for a specific monomer type.
monomerId | integer monomer type index |
Definition at line 603 of file fd1d/System.h.
Referenced by Pscf::Fd1d::BinaryRelaxIterator::solve(), Pscf::Fd1d::NrIterator::solve(), and Pscf::Fd1d::SystemAccess::wField().
|
inline |
Get array of all chemical potential fields.
The array capacity is equal to the number of monomer types.
Definition at line 610 of file fd1d/System.h.
Referenced by Pscf::Fd1d::SystemAccess::cFields(), readCommands(), and writeC().
|
inline |
Get chemical potential field for a specific monomer type.
monomerId | integer monomer type index |
Definition at line 616 of file fd1d/System.h.
Referenced by Pscf::Fd1d::SystemAccess::cField(), Pscf::Fd1d::BinaryRelaxIterator::solve(), and Pscf::Fd1d::NrIterator::solve().
|
inline |
Get Mixture by reference.
Definition at line 537 of file fd1d/System.h.
Referenced by computeFreeEnergy(), Pscf::Fd1d::SystemAccess::mixture(), readParameters(), Pscf::Fd1d::NrIterator::solve(), and writeThermo().
|
inline |
Get Mixture by reference.
Definition at line 543 of file fd1d/System.h.
|
inline |
Get interaction (i.e., excess free energy) by reference.
Definition at line 549 of file fd1d/System.h.
References UTIL_ASSERT.
Referenced by computeFreeEnergy(), Pscf::Fd1d::SystemAccess::interaction(), and readParameters().
|
inline |
Get interaction (i.e., excess free energy) by const reference.
Definition at line 558 of file fd1d/System.h.
References UTIL_ASSERT.
|
inline |
Get spatial domain (including grid info) by reference.
Definition at line 567 of file fd1d/System.h.
Referenced by computeFreeEnergy(), Pscf::Fd1d::SystemAccess::domain(), readParameters(), and Pscf::Fd1d::Sweep::Sweep().
|
inline |
Get the Iterator by reference.
Definition at line 580 of file fd1d/System.h.
References UTIL_ASSERT.
Referenced by iterate().
|
inline |
Get homogeneous mixture (for reference calculations).
Definition at line 574 of file fd1d/System.h.
Referenced by Pscf::Fd1d::SystemAccess::homogeneous(), and Pscf::Fd1d::Sweep::outputSummary().
|
inline |
Get FileMaster by reference.
Definition at line 589 of file fd1d/System.h.
Referenced by Pscf::Fd1d::SystemAccess::fileMaster(), readCommands(), readParam(), setOptions(), and Pscf::Fd1d::Sweep::Sweep().