output ninserted for fixes: deposit+pour

This commit is contained in:
Jacob Gissinger
2023-10-28 13:22:10 -04:00
parent ed6c603488
commit c5463e13f1
4 changed files with 19 additions and 1 deletions

View File

@ -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"); if (lmp->kokkos) error->all(FLERR, "Cannot yet use fix pour with the KOKKOS package");
scalar_flag = 1;
time_depend = 1; time_depend = 1;
if (!atom->radius_flag || !atom->rmass_flag) 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() void FixPour::reset_dt()

View File

@ -32,6 +32,7 @@ class FixPour : public Fix {
void init() override; void init() override;
void setup_pre_exchange() override; void setup_pre_exchange() override;
void pre_exchange() override; void pre_exchange() override;
double compute_scalar() override;
void reset_dt() override; void reset_dt() override;
void *extract(const char *, int &) override; void *extract(const char *, int &) override;

View File

@ -51,6 +51,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
{ {
if (narg < 7) error->all(FLERR,"Illegal fix deposit command"); if (narg < 7) error->all(FLERR,"Illegal fix deposit command");
scalar_flag = 1;
restart_global = 1; restart_global = 1;
time_depend = 1; time_depend = 1;
@ -816,6 +817,11 @@ void FixDeposit::options(int narg, char **arg)
} }
} }
double FixDeposit::compute_scalar()
{
return ninserted;
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
pack entire state of Fix into one write pack entire state of Fix into one write
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -32,6 +32,7 @@ class FixDeposit : public Fix {
void init() override; void init() override;
void setup_pre_exchange() override; void setup_pre_exchange() override;
void pre_exchange() override; void pre_exchange() override;
double compute_scalar() override;
void write_restart(FILE *) override; void write_restart(FILE *) override;
void restart(char *) override; void restart(char *) override;
void *extract(const char *, int &) override; void *extract(const char *, int &) override;