PSCF v1.1
|
Block within a branched polymer. More...
#include <Block.h>
Public Member Functions | |
Block () | |
Constructor. More... | |
~Block () | |
Destructor. More... | |
void | setDiscretization (Domain const &domain, double ds) |
Initialize discretization and allocate required memory. More... | |
virtual void | setLength (double newLength) |
Set length and readjust ds_ accordingly. More... | |
void | setupSolver (DArray< double > const &w) |
Set Crank-Nicholson solver for this block. More... | |
void | computeConcentration (double prefactor) |
Compute concentration for block by integration. More... | |
void | step (DArray< double > const &q, DArray< double > &qNew) |
Compute one step of integration loop, from i to i+1. More... | |
Domain const & | domain () const |
Return associated domain by reference. More... | |
int | ns () const |
Number of contour length steps. More... | |
![]() | |
BlockTmpl () | |
Constructor. More... | |
virtual | ~BlockTmpl () |
Destructor. More... | |
virtual void | setKuhn (double kuhn) |
Set monomer statistical segment length. More... | |
Propagator & | propagator (int directionId) |
Get a Propagator for a specified direction. More... | |
Propagator 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>. A BlockTmpl<Propagator> has two Propagator members and is derived from BlockDescriptor.
Definition at line 31 of file fd1d/solvers/Block.h.
Pscf::Fd1d::Block::Block | ( | ) |
Constructor.
Definition at line 20 of file fd1d/solvers/Block.cpp.
References Pscf::BlockTmpl< Propagator >::propagator().
Pscf::Fd1d::Block::~Block | ( | ) |
Destructor.
Definition at line 33 of file fd1d/solvers/Block.cpp.
void Pscf::Fd1d::Block::setDiscretization | ( | Domain const & | domain, |
double | ds | ||
) |
Initialize discretization and allocate required memory.
domain | associated Domain object, with grid info |
ds | desired (optimal) value for contour length step |
Definition at line 36 of file fd1d/solvers/Block.cpp.
References Util::DArray< Data >::allocate(), Pscf::TridiagonalSolver::allocate(), Pscf::BlockTmpl< Propagator >::cField(), domain(), Pscf::BlockDescriptor::length(), Pscf::Fd1d::Domain::nx(), Pscf::BlockTmpl< Propagator >::propagator(), and UTIL_CHECK.
|
virtual |
Set length and readjust ds_ accordingly.
newLength | length (# of monomers) for this block |
Reimplemented from Pscf::BlockDescriptor.
Definition at line 68 of file fd1d/solvers/Block.cpp.
References Pscf::BlockDescriptor::length(), Pscf::BlockTmpl< Propagator >::propagator(), Pscf::BlockDescriptor::setLength(), and UTIL_CHECK.
void Pscf::Fd1d::Block::setupSolver | ( | DArray< double > const & | w | ) |
Set Crank-Nicholson solver for this block.
w | Chemical potential field (input) |
Definition at line 120 of file fd1d/solvers/Block.cpp.
References Util::Array< Data >::capacity(), Pscf::TridiagonalSolver::computeLU(), domain(), Pscf::Fd1d::Domain::dx(), Pscf::Fd1d::Domain::isShell(), Pscf::BlockTmpl< Propagator >::kuhn(), Pscf::BlockDescriptor::length(), Pscf::Fd1d::Domain::mode(), Pscf::Fd1d::Domain::nx(), Pscf::BlockTmpl< Propagator >::propagator(), UTIL_CHECK, UTIL_THROW, Pscf::Fd1d::Domain::xMax(), and Pscf::Fd1d::Domain::xMin().
void Pscf::Fd1d::Block::computeConcentration | ( | double | prefactor | ) |
Compute 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 241 of file fd1d/solvers/Block.cpp.
References Util::Array< Data >::capacity(), Pscf::BlockTmpl< Propagator >::cField(), domain(), Pscf::Fd1d::Domain::nx(), Pscf::BlockTmpl< Propagator >::propagator(), and UTIL_CHECK.
Compute one step of integration loop, from i to i+1.
q | propagator slice at step i (input) |
qNew | propagator slice at step i + 1 (output) |
Definition at line 294 of file fd1d/solvers/Block.cpp.
References domain(), Pscf::Fd1d::Domain::nx(), and Pscf::TridiagonalSolver::solve().
Referenced by Pscf::Fd1d::Propagator::solve().
|
inline |
Return associated domain by reference.
Get Domain by reference.
Definition at line 148 of file fd1d/solvers/Block.h.
References UTIL_ASSERT.
Referenced by computeConcentration(), Pscf::Fd1d::Propagator::computeQ(), setDiscretization(), setupSolver(), and step().
|
inline |
Number of contour length steps.
Get number of contour steps.
Definition at line 155 of file fd1d/solvers/Block.h.