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

Description of a linear homopolymer block within a block polymer. More...

#include <BlockDescriptor.h>

Inheritance diagram for Pscf::BlockDescriptor:
Pscf::BlockTmpl< Propagator > Pscf::BlockTmpl< Propagator< D > > Pscf::BlockTmpl< TP > Pscf::Fd1d::Block Pscf::Pspc::Block< D > Pscf::Pspg::Block< D >

Public Member Functions

 BlockDescriptor ()
 Constructor. More...
 
virtual ~BlockDescriptor ()
 Destructor. More...
 
template<class Archive >
void serialize (Archive &ar, unsigned int versionId)
 Serialize to/from archive. More...
 
Setters
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...
 
virtual void setLength (double length)
 Set the length of this block. More...
 
void setPolymerType (PolymerType::Enum type)
 Set the polymer type. More...
 

Accessors (getters)

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...
 
std::istream & operator>> (std::istream &in, BlockDescriptor &block)
 istream extractor for a BlockDescriptor. More...
 
std::ostream & operator<< (std::ostream &out, const BlockDescriptor &block)
 ostream inserter for a BlockDescriptor. More...
 

Detailed Description

Description of a linear homopolymer block within a block polymer.

This class defines the blockId, monomerId, length and vertexIds of a block within a block polymer. It serves as a base class for the BlockTmpl class template, which is a template for classes that solve the modified diffusion equation for the two propagators associated with a block. VertexIds should be set for all blocks in a block polymer before the associated Vertex objects are initialized.

Parameter File Format

Definition at line 34 of file BlockDescriptor.h.

Constructor & Destructor Documentation

◆ BlockDescriptor()

Pscf::BlockDescriptor::BlockDescriptor ( )

Constructor.

Definition at line 16 of file BlockDescriptor.cpp.

◆ ~BlockDescriptor()

Pscf::BlockDescriptor::~BlockDescriptor ( )
virtual

Destructor.

Definition at line 31 of file BlockDescriptor.cpp.

Member Function Documentation

◆ serialize()

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

Serialize to/from archive.

Parameters
arinput or output Archive
versionIdarchive format version index

Definition at line 232 of file BlockDescriptor.h.

◆ setId()

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

Set the id for this block.

Parameters
idinteger index for this block

Definition at line 37 of file BlockDescriptor.cpp.

References id().

◆ setVertexIds()

void Pscf::BlockDescriptor::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 BlockDescriptor.cpp.

◆ setMonomerId()

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

Set the monomer id.

Parameters
monomerIdinteger id of monomer type (>=0)

Definition at line 52 of file BlockDescriptor.cpp.

References monomerId().

◆ setLength()

void Pscf::BlockDescriptor::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::Pspc::Block< D >, Pscf::Pspg::Block< D >, Pscf::Pspg::Block< D >, Pscf::Fd1d::Block, and Pscf::Pspc::Block< D >.

Definition at line 58 of file BlockDescriptor.cpp.

References length().

Referenced by Pscf::Pspg::Block< D >::setLength(), Pscf::Fd1d::Block::setLength(), and Pscf::Pspc::Block< D >::setLength().

◆ setPolymerType()

void Pscf::BlockDescriptor::setPolymerType ( PolymerType::Enum  type)

Set the polymer type.

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 PolymerType enumeration value for the block is used by the inserter and extractor operators to define a shorter string representation for blocks in linear polymers, for which the string representation does not include values for vertex ids. Vertex id values for blocks in a linear poiymer must be set explicitly by calling the setVertexIds function with consecutive values, as done in the PolymerTmpl::readParameters function.

Parameters
typetype of polymer (branched or linear)

Definition at line 64 of file BlockDescriptor.cpp.

◆ id()

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

Get the id of this block.

Definition at line 195 of file BlockDescriptor.h.

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

◆ monomerId()

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

Get the monomer type id.

Definition at line 201 of file BlockDescriptor.h.

Referenced by setMonomerId().

◆ vertexIds()

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

Get the pair of associated vertex ids.

Definition at line 207 of file BlockDescriptor.h.

◆ vertexId()

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

Get id of an associated vertex.

Parameters
iindex of vertex (0 or 1)

Definition at line 213 of file BlockDescriptor.h.

Referenced by Pscf::Vertex::addBlock().

◆ length()

double Pscf::BlockDescriptor::length ( ) const
inline

Get the length (number of monomers) in this block.

Definition at line 219 of file BlockDescriptor.h.

Referenced by Pscf::Fd1d::Block::setDiscretization(), setLength(), Pscf::Fd1d::Block::setLength(), and Pscf::Fd1d::Block::setupSolver().

◆ polymerType()

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

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

Definition at line 225 of file BlockDescriptor.h.

Friends And Related Function Documentation

◆ operator>>

std::istream & operator>> ( std::istream &  in,
BlockDescriptor block 
)
friend

istream extractor for a BlockDescriptor.

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

Definition at line 70 of file BlockDescriptor.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const BlockDescriptor block 
)
friend

ostream inserter for a BlockDescriptor.

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

Definition at line 84 of file BlockDescriptor.cpp.


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