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
4 changes: 2 additions & 2 deletions source/module_esolver/esolver_dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ void ESolver_DP::cal_stress(UnitCell& ucell, ModuleBase::matrix& stress)
{
stress = dp_virial;

ModuleIO::print_stress("TOTAL-STRESS", stress, true, false);

// external stress
double unit_transform = ModuleBase::RYDBERG_SI / pow(ModuleBase::BOHR_RADIUS_SI, 3) * 1.0e-8;
double external_stress[3] = {PARAM.inp.press1, PARAM.inp.press2, PARAM.inp.press3};
for (int i = 0; i < 3; i++)
{
stress(i, i) -= external_stress[i] / unit_transform;
}

ModuleIO::print_stress("TOTAL-STRESS", stress, true, false);
}

void ESolver_DP::after_all_runners(UnitCell& ucell)
Expand Down
6 changes: 0 additions & 6 deletions source/module_esolver/esolver_gets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ void ESolver_GetS::before_all_runners(UnitCell& ucell, const Input_para& inp)
two_center_bundle_,
orb_);

// 4) initialize the density matrix
// DensityMatrix is allocated here, DMK is also initialized here
// DMR is not initialized here, it will be constructed in each before_scf
dynamic_cast<elecstate::ElecStateLCAO<std::complex<double>>*>(this->pelec)
->init_DM(&this->kv, &(this->pv), inp.nspin);

ModuleBase::timer::tick("ESolver_GetS", "before_all_runners");
}

Expand Down
4 changes: 2 additions & 2 deletions source/module_esolver/esolver_lj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ void ESolver_LJ::runner(UnitCell& ucell, const int istep)
{
stress = lj_virial;

ModuleIO::print_stress("TOTAL-STRESS", stress, true, false);

// external stress
double unit_transform = ModuleBase::RYDBERG_SI / pow(ModuleBase::BOHR_RADIUS_SI, 3) * 1.0e-8;
double external_stress[3] = {PARAM.inp.press1, PARAM.inp.press2, PARAM.inp.press3};
for (int i = 0; i < 3; i++)
{
stress(i, i) -= external_stress[i] / unit_transform;
}

ModuleIO::print_stress("TOTAL-STRESS", stress, true, false);
}

void ESolver_LJ::after_all_runners(UnitCell& ucell)
Expand Down
Loading