Skip to content

Commit

Permalink
remove GlobalV::NSPIN
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Oct 11, 2024
1 parent 7cc0cd5 commit c89ebdc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void Force_LCAO<double>::ftable(const bool isforce,
const double* dSxy[6] = { fsr.DSloc_11, fsr.DSloc_12, fsr.DSloc_13, fsr.DSloc_22, fsr.DSloc_23, fsr.DSloc_33 };
// calculate the force related to 'energy density matrix'.
PulayForceStress::cal_pulay_fs(foverlap, soverlap,
this->cal_edm(pelec, *psi, *dm, *kv, pv, GlobalV::NSPIN, GlobalV::NBANDS, ucell, *ra),
this->cal_edm(pelec, *psi, *dm, *kv, pv, PARAM.inp.nspin, PARAM.inp.nbands, ucell, *ra),
ucell, pv, dSx, dSxy, isforce, isstress);

const double* dHx[3] = { fsr.DHloc_fixed_x, fsr.DHloc_fixed_y, fsr.DHloc_fixed_z };
Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void Force_LCAO<std::complex<double>>::ftable(const bool isforce,
// calculate the energy density matrix
// and the force related to overlap matrix and energy density matrix.
PulayForceStress::cal_pulay_fs(foverlap, soverlap,
this->cal_edm(pelec, *psi, *dm, *kv, pv, GlobalV::NSPIN, GlobalV::NBANDS, ucell, *ra),
this->cal_edm(pelec, *psi, *dm, *kv, pv, PARAM.inp.nspin, PARAM.inp.nbands, ucell, *ra),
ucell, pv, dSx, fsr.DH_r, isforce, isstress, ra, -1.0, 1.0);

const double* dHx[3] = { fsr.DHloc_fixedR_x, fsr.DHloc_fixedR_y, fsr.DHloc_fixedR_z }; // T+Vnl
Expand Down
1 change: 1 addition & 0 deletions source/module_hamilt_lcao/hamilt_lcaodft/edm.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "FORCE.h"
#include "module_elecstate/module_dm/cal_dm_psi.h"
#include "module_base/memory.h"
#include "module_parameter/parameter.h"
template<>
elecstate::DensityMatrix<double, double> Force_LCAO<double>::cal_edm(const elecstate::ElecState* pelec,
const psi::Psi<double>& psi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace PulayForceStress
ModuleBase::TITLE("Force_LCAO", "cal_pulay_fs_center2");
ModuleBase::timer::tick("Force_LCAO", "cal_pulay_fs_center2");

const int nspin = GlobalV::NSPIN;
const int nlocal = GlobalV::NLOCAL;
const int nspin = PARAM.inp.nspin;
const int nlocal = PARAM.globalv.nlocal;

for (int i = 0; i < nlocal; ++i)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "pulay_force_stress.h"
#include "module_base/timer.h"
#include "module_parameter/parameter.h"
namespace PulayForceStress
{
// common kernel
Expand All @@ -24,7 +25,7 @@ namespace PulayForceStress
ModuleBase::TITLE("Force_LCAO", "cal_pulay_fs_center2");
ModuleBase::timer::tick("Force_LCAO", "cal_pulay_fs_center2");

const int nspin_DMR = (GlobalV::NSPIN == 2) ? 2 : 1;
const int nspin_DMR = (PARAM.inp.nspin == 2) ? 2 : 1;
int total_irr = 0;
#ifdef _OPENMP
#pragma omp parallel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "pulay_force_stress.h"
#include "module_hamilt_lcao/hamilt_lcaodft/stress_tools.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#include "module_parameter/parameter.h"
namespace PulayForceStress
{
template<typename TK, typename TR>
Expand All @@ -17,7 +18,7 @@ namespace PulayForceStress
const bool& set_dmr_gint)
{
if (set_dmr_gint) { gint.transfer_DM2DtoGrid(dm.get_DMR_vector()); } // 2d block to grid
const int nspin = GlobalV::NSPIN;
const int nspin = PARAM.inp.nspin;
for (int is = 0; is < nspin; ++is)
{
const double* vr_eff1 = pot->get_effective_v(is);
Expand Down

0 comments on commit c89ebdc

Please sign in to comment.