SIRIUS 7.5.0
Electronic structure library and applications
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sirius::fft::Gvec Class Reference

A set of G-vectors for FFTs and G+k basis functions. More...

#include <gvec.hpp>

Public Member Functions

 Gvec (r3::vector< double > vk__, r3::matrix< double > M__, double Gmax__, mpi::Communicator const &comm__, bool reduce_gvec__, double sym_tol__=1e-6)
 Constructor for G+k vectors. More...
 
 Gvec (r3::matrix< double > M__, double Gmax__, mpi::Communicator const &comm__, bool reduce_gvec__, double sym_tol__=1e-6)
 Constructor for G-vectors. More...
 
 Gvec (r3::matrix< double > M__, double Gmax__, fft::Grid const &fft_grid__, mpi::Communicator const &comm__, bool reduce_gvec__, double sym_tol__=1e-6)
 Constructor for G-vectors. More...
 
 Gvec (double Gmax__, Gvec const &gvec_base__)
 Constructor for G-vector distribution based on a previous set. More...
 
 Gvec (r3::matrix< double > M__, double Gmax__, bool reduce_gvec__, double sym_tol__=1e-6)
 Constructor for G-vectors with mpi_comm_self() More...
 
 Gvec (r3::vector< double > vk__, r3::matrix< double > M__, int ngv_loc__, int const *gv__, mpi::Communicator const &comm__, bool reduce_gvec__)
 Construct with the defined order of G-vectors. More...
 
 Gvec (mpi::Communicator const &comm__)
 Constructor for empty set of G-vectors. More...
 
Gvecoperator= (Gvec &&src__)=default
 Move assignment operator.
 
 Gvec (Gvec &&src__)=default
 Move constructor.
 
auto const & vk () const
 
mpi::Communicator const & comm () const
 
auto const & lattice_vectors (r3::matrix< double > lattice_vectors__)
 Set the new reciprocal lattice vectors. More...
 
auto const & lattice_vectors () const
 Retrn a const reference to the reciprocal lattice vectors. More...
 
auto const unit_cell_lattice_vectors () const
 
double omega () const
 Return the volume of the real space unit cell that corresponds to the reciprocal lattice of G-vectors. More...
 
int num_gvec () const
 Return the total number of G-vectors within the cutoff. More...
 
int zcol_count (int rank__) const
 Number of z-columns for a fine-grained distribution. More...
 
int zcol_offset (int rank__) const
 Offset in the global index of z-columns for a given rank. More...
 
int gvec_count (int rank__) const
 Number of G-vectors for a fine-grained distribution. More...
 
int count () const
 Number of G-vectors for a fine-grained distribution for the current MPI rank. More...
 
int gvec_offset (int rank__) const
 Offset (in the global index) of G-vectors for a fine-grained distribution. More...
 
int offset () const
 Offset (in the global index) of G-vectors for a fine-grained distribution for a current MPI rank. More...
 
int skip_g0 () const
 Local starting index of G-vectors if G=0 is not counted. More...
 
int num_shells () const
 Return number of G-vector shells. More...
 
template<index_domain_t idx_t>
r3::vector< int > gvec (int ig__) const
 Return G vector in fractional coordinates. More...
 
template<index_domain_t idx_t>
r3::vector< double > gkvec (int ig__) const
 Return G+k vector in fractional coordinates. More...
 
template<index_domain_t idx_t>
r3::vector< double > gvec_cart (int ig__) const
 Return G vector in Cartesian coordinates. More...
 
template<index_domain_t idx_t>
r3::vector< double > gkvec_cart (int ig__) const
 Return G+k vector in fractional coordinates. More...
 
int shell (int ig__) const
 Return index of the G-vector shell by the G-vector index. More...
 
int shell (r3::vector< int > const &G__) const
 
double shell_len (int igs__) const
 Return length of the G-vector shell. More...
 
std::vector< double > shells_len () const
 Get lengths of all G-vector shells. More...
 
