PSCF v1.4.0
Pscf::MixtureBase< WT > Class Template Referenceabstract

Abstract descriptor for a mixture of polymer and solvent species. More...

#include <MixtureBase.h>

Public Member Functions

 MixtureBase ()
 Constructor.
virtual ~MixtureBase ()=default
 Destructor.
void setVmonomer (double vMonomer)
 Set new vMonomer value.
Accessors (by value)
int nMonomer () const
 Get number of monomer types.
int nPolymer () const
 Get number of polymer species.
int nSolvent () const
 Get number of solvent (point particle) species.
int nBlock () const
 Get total number blocks among all polymer species.
double vMonomer () const
 Get monomer reference volume (set to 1.0 by default).
bool isCanonical () const
 Is this mixture being treated in canonical ensemble?
Accessors (by const reference)
Monomer const & monomer (int id) const
 Get a Monomer type descriptor by const reference.
virtual PolymerSpecies< WT > const & polymerSpecies (int id) const =0
 Get a PolymerSpecies by const reference.
virtual SolventSpecies< WT > const & solventSpecies (int id) const =0
 Set a solvent solver object by const reference.

Protected Member Functions

Monomermonomer (int id)
 Get a Monomer type descriptor (non-const reference).

Protected Attributes

DArray< Monomermonomers_
 Array of monomer type descriptors.
int nMonomer_
 Number of monomer types.
int nPolymer_
 Number of polymer species.
int nSolvent_
 Number of solvent species.
int nBlock_
 Number of blocks total, across all polymers.
double vMonomer_
 Monomer reference volume (set to 1.0 by default).

Detailed Description

template<typename WT>
class Pscf::MixtureBase< WT >

Abstract descriptor for a mixture of polymer and solvent species.

A MixtureBase has an array of Monomer objects and provides access to PolymerSpecies and SolventSpecies objects describing all molecular species in in a mixture. The MixtureBase class does not have functions or data structures needed to solve the modified diffusion equation (MDE), and is thus a descriptor but not an MDE solver for the mixture.

MixtureBase is an abstract base class for "solver" classes that can actually solve the single-molecule statistical mechanics problem for very species in a mixture. Each implementation level sub-namespace of Pscf (R1d, Rpc or Rpg) contains a concrete class named Mixture that is derived from Pscf::MixtureBase, and that acts as both a solver and descriptor for the mixture. Each such subspace also defines an polymer MDE solver class named Polymer that is a subclass of PolymerSpecies and a solvent solver class named Solvent that is subclass of SolventSpecies.

The Mixture class in each such program-level namespace is a subclass of a specialization Pscf::PolymerTmpl<Polymer, Solvent> of the class template Pscf::PolymerTmpl. This template is derived directly from MixtureBase. A PolymerTmpl<Polymer, Solvent> object has two member private variables that are arrays of Polymer and Solvent solver objects. The PolymerTmpl template defines implementations of functions polymerSpecies(int id) and solventSpecies(int id) that are declared as pure virtual member functions of MixtureBase. These functions return a single Polymer solver object as a reference to a PolymerSpecies descriptor, or a Solvent solver object as a reference to a SolventSpecies descriptor, respectively.

Definition at line 57 of file MixtureBase.h.

Constructor & Destructor Documentation

◆ MixtureBase()

template<typename WT>
Pscf::MixtureBase< WT >::MixtureBase ( )

Constructor.

Definition at line 19 of file MixtureBase.tpp.

References monomers_, nBlock_, nMonomer_, nPolymer_, nSolvent_, and vMonomer_.

◆ ~MixtureBase()

template<typename WT>
virtual Pscf::MixtureBase< WT >::~MixtureBase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ setVmonomer()

template<typename WT>
void Pscf::MixtureBase< WT >::setVmonomer ( double vMonomer)

Set new vMonomer value.

Parameters
vMonomernew vMonomer value

Definition at line 32 of file MixtureBase.tpp.

