Skip to content

Commit

Permalink
Merge branch 'mdp' of github.com:YuLiu98/abacus-develop into mdp
Browse files Browse the repository at this point in the history
  • Loading branch information
YuLiu98 committed Jul 28, 2024
2 parents 1de5d46 + 2b102dc commit 4052334
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions source/module_md/langevin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void Langevin::first_half(std::ofstream& ofs)
}


void Langevin::second_half(void)
void Langevin::second_half()
{
ModuleBase::TITLE("Langevin", "second_half");
ModuleBase::timer::tick("Langevin", "second_half");
Expand Down Expand Up @@ -83,7 +83,7 @@ void Langevin::restart(const std::string& global_readin_dir)
}


void Langevin::post_force(void)
void Langevin::post_force()
{
if (my_rank == 0)
{
Expand Down
20 changes: 13 additions & 7 deletions source/module_md/md_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace MD_func
{

double gaussrand(void)
double gaussrand()
{
static double v1=0.0;
static double v2=0.0;
Expand Down Expand Up @@ -83,12 +83,15 @@ void read_vel(const UnitCell& unit_in, ModuleBase::Vector3<double>* vel)
for (int ia = 0; ia < unit_in.atoms[it].na; ++ia)
{
vel[iat] = unit_in.atoms[it].vel[ia];
if (unit_in.atoms[it].mbl[ia].x == 0)
if (unit_in.atoms[it].mbl[ia].x == 0) {
vel[iat].x = 0;
if (unit_in.atoms[it].mbl[ia].y == 0)
}
if (unit_in.atoms[it].mbl[ia].y == 0) {
vel[iat].y = 0;
if (unit_in.atoms[it].mbl[ia].z == 0)
}
if (unit_in.atoms[it].mbl[ia].z == 0) {
vel[iat].z = 0;
}
++iat;
}
}
Expand Down Expand Up @@ -407,12 +410,15 @@ void get_mass_mbl(const UnitCell& unit_in,
{
allmass[ion] = unit_in.atoms[it].mass / ModuleBase::AU_to_MASS;
ionmbl[ion] = unit_in.atoms[it].mbl[i];
if (ionmbl[ion].x == 0)
if (ionmbl[ion].x == 0) {
++frozen.x;
if (ionmbl[ion].y == 0)
}
if (ionmbl[ion].y == 0) {
++frozen.y;
if (ionmbl[ion].z == 0)
}
if (ionmbl[ion].z == 0) {
++frozen.z;
}

ion++;
}
Expand Down

0 comments on commit 4052334

Please sign in to comment.