template<index_domain_t idx_t>
double gvec_len (int ig__) const
 Return length of the G-vector. More...
 
int index_g12 (r3::vector< int > const &g1__, r3::vector< int > const &g2__) const
 
std::pair< int, bool > index_g12_safe (r3::vector< int > const &g1__, r3::vector< int > const &g2__) const
 
int index_by_gvec (r3::vector< int > const &G__) const
 Return a global G-vector index in the range [0, num_gvec) by the G-vector. More...
 
bool reduced () const
 
bool bare () const
 
int num_zcol () const
 Return global number of z-columns. More...
 
int num_zcol_local () const
 Return local number of z-columns. More...
 
z_column_descriptor const & zcol (size_t idx__) const
 
int gvec_base_mapping (int igloc_base__) const
 
int num_gvec_shells_local () const
 
double gvec_shell_len_local (int idx__) const
 
int gvec_shell_idx_local (int igloc__) const
 
auto const & gvec_local () const
 Return local list of G-vectors. More...
 
auto gvec_local (int rank__) const
 Return local list of G-vectors for a given rank. More...
 
auto & gvec_tp ()
 
auto const & gvec_tp () const
 
auto & gkvec_tp ()
 
auto const & gkvec_tp () const
 

Private Member Functions

r3::vector< int > gvec_by_full_index (uint32_t idx__) const
 Return corresponding G-vector for an index in the range [0, num_gvec). More...
 
void find_z_columns (double Gmax__, fft::Grid const &fft_box__)
 Find z-columns of G-vectors inside a sphere with Gmax radius. More...
 
void distribute_z_columns ()
 Distribute z-columns between MPI ranks. More...
 
void find_gvec_shells ()
 Find a list of G-vector shells. More...
 
void init_gvec_local ()
 Initialize lattice coordinates of the local fraction of G-vectors. More...
 
void init_gvec_cart_local ()
 Initialize Cartesian coordinates of the local fraction of G-vectors. More...
 
void init (fft::Grid const &fft_grid)
 Initialize everything. More...
 
 Gvec (Gvec const &src__)=delete
 
Gvecoperator= (Gvec const &src__)=delete
 

Private Attributes

r3::vector< double > vk_ {0, 0, 0}
 k-vector of G+k. More...
 
double Gmax_ {0}
 Cutoff for |G+k| vectors. More...
 
r3::matrix< double > lattice_vectors_
 Reciprocal lattice vectors. More...
 
mpi::Communicator comm_
 Total communicator which is used to distribute G or G+k vectors. More...
 
bool reduce_gvec_ {false}
 Indicates that G-vectors are reduced by inversion symmetry. More...
 
bool bare_gvec_ {true}
 True if this a list of G-vectors without k-point shift. More...
 
int num_gvec_ {0}
 Total number of G-vectors. More...
 
sddk::mdarray< uint32_t, 1 > gvec_full_index_
 Mapping between G-vector index [0:num_gvec_) and a full index. More...
 
sddk::mdarray< int, 1 > gvec_shell_
 Index of the shell to which the given G-vector belongs. More...
 
int num_gvec_shells_
 Number of G-vector shells (groups of G-vectors with the same length). More...
 
sddk::mdarray< double, 1 > gvec_shell_len_
 Radii (or lengths) of G-vector shells in a.u.^-1. More...
 
int num_gvec_shells_local_
 Local number of G-vector shells for the local number of G-vectors. More...
 
std::vector< double > gvec_shell_len_local_
 Radii of G-vector shells in the local index counting [0, num_gvec_shells_local) More...
 
std::vector< int > gvec_shell_idx_local_
 Mapping between local index of G-vector and local G-shell index. More...
 
sddk::mdarray< int, 3 > gvec_index_by_xy_
 
std::vector< z_column_descriptorz_columns_
 Global list of non-zero z-columns. More...
 
mpi::block_data_descriptor gvec_distr_
 Fine-grained distribution of G-vectors. More...
 
