PSCF v1.1
Public Member Functions | List of all members
Pscf::BlockTmpl< TP > Class Template Reference

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

#include <BlockTmpl.h>

Inheritance diagram for Pscf::BlockTmpl< TP >:
Pscf::BlockDescriptor

Public Member Functions

 BlockTmpl ()
 Constructor. More...
 
virtual ~BlockTmpl ()
 Destructor. More...
 
virtual void setKuhn (double kuhn)
 Set monomer statistical segment length. More...
 
TP & propagator (int directionId)
 Get a Propagator for a specified direction. More...
 
TP const & propagator (int directionId) const
 Get a const Propagator for a specified direction. More...
 
TP::CField & cField ()
 Get the associated monomer concentration field. More...
 
TP::CField const & cField () const
 Get the associated const monomer concentration field. More...
 
double kuhn () const
 Get monomer statistical segment length. More...
 
- Public Member Functions inherited from Pscf::BlockDescriptor
 BlockDescriptor ()
 Constructor. More...
 
virtual ~BlockDescriptor ()
 Destructor. More...
 
template<class Archive >
void serialize (Archive &ar, unsigned int versionId)
 Serialize to/from archive. More...
 
void setId (int id)
 Set the id for this block. More...
 
void setVertexIds (int vertexAId, int vertexBId)
 Set indices of associated vertices. More...
 
void setMonomerId (int monomerId)
 Set the monomer id. More...
 
virtual void setLength (double length)
 Set the length of this block. More...
 
void setPolymerType (PolymerType::Enum type)
 Set the polymer type. More...
 
int id () const
 Get the id of this block. More...
 
int monomerId () const
 Get the monomer type id. More...
 
const Pair< int > & vertexIds () const
 Get the pair of associated vertex ids. More...
 
int vertexId (int i) const
 Get id of an associated vertex. More...
 
double length () const
 Get the length (number of monomers) in this block. More...
 
PolymerType::Enum polymerType () const
 Get the type of the parent polymer (branched or linear). More...
 

Detailed Description

template<class TP>
class Pscf::BlockTmpl< TP >

Class template for a block in a block copolymer.

Class TP is a concrete propagator class. A BlockTmpl<TP> object has:

Each implementation of self-consistent field theory (SCFT) is defined in a different sub-namespace of Pscf. Each such implementation defines a concrete propagator class and a concrete block class, which ar named Propagator and Block by convention.The Block class in each implementation is derived from BlockTmpl<Propagator>, using the following syntax:

class Block : public BlockTmpl<Propagator>
{
....
}
Class template for a block in a block copolymer.
Definition: BlockTmpl.h:89

The algorithms for taking one step of integration of the modified diffusion equation and for computing the monomer concentration field arising from monomers in one block must be implemented in the Block class. These algorithms must be implemented in member functions of the concrete Block class with the following interfaces:

// ---------------------------------------------------------------
// Take one step of integration of the modified diffusion equation.
// ---------------------------------------------------------------
void step(Propagator::QField const & in, Propagator::QField& out);
// ---------------------------------------------------------------
// Compute monomer concentration field for this block.
//
// \param prefactor numerical prefactor of phi/(Q*length)
// ---------------------------------------------------------------
void computeConcentration(double prefactor);

These core algorithms are implemented in the Block class, rather than the Propagator class, because the data required to implement these algorithms generally depends on the monomer type and contour length step size ds of a particular block, and can thus be shared by the two propagators associated with a particular block. The data required to implement these algorithms cannot, however, be shared among propagators in different blocks of the same monomer type because the requirement that the length of each block be divided into an integer number of contour length steps implies that different blocks of arbitrary user-specified length must generally be assumed to have slightly different values for the step size ds.

The step() function is called in the implementation of the PropagatorTmpl::solve() member function, within a loop over steps. The computeConcentration() function is called in the implementation of the PolymerTmpl::solve() member function, within a loop over all blocks of the molecule that is called after solution of the modified diffusion equation for all propagators.

Definition at line 88 of file BlockTmpl.h.

Constructor & Destructor Documentation

◆ BlockTmpl()

template<class TP >
Pscf::BlockTmpl< TP >::BlockTmpl

Constructor.

Definition at line 214 of file BlockTmpl.h.

References Pscf::BlockTmpl< TP >::propagator().

◆ ~BlockTmpl()

template<class TP >
Pscf::BlockTmpl< TP >::~BlockTmpl
virtual

Destructor.

Definition at line 229 of file BlockTmpl.h.

Member Function Documentation

◆ setKuhn()

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

Set monomer statistical segment length.

Parameters
kuhnmonomer statistical segment length

Reimplemented in Pscf::Pspc::Block< D >, and Pscf::Pspg::Block< D >.

Definition at line 236 of file BlockTmpl.h.

◆ propagator() [1/2]

template<class TP >
TP & Pscf::BlockTmpl< TP >::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 174 of file BlockTmpl.h.

Referenced by Pscf::BlockTmpl< TP >::BlockTmpl().

◆ propagator() [2/2]

template<class TP >
TP const & Pscf::BlockTmpl< TP >::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 182 of file BlockTmpl.h.

◆ cField() [1/2]

template<class TP >
TP::CField & Pscf::BlockTmpl< TP >::cField
inline

Get the associated monomer concentration field.

Definition at line 190 of file BlockTmpl.h.

◆ cField() [2/2]

template<class TP >
TP::CField const & Pscf::BlockTmpl< TP >::cField
inline

Get the associated const monomer concentration field.

Definition at line 198 of file BlockTmpl.h.

◆ kuhn()

template<class TP >
double Pscf::BlockTmpl< TP >::kuhn
inline

Get monomer statistical segment length.

Definition at line 205 of file BlockTmpl.h.


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