From b548a06270a5d7f6ab59674358e9c1284586ee5f Mon Sep 17 00:00:00 2001 From: jtclemm Date: Thu, 20 Apr 2023 10:19:05 -0600 Subject: [PATCH 1/2] Redefining already used variable name a->A in pair granular doc --- doc/src/pair_granular.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index 0911a3486a..21afc1b4fc 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -650,13 +650,13 @@ For *heat* *area*, the heat .. math:: - Q = k_{s} a \Delta T + Q = k_{s} A \Delta T where :math:`\Delta T` is the difference in the two particles' temperature, :math:`k_{s}` is a non-negative numeric value for the conductivity, and -:math:`a` is the area of the contact and depends on the normal force model. +:math:`A` is the area of the contact and depends on the normal force model. Note that the option *none* must either be used in all or none of of the *pair_coeff* calls. See :doc:`fix heat/flow ` and From 6ef6d6f0b29ce22df626cbff8e599a61330ed910 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Thu, 20 Apr 2023 11:17:24 -0600 Subject: [PATCH 2/2] Fixing group mask bug in gran wall, clean up redundant nullptr assignments --- src/GRANULAR/fix_wall_gran.cpp | 15 ++++++--------- src/GRANULAR/fix_wall_gran_region.cpp | 5 +---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 8ebe2d5a4c..d8dad458c6 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -52,7 +52,7 @@ enum {NONE,CONSTANT,EQUAL}; /* ---------------------------------------------------------------------- */ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(nullptr), history_one(nullptr), + Fix(lmp, narg, arg), idregion(nullptr), tstr(nullptr), history_one(nullptr), fix_rigid(nullptr), mass_rigid(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix wall/gran command"); @@ -127,9 +127,6 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // wallstyle args - idregion = nullptr; - tstr = nullptr; - if (iarg >= narg) error->all(FLERR, "Illegal fix wall/gran command"); if (strcmp(arg[iarg],"xplane") == 0) { @@ -247,13 +244,11 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - history_one = nullptr; FixWallGran::grow_arrays(atom->nmax); atom->add_callback(Atom::GROW); atom->add_callback(Atom::RESTART); nmax = 0; - mass_rigid = nullptr; // initialize history as if particle is not touching region // history_one will be a null pointer for wallstyle = REGION @@ -323,7 +318,6 @@ void FixWallGran::init() // check for FixRigid so can extract rigid body masses - fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -452,7 +446,7 @@ void FixWallGran::post_force(int /*vflag*/) } for (int i = 0; i < nlocal; i++) { - if ((!mask[i]) & groupbit) continue; + if (!(mask[i] & groupbit)) continue; dx = dy = dz = 0.0; @@ -548,7 +542,10 @@ void FixWallGran::post_force(int /*vflag*/) } } -void FixWallGran::clear_stored_contacts() { +/* ---------------------------------------------------------------------- */ + +void FixWallGran::clear_stored_contacts() +{ const int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { for (int m = 0; m < size_peratom_cols; m++) { diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 9f9716094f..1c2fd4bcc0 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -59,9 +59,6 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : memory->destroy(history_one); history_one = nullptr; - ncontact = nullptr; - walls = nullptr; - history_many = nullptr; FixWallGranRegion::grow_arrays(atom->nmax); // initialize shear history as if particle is not touching region @@ -193,7 +190,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) } for (i = 0; i < nlocal; i++) { - if ((!mask[i]) & groupbit) continue; + if (!(mask[i] & groupbit)) continue; if (! region->match(x[i][0], x[i][1], x[i][2])) continue; nc = region->surface(x[i][0], x[i][1], x[i][2], radius[i] + model->pulloff_distance(radius[i], 0.0));