PSCF v1.3
Pscf::Prdc::ScftReal< D, ST > Class Template Reference

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

#include <ScftReal.h>

Inheritance diagram for Pscf::Prdc::ScftReal< D, ST >:
Pscf::Prdc::SystemConstRefReal< ST >

Public Types

using Base = SystemConstRefReal<ST>
 Base class type name alias.
using SystemT = typename Base::SystemT
 Parent System type name alias.

Public Member Functions

 ScftReal (SystemT const &system)
 Constructor.
virtual ~ScftReal ()
 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 (FieldT const &A, FieldT 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.
CFieldContainerT const & c () const
 Get the concentration (c) field container.
WFieldContainerT const & w () const
 Get the chemical potential (w) field container.
WFieldContainerT 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::SystemConstRefReal< ST >
 SystemConstRefReal ()
 Default constructor.
 SystemConstRefReal (SystemT const &system)
 Constructor.
 ~SystemConstRefReal ()
 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.
CFieldContainerT const & c () const
 Get the concentration (c) field container.
WFieldContainerT const & w () const
 Get the chemical potential (w) field container.
WFieldContainerT const & h () const
 Get the external potential (h) field container.
MaskT const & mask () const
 Get the mask.
FileMaster const & fileMaster () const
 Get the FileMaster.

Detailed Description

template<int D, class ST>
class Pscf::Prdc::ScftReal< D, ST >

Base class for SCFT thermodynamic property calculator.

Definition at line 24 of file ScftReal.h.

Member Typedef Documentation

◆ Base

template<int D, class ST>
using Pscf::Prdc::ScftReal< D, ST >::Base = SystemConstRefReal<ST>

Base class type name alias.

Definition at line 30 of file ScftReal.h.

◆ SystemT

template<int D, class ST>
using Pscf::Prdc::ScftReal< D, ST >::SystemT = typename Base::SystemT

Parent System type name alias.

Definition at line 33 of file ScftReal.h.

Constructor & Destructor Documentation

◆ ScftReal()

template<int D, class ST>
Pscf::Prdc::ScftReal< D, ST >::ScftReal ( SystemT const & system)

Constructor.

Parameters
systemparent System object

Definition at line 30 of file ScftReal.tpp.

References system(), and Pscf::Prdc::SystemConstRefReal< ST >::SystemConstRefReal().

◆ ~ScftReal()

template<int D, class ST>
Pscf::Prdc::ScftReal< D, ST >::~ScftReal ( )
virtual

Destructor.

Definition at line 44 of file ScftReal.tpp.

Member Function Documentation

◆ compute()

template<int D, class ST>
void Pscf::Prdc::ScftReal< 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.

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

Definition at line 51 of file ScftReal.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().

◆ clear()

template<int D, class ST>
void Pscf::Prdc::ScftReal< D, ST >::clear ( )

Clear all thermodynamic data.

Postcondition
hasData() == false

Definition at line 269 of file ScftReal.tpp.

◆ hasData()

template<int D, class ST>
bool Pscf::Prdc::ScftReal< D, ST >::hasData ( ) const
inline

Have free energies and pressure been computed?

Definition at line 259 of file ScftReal.h.

Referenced by compute(), and write().

◆ fHelmholtz()

template<int D, class ST>
double Pscf::Prdc::ScftReal< D, ST >::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 ScftReal.h.

References UTIL_CHECK.

Referenced by write().

◆ fIdeal()

template<int D, class ST>
double Pscf::Prdc::ScftReal< D, ST >::fIdeal ( ) const
inline

Get the ideal gas contribution to fHelmholtz.

This function retrieves a value computed by computeFreeEnergy().

Definition at line 227 of file ScftReal.h.

References UTIL_CHECK.

◆ fInter()

template<int D, class ST>
double Pscf::Prdc::ScftReal< D, ST >::fInter ( ) const
inline

Get the interaction contribution to fHelmholtz.

This function retrieves a value computed by computeFreeEnergy().

Definition at line 235 of file ScftReal.h.

References UTIL_CHECK.

◆ fExt()

template<int D, class ST>
double Pscf::Prdc::ScftReal< D, ST >::fExt ( ) const
inline

Get the external field contribution to fHelmholtz.

This function retrieves a value computed by computeFreeEnergy().

Definition at line 243 of file ScftReal.h.

References UTIL_CHECK.

◆ pressure()

template<int D, class ST>
double Pscf::Prdc::ScftReal< D, ST >::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 ScftReal.h.

References UTIL_CHECK.

Referenced by write().

◆ write()

template<int D, class ST>
void Pscf::Prdc::ScftReal< 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.

Parameters
outoutput stream

Definition at line 276 of file ScftReal.tpp.

References compute(), domain(), fHelmholtz(), h(), hasData(), mixture(), and pressure().

◆ innerProduct()

template<int D, class ST>
virtual double Pscf::Prdc::ScftReal< D, ST >::innerProduct ( FieldT const & A,
FieldT const & B ) const
inlineprotectedvirtual

Inner product of two fields.

Parameters
A1st field
B2nd field
Returns
inner product (sum of product A[i]*B[i] over mesh points)

Definition at line 169 of file ScftReal.h.

Referenced by compute().

◆ system()

template<int D, class ST>
SystemT const & Pscf::Prdc::SystemConstRefReal< ST >::system ( ) const
inlineprotected

Get the associated System.

Definition at line 70 of file SystemConstRefReal.h.

Referenced by ScftReal().

◆ mixture()

template<int D, class ST>
MixtureT const & Pscf::Prdc::SystemConstRefReal< ST >::mixture ( ) const
inlineprotected

Get the Mixture.

Definition at line 74 of file SystemConstRefReal.h.

Referenced by compute(), and write().

◆ interaction()

template<int D, class ST>
InteractionT const & Pscf::Prdc::SystemConstRefReal< ST >::interaction ( ) const
inlineprotected

Get the Interaction.

Definition at line 78 of file SystemConstRefReal.h.

Referenced by compute().

◆ domain()

template<int D, class ST>
DomainT const & Pscf::Prdc::SystemConstRefReal< ST >::domain ( ) const
inlineprotected

Get the Domain.

Definition at line 82 of file SystemConstRefReal.h.

Referenced by compute(), and write().

◆ c()

template<int D, class ST>
CFieldContainerT const & Pscf::Prdc::SystemConstRefReal< ST >::c ( ) const
inlineprotected

Get the concentration (c) field container.

Definition at line 86 of file SystemConstRefReal.h.

Referenced by compute().

◆ w()

template<int D, class ST>
WFieldContainerT const & Pscf::Prdc::SystemConstRefReal< ST >::w ( ) const
inlineprotected

Get the chemical potential (w) field container.

Definition at line 90 of file SystemConstRefReal.h.

Referenced by compute().

◆ h()

template<int D, class ST>
WFieldContainerT const & Pscf::Prdc::SystemConstRefReal< ST >::h ( ) const
inlineprotected

Get the external potential (h) field container.

Definition at line 94 of file SystemConstRefReal.h.

Referenced by compute(), and write().

◆ mask()

template<int D, class ST>
MaskT const & Pscf::Prdc::SystemConstRefReal< ST >::mask ( ) const
inlineprotected

Get the mask.

Definition at line 98 of file SystemConstRefReal.h.

Referenced by compute().

◆ fileMaster()

template<int D, class ST>
FileMaster const & Pscf::Prdc::SystemConstRefReal< ST >::fileMaster ( ) const
inlineprotected

Get the FileMaster.

Definition at line 102 of file SystemConstRefReal.h.


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