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

Fourier transform of a real field on an FFT mesh (CPU version). More...

#include <RFieldDft.h>

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

Public Types

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

Public Member Functions

 RFieldDft ()
 Default constructor.
 RFieldDft (RFieldDft< D, CPT > const &other)
 Copy constructor.
virtual ~RFieldDft ()
 Destructor.
RFieldDft< D, CPT > & operator= (RFieldDft< D, CPT > const &other)
 Assignment operator.
RFieldDft< D, CPT > & operator= (HostSendArray< fftw_complex, CPT > const &other)
 Pseudo-assignment from an associated HostSendArray.
void allocate (IntVec< D > const &meshDimensions)
 Allocate the underlying C array and set mesh dimensions.
virtual void deallocate ()
 Deallocate underlying C array and clear mesh dimensions.
IntVec< D > const & meshDimensions () const
 Return vector of spatial mesh dimensions by const reference.
IntVec< D > const & dftDimensions () const
 Return vector of dft (Fourier) grid dimensions by const 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::RFieldDft< D, CPT >

Fourier transform of a real field on an FFT mesh (CPU version).

Definition at line 35 of file cpp/RFieldDft.h.

Member Typedef Documentation

◆ RealType

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

Type of real and imaginary parts of a complex element value.

Definition at line 51 of file cpp/RFieldDft.h.

Constructor & Destructor Documentation

◆ RFieldDft() [1/2]

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

Default constructor.

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

References RFieldDft().

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

◆ RFieldDft() [2/2]

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

Copy constructor.

Allocates new memory and copies all elements by value.

Parameters
otherthe RFieldDft to be copied.

Definition at line 34 of file cpp/RFieldDft.tpp.

References allocate(), and RFieldDft().

◆ ~RFieldDft()

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

Destructor.

Deletes underlying C array, if allocated previously.

Definition at line 53 of file cpp/RFieldDft.tpp.

References RFieldDft().

Member Function Documentation

◆ operator=() [1/2]

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

Assignment operator.

Perform a deep copy of all elements of another RFieldDft array. If this Field is not allocated, it first allocates this array. If this and the other Field are both allocated on entry, the capacities must match.

Exceptions
Exceptionif other is not allocated
Exceptionif this and other have unequal nonzero capacities
Parameters
otherthe field on the RHS of assignment

Definition at line 68 of file cpp/RFieldDft.tpp.

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

◆ operator=() [2/2]

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

Pseudo-assignment from an associated HostSendArray.

This function simply calls the corresponding assignment operator of the BackendArray base class, then returns this RFieldDft object. It checks if an association exists between the LHS and RHS arrays, and does nothing if this is the case.

Exceptions
Exceptionif other (RHS) is not allocated
Exceptionif other (RHS) is not associated with this (LHS)
Parameters
otherthe RHS host array

Definition at line 100 of file cpp/RFieldDft.tpp.

References RFieldDft().

◆ allocate()

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

Allocate the underlying C array and set mesh dimensions.

Exceptions
Exceptionif the RFieldDft is already allocated.
Parameters
meshDimensionsvector of grid points in each direction

Definition at line 110 of file cpp/RFieldDft.tpp.

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

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

◆ deallocate()

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

Deallocate underlying C array and clear mesh dimensions.

Definition at line 130 of file cpp/RFieldDft.tpp.

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

◆ meshDimensions()

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

Return vector of spatial mesh dimensions by const reference.

Definition at line 167 of file cpp/RFieldDft.h.

References RFieldDft().

Referenced by allocate().

◆ dftDimensions()

template<int D>
IntVec< D > const & Pscf::RFieldDft< D, CPT >::dftDimensions ( ) const
inline

Return vector of dft (Fourier) grid dimensions by const reference.

The last element of dftDimensions() and meshDimensions() differ by about a factor of two: dftDimension()[D-1] = meshDimensions()/2 + 1. For D > 1, other elements are equal.

Definition at line 174 of file cpp/RFieldDft.h.

References RFieldDft().

◆ serialize()

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

Serialize a Field to/from an Archive.

Parameters
ararchive
versionarchive version id

Definition at line 182 of file cpp/RFieldDft.h.

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


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