changes for next patch, 2d disc options for spheres, fix external upgrade, bug fixes for fix ave/chunk for density calcs, Aidan doc page citation deconvolution
This commit is contained in:
@ -36,6 +36,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
scalar_flag = 1;
|
||||
global_freq = 1;
|
||||
virial_flag = 1;
|
||||
extscalar = 1;
|
||||
|
||||
if (strcmp(arg[3],"pf/callback") == 0) {
|
||||
@ -80,6 +81,7 @@ int FixExternal::setmask()
|
||||
{
|
||||
int mask = 0;
|
||||
if (mode == PF_CALLBACK || mode == PF_ARRAY) {
|
||||
mask |= PRE_REVERSE;
|
||||
mask |= POST_FORCE;
|
||||
mask |= THERMO_ENERGY;
|
||||
mask |= MIN_POST_FORCE;
|
||||
@ -102,6 +104,13 @@ void FixExternal::setup(int vflag)
|
||||
post_force(vflag);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::setup_pre_reverse(int eflag, int vflag)
|
||||
{
|
||||
pre_reverse(eflag,vflag);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::min_setup(int vflag)
|
||||
@ -109,12 +118,25 @@ void FixExternal::min_setup(int vflag)
|
||||
post_force(vflag);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
store eflag, so can use it in post_force to tally per-atom energies
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::pre_reverse(int eflag, int vflag)
|
||||
{
|
||||
eflag_caller = eflag;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::post_force(int vflag)
|
||||
{
|
||||
bigint ntimestep = update->ntimestep;
|
||||
|
||||
int eflag = eflag_caller;
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
else evflag = 0;
|
||||
|
||||
// invoke the callback in driver program
|
||||
// it will fill fexternal with forces
|
||||
|
||||
@ -145,11 +167,57 @@ void FixExternal::min_post_force(int vflag)
|
||||
post_force(vflag);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
caller invokes this method to set its contribution to global energy
|
||||
do not just return if eflag_global is not set
|
||||
input script could access this quantity via compute_scalar()
|
||||
even if eflag is not set on a particular timestep
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::set_energy(double eng)
|
||||
void FixExternal::set_energy_global(double caller_energy)
|
||||
{
|
||||
user_energy = eng;
|
||||
user_energy = caller_energy;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
caller invokes this method to set its contribution to global virial
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::set_virial_global(double *caller_virial)
|
||||
{
|
||||
if (!vflag_global) return;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
virial[i] = caller_virial[i];
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
caller invokes this method to set its contribution to peratom energy
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::set_energy_peratom(double *caller_energy)
|
||||
{
|
||||
if (!eflag_atom) return;
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
eatom[i] = caller_energy[i];
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
caller invokes this method to set its contribution to peratom virial
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixExternal::set_virial_peratom(double **caller_virial)
|
||||
{
|
||||
int i,j;
|
||||
|
||||
if (!vflag_atom) return;
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
for (i = 0; i < nlocal; i++)
|
||||
for (j = 0; j < 6; j++)
|
||||
vatom[i][j] = caller_virial[i][j];
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user