Skip to content

Commit

Permalink
reside WCs on their corresponding real atoms in pre_exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi-FanLi committed Aug 29, 2024
1 parent 54b53df commit 7cbcb79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions source/lmp/fix_dplr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ int FixDPLR::setmask() {
// THERMO_ENERGY removed in lammps/lammps#2560
mask |= THERMO_ENERGY;
#endif
mask |= POST_INTEGRATE;
mask |= PRE_EXCHANGE;
mask |= PRE_FORCE;
mask |= POST_FORCE;
mask |= MIN_PRE_EXCHANGE;
Expand Down Expand Up @@ -301,7 +301,11 @@ void FixDPLR::init() {
}
}

void FixDPLR::setup_pre_exchange() { post_integrate(); }
void FixDPLR::setup_pre_exchange() {
printf("FixDPLR::setup_pre_exchange\n");
pre_exchange();
printf("FixDPLR::setup_pre_exchange\n");
}

/* ---------------------------------------------------------------------- */

Expand All @@ -310,11 +314,13 @@ void FixDPLR::setup_pre_force(int vflag) { pre_force(vflag); }
/* ---------------------------------------------------------------------- */

void FixDPLR::setup(int vflag) {
printf("FixDPLR::setup\n");
// if (strstr(update->integrate_style,"verlet"))
post_force(vflag);
// else {
// error->all(FLERR, "respa is not supported by this fix");
// }
printf("FixDPLR::setup\n");
}

/* ---------------------------------------------------------------------- */
Expand Down Expand Up @@ -401,7 +407,7 @@ void FixDPLR::get_valid_pairs(vector<pair<int, int> > &pairs) {

/* ---------------------------------------------------------------------- */

void FixDPLR::post_integrate() {
void FixDPLR::pre_exchange() {
double **x = atom->x;
double **v = atom->v;
int *type = atom->type;
Expand Down Expand Up @@ -719,7 +725,7 @@ void FixDPLR::post_force(int vflag) {

/* ---------------------------------------------------------------------- */

void FixDPLR::min_pre_exchange() { post_integrate(); }
void FixDPLR::min_pre_exchange() { pre_exchange(); }

/* ---------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion source/lmp/fix_dplr.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FixDPLR : public Fix {
void setup_pre_exchange() override;
void setup_pre_force(int) override;
void min_setup(int) override;
void post_integrate() override;
void pre_exchange() override;
void pre_force(int) override;
void post_force(int) override;
void min_pre_exchange() override;
Expand Down

0 comments on commit 7cbcb79

Please sign in to comment.