PSCF v1.1
Public Member Functions | List of all members
Pscf::Pspg::Block< D > Class Template Reference

Block within a branched polymer. More...

#include <Block.h>

Inheritance diagram for Pscf::Pspg::Block< D >:
Pscf::BlockTmpl< Propagator< D > > Pscf::BlockDescriptor

Public Member Functions

 Block ()
 Constructor. More...
 
 ~Block ()
 Destructor. More...
 
void setDiscretization (double ds, const Mesh< D > &mesh)
 Initialize discretization and allocate required memory. More...
 
void setupUnitCell (UnitCell< D > const &unitCell, WaveList< D > const &waveList)
 Setup parameters that depend on the unit cell. More...
 
void setLength (double length)
 Set or reset block length. More...
 
void setKuhn (double kuhn)
 Set or reset monomer statistical segment length. More...
 
void setupSolver (RDField< D > const &w)
 Set solver for this block. More...
 
void setupFFT ()
 Initialize FFT and batch FFT classes. More...
 
void step (cudaReal const *q, cudaReal *qNew)
 Compute step of integration loop, from i to i+1. More...
 
void computeConcentration (double prefactor)
 Compute unnormalized concentration for block by integration. More...
 
void computeStress (WaveList< D > const &waveList, double prefactor)
 Compute derivatives of free energy w/ respect to cell parameters. More...
 
double stress (int n)
 Get derivative of free energy w/ respect to a unit cell parameter. More...
 
Mesh< D > const & mesh () const
 Return associated spatial Mesh by const reference. More...
 
double ds () const
 Contour length step size. More...
 
int ns () const
 Number of contour length steps. 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...
 
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...
 
- Public Member Functions inherited from Pscf::BlockTmpl< Propagator< D > >
 BlockTmpl ()
 Constructor. More...
 
virtual ~BlockTmpl ()
 Destructor. More...
 
virtual void setKuhn (double kuhn)
 Set monomer statistical segment length. More...
 
Propagator< D > & propagator (int directionId)
 Get a Propagator for a specified direction. More...
 
Propagator< D > 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...
 
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<int D>
class Pscf::Pspg::Block< D >

Block within a branched polymer.

Derived from BlockTmpl<Propagator<D>>. A BlockTmpl<Propagator<D>> has two Propagator<D> members and is derived from BlockDescriptor.

Definition at line 39 of file pspg/solvers/Block.h.

Constructor & Destructor Documentation

◆ Block()

template<int D>
Pscf::Pspg::Block< D >::Block

Constructor.

Definition at line 140 of file pspg/solvers/Block.tpp.

References Pscf::BlockTmpl< Propagator< D > >::propagator().

◆ ~Block()

template<int D>
Pscf::Pspg::Block< D >::~Block

Destructor.

Definition at line 159 of file pspg/solvers/Block.tpp.

Member Function Documentation

◆ setDiscretization()

template<int D>
void Pscf::Pspg::Block< D >::setDiscretization ( double  ds,
const Mesh< D > &  mesh 
)

Initialize discretization and allocate required memory.

Parameters
dsdesired (optimal) value for contour length step
meshspatial discretization mesh

Definition at line 173 of file pspg/solvers/Block.tpp.

References Pscf::Mesh< D >::dimensions(), Pscf::Pspg::ThreadGrid::setThreadsLogical(), Pscf::Mesh< D >::size(), and UTIL_CHECK.

◆ setupUnitCell()

template<int D>
void Pscf::Pspg::Block< D >::setupUnitCell ( UnitCell< D > const &  unitCell,
WaveList< D > const &  waveList 
)

Setup parameters that depend on the unit cell.

Parameters
unitCellunit cell, defining cell dimensions (input)
waveListcontainer for properties of wavevectors (input)

Definition at line 270 of file pspg/solvers/Block.tpp.

References Pscf::UnitCellBase< D >::nParameter().

◆ setLength() [1/2]

template<int D>
void Pscf::Pspg::Block< D >::setLength ( double  length)
virtual

Set or reset block length.

Parameters
lengthnew block length

Reimplemented from Pscf::BlockDescriptor.

Definition at line 246 of file pspg/solvers/Block.tpp.

References Pscf::BlockDescriptor::setLength(), and UTIL_CHECK.

◆ setKuhn()

template<int D>
void Pscf::Pspg::Block< D >::setKuhn ( double  kuhn)
virtual

Set or reset monomer statistical segment length.

Parameters
kuhnnew monomer statistical segment length.

Reimplemented from Pscf::BlockTmpl< Propagator< D > >.

Definition at line 260 of file pspg/solvers/Block.tpp.

◆ setupSolver()

template<int D>
void Pscf::Pspg::Block< D >::setupSolver ( RDField< D > const &  w)

Set solver for this block.

Parameters
wchemical potential field for this monomer type

Definition at line 320 of file pspg/solvers/Block.tpp.

References Pscf::Pspg::DField< Data >::cDField(), and UTIL_CHECK.

