Skip to content

Commit d30a434

Browse files
author
dyzheng
committed
Fix: nspin2 error
1 parent f7dbc92 commit d30a434

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

source/module_elecstate/module_dm/density_matrix.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,6 @@ void DensityMatrix<std::complex<double>, double>::cal_DMR_full(hamilt::HContaine
614614
// get global indexes of whole matrix for each atom in this process
615615
int row_ap = this->_paraV->atom_begin_row[iat1];
616616
int col_ap = this->_paraV->atom_begin_col[iat2];
617-
if (row_ap == -1 || col_ap == -1)
618-
{
619-
throw std::string("Atom-pair not belong this process");
620-
}
621617
for (int ir = 0; ir < tmp_ap.get_R_size(); ++ir)
622618
{
623619
const ModuleBase::Vector3<int> r_index = tmp_ap.get_R_index(ir);

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void Force_Stress_LCAO<T>::getForceStress(const bool isforce,
185185
const auto* dm_p = dynamic_cast<const elecstate::ElecStateLCAO<T>*>(pelec)->get_DM();
186186
if(GlobalV::NSPIN==2)
187187
{
188-
const_cast<elecstate::DensityMatrix<T, double>*>(dm_p)->switch_dmr(2);
188+
const_cast<elecstate::DensityMatrix<T, double>*>(dm_p)->switch_dmr(1);
189189
}
190190
const hamilt::HContainer<double>* dmr = dm_p->get_DMR_pointer(1);
191191
tmp_nonlocal.cal_force_stress(isforce, isstress, dmr, fvnl_dbeta, svnl_dbeta);

0 commit comments

Comments
 (0)