1#ifndef PSCF_MIXTURE_TMPL_H
2#define PSCF_MIXTURE_TMPL_H
11#include <pscf/chem/MixtureBase.h>
12#include <util/param/ParamComposite.h>
13#include <util/containers/DArray.h>
25 template <
class PT,
class ST>
163 template <
class PT,
class ST>
167 return polymers_[id];
170 template <
class PT,
class ST>
174 return polymers_[id];
177 template <
class PT,
class ST>
181 return solvents_[id];
184 template <
class PT,
class ST>
188 return solvents_[id];
196 template <
class PT,
class ST>
207 template <
class PT,
class ST>
214 template <
class PT,
class ST>
218 return polymers_[id];
224 template <
class PT,
class ST>
228 return solvents_[id];
234 template <
class PT,
class ST>
239 monomers_.allocate(nMonomer_);
240 for (
int i = 0; i < nMonomer_; ++i) {
241 monomers_[i].setId(i);
264 polymers_.allocate(nPolymer_);
265 for (
int i = 0; i < nPolymer_; ++i) {
267 nBlock_ = nBlock_ +
polymer(i).nBlock();
273 for (
int i = 0; i < nPolymer_; ++i) {
274 for (
int j = 0; j <
polymer(i).nBlock(); ++j) {
275 monomerId =
polymer(i).block(j).monomerId();
276 kuhn =
monomer(monomerId).kuhn();
277 polymer(i).block(j).setKuhn(kuhn);
286 solvents_.allocate(nSolvent_);
287 for (
int i = 0; i < nSolvent_; ++i) {
int nMonomer_
Number of monomer types.
int nPolymer_
Number of polymer species.
int nBlock_
Number of blocks total, across all polymers.
Monomer const & monomer(int id) const
Get a Monomer type descriptor by const reference.
int nSolvent_
Number of solvent species.
double vMonomer_
Monomer reference volume (set to 1.0 by default).
MixtureBase()
Constructor.
DArray< Monomer > monomers_
Array of monomer type descriptors.
SolventT & solvent(int id)
Get a solvent solver object.
PolymerSpecies const & polymerSpecies(int id) const final
Get a PolymerSpecies descriptor by const reference.
typename PT::BlockT BlockT
Block polymer block type.
virtual void readParameters(std::istream &in)
Read parameters from file and initialize.
PT PolymerT
Polymer species solver type.
~MixtureTmpl()
Destructor.
PolymerT & polymer(int id)
Get a polymer solver object by non-const reference.
MixtureTmpl()
Constructor.
SolventSpecies const & solventSpecies(int id) const final
Set a SolventSpecies descriptor object by const reference.
typename BlockT::PropagatorT PropagatorT
Polymer block propagator type.
ST SolventT
Solvent species solver type.
Descriptor for a linear or acyclic branched block polymer.
PT PolymerT
Polymer species solver type.
ST SolventT
Solvent species solver type.
Descriptor for a solvent species.
Dynamically allocatable contiguous array template.
DArrayParam< Type > & readDArray(std::istream &in, const char *label, DArray< Type > &array, int n)
Add and read a required DArray < Type > parameter.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
ScalarParam< Type > & readOptional(std::istream &in, const char *label, Type &value)
Add and read a new optional ScalarParam < Type > object.
ParamComposite()
Constructor.
void readParamComposite(std::istream &in, ParamComposite &child, bool next=true)
Add and read a required child ParamComposite.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
PSCF package top-level namespace.