PSCF v1.1
|
Block within a branched polymer. More...
#include <Block.h>
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... | |
![]() | |
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... | |
![]() | |
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... | |
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.
Pscf::Pspg::Block< D >::Block |
Constructor.
Definition at line 140 of file pspg/solvers/Block.tpp.
References Pscf::BlockTmpl< Propagator< D > >::propagator().
Pscf::Pspg::Block< D >::~Block |
Destructor.
Definition at line 159 of file pspg/solvers/Block.tpp.
void Pscf::Pspg::Block< D >::setDiscretization | ( | double | ds, |
const Mesh< D > & | mesh | ||
) |
Initialize discretization and allocate required memory.
ds | desired (optimal) value for contour length step |
mesh | spatial 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.
void Pscf::Pspg::Block< D >::setupUnitCell | ( | UnitCell< D > const & | unitCell, |
WaveList< D > const & | waveList | ||
) |
Setup parameters that depend on the unit cell.
unitCell | unit cell, defining cell dimensions (input) |
waveList | container for properties of wavevectors (input) |
Definition at line 270 of file pspg/solvers/Block.tpp.
References Pscf::UnitCellBase< D >::nParameter().
|
virtual |
Set or reset block length.
length | new block length |
Reimplemented from Pscf::BlockDescriptor.
Definition at line 246 of file pspg/solvers/Block.tpp.
References Pscf::BlockDescriptor::setLength(), and UTIL_CHECK.
|
virtual |
Set or reset monomer statistical segment length.
kuhn | new monomer statistical segment length. |
Reimplemented from Pscf::BlockTmpl< Propagator< D > >.
Definition at line 260 of file pspg/solvers/Block.tpp.
void Pscf::Pspg::Block< D >::setupSolver | ( | RDField< D > const & | w | ) |
Set solver for this block.
w | chemical 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.
void Pscf::Pspg::Block< D >::setupFFT |
Initialize FFT and batch FFT classes.
Definition at line 383 of file pspg/solvers/Block.tpp.
void Pscf::Pspg::Block< D >::step | ( | cudaReal const * | q, |
cudaReal * | qNew | ||
) |
Compute step of integration loop, from i to i+1.
q | pointer to current slice of propagator q (input) |
qNew | pointer to current slice of propagator q (output) |
Definition at line 394 of file pspg/solvers/Block.tpp.
References UTIL_CHECK.
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.
prefactor | constant prefactor multiplying integral |
Definition at line 344 of file pspg/solvers/Block.tpp.
References Pscf::Pspg::Propagator< D >::q(), and UTIL_CHECK.
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.
waveList | container for properties of wavevectors |
prefactor | constant 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.
|
inline |
Get derivative of free energy w/ respect to a unit cell parameter.
n | unit cell parameter index |
Definition at line 279 of file pspg/solvers/Block.h.
|
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.
|
inline |
Contour length step size.
Get number of contour steps.
Definition at line 274 of file pspg/solvers/Block.h.
|
inline |
Number of contour length steps.
Get number of contour steps.
Definition at line 269 of file pspg/solvers/Block.h.
void Pscf::BlockDescriptor::setId | ( | int | id | ) |
Set the id for this block.
id | integer index for this block |
Definition at line 65 of file BlockDescriptor.cpp.
void Pscf::BlockDescriptor::setVertexIds | ( | int | vertexAId, |
int | vertexBId | ||
) |
Set indices of associated vertices.
vertexAId | integer id of vertex A |
vertexBId | integer id of vertex B |
Definition at line 73 of file BlockDescriptor.cpp.
void Pscf::BlockDescriptor::setMonomerId | ( | int | monomerId | ) |
Set the monomer id.
monomerId | integer id of monomer type (>=0) |
Definition at line 80 of file BlockDescriptor.cpp.
|
virtual |
Set the length of this block.
The ``length" is steric volume / reference volume.
length | block length (number of monomers). |
Reimplemented from Pscf::BlockDescriptor.
Definition at line 89 of file BlockDescriptor.cpp.
|
inline |
Get the id of this block.
Definition at line 115 of file BlockDescriptor.h.
|
inline |
Get the monomer type id.
Definition at line 120 of file BlockDescriptor.h.
|
inline |
Get the pair of associated vertex ids.
Definition at line 125 of file BlockDescriptor.h.
|
inline |
Get id of an associated vertex.
i | index of vertex (0 or 1) |
Definition at line 132 of file BlockDescriptor.h.
|
inline |
Get the length (number of monomers) in this block.
Definition at line 137 of file BlockDescriptor.h.