From ae80dba958446838407a44fb82f5d666375677a3 Mon Sep 17 00:00:00 2001 From: Gabriel Alkuino <107645552+gsalkuin@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:02:26 -0400 Subject: [PATCH] Remove even more whitespace --- doc/src/fix_epot_lepton.rst | 26 +++++++++++++------------- src/LEPTON/fix_epot_lepton.cpp | 10 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/src/fix_epot_lepton.rst b/doc/src/fix_epot_lepton.rst index 710954500f..4a9b4a8669 100644 --- a/doc/src/fix_epot_lepton.rst +++ b/doc/src/fix_epot_lepton.rst @@ -42,21 +42,21 @@ Description .. versionadded:: TBD -Add an electric potential :math:`V` that applies to a group of charged atoms a force :math:`\vec{F} = q \vec{E}`, -and to dipoles a force :math:`\vec{F} = (\vec{p} \cdot \nabla) \vec{E}` and torque :math:`\vec{T} = \vec{p} \times \vec{E}`, -where :math:`\vec{E} = - \nabla V`. The fix also evaluates the electrostatic energy (:math:`U_{q} = q V` and :math:`U_{p} = - \vec{p} \cdot \vec{E}`) -due to this potential when the :doc:`fix_modify energy yes ` command is specified (see below). +Add an electric potential :math:`V` that applies to a group of charged atoms a force :math:`\vec{F} = q \vec{E}`, +and to dipoles a force :math:`\vec{F} = (\vec{p} \cdot \nabla) \vec{E}` and torque :math:`\vec{T} = \vec{p} \times \vec{E}`, +where :math:`\vec{E} = - \nabla V`. The fix also evaluates the electrostatic energy (:math:`U_{q} = q V` and :math:`U_{p} = - \vec{p} \cdot \vec{E}`) +due to this potential when the :doc:`fix_modify energy yes ` command is specified (see below). -The `Lepton library `_, that the *epot/lepton* fix style interfaces with, evaluates -the expression string at run time to compute the energy, forces, and torques. It creates an analytical representation +The `Lepton library `_, that the *epot/lepton* fix style interfaces with, evaluates +the expression string at run time to compute the energy, forces, and torques. It creates an analytical representation of :math:`V` and :math:`\vec{E}`, while the gradient force is computed using a central difference scheme .. math:: - + \vec{F} = \frac{|\vec{p}|}{2h} \left[ \vec{E}(\vec{x} + h \hat{p}) - \vec{E}(\vec{x} - h \hat{p}) \right] . -The Lepton expression must be either enclosed in quotes or must not contain any whitespace so that LAMMPS -recognizes it as a single keyword. More on valid Lepton expressions below. The final Lepton expression must +The Lepton expression must be either enclosed in quotes or must not contain any whitespace so that LAMMPS +recognizes it as a single keyword. More on valid Lepton expressions below. The final Lepton expression must be a function of only :math:`x, y, z`, which refer to the current *unwrapped* coordinates of the atoms to ensure continuity. Special care must be taken when using this fix with periodic boundary conditions or box-changing commands. @@ -98,9 +98,9 @@ fix. This allows to set at which level of the :doc:`r-RESPA ` integrator the fix adding its forces. Default is the outermost level. This fix computes a global scalar and a global 3-vector of forces, -which can be accessed by various :doc:`output commands `. -The scalar is the potential energy discussed above. -The vector is the total force added to the group of atoms. +which can be accessed by various :doc:`output commands `. +The scalar is the potential energy discussed above. +The vector is the total force added to the group of atoms. The scalar and vector values calculated by this fix are "extensive". This fix cannot be used with the *start/stop* keywords of @@ -123,7 +123,7 @@ the iteration count during the minimization. Restrictions """""""""""" -Fix style *epot/lepton* is part of the LEPTON package. It is only enabled if LAMMPS was built with that package. +Fix style *epot/lepton* is part of the LEPTON package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` page for more info. diff --git a/src/LEPTON/fix_epot_lepton.cpp b/src/LEPTON/fix_epot_lepton.cpp index 96c19e9ca5..f0ead28b7e 100644 --- a/src/LEPTON/fix_epot_lepton.cpp +++ b/src/LEPTON/fix_epot_lepton.cpp @@ -76,7 +76,7 @@ FixEpotLepton::FixEpotLepton(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Unknown keyword for fix {} command: {}", style, arg[iarg]); } } - + // check validity of Lepton expression // remove whitespace and quotes from expression string and then // check if the expression can be parsed without error @@ -277,7 +277,7 @@ void FixEpotLepton::post_force(int vflag) // force = (mu dot D) E // using central difference method h_mu = h / mu_norm; - + xf = unwrap[0] + h_mu * mu[i][0]; yf = unwrap[1] + h_mu * mu[i][1]; zf = unwrap[2] + h_mu * mu[i][2]; @@ -378,7 +378,7 @@ void FixEpotLepton::post_force(int vflag) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (region && !region->match(x[i][0], x[i][1], x[i][2])) continue; - + mu_norm = sqrt(mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2]); if (mu_norm > EPSILON) continue; @@ -403,7 +403,7 @@ void FixEpotLepton::post_force(int vflag) // force = (mu dot D) E // using central difference method h_mu = h / sqrt(mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2]); - + xf = unwrap[0] + h_mu * mu[i][0]; yf = unwrap[1] + h_mu * mu[i][1]; zf = unwrap[2] + h_mu * mu[i][2]; @@ -453,7 +453,7 @@ void FixEpotLepton::post_force(int vflag) } } } - + /* ---------------------------------------------------------------------- */ void FixEpotLepton::post_force_respa(int vflag, int ilevel, int /*iloop*/)