PSCF v1.3
|
Class template for a block solver in a block copolymer. More...
#include <BlockTmpl.h>
Public Types | |
using | PropagatorT = QT |
Modified diffusion equation solver (propagator) type. |
Public Member Functions | |
BlockTmpl () | |
Constructor. | |
virtual | ~BlockTmpl () |
Destructor. | |
virtual void | setKuhn (double kuhn) |
Set monomer statistical segment length. | |
QT & | propagator (int directionId) |
Get a Propagator for a specified direction. | |
QT const & | propagator (int directionId) const |
Get a const Propagator for a specified direction. | |
QT::FieldT & | cField () |
Get the associated monomer concentration field. | |
QT::FieldT const & | cField () const |
Get the associated const monomer concentration field. | |
double | kuhn () const |
Get monomer statistical segment length. | |
Public Member Functions inherited from Pscf::Edge | |
Edge () | |
Constructor. | |
virtual | ~Edge () |
Destructor. | |
template<class Archive> | |
void | serialize (Archive &ar, unsigned int versionId) |
Serialize to/from archive. | |
void | setId (int id) |
Set the id for this block. | |
void | setMonomerId (int monomerId) |
Set the monomer type id. | |
void | setVertexIds (int vertexId0, int vertexId1) |
Set indices of associated vertices. | |
virtual void | setLength (double length) |
Set the length of this block (only valid for thread model). | |
virtual void | setNBead (int nBead) |
Set the number of beads in this block (only valid for bead model). | |
void | setPolymerType (PolymerType::Enum type) |
Set the type of the parent polymer (branched or linear). | |
int | id () const |
Get the id of this block (unique within the polymer). | |
int | monomerId () const |
Get the monomer type id for this block. | |
const Pair< int > & | vertexIds () const |
Get the pair of associated vertex ids. | |
int | vertexId (int i) const |
Get the id of one associated vertex. | |
double | length () const |
Get the length of this block, in the thread model. | |
int | nBead () const |
Get the number of beads in this block, in the bead model. | |
PolymerType::Enum | polymerType () const |
Get the type of the parent polymer (branched or linear). |
Class template for a block solver in a block copolymer.
Class template argument QT is a concrete propagator class. A BlockTmpl<QT> object has:
Each implementation of SCFT and/or FTS is defined in a different enclosed namespace of Pscf. Each such implementation defines a concrete propagator class and a concrete block class. By convention, these are named Propagator and Block, respectively. The Block class in each implementation is derived from BlockTmpl<Propagator>, using the following syntax:
Design notes:
The Block class of a polymer field theory implementation has member variables that specify all the data that is needed to describe the block. This includes but is not limited to the monomer type id and block length (defined by the Edge base class) and the kuhn length (defined by this class template). In addition, each such Block class may define a variety of member variables that define the numerical discretization of the block and any related parameters needed by the algorithm that solves the modified diffusion equation.
The Block class will normally define one or more public functions that can be called repeatedly by the Propagator::solve() function in order to implement individual steps of the stepping algorithm used to solve the MDE.
The Block class also normally provides a void function named computeConcentration() that integrates the product of the two associated propagators with respect to contour length in order to compute the monomer concentration field associated with the block. This is normally called within the implementation of solve() function of the associated Polymer class, within a loop over all blocks of the molecule that is called after solution of the modified diffusion equation for all propagators.
Here is an example of a simple interface of the Block class for an implementation that is designed for self-consistent field theory:
The step and computeConcentration functions in this example can both use private variables that depend on the monomer type and contour length of a particular block, and that apply to both of the two associated propagators. Parameters that depend upon the step size used to discretize the MDE for a particular block generally cannot, however, be re-used by other blocks, because the MDE solver algorithm for a thread model may use slightly different step sizes in different blocks in order to divide each block into an even integer number of steps of equal length.
Definition at line 106 of file BlockTmpl.h.
using Pscf::BlockTmpl< QT >::PropagatorT = QT |
Modified diffusion equation solver (propagator) type.
Definition at line 116 of file BlockTmpl.h.
Pscf::BlockTmpl< QT >::BlockTmpl | ( | ) |
|
virtual |
Destructor.
Definition at line 247 of file BlockTmpl.h.
|
virtual |
Set monomer statistical segment length.
kuhn | monomer statistical segment length |
Reimplemented in Pscf::Rpc::Block< D >, and Pscf::Rpg::Block< D >.
Definition at line 254 of file BlockTmpl.h.
References kuhn().
|
inline |
Get a Propagator for a specified direction.
For a block with v0 = vertexId(0) and v1 = vertexId(1), propagator(0) propagates from vertex v0 to v1, while propagator(1) propagates from vertex v1 to v0.
directionId | integer index for direction (0 or 1) |
Definition at line 192 of file BlockTmpl.h.
Referenced by BlockTmpl().
|
inline |
Get a const Propagator for a specified direction.
See above for number conventions.
directionId | integer index for direction (0 or 1) |
Definition at line 200 of file BlockTmpl.h.
|
inline |
Get the associated monomer concentration field.
Definition at line 208 of file BlockTmpl.h.
|
inline |
Get the associated const monomer concentration field.
Definition at line 216 of file BlockTmpl.h.
|
inline |
Get monomer statistical segment length.
Definition at line 223 of file BlockTmpl.h.
Referenced by setKuhn().