Skip to content

Commit

Permalink
oh, my NQX and DQ are lost!
Browse files Browse the repository at this point in the history
  • Loading branch information
kirk0830 committed Sep 20, 2024
1 parent 4e65938 commit 2763c47
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source/module_psi/psi_initializer_nao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#endif
#include "module_parameter/parameter.h"
#include "module_io/orb_io.h"
// GlobalV::NQX and GlobalV::DQ are here
#include "module_parameter/parameter.h"

#include <numeric>
#include <algorithm>
Expand Down Expand Up @@ -212,9 +214,9 @@ void psi_initializer_nao<T, Device>::tabulate()
ModuleBase::timer::tick("psi_initializer_nao", "tabulate");

// a uniformed qgrid
std::vector<double> qgrid(GlobalV::NQX);
std::vector<double> qgrid(PARAM.globalv.nqx);
std::iota(qgrid.begin(), qgrid.end(), 0);
std::for_each(qgrid.begin(), qgrid.end(), [this](double& q) { q = q * GlobalV::DQ; });
std::for_each(qgrid.begin(), qgrid.end(), [this](double& q) { q = q * PARAM.globalv.dq; });

// only when needed, allocate memory for cubspl_
if (this->cubspl_.get()) { this->cubspl_.reset(); }
Expand All @@ -234,7 +236,7 @@ void psi_initializer_nao<T, Device>::tabulate()
ModuleBase::SphericalBesselTransformer sbt_(true); // bool: enable cache

// tabulate the spherical bessel transform of numerical orbital function
std::vector<double> Jlfq(GlobalV::NQX, 0.0);
std::vector<double> Jlfq(PARAM.globalv.nqx, 0.0);
int i = 0;
for (int it = 0; it < this->p_ucell_->ntype; it++)
{
Expand All @@ -247,7 +249,7 @@ void psi_initializer_nao<T, Device>::tabulate()
this->nr_[it][ic],
this->rgrid_[it][ic].data(),
this->chi_[it][ic].data(),
GlobalV::NQX,
PARAM.globalv.nqx,
qgrid.data(),
Jlfq.data());
this->cubspl_->add(Jlfq.data());
Expand Down

0 comments on commit 2763c47

Please sign in to comment.