PSCF v1.2
Pscf::Edge Class Reference

Descriptor for a block within an acyclic block polymer. More...

#include <Edge.h>

Inheritance diagram for Pscf::Edge:
Pscf::BlockTmpl< Propagator > Pscf::BlockTmpl< Propagator< D > > Pscf::BlockTmpl< TP > Pscf::R1d::Block Pscf::Rpc::Block< D > Pscf::Rpg::Block< D >

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.
 

Detailed Description

Descriptor for a block within an acyclic block polymer.

An Edge has:

  • a monomer type id
  • a length
  • a block id (unique with the polymer)
  • ids of the two vertices at which it terminates

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.

Parameter File Format

Definition at line 49 of file Edge.h.

Constructor & Destructor Documentation

◆ Edge()

Pscf::Edge::Edge ( )

Constructor.

Definition at line 16 of file Edge.cpp.

◆ ~Edge()

Pscf::Edge::~Edge ( )
virtual

Destructor.

Definition at line 31 of file Edge.cpp.

Member Function Documentation

◆ serialize()

template<class Archive >
void Pscf::Edge::serialize ( Archive & ar,
unsigned int versionId )

Serialize to/from archive.

Parameters
arinput or output Archive
versionIdarchive format version index

Definition at line 266 of file Edge.h.

◆ setId()

void Pscf::Edge::setId ( int id)

Set the id for this block.

Parameters
idinteger index for this block

Definition at line 37 of file Edge.cpp.

References id().

Referenced by Pscf::PolymerSpecies::readParameters().

◆ setVertexIds()

void Pscf::Edge::setVertexIds ( int vertexAId,
int vertexBId )

Set indices of associated vertices.

Parameters
vertexAIdinteger id of vertex A
vertexBIdinteger id of vertex B

Definition at line 43 of file Edge.cpp.

Referenced by Pscf::PolymerSpecies::readParameters().

◆ setMonomerId()

void Pscf::Edge::setMonomerId ( int monomerId)

Set the monomer type id.

Parameters
monomerIdinteger id of monomer type

Definition at line 52 of file Edge.cpp.

References monomerId().

◆ setLength()

void Pscf::Edge::setLength ( double length)
virtual

Set the length of this block.

The ``length" is steric volume / reference volume.

Parameters
lengthblock 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().

◆ setPolymerType()

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.

Parameters
typetype of polymer (branched or linear)

Definition at line 64 of file Edge.cpp.

Referenced by Pscf::PolymerSpecies::readParameters().

◆ id()

int Pscf::Edge::id ( ) const
inline

Get the id of this block.

Definition at line 229 of file Edge.h.

Referenced by Pscf::Vertex::addEdge(), and setId().

◆ monomerId()

int Pscf::Edge::monomerId ( ) const
inline

Get the monomer type id.

Definition at line 235 of file Edge.h.

Referenced by setMonomerId().

◆ vertexIds()

const Pair< int > & Pscf::Edge::vertexIds ( ) const
inline

Get the pair of associated vertex ids.

Definition at line 241 of file Edge.h.

◆ vertexId()

int Pscf::Edge::vertexId ( int i) const
inline

◆ length()

double Pscf::Edge::length ( ) const
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().

◆ polymerType()

PolymerType::Enum Pscf::Edge::polymerType ( ) const
inline

Get the type of the parent polymer (branched or linear).

Definition at line 259 of file Edge.h.

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
Edge & block )
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:

monomerId length vertexId(0) vertexid(1)
int monomerId() const
Get the monomer type id.
Definition Edge.h:235
int vertexId(int i) const
Get id of an associated vertex.
Definition Edge.h:247
double length() const
Get the length (number of monomers) in this block.
Definition Edge.h:253

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.

Parameters
ininput stream
blockEdge to be read from stream
Returns
modified input stream

Definition at line 70 of file Edge.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const Edge & block )
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.

Parameters
outoutput stream
blockEdge to be written to stream
Returns
modified output stream

Definition at line 84 of file Edge.cpp.


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