PSCF v1.1
Public Types | List of all members
Pscf::Fd1d::System Class Reference

Main class in SCFT simulation of one system. More...

#include <System.h>

Inheritance diagram for Pscf::Fd1d::System:
Util::ParamComposite Util::ParamComponent Util::Serializable Util::MpiFileIo

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

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...
 
WFieldwField (int monomerId)
 Get chemical potential field for a specific monomer type. More...
 
DArray< CField > & cFields ()
 Get array of all chemical potential fields. More...
 
CFieldcField (int monomerId)
 Get chemical potential field for a specific monomer type. More...
 
Member object accessors
Mixturemixture ()
 Get Mixture by reference. More...
 
Mixture const & mixture () const
 Get Mixture by reference. More...
 
Interactioninteraction ()
 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...
 
Domaindomain ()
 Get spatial domain (including grid info) by reference. More...
 
Iteratoriterator ()
 Get the Iterator by reference. More...
 
Homogeneous::Mixturehomogeneous ()
 Get homogeneous mixture (for reference calculations). More...
 
FileMasterfileMaster ()
 Get FileMaster by reference. More...
 
- Public Member Functions inherited from Util::ParamComposite
 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...
 
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...
 
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...
 
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...
 
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...
 
- 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...
 

Additional Inherited Members

- 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::ParamComposite
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...
 
- Protected Member Functions inherited from Util::ParamComponent
 ParamComponent ()
 Constructor. More...
 
 ParamComponent (const ParamComponent &other)
 Copy constructor. More...
 

Detailed Description

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:

int main(int argc, char **argv) {
system.setOptions(argc, argv);
system.readParam();
system.readCommands();
}
Main class in SCFT simulation of one system.
Definition: fd1d/System.h:63
virtual void readParam(std::istream &in)
Read input parameters (with opening and closing lines).
void setOptions(int argc, char **argv)
Process command line options.
Definition: fd1d/System.cpp:99
void readCommands(std::istream &in)
Read command script.

The actual main program is given in the file pscf_fd.cpp.

Parameter File Format

Definition at line 62 of file fd1d/System.h.

Member Typedef Documentation

◆ Field

Generic Field type.

Definition at line 68 of file fd1d/System.h.

◆ WField

Monomer chemical potential field type.

Definition at line 71 of file fd1d/System.h.

◆ CField

Monomer concentration / volume fraction field type.

Definition at line 74 of file fd1d/System.h.

Constructor & Destructor Documentation

◆ System()

Pscf::Fd1d::System::System ( )

◆ ~System()

Pscf::Fd1d::System::~System ( )

Destructor.

Definition at line 77 of file fd1d/System.cpp.

Member Function Documentation

◆ setOptions()

void Pscf::Fd1d::System::setOptions ( int  argc,
char **  argv 
)

◆ readParam() [1/2]

void Pscf::Fd1d::System::readParam ( std::istream &  in)
virtual

Read input parameters (with opening and closing lines).

Parameters
ininput 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().

◆ readParam() [2/2]

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

◆ readParameters()

void Pscf::Fd1d::System::readParameters ( std::istream &  in)
virtual

◆ readCommands() [1/2]

void Pscf::Fd1d::System::readCommands ( std::istream &  in)

◆ readCommands() [2/2]

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

◆ compute()

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

◆ iterate()

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.

Parameters
isContinuationtrue if continuation within a sweep.
Returns
returns 0 for successful convergence, 1 for failure.

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

◆ sweep()

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

◆ computeFreeEnergy()

void Pscf::Fd1d::System::computeFreeEnergy ( )

◆ fHelmholtz()

double Pscf::Fd1d::System::fHelmholtz ( ) const
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().

◆ pressure()

double Pscf::Fd1d::System::pressure ( ) const
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().

◆ writeParamNoSweep()

void Pscf::Fd1d::System::writeParamNoSweep ( std::ostream &  out) const

Write parameter file to an ostream, omitting any Sweep block.

Parameters
outoutput stream

Definition at line 232 of file fd1d/System.cpp.

References Util::ParamComposite::writeParam().

◆ writeThermo()

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.

Parameters
outoutput 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().

◆ writeW()

void Pscf::Fd1d::System::writeW ( std::string const &  filename)

Write chemical potential fields in symmetrized basis format.

Parameters
filenamename of output file

Definition at line 733 of file fd1d/System.cpp.

References wFields(), and Pscf::Fd1d::FieldIo::writeFields().

◆ writeC()

void Pscf::Fd1d::System::writeC ( std::string const &  filename)

Write concentration fields in symmetrized basis format.

Parameters
filenamename of output file

Definition at line 742 of file fd1d/System.cpp.

References cFields(), and Pscf::Fd1d::FieldIo::writeFields().

◆ writeBlockC()

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.

Parameters
filenamename of output file

Definition at line 752 of file fd1d/System.cpp.

References Pscf::Fd1d::FieldIo::writeBlockCFields().

◆ writeQSlice()

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.

Parameters
filenamename of output file
polymerIdinteger id of the polymer
blockIdinteger id of the block within the polymer
directionIdinteger id of the direction (0 or 1)
segmentIdinteger 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().

◆ writeQTail()

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.

Parameters
filenamename of output file
polymerIdinteger id of the polymer
blockIdinteger id of the block within the polymer
directionIdinteger 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().

◆ writeQ()

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.

Parameters
filenamename of output file
polymerIdinteger id of the polymer
blockIdinteger id of the block within the polymer
directionIdinteger 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().

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

Parameters
basenamecommon 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().

◆ wFields()

DArray< System::WField > & Pscf::Fd1d::System::wFields ( )
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().

◆ wField()

System::WField & Pscf::Fd1d::System::wField ( int  monomerId)
inline

Get chemical potential field for a specific monomer type.

Parameters
monomerIdinteger 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().

◆ cFields()

DArray< System::CField > & Pscf::Fd1d::System::cFields ( )
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().

◆ cField()

System::CField & Pscf::Fd1d::System::cField ( int  monomerId)
inline

Get chemical potential field for a specific monomer type.

Parameters
monomerIdinteger 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().

◆ mixture() [1/2]

Mixture & Pscf::Fd1d::System::mixture ( )
inline

◆ mixture() [2/2]

Mixture const & Pscf::Fd1d::System::mixture ( ) const
inline

Get Mixture by reference.

Definition at line 543 of file fd1d/System.h.

◆ interaction() [1/2]

Interaction & Pscf::Fd1d::System::interaction ( )
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().

◆ interaction() [2/2]

Interaction const & Pscf::Fd1d::System::interaction ( ) const
inline

Get interaction (i.e., excess free energy) by const reference.

Definition at line 558 of file fd1d/System.h.

References UTIL_ASSERT.

◆ domain()

Domain & Pscf::Fd1d::System::domain ( )
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().

◆ iterator()

Iterator & Pscf::Fd1d::System::iterator ( )
inline

Get the Iterator by reference.

Definition at line 580 of file fd1d/System.h.

References UTIL_ASSERT.

Referenced by iterate().

◆ homogeneous()

Homogeneous::Mixture & Pscf::Fd1d::System::homogeneous ( )
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().

◆ fileMaster()

FileMaster & Pscf::Fd1d::System::fileMaster ( )
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().


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