PSCF v1.4.0

Base class for SCFT thermodynamic property calculators. More...

#include <ScftThermo.h>

Inheritance diagram for Pscf::Rp::ScftThermo< D, T >:

Public Member Functions

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 Types

using SystemConstRefT = typename T::SystemConstRef
 Base class type name alias.
using SystemT = typename T::System
 Parent System type name alias.

Protected Member Functions

 ScftThermo (SystemT const &system)
 Constructor.
 ~ScftThermo ()
 Destructor.

Detailed Description

template<int D, class T>
class Pscf::Rp::ScftThermo< D, T >

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). Specializations of this template are used as base classes for class templates named ScftThermo<D> that are defined in Rpc and Rpg namespaces.

Template parameters:

Definition at line 37 of file scft/ScftThermo.h.

Member Typedef Documentation

◆ SystemConstRefT

template<int D, class T>
using Pscf::Rp::ScftThermo< D, T >::SystemConstRefT = typename T::SystemConstRef
protected

Base class type name alias.

Definition at line 135 of file scft/ScftThermo.h.

◆ SystemT

template<int D, class T>
using Pscf::Rp::ScftThermo< D, T >::SystemT = typename T::System
protected

Parent System type name alias.

Definition at line 138 of file scft/ScftThermo.h.

Constructor & Destructor Documentation

◆ ScftThermo()

template<int D, class T>
Pscf::Rp::ScftThermo< D, T >::ScftThermo ( SystemT const & system)
protected

Constructor.

Parameters
systemparent System object

Definition at line 31 of file ScftThermo.tpp.

◆ ~ScftThermo()

template<int D, class T>
Pscf::Rp::ScftThermo< D, T >::~ScftThermo ( )
protected

Destructor.

Definition at line 45 of file ScftThermo.tpp.

Member Function Documentation

◆ compute()

template<int D, class T>
void Pscf::Rp::ScftThermo< D, T >::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.

Precondition
w().hasData() == true
c().hasData() == true
Postcondition
hasData() == true

Definition at line 52 of file ScftThermo.tpp.

Referenced by write().

◆ clear()

template<int D, class T>
void Pscf::Rp::ScftThermo< D, T >::clear ( )

Clear all thermodynamic data.

Postcondition
hasData() == false

Definition at line 254 of file ScftThermo.tpp.

◆ hasData()

template<int D, class T>
bool Pscf::Rp::ScftThermo< D, T >::hasData ( ) const
inline

Have free energies and pressure been computed?

Definition at line 259 of file scft/ScftThermo.h.

Referenced by write().

◆ fHelmholtz()

template<int D, class T>
double Pscf::Rp::ScftThermo< D, T >::fHelmholtz ( ) const
inline

Get total Helmholtz free energy per monomer / kT.

This function retrieves a value computed by computeFreeEnergy().

Definition at line 219 of file scft/ScftThermo.h.

References UTIL_CHECK.

Referenced by write().

◆ fIdeal()

template<int D, class T>
double Pscf::Rp::ScftThermo< D, T >::fIdeal ( ) const
inline

Get the ideal gas contribution to fHelmholtz.

This function retrieves a value computed by computeFreeEnergy().

Definition at line 227 of file scft/ScftThermo.h.

References UTIL_CHECK.

◆ fInter()

template<int D, class T>
double Pscf::Rp::ScftThermo< D, T >::fInter ( ) const
inline

Get the interaction contribution to fHelmholtz.

This function retrieves a value computed by computeFreeEnergy().

Definition at line 235 of file scft/ScftThermo.h.

References UTIL_CHECK.

◆ fExt()

template<int D, class T>
double Pscf::Rp::ScftThermo< D, T >::fExt ( ) const
inline

Get the external field contribution to fHelmholtz.

This function retrieves a value computed by computeFreeEnergy().

Definition at line 243 of file scft/ScftThermo.h.

References UTIL_CHECK.

◆ pressure()

template<int D, class T>
double Pscf::Rp::ScftThermo< D, T >::pressure ( ) const
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 251 of file scft/ScftThermo.h.

References UTIL_CHECK.

Referenced by write().

◆ write()

template<int D, class T>
void Pscf::Rp::ScftThermo< D, T >::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.

Parameters
outoutput stream

Definition at line 261 of file ScftThermo.tpp.

References compute(), fHelmholtz(), hasData(), and pressure().


The documentation for this class was generated from the following files: