1#ifndef PSCF_FLORY_HUGGINS_MIXTURE_TPP
2#define PSCF_FLORY_HUGGINS_MIXTURE_TPP
12#include "FhMolecule.h"
14#include <pscf/chem/Composition.h>
15#include <pscf/chem/PolymerSpecies.h>
16#include <pscf/chem/SolventSpecies.h>
17#include <pscf/chem/Edge.h>
29 template <
typename WT>
49 if (nMolecule_ == 0) {
75 for (i = 0; i < np; ++i) {
79 for (j = 0; j < nm; ++j) {
81 clumpFlags[j] =
false;
86 for (k = 0; k < nb; ++k) {
90 clumpSizes[j] += edge.
length();
96 for (j = 0; j < nm; ++j) {
109 for (j = 0; j < nm; ++j) {
126 for (
int is = 0; is < ns; ++is) {
130 size = solvent.
size();
Descriptor for a mixture of polymer and solvent species.
int nMonomer() const
Get number of monomer types.
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.
int nPolymer() const
Get number of polymer species.
int nSolvent() const
Get number of solvent (point particle) species.
Descriptor for one block within a block polymer.
int monomerId() const
Get the monomer type id for this block.
double length() const
Get the length of this block, in the thread model.
void setMonomerId(int monomerId)
Set the monomer type id.
void setSize(double size)
Set the size of this clump.
FhMolecule & molecule(int id)
Get a molecule object (non-const reference).
int nMonomer() const
Get number of monomer types.
void initialize(Composition< WT > const &mixture)
Initialize to properties of a Composition descriptor.
void setNMolecule(int nMolecule)
Set the number of molecular species and allocate memory.
void setNMonomer(int nMonomer)
Set the number of monomer types and allocate memory.
void setNClump(int nClump)
Set the number of clumps, and allocate memory.
FhClump & clump(int id)
Get a specified FhClump.
void computeSize()
Compute total molecule size by adding clump sizes.
Descriptor for a linear or acyclic branched block polymer.
virtual Edge & edge(int id)=0
Get a specified Edge (block descriptor) by non-const reference.
int nBlock() const
Number of blocks.
Descriptor for a solvent species.
double size() const
Get the size (number of monomers) in this solvent.
int monomerId() const
Get the monomer type id.
Dynamically allocatable contiguous array template.
void allocate(int capacity)
Allocate the underlying C array.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
PSCF package top-level namespace.