PSCF v1.2
Pscf::Rpg::CFieldContainer< D > Class Template Reference

A list of c fields stored in both basis and r-grid format. More...

#include <CFieldContainer.h>

Public Member Functions

 CFieldContainer ()
 Constructor.
 
 ~CFieldContainer ()
 Destructor.
 
void setNMonomer (int nMonomer)
 Set stored value of nMonomer.
 
void allocateRGrid (IntVec< D > const &dimensions)
 Allocate or re-allocate memory for fields in rgrid format.
 
void deallocateRGrid ()
 De-allocate fields in rgrid format.
 
void allocateBasis (int nBasis)
 Allocate or re-allocate memory for fields in basis format.
 
void deallocateBasis ()
 De-allocate fields in basis format.
 
void allocate (int nMonomer, int nBasis, IntVec< D > const &dimensions)
 Allocate memory for both r-grid and basis field formats.
 
DArray< DArray< double > > & basis ()
 Get array of all fields in basis format (non-const).
 
DArray< DArray< double > > const & basis () const
 Get array of all fields in basis format (const)
 
DArray< double > & basis (int monomerId)
 Get the field for one monomer type in basis format (non-const).
 
DArray< double > const & basis (int monomerId) const
 Get the field for one monomer type in basis format (const)
 
DArray< RField< D > > & rgrid ()
 Get array of all fields in r-grid format (non-const).
 
DArray< RField< D > > const & rgrid () const
 Get array of all fields in r-grid format (const).
 
RField< D > & rgrid (int monomerId)
 Get field for one monomer type in r-grid format (non-const)
 
RField< D > const & rgrid (int monomerId) const
 Get field for one monomer type in r-grid format (const).
 
bool isAllocatedRGrid () const
 Has memory been allocated for fields in r-grid format?
 
bool isAllocatedBasis () const
 Has memory been allocated for fields in basis format?
 

Detailed Description

template<int D>
class Pscf::Rpg::CFieldContainer< D >

A list of c fields stored in both basis and r-grid format.

A CFieldContainer<D> contains representations of a list of nMonomer fields that are associated with different monomer types in two different related formats:

  • A DArray of DArray<double> containers holds components of each field in a symmetry-adapted Fourier expansion (i.e., in basis format). This is accessed by the basis() and basis(int) member functions.
  • A DArray of RField<D> containers holds valus of each field on the nodes of a regular grid. This is accessed by the rgrid() and rgrid(int) member functions.

Definition at line 40 of file rpg/field/CFieldContainer.h.

Constructor & Destructor Documentation

◆ CFieldContainer()

template<int D>
Pscf::Rpg::CFieldContainer< D >::CFieldContainer ( )

Constructor.

Definition at line 23 of file rpg/field/CFieldContainer.tpp.

◆ ~CFieldContainer()

template<int D>
Pscf::Rpg::CFieldContainer< D >::~CFieldContainer ( )

Destructor.

Definition at line 35 of file rpg/field/CFieldContainer.tpp.

Member Function Documentation

◆ setNMonomer()

template<int D>
void Pscf::Rpg::CFieldContainer< D >::setNMonomer ( int nMonomer)

Set stored value of nMonomer.

May only be called once.

Parameters
nMonomernumber of monomer types.

Definition at line 42 of file rpg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ allocateRGrid()

template<int D>
void Pscf::Rpg::CFieldContainer< D >::allocateRGrid ( IntVec< D > const & dimensions)

Allocate or re-allocate memory for fields in rgrid format.

Parameters
dimensionsdimensions of spatial mesh

Definition at line 54 of file rpg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ deallocateRGrid()

template<int D>
void Pscf::Rpg::CFieldContainer< D >::deallocateRGrid ( )

De-allocate fields in rgrid format.

Definition at line 75 of file rpg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ allocateBasis()

template<int D>
void Pscf::Rpg::CFieldContainer< D >::allocateBasis ( int nBasis)

Allocate or re-allocate memory for fields in basis format.

Parameters
nBasisnumber of basis functions

Definition at line 90 of file rpg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ deallocateBasis()

template<int D>
void Pscf::Rpg::CFieldContainer< D >::deallocateBasis ( )

De-allocate fields in basis format.

Definition at line 111 of file rpg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ allocate()

template<int D>
void Pscf::Rpg::CFieldContainer< D >::allocate ( int nMonomer,
int nBasis,
IntVec< D > const & dimensions )

Allocate memory for both r-grid and basis field formats.

This function may only be called once.

Parameters
nMonomernumber of monomer types
nBasisnumber of basis functions
dimensionsdimensions of spatial mesh

Definition at line 126 of file rpg/field/CFieldContainer.tpp.

◆ basis() [1/4]

template<int D>
DArray< DArray< double > > & Pscf::Rpg::CFieldContainer< D >::basis ( )
inline

Get array of all fields in basis format (non-const).

Definition at line 102 of file rpg/field/CFieldContainer.h.

◆ basis() [2/4]

template<int D>
DArray< DArray< double > > const & Pscf::Rpg::CFieldContainer< D >::basis ( ) const
inline

Get array of all fields in basis format (const)

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

Definition at line 110 of file rpg/field/CFieldContainer.h.

◆ basis() [3/4]

template<int D>
DArray< double > & Pscf::Rpg::CFieldContainer< D >::basis ( int monomerId)
inline

Get the field for one monomer type in basis format (non-const).

Parameters
monomerIdinteger monomer type index (0, ... ,nMonomer-1)

Definition at line 118 of file rpg/field/CFieldContainer.h.

◆ basis() [4/4]

template<int D>
DArray< double > const & Pscf::Rpg::CFieldContainer< D >::basis ( int monomerId) const
inline

Get the field for one monomer type in basis format (const)

Parameters
monomerIdinteger monomer type index (0, ... ,nMonomer-1)

Definition at line 126 of file rpg/field/CFieldContainer.h.

◆ rgrid() [1/4]

template<int D>
DArray< RField< D > > & Pscf::Rpg::CFieldContainer< D >::rgrid ( )
inline

Get array of all fields in r-grid format (non-const).

Definition at line 132 of file rpg/field/CFieldContainer.h.

◆ rgrid() [2/4]

template<int D>
DArray< RField< D > > const & Pscf::Rpg::CFieldContainer< D >::rgrid ( ) const
inline

Get array of all fields in r-grid format (const).

Definition at line 138 of file rpg/field/CFieldContainer.h.

◆ rgrid() [3/4]

template<int D>
RField< D > & Pscf::Rpg::CFieldContainer< D >::rgrid ( int monomerId)
inline

Get field for one monomer type in r-grid format (non-const)

Parameters
monomerIdinteger monomer type index (0,..,nMonomer-1)

Definition at line 146 of file rpg/field/CFieldContainer.h.

◆ rgrid() [4/4]

template<int D>
RField< D > const & Pscf::Rpg::CFieldContainer< D >::rgrid ( int monomerId) const
inline

Get field for one monomer type in r-grid format (const).

Parameters
monomerIdinteger monomer type index (0,..,nMonomer-1)

Definition at line 154 of file rpg/field/CFieldContainer.h.

◆ isAllocatedRGrid()

template<int D>
bool Pscf::Rpg::CFieldContainer< D >::isAllocatedRGrid ( ) const
inline

Has memory been allocated for fields in r-grid format?

Definition at line 160 of file rpg/field/CFieldContainer.h.

◆ isAllocatedBasis()

template<int D>
bool Pscf::Rpg::CFieldContainer< D >::isAllocatedBasis ( ) const
inline

Has memory been allocated for fields in basis format?

Definition at line 166 of file rpg/field/CFieldContainer.h.


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