1#ifndef PSCF_R_FIELD_CP_TPP
2#define PSCF_R_FIELD_CP_TPP
12#include <pscf/backend/cpp/HostSendArray.h>
40 if (other.isAllocated()) {
41 allocate(other.meshDimensions_);
42 for (int i = 0; i < capacity_; ++i) {
43 data_[i] = other.data_[i];
55 for (
int i = 0; i < D; ++i) {
70 for (
int i = 0; i < D; ++i) {
71 meshDimensions_[i] = 0;
84 for (
int i = 0; i < D; ++i) {
107 if (
this == &other)
return *
this;
111 if (!isAllocated()) {
115 UTIL_CHECK(meshDimensions_ == other.meshDimensions_);
118 for (
int i = 0; i < capacity_; ++i) {
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.
void allocate(IntVec< D > const &meshDimensions)
Allocate the underlying C array for values on a regular mesh.
RField()
Default constructor.
IntVec< D > const & meshDimensions() const
Return mesh dimensions by constant reference.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
PSCF package top-level namespace.