diff --git a/doc/src/fix_deposit.rst b/doc/src/fix_deposit.rst index 7d2d28bfa9..08711001c5 100644 --- a/doc/src/fix_deposit.rst +++ b/doc/src/fix_deposit.rst @@ -289,10 +289,11 @@ operation of the fix continues in an uninterrupted fashion. The fix will try to detect it and stop with an error. None of the :doc:`fix_modify ` options are relevant to this -fix. No global or per-atom quantities are stored by this fix for -access by various :doc:`output commands `. No parameter -of this fix can be used with the *start/stop* keywords of the -:doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +fix. This fix computes a global scalar, which can be accessed by various +output commands. The scalar is the cumulative number of insertions. The +scalar value calculated by this fix is “intensive”. No parameter of this +fix can be used with the *start/stop* keywords of the :doc:`run ` +command. This fix is not invoked during :doc:`energy minimization `. Restrictions """""""""""" diff --git a/doc/src/fix_pour.rst b/doc/src/fix_pour.rst index eca1f70c41..0ad369bf29 100644 --- a/doc/src/fix_pour.rst +++ b/doc/src/fix_pour.rst @@ -245,8 +245,9 @@ produce the same behavior if you adjust the fix pour parameters appropriately. None of the :doc:`fix_modify ` options are relevant to this -fix. No global or per-atom quantities are stored by this fix for -access by various :doc:`output commands `. No parameter +fix. This fix computes a global scalar, which can be accessed by various +output commands. The scalar is the cumulative number of insertions. The +scalar value calculated by this fix is “intensive”. No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index f92bca5073..cc5f0567e8 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -58,6 +58,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : if (lmp->kokkos) error->all(FLERR, "Cannot yet use fix pour with the KOKKOS package"); + scalar_flag = 1; time_depend = 1; if (!atom->radius_flag || !atom->rmass_flag) @@ -1030,6 +1031,15 @@ void FixPour::options(int narg, char **arg) } } +/* ---------------------------------------------------------------------- + output number of successful insertions +------------------------------------------------------------------------- */ + +double FixPour::compute_scalar() +{ + return ninserted; +} + /* ---------------------------------------------------------------------- */ void FixPour::reset_dt() diff --git a/src/GRANULAR/fix_pour.h b/src/GRANULAR/fix_pour.h index 4a6e4abdae..57db2541df 100644 --- a/src/GRANULAR/fix_pour.h +++ b/src/GRANULAR/fix_pour.h @@ -32,6 +32,7 @@ class FixPour : public Fix { void init() override; void setup_pre_exchange() override; void pre_exchange() override; + double compute_scalar() override; void reset_dt() override; void *extract(const char *, int &) override; diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp index 35bc48fe89..d2bcb3e855 100644 --- a/src/fix_deposit.cpp +++ b/src/fix_deposit.cpp @@ -51,6 +51,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : { if (narg < 7) error->all(FLERR,"Illegal fix deposit command"); + scalar_flag = 1; restart_global = 1; time_depend = 1; @@ -816,6 +817,15 @@ void FixDeposit::options(int narg, char **arg) } } +/* ---------------------------------------------------------------------- + output number of successful insertions +------------------------------------------------------------------------- */ + +double FixDeposit::compute_scalar() +{ + return ninserted; +} + /* ---------------------------------------------------------------------- pack entire state of Fix into one write ------------------------------------------------------------------------- */ diff --git a/src/fix_deposit.h b/src/fix_deposit.h index ba5078dbbe..2b866dc068 100644 --- a/src/fix_deposit.h +++ b/src/fix_deposit.h @@ -32,6 +32,7 @@ class FixDeposit : public Fix { void init() override; void setup_pre_exchange() override; void pre_exchange() override; + double compute_scalar() override; void write_restart(FILE *) override; void restart(char *) override; void *extract(const char *, int &) override;