1#ifndef RPC_C_FIELD_CONTAINER_H
2#define RPC_C_FIELD_CONTAINER_H
11#include <prdc/cpu/RField.h>
12#include <util/containers/DArray.h>
19 using namespace Prdc::Cpu;
127 {
return basis_[monomerId]; }
135 {
return basis_[monomerId]; }
155 {
return rgrid_[monomerId]; }
163 {
return rgrid_[monomerId]; }
173 {
return isAllocatedRGrid_; }
179 {
return isAllocatedBasis_; }
210 bool isAllocatedRGrid_;
215 bool isAllocatedBasis_;
219 #ifndef RPC_FIELD_CONTAINER_TPP
221 extern template class CFieldContainer<1>;
222 extern template class CFieldContainer<2>;
223 extern template class CFieldContainer<3>;
An IntVec<D, T> is a D-component vector of elements of integer type T.
Field of real double precision values on an FFT mesh.
A list of c fields stored in both basis and r-grid format.
void allocate(int nMonomer, int nBasis, IntVec< D > const &dimensions)
Allocate memory for both r-grid and basis field formats.
CFieldContainer()
Constructor.
DArray< double > & basis(int monomerId)
Get the field for one monomer type in basis format (non-const).
DArray< RField< D > > const & rgrid() const
Get array of all fields in r-grid format (const).
void allocateBasis(int nBasis)
Allocate or re-allocate memory for fields in basis format.
DArray< RField< D > > & rgrid()
Get array of all fields in r-grid format (non-const).
~CFieldContainer()
Destructor.
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).
DArray< double > const & basis(int monomerId) const
Get the field for one monomer type in basis 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?
void deallocateRGrid()
De-allocate fields in rgrid format.
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 deallocateBasis()
De-allocate fields in basis format.
DArray< DArray< double > > const & basis() const
Get array of all fields in basis format (const)
DArray< DArray< double > > & basis()
Get array of all fields in basis format (non-const).
Dynamically allocatable contiguous array template.
PSCF package top-level namespace.
Utility classes for scientific computation.