mpi::block_data_descriptor zcol_distr_
 Fine-grained distribution of z-columns. More...
 
Gvec const * gvec_base_ {nullptr}
 Set of G-vectors on which the current G-vector distribution can be based. More...
 
sddk::mdarray< int, 1 > gvec_base_mapping_
 Mapping between current and base G-vector sets. More...
 
sddk::mdarray< int, 2 > gvec_
 Lattice coordinates of a local set of G-vectors. More...
 
sddk::mdarray< double, 2 > gkvec_
 Lattice coordinates of a local set of G+k-vectors. More...
 
sddk::mdarray< double, 2 > gvec_cart_
 Cartiesian coordinaes of a local set of G-vectors. More...
 
sddk::mdarray< double, 2 > gkvec_cart_
 Cartesian coordinaes of a local set of G+k-vectors. More...
 
sddk::mdarray< double, 1 > gvec_len_
 Length of the local fraction of G-vectors. More...
 
sddk::mdarray< double, 2 > gvec_tp_
 
sddk::mdarray< double, 2 > gkvec_tp_
 
int offset_ {-1}
 Offset in the global index for the local part of G-vectors. More...
 
int count_ {-1}
 Local number of G-vectors. More...
 
int num_zcol_local_ {-1}
 Local number of z-columns. More...
 
double sym_tol_ {1e-6}
 Symmetry tolerance of the real-space lattice. More...
 

Friends

void serialize (serializer &s__, Gvec const &gv__)
 
void deserialize (serializer &s__, Gvec &gv__)
 

Detailed Description

A set of G-vectors for FFTs and G+k basis functions.

Current implemntation supports up to 2^12 (4096) z-dimension of the FFT grid and 2^20 (1048576) number of z-columns. The order of z-sticks and G-vectors is not fixed and depends on the number of MPI ranks used for the parallelization.

Definition at line 129 of file gvec.hpp.

Constructor & Destructor Documentation

◆ Gvec() [1/7]

sirius::fft::Gvec::Gvec ( r3::vector< double >  vk__,
r3::matrix< double >  M__,
double  Gmax__,
mpi::Communicator const &  comm__,
bool  reduce_gvec__,
double  sym_tol__ = 1e-6 
)
inline

Constructor for G+k vectors.

Parameters
[in]vkK-point vector of G+k
[in]MReciprocal lattice vectors in column order
[in]GmaxCutoff for G+k vectors
[in]commTotal communicator which is used to distribute G-vectors
[in]reduce_gvecTrue if G-vectors need to be reduced by inversion symmetry.
[in]sym_tolUnit cell lattice symmetry tolerance.

Definition at line 290 of file gvec.hpp.

◆ Gvec() [2/7]

sirius::fft::Gvec::Gvec ( r3::matrix< double >  M__,
double  Gmax__,
mpi::Communicator const &  comm__,
bool  reduce_gvec__,
double  sym_tol__ = 1e-6 
)
inline

Constructor for G-vectors.

Parameters
[in]MReciprocal lattice vectors in column order
[in]GmaxCutoff for G+k vectors
[in]commTotal communicator which is used to distribute G-vectors
[in]reduce_gvecTrue if G-vectors need to be reduced by inversion symmetry.
[in]sym_tolUnit cell lattice symmetry tolerance.

Definition at line 310 of file gvec.hpp.

◆ Gvec() [3/7]

sirius::fft::Gvec::Gvec ( r3::matrix< double >  M__,
double  Gmax__,
fft::Grid const &  fft_grid__,
mpi::Communicator const &  comm__,
bool  reduce_gvec__,
double  sym_tol__ = 1e-6 
)
inline

Constructor for G-vectors.

Parameters
[in]MReciprocal lattice vectors in column order
[in]GmaxCutoff for G+k vectors
[in]fft_gridProvide explicit boundaries for the G-vector min and max frequencies.
[in]commTotal communicator which is used to distribute G-vectors
[in]reduce_gvecTrue if G-vectors need to be reduced by inversion symmetry.
[in]sym_tolUnit cell lattice symmetry tolerance.

