1#ifndef PSCF_FLORY_HUGGINS_MIXTURE_H
2#define PSCF_FLORY_HUGGINS_MIXTURE_H
11#include <util/param/ParamComposite.h>
13#include <pscf/chem/Monomer.h>
14#include <pscf/floryHuggins/Molecule.h>
15#include <util/containers/DArray.h>
16#include <util/containers/DMatrix.h>
143 double mu(
int id)
const;
150 double phi(
int id)
const;
157 double c(
int id)
const;
275 bool hasComposition_;
301 return molecules_[id];
326 {
return fHelmholtz_; }
329 {
return pressure_; }
332 {
return nMolecule_; }
335 {
return nMonomer_; }
int nMonomer() const
Get number of monomer types.
double phi(int id) const
Return molecular volume fraction for one species.
double c(int id) const
Return monomer volume fraction for one monomer type.
void setComposition(DArray< double > const &phi)
Set system composition.
void setNMolecule(int nMolecule)
Set the number of molecular species and allocate memory.
double fHelmholtz() const
Return Helmholtz free energy per monomer / kT.
void computeMu(Interaction const &interaction, double xi=0.0)
Compute chemical potential from preset composition.
int nMolecule() const
Get number of molecule species (polymer + solvent).
void setNMonomer(int nMonomer)
Set the number of monomer types.
double mu(int id) const
Return chemical potential for one species.
Molecule & molecule(int id)
Get a molecule object (non-const reference).
void computeFreeEnergy(Interaction const &interaction)
Compute Helmholtz free energy and pressure.
void computePhi(Interaction const &interaction, DArray< double > const &mu, DArray< double > const &phi, double &xi)
Compute composition from chemical potentials.
double pressure() const
Return pressure in units of kT / monomer volume.
void validate() const
Validate all data structures.
void initialize(MixtureBase const &mixture)
Initialize to properties of a MixtureBase Mixture descriptor.
virtual void readParameters(std::istream &in)
Read parameters from file and initialize.
Descriptor of a molecular species in a homogeneous mixture.
Flory-Huggins excess free energy model.
Solve Ax=b by LU decomposition of A.
Abstract descriptor for a mixture of polymer and solvent species.
Dynamically allocatable contiguous array template.
Dynamically allocated Matrix.
ParamComposite()
Constructor.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
Flory-Huggins theory of spatially homogeneous mixtures.
PSCF package top-level namespace.