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>
63 template <
typename WT>
144 double mu(
int id)
const;
151 double phi(
int id)
const;
158 double c(
int id)
const;
276 bool hasComposition_;
302 return molecules_[id];
327 {
return fHelmholtz_; }
330 {
return pressure_; }
333 {
return nMolecule_; }
336 {
return nMonomer_; }
Flory-Huggins interaction model.
void setComposition(DArray< double > const &phi)
Set system composition.
FhMolecule & molecule(int id)
Get a molecule object (non-const reference).
void initialize(MixtureBase< WT > const &mixture)
Initialize to properties of a MixtureBase descriptor.
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 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.
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.
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.
PSCF package top-level namespace.