1#ifndef PSPC_R_FIELD_TPP
2#define PSPC_R_FIELD_TPP
54 meshDimensions_ = other.meshDimensions_;
71 if (
this == &other)
return *
this;
80 }
else if (capacity_ != other.
capacity_) {
81 UTIL_THROW(
"Cannot assign Fields of unequal capacity");
85 for (
int i = 0; i < capacity_; ++i) {
88 meshDimensions_ = other.meshDimensions_;
100 for (
int i = 0; i < D; ++i) {
102 meshDimensions_[i] = meshDimensions[i];
103 size *= meshDimensions[i];
Base class template for a field defined on a spatial grid.
An IntVec<D, T> is a D-component vector of elements of integer type T.
void allocate(int capacity)
Allocate the underlying C array.
Field of real double precision values on an FFT mesh.
RField & operator=(const RField &other)
Assignment operator.
virtual ~RField()
Destructor.
RField()
Default constructor.
void allocate(const IntVec< D > &meshDimensions)
Allocate the underlying C array for an FFT grid.
Data * data_
Pointer to an array of Data elements.
int capacity() const
Return allocated size.
int capacity_
Allocated size of the data_ array.
bool isAllocated() const
Return true if this DArray has been allocated, false otherwise.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.