Definition at line 329 of file gvec.hpp.

◆ Gvec() [4/7]

sirius::fft::Gvec::Gvec ( double  Gmax__,
Gvec const &  gvec_base__ 
)
inline

Constructor for G-vector distribution based on a previous set.

Previous set of G-vectors must be a subset of the current set.

Definition at line 342 of file gvec.hpp.

◆ Gvec() [5/7]

sirius::fft::Gvec::Gvec ( r3::matrix< double >  M__,
double  Gmax__,
bool  reduce_gvec__,
double  sym_tol__ = 1e-6 
)
inline

Constructor for G-vectors with mpi_comm_self()

Definition at line 354 of file gvec.hpp.

◆ Gvec() [6/7]

sirius::fft::Gvec::Gvec ( r3::vector< double >  vk__,
r3::matrix< double >  M__,
int  ngv_loc__,
int const *  gv__,
mpi::Communicator const &  comm__,
bool  reduce_gvec__ 
)
inline

Construct with the defined order of G-vectors.

Definition at line 365 of file gvec.hpp.

◆ Gvec() [7/7]

sirius::fft::Gvec::Gvec ( mpi::Communicator const &  comm__)
inline

Constructor for empty set of G-vectors.

Definition at line 425 of file gvec.hpp.

Member Function Documentation

◆ gvec_by_full_index()

r3::vector< int > sirius::fft::Gvec::gvec_by_full_index ( uint32_t  idx__) const
private

Return corresponding G-vector for an index in the range [0, num_gvec).

Definition at line 34 of file gvec.cpp.

◆ find_z_columns()

void sirius::fft::Gvec::find_z_columns ( double  Gmax__,
fft::Grid const &  fft_box__ 
)
private

Find z-columns of G-vectors inside a sphere with Gmax radius.

This function also computes the total number of G-vectors.

Definition at line 48 of file gvec.cpp.

◆ distribute_z_columns()

void sirius::fft::Gvec::distribute_z_columns ( )
private

Distribute z-columns between MPI ranks.

Definition at line 208 of file gvec.cpp.

◆ find_gvec_shells()

void sirius::fft::Gvec::find_gvec_shells ( )
private

Find a list of G-vector shells.

G-vectors belonging to the same shell have the same length and transform to each other under a lattice symmetry operation.

Definition at line 275 of file gvec.cpp.

◆ init_gvec_local()

void sirius::fft::Gvec::init_gvec_local ( )
private

Initialize lattice coordinates of the local fraction of G-vectors.

Definition at line 372 of file gvec.cpp.

◆ init_gvec_cart_local()

void sirius::fft::Gvec::init_gvec_cart_local ( )
private

Initialize Cartesian coordinates of the local fraction of G-vectors.

Definition at line 388 of file gvec.cpp.

◆ init()

void sirius::fft::Gvec::init ( fft::Grid const &  fft_grid)
private

Initialize everything.

Definition at line 420 of file gvec.cpp.

◆ vk()

auto const & sirius::fft::Gvec::vk ( ) const
inline

Definition at line 436 of file gvec.hpp.

◆ comm()

mpi::Communicator const & sirius::fft::Gvec::comm ( ) const
inline

Definition at line 441 of file gvec.hpp.

◆ lattice_vectors() [1/2]

auto const & sirius::fft::Gvec::lattice_vectors ( r3::matrix< double >  lattice_vectors__)
inline

Set the new reciprocal lattice vectors.

For the varibale-cell relaxation runs we need an option to preserve the number of G- and G+k vectors. Here we can set the new lattice vectors and update the relevant members of the Gvec class.

Definition at line 449 of file gvec.hpp.

◆ lattice_vectors() [2/2]

auto const & sirius::fft::Gvec::lattice_vectors ( ) const
inline

Retrn a const reference to the reciprocal lattice vectors.

