PSCF v1.1
Public Member Functions | List of all members
Pscf::Pspg::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. More...
 
 ~CFieldContainer ()
 Destructor. More...
 
void setNMonomer (int nMonomer)
 Set stored value of nMonomer. More...
 
void allocateRGrid (IntVec< D > const &dimensions)
 Allocate or re-allocate memory for fields in rgrid format. More...
 
void deallocateRGrid ()
 De-allocate fields in rgrid format. More...
 
void allocateBasis (int nBasis)
 Allocate or re-allocate memory for fields in basis format. More...
 
void deallocateBasis ()
 De-allocate fields in basis format. More...
 
void allocate (int nMonomer, int nBasis, IntVec< D > const &dimensions)
 Allocate memory for both r-grid and basis field formats. More...
 
DArray< DArray< double > > & basis ()
 Get array of all fields in basis format (non-const). More...
 
DArray< DArray< double > > const & basis () const
 Get array of all fields in basis format (const) More...
 
DArray< double > & basis (int monomerId)
 Get the field for one monomer type in basis format (non-const). More...
 
DArray< double > const & basis (int monomerId) const
 Get the field for one monomer type in basis format (const) More...
 
DArray< RDField< D > > & rgrid ()
 Get array of all fields in r-grid format (non-const). More...
 
DArray< RDField< D > > const & rgrid () const
 Get array of all fields in r-grid format (const). More...
 
RDField< D > & rgrid (int monomerId)
 Get field for one monomer type in r-grid format (non-const) More...
 
RDField< D > const & rgrid (int monomerId) const
 Get field for one monomer type in r-grid format (const). More...
 
bool isAllocatedRGrid () const
 Has memory been allocated for fields in r-grid format? More...
 
bool isAllocatedBasis () const
 Has memory been allocated for fields in basis format? More...
 

Detailed Description

template<int D>
class Pscf::Pspg::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:

Definition at line 38 of file pspg/field/CFieldContainer.h.

Constructor & Destructor Documentation

◆ CFieldContainer()

template<int D>
Pscf::Pspg::CFieldContainer< D >::CFieldContainer

Constructor.

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

◆ ~CFieldContainer()

Destructor.

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

Member Function Documentation

◆ setNMonomer()

template<int D>
void Pscf::Pspg::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 pspg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ allocateRGrid()

template<int D>
void Pscf::Pspg::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 pspg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ deallocateRGrid()

template<int D>
void Pscf::Pspg::CFieldContainer< D >::deallocateRGrid

De-allocate fields in rgrid format.

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

References UTIL_CHECK.

◆ allocateBasis()

template<int D>
void Pscf::Pspg::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 pspg/field/CFieldContainer.tpp.

References UTIL_CHECK.

◆ deallocateBasis()

template<int D>
void Pscf::Pspg::CFieldContainer< D >::deallocateBasis

De-allocate fields in basis format.

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

References UTIL_CHECK.

◆ allocate()

template<int D>
void Pscf::Pspg::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 pspg/field/CFieldContainer.tpp.

◆ basis() [1/4]

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

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

Definition at line 100 of file pspg/field/CFieldContainer.h.

◆ basis() [2/4]

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

◆ basis() [3/4]

template<int D>
DArray< double > & Pscf::Pspg::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 116 of file pspg/field/CFieldContainer.h.

◆ basis() [4/4]

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

◆ rgrid() [1/4]

template<int D>
DArray< RDField< D > > & Pscf::Pspg::CFieldContainer< D >::rgrid ( )
inline

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

Definition at line 130 of file pspg/field/CFieldContainer.h.

◆ rgrid() [2/4]

template<int D>
DArray< RDField< D > > const & Pscf::Pspg::CFieldContainer< D >::rgrid ( ) const
inline

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

Definition at line 136 of file pspg/field/CFieldContainer.h.

◆ rgrid() [3/4]

template<int D>
RDField< D > & Pscf::Pspg::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 144 of file pspg/field/CFieldContainer.h.

◆ rgrid() [4/4]

template<int D>
RDField< D > const & Pscf::Pspg::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 152 of file pspg/field/CFieldContainer.h.

◆ isAllocatedRGrid()

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

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

Definition at line 158 of file pspg/field/CFieldContainer.h.

◆ isAllocatedBasis()

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

Has memory been allocated for fields in basis format?

Definition at line 164 of file pspg/field/CFieldContainer.h.


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