PSCF v1.5.0
Pscf::Rp::ScftThermo< D, T > Class Template Reference

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

#include <ScftThermo.h>

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

Public Member Functions

Construction
 ScftThermo (System< D, T > const &system)
 Constructor.
State modifiers
void compute ()
 Compute SCFT free energy density and pressure for current fields.
void clear ()
 Clear all thermodynamic data.
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 = SystemConstRef<D,T>
 Base class type name alias.

Protected Member Functions

System< D, T > const & system () const
 Get the associated System.
Mixture< D, T > const & mixture () const
 Get the Mixture.
Interaction const & interaction () const
 Get the Interaction.
Domain< D, T > const & domain () const
 Get the Domain.
CFields< D, T > const & c () const
 Get the concentration (c) field container.
WFields< D, T > const & w () const
 Get the chemical potential (w) field container.
WFields< D, T > const & h () const
 Get the external potential (h) field container (if any).
Mask< D, T > const & mask () const
 Get the mask (if any).
FileMaster const & fileMaster () const
 Get the FileMaster.
Protected Member Functions inherited from Pscf::Rp::SystemConstRef< D, T >
 SystemConstRef ()
 Default constructor.
 SystemConstRef (System< D, T > const &system)
 Constructor - creates associations.
 ~SystemConstRef ()
 Destructor.
void associate (System< D, T > const &system)
 Create associations with a system and its components.
System< D, T > const & system () const
 Get the associated System.
Mixture< D, T > const & mixture () const
 Get the Mixture.
Interaction const & interaction () const
 Get the Interaction.
Domain< D, T > const & domain () const
 Get the Domain.
CFields< D, T > const & c () const
 Get the concentration (c) field container.
WFields< D, T > const & w () const
 Get the chemical potential (w) field container.
WFields< D, T > const & h () const
 Get the external potential (h) field container (if any).
Mask< D, T > const & mask () const
 Get the mask (if any).
FileMaster const & fileMaster () const
 Get the FileMaster.

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, and external).

Template parameters:

  • D : dimension of space
  • T : backend identifier class (CPT or CUT)

Definition at line 38 of file ScftThermo.h.

Member Typedef Documentation

◆ SystemConstRefT

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

Base class type name alias.

Definition at line 149 of file ScftThermo.h.

Constructor & Destructor Documentation

◆ ScftThermo()

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

Constructor.

Parameters
systemparent System object

Definition at line 42 of file ScftThermo.tpp.

References system().

Referenced by Pscf::Rp::System< D, T >::System().

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 56 of file ScftThermo.tpp.

References c(), hasData(), mixture(), UTIL_CHECK, and w().

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 258 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 249 of file ScftThermo.h.

Referenced by compute(), and 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 209 of file 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 217 of file 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 225 of file 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 233 of file 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 241 of file 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 265 of file ScftThermo.tpp.

References compute(), Util::Dbl::Dbl(), domain(), fHelmholtz(), h(), hasData(), Util::Int::Int(), mixture(), and pressure().

◆ system()

template<int D, class T>
System< D, T > const & Pscf::Rp::SystemConstRef< D, T >::system ( ) const
inlineprotected

Get the associated System.

Definition at line 54 of file SystemConstRef.h.

Referenced by ScftThermo().

◆ mixture()

template<int D, class T>
Mixture< D, T > const & Pscf::Rp::SystemConstRef< D, T >::mixture ( ) const
inlineprotected

Get the Mixture.

Definition at line 60 of file SystemConstRef.h.

Referenced by compute(), and write().

◆ interaction()

template<int D, class T>
Interaction const & Pscf::Rp::SystemConstRef< D, T >::interaction ( ) const
inlineprotected

Get the Interaction.

Definition at line 66 of file SystemConstRef.h.

◆ domain()

template<int D, class T>
Domain< D, T > const & Pscf::Rp::SystemConstRef< D, T >::domain ( ) const
inlineprotected

Get the Domain.

Definition at line 72 of file SystemConstRef.h.

Referenced by write().

◆ c()

template<int D, class T>
CFields< D, T > const & Pscf::Rp::SystemConstRef< D, T >::c ( ) const
inlineprotected

Get the concentration (c) field container.

Definition at line 78 of file SystemConstRef.h.

Referenced by compute().

◆ w()

template<int D, class T>
WFields< D, T > const & Pscf::Rp::SystemConstRef< D, T >::w ( ) const
inlineprotected

Get the chemical potential (w) field container.

Definition at line 84 of file SystemConstRef.h.

Referenced by compute().

◆ h()

template<int D, class T>
WFields< D, T > const & Pscf::Rp::SystemConstRef< D, T >::h ( ) const
inlineprotected

Get the external potential (h) field container (if any).

Definition at line 90 of file SystemConstRef.h.

Referenced by write().

◆ mask()

template<int D, class T>
Mask< D, T > const & Pscf::Rp::SystemConstRef< D, T >::mask ( ) const
inlineprotected

Get the mask (if any).

Definition at line 96 of file SystemConstRef.h.

◆ fileMaster()

template<int D, class T>
FileMaster const & Pscf::Rp::SystemConstRef< D, T >::fileMaster ( ) const
inlineprotected

Get the FileMaster.

Definition at line 102 of file SystemConstRef.h.


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