11#include " module_base/grid/delley.h"
22
3+ #include < functional>
34#include < algorithm>
45#include < cmath>
56#include < cassert>
67
78namespace {
89
9- struct Table {
10+ struct DelleyTable {
1011 const int lmax_;
1112 const int ngrid_;
1213 const int ntype_[6 ];
1314 const std::vector<double > data_;
1415};
1516
1617// Delley's table from the original article
17- const std::vector<Table> table = {
18+ const std::vector<DelleyTable> delley_table = {
1819 {
1920 17 , 110 , {1 , 1 , 0 , 3 , 1 , 0 },
2021 {
@@ -209,7 +210,7 @@ const std::vector<Table> table = {
209210 0.63942796347491023 , 0.06424549224220589 , 0.0009158016174693465 ,
210211 }
211212 }
212- }; // end of the definition of "table "
213+ }; // end of the definition of "delley_table "
213214
214215// size of each group of points with octahedral symmetry
215216// 6: (1, 0, 0) x sign x permutation (vertices)
@@ -324,15 +325,15 @@ const std::vector<Fill_t> fill = {
324325 },
325326}; // end of the definition of "fill"
326327
327- const Table* _find_table (int & lmax) {
328- // NOTE: this function assumes elements in "Delley::table_ " are
328+ const DelleyTable* _find_delley (int & lmax) {
329+ // NOTE: this function assumes elements in "delley_table " are
329330 // arranged such that their members "lmax_" are in ascending order.
330- auto tab = std::find_if (table .begin (), table .end (),
331- [lmax](const Table & t) { return t.lmax_ >= lmax; });
332- return tab == table .end () ? nullptr : (lmax = tab->lmax_ , &(*tab));
331+ auto tab = std::find_if (delley_table .begin (), delley_table .end (),
332+ [lmax](const DelleyTable & t) { return t.lmax_ >= lmax; });
333+ return tab == delley_table .end () ? nullptr : (lmax = tab->lmax_ , &(*tab));
333334}
334335
335- void _get (const Table * tab, double * grid, double * weight) {
336+ void _delley (const DelleyTable * tab, double * grid, double * weight) {
336337 assert (tab);
337338 const double * ptr = &tab->data_ [0 ];
338339 for (int itype = 0 ; itype < 6 ; ++itype) {
@@ -348,29 +349,29 @@ void _get(const Table* tab, double* grid, double* weight) {
348349} // end of anonymous namespace
349350
350351
351- int Grid::Delley::ngrid (int & lmax) {
352- auto tab = _find_table (lmax);
352+ int Grid::Angular::ngrid_delley (int & lmax) {
353+ auto tab = _find_delley (lmax);
353354 return tab ? tab->ngrid_ : -1 ;
354355}
355356
356357
357- int Grid::Delley::get (int & lmax, double * grid, double * weight) {
358- auto tab = _find_table (lmax);
359- return tab ? _get (tab, grid, weight), 0 : -1 ;
358+ int Grid::Angular::delley (int & lmax, double * grid, double * weight) {
359+ auto tab = _find_delley (lmax);
360+ return tab ? _delley (tab, grid, weight), 0 : -1 ;
360361}
361362
362363
363- int Grid::Delley::get (
364+ int Grid::Angular::delley (
364365 int & lmax,
365366 std::vector<double >& grid,
366367 std::vector<double >& weight
367368) {
368- auto tab = _find_table (lmax);
369+ auto tab = _find_delley (lmax);
369370 if (!tab) {
370371 return -1 ;
371372 }
372373 grid.resize (3 * tab->ngrid_ );
373374 weight.resize (tab->ngrid_ );
374- _get (tab, grid.data (), weight.data ());
375+ _delley (tab, grid.data (), weight.data ());
375376 return 0 ;
376377}
0 commit comments