PSCF v1.3
Pscf::R1d::Block Class Reference

Block within a branched polymer. More...

#include <Block.h>

Inheritance diagram for Pscf::R1d::Block:
Pscf::BlockTmpl< Propagator > Pscf::Edge

Public Member Functions

 Block ()
 Constructor.
 ~Block ()
 Destructor.
void setDiscretization (Domain const &domain, double ds)
 Initialize discretization and allocate required memory.
virtual void setLength (double newLength)
 Set length and readjust ds_ accordingly.
void setupSolver (DArray< double > const &w)
 Set Crank-Nicholson solver for this block.
void computeConcentration (double prefactor)
 Compute concentration for block by integration.
void step (DArray< double > const &q, DArray< double > &qNew)
 Compute one step of integration loop, from i to i+1.
Domain const & domain () const
 Return associated domain by reference.
int ns () const
 Number of contour length steps.
Public Member Functions inherited from Pscf::BlockTmpl< Propagator >
 BlockTmpl ()
 Constructor.
virtual ~BlockTmpl ()
 Destructor.
virtual void setKuhn (double kuhn)
 Set monomer statistical segment length.
Propagator & propagator (int directionId)
 Get a Propagator for a specified direction.
Propagator::FieldT & cField ()
 Get the associated monomer concentration field.
double kuhn () const
 Get monomer statistical segment length.
Public Member Functions inherited from Pscf::Edge
 Edge ()
 Constructor.
virtual ~Edge ()
 Destructor.
template<class Archive>
void serialize (Archive &ar, unsigned int versionId)
 Serialize to/from archive.
void setId (int id)
 Set the id for this block.
void setMonomerId (int monomerId)
 Set the monomer type id.
void setVertexIds (int vertexId0, int vertexId1)
 Set indices of associated vertices.
virtual void setNBead (int nBead)
 Set the number of beads in this block (only valid for bead model).
void setPolymerType (PolymerType::Enum type)
 Set the type of the parent polymer (branched or linear).
int id () const
 Get the id of this block (unique within the polymer).
int monomerId () const
 Get the monomer type id for this block.
const Pair< int > & vertexIds () const
 Get the pair of associated vertex ids.
int vertexId (int i) const
 Get the id of one associated vertex.
double length () const
 Get the length of this block, in the thread model.
int nBead () const
 Get the number of beads in this block, in the bead model.
PolymerType::Enum polymerType () const
 Get the type of the parent polymer (branched or linear).

Additional Inherited Members

Public Types inherited from Pscf::BlockTmpl< Propagator >
using PropagatorT
 Modified diffusion equation solver (propagator) type.

Detailed Description

Block within a branched polymer.

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

Definition at line 30 of file r1d/solvers/Block.h.

Constructor & Destructor Documentation

◆ Block()

Pscf::R1d::Block::Block ( )

Constructor.

Definition at line 21 of file r1d/solvers/Block.cpp.

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

◆ ~Block()

Pscf::R1d::Block::~Block ( )

Destructor.

Definition at line 34 of file r1d/solvers/Block.cpp.

Member Function Documentation

◆ setDiscretization()

void Pscf::R1d::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 37 of file r1d/solvers/Block.cpp.

References Pscf::BlockTmpl< Propagator >::cField(), domain(), Pscf::Edge::length(), Pscf::BlockTmpl< Propagator >::propagator(), and UTIL_CHECK.

◆ setLength()

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

Set length and readjust ds_ accordingly.

Parameters
newLengthlength (# of monomers) for this block

Reimplemented from Pscf::Edge.

Definition at line 69 of file r1d/solvers/Block.cpp.

References Pscf::Edge::length(), Pscf::BlockTmpl< Propagator >::propagator(), Pscf::Edge::setLength(), and UTIL_CHECK.

◆ setupSolver()

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

◆ computeConcentration()

void Pscf::R1d::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 242 of file r1d/solvers/Block.cpp.

References Pscf::BlockTmpl< Propagator >::cField(), domain(), Pscf::R1d::Domain::nx(), Pscf::BlockTmpl< Propagator >::propagator(), Pscf::R1d::Propagator::q(), and UTIL_CHECK.

◆ step()

void Pscf::R1d::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 295 of file r1d/solvers/Block.cpp.

References domain(), and Pscf::R1d::Domain::nx().

◆ domain()

Domain const & Pscf::R1d::Block::domain ( ) const
inline

Return associated domain by reference.

Get Domain by reference.

Definition at line 147 of file r1d/solvers/Block.h.

References UTIL_ASSERT.

Referenced by computeConcentration(), setDiscretization(), setupSolver(), and step().

◆ ns()

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

Number of contour length steps.

Get number of contour steps.

Definition at line 154 of file r1d/solvers/Block.h.


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