Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Jul 9, 2024
1 parent 986d12a commit 009384c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
27 changes: 18 additions & 9 deletions source/module_io/input_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ void Input_Conv::parse_expression(const std::string& fn, std::vector<T>& vec)
// const std::vector<double>::iterator dest = vec.begin() + count;
// copy(ocp_temp.begin(), ocp_temp.end(), dest);
// count += num;
for (size_t k = 0; k != num; k++)
for (size_t k = 0; k != num; k++) {
vec.emplace_back(occ);
}
}
else
{
Expand Down Expand Up @@ -297,12 +298,15 @@ void Input_Conv::Convert()
GlobalV::stru_file = INPUT.stru_file;
}
GlobalV::global_wannier_card = INPUT.wannier_card;
if (INPUT.kpoint_file != "")
if (INPUT.kpoint_file != "") {
GlobalV::global_kpoint_card = INPUT.kpoint_file;
if (INPUT.pseudo_dir != "")
}
if (INPUT.pseudo_dir != "") {
GlobalV::global_pseudo_dir = INPUT.pseudo_dir + "/";
if (INPUT.orbital_dir != "")
}
if (INPUT.orbital_dir != "") {
GlobalV::global_orbital_dir = INPUT.orbital_dir + "/";
}
// GlobalV::global_pseudo_type = INPUT.pseudo_type;
GlobalC::ucell.setup(INPUT.latname, INPUT.ntype, INPUT.lmaxmax, INPUT.init_vel, INPUT.fixed_axes);

Expand Down Expand Up @@ -684,8 +688,9 @@ void Input_Conv::Convert()
Exx_Abfs::Jle::tolerence = PARAM.inp.exx_opt_orb_tolerence;

// EXX does not support symmetry=1
if (INPUT.calculation != "nscf" && PARAM.inp.symmetry == "1")
if (INPUT.calculation != "nscf" && PARAM.inp.symmetry == "1") {
ModuleSymmetry::Symmetry::symm_flag = 0;
}
}
#endif // __LCAO
#endif // __EXX
Expand Down Expand Up @@ -809,15 +814,19 @@ void Input_Conv::Convert()
{
GlobalV::deepks_out_labels = true;
GlobalV::deepks_scf = true;
if (GlobalV::NPROC > 1)
if (GlobalV::NPROC > 1) {
ModuleBase::WARNING_QUIT("Input_conv", "generate deepks unittest with only 1 processor");
if (GlobalV::CAL_FORCE != 1)
}
if (GlobalV::CAL_FORCE != 1) {
ModuleBase::WARNING_QUIT("Input_conv", "force is required in generating deepks unittest");
if (GlobalV::CAL_STRESS != 1)
}
if (GlobalV::CAL_STRESS != 1) {
ModuleBase::WARNING_QUIT("Input_conv", "stress is required in generating deepks unittest");
}
}
if (GlobalV::deepks_scf || GlobalV::deepks_out_labels)
if (GlobalV::deepks_scf || GlobalV::deepks_out_labels) {
GlobalV::deepks_setorb = true;
}
#else
if (PARAM.inp.deepks_scf || PARAM.inp.deepks_out_labels || PARAM.inp.deepks_bandgap)
{
Expand Down
3 changes: 2 additions & 1 deletion source/module_io/test/for_testing_input_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ wavefunc::~wavefunc()
}
UnitCell::UnitCell()
{
if (GlobalV::test_unitcell)
if (GlobalV::test_unitcell) {
ModuleBase::TITLE("unitcell", "Constructor");
}
Coordinate = "Direct";
latName = "none";
lat0 = 0.0;
Expand Down
5 changes: 3 additions & 2 deletions source/module_io/write_dos_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ void ModuleIO::write_dos_lcao(const psi::Psi<double>* psi,

out << "<pdos>" << std::endl;
out << "<nspin>" << GlobalV::NSPIN << "</nspin>" << std::endl;
if (GlobalV::NSPIN == 4)
if (GlobalV::NSPIN == 4) {
out << "<norbitals>" << std::setw(2) << GlobalV::NLOCAL / 2 << "</norbitals>" << std::endl;
else
} else {
out << "<norbitals>" << std::setw(2) << GlobalV::NLOCAL << "</norbitals>" << std::endl;
}
out << "<energy_values units=\"eV\">" << std::endl;

for (int n = 0; n < npoints; ++n)
Expand Down

0 comments on commit 009384c

Please sign in to comment.