Definition at line 458 of file gvec.hpp.

◆ unit_cell_lattice_vectors()

auto const sirius::fft::Gvec::unit_cell_lattice_vectors ( ) const
inline

Definition at line 463 of file gvec.hpp.

◆ omega()

double sirius::fft::Gvec::omega ( ) const
inline

Return the volume of the real space unit cell that corresponds to the reciprocal lattice of G-vectors.

Definition at line 471 of file gvec.hpp.

◆ num_gvec()

int sirius::fft::Gvec::num_gvec ( ) const
inline

Return the total number of G-vectors within the cutoff.

Definition at line 478 of file gvec.hpp.

◆ zcol_count()

int sirius::fft::Gvec::zcol_count ( int  rank__) const
inline

Number of z-columns for a fine-grained distribution.

Definition at line 484 of file gvec.hpp.

◆ zcol_offset()

int sirius::fft::Gvec::zcol_offset ( int  rank__) const
inline

Offset in the global index of z-columns for a given rank.

Definition at line 491 of file gvec.hpp.

◆ gvec_count()

int sirius::fft::Gvec::gvec_count ( int  rank__) const
inline

Number of G-vectors for a fine-grained distribution.

Definition at line 498 of file gvec.hpp.

◆ count()

int sirius::fft::Gvec::count ( ) const
inline

Number of G-vectors for a fine-grained distribution for the current MPI rank.

The count and offset are borrowed from the MPI terminology for data distribution.

Definition at line 506 of file gvec.hpp.

◆ gvec_offset()

int sirius::fft::Gvec::gvec_offset ( int  rank__) const
inline

Offset (in the global index) of G-vectors for a fine-grained distribution.

Definition at line 512 of file gvec.hpp.

◆ offset()

int sirius::fft::Gvec::offset ( ) const
inline

Offset (in the global index) of G-vectors for a fine-grained distribution for a current MPI rank.

The count and offset are borrowed from the MPI terminology for data distribution.

Definition at line 520 of file gvec.hpp.

◆ skip_g0()

int sirius::fft::Gvec::skip_g0 ( ) const
inline

Local starting index of G-vectors if G=0 is not counted.

Definition at line 526 of file gvec.hpp.

◆ num_shells()

int sirius::fft::Gvec::num_shells ( ) const
inline

Return number of G-vector shells.

Definition at line 532 of file gvec.hpp.

◆ gvec()

template<index_domain_t idx_t>
r3::vector< int > sirius::fft::Gvec::gvec ( int  ig__) const
inline

Return G vector in fractional coordinates.

Definition at line 540 of file gvec.hpp.

◆ gkvec()

template<index_domain_t idx_t>
r3::vector< double > sirius::fft::Gvec::gkvec ( int  ig__) const
inline

Return G+k vector in fractional coordinates.

Definition at line 557 of file gvec.hpp.

◆ gvec_cart()

template<index_domain_t idx_t>
r3::vector< double > sirius::fft::Gvec::gvec_cart ( int  ig__) const
inline

Return G vector in Cartesian coordinates.

Definition at line 574 of file gvec.hpp.

◆ gkvec_cart()

template<index_domain_t idx_t>
r3::vector< double > sirius::fft::Gvec::gkvec_cart ( int  ig__) const
inline

Return G+k vector in fractional coordinates.

Definition at line 592 of file gvec.hpp.

◆ shell() [1/2]

int sirius::fft::Gvec::shell ( int  ig__) const
inline

Return index of the G-vector shell by the G-vector index.

Definition at line 608 of file gvec.hpp.

◆ shell() [2/2]

int sirius::fft::Gvec::shell ( r3::vector< int > const &  G__) const
inline

Definition at line 613 of file gvec.hpp.

◆ shell_len()

double sirius::fft::Gvec::shell_len ( int  igs__) const
inline

Return length of the G-vector shell.

Definition at line 619 of file gvec.hpp.

◆ shells_len()

