1#ifndef PSCF_C_FIELD_CP_TPP
2#define PSCF_C_FIELD_CP_TPP
44 if (other.isAllocated() && other.capacity_ > 0) {
45 FftwDRArray<fftw_complex>::allocate(other.capacity_);
46 meshDimensions_ = other.meshDimensions_;
47 for (int i = 0; i < capacity_; ++i) {
48 data_[i][0] = other.data_[i][0];
49 data_[i][1] = other.data_[i][1];
63 if (
this == &other)
return *
this;
66 if (!other.isAllocated()) {
67 UTIL_THROW(
"Other CField must be allocated in assignment.");
74 UTIL_CHECK(meshDimensions_ == other.meshDimensions_);
77 for (
int i = 0; i < capacity_; ++i) {
78 data_[i][0] = other.data_[i][0];
79 data_[i][1] = other.data_[i][1];
92 for (
int i = 0; i < D; ++i) {
107 for (
int i = 0; i < D; ++i) {
108 meshDimensions_[i] = 0;
CField()
Default constructor.
const IntVec< D > & meshDimensions() const
Return mesh dimensions by constant reference.
void allocate(const IntVec< D > &meshDimensions)
Allocate the underlying C array for an FFT grid.
Backend identifier class for the C++ serial CPU backend.
virtual void deallocate()
Dellocate an underlying C array that is owned by this container.
void allocate(int capacity)
Allocate an underlying C array, which this container then owns.
An IntVec<D, T> is a D-component vector of elements of integer type T.
File containing preprocessor macros for error handling.
#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.
PSCF package top-level namespace.