PSCF v1.3.1
|
Base class for SCFT thermodynamic property calculators. More...
#include <ScftThermoTmpl.h>
Public Types | |
using | Base = SystemConstRefTmpl<ST> |
Base class type name alias. | |
using | SystemT = typename Base::SystemT |
Parent System type name alias. |
Public Member Functions | |
ScftThermoTmpl (SystemT const &system) | |
Constructor. | |
virtual | ~ScftThermoTmpl () |
Destructor. | |
State modifiers | |
void | compute () |
Compute SCFT free energy density and pressure for current fields. | |
void | clear () |
Clear all thermodynamic data. | |
SCFT Property Access and Output | |
bool | hasData () const |
Have free energies and pressure been computed? | |
double | fHelmholtz () const |
Get total Helmholtz free energy per monomer / kT. | |
double | fIdeal () const |
Get the ideal gas contribution to fHelmholtz. | |
double | fInter () const |
Get the interaction contribution to fHelmholtz. | |
double | fExt () const |
Get the external field contribution to fHelmholtz. | |
double | pressure () const |
Get the precomputed pressure times monomer volume / kT. | |
void | write (std::ostream &out) |
Write SCFT thermodynamic properties to a file. |
Protected Member Functions | |
virtual double | innerProduct (RFieldT const &A, RFieldT const &B) const |
Inner product of two fields. | |
SystemT const & | system () const |
Get the associated System. | |
MixtureT const & | mixture () const |
Get the Mixture. | |
InteractionT const & | interaction () const |
Get the Interaction. | |
DomainT const & | domain () const |
Get the Domain. | |
CFieldsT const & | c () const |
Get the concentration (c) field container. | |
WFieldsT const & | w () const |
Get the chemical potential (w) field container. | |
WFieldsT const & | h () const |
Get the external potential (h) field container. | |
MaskT const & | mask () const |
Get the mask. | |
FileMaster const & | fileMaster () const |
Get the FileMaster. | |
Protected Member Functions inherited from Pscf::Prdc::SystemConstRefTmpl< ST > | |
SystemConstRefTmpl () | |
Default constructor. | |
SystemConstRefTmpl (SystemT const &system) | |
Constructor. | |
~SystemConstRefTmpl () | |
Destructor. | |
void | associate (SystemT const &system) |
Create associations with a system and its components. | |
SystemT const & | system () const |
Get the associated System. | |
MixtureT const & | mixture () const |
Get the Mixture. | |
InteractionT const & | interaction () const |
Get the Interaction. | |
DomainT const & | domain () const |
Get the Domain. | |
CFieldsT const & | c () const |
Get the concentration (c) field container. | |
WFieldsT const & | w () const |
Get the chemical potential (w) field container. | |
WFieldsT const & | h () const |
Get the external potential (h) field container. | |
MaskT const & | mask () const |
Get the mask. | |
FileMaster const & | fileMaster () const |
Get the FileMaster. |
Base class for SCFT thermodynamic property calculators.
This class computes and stores values for the SCFT Helmholtz free energy and pressure, and free energy components (ideal, interaction, external). It is used as a base class for classes named ScftThermo defined in Rpc and Rpg namespaces.
Definition at line 29 of file ScftThermoTmpl.h.
using Pscf::Prdc::ScftThermoTmpl< D, ST >::Base = SystemConstRefTmpl<ST> |
Base class type name alias.
Definition at line 35 of file ScftThermoTmpl.h.
using Pscf::Prdc::ScftThermoTmpl< D, ST >::SystemT = typename Base::SystemT |
Parent System type name alias.
Definition at line 38 of file ScftThermoTmpl.h.
Pscf::Prdc::ScftThermoTmpl< D, ST >::ScftThermoTmpl | ( | SystemT const & | system | ) |
Constructor.
system | parent System object |
Definition at line 30 of file ScftThermoTmpl.tpp.
References system(), and Pscf::Prdc::SystemConstRefTmpl< ST >::SystemConstRefTmpl().
|
virtual |
Destructor.
Definition at line 44 of file ScftThermoTmpl.tpp.
void Pscf::Prdc::ScftThermoTmpl< D, ST >::compute | ( | ) |
Compute SCFT free energy density and pressure for current fields.
Resulting values are retrieved by the fHelmholtz(), fIdeal(), fInter(), fExt(), and pressure() accessor functions.
Definition at line 51 of file ScftThermoTmpl.tpp.
References c(), domain(), h(), hasData(), innerProduct(), interaction(), Pscf::PolymerModel::isThread(), Pscf::PolymerSpecies::length(), mask(), mixture(), Pscf::Species::mu(), Pscf::PolymerSpecies::nBead(), Pscf::Species::phi(), Pscf::SolventSpecies::size(), UTIL_CHECK, and w().
Referenced by write().
void Pscf::Prdc::ScftThermoTmpl< D, ST >::clear | ( | ) |
Clear all thermodynamic data.
Definition at line 269 of file ScftThermoTmpl.tpp.
|
inline |
Have free energies and pressure been computed?
Definition at line 264 of file ScftThermoTmpl.h.
|
inline |
Get total Helmholtz free energy per monomer / kT.
This function retrieves a value computed by computeFreeEnergy().
Definition at line 224 of file ScftThermoTmpl.h.
References UTIL_CHECK.
Referenced by write().
|
inline |
Get the ideal gas contribution to fHelmholtz.
This function retrieves a value computed by computeFreeEnergy().
Definition at line 232 of file ScftThermoTmpl.h.
References UTIL_CHECK.
|
inline |
Get the interaction contribution to fHelmholtz.
This function retrieves a value computed by computeFreeEnergy().
Definition at line 240 of file ScftThermoTmpl.h.
References UTIL_CHECK.
|
inline |
Get the external field contribution to fHelmholtz.
This function retrieves a value computed by computeFreeEnergy().
Definition at line 248 of file ScftThermoTmpl.h.
References UTIL_CHECK.
|
inline |
Get the precomputed pressure times monomer volume / kT.
This function retrieves a value computed by computeFreeEnergy(). The value is -1 times the grand-canonical free energy per monomer divided by kT.
Definition at line 256 of file ScftThermoTmpl.h.
References UTIL_CHECK.
Referenced by write().
void Pscf::Prdc::ScftThermoTmpl< D, ST >::write | ( | std::ostream & | out | ) |
Write SCFT thermodynamic properties to a file.
This function outputs Helmholtz free energy per monomer, pressure (in units of kT per monomer volume), the volume fraction and chemical potential of each species, and all unit cell parameters.
If data is not available (i.e,. if hasData() == false), this function calls compute() on entry.
If parameter "out" is a file that already exists, this function will append to the end of that file, rather than overwriting it. Calling writeParamNoSweep and writeThermo in succession with the same output stream will thus produce a single file containing both input parameters and calculated thermodynamic properties.
out | output stream |
Definition at line 276 of file ScftThermoTmpl.tpp.
References compute(), domain(), fHelmholtz(), h(), hasData(), mixture(), and pressure().
|
inlineprotectedvirtual |
Inner product of two fields.
A | 1st field |
B | 2nd field |
Definition at line 174 of file ScftThermoTmpl.h.
Referenced by compute().
|
inlineprotected |
Get the associated System.
Definition at line 71 of file SystemConstRefTmpl.h.
Referenced by ScftThermoTmpl().
|
inlineprotected |
Get the Mixture.
Definition at line 75 of file SystemConstRefTmpl.h.
|
inlineprotected |
|
inlineprotected |
Get the Domain.
Definition at line 83 of file SystemConstRefTmpl.h.
|
inlineprotected |
Get the concentration (c) field container.
Definition at line 87 of file SystemConstRefTmpl.h.
Referenced by compute().
|
inlineprotected |
Get the chemical potential (w) field container.
Definition at line 91 of file SystemConstRefTmpl.h.
Referenced by compute().
|
inlineprotected |
Get the external potential (h) field container.
Definition at line 95 of file SystemConstRefTmpl.h.
|
inlineprotected |
|
inlineprotected |
Get the FileMaster.
Definition at line 103 of file SystemConstRefTmpl.h.