PSCF v1.1
Public Member Functions | List of all members
Pscf::Fd1d::Block Class Reference

Block within a branched polymer. More...

#include <Block.h>

Inheritance diagram for Pscf::Fd1d::Block:
Pscf::BlockTmpl< Propagator > Pscf::BlockDescriptor

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...
 
- Public Member Functions inherited from Pscf::BlockTmpl< Propagator >
 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...
 
- 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

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.

Constructor & Destructor Documentation

◆ Block()

Pscf::Fd1d::Block::Block ( )

Constructor.

Definition at line 20 of file fd1d/solvers/Block.cpp.

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

◆ ~Block()

Pscf::Fd1d::Block::~Block ( )

Destructor.

Definition at line 33 of file fd1d/solvers/Block.cpp.

Member Function Documentation

◆ setDiscretization()

void Pscf::Fd1d::Block::setDiscretization ( Domain const &  domain,
double  ds 
)

Initialize discretization and allocate required memory.

Parameters
domainassociated Domain object, with grid info
dsdesired (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.

◆ setLength()

void Pscf::Fd1d::Block::setLength ( double  newLength)
virtual

Set length and readjust ds_ accordingly.

Parameters
newLengthlength (# 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.

◆ setupSolver()

void Pscf::Fd1d::Block::setupSolver ( DArray< double > const &  w)

◆ computeConcentration()

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.

Parameters
prefactorconstant 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.

◆ step()

void Pscf::Fd1d::Block::step ( DArray< double > const &  q,
DArray< double > &  qNew 
)

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

Parameters
qpropagator slice at step i (input)
qNewpropagator 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().

◆ domain()

Domain const & Pscf::Fd1d::Block::domain ( ) const
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().

◆ ns()

int Pscf::Fd1d::Block::ns ( ) const
inline

Number of contour length steps.

Get number of contour steps.

Definition at line 155 of file fd1d/solvers/Block.h.


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