|
PSCF v1.4.0
|
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 | |
| Monomer & | monomer (int id) |
| Get a Monomer type descriptor (non-const reference). | |
Protected Attributes | |
| DArray< Monomer > | monomers_ |
| 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). | |
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.
| Pscf::MixtureBase< WT >::MixtureBase | ( | ) |
|
virtualdefault |
Destructor.
| void Pscf::MixtureBase< WT >::setVmonomer | ( | double | vMonomer | ) |
Set new vMonomer value.
| vMonomer | new vMonomer value |
Definition at line 32 of file MixtureBase.tpp.
References UTIL_CHECK, vMonomer(), and vMonomer_.
|
inline |
Get number of monomer types.
Definition at line 189 of file MixtureBase.h.
References nMonomer_.
Referenced by Pscf::R1d::Sweep::checkAllocation(), Pscf::R1d::System::computeFreeEnergy(), Pscf::R1d::Sweep::extrapolate(), Pscf::FhMixture::initialize(), Pscf::R1d::BinaryRelaxIterator::solve(), and Pscf::R1d::NrIterator::solve().
|
inline |
Get number of polymer species.
Definition at line 193 of file MixtureBase.h.
References nPolymer_.
Referenced by Pscf::R1d::HomogeneousComparison::compute(), Pscf::R1d::System::computeFreeEnergy(), Pscf::FhMixture::initialize(), isCanonical(), Pscf::R1d::BinaryRelaxIterator::solve(), Pscf::R1d::NrIterator::solve(), Pscf::R1d::FieldIo::writeBlockCFields(), Pscf::R1d::System::writeThermo(), and Pscf::R1d::FieldIo::writeVertexQ().
|
inline |
Get number of solvent (point particle) species.
Definition at line 197 of file MixtureBase.h.
References nSolvent_.
Referenced by Pscf::R1d::HomogeneousComparison::compute(), Pscf::R1d::System::computeFreeEnergy(), Pscf::FhMixture::initialize(), isCanonical(), Pscf::R1d::FieldIo::writeBlockCFields(), and Pscf::R1d::System::writeThermo().
|
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().
|
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().
| 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().
|
inline |
Get a Monomer type descriptor by const reference.
| id | integer 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().
|
pure virtual |
Get a PolymerSpecies by const reference.
| id | integer polymer species index (0 <= id < nPolymer) |
Implemented in Pscf::Cp::Mixture< D, PT, ST, TT >, Pscf::Cp::Mixture< D, Polymer< D >, Solvent< D >, Types< D > >, Pscf::MixtureTmpl< PT, ST, WT >, Pscf::MixtureTmpl< Polymer, Solvent >, Pscf::MixtureTmpl< Polymer< D >, Solvent< D >, std::complex< double > >, Pscf::MixtureTmpl< PolymerT, SolventT, double >, Pscf::MixtureTmpl< PT, ST, std::complex< double > >, Pscf::MixtureTmpl< T::Polymer, T::Solvent, double >, Pscf::MixtureTmpl< Types< D >::Polymer, Types< D >::Solvent, double >, Pscf::Rp::Mixture< D, T >, Pscf::Rp::Mixture< D >, and Pscf::Rp::Mixture< D, Types< D > >.
Referenced by Pscf::FhMixture::initialize(), and isCanonical().
|
pure virtual |
Set a solvent solver object by const reference.
| id | integer solvent species index (0 <= id < nSolvent) |
Implemented in Pscf::Cp::Mixture< D, PT, ST, TT >, Pscf::Cp::Mixture< D, Polymer< D >, Solvent< D >, Types< D > >, Pscf::MixtureTmpl< PT, ST, WT >, Pscf::MixtureTmpl< Polymer, Solvent >, Pscf::MixtureTmpl< Polymer< D >, Solvent< D >, std::complex< double > >, Pscf::MixtureTmpl< PolymerT, SolventT, double >, Pscf::MixtureTmpl< PT, ST, std::complex< double > >, Pscf::MixtureTmpl< T::Polymer, T::Solvent, double >, Pscf::MixtureTmpl< Types< D >::Polymer, Types< D >::Solvent, double >, Pscf::Rp::Mixture< D, T >, Pscf::Rp::Mixture< D >, and Pscf::Rp::Mixture< D, Types< D > >.
Referenced by Pscf::FhMixture::initialize(), and isCanonical().
|
inlineprotected |
Get a Monomer type descriptor (non-const reference).
| id | integer monomer type index (0 <= id < nMonomer) |
Definition at line 218 of file MixtureBase.h.
References monomers_, nMonomer_, and UTIL_CHECK.
|
protected |
Array of monomer type descriptors.
Definition at line 157 of file MixtureBase.h.
Referenced by MixtureBase(), monomer(), and monomer().
|
protected |
Number of monomer types.
Definition at line 162 of file MixtureBase.h.
Referenced by MixtureBase(), monomer(), monomer(), and nMonomer().
|
protected |
Number of polymer species.
Definition at line 167 of file MixtureBase.h.
Referenced by MixtureBase(), and nPolymer().
|
protected |
Number of solvent species.
Definition at line 172 of file MixtureBase.h.
Referenced by MixtureBase(), and nSolvent().
|
protected |
Number of blocks total, across all polymers.
Definition at line 177 of file MixtureBase.h.
Referenced by MixtureBase(), and nBlock().
|
protected |
Monomer reference volume (set to 1.0 by default).
Definition at line 182 of file MixtureBase.h.
Referenced by MixtureBase(), setVmonomer(), and vMonomer().