◆ setupFFT()

template<int D>
void Pscf::Pspg::Block< D >::setupFFT

Initialize FFT and batch FFT classes.

Definition at line 383 of file pspg/solvers/Block.tpp.

◆ step()

template<int D>
void Pscf::Pspg::Block< D >::step ( cudaReal const *  q,
cudaReal *  qNew 
)

Compute step of integration loop, from i to i+1.

Parameters
qpointer to current slice of propagator q (input)
qNewpointer to current slice of propagator q (output)

Definition at line 394 of file pspg/solvers/Block.tpp.

References UTIL_CHECK.

◆ computeConcentration()

template<int D>
void Pscf::Pspg::Block< D >::computeConcentration ( double  prefactor)

Compute unnormalized concentration for block by integration.

Upon return, grid point r of array cField() contains the integral int ds q(r,s)q^{*}(r,L-s) times the prefactor, where q(r,s) is the solution obtained from propagator(0), and q^{*} is the solution of propagator(1), and s is a contour variable that is integrated over the domain 0 < s < length(), where length() is the block length.

Parameters
prefactorconstant prefactor multiplying integral

Definition at line 344 of file pspg/solvers/Block.tpp.

References Pscf::Pspg::Propagator< D >::q(), and UTIL_CHECK.

◆ computeStress()

template<int D>
void Pscf::Pspg::Block< D >::computeStress ( WaveList< D > const &  waveList,
double  prefactor 
)

Compute derivatives of free energy w/ respect to cell parameters.

The prefactor is the same as that used in computeConcentration.

Parameters
waveListcontainer for properties of wavevectors
prefactorconstant prefactor multiplying integral

Definition at line 440 of file pspg/solvers/Block.tpp.

References Pscf::Pspg::WaveList< D >::dkSq(), Pscf::Pspg::Propagator< D >::head(), and UTIL_CHECK.

◆ stress()

template<int D>
double Pscf::Pspg::Block< D >::stress ( int  n)
inline

Get derivative of free energy w/ respect to a unit cell parameter.

Parameters
nunit cell parameter index

Definition at line 279 of file pspg/solvers/Block.h.

◆ mesh()

template<int D>
Mesh< D > const & Pscf::Pspg::Block< D >::mesh
inline

Return associated spatial Mesh by const reference.

Get Mesh by reference.

Definition at line 284 of file pspg/solvers/Block.h.

References UTIL_ASSERT.

◆ ds()

template<int D>
double Pscf::Pspg::Block< D >::ds
inline

Contour length step size.

Get number of contour steps.

Definition at line 274 of file pspg/solvers/Block.h.

◆ ns()

template<int D>
int Pscf::Pspg::Block< D >::ns
inline

Number of contour length steps.

Get number of contour steps.

Definition at line 269 of file pspg/solvers/Block.h.

◆ setId()

template<int D>
void Pscf::BlockDescriptor::setId ( int  id)

Set the id for this block.

Parameters
idinteger index for this block

Definition at line 65 of file BlockDescriptor.cpp.

◆ setVertexIds()

template<int D>
void Pscf::BlockDescriptor::setVertexIds ( int  vertexAId,
int  vertexBId 
)

Set indices of associated vertices.

Parameters
vertexAIdinteger id of vertex A
vertexBIdinteger id of vertex B

Definition at line 73 of file BlockDescriptor.cpp.

◆ setMonomerId()

template<int D>
void Pscf::BlockDescriptor::setMonomerId ( int  monomerId)

Set the monomer id.

Parameters
monomerIdinteger id of monomer type (>=0)

Definition at line 80 of file BlockDescriptor.cpp.

◆ setLength() [2/2]

template<int D>
void Pscf::BlockDescriptor::setLength ( double  length)
virtual

Set the length of this block.

The ``length" is steric volume / reference volume.

Parameters
lengthblock length (number of monomers).

Reimplemented from Pscf::BlockDescriptor.

Definition at line 89 of file BlockDescriptor.cpp.

◆ id()

template<int D>
int Pscf::BlockDescriptor::id ( ) const
inline

Get the id of this block.

Definition at line 115 of file BlockDescriptor.h.

◆ monomerId()

template<int D>
int Pscf::BlockDescriptor::monomerId ( ) const
inline

Get the monomer type id.

Definition at line 120 of file BlockDescriptor.h.

◆ vertexIds()

template<int D>
const Pair< int > & Pscf::BlockDescriptor::vertexIds ( ) const
inline

Get the pair of associated vertex ids.

Definition at line 125 of file BlockDescriptor.h.

◆ vertexId()

template<int D>
int Pscf::BlockDescriptor::vertexId ( int  i) const
inline

Get id of an associated vertex.

Parameters
iindex of vertex (0 or 1)

Definition at line 132 of file BlockDescriptor.h.

◆ length()

template<int D>
double Pscf::BlockDescriptor::length ( ) const
inline

Get the length (number of monomers) in this block.

Definition at line 137 of file BlockDescriptor.h.


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