25#ifndef __MAKE_PERIODIC_FUNCTION_HPP__
26#define __MAKE_PERIODIC_FUNCTION_HPP__
32template <index_domain_t index_domain,
typename F>
35 sddk::mdarray<std::complex<double>, 2>
const& phase_factors_t__, F&& form_factors__)
37 PROFILE(
"sirius::make_periodic_function");
45 #pragma omp parallel for schedule(static)
46 for (
int igloc = 0; igloc < gv__.
count(); igloc++) {
48 const int ig = gv__.
offset() + igloc;
53 f_pw[j] += fourpi_omega *
std::conj(phase_factors_t__(igloc, iat)) * form_factors__(iat, g);
65template <index_domain_t index_domain>
68 sddk::mdarray<std::complex<double>, 2>
const& phase_factors_t__,
71 PROFILE(
"sirius::make_periodic_function");
79 #pragma omp parallel for schedule(static)
80 for (
int igloc = 0; igloc < gv__.
count(); igloc++) {
82 const int ig = gv__.
offset() + igloc;
83 const int igsh = gv__.
shell(ig);
87 f_pw[j] += fourpi_omega *
std::conj(phase_factors_t__(igloc, iat)) * form_factors__(igsh, iat);
Representation of a unit cell.
double omega() const
Unit cell volume.
int num_atom_types() const
Number of atom types.
A set of G-vectors for FFTs and G+k basis functions.
double gvec_len(int ig__) const
Return length of the G-vector.
int num_gvec() const
Return the total number of G-vectors within the cutoff.
int offset() const
Offset (in the global index) of G-vectors for a fine-grained distribution for a current MPI rank.
int count() const
Number of G-vectors for a fine-grained distribution for the current MPI rank.
int shell(int ig__) const
Return index of the G-vector shell by the G-vector index.
void allgather(T *buffer__, int const *recvcounts__, int const *displs__) const
In-place MPI_Allgatherv.
Multidimensional array with the column-major (Fortran) order.
void zero(memory_t mem__, size_t idx0__, size_t n__)
Zero n elements starting from idx0.
Namespace of the SIRIUS library.
auto make_periodic_function(Unit_cell const &uc__, fft::Gvec const &gv__, sddk::mdarray< std::complex< double >, 2 > const &phase_factors_t__, F &&form_factors__)
Make periodic function out of form factors.
auto conj(double x__)
Return complex conjugate of a number. For a real value this is the number itself.