std::vector< double > sirius::fft::Gvec::shells_len ( ) const
inline

Get lengths of all G-vector shells.

Definition at line 625 of file gvec.hpp.

◆ gvec_len()

template<index_domain_t idx_t>
double sirius::fft::Gvec::gvec_len ( int  ig__) const
inline

Return length of the G-vector.

Definition at line 637 of file gvec.hpp.

◆ index_g12()

int sirius::fft::Gvec::index_g12 ( r3::vector< int > const &  g1__,
r3::vector< int > const &  g2__ 
) const
inline

Definition at line 651 of file gvec.hpp.

◆ index_g12_safe()

std::pair< int, bool > sirius::fft::Gvec::index_g12_safe ( r3::vector< int > const &  g1__,
r3::vector< int > const &  g2__ 
) const

Definition at line 497 of file gvec.cpp.

◆ index_by_gvec()

int sirius::fft::Gvec::index_by_gvec ( r3::vector< int > const &  G__) const

Return a global G-vector index in the range [0, num_gvec) by the G-vector.

The information about a G-vector index is encoded by two numbers: a starting index for the column of G-vectors and column's size. Depending on the geometry of the reciprocal lattice, z-columns may have only negative, only positive or both negative and positive frequencies for a given x and y. This information is used to compute the offset which is added to the starting index in order to get a full G-vector index. Check find_z_columns() to see how the z-columns are found and added to the list of columns.

Definition at line 518 of file gvec.cpp.

◆ reduced()

bool sirius::fft::Gvec::reduced ( ) const
inline

Definition at line 677 of file gvec.hpp.

◆ bare()

bool sirius::fft::Gvec::bare ( ) const
inline

Definition at line 682 of file gvec.hpp.

◆ num_zcol()

int sirius::fft::Gvec::num_zcol ( ) const
inline

Return global number of z-columns.

Definition at line 688 of file gvec.hpp.

◆ num_zcol_local()

int sirius::fft::Gvec::num_zcol_local ( ) const
inline

Return local number of z-columns.

Definition at line 694 of file gvec.hpp.

◆ zcol()

z_column_descriptor const & sirius::fft::Gvec::zcol ( size_t  idx__) const
inline

Definition at line 699 of file gvec.hpp.

◆ gvec_base_mapping()

int sirius::fft::Gvec::gvec_base_mapping ( int  igloc_base__) const
inline

Definition at line 704 of file gvec.hpp.

◆ num_gvec_shells_local()

int sirius::fft::Gvec::num_gvec_shells_local ( ) const
inline

Definition at line 710 of file gvec.hpp.

◆ gvec_shell_len_local()

double sirius::fft::Gvec::gvec_shell_len_local ( int  idx__) const
inline

Definition at line 715 of file gvec.hpp.

◆ gvec_shell_idx_local()

int sirius::fft::Gvec::gvec_shell_idx_local ( int  igloc__) const
inline

Definition at line 720 of file gvec.hpp.

◆ gvec_local() [1/2]

auto const & sirius::fft::Gvec::gvec_local ( ) const
inline

Return local list of G-vectors.

Definition at line 726 of file gvec.hpp.

◆ gvec_local() [2/2]

auto sirius::fft::Gvec::gvec_local ( int  rank__) const
inline

Return local list of G-vectors for a given rank.

This function must be called by all MPI ranks of the G-vector communicator.

Definition at line 733 of file gvec.hpp.

◆ gvec_tp() [1/2]

auto & sirius::fft::Gvec::gvec_tp ( )
inline

Definition at line 746 of file gvec.hpp.

◆ gvec_tp() [2/2]

auto const & sirius::fft::Gvec::gvec_tp ( ) const
inline

Definition at line 751 of file gvec.hpp.

◆ gkvec_tp() [1/2]

auto & sirius::fft::Gvec::gkvec_tp ( )
inline

Definition at line 756 of file gvec.hpp.

◆ gkvec_tp() [2/2]

