add proper r-RESPA support for fix cmap
This commit is contained in:
@ -127,6 +127,11 @@ the :doc:`run <run>` command.
|
|||||||
The forces due to this fix are imposed during an energy minimization,
|
The forces due to this fix are imposed during an energy minimization,
|
||||||
invoked by the :doc:`minimize <minimize>` command.
|
invoked by the :doc:`minimize <minimize>` command.
|
||||||
|
|
||||||
|
The :doc:`fix_modify <fix_modify>` *respa* option is supported by this
|
||||||
|
fix. This allows to set at which level of the :doc:`r-RESPA
|
||||||
|
<run_style>` integrator the fix is adding its forces. Default is the
|
||||||
|
outermost level.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
If you want the potential energy associated with the CMAP terms
|
If you want the potential energy associated with the CMAP terms
|
||||||
|
|||||||
@ -81,6 +81,8 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
extvector = 1;
|
extvector = 1;
|
||||||
wd_header = 1;
|
wd_header = 1;
|
||||||
wd_section = 1;
|
wd_section = 1;
|
||||||
|
respa_level_support = 1;
|
||||||
|
ilevel_respa = 0;
|
||||||
|
|
||||||
MPI_Comm_rank(world,&me);
|
MPI_Comm_rank(world,&me);
|
||||||
MPI_Comm_size(world,&nprocs);
|
MPI_Comm_size(world,&nprocs);
|
||||||
@ -182,6 +184,11 @@ void FixCMAP::init()
|
|||||||
// define newton_bond here in case restart file was read (not data file)
|
// define newton_bond here in case restart file was read (not data file)
|
||||||
|
|
||||||
newton_bond = force->newton_bond;
|
newton_bond = force->newton_bond;
|
||||||
|
|
||||||
|
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||||
|
ilevel_respa = ((Respa *) update->integrate)->nlevels-1;
|
||||||
|
if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
@ -190,12 +197,12 @@ void FixCMAP::setup(int vflag)
|
|||||||
{
|
{
|
||||||
pre_neighbor();
|
pre_neighbor();
|
||||||
|
|
||||||
if (strstr(update->integrate_style,"verlet"))
|
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||||
post_force(vflag);
|
post_force(vflag);
|
||||||
else {
|
else {
|
||||||
((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
|
((Respa *) update->integrate)->copy_flevel_f(ilevel_respa);
|
||||||
post_force_respa(vflag,nlevels_respa-1,0);
|
post_force_respa(vflag,ilevel_respa,0);
|
||||||
((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1);
|
((Respa *) update->integrate)->copy_f_flevel(ilevel_respa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,7 +603,7 @@ void FixCMAP::post_force(int vflag)
|
|||||||
|
|
||||||
void FixCMAP::post_force_respa(int vflag, int ilevel, int /*iloop*/)
|
void FixCMAP::post_force_respa(int vflag, int ilevel, int /*iloop*/)
|
||||||
{
|
{
|
||||||
if (ilevel == nlevels_respa-1) post_force(vflag);
|
if (ilevel == ilevel_respa) post_force(vflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class FixCMAP : public Fix {
|
|||||||
private:
|
private:
|
||||||
int nprocs,me;
|
int nprocs,me;
|
||||||
int newton_bond,eflag_caller;
|
int newton_bond,eflag_caller;
|
||||||
int ctype,nlevels_respa;
|
int ctype,ilevel_respa;
|
||||||
int ncrosstermtypes,crossterm_per_atom,maxcrossterm;
|
int ncrosstermtypes,crossterm_per_atom,maxcrossterm;
|
||||||
int ncrosstermlist;
|
int ncrosstermlist;
|
||||||
bigint ncmap;
|
bigint ncmap;
|
||||||
|
|||||||
Reference in New Issue
Block a user