fix issues with compute smd/vol and related docs

This commit is contained in:
Axel Kohlmeyer
2024-08-16 14:58:47 -04:00
parent 4aaf7d7098
commit 2db37c9a35
3 changed files with 14 additions and 11 deletions

View File

@ -45,7 +45,8 @@ Restrictions
""""""""""""
This compute is part of the MACHDYN package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.
Related commands
""""""""""""""""

View File

@ -24,7 +24,7 @@ Description
"""""""""""
Define a computation that provides the per-particle volume and the sum
of the per-particle volumes of the group for which the fix is defined.
of the per-particle volumes of the group for which the compute is defined.
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
@ -41,13 +41,14 @@ The per-particle vector values will be given in :doc:`units <units>` of
volume.
Additionally, the compute returns a scalar, which is the sum of the
per-particle volumes of the group for which the fix is defined.
per-particle volumes of the group for which the compute is defined.
Restrictions
""""""""""""
This compute is part of the MACHDYN package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.
Related commands
""""""""""""""""

View File

@ -25,13 +25,14 @@
#include "compute_smd_vol.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "memory.h"
#include "modify.h"
#include "update.h"
#include <cstring>
using namespace LAMMPS_NS;
@ -39,12 +40,12 @@ using namespace LAMMPS_NS;
ComputeSMDVol::ComputeSMDVol(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg) {
if (narg != 3)
error->all(FLERR, "Illegal compute smd/volume command");
if (narg != 3) error->all(FLERR, "Illegal compute smd/volume command");
if (atom->vfrac_flag != 1)
error->all(FLERR, "compute smd/volume command requires atom_style with density (e.g. smd)");
scalar_flag = 1;
extscalar = 1;
peratom_flag = 1;
size_peratom_cols = 0;