PSCF v1.5.0
Pscf::CField< D, CPT > Class Template Reference

Field of complex double precision values on a mesh (CPP). More...

#include <CField.h>

Inheritance diagram for Pscf::CField< D, CPT >:
Pscf::BackendArray< fftw_complex, CPT >

Public Types

using RealType = double
 Type of real and imaginary parts of a complex value.

Public Member Functions

 CField ()
 Default constructor.
 CField (CField< D, CPT > const &other)
 Copy constructor.
virtual ~CField ()
 Destructor.
CField & operator= (CField< D, CPT > const &other)
 Assignment operator.
void allocate (const IntVec< D > &meshDimensions)
 Allocate the underlying C array for an FFT grid.
virtual void deallocate ()
 Deallocate underlying C array and clear mesh dimensions.
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.

Detailed Description

template<int D>
class Pscf::CField< D, CPT >

Field of complex double precision values on a mesh (CPP).

Definition at line 30 of file cpp/CField.h.

Member Typedef Documentation

◆ RealType

template<int D>
using Pscf::CField< D, CPT >::RealType = double

Type of real and imaginary parts of a complex value.

Definition at line 43 of file cpp/CField.h.

Constructor & Destructor Documentation

◆ CField() [1/2]

template<int D>
Pscf::CField< D, CPT >::CField ( )

Default constructor.

Definition at line 22 of file cpp/CField.tpp.

References CField().

Referenced by allocate(), CField(), CField(), deallocate(), meshDimensions(), operator=(), serialize(), and ~CField().

◆ CField() [2/2]

template<int D>
Pscf::CField< D, CPT >::CField ( CField< D, CPT > const & other)

Copy constructor.

Allocates new memory and copies all elements by value.

Parameters
otherthe CField to be copied.

Definition at line 40 of file cpp/CField.tpp.

References CField().

◆ ~CField()

template<int D>
Pscf::CField< D, CPT >::~CField ( )
virtual

Destructor.

Deletes underlying C array, if allocated previously.

Definition at line 31 of file cpp/CField.tpp.

References CField().

Member Function Documentation

◆ operator=()

template<int D>
CField< D, CPT > & Pscf::CField< D, CPT >::operator= ( CField< D, CPT > const & other)

Assignment operator.

If this field is not allocated, this function allocates the field and copies all elements.

If this and the other field are both allocated, the capacities must be equal. If so, this functions copies all elements.

Parameters
otherthe RHS CField

Definition at line 60 of file cpp/CField.tpp.

References allocate(), CField(), UTIL_CHECK, and UTIL_THROW.

◆ allocate()

template<int D>
void Pscf::CField< D, CPT >::allocate ( const IntVec< D > & meshDimensions)

Allocate the underlying C array for an FFT grid.

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

Definition at line 89 of file cpp/CField.tpp.

References Pscf::FftwDRArray< Data >::allocate(), CField(), meshDimensions(), and UTIL_CHECK.

Referenced by operator=().

◆ deallocate()

template<int D>
void Pscf::CField< D, CPT >::deallocate ( )
virtual

Deallocate underlying C array and clear mesh dimensions.

Definition at line 104 of file cpp/CField.tpp.

References CField(), and Pscf::FftwDRArray< Data >::deallocate().

◆ meshDimensions()

template<int D>
IntVec< D > const & Pscf::CField< D, CPT >::meshDimensions ( ) const
inline

Return mesh dimensions by constant reference.

Definition at line 122 of file cpp/CField.h.

References CField().

Referenced by allocate().

◆ serialize()

template<int D>
template<class Archive>
void Pscf::CField< D, CPT >::serialize ( Archive & ar,
const unsigned int version )

Serialize a Field to/from an Archive.

Parameters
ararchive
versionarchive version id

Definition at line 130 of file cpp/CField.h.

References CField(), and Pscf::FftwDRArray< Data >::serialize().


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