1#ifndef PSCF_R_FIELD_DFT_CP_TPP
2#define PSCF_R_FIELD_DFT_CP_TPP
12#include <pscf/field/cpp/FFT.h>
39 if (!other.isAllocated()) {
40 UTIL_THROW(
"Other Field must be allocated.");
43 for (
int i = 0; i < capacity_; ++i) {
44 data_[i][0] = other.data_[i][0];
45 data_[i][1] = other.data_[i][1];
71 if (
this == &other)
return *
this;
74 if (!other.isAllocated()) {
75 UTIL_THROW(
"Other RFieldDft must be allocated.");
83 UTIL_CHECK(meshDimensions_ == other.meshDimensions_);
84 UTIL_CHECK(dftDimensions_ == other.dftDimensions_);
87 for (
int i = 0; i < capacity_; ++i) {
88 data_[i][0] = other.data_[i][0];
89 data_[i][1] = other.data_[i][1];
113 for (
int i = 0; i < D; ++i) {
133 for (
int i = 0; i < D; ++i) {
134 meshDimensions_[i] = 0;
135 dftDimensions_[i] = 0;
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.
RFieldDft()
Default constructor.
IntVec< D > const & meshDimensions() const
Return vector of spatial mesh dimensions by const reference.
void allocate(IntVec< D > const &meshDimensions)
Allocate the underlying C array and set mesh dimensions.
#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.