Skip to content

Commit b0113a1

Browse files
committed
remove GlobalV::NSPIN
1 parent c1d11ed commit b0113a1

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void Force_LCAO<double>::ftable(const bool isforce,
220220
const double* dSxy[6] = { fsr.DSloc_11, fsr.DSloc_12, fsr.DSloc_13, fsr.DSloc_22, fsr.DSloc_23, fsr.DSloc_33 };
221221
// calculate the force related to 'energy density matrix'.
222222
PulayForceStress::cal_pulay_fs(foverlap, soverlap,
223-
this->cal_edm(pelec, *psi, *dm, *kv, pv, GlobalV::NSPIN, GlobalV::NBANDS, ucell, *ra),
223+
this->cal_edm(pelec, *psi, *dm, *kv, pv, PARAM.inp.nspin, GlobalV::NBANDS, ucell, *ra),
224224
ucell, pv, dSx, dSxy, isforce, isstress);
225225

226226
const double* dHx[3] = { fsr.DHloc_fixed_x, fsr.DHloc_fixed_y, fsr.DHloc_fixed_z };

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void Force_LCAO<std::complex<double>>::ftable(const bool isforce,
317317
// calculate the energy density matrix
318318
// and the force related to overlap matrix and energy density matrix.
319319
PulayForceStress::cal_pulay_fs(foverlap, soverlap,
320-
this->cal_edm(pelec, *psi, *dm, *kv, pv, GlobalV::NSPIN, GlobalV::NBANDS, ucell, *ra),
320+
this->cal_edm(pelec, *psi, *dm, *kv, pv, PARAM.inp.nspin, GlobalV::NBANDS, ucell, *ra),
321321
ucell, pv, dSx, fsr.DH_r, isforce, isstress, ra, -1.0, 1.0);
322322

323323
const double* dHx[3] = { fsr.DHloc_fixedR_x, fsr.DHloc_fixedR_y, fsr.DHloc_fixedR_z }; // T+Vnl

source/module_hamilt_lcao/hamilt_lcaodft/edm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "FORCE.h"
22
#include "module_elecstate/module_dm/cal_dm_psi.h"
33
#include "module_base/memory.h"
4+
#include "module_parameter/parameters.h"
45
template<>
56
elecstate::DensityMatrix<double, double> Force_LCAO<double>::cal_edm(const elecstate::ElecState* pelec,
67
const psi::Psi<double>& psi,

source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace PulayForceStress
1919
ModuleBase::TITLE("Force_LCAO", "cal_pulay_fs_center2");
2020
ModuleBase::timer::tick("Force_LCAO", "cal_pulay_fs_center2");
2121

22-
const int nspin = GlobalV::NSPIN;
22+
const int nspin = PARAM.inp.nspin;
2323
const int nlocal = GlobalV::NLOCAL;
2424

2525
for (int i = 0; i < nlocal; ++i)

source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_center2_template.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include "pulay_force_stress.h"
33
#include "module_base/timer.h"
4+
#include "module_parameter/parameter.h"
45
namespace PulayForceStress
56
{
67
// common kernel
@@ -24,7 +25,7 @@ namespace PulayForceStress
2425
ModuleBase::TITLE("Force_LCAO", "cal_pulay_fs_center2");
2526
ModuleBase::timer::tick("Force_LCAO", "cal_pulay_fs_center2");
2627

27-
const int nspin_DMR = (GlobalV::NSPIN == 2) ? 2 : 1;
28+
const int nspin_DMR = (PARAM.inp.nspin == 2) ? 2 : 1;
2829
int total_irr = 0;
2930
#ifdef _OPENMP
3031
#pragma omp parallel

source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_gint.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "pulay_force_stress.h"
33
#include "module_hamilt_lcao/hamilt_lcaodft/stress_tools.h"
44
#include "module_hamilt_general/module_xc/xc_functional.h"
5+
#include "module_parameter/parameter.h"
56
namespace PulayForceStress
67
{
78
template<typename TK, typename TR>
@@ -17,7 +18,7 @@ namespace PulayForceStress
1718
const bool& set_dmr_gint)
1819
{
1920
if (set_dmr_gint) { gint.transfer_DM2DtoGrid(dm.get_DMR_vector()); } // 2d block to grid
20-
const int nspin = GlobalV::NSPIN;
21+
const int nspin = PARAM.inp.nspin;
2122
for (int is = 0; is < nspin; ++is)
2223
{
2324
const double* vr_eff1 = pot->get_effective_v(is);

0 commit comments

Comments
 (0)