rename dlm option to dipole/dlm and turn on dipole flag with it as well

This commit is contained in:
Axel Kohlmeyer
2016-07-27 07:56:53 -04:00
parent 01e12e23c2
commit 671ca115f9
4 changed files with 30 additions and 27 deletions

View File

@ -56,8 +56,9 @@ keyword = {temp} or {iso} or {aniso} or {tri} or {x} or {y} or {z} or {xy} or {y
{flip} value = {yes} or {no} = allow or disallow box flips when it becomes highly skewed
{fixedpoint} values = x y z
x,y,z = perform barostat dilation/contraction around this point (distance units)
{update} value = {dipole} update dipole orientation (only for sphere variants)
{dlm} use Dullweber-Leimkuhler-McLachlan integrator to update the dipole orientation :pre
{update} value = {dipole} or {dipole/dlm}
dipole = update dipole orientation (only for sphere variants)
dipole/dlm = use alternative Dullweber-Leimkuhler-McLachlan integrator to update the dipole orientation (only for sphere variants) :pre
:ule
@ -335,8 +336,12 @@ during the time integration. This option should be used for models
where a dipole moment is assigned to finite-size particles,
e.g. spheroids via use of the "atom_style hybrid sphere
dipole"_atom_style.html command.
Instead of the default integrator used when the {update dipole} keyword/value pair is present, adding the {dlm} keyword enables the Dullweber-Leimkuhler-McLachlan integration scheme "(Dullweber)"_#nh-Dullweber for the dipole orientation. This integrator is symplectic and time-reversible, giving better energy conservation and allows slightly longer timesteps at only a small additional computational cost. The {dlm} keyword may only be used together with {update dipole}.
The default dipole orientation integrator can be changed the
Dullweber-Leimkuhler-McLachlan integration scheme "(Dullweber)"_#nh-Dullweber
when using {update} with the value {dipole/dlm}. This integrator
is symplectic and time-reversible, giving better energy conservation
and allows slightly longer timesteps at only a small additional
computational cost.
:line

View File

@ -16,19 +16,18 @@ fix ID group-ID nve/sphere :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
nve/sphere = style name of this fix command :l
zero or more keyword/value pairs may be appended :l
keyword = {update} :l
{update} value = {dipole}
dipole = update orientation of dipole moment during integration :pre
keyword = {dlm} :l
{dlm}
use Dullweber-Leimkuhler-McLachlan integrator to update the dipole orientation :pre
keyword = {update}
{update} value = {dipole} or {dipole/dlm}
dipole = update orientation of dipole moment during integration
dipole/dlm = use alternative Dullweber-Leimkuhler-McLachlan integrator to update the dipole orientation :pre
:ule
[Examples:]
fix 1 all nve/sphere
fix 1 all nve/sphere update dipole
fix 1 all nve/sphere update dipole dlm :pre
fix 1 all nve/sphere update dipole/dlm :pre
[Description:]
@ -46,8 +45,12 @@ during the time integration. This option should be used for models
where a dipole moment is assigned to finite-size particles,
e.g. spheroids via use of the "atom_style hybrid sphere
dipole"_atom_style.html command.
Instead of the default integrator used when the {update dipole} keyword/value pair is present, adding the {dlm} keyword enables the Dullweber-Leimkuhler-McLachlan integration scheme "(Dullweber)"_#nve-Dullweber for the dipole orientation. This integrator is symplectic and time-reversible, giving better energy conservation and allows slightly longer timesteps at only a small additional computational cost. The {dlm} keyword may only be used together with {update dipole}.
The default dipole orientation integrator can be changed the
Dullweber-Leimkuhler-McLachlan integration scheme "(Dullweber)"_#nh-Dullweber
when using {update} with the value {dipole/dlm}. This integrator
is symplectic and time-reversible, giving better energy conservation
and allows slightly longer timesteps at only a small additional
computational cost.
:line

View File

@ -331,11 +331,11 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
} else if (strcmp(arg[iarg],"update") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"dipole") == 0) dipole_flag = 1;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
else if (strcmp(arg[iarg],"dipole/dlm") == 0) {
dipole_flag = 1;
dlm_flag = 1;
} else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"dlm") == 0) {
dlm_flag = 1;
iarg += 1;
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]);
@ -439,9 +439,6 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
error->all(FLERR,"Using update dipole flag requires atom attribute mu");
}
if (dlm_flag && !dipole_flag)
error->all(FLERR,"The dlm flag must be used with update dipole");
if ((tstat_flag && t_period <= 0.0) ||
(p_flag[0] && p_period[0] <= 0.0) ||
(p_flag[1] && p_period[1] <= 0.0) ||

View File

@ -52,11 +52,11 @@ FixNVESphere::FixNVESphere(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg],"update") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nve/sphere command");
if (strcmp(arg[iarg+1],"dipole") == 0) extra = DIPOLE;
else error->all(FLERR,"Illegal fix nve/sphere command");
else if (strcmp(arg[iarg+1],"dipole/dlm") == 0) {
extra = DIPOLE;
dlm = DLM;
} else error->all(FLERR,"Illegal fix nve/sphere command");
iarg += 2;
} else if (strcmp(arg[iarg],"dlm") == 0) {
dlm = DLM;
iarg += 1;
} else error->all(FLERR,"Illegal fix nve/sphere command");
}
@ -66,8 +66,6 @@ FixNVESphere::FixNVESphere(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Fix nve/sphere requires atom style sphere");
if (extra == DIPOLE && !atom->mu_flag)
error->all(FLERR,"Fix nve/sphere update dipole requires atom attribute mu");
if (dlm == DLM && extra != DIPOLE)
error->all(FLERR,"Fix nve/sphere dlm must be used with update dipole");
}
/* ---------------------------------------------------------------------- */
@ -93,7 +91,7 @@ void FixNVESphere::init()
void FixNVESphere::initial_integrate(int vflag)
{
double dtfm,dtirotate,msq,scale,s2,c,inv_len_mu;
double dtfm,dtirotate,msq,scale,s2,inv_len_mu;
double g[3];
vector w, w_temp, a;
matrix Q, Q_temp, R;