1#ifndef PSCF_HOMOGENEOUS_MIXTURE_H
2#define PSCF_HOMOGENEOUS_MIXTURE_H
11#include <util/param/ParamComposite.h>
13#include <pscf/chem/Monomer.h>
14#include <pscf/homogeneous/Molecule.h>
15#include <util/containers/DArray.h>
16#include <util/containers/DMatrix.h>
24namespace Homogeneous {
135 double mu(
int id)
const;
142 double phi(
int id)
const;
149 double c(
int id)
const;
267 bool hasComposition_;
293 return molecules_[id];
318 {
return fHelmholtz_; }
321 {
return pressure_; }
324 {
return nMolecule_; }
327 {
return nMonomer_; }
A spatially homogeneous mixture.
double c(int id) const
Return monomer volume fraction for one monomer type.
double pressure() const
Return pressure in units of kT / monomer volume.
void validate() const
Validate all data structures.
Molecule & molecule(int id)
Get a molecule object (non-const reference).
virtual void readParameters(std::istream &in)
Read parameters from file and initialize.
double phi(int id) const
Return molecular volume fraction for one species.
int nMonomer() const
Get number of monomer types.
void setComposition(DArray< double > const &phi)
Set system composition.
void computePhi(Interaction const &interaction, DArray< double > const &mu, DArray< double > const &phi, double &xi)
Compute composition from chemical potentials.
void computeFreeEnergy(Interaction const &interaction)
Compute Helmholtz free energy and pressure.
int nMolecule() const
Get number of molecule species (polymer + solvent).
double mu(int id) const
Return chemical potential for one species.
void setNMonomer(int nMonomer)
Set the number of monomer types.
void computeMu(Interaction const &interaction, double xi=0.0)
Compute chemical potential from preset composition.
double fHelmholtz() const
Return Helmholtz free energy per monomer / kT.
void setNMolecule(int nMolecule)
Set the number of molecular species and allocate memory.
Descriptor of a molecular species in a homogeneous mixture.
Flory-Huggins excess free energy model.
Solve Ax=b by LU decomposition of A.
Dynamically allocatable contiguous array template.
Dynamically allocated Matrix.
An object that can read multiple parameters from file.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.