1#ifndef RPC_C_FIELD_CONTAINER_TPP
2#define RPC_C_FIELD_CONTAINER_TPP
11#include "CFieldContainer.h"
19 using namespace Prdc::Cpu;
29 isAllocatedRGrid_(false),
30 isAllocatedBasis_(false)
61 if (isAllocatedRGrid_) {
66 rgrid_.allocate(nMonomer_);
67 for (
int i = 0; i < nMonomer_; ++i) {
68 rgrid_[i].allocate(meshDimensions);
70 isAllocatedRGrid_ =
true;
81 for (
int i = 0; i < nMonomer_ ; ++i) {
82 rgrid_[i].deallocate();
85 isAllocatedRGrid_ =
false;
97 if (isAllocatedBasis_) {
102 basis_.allocate(nMonomer_);
103 for (
int i = 0; i < nMonomer_; ++i) {
104 basis_[i].allocate(nBasis);
106 isAllocatedBasis_ =
true;
117 for (
int i = 0; i < nMonomer_; ++i) {
118 basis_[i].deallocate();
121 isAllocatedBasis_ =
false;
131 setNMonomer(nMonomer);
132 allocateRGrid(meshDimensions);
133 allocateBasis(nBasis);
An IntVec<D, T> is a D-component vector of elements of integer type T.
void allocate(int nMonomer, int nBasis, IntVec< D > const &dimensions)
Allocate memory for both r-grid and basis field formats.
CFieldContainer()
Constructor.
void allocateBasis(int nBasis)
Allocate or re-allocate memory for fields in basis format.
~CFieldContainer()
Destructor.
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.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
PSCF package top-level namespace.
Utility classes for scientific computation.