25#ifndef __CHECK_GVEC_HPP__
26#define __CHECK_GVEC_HPP__
32inline void check_gvec(fft::Gvec
const& gvec__, Crystal_symmetry
const& sym__)
34 PROFILE(
"sirius::check_gvec");
36 #pragma omp parallel for
37 for (
int isym = 0; isym < sym__.size(); isym++) {
38 auto sm = sym__[isym].spg_op.R;
40 for (
int igloc = 0; igloc < gvec__.count(); igloc++) {
43 auto gv_rot = dot(gv, sm);
66 int ig_rot = gvec__.index_by_gvec(gv_rot);
68 if (gvec__.reduced() && ig_rot < 0) {
69 gv_rot = gv_rot * (-1);
70 ig_rot = gvec__.index_by_gvec(gv_rot);
72 if (ig_rot < 0 || ig_rot >= gvec__.num_gvec()) {
74 s <<
"rotated G-vector index is wrong" << std::endl
75 <<
"original G-vector: " << gv << std::endl
76 <<
"rotation matrix: " << std::endl
78 <<
"rotated G-vector: " << gv_rot << std::endl
79 <<
"rotated G-vector index: " << ig_rot << std::endl
80 <<
"number of G-vectors: " << gvec__.num_gvec();
87inline void check_gvec(fft::Gvec_shells
const& gvec_shells__, Crystal_symmetry
const& sym__)
90 for (
int igloc = 0; igloc < gvec_shells__.gvec_count_remapped(); igloc++) {
91 auto G = gvec_shells__.gvec_remapped(igloc);
93 for (
int i = 0; i < sym__.size(); i++) {
94 auto& invRT = sym__[i].spg_op.invRT;
95 auto gv_rot = dot(invRT, G);
98 int ig_rot = gvec_shells__.index_by_gvec(gv_rot);
101 gv_rot = gv_rot * (-1);
102 ig_rot = gvec_shells__.index_by_gvec(gv_rot);
105 s <<
"Failed to find a rotated G-vector in the list" << std::endl
106 <<
" local index of original vector: " << igloc << std::endl
107 <<
" global index of G-shell: " << gvec_shells__.gvec_shell_remapped(igloc) << std::endl
108 <<
" original G-vector: " << G << std::endl
109 <<
" rotated G-vector: " << gv_rot;
113 if (ig_rot >= gvec_shells__.gvec_count_remapped()) {
115 s <<
"G-vector index is above the boundary";
Contains definition and partial implementation of sirius::Crystal_symmetry class.
Namespace of the SIRIUS library.