PSCF v1.2
Pscf::Rpc::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.
 
Initialization and Memory Management
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.
 
Field Mutators and Accessors (return by reference)
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).
 
Boolean Queries
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::Rpc::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 rpc/field/CFieldContainer.h.

Constructor & Destructor Documentation

◆ CFieldContainer()

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

Constructor.

Definition at line 25 of file rpc/field/CFieldContainer.tpp.

◆ ~CFieldContainer()

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

Destructor.

Definition at line 37 of file rpc/field/CFieldContainer.tpp.

Member Function Documentation

◆ setNMonomer()

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

Set stored value of nMonomer.

May only be called once.

Parameters
nMonomernumber of monomer types.

Definition at line 44 of file rpc/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ allocateRGrid()

template<int D>
void Pscf::Rpc::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 56 of file rpc/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ deallocateRGrid()

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

De-allocate fields in rgrid format.

Definition at line 77 of file rpc/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ allocateBasis()

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

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

Parameters
nBasisnumber of basis functions

Definition at line 92 of file rpc/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ deallocateBasis()

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

De-allocate fields in basis format.

Definition at line 113 of file rpc/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ allocate()

template<int D>
void Pscf::Rpc::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 128 of file rpc/field/CFieldContainer.tpp.

◆ basis() [1/4]

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

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

Definition at line 109 of file rpc/field/CFieldContainer.h.

◆ basis() [2/4]

template<int D>
DArray< DArray< double > > const & Pscf::Rpc::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 117 of file rpc/field/CFieldContainer.h.

◆ basis() [3/4]

template<int D>
DArray< double > & Pscf::Rpc::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 126 of file rpc/field/CFieldContainer.h.

◆ basis() [4/4]

template<int D>
DArray< double > const & Pscf::Rpc::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 134 of file rpc/field/CFieldContainer.h.

◆ rgrid() [1/4]

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

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

Definition at line 140 of file rpc/field/CFieldContainer.h.

◆ rgrid() [2/4]

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

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

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

◆ rgrid() [3/4]

template<int D>
RField< D > & Pscf::Rpc::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 154 of file rpc/field/CFieldContainer.h.

◆ rgrid() [4/4]

template<int D>
RField< D > const & Pscf::Rpc::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 162 of file rpc/field/CFieldContainer.h.

◆ isAllocatedRGrid()

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

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

Definition at line 172 of file rpc/field/CFieldContainer.h.

◆ isAllocatedBasis()

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

Has memory been allocated for fields in basis format?

Definition at line 178 of file rpc/field/CFieldContainer.h.


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