auto const & sirius::fft::Gvec::gkvec_tp ( ) const
inline

Definition at line 761 of file gvec.hpp.

Friends And Related Function Documentation

◆ serialize

void serialize ( serializer s__,
Gvec const &  gv__ 
)
friend

Definition at line 744 of file gvec.cpp.

◆ deserialize

void deserialize ( serializer s__,
Gvec gv__ 
)
friend

Definition at line 765 of file gvec.cpp.

Member Data Documentation

◆ vk_

r3::vector<double> sirius::fft::Gvec::vk_ {0, 0, 0}
private

k-vector of G+k.

Definition at line 133 of file gvec.hpp.

◆ Gmax_

double sirius::fft::Gvec::Gmax_ {0}
private

Cutoff for |G+k| vectors.

Definition at line 136 of file gvec.hpp.

◆ lattice_vectors_

r3::matrix<double> sirius::fft::Gvec::lattice_vectors_
private

Reciprocal lattice vectors.

Definition at line 139 of file gvec.hpp.

◆ comm_

mpi::Communicator sirius::fft::Gvec::comm_
private

Total communicator which is used to distribute G or G+k vectors.

Definition at line 142 of file gvec.hpp.

◆ reduce_gvec_

bool sirius::fft::Gvec::reduce_gvec_ {false}
private

Indicates that G-vectors are reduced by inversion symmetry.

Definition at line 145 of file gvec.hpp.

◆ bare_gvec_

bool sirius::fft::Gvec::bare_gvec_ {true}
private

True if this a list of G-vectors without k-point shift.

Definition at line 148 of file gvec.hpp.

◆ num_gvec_

int sirius::fft::Gvec::num_gvec_ {0}
private

Total number of G-vectors.

Definition at line 151 of file gvec.hpp.

◆ gvec_full_index_

sddk::mdarray<uint32_t, 1> sirius::fft::Gvec::gvec_full_index_
private

Mapping between G-vector index [0:num_gvec_) and a full index.

Full index is used to store x,y,z coordinates in a packed form in a single integer number. The index is equal to ((i << 12) + j) where i is the global index of z_column and j is the index of G-vector z-coordinate in the column i. This is a global array: each MPI rank stores exactly the same copy of the gvec_full_index_.

Limitations: size of z-dimension of FFT grid: 4096, number of z-columns: 1048576

Definition at line 161 of file gvec.hpp.

◆ gvec_shell_

sddk::mdarray<int, 1> sirius::fft::Gvec::gvec_shell_
private

Index of the shell to which the given G-vector belongs.

Definition at line 164 of file gvec.hpp.

◆ num_gvec_shells_

int sirius::fft::Gvec::num_gvec_shells_
private

Number of G-vector shells (groups of G-vectors with the same length).

Definition at line 167 of file gvec.hpp.

◆ gvec_shell_len_

sddk::mdarray<double, 1> sirius::fft::Gvec::gvec_shell_len_
private

Radii (or lengths) of G-vector shells in a.u.^-1.

Definition at line 170 of file gvec.hpp.

◆ num_gvec_shells_local_

int sirius::fft::Gvec::num_gvec_shells_local_
private

Local number of G-vector shells for the local number of G-vectors.

G-vectors are distributed by sticks, not by G-shells. This means that each rank stores local fraction of G-vectors with a non-consecutive G-shell index and not all G-shells are present at a given rank. This variable stores the number of G-shells which this rank holds.

Definition at line 176 of file gvec.hpp.

◆ gvec_shell_len_local_

std::vector<double> sirius::fft::Gvec::gvec_shell_len_local_
private

Radii of G-vector shells in the local index counting [0, num_gvec_shells_local)

Definition at line 179 of file gvec.hpp.

◆ gvec_shell_idx_local_

std::vector<int> sirius::fft::Gvec::gvec_shell_idx_local_
private

Mapping between local index of G-vector and local G-shell index.

Definition at line 182 of file gvec.hpp.

