@@ -15,7 +15,11 @@ Magnetism::~Magnetism()
1515 delete[] this ->start_magnetization ;
1616}
1717
18- void Magnetism::compute_magnetization (const int & nrxx, const int & nxyz, const double * const * rho, double * nelec_spin)
18+ void Magnetism::compute_magnetization (const double omega,
19+ const int & nrxx,
20+ const int & nxyz,
21+ const double * const * rho,
22+ double * nelec_spin)
1923{
2024 if (PARAM.inp .nspin ==2 )
2125 {
@@ -32,8 +36,8 @@ void Magnetism::compute_magnetization(const int& nrxx, const int& nxyz, const do
3236 Parallel_Reduce::reduce_pool (this ->tot_magnetization );
3337 Parallel_Reduce::reduce_pool (this ->abs_magnetization );
3438#endif
35- this ->tot_magnetization *= elecstate::get_ucell_omega () / nxyz;
36- this ->abs_magnetization *= elecstate::get_ucell_omega () / nxyz;
39+ this ->tot_magnetization *= omega / nxyz;
40+ this ->abs_magnetization *= omega / nxyz;
3741
3842 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running," total magnetism (Bohr mag/cell)" ,this ->tot_magnetization );
3943 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running," absolute magnetism (Bohr mag/cell)" ,this ->abs_magnetization );
@@ -65,8 +69,8 @@ void Magnetism::compute_magnetization(const int& nrxx, const int& nxyz, const do
6569 Parallel_Reduce::reduce_pool (this ->tot_magnetization_nc , 3 );
6670 Parallel_Reduce::reduce_pool (this ->abs_magnetization );
6771#endif
68- for (int i=0 ;i<3 ;i++)this ->tot_magnetization_nc [i] *= elecstate::get_ucell_omega () / nxyz;
69- this ->abs_magnetization *= elecstate::get_ucell_omega () / nxyz;
72+ for (int i=0 ;i<3 ;i++)this ->tot_magnetization_nc [i] *= omega / nxyz;
73+ this ->abs_magnetization *= omega / nxyz;
7074 GlobalV::ofs_running<<" total magnetism (Bohr mag/cell)" <<' \t ' <<this ->tot_magnetization_nc [0 ]<<' \t ' <<this ->tot_magnetization_nc [1 ]<<' \t ' <<this ->tot_magnetization_nc [2 ]<<' \n ' ;
7175 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running," absolute magnetism (Bohr mag/cell)" ,this ->abs_magnetization );
7276 }
0 commit comments