From 51743655703cbfa3e31c41894316df5f451343bb Mon Sep 17 00:00:00 2001 From: ares20105 Date: Wed, 20 Nov 2019 13:21:41 -0700 Subject: [PATCH] add force modifications. Previous code does not call force modify, thus the dynamical matrix calculation does not work for other potentials defined via modify --- src/USER-PHONON/dynamical_matrix.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 1495219124..6bb843c16e 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -19,6 +19,7 @@ #include "improper.h" #include "kspace.h" #include "update.h" +#include "modify.h" #include "neighbor.h" #include "pair.h" #include "timer.h" @@ -385,6 +386,7 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { force_clear(); + int n_post_force = modify->n_post_force; if (pair_compute_flag) { force->pair->compute(eflag,vflag); @@ -405,6 +407,11 @@ void DynamicalMatrix::update_force() comm->reverse_comm(); timer->stamp(Timer::COMM); } + + // force modifications, + if (n_post_force) modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + ++ update->nsteps; }