PSCF v1.4.0
Pscf::Prdc::Cpu::RField< D > Class Template Reference

Field of real double precision values on an FFT mesh. More...

#include <RField.h>

Inheritance diagram for Pscf::Prdc::Cpu::RField< D >:
Pscf::Prdc::Cpu::FftwDArray< double > Util::Array< double >

Public Member Functions

 RField ()
 Default constructor.
 RField (const RField &other)
 Copy constructor.
virtual ~RField ()
 Destructor.
RFieldoperator= (const RField &other)
 Assignment operator.
void allocate (IntVec< D > const &meshDimensions)
 Allocate the underlying C array for an FFT grid.
virtual void deallocate ()
 Deallocate memory and return to empty state.
const IntVec< D > & meshDimensions () const
 Return mesh dimensions by constant reference.
template<class Archive>
void serialize (Archive &ar, const unsigned int version)
 Serialize a Field to/from an Archive.
Public Member Functions inherited from Pscf::Prdc::Cpu::FftwDArray< double >
 FftwDArray ()
 Default constructor.
virtual ~FftwDArray ()
 Destructor.
void allocate (int capacity)
 Allocate the underlying C array.
bool isAllocated () const
 Return true if the FftwDArray has been allocated, false otherwise.
void serialize (Archive &ar, const unsigned int version)
 Serialize a FftwDArray to/from an Archive.
Public Member Functions inherited from Util::Array< double >
int capacity () const
 Return allocated size.
void begin (ArrayIterator< double > &iterator)
 Set an iterator to begin this Array.
double & operator[] (int i)
 Get an element by non-const reference.
double * cArray ()
 Return a pointer to the underlying C array.

Additional Inherited Members

Public Types inherited from Pscf::Prdc::Cpu::FftwDArray< double >
using ValueType
 Data type of each array element.
Protected Member Functions inherited from Util::Array< double >
 ~Array ()
 Destructor (protected to prevent direct destruction).
Protected Attributes inherited from Util::Array< double >
double * data_
 Pointer to an array of Data elements.
int capacity_
 Allocated size of the data_ array.

Detailed Description

template<int D>
class Pscf::Prdc::Cpu::RField< D >

Field of real double precision values on an FFT mesh.

Definition at line 26 of file cpu/RField.h.

Constructor & Destructor Documentation

◆ RField() [1/2]

template<int D>
Pscf::Prdc::Cpu::RField< D >::RField ( )

Default constructor.

Definition at line 24 of file cpu/RField.tpp.

References Pscf::Prdc::Cpu::FftwDArray< double >::FftwDArray().

Referenced by operator=(), and RField().

◆ RField() [2/2]

template<int D>
Pscf::Prdc::Cpu::RField< D >::RField ( const RField< D > & other)

Copy constructor.

Allocates new memory and copies all elements by value.

Parameters
otherthe RField to be copied.

Definition at line 44 of file cpu/RField.tpp.

References Pscf::Prdc::Cpu::FftwDArray< double >::FftwDArray(), Pscf::Prdc::Cpu::FftwDArray< Data >::isAllocated(), and RField().

◆ ~RField()

template<int D>
Pscf::Prdc::Cpu::RField< D >::~RField ( )
virtual

Destructor.

Deletes underlying C array, if allocated previously.

Definition at line 33 of file cpu/RField.tpp.

Member Function Documentation

◆ operator=()

template<int D>
RField< D > & Pscf::Prdc::Cpu::RField< D >::operator= ( const RField< D > & other)

Assignment operator.

If this Field is not allocated, allocates and copies all elements.

If this and the other Field are both allocated, the capacities must be exactly equal. If so, this method copies all elements.

Parameters
otherthe RHS RField

Definition at line 67 of file cpu/RField.tpp.

References allocate(), Util::Array< Data >::capacity_, Util::Array< double >::capacity_, Util::Array< double >::data_, Pscf::Prdc::Cpu::FftwDArray< Data >::isAllocated(), Pscf::Prdc::Cpu::FftwDArray< double >::isAllocated(), RField(), UTIL_CHECK, and UTIL_THROW.

◆ allocate()

template<int D>
void Pscf::Prdc::Cpu::RField< D >::allocate ( IntVec< D > const & meshDimensions)

Allocate the underlying C array for an FFT grid.

Exceptions
Exceptionif the RField is already allocated.
Parameters
meshDimensionsvector of numbers of grid points per direction

Definition at line 95 of file cpu/RField.tpp.

References Pscf::Prdc::Cpu::FftwDArray< Data >::allocate(), allocate(), meshDimensions(), and UTIL_CHECK.

Referenced by allocate(), Pscf::Rpc::FilmFieldGenMask< D >::compute(), operator=(), Pscf::Prdc::Cpu::FFT< D >::setup(), Pscf::Rpc::FilmFieldGenExt< D >::stress(), and Pscf::Rpc::FilmFieldGenMask< D >::stress().

◆ deallocate()

template<int D>
void Pscf::Prdc::Cpu::RField< D >::deallocate ( )
virtual

Deallocate memory and return to empty state.

Reimplemented from Pscf::Prdc::Cpu::FftwDArray< double >.

Definition at line 110 of file cpu/RField.tpp.

References Pscf::Prdc::Cpu::FftwDArray< Data >::deallocate(), and deallocate().

Referenced by deallocate().

◆ meshDimensions()

template<int D>
const IntVec< D > & Pscf::Prdc::Cpu::RField< D >::meshDimensions ( ) const
inline

◆ serialize()

template<int D>
template<class Archive>
void Pscf::Prdc::Cpu::RField< D >::serialize ( Archive & ar,
const unsigned int version )

Serialize a Field to/from an Archive.

Parameters
ararchive
versionarchive version id

Definition at line 119 of file cpu/RField.h.

References Pscf::Prdc::Cpu::FftwDArray< Data >::serialize().


The documentation for this class was generated from the following files: