1#ifndef PSCF_FH_MIXTURE_H
2#define PSCF_FH_MIXTURE_H
11#include <util/param/ParamComposite.h>
13#include <pscf/chem/Monomer.h>
14#include <pscf/floryHuggins/FhMolecule.h>
15#include <util/containers/DArray.h>
16#include <util/containers/DMatrix.h>
71 template <
typename WT>
168 double mu(
int id)
const;
175 double phi(
int id)
const;
182 double c(
int id)
const;
308 bool hasComposition_;
344 return molecules_[id];
369 {
return fHelmholtz_; }
372 {
return pressure_; }
375 {
return nMolecule_; }
378 {
return nMonomer_; }
Descriptor for a mixture of polymer and solvent species.
Flory-Huggins interaction model.
void setComposition(DArray< double > const &phi)
Set system composition.
FhMolecule & molecule(int id)
Get a molecule object (non-const reference).
int nMolecule() const
Get number of molecule species (polymer + solvent).
void validate() const
Validate all data structures.
void computePhi(FhInteraction const &interaction, DArray< double > const &mu, DArray< double > const &phi, double &xi)
Compute composition from chemical potentials.
double mu(int id) const
Return chemical potential for one species.
double fHelmholtz() const
Return Helmholtz free energy per monomer / kT.
double pressure() const
Return pressure in units of kT / monomer volume.
int nMonomer() const
Get number of monomer types.
void initialize(Composition< WT > const &mixture)
Initialize to properties of a Composition descriptor.
void computeMu(FhInteraction const &interaction, double xi=0.0)
Compute chemical potential from preset composition.
void computeFreeEnergy(FhInteraction const &interaction)
Compute Helmholtz free energy and pressure.
double c(int id) const
Return monomer volume fraction for one monomer type.
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.
virtual void readParameters(std::istream &in)
Read parameters from file and initialize.
double phi(int id) const
Return molecular volume fraction for one species.
Molecular species in a homogeneous Flory-Huggins mixture.
Solve Ax=b by LU decomposition of A.
Dynamically allocatable contiguous array template.
Dynamically allocated Matrix.
ParamComposite()
Constructor.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
PSCF package top-level namespace.