References UTIL_CHECK, vMonomer(), and vMonomer_.

◆ nMonomer()

template<typename WT>
int Pscf::MixtureBase< WT >::nMonomer ( ) const
inline

◆ nPolymer()

◆ nSolvent()

template<typename WT>
int Pscf::MixtureBase< WT >::nSolvent ( ) const
inline

◆ nBlock()

template<typename WT>
int Pscf::MixtureBase< WT >::nBlock ( ) const
inline

Get total number blocks among all polymer species.

Definition at line 201 of file MixtureBase.h.

References nBlock_.

Referenced by Pscf::R1d::FieldIo::writeBlockCFields().

◆ vMonomer()

template<typename WT>
double Pscf::MixtureBase< WT >::vMonomer ( ) const
inline

Get monomer reference volume (set to 1.0 by default).

Definition at line 205 of file MixtureBase.h.

References vMonomer_.

Referenced by Pscf::R1d::HomogeneousComparison::output(), and setVmonomer().

◆ isCanonical()

template<typename WT>
bool Pscf::MixtureBase< WT >::isCanonical ( ) const

Is this mixture being treated in canonical ensemble?

Returns true iff a closed ensemble is used for every polymer and solve species, by specifying a volume fraction phi rather than a chemical potential mu for every species in the mixture.

Definition at line 42 of file MixtureBase.tpp.

References nPolymer(), nSolvent(), polymerSpecies(), and solventSpecies().

◆ monomer() [1/2]

template<typename WT>
Monomer const & Pscf::MixtureBase< WT >::monomer ( int id) const
inline

Get a Monomer type descriptor by const reference.

Parameters
idinteger monomer type index (0 <= id < nMonomer)

Definition at line 209 of file MixtureBase.h.

References monomers_, nMonomer_, and UTIL_CHECK.

Referenced by Pscf::MixtureTmpl< Polymer< D >, Solvent< D >, std::complex< double > >::polymerSpecies().

◆ polymerSpecies()

◆ solventSpecies()

◆ monomer() [2/2]

template<typename WT>
Monomer & Pscf::MixtureBase< WT >::monomer ( int id)
inlineprotected

Get a Monomer type descriptor (non-const reference).

Parameters
idinteger monomer type index (0 <= id < nMonomer)

Definition at line 218 of file MixtureBase.h.

References monomers_, nMonomer_, and UTIL_CHECK.

Member Data Documentation

◆ monomers_

template<typename WT>
DArray<Monomer> Pscf::MixtureBase< WT >::monomers_
protected

Array of monomer type descriptors.

Definition at line 157 of file MixtureBase.h.

Referenced by MixtureBase(), monomer(), and monomer().

◆ nMonomer_

template<typename WT>
int Pscf::MixtureBase< WT >::nMonomer_
protected

Number of monomer types.

Definition at line 162 of file MixtureBase.h.

Referenced by MixtureBase(), monomer(), monomer(), and nMonomer().

◆ nPolymer_

template<typename WT>
int Pscf::MixtureBase< WT >::nPolymer_
protected

Number of polymer species.

Definition at line 167 of file MixtureBase.h.

Referenced by MixtureBase(), and nPolymer().

◆ nSolvent_

template<typename WT>
int Pscf::MixtureBase< WT >::nSolvent_
protected

Number of solvent species.

Definition at line 172 of file MixtureBase.h.

Referenced by MixtureBase(), and nSolvent().

◆ nBlock_

template<typename WT>
int Pscf::MixtureBase< WT >::nBlock_
protected

Number of blocks total, across all polymers.

Definition at line 177 of file MixtureBase.h.

Referenced by MixtureBase(), and nBlock().

◆ vMonomer_

template<typename WT>
double Pscf::MixtureBase< WT >::vMonomer_
protected

Monomer reference volume (set to 1.0 by default).

Definition at line 182 of file MixtureBase.h.

Referenced by MixtureBase(), setVmonomer(), and vMonomer().


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