PSCF v1.3
Pscf::BlockTmpl< QT > Class Template Reference

Class template for a block solver in a block copolymer. More...

#include <BlockTmpl.h>

Inheritance diagram for Pscf::BlockTmpl< QT >:
Pscf::Edge

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

Detailed Description

template<class QT>
class Pscf::BlockTmpl< QT >

Class template for a block solver in a block copolymer.

Class template argument QT is a concrete propagator class. A BlockTmpl<QT> object has:

  • two QT propagator objects, one per direction
  • a monomer concentration field for the block
  • a kuhn length

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:

class Block : public BlockTmpl<Propagator>
{
....
}
BlockTmpl()
Constructor.
Definition BlockTmpl.h:232

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:

// -------------------------------------------------------------
// One step of integration of the modified diffusion equation.
//
// \param in input q-field from previous step
// \param out output q-field at next step
// -------------------------------------------------------------
void step(Propagator::FieldT const & in, Propagator::FieldT& out);
// -------------------------------------------------------------
// Compute monomer concentration field for this block.
//
// \param prefactor numerical prefactor of phi/(Q*length)
// -------------------------------------------------------------
void computeConcentration(double prefactor);

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.

Member Typedef Documentation

◆ PropagatorT

template<class QT>
using Pscf::BlockTmpl< QT >::PropagatorT = QT

Modified diffusion equation solver (propagator) type.

Definition at line 116 of file BlockTmpl.h.

Constructor & Destructor Documentation

◆ BlockTmpl()

template<class QT>
Pscf::BlockTmpl< QT >::BlockTmpl ( )

Constructor.

Definition at line 232 of file BlockTmpl.h.

References propagator().

◆ ~BlockTmpl()

template<class QT>
Pscf::BlockTmpl< QT >::~BlockTmpl ( )
virtual

Destructor.

Definition at line 247 of file BlockTmpl.h.

Member Function Documentation

◆ setKuhn()

template<class QT>
void Pscf::BlockTmpl< QT >::setKuhn ( double kuhn)
virtual

Set monomer statistical segment length.

Parameters
kuhnmonomer statistical segment length

Reimplemented in Pscf::Rpc::Block< D >, and Pscf::Rpg::Block< D >.

Definition at line 254 of file BlockTmpl.h.

References kuhn().

◆ propagator() [1/2]

template<class QT>
QT & Pscf::BlockTmpl< QT >::propagator ( int directionId)
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.

Parameters
directionIdinteger index for direction (0 or 1)

Definition at line 192 of file BlockTmpl.h.

Referenced by BlockTmpl().

◆ propagator() [2/2]

template<class QT>
QT const & Pscf::BlockTmpl< QT >::propagator ( int directionId) const
inline

Get a const Propagator for a specified direction.

See above for number conventions.

Parameters
directionIdinteger index for direction (0 or 1)

Definition at line 200 of file BlockTmpl.h.

◆ cField() [1/2]

template<class QT>
QT::FieldT & Pscf::BlockTmpl< QT >::cField ( )
inline

Get the associated monomer concentration field.

Definition at line 208 of file BlockTmpl.h.

◆ cField() [2/2]

template<class QT>
QT::FieldT const & Pscf::BlockTmpl< QT >::cField ( ) const
inline

Get the associated const monomer concentration field.

Definition at line 216 of file BlockTmpl.h.

◆ kuhn()

template<class QT>
double Pscf::BlockTmpl< QT >::kuhn ( ) const
inline

Get monomer statistical segment length.

Definition at line 223 of file BlockTmpl.h.

Referenced by setKuhn().


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