PSCF v1.2
|
Descriptor for a block within an acyclic block polymer. More...
#include <Edge.h>
Public Member Functions | |
Edge () | |
Constructor. | |
virtual | ~Edge () |
Destructor. | |
template<class Archive > | |
void | serialize (Archive &ar, unsigned int versionId) |
Serialize to/from archive. | |
Setters | |
void | setId (int id) |
Set the id for this block. | |
void | setVertexIds (int vertexAId, int vertexBId) |
Set indices of associated vertices. | |
void | setMonomerId (int monomerId) |
Set the monomer type id. | |
virtual void | setLength (double length) |
Set the length of this block. | |
void | setPolymerType (PolymerType::Enum type) |
Set the polymer type (branched or linear). | |
Accessors (getters) | |
int | id () const |
Get the id of this block. | |
int | monomerId () const |
Get the monomer type id. | |
const Pair< int > & | vertexIds () const |
Get the pair of associated vertex ids. | |
int | vertexId (int i) const |
Get id of an associated vertex. | |
double | length () const |
Get the length (number of monomers) in this block. | |
PolymerType::Enum | polymerType () const |
Get the type of the parent polymer (branched or linear). | |
std::istream & | operator>> (std::istream &in, Edge &block) |
Input stream extractor (>>) for a Edge. | |
std::ostream & | operator<< (std::ostream &out, const Edge &block) |
Output stream inserter (<<) for a Edge. | |
Descriptor for a block within an acyclic block polymer.
An Edge has:
An Edge is a descriptor for a block within a block polymer, but does not provide functions or data structure needed to solve the modified diffusion equation (MDE). The Edge class is used as a base class for subclasses that are block MDE solvers as well as descriptors. Each implementation level sub-namespace of Pscf (i.e., R1d, Rpc and Rpg) contains a class named Block that is both a descriptor and an MDE solver for the associated block. Each such Block class is a subclass of an instance of a class template Pscf::BlockTmpl, which is itself a subclass of the Edge class.
Block objects associated with a polymer are normally stored in an array that is a private member of the Pscf::PolymerTmpl class template. The block id for each edge be set to the element index of the Block within that array.
void Pscf::Edge::serialize | ( | Archive & | ar, |
unsigned int | versionId ) |
void Pscf::Edge::setId | ( | int | id | ) |
Set the id for this block.
id | integer index for this block |
Definition at line 37 of file Edge.cpp.
References id().
Referenced by Pscf::PolymerSpecies::readParameters().
void Pscf::Edge::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 43 of file Edge.cpp.
Referenced by Pscf::PolymerSpecies::readParameters().
void Pscf::Edge::setMonomerId | ( | int | monomerId | ) |
Set the monomer type id.
monomerId | integer id of monomer type |
Definition at line 52 of file Edge.cpp.
References monomerId().
|
virtual |
Set the length of this block.
The ``length" is steric volume / reference volume.
length | block length (number of monomers). |
Reimplemented in Pscf::R1d::Block, Pscf::Rpc::Block< D >, and Pscf::Rpg::Block< D >.
Definition at line 58 of file Edge.cpp.
References length().
Referenced by Pscf::R1d::Block::setLength(), Pscf::Rpc::Block< D >::setLength(), and Pscf::Rpg::Block< D >::setLength().
void Pscf::Edge::setPolymerType | ( | PolymerType::Enum | type | ) |
Set the polymer type (branched or linear).
By convention, if the polymer type of a block with block index id is PolymerType::Linear, then vertexId(0) = id and vertexId(1) = id + 1. The stream insertion and extraction operators for a Edge can thus use a shorter string representation for linear polymers in in which vertex ids are omitted.
type | type of polymer (branched or linear) |
Definition at line 64 of file Edge.cpp.
Referenced by Pscf::PolymerSpecies::readParameters().
|
inline |
Get the id of this block.
Definition at line 229 of file Edge.h.
Referenced by Pscf::Vertex::addEdge(), and setId().
|
inline |
|
inline |
|
inline |
Get id of an associated vertex.
i | index of vertex (0 or 1) |
Definition at line 247 of file Edge.h.
Referenced by Pscf::Vertex::addEdge(), Pscf::EdgeIterator::begin(), Pscf::PolymerSpecies::isValid(), Pscf::PolymerSpecies::makePlan(), Pscf::EdgeIterator::operator++(), Pscf::VertexIterator::operator++(), and Pscf::PolymerSpecies::readParameters().
|
inline |
Get the length (number of monomers) in this block.
Definition at line 253 of file Edge.h.
Referenced by Pscf::PolymerSpecies::length(), Pscf::R1d::Block::setDiscretization(), setLength(), Pscf::R1d::Block::setLength(), and Pscf::R1d::Block::setupSolver().
|
inline |
|
friend |
Input stream extractor (>>) for a Edge.
Different text representations are used for linear and branched polymers, based on the value of the polymerType enumeratin value. Text representation for a branched polymer is:
The vertex ids are omitted from the text representation for a linear polymer, because the vertex ids for a linear polymer must be equal to id and id + 1, where id denotes the block id.
The polymerType must be set before a Edge can be read from a stream. The block id must be set explicitly by calling setId, rather than read from an istream. Vertex id values for blocks in a linear polymer must be set explicitly by calling setVertexIds with consecutive values, as done in the function Pscf::PolymerTmpl::readParameters.
in | input stream |
block | Edge to be read from stream |
|
friend |
Output stream inserter (<<) for a Edge.
Different text representations are used for linear and branched polymers, as discussed in documentation for the stream extractor (>>) operator. Vertex ids are output only for blocks of branched polymers.
out | output stream |
block | Edge to be written to stream |