Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions source/module_basis/module_nao/two_center_bundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void TwoCenterBundle::tabulate()
{
ModuleBase::SphericalBesselTransformer sbt(true);
orb_->set_transformer(sbt);
beta_->set_transformer(sbt);
if (beta_) { beta_->set_transformer(sbt); }
if (alpha_) {
alpha_->set_transformer(sbt);
}
Expand All @@ -75,22 +75,17 @@ void TwoCenterBundle::tabulate()
// build two-center integration tables
//================================================================
// set up a universal radial grid
double rmax = std::max(orb_->rcut_max(), beta_->rcut_max());
if (alpha_) {
rmax = std::max(rmax, alpha_->rcut_max());
}
double rmax = orb_->rcut_max();
if (beta_) { rmax = std::max(rmax, beta_->rcut_max()); }
if (alpha_) { rmax = std::max(rmax, alpha_->rcut_max()); }
double dr = 0.01;
double cutoff = 2.0 * rmax;
int nr = static_cast<int>(rmax / dr) + 1;

orb_->set_uniform_grid(true, nr, cutoff, 'i', true);
beta_->set_uniform_grid(true, nr, cutoff, 'i', true);
if (alpha_) {
alpha_->set_uniform_grid(true, nr, cutoff, 'i', true);
}
if (orb_onsite_) {
orb_onsite_->set_uniform_grid(true, nr, cutoff, 'i', true);
}
if (beta_) { beta_->set_uniform_grid(true, nr, cutoff, 'i', true); }
if (alpha_) { alpha_->set_uniform_grid(true, nr, cutoff, 'i', true);}
if (orb_onsite_) { orb_onsite_->set_uniform_grid(true, nr, cutoff, 'i', true);}

// build TwoCenterIntegrator objects
kinetic_orb = std::unique_ptr<TwoCenterIntegrator>(new TwoCenterIntegrator);
Expand All @@ -101,9 +96,12 @@ void TwoCenterBundle::tabulate()
overlap_orb->tabulate(*orb_, *orb_, 'S', nr, cutoff);
ModuleBase::Memory::record("TwoCenterTable: Overlap", overlap_orb->table_memory());

overlap_orb_beta = std::unique_ptr<TwoCenterIntegrator>(new TwoCenterIntegrator);
overlap_orb_beta->tabulate(*orb_, *beta_, 'S', nr, cutoff);
ModuleBase::Memory::record("TwoCenterTable: Nonlocal", overlap_orb_beta->table_memory());
if (beta_)
{
overlap_orb_beta = std::unique_ptr<TwoCenterIntegrator>(new TwoCenterIntegrator);
overlap_orb_beta->tabulate(*orb_, *beta_, 'S', nr, cutoff);
ModuleBase::Memory::record("TwoCenterTable: Nonlocal", overlap_orb_beta->table_memory());
}

if (alpha_)
{
Expand Down
8 changes: 5 additions & 3 deletions source/module_hamilt_lcao/hamilt_lcaodft/LCAO_init_basis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ void init_basis_lcao(Parallel_Orbitals& pv,
// on the old interface for now.
two_center_bundle.to_LCAO_Orbitals(orb, lcao_ecut, lcao_dk, lcao_dr, lcao_rmax);

ucell.infoNL.setupNonlocal(ucell.ntype, ucell.atoms, GlobalV::ofs_running, orb);

two_center_bundle.build_beta(ucell.ntype, ucell.infoNL.Beta);
if (PARAM.inp.vnl_in_h)
{
ucell.infoNL.setupNonlocal(ucell.ntype, ucell.atoms, GlobalV::ofs_running, orb);
two_center_bundle.build_beta(ucell.ntype, ucell.infoNL.Beta);
}

int Lmax = 0;
#ifdef __EXX
Expand Down
Loading