PSCF v1.4.0
Pscf::Rp::BasisFieldState< D, T > Class Template Reference

FieldState for fields in symmetry-adapted basis format. More...

#include <BasisFieldState.h>

Inheritance diagram for Pscf::Rp::BasisFieldState< D, T >:
Pscf::Prdc::FieldState< D, DArray< double >, T::System >

Public Member Functions

void allocate ()
 Allocate all fields.
void read (const std::string &filename)
 Read state from file.
void write (const std::string &filename)
 Write state to file.
void getSystemState ()
 Store the current state of the associated system.
void setSystemState (bool newCellParams)
 Set the state of the associated system to this state.
const DArray< FT > & fields () const
 Get array of all fields by const reference.
DArray< FT > & fields ()
 Get array of all chemical potential fields (non-const reference).
const DArray< double > & field (int monomerId) const
 Get a field for a single monomer type by const reference.
DArray< double > & field (int monomerId)
 Get field for a specific monomer type (non-const reference).
const UnitCell< D > & unitCell () const
 Get UnitCell (i.e., lattice type and parameters) by const reference.
UnitCell< D > & unitCell ()
 Get the UnitCell by non-const reference.
typename T::System & system ()
 Get associated System by reference.
Public Member Functions inherited from Pscf::Prdc::FieldState< D, DArray< double >, T::System >
 FieldState ()
 Default constructor.
 ~FieldState ()
 Destructor.
void setSystem (T::System &system)
 Set association with System, after default construction.
const DArray< FT > & fields () const
 Get array of all fields by const reference.
const DArray< double > & field (int monomerId) const
 Get a field for a single monomer type by const reference.
const UnitCell< D > & unitCell () const
 Get UnitCell (i.e., lattice type and parameters) by const reference.

Protected Member Functions

 BasisFieldState ()
 Default constructor.
 BasisFieldState (typename T::System &system)
 Constructor, create association with a parent system.
Protected Member Functions inherited from Pscf::Prdc::FieldState< D, DArray< double >, T::System >
bool hasSystem ()
 Has a system been set?
T::System & system ()
 Get associated System by reference.

Detailed Description

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

FieldState for fields in symmetry-adapted basis format.

Instantiations of this class template are used as base classes for two closely analogous class templates, also named BasisFieldState, that are defined in Rpc and Rpg namespaces and used in the pscf_rpc and pscf_rpg programs, respectively.

Template parameters:

Definition at line 36 of file scft/sweep/BasisFieldState.h.

Constructor & Destructor Documentation

◆ BasisFieldState() [1/2]

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

Default constructor.

Definition at line 33 of file BasisFieldState.tpp.

◆ BasisFieldState() [2/2]

template<int D, class T>
Pscf::Rp::BasisFieldState< D, T >::BasisFieldState ( typename T::System & system)
protected

Constructor, create association with a parent system.

Parameters
systemassociated parent system

Definition at line 41 of file BasisFieldState.tpp.

References system().

Member Function Documentation

◆ allocate()

template<int D, class T>
void Pscf::Rp::BasisFieldState< D, T >::allocate ( )

Allocate all fields.

Precondition: hasSystem() == true

Definition at line 49 of file BasisFieldState.tpp.

References Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::hasSystem(), and UTIL_CHECK.

Referenced by getSystemState(), and read().

◆ read()

template<int D, class T>
void Pscf::Rp::BasisFieldState< D, T >::read ( const std::string & filename)

Read state from file.

Parameters
filenamename of input w-field file, in basis format

Definition at line 78 of file BasisFieldState.tpp.

References allocate(), fields(), system(), and unitCell().

Referenced by pscfpp.command.Script::__init__(), pscfpp.field.Field::__init__(), pscfpp.output.Thermo::__init__(), pscfpp.param.Array::__init__(), pscfpp.param.Composite::__init__(), and pscfpp.param.Matrix::__init__().

◆ write()

template<int D, class T>
void Pscf::Rp::BasisFieldState< D, T >::write ( const std::string & filename)

Write state to file.

Parameters
filenamename of output w-field file, in basis format

Definition at line 89 of file BasisFieldState.tpp.

◆ getSystemState()

template<int D, class T>
void Pscf::Rp::BasisFieldState< D, T >::getSystemState ( )

Store the current state of the associated system.

Copy the fields and the unit cell.

Definition at line 99 of file BasisFieldState.tpp.

References allocate(), field(), system(), and unitCell().

◆ setSystemState()

template<int D, class T>
void Pscf::Rp::BasisFieldState< D, T >::setSystemState ( bool newCellParams)

Set the state of the associated system to this state.

Parameters
newCellParamsupdate unit cell parameters iff true

Definition at line 122 of file BasisFieldState.tpp.

References fields(), system(), and unitCell().

◆ fields() [1/2]

template<int D, class T>
const DArray< FT > & Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::fields ( ) const

Get array of all fields by const reference.

The array capacity is equal to the number of monomer types.

Referenced by read(), and setSystemState().

◆ fields() [2/2]

template<int D, class T>
DArray< FT > & Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::fields ( )

Get array of all chemical potential fields (non-const reference).

The array capacity is equal to the number of monomer types.

◆ field() [1/2]

template<int D, class T>
const DArray< double > & Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::field ( int monomerId) const

Get a field for a single monomer type by const reference.

Parameters
monomerIdinteger monomer type index

Referenced by getSystemState().

◆ field() [2/2]

template<int D, class T>
DArray< double > & Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::field ( int monomerId)

Get field for a specific monomer type (non-const reference).

Parameters
monomerIdinteger monomer type index

◆ unitCell() [1/2]

template<int D, class T>
const UnitCell< D > & Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::unitCell ( ) const

Get UnitCell (i.e., lattice type and parameters) by const reference.

Referenced by getSystemState(), read(), and setSystemState().

◆ unitCell() [2/2]

template<int D, class T>
UnitCell< D > & Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::unitCell ( )

Get the UnitCell by non-const reference.

◆ system()

template<int D, class T>
typename T::System & Pscf::Prdc::FieldState< D, DArray< double >, typename T::System >::system ( )

Get associated System by reference.

Referenced by BasisFieldState(), getSystemState(), read(), and setSystemState().


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