1#ifndef PRDC_CPU_WAVE_LIST_H
2#define PRDC_CPU_WAVE_LIST_H
11#include <prdc/cpu/RField.h>
12#include <pscf/math/IntVec.h>
13#include <util/containers/DArray.h>
14#include <util/containers/GArray.h>
15#include <util/containers/Pair.h>
19 template <
int D>
class Mesh;
267 {
return kMeshDimensions_; }
295 {
return isAllocated_; }
301 {
return hasMinImages_; }
319 {
return isSorted_; }
325 {
return isRealField_; }
439 {
return *unitCellPtr_; }
443 {
return *meshPtr_; }
448 template <
int D>
inline
456 template <
int D>
inline
464 template <
int D>
inline
472 template <
int D>
inline
480 template <
int D>
inline
485 return implicitInverse_;
489 template <
int D>
inline
497 template <
int D>
inline
501 return sortedBunches_;
505 template <
int D>
inline
An IntVec<D, T> is a D-component vector of elements of integer type T.
Description of a regular grid of points in a periodic domain.
Field of real double precision values on an FFT mesh.
Class to compute and store properties associated with wavevectors.
void computeKSq()
Compute square norm |k|^2 for all wavevectors.
RField< D > const & kSq() const
Get the kSq array on the device by const reference.
DArray< IntVec< D > > const & minImages() const
Get the array of minimum image vectors by const reference.
void sortWaves()
Sort waves in order of ascending wavevector norm.
bool hasMinImages() const
Are minimum images up to date ?
void computeMinimumImages()
Compute minimum images of wavevectors, and also calculates kSq.
GArray< Pair< int > > const & sortedBunches() const
Get the sortedBunches array by reference.
bool isRealField() const
Is this WaveList set up for use with real-valued fields?
bool hasKSq() const
Are values of kSq up-to-date ?
int nBunch() const
Return the number of bunches of sorted waves.
void allocate(Mesh< D > const &m, UnitCell< D > const &c)
Allocate memory and set association with a Mesh and UnitCell object.
bool isSorted() const
Have the waves been sorted by magnitude ?
void computedKSq()
Compute derivatives of |k|^2 w/ respect to unit cell parameters.
bool isAllocated() const
Has memory been allocated for arrays?
DArray< bool > const & implicitInverse() const
Get the implicitInverse array by reference.
int kSize() const
Return the number of points in the k-grid mesh.
bool hasdKSq() const
Are values of dKSq up-to-date?
DArray< int > const & sortedIds() const
Get the sortedIds array by reference.
void clearUnitCellData()
Clear all internal data that depends on lattice parameters.
WaveList(bool isRealField=true)
Constructor.
DArray< RField< D > > const & dKSq() const
Get all derivatives of kSq with respect to unit cell parameters.
DArray< int > const & bunchIds() const
Get the bunchIds array by reference.
IntVec< D > const & kMeshDimensions() const
Return the dimensions of the k-grid mesh.
Base template for UnitCell<D> classes, D=1, 2 or 3.
Dynamically allocatable contiguous array template.
An automatically growable array, analogous to a std::vector.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Fields and FFTs for periodic boundary conditions (CPU)
Periodic fields and crystallography.
PSCF package top-level namespace.