◆ gvec_index_by_xy_

sddk::mdarray<int, 3> sirius::fft::Gvec::gvec_index_by_xy_
private

Definition at line 184 of file gvec.hpp.

◆ z_columns_

std::vector<z_column_descriptor> sirius::fft::Gvec::z_columns_
private

Global list of non-zero z-columns.

Definition at line 187 of file gvec.hpp.

◆ gvec_distr_

mpi::block_data_descriptor sirius::fft::Gvec::gvec_distr_
private

Fine-grained distribution of G-vectors.

Definition at line 190 of file gvec.hpp.

◆ zcol_distr_

mpi::block_data_descriptor sirius::fft::Gvec::zcol_distr_
private

Fine-grained distribution of z-columns.

Definition at line 193 of file gvec.hpp.

◆ gvec_base_

Gvec const* sirius::fft::Gvec::gvec_base_ {nullptr}
private

Set of G-vectors on which the current G-vector distribution can be based.

This can be used to establish a local mapping between coarse and fine G-vector sets without MPI communication.

Definition at line 198 of file gvec.hpp.

◆ gvec_base_mapping_

sddk::mdarray<int, 1> sirius::fft::Gvec::gvec_base_mapping_
private

Mapping between current and base G-vector sets.

This mapping allows for a local-to-local copy of PW coefficients without any MPI communication.

Example:

// Copy from a coarse G-vector set.
for (int igloc = 0; igloc < ctx_.gvec_coarse().count(); igloc++) {
rho_vec_[j]->f_pw_local(ctx_.gvec().gvec_base_mapping(igloc)) = rho_mag_coarse_[j]->f_pw_local(igloc);
}
int count() const
Number of G-vectors for a fine-grained distribution for the current MPI rank.
Definition: gvec.hpp:506

Definition at line 211 of file gvec.hpp.

◆ gvec_

sddk::mdarray<int, 2> sirius::fft::Gvec::gvec_
private

Lattice coordinates of a local set of G-vectors.

This are also known as Miller indices

Definition at line 215 of file gvec.hpp.

◆ gkvec_

sddk::mdarray<double, 2> sirius::fft::Gvec::gkvec_
private

Lattice coordinates of a local set of G+k-vectors.

Definition at line 218 of file gvec.hpp.

◆ gvec_cart_

sddk::mdarray<double, 2> sirius::fft::Gvec::gvec_cart_
private

Cartiesian coordinaes of a local set of G-vectors.

Definition at line 221 of file gvec.hpp.

◆ gkvec_cart_

sddk::mdarray<double, 2> sirius::fft::Gvec::gkvec_cart_
private

Cartesian coordinaes of a local set of G+k-vectors.

Definition at line 224 of file gvec.hpp.

◆ gvec_len_

sddk::mdarray<double, 1> sirius::fft::Gvec::gvec_len_
private

Length of the local fraction of G-vectors.

Definition at line 227 of file gvec.hpp.

◆ gvec_tp_

sddk::mdarray<double, 2> sirius::fft::Gvec::gvec_tp_
private

Definition at line 230 of file gvec.hpp.

◆ gkvec_tp_

sddk::mdarray<double, 2> sirius::fft::Gvec::gkvec_tp_
private

Definition at line 233 of file gvec.hpp.

◆ offset_

int sirius::fft::Gvec::offset_ {-1}
private

Offset in the global index for the local part of G-vectors.

Definition at line 236 of file gvec.hpp.

◆ count_

int sirius::fft::Gvec::count_ {-1}
private

Local number of G-vectors.

Definition at line 239 of file gvec.hpp.

◆ num_zcol_local_

int sirius::fft::Gvec::num_zcol_local_ {-1}
private

Local number of z-columns.

Definition at line 242 of file gvec.hpp.

◆ sym_tol_

double sirius::fft::Gvec::sym_tol_ {1e-6}
private

Symmetry tolerance of the real-space lattice.

Definition at line 245 of file gvec.hpp.


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