9#include <pscf/math/arithmetic.h>
19 template <
typename WT>
33 template <
typename WT>
37 bool hasPhi =
readOptional(in,
"phi", phiMu_).isActive();
39 ensemble_ = Ensemble::Closed;
42 ensemble_ = Ensemble::Open;
43 read(in,
"mu", phiMu_);
51 template <
typename WT>
64 template <
typename WT>
75 template <
typename WT>
79 if (
ensemble() == Ensemble::Closed) {
88 mul(phi_, lambda, q_);
WT q() const
Get the molecular partition function for this species.
void setMu(double mu)
Set value of mu (chemical potential), if ensemble is closed.
Ensemble ensemble() const
Get the statistical ensemble for this species (open or closed).
virtual void readParameters(std::istream &in)
Read phi or mu (but not both) and set ensemble accordingly.
WT mu() const
Get the chemical potential for this species (units kT=1).
void setQ(WT q)
Set q and compute phi or mu (depending on the ensemble).
WT phi() const
Get the overall volume fraction for this species.
void setPhi(double phi)
Set value of phi (volume fraction), if ensemble is closed.
void setClassName(const char *className)
Set class name string.
ScalarParam< Type > & readOptional(std::istream &in, const char *label, Type &value)
Add and read a new optional ScalarParam < Type > object.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Ensemble
Statistical ensemble type for the number of molecules of one species.
void div(fftw_complex &z, fftw_complex const &a, fftw_complex const &b)
Division of fftw_complex numbers, z = a / b .
void assignExp(fftw_complex &z, fftw_complex const &a)
Exponentation of a ffts_complex variable, z = exp(a).
void assign(fftw_complex &z, double const &a, double const &b)
Create an fftw_complex from real and imaginary parts, z = a + ib.
void mul(fftw_complex &z, fftw_complex const &a, fftw_complex const &b)
Multiplication of fftw_complex numbers, z = a * b.
void assignLog(fftw_complex &z, fftw_complex const &a)
Logarithm of an fftw_complex variable, z = log(a).
PSCF package top-level namespace.