PSCF v1.1
Public Member Functions | List of all members
Pscf::Pspg::WaveList< D > Class Template Reference

Container for wavevector data. More...

#include <WaveList.h>

Public Member Functions

 WaveList ()
 Constructor. More...
 
 ~WaveList ()
 Destructor. More...
 
void allocate (Mesh< D > const &mesh, UnitCell< D > const &unitCell)
 Allocate memory for all arrays. More...
 
void computeMinimumImages (Mesh< D > const &mesh, UnitCell< D > const &unitCell)
 Compute minimum images of wavevectors. More...
 
void computeKSq (UnitCell< D > const &unitCell)
 Compute square norm |k|^2 for all wavevectors. More...
 
void computedKSq (UnitCell< D > const &unitCell)
 Compute derivatives of |k|^2 w/ respect to unit cell parameters. More...
 
const IntVec< D > & minImage (int i) const
 Get the minimum image vector for a specified wavevector. More...
 
cudaReal * kSq () const
 Get a pointer to the kSq array on device. More...
 
cudaReal * dkSq () const
 Get a pointer to the dkSq array on device. More...
 
int kSize () const
 Get size of k-grid (number of wavewavectors). More...
 

Detailed Description

template<int D>
class Pscf::Pspg::WaveList< D >

Container for wavevector data.

Definition at line 31 of file WaveList.h.

Constructor & Destructor Documentation

◆ WaveList()

template<int D>
Pscf::Pspg::WaveList< D >::WaveList

Constructor.

Definition at line 79 of file WaveList.tpp.

◆ ~WaveList()

template<int D>
Pscf::Pspg::WaveList< D >::~WaveList

Destructor.

Definition at line 103 of file WaveList.tpp.

Member Function Documentation

◆ allocate()

template<int D>
void Pscf::Pspg::WaveList< D >::allocate ( Mesh< D > const &  mesh,
UnitCell< D > const &  unitCell 
)

Allocate memory for all arrays.

Call in readParameters.

Parameters
meshspatial discretization mesh (input)
unitCellcrystallographic unit cell (input)

Definition at line 117 of file WaveList.tpp.

References Pscf::Mesh< D >::dimension(), Pscf::Mesh< D >::dimensions(), Pscf::UnitCellBase< D >::nParameter(), Pscf::Mesh< D >::size(), and UTIL_CHECK.

◆ computeMinimumImages()

template<int D>
void Pscf::Pspg::WaveList< D >::computeMinimumImages ( Mesh< D > const &  mesh,
UnitCell< D > const &  unitCell 
)

Compute minimum images of wavevectors.

This is only done once, at beginning, using mesh and the initial unit cell. This can also be called in the readParameters function.

Parameters
meshspatial discretization Mesh<D> object
unitCellcrystallographic UnitCell<D> object

Definition at line 172 of file WaveList.tpp.

References Pscf::MeshIterator< D >::atEnd(), Pscf::MeshIterator< D >::begin(), Pscf::Mesh< D >::dimension(), Pscf::Mesh< D >::dimensions(), Pscf::UnitCellBase< D >::isInitialized(), Pscf::UnitCellBase< D >::ksq(), Pscf::UnitCellBase< D >::nParameter(), Pscf::MeshIterator< D >::position(), Pscf::MeshIterator< D >::rank(), Pscf::Mesh< D >::rank(), Pscf::Mesh< D >::shift(), Pscf::Mesh< D >::size(), and UTIL_CHECK.

◆ computeKSq()

template<int D>
void Pscf::Pspg::WaveList< D >::computeKSq ( UnitCell< D > const &  unitCell)

Compute square norm |k|^2 for all wavevectors.

Called once per iteration with unit cell relaxation. Implementation can copy geometric data (rBasis, kBasis, etc.) into local data structures and implement the actual calculation of kSq or dKSq for each wavevector on the GPU.

Parameters
unitCellcrystallographic UnitCell<D>

Definition at line 280 of file WaveList.tpp.

◆ computedKSq()

template<int D>
void Pscf::Pspg::WaveList< D >::computedKSq ( UnitCell< D > const &  unitCell)

Compute derivatives of |k|^2 w/ respect to unit cell parameters.

Called once per iteration with unit cell relaxation.

Parameters
unitCellcrystallographic UnitCell<D>

Definition at line 285 of file WaveList.tpp.

References Pscf::UnitCellBase< D >::dkkBasis(), Pscf::UnitCellBase< D >::isInitialized(), Pscf::UnitCellBase< D >::nParameter(), Pscf::Pspg::ThreadGrid::setThreadsLogical(), and UTIL_CHECK.

◆ minImage()

template<int D>
const IntVec< D > & Pscf::Pspg::WaveList< D >::minImage ( int  i) const
inline

Get the minimum image vector for a specified wavevector.

Parameters
iindex for wavevector

Definition at line 151 of file WaveList.h.

◆ kSq()

template<int D>
cudaReal * Pscf::Pspg::WaveList< D >::kSq
inline

Get a pointer to the kSq array on device.

Definition at line 155 of file WaveList.h.

◆ dkSq()

template<int D>
cudaReal * Pscf::Pspg::WaveList< D >::dkSq
inline

Get a pointer to the dkSq array on device.

Definition at line 159 of file WaveList.h.

Referenced by Pscf::Pspg::Block< D >::computeStress().

◆ kSize()

template<int D>
int Pscf::Pspg::WaveList< D >::kSize
inline

Get size of k-grid (number of wavewavectors).

Definition at line 163 of file WaveList.h.


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