From e01ef140253b9d58ba4f19347e07390ca3dc0234 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Sun, 12 Jun 2022 10:06:16 -0600 Subject: [PATCH 001/112] Adding documentation and integration fix --- doc/src/atom_style.rst | 14 ++++--- doc/src/fix_temp_integrate.rst | 75 ++++++++++++++++++++++++++++++++++ doc/src/set.rst | 9 +++- 3 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 doc/src/fix_temp_integrate.rst diff --git a/doc/src/atom_style.rst b/doc/src/atom_style.rst index bd0c193962..5b93c56887 100644 --- a/doc/src/atom_style.rst +++ b/doc/src/atom_style.rst @@ -121,6 +121,8 @@ quantities. +--------------+-----------------------------------------------------+--------------------------------------+ | *sphere* | diameter, mass, angular velocity | granular models | +--------------+-----------------------------------------------------+--------------------------------------+ +| *sphere/temp*| diameter, mass, angular velocity, temperature | thermal granular models | ++--------------+-----------------------------------------------------+--------------------------------------+ | *bpm/sphere* | diameter, mass, angular velocity, quaternion | granular bonded particle models (BPM)| +--------------+-----------------------------------------------------+--------------------------------------+ | *spin* | magnetic moment | system with magnetic particles | @@ -144,7 +146,7 @@ quantities. output the custom values. All of the above styles define point particles, except the *sphere*, -*bpm/sphere*, *ellipsoid*, *electron*, *peri*, *wavepacket*, *line*, +*sphere/temp*, *bpm/sphere*, *ellipsoid*, *electron*, *peri*, *wavepacket*, *line*, *tri*, and *body* styles, which define finite-size particles. See the :doc:`Howto spherical ` page for an overview of using finite-size particle models with LAMMPS. @@ -154,15 +156,15 @@ per-type basis, using the :doc:`mass ` command, The finite-size particle styles assign mass to individual particles on a per-particle basis. -For the *sphere* and *bpm/sphere* styles, the particles are spheres and each stores a -per-particle diameter and mass. If the diameter > 0.0, the particle -is a finite-size sphere. If the diameter = 0.0, it is a point -particle. Note that by use of the *disc* keyword with the :doc:`fix +For the *sphere*, *sphere/temp*, and *bpm/sphere* styles, the particles +are spheres and each stores a per-particle diameter and mass. If the +diameter > 0.0, the particle is a finite-size sphere. If the diameter = 0.0, +it is a point particle. Note that by use of the *disc* keyword with the :doc:`fix nve/sphere `, :doc:`fix nvt/sphere `, :doc:`fix nph/sphere `, :doc:`fix npt/sphere ` commands for the *sphere* style, spheres can be effectively treated as 2d discs for a 2d simulation if desired. See also the :doc:`set -density/disc ` command. The *sphere* and *bpm/sphere* styles take an optional 0 +density/disc ` command. These styles take an optional 0 or 1 argument. A value of 0 means the radius of each sphere is constant for the duration of the simulation. A value of 1 means the radii may vary dynamically during the simulation, e.g. due to use of diff --git a/doc/src/fix_temp_integrate.rst b/doc/src/fix_temp_integrate.rst new file mode 100644 index 0000000000..c2f1257075 --- /dev/null +++ b/doc/src/fix_temp_integrate.rst @@ -0,0 +1,75 @@ +.. index:: fix temp/integrate + +fix temp/integrate command +========================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID temp/integrate style values ... + +* ID, group-ID are documented in :doc:`fix ` command +* temp/integrate = style name of this fix command +* one style with corresponding value(s) needs to be listed + + .. parsed-literal:: + + style = *constant* or *type* + *constant* = cp + cp = value of specifc heat (energy/(mass * temperature) units) + *type* = cp1 ... cpN + cpN = value of specifc heat for type N (energy/(mass * temperature) units) + +* + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all temp/integrate constant 1.0 + fix 1 all temp/integrate type 1.0 0.5 + +Description +""""""""""" + +Perform plain time integration to update temperature for atoms in the +group each timestep. The specific heat of atoms can be defined using either +the *constant* or *type* keywords. For style *constant*, the specific heat +is a constant value *cp* for all atoms. For style *type*, *N* different values +of the specific heat are defined, one for each of the *N* types of atoms. + + + +---------- + +.. include:: accel_styles.rst + +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about this fix is written to :doc:`binary restart files `. 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 `. + +Restrictions +"""""""""""" + +This fix requires that atoms store temperature and a heat flux +as defined by the :doc:`atom_style sphere/temp ` command. + +Related commands +"""""""""""""""" + +:doc:`pair granular ` + +Default +""""""" + +none diff --git a/doc/src/set.rst b/doc/src/set.rst index cc1d2766e3..d11d3fc229 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -18,7 +18,7 @@ Syntax *dipole/random* or *quat* or *spin* or *spin/random* or *quat* or *quat/random* or *diameter* or *shape* or *length* or *tri* or *theta* or *theta/random* or *angmom* or - *omega* or *mass* or *density* or *density/disc* or + *omega* or *mass* or *density* or *density/disc* or *temperature* or *volume* or *image* or *bond* or *angle* or *dihedral* or *improper* or *sph/e* or *sph/cv* or *sph/rho* or *smd/contact/radius* or *smd/mass/density* or *dpd/theta* or @@ -95,6 +95,8 @@ Syntax value can be an atom-style variable (see below) *density/disc* value = particle density for a 2d disc or ellipse (mass/distance\^2 units) value can be an atom-style variable (see below) + *temperature* value = particle temperature for a finite-size particle particle (temperature units)s + value can be an atom-style variable (see below) *volume* value = particle volume for Peridynamic particle (distance\^3 units) value can be an atom-style variable (see below) *image* nx ny nz @@ -410,6 +412,11 @@ assumed to be in mass/distance\^2 units). If none of these cases are valid, then the mass is set to the density value directly (the input density is assumed to be in mass units). +Keyword *temperature* sets the temperature of a finite-size particle +as defined by the GRANULAR package. Currently, only +:doc:`atom_style sphere/temperature ` defines particles +with this attribute. The values for the temperature must be positive. + Keyword *volume* sets the volume of all selected particles. Currently, only the :doc:`atom_style peri ` command defines particles with a volume attribute. Note that this command does not adjust the From c6d59fc5267bede32772403f683c136e36d8528a Mon Sep 17 00:00:00 2001 From: jtclemm Date: Sun, 12 Jun 2022 10:09:26 -0600 Subject: [PATCH 002/112] adding documentation and integration fix --- src/.gitignore | 6 +- src/GRANULAR/atom_vec_sphere_temperature.cpp | 160 +++++++++++++++++++ src/GRANULAR/atom_vec_sphere_temperature.h | 51 ++++++ src/GRANULAR/fix_temp_integrate.cpp | 142 ++++++++++++++++ src/GRANULAR/fix_temp_integrate.h | 50 ++++++ src/atom.cpp | 18 +++ src/atom.h | 2 + src/set.cpp | 19 ++- 8 files changed, 445 insertions(+), 3 deletions(-) create mode 100644 src/GRANULAR/atom_vec_sphere_temperature.cpp create mode 100644 src/GRANULAR/atom_vec_sphere_temperature.h create mode 100644 src/GRANULAR/fix_temp_integrate.cpp create mode 100644 src/GRANULAR/fix_temp_integrate.h diff --git a/src/.gitignore b/src/.gitignore index 6657256e8f..7a6bc1beb4 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -421,14 +421,14 @@ /atom_vec_full.h /atom_vec_full_hars.cpp /atom_vec_full_hars.h -/atom_vec_granular.cpp -/atom_vec_granular.h /atom_vec_molecular.cpp /atom_vec_molecular.h /atom_vec_oxdna.cpp /atom_vec_oxdna.h /atom_vec_peri.cpp /atom_vec_peri.h +/atom_vec_sphere_temperature.cpp +/atom_vec_sphere_temperature.h /atom_vec_template.cpp /atom_vec_template.h /body_nparticle.cpp @@ -1510,6 +1510,8 @@ /fix_smd_wall_surface.h /fix_srp.cpp /fix_srp.h +/fix_temp_integrate.cpp +/fix_temp_integrate.h /fix_tfmc.cpp /fix_tfmc.h /fix_ttm.cpp diff --git a/src/GRANULAR/atom_vec_sphere_temperature.cpp b/src/GRANULAR/atom_vec_sphere_temperature.cpp new file mode 100644 index 0000000000..5b62a2c279 --- /dev/null +++ b/src/GRANULAR/atom_vec_sphere_temperature.cpp @@ -0,0 +1,160 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "atom_vec_sphere_temperature.h" + +#include "atom.h" +#include "error.h" +#include "fix.h" +#include "fix_adapt.h" +#include "math_const.h" +#include "modify.h" + +using namespace LAMMPS_NS; +using namespace MathConst; + +/* ---------------------------------------------------------------------- */ + +AtomVecSphereTemperature::AtomVecSphereTemperature(LAMMPS *lmp) : AtomVec(lmp) +{ + mass_type = PER_ATOM; + molecular = Atom::ATOMIC; + + atom->sphere_flag = 1; + atom->radius_flag = atom->rmass_flag = atom->omega_flag = atom->torque_flag = 1; + atom->temperature_flag = atom->heatflux_flag = 1; + + // strings with peratom variables to include in each AtomVec method + // strings cannot contain fields in corresponding AtomVec default strings + // order of fields in a string does not matter + // except: fields_data_atom & fields_data_vel must match data file + + fields_grow = {"radius", "rmass", "omega", "torque", "temperature", "heatflux"}; + fields_copy = {"radius", "rmass", "omega", "temperature"}; + fields_comm_vel = {"omega", "temperature"}; + fields_reverse = {"torque", "heatflux"}; + fields_border = {"radius", "rmass", "temperature"}; + fields_border_vel = {"radius", "rmass", "omega", "temperature"}; + fields_exchange = {"radius", "rmass", "omega", "temperature"}; + fields_restart = {"radius", "rmass", "omega", "temperature"}; + fields_create = {"radius", "rmass", "omega", "temperature"}; + fields_data_atom = {"id", "type", "radius", "rmass", "x", "temperature"}; + fields_data_vel = {"id", "v", "omega"}; +} + +/* ---------------------------------------------------------------------- + process sub-style args + optional arg = 0/1 for static/dynamic particle radii +------------------------------------------------------------------------- */ + +void AtomVecSphereTemperature::process_args(int narg, char **arg) +{ + if (narg != 0 && narg != 1) error->all(FLERR, "Illegal atom_style sphere command"); + + radvary = 0; + if (narg == 1) { + radvary = utils::numeric(FLERR, arg[0], true, lmp); + if (radvary < 0 || radvary > 1) error->all(FLERR, "Illegal atom_style sphere command"); + } + + // dynamic particle radius and mass must be communicated every step + + if (radvary) { + fields_comm = {"radius", "rmass"}; + fields_comm_vel = {"radius", "rmass", "omega"}; + } + + // delay setting up of fields until now + + setup_fields(); +} + +/* ---------------------------------------------------------------------- */ + +void AtomVecSphereTemperature::init() +{ + AtomVec::init(); + + // check if optional radvary setting should have been set to 1 + + for (int i = 0; i < modify->nfix; i++) + if (strcmp(modify->fix[i]->style, "adapt") == 0) { + auto fix = dynamic_cast(modify->fix[i]); + if (fix->diamflag && radvary == 0) + error->all(FLERR, "Fix adapt changes particle radii but atom_style sphere is not dynamic"); + } +} + +/* ---------------------------------------------------------------------- + set local copies of all grow ptrs used by this class, except defaults + needed in replicate when 2 atom classes exist and it calls pack_restart() +------------------------------------------------------------------------- */ + +void AtomVecSphereTemperature::grow_pointers() +{ + radius = atom->radius; + rmass = atom->rmass; + omega = atom->omega; +} + +/* ---------------------------------------------------------------------- + initialize non-zero atom quantities +------------------------------------------------------------------------- */ + +void AtomVecSphereTemperature::create_atom_post(int ilocal) +{ + radius[ilocal] = 0.5; + rmass[ilocal] = 4.0 * MY_PI / 3.0 * 0.5 * 0.5 * 0.5; +} + +/* ---------------------------------------------------------------------- + modify what AtomVec::data_atom() just unpacked + or initialize other atom quantities +------------------------------------------------------------------------- */ + +void AtomVecSphereTemperature::data_atom_post(int ilocal) +{ + radius_one = 0.5 * atom->radius[ilocal]; + radius[ilocal] = radius_one; + if (radius_one > 0.0) rmass[ilocal] *= 4.0 * MY_PI / 3.0 * radius_one * radius_one * radius_one; + + if (rmass[ilocal] <= 0.0) error->one(FLERR, "Invalid density in Atoms section of data file"); + + omega[ilocal][0] = 0.0; + omega[ilocal][1] = 0.0; + omega[ilocal][2] = 0.0; +} + +/* ---------------------------------------------------------------------- + modify values for AtomVec::pack_data() to pack +------------------------------------------------------------------------- */ + +void AtomVecSphereTemperature::pack_data_pre(int ilocal) +{ + radius_one = radius[ilocal]; + rmass_one = rmass[ilocal]; + + radius[ilocal] *= 2.0; + if (radius_one != 0.0) + rmass[ilocal] = rmass_one / (4.0 * MY_PI / 3.0 * radius_one * radius_one * radius_one); +} + +/* ---------------------------------------------------------------------- + unmodify values packed by AtomVec::pack_data() +------------------------------------------------------------------------- */ + +void AtomVecSphereTemperature::pack_data_post(int ilocal) +{ + radius[ilocal] = radius_one; + rmass[ilocal] = rmass_one; +} diff --git a/src/GRANULAR/atom_vec_sphere_temperature.h b/src/GRANULAR/atom_vec_sphere_temperature.h new file mode 100644 index 0000000000..6b1ca6f390 --- /dev/null +++ b/src/GRANULAR/atom_vec_sphere_temperature.h @@ -0,0 +1,51 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef ATOM_CLASS +// clang-format off +AtomStyle(sphere,AtomVecSphereTemperature); +// clang-format on +#else + +#ifndef LMP_ATOM_VEC_SPHERE_TEMPERATURE_H +#define LMP_ATOM_VEC_SPHERE_TEMPERATURE_H + +#include "atom_vec.h" + +namespace LAMMPS_NS { + +class AtomVecSphereTemperature : public AtomVec { + public: + AtomVecSphereTemperature(class LAMMPS *); + void process_args(int, char **) override; + void init() override; + + void grow_pointers() override; + void create_atom_post(int) override; + void data_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; + + private: + double *radius, *rmass; + double **omega; + double *temperature, *heatflux; + + int radvary; + double radius_one, rmass_one; +}; + +} // namespace LAMMPS_NS + +#endif +#endif diff --git a/src/GRANULAR/fix_temp_integrate.cpp b/src/GRANULAR/fix_temp_integrate.cpp new file mode 100644 index 0000000000..bb351d7db4 --- /dev/null +++ b/src/GRANULAR/fix_temp_integrate.cpp @@ -0,0 +1,142 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "fix_temp_integrate.h" + +#include "atom.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "respa.h" +#include "update.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +enum {NONE, CONSTANT, TYPE}; + +/* ---------------------------------------------------------------------- */ + +FixTempIntegrate::FixTempIntegrate(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + if (narg < 4) error->all(FLERR,"Illegal fix command"); + + cp_style = NONE; + + int ntypes = atom->ntypes; + int iarg = 3; + while (iarg < narg) { + if (strcmp(arg[iarg+1],"constant") == 0) { + if (iarg+2 >= narg) error->all(FLERR,"Illegal fix command"); + cp_style = CONSTANT; + cp = utils::numeric(FLERR,arg[iarg+2],false,lmp); + if (cp < 0.0) error->all(FLERR,"Illegal fix command"); + iarg += 2; + } else if (strcmp(arg[iarg+1],"type") == 0) { + if (iarg+1+ntypes >= narg) error->all(FLERR,"Illegal fix command"); + cp_style = TYPE; + memory->create(cp_type,ntypes+1,"fix/temp/integrate:cp_type"); + for (int i = 1; i <= ntypes; i++) { + cp_type[i] = utils::numeric(FLERR,arg[iarg+1+i],false,lmp); + if (cp_type[i] < 0.0) error->all(FLERR,"Illegal fix command"); + } + iarg += 1+ntypes; + } else { + error->all(FLERR,"Illegal fix command"); + } + iarg += 1; + } + + if (cp_style == NONE) + error->all(FLERR, "Must specify specific heat in fix temp/integrate"); + dynamic_group_allow = 1; + time_integrate = 1; +} + +/* ---------------------------------------------------------------------- */ + +int FixTempIntegrate::setmask() +{ + int mask = 0; + mask |= FINAL_INTEGRATE; + mask |= FINAL_INTEGRATE_RESPA; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixTempIntegrate::init() +{ + dt = update->dt; + + if (!atom->temperature_flag) + error->all(FLERR,"Fix temp/integrate requires atom style with temperature property"); + if (!atom->heatflux_flag) + error->all(FLERR,"Fix temp/integrate requires atom style with heatflux property"); +} + +/* ---------------------------------------------------------------------- */ + +void FixTempIntegrate::final_integrate() +{ + // update temperature of atoms in group + + double *temperature = atom->temperature; + double *heatflux = atom->heatflux; + double *rmass = atom->rmass; + double *mass = atom->mass; + int *type = atom->type; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + if (rmass) { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + temperature[i] += dt * heatflux[i] / (calc_cp(i) * rmass[i]); + } + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + temperature[i] += dt * heatflux[i] / (calc_cp(i) * mass[type[i]]); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixTempIntegrate::final_integrate_respa(int ilevel, int /*iloop*/) +{ + dt = update->dt; + final_integrate(); +} + +/* ---------------------------------------------------------------------- */ + +void FixTempIntegrate::reset_dt() +{ + dt = update->dt; +} + +/* ---------------------------------------------------------------------- */ + +double FixTempIntegrate::calc_cp(int i) +{ + if (cp_style == TYPE) { + return cp_type[atom->type[i]]; + } else { + return cp; + } +} diff --git a/src/GRANULAR/fix_temp_integrate.h b/src/GRANULAR/fix_temp_integrate.h new file mode 100644 index 0000000000..738cb28a6f --- /dev/null +++ b/src/GRANULAR/fix_temp_integrate.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS +// clang-format off +FixStyle(temp/integrate,FixTempIntegrate); +// clang-format on +#else + +#ifndef LMP_FIX_TEMP_INTEGRATE_H +#define LMP_FIX_TEMP_INTEGRATE_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixTempIntegrate : public Fix { + public: + FixTempIntegrate(class LAMMPS *, int, char **); + + int setmask() override; + void init() override; + void final_integrate() override; + void final_integrate_respa(int, int) override; + void reset_dt() override; + + protected: + double dt; + double cp, *cp_type; + int cp_style; + + int mass_require; + + double calc_cp(int); +}; + +} // namespace LAMMPS_NS + +#endif +#endif diff --git a/src/atom.cpp b/src/atom.cpp index 8b3ab8c75d..ce66742779 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -123,6 +123,8 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) radius = rmass = nullptr; ellipsoid = line = tri = body = nullptr; quat = nullptr; + temperature = nullptr; + heatflux = nullptr; // molecular systems @@ -410,6 +412,9 @@ void Atom::peratom_create() add_peratom("tri",&tri,INT,0); add_peratom("body",&body,INT,0); + add_peratom("temperature",&temperature,DOUBLE,0); + add_peratom("heatflux",&heatflux,DOUBLE,0); + // BPM package add_peratom("quat",&quat,DOUBLE,4); @@ -612,6 +617,7 @@ void Atom::set_atomflag_defaults() molecule_flag = molindex_flag = molatom_flag = 0; q_flag = mu_flag = 0; rmass_flag = radius_flag = omega_flag = torque_flag = angmom_flag = 0; + temperature_flag = heatflux_flag = 0; vfrac_flag = spin_flag = eradius_flag = ervel_flag = erforce_flag = 0; cs_flag = csforce_flag = vforce_flag = ervelforce_flag = etag_flag = 0; rho_flag = esph_flag = cv_flag = vest_flag = 0; @@ -2602,6 +2608,14 @@ length of the data area, and a short description. - double - 4 - four quaternion components of the particles + * - temperature + - double + - 1 + - temperature of the particles + * - heatflux + - double + - 1 + - heatflux of the particles * - i_name - int - 1 @@ -2658,6 +2672,8 @@ void *Atom::extract(const char *name) if (strcmp(name,"tri") == 0) return (void *) tri; if (strcmp(name,"body") == 0) return (void *) body; if (strcmp(name,"quat") == 0) return (void *) quat; + if (strcmp(name,"temperature") == 0) return (void *) temperature; + if (strcmp(name,"heatflux") == 0) return (void *) heatflux; if (strcmp(name,"vfrac") == 0) return (void *) vfrac; if (strcmp(name,"s0") == 0) return (void *) s0; @@ -2781,6 +2797,8 @@ int Atom::extract_datatype(const char *name) if (strcmp(name,"tri") == 0) return LAMMPS_INT; if (strcmp(name,"body") == 0) return LAMMPS_INT; if (strcmp(name,"quat") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"temperature") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"heatflux") == 0) return LAMMPS_DOUBLE; if (strcmp(name,"vfrac") == 0) return LAMMPS_DOUBLE; if (strcmp(name,"s0") == 0) return LAMMPS_DOUBLE; diff --git a/src/atom.h b/src/atom.h index 499e5f0d0f..7ac459317c 100644 --- a/src/atom.h +++ b/src/atom.h @@ -80,6 +80,7 @@ class Atom : protected Pointers { double **omega, **angmom, **torque; int *ellipsoid, *line, *tri, *body; double **quat; + double *temperature, *heatflux; // molecular systems @@ -182,6 +183,7 @@ class Atom : protected Pointers { int molecule_flag, molindex_flag, molatom_flag; int q_flag, mu_flag; int rmass_flag, radius_flag, omega_flag, torque_flag, angmom_flag, quat_flag; + int temperature_flag, heatflux_flag; int vfrac_flag, spin_flag, eradius_flag, ervel_flag, erforce_flag; int cs_flag, csforce_flag, vforce_flag, ervelforce_flag, etag_flag; int rho_flag, esph_flag, cv_flag, vest_flag; diff --git a/src/set.cpp b/src/set.cpp index 2843281d78..7c759873a2 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -47,7 +47,7 @@ enum{ATOM_SELECT,MOL_SELECT,TYPE_SELECT,GROUP_SELECT,REGION_SELECT}; enum{TYPE,TYPE_FRACTION,TYPE_RATIO,TYPE_SUBSET, MOLECULE,X,Y,Z,VX,VY,VZ,CHARGE,MASS,SHAPE,LENGTH,TRI, DIPOLE,DIPOLE_RANDOM,SPIN,SPIN_RANDOM,QUAT,QUAT_RANDOM, - THETA,THETA_RANDOM,ANGMOM,OMEGA, + THETA,THETA_RANDOM,ANGMOM,OMEGA,TEMPERATURE, DIAMETER,DENSITY,VOLUME,IMAGE,BOND,ANGLE,DIHEDRAL,IMPROPER, SPH_E,SPH_CV,SPH_RHO,EDPD_TEMP,EDPD_CV,CC,SMD_MASS_DENSITY, SMD_CONTACT_RADIUS,DPDTHETA,EPSILON,IVEC,DVEC,IARRAY,DARRAY}; @@ -389,6 +389,15 @@ void Set::command(int narg, char **arg) set(DENSITY); iarg += 2; + } else if (strcmp(arg[iarg],"temperature") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); + if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); + if (!atom->temperature_flag) + error->all(FLERR,"Cannot set this attribute for this atom style"); + set(TEMPERATURE); + iarg += 2; + } else if (strcmp(arg[iarg],"volume") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); @@ -768,6 +777,7 @@ void Set::set(int keyword) case SHAPE: case DIAMETER: case DENSITY: + case TEMPERATURE: case QUAT: case IMAGE: if (modify->check_rigid_list_overlap(select)) @@ -1008,6 +1018,13 @@ void Set::set(int keyword) atom->omega[i][2] = zvalue; } + // set temperature of particle + + else if (keyword == ANGMOM) { + if (dvalue < 0.0) error->one(FLERR,"Invalid temperature in set command"); + atom->temperature[i] = dvalue; + } + // reset any or all of 3 image flags else if (keyword == IMAGE) { From 66188d9d572c7671b2a351fda086dee0ee89c37c Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 13 Jun 2022 09:00:15 -0600 Subject: [PATCH 003/112] unified naming scheme --- src/.gitignore | 4 ++-- ...emperature.cpp => atom_vec_sphere_temp.cpp} | 18 +++++++++--------- ...re_temperature.h => atom_vec_sphere_temp.h} | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) rename src/GRANULAR/{atom_vec_sphere_temperature.cpp => atom_vec_sphere_temp.cpp} (91%) rename src/GRANULAR/{atom_vec_sphere_temperature.h => atom_vec_sphere_temp.h} (84%) diff --git a/src/.gitignore b/src/.gitignore index 7a6bc1beb4..acb509551c 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -427,8 +427,8 @@ /atom_vec_oxdna.h /atom_vec_peri.cpp /atom_vec_peri.h -/atom_vec_sphere_temperature.cpp -/atom_vec_sphere_temperature.h +/atom_vec_sphere_temp.cpp +/atom_vec_sphere_temp.h /atom_vec_template.cpp /atom_vec_template.h /body_nparticle.cpp diff --git a/src/GRANULAR/atom_vec_sphere_temperature.cpp b/src/GRANULAR/atom_vec_sphere_temp.cpp similarity index 91% rename from src/GRANULAR/atom_vec_sphere_temperature.cpp rename to src/GRANULAR/atom_vec_sphere_temp.cpp index 5b62a2c279..d4e30e3154 100644 --- a/src/GRANULAR/atom_vec_sphere_temperature.cpp +++ b/src/GRANULAR/atom_vec_sphere_temp.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "atom_vec_sphere_temperature.h" +#include "atom_vec_sphere_temp.h" #include "atom.h" #include "error.h" @@ -25,7 +25,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -AtomVecSphereTemperature::AtomVecSphereTemperature(LAMMPS *lmp) : AtomVec(lmp) +AtomVecSphereTemp::AtomVecSphereTemp(LAMMPS *lmp) : AtomVec(lmp) { mass_type = PER_ATOM; molecular = Atom::ATOMIC; @@ -57,7 +57,7 @@ AtomVecSphereTemperature::AtomVecSphereTemperature(LAMMPS *lmp) : AtomVec(lmp) optional arg = 0/1 for static/dynamic particle radii ------------------------------------------------------------------------- */ -void AtomVecSphereTemperature::process_args(int narg, char **arg) +void AtomVecSphereTemp::process_args(int narg, char **arg) { if (narg != 0 && narg != 1) error->all(FLERR, "Illegal atom_style sphere command"); @@ -81,7 +81,7 @@ void AtomVecSphereTemperature::process_args(int narg, char **arg) /* ---------------------------------------------------------------------- */ -void AtomVecSphereTemperature::init() +void AtomVecSphereTemp::init() { AtomVec::init(); @@ -100,7 +100,7 @@ void AtomVecSphereTemperature::init() needed in replicate when 2 atom classes exist and it calls pack_restart() ------------------------------------------------------------------------- */ -void AtomVecSphereTemperature::grow_pointers() +void AtomVecSphereTemp::grow_pointers() { radius = atom->radius; rmass = atom->rmass; @@ -111,7 +111,7 @@ void AtomVecSphereTemperature::grow_pointers() initialize non-zero atom quantities ------------------------------------------------------------------------- */ -void AtomVecSphereTemperature::create_atom_post(int ilocal) +void AtomVecSphereTemp::create_atom_post(int ilocal) { radius[ilocal] = 0.5; rmass[ilocal] = 4.0 * MY_PI / 3.0 * 0.5 * 0.5 * 0.5; @@ -122,7 +122,7 @@ void AtomVecSphereTemperature::create_atom_post(int ilocal) or initialize other atom quantities ------------------------------------------------------------------------- */ -void AtomVecSphereTemperature::data_atom_post(int ilocal) +void AtomVecSphereTemp::data_atom_post(int ilocal) { radius_one = 0.5 * atom->radius[ilocal]; radius[ilocal] = radius_one; @@ -139,7 +139,7 @@ void AtomVecSphereTemperature::data_atom_post(int ilocal) modify values for AtomVec::pack_data() to pack ------------------------------------------------------------------------- */ -void AtomVecSphereTemperature::pack_data_pre(int ilocal) +void AtomVecSphereTemp::pack_data_pre(int ilocal) { radius_one = radius[ilocal]; rmass_one = rmass[ilocal]; @@ -153,7 +153,7 @@ void AtomVecSphereTemperature::pack_data_pre(int ilocal) unmodify values packed by AtomVec::pack_data() ------------------------------------------------------------------------- */ -void AtomVecSphereTemperature::pack_data_post(int ilocal) +void AtomVecSphereTemp::pack_data_post(int ilocal) { radius[ilocal] = radius_one; rmass[ilocal] = rmass_one; diff --git a/src/GRANULAR/atom_vec_sphere_temperature.h b/src/GRANULAR/atom_vec_sphere_temp.h similarity index 84% rename from src/GRANULAR/atom_vec_sphere_temperature.h rename to src/GRANULAR/atom_vec_sphere_temp.h index 6b1ca6f390..f42b844886 100644 --- a/src/GRANULAR/atom_vec_sphere_temperature.h +++ b/src/GRANULAR/atom_vec_sphere_temp.h @@ -13,20 +13,20 @@ #ifdef ATOM_CLASS // clang-format off -AtomStyle(sphere,AtomVecSphereTemperature); +AtomStyle(sphere/temp,AtomVecSphereTemp); // clang-format on #else -#ifndef LMP_ATOM_VEC_SPHERE_TEMPERATURE_H -#define LMP_ATOM_VEC_SPHERE_TEMPERATURE_H +#ifndef LMP_ATOM_VEC_SPHERE_TEMP_H +#define LMP_ATOM_VEC_SPHERE_TEMP_H #include "atom_vec.h" namespace LAMMPS_NS { -class AtomVecSphereTemperature : public AtomVec { +class AtomVecSphereTemp : public AtomVec { public: - AtomVecSphereTemperature(class LAMMPS *); + AtomVecSphereTemp(class LAMMPS *); void process_args(int, char **) override; void init() override; From c0078fda059b734417d1080ee1b7bb54cdcf77ac Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 14 Jun 2022 09:27:14 -0600 Subject: [PATCH 004/112] Begin refactoring of pair granular --- src/GRANULAR/pair_granular.cpp | 825 ++++++++++----------------------- src/GRANULAR/pair_granular.h | 12 + 2 files changed, 248 insertions(+), 589 deletions(-) diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 013c63172d..34edbc0ae3 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -28,6 +28,7 @@ #include "fix_neigh_history.h" #include "force.h" #include "math_const.h" +#include "math_extra.h" #include "math_special.h" #include "memory.h" #include "modify.h" @@ -149,37 +150,35 @@ PairGranular::~PairGranular() void PairGranular::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; - double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz,nx,ny,nz; + double dx[3],fx[3],nx[3]; double radi,radj,radsum,rsq,r,rinv,factor_lj; double Reff, delta, dR, dR2, dist_to_contact; - double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; - double wr1,wr2,wr3; - double vtr1,vtr2,vtr3,vrel; + double vr[3],vnnr,vn[3],vt[3],wr[3],vtr[3],vrel[3]; + double temp[3], temp_dbl; - double knfac, damp_normal=0.0, damp_normal_prefactor; + double damp_normal=0.0, damp_normal_prefactor; double k_tangential, damp_tangential; double Fne, Ft, Fdamp, Fntot, Fncrit, Fscrit, Frcrit; - double fs, fs1, fs2, fs3, tor1, tor2, tor3; + double magfs, fs[3], tor[3]; double mi,mj,meff; - double relrot1,relrot2,relrot3,vrl1,vrl2,vrl3; + double relrot[3],vrl[3]; - // for JKR - double R2, coh, F_pulloff, delta_pulloff, dist_pulloff, a, a2, E; - double t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3; + ContactModel model; + ContactGeom geom; // rolling double k_roll, damp_roll; - double torroll1, torroll2, torroll3; + int rhist0, rhist1, rhist2; + double torroll[3]; double rollmag, rolldotn, scalefac; - double fr, fr1, fr2, fr3; + double magfr, fr[3]; // twisting double k_twist, damp_twist, mu_twist; double signtwist, magtwist, magtortwist, Mtcrit; - double tortwist1, tortwist2, tortwist3; + double tortwist[3]; double shrmag,rsht,prjmag; bool frameupdate; @@ -236,9 +235,6 @@ void PairGranular::compute(int eflag, int vflag) for (ii = 0; ii < inum; ii++) { i = ilist[ii]; itype = type[i]; - xtmp = x[i][0]; - ytmp = x[i][1]; - ztmp = x[i][2]; itype = type[i]; radi = radius[i]; if (use_history) { @@ -255,30 +251,21 @@ void PairGranular::compute(int eflag, int vflag) if (factor_lj == 0) continue; - delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; + MathExtra::sub3(x[i], x[j], dx); jtype = type[j]; - rsq = delx*delx + dely*dely + delz*delz; + rsq = MathExtra::lensq3(dx); radj = radius[j]; radsum = radi + radj; - - E = normal_coeffs[itype][jtype][0]; Reff = radi*radj/radsum; - touchflag = false; + // Copy data into structures to easily pass to functions + geom.rsq = rsq; + geom.Reff = Reff; + geom.radsum = radsum; + + touchflag = false; if (normal_model[itype][jtype] == JKR) { - E *= THREEQUARTERS; - if (touch[jj]) { - R2 = Reff*Reff; - coh = normal_coeffs[itype][jtype][3]; - a = cbrt(9.0*MY_PI*coh*R2/(4*E)); - delta_pulloff = a*a/Reff - 2*sqrt(MY_PI*coh*a/E); - dist_pulloff = radsum-delta_pulloff; - touchflag = (rsq < dist_pulloff*dist_pulloff); - } else { - touchflag = (rsq < radsum*radsum); - } + touchflag = touch_JKR(touch[jj], geom, model) } else { touchflag = (rsq < radsum*radsum); } @@ -294,22 +281,30 @@ void PairGranular::compute(int eflag, int vflag) r = sqrt(rsq); rinv = 1.0/r; - nx = delx*rinv; - ny = dely*rinv; - nz = delz*rinv; + // Copy data into structures to easily pass to functions + geom.r = r; + geom.rinv = rinv + geom.delta = radsum - r; + geom.dR = geom.delta*Reff; + + model.normal = normal_model[itype][jtype]; + model.damping = damping_model[itype][jtype]; + model.tangential = tangential_model[itype][jtype]; + model.roll = roll_model[itype][jtype]; + model.twist = twist_model[itype][jtype]; + model.E = normal_coeffs[itype][jtype][0]; + model.damp = normal_coeffs[itype][jtype][1]; + model.poisson = normal_coeffs[itype][jtype][2]; + model.coh = normal_coeffs[itype][jtype][3]; + + MathExtra::scale3(rinv, dx, nx); // relative translational velocity - - vr1 = v[i][0] - v[j][0]; - vr2 = v[i][1] - v[j][1]; - vr3 = v[i][2] - v[j][2]; + MathExtra::sub3(v[i], v[j], vr); // normal component - - vnnr = vr1*nx + vr2*ny + vr3*nz; //v_R . n - vn1 = nx*vnnr; - vn2 = ny*vnnr; - vn3 = nz*vnnr; + vnnr = MathExtra::dot3(vr, nx); //v_R . n + MathExtra::scale3(vnnr, nx, vn); // meff = effective mass of pair of particles // if I or J part of rigid body, use body mass @@ -322,60 +317,22 @@ void PairGranular::compute(int eflag, int vflag) if (mass_rigid[j] > 0.0) mj = mass_rigid[j]; } - meff = mi*mj / (mi+mj); + meff = mi * mj / (mi + mj); if (mask[i] & freeze_group_bit) meff = mj; if (mask[j] & freeze_group_bit) meff = mi; - delta = radsum - r; - dR = delta*Reff; - - if (normal_model[itype][jtype] == JKR) { + if (model.normal == JKR) { touch[jj] = 1; - R2=Reff*Reff; - coh = normal_coeffs[itype][jtype][3]; - dR2 = dR*dR; - t0 = coh*coh*R2*R2*E; - t1 = PI27SQ*t0; - t2 = 8*dR*dR2*E*E*E; - t3 = 4*dR2*E; - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0*(t1+2*t2)); - t4 = cbrt(t1+t2+THREEROOT3*MY_PI*sqrt(sqrt1)); - t5 = t3/t4 + t4/E; - sqrt2 = MAX(0, 2*dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4*dR - t5 + SIXROOT6*coh*MY_PI*R2/(E*t6)); - a = INVROOT6*(t6 + sqrt(sqrt3)); - a2 = a*a; - knfac = normal_coeffs[itype][jtype][0]*a; - Fne = knfac*a2/Reff - MY_2PI*a2*sqrt(4*coh*E/(MY_PI*a)); + normal_JKR(Fne, Fncrit, geom, model); + } else if (model.normal == DMT) { + normal_DMT(Fne, Fncrit, geom, model); } else { - knfac = E; // Hooke - Fne = knfac*delta; - a = sqrt(dR); - if (normal_model[itype][jtype] != HOOKE) { - Fne *= a; - knfac *= a; - } - if (normal_model[itype][jtype] == DMT) - Fne -= 4*MY_PI*normal_coeffs[itype][jtype][3]*Reff; + normal_hooke(Fne, Fncrit, geom, model); } // NOTE: consider restricting Hooke to only have // 'velocity' as an option for damping? - - if (damping_model[itype][jtype] == VELOCITY) { - damp_normal = 1; - } else if (damping_model[itype][jtype] == MASS_VELOCITY) { - damp_normal = meff; - } else if (damping_model[itype][jtype] == VISCOELASTIC) { - damp_normal = a*meff; - } else if (damping_model[itype][jtype] == TSUJI) { - damp_normal = sqrt(meff*knfac); - } else damp_normal = 0.0; - - damp_normal_prefactor = normal_coeffs[itype][jtype][1]*damp_normal; - Fdamp = -damp_normal_prefactor*vnnr; + Fdamp = normal_damping(vnnr, meff, geom, model); Fntot = Fne + Fdamp; if (limit_damping[itype][jtype] && (Fntot < 0.0)) Fntot = 0.0; @@ -391,21 +348,15 @@ void PairGranular::compute(int eflag, int vflag) // history = cumulative tangential elastic force // tangential component - vt1 = vr1 - vn1; - vt2 = vr2 - vn2; - vt3 = vr3 - vn3; + MathExtra::sub3(vr, vn, vt); // relative rotational velocity - wr1 = (radi*omega[i][0] + radj*omega[j][0]); - wr2 = (radi*omega[i][1] + radj*omega[j][1]); - wr3 = (radi*omega[i][2] + radj*omega[j][2]); + MathExtra::scaleadd3(radi, omega[i], radj, omega[j], wr); // relative tangential velocities - vtr1 = vt1 - (nz*wr2-ny*wr3); - vtr2 = vt2 - (nx*wr3-nz*wr1); - vtr3 = vt3 - (ny*wr1-nx*wr2); - vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3; - vrel = sqrt(vrel); + MathExtra::cross3(wr, nx, temp); + MathExtra::sub3(vt, temp, vtr); + vrel = MathExtra::len(vtr); // if any history is needed if (use_history) { @@ -413,20 +364,13 @@ void PairGranular::compute(int eflag, int vflag) history = &allhistory[size_history*jj]; } - if (normal_model[itype][jtype] == JKR) { - F_pulloff = 3*MY_PI*coh*Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } else if (normal_model[itype][jtype] == DMT) { - F_pulloff = 4*MY_PI*coh*Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } else { - Fncrit = fabs(Fntot); - } - Fscrit = tangential_coeffs[itype][jtype][2] * Fncrit; + Fncrit = critical_normal(Fne, Fntot, geom, model); + Fscrit = model.poisson * Fncrit; //------------------------------ // tangential forces //------------------------------ + k_tangential = tangential_coeffs[itype][jtype][0]; damp_tangential = tangential_coeffs[itype][jtype][1] * damp_normal_prefactor; @@ -443,9 +387,7 @@ void PairGranular::compute(int eflag, int vflag) // on unloading, rescale the shear displacements/force if (a < history[3]) { double factor = a/history[3]; - history[0] *= factor; - history[1] *= factor; - history[2] *= factor; + MathExtra::scale3(history, factor); } } // rotate and update displacements / force. @@ -455,40 +397,33 @@ void PairGranular::compute(int eflag, int vflag) if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_FORCE || tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE_FORCE) - frameupdate = fabs(rsht) > EPSILON*Fscrit; + frameupdate = fabs(rsht) > EPSILON * Fscrit; else - frameupdate = fabs(rsht)*k_tangential > EPSILON*Fscrit; + frameupdate = fabs(rsht) * k_tangential > EPSILON * Fscrit; if (frameupdate) { shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + history[2]*history[2]); // projection - history[0] -= rsht*nx; - history[1] -= rsht*ny; - history[2] -= rsht*nz; + MathExtra::scale3(rsht, nx, history); // also rescale to preserve magnitude - prjmag = sqrt(history[0]*history[0] + history[1]*history[1] + - history[2]*history[2]); + prjmag = MathExtra::len3(history); if (prjmag > 0) scalefac = shrmag/prjmag; else scalefac = 0; - history[0] *= scalefac; - history[1] *= scalefac; - history[2] *= scalefac; + MathExtra::scale3(scalefac, history); } // update history if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { // tangential displacement - history[0] += vtr1*dt; - history[1] += vtr2*dt; - history[2] += vtr3*dt; + MathExtra::scale3(dt, vtr, temp); + MathExtra::add3(temp, history, history); } else { // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - history[0] -= k_tangential*vtr1*dt; - history[1] -= k_tangential*vtr2*dt; - history[2] -= k_tangential*vtr3*dt; + MathExtra::scale3(k_tangential*dt, vtr, temp); + MathExtra::sub3(history, temp, history); } if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE || tangential_model[itype][jtype] == @@ -497,58 +432,41 @@ void PairGranular::compute(int eflag, int vflag) } // tangential forces = history + tangential velocity damping + MathExtra::scale3(-damp_tangential, vtr, fs); if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { - fs1 = -k_tangential*history[0] - damp_tangential*vtr1; - fs2 = -k_tangential*history[1] - damp_tangential*vtr2; - fs3 = -k_tangential*history[2] - damp_tangential*vtr3; - } else { - fs1 = history[0] - damp_tangential*vtr1; - fs2 = history[1] - damp_tangential*vtr2; - fs3 = history[2] - damp_tangential*vtr3; + MathExtra::scale3(-k_tangential, history, temp); + MathExtra::add3(fs, temp, fs); } // rescale frictional displacements and forces if needed - fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3); + magfs = MathExtra::len3(fs); if (fs > Fscrit) { - shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + - history[2]*history[2]); + shrmag = MathExtra::len3(history); if (shrmag != 0.0) { + history[0] = Fscrit*fs[0]/magfs + damp_tangential*vtr[0]; + history[1] = Fscrit*fs[1]/magfs + damp_tangential*vtr[1]; + history[2] = Fscrit*fs[2]/magfs + damp_tangential*vtr[2]; if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { - history[0] = -1.0/k_tangential*(Fscrit*fs1/fs + - damp_tangential*vtr1); - history[1] = -1.0/k_tangential*(Fscrit*fs2/fs + - damp_tangential*vtr2); - history[2] = -1.0/k_tangential*(Fscrit*fs3/fs + - damp_tangential*vtr3); - } else { - history[0] = Fscrit*fs1/fs + damp_tangential*vtr1; - history[1] = Fscrit*fs2/fs + damp_tangential*vtr2; - history[2] = Fscrit*fs3/fs + damp_tangential*vtr3; + MathExtra::scale3(-1.0/k_tangential, history); } - fs1 *= Fscrit/fs; - fs2 *= Fscrit/fs; - fs3 *= Fscrit/fs; - } else fs1 = fs2 = fs3 = 0.0; + MathExtra::scale3(Fscrit/magfs, fs); + } else MathExtra::zero3(fs); } } else { // classic pair gran/hooke (no history) fs = damp_tangential*vrel; if (vrel != 0.0) Ft = MIN(Fscrit,fs) / vrel; else Ft = 0.0; - fs1 = -Ft*vtr1; - fs2 = -Ft*vtr2; - fs3 = -Ft*vtr3; + MathExtra::scale3(-Ft, vtr, fs); } if (roll_model[itype][jtype] != ROLL_NONE || twist_model[itype][jtype] != TWIST_NONE) { - relrot1 = omega[i][0] - omega[j][0]; - relrot2 = omega[i][1] - omega[j][1]; - relrot3 = omega[i][2] - omega[j][2]; + MathExtra::sub3(omega[i], omega[j], relrot); } //**************************************** // rolling resistance @@ -560,64 +478,63 @@ void PairGranular::compute(int eflag, int vflag) // this is different from the Marshall papers, // which use the Bagi/Kuhn formulation // for rolling velocity (see Wang et al for why the latter is wrong) - vrl1 = Reff*(relrot2*nz - relrot3*ny); - vrl2 = Reff*(relrot3*nx - relrot1*nz); - vrl3 = Reff*(relrot1*ny - relrot2*nx); + vrl[0] = Reff * (relrot[1] * n[2] - relrot[2] * nx[1]); + vrl[1] = Reff * (relrot[2] * n[0] - relrot[0] * nx[2]); + vrl[2] = Reff * (relrot[0] * n[1] - relrot[1] * nx[0]); - int rhist0 = roll_history_index; - int rhist1 = rhist0 + 1; - int rhist2 = rhist1 + 1; + rhist0 = roll_history_index; + rhist1 = rhist0 + 1; + rhist2 = rhist1 + 1; k_roll = roll_coeffs[itype][jtype][0]; damp_roll = roll_coeffs[itype][jtype][1]; Frcrit = roll_coeffs[itype][jtype][2] * Fncrit; if (historyupdate) { - rolldotn = history[rhist0]*nx + history[rhist1]*ny + history[rhist2]*nz; + temp[0] = history[rhist0]; + temp[1] = history[rhist1]; + temp[2] = history[rhist2]; + rolldotn = MathExtra::dot3(temp, nx); frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; if (frameupdate) { // rotate into tangential plane - rollmag = sqrt(history[rhist0]*history[rhist0] + - history[rhist1]*history[rhist1] + - history[rhist2]*history[rhist2]); + rollmag = MathExtra::len3(temp); // projection - history[rhist0] -= rolldotn*nx; - history[rhist1] -= rolldotn*ny; - history[rhist2] -= rolldotn*nz; + temp[0] -= rolldotn*nx[0]; + temp[1] -= rolldotn*nx[1]; + temp[2] -= rolldotn*nx[2]; // also rescale to preserve magnitude - prjmag = sqrt(history[rhist0]*history[rhist0] + - history[rhist1]*history[rhist1] + - history[rhist2]*history[rhist2]); + prjmag = MathExtra::len3(temp); if (prjmag > 0) scalefac = rollmag/prjmag; else scalefac = 0; - history[rhist0] *= scalefac; - history[rhist1] *= scalefac; - history[rhist2] *= scalefac; + MathExtra::scale3(scalefac, temp); } - history[rhist0] += vrl1*dt; - history[rhist1] += vrl2*dt; - history[rhist2] += vrl3*dt; + temp[0] += vrl[0]*dt; + temp[1] += vrl[1]*dt; + temp[2] += vrl[2]*dt; } - fr1 = -k_roll*history[rhist0] - damp_roll*vrl1; - fr2 = -k_roll*history[rhist1] - damp_roll*vrl2; - fr3 = -k_roll*history[rhist2] - damp_roll*vrl3; + fr[0] = -k_roll*temp[0] - damp_roll*vrl[0]; + fr[1] = -k_roll*temp[1] - damp_roll*vrl[1]; + fr[2] = -k_roll*temp[2] - damp_roll*vrl[2]; // rescale frictional displacements and forces if needed - fr = sqrt(fr1*fr1 + fr2*fr2 + fr3*fr3); - if (fr > Frcrit) { - rollmag = sqrt(history[rhist0]*history[rhist0] + - history[rhist1]*history[rhist1] + - history[rhist2]*history[rhist2]); + magfr = MathExtra::len3(fr); + if (magfr > Frcrit) { + rollmag = MathExtra::len3(temp); if (rollmag != 0.0) { - history[rhist0] = -1.0/k_roll*(Frcrit*fr1/fr + damp_roll*vrl1); - history[rhist1] = -1.0/k_roll*(Frcrit*fr2/fr + damp_roll*vrl2); - history[rhist2] = -1.0/k_roll*(Frcrit*fr3/fr + damp_roll*vrl3); - fr1 *= Frcrit/fr; - fr2 *= Frcrit/fr; - fr3 *= Frcrit/fr; - } else fr1 = fr2 = fr3 = 0.0; + temp[0] = -1.0/k_roll*(Frcrit*fr[0]/magfr + damp_roll*vrl[0]); + temp[1] = -1.0/k_roll*(Frcrit*fr[1]/magfr + damp_roll*vrl[1]); + temp[2] = -1.0/k_roll*(Frcrit*fr[2]/magfr + damp_roll*vrl[2]); + fr[0] *= Frcrit/magfr; + fr[1] *= Frcrit/magfr; + fr[2] *= Frcrit/magfr; + } else MathExtra::zero3(fr); } + + history[rhist0] = temp[0]; + history[rhist1] = temp[1]; + history[rhist2] = temp[2]; } //**************************************** @@ -626,7 +543,7 @@ void PairGranular::compute(int eflag, int vflag) if (twist_model[itype][jtype] != TWIST_NONE) { // omega_T (eq 29 of Marshall) - magtwist = relrot1*nx + relrot2*ny + relrot3*nz; + magtwist = MathExtra::dot3(relrot, nx); if (twist_model[itype][jtype] == TWIST_MARSHALL) { k_twist = 0.5*k_tangential*a*a;; // eq 32 of Marshall paper damp_twist = 0.5*damp_tangential*a*a; @@ -652,72 +569,45 @@ void PairGranular::compute(int eflag, int vflag) // apply forces & torques - fx = nx*Fntot + fs1; - fy = ny*Fntot + fs2; - fz = nz*Fntot + fs3; - fx *= factor_lj; - fy *= factor_lj; - fz *= factor_lj; + MathExtra::scale3(Fntot, nx, fx); + MathExtra::add3(fx, fs, fx); + MathExtra::scale3(factor_lj, fx); + MathExtra::add3(f[i], fx, f[i]); - f[i][0] += fx; - f[i][1] += fy; - f[i][2] += fz; - - tor1 = ny*fs3 - nz*fs2; - tor2 = nz*fs1 - nx*fs3; - tor3 = nx*fs2 - ny*fs1; - tor1 *= factor_lj; - tor2 *= factor_lj; - tor3 *= factor_lj; + MathExtra::cross3(nx, fs, tor); + MathExtra::scale3(factor_lj, tor); dist_to_contact = radi-0.5*delta; - torque[i][0] -= dist_to_contact*tor1; - torque[i][1] -= dist_to_contact*tor2; - torque[i][2] -= dist_to_contact*tor3; + MathExtra::scale3(dist_to_contact, tor, temp); + MathExtra::sub3(torque[i], temp, torque[i]); if (twist_model[itype][jtype] != TWIST_NONE) { - tortwist1 = magtortwist * nx * factor_lj; - tortwist2 = magtortwist * ny * factor_lj; - tortwist3 = magtortwist * nz * factor_lj; - - torque[i][0] += tortwist1; - torque[i][1] += tortwist2; - torque[i][2] += tortwist3; + MathExtra::scale3(magtortwist, nx, tortwist); + MathExtra::scale3(factor_lj, tortwist); + MathExtra::add3(torque[i], tortwist, torque[i]); } if (roll_model[itype][jtype] != ROLL_NONE) { - torroll1 = Reff*(ny*fr3 - nz*fr2) * factor_lj; // n cross fr - torroll2 = Reff*(nz*fr1 - nx*fr3) * factor_lj; - torroll3 = Reff*(nx*fr2 - ny*fr1) * factor_lj; - - torque[i][0] += torroll1; - torque[i][1] += torroll2; - torque[i][2] += torroll3; + MathExtra::cross3(nx, fr, torroll); + MathExtra::scale3(Reff, torroll); + MathExtra::scale3(factor_lj, torroll); + MathExtra::add3(torque[i], torroll, torque[i]); } if (force->newton_pair || j < nlocal) { - f[j][0] -= fx; - f[j][1] -= fy; - f[j][2] -= fz; + MathExtra::sub3(f[j], fx, f[j]); dist_to_contact = radj-0.5*delta; - torque[j][0] -= dist_to_contact*tor1; - torque[j][1] -= dist_to_contact*tor2; - torque[j][2] -= dist_to_contact*tor3; + MathExtra::scale3(dist_to_contact, tor, temp); + MathExtra::sub3(torque[j], tor, torque[j]); - if (twist_model[itype][jtype] != TWIST_NONE) { - torque[j][0] -= tortwist1; - torque[j][1] -= tortwist2; - torque[j][2] -= tortwist3; - } - if (roll_model[itype][jtype] != ROLL_NONE) { - torque[j][0] -= torroll1; - torque[j][1] -= torroll2; - torque[j][2] -= torroll3; - } + if (twist_model[itype][jtype] != TWIST_NONE) + MathExtra::sub3(torque[j], tortwist, torque[j]); + if (roll_model[itype][jtype] != ROLL_NONE) + MathExtra::sub3(torque[j], torroll, torque[j]); } if (evflag) ev_tally_xyz(i,j,nlocal,force->newton_pair, - 0.0,0.0,fx,fy,fz,delx,dely,delz); + 0.0,0.0,fx[0],fx[1],fx[2],dx[0],dy[1],dx[2]); } } } @@ -1389,346 +1279,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, double rsq, double /* factor_coul */, double /* factor_lj */, double &fforce) { - double radi,radj,radsum; - double r,rinv,delx,dely,delz, nx, ny, nz, Reff; - double dR, dR2; - double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3,wr1,wr2,wr3; - double vtr1,vtr2,vtr3,vrel; - double mi,mj,meff; - double relrot1,relrot2,relrot3,vrl1,vrl2,vrl3; - double knfac, damp_normal, damp_normal_prefactor; - double k_tangential, damp_tangential; - double Fne, Ft, Fdamp, Fntot, Fncrit, Fscrit, Frcrit; - double fs, fs1, fs2, fs3; - - // for JKR - double R2, coh, F_pulloff, delta_pulloff, dist_pulloff, a, a2, E; - double delta, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3; - - // rolling - double k_roll, damp_roll; - double rollmag; - double fr, fr1, fr2, fr3; - - // twisting - double k_twist, damp_twist, mu_twist; - double signtwist, magtwist, magtortwist, Mtcrit; - - double shrmag; - int jnum; - int *jlist; - double *history,*allhistory; - - int nall = atom->nlocal + atom->nghost; - if ((i >= nall) || (j >= nall)) - error->all(FLERR,"Not enough atoms for pair granular single function"); - - double *radius = atom->radius; - radi = radius[i]; - radj = radius[j]; - radsum = radi + radj; - Reff = (radsum > 0.0) ? radi*radj/radsum : 0.0; - - bool touchflag; - E = normal_coeffs[itype][jtype][0]; - if (normal_model[itype][jtype] == JKR) { - E *= THREEQUARTERS; - R2 = Reff*Reff; - coh = normal_coeffs[itype][jtype][3]; - a = cbrt(9.0*MY_PI*coh*R2/(4*E)); - delta_pulloff = a*a/Reff - 2*sqrt(MY_PI*coh*a/E); - dist_pulloff = radsum+delta_pulloff; - touchflag = (rsq <= dist_pulloff*dist_pulloff); - } else touchflag = (rsq <= radsum*radsum); - - if (!touchflag) { - fforce = 0.0; - for (int m = 0; m < single_extra; m++) svector[m] = 0.0; - return 0.0; - } - - double **x = atom->x; - delx = x[i][0] - x[j][0]; - dely = x[i][1] - x[j][1]; - delz = x[i][2] - x[j][2]; - r = sqrt(rsq); - rinv = 1.0/r; - - nx = delx*rinv; - ny = dely*rinv; - nz = delz*rinv; - - // relative translational velocity - - double **v = atom->v; - vr1 = v[i][0] - v[j][0]; - vr2 = v[i][1] - v[j][1]; - vr3 = v[i][2] - v[j][2]; - - // normal component - - vnnr = vr1*nx + vr2*ny + vr3*nz; - vn1 = nx*vnnr; - vn2 = ny*vnnr; - vn3 = nz*vnnr; - - // tangential component - - vt1 = vr1 - vn1; - vt2 = vr2 - vn2; - vt3 = vr3 - vn3; - - // relative rotational velocity - - double **omega = atom->omega; - wr1 = (radi*omega[i][0] + radj*omega[j][0]); - wr2 = (radi*omega[i][1] + radj*omega[j][1]); - wr3 = (radi*omega[i][2] + radj*omega[j][2]); - - // meff = effective mass of pair of particles - // if I or J part of rigid body, use body mass - // if I or J is frozen, meff is other particle - - double *rmass = atom->rmass; - int *mask = atom->mask; - - mi = rmass[i]; - mj = rmass[j]; - if (fix_rigid) { - // NOTE: ensure mass_rigid is current for owned+ghost atoms? - if (mass_rigid[i] > 0.0) mi = mass_rigid[i]; - if (mass_rigid[j] > 0.0) mj = mass_rigid[j]; - } - - meff = mi*mj / (mi+mj); - if (mask[i] & freeze_group_bit) meff = mj; - if (mask[j] & freeze_group_bit) meff = mi; - - delta = radsum - r; - dR = delta*Reff; - if (normal_model[itype][jtype] == JKR) { - dR2 = dR*dR; - t0 = coh*coh*R2*R2*E; - t1 = PI27SQ*t0; - t2 = 8*dR*dR2*E*E*E; - t3 = 4*dR2*E; - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0*(t1+2*t2)); - t4 = cbrt(t1+t2+THREEROOT3*MY_PI*sqrt(sqrt1)); - t5 = t3/t4 + t4/E; - sqrt2 = MAX(0, 2*dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4*dR - t5 + SIXROOT6*coh*MY_PI*R2/(E*t6)); - a = INVROOT6*(t6 + sqrt(sqrt3)); - a2 = a*a; - knfac = normal_coeffs[itype][jtype][0]*a; - Fne = knfac*a2/Reff - MY_2PI*a2*sqrt(4*coh*E/(MY_PI*a)); - } else { - knfac = E; - Fne = knfac*delta; - a = sqrt(dR); - if (normal_model[itype][jtype] != HOOKE) { - Fne *= a; - knfac *= a; - } - if (normal_model[itype][jtype] == DMT) - Fne -= 4*MY_PI*normal_coeffs[itype][jtype][3]*Reff; - } - - if (damping_model[itype][jtype] == VELOCITY) { - damp_normal = 1; - } else if (damping_model[itype][jtype] == MASS_VELOCITY) { - damp_normal = meff; - } else if (damping_model[itype][jtype] == VISCOELASTIC) { - damp_normal = a*meff; - } else if (damping_model[itype][jtype] == TSUJI) { - damp_normal = sqrt(meff*knfac); - } else damp_normal = 0.0; - - damp_normal_prefactor = normal_coeffs[itype][jtype][1]*damp_normal; - Fdamp = -damp_normal_prefactor*vnnr; - - Fntot = Fne + Fdamp; - if (limit_damping[itype][jtype] && (Fntot < 0.0)) Fntot = 0.0; - - jnum = list->numneigh[i]; - jlist = list->firstneigh[i]; - - if (use_history) { - if ((fix_history == nullptr) || (fix_history->firstvalue == nullptr)) - error->one(FLERR,"Pair granular single computation needs history"); - allhistory = fix_history->firstvalue[i]; - for (int jj = 0; jj < jnum; jj++) { - neighprev++; - if (neighprev >= jnum) neighprev = 0; - if (jlist[neighprev] == j) break; - } - history = &allhistory[size_history*neighprev]; - } - - //**************************************** - // tangential force, including history effects - //**************************************** - - // For linear, mindlin, mindlin_rescale: - // history = cumulative tangential displacement - // - // For mindlin/force, mindlin_rescale/force: - // history = cumulative tangential elastic force - - // tangential component - vt1 = vr1 - vn1; - vt2 = vr2 - vn2; - vt3 = vr3 - vn3; - - // relative rotational velocity - wr1 = (radi*omega[i][0] + radj*omega[j][0]); - wr2 = (radi*omega[i][1] + radj*omega[j][1]); - wr3 = (radi*omega[i][2] + radj*omega[j][2]); - - // relative tangential velocities - vtr1 = vt1 - (nz*wr2-ny*wr3); - vtr2 = vt2 - (nx*wr3-nz*wr1); - vtr3 = vt3 - (ny*wr1-nx*wr2); - vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3; - vrel = sqrt(vrel); - - if (normal_model[itype][jtype] == JKR) { - F_pulloff = 3*MY_PI*coh*Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } else if (normal_model[itype][jtype] == DMT) { - F_pulloff = 4*MY_PI*coh*Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } else { - Fncrit = fabs(Fntot); - } - Fscrit = tangential_coeffs[itype][jtype][2] * Fncrit; - - //------------------------------ - // tangential forces - //------------------------------ - k_tangential = tangential_coeffs[itype][jtype][0]; - damp_tangential = tangential_coeffs[itype][jtype][1]*damp_normal_prefactor; - - if (tangential_history) { - if (tangential_model[itype][jtype] != TANGENTIAL_HISTORY) { - k_tangential *= a; - } - - shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + - history[2]*history[2]); - - // tangential forces = history + tangential velocity damping - if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { - fs1 = -k_tangential*history[0] - damp_tangential*vtr1; - fs2 = -k_tangential*history[1] - damp_tangential*vtr2; - fs3 = -k_tangential*history[2] - damp_tangential*vtr3; - } else { - fs1 = history[0] - damp_tangential*vtr1; - fs2 = history[1] - damp_tangential*vtr2; - fs3 = history[2] - damp_tangential*vtr3; - } - - // rescale frictional forces if needed - fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3); - if (fs > Fscrit) { - if (shrmag != 0.0) { - fs1 *= Fscrit/fs; - fs2 *= Fscrit/fs; - fs3 *= Fscrit/fs; - fs *= Fscrit/fs; - } else fs1 = fs2 = fs3 = fs = 0.0; - } - - // classic pair gran/hooke (no history) - } else { - fs = damp_tangential*vrel; - if (vrel != 0.0) Ft = MIN(Fscrit,fs) / vrel; - else Ft = 0.0; - fs1 = -Ft*vtr1; - fs2 = -Ft*vtr2; - fs3 = -Ft*vtr3; - fs = Ft*vrel; - } - - //**************************************** - // rolling resistance - //**************************************** - - if ((roll_model[itype][jtype] != ROLL_NONE) - || (twist_model[itype][jtype] != TWIST_NONE)) { - relrot1 = omega[i][0] - omega[j][0]; - relrot2 = omega[i][1] - omega[j][1]; - relrot3 = omega[i][2] - omega[j][2]; - - // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) - // this is different from the Marshall papers, - // which use the Bagi/Kuhn formulation - // for rolling velocity (see Wang et al for why the latter is wrong) - - vrl1 = Reff*(relrot2*nz - relrot3*ny); //- 0.5*((radj-radi)/radsum)*vtr1; - vrl2 = Reff*(relrot3*nx - relrot1*nz); //- 0.5*((radj-radi)/radsum)*vtr2; - vrl3 = Reff*(relrot1*ny - relrot2*nx); //- 0.5*((radj-radi)/radsum)*vtr3; - - int rhist0 = roll_history_index; - int rhist1 = rhist0 + 1; - int rhist2 = rhist1 + 1; - - // rolling displacement - rollmag = sqrt(history[rhist0]*history[rhist0] + - history[rhist1]*history[rhist1] + - history[rhist2]*history[rhist2]); - - k_roll = roll_coeffs[itype][jtype][0]; - damp_roll = roll_coeffs[itype][jtype][1]; - fr1 = -k_roll*history[rhist0] - damp_roll*vrl1; - fr2 = -k_roll*history[rhist1] - damp_roll*vrl2; - fr3 = -k_roll*history[rhist2] - damp_roll*vrl3; - - // rescale frictional displacements and forces if needed - Frcrit = roll_coeffs[itype][jtype][2] * Fncrit; - - fr = sqrt(fr1*fr1 + fr2*fr2 + fr3*fr3); - if (fr > Frcrit) { - if (rollmag != 0.0) { - fr1 *= Frcrit/fr; - fr2 *= Frcrit/fr; - fr3 *= Frcrit/fr; - fr *= Frcrit/fr; - } else fr1 = fr2 = fr3 = fr = 0.0; - } - } else fr1 = fr2 = fr3 = fr = 0.0; - - //**************************************** - // twisting torque, including history effects - //**************************************** - - if (twist_model[itype][jtype] != TWIST_NONE) { - // omega_T (eq 29 of Marshall) - magtwist = relrot1*nx + relrot2*ny + relrot3*nz; - if (twist_model[itype][jtype] == TWIST_MARSHALL) { - k_twist = 0.5*k_tangential*a*a;; //eq 32 - damp_twist = 0.5*damp_tangential*a*a; - mu_twist = TWOTHIRDS*a*tangential_coeffs[itype][jtype][2];; - } else { - k_twist = twist_coeffs[itype][jtype][0]; - damp_twist = twist_coeffs[itype][jtype][1]; - mu_twist = twist_coeffs[itype][jtype][2]; - } - // M_t torque (eq 30) - magtortwist = -k_twist*history[twist_history_index] - damp_twist*magtwist; - signtwist = (magtwist > 0) - (magtwist < 0); - Mtcrit = mu_twist*Fncrit; // critical torque (eq 44) - if (fabs(magtortwist) > Mtcrit) { - magtortwist = -Mtcrit * signtwist; // eq 34 - } else magtortwist = 0.0; - } else magtortwist = 0.0; - - // set force and return no energy fforce = Fntot*rinv; @@ -1889,3 +1440,99 @@ double PairGranular::radii2cut(double r1, double r2) return cut; } + +double PairGranular::touch_JKR(int touch, ContactGeom geom, ContactModel model) +{ + double E, R2, a, delta_pulloff, dist_pulloff; + bool touchflag; + E = model.E; + E *= THREEQUARTERS; + if (touch) { + R2 = geom.Reff * geom.Reff; + a = cbrt(9.0 * MY_PI * model.coh * R2 / (4 * E)); + delta_pulloff = a * a / Reff - 2 * sqrt(MY_PI * coh * a / E); + dist_pulloff = geom.radsum - delta_pulloff; + touchflag = (geom.rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (geom.rsq < geom.radsum * geom.radsum); + } + return touchflag; +} + +void PairGranular::normal_JKR(double &Fne, ContactGeom geom, ContactModel model) +{ + double R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff; + + R2 = geom.Reff * geom.Reff; + dR2 = geom.dR * geom.dR; + t0 = model.coh * model.coh * R2 * R2 * model.E; + t1 = PI27SQ*t0; + t2 = 8 * geom.dR * dR2 * model.E * model.E * model.E; + t3 = 4 * dR2 * E; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / E; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * model.coh * MY_PI * R2 / (model.E * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + + Fne = model.E * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * model.coh * model.E / (MY_PI * a)); + model.a = a; + model.knfac = model.E*a; +} + +void PairGraunular::normal_DMT(double &Fne, ContactGeom geom, ContactModel model) +{ + double a = sqrt(geom.dR); + Fne = a * model.E * geom.delta; + Fne -= 4 * MY_PI * model.coh * geom.Reff; + F_pulloff = 4 * MY_PI * model.coh * geom.Reff; + model.a = a; + model.knfact = model.E * a; +} + +void PairGraunular::normal_Hooke(double &Fne, ContactGeom geom, ContactModel model) +{ + double a = sqrt(geom.dR); + Fne = model.E * geom.delta; + if (model.normal != HOOKE) Fne *= a; + model.a = a; + model.knfac = model.E; + if (model.normal != HOOKE) model.knfac *= a; +} + +double PairGranular::normal_damping(double vnnr, double meff, ContactGeom geom, ContactModel model) +{ + double damp_normal, a; + if (model.damping == VELOCITY) { + damp_normal = 1; + } else if (model.damping == MASS_VELOCITY) { + damp_normal = meff; + } else if (model.damping == VISCOELASTIC) { + damp_normal = model.a * meff; + } else if (model.damping == TSUJI) { + damp_normal = sqrt(meff * model.knfac); + } else damp_normal = 0.0; + + damp_normal_prefactor = model.damp * damp_normal; + return -damp_normal_prefactor * vnnr; +} + +double PairGranular::critical_normal(double Fne, double Fntot, ContactGeom geom, Contactmodel model) +{ + if (model.normal == JKR) { + F_pulloff = 3*MY_PI*model.coh*geom.Reff; + Fncrit = fabs(Fne + 2*F_pulloff); + } else if (model.normal == DMT) { + F_pulloff = 4*MY_PI*model.coh*geom.Reff; + Fncrit = fabs(Fne + 2*F_pulloff); + } else { + Fncrit = fabs(Fntot); + } + return Fncrit; +} \ No newline at end of file diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 5c3edf30a2..896db15231 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -100,6 +100,18 @@ class PairGranular : public Pair { double mix_stiffnessG(double, double, double, double); double mix_geom(double, double); double pulloff_distance(double, double, int, int); + + // Structure to store details of model + struct ContactModel { + int normal, damping, tangential, roll, twist; + double E, damp, poisson, coh; + double a, knfac; + }; + + struct ContactGeom { + double r, rinv, rsq, Reff, radsum; + double delta, dR; + } }; } // namespace LAMMPS_NS From 68e00a60bd8be2c55cb97a3e95156313ff766705 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 15 Jun 2022 12:37:02 -0600 Subject: [PATCH 005/112] Fixing rare bug in writing restart files with history --- src/fix_neigh_history.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 7413b590a7..613716c9a4 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -351,7 +351,9 @@ void FixNeighHistory::pre_exchange_newton() // 1st loop over neighbor list // calculate npartner for owned+ghost atoms - for (i = 0; i < nall_neigh; i++) npartner[i] = 0; + // Ensure npartner is zeroed across all atoms, nall_neigh can be less than nall + // when writing restarts when comm calls are made but modify->post_neighbor() isn't + for (i = 0; i < MAX(nall_neigh, atom->nall); i++) npartner[i] = 0; tagint *tag = atom->tag; NeighList *list = pair->list; @@ -406,7 +408,7 @@ void FixNeighHistory::pre_exchange_newton() // store partner IDs and values for owned+ghost atoms // re-zero npartner to use as counter - for (i = 0; i < nall_neigh; i++) npartner[i] = 0; + for (i = 0; i < MAX(nall_neigh, atom->nall); i++) npartner[i] = 0; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; From 468a6d9f29d46c6a149777fe2cafed9d0f9d276b Mon Sep 17 00:00:00 2001 From: jtclemm Date: Thu, 16 Jun 2022 14:27:57 -0600 Subject: [PATCH 006/112] creating ContactModel class --- src/GRANULAR/contact.cpp | 624 +++++++++++++++++++++++++ src/GRANULAR/contact.h | 73 +++ src/GRANULAR/pair_granular.cpp | 810 ++++++++------------------------- src/GRANULAR/pair_granular.h | 28 +- src/contact.cpp | 58 +++ src/contact.h | 50 ++ src/contact_model.cpp | 58 +++ src/contact_model.h | 35 ++ 8 files changed, 1101 insertions(+), 635 deletions(-) create mode 100644 src/GRANULAR/contact.cpp create mode 100644 src/GRANULAR/contact.h create mode 100644 src/contact.cpp create mode 100644 src/contact.h create mode 100644 src/contact_model.cpp create mode 100644 src/contact_model.h diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp new file mode 100644 index 0000000000..3cea933370 --- /dev/null +++ b/src/GRANULAR/contact.cpp @@ -0,0 +1,624 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- + + This class contains a series of tools for DEM contacts + Multiple models can be defined and used to calculate forces + and torques based on contact geometry +*/ + +#include +#include "contact.h" + +namespace LAMMPS_NS { + namespace Contact{ + +enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; +enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; +enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, + TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, + TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; +enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; +enum {ROLL_NONE, ROLL_SDS}; + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define THREEQUARTERS 0.75 // 3/4 + +#define EPSILON 1e-10 + +ContactModel::ContactModel() +{ + k_norm = cohesion = gamma_norm = 0.0; + k_tang = gamma_tang = mu_tang = 0.0; + k_roll = gamma_roll = mu_roll = 0.0; + k_twist = gamma_twist = mu_twist = 0.0; + + limit_damping = 0; + cutoff_type = 0.0; + reset_contact(); +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::reset_contact() +{ + radi = radj = 0.0; + xi = xj = vi = vj = omegai = omegaj = nullptr; + + prep_flag = check_flag = 0; + touch = false; +} + +/* ---------------------------------------------------------------------- */ + +bool ContactModel::check_contact() +{ + check_flag = 1; + + MathExtra::sub3(xi, xj, dx); + rsq = MathExtra::lensq3(dx); + radsum = radi + radj; + Reff = radi*radj/radsum; + + touch = false; + if (normal_model == JKR) touch = touch_JKR(touch); + else touch = (rsq < radsum*radsum); + + return touch +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::prep_contact() +{ + prep_flag = 1; + + // If it hasn't already been done, test if the contact exists + if (check_flag != 1) touch = check_contact(); + if (!touch) return; + + // Set flags + mindlin_rescale = mindlin_force = 0; + if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) + mindlin_rescale = 1 + if (tangential_model == TANGENTIAL_MINDLIN_FORCE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) + mindlin_force = 1 + + double temp[3]; + + // Standard geometric quantities + r = sqrt(rsq); + rinv = 1.0/r; + delta = radsum - r; + dR = delta*Reff + MathExtra::scale3(rinv, dx, nx); + + // relative translational velocity + MathExtra::sub3(v[i], v[j], vr); + + // normal component + vnnr = MathExtra::dot3(vr, nx); //v_R . n + MathExtra::scale3(vnnr, nx, vn); + + // tangential component + MathExtra::sub3(vr, vn, vt); + + // relative rotational velocity + MathExtra::scaleadd3(radi, omegai, radj, omegaj, wr); + + // relative tangential velocities + MathExtra::cross3(wr, nx, temp); + MathExtra::sub3(vt, temp, vtr); + vrel = MathExtra::len(vtr); + + if (roll_model != NONE || twist_model != NONE) + MathExtra::sub3(omega[i], omega[j], relrot); + + if (roll_model != NONE) { + // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) + // this is different from the Marshall papers, which use the Bagi/Kuhn formulation + // for rolling velocity (see Wang et al for why the latter is wrong) + vrl[0] = Reff * (relrot[1] * n[2] - relrot[2] * nx[1]); + vrl[1] = Reff * (relrot[2] * n[0] - relrot[0] * nx[2]); + vrl[2] = Reff * (relrot[0] * n[1] - relrot[1] * nx[0]); + } + + if (twist_model != NONE) { + // omega_T (eq 29 of Marshall) + magtwist = MathExtra::dot3(relrot, nx); + } +} + + +/* ---------------------------------------------------------------------- */ + +void ContactModel::calculate_forces(double *forces, double *torquesi, double *torquesj, double *history) +{ + // If it hasn't already been done, run prep calculations + if (prep_flag != 1) prep_contact(); + if (!touch) { + forces[0] = forces[1] = forces[2] = 0.0; + return + } + + //********************************************** + // normal forces + //********************************************** + + // Also calculates: a, knfac, Fncrit + double Fne; + if (normal_model == JKR) { + Fne = normal_JKR(); + } else if (normal_model == DMT) { + Fne = normal_DMT(); + } else if (normal_model == HERTZ || normal_model == HERTZ_MATERIAL) { + Fne = normal_hertz(); + } else { + Fne = normal_hooke(); + } + + // NOTE: consider restricting Hooke to only have + // 'velocity' as an option for damping? + // Also calculates: damp_normal_prefactor + double Fdamp = normal_damping(); + + double Fntot = Fne + Fdamp; + if (limit_damping && (Fntot < 0.0)) Fntot = 0.0; + + //********************************************** + // tangential force, including history effects + //********************************************** + // For linear, mindlin, mindlin_rescale: + // history = cumulative tangential displacement + // + // For mindlin/force, mindlin_rescale/force: + // history = cumulative tangential elastic force + + Fncrit = critical_normal(Fne, Fntot, geom, model); + Fscrit = mu_tang * Fncrit; + + if (tangential_model == TANGENTIAL_NOHISTORY) { + tangential_no_history(); + } else if (tangential_model == TANGENTIAL_HISTORY) { + tangential_history(history); + } + tangential_forces(history); + + //********************************************** + // rolling force + //********************************************** + + if (roll_model != ROLL_NONE) + rolling(history); + + //**************************************** + // twisting torque, including history effects + //**************************************** + + if (twist_model == TWIST_MARSHALL) { + twist_marshall(history); + } else if (twist_model == TWIST_SDS) { + twist_SDS(history); + } + + //********************************************** + // sum contributions + //********************************************** + + MathExtra::scale3(Fntot, nx, forces); + MathExtra::add3(forces, fs, forces); + + MathExtra::cross3(nx, fs, torquesi); + MathExtra::copy3(torquesi, torquesj); + + double dist_to_contact = radi-0.5*delta; + MathExtra::scale3(dist_to_contact, torquesi); + dist_to_contact = radj-0.5*delta; + MathExtra::scale3(dist_to_contact, torquesj); + + double torroll[3]; + if (roll_model != ROLL_NONE) { + MathExtra::cross3(nx, fr, torroll); + MathExtra::scale3(Reff, torroll); + MathExtra::add3(torquesi, torroll, torquesi); + MathExtra::sub3(torquesj, torroll, torquesj); + } + + double tortwist[3]; + if (twist_model != NONE_TWIST) { + MathExtra::scale3(magtortwist, nx, tortwist); + MathExtra::add3(torquesi, tortwist, torquesi) + MathExtra::sub3(torquesj, tortwist, torquesj) + } +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::touch_JKR(int touch) +{ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = E*THREEQUARTERS; + if (touch) { + R2 = Reff * Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = radsum - delta_pulloff; + touchflag = (rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rsq < radsum * radsum); + } + return touchflag; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_JKR() +{ + double R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * E; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * E * E * E; + t3 = 4 * dR2 * E; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / E; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (E * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + double Fne = E * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * E / (MY_PI * a)); + double F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = E * a; + Fncrit = fabs(Fne + 2*F_pulloff); + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_DMT(double &Fne) +{ + a = sqrt(dR); + double Fne = a * E * delta; + Fne -= 4 * MY_PI * cohesion * Reff; + F_pulloff = 4 * MY_PI * cohesion * Reff; + + knfac = E * a; + Fncrit = fabs(Fne + 2*F_pulloff); + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_Hertz(double &Fne) +{ + a = sqrt(dR); + double Fne = E * delta * a; + + knfac = E * a; + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_Hooke(double &Fne) +{ + a = sqrt(dR); + double Fne = E * delta; + + knfac = E; + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_damping() +{ + double damp_normal; + if (damping_model == VELOCITY) { + damp_normal = 1; + } else if (damping_model == MASS_VELOCITY) { + damp_normal = meff; + } else if (damping_model == VISCOELASTIC) { + damp_normal = a * meff; + } else if (damping_model == TSUJI) { + damp_normal = sqrt(meff * knfac); + } else damp_normal = 0.0; + + damp_normal_prefactor = gamma_norm * damp_normal; + return -damp_normal_prefactor * vnnr; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::tangential_no_history() +{ + double gamma_scaled = gamma_tang * damp_normal_prefactor; + double fsmag, Ft; + + // classic pair gran/hooke (no history) + fsmag = gamma_scaled * vrel; + if (vrel != 0.0) Ft = MIN(Fscrit,fsmag) / vrel; + else Ft = 0.0; + + Ft = -Ft; + MathExtra::scale3(Ft, vtr, fs); +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::tangential_forces(double *history) +{ + double gamma_scaled = gamma_tang * damp_normal_prefactor; + double k = k_tang; + int frame_update = 0; + double fsmag, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (history_update) { + rsht = MathExtra::dot(history, nx); + frameupdate = fabs(rsht) * k > EPSILON * Fscrit; + + if (frameupdate) { + shrmag = MathExtra::len3(history); + // projection + MathExtra::scale3(rsht, nx, history); + // also rescale to preserve magnitude + prjmag = MathExtra::len3(history); + if (prjmag > 0) temp_double = shrmag / prjmag; + else temp_double = 0; + MathExtra::scale3(temp_double, history); + } + + // update history + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + temp_dbl = k * dt; + MathExtra::scale3(temp_dbl, vtr, temp_array); + MathExtra::sub3(history, temp_array, history); + } + + // tangential forces = history + tangential velocity damping + temp_double = -gamma; + MathExtra::scale3(temp_double, vtr, fs); + + // rescale frictional displacements and forces if needed + fsmag = MathExtra::len3(fs); + if (fsmag > Fscrit) { + shrmag = MathExtra::len3(history); + if (shrmag != 0.0) { + temp_double = Fscrit / magfs; + MathExtra::scale3(temp_double, fs, history); + MathExtra::scale3(gamma, vtr, temp_array); + MathExtra::add3(history, temp_array, history); + temp_double = Fscrit / magfs; + MathExtra::scale3(temp_double, fs); + } else { + MathExtra::zero3(fs); + } + } +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::tangential_mindlin(double *history) +{ + double k_scaled, gamma_scaled, fsmag, rsht, shrmag, prjmag, temp_dbl; + double temp_array[3]; + int frame_update = 0; + + gamma_scaled = gamma_tang * damp_normal_prefactor; + k_scaled = k_tange * a; + if (mindlin_rescale) { + // on unloading, rescale the shear displacements/force + if (a < history[3]) { + temp_double = a / history[3]; + MathExtra::scale3(temp_double, history); + } + } + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (history_update) { + rsht = MathExtra::dot(history, nx); + if (mindlin_force) + frameupdate = fabs(rsht) > EPSILON * Fscrit; + else + frameupdate = fabs(rsht) * k_scaled > EPSILON * Fscrit; + + if (frameupdate) { + shrmag = MathExtra::len3(history); + // projection + MathExtra::scale3(rsht, nx, history); + // also rescale to preserve magnitude + prjmag = MathExtra::len3(history); + if (prjmag > 0) temp_double = shrmag / prjmag; + else temp_double = 0; + MathExtra::scale3(temp_double, history); + } + + // update history + if (mindlin_force) { + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + temp_dbl = -k_scaled * dt; + MathExtra::scale3(temp_dbl, vtr, temp_array); + } else { + MathExtra::scale3(dt, vtr, temp_array); + } + MathExtra::add3(history, temp_array, history); + + if (mindlin_rescale) history[3] = a; + } + + // tangential forces = history + tangential velocity damping + temp_double = -gamma_scaled; + MathExtra::scale3(temp_double, vtr, fs); + + if (! mindlin_force) { + MathExtra::scale3(k_scaled, history, temp_array); + MathExtra::add3(fs, temp_array, fs); + } + + // rescale frictional displacements and forces if needed + fsmag = MathExtra::len3(fs); + if (fsmag > Fscrit) { + shrmag = MathExtra::len3(history); + if (shrmag != 0.0) { + temp_double = Fscrit / magfs; + MathExtra::scale3(temp_double, fs, history); + MathExtra::scale3(gamma, vtr, temp_array); + MathExtra::add3(history, temp_array, history); + if (! mindlin_force) { + temp_double = -1.0 / k; + MathExtra::scale3(temp_double, history); + } + temp_double = Fscrit / magfs; + MathExtra::scale3(temp_double, fs); + } else { + MathExtra::zero3(fs); + } + } +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::rolling(double *history) +{ + int rhist0, rhist1, rhist2, frameupdate; + double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_array[3]; + + rhist0 = roll_history_index; + rhist1 = rhist0 + 1; + rhist2 = rhist1 + 1; + + Frcrit = mu_roll * Fncrit; + + if (history_update) { + hist_temp[0] = history[rhist0]; + hist_temp[1] = history[rhist1]; + hist_temp[2] = history[rhist2]; + rolldotn = MathExtra::dot3(hist_temp, nx); + + frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; + if (frameupdate) { // rotate into tangential plane + rollmag = MathExtra::len3(temp); + // projection + temp_double = -rolldotn; + MathExtra::scale3(temp_double, nx, temp); + + // also rescale to preserve magnitude + prjmag = MathExtra::len3(hist_temp); + if (prjmag > 0) temp_double = rollmag / prjmag; + else temp_double = 0; + MathExtra::scale3(temp_double, hist_temp); + } + MathExtra::scale3(dt, vrl, temp_array); + MathExtra::add3(hist_temp, temp_array, hist_temp) + } + + MathExtra::scaleadd3(k_roll, hist_tepm, gamma_roll, vrl, fr); + MathExtra::negate3(fr); + + // rescale frictional displacements and forces if needed + + magfr = MathExtra::len3(fr); + if (magfr > Frcrit) { + rollmag = MathExtra::len3(temp); + if (rollmag != 0.0) { + temp_double = -Frcrit / (magfr * k_roll); + MathExtra::scale3(temp_double, fr, temp_array); + MathExtra::add3(hist_temp, temp_array, hist_temp); + + temp_double = -gamma_roll/k_roll; + MathExtra::scale3(temp_double, vrl, temp_array); + MathExtra::add3(hist_temp, temp_array, hist_temp) + + temp_double = Frcrit / magfr; + MathExtra::scale3(temp_double, fr); + } else { + MathExtra::zero3(fr); + } + } + + history[rhist0] = hist_temp[0]; + history[rhist1] = hist_temp[1]; + history[rhist2] = hist_temp[2]; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::twisting_marshall(double *history) +{ + // Overwrite twist coefficients with derived values + k_twist = 0.5 * k_tangential * a * a; // eq 32 of Marshall paper + gamma_twist = 0.5 * gamma_tangential * a * a; + mu_twist = TWOTHIRDS * a * mu_tangential; + + twisting_SDS(history); +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::twisting_SDS(double *history) +{ + double signtwist, Mtcrit; + + if (historyupdate) { + history[twist_history_index] += magtwist * dt; + } + + magtortwist = -k_twist * history[twist_history_index] - damp_twist*magtwist; // M_t torque (eq 30) + signtwist = (magtwist > 0) - (magtwist < 0); + Mtcrit = mu_twist * Fncrit; // critical torque (eq 44) + if (fabs(magtortwist) > Mtcrit) { + history[twist_history_index] = (Mtcrit * signtwist - gamma_twist * magtwist) / k_twist; + magtortwist = -Mtcrit * signtwist; // eq 34 + } +} + +/* ---------------------------------------------------------------------- + compute pull-off distance (beyond contact) for a given radius and atom type + use temporary variables since this does not use a specific contact geometry +------------------------------------------------------------------------- */ + +double ContactModel::pulloff_distance(double radi, double radj) +{ + double Ecaled, a_tmp, Reff_tmp; + + if (normal_model != JKR) return radi+radj; + + Reff_tmp = radi * radj / (radi + radj); + if (Reff_tmp <= 0) return 0; + Ecaled = E * THREEQUARTERS; + a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); + return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); +} + +}} diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h new file mode 100644 index 0000000000..a5b5d23463 --- /dev/null +++ b/src/GRANULAR/contact.h @@ -0,0 +1,73 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef LMP_CONTACT +_H +#define LMP_CONTACT +_H + +namespace LAMMPS_NS { +namespace Contact { + + class ContactModel { + public: + ContactModel(); + void reset_contact(); + bool check_contact(); + void prep_contact(); + void calculate_forces(double *, double *, double *, double *); + double pulloff_distance(double, double); + + int normal_model, damping_model, tangential_model; + int roll_model, twist_model; + int limit_damping; + double cutoff_type; + double Emod, poisson; // variables used in defining mixed interactions + double k_norm, gamma_norm, cohesion; // normal_coeffs + double k_tang, gamma_tang, mu_tang; // tangential_coeffs - wutang? + double k_roll, gamma_roll, mu_roll; // roll_coeffs + double k_twist, gamma_twist, mu_twist; // twist_coeffs + + double radi, radj, meff, dt; + double xi[3], xj[3], vi[3], vj[3], omegai[3], omegaj[3]; + int history_update, roll_history_index, twist_history_index; + + private: + double a, knfac, Fncrit, Fscrit, Frcrit, damp_normal_prefactor; + double fs[3], fr[3], ft[3]; + double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta; + double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrel; + double magtwist, magtortwist; + bool touch; + + int prep_flag, check_flag; + int mindlin_rescale, mindlin_force; + + void touch_JKR(int); + double normal_JKR(); + double normal_DMT(); + double normal_Hertz(); + double normal_Hooke(); + double normal_damping(); + void tangential_no_history(); + void tangential_history(double *); + void tangential_mindlin(double *); + void rolling(double *); + void twisting_marshall(double *); + void twisting_SDS(double *); + + }; + +} // namespace Contact +} // namespace LAMMPS_NS +#endif diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 34edbc0ae3..61644df9c2 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -22,6 +22,7 @@ #include "atom.h" #include "comm.h" +#include "contact.h" #include "error.h" #include "fix.h" #include "fix_dummy.h" @@ -43,23 +44,9 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; +using namespace Contact; -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define THREEQUARTERS 0.75 // 3/4 -#define EPSILON 1e-10 - -enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; -enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; -enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, - TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; -enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; -enum {ROLL_NONE, ROLL_SDS}; /* ---------------------------------------------------------------------- */ @@ -83,6 +70,8 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) maxrad_dynamic = nullptr; maxrad_frozen = nullptr; + models = nullptr; + limit_damping = nullptr; history_transfer_factors = nullptr; @@ -121,6 +110,8 @@ PairGranular::~PairGranular() memory->destroy(cutsq); memory->destroy(cutoff_type); + memory->destroy(models); + memory->destroy(normal_coeffs); memory->destroy(tangential_coeffs); memory->destroy(roll_coeffs); @@ -150,38 +141,9 @@ PairGranular::~PairGranular() void PairGranular::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; - double dx[3],fx[3],nx[3]; - double radi,radj,radsum,rsq,r,rinv,factor_lj; - double Reff, delta, dR, dR2, dist_to_contact; + double factor_lj,mi,mj,meff; + double forces[3], torquesi[3], torquesj[3]; - double vr[3],vnnr,vn[3],vt[3],wr[3],vtr[3],vrel[3]; - double temp[3], temp_dbl; - - double damp_normal=0.0, damp_normal_prefactor; - double k_tangential, damp_tangential; - double Fne, Ft, Fdamp, Fntot, Fncrit, Fscrit, Frcrit; - double magfs, fs[3], tor[3]; - - double mi,mj,meff; - double relrot[3],vrl[3]; - - ContactModel model; - ContactGeom geom; - - // rolling - double k_roll, damp_roll; - int rhist0, rhist1, rhist2; - double torroll[3]; - double rollmag, rolldotn, scalefac; - double magfr, fr[3]; - - // twisting - double k_twist, damp_twist, mu_twist; - double signtwist, magtwist, magtortwist, Mtcrit; - double tortwist[3]; - - double shrmag,rsht,prjmag; - bool frameupdate; int *ilist,*jlist,*numneigh,**firstneigh; int *touch,**firsttouch; double *history,*allhistory,**firsthistory; @@ -235,8 +197,6 @@ void PairGranular::compute(int eflag, int vflag) for (ii = 0; ii < inum; ii++) { i = ilist[ii]; itype = type[i]; - itype = type[i]; - radi = radius[i]; if (use_history) { touch = firsttouch[i]; allhistory = firsthistory[i]; @@ -251,24 +211,17 @@ void PairGranular::compute(int eflag, int vflag) if (factor_lj == 0) continue; - MathExtra::sub3(x[i], x[j], dx); jtype = type[j]; - rsq = MathExtra::lensq3(dx); - radj = radius[j]; - radsum = radi + radj; - Reff = radi*radj/radsum; - // Copy data into structures to easily pass to functions - geom.rsq = rsq; - geom.Reff = Reff; - geom.radsum = radsum; + // Reset model and copy initial geometric data + models[itype][jtype]->reset_contact(); + models[itype][jtype].xi = x[i]; + models[itype][jtype].xj = x[j]; + models[itype][jtype].radi = radius[i]; + models[itype][jtype].radj = radius[j]; - touchflag = false; - if (normal_model[itype][jtype] == JKR) { - touchflag = touch_JKR(touch[jj], geom, model) - } else { - touchflag = (rsq < radsum*radsum); - } + + touchflag = models[itype][jtype]->check_contact(); if (!touchflag) { // unset non-touching neighbors @@ -278,336 +231,57 @@ void PairGranular::compute(int eflag, int vflag) for (int k = 0; k < size_history; k++) history[k] = 0.0; } } else { - r = sqrt(rsq); - rinv = 1.0/r; - - // Copy data into structures to easily pass to functions - geom.r = r; - geom.rinv = rinv - geom.delta = radsum - r; - geom.dR = geom.delta*Reff; - - model.normal = normal_model[itype][jtype]; - model.damping = damping_model[itype][jtype]; - model.tangential = tangential_model[itype][jtype]; - model.roll = roll_model[itype][jtype]; - model.twist = twist_model[itype][jtype]; - model.E = normal_coeffs[itype][jtype][0]; - model.damp = normal_coeffs[itype][jtype][1]; - model.poisson = normal_coeffs[itype][jtype][2]; - model.coh = normal_coeffs[itype][jtype][3]; - - MathExtra::scale3(rinv, dx, nx); - - // relative translational velocity - MathExtra::sub3(v[i], v[j], vr); - - // normal component - vnnr = MathExtra::dot3(vr, nx); //v_R . n - MathExtra::scale3(vnnr, nx, vn); // meff = effective mass of pair of particles // if I or J part of rigid body, use body mass // if I or J is frozen, meff is other particle - mi = rmass[i]; mj = rmass[j]; if (fix_rigid) { if (mass_rigid[i] > 0.0) mi = mass_rigid[i]; if (mass_rigid[j] > 0.0) mj = mass_rigid[j]; } - meff = mi * mj / (mi + mj); if (mask[i] & freeze_group_bit) meff = mj; if (mask[j] & freeze_group_bit) meff = mi; - if (model.normal == JKR) { - touch[jj] = 1; - normal_JKR(Fne, Fncrit, geom, model); - } else if (model.normal == DMT) { - normal_DMT(Fne, Fncrit, geom, model); - } else { - normal_hooke(Fne, Fncrit, geom, model); - } + // Copy additional information and prepare force calculations + models[itype][jtype].meff = meff; + models[itype][jtype].dt = dt; + models[itype][jtype].history_update = historyupdate; + models[itype][jtype].roll_history_index = roll_history_index; + models[itype][jtype].twist_history_index = twist_history_index; + models[itype][jtype].vi = v[i]; + models[itype][jtype].vj = v[j]; + models[itype][jtype].omegai = omega[i]; + models[itype][jtype].omegaj = omega[j]; + models[itype][jtype] -> prep_contact(); - // NOTE: consider restricting Hooke to only have - // 'velocity' as an option for damping? - Fdamp = normal_damping(vnnr, meff, geom, model); - - Fntot = Fne + Fdamp; - if (limit_damping[itype][jtype] && (Fntot < 0.0)) Fntot = 0.0; - - //**************************************** - // tangential force, including history effects - //**************************************** - - // For linear, mindlin, mindlin_rescale: - // history = cumulative tangential displacement - // - // For mindlin/force, mindlin_rescale/force: - // history = cumulative tangential elastic force - - // tangential component - MathExtra::sub3(vr, vn, vt); - - // relative rotational velocity - MathExtra::scaleadd3(radi, omega[i], radj, omega[j], wr); - - // relative tangential velocities - MathExtra::cross3(wr, nx, temp); - MathExtra::sub3(vt, temp, vtr); - vrel = MathExtra::len(vtr); + if (models[itype][jtype].normal_model == JKR) touch[jj] = 1; // if any history is needed if (use_history) { touch[jj] = 1; history = &allhistory[size_history*jj]; } - Fncrit = critical_normal(Fne, Fntot, geom, model); - Fscrit = model.poisson * Fncrit; - - //------------------------------ - // tangential forces - //------------------------------ - - k_tangential = tangential_coeffs[itype][jtype][0]; - damp_tangential = tangential_coeffs[itype][jtype][1] * - damp_normal_prefactor; - - if (tangential_history) { - if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_FORCE) { - k_tangential *= a; - } else if (tangential_model[itype][jtype] == - TANGENTIAL_MINDLIN_RESCALE || - tangential_model[itype][jtype] == - TANGENTIAL_MINDLIN_RESCALE_FORCE) { - k_tangential *= a; - // on unloading, rescale the shear displacements/force - if (a < history[3]) { - double factor = a/history[3]; - MathExtra::scale3(history, factor); - } - } - // rotate and update displacements / force. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (historyupdate) { - rsht = history[0]*nx + history[1]*ny + history[2]*nz; - if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_FORCE || - tangential_model[itype][jtype] == - TANGENTIAL_MINDLIN_RESCALE_FORCE) - frameupdate = fabs(rsht) > EPSILON * Fscrit; - else - frameupdate = fabs(rsht) * k_tangential > EPSILON * Fscrit; - if (frameupdate) { - shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + - history[2]*history[2]); - // projection - MathExtra::scale3(rsht, nx, history); - - // also rescale to preserve magnitude - prjmag = MathExtra::len3(history); - if (prjmag > 0) scalefac = shrmag/prjmag; - else scalefac = 0; - MathExtra::scale3(scalefac, history); - } - // update history - if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { - // tangential displacement - MathExtra::scale3(dt, vtr, temp); - MathExtra::add3(temp, history, history); - } else { - // tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - MathExtra::scale3(k_tangential*dt, vtr, temp); - MathExtra::sub3(history, temp, history); - } - if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE || - tangential_model[itype][jtype] == - TANGENTIAL_MINDLIN_RESCALE_FORCE) - history[3] = a; - } - - // tangential forces = history + tangential velocity damping - MathExtra::scale3(-damp_tangential, vtr, fs); - if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { - MathExtra::scale3(-k_tangential, history, temp); - MathExtra::add3(fs, temp, fs); - } - - // rescale frictional displacements and forces if needed - magfs = MathExtra::len3(fs); - if (fs > Fscrit) { - shrmag = MathExtra::len3(history); - if (shrmag != 0.0) { - history[0] = Fscrit*fs[0]/magfs + damp_tangential*vtr[0]; - history[1] = Fscrit*fs[1]/magfs + damp_tangential*vtr[1]; - history[2] = Fscrit*fs[2]/magfs + damp_tangential*vtr[2]; - if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || - tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || - tangential_model[itype][jtype] == - TANGENTIAL_MINDLIN_RESCALE) { - MathExtra::scale3(-1.0/k_tangential, history); - } - MathExtra::scale3(Fscrit/magfs, fs); - } else MathExtra::zero3(fs); - } - } else { // classic pair gran/hooke (no history) - fs = damp_tangential*vrel; - if (vrel != 0.0) Ft = MIN(Fscrit,fs) / vrel; - else Ft = 0.0; - MathExtra::scale3(-Ft, vtr, fs); - } - - if (roll_model[itype][jtype] != ROLL_NONE || - twist_model[itype][jtype] != TWIST_NONE) { - MathExtra::sub3(omega[i], omega[j], relrot); - } - //**************************************** - // rolling resistance - //**************************************** - - if (roll_model[itype][jtype] != ROLL_NONE) { - // rolling velocity, - // see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) - // this is different from the Marshall papers, - // which use the Bagi/Kuhn formulation - // for rolling velocity (see Wang et al for why the latter is wrong) - vrl[0] = Reff * (relrot[1] * n[2] - relrot[2] * nx[1]); - vrl[1] = Reff * (relrot[2] * n[0] - relrot[0] * nx[2]); - vrl[2] = Reff * (relrot[0] * n[1] - relrot[1] * nx[0]); - - rhist0 = roll_history_index; - rhist1 = rhist0 + 1; - rhist2 = rhist1 + 1; - - k_roll = roll_coeffs[itype][jtype][0]; - damp_roll = roll_coeffs[itype][jtype][1]; - Frcrit = roll_coeffs[itype][jtype][2] * Fncrit; - - if (historyupdate) { - temp[0] = history[rhist0]; - temp[1] = history[rhist1]; - temp[2] = history[rhist2]; - rolldotn = MathExtra::dot3(temp, nx); - frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; - if (frameupdate) { // rotate into tangential plane - rollmag = MathExtra::len3(temp); - // projection - temp[0] -= rolldotn*nx[0]; - temp[1] -= rolldotn*nx[1]; - temp[2] -= rolldotn*nx[2]; - // also rescale to preserve magnitude - prjmag = MathExtra::len3(temp); - if (prjmag > 0) scalefac = rollmag/prjmag; - else scalefac = 0; - MathExtra::scale3(scalefac, temp); - } - temp[0] += vrl[0]*dt; - temp[1] += vrl[1]*dt; - temp[2] += vrl[2]*dt; - } - - fr[0] = -k_roll*temp[0] - damp_roll*vrl[0]; - fr[1] = -k_roll*temp[1] - damp_roll*vrl[1]; - fr[2] = -k_roll*temp[2] - damp_roll*vrl[2]; - - // rescale frictional displacements and forces if needed - - magfr = MathExtra::len3(fr); - if (magfr > Frcrit) { - rollmag = MathExtra::len3(temp); - if (rollmag != 0.0) { - temp[0] = -1.0/k_roll*(Frcrit*fr[0]/magfr + damp_roll*vrl[0]); - temp[1] = -1.0/k_roll*(Frcrit*fr[1]/magfr + damp_roll*vrl[1]); - temp[2] = -1.0/k_roll*(Frcrit*fr[2]/magfr + damp_roll*vrl[2]); - fr[0] *= Frcrit/magfr; - fr[1] *= Frcrit/magfr; - fr[2] *= Frcrit/magfr; - } else MathExtra::zero3(fr); - } - - history[rhist0] = temp[0]; - history[rhist1] = temp[1]; - history[rhist2] = temp[2]; - } - - //**************************************** - // twisting torque, including history effects - //**************************************** - - if (twist_model[itype][jtype] != TWIST_NONE) { - // omega_T (eq 29 of Marshall) - magtwist = MathExtra::dot3(relrot, nx); - if (twist_model[itype][jtype] == TWIST_MARSHALL) { - k_twist = 0.5*k_tangential*a*a;; // eq 32 of Marshall paper - damp_twist = 0.5*damp_tangential*a*a; - mu_twist = TWOTHIRDS*a*tangential_coeffs[itype][jtype][2]; - } else { - k_twist = twist_coeffs[itype][jtype][0]; - damp_twist = twist_coeffs[itype][jtype][1]; - mu_twist = twist_coeffs[itype][jtype][2]; - } - if (historyupdate) { - history[twist_history_index] += magtwist*dt; - } - magtortwist = -k_twist*history[twist_history_index] - - damp_twist*magtwist; // M_t torque (eq 30) - signtwist = (magtwist > 0) - (magtwist < 0); - Mtcrit = mu_twist*Fncrit; // critical torque (eq 44) - if (fabs(magtortwist) > Mtcrit) { - history[twist_history_index] = 1.0/k_twist*(Mtcrit*signtwist - - damp_twist*magtwist); - magtortwist = -Mtcrit * signtwist; // eq 34 - } - } + models[itype][jtype].calculate_forces(forces, torquesi, torquesj, history); // apply forces & torques + MathExtra::scale3(factor_lj, forces); + MathExtra::add3(f[i], forces, f[i]); - MathExtra::scale3(Fntot, nx, fx); - MathExtra::add3(fx, fs, fx); - MathExtra::scale3(factor_lj, fx); - MathExtra::add3(f[i], fx, f[i]); - - MathExtra::cross3(nx, fs, tor); - MathExtra::scale3(factor_lj, tor); - - dist_to_contact = radi-0.5*delta; - MathExtra::scale3(dist_to_contact, tor, temp); - MathExtra::sub3(torque[i], temp, torque[i]); - - if (twist_model[itype][jtype] != TWIST_NONE) { - MathExtra::scale3(magtortwist, nx, tortwist); - MathExtra::scale3(factor_lj, tortwist); - MathExtra::add3(torque[i], tortwist, torque[i]); - } - - if (roll_model[itype][jtype] != ROLL_NONE) { - MathExtra::cross3(nx, fr, torroll); - MathExtra::scale3(Reff, torroll); - MathExtra::scale3(factor_lj, torroll); - MathExtra::add3(torque[i], torroll, torque[i]); - } + MathExtra::scale3(factor_lj, torquesi); + MathExtra::add3(torques[i], torquesi, torques[i]); if (force->newton_pair || j < nlocal) { - MathExtra::sub3(f[j], fx, f[j]); - - dist_to_contact = radj-0.5*delta; - MathExtra::scale3(dist_to_contact, tor, temp); - MathExtra::sub3(torque[j], tor, torque[j]); - - if (twist_model[itype][jtype] != TWIST_NONE) - MathExtra::sub3(torque[j], tortwist, torque[j]); - if (roll_model[itype][jtype] != ROLL_NONE) - MathExtra::sub3(torque[j], torroll, torque[j]); + MathExtra::sub3(f[j], forces, f[j]); + MathExtra::scale3(factor_lj, torquesj); + MathExtra::add3(torques[j], torquesj, torques[j]); } + if (evflag) ev_tally_xyz(i,j,nlocal,force->newton_pair, - 0.0,0.0,fx[0],fx[1],fx[2],dx[0],dy[1],dx[2]); + 0.0,0.0,forces[0],forces[1],forces[2],dx[0],dy[1],dx[2]); } } } @@ -629,20 +303,7 @@ void PairGranular::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutoff_type,n+1,n+1,"pair:cutoff_type"); - memory->create(normal_coeffs,n+1,n+1,4,"pair:normal_coeffs"); - memory->create(tangential_coeffs,n+1,n+1,3,"pair:tangential_coeffs"); - memory->create(roll_coeffs,n+1,n+1,3,"pair:roll_coeffs"); - memory->create(twist_coeffs,n+1,n+1,3,"pair:twist_coeffs"); - - memory->create(Emod,n+1,n+1,"pair:Emod"); - memory->create(poiss,n+1,n+1,"pair:poiss"); - - memory->create(normal_model,n+1,n+1,"pair:normal_model"); - memory->create(damping_model,n+1,n+1,"pair:damping_model"); - memory->create(tangential_model,n+1,n+1,"pair:tangential_model"); - memory->create(roll_model,n+1,n+1,"pair:roll_model"); - memory->create(twist_model,n+1,n+1,"pair:twist_model"); - memory->create(limit_damping,n+1,n+1,"pair:limit_damping"); + memory->create(models,n+1,n+1,"pair:models"); onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -899,56 +560,64 @@ void PairGranular::coeff(int narg, char **arg) error->all(FLERR,"Illegal pair_coeff command, " "Cannot limit damping with DMT model"); + double Emod, poisson; for (int i = ilo; i <= ihi; i++) { for (int j = MAX(jlo,i); j <= jhi; j++) { - normal_model[i][j] = normal_model[j][i] = normal_model_one; - normal_coeffs[i][j][1] = normal_coeffs[j][i][1] = damp; + + // Define normal model + models[i][j].normal_model = models[j][i].normal_model = normal_model_one; + models[i][j].damping_model = models[j][i].damping_model = damping_model_one; + models[i][j].gamma_norm = models[j][i].gamma_norm = damp; + Emod = normal_coeffs_one[0]; + poisson = normal_coeffs_one[2]; + models[i][j].Emod = models[j][i].Emod = Emod; + models[i][j].poisson = models[j][i].poisson = poisson; + if (normal_model_one != HERTZ && normal_model_one != HOOKE) { - Emod[i][j] = Emod[j][i] = normal_coeffs_one[0]; - poiss[i][j] = poiss[j][i] = normal_coeffs_one[2]; - normal_coeffs[i][j][0] = normal_coeffs[j][i][0] = - FOURTHIRDS*mix_stiffnessE(Emod[i][j],Emod[i][j], - poiss[i][j],poiss[i][j]); + models[i][j].k_norm = models[j][i].k_norm = + FOURTHIRDS*mix_stiffnessE(Emod,Emod,poisson,poisson); } else { - normal_coeffs[i][j][0] = normal_coeffs[j][i][0] = normal_coeffs_one[0]; + models[i][j].k_norm = models[j][i].k_norm = normal_coeffs_one[0]; } if ((normal_model_one == JKR) || (normal_model_one == DMT)) - normal_coeffs[i][j][3] = normal_coeffs[j][i][3] = normal_coeffs_one[3]; + models[i][j].cohesion = models[j][i].cohesion = normal_coeffs_one[3]; - damping_model[i][j] = damping_model[j][i] = damping_model_one; - - tangential_model[i][j] = tangential_model[j][i] = tangential_model_one; + // Define tangential model + models[i][j].tangential_model = models[j][i].tangential_model = tangential_model_one; if (tangential_coeffs_one[0] == -1) { - tangential_coeffs[i][j][0] = tangential_coeffs[j][i][0] = - 8*mix_stiffnessG(Emod[i][j],Emod[i][j],poiss[i][j],poiss[i][j]); + models[i][j].k_tang = models[j][i].k_tang = + 8*mix_stiffnessG(Emod, Emod, poisson, poisson); } else { - tangential_coeffs[i][j][0] = tangential_coeffs[j][i][0] = - tangential_coeffs_one[0]; + models[i][j].k_tang = models[j][i].k_tang = tangential_coeffs_one[0]; } - for (int k = 1; k < 3; k++) - tangential_coeffs[i][j][k] = tangential_coeffs[j][i][k] = - tangential_coeffs_one[k]; + models[i][j].gamma_tang = models[j][i]].gamma_tang = tangential_coeffs_one[1]; + models[i][j].mu_tang = models[j][i]].mu_tang = tangential_coeffs_one[2]; - roll_model[i][j] = roll_model[j][i] = roll_model_one; - if (roll_model_one != ROLL_NONE) - for (int k = 0; k < 3; k++) - roll_coeffs[i][j][k] = roll_coeffs[j][i][k] = roll_coeffs_one[k]; + // Define rolling model + model[i][j].roll_model = model[j][i].roll_model = roll_model_one; + if (roll_model_one != ROLL_NONE) { + model[i][j].k_roll = model[j][i].k_roll = roll_coeffs_one[0]; + model[i][j].gamma_roll = model[j][i].gamma_roll = roll_coeffs_one[1]; + model[i][j].mu_roll = model[j][i].mu_roll = roll_coeffs_one[2]; + } - twist_model[i][j] = twist_model[j][i] = twist_model_one; - if (twist_model_one != TWIST_NONE && twist_model_one != TWIST_MARSHALL) - for (int k = 0; k < 3; k++) - twist_coeffs[i][j][k] = twist_coeffs[j][i][k] = twist_coeffs_one[k]; + // Define twisting model + models[i][j].twist_model = models[j][i].twist_model = twist_model_one; + if (twist_model_one != TWIST_NONE && twist_model_one != TWIST_MARSHALL) { + model[i][j].k_twist = model[j][i].k_twist = twist_coeffs_one[0]; + model[i][j].gamma_twist = model[j][i].gamma_twist = twist_coeffs_one[1]; + model[i][j].mu_twist = model[j][i].mu_twist = twist_coeffs_one[2]; + } - cutoff_type[i][j] = cutoff_type[j][i] = cutoff_one; - - limit_damping[i][j] = limit_damping[j][i] = ld_flag; + // Define extra options + model[i][j].cutoff_type = model[j][i].cutoff_type = cutoff_one; + model[i][j].limit_damping = model[j][i].limit_damping = ld_flag; setflag[i][j] = 1; count++; } } - if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); } @@ -976,7 +645,7 @@ void PairGranular::init_style() for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) - if (normal_model[i][j] == JKR) use_history = 1; + if (models[i][j].normal_model == JKR) use_history = 1; size_history = 3*tangential_history + 3*roll_history + twist_history; @@ -997,8 +666,8 @@ void PairGranular::init_style() } for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) - if (tangential_model[i][j] == TANGENTIAL_MINDLIN_RESCALE || - tangential_model[i][j] == TANGENTIAL_MINDLIN_RESCALE_FORCE) { + if (model[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE || + model[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { size_history += 1; roll_history_index += 1; twist_history_index += 1; @@ -1100,47 +769,61 @@ void PairGranular::init_style() double PairGranular::init_one(int i, int j) { - double cutoff=0.0; + double cutoff = 0.0; if (setflag[i][j] == 0) { - if ((normal_model[i][i] != normal_model[j][j]) || - (damping_model[i][i] != damping_model[j][j]) || - (tangential_model[i][i] != tangential_model[j][j]) || - (roll_model[i][i] != roll_model[j][j]) || - (twist_model[i][i] != twist_model[j][j])) { + if ((models[i][i].normal_model != models[j][j].normal_model) || + (models[i][i].damping_model != models[j][j].damping_model) || + (models[i][i].tangential_model != models[j][j].tangential_model) || + (models[i][i].roll_model != models[j][j].roll_model) || + (models[i][i].twist_model != models[j][j].twist_model)) { error->all(FLERR,"Granular pair style functional forms are different, " "cannot mix coefficients for types {} and {}. \n" "This combination must be set explicitly via a " "pair_coeff command",i,j); } - if (normal_model[i][j] == HERTZ || normal_model[i][j] == HOOKE) - normal_coeffs[i][j][0] = normal_coeffs[j][i][0] = - mix_geom(normal_coeffs[i][i][0], normal_coeffs[j][j][0]); + // Mix normal coefficients + if (models[i][j].normal_model == HERTZ || models[i][j].normal_model == HOOKE) + models[i][j].k_norm = models[j][i][0].k_norm = + mix_geom(models[i][i].k_norm, models[j][j].k_norm); else - normal_coeffs[i][j][0] = normal_coeffs[j][i][0] = - mix_stiffnessE(Emod[i][i], Emod[j][j], poiss[i][i], poiss[j][j]); + models[i][j].k_norm = models[j][i].k_norm = + mix_stiffnessE(models[i][i].Emod, models[j][j].Emod, + models[i][i].poisson, models[j][j].poisson); - normal_coeffs[i][j][1] = normal_coeffs[j][i][1] = - mix_geom(normal_coeffs[i][i][1], normal_coeffs[j][j][1]); + models[i][j].gamma_norm = models[j][i].gamma_norm = + mix_geom(models[i][i].gamma_norm, models[j][j].gamma_norm); if ((normal_model[i][j] == JKR) || (normal_model[i][j] == DMT)) - normal_coeffs[i][j][3] = normal_coeffs[j][i][3] = - mix_geom(normal_coeffs[i][i][3], normal_coeffs[j][j][3]); + models[i][j].cohesion = models[j][i].cohesion = + mix_geom(models[i][i].cohesion, models[j][j].cohesion); - for (int k = 0; k < 3; k++) - tangential_coeffs[i][j][k] = tangential_coeffs[j][i][k] = - mix_geom(tangential_coeffs[i][i][k], tangential_coeffs[j][j][k]); + // Mix tangential coefficients + models[i][j].k_tang = models[j][i].k_tang = + mix_geom(models[i][i].k_tang, models[j][j].k_tang); + models[i][j].gamma_tang = models[j][i].gamma_tang = + mix_geom(models[i][i].gamma_tang, models[j][j].gamma_tang); + models[i][j].mu_tang = models[j][i].mu_tang = + mix_geom(models[i][i].mu_tang, models[j][j].mu_tang); - if (roll_model[i][j] != ROLL_NONE) { - for (int k = 0; k < 3; k++) - roll_coeffs[i][j][k] = roll_coeffs[j][i][k] = - mix_geom(roll_coeffs[i][i][k], roll_coeffs[j][j][k]); + // Mix rolling coefficients + if (models.roll_model[i][j] != ROLL_NONE) { + models[i][j].k_roll = models[j][i].k_roll = + mix_geom(models[i][i].k_roll, models[j][j].k_roll); + models[i][j].gamma_roll = models[j][i].gamma_roll = + mix_geom(models[i][i].gamma_roll, models[j][j].gamma_roll); + models[i][j].mu_roll = models[j][i].mu_roll = + mix_geom(models[i][i].mu_roll, models[j][j].mu_roll); } - if (twist_model[i][j] != TWIST_NONE && twist_model[i][j] != TWIST_MARSHALL) { - for (int k = 0; k < 3; k++) - twist_coeffs[i][j][k] = twist_coeffs[j][i][k] = - mix_geom(twist_coeffs[i][i][k], twist_coeffs[j][j][k]); + // Mix twisting coefficients + if (models[i][j].twist_model != TWIST_NONE && models[i][j].twist_model != TWIST_MARSHALL) { + models[i][j].k_twist = models[j][i].k_twist = + mix_geom(models[i][i].k_twist, models[j][j].k_twist); + models[i][j].gamma_twist = models[j][i].gamma_twist = + mix_geom(models[i][i].gamma_twist, models[j][j].gamma_twist); + models[i][j].mu_twist = models[j][i].mu_twist = + mix_geom(models[i][i].mu_twist, models[j][j].mu_twist); } } @@ -1153,27 +836,23 @@ double PairGranular::init_one(int i, int j) // we assign cutoff = max(cut[i][j]) for i,j such that cut[i][j] > 0.0. double pulloff; - - if (cutoff_type[i][j] < 0 && cutoff_global < 0) { + if (models[i][j].cutoff_type < 0 && cutoff_global < 0) { if (((maxrad_dynamic[i] > 0.0) && (maxrad_dynamic[j] > 0.0)) || ((maxrad_dynamic[i] > 0.0) && (maxrad_frozen[j] > 0.0)) || // radius info about both i and j exist ((maxrad_frozen[i] > 0.0) && (maxrad_dynamic[j] > 0.0))) { - cutoff = maxrad_dynamic[i]+maxrad_dynamic[j]; + cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; pulloff = 0.0; if (normal_model[i][j] == JKR) { - pulloff = pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j], i, j); + pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j]); cutoff += pulloff; + + pulloff = models[i][j]->pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j]); + cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j] + pulloff); + + pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j]); + cutoff = MAX(cutoff,maxrad_dynamic[i] + maxrad_frozen[j] + pulloff); } - - if (normal_model[i][j] == JKR) - pulloff = pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j], i, j); - cutoff = MAX(cutoff, maxrad_frozen[i]+maxrad_dynamic[j]+pulloff); - - if (normal_model[i][j] == JKR) - pulloff = pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j], i, j); - cutoff = MAX(cutoff,maxrad_dynamic[i]+maxrad_frozen[j]+pulloff); - } else { // radius info about either i or j does not exist @@ -1187,8 +866,8 @@ double PairGranular::init_one(int i, int j) } cutoff = cutmax; } - } else if (cutoff_type[i][j] > 0) { - cutoff = cutoff_type[i][j]; + } else if (models[i][j].cutoff_type > 0) { + cutoff = models[i][j].cutoff_type; } else if (cutoff_global > 0) { cutoff = cutoff_global; } @@ -1207,17 +886,27 @@ void PairGranular::write_restart(FILE *fp) for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { - fwrite(&normal_model[i][j],sizeof(int),1,fp); - fwrite(&damping_model[i][j],sizeof(int),1,fp); - fwrite(&tangential_model[i][j],sizeof(int),1,fp); - fwrite(&roll_model[i][j],sizeof(int),1,fp); - fwrite(&twist_model[i][j],sizeof(int),1,fp); - fwrite(&limit_damping[i][j],sizeof(int),1,fp); - fwrite(normal_coeffs[i][j],sizeof(double),4,fp); - fwrite(tangential_coeffs[i][j],sizeof(double),3,fp); - fwrite(roll_coeffs[i][j],sizeof(double),3,fp); - fwrite(twist_coeffs[i][j],sizeof(double),3,fp); - fwrite(&cutoff_type[i][j],sizeof(double),1,fp); + fwrite(&models[i][j].normal_model,sizeof(int),1,fp); + fwrite(&models[i][j].damping_model,sizeof(int),1,fp); + fwrite(&models[i][j].tangential_model,sizeof(int),1,fp); + fwrite(&models[i][j].roll_model,sizeof(int),1,fp); + fwrite(&models[i][j].twist_model,sizeof(int),1,fp); + fwrite(&models[i][j].limit_damping,sizeof(int),1,fp); + fwrite(&models[i][j].Emod,sizeof(double),1,fp); + fwrite(&models[i][j].poisson,sizeof(double),1,fp); + fwrite(&models[i][j].k_norm,sizeof(double),1,fp); + fwrite(&models[i][j].gamma_norm,sizeof(double),1,fp); + fwrite(&models[i][j].cohesion,sizeof(double),1,fp); + fwrite(&models[i][j].k_tang,sizeof(double),1,fp); + fwrite(&models[i][j].gamma_tang,sizeof(double),1,fp); + fwrite(&models[i][j].mu_tang,sizeof(double),1,fp); + fwrite(&models[i][j].k_roll,sizeof(double),1,fp); + fwrite(&models[i][j].gamma_roll,sizeof(double),1,fp); + fwrite(&models[i][j].mu_roll,sizeof(double),1,fp); + fwrite(&models[i][j].k_twist,sizeof(double),1,fp); + fwrite(&models[i][j].gamma_twist,sizeof(double),1,fp); + fwrite(&models[i][j].mu_twist,sizeof(double),1,fp); + fwrite(&models[i][j].cutoff_type,sizeof(double),1,fp); } } } @@ -1238,29 +927,45 @@ void PairGranular::read_restart(FILE *fp) MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&normal_model[i][j],sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&damping_model[i][j],sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&tangential_model[i][j],sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&roll_model[i][j],sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&twist_model[i][j],sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&limit_damping[i][j],sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,normal_coeffs[i][j],sizeof(double),4,fp,nullptr,error); - utils::sfread(FLERR,tangential_coeffs[i][j],sizeof(double),3,fp,nullptr,error); - utils::sfread(FLERR,roll_coeffs[i][j],sizeof(double),3,fp,nullptr,error); - utils::sfread(FLERR,twist_coeffs[i][j],sizeof(double),3,fp,nullptr,error); - utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].normal_model,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].damping_model,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].tangential_model,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].roll_model,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].twist_model,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].limit_damping,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].k_norm,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].gamma_norm,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].cohesion,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].k_tang,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].gamma_tang,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].mu_tang,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].k_roll,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].gamma_roll,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].mu_roll,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].k_twist,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].gamma_twist,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].mu_twist,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].cutoff_type,sizeof(double),1,fp,nullptr,error); } - MPI_Bcast(&normal_model[i][j],1,MPI_INT,0,world); - MPI_Bcast(&damping_model[i][j],1,MPI_INT,0,world); - MPI_Bcast(&tangential_model[i][j],1,MPI_INT,0,world); - MPI_Bcast(&roll_model[i][j],1,MPI_INT,0,world); - MPI_Bcast(&twist_model[i][j],1,MPI_INT,0,world); - MPI_Bcast(&limit_damping[i][j],1,MPI_INT,0,world); - MPI_Bcast(normal_coeffs[i][j],4,MPI_DOUBLE,0,world); - MPI_Bcast(tangential_coeffs[i][j],3,MPI_DOUBLE,0,world); - MPI_Bcast(roll_coeffs[i][j],3,MPI_DOUBLE,0,world); - MPI_Bcast(twist_coeffs[i][j],3,MPI_DOUBLE,0,world); - MPI_Bcast(&cutoff_type[i][j],1,MPI_DOUBLE,0,world); + MPI_Bcast(&models[i][j].normal_model,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].damping_model,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].tangential_model,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].roll_model,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].twist_model,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].limit_damping,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].k_norm,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].gamma_norm,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].cohesion,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].k_tang,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].gamma_tang,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].mu_tang,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].k_roll,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].gamma_roll,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].mu_roll,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].k_twist,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].gamma_twist,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].mu_twist,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].cutoff_type,1,MPI_DOUBLE,0,world); } } } @@ -1366,23 +1071,6 @@ double PairGranular::mix_geom(double valii, double valjj) return sqrt(valii*valjj); } - -/* ---------------------------------------------------------------------- - compute pull-off distance (beyond contact) for a given radius and atom type -------------------------------------------------------------------------- */ - -double PairGranular::pulloff_distance(double radi, double radj, - int itype, int jtype) -{ - double E, coh, a, Reff; - Reff = radi*radj/(radi+radj); - if (Reff <= 0) return 0; - coh = normal_coeffs[itype][jtype][3]; - E = normal_coeffs[itype][jtype][0]*THREEQUARTERS; - a = cbrt(9*MY_PI*coh*Reff*Reff/(4*E)); - return a*a/Reff - 2*sqrt(MY_PI*coh*a/E); -} - /* ---------------------------------------------------------------------- transfer history during fix/neigh/history exchange only needed if any history entries i-j are not just negative of j-i entries @@ -1402,11 +1090,11 @@ double PairGranular::atom2cut(int i) { double cut; - cut = atom->radius[i]*2; - if(beyond_contact) { + cut = atom->radius[i] * 2; + if (beyond_contact) { int itype = atom->type[i]; - if(normal_model[itype][itype] == JKR) { - cut += pulloff_distance(cut, cut, itype, itype); + if (models[itype][itype].normal_model == JKR) { + cut += models[itype][itype].pulloff_distance(cut, cut); } } @@ -1421,16 +1109,16 @@ double PairGranular::radii2cut(double r1, double r2) { double cut = 0.0; - if(beyond_contact) { + if (beyond_contact) { int n = atom->ntypes; double temp; // Check all combinations of i and j to find theoretical maximum pull off distance - for(int i = 0; i < n; i++){ - for(int j = 0; j < n; j++){ - if(normal_model[i][j] == JKR) { - temp = pulloff_distance(r1, r2, i, j); - if(temp > cut) cut = temp; + for (int i = 0; i < n; i++){ + for (int j = 0; j < n; j++){ + if (models[i][j].normal_model == JKR) { + temp = pulloff_distance(r1, r2); + if (temp > cut) cut = temp; } } } @@ -1440,99 +1128,3 @@ double PairGranular::radii2cut(double r1, double r2) return cut; } - -double PairGranular::touch_JKR(int touch, ContactGeom geom, ContactModel model) -{ - double E, R2, a, delta_pulloff, dist_pulloff; - bool touchflag; - E = model.E; - E *= THREEQUARTERS; - if (touch) { - R2 = geom.Reff * geom.Reff; - a = cbrt(9.0 * MY_PI * model.coh * R2 / (4 * E)); - delta_pulloff = a * a / Reff - 2 * sqrt(MY_PI * coh * a / E); - dist_pulloff = geom.radsum - delta_pulloff; - touchflag = (geom.rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (geom.rsq < geom.radsum * geom.radsum); - } - return touchflag; -} - -void PairGranular::normal_JKR(double &Fne, ContactGeom geom, ContactModel model) -{ - double R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff; - - R2 = geom.Reff * geom.Reff; - dR2 = geom.dR * geom.dR; - t0 = model.coh * model.coh * R2 * R2 * model.E; - t1 = PI27SQ*t0; - t2 = 8 * geom.dR * dR2 * model.E * model.E * model.E; - t3 = 4 * dR2 * E; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / E; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * model.coh * MY_PI * R2 / (model.E * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - - Fne = model.E * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * model.coh * model.E / (MY_PI * a)); - model.a = a; - model.knfac = model.E*a; -} - -void PairGraunular::normal_DMT(double &Fne, ContactGeom geom, ContactModel model) -{ - double a = sqrt(geom.dR); - Fne = a * model.E * geom.delta; - Fne -= 4 * MY_PI * model.coh * geom.Reff; - F_pulloff = 4 * MY_PI * model.coh * geom.Reff; - model.a = a; - model.knfact = model.E * a; -} - -void PairGraunular::normal_Hooke(double &Fne, ContactGeom geom, ContactModel model) -{ - double a = sqrt(geom.dR); - Fne = model.E * geom.delta; - if (model.normal != HOOKE) Fne *= a; - model.a = a; - model.knfac = model.E; - if (model.normal != HOOKE) model.knfac *= a; -} - -double PairGranular::normal_damping(double vnnr, double meff, ContactGeom geom, ContactModel model) -{ - double damp_normal, a; - if (model.damping == VELOCITY) { - damp_normal = 1; - } else if (model.damping == MASS_VELOCITY) { - damp_normal = meff; - } else if (model.damping == VISCOELASTIC) { - damp_normal = model.a * meff; - } else if (model.damping == TSUJI) { - damp_normal = sqrt(meff * model.knfac); - } else damp_normal = 0.0; - - damp_normal_prefactor = model.damp * damp_normal; - return -damp_normal_prefactor * vnnr; -} - -double PairGranular::critical_normal(double Fne, double Fntot, ContactGeom geom, Contactmodel model) -{ - if (model.normal == JKR) { - F_pulloff = 3*MY_PI*model.coh*geom.Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } else if (model.normal == DMT) { - F_pulloff = 4*MY_PI*model.coh*geom.Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } else { - Fncrit = fabs(Fntot); - } - return Fncrit; -} \ No newline at end of file diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 896db15231..509981d5f9 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -69,10 +69,8 @@ class PairGranular : public Pair { int size_history; int *history_transfer_factors; - // model choices - int **normal_model, **damping_model; - int **tangential_model, **roll_model, **twist_model; - int **limit_damping; + // contact models + ContactModel **models; // history flags int normal_history, tangential_history, roll_history, twist_history; @@ -83,15 +81,6 @@ class PairGranular : public Pair { int roll_history_index; int twist_history_index; - // per-type material coefficients - double **Emod, **poiss, **Gmod; - - // per-type coefficients, set in pair coeff command - double ***normal_coeffs; - double ***tangential_coeffs; - double ***roll_coeffs; - double ***twist_coeffs; - // optional user-specified global cutoff, per-type user-specified cutoffs double **cutoff_type; double cutoff_global; @@ -99,19 +88,6 @@ class PairGranular : public Pair { double mix_stiffnessE(double, double, double, double); double mix_stiffnessG(double, double, double, double); double mix_geom(double, double); - double pulloff_distance(double, double, int, int); - - // Structure to store details of model - struct ContactModel { - int normal, damping, tangential, roll, twist; - double E, damp, poisson, coh; - double a, knfac; - }; - - struct ContactGeom { - double r, rinv, rsq, Reff, radsum; - double delta, dR; - } }; } // namespace LAMMPS_NS diff --git a/src/contact.cpp b/src/contact.cpp new file mode 100644 index 0000000000..b7d5d4d85d --- /dev/null +++ b/src/contact.cpp @@ -0,0 +1,58 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- + + This class contains a series of DEM contact models + that can be defined and used to calculate forces + and torques based on contact geometry +*/ + +#include +#include "contact.h" + +namespace LAMMPS_NS { + namespace Contact{ + +enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; +enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; +enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, + TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, + TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; +enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; +enum {ROLL_NONE, ROLL_SDS}; + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define THREEQUARTERS 0.75 // 3/4 + +#define EPSILON 1e-10 + +ContactModel::ContactModel() +{ + +} + +/* ---------------------------------------------------------------------- + get volume-correct r basis in: basis*cbrt(vol) = q*r +------------------------------------------------------------------------- */ + +void ContactModel::() +{ + +} + + +}} diff --git a/src/contact.h b/src/contact.h new file mode 100644 index 0000000000..38cb6f0be6 --- /dev/null +++ b/src/contact.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef LMP_CONTACT +_H +#define LMP_CONTACT +_H + +namespace LAMMPS_NS { +namespace Contact { + + class ContactModel { + public: + ContactModel(); + void touch_JKR(int); + void normal_JKR(double&); + void normal_DMT(double&); + void normal_Hooke(double&); + double normal_damping(double, double); + double critical_normal(double, double); + + int normal_model, damping_model, tangential_model; + int roll_model, twist_model; + double E, G, poisson, damp, coh; + + private: + double a, knfac; + ContactGeometry geom; + }; + + + class ContactGeometry { + public: + ContactGeometry(); + void add_data(); + double r, rinv, rsq, Reff, radsum, delta, dR; + }; +} // namespace Contact +} // namespace LAMMPS_NS +#endif diff --git a/src/contact_model.cpp b/src/contact_model.cpp new file mode 100644 index 0000000000..779631836b --- /dev/null +++ b/src/contact_model.cpp @@ -0,0 +1,58 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- + + This class contains a series of DEM contact models + that can be defined and used to calculate forces + and torques based on contact geometry +*/ + +#include +#include "contact_model.h" + +namespace LAMMPS_NS { + namespace Contact_Model{ + +enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; +enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; +enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, + TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, + TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; +enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; +enum {ROLL_NONE, ROLL_SDS}; + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define THREEQUARTERS 0.75 // 3/4 + +#define EPSILON 1e-10 + +ContactModel::ContactModel() +{ + +} + +/* ---------------------------------------------------------------------- + get volume-correct r basis in: basis*cbrt(vol) = q*r +------------------------------------------------------------------------- */ + +void ContactModel::() +{ + +} + + +}} diff --git a/src/contact_model.h b/src/contact_model.h new file mode 100644 index 0000000000..678a7111a8 --- /dev/null +++ b/src/contact_model.h @@ -0,0 +1,35 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef LMP_CONTACT_MODEL_H +#define LMP_CONTACT_MODEL_H + +namespace LAMMPS_NS { +namespace Contact_Model { + + class ContactModel { + public: + ContactModel(); + void set_strain(const double, const double); + void step_deform(const double, const double); + bool reduce(); + void get_box(double[3][3], double); + void get_rot(double[3][3]); + void get_inverse_cob(int[3][3]); + + private: + double a, knfac; + }; +} // namespace Contact_Model +} // namespace LAMMPS_NS +#endif From 1faa7397d3f6effe234c07d04e150a54757ca07a Mon Sep 17 00:00:00 2001 From: jtclemm Date: Sat, 18 Jun 2022 10:11:57 -0600 Subject: [PATCH 007/112] Fixing complier issues, adding dump options, initail conduction --- doc/src/dump.rst | 5 +- doc/src/pair_granular.rst | 10 + src/GRANULAR/atom_vec_sphere_temp.cpp | 11 + src/GRANULAR/atom_vec_sphere_temp.h | 1 + src/GRANULAR/contact.cpp | 385 ++++++++-------- src/GRANULAR/contact.h | 46 +- src/GRANULAR/fix_temp_integrate.cpp | 34 +- src/GRANULAR/pair_granular.cpp | 249 +++++++--- src/GRANULAR/pair_granular.h | 5 +- src/contact.cpp | 625 +++++++++++++++++++++++++- src/contact.h | 85 +++- src/contact_model.cpp | 58 --- src/contact_model.h | 35 -- src/dump_custom.cpp | 50 ++- src/dump_custom.h | 2 + src/fix_neigh_history.cpp | 5 +- 16 files changed, 1171 insertions(+), 435 deletions(-) delete mode 100644 src/contact_model.cpp delete mode 100644 src/contact_model.h diff --git a/doc/src/dump.rst b/doc/src/dump.rst index 4d272c940b..4406c827bf 100644 --- a/doc/src/dump.rst +++ b/doc/src/dump.rst @@ -81,6 +81,7 @@ Syntax q, mux, muy, muz, mu, radius, diameter, omegax, omegay, omegaz, angmomx, angmomy, angmomz, tqx, tqy, tqz, + heatflux, temperature, c_ID, c_ID[I], f_ID, f_ID[I], v_name, i_name, d_name, i2_name[I], d2_name[I] @@ -103,10 +104,12 @@ Syntax q = atom charge mux,muy,muz = orientation of dipole moment of atom mu = magnitude of dipole moment of atom - radius,diameter = radius,diameter of spherical particle + radius,diameter = radius, diameter of spherical particle omegax,omegay,omegaz = angular velocity of spherical particle angmomx,angmomy,angmomz = angular momentum of aspherical particle tqx,tqy,tqz = torque on finite-size particles + heatflux = flux of heat into particle + temperature = temperature of particle c_ID = per-atom vector calculated by a compute with ID c_ID[I] = Ith column of per-atom array calculated by a compute with ID, I can include wildcard (see below) f_ID = per-atom vector calculated by a fix with ID diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index 6f84b0d9c7..9a99558653 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -37,6 +37,9 @@ Examples pair_coeff 1 1 dmt 1000.0 50.0 0.3 0.0 tangential mindlin NULL 0.5 0.5 rolling sds 500.0 200.0 0.5 twisting marshall pair_coeff 2 2 dmt 1000.0 50.0 0.3 10.0 tangential mindlin NULL 0.5 0.1 rolling sds 500.0 200.0 0.1 twisting marshall + pair_style granular + pair_coeff * * hertz 1000.0 50.0 tangential mindlin 1000.0 1.0 0.4 heat 0.1 + Description """"""""""" @@ -631,6 +634,13 @@ attractive force. This keyword cannot be used with the JKR or DMT models. ---------- +The optional *heat* keyword enables heat conduction and it must be followed by +a non-negative numeric value for the conductivity. Note that the *heat* keyword +must be included in either all or none of of the *pair_coeff* calls. See +:doc:`fix temp/integrate ` for more information on this option. + +---------- + The *granular* pair style can reproduce the behavior of the *pair gran/\** styles with the appropriate settings (some very minor differences can be expected due to corrections in diff --git a/src/GRANULAR/atom_vec_sphere_temp.cpp b/src/GRANULAR/atom_vec_sphere_temp.cpp index d4e30e3154..a455a9ddc8 100644 --- a/src/GRANULAR/atom_vec_sphere_temp.cpp +++ b/src/GRANULAR/atom_vec_sphere_temp.cpp @@ -28,6 +28,7 @@ using namespace MathConst; AtomVecSphereTemp::AtomVecSphereTemp(LAMMPS *lmp) : AtomVec(lmp) { mass_type = PER_ATOM; + forceclearflag = 1; molecular = Atom::ATOMIC; atom->sphere_flag = 1; @@ -107,6 +108,16 @@ void AtomVecSphereTemp::grow_pointers() omega = atom->omega; } +/* ---------------------------------------------------------------------- + clear extra forces starting at atom N + nbytes = # of bytes to clear for a per-atom vector +------------------------------------------------------------------------- */ + +void AtomVecSphereTemp::force_clear(int n, size_t nbytes) +{ + memset(&heatflux[n], 0, nbytes); +} + /* ---------------------------------------------------------------------- initialize non-zero atom quantities ------------------------------------------------------------------------- */ diff --git a/src/GRANULAR/atom_vec_sphere_temp.h b/src/GRANULAR/atom_vec_sphere_temp.h index f42b844886..70e047a8cc 100644 --- a/src/GRANULAR/atom_vec_sphere_temp.h +++ b/src/GRANULAR/atom_vec_sphere_temp.h @@ -31,6 +31,7 @@ class AtomVecSphereTemp : public AtomVec { void init() override; void grow_pointers() override; + void force_clear(int, size_t) override; void create_atom_post(int) override; void data_atom_post(int) override; void pack_data_pre(int) override; diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 3cea933370..b4b335a1aa 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -17,28 +17,18 @@ and torques based on contact geometry */ -#include #include "contact.h" +#include "math_const.h" +#include "math_extra.h" +#include "pointers.h" -namespace LAMMPS_NS { - namespace Contact{ +#include -enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; -enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; -enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, - TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; -enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; -enum {ROLL_NONE, ROLL_SDS}; +using namespace LAMMPS_NS; +using namespace MathExtra; +using namespace MathConst; -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define THREEQUARTERS 0.75 // 3/4 - -#define EPSILON 1e-10 +namespace Contact { ContactModel::ContactModel() { @@ -69,8 +59,8 @@ bool ContactModel::check_contact() { check_flag = 1; - MathExtra::sub3(xi, xj, dx); - rsq = MathExtra::lensq3(dx); + sub3(xi, xj, dx); + rsq = lensq3(dx); radsum = radi + radj; Reff = radi*radj/radsum; @@ -78,7 +68,7 @@ bool ContactModel::check_contact() if (normal_model == JKR) touch = touch_JKR(touch); else touch = (rsq < radsum*radsum); - return touch + return touch; } /* ---------------------------------------------------------------------- */ @@ -91,57 +81,57 @@ void ContactModel::prep_contact() if (check_flag != 1) touch = check_contact(); if (!touch) return; + double temp[3]; + // Set flags mindlin_rescale = mindlin_force = 0; if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - mindlin_rescale = 1 + mindlin_rescale = 1; if (tangential_model == TANGENTIAL_MINDLIN_FORCE || tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - mindlin_force = 1 - - double temp[3]; + mindlin_force = 1; // Standard geometric quantities r = sqrt(rsq); rinv = 1.0/r; delta = radsum - r; - dR = delta*Reff - MathExtra::scale3(rinv, dx, nx); + dR = delta*Reff; + scale3(rinv, dx, nx); // relative translational velocity - MathExtra::sub3(v[i], v[j], vr); + sub3(vi, vj, vr); // normal component - vnnr = MathExtra::dot3(vr, nx); //v_R . n - MathExtra::scale3(vnnr, nx, vn); + vnnr = dot3(vr, nx); //v_R . n + scale3(vnnr, nx, vn); // tangential component - MathExtra::sub3(vr, vn, vt); + sub3(vr, vn, vt); // relative rotational velocity - MathExtra::scaleadd3(radi, omegai, radj, omegaj, wr); + scaleadd3(radi, omegai, radj, omegaj, wr); // relative tangential velocities - MathExtra::cross3(wr, nx, temp); - MathExtra::sub3(vt, temp, vtr); - vrel = MathExtra::len(vtr); + cross3(wr, nx, temp); + sub3(vt, temp, vtr); + vrel = len3(vtr); - if (roll_model != NONE || twist_model != NONE) - MathExtra::sub3(omega[i], omega[j], relrot); + if (roll_model != ROLL_NONE || twist_model != TWIST_NONE) + sub3(omegai, omegaj, relrot); - if (roll_model != NONE) { + if (roll_model != ROLL_NONE) { // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) // this is different from the Marshall papers, which use the Bagi/Kuhn formulation // for rolling velocity (see Wang et al for why the latter is wrong) - vrl[0] = Reff * (relrot[1] * n[2] - relrot[2] * nx[1]); - vrl[1] = Reff * (relrot[2] * n[0] - relrot[0] * nx[2]); - vrl[2] = Reff * (relrot[0] * n[1] - relrot[1] * nx[0]); + vrl[0] = Reff * (relrot[1] * nx[2] - relrot[2] * nx[1]); + vrl[1] = Reff * (relrot[2] * nx[0] - relrot[0] * nx[2]); + vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); } - if (twist_model != NONE) { + if (twist_model != TWIST_NONE) { // omega_T (eq 29 of Marshall) - magtwist = MathExtra::dot3(relrot, nx); + magtwist = dot3(relrot, nx); } } @@ -154,23 +144,23 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to if (prep_flag != 1) prep_contact(); if (!touch) { forces[0] = forces[1] = forces[2] = 0.0; - return + return; } //********************************************** // normal forces //********************************************** - // Also calculates: a, knfac, Fncrit + // Also calculates: a, knfac, Fncrit (for JKR or DMT) double Fne; if (normal_model == JKR) { Fne = normal_JKR(); } else if (normal_model == DMT) { Fne = normal_DMT(); } else if (normal_model == HERTZ || normal_model == HERTZ_MATERIAL) { - Fne = normal_hertz(); + Fne = normal_Hertz(); } else { - Fne = normal_hooke(); + Fne = normal_Hooke(); } // NOTE: consider restricting Hooke to only have @@ -178,9 +168,11 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to // Also calculates: damp_normal_prefactor double Fdamp = normal_damping(); - double Fntot = Fne + Fdamp; + Fntot = Fne + Fdamp; if (limit_damping && (Fntot < 0.0)) Fntot = 0.0; + if (normal_model != JKR && normal_model != DMT) Fncrit = fabs(Fntot); + //********************************************** // tangential force, including history effects //********************************************** @@ -190,15 +182,18 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to // For mindlin/force, mindlin_rescale/force: // history = cumulative tangential elastic force - Fncrit = critical_normal(Fne, Fntot, geom, model); Fscrit = mu_tang * Fncrit; - if (tangential_model == TANGENTIAL_NOHISTORY) { - tangential_no_history(); + if (tangential_model == TANGENTIAL_MINDLIN || + tangential_model == TANGENTIAL_MINDLIN_FORCE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { + tangential_mindlin(history); } else if (tangential_model == TANGENTIAL_HISTORY) { tangential_history(history); + } else { + tangential_no_history(); } - tangential_forces(history); //********************************************** // rolling force @@ -212,50 +207,63 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to //**************************************** if (twist_model == TWIST_MARSHALL) { - twist_marshall(history); + twisting_marshall(history); } else if (twist_model == TWIST_SDS) { - twist_SDS(history); + twisting_SDS(history); } //********************************************** // sum contributions //********************************************** - MathExtra::scale3(Fntot, nx, forces); - MathExtra::add3(forces, fs, forces); + scale3(Fntot, nx, forces); + add3(forces, fs, forces); - MathExtra::cross3(nx, fs, torquesi); - MathExtra::copy3(torquesi, torquesj); + cross3(nx, fs, torquesi); + copy3(torquesi, torquesj); double dist_to_contact = radi-0.5*delta; - MathExtra::scale3(dist_to_contact, torquesi); + scale3(dist_to_contact, torquesi); dist_to_contact = radj-0.5*delta; - MathExtra::scale3(dist_to_contact, torquesj); + scale3(dist_to_contact, torquesj); double torroll[3]; if (roll_model != ROLL_NONE) { - MathExtra::cross3(nx, fr, torroll); - MathExtra::scale3(Reff, torroll); - MathExtra::add3(torquesi, torroll, torquesi); - MathExtra::sub3(torquesj, torroll, torquesj); + cross3(nx, fr, torroll); + scale3(Reff, torroll); + add3(torquesi, torroll, torquesi); + sub3(torquesj, torroll, torquesj); } double tortwist[3]; - if (twist_model != NONE_TWIST) { - MathExtra::scale3(magtortwist, nx, tortwist); - MathExtra::add3(torquesi, tortwist, torquesi) - MathExtra::sub3(torquesj, tortwist, torquesj) + if (twist_model != TWIST_NONE) { + scale3(magtortwist, nx, tortwist); + add3(torquesi, tortwist, torquesi); + sub3(torquesj, tortwist, torquesj); } } /* ---------------------------------------------------------------------- */ -double ContactModel::touch_JKR(int touch) +double ContactModel::calculate_heat() +{ + double dT = Ti - Tj; + double Hc; + + //Dan is Emod the youngs modulus for all models? or do I need to scale? + Hc = 2 * conductivity * pow(FOURTHIRDS * Fntot * Reff / Emod, ONETHIRD); + + return Hc * dT; +} + +/* ---------------------------------------------------------------------- */ + +bool ContactModel::touch_JKR(int touch) { double Escaled, R2, delta_pulloff, dist_pulloff; bool touchflag; - Escaled = E*THREEQUARTERS; + Escaled = k_norm * THREEQUARTERS; if (touch) { R2 = Reff * Reff; a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); @@ -272,66 +280,68 @@ double ContactModel::touch_JKR(int touch) double ContactModel::normal_JKR() { - double R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff; + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; R2 = Reff * Reff; dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * E; + t0 = cohesion * cohesion * R2 * R2 * Escaled; t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * E * E * E; - t3 = 4 * dR2 * E; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; // in case sqrt(0) < 0 due to precision issues sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / E; + t5 = t3 / t4 + t4 / Escaled; sqrt2 = MAX(0, 2 * dR + t5); t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (E * t6)); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); a = INVROOT6 * (t6 + sqrt(sqrt3)); a2 = a * a; - double Fne = E * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * E / (MY_PI * a)); - double F_pulloff = 3 * MY_PI * cohesion * Reff; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; - knfac = E * a; - Fncrit = fabs(Fne + 2*F_pulloff); + knfac = Escaled * a; + Fncrit = fabs(Fne + 2 * F_pulloff); return Fne; } /* ---------------------------------------------------------------------- */ -double ContactModel::normal_DMT(double &Fne) +double ContactModel::normal_DMT() { a = sqrt(dR); - double Fne = a * E * delta; + double Fne = a * k_norm * delta; Fne -= 4 * MY_PI * cohesion * Reff; - F_pulloff = 4 * MY_PI * cohesion * Reff; + double F_pulloff = 4 * MY_PI * cohesion * Reff; - knfac = E * a; - Fncrit = fabs(Fne + 2*F_pulloff); + knfac = k_norm * a; + Fncrit = fabs(Fne + 2 * F_pulloff); return Fne; } /* ---------------------------------------------------------------------- */ -double ContactModel::normal_Hertz(double &Fne) +double ContactModel::normal_Hertz() { a = sqrt(dR); - double Fne = E * delta * a; + double Fne = k_norm * delta * a; - knfac = E * a; + knfac = k_norm * a; return Fne; } /* ---------------------------------------------------------------------- */ -double ContactModel::normal_Hooke(double &Fne) +double ContactModel::normal_Hooke() { a = sqrt(dR); - double Fne = E * delta; + double Fne = k_norm * delta; - knfac = E; + knfac = k_norm; return Fne; } @@ -356,7 +366,7 @@ double ContactModel::normal_damping() /* ---------------------------------------------------------------------- */ -double ContactModel::tangential_no_history() +void ContactModel::tangential_no_history() { double gamma_scaled = gamma_tang * damp_normal_prefactor; double fsmag, Ft; @@ -367,100 +377,100 @@ double ContactModel::tangential_no_history() else Ft = 0.0; Ft = -Ft; - MathExtra::scale3(Ft, vtr, fs); + scale3(Ft, vtr, fs); } /* ---------------------------------------------------------------------- */ -double ContactModel::tangential_forces(double *history) +void ContactModel::tangential_history(double *history) { double gamma_scaled = gamma_tang * damp_normal_prefactor; double k = k_tang; int frame_update = 0; - double fsmag, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 if (history_update) { - rsht = MathExtra::dot(history, nx); - frameupdate = fabs(rsht) * k > EPSILON * Fscrit; + rsht = dot3(history, nx); + frame_update = fabs(rsht) * k > EPSILON * Fscrit; - if (frameupdate) { - shrmag = MathExtra::len3(history); + if (frame_update) { + shrmag = len3(history); // projection - MathExtra::scale3(rsht, nx, history); + scale3(rsht, nx, history); // also rescale to preserve magnitude - prjmag = MathExtra::len3(history); - if (prjmag > 0) temp_double = shrmag / prjmag; - else temp_double = 0; - MathExtra::scale3(temp_double, history); + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); } // update history // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 temp_dbl = k * dt; - MathExtra::scale3(temp_dbl, vtr, temp_array); - MathExtra::sub3(history, temp_array, history); + scale3(temp_dbl, vtr, temp_array); + sub3(history, temp_array, history); } // tangential forces = history + tangential velocity damping - temp_double = -gamma; - MathExtra::scale3(temp_double, vtr, fs); + temp_dbl = -gamma_norm; + scale3(temp_dbl, vtr, fs); // rescale frictional displacements and forces if needed - fsmag = MathExtra::len3(fs); - if (fsmag > Fscrit) { - shrmag = MathExtra::len3(history); + magfs = len3(fs); + if (magfs > Fscrit) { + shrmag = len3(history); if (shrmag != 0.0) { - temp_double = Fscrit / magfs; - MathExtra::scale3(temp_double, fs, history); - MathExtra::scale3(gamma, vtr, temp_array); - MathExtra::add3(history, temp_array, history); - temp_double = Fscrit / magfs; - MathExtra::scale3(temp_double, fs); + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs, history); + scale3(gamma_norm, vtr, temp_array); + add3(history, temp_array, history); + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs); } else { - MathExtra::zero3(fs); + zero3(fs); } } } /* ---------------------------------------------------------------------- */ -double ContactModel::tangential_mindlin(double *history) +void ContactModel::tangential_mindlin(double *history) { - double k_scaled, gamma_scaled, fsmag, rsht, shrmag, prjmag, temp_dbl; + double k_scaled, gamma_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; double temp_array[3]; int frame_update = 0; gamma_scaled = gamma_tang * damp_normal_prefactor; - k_scaled = k_tange * a; + k_scaled = k_tang * a; if (mindlin_rescale) { // on unloading, rescale the shear displacements/force if (a < history[3]) { - temp_double = a / history[3]; - MathExtra::scale3(temp_double, history); + temp_dbl = a / history[3]; + scale3(temp_dbl, history); } } // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 if (history_update) { - rsht = MathExtra::dot(history, nx); + rsht = dot3(history, nx); if (mindlin_force) - frameupdate = fabs(rsht) > EPSILON * Fscrit; + frame_update = fabs(rsht) > EPSILON * Fscrit; else - frameupdate = fabs(rsht) * k_scaled > EPSILON * Fscrit; + frame_update = fabs(rsht) * k_scaled > EPSILON * Fscrit; - if (frameupdate) { - shrmag = MathExtra::len3(history); + if (frame_update) { + shrmag = len3(history); // projection - MathExtra::scale3(rsht, nx, history); + scale3(rsht, nx, history); // also rescale to preserve magnitude - prjmag = MathExtra::len3(history); - if (prjmag > 0) temp_double = shrmag / prjmag; - else temp_double = 0; - MathExtra::scale3(temp_double, history); + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); } // update history @@ -468,51 +478,51 @@ double ContactModel::tangential_mindlin(double *history) // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 temp_dbl = -k_scaled * dt; - MathExtra::scale3(temp_dbl, vtr, temp_array); + scale3(temp_dbl, vtr, temp_array); } else { - MathExtra::scale3(dt, vtr, temp_array); + scale3(dt, vtr, temp_array); } - MathExtra::add3(history, temp_array, history); + add3(history, temp_array, history); if (mindlin_rescale) history[3] = a; } // tangential forces = history + tangential velocity damping - temp_double = -gamma_scaled; - MathExtra::scale3(temp_double, vtr, fs); + temp_dbl = -gamma_scaled; + scale3(temp_dbl, vtr, fs); if (! mindlin_force) { - MathExtra::scale3(k_scaled, history, temp_array); - MathExtra::add3(fs, temp_array, fs); + scale3(k_scaled, history, temp_array); + add3(fs, temp_array, fs); } // rescale frictional displacements and forces if needed - fsmag = MathExtra::len3(fs); - if (fsmag > Fscrit) { - shrmag = MathExtra::len3(history); + magfs = len3(fs); + if (magfs > Fscrit) { + shrmag = len3(history); if (shrmag != 0.0) { - temp_double = Fscrit / magfs; - MathExtra::scale3(temp_double, fs, history); - MathExtra::scale3(gamma, vtr, temp_array); - MathExtra::add3(history, temp_array, history); + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs, history); + scale3(gamma_tang, vtr, temp_array); + add3(history, temp_array, history); if (! mindlin_force) { - temp_double = -1.0 / k; - MathExtra::scale3(temp_double, history); + temp_dbl = -1.0 / k_tang; + scale3(temp_dbl, history); } - temp_double = Fscrit / magfs; - MathExtra::scale3(temp_double, fs); + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs); } else { - MathExtra::zero3(fs); + zero3(fs); } } } /* ---------------------------------------------------------------------- */ -double ContactModel::rolling(double *history) +void ContactModel::rolling(double *history) { int rhist0, rhist1, rhist2, frameupdate; - double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_array[3]; + double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; rhist0 = roll_history_index; rhist1 = rhist0 + 1; @@ -524,46 +534,47 @@ double ContactModel::rolling(double *history) hist_temp[0] = history[rhist0]; hist_temp[1] = history[rhist1]; hist_temp[2] = history[rhist2]; - rolldotn = MathExtra::dot3(hist_temp, nx); + rolldotn = dot3(hist_temp, nx); frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; if (frameupdate) { // rotate into tangential plane - rollmag = MathExtra::len3(temp); + rollmag = len3(hist_temp); // projection - temp_double = -rolldotn; - MathExtra::scale3(temp_double, nx, temp); + temp_dbl = -rolldotn; + scale3(temp_dbl, nx, temp_array); + sub3(hist_temp, temp_array, hist_temp); // also rescale to preserve magnitude - prjmag = MathExtra::len3(hist_temp); - if (prjmag > 0) temp_double = rollmag / prjmag; - else temp_double = 0; - MathExtra::scale3(temp_double, hist_temp); + prjmag = len3(hist_temp); + if (prjmag > 0) temp_dbl = rollmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, hist_temp); } - MathExtra::scale3(dt, vrl, temp_array); - MathExtra::add3(hist_temp, temp_array, hist_temp) + scale3(dt, vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); } - MathExtra::scaleadd3(k_roll, hist_tepm, gamma_roll, vrl, fr); - MathExtra::negate3(fr); + scaleadd3(k_roll, hist_temp, gamma_roll, vrl, fr); + negate3(fr); // rescale frictional displacements and forces if needed - magfr = MathExtra::len3(fr); + magfr = len3(fr); if (magfr > Frcrit) { - rollmag = MathExtra::len3(temp); + rollmag = len3(hist_temp); if (rollmag != 0.0) { - temp_double = -Frcrit / (magfr * k_roll); - MathExtra::scale3(temp_double, fr, temp_array); - MathExtra::add3(hist_temp, temp_array, hist_temp); + temp_dbl = -Frcrit / (magfr * k_roll); + scale3(temp_dbl, fr, temp_array); + add3(hist_temp, temp_array, hist_temp); - temp_double = -gamma_roll/k_roll; - MathExtra::scale3(temp_double, vrl, temp_array); - MathExtra::add3(hist_temp, temp_array, hist_temp) + temp_dbl = -gamma_roll/k_roll; + scale3(temp_dbl, vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); - temp_double = Frcrit / magfr; - MathExtra::scale3(temp_double, fr); + temp_dbl = Frcrit / magfr; + scale3(temp_dbl, fr); } else { - MathExtra::zero3(fr); + zero3(fr); } } @@ -574,27 +585,27 @@ double ContactModel::rolling(double *history) /* ---------------------------------------------------------------------- */ -double ContactModel::twisting_marshall(double *history) +void ContactModel::twisting_marshall(double *history) { // Overwrite twist coefficients with derived values - k_twist = 0.5 * k_tangential * a * a; // eq 32 of Marshall paper - gamma_twist = 0.5 * gamma_tangential * a * a; - mu_twist = TWOTHIRDS * a * mu_tangential; + k_twist = 0.5 * k_tang * a * a; // eq 32 of Marshall paper + gamma_twist = 0.5 * gamma_tang * a * a; + mu_twist = TWOTHIRDS * a * mu_tang; twisting_SDS(history); } /* ---------------------------------------------------------------------- */ -double ContactModel::twisting_SDS(double *history) +void ContactModel::twisting_SDS(double *history) { double signtwist, Mtcrit; - if (historyupdate) { + if (history_update) { history[twist_history_index] += magtwist * dt; } - magtortwist = -k_twist * history[twist_history_index] - damp_twist*magtwist; // M_t torque (eq 30) + magtortwist = -k_twist * history[twist_history_index] - gamma_twist*magtwist; // M_t torque (eq 30) signtwist = (magtwist > 0) - (magtwist < 0); Mtcrit = mu_twist * Fncrit; // critical torque (eq 44) if (fabs(magtortwist) > Mtcrit) { @@ -616,9 +627,9 @@ double ContactModel::pulloff_distance(double radi, double radj) Reff_tmp = radi * radj / (radi + radj); if (Reff_tmp <= 0) return 0; - Ecaled = E * THREEQUARTERS; + Ecaled = k_norm * THREEQUARTERS; a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); } -}} +} diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index a5b5d23463..167f88e9de 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -11,14 +11,29 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef LMP_CONTACT -_H -#define LMP_CONTACT -_H +#ifndef LMP_CONTACT_H +#define LMP_CONTACT_H -namespace LAMMPS_NS { namespace Contact { + enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; + enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; + enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, + TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, + TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; + enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; + enum {ROLL_NONE, ROLL_SDS}; + + #define PI27SQ 266.47931882941264802866 // 27*PI**2 + #define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) + #define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) + #define INVROOT6 0.40824829046386307274 // 1/sqrt(6) + #define FOURTHIRDS (4.0/3.0) // 4/3 + #define ONETHIRD (1.0/3.0) // 1/3 + #define THREEQUARTERS 0.75 // 3/4 + + #define EPSILON 1e-10 + class ContactModel { public: ContactModel(); @@ -26,6 +41,7 @@ namespace Contact { bool check_contact(); void prep_contact(); void calculate_forces(double *, double *, double *, double *); + double calculate_heat(); double pulloff_distance(double, double); int normal_model, damping_model, tangential_model; @@ -37,23 +53,25 @@ namespace Contact { double k_tang, gamma_tang, mu_tang; // tangential_coeffs - wutang? double k_roll, gamma_roll, mu_roll; // roll_coeffs double k_twist, gamma_twist, mu_twist; // twist_coeffs + double conductivity; - double radi, radj, meff, dt; - double xi[3], xj[3], vi[3], vj[3], omegai[3], omegaj[3]; + double radi, radj, meff, dt, Ti, Tj; + double *xi, *xj, *vi, *vj, *omegai, *omegaj; int history_update, roll_history_index, twist_history_index; + double fs[3], fr[3], ft[3], magtortwist; + private: - double a, knfac, Fncrit, Fscrit, Frcrit, damp_normal_prefactor; - double fs[3], fr[3], ft[3]; - double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta; - double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrel; - double magtwist, magtortwist; + double a, knfac, Fntot, Fncrit, Fscrit, Frcrit, damp_normal_prefactor; + double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; + double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; + double magtwist; bool touch; int prep_flag, check_flag; int mindlin_rescale, mindlin_force; - void touch_JKR(int); + bool touch_JKR(int); double normal_JKR(); double normal_DMT(); double normal_Hertz(); @@ -69,5 +87,5 @@ namespace Contact { }; } // namespace Contact -} // namespace LAMMPS_NS + #endif diff --git a/src/GRANULAR/fix_temp_integrate.cpp b/src/GRANULAR/fix_temp_integrate.cpp index bb351d7db4..f81442766b 100644 --- a/src/GRANULAR/fix_temp_integrate.cpp +++ b/src/GRANULAR/fix_temp_integrate.cpp @@ -36,27 +36,21 @@ FixTempIntegrate::FixTempIntegrate(LAMMPS *lmp, int narg, char **arg) : cp_style = NONE; int ntypes = atom->ntypes; - int iarg = 3; - while (iarg < narg) { - if (strcmp(arg[iarg+1],"constant") == 0) { - if (iarg+2 >= narg) error->all(FLERR,"Illegal fix command"); - cp_style = CONSTANT; - cp = utils::numeric(FLERR,arg[iarg+2],false,lmp); - if (cp < 0.0) error->all(FLERR,"Illegal fix command"); - iarg += 2; - } else if (strcmp(arg[iarg+1],"type") == 0) { - if (iarg+1+ntypes >= narg) error->all(FLERR,"Illegal fix command"); - cp_style = TYPE; - memory->create(cp_type,ntypes+1,"fix/temp/integrate:cp_type"); - for (int i = 1; i <= ntypes; i++) { - cp_type[i] = utils::numeric(FLERR,arg[iarg+1+i],false,lmp); - if (cp_type[i] < 0.0) error->all(FLERR,"Illegal fix command"); - } - iarg += 1+ntypes; - } else { - error->all(FLERR,"Illegal fix command"); + if (strcmp(arg[3],"constant") == 0) { + if (narg != 5) error->all(FLERR,"Illegal fix command"); + cp_style = CONSTANT; + cp = utils::numeric(FLERR,arg[4],false,lmp); + if (cp < 0.0) error->all(FLERR,"Illegal fix command"); + } else if (strcmp(arg[3],"type") == 0) { + if (narg != 4 + ntypes) error->all(FLERR,"Illegal fix command"); + cp_style = TYPE; + memory->create(cp_type,ntypes+1,"fix/temp/integrate:cp_type"); + for (int i = 1; i <= ntypes; i++) { + cp_type[i] = utils::numeric(FLERR,arg[3+i],false,lmp); + if (cp_type[i] < 0.0) error->all(FLERR,"Illegal fix command"); } - iarg += 1; + } else { + error->all(FLERR,"Illegal fix command"); } if (cp_style == NONE) diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 61644df9c2..0047e24359 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -40,14 +40,13 @@ #include #include +#include using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; using namespace Contact; - - /* ---------------------------------------------------------------------- */ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) @@ -70,10 +69,6 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) maxrad_dynamic = nullptr; maxrad_frozen = nullptr; - models = nullptr; - - limit_damping = nullptr; - history_transfer_factors = nullptr; dt = update->dt; @@ -87,6 +82,7 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) nondefault_history_transfer = 0; tangential_history_index = 0; roll_history_index = twist_history_index = 0; + heat_flag = 0; // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script @@ -108,24 +104,6 @@ PairGranular::~PairGranular() if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); - memory->destroy(cutoff_type); - - memory->destroy(models); - - memory->destroy(normal_coeffs); - memory->destroy(tangential_coeffs); - memory->destroy(roll_coeffs); - memory->destroy(twist_coeffs); - - memory->destroy(Emod); - memory->destroy(poiss); - - memory->destroy(normal_model); - memory->destroy(damping_model); - memory->destroy(tangential_model); - memory->destroy(roll_model); - memory->destroy(twist_model); - memory->destroy(limit_damping); delete [] onerad_dynamic; delete [] onerad_frozen; @@ -141,7 +119,7 @@ PairGranular::~PairGranular() void PairGranular::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; - double factor_lj,mi,mj,meff; + double factor_lj,mi,mj,meff,delx,dely,delz; double forces[3], torquesi[3], torquesj[3]; int *ilist,*jlist,*numneigh,**firstneigh; @@ -184,6 +162,11 @@ void PairGranular::compute(int eflag, int vflag) int *mask = atom->mask; int nlocal = atom->nlocal; double *special_lj = force->special_lj; + double *heatflux, *temperature, dq; + if (heat_flag) { + heatflux = atom->heatflux; + temperature = atom->temperature; + } inum = list->inum; ilist = list->ilist; @@ -214,14 +197,13 @@ void PairGranular::compute(int eflag, int vflag) jtype = type[j]; // Reset model and copy initial geometric data - models[itype][jtype]->reset_contact(); + models[itype][jtype].reset_contact(); models[itype][jtype].xi = x[i]; models[itype][jtype].xj = x[j]; models[itype][jtype].radi = radius[i]; models[itype][jtype].radj = radius[j]; - - touchflag = models[itype][jtype]->check_contact(); + touchflag = models[itype][jtype].check_contact(); if (!touchflag) { // unset non-touching neighbors @@ -247,18 +229,21 @@ void PairGranular::compute(int eflag, int vflag) // Copy additional information and prepare force calculations models[itype][jtype].meff = meff; - models[itype][jtype].dt = dt; - models[itype][jtype].history_update = historyupdate; - models[itype][jtype].roll_history_index = roll_history_index; - models[itype][jtype].twist_history_index = twist_history_index; models[itype][jtype].vi = v[i]; models[itype][jtype].vj = v[j]; models[itype][jtype].omegai = omega[i]; models[itype][jtype].omegaj = omega[j]; - models[itype][jtype] -> prep_contact(); + models[itype][jtype].history_update = historyupdate; + models[itype][jtype].prep_contact(); + + if (heat_flag) { + models[itype][jtype].Ti = temperature[i]; + models[itype][jtype].Tj = temperature[j]; + } if (models[itype][jtype].normal_model == JKR) touch[jj] = 1; + // if any history is needed if (use_history) { touch[jj] = 1; @@ -266,22 +251,30 @@ void PairGranular::compute(int eflag, int vflag) } models[itype][jtype].calculate_forces(forces, torquesi, torquesj, history); + if (heat_flag) dq = models[itype][jtype].calculate_heat(); // apply forces & torques MathExtra::scale3(factor_lj, forces); MathExtra::add3(f[i], forces, f[i]); MathExtra::scale3(factor_lj, torquesi); - MathExtra::add3(torques[i], torquesi, torques[i]); + MathExtra::add3(torque[i], torquesi, torque[i]); + if (heat_flag) heatflux[i] += dq; if (force->newton_pair || j < nlocal) { MathExtra::sub3(f[j], forces, f[j]); MathExtra::scale3(factor_lj, torquesj); - MathExtra::add3(torques[j], torquesj, torques[j]); + MathExtra::add3(torque[j], torquesj, torque[j]); + if (heat_flag) heatflux[j] -= dq; } - if (evflag) ev_tally_xyz(i,j,nlocal,force->newton_pair, - 0.0,0.0,forces[0],forces[1],forces[2],dx[0],dy[1],dx[2]); + if (evflag) { + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + ev_tally_xyz(i,j,nlocal,force->newton_pair, + 0.0,0.0,forces[0],forces[1],forces[2],delx,dely,delz); + } } } } @@ -303,7 +296,9 @@ void PairGranular::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutoff_type,n+1,n+1,"pair:cutoff_type"); - memory->create(models,n+1,n+1,"pair:models"); + for (int i = 0; i < n+1; i++) { + models.push_back(std::vector (n+1)); + } onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -341,6 +336,7 @@ void PairGranular::coeff(int narg, char **arg) double roll_coeffs_one[4]; double twist_coeffs_one[4]; + double conductivity_one; double cutoff_one = -1; if (narg < 2) @@ -535,6 +531,14 @@ void PairGranular::coeff(int narg, char **arg) } else if (strcmp(arg[iarg], "limit_damping") == 0) { ld_flag = 1; iarg += 1; + } else if (strcmp(arg[iarg], "heat") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + conductivity_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); + if (conductivity_one < 0.0) + error->all(FLERR, "Illegal pair_coeff command, conductivity must be positive"); + heat_flag = 1; + iarg += 2; } else error->all(FLERR, "Illegal pair_coeff command"); } @@ -590,28 +594,29 @@ void PairGranular::coeff(int narg, char **arg) } else { models[i][j].k_tang = models[j][i].k_tang = tangential_coeffs_one[0]; } - models[i][j].gamma_tang = models[j][i]].gamma_tang = tangential_coeffs_one[1]; - models[i][j].mu_tang = models[j][i]].mu_tang = tangential_coeffs_one[2]; + models[i][j].gamma_tang = models[j][i].gamma_tang = tangential_coeffs_one[1]; + models[i][j].mu_tang = models[j][i].mu_tang = tangential_coeffs_one[2]; // Define rolling model - model[i][j].roll_model = model[j][i].roll_model = roll_model_one; + models[i][j].roll_model = models[j][i].roll_model = roll_model_one; if (roll_model_one != ROLL_NONE) { - model[i][j].k_roll = model[j][i].k_roll = roll_coeffs_one[0]; - model[i][j].gamma_roll = model[j][i].gamma_roll = roll_coeffs_one[1]; - model[i][j].mu_roll = model[j][i].mu_roll = roll_coeffs_one[2]; + models[i][j].k_roll = models[j][i].k_roll = roll_coeffs_one[0]; + models[i][j].gamma_roll = models[j][i].gamma_roll = roll_coeffs_one[1]; + models[i][j].mu_roll = models[j][i].mu_roll = roll_coeffs_one[2]; } // Define twisting model models[i][j].twist_model = models[j][i].twist_model = twist_model_one; if (twist_model_one != TWIST_NONE && twist_model_one != TWIST_MARSHALL) { - model[i][j].k_twist = model[j][i].k_twist = twist_coeffs_one[0]; - model[i][j].gamma_twist = model[j][i].gamma_twist = twist_coeffs_one[1]; - model[i][j].mu_twist = model[j][i].mu_twist = twist_coeffs_one[2]; + models[i][j].k_twist = models[j][i].k_twist = twist_coeffs_one[0]; + models[i][j].gamma_twist = models[j][i].gamma_twist = twist_coeffs_one[1]; + models[i][j].mu_twist = models[j][i].mu_twist = twist_coeffs_one[2]; } // Define extra options - model[i][j].cutoff_type = model[j][i].cutoff_type = cutoff_one; - model[i][j].limit_damping = model[j][i].limit_damping = ld_flag; + models[i][j].cutoff_type = models[j][i].cutoff_type = cutoff_one; + models[i][j].limit_damping = models[j][i].limit_damping = ld_flag; + models[i][j].conductivity = models[j][i].conductivity = conductivity_one; setflag[i][j] = 1; count++; @@ -666,8 +671,8 @@ void PairGranular::init_style() } for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) - if (model[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE || - model[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { + if (models[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE || + models[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { size_history += 1; roll_history_index += 1; twist_history_index += 1; @@ -785,7 +790,7 @@ double PairGranular::init_one(int i, int j) // Mix normal coefficients if (models[i][j].normal_model == HERTZ || models[i][j].normal_model == HOOKE) - models[i][j].k_norm = models[j][i][0].k_norm = + models[i][j].k_norm = models[j][i].k_norm = mix_geom(models[i][i].k_norm, models[j][j].k_norm); else models[i][j].k_norm = models[j][i].k_norm = @@ -794,7 +799,7 @@ double PairGranular::init_one(int i, int j) models[i][j].gamma_norm = models[j][i].gamma_norm = mix_geom(models[i][i].gamma_norm, models[j][j].gamma_norm); - if ((normal_model[i][j] == JKR) || (normal_model[i][j] == DMT)) + if ((models[i][j].normal_model == JKR) || (models[i][j].normal_model == DMT)) models[i][j].cohesion = models[j][i].cohesion = mix_geom(models[i][i].cohesion, models[j][j].cohesion); @@ -807,7 +812,7 @@ double PairGranular::init_one(int i, int j) mix_geom(models[i][i].mu_tang, models[j][j].mu_tang); // Mix rolling coefficients - if (models.roll_model[i][j] != ROLL_NONE) { + if (models[i][j].roll_model != ROLL_NONE) { models[i][j].k_roll = models[j][i].k_roll = mix_geom(models[i][i].k_roll, models[j][j].k_roll); models[i][j].gamma_roll = models[j][i].gamma_roll = @@ -825,8 +830,19 @@ double PairGranular::init_one(int i, int j) models[i][j].mu_twist = models[j][i].mu_twist = mix_geom(models[i][i].mu_twist, models[j][j].mu_twist); } + + models[i][j].limit_damping = models[j][i].limit_damping = + MAX(models[i][i].limit_damping, models[j][j].limit_damping); + if (heat_flag) { + models[i][j].conductivity = models[j][i].conductivity = + mix_geom(models[i][i].conductivity, models[j][j].conductivity); + } } + // Check if conductivity is undefined (negative) for any type combination + if (heat_flag && models[i][j].conductivity < 0.0) + error->all(FLERR, "To calculate heat, conductivity must be defined for all pair coeff"); + // It is possible that cut[i][j] at this point is still 0.0. // This can happen when // there is a future fix_pour after the current run. A cut[i][j] = 0.0 creates @@ -843,14 +859,14 @@ double PairGranular::init_one(int i, int j) ((maxrad_frozen[i] > 0.0) && (maxrad_dynamic[j] > 0.0))) { cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; pulloff = 0.0; - if (normal_model[i][j] == JKR) { - pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j]); + if (models[i][j].normal_model == JKR) { + pulloff = models[i][j].pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j]); cutoff += pulloff; - pulloff = models[i][j]->pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j]); + pulloff = models[i][j].pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j]); cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j] + pulloff); - pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j]); + pulloff = models[i][j].pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j]); cutoff = MAX(cutoff,maxrad_dynamic[i] + maxrad_frozen[j] + pulloff); } } else { @@ -872,6 +888,11 @@ double PairGranular::init_one(int i, int j) cutoff = cutoff_global; } + // Copy global options + models[i][j].dt = dt; + models[i][j].roll_history_index = roll_history_index; + models[i][j].twist_history_index = twist_history_index; + return cutoff; } @@ -982,26 +1003,114 @@ void PairGranular::reset_dt() double PairGranular::single(int i, int j, int itype, int jtype, double rsq, double /* factor_coul */, - double /* factor_lj */, double &fforce) + double factor_lj, double &fforce) { + if (factor_lj == 0) { + fforce = 0.0; + for (int m = 0; m < single_extra; m++) svector[m] = 0.0; + return 0.0; + } - fforce = Fntot*rinv; + int jnum; + int *jlist; + double *history,*allhistory; + + int nall = atom->nlocal + atom->nghost; + if ((i >= nall) || (j >= nall)) + error->all(FLERR,"Not enough atoms for pair granular single function"); + + + int touchflag; + double **x = atom->x; + double *radius = atom->radius; + + // Reset model and copy initial geometric data + models[itype][jtype].reset_contact(); + models[itype][jtype].xi = x[i]; + models[itype][jtype].xj = x[j]; + models[itype][jtype].radi = radius[i]; + models[itype][jtype].radj = radius[j]; + models[i][j].history_update = 0; // Don't update history + + touchflag = models[itype][jtype].check_contact(); + + if (!touchflag) { + fforce = 0.0; + for (int m = 0; m < single_extra; m++) svector[m] = 0.0; + return 0.0; + } + + // meff = effective mass of pair of particles + // if I or J part of rigid body, use body mass + // if I or J is frozen, meff is other particle + double mi, mj, meff; + double *rmass = atom->rmass; + int *mask = atom->mask; + + mi = rmass[i]; + mj = rmass[j]; + if (fix_rigid) { + if (mass_rigid[i] > 0.0) mi = mass_rigid[i]; + if (mass_rigid[j] > 0.0) mj = mass_rigid[j]; + } + meff = mi * mj / (mi + mj); + if (mask[i] & freeze_group_bit) meff = mj; + if (mask[j] & freeze_group_bit) meff = mi; + + // Copy additional information and prepare force calculations + double **v = atom->v; + double **omega = atom->omega; + + models[itype][jtype].meff = meff; + models[itype][jtype].vi = v[i]; + models[itype][jtype].vj = v[j]; + models[itype][jtype].omegai = omega[i]; + models[itype][jtype].omegaj = omega[j]; + models[itype][jtype].prep_contact(); + + // if any history is needed + + jnum = list->numneigh[i]; + jlist = list->firstneigh[i]; + + if (use_history) { + if ((fix_history == nullptr) || (fix_history->firstvalue == nullptr)) + error->one(FLERR,"Pair granular single computation needs history"); + allhistory = fix_history->firstvalue[i]; + for (int jj = 0; jj < jnum; jj++) { + neighprev++; + if (neighprev >= jnum) neighprev = 0; + if (jlist[neighprev] == j) break; + } + history = &allhistory[size_history*neighprev]; + } + + double forces[3], torquesi[3], torquesj[3]; + models[itype][jtype].calculate_forces(forces, torquesi, torquesj, history); + + // apply forces & torques + fforce = MathExtra::len3(forces); // set single_extra quantities - svector[0] = fs1; - svector[1] = fs2; - svector[2] = fs3; - svector[3] = fs; - svector[4] = fr1; - svector[5] = fr2; - svector[6] = fr3; - svector[7] = fr; - svector[8] = magtortwist; + double delx = x[i][0] - x[j][0]; + double dely = x[i][1] - x[j][1]; + double delz = x[i][2] - x[j][2]; + + svector[0] = models[itype][jtype].fs[0]; + svector[1] = models[itype][jtype].fs[1]; + svector[2] = models[itype][jtype].fs[2]; + svector[3] = MathExtra::len3(models[itype][jtype].fs); + svector[4] = models[itype][jtype].fr[0]; + svector[5] = models[itype][jtype].fr[1]; + svector[6] = models[itype][jtype].fr[2]; + svector[7] = MathExtra::len3(models[itype][jtype].fr); + svector[8] = models[itype][jtype].magtortwist; svector[9] = delx; svector[10] = dely; svector[11] = delz; + return 0.0; } @@ -1117,7 +1226,7 @@ double PairGranular::radii2cut(double r1, double r2) for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ if (models[i][j].normal_model == JKR) { - temp = pulloff_distance(r1, r2); + temp = models[i][j].pulloff_distance(r1, r2); if (temp > cut) cut = temp; } } diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 509981d5f9..3440d60e29 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -20,7 +20,9 @@ PairStyle(granular,PairGranular); #ifndef LMP_PAIR_GRANULAR_H #define LMP_PAIR_GRANULAR_H +#include "contact.h" #include "pair.h" +#include namespace LAMMPS_NS { @@ -68,9 +70,10 @@ class PairGranular : public Pair { private: int size_history; int *history_transfer_factors; + int heat_flag; // contact models - ContactModel **models; + std::vector > models; // history flags int normal_history, tangential_history, roll_history, twist_history; diff --git a/src/contact.cpp b/src/contact.cpp index b7d5d4d85d..b4b335a1aa 100644 --- a/src/contact.cpp +++ b/src/contact.cpp @@ -12,47 +12,624 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- - This class contains a series of DEM contact models - that can be defined and used to calculate forces + This class contains a series of tools for DEM contacts + Multiple models can be defined and used to calculate forces and torques based on contact geometry */ -#include #include "contact.h" +#include "math_const.h" +#include "math_extra.h" +#include "pointers.h" -namespace LAMMPS_NS { - namespace Contact{ +#include -enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; -enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; -enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, - TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; -enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; -enum {ROLL_NONE, ROLL_SDS}; +using namespace LAMMPS_NS; +using namespace MathExtra; +using namespace MathConst; -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define THREEQUARTERS 0.75 // 3/4 - -#define EPSILON 1e-10 +namespace Contact { ContactModel::ContactModel() { + k_norm = cohesion = gamma_norm = 0.0; + k_tang = gamma_tang = mu_tang = 0.0; + k_roll = gamma_roll = mu_roll = 0.0; + k_twist = gamma_twist = mu_twist = 0.0; + limit_damping = 0; + cutoff_type = 0.0; + reset_contact(); +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::reset_contact() +{ + radi = radj = 0.0; + xi = xj = vi = vj = omegai = omegaj = nullptr; + + prep_flag = check_flag = 0; + touch = false; +} + +/* ---------------------------------------------------------------------- */ + +bool ContactModel::check_contact() +{ + check_flag = 1; + + sub3(xi, xj, dx); + rsq = lensq3(dx); + radsum = radi + radj; + Reff = radi*radj/radsum; + + touch = false; + if (normal_model == JKR) touch = touch_JKR(touch); + else touch = (rsq < radsum*radsum); + + return touch; +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::prep_contact() +{ + prep_flag = 1; + + // If it hasn't already been done, test if the contact exists + if (check_flag != 1) touch = check_contact(); + if (!touch) return; + + double temp[3]; + + // Set flags + mindlin_rescale = mindlin_force = 0; + if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) + mindlin_rescale = 1; + if (tangential_model == TANGENTIAL_MINDLIN_FORCE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) + mindlin_force = 1; + + // Standard geometric quantities + r = sqrt(rsq); + rinv = 1.0/r; + delta = radsum - r; + dR = delta*Reff; + scale3(rinv, dx, nx); + + // relative translational velocity + sub3(vi, vj, vr); + + // normal component + vnnr = dot3(vr, nx); //v_R . n + scale3(vnnr, nx, vn); + + // tangential component + sub3(vr, vn, vt); + + // relative rotational velocity + scaleadd3(radi, omegai, radj, omegaj, wr); + + // relative tangential velocities + cross3(wr, nx, temp); + sub3(vt, temp, vtr); + vrel = len3(vtr); + + if (roll_model != ROLL_NONE || twist_model != TWIST_NONE) + sub3(omegai, omegaj, relrot); + + if (roll_model != ROLL_NONE) { + // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) + // this is different from the Marshall papers, which use the Bagi/Kuhn formulation + // for rolling velocity (see Wang et al for why the latter is wrong) + vrl[0] = Reff * (relrot[1] * nx[2] - relrot[2] * nx[1]); + vrl[1] = Reff * (relrot[2] * nx[0] - relrot[0] * nx[2]); + vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); + } + + if (twist_model != TWIST_NONE) { + // omega_T (eq 29 of Marshall) + magtwist = dot3(relrot, nx); + } +} + + +/* ---------------------------------------------------------------------- */ + +void ContactModel::calculate_forces(double *forces, double *torquesi, double *torquesj, double *history) +{ + // If it hasn't already been done, run prep calculations + if (prep_flag != 1) prep_contact(); + if (!touch) { + forces[0] = forces[1] = forces[2] = 0.0; + return; + } + + //********************************************** + // normal forces + //********************************************** + + // Also calculates: a, knfac, Fncrit (for JKR or DMT) + double Fne; + if (normal_model == JKR) { + Fne = normal_JKR(); + } else if (normal_model == DMT) { + Fne = normal_DMT(); + } else if (normal_model == HERTZ || normal_model == HERTZ_MATERIAL) { + Fne = normal_Hertz(); + } else { + Fne = normal_Hooke(); + } + + // NOTE: consider restricting Hooke to only have + // 'velocity' as an option for damping? + // Also calculates: damp_normal_prefactor + double Fdamp = normal_damping(); + + Fntot = Fne + Fdamp; + if (limit_damping && (Fntot < 0.0)) Fntot = 0.0; + + if (normal_model != JKR && normal_model != DMT) Fncrit = fabs(Fntot); + + //********************************************** + // tangential force, including history effects + //********************************************** + // For linear, mindlin, mindlin_rescale: + // history = cumulative tangential displacement + // + // For mindlin/force, mindlin_rescale/force: + // history = cumulative tangential elastic force + + Fscrit = mu_tang * Fncrit; + + if (tangential_model == TANGENTIAL_MINDLIN || + tangential_model == TANGENTIAL_MINDLIN_FORCE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { + tangential_mindlin(history); + } else if (tangential_model == TANGENTIAL_HISTORY) { + tangential_history(history); + } else { + tangential_no_history(); + } + + //********************************************** + // rolling force + //********************************************** + + if (roll_model != ROLL_NONE) + rolling(history); + + //**************************************** + // twisting torque, including history effects + //**************************************** + + if (twist_model == TWIST_MARSHALL) { + twisting_marshall(history); + } else if (twist_model == TWIST_SDS) { + twisting_SDS(history); + } + + //********************************************** + // sum contributions + //********************************************** + + scale3(Fntot, nx, forces); + add3(forces, fs, forces); + + cross3(nx, fs, torquesi); + copy3(torquesi, torquesj); + + double dist_to_contact = radi-0.5*delta; + scale3(dist_to_contact, torquesi); + dist_to_contact = radj-0.5*delta; + scale3(dist_to_contact, torquesj); + + double torroll[3]; + if (roll_model != ROLL_NONE) { + cross3(nx, fr, torroll); + scale3(Reff, torroll); + add3(torquesi, torroll, torquesi); + sub3(torquesj, torroll, torquesj); + } + + double tortwist[3]; + if (twist_model != TWIST_NONE) { + scale3(magtortwist, nx, tortwist); + add3(torquesi, tortwist, torquesi); + sub3(torquesj, tortwist, torquesj); + } +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::calculate_heat() +{ + double dT = Ti - Tj; + double Hc; + + //Dan is Emod the youngs modulus for all models? or do I need to scale? + Hc = 2 * conductivity * pow(FOURTHIRDS * Fntot * Reff / Emod, ONETHIRD); + + return Hc * dT; +} + +/* ---------------------------------------------------------------------- */ + +bool ContactModel::touch_JKR(int touch) +{ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = k_norm * THREEQUARTERS; + if (touch) { + R2 = Reff * Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = radsum - delta_pulloff; + touchflag = (rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rsq < radsum * radsum); + } + return touchflag; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_JKR() +{ + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = Escaled * a; + Fncrit = fabs(Fne + 2 * F_pulloff); + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_DMT() +{ + a = sqrt(dR); + double Fne = a * k_norm * delta; + Fne -= 4 * MY_PI * cohesion * Reff; + double F_pulloff = 4 * MY_PI * cohesion * Reff; + + knfac = k_norm * a; + Fncrit = fabs(Fne + 2 * F_pulloff); + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_Hertz() +{ + a = sqrt(dR); + double Fne = k_norm * delta * a; + + knfac = k_norm * a; + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_Hooke() +{ + a = sqrt(dR); + double Fne = k_norm * delta; + + knfac = k_norm; + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +double ContactModel::normal_damping() +{ + double damp_normal; + if (damping_model == VELOCITY) { + damp_normal = 1; + } else if (damping_model == MASS_VELOCITY) { + damp_normal = meff; + } else if (damping_model == VISCOELASTIC) { + damp_normal = a * meff; + } else if (damping_model == TSUJI) { + damp_normal = sqrt(meff * knfac); + } else damp_normal = 0.0; + + damp_normal_prefactor = gamma_norm * damp_normal; + return -damp_normal_prefactor * vnnr; +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::tangential_no_history() +{ + double gamma_scaled = gamma_tang * damp_normal_prefactor; + double fsmag, Ft; + + // classic pair gran/hooke (no history) + fsmag = gamma_scaled * vrel; + if (vrel != 0.0) Ft = MIN(Fscrit,fsmag) / vrel; + else Ft = 0.0; + + Ft = -Ft; + scale3(Ft, vtr, fs); +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::tangential_history(double *history) +{ + double gamma_scaled = gamma_tang * damp_normal_prefactor; + double k = k_tang; + int frame_update = 0; + double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (history_update) { + rsht = dot3(history, nx); + frame_update = fabs(rsht) * k > EPSILON * Fscrit; + + if (frame_update) { + shrmag = len3(history); + // projection + scale3(rsht, nx, history); + // also rescale to preserve magnitude + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); + } + + // update history + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + temp_dbl = k * dt; + scale3(temp_dbl, vtr, temp_array); + sub3(history, temp_array, history); + } + + // tangential forces = history + tangential velocity damping + temp_dbl = -gamma_norm; + scale3(temp_dbl, vtr, fs); + + // rescale frictional displacements and forces if needed + magfs = len3(fs); + if (magfs > Fscrit) { + shrmag = len3(history); + if (shrmag != 0.0) { + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs, history); + scale3(gamma_norm, vtr, temp_array); + add3(history, temp_array, history); + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs); + } else { + zero3(fs); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::tangential_mindlin(double *history) +{ + double k_scaled, gamma_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; + double temp_array[3]; + int frame_update = 0; + + gamma_scaled = gamma_tang * damp_normal_prefactor; + k_scaled = k_tang * a; + if (mindlin_rescale) { + // on unloading, rescale the shear displacements/force + if (a < history[3]) { + temp_dbl = a / history[3]; + scale3(temp_dbl, history); + } + } + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (history_update) { + rsht = dot3(history, nx); + if (mindlin_force) + frame_update = fabs(rsht) > EPSILON * Fscrit; + else + frame_update = fabs(rsht) * k_scaled > EPSILON * Fscrit; + + if (frame_update) { + shrmag = len3(history); + // projection + scale3(rsht, nx, history); + // also rescale to preserve magnitude + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); + } + + // update history + if (mindlin_force) { + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + temp_dbl = -k_scaled * dt; + scale3(temp_dbl, vtr, temp_array); + } else { + scale3(dt, vtr, temp_array); + } + add3(history, temp_array, history); + + if (mindlin_rescale) history[3] = a; + } + + // tangential forces = history + tangential velocity damping + temp_dbl = -gamma_scaled; + scale3(temp_dbl, vtr, fs); + + if (! mindlin_force) { + scale3(k_scaled, history, temp_array); + add3(fs, temp_array, fs); + } + + // rescale frictional displacements and forces if needed + magfs = len3(fs); + if (magfs > Fscrit) { + shrmag = len3(history); + if (shrmag != 0.0) { + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs, history); + scale3(gamma_tang, vtr, temp_array); + add3(history, temp_array, history); + if (! mindlin_force) { + temp_dbl = -1.0 / k_tang; + scale3(temp_dbl, history); + } + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs); + } else { + zero3(fs); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::rolling(double *history) +{ + int rhist0, rhist1, rhist2, frameupdate; + double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; + + rhist0 = roll_history_index; + rhist1 = rhist0 + 1; + rhist2 = rhist1 + 1; + + Frcrit = mu_roll * Fncrit; + + if (history_update) { + hist_temp[0] = history[rhist0]; + hist_temp[1] = history[rhist1]; + hist_temp[2] = history[rhist2]; + rolldotn = dot3(hist_temp, nx); + + frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; + if (frameupdate) { // rotate into tangential plane + rollmag = len3(hist_temp); + // projection + temp_dbl = -rolldotn; + scale3(temp_dbl, nx, temp_array); + sub3(hist_temp, temp_array, hist_temp); + + // also rescale to preserve magnitude + prjmag = len3(hist_temp); + if (prjmag > 0) temp_dbl = rollmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, hist_temp); + } + scale3(dt, vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); + } + + scaleadd3(k_roll, hist_temp, gamma_roll, vrl, fr); + negate3(fr); + + // rescale frictional displacements and forces if needed + + magfr = len3(fr); + if (magfr > Frcrit) { + rollmag = len3(hist_temp); + if (rollmag != 0.0) { + temp_dbl = -Frcrit / (magfr * k_roll); + scale3(temp_dbl, fr, temp_array); + add3(hist_temp, temp_array, hist_temp); + + temp_dbl = -gamma_roll/k_roll; + scale3(temp_dbl, vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); + + temp_dbl = Frcrit / magfr; + scale3(temp_dbl, fr); + } else { + zero3(fr); + } + } + + history[rhist0] = hist_temp[0]; + history[rhist1] = hist_temp[1]; + history[rhist2] = hist_temp[2]; +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::twisting_marshall(double *history) +{ + // Overwrite twist coefficients with derived values + k_twist = 0.5 * k_tang * a * a; // eq 32 of Marshall paper + gamma_twist = 0.5 * gamma_tang * a * a; + mu_twist = TWOTHIRDS * a * mu_tang; + + twisting_SDS(history); +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::twisting_SDS(double *history) +{ + double signtwist, Mtcrit; + + if (history_update) { + history[twist_history_index] += magtwist * dt; + } + + magtortwist = -k_twist * history[twist_history_index] - gamma_twist*magtwist; // M_t torque (eq 30) + signtwist = (magtwist > 0) - (magtwist < 0); + Mtcrit = mu_twist * Fncrit; // critical torque (eq 44) + if (fabs(magtortwist) > Mtcrit) { + history[twist_history_index] = (Mtcrit * signtwist - gamma_twist * magtwist) / k_twist; + magtortwist = -Mtcrit * signtwist; // eq 34 + } } /* ---------------------------------------------------------------------- - get volume-correct r basis in: basis*cbrt(vol) = q*r + compute pull-off distance (beyond contact) for a given radius and atom type + use temporary variables since this does not use a specific contact geometry ------------------------------------------------------------------------- */ -void ContactModel::() +double ContactModel::pulloff_distance(double radi, double radj) { + double Ecaled, a_tmp, Reff_tmp; + if (normal_model != JKR) return radi+radj; + + Reff_tmp = radi * radj / (radi + radj); + if (Reff_tmp <= 0) return 0; + Ecaled = k_norm * THREEQUARTERS; + a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); + return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); } - -}} +} diff --git a/src/contact.h b/src/contact.h index 38cb6f0be6..167f88e9de 100644 --- a/src/contact.h +++ b/src/contact.h @@ -11,40 +11,81 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef LMP_CONTACT -_H -#define LMP_CONTACT -_H +#ifndef LMP_CONTACT_H +#define LMP_CONTACT_H -namespace LAMMPS_NS { namespace Contact { + enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; + enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; + enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, + TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, + TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; + enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; + enum {ROLL_NONE, ROLL_SDS}; + + #define PI27SQ 266.47931882941264802866 // 27*PI**2 + #define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) + #define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) + #define INVROOT6 0.40824829046386307274 // 1/sqrt(6) + #define FOURTHIRDS (4.0/3.0) // 4/3 + #define ONETHIRD (1.0/3.0) // 1/3 + #define THREEQUARTERS 0.75 // 3/4 + + #define EPSILON 1e-10 + class ContactModel { public: ContactModel(); - void touch_JKR(int); - void normal_JKR(double&); - void normal_DMT(double&); - void normal_Hooke(double&); - double normal_damping(double, double); - double critical_normal(double, double); + void reset_contact(); + bool check_contact(); + void prep_contact(); + void calculate_forces(double *, double *, double *, double *); + double calculate_heat(); + double pulloff_distance(double, double); int normal_model, damping_model, tangential_model; int roll_model, twist_model; - double E, G, poisson, damp, coh; + int limit_damping; + double cutoff_type; + double Emod, poisson; // variables used in defining mixed interactions + double k_norm, gamma_norm, cohesion; // normal_coeffs + double k_tang, gamma_tang, mu_tang; // tangential_coeffs - wutang? + double k_roll, gamma_roll, mu_roll; // roll_coeffs + double k_twist, gamma_twist, mu_twist; // twist_coeffs + double conductivity; + + double radi, radj, meff, dt, Ti, Tj; + double *xi, *xj, *vi, *vj, *omegai, *omegaj; + int history_update, roll_history_index, twist_history_index; + + double fs[3], fr[3], ft[3], magtortwist; private: - double a, knfac; - ContactGeometry geom; + double a, knfac, Fntot, Fncrit, Fscrit, Frcrit, damp_normal_prefactor; + double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; + double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; + double magtwist; + bool touch; + + int prep_flag, check_flag; + int mindlin_rescale, mindlin_force; + + bool touch_JKR(int); + double normal_JKR(); + double normal_DMT(); + double normal_Hertz(); + double normal_Hooke(); + double normal_damping(); + void tangential_no_history(); + void tangential_history(double *); + void tangential_mindlin(double *); + void rolling(double *); + void twisting_marshall(double *); + void twisting_SDS(double *); + }; - - class ContactGeometry { - public: - ContactGeometry(); - void add_data(); - double r, rinv, rsq, Reff, radsum, delta, dR; - }; } // namespace Contact -} // namespace LAMMPS_NS + #endif diff --git a/src/contact_model.cpp b/src/contact_model.cpp deleted file mode 100644 index 779631836b..0000000000 --- a/src/contact_model.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- - - This class contains a series of DEM contact models - that can be defined and used to calculate forces - and torques based on contact geometry -*/ - -#include -#include "contact_model.h" - -namespace LAMMPS_NS { - namespace Contact_Model{ - -enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; -enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; -enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, - TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; -enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; -enum {ROLL_NONE, ROLL_SDS}; - -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define THREEQUARTERS 0.75 // 3/4 - -#define EPSILON 1e-10 - -ContactModel::ContactModel() -{ - -} - -/* ---------------------------------------------------------------------- - get volume-correct r basis in: basis*cbrt(vol) = q*r -------------------------------------------------------------------------- */ - -void ContactModel::() -{ - -} - - -}} diff --git a/src/contact_model.h b/src/contact_model.h deleted file mode 100644 index 678a7111a8..0000000000 --- a/src/contact_model.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef LMP_CONTACT_MODEL_H -#define LMP_CONTACT_MODEL_H - -namespace LAMMPS_NS { -namespace Contact_Model { - - class ContactModel { - public: - ContactModel(); - void set_strain(const double, const double); - void step_deform(const double, const double); - bool reduce(); - void get_box(double[3][3], double); - void get_rot(double[3][3]); - void get_inverse_cob(int[3][3]); - - private: - double a, knfac; - }; -} // namespace Contact_Model -} // namespace LAMMPS_NS -#endif diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 87bd04b2a9..a74e91c889 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -41,7 +41,7 @@ enum{ID,MOL,PROC,PROCP1,TYPE,ELEMENT,MASS, XSU,YSU,ZSU,XSUTRI,YSUTRI,ZSUTRI, IX,IY,IZ, VX,VY,VZ,FX,FY,FZ, - Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER, + Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER,HEATFLUX,TEMPERATURE, OMEGAX,OMEGAY,OMEGAZ,ANGMOMX,ANGMOMY,ANGMOMZ, TQX,TQY,TQZ, COMPUTE,FIX,VARIABLE,IVEC,DVEC,IARRAY,DARRAY}; @@ -930,6 +930,18 @@ int DumpCustom::count() for (i = 0; i < nlocal; i++) dchoose[i] = 2.0*radius[i]; ptr = dchoose; nstride = 1; + } else if (thresh_array[ithresh] == HEATFLUX) { + if (!atom->heatflux_flag) + error->all(FLERR, + "Threshold for an atom property that isn't allocated"); + ptr = atom->heatflux; + nstride = 1; + } else if (thresh_array[ithresh] == TEMPERATURE) { + if (!atom->temperature_flag) + error->all(FLERR, + "Threshold for an atom property that isn't allocated"); + ptr = atom->temperature; + nstride = 1; } else if (thresh_array[ithresh] == OMEGAX) { if (!atom->omega_flag) error->all(FLERR, @@ -1380,6 +1392,16 @@ int DumpCustom::parse_fields(int narg, char **arg) error->all(FLERR,"Dumping an atom property that isn't allocated"); pack_choice[iarg] = &DumpCustom::pack_diameter; vtype[iarg] = Dump::DOUBLE; + } else if (strcmp(arg[iarg],"heatflux") == 0) { + if (!atom->heatflux_flag) + error->all(FLERR,"Dumping an atom property that isn't allocated"); + pack_choice[iarg] = &DumpCustom::pack_heatflux; + vtype[iarg] = Dump::DOUBLE; + } else if (strcmp(arg[iarg],"temperature") == 0) { + if (!atom->temperature_flag) + error->all(FLERR,"Dumping an atom property that isn't allocated"); + pack_choice[iarg] = &DumpCustom::pack_temperature; + vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"omegax") == 0) { if (!atom->omega_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); @@ -1845,6 +1867,8 @@ int DumpCustom::modify_param(int narg, char **arg) else if (strcmp(arg[1],"radius") == 0) thresh_array[nthresh] = RADIUS; else if (strcmp(arg[1],"diameter") == 0) thresh_array[nthresh] = DIAMETER; + else if (strcmp(arg[1],"heatflux") == 0) thresh_array[nthresh] = HEATFLUX; + else if (strcmp(arg[1],"temperature") == 0) thresh_array[nthresh] = TEMPERATURE; else if (strcmp(arg[1],"omegax") == 0) thresh_array[nthresh] = OMEGAX; else if (strcmp(arg[1],"omegay") == 0) thresh_array[nthresh] = OMEGAY; else if (strcmp(arg[1],"omegaz") == 0) thresh_array[nthresh] = OMEGAZ; @@ -2759,6 +2783,30 @@ void DumpCustom::pack_diameter(int n) /* ---------------------------------------------------------------------- */ +void DumpCustom::pack_heatflux(int n) +{ + double *heatflux = atom->heatflux; + + for (int i = 0; i < nchoose; i++) { + buf[n] = heatflux[clist[i]]; + n += size_one; + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustom::pack_temperature(int n) +{ + double *temperature = atom->temperature; + + for (int i = 0; i < nchoose; i++) { + buf[n] = temperature[clist[i]]; + n += size_one; + } +} + +/* ---------------------------------------------------------------------- */ + void DumpCustom::pack_omegax(int n) { double **omega = atom->omega; diff --git a/src/dump_custom.h b/src/dump_custom.h index b27a9950cd..fd4fd413c3 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -193,6 +193,8 @@ class DumpCustom : public Dump { void pack_mu(int); void pack_radius(int); void pack_diameter(int); + void pack_heatflux(int); + void pack_temperature(int); void pack_omegax(int); void pack_omegay(int); diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 613716c9a4..37d1b37946 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -353,7 +353,8 @@ void FixNeighHistory::pre_exchange_newton() // Ensure npartner is zeroed across all atoms, nall_neigh can be less than nall // when writing restarts when comm calls are made but modify->post_neighbor() isn't - for (i = 0; i < MAX(nall_neigh, atom->nall); i++) npartner[i] = 0; + int nall = atom->nlocal + atom->nghost; + for (i = 0; i < MAX(nall_neigh, nall); i++) npartner[i] = 0; tagint *tag = atom->tag; NeighList *list = pair->list; @@ -408,7 +409,7 @@ void FixNeighHistory::pre_exchange_newton() // store partner IDs and values for owned+ghost atoms // re-zero npartner to use as counter - for (i = 0; i < MAX(nall_neigh, atom->nall); i++) npartner[i] = 0; + for (i = 0; i < MAX(nall_neigh, nall); i++) npartner[i] = 0; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; From 222c40ebcf29bae96e76bf8f078beb6e375fadab Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 29 Jun 2022 15:02:05 -0600 Subject: [PATCH 008/112] Fixing memory errors --- src/.gitignore | 2 ++ src/GRANULAR/atom_vec_sphere_temp.cpp | 2 ++ src/GRANULAR/contact.cpp | 6 +++--- src/GRANULAR/pair_granular.cpp | 6 +++--- src/contact.cpp | 6 +++--- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/.gitignore b/src/.gitignore index acb509551c..a1aee630b5 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1472,6 +1472,8 @@ /compute_xrd.cpp /compute_xrd.h /compute_xrd_consts.h +/contact.cpp +/contact.h /fix_atom_swap.cpp /fix_atom_swap.h /fix_ave_spatial_sphere.cpp diff --git a/src/GRANULAR/atom_vec_sphere_temp.cpp b/src/GRANULAR/atom_vec_sphere_temp.cpp index a455a9ddc8..a92486a1b5 100644 --- a/src/GRANULAR/atom_vec_sphere_temp.cpp +++ b/src/GRANULAR/atom_vec_sphere_temp.cpp @@ -106,6 +106,8 @@ void AtomVecSphereTemp::grow_pointers() radius = atom->radius; rmass = atom->rmass; omega = atom->omega; + temperature = atom->temperature; + heatflux = atom->heatflux; } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index b4b335a1aa..a8405d095b 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -94,9 +94,9 @@ void ContactModel::prep_contact() // Standard geometric quantities r = sqrt(rsq); - rinv = 1.0/r; + rinv = 1.0 / r; delta = radsum - r; - dR = delta*Reff; + dR = delta * Reff; scale3(rinv, dx, nx); // relative translational velocity @@ -281,7 +281,7 @@ bool ContactModel::touch_JKR(int touch) double ContactModel::normal_JKR() { double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff, Fne; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; Escaled = k_norm * THREEQUARTERS; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 0047e24359..506cc2e175 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -889,9 +889,9 @@ double PairGranular::init_one(int i, int j) } // Copy global options - models[i][j].dt = dt; - models[i][j].roll_history_index = roll_history_index; - models[i][j].twist_history_index = twist_history_index; + models[i][j].dt = models[j][i].dt = dt; + models[i][j].roll_history_index = models[j][i].roll_history_index = roll_history_index; + models[i][j].twist_history_index = models[j][i].twist_history_index = twist_history_index; return cutoff; } diff --git a/src/contact.cpp b/src/contact.cpp index b4b335a1aa..a8405d095b 100644 --- a/src/contact.cpp +++ b/src/contact.cpp @@ -94,9 +94,9 @@ void ContactModel::prep_contact() // Standard geometric quantities r = sqrt(rsq); - rinv = 1.0/r; + rinv = 1.0 / r; delta = radsum - r; - dR = delta*Reff; + dR = delta * Reff; scale3(rinv, dx, nx); // relative translational velocity @@ -281,7 +281,7 @@ bool ContactModel::touch_JKR(int touch) double ContactModel::normal_JKR() { double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a, a2, F_pulloff, Fne; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; Escaled = k_norm * THREEQUARTERS; From ba1c4e8e814575c1ef3797982eb2655c41d2c4f2 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 29 Jun 2022 15:34:39 -0600 Subject: [PATCH 009/112] Defining conduction from area, a --- doc/src/pair_granular.rst | 10 +++++++++- src/GRANULAR/contact.cpp | 6 +----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index 9a99558653..c14d94a77a 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -635,7 +635,15 @@ attractive force. This keyword cannot be used with the JKR or DMT models. ---------- The optional *heat* keyword enables heat conduction and it must be followed by -a non-negative numeric value for the conductivity. Note that the *heat* keyword +a non-negative numeric value for the conductivity :math:`k_{s}.`` The heat :math:`Q` +conducted across an interface is given by + +.. math:: + + Q = k_{s} a \Delta T + +where :math:`\Delta T` is the difference in the two particles' temperature and :math:`a` +is the area of the contact and depends on the normal force model. Note that the *heat* keyword must be included in either all or none of of the *pair_coeff* calls. See :doc:`fix temp/integrate ` for more information on this option. diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index a8405d095b..a7b59f7172 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -249,11 +249,7 @@ double ContactModel::calculate_heat() { double dT = Ti - Tj; double Hc; - - //Dan is Emod the youngs modulus for all models? or do I need to scale? - Hc = 2 * conductivity * pow(FOURTHIRDS * Fntot * Reff / Emod, ONETHIRD); - - return Hc * dT; + return conductivity * a * dT; } /* ---------------------------------------------------------------------- */ From bb92dae6d355187628bcd17041d375f070d95854 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 5 Jul 2022 10:12:12 -0600 Subject: [PATCH 010/112] Simplying conduction --- src/GRANULAR/contact.cpp | 1 - src/contact.cpp | 635 --------------------------------------- 2 files changed, 636 deletions(-) delete mode 100644 src/contact.cpp diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index a7b59f7172..40105be815 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -248,7 +248,6 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to double ContactModel::calculate_heat() { double dT = Ti - Tj; - double Hc; return conductivity * a * dT; } diff --git a/src/contact.cpp b/src/contact.cpp deleted file mode 100644 index a8405d095b..0000000000 --- a/src/contact.cpp +++ /dev/null @@ -1,635 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- - - This class contains a series of tools for DEM contacts - Multiple models can be defined and used to calculate forces - and torques based on contact geometry -*/ - -#include "contact.h" -#include "math_const.h" -#include "math_extra.h" -#include "pointers.h" - -#include - -using namespace LAMMPS_NS; -using namespace MathExtra; -using namespace MathConst; - -namespace Contact { - -ContactModel::ContactModel() -{ - k_norm = cohesion = gamma_norm = 0.0; - k_tang = gamma_tang = mu_tang = 0.0; - k_roll = gamma_roll = mu_roll = 0.0; - k_twist = gamma_twist = mu_twist = 0.0; - - limit_damping = 0; - cutoff_type = 0.0; - reset_contact(); -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::reset_contact() -{ - radi = radj = 0.0; - xi = xj = vi = vj = omegai = omegaj = nullptr; - - prep_flag = check_flag = 0; - touch = false; -} - -/* ---------------------------------------------------------------------- */ - -bool ContactModel::check_contact() -{ - check_flag = 1; - - sub3(xi, xj, dx); - rsq = lensq3(dx); - radsum = radi + radj; - Reff = radi*radj/radsum; - - touch = false; - if (normal_model == JKR) touch = touch_JKR(touch); - else touch = (rsq < radsum*radsum); - - return touch; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::prep_contact() -{ - prep_flag = 1; - - // If it hasn't already been done, test if the contact exists - if (check_flag != 1) touch = check_contact(); - if (!touch) return; - - double temp[3]; - - // Set flags - mindlin_rescale = mindlin_force = 0; - if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - mindlin_rescale = 1; - if (tangential_model == TANGENTIAL_MINDLIN_FORCE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - mindlin_force = 1; - - // Standard geometric quantities - r = sqrt(rsq); - rinv = 1.0 / r; - delta = radsum - r; - dR = delta * Reff; - scale3(rinv, dx, nx); - - // relative translational velocity - sub3(vi, vj, vr); - - // normal component - vnnr = dot3(vr, nx); //v_R . n - scale3(vnnr, nx, vn); - - // tangential component - sub3(vr, vn, vt); - - // relative rotational velocity - scaleadd3(radi, omegai, radj, omegaj, wr); - - // relative tangential velocities - cross3(wr, nx, temp); - sub3(vt, temp, vtr); - vrel = len3(vtr); - - if (roll_model != ROLL_NONE || twist_model != TWIST_NONE) - sub3(omegai, omegaj, relrot); - - if (roll_model != ROLL_NONE) { - // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) - // this is different from the Marshall papers, which use the Bagi/Kuhn formulation - // for rolling velocity (see Wang et al for why the latter is wrong) - vrl[0] = Reff * (relrot[1] * nx[2] - relrot[2] * nx[1]); - vrl[1] = Reff * (relrot[2] * nx[0] - relrot[0] * nx[2]); - vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); - } - - if (twist_model != TWIST_NONE) { - // omega_T (eq 29 of Marshall) - magtwist = dot3(relrot, nx); - } -} - - -/* ---------------------------------------------------------------------- */ - -void ContactModel::calculate_forces(double *forces, double *torquesi, double *torquesj, double *history) -{ - // If it hasn't already been done, run prep calculations - if (prep_flag != 1) prep_contact(); - if (!touch) { - forces[0] = forces[1] = forces[2] = 0.0; - return; - } - - //********************************************** - // normal forces - //********************************************** - - // Also calculates: a, knfac, Fncrit (for JKR or DMT) - double Fne; - if (normal_model == JKR) { - Fne = normal_JKR(); - } else if (normal_model == DMT) { - Fne = normal_DMT(); - } else if (normal_model == HERTZ || normal_model == HERTZ_MATERIAL) { - Fne = normal_Hertz(); - } else { - Fne = normal_Hooke(); - } - - // NOTE: consider restricting Hooke to only have - // 'velocity' as an option for damping? - // Also calculates: damp_normal_prefactor - double Fdamp = normal_damping(); - - Fntot = Fne + Fdamp; - if (limit_damping && (Fntot < 0.0)) Fntot = 0.0; - - if (normal_model != JKR && normal_model != DMT) Fncrit = fabs(Fntot); - - //********************************************** - // tangential force, including history effects - //********************************************** - // For linear, mindlin, mindlin_rescale: - // history = cumulative tangential displacement - // - // For mindlin/force, mindlin_rescale/force: - // history = cumulative tangential elastic force - - Fscrit = mu_tang * Fncrit; - - if (tangential_model == TANGENTIAL_MINDLIN || - tangential_model == TANGENTIAL_MINDLIN_FORCE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { - tangential_mindlin(history); - } else if (tangential_model == TANGENTIAL_HISTORY) { - tangential_history(history); - } else { - tangential_no_history(); - } - - //********************************************** - // rolling force - //********************************************** - - if (roll_model != ROLL_NONE) - rolling(history); - - //**************************************** - // twisting torque, including history effects - //**************************************** - - if (twist_model == TWIST_MARSHALL) { - twisting_marshall(history); - } else if (twist_model == TWIST_SDS) { - twisting_SDS(history); - } - - //********************************************** - // sum contributions - //********************************************** - - scale3(Fntot, nx, forces); - add3(forces, fs, forces); - - cross3(nx, fs, torquesi); - copy3(torquesi, torquesj); - - double dist_to_contact = radi-0.5*delta; - scale3(dist_to_contact, torquesi); - dist_to_contact = radj-0.5*delta; - scale3(dist_to_contact, torquesj); - - double torroll[3]; - if (roll_model != ROLL_NONE) { - cross3(nx, fr, torroll); - scale3(Reff, torroll); - add3(torquesi, torroll, torquesi); - sub3(torquesj, torroll, torquesj); - } - - double tortwist[3]; - if (twist_model != TWIST_NONE) { - scale3(magtortwist, nx, tortwist); - add3(torquesi, tortwist, torquesi); - sub3(torquesj, tortwist, torquesj); - } -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::calculate_heat() -{ - double dT = Ti - Tj; - double Hc; - - //Dan is Emod the youngs modulus for all models? or do I need to scale? - Hc = 2 * conductivity * pow(FOURTHIRDS * Fntot * Reff / Emod, ONETHIRD); - - return Hc * dT; -} - -/* ---------------------------------------------------------------------- */ - -bool ContactModel::touch_JKR(int touch) -{ - double Escaled, R2, delta_pulloff, dist_pulloff; - bool touchflag; - - Escaled = k_norm * THREEQUARTERS; - if (touch) { - R2 = Reff * Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = radsum - delta_pulloff; - touchflag = (rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rsq < radsum * radsum); - } - return touchflag; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_JKR() -{ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - - Escaled = k_norm * THREEQUARTERS; - - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; - - knfac = Escaled * a; - Fncrit = fabs(Fne + 2 * F_pulloff); - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_DMT() -{ - a = sqrt(dR); - double Fne = a * k_norm * delta; - Fne -= 4 * MY_PI * cohesion * Reff; - double F_pulloff = 4 * MY_PI * cohesion * Reff; - - knfac = k_norm * a; - Fncrit = fabs(Fne + 2 * F_pulloff); - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_Hertz() -{ - a = sqrt(dR); - double Fne = k_norm * delta * a; - - knfac = k_norm * a; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_Hooke() -{ - a = sqrt(dR); - double Fne = k_norm * delta; - - knfac = k_norm; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_damping() -{ - double damp_normal; - if (damping_model == VELOCITY) { - damp_normal = 1; - } else if (damping_model == MASS_VELOCITY) { - damp_normal = meff; - } else if (damping_model == VISCOELASTIC) { - damp_normal = a * meff; - } else if (damping_model == TSUJI) { - damp_normal = sqrt(meff * knfac); - } else damp_normal = 0.0; - - damp_normal_prefactor = gamma_norm * damp_normal; - return -damp_normal_prefactor * vnnr; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::tangential_no_history() -{ - double gamma_scaled = gamma_tang * damp_normal_prefactor; - double fsmag, Ft; - - // classic pair gran/hooke (no history) - fsmag = gamma_scaled * vrel; - if (vrel != 0.0) Ft = MIN(Fscrit,fsmag) / vrel; - else Ft = 0.0; - - Ft = -Ft; - scale3(Ft, vtr, fs); -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::tangential_history(double *history) -{ - double gamma_scaled = gamma_tang * damp_normal_prefactor; - double k = k_tang; - int frame_update = 0; - double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; - - // rotate and update displacements / force. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (history_update) { - rsht = dot3(history, nx); - frame_update = fabs(rsht) * k > EPSILON * Fscrit; - - if (frame_update) { - shrmag = len3(history); - // projection - scale3(rsht, nx, history); - // also rescale to preserve magnitude - prjmag = len3(history); - if (prjmag > 0) temp_dbl = shrmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, history); - } - - // update history - // tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = k * dt; - scale3(temp_dbl, vtr, temp_array); - sub3(history, temp_array, history); - } - - // tangential forces = history + tangential velocity damping - temp_dbl = -gamma_norm; - scale3(temp_dbl, vtr, fs); - - // rescale frictional displacements and forces if needed - magfs = len3(fs); - if (magfs > Fscrit) { - shrmag = len3(history); - if (shrmag != 0.0) { - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs, history); - scale3(gamma_norm, vtr, temp_array); - add3(history, temp_array, history); - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs); - } else { - zero3(fs); - } - } -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::tangential_mindlin(double *history) -{ - double k_scaled, gamma_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; - double temp_array[3]; - int frame_update = 0; - - gamma_scaled = gamma_tang * damp_normal_prefactor; - k_scaled = k_tang * a; - if (mindlin_rescale) { - // on unloading, rescale the shear displacements/force - if (a < history[3]) { - temp_dbl = a / history[3]; - scale3(temp_dbl, history); - } - } - - // rotate and update displacements / force. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (history_update) { - rsht = dot3(history, nx); - if (mindlin_force) - frame_update = fabs(rsht) > EPSILON * Fscrit; - else - frame_update = fabs(rsht) * k_scaled > EPSILON * Fscrit; - - if (frame_update) { - shrmag = len3(history); - // projection - scale3(rsht, nx, history); - // also rescale to preserve magnitude - prjmag = len3(history); - if (prjmag > 0) temp_dbl = shrmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, history); - } - - // update history - if (mindlin_force) { - // tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = -k_scaled * dt; - scale3(temp_dbl, vtr, temp_array); - } else { - scale3(dt, vtr, temp_array); - } - add3(history, temp_array, history); - - if (mindlin_rescale) history[3] = a; - } - - // tangential forces = history + tangential velocity damping - temp_dbl = -gamma_scaled; - scale3(temp_dbl, vtr, fs); - - if (! mindlin_force) { - scale3(k_scaled, history, temp_array); - add3(fs, temp_array, fs); - } - - // rescale frictional displacements and forces if needed - magfs = len3(fs); - if (magfs > Fscrit) { - shrmag = len3(history); - if (shrmag != 0.0) { - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs, history); - scale3(gamma_tang, vtr, temp_array); - add3(history, temp_array, history); - if (! mindlin_force) { - temp_dbl = -1.0 / k_tang; - scale3(temp_dbl, history); - } - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs); - } else { - zero3(fs); - } - } -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::rolling(double *history) -{ - int rhist0, rhist1, rhist2, frameupdate; - double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; - - rhist0 = roll_history_index; - rhist1 = rhist0 + 1; - rhist2 = rhist1 + 1; - - Frcrit = mu_roll * Fncrit; - - if (history_update) { - hist_temp[0] = history[rhist0]; - hist_temp[1] = history[rhist1]; - hist_temp[2] = history[rhist2]; - rolldotn = dot3(hist_temp, nx); - - frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; - if (frameupdate) { // rotate into tangential plane - rollmag = len3(hist_temp); - // projection - temp_dbl = -rolldotn; - scale3(temp_dbl, nx, temp_array); - sub3(hist_temp, temp_array, hist_temp); - - // also rescale to preserve magnitude - prjmag = len3(hist_temp); - if (prjmag > 0) temp_dbl = rollmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, hist_temp); - } - scale3(dt, vrl, temp_array); - add3(hist_temp, temp_array, hist_temp); - } - - scaleadd3(k_roll, hist_temp, gamma_roll, vrl, fr); - negate3(fr); - - // rescale frictional displacements and forces if needed - - magfr = len3(fr); - if (magfr > Frcrit) { - rollmag = len3(hist_temp); - if (rollmag != 0.0) { - temp_dbl = -Frcrit / (magfr * k_roll); - scale3(temp_dbl, fr, temp_array); - add3(hist_temp, temp_array, hist_temp); - - temp_dbl = -gamma_roll/k_roll; - scale3(temp_dbl, vrl, temp_array); - add3(hist_temp, temp_array, hist_temp); - - temp_dbl = Frcrit / magfr; - scale3(temp_dbl, fr); - } else { - zero3(fr); - } - } - - history[rhist0] = hist_temp[0]; - history[rhist1] = hist_temp[1]; - history[rhist2] = hist_temp[2]; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::twisting_marshall(double *history) -{ - // Overwrite twist coefficients with derived values - k_twist = 0.5 * k_tang * a * a; // eq 32 of Marshall paper - gamma_twist = 0.5 * gamma_tang * a * a; - mu_twist = TWOTHIRDS * a * mu_tang; - - twisting_SDS(history); -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::twisting_SDS(double *history) -{ - double signtwist, Mtcrit; - - if (history_update) { - history[twist_history_index] += magtwist * dt; - } - - magtortwist = -k_twist * history[twist_history_index] - gamma_twist*magtwist; // M_t torque (eq 30) - signtwist = (magtwist > 0) - (magtwist < 0); - Mtcrit = mu_twist * Fncrit; // critical torque (eq 44) - if (fabs(magtortwist) > Mtcrit) { - history[twist_history_index] = (Mtcrit * signtwist - gamma_twist * magtwist) / k_twist; - magtortwist = -Mtcrit * signtwist; // eq 34 - } -} - -/* ---------------------------------------------------------------------- - compute pull-off distance (beyond contact) for a given radius and atom type - use temporary variables since this does not use a specific contact geometry -------------------------------------------------------------------------- */ - -double ContactModel::pulloff_distance(double radi, double radj) -{ - double Ecaled, a_tmp, Reff_tmp; - - if (normal_model != JKR) return radi+radj; - - Reff_tmp = radi * radj / (radi + radj); - if (Reff_tmp <= 0) return 0; - Ecaled = k_norm * THREEQUARTERS; - a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); - return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); -} - -} From 6b40ae29e45138afc67a9a85c64feb3ca541c2e3 Mon Sep 17 00:00:00 2001 From: "Dan S. Bolintineanu" Date: Thu, 14 Jul 2022 11:29:13 -0600 Subject: [PATCH 011/112] First stab --- src/GRANULAR/contact.cpp | 308 ++++++--------- src/GRANULAR/contact.h | 112 +++--- src/GRANULAR/damping_contact_models.cpp | 54 +++ src/GRANULAR/damping_contact_models.h | 56 +++ src/GRANULAR/heat_models.cpp | 185 +++++++++ src/GRANULAR/heat_models.h | 83 ++++ src/GRANULAR/normal_contact_models.cpp | 178 +++++++++ src/GRANULAR/normal_contact_models.h | 85 +++++ src/GRANULAR/pair_granular.cpp | 425 +++++---------------- src/GRANULAR/rolling_contact_models.cpp | 185 +++++++++ src/GRANULAR/rolling_contact_models.h | 83 ++++ src/GRANULAR/sub_model.cpp | 76 ++++ src/GRANULAR/sub_model.h | 48 +++ src/GRANULAR/tangential_contact_models.cpp | 168 ++++++++ src/GRANULAR/tangential_contact_models.h | 79 ++++ src/GRANULAR/twisting_contact_models.cpp | 185 +++++++++ src/GRANULAR/twisting_contact_models.h | 83 ++++ 17 files changed, 1825 insertions(+), 568 deletions(-) create mode 100644 src/GRANULAR/damping_contact_models.cpp create mode 100644 src/GRANULAR/damping_contact_models.h create mode 100644 src/GRANULAR/heat_models.cpp create mode 100644 src/GRANULAR/heat_models.h create mode 100644 src/GRANULAR/normal_contact_models.cpp create mode 100644 src/GRANULAR/normal_contact_models.h create mode 100644 src/GRANULAR/rolling_contact_models.cpp create mode 100644 src/GRANULAR/rolling_contact_models.h create mode 100644 src/GRANULAR/sub_model.cpp create mode 100644 src/GRANULAR/sub_model.h create mode 100644 src/GRANULAR/tangential_contact_models.cpp create mode 100644 src/GRANULAR/tangential_contact_models.h create mode 100644 src/GRANULAR/twisting_contact_models.cpp create mode 100644 src/GRANULAR/twisting_contact_models.h diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 40105be815..554a54eec9 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -21,6 +21,8 @@ #include "math_const.h" #include "math_extra.h" #include "pointers.h" +#include "comm.h" +#include "error.h" #include @@ -32,16 +34,117 @@ namespace Contact { ContactModel::ContactModel() { - k_norm = cohesion = gamma_norm = 0.0; - k_tang = gamma_tang = mu_tang = 0.0; - k_roll = gamma_roll = mu_roll = 0.0; - k_twist = gamma_twist = mu_twist = 0.0; - limit_damping = 0; cutoff_type = 0.0; + normal_model = nullptr; + tangential_model = nullptr; + damping_model = nullptr; + rolling_model = nullptr; + twisting_model = nullptr; reset_contact(); } +/* ---------------------------------------------------------------------- */ +void ContactModel::init_normal(char *model_name){ + if (strcmp(model_name, "hooke") == 0) normal_model = new Hooke(); + else if (strcmp(model_name, "hertz") == 0) normal_model = new Hertz(0); + else if (strcmp(model_name, "hertz/material") == 0) normal_model = new Hertz(1); + //... + else error->all(FLERR, "Normal model name not recognized"); + + normal_model->model_name.assign(model_name); + normal_model->contact = *this; + normal_model->allocate_coeffs(); +} + +/* ---------------------------------------------------------------------- */ +void ContactModel::init_damping(char *model_name){ + if (strcmp(model_name, "velocity") == 0) tangential_model = new Velocity(*this); + //... + else error->all(FLERR, "Damping model name not recognized"); + tangential_model->model_name.assign(model_name); + tangential_model->contact = *this; + tangential_model->allocate_coeffs(); +} + +/* ---------------------------------------------------------------------- */ +void ContactModel::init_tangential(char *model_name){ + if (strcmp(model_name, "linear") == 0) tangential_model = new LinearNohistory(*this); + //... + else error->all(FLERR, "Tangential model name not recognized"); + damping_model->model_name.assign(model_name); + damping_model->contact = *this; + damping_model->allocate_coeffs(); +} + + +/* ---------------------------------------------------------------------- */ +// .... same for rolling, twisting + + +void ContactModel::write_restart(FILE *fp){ + normal_model->write_restart(fp); + tangential_model->write_restart(fp); + damping_model->write_restart(fp); + if (rolling_model){ + rolling_model->write_restart(fp); + } + else{ + int num_char = -1; + fwrite(&num_char, sizeof(int), 1, fp); + } + if (twisting_model){ + twisting_model->write_restart(fp); + } + else{ + int num_char = -1; + fwrite(&num_char, sizeof(int), 1, fp); + } +} + +void ContactModel::read_restart(FILE *fp){ + int num_char; + //Normal model + if (comm->me == 0){ + utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); + } + MPI_BCast(&num_char, 1, MPI_INT, 0, world); + std::string model_name(num_char); + if (comm->me == 0){ + utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr,error); + } + MPI_BCast(const_cast(model_name.data()), num_char, MPI_CHAR, world); + init_normal(const_cast(model_name.data())); + normal_model->read_restart(); + + //Tangential model + if (comm->me == 0){ + utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); + } + MPI_BCast(&num_char, 1, MPI_INT, 0, world); + std::string model_name(num_char); + if (comm->me == 0){ + utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr,error); + } + init_tangential(const_cast(model_name.data())); + tangential_model->read_restart(); + + //Damping + if (comm->me == 0){ + utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); + } + MPI_BCast(&num_char, 1, MPI_INT, 0, world); + std::string model_name(num_char); + if (comm->me == 0){ + utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr,error); + } + init_tangential(const_cast(model_name.data())); + damping_model->read_restart(); + + //Optional (rolling, twisting) - only if num_char is > 0. + +} + /* ---------------------------------------------------------------------- */ void ContactModel::reset_contact() @@ -65,7 +168,7 @@ bool ContactModel::check_contact() Reff = radi*radj/radsum; touch = false; - if (normal_model == JKR) touch = touch_JKR(touch); + if (normal_model->beyond_contact) normal_model->touch(touch); else touch = (rsq < radsum*radsum); return touch; @@ -76,22 +179,12 @@ bool ContactModel::check_contact() void ContactModel::prep_contact() { prep_flag = 1; - // If it hasn't already been done, test if the contact exists if (check_flag != 1) touch = check_contact(); if (!touch) return; double temp[3]; - // Set flags - mindlin_rescale = mindlin_force = 0; - if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - mindlin_rescale = 1; - if (tangential_model == TANGENTIAL_MINDLIN_FORCE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - mindlin_force = 1; - // Standard geometric quantities r = sqrt(rsq); rinv = 1.0 / r; @@ -117,10 +210,10 @@ void ContactModel::prep_contact() sub3(vt, temp, vtr); vrel = len3(vtr); - if (roll_model != ROLL_NONE || twist_model != TWIST_NONE) + if (roll_model || twist_model) sub3(omegai, omegaj, relrot); - if (roll_model != ROLL_NONE) { + if (roll_model) { // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) // this is different from the Marshall papers, which use the Bagi/Kuhn formulation // for rolling velocity (see Wang et al for why the latter is wrong) @@ -129,16 +222,15 @@ void ContactModel::prep_contact() vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); } - if (twist_model != TWIST_NONE) { + if (twist_model) { // omega_T (eq 29 of Marshall) magtwist = dot3(relrot, nx); } } - /* ---------------------------------------------------------------------- */ -void ContactModel::calculate_forces(double *forces, double *torquesi, double *torquesj, double *history) +void ContactModel::calculate_forces() { // If it hasn't already been done, run prep calculations if (prep_flag != 1) prep_contact(); @@ -151,66 +243,17 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to // normal forces //********************************************** - // Also calculates: a, knfac, Fncrit (for JKR or DMT) - double Fne; - if (normal_model == JKR) { - Fne = normal_JKR(); - } else if (normal_model == DMT) { - Fne = normal_DMT(); - } else if (normal_model == HERTZ || normal_model == HERTZ_MATERIAL) { - Fne = normal_Hertz(); - } else { - Fne = normal_Hooke(); - } - - // NOTE: consider restricting Hooke to only have - // 'velocity' as an option for damping? - // Also calculates: damp_normal_prefactor - double Fdamp = normal_damping(); + double Fne, Fdamp; + Fne = normal_model->calculate_forces(); + Fdamp = damping_model->calculate_forces(); Fntot = Fne + Fdamp; - if (limit_damping && (Fntot < 0.0)) Fntot = 0.0; + if (limit_damping && Fntot < 0.0) Fntot = 0.0; + normal_model->set_fncrit(); - if (normal_model != JKR && normal_model != DMT) Fncrit = fabs(Fntot); - - //********************************************** - // tangential force, including history effects - //********************************************** - // For linear, mindlin, mindlin_rescale: - // history = cumulative tangential displacement - // - // For mindlin/force, mindlin_rescale/force: - // history = cumulative tangential elastic force - - Fscrit = mu_tang * Fncrit; - - if (tangential_model == TANGENTIAL_MINDLIN || - tangential_model == TANGENTIAL_MINDLIN_FORCE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { - tangential_mindlin(history); - } else if (tangential_model == TANGENTIAL_HISTORY) { - tangential_history(history); - } else { - tangential_no_history(); - } - - //********************************************** - // rolling force - //********************************************** - - if (roll_model != ROLL_NONE) - rolling(history); - - //**************************************** - // twisting torque, including history effects - //**************************************** - - if (twist_model == TWIST_MARSHALL) { - twisting_marshall(history); - } else if (twist_model == TWIST_SDS) { - twisting_SDS(history); - } + tangential_model->calculate_forces(); + if (roll_model) roll_model->calculate_forces(); + if (twist_model) twist_model->calculate_forces(); //********************************************** // sum contributions @@ -219,6 +262,7 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to scale3(Fntot, nx, forces); add3(forces, fs, forces); + //May need to rethink this for use with walls (and eventually tris).. cross3(nx, fs, torquesi); copy3(torquesi, torquesj); @@ -228,7 +272,7 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to scale3(dist_to_contact, torquesj); double torroll[3]; - if (roll_model != ROLL_NONE) { + if (roll_model) { cross3(nx, fr, torroll); scale3(Reff, torroll); add3(torquesi, torroll, torquesi); @@ -236,7 +280,7 @@ void ContactModel::calculate_forces(double *forces, double *torquesi, double *to } double tortwist[3]; - if (twist_model != TWIST_NONE) { + if (twist_model) { scale3(magtortwist, nx, tortwist); add3(torquesi, tortwist, torquesi); sub3(torquesj, tortwist, torquesj); @@ -253,111 +297,7 @@ double ContactModel::calculate_heat() /* ---------------------------------------------------------------------- */ -bool ContactModel::touch_JKR(int touch) -{ - double Escaled, R2, delta_pulloff, dist_pulloff; - bool touchflag; - Escaled = k_norm * THREEQUARTERS; - if (touch) { - R2 = Reff * Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = radsum - delta_pulloff; - touchflag = (rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rsq < radsum * radsum); - } - return touchflag; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_JKR() -{ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - - Escaled = k_norm * THREEQUARTERS; - - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; - - knfac = Escaled * a; - Fncrit = fabs(Fne + 2 * F_pulloff); - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_DMT() -{ - a = sqrt(dR); - double Fne = a * k_norm * delta; - Fne -= 4 * MY_PI * cohesion * Reff; - double F_pulloff = 4 * MY_PI * cohesion * Reff; - - knfac = k_norm * a; - Fncrit = fabs(Fne + 2 * F_pulloff); - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_Hertz() -{ - a = sqrt(dR); - double Fne = k_norm * delta * a; - - knfac = k_norm * a; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_Hooke() -{ - a = sqrt(dR); - double Fne = k_norm * delta; - - knfac = k_norm; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -double ContactModel::normal_damping() -{ - double damp_normal; - if (damping_model == VELOCITY) { - damp_normal = 1; - } else if (damping_model == MASS_VELOCITY) { - damp_normal = meff; - } else if (damping_model == VISCOELASTIC) { - damp_normal = a * meff; - } else if (damping_model == TSUJI) { - damp_normal = sqrt(meff * knfac); - } else damp_normal = 0.0; - - damp_normal_prefactor = gamma_norm * damp_normal; - return -damp_normal_prefactor * vnnr; -} /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 167f88e9de..cb6d1865af 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -14,77 +14,71 @@ #ifndef LMP_CONTACT_H #define LMP_CONTACT_H +#include "pointers.h" +#include "normal_contact_models.h" +#include "tangential_contact_models.h" +#include "damping_contact_models.h" +#include "rolling_contact_models.h" +#include "twisting_contact_models.h" +#include "heat_models.h" + +using namespace LAMMPS_NS; + namespace Contact { - enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; - enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; - enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, - TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; - enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; - enum {ROLL_NONE, ROLL_SDS}; +#define EPSILON 1e-10 - #define PI27SQ 266.47931882941264802866 // 27*PI**2 - #define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) - #define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) - #define INVROOT6 0.40824829046386307274 // 1/sqrt(6) - #define FOURTHIRDS (4.0/3.0) // 4/3 - #define ONETHIRD (1.0/3.0) // 1/3 - #define THREEQUARTERS 0.75 // 3/4 +class ContactModel : protected Pointers { +public: + ContactModel(); + ~ContactModel(); + int init(); + bool check_contact(); + void reset_contact(); + void calculate_forces(); + double calculate_heat(); + double pulloff_distance(double, double); - #define EPSILON 1e-10 + void init_normal(char*); + void init_tangential(char*); + void init_damping(char*); + void init_rolling(char*); + void init_twisting(char*); + void init_heat(char*); - class ContactModel { - public: - ContactModel(); - void reset_contact(); - bool check_contact(); - void prep_contact(); - void calculate_forces(double *, double *, double *, double *); - double calculate_heat(); - double pulloff_distance(double, double); + void write_restart(FILE *); + void read_restart(FILE *); - int normal_model, damping_model, tangential_model; - int roll_model, twist_model; - int limit_damping; - double cutoff_type; - double Emod, poisson; // variables used in defining mixed interactions - double k_norm, gamma_norm, cohesion; // normal_coeffs - double k_tang, gamma_tang, mu_tang; // tangential_coeffs - wutang? - double k_roll, gamma_roll, mu_roll; // roll_coeffs - double k_twist, gamma_twist, mu_twist; // twist_coeffs - double conductivity; + NormalModel *normal_model; + DampingModel *damping_model; //Classes below need .h and .cpp files analogous to normal_contact_models.h/.cpp + TangentialModel *tangential_model; + RollingModel *rolling_model; + TwistingModel *twisting_model; + HeatModel *heat_model; - double radi, radj, meff, dt, Ti, Tj; - double *xi, *xj, *vi, *vj, *omegai, *omegaj; - int history_update, roll_history_index, twist_history_index; + double *forces; + double *torquesi; + double *torquesj; + double *history; - double fs[3], fr[3], ft[3], magtortwist; + int limit_damping; - private: - double a, knfac, Fntot, Fncrit, Fscrit, Frcrit, damp_normal_prefactor; - double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; - double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; - double magtwist; - bool touch; + double radi, radj, meff, dt, Ti, Tj; + double area; - int prep_flag, check_flag; - int mindlin_rescale, mindlin_force; + double *xi, *xj, *vi, *vj, *omegai, *omegaj; + double Fntot, Fncrit; + double fs[3], fr[3], ft[3], magtortwist; - bool touch_JKR(int); - double normal_JKR(); - double normal_DMT(); - double normal_Hertz(); - double normal_Hooke(); - double normal_damping(); - void tangential_no_history(); - void tangential_history(double *); - void tangential_mindlin(double *); - void rolling(double *); - void twisting_marshall(double *); - void twisting_SDS(double *); +private: + double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; + double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; + double magtwist; + bool touch; - }; + int prep_flag, check_flag; + int mindlin_rescale, mindlin_force; +}; } // namespace Contact diff --git a/src/GRANULAR/damping_contact_models.cpp b/src/GRANULAR/damping_contact_models.cpp new file mode 100644 index 0000000000..11d2c19b57 --- /dev/null +++ b/src/GRANULAR/damping_contact_models.cpp @@ -0,0 +1,54 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "damping_contact_models.h" +#include "math_const.h" +#include "contact.h" + +#include +#include "math_special.h" + +using namespace MathConst; +using namespace MathSpecial; + +namespace Contact{ + +void DampingModel::allocate_coeffs(){ + damp = contact.normal_model->coeffs[1]; +} + +//----------------------------------------- +double Velocity::calculate_forces(){ + return -damp*contact.vnnr; +} + +double MassVelocity::calculate_forces(){ + return -damp*contact.meff*contact.vnnr; +} + + +double ViscoElastic::calculate_forces(){ + return -damp*contact.meff*contact.area*contact.vnnr; +} + + +void Tsuji::allocate_coeffs(){ + double cor = contact.normal_model->coeffs[1]; + damp = 1.2728-4.2783*cor+11.087*square(cor)-22.348*cube(cor)+ + 27.467*powint(cor,4)-18.022*powint(cor,5)+4.8218*powint(cor,6); +} + +double Tsuji::calculate_forces(){ + return -damp*sqrt(contact.meff*contact.knfac)*contact.vnnr; +} + diff --git a/src/GRANULAR/damping_contact_models.h b/src/GRANULAR/damping_contact_models.h new file mode 100644 index 0000000000..036f6e3452 --- /dev/null +++ b/src/GRANULAR/damping_contact_models.h @@ -0,0 +1,56 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef DAMPING_CONTACT_MODELS_H_ +#define DAMPING_CONTACT_MODELS_H_ + +#include "contact.h"; +#include "sub_model.h" + +namespace Contact { + +class DampingModel:SubModel{ +public: + DampingModel(){}; + virtual ~DampingModel(){}; + virtual double calculate_forces() = 0; + virtual void allocate_coeffs(); + double damp; +}; + +class Velocity:DampingModel{ +public: + double calculate_forces(); +}; + +class MassVelocity:DampingModel{ +public: + double calculate_forces(); +}; + +class ViscoElastic:DampingModel{ +public: + double calculate_forces(); +}; + +class Tsuji:DampingModel{ +public: + double calculate_forces(); + void allocate_coeffs(); +}; + + +} + +#endif /*DAMPING_CONTACT_MODELS_H_ */ + diff --git a/src/GRANULAR/heat_models.cpp b/src/GRANULAR/heat_models.cpp new file mode 100644 index 0000000000..e6bafe4b3c --- /dev/null +++ b/src/GRANULAR/heat_models.cpp @@ -0,0 +1,185 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "normal_contact_models.h" +#include "math_const.h" +#include "contact.h" + +#include + +using namespace MathConst; + +namespace Contact{ + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define ONETHIRD (1.0/3.0) // 1/3 +#define THREEQUARTERS 0.75 // 3/4 + +// ************************ +// Default behaviors where needed +// ************************ +void NormalModel::set_fncrit(){ + contact->Fncrit = fabs(contact->Fntot); +} + +void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ + for (int i = 0; i < num_coeffs; i++){ + coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); + } +} + +//----------------------------------------- + +//****************** +// Hooke +//****************** +void Hooke::Hooke(ContactModel &c){ + contact = c; + num_coeffs = 2; + allocate_coeffs(); +} + +void Hooke::coeffs_to_local(){ + k_norm = coeffs[0]; + damp = coeffs[1]; +} + +double Hooke::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = k_norm * contact.area; + return contact.knfac * contact.delta; +} + + +//****************** +// Hertz +//****************** +void Hertz::Hertz(ContactModel &c, int mat_flag){ + contact = c; + material_prop_flag = mat_flag; + if (material_prop_flag){ + num_coeffs = 3; + } + else{ + num_coeffs = 2; + } + allocate_coeffs(); +} + +void Hertz::coeffs_to_local(){ + if (material_prop_flag){ + Emod = coeffs[0]; + poiss = coeffs[1]; + k_norm = 4/3*Emod; + } + else{ + k_norm = coeffs[0]; + } +} + +double Hertz::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + return contact.knfac * contact.delta; +} + +//****************** +// DMT +//****************** +void DMT::DMT(ContactModel &c){ + contact = c; + material_prop_flag = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +double DMT::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + double Fne = contact.knfac * contact.delta; + F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; + Fne -= F_pulloff; + return Fne; +} + +void DMT::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); +} + +//****************** +// JKR +//****************** +void JKR::JKR(ContactModel &c){ + contact = c; + material_prop_flag = 1; + beyond_contact = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +bool JKR::touch(int touch){ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = k_norm * THREEQUARTERS; + if (touch) { + R2 = contact.Reff * contact.Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = contact.radsum - delta_pulloff; + touchflag = (contact.rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rcontact.sq < contact.radsum * contact.radsum); + } + return touchflag; +} + +double JKR::calculate_forces(){ + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = Escaled * a; + return Fne; +} + +void JKR::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); +} + + + diff --git a/src/GRANULAR/heat_models.h b/src/GRANULAR/heat_models.h new file mode 100644 index 0000000000..1a2f1ddb7d --- /dev/null +++ b/src/GRANULAR/heat_models.h @@ -0,0 +1,83 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef NORMAL_CONTACT_MODELS_H_ +#define NORMAL_CONTACT_MODELS_H_ + +#include "contact.h"; +#include "sub_model.h" + +namespace Contact { + +class NormalModel:SubModel{ +public: + NormalModel(){}; + virtual ~NormalModel(){}; + virtual bool check_contact(); + virtual void prep_contact(); + virtual void set_fncrit(); + virtual double calculate_forces() = 0; + virtual void coeffs_to_local(); + virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed + +private: + int beyond_contact = 0; + int allow_limit_damping = 1; + +}; + +class Hooke:NormalModel{ +public: + Hooke(ContactModel &c); + ~Hooke(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp; +}; + +class Hertz:NormalModel{ +public: + Hertz(ContactModel&, int); + ~Hertz(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss; +}; + +class DMT:NormalModel{ +public: + DMT(ContactModel &c); + ~DMT(){}; + void coeffs_to_local(); + void coeffs_to_local(NormalModel*, NormalModel*); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss, coh; +}; + +class JKR:NormalModel{ +public: + JKR(ContactModel &c); + ~JKR(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss, coh; + +}; +} + +#endif /*NORMAL_CONTACT_MODELS_H_ */ + diff --git a/src/GRANULAR/normal_contact_models.cpp b/src/GRANULAR/normal_contact_models.cpp new file mode 100644 index 0000000000..cc01a3ddb2 --- /dev/null +++ b/src/GRANULAR/normal_contact_models.cpp @@ -0,0 +1,178 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "normal_contact_models.h" +#include "math_const.h" +#include "contact.h" + +#include + +using namespace MathConst; + +namespace Contact{ + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define ONETHIRD (1.0/3.0) // 1/3 +#define THREEQUARTERS 0.75 // 3/4 + +// ************************ +// Default behaviors where needed +// ************************ +void NormalModel::set_fncrit(){ + contact->Fncrit = fabs(contact->Fntot); +} + +void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ + for (int i = 0; i < num_coeffs; i++){ + coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); + } +} + +//----------------------------------------- + +//****************** +// Hooke +//****************** +void Hooke::Hooke(ContactModel &c){ + num_coeffs = 2; + allocate_coeffs(); +} + +void Hooke::coeffs_to_local(){ + k_norm = coeffs[0]; + damp = coeffs[1]; +} + +double Hooke::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = k_norm * contact.area; + return contact.knfac * contact.delta; +} + + +//****************** +// Hertz +//****************** +void Hertz::Hertz(ContactModel &c, int mat_flag){ + material_prop_flag = mat_flag; + if (material_prop_flag){ + num_coeffs = 3; + } + else{ + num_coeffs = 2; + } +} + +void Hertz::coeffs_to_local(){ + if (material_prop_flag){ + Emod = coeffs[0]; + poiss = coeffs[1]; + k_norm = 4/3*Emod; + } + else{ + k_norm = coeffs[0]; + } +} + +double Hertz::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + return contact.knfac * contact.delta; +} + +//****************** +// DMT +//****************** +void DMT::DMT(ContactModel &c){ + material_prop_flag = 1; + num_coeffs = 4; +} + +double DMT::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + double Fne = contact.knfac * contact.delta; + F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; + Fne -= F_pulloff; + return Fne; +} + +void DMT::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); +} + +//****************** +// JKR +//****************** +void JKR::JKR(ContactModel &c){ + material_prop_flag = 1; + beyond_contact = 1; + num_coeffs = 4; +} + +bool JKR::touch(int touch){ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = k_norm * THREEQUARTERS; + if (touch) { + R2 = contact.Reff * contact.Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = contact.radsum - delta_pulloff; + touchflag = (contact.rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rcontact.sq < contact.radsum * contact.radsum); + } + return touchflag; +} + +double JKR::calculate_forces(){ + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = Escaled * a; + return Fne; +} + +void JKR::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); +} + + + diff --git a/src/GRANULAR/normal_contact_models.h b/src/GRANULAR/normal_contact_models.h new file mode 100644 index 0000000000..198e4bcb59 --- /dev/null +++ b/src/GRANULAR/normal_contact_models.h @@ -0,0 +1,85 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef NORMAL_CONTACT_MODELS_H_ +#define NORMAL_CONTACT_MODELS_H_ + +#include "contact.h"; +#include "sub_model.h" + +namespace Contact { + +class NormalModel:SubModel{ +public: + NormalModel(){}; + virtual ~NormalModel(){}; + virtual bool check_contact(); + virtual void prep_contact(); + virtual void set_fncrit(); + virtual double calculate_forces() = 0; + virtual void coeffs_to_local(); + virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed + +private: + int size_history = 0; + int beyond_contact = 0; + int allow_limit_damping = 1; + +}; + +class Hooke:NormalModel{ +public: + Hooke(); + ~Hooke(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp; +}; + +class Hertz:NormalModel{ +public: + Hertz(int); + ~Hertz(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss; +}; + +class DMT:NormalModel{ +public: + DMT(); + ~DMT(){}; + void coeffs_to_local(); + void coeffs_to_local(NormalModel*, NormalModel*); + double calculate_forces(); +private: + double k_norm, damp, Emod, cohesion, poiss; + double F_pulloff; +}; + +class JKR:NormalModel{ +public: + JKR(); + ~JKR(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, cohesion, poiss; + double F_pulloff; +}; +} + +#endif /*NORMAL_CONTACT_MODELS_H_ */ + diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 506cc2e175..855ed36cf0 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -81,7 +81,8 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) beyond_contact = 0; nondefault_history_transfer = 0; tangential_history_index = 0; - roll_history_index = twist_history_index = 0; + roll_history_index = 0; + twist_history_index = 0; heat_flag = 0; // create dummy fix as placeholder for FixNeighHistory @@ -234,6 +235,7 @@ void PairGranular::compute(int eflag, int vflag) models[itype][jtype].omegai = omega[i]; models[itype][jtype].omegaj = omega[j]; models[itype][jtype].history_update = historyupdate; + models[itype][jtype].history = history; models[itype][jtype].prep_contact(); if (heat_flag) { @@ -250,7 +252,11 @@ void PairGranular::compute(int eflag, int vflag) history = &allhistory[size_history*jj]; } - models[itype][jtype].calculate_forces(forces, torquesi, torquesj, history); + double *forces = models[itype][jtype].forces; + double *torquesi = models[itype][jtype].torquesi; + double *torquesj = models[itype][jtype].torquesj; + + models[itype][jtype].calculate_forces(); if (heat_flag) dq = models[itype][jtype].calculate_heat(); // apply forces & torques @@ -339,7 +345,7 @@ void PairGranular::coeff(int narg, char **arg) double conductivity_one; double cutoff_one = -1; - if (narg < 2) + if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients"); if (!allocated) allocate(); @@ -348,276 +354,66 @@ void PairGranular::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - //Defaults - normal_model_one = tangential_model_one = -1; - roll_model_one = ROLL_NONE; - twist_model_one = TWIST_NONE; - damping_model_one = VISCOELASTIC; - int ld_flag = 0; + //Here's one option for handing off parsing to the SubModel objects: + ContactModel model_one; + //Parse mandatory normal and tangential specifications int iarg = 2; + model_one.init_normal(arg[iarg]); + iarg += 1; + if (iarg + model_one.normal_model->num_coeffs >= narg) + error->all(FLERR,"Illegal pair_coeff command" + "Insufficient arguments provided."); + model_one.normal_model->parse_coeffs(arg, iarg); + iarg += model_one.normal_model->num_coeffs; + + if (strcmp(arg[iarg], "tangential") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR,"Illegal pair_coeff command, must specify " + "tangential model after tangential keyword"); + model_one.init_tangential(arg[iarg]); + iarg += 1; + if (iarg + model_one.tangential_model->num_coeffs >= narg) + error->all(FLERR, "Illegal pair_coeff command" + "Insufficient arguments provided."); + model_one.tangential_model->parse_coeffs(arg, iarg); + iarg += model_one.tangential_model->num_coeffs; + } + else{ + error->all(FLERR, "Illegal pair_coeff command, 'tangential' keyword expected"); + } + //Parse optional arguments while (iarg < narg) { - if (strcmp(arg[iarg], "hooke") == 0) { - if (iarg + 2 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for Hooke option"); - normal_model_one = HOOKE; - normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // kn - normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping - iarg += 3; - } else if (strcmp(arg[iarg], "hertz") == 0) { - if (iarg + 2 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for Hertz option"); - normal_model_one = HERTZ; - normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // kn - normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping - iarg += 3; - } else if (strcmp(arg[iarg], "hertz/material") == 0) { - if (iarg + 3 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for Hertz/material option"); - normal_model_one = HERTZ_MATERIAL; - normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E - normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping - normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio - iarg += 4; - } else if (strcmp(arg[iarg], "dmt") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for Hertz option"); - normal_model_one = DMT; - normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E - normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping - normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio - normal_coeffs_one[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); // cohesion - iarg += 5; - } else if (strcmp(arg[iarg], "jkr") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for JKR option"); - beyond_contact = 1; - normal_model_one = JKR; - normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E - normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping - normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio - normal_coeffs_one[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); // cohesion - iarg += 5; - } else if (strcmp(arg[iarg], "damping") == 0) { - if (iarg+1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, " - "not enough parameters provided for damping model"); - if (strcmp(arg[iarg+1], "velocity") == 0) { - damping_model_one = VELOCITY; - iarg += 1; - } else if (strcmp(arg[iarg+1], "mass_velocity") == 0) { - damping_model_one = MASS_VELOCITY; - iarg += 1; - } else if (strcmp(arg[iarg+1], "viscoelastic") == 0) { - damping_model_one = VISCOELASTIC; - iarg += 1; - } else if (strcmp(arg[iarg+1], "tsuji") == 0) { - damping_model_one = TSUJI; - iarg += 1; - } else error->all(FLERR, "Illegal pair_coeff command, " - "unrecognized damping model"); + if (strcmp(arg[iarg], "rolling") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + model_one.init_rolling(arg[iarg+1]); iarg += 1; - } else if (strcmp(arg[iarg], "tangential") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR,"Illegal pair_coeff command, must specify " - "tangential model after tangential keyword"); - if (strcmp(arg[iarg+1], "linear_nohistory") == 0) { - if (iarg + 3 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for tangential model"); - tangential_model_one = TANGENTIAL_NOHISTORY; - tangential_coeffs_one[0] = 0; - // gammat and friction coeff - tangential_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); - tangential_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - iarg += 4; - } else if ((strcmp(arg[iarg+1], "linear_history") == 0) || - (strcmp(arg[iarg+1], "mindlin") == 0) || - (strcmp(arg[iarg+1], "mindlin_rescale") == 0) || - (strcmp(arg[iarg+1], "mindlin/force") == 0) || - (strcmp(arg[iarg+1], "mindlin_rescale/force") == 0)) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for tangential model"); - if (strcmp(arg[iarg+1], "linear_history") == 0) - tangential_model_one = TANGENTIAL_HISTORY; - else if (strcmp(arg[iarg+1], "mindlin") == 0) - tangential_model_one = TANGENTIAL_MINDLIN; - else if (strcmp(arg[iarg+1], "mindlin_rescale") == 0) - tangential_model_one = TANGENTIAL_MINDLIN_RESCALE; - else if (strcmp(arg[iarg+1], "mindlin/force") == 0) - tangential_model_one = TANGENTIAL_MINDLIN_FORCE; - else if (strcmp(arg[iarg+1], "mindlin_rescale/force") == 0) - tangential_model_one = TANGENTIAL_MINDLIN_RESCALE_FORCE; - tangential_history = 1; - if ((tangential_model_one == TANGENTIAL_MINDLIN || - tangential_model_one == TANGENTIAL_MINDLIN_RESCALE || - tangential_model_one == TANGENTIAL_MINDLIN_FORCE || - tangential_model_one == TANGENTIAL_MINDLIN_RESCALE_FORCE) && - (strcmp(arg[iarg+2], "NULL") == 0)) { - if (normal_model_one == HERTZ || normal_model_one == HOOKE) { - error->all(FLERR, "NULL setting for Mindlin tangential " - "stiffness requires a normal contact model that " - "specifies material properties"); - } - tangential_coeffs_one[0] = -1; - } else { - tangential_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // kt - } - // gammat and friction coeff - tangential_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - tangential_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); - iarg += 5; - } else { - error->all(FLERR, "Illegal pair_coeff command, " - "tangential model not recognized"); - } - } else if (strcmp(arg[iarg], "rolling") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - if (strcmp(arg[iarg+1], "none") == 0) { - roll_model_one = ROLL_NONE; - iarg += 2; - } else if (strcmp(arg[iarg+1], "sds") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for rolling model"); - roll_model_one = ROLL_SDS; - roll_history = 1; - // kR and gammaR and rolling friction coeff - roll_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); - roll_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - roll_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); - iarg += 5; - } else { - error->all(FLERR, "Illegal pair_coeff command, " - "rolling friction model not recognized"); - } - } else if (strcmp(arg[iarg], "twisting") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - if (strcmp(arg[iarg+1], "none") == 0) { - twist_model_one = TWIST_NONE; - iarg += 2; - } else if (strcmp(arg[iarg+1], "marshall") == 0) { - twist_model_one = TWIST_MARSHALL; - twist_history = 1; - iarg += 2; - } else if (strcmp(arg[iarg+1], "sds") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for twist model"); - twist_model_one = TWIST_SDS; - twist_history = 1; - // kt and gammat and friction coeff - twist_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); - twist_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - twist_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); - iarg += 5; - } else { - error->all(FLERR, "Illegal pair_coeff command, " - "twisting friction model not recognized"); - } - } else if (strcmp(arg[iarg], "cutoff") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - cutoff_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); - iarg += 2; + if (iarg + model_one.rolling_model->num_coeffs >= narg) + error->all(FLERR, "Illegal pair_coeff command" + "Insufficient arguments provided for rolling model."); + iarg += model_one.rolling_model->num_coeffs; + } + else if (strcmp(arg[iarg], "twisting") == 0) { + //... + } + else if (strcmp(arg[iarg], "cutoff") == 0) { + //.. } else if (strcmp(arg[iarg], "limit_damping") == 0) { - ld_flag = 1; - iarg += 1; + //.. } else if (strcmp(arg[iarg], "heat") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - conductivity_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (conductivity_one < 0.0) - error->all(FLERR, "Illegal pair_coeff command, conductivity must be positive"); - heat_flag = 1; - iarg += 2; + //.. } else error->all(FLERR, "Illegal pair_coeff command"); } - // error not to specify normal or tangential model - if ((normal_model_one < 0) || (tangential_model_one < 0)) - error->all(FLERR, "Illegal pair_coeff command, " - "must specify normal or tangential contact model"); + if (model_one.limit_damping && !model_one.normal_model->allow_limit_damping) + error->all(FLERR,"Illegal pair_coeff command, " + "Cannot limit damping with specified normal contact model"); int count = 0; - double damp; - if (damping_model_one == TSUJI) { - double cor; - cor = normal_coeffs_one[1]; - damp = 1.2728-4.2783*cor+11.087*square(cor)-22.348*cube(cor)+ - 27.467*powint(cor,4)-18.022*powint(cor,5)+4.8218*powint(cor,6); - } else damp = normal_coeffs_one[1]; - - if (ld_flag && normal_model_one == JKR) - error->all(FLERR,"Illegal pair_coeff command, " - "Cannot limit damping with JKR model"); - - if (ld_flag && normal_model_one == DMT) - error->all(FLERR,"Illegal pair_coeff command, " - "Cannot limit damping with DMT model"); - - double Emod, poisson; for (int i = ilo; i <= ihi; i++) { for (int j = MAX(jlo,i); j <= jhi; j++) { - - // Define normal model - models[i][j].normal_model = models[j][i].normal_model = normal_model_one; - models[i][j].damping_model = models[j][i].damping_model = damping_model_one; - models[i][j].gamma_norm = models[j][i].gamma_norm = damp; - Emod = normal_coeffs_one[0]; - poisson = normal_coeffs_one[2]; - models[i][j].Emod = models[j][i].Emod = Emod; - models[i][j].poisson = models[j][i].poisson = poisson; - - if (normal_model_one != HERTZ && normal_model_one != HOOKE) { - models[i][j].k_norm = models[j][i].k_norm = - FOURTHIRDS*mix_stiffnessE(Emod,Emod,poisson,poisson); - } else { - models[i][j].k_norm = models[j][i].k_norm = normal_coeffs_one[0]; - } - if ((normal_model_one == JKR) || (normal_model_one == DMT)) - models[i][j].cohesion = models[j][i].cohesion = normal_coeffs_one[3]; - - // Define tangential model - models[i][j].tangential_model = models[j][i].tangential_model = tangential_model_one; - if (tangential_coeffs_one[0] == -1) { - models[i][j].k_tang = models[j][i].k_tang = - 8*mix_stiffnessG(Emod, Emod, poisson, poisson); - } else { - models[i][j].k_tang = models[j][i].k_tang = tangential_coeffs_one[0]; - } - models[i][j].gamma_tang = models[j][i].gamma_tang = tangential_coeffs_one[1]; - models[i][j].mu_tang = models[j][i].mu_tang = tangential_coeffs_one[2]; - - // Define rolling model - models[i][j].roll_model = models[j][i].roll_model = roll_model_one; - if (roll_model_one != ROLL_NONE) { - models[i][j].k_roll = models[j][i].k_roll = roll_coeffs_one[0]; - models[i][j].gamma_roll = models[j][i].gamma_roll = roll_coeffs_one[1]; - models[i][j].mu_roll = models[j][i].mu_roll = roll_coeffs_one[2]; - } - - // Define twisting model - models[i][j].twist_model = models[j][i].twist_model = twist_model_one; - if (twist_model_one != TWIST_NONE && twist_model_one != TWIST_MARSHALL) { - models[i][j].k_twist = models[j][i].k_twist = twist_coeffs_one[0]; - models[i][j].gamma_twist = models[j][i].gamma_twist = twist_coeffs_one[1]; - models[i][j].mu_twist = models[j][i].mu_twist = twist_coeffs_one[2]; - } - - // Define extra options - models[i][j].cutoff_type = models[j][i].cutoff_type = cutoff_one; - models[i][j].limit_damping = models[j][i].limit_damping = ld_flag; - models[i][j].conductivity = models[j][i].conductivity = conductivity_one; - + models[i][j] = model_one; //Not sure if this works to copy? May need to specify a copy operator for ContactModel.. setflag[i][j] = 1; count++; } @@ -641,48 +437,31 @@ void PairGranular::init_style() if (comm->ghost_velocity == 0) error->all(FLERR,"Pair granular requires ghost atoms store velocity"); - // determine whether we need a granular neigh list, how large it needs to be - - use_history = normal_history || tangential_history || - roll_history || twist_history; - - // for JKR, will need fix/neigh/history to keep track of touch arrays - + size_normal_history = 0; + size_tangential_history = 0; + size_rolling_history = 0; + size_twisting_history = 0; for (int i = 1; i <= atom->ntypes; i++) - for (int j = i; j <= atom->ntypes; j++) - if (models[i][j].normal_model == JKR) use_history = 1; + for (int j = i; j <= atom->ntypes; j++){ + if (models[i][j].normal_model->history_flag || + models[i][j].tangential_model->history_flag || + models[i][j].rolling_model->history_flag || + models[i][j].twisting_model->history_flag) use_history = 1; - size_history = 3*tangential_history + 3*roll_history + twist_history; + if (models[i][j].nondefault_history_transfer) + if (models[i][j].normal_model->size_history > size_normal_history) + size_normal_history = models[i][j].normal_model->size_history; + //... + } + + size_history = size_normal_history + size_tangential_history + + size_roll_history + size_twist_history; // determine location of tangential/roll/twist histories in array - if (roll_history) { - if (tangential_history) roll_history_index = 3; - else roll_history_index = 0; - } - if (twist_history) { - if (tangential_history) { - if (roll_history) twist_history_index = 6; - else twist_history_index = 3; - } else { - if (roll_history) twist_history_index = 3; - else twist_history_index = 0; - } - } - for (int i = 1; i <= atom->ntypes; i++) - for (int j = i; j <= atom->ntypes; j++) - if (models[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE || - models[i][j].tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { - size_history += 1; - roll_history_index += 1; - twist_history_index += 1; - nondefault_history_transfer = 1; - history_transfer_factors = new int[size_history]; - for (int ii = 0; ii < size_history; ++ii) - history_transfer_factors[ii] = -1; - history_transfer_factors[3] = 1; - break; - } + tangential_history_index = size_normal_history; + roll_history_index = size_normal_history + size_tangential_history; + twist_history_index = size_normal_history + size_tangential_history + size_roll_history; if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE|NeighConst::REQ_HISTORY); else neighbor->add_request(this, NeighConst::REQ_SIZE); @@ -907,27 +686,9 @@ void PairGranular::write_restart(FILE *fp) for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { - fwrite(&models[i][j].normal_model,sizeof(int),1,fp); - fwrite(&models[i][j].damping_model,sizeof(int),1,fp); - fwrite(&models[i][j].tangential_model,sizeof(int),1,fp); - fwrite(&models[i][j].roll_model,sizeof(int),1,fp); - fwrite(&models[i][j].twist_model,sizeof(int),1,fp); - fwrite(&models[i][j].limit_damping,sizeof(int),1,fp); - fwrite(&models[i][j].Emod,sizeof(double),1,fp); - fwrite(&models[i][j].poisson,sizeof(double),1,fp); - fwrite(&models[i][j].k_norm,sizeof(double),1,fp); - fwrite(&models[i][j].gamma_norm,sizeof(double),1,fp); - fwrite(&models[i][j].cohesion,sizeof(double),1,fp); - fwrite(&models[i][j].k_tang,sizeof(double),1,fp); - fwrite(&models[i][j].gamma_tang,sizeof(double),1,fp); - fwrite(&models[i][j].mu_tang,sizeof(double),1,fp); - fwrite(&models[i][j].k_roll,sizeof(double),1,fp); - fwrite(&models[i][j].gamma_roll,sizeof(double),1,fp); - fwrite(&models[i][j].mu_roll,sizeof(double),1,fp); - fwrite(&models[i][j].k_twist,sizeof(double),1,fp); - fwrite(&models[i][j].gamma_twist,sizeof(double),1,fp); - fwrite(&models[i][j].mu_twist,sizeof(double),1,fp); - fwrite(&models[i][j].cutoff_type,sizeof(double),1,fp); + if (comm->me == 0){ + models[i][j].write_restart(fp); + } } } } @@ -948,12 +709,23 @@ void PairGranular::read_restart(FILE *fp) MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&models[i][j].normal_model,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].damping_model,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].tangential_model,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].roll_model,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].twist_model,sizeof(int),1,fp,nullptr,error); + std::string name; + utils::sfread(FLERR,&name.data(),sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].damping_model_type,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].tangential_model_type,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].roll_model_type,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&models[i][j].twist_model_type,sizeof(int),1,fp,nullptr,error); utils::sfread(FLERR,&models[i][j].limit_damping,sizeof(int),1,fp,nullptr,error); + } + MPI_Bcast(&models[i][j].normal_model_type,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].damping_model_type,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].tangential_model_type,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].roll_model_type,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].twist_model_type,1,MPI_INT,0,world); + MPI_Bcast(&models[i][j].limit_damping,1,MPI_INT,0,world); + models[i][j].init(); + models[i][j].read_restart(); + utils::sfread(FLERR,&models[i][j].k_norm,sizeof(int),1,fp,nullptr,error); utils::sfread(FLERR,&models[i][j].gamma_norm,sizeof(int),1,fp,nullptr,error); utils::sfread(FLERR,&models[i][j].cohesion,sizeof(int),1,fp,nullptr,error); @@ -1087,6 +859,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, } double forces[3], torquesi[3], torquesj[3]; + models[itype][jtype].calculate_forces(forces, torquesi, torquesj, history); // apply forces & torques @@ -1185,10 +958,12 @@ double PairGranular::mix_geom(double valii, double valjj) only needed if any history entries i-j are not just negative of j-i entries ------------------------------------------------------------------------- */ -void PairGranular::transfer_history(double* source, double* target) +void PairGranular::transfer_history(double* source, double* target, int source_type, int target_type) { - for (int i = 0; i < size_history; i++) + models[itype][jtype].transfer_history(); + for (int i = 0; i < size_history; i++){ target[i] = history_transfer_factors[i]*source[i]; + } } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/rolling_contact_models.cpp b/src/GRANULAR/rolling_contact_models.cpp new file mode 100644 index 0000000000..e6bafe4b3c --- /dev/null +++ b/src/GRANULAR/rolling_contact_models.cpp @@ -0,0 +1,185 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "normal_contact_models.h" +#include "math_const.h" +#include "contact.h" + +#include + +using namespace MathConst; + +namespace Contact{ + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define ONETHIRD (1.0/3.0) // 1/3 +#define THREEQUARTERS 0.75 // 3/4 + +// ************************ +// Default behaviors where needed +// ************************ +void NormalModel::set_fncrit(){ + contact->Fncrit = fabs(contact->Fntot); +} + +void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ + for (int i = 0; i < num_coeffs; i++){ + coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); + } +} + +//----------------------------------------- + +//****************** +// Hooke +//****************** +void Hooke::Hooke(ContactModel &c){ + contact = c; + num_coeffs = 2; + allocate_coeffs(); +} + +void Hooke::coeffs_to_local(){ + k_norm = coeffs[0]; + damp = coeffs[1]; +} + +double Hooke::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = k_norm * contact.area; + return contact.knfac * contact.delta; +} + + +//****************** +// Hertz +//****************** +void Hertz::Hertz(ContactModel &c, int mat_flag){ + contact = c; + material_prop_flag = mat_flag; + if (material_prop_flag){ + num_coeffs = 3; + } + else{ + num_coeffs = 2; + } + allocate_coeffs(); +} + +void Hertz::coeffs_to_local(){ + if (material_prop_flag){ + Emod = coeffs[0]; + poiss = coeffs[1]; + k_norm = 4/3*Emod; + } + else{ + k_norm = coeffs[0]; + } +} + +double Hertz::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + return contact.knfac * contact.delta; +} + +//****************** +// DMT +//****************** +void DMT::DMT(ContactModel &c){ + contact = c; + material_prop_flag = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +double DMT::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + double Fne = contact.knfac * contact.delta; + F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; + Fne -= F_pulloff; + return Fne; +} + +void DMT::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); +} + +//****************** +// JKR +//****************** +void JKR::JKR(ContactModel &c){ + contact = c; + material_prop_flag = 1; + beyond_contact = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +bool JKR::touch(int touch){ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = k_norm * THREEQUARTERS; + if (touch) { + R2 = contact.Reff * contact.Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = contact.radsum - delta_pulloff; + touchflag = (contact.rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rcontact.sq < contact.radsum * contact.radsum); + } + return touchflag; +} + +double JKR::calculate_forces(){ + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = Escaled * a; + return Fne; +} + +void JKR::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); +} + + + diff --git a/src/GRANULAR/rolling_contact_models.h b/src/GRANULAR/rolling_contact_models.h new file mode 100644 index 0000000000..1a2f1ddb7d --- /dev/null +++ b/src/GRANULAR/rolling_contact_models.h @@ -0,0 +1,83 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef NORMAL_CONTACT_MODELS_H_ +#define NORMAL_CONTACT_MODELS_H_ + +#include "contact.h"; +#include "sub_model.h" + +namespace Contact { + +class NormalModel:SubModel{ +public: + NormalModel(){}; + virtual ~NormalModel(){}; + virtual bool check_contact(); + virtual void prep_contact(); + virtual void set_fncrit(); + virtual double calculate_forces() = 0; + virtual void coeffs_to_local(); + virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed + +private: + int beyond_contact = 0; + int allow_limit_damping = 1; + +}; + +class Hooke:NormalModel{ +public: + Hooke(ContactModel &c); + ~Hooke(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp; +}; + +class Hertz:NormalModel{ +public: + Hertz(ContactModel&, int); + ~Hertz(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss; +}; + +class DMT:NormalModel{ +public: + DMT(ContactModel &c); + ~DMT(){}; + void coeffs_to_local(); + void coeffs_to_local(NormalModel*, NormalModel*); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss, coh; +}; + +class JKR:NormalModel{ +public: + JKR(ContactModel &c); + ~JKR(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss, coh; + +}; +} + +#endif /*NORMAL_CONTACT_MODELS_H_ */ + diff --git a/src/GRANULAR/sub_model.cpp b/src/GRANULAR/sub_model.cpp new file mode 100644 index 0000000000..e5ace9885e --- /dev/null +++ b/src/GRANULAR/sub_model.cpp @@ -0,0 +1,76 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- + + This class contains a series of tools for DEM contacts + Multiple models can be defined and used to calculate forces + and torques based on contact geometry +*/ +#include "sub_model.h" +#include "pointers.h" +#include "utils.h" +#include "error.h" +#include "comm.h" + +using namespace LAMMPS_NS; + +namespace Contact{ + +SubModel::SubModel(){ + allocated = 0; +} +SubModel::~SubModel(){ + if (allocated) delete [] coeffs; +} + +void SubModel::allocate_coeffs(){ + allocated = 1; + coeffs = new double[num_coeffs]; +} + +void SubModel::parse_coeffs(char **arg, int iarg){ + for (int i = 0; i < num_coeffs; i++){ + coeffs[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); + } + coeffs_to_local(); +} + +void SubModel::write_restart(FILE *fp){ + fwrite(&model_name.length(),sizeof(int),1,fp); + fwrite(model_name.data(),sizeof(char),model_name.length(),fp); + fwrite(&num_coeffs,sizeof(int),1,fp); + fwrite(coeffs,sizeof(int),num_coeffs,fp); +} + +void SubModel::read_restart(FILE *fp, int num_char){ + if (comm->me == 0){ + utils::sfread(FLERR,&num_coeffs,sizeof(int),1,fp,nullptr,error); + } + MPI_BCast(const_cast(model_name.data()), num_char, MPI_CHAR, world); + allocate_coeffs(); +} + +void SubModel::read_restart(FILE *fp){ + int num_char; + if (me == 0){ + utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); + } + MPI_BCast(&num_char, 1, MPI_INT, 0, world); + read_restart(fp, num_char); +} + + + + +} + diff --git a/src/GRANULAR/sub_model.h b/src/GRANULAR/sub_model.h new file mode 100644 index 0000000000..2d3261238b --- /dev/null +++ b/src/GRANULAR/sub_model.h @@ -0,0 +1,48 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef GRANULAR_SUB_MODEL_H_ +#define GRANULAR_SUB_MODEL_H_ + +#include "contact.h" + +using namespace LAMMPS_NS; + +namespace Contact{ + +class SubModel : Pointers{ + SubModel(){}; + virtual ~SubModel(); +public: + int num_coeffs; + double *coeffs; + virtual double calculate_forces() = 0; + void read_restart(); + virtual void parse_coeffs(char **, int); + void write_restart(FILE*); + void read_restart(FILE*); + void read_restart(FILE*, int); + virtual void coeffs_to_local(); + void allocate_coeffs(); + std::string model_name; +private: + ContactModel &contact; + int allocated; + int material_prop_flag = 0; + int size_history; + +}; + +} + +#endif /* GRANULAR_SUB_MODEL_H_ */ diff --git a/src/GRANULAR/tangential_contact_models.cpp b/src/GRANULAR/tangential_contact_models.cpp new file mode 100644 index 0000000000..ff59ceabb7 --- /dev/null +++ b/src/GRANULAR/tangential_contact_models.cpp @@ -0,0 +1,168 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "tangential_contact_models.h" +#include "math_const.h" +#include "contact.h" + +#include + +using namespace MathConst; + +namespace Contact{ + +// ************************ +// Default behaviors where needed +// ************************ + +//----------------------------------------- + +//****************** +// Hooke +//****************** +void LinearNohistory::calculate_forces(){ + contact = c; + num_coeffs = 2; + allocate_coeffs(); +} + +void Hooke::coeffs_to_local(){ + k_norm = coeffs[0]; + damp = coeffs[1]; +} + +double Hooke::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = k_norm * contact.area; + return contact.knfac * contact.delta; +} + + +//****************** +// Hertz +//****************** +void Hertz::Hertz(ContactModel &c, int mat_flag){ + contact = c; + material_prop_flag = mat_flag; + if (material_prop_flag){ + num_coeffs = 3; + } + else{ + num_coeffs = 2; + } + allocate_coeffs(); +} + +void Hertz::coeffs_to_local(){ + if (material_prop_flag){ + Emod = coeffs[0]; + poiss = coeffs[1]; + k_norm = 4/3*Emod; + } + else{ + k_norm = coeffs[0]; + } +} + +double Hertz::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + return contact.knfac * contact.delta; +} + +//****************** +// DMT +//****************** +void DMT::DMT(ContactModel &c){ + contact = c; + material_prop_flag = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +double DMT::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + double Fne = contact.knfac * contact.delta; + F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; + Fne -= F_pulloff; + return Fne; +} + +void DMT::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); +} + +//****************** +// JKR +//****************** +void JKR::JKR(ContactModel &c){ + contact = c; + material_prop_flag = 1; + beyond_contact = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +bool JKR::touch(int touch){ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = k_norm * THREEQUARTERS; + if (touch) { + R2 = contact.Reff * contact.Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = contact.radsum - delta_pulloff; + touchflag = (contact.rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rcontact.sq < contact.radsum * contact.radsum); + } + return touchflag; +} + +double JKR::calculate_forces(){ + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = Escaled * a; + return Fne; +} + +void JKR::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); +} + + + diff --git a/src/GRANULAR/tangential_contact_models.h b/src/GRANULAR/tangential_contact_models.h new file mode 100644 index 0000000000..207d129e7c --- /dev/null +++ b/src/GRANULAR/tangential_contact_models.h @@ -0,0 +1,79 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef TANGENTIAL_CONTACT_MODELS_H_ +#define TANGENTIAL_CONTACT_MODELS_H_ + +#include "contact.h"; +#include "sub_model.h" + +namespace Contact { + +class TangentialModel:SubModel{ +public: + TangentialModel(){}; + virtual ~TangentialModel(){}; + virtual double calculate_forces() = 0; + virtual void coeffs_to_local(); + virtual void mix_coeffs(TangentialModel*, TangentialModel*); //When mixing is needed + int rescale_flag = 0; +private: + int beyond_contact = 0; + int allow_limit_damping = 1; + +}; + +class LinearNohistory:TangentialModel{ +public: + double calculate_forces(); +private: + void allocate_coeffs(); + double k_t, damp; +}; + +class LinearHistory:TangentialModel{ +public: + LinearHistory(){} + ~LinearHistory(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss; +}; + +class Mindlin:TangentialModel{ +public: + Mindlin(int); + ~Mindlin(){}; + void coeffs_to_local(); + void coeffs_to_local(TangentialModel*, TangentialModel*); + double calculate_forces(); +private: + + double k_norm, damp, Emod, poiss, coh; +}; + +class MindlinForce:TangentialModel{ +public: + JKR(ContactModel &c); + ~JKR(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss, coh; + +}; +} + +#endif /*TANGENTIAL_CONTACT_MODELS_H_ */ + diff --git a/src/GRANULAR/twisting_contact_models.cpp b/src/GRANULAR/twisting_contact_models.cpp new file mode 100644 index 0000000000..e6bafe4b3c --- /dev/null +++ b/src/GRANULAR/twisting_contact_models.cpp @@ -0,0 +1,185 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "normal_contact_models.h" +#include "math_const.h" +#include "contact.h" + +#include + +using namespace MathConst; + +namespace Contact{ + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define ONETHIRD (1.0/3.0) // 1/3 +#define THREEQUARTERS 0.75 // 3/4 + +// ************************ +// Default behaviors where needed +// ************************ +void NormalModel::set_fncrit(){ + contact->Fncrit = fabs(contact->Fntot); +} + +void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ + for (int i = 0; i < num_coeffs; i++){ + coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); + } +} + +//----------------------------------------- + +//****************** +// Hooke +//****************** +void Hooke::Hooke(ContactModel &c){ + contact = c; + num_coeffs = 2; + allocate_coeffs(); +} + +void Hooke::coeffs_to_local(){ + k_norm = coeffs[0]; + damp = coeffs[1]; +} + +double Hooke::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = k_norm * contact.area; + return contact.knfac * contact.delta; +} + + +//****************** +// Hertz +//****************** +void Hertz::Hertz(ContactModel &c, int mat_flag){ + contact = c; + material_prop_flag = mat_flag; + if (material_prop_flag){ + num_coeffs = 3; + } + else{ + num_coeffs = 2; + } + allocate_coeffs(); +} + +void Hertz::coeffs_to_local(){ + if (material_prop_flag){ + Emod = coeffs[0]; + poiss = coeffs[1]; + k_norm = 4/3*Emod; + } + else{ + k_norm = coeffs[0]; + } +} + +double Hertz::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + return contact.knfac * contact.delta; +} + +//****************** +// DMT +//****************** +void DMT::DMT(ContactModel &c){ + contact = c; + material_prop_flag = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +double DMT::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + double Fne = contact.knfac * contact.delta; + F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; + Fne -= F_pulloff; + return Fne; +} + +void DMT::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); +} + +//****************** +// JKR +//****************** +void JKR::JKR(ContactModel &c){ + contact = c; + material_prop_flag = 1; + beyond_contact = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +bool JKR::touch(int touch){ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = k_norm * THREEQUARTERS; + if (touch) { + R2 = contact.Reff * contact.Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = contact.radsum - delta_pulloff; + touchflag = (contact.rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rcontact.sq < contact.radsum * contact.radsum); + } + return touchflag; +} + +double JKR::calculate_forces(){ + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = Escaled * a; + return Fne; +} + +void JKR::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); +} + + + diff --git a/src/GRANULAR/twisting_contact_models.h b/src/GRANULAR/twisting_contact_models.h new file mode 100644 index 0000000000..1a2f1ddb7d --- /dev/null +++ b/src/GRANULAR/twisting_contact_models.h @@ -0,0 +1,83 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef NORMAL_CONTACT_MODELS_H_ +#define NORMAL_CONTACT_MODELS_H_ + +#include "contact.h"; +#include "sub_model.h" + +namespace Contact { + +class NormalModel:SubModel{ +public: + NormalModel(){}; + virtual ~NormalModel(){}; + virtual bool check_contact(); + virtual void prep_contact(); + virtual void set_fncrit(); + virtual double calculate_forces() = 0; + virtual void coeffs_to_local(); + virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed + +private: + int beyond_contact = 0; + int allow_limit_damping = 1; + +}; + +class Hooke:NormalModel{ +public: + Hooke(ContactModel &c); + ~Hooke(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp; +}; + +class Hertz:NormalModel{ +public: + Hertz(ContactModel&, int); + ~Hertz(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss; +}; + +class DMT:NormalModel{ +public: + DMT(ContactModel &c); + ~DMT(){}; + void coeffs_to_local(); + void coeffs_to_local(NormalModel*, NormalModel*); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss, coh; +}; + +class JKR:NormalModel{ +public: + JKR(ContactModel &c); + ~JKR(){}; + void coeffs_to_local(); + double calculate_forces(); +private: + double k_norm, damp, Emod, poiss, coh; + +}; +} + +#endif /*NORMAL_CONTACT_MODELS_H_ */ + From 6a1a06d76cd93dfe49caca16f708a3ddc0d620ed Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 15 Jul 2022 12:30:30 -0600 Subject: [PATCH 012/112] Take 2 --- src/.gitignore | 14 + src/GRANULAR/contact.cpp | 461 ++++-------------- src/GRANULAR/contact.h | 42 +- ..._models.cpp => contact_damping_models.cpp} | 0 ...tact_models.h => contact_damping_models.h} | 0 ...eat_models.cpp => contact_heat_models.cpp} | 0 .../{heat_models.h => contact_heat_models.h} | 0 ...t_models.cpp => contact_normal_models.cpp} | 108 ++-- ...ntact_models.h => contact_normal_models.h} | 1 + ..._models.cpp => contact_rolling_models.cpp} | 64 +++ ...tact_models.h => contact_rolling_models.h} | 0 .../{sub_model.cpp => contact_sub_models.cpp} | 29 +- .../{sub_model.h => contact_sub_models.h} | 5 +- src/GRANULAR/contact_tangential_models.cpp | 324 ++++++++++++ ...t_models.h => contact_tangential_models.h} | 0 ...models.cpp => contact_twisting_models.cpp} | 31 ++ ...act_models.h => contact_twisting_models.h} | 0 src/GRANULAR/pair_granular.cpp | 397 +++++++-------- src/GRANULAR/pair_granular.h | 5 +- src/GRANULAR/tangential_contact_models.cpp | 168 ------- 20 files changed, 817 insertions(+), 832 deletions(-) rename src/GRANULAR/{damping_contact_models.cpp => contact_damping_models.cpp} (100%) rename src/GRANULAR/{damping_contact_models.h => contact_damping_models.h} (100%) rename src/GRANULAR/{heat_models.cpp => contact_heat_models.cpp} (100%) rename src/GRANULAR/{heat_models.h => contact_heat_models.h} (100%) rename src/GRANULAR/{normal_contact_models.cpp => contact_normal_models.cpp} (63%) rename src/GRANULAR/{normal_contact_models.h => contact_normal_models.h} (97%) rename src/GRANULAR/{twisting_contact_models.cpp => contact_rolling_models.cpp} (73%) rename src/GRANULAR/{rolling_contact_models.h => contact_rolling_models.h} (100%) rename src/GRANULAR/{sub_model.cpp => contact_sub_models.cpp} (80%) rename src/GRANULAR/{sub_model.h => contact_sub_models.h} (93%) create mode 100644 src/GRANULAR/contact_tangential_models.cpp rename src/GRANULAR/{tangential_contact_models.h => contact_tangential_models.h} (100%) rename src/GRANULAR/{rolling_contact_models.cpp => contact_twisting_models.cpp} (82%) rename src/GRANULAR/{twisting_contact_models.h => contact_twisting_models.h} (100%) delete mode 100644 src/GRANULAR/tangential_contact_models.cpp diff --git a/src/.gitignore b/src/.gitignore index a1aee630b5..07230a10b4 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1474,6 +1474,20 @@ /compute_xrd_consts.h /contact.cpp /contact.h +/contact_normal_models.cpp +/contact_normal_models.h +/contact_damping_models.cpp +/contact_damping_models.h +/contact_tangential_models.cpp +/contact_tangential_models.h +/contact_twisting_models.cpp +/contact_twisting_models.h +/contact_rolling_models.cpp +/contact_rolling_models.h +/contact_heat_models.cpp +/contact_heat_models.h +/contact_sub_models.cpp +/contact_sub_models.h /fix_atom_swap.cpp /fix_atom_swap.h /fix_ave_spatial_sphere.cpp diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 554a54eec9..693721fe22 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -32,9 +32,12 @@ using namespace MathConst; namespace Contact { +enum {NORMAL, TANGENTIAL, DAMPING, ROLLING, TWISTING, HEAT} + ContactModel::ContactModel() { limit_damping = 0; + beyond_contact = 0; cutoff_type = 0.0; normal_model = nullptr; tangential_model = nullptr; @@ -42,115 +45,114 @@ ContactModel::ContactModel() rolling_model = nullptr; twisting_model = nullptr; reset_contact(); + + sub_models = {nullptr}; } /* ---------------------------------------------------------------------- */ -void ContactModel::init_normal(char *model_name){ - if (strcmp(model_name, "hooke") == 0) normal_model = new Hooke(); - else if (strcmp(model_name, "hertz") == 0) normal_model = new Hertz(0); - else if (strcmp(model_name, "hertz/material") == 0) normal_model = new Hertz(1); - //... - else error->all(FLERR, "Normal model name not recognized"); - normal_model->model_name.assign(model_name); - normal_model->contact = *this; - normal_model->allocate_coeffs(); +void ContactModel::init_model(char *model_name, int model_type) +{ + if (model_type == NORMAL) { + if (strcmp(model_name, "hooke") == 0) normal_model = new Hooke(); + else if (strcmp(model_name, "hertz") == 0) normal_model = new Hertz(0); + else if (strcmp(model_name, "hertz/material") == 0) normal_model = new Hertz(1); + //... + else error->all(FLERR, "Normal model name not recognized"); + sub_models[model_type] = &normal_model; + + } else if (model_type == TANGENTIAL) { + if (strcmp(model_name, "linear") == 0) tangential_model = new LinearNoHistory(); + //... + else error->all(FLERR, "Tangential model name not recognized"); + sub_models[model_type] = &tangential_model; + + } else if (model_type == DAMPING) { + if (strcmp(model_name, "linear") == 0) damping_model = new LinearNoHistory(); + //... + else error->all(FLERR, "Damping model name not recognized"); + sub_models[model_type] = &damping_model; + + } else if (model_type == ROLLING) { + if (strcmp(model_name, "linear") == 0) rolling_model = new LinearNoHistory(); + //... + else error->all(FLERR, "Rolling model name not recognized"); + sub_models[model_type] = &rolling_model; + + } else if (model_type == TWISTING) { + if (strcmp(model_name, "linear") == 0) twisting_model = new LinearNoHistory(); + //... + else error->all(FLERR, "Twisting model name not recognized"); + sub_models[model_type] = &twisting_model; + + } else if (model_type == HEAT) { + if (strcmp(model_name, "linear") == 0) heat_model = new LinearNoHistory(); + //... + else error->all(FLERR, "Heat model name not recognized"); + sub_models[model_type] = &heat_model; + } + + sub_models[model_type]->model_name.assign(model_name); + sub_models[model_type]->contact = *this; + sub_models[model_type]->allocate_coeffs(); } /* ---------------------------------------------------------------------- */ -void ContactModel::init_damping(char *model_name){ - if (strcmp(model_name, "velocity") == 0) tangential_model = new Velocity(*this); - //... - else error->all(FLERR, "Damping model name not recognized"); - tangential_model->model_name.assign(model_name); - tangential_model->contact = *this; - tangential_model->allocate_coeffs(); + +void ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) +{ + for (int i = 0; i < 5; i++) + sum_model[i]->mix_coeffs(c1->submodel[i], c2->submodel[i]); + + limit_damping = MAX(c1->limit_damping, c2->limit_damping); + cutoff_type = MAX(c1->cutoff_type, c2->cutoff_type); } /* ---------------------------------------------------------------------- */ -void ContactModel::init_tangential(char *model_name){ - if (strcmp(model_name, "linear") == 0) tangential_model = new LinearNohistory(*this); - //... - else error->all(FLERR, "Tangential model name not recognized"); - damping_model->model_name.assign(model_name); - damping_model->contact = *this; - damping_model->allocate_coeffs(); -} +void ContactModel::write_restart(FILE *fp) +{ + int num_char = -1; + + for (int i = 0; i < 5; i++) { + if (sub_models[i]) { + sub_models[i]->write_restart(fp); + } else { + fwrite(&num_char, sizeof(int), 1, fp); + } + } +} /* ---------------------------------------------------------------------- */ -// .... same for rolling, twisting - -void ContactModel::write_restart(FILE *fp){ - normal_model->write_restart(fp); - tangential_model->write_restart(fp); - damping_model->write_restart(fp); - if (rolling_model){ - rolling_model->write_restart(fp); - } - else{ - int num_char = -1; - fwrite(&num_char, sizeof(int), 1, fp); - } - if (twisting_model){ - twisting_model->write_restart(fp); - } - else{ - int num_char = -1; - fwrite(&num_char, sizeof(int), 1, fp); - } -} - -void ContactModel::read_restart(FILE *fp){ +void ContactModel::read_restart(FILE *fp) +{ int num_char; - //Normal model - if (comm->me == 0){ - utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); - } - MPI_BCast(&num_char, 1, MPI_INT, 0, world); - std::string model_name(num_char); - if (comm->me == 0){ - utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr,error); - } - MPI_BCast(const_cast(model_name.data()), num_char, MPI_CHAR, world); - init_normal(const_cast(model_name.data())); - normal_model->read_restart(); - //Tangential model - if (comm->me == 0){ - utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); - } - MPI_BCast(&num_char, 1, MPI_INT, 0, world); - std::string model_name(num_char); - if (comm->me == 0){ - utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr,error); - } - init_tangential(const_cast(model_name.data())); - tangential_model->read_restart(); + for (int i = 0; i < 5; i++) { + if (comm->me == 0) + utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); + MPI_BCast(&num_char, 1, MPI_INT, 0, world); - //Damping - if (comm->me == 0){ - utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); - } - MPI_BCast(&num_char, 1, MPI_INT, 0, world); - std::string model_name(num_char); - if (comm->me == 0){ - utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr,error); - } - init_tangential(const_cast(model_name.data())); - damping_model->read_restart(); - - //Optional (rolling, twisting) - only if num_char is > 0. + if (num_char != -1) { + std::string model_name(num_char); + if (comm->me == 0) + utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr, error); + MPI_BCast(const_cast(model_name.data()), num_char, MPI_CHAR, world); + init_model(const_cast(model_name.data(), i)); + sub_models[i]->read_restart(); + } + } } /* ---------------------------------------------------------------------- */ void ContactModel::reset_contact() { - radi = radj = 0.0; + radi = radj = Fntot = Fncrit = magtortwist = 0.0; xi = xj = vi = vj = omegai = omegaj = nullptr; + forces = torquesi = torquesj = history = nullptr; prep_flag = check_flag = 0; touch = false; @@ -165,10 +167,10 @@ bool ContactModel::check_contact() sub3(xi, xj, dx); rsq = lensq3(dx); radsum = radi + radj; - Reff = radi*radj/radsum; + Reff = radi * radj / radsum; touch = false; - if (normal_model->beyond_contact) normal_model->touch(touch); + if (normal_model.beyond_contact) normal_model.touch(touch); else touch = (rsq < radsum*radsum); return touch; @@ -213,7 +215,7 @@ void ContactModel::prep_contact() if (roll_model || twist_model) sub3(omegai, omegaj, relrot); - if (roll_model) { + if (rolling_model) { // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) // this is different from the Marshall papers, which use the Bagi/Kuhn formulation // for rolling velocity (see Wang et al for why the latter is wrong) @@ -222,7 +224,7 @@ void ContactModel::prep_contact() vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); } - if (twist_model) { + if (twisting_model) { // omega_T (eq 29 of Marshall) magtwist = dot3(relrot, nx); } @@ -244,16 +246,16 @@ void ContactModel::calculate_forces() //********************************************** double Fne, Fdamp; - Fne = normal_model->calculate_forces(); - Fdamp = damping_model->calculate_forces(); + Fne = normal_model.calculate_forces(); + Fdamp = damping_model.calculate_forces(); Fntot = Fne + Fdamp; if (limit_damping && Fntot < 0.0) Fntot = 0.0; - normal_model->set_fncrit(); + normal_model.set_fncrit(); - tangential_model->calculate_forces(); - if (roll_model) roll_model->calculate_forces(); - if (twist_model) twist_model->calculate_forces(); + tangential_model.calculate_forces(); + if (rolling_model) rolling_model.calculate_forces(); + if (twisting_model) twisting_model.calculate_forces(); //********************************************** // sum contributions @@ -272,7 +274,7 @@ void ContactModel::calculate_forces() scale3(dist_to_contact, torquesj); double torroll[3]; - if (roll_model) { + if (rolling_model) { cross3(nx, fr, torroll); scale3(Reff, torroll); add3(torquesi, torroll, torquesi); @@ -280,7 +282,7 @@ void ContactModel::calculate_forces() } double tortwist[3]; - if (twist_model) { + if (twisting_model) { scale3(magtortwist, nx, tortwist); add3(torquesi, tortwist, torquesi); sub3(torquesj, tortwist, torquesj); @@ -291,262 +293,7 @@ void ContactModel::calculate_forces() double ContactModel::calculate_heat() { - double dT = Ti - Tj; - return conductivity * a * dT; -} - -/* ---------------------------------------------------------------------- */ - - - -/* ---------------------------------------------------------------------- */ - -void ContactModel::tangential_no_history() -{ - double gamma_scaled = gamma_tang * damp_normal_prefactor; - double fsmag, Ft; - - // classic pair gran/hooke (no history) - fsmag = gamma_scaled * vrel; - if (vrel != 0.0) Ft = MIN(Fscrit,fsmag) / vrel; - else Ft = 0.0; - - Ft = -Ft; - scale3(Ft, vtr, fs); -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::tangential_history(double *history) -{ - double gamma_scaled = gamma_tang * damp_normal_prefactor; - double k = k_tang; - int frame_update = 0; - double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; - - // rotate and update displacements / force. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (history_update) { - rsht = dot3(history, nx); - frame_update = fabs(rsht) * k > EPSILON * Fscrit; - - if (frame_update) { - shrmag = len3(history); - // projection - scale3(rsht, nx, history); - // also rescale to preserve magnitude - prjmag = len3(history); - if (prjmag > 0) temp_dbl = shrmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, history); - } - - // update history - // tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = k * dt; - scale3(temp_dbl, vtr, temp_array); - sub3(history, temp_array, history); - } - - // tangential forces = history + tangential velocity damping - temp_dbl = -gamma_norm; - scale3(temp_dbl, vtr, fs); - - // rescale frictional displacements and forces if needed - magfs = len3(fs); - if (magfs > Fscrit) { - shrmag = len3(history); - if (shrmag != 0.0) { - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs, history); - scale3(gamma_norm, vtr, temp_array); - add3(history, temp_array, history); - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs); - } else { - zero3(fs); - } - } -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::tangential_mindlin(double *history) -{ - double k_scaled, gamma_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; - double temp_array[3]; - int frame_update = 0; - - gamma_scaled = gamma_tang * damp_normal_prefactor; - k_scaled = k_tang * a; - if (mindlin_rescale) { - // on unloading, rescale the shear displacements/force - if (a < history[3]) { - temp_dbl = a / history[3]; - scale3(temp_dbl, history); - } - } - - // rotate and update displacements / force. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (history_update) { - rsht = dot3(history, nx); - if (mindlin_force) - frame_update = fabs(rsht) > EPSILON * Fscrit; - else - frame_update = fabs(rsht) * k_scaled > EPSILON * Fscrit; - - if (frame_update) { - shrmag = len3(history); - // projection - scale3(rsht, nx, history); - // also rescale to preserve magnitude - prjmag = len3(history); - if (prjmag > 0) temp_dbl = shrmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, history); - } - - // update history - if (mindlin_force) { - // tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = -k_scaled * dt; - scale3(temp_dbl, vtr, temp_array); - } else { - scale3(dt, vtr, temp_array); - } - add3(history, temp_array, history); - - if (mindlin_rescale) history[3] = a; - } - - // tangential forces = history + tangential velocity damping - temp_dbl = -gamma_scaled; - scale3(temp_dbl, vtr, fs); - - if (! mindlin_force) { - scale3(k_scaled, history, temp_array); - add3(fs, temp_array, fs); - } - - // rescale frictional displacements and forces if needed - magfs = len3(fs); - if (magfs > Fscrit) { - shrmag = len3(history); - if (shrmag != 0.0) { - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs, history); - scale3(gamma_tang, vtr, temp_array); - add3(history, temp_array, history); - if (! mindlin_force) { - temp_dbl = -1.0 / k_tang; - scale3(temp_dbl, history); - } - temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs); - } else { - zero3(fs); - } - } -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::rolling(double *history) -{ - int rhist0, rhist1, rhist2, frameupdate; - double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; - - rhist0 = roll_history_index; - rhist1 = rhist0 + 1; - rhist2 = rhist1 + 1; - - Frcrit = mu_roll * Fncrit; - - if (history_update) { - hist_temp[0] = history[rhist0]; - hist_temp[1] = history[rhist1]; - hist_temp[2] = history[rhist2]; - rolldotn = dot3(hist_temp, nx); - - frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; - if (frameupdate) { // rotate into tangential plane - rollmag = len3(hist_temp); - // projection - temp_dbl = -rolldotn; - scale3(temp_dbl, nx, temp_array); - sub3(hist_temp, temp_array, hist_temp); - - // also rescale to preserve magnitude - prjmag = len3(hist_temp); - if (prjmag > 0) temp_dbl = rollmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, hist_temp); - } - scale3(dt, vrl, temp_array); - add3(hist_temp, temp_array, hist_temp); - } - - scaleadd3(k_roll, hist_temp, gamma_roll, vrl, fr); - negate3(fr); - - // rescale frictional displacements and forces if needed - - magfr = len3(fr); - if (magfr > Frcrit) { - rollmag = len3(hist_temp); - if (rollmag != 0.0) { - temp_dbl = -Frcrit / (magfr * k_roll); - scale3(temp_dbl, fr, temp_array); - add3(hist_temp, temp_array, hist_temp); - - temp_dbl = -gamma_roll/k_roll; - scale3(temp_dbl, vrl, temp_array); - add3(hist_temp, temp_array, hist_temp); - - temp_dbl = Frcrit / magfr; - scale3(temp_dbl, fr); - } else { - zero3(fr); - } - } - - history[rhist0] = hist_temp[0]; - history[rhist1] = hist_temp[1]; - history[rhist2] = hist_temp[2]; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::twisting_marshall(double *history) -{ - // Overwrite twist coefficients with derived values - k_twist = 0.5 * k_tang * a * a; // eq 32 of Marshall paper - gamma_twist = 0.5 * gamma_tang * a * a; - mu_twist = TWOTHIRDS * a * mu_tang; - - twisting_SDS(history); -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::twisting_SDS(double *history) -{ - double signtwist, Mtcrit; - - if (history_update) { - history[twist_history_index] += magtwist * dt; - } - - magtortwist = -k_twist * history[twist_history_index] - gamma_twist*magtwist; // M_t torque (eq 30) - signtwist = (magtwist > 0) - (magtwist < 0); - Mtcrit = mu_twist * Fncrit; // critical torque (eq 44) - if (fabs(magtortwist) > Mtcrit) { - history[twist_history_index] = (Mtcrit * signtwist - gamma_twist * magtwist) / k_twist; - magtortwist = -Mtcrit * signtwist; // eq 34 - } + return heat_model.calculate_heat(); } /* ---------------------------------------------------------------------- @@ -556,15 +303,7 @@ void ContactModel::twisting_SDS(double *history) double ContactModel::pulloff_distance(double radi, double radj) { - double Ecaled, a_tmp, Reff_tmp; - - if (normal_model != JKR) return radi+radj; - - Reff_tmp = radi * radj / (radi + radj); - if (Reff_tmp <= 0) return 0; - Ecaled = k_norm * THREEQUARTERS; - a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); - return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); + return normal_model.pulloff_distance(radi, radj); } } diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index cb6d1865af..8883ecb08e 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -39,36 +39,35 @@ public: double calculate_heat(); double pulloff_distance(double, double); - void init_normal(char*); - void init_tangential(char*); - void init_damping(char*); - void init_rolling(char*); - void init_twisting(char*); - void init_heat(char*); + void init_model(char*, int); + + void mix_coeffs(ContactModel*, ContactModel*); void write_restart(FILE *); void read_restart(FILE *); - NormalModel *normal_model; - DampingModel *damping_model; //Classes below need .h and .cpp files analogous to normal_contact_models.h/.cpp - TangentialModel *tangential_model; - RollingModel *rolling_model; - TwistingModel *twisting_model; - HeatModel *heat_model; + // Sub models + NormalModel normal_model; + DampingModel damping_model; + TangentialModel tangential_model; + RollingModel rolling_model; + TwistingModel twisting_model; + HeatModel heat_model; + SubModel *sub_models[6]; // Need to resize if we add more model flavors - double *forces; - double *torquesi; - double *torquesj; + // Extra options + int beyond_contact, limit_damping; + double cutoff_type; + + // Contact properties/output + double *forces, *torquesi, *torquesj; double *history; - int limit_damping; - - double radi, radj, meff, dt, Ti, Tj; - double area; + double radi, radj, meff, dt, Ti, Tj, area; + double Fntot, Fncrit, magtortwist; double *xi, *xj, *vi, *vj, *omegai, *omegaj; - double Fntot, Fncrit; - double fs[3], fr[3], ft[3], magtortwist; + double fs[3], fr[3], ft[3]; private: double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; @@ -77,7 +76,6 @@ private: bool touch; int prep_flag, check_flag; - int mindlin_rescale, mindlin_force; }; } // namespace Contact diff --git a/src/GRANULAR/damping_contact_models.cpp b/src/GRANULAR/contact_damping_models.cpp similarity index 100% rename from src/GRANULAR/damping_contact_models.cpp rename to src/GRANULAR/contact_damping_models.cpp diff --git a/src/GRANULAR/damping_contact_models.h b/src/GRANULAR/contact_damping_models.h similarity index 100% rename from src/GRANULAR/damping_contact_models.h rename to src/GRANULAR/contact_damping_models.h diff --git a/src/GRANULAR/heat_models.cpp b/src/GRANULAR/contact_heat_models.cpp similarity index 100% rename from src/GRANULAR/heat_models.cpp rename to src/GRANULAR/contact_heat_models.cpp diff --git a/src/GRANULAR/heat_models.h b/src/GRANULAR/contact_heat_models.h similarity index 100% rename from src/GRANULAR/heat_models.h rename to src/GRANULAR/contact_heat_models.h diff --git a/src/GRANULAR/normal_contact_models.cpp b/src/GRANULAR/contact_normal_models.cpp similarity index 63% rename from src/GRANULAR/normal_contact_models.cpp rename to src/GRANULAR/contact_normal_models.cpp index cc01a3ddb2..e17798ca25 100644 --- a/src/GRANULAR/normal_contact_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "normal_contact_models.h" +#include "contact_normal_models.h" #include "math_const.h" #include "contact.h" @@ -32,32 +32,42 @@ namespace Contact{ // ************************ // Default behaviors where needed // ************************ -void NormalModel::set_fncrit(){ +void NormalModel::set_fncrit() +{ contact->Fncrit = fabs(contact->Fntot); } -void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ - for (int i = 0; i < num_coeffs; i++){ +void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + for (int i = 0; i < num_coeffs; i++) { coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); } } +void NormalModel::pulloff_distance(double radi, double radj) +{ + return radi + radj; +} + //----------------------------------------- //****************** // Hooke //****************** -void Hooke::Hooke(ContactModel &c){ +void Hooke::Hooke(ContactModel &c) +{ num_coeffs = 2; allocate_coeffs(); } -void Hooke::coeffs_to_local(){ +void Hooke::coeffs_to_local() +{ k_norm = coeffs[0]; damp = coeffs[1]; } -double Hooke::calculate_forces(){ +double Hooke::calculate_forces() +{ contact.area = sqrt(contact.dR); contact.knfac = k_norm * contact.area; return contact.knfac * contact.delta; @@ -67,7 +77,8 @@ double Hooke::calculate_forces(){ //****************** // Hertz //****************** -void Hertz::Hertz(ContactModel &c, int mat_flag){ +void Hertz::Hertz(ContactModel &c, int mat_flag) +{ material_prop_flag = mat_flag; if (material_prop_flag){ num_coeffs = 3; @@ -77,7 +88,8 @@ void Hertz::Hertz(ContactModel &c, int mat_flag){ } } -void Hertz::coeffs_to_local(){ +void Hertz::coeffs_to_local() +{ if (material_prop_flag){ Emod = coeffs[0]; poiss = coeffs[1]; @@ -88,7 +100,8 @@ void Hertz::coeffs_to_local(){ } } -double Hertz::calculate_forces(){ +double Hertz::calculate_forces() +{ contact.area = sqrt(contact.dR); contact.knfac = contact.k_norm * contact.area; return contact.knfac * contact.delta; @@ -97,12 +110,14 @@ double Hertz::calculate_forces(){ //****************** // DMT //****************** -void DMT::DMT(ContactModel &c){ +void DMT::DMT(ContactModel &c) +{ material_prop_flag = 1; num_coeffs = 4; } -double DMT::calculate_forces(){ +double DMT::calculate_forces() +{ contact.area = sqrt(contact.dR); contact.knfac = contact.k_norm * contact.area; double Fne = contact.knfac * contact.delta; @@ -111,20 +126,23 @@ double DMT::calculate_forces(){ return Fne; } -void DMT::set_fncrit(){ +void DMT::set_fncrit() +{ contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); } //****************** // JKR //****************** -void JKR::JKR(ContactModel &c){ +void JKR::JKR(ContactModel &c) +{ material_prop_flag = 1; - beyond_contact = 1; + contact.beyond_contact = beyond_contact = 1; num_coeffs = 4; } -bool JKR::touch(int touch){ +bool JKR::touch(int touch) +{ double Escaled, R2, delta_pulloff, dist_pulloff; bool touchflag; @@ -141,38 +159,50 @@ bool JKR::touch(int touch){ return touchflag; } -double JKR::calculate_forces(){ +double JKR::calculate_forces() +{ double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - Escaled = k_norm * THREEQUARTERS; + Escaled = k_norm * THREEQUARTERS; - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; - knfac = Escaled * a; - return Fne; + knfac = Escaled * a; + return Fne; } -void JKR::set_fncrit(){ +void JKR::set_fncrit() +{ contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); } +void JKR::pulloff_distance(double radi, double radj) +{ + double Ecaled, a_tmp, Reff_tmp; + Reff_tmp = radi * radj / (radi + radj); + if (Reff_tmp <= 0) return 0; + + Ecaled = k_norm * THREEQUARTERS; + a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); + return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); +} diff --git a/src/GRANULAR/normal_contact_models.h b/src/GRANULAR/contact_normal_models.h similarity index 97% rename from src/GRANULAR/normal_contact_models.h rename to src/GRANULAR/contact_normal_models.h index 198e4bcb59..7d54fc942b 100644 --- a/src/GRANULAR/normal_contact_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -29,6 +29,7 @@ public: virtual double calculate_forces() = 0; virtual void coeffs_to_local(); virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed + void pulloff_distance(double, double); private: int size_history = 0; diff --git a/src/GRANULAR/twisting_contact_models.cpp b/src/GRANULAR/contact_rolling_models.cpp similarity index 73% rename from src/GRANULAR/twisting_contact_models.cpp rename to src/GRANULAR/contact_rolling_models.cpp index e6bafe4b3c..5521e10aee 100644 --- a/src/GRANULAR/twisting_contact_models.cpp +++ b/src/GRANULAR/contact_rolling_models.cpp @@ -183,3 +183,67 @@ void JKR::set_fncrit(){ + +void ContactModel::rolling(double *history) +{ + int rhist0, rhist1, rhist2, frameupdate; + double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; + + rhist0 = roll_history_index; + rhist1 = rhist0 + 1; + rhist2 = rhist1 + 1; + + Frcrit = mu_roll * Fncrit; + + if (history_update) { + hist_temp[0] = history[rhist0]; + hist_temp[1] = history[rhist1]; + hist_temp[2] = history[rhist2]; + rolldotn = dot3(hist_temp, nx); + + frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; + if (frameupdate) { // rotate into tangential plane + rollmag = len3(hist_temp); + // projection + temp_dbl = -rolldotn; + scale3(temp_dbl, nx, temp_array); + sub3(hist_temp, temp_array, hist_temp); + + // also rescale to preserve magnitude + prjmag = len3(hist_temp); + if (prjmag > 0) temp_dbl = rollmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, hist_temp); + } + scale3(dt, vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); + } + + scaleadd3(k_roll, hist_temp, gamma_roll, vrl, fr); + negate3(fr); + + // rescale frictional displacements and forces if needed + + magfr = len3(fr); + if (magfr > Frcrit) { + rollmag = len3(hist_temp); + if (rollmag != 0.0) { + temp_dbl = -Frcrit / (magfr * k_roll); + scale3(temp_dbl, fr, temp_array); + add3(hist_temp, temp_array, hist_temp); + + temp_dbl = -gamma_roll/k_roll; + scale3(temp_dbl, vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); + + temp_dbl = Frcrit / magfr; + scale3(temp_dbl, fr); + } else { + zero3(fr); + } + } + + history[rhist0] = hist_temp[0]; + history[rhist1] = hist_temp[1]; + history[rhist2] = hist_temp[2]; +} diff --git a/src/GRANULAR/rolling_contact_models.h b/src/GRANULAR/contact_rolling_models.h similarity index 100% rename from src/GRANULAR/rolling_contact_models.h rename to src/GRANULAR/contact_rolling_models.h diff --git a/src/GRANULAR/sub_model.cpp b/src/GRANULAR/contact_sub_models.cpp similarity index 80% rename from src/GRANULAR/sub_model.cpp rename to src/GRANULAR/contact_sub_models.cpp index e5ace9885e..8802622c78 100644 --- a/src/GRANULAR/sub_model.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -16,7 +16,7 @@ Multiple models can be defined and used to calculate forces and torques based on contact geometry */ -#include "sub_model.h" +#include "contact_sub_model.h" #include "pointers.h" #include "utils.h" #include "error.h" @@ -26,33 +26,43 @@ using namespace LAMMPS_NS; namespace Contact{ -SubModel::SubModel(){ +SubModel::SubModel() +{ allocated = 0; + material_prop_flag = 0; + size_history = 0; + history_index = 0; } -SubModel::~SubModel(){ + +SubModel::~SubModel() +{ if (allocated) delete [] coeffs; } -void SubModel::allocate_coeffs(){ +void SubModel::allocate_coeffs() +{ allocated = 1; coeffs = new double[num_coeffs]; } -void SubModel::parse_coeffs(char **arg, int iarg){ - for (int i = 0; i < num_coeffs; i++){ +void SubModel::parse_coeffs(char **arg, int iarg) +{ + for (int i = 0; i < num_coeffs; i++) { coeffs[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); } coeffs_to_local(); } -void SubModel::write_restart(FILE *fp){ +void SubModel::write_restart(FILE *fp) +{ fwrite(&model_name.length(),sizeof(int),1,fp); fwrite(model_name.data(),sizeof(char),model_name.length(),fp); fwrite(&num_coeffs,sizeof(int),1,fp); fwrite(coeffs,sizeof(int),num_coeffs,fp); } -void SubModel::read_restart(FILE *fp, int num_char){ +void SubModel::read_restart(FILE *fp, int num_char) +{ if (comm->me == 0){ utils::sfread(FLERR,&num_coeffs,sizeof(int),1,fp,nullptr,error); } @@ -60,7 +70,8 @@ void SubModel::read_restart(FILE *fp, int num_char){ allocate_coeffs(); } -void SubModel::read_restart(FILE *fp){ +void SubModel::read_restart(FILE *fp) +{ int num_char; if (me == 0){ utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); diff --git a/src/GRANULAR/sub_model.h b/src/GRANULAR/contact_sub_models.h similarity index 93% rename from src/GRANULAR/sub_model.h rename to src/GRANULAR/contact_sub_models.h index 2d3261238b..771f0f0890 100644 --- a/src/GRANULAR/sub_model.h +++ b/src/GRANULAR/contact_sub_models.h @@ -29,6 +29,7 @@ public: virtual double calculate_forces() = 0; void read_restart(); virtual void parse_coeffs(char **, int); + void mix_coeff(SubModel*, SubModel*); void write_restart(FILE*); void read_restart(FILE*); void read_restart(FILE*, int); @@ -38,9 +39,9 @@ public: private: ContactModel &contact; int allocated; - int material_prop_flag = 0; + int material_prop_flag; int size_history; - + int history_index; }; } diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp new file mode 100644 index 0000000000..1ceb940111 --- /dev/null +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -0,0 +1,324 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "tangential_contact_models.h" +#include "math_const.h" +#include "contact.h" + +#include + +using namespace MathConst; + +namespace Contact{ + +// ************************ +// Default behaviors where needed +// ************************ + +//----------------------------------------- + +//****************** +// Hooke +//****************** +void LinearNohistory::calculate_forces(){ + contact = c; + num_coeffs = 2; + allocate_coeffs(); +} + +void Hooke::coeffs_to_local(){ + k_norm = coeffs[0]; + damp = coeffs[1]; +} + +double Hooke::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = k_norm * contact.area; + return contact.knfac * contact.delta; +} + + +//****************** +// Hertz +//****************** +void Hertz::Hertz(ContactModel &c, int mat_flag){ + contact = c; + material_prop_flag = mat_flag; + if (material_prop_flag){ + num_coeffs = 3; + } + else{ + num_coeffs = 2; + } + allocate_coeffs(); +} + +void Hertz::coeffs_to_local(){ + if (material_prop_flag){ + Emod = coeffs[0]; + poiss = coeffs[1]; + k_norm = 4/3*Emod; + } + else{ + k_norm = coeffs[0]; + } +} + +double Hertz::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + return contact.knfac * contact.delta; +} + +//****************** +// DMT +//****************** +void DMT::DMT(ContactModel &c){ + contact = c; + material_prop_flag = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +double DMT::calculate_forces(){ + contact.area = sqrt(contact.dR); + contact.knfac = contact.k_norm * contact.area; + double Fne = contact.knfac * contact.delta; + F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; + Fne -= F_pulloff; + return Fne; +} + +void DMT::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); +} + +//****************** +// JKR +//****************** +void JKR::JKR(ContactModel &c){ + contact = c; + material_prop_flag = 1; + beyond_contact = 1; + num_coeffs = 4; + allocate_coeffs(); +} + +bool JKR::touch(int touch){ + double Escaled, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + Escaled = k_norm * THREEQUARTERS; + if (touch) { + R2 = contact.Reff * contact.Reff; + a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); + dist_pulloff = contact.radsum - delta_pulloff; + touchflag = (contact.rsq < dist_pulloff * dist_pulloff); + } else { + touchflag = (rcontact.sq < contact.radsum * contact.radsum); + } + return touchflag; +} + +double JKR::calculate_forces(){ + double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; + + Escaled = k_norm * THREEQUARTERS; + + R2 = Reff * Reff; + dR2 = dR * dR; + t0 = cohesion * cohesion * R2 * R2 * Escaled; + t1 = PI27SQ*t0; + t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4 * dR2 * Escaled; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Escaled; + sqrt2 = MAX(0, 2 * dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + a = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = a * a; + Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + F_pulloff = 3 * MY_PI * cohesion * Reff; + + knfac = Escaled * a; + return Fne; +} + +void JKR::set_fncrit(){ + contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); +} + + + + + +/* ---------------------------------------------------------------------- */ + +void ContactModel::tangential_no_history() +{ + double gamma_scaled = gamma_tang * damp_normal_prefactor; + double fsmag, Ft; + + // classic pair gran/hooke (no history) + fsmag = gamma_scaled * vrel; + if (vrel != 0.0) Ft = MIN(Fscrit,fsmag) / vrel; + else Ft = 0.0; + + Ft = -Ft; + scale3(Ft, vtr, fs); +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::tangential_history(double *history) +{ + double gamma_scaled = gamma_tang * damp_normal_prefactor; + double k = k_tang; + int frame_update = 0; + double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (history_update) { + rsht = dot3(history, nx); + frame_update = fabs(rsht) * k > EPSILON * Fscrit; + + if (frame_update) { + shrmag = len3(history); + // projection + scale3(rsht, nx, history); + // also rescale to preserve magnitude + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); + } + + // update history + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + temp_dbl = k * dt; + scale3(temp_dbl, vtr, temp_array); + sub3(history, temp_array, history); + } + + // tangential forces = history + tangential velocity damping + temp_dbl = -gamma_norm; + scale3(temp_dbl, vtr, fs); + + // rescale frictional displacements and forces if needed + magfs = len3(fs); + if (magfs > Fscrit) { + shrmag = len3(history); + if (shrmag != 0.0) { + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs, history); + scale3(gamma_norm, vtr, temp_array); + add3(history, temp_array, history); + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs); + } else { + zero3(fs); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::tangential_mindlin(double *history) +{ + double k_scaled, gamma_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; + double temp_array[3]; + int frame_update = 0; + + gamma_scaled = gamma_tang * damp_normal_prefactor; + k_scaled = k_tang * a; + if (mindlin_rescale) { + // on unloading, rescale the shear displacements/force + if (a < history[3]) { + temp_dbl = a / history[3]; + scale3(temp_dbl, history); + } + } + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (history_update) { + rsht = dot3(history, nx); + if (mindlin_force) + frame_update = fabs(rsht) > EPSILON * Fscrit; + else + frame_update = fabs(rsht) * k_scaled > EPSILON * Fscrit; + + if (frame_update) { + shrmag = len3(history); + // projection + scale3(rsht, nx, history); + // also rescale to preserve magnitude + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); + } + + // update history + if (mindlin_force) { + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + temp_dbl = -k_scaled * dt; + scale3(temp_dbl, vtr, temp_array); + } else { + scale3(dt, vtr, temp_array); + } + add3(history, temp_array, history); + + if (mindlin_rescale) history[3] = a; + } + + // tangential forces = history + tangential velocity damping + temp_dbl = -gamma_scaled; + scale3(temp_dbl, vtr, fs); + + if (! mindlin_force) { + scale3(k_scaled, history, temp_array); + add3(fs, temp_array, fs); + } + + // rescale frictional displacements and forces if needed + magfs = len3(fs); + if (magfs > Fscrit) { + shrmag = len3(history); + if (shrmag != 0.0) { + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs, history); + scale3(gamma_tang, vtr, temp_array); + add3(history, temp_array, history); + if (! mindlin_force) { + temp_dbl = -1.0 / k_tang; + scale3(temp_dbl, history); + } + temp_dbl = Fscrit / magfs; + scale3(temp_dbl, fs); + } else { + zero3(fs); + } + } +} + +/* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/tangential_contact_models.h b/src/GRANULAR/contact_tangential_models.h similarity index 100% rename from src/GRANULAR/tangential_contact_models.h rename to src/GRANULAR/contact_tangential_models.h diff --git a/src/GRANULAR/rolling_contact_models.cpp b/src/GRANULAR/contact_twisting_models.cpp similarity index 82% rename from src/GRANULAR/rolling_contact_models.cpp rename to src/GRANULAR/contact_twisting_models.cpp index e6bafe4b3c..0e9e9115ac 100644 --- a/src/GRANULAR/rolling_contact_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -183,3 +183,34 @@ void JKR::set_fncrit(){ + +/* ---------------------------------------------------------------------- */ + +void ContactModel::twisting_marshall(double *history) +{ + // Overwrite twist coefficients with derived values + k_twist = 0.5 * k_tang * a * a; // eq 32 of Marshall paper + gamma_twist = 0.5 * gamma_tang * a * a; + mu_twist = TWOTHIRDS * a * mu_tang; + + twisting_SDS(history); +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::twisting_SDS(double *history) +{ + double signtwist, Mtcrit; + + if (history_update) { + history[twist_history_index] += magtwist * dt; + } + + magtortwist = -k_twist * history[twist_history_index] - gamma_twist*magtwist; // M_t torque (eq 30) + signtwist = (magtwist > 0) - (magtwist < 0); + Mtcrit = mu_twist * Fncrit; // critical torque (eq 44) + if (fabs(magtortwist) > Mtcrit) { + history[twist_history_index] = (Mtcrit * signtwist - gamma_twist * magtwist) / k_twist; + magtortwist = -Mtcrit * signtwist; // eq 34 + } +} diff --git a/src/GRANULAR/twisting_contact_models.h b/src/GRANULAR/contact_twisting_models.h similarity index 100% rename from src/GRANULAR/twisting_contact_models.h rename to src/GRANULAR/contact_twisting_models.h diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 855ed36cf0..7378df2f77 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -198,13 +198,13 @@ void PairGranular::compute(int eflag, int vflag) jtype = type[j]; // Reset model and copy initial geometric data - models[itype][jtype].reset_contact(); - models[itype][jtype].xi = x[i]; - models[itype][jtype].xj = x[j]; - models[itype][jtype].radi = radius[i]; - models[itype][jtype].radj = radius[j]; + models[itype][jtype]->reset_contact(); + models[itype][jtype]->xi = x[i]; + models[itype][jtype]->xj = x[j]; + models[itype][jtype]->radi = radius[i]; + models[itype][jtype]->radj = radius[j]; - touchflag = models[itype][jtype].check_contact(); + touchflag = models[itype][jtype]->check_contact(); if (!touchflag) { // unset non-touching neighbors @@ -229,22 +229,21 @@ void PairGranular::compute(int eflag, int vflag) if (mask[j] & freeze_group_bit) meff = mi; // Copy additional information and prepare force calculations - models[itype][jtype].meff = meff; - models[itype][jtype].vi = v[i]; - models[itype][jtype].vj = v[j]; - models[itype][jtype].omegai = omega[i]; - models[itype][jtype].omegaj = omega[j]; - models[itype][jtype].history_update = historyupdate; - models[itype][jtype].history = history; - models[itype][jtype].prep_contact(); + models[itype][jtype]->meff = meff; + models[itype][jtype]->vi = v[i]; + models[itype][jtype]->vj = v[j]; + models[itype][jtype]->omegai = omega[i]; + models[itype][jtype]->omegaj = omega[j]; + models[itype][jtype]->history_update = historyupdate; + models[itype][jtype]->history = history; + models[itype][jtype]->prep_contact(); if (heat_flag) { - models[itype][jtype].Ti = temperature[i]; - models[itype][jtype].Tj = temperature[j]; + models[itype][jtype]->Ti = temperature[i]; + models[itype][jtype]->Tj = temperature[j]; } - - if (models[itype][jtype].normal_model == JKR) touch[jj] = 1; + if (models[itype][jtype]->beyond_contact) touch[jj] = 1; // if any history is needed if (use_history) { @@ -252,12 +251,12 @@ void PairGranular::compute(int eflag, int vflag) history = &allhistory[size_history*jj]; } - double *forces = models[itype][jtype].forces; - double *torquesi = models[itype][jtype].torquesi; - double *torquesj = models[itype][jtype].torquesj; + models[itype][jtype]->calculate_forces(); + if (heat_flag) dq = models[itype][jtype]->calculate_heat(); - models[itype][jtype].calculate_forces(); - if (heat_flag) dq = models[itype][jtype].calculate_heat(); + forces = models[itype][jtype]->forces; + torquesi = models[itype][jtype]->torquesi; + torquesj = models[itype][jtype]->torquesj; // apply forces & torques MathExtra::scale3(factor_lj, forces); @@ -302,9 +301,8 @@ void PairGranular::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutoff_type,n+1,n+1,"pair:cutoff_type"); - for (int i = 0; i < n+1; i++) { - models.push_back(std::vector (n+1)); - } + + models = (ContactModel **) memory->srealloc(fix, n+1,n+1, "pair:contact_models"); onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -334,16 +332,8 @@ void PairGranular::settings(int narg, char **arg) void PairGranular::coeff(int narg, char **arg) { - int normal_model_one, damping_model_one; - int tangential_model_one, roll_model_one, twist_model_one; - - double normal_coeffs_one[4]; - double tangential_coeffs_one[4]; - double roll_coeffs_one[4]; - double twist_coeffs_one[4]; - - double conductivity_one; double cutoff_one = -1; + int ncoeff; if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients"); @@ -354,66 +344,97 @@ void PairGranular::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - //Here's one option for handing off parsing to the SubModel objects: - ContactModel model_one; + // Create new model stored in vector + vec_models.push_back(ContactModel()); //Parse mandatory normal and tangential specifications int iarg = 2; - model_one.init_normal(arg[iarg]); + vec_models.back().init(arg[iarg], Contact::NORMAL); + ncoeff = vec_models.back().normal_model.num_coeffs iarg += 1; - if (iarg + model_one.normal_model->num_coeffs >= narg) + if (iarg + ncoeff >= narg) error->all(FLERR,"Illegal pair_coeff command" - "Insufficient arguments provided."); - model_one.normal_model->parse_coeffs(arg, iarg); - iarg += model_one.normal_model->num_coeffs; + "Insufficient arguments provided for normal model."); + vec_models.back().normal_model.parse_coeffs(arg, iarg); + iarg += ncoeff; if (strcmp(arg[iarg], "tangential") == 0) { if (iarg + 1 >= narg) error->all(FLERR,"Illegal pair_coeff command, must specify " "tangential model after tangential keyword"); - model_one.init_tangential(arg[iarg]); + vec_models.back().init(arg[iarg], Contact::TANGENTIAL); + ncoeff = vec_models.back().tangential_model.num_coeffs; iarg += 1; - if (iarg + model_one.tangential_model->num_coeffs >= narg) + if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" - "Insufficient arguments provided."); - model_one.tangential_model->parse_coeffs(arg, iarg); - iarg += model_one.tangential_model->num_coeffs; - } - else{ + "Insufficient arguments provided for tangential model."); + vec_models.back().tangential_model.parse_coeffs(arg, iarg); + iarg += ncoeff; + } else{ error->all(FLERR, "Illegal pair_coeff command, 'tangential' keyword expected"); } + //Parse optional arguments while (iarg < narg) { if (strcmp(arg[iarg], "rolling") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - model_one.init_rolling(arg[iarg+1]); + vec_models.back().init(arg[iarg], Contact::ROLLING); + ncoeff = vec_models.back().rolling_model.num_coeffs; iarg += 1; - if (iarg + model_one.rolling_model->num_coeffs >= narg) + if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" "Insufficient arguments provided for rolling model."); - iarg += model_one.rolling_model->num_coeffs; - } - else if (strcmp(arg[iarg], "twisting") == 0) { - //... - } - else if (strcmp(arg[iarg], "cutoff") == 0) { - //.. - } else if (strcmp(arg[iarg], "limit_damping") == 0) { - //.. + vec_models.back().rolling_model.parse_coeffs(arg, iarg); + iarg += ncoeff; + + } else if (strcmp(arg[iarg], "twisting") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + vec_models.back().init(arg[iarg], Contact::TWISTING); + ncoeff = vec_models.back().twisting_model.num_coeffs; + iarg += 1; + if (iarg + ncoeff >= narg) + error->all(FLERR, "Illegal pair_coeff command" + "Insufficient arguments provided for twisting model."); + vec_models.back().twisting_model.parse_coeffs(arg, iarg); + iarg += ncoeff; + } else if (strcmp(arg[iarg], "heat") == 0) { - //.. + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + vec_models.back().init(arg[iarg], Contact::HEAT); + ncoeff = vec_models.back().heat_model.num_coeffs; + iarg += 1; + if (iarg + ncoeff >= narg) + error->all(FLERR, "Illegal pair_coeff command" + "Insufficient arguments provided for heat model."); + ncoeff = vec_models.back().heat_model.num_coeffs; + vec_models.back().heat_model.parse_coeffs(arg, iarg); + iarg += ncoeff; + heat_flag = 1; + + } else if (strcmp(arg[iarg], "cutoff") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + vec_models.back().cutoff_type = utils::numeric(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + + } else if (strcmp(arg[iarg], "limit_damping") == 0) { + vec_models.back().limit_damping = 1; + iarg += 1; + } else error->all(FLERR, "Illegal pair_coeff command"); } - if (model_one.limit_damping && !model_one.normal_model->allow_limit_damping) + if (vec_models.back().limit_damping && !vec_models.back().normal_model->allow_limit_damping) error->all(FLERR,"Illegal pair_coeff command, " "Cannot limit damping with specified normal contact model"); int count = 0; for (int i = ilo; i <= ihi; i++) { for (int j = MAX(jlo,i); j <= jhi; j++) { - models[i][j] = model_one; //Not sure if this works to copy? May need to specify a copy operator for ContactModel.. + models[i][j] = & vec_models.back(); setflag[i][j] = 1; count++; } @@ -437,31 +458,38 @@ void PairGranular::init_style() if (comm->ghost_velocity == 0) error->all(FLERR,"Pair granular requires ghost atoms store velocity"); - size_normal_history = 0; - size_tangential_history = 0; - size_rolling_history = 0; - size_twisting_history = 0; - for (int i = 1; i <= atom->ntypes; i++) - for (int j = i; j <= atom->ntypes; j++){ - if (models[i][j].normal_model->history_flag || - models[i][j].tangential_model->history_flag || - models[i][j].rolling_model->history_flag || - models[i][j].twisting_model->history_flag) use_history = 1; + // allocate history - if (models[i][j].nondefault_history_transfer) - if (models[i][j].normal_model->size_history > size_normal_history) - size_normal_history = models[i][j].normal_model->size_history; - //... + int size_normal_history = 0; + int size_tangential_history = 0; + int size_rolling_history = 0; + int size_twisting_history = 0; + for (int i = 1; i <= atom->ntypes; i++) { + for (int j = i; j <= atom->ntypes; j++) { + if (models[i][j]->normal_model.history_flag || + models[i][j]->tangential_model.history_flag || + models[i][j]->rolling_model.history_flag || + models[i][j]->twisting_model.history_flag) use_history = 1; + + if (models[i][j]->nondefault_history_transfer) // ??? + + if (models[i][j]->normal_model->size_history > size_normal_history) + size_normal_history = models[i][j]->normal_model.size_history; + if (models[i][j]->tangential_model->size_history > size_tangential_history) + size_tangential_history = models[i][j]->tangential_model.size_history; + if (models[i][j]->rolling_model->size_history > size_rolling_history) + size_rolling_history = models[i][j]->rolling_model.size_history; + if (models[i][j]->twisting_model->size_history > size_twisting_history) + size_twisting_history = models[i][j]->twisting_model.size_history; } + } size_history = size_normal_history + size_tangential_history + - size_roll_history + size_twist_history; - - // determine location of tangential/roll/twist histories in array + size_rolling_history + size_twisting_history; tangential_history_index = size_normal_history; roll_history_index = size_normal_history + size_tangential_history; - twist_history_index = size_normal_history + size_tangential_history + size_roll_history; + twist_history_index = size_normal_history + size_tangential_history + size_rolling_history; if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE|NeighConst::REQ_HISTORY); else neighbor->add_request(this, NeighConst::REQ_SIZE); @@ -556,71 +584,25 @@ double PairGranular::init_one(int i, int j) double cutoff = 0.0; if (setflag[i][j] == 0) { - if ((models[i][i].normal_model != models[j][j].normal_model) || - (models[i][i].damping_model != models[j][j].damping_model) || - (models[i][i].tangential_model != models[j][j].tangential_model) || - (models[i][i].roll_model != models[j][j].roll_model) || - (models[i][i].twist_model != models[j][j].twist_model)) { + if ((models[i][i]->normal_model != models[j][j]->normal_model) || + (models[i][i]->damping_model != models[j][j]->damping_model) || + (models[i][i]->tangential_model != models[j][j]->tangential_model) || + (models[i][i]->roll_model != models[j][j]->roll_model) || + (models[i][i]->twist_model != models[j][j]->twist_model)) { error->all(FLERR,"Granular pair style functional forms are different, " "cannot mix coefficients for types {} and {}. \n" "This combination must be set explicitly via a " "pair_coeff command",i,j); } - // Mix normal coefficients - if (models[i][j].normal_model == HERTZ || models[i][j].normal_model == HOOKE) - models[i][j].k_norm = models[j][i].k_norm = - mix_geom(models[i][i].k_norm, models[j][j].k_norm); - else - models[i][j].k_norm = models[j][i].k_norm = - mix_stiffnessE(models[i][i].Emod, models[j][j].Emod, - models[i][i].poisson, models[j][j].poisson); - - models[i][j].gamma_norm = models[j][i].gamma_norm = - mix_geom(models[i][i].gamma_norm, models[j][j].gamma_norm); - if ((models[i][j].normal_model == JKR) || (models[i][j].normal_model == DMT)) - models[i][j].cohesion = models[j][i].cohesion = - mix_geom(models[i][i].cohesion, models[j][j].cohesion); - - // Mix tangential coefficients - models[i][j].k_tang = models[j][i].k_tang = - mix_geom(models[i][i].k_tang, models[j][j].k_tang); - models[i][j].gamma_tang = models[j][i].gamma_tang = - mix_geom(models[i][i].gamma_tang, models[j][j].gamma_tang); - models[i][j].mu_tang = models[j][i].mu_tang = - mix_geom(models[i][i].mu_tang, models[j][j].mu_tang); - - // Mix rolling coefficients - if (models[i][j].roll_model != ROLL_NONE) { - models[i][j].k_roll = models[j][i].k_roll = - mix_geom(models[i][i].k_roll, models[j][j].k_roll); - models[i][j].gamma_roll = models[j][i].gamma_roll = - mix_geom(models[i][i].gamma_roll, models[j][j].gamma_roll); - models[i][j].mu_roll = models[j][i].mu_roll = - mix_geom(models[i][i].mu_roll, models[j][j].mu_roll); - } - - // Mix twisting coefficients - if (models[i][j].twist_model != TWIST_NONE && models[i][j].twist_model != TWIST_MARSHALL) { - models[i][j].k_twist = models[j][i].k_twist = - mix_geom(models[i][i].k_twist, models[j][j].k_twist); - models[i][j].gamma_twist = models[j][i].gamma_twist = - mix_geom(models[i][i].gamma_twist, models[j][j].gamma_twist); - models[i][j].mu_twist = models[j][i].mu_twist = - mix_geom(models[i][i].mu_twist, models[j][j].mu_twist); - } - - models[i][j].limit_damping = models[j][i].limit_damping = - MAX(models[i][i].limit_damping, models[j][j].limit_damping); - if (heat_flag) { - models[i][j].conductivity = models[j][i].conductivity = - mix_geom(models[i][i].conductivity, models[j][j].conductivity); - } + vec_models.push_back(ContactModel()); + models[i][j] = models[j][i] = & vec_models.back(); + vec_models.back().mix_coeffs(models[i][i], models[j][j]); } - // Check if conductivity is undefined (negative) for any type combination - if (heat_flag && models[i][j].conductivity < 0.0) - error->all(FLERR, "To calculate heat, conductivity must be defined for all pair coeff"); + // Check if heat model is defined for all type combinations + if (heat_flag && !models[i][j]->heat_model) + error->all(FLERR, "Must specify a heat model for all pair types"); // It is possible that cut[i][j] at this point is still 0.0. // This can happen when @@ -631,21 +613,21 @@ double PairGranular::init_one(int i, int j) // we assign cutoff = max(cut[i][j]) for i,j such that cut[i][j] > 0.0. double pulloff; - if (models[i][j].cutoff_type < 0 && cutoff_global < 0) { + if (models[i][j]->cutoff_type < 0 && cutoff_global < 0) { if (((maxrad_dynamic[i] > 0.0) && (maxrad_dynamic[j] > 0.0)) || ((maxrad_dynamic[i] > 0.0) && (maxrad_frozen[j] > 0.0)) || // radius info about both i and j exist ((maxrad_frozen[i] > 0.0) && (maxrad_dynamic[j] > 0.0))) { cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; pulloff = 0.0; - if (models[i][j].normal_model == JKR) { - pulloff = models[i][j].pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j]); + if (models[i][j]->beyond_contact) { + pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j]); cutoff += pulloff; - pulloff = models[i][j].pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j]); + pulloff = models[i][j]->pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j]); cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j] + pulloff); - pulloff = models[i][j].pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j]); + pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j]); cutoff = MAX(cutoff,maxrad_dynamic[i] + maxrad_frozen[j] + pulloff); } } else { @@ -661,16 +643,18 @@ double PairGranular::init_one(int i, int j) } cutoff = cutmax; } - } else if (models[i][j].cutoff_type > 0) { - cutoff = models[i][j].cutoff_type; + } else if (models[i][j]->cutoff_type > 0) { + cutoff = models[i][j]->cutoff_type; } else if (cutoff_global > 0) { cutoff = cutoff_global; } // Copy global options - models[i][j].dt = models[j][i].dt = dt; - models[i][j].roll_history_index = models[j][i].roll_history_index = roll_history_index; - models[i][j].twist_history_index = models[j][i].twist_history_index = twist_history_index; + models[i][j]->dt = models[j][i]->dt = dt; + models[i][j]->normal_model.history_index = models[j][i]->normal_model.history_index = normal_history_index; + models[i][j]->tangential_model.history_index = models[j][i]->tangential_model.history_index = tangential_history_index; + models[i][j]->rolling_model.history_index = models[j][i]->rolling_model.history_index = rolling_history_index; + models[i][j]->twisting_model.history_index = models[j][i]->twisting_model.history_index = twisting_history_index; return cutoff; } @@ -687,7 +671,7 @@ void PairGranular::write_restart(FILE *fp) fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { if (comm->me == 0){ - models[i][j].write_restart(fp); + models[i][j]->write_restart(fp); } } } @@ -708,57 +692,9 @@ void PairGranular::read_restart(FILE *fp) if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) { - std::string name; - utils::sfread(FLERR,&name.data(),sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].damping_model_type,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].tangential_model_type,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].roll_model_type,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].twist_model_type,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].limit_damping,sizeof(int),1,fp,nullptr,error); - } - MPI_Bcast(&models[i][j].normal_model_type,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].damping_model_type,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].tangential_model_type,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].roll_model_type,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].twist_model_type,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].limit_damping,1,MPI_INT,0,world); - models[i][j].init(); - models[i][j].read_restart(); - - utils::sfread(FLERR,&models[i][j].k_norm,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].gamma_norm,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].cohesion,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].k_tang,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].gamma_tang,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].mu_tang,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].k_roll,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].gamma_roll,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].mu_roll,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].k_twist,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].gamma_twist,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].mu_twist,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&models[i][j].cutoff_type,sizeof(double),1,fp,nullptr,error); - } - MPI_Bcast(&models[i][j].normal_model,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].damping_model,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].tangential_model,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].roll_model,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].twist_model,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].limit_damping,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].k_norm,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].gamma_norm,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].cohesion,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].k_tang,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].gamma_tang,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].mu_tang,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].k_roll,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].gamma_roll,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].mu_roll,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].k_twist,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].gamma_twist,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].mu_twist,1,MPI_INT,0,world); - MPI_Bcast(&models[i][j].cutoff_type,1,MPI_DOUBLE,0,world); + vec_models.push_back(ContactModel()); + models[i][j] = & vec_models.back(); + models[i][j]->read_restart(); } } } @@ -798,14 +734,14 @@ double PairGranular::single(int i, int j, int itype, int jtype, double *radius = atom->radius; // Reset model and copy initial geometric data - models[itype][jtype].reset_contact(); - models[itype][jtype].xi = x[i]; - models[itype][jtype].xj = x[j]; - models[itype][jtype].radi = radius[i]; - models[itype][jtype].radj = radius[j]; - models[i][j].history_update = 0; // Don't update history + models[itype][jtype]->reset_contact(); + models[itype][jtype]->xi = x[i]; + models[itype][jtype]->xj = x[j]; + models[itype][jtype]->radi = radius[i]; + models[itype][jtype]->radj = radius[j]; + models[i][j]->history_update = 0; // Don't update history - touchflag = models[itype][jtype].check_contact(); + touchflag = models[itype][jtype]->check_contact(); if (!touchflag) { fforce = 0.0; @@ -834,12 +770,13 @@ double PairGranular::single(int i, int j, int itype, int jtype, double **v = atom->v; double **omega = atom->omega; - models[itype][jtype].meff = meff; - models[itype][jtype].vi = v[i]; - models[itype][jtype].vj = v[j]; - models[itype][jtype].omegai = omega[i]; - models[itype][jtype].omegaj = omega[j]; - models[itype][jtype].prep_contact(); + models[itype][jtype]->meff = meff; + models[itype][jtype]->vi = v[i]; + models[itype][jtype]->vj = v[j]; + models[itype][jtype]->omegai = omega[i]; + models[itype][jtype]->omegaj = omega[j]; + models[itype][jtype]->history = history; + models[itype][jtype]->prep_contact(); // if any history is needed @@ -859,8 +796,10 @@ double PairGranular::single(int i, int j, int itype, int jtype, } double forces[3], torquesi[3], torquesj[3]; - - models[itype][jtype].calculate_forces(forces, torquesi, torquesj, history); + models[itype][jtype]->calculate_forces(); + forces = models[itype][jtype]->forces; + torquesi = models[itype][jtype]->torquesi; + torquesj = models[itype][jtype]->torquesj; // apply forces & torques fforce = MathExtra::len3(forces); @@ -871,15 +810,15 @@ double PairGranular::single(int i, int j, int itype, int jtype, double dely = x[i][1] - x[j][1]; double delz = x[i][2] - x[j][2]; - svector[0] = models[itype][jtype].fs[0]; - svector[1] = models[itype][jtype].fs[1]; - svector[2] = models[itype][jtype].fs[2]; - svector[3] = MathExtra::len3(models[itype][jtype].fs); - svector[4] = models[itype][jtype].fr[0]; - svector[5] = models[itype][jtype].fr[1]; - svector[6] = models[itype][jtype].fr[2]; - svector[7] = MathExtra::len3(models[itype][jtype].fr); - svector[8] = models[itype][jtype].magtortwist; + svector[0] = models[itype][jtype]->fs[0]; + svector[1] = models[itype][jtype]->fs[1]; + svector[2] = models[itype][jtype]->fs[2]; + svector[3] = MathExtra::len3(models[itype][jtype]->fs); + svector[4] = models[itype][jtype]->fr[0]; + svector[5] = models[itype][jtype]->fr[1]; + svector[6] = models[itype][jtype]->fr[2]; + svector[7] = MathExtra::len3(models[itype][jtype]->fr); + svector[8] = models[itype][jtype]->magtortwist; svector[9] = delx; svector[10] = dely; svector[11] = delz; @@ -960,7 +899,7 @@ double PairGranular::mix_geom(double valii, double valjj) void PairGranular::transfer_history(double* source, double* target, int source_type, int target_type) { - models[itype][jtype].transfer_history(); + models[itype][jtype]->transfer_history(); for (int i = 0; i < size_history; i++){ target[i] = history_transfer_factors[i]*source[i]; } @@ -977,8 +916,8 @@ double PairGranular::atom2cut(int i) cut = atom->radius[i] * 2; if (beyond_contact) { int itype = atom->type[i]; - if (models[itype][itype].normal_model == JKR) { - cut += models[itype][itype].pulloff_distance(cut, cut); + if (models[itype][itype]->beyond_contact) { + cut += models[itype][itype]->pulloff_distance(cut, cut); } } @@ -1000,8 +939,8 @@ double PairGranular::radii2cut(double r1, double r2) // Check all combinations of i and j to find theoretical maximum pull off distance for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ - if (models[i][j].normal_model == JKR) { - temp = models[i][j].pulloff_distance(r1, r2); + if (models[i][j]->beyond_contact) { + temp = models[i][j]->pulloff_distance(r1, r2); if (temp > cut) cut = temp; } } diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 3440d60e29..503e3ed938 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -22,7 +22,7 @@ PairStyle(granular,PairGranular); #include "contact.h" #include "pair.h" -#include +#include "vector.h" namespace LAMMPS_NS { @@ -73,7 +73,8 @@ class PairGranular : public Pair { int heat_flag; // contact models - std::vector > models; + std::vector vec_models; + Contact::ContactModel ***models; // history flags int normal_history, tangential_history, roll_history, twist_history; diff --git a/src/GRANULAR/tangential_contact_models.cpp b/src/GRANULAR/tangential_contact_models.cpp deleted file mode 100644 index ff59ceabb7..0000000000 --- a/src/GRANULAR/tangential_contact_models.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "tangential_contact_models.h" -#include "math_const.h" -#include "contact.h" - -#include - -using namespace MathConst; - -namespace Contact{ - -// ************************ -// Default behaviors where needed -// ************************ - -//----------------------------------------- - -//****************** -// Hooke -//****************** -void LinearNohistory::calculate_forces(){ - contact = c; - num_coeffs = 2; - allocate_coeffs(); -} - -void Hooke::coeffs_to_local(){ - k_norm = coeffs[0]; - damp = coeffs[1]; -} - -double Hooke::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = k_norm * contact.area; - return contact.knfac * contact.delta; -} - - -//****************** -// Hertz -//****************** -void Hertz::Hertz(ContactModel &c, int mat_flag){ - contact = c; - material_prop_flag = mat_flag; - if (material_prop_flag){ - num_coeffs = 3; - } - else{ - num_coeffs = 2; - } - allocate_coeffs(); -} - -void Hertz::coeffs_to_local(){ - if (material_prop_flag){ - Emod = coeffs[0]; - poiss = coeffs[1]; - k_norm = 4/3*Emod; - } - else{ - k_norm = coeffs[0]; - } -} - -double Hertz::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - return contact.knfac * contact.delta; -} - -//****************** -// DMT -//****************** -void DMT::DMT(ContactModel &c){ - contact = c; - material_prop_flag = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -double DMT::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - double Fne = contact.knfac * contact.delta; - F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; - Fne -= F_pulloff; - return Fne; -} - -void DMT::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); -} - -//****************** -// JKR -//****************** -void JKR::JKR(ContactModel &c){ - contact = c; - material_prop_flag = 1; - beyond_contact = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -bool JKR::touch(int touch){ - double Escaled, R2, delta_pulloff, dist_pulloff; - bool touchflag; - - Escaled = k_norm * THREEQUARTERS; - if (touch) { - R2 = contact.Reff * contact.Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = contact.radsum - delta_pulloff; - touchflag = (contact.rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rcontact.sq < contact.radsum * contact.radsum); - } - return touchflag; -} - -double JKR::calculate_forces(){ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - - Escaled = k_norm * THREEQUARTERS; - - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; - - knfac = Escaled * a; - return Fne; -} - -void JKR::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); -} - - - From 8557ce7c97634b855c896374a69b1e90041f2424 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 15 Jul 2022 17:57:38 -0600 Subject: [PATCH 013/112] Adding normal, damping, and tangential sub models --- src/GRANULAR/contact.cpp | 38 ++- src/GRANULAR/contact.h | 2 +- src/GRANULAR/contact_damping_models.cpp | 64 +++- src/GRANULAR/contact_damping_models.h | 42 ++- src/GRANULAR/contact_normal_models.cpp | 251 +++++++++----- src/GRANULAR/contact_normal_models.h | 100 +++--- src/GRANULAR/contact_sub_models.cpp | 57 +++- src/GRANULAR/contact_sub_models.h | 11 +- src/GRANULAR/contact_tangential_models.cpp | 365 ++++++++++----------- src/GRANULAR/contact_tangential_models.h | 79 +++-- src/GRANULAR/pair_granular.cpp | 68 ++-- src/GRANULAR/pair_granular.h | 4 - 12 files changed, 660 insertions(+), 421 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 693721fe22..12a9476585 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -54,45 +54,53 @@ ContactModel::ContactModel() void ContactModel::init_model(char *model_name, int model_type) { if (model_type == NORMAL) { - if (strcmp(model_name, "hooke") == 0) normal_model = new Hooke(); - else if (strcmp(model_name, "hertz") == 0) normal_model = new Hertz(0); - else if (strcmp(model_name, "hertz/material") == 0) normal_model = new Hertz(1); - //... + if (strcmp(model_name, "hooke") == 0) normal_model = new NormalHooke(); + else if (strcmp(model_name, "hertz") == 0) normal_model = new NormalHertz(); + else if (strcmp(model_name, "hertz/material") == 0) normal_model = new NormalHertzMaterial(); + else if (strcmp(model_name, "dmt") == 0) normal_model = new NormalDMT(); + else if (strcmp(model_name, "jkr") == 0) normal_model = new NormalJKR(); else error->all(FLERR, "Normal model name not recognized"); sub_models[model_type] = &normal_model; } else if (model_type == TANGENTIAL) { - if (strcmp(model_name, "linear") == 0) tangential_model = new LinearNoHistory(); - //... + if (strcmp(model_name, "linear_nohistory") == 0) tangential_model = new TangentialLinearNoHistory(); + else if (strcmp(model_name, "linear_history") == 0) tangential_model = new TangentialLinearHistory(); + else if (strcmp(model_name, "mindlin") == 0) tangential_model = new TangentialMindlin(); + else if (strcmp(model_name, "mindlin/force") == 0) tangential_model = new TangentialMindlinForce(); + else if (strcmp(model_name, "mindlin_rescale") == 0) tangential_model = new TangentialMindlinRescale(); + else if (strcmp(model_name, "mindlin_rescale/force") == 0) tangential_model = new TangentialMindlinRescaleForce(); else error->all(FLERR, "Tangential model name not recognized"); sub_models[model_type] = &tangential_model; } else if (model_type == DAMPING) { - if (strcmp(model_name, "linear") == 0) damping_model = new LinearNoHistory(); - //... + if (strcmp(model_name, "velocity") == 0) damping_model = new DampingVelocity(); + else if (strcmp(model_name, "mass_velocity") == 0) damping_model = new DampingMassVelocity(); + else if (strcmp(model_name, "viscoelastic") == 0) damping_model = new DampingViscoelastic(); + else if (strcmp(model_name, "tsuji") == 0) damping_model = new DampingTsuji(); else error->all(FLERR, "Damping model name not recognized"); sub_models[model_type] = &damping_model; } else if (model_type == ROLLING) { - if (strcmp(model_name, "linear") == 0) rolling_model = new LinearNoHistory(); - //... + if (strcmp(model_name, "none") == 0) delete rolling_model; + else if (strcmp(model_name, "sds") == 0) rolling_model = new RollingSDS(); else error->all(FLERR, "Rolling model name not recognized"); sub_models[model_type] = &rolling_model; } else if (model_type == TWISTING) { - if (strcmp(model_name, "linear") == 0) twisting_model = new LinearNoHistory(); - //... + if (strcmp(model_name, "none") == 0) delete twisting_model; + else if (strcmp(model_name, "sds") == 0) twisting_model = new TwistingSDS(); + else if (strcmp(model_name, "marshall") == 0) twisting_model = new TwistingMarshall(); else error->all(FLERR, "Twisting model name not recognized"); sub_models[model_type] = &twisting_model; } else if (model_type == HEAT) { - if (strcmp(model_name, "linear") == 0) heat_model = new LinearNoHistory(); - //... + if (strcmp(model_name, "none") == 0) delete heat_model; + else if (strcmp(model_name, "area") == 0) heat_model = new HeatArea(); else error->all(FLERR, "Heat model name not recognized"); sub_models[model_type] = &heat_model; } - sub_models[model_type]->model_name.assign(model_name); + sub_models[model_type]->name.assign(model_name); sub_models[model_type]->contact = *this; sub_models[model_type]->allocate_coeffs(); } diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 8883ecb08e..f9f18a1eb4 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -64,7 +64,7 @@ public: double *history; double radi, radj, meff, dt, Ti, Tj, area; - double Fntot, Fncrit, magtortwist; + double Fntot, magtortwist; double *xi, *xj, *vi, *vj, *omegai, *omegaj; double fs[3], fr[3], ft[3]; diff --git a/src/GRANULAR/contact_damping_models.cpp b/src/GRANULAR/contact_damping_models.cpp index 11d2c19b57..1e233234b2 100644 --- a/src/GRANULAR/contact_damping_models.cpp +++ b/src/GRANULAR/contact_damping_models.cpp @@ -23,32 +23,66 @@ using namespace MathSpecial; namespace Contact{ -void DampingModel::allocate_coeffs(){ - damp = contact.normal_model->coeffs[1]; + +/* ---------------------------------------------------------------------- + Default damping model +------------------------------------------------------------------------- */ + +void DampingModel::DampingModel() +{ + num_coeffs = 0; } -//----------------------------------------- -double Velocity::calculate_forces(){ - return -damp*contact.vnnr; +/* ---------------------------------------------------------------------- */ + +void DampingModel::coeffs_to_local() +{ + damp = contact.normal_model.damp; } -double MassVelocity::calculate_forces(){ - return -damp*contact.meff*contact.vnnr; +/* ---------------------------------------------------------------------- + Velocity damping +------------------------------------------------------------------------- */ + +double DampingVelocity::calculate_forces() +{ + return -damp * contact.vnnr; } +/* ---------------------------------------------------------------------- + Mass velocity damping +------------------------------------------------------------------------- */ -double ViscoElastic::calculate_forces(){ - return -damp*contact.meff*contact.area*contact.vnnr; +double MassVelocity::calculate_forces() +{ + return -damp * contact.meff * contact.vnnr; } +/* ---------------------------------------------------------------------- + Default, viscoelastic damping +------------------------------------------------------------------------- */ -void Tsuji::allocate_coeffs(){ - double cor = contact.normal_model->coeffs[1]; - damp = 1.2728-4.2783*cor+11.087*square(cor)-22.348*cube(cor)+ - 27.467*powint(cor,4)-18.022*powint(cor,5)+4.8218*powint(cor,6); +double ViscoElastic::calculate_forces() +{ + return -damp * contact.meff * contact.area * contact.vnnr; } -double Tsuji::calculate_forces(){ - return -damp*sqrt(contact.meff*contact.knfac)*contact.vnnr; +/* ---------------------------------------------------------------------- + Tsuji damping +------------------------------------------------------------------------- */ + +void Tsuji::coeffs_to_local() +{ + double tmp = contact.normal_model.damp; + damp = 1.2728 - 4.2783 * tmp + 11.087 * square(tmp); + damp += -22.348 * cube(tmp)+ 27.467 * powint(tmp, 4); + damp += -18.022 * powint(tmp, 5) + 4.8218 * powint(tmp,6); +} + +/* ---------------------------------------------------------------------- */ + +double Tsuji::calculate_forces() +{ + return -damp_scaled * sqrt(contact.meff * contact.normal_model.knfac) * contact.vnnr; } diff --git a/src/GRANULAR/contact_damping_models.h b/src/GRANULAR/contact_damping_models.h index 036f6e3452..0fc4fd2c17 100644 --- a/src/GRANULAR/contact_damping_models.h +++ b/src/GRANULAR/contact_damping_models.h @@ -19,34 +19,48 @@ namespace Contact { -class DampingModel:SubModel{ -public: - DampingModel(){}; - virtual ~DampingModel(){}; +class DampingModel:SubModel +{ + public: + DampingModel(); + virtual ~DampingModel() {}; virtual double calculate_forces() = 0; - virtual void allocate_coeffs(); + virtual void coeffs_to_local(); + virtual void mix_coeffs(NormalModel*, NormalModel*); double damp; }; -class Velocity:DampingModel{ -public: +/* ---------------------------------------------------------------------- */ + +class DampingVelocity:DampingModel +{ + public: double calculate_forces(); }; -class MassVelocity:DampingModel{ -public: +/* ---------------------------------------------------------------------- */ + +class DampingMassVelocity:DampingModel +{ + public: double calculate_forces(); }; -class ViscoElastic:DampingModel{ -public: +/* ---------------------------------------------------------------------- */ + +class DampingViscoElastic:DampingModel +{ + public: double calculate_forces(); }; -class Tsuji:DampingModel{ -public: +/* ---------------------------------------------------------------------- */ + +class DampingTsuji:DampingModel +{ + public: double calculate_forces(); - void allocate_coeffs(); + void coeffs_to_local(); }; diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index e17798ca25..9b1d85d123 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -29,124 +29,226 @@ namespace Contact{ #define ONETHIRD (1.0/3.0) // 1/3 #define THREEQUARTERS 0.75 // 3/4 -// ************************ -// Default behaviors where needed -// ************************ -void NormalModel::set_fncrit() +/* ---------------------------------------------------------------------- + Default normal model +------------------------------------------------------------------------- */ + +NormalModel::NormalModel() { - contact->Fncrit = fabs(contact->Fntot); + material_properties = 0; } -void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +/* ---------------------------------------------------------------------- */ + +void NormalModel::set_fncrit() { - for (int i = 0; i < num_coeffs; i++) { - coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); - } + Fncrit = fabs(contact.Fntot); } +/* ---------------------------------------------------------------------- */ + void NormalModel::pulloff_distance(double radi, double radj) { return radi + radj; } -//----------------------------------------- +/* ---------------------------------------------------------------------- + Hookean normal force +------------------------------------------------------------------------- */ -//****************** -// Hooke -//****************** -void Hooke::Hooke(ContactModel &c) +void NormalHooke::NormalHooke() { num_coeffs = 2; allocate_coeffs(); } -void Hooke::coeffs_to_local() +/* ---------------------------------------------------------------------- */ + +void NormalHooke::coeffs_to_local() { k_norm = coeffs[0]; damp = coeffs[1]; } -double Hooke::calculate_forces() +/* ---------------------------------------------------------------------- */ + +void NormalHooke::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +double NormalHooke::calculate_forces() { contact.area = sqrt(contact.dR); - contact.knfac = k_norm * contact.area; - return contact.knfac * contact.delta; + knfac = k_norm * contact.area; + Fne = knfac * contact.delta; + return Fne; } +/* ---------------------------------------------------------------------- + Hertzian normal force +------------------------------------------------------------------------- */ -//****************** -// Hertz -//****************** -void Hertz::Hertz(ContactModel &c, int mat_flag) +void NormalHertz::NormalHertz() { - material_prop_flag = mat_flag; - if (material_prop_flag){ - num_coeffs = 3; - } - else{ - num_coeffs = 2; - } + num_coeffs = 2; } -void Hertz::coeffs_to_local() +/* ---------------------------------------------------------------------- */ + +void NormalHertz::coeffs_to_local() { - if (material_prop_flag){ - Emod = coeffs[0]; - poiss = coeffs[1]; - k_norm = 4/3*Emod; - } - else{ - k_norm = coeffs[0]; - } + k_norm = coeffs[0]; + damp = coeffs[1]; } -double Hertz::calculate_forces() +/* ---------------------------------------------------------------------- */ + +void NormalHertz::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +double NormalHertz::calculate_forces() { contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - return contact.knfac * contact.delta; + knfac = contact.k_norm * contact.area; + Fne = knfac * contact.delta; + return Fne; } -//****************** -// DMT -//****************** -void DMT::DMT(ContactModel &c) +/* ---------------------------------------------------------------------- + Hertzian normal force with material properties +------------------------------------------------------------------------- */ + +void NormalHertzMaterial::NormalHertzMaterial() { - material_prop_flag = 1; + material_properties = 1; + num_coeffs = 3; +} + +/* ---------------------------------------------------------------------- */ + +void NormalHertzMaterial::coeffs_to_local() +{ + Emod = coeffs[0]; + damp = coeffs[1]; + poiss = coeffs[2]; + k_norm = 4 / 3 * Emod; +} + +/* ---------------------------------------------------------------------- */ + +void NormalHertzMaterial::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- + DMT normal force +------------------------------------------------------------------------- */ + +void NormalDMT::NormalDMT(ContactModel &c) +{ + allow_limit_damping = 0; + material_properties = 1; num_coeffs = 4; } -double DMT::calculate_forces() +/* ---------------------------------------------------------------------- */ + +void NormalDMT::coeffs_to_local() +{ + Emod = coeffs[0]; + damp = coeffs[1]; + poiss = coeffs[2]; + cohesion = coeffs[3]; + k_norm = 4 / 3 * Emod; +} + +/* ---------------------------------------------------------------------- */ + +void NormalDMT::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +double NormalDMT::calculate_forces() { contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - double Fne = contact.knfac * contact.delta; + knfac = k_norm * contact.area; + Fne = knfac * contact.delta; F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; Fne -= F_pulloff; return Fne; } -void DMT::set_fncrit() +/* ---------------------------------------------------------------------- */ + +void NormalDMT::set_fncrit() { - contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); + Fncrit = fabs(Fne + 2* F_pulloff); } -//****************** -// JKR -//****************** -void JKR::JKR(ContactModel &c) +/* ---------------------------------------------------------------------- + JKR normal force +------------------------------------------------------------------------- */ + +void NormalJKR::NormalJKR(ContactModel &c) { - material_prop_flag = 1; + allow_limit_damping = 0; + material_properties = 1; contact.beyond_contact = beyond_contact = 1; num_coeffs = 4; } -bool JKR::touch(int touch) +/* ---------------------------------------------------------------------- */ + +void NormalJKR::coeffs_to_local() { - double Escaled, R2, delta_pulloff, dist_pulloff; + Emod = coeffs[0]; + damp = coeffs[1]; + poiss = coeffs[2]; + cohesion = coeffs[3]; + k_norm = 4/3*Emod; + Escaled = k_norm * THREEQUARTERS; +} + +/* ---------------------------------------------------------------------- */ + +void NormalJKR::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +bool NormalJKR::touch(int touch) +{ + double R2, delta_pulloff, dist_pulloff; bool touchflag; - Escaled = k_norm * THREEQUARTERS; if (touch) { R2 = contact.Reff * contact.Reff; a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); @@ -159,12 +261,12 @@ bool JKR::touch(int touch) return touchflag; } -double JKR::calculate_forces() -{ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; +/* ---------------------------------------------------------------------- */ - Escaled = k_norm * THREEQUARTERS; +double NormalJKR::calculate_forces() +{ + double R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3, a2; R2 = Reff * Reff; dR2 = dR * dR; @@ -180,28 +282,31 @@ double JKR::calculate_forces() sqrt2 = MAX(0, 2 * dR + t5); t6 = sqrt(sqrt2); sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); + contact.area = INVROOT6 * (t6 + sqrt(sqrt3)); + a2 = contact.area * contact.area; + Fne = Escaled * contact.area * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * contact.area)); F_pulloff = 3 * MY_PI * cohesion * Reff; - knfac = Escaled * a; + knfac = Escaled * contact.area; return Fne; } -void JKR::set_fncrit() +/* ---------------------------------------------------------------------- */ + +void NormalJKR::set_fncrit() { - contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); + Fncrit = fabs(Fne + 2 * F_pulloff); } -void JKR::pulloff_distance(double radi, double radj) +/* ---------------------------------------------------------------------- */ + +void NormalJKR::pulloff_distance(double radi, double radj) { - double Ecaled, a_tmp, Reff_tmp; + double a_tmp, Reff_tmp; Reff_tmp = radi * radj / (radi + radj); if (Reff_tmp <= 0) return 0; - Ecaled = k_norm * THREEQUARTERS; a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); } diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index 7d54fc942b..e91d5af1c9 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -20,65 +20,91 @@ namespace Contact { class NormalModel:SubModel{ -public: - NormalModel(){}; - virtual ~NormalModel(){}; + public: + NormalModel(); + virtual ~NormalModel() {}; virtual bool check_contact(); - virtual void prep_contact(); virtual void set_fncrit(); virtual double calculate_forces() = 0; virtual void coeffs_to_local(); - virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed + virtual void mix_coeffs(NormalModel*, NormalModel*); void pulloff_distance(double, double); - -private: - int size_history = 0; - int beyond_contact = 0; - int allow_limit_damping = 1; - + double damp; // Vestigial argument needed by damping + double Fncrit, Fne, knfac; + int material_properties; }; -class Hooke:NormalModel{ -public: - Hooke(); - ~Hooke(){}; +/* ---------------------------------------------------------------------- */ + +class NormalHooke:NormalModel +{ + public: + NormalHooke(); + ~NormalHooke() {}; void coeffs_to_local(); + void mix_coeffs(NormalModel*, NormalModel*); double calculate_forces(); -private: - double k_norm, damp; + double Emod, poiss; }; -class Hertz:NormalModel{ -public: - Hertz(int); - ~Hertz(){}; +/* ---------------------------------------------------------------------- */ + +class NormalHertz:NormalModel +{ + public: + NormalHertz(); + ~NormalHertz() {}; void coeffs_to_local(); + void mix_coeffs(NormalModel*, NormalModel*); double calculate_forces(); -private: - double k_norm, damp, Emod, poiss; + private: + double k_norm; }; -class DMT:NormalModel{ -public: - DMT(); - ~DMT(){}; +/* ---------------------------------------------------------------------- */ + +class NormalHertzMaterial:NormalHertz +{ + public: + NormalHertzMaterial(); + ~NormalHertzMaterial() {}; void coeffs_to_local(); - void coeffs_to_local(NormalModel*, NormalModel*); + void mix_coeffs(NormalModel*, NormalModel*); + private: + double k_norm; +}; + +/* ---------------------------------------------------------------------- */ + +class NormalDMT:NormalModel +{ + public: + NormalDMT(); + ~NormalDMT() {}; + void coeffs_to_local(); + void mix_coeffs(NormalModel*, NormalModel*); + void set_fncrit(); double calculate_forces(); -private: - double k_norm, damp, Emod, cohesion, poiss; + private: + double k_norm, cohesion; double F_pulloff; }; -class JKR:NormalModel{ -public: - JKR(); - ~JKR(){}; +/* ---------------------------------------------------------------------- */ + +class NormalJKR:NormalModel +{ + public: + NormalJKR(); + ~NormalJKR() {}; void coeffs_to_local(); + void mix_coeffs(NormalModel*, NormalModel*); + void set_fncrit(); double calculate_forces(); -private: - double k_norm, damp, Emod, cohesion, poiss; - double F_pulloff; + void pulloff_distance(double, double); + private: + double k_norm, cohesion; + double Escaled, F_pulloff; }; } diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/GRANULAR/contact_sub_models.cpp index 8802622c78..99fcd638b4 100644 --- a/src/GRANULAR/contact_sub_models.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -29,30 +29,41 @@ namespace Contact{ SubModel::SubModel() { allocated = 0; - material_prop_flag = 0; size_history = 0; history_index = 0; + allow_limit_damping = 1; + beyond_contact = 0; } +/* ---------------------------------------------------------------------- */ + SubModel::~SubModel() { if (allocated) delete [] coeffs; } +/* ---------------------------------------------------------------------- */ + void SubModel::allocate_coeffs() { allocated = 1; coeffs = new double[num_coeffs]; } +/* ---------------------------------------------------------------------- */ + void SubModel::parse_coeffs(char **arg, int iarg) { for (int i = 0; i < num_coeffs; i++) { - coeffs[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); + // A few parameters (eg.g kt for tangential mindlin) allow null + if (strcmp(arg[iarg+i+1], "NULL") == 0) coeffs[i] = -1; + else coeffs[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); } coeffs_to_local(); } +/* ---------------------------------------------------------------------- */ + void SubModel::write_restart(FILE *fp) { fwrite(&model_name.length(),sizeof(int),1,fp); @@ -61,27 +72,61 @@ void SubModel::write_restart(FILE *fp) fwrite(coeffs,sizeof(int),num_coeffs,fp); } +/* ---------------------------------------------------------------------- */ + void SubModel::read_restart(FILE *fp, int num_char) { - if (comm->me == 0){ + if (comm->me == 0) { utils::sfread(FLERR,&num_coeffs,sizeof(int),1,fp,nullptr,error); } MPI_BCast(const_cast(model_name.data()), num_char, MPI_CHAR, world); allocate_coeffs(); } +/* ---------------------------------------------------------------------- */ + void SubModel::read_restart(FILE *fp) { int num_char; - if (me == 0){ + if (me == 0) { utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); } MPI_BCast(&num_char, 1, MPI_INT, 0, world); read_restart(fp, num_char); } +/* ---------------------------------------------------------------------- + mixing of Young's modulus (E) +------------------------------------------------------------------------- */ - - +double SubModel::mix_stiffnessE(double E1, double E2, + double pois1, double pois2) +{ + double factor1 = (1 - pois1 * pois1) / E1; + double factor2 = (1 - pois2 * pois2) / E2; + return 1 / (factor1 + factor2); } +/* ---------------------------------------------------------------------- + mixing of shear modulus (G) +------------------------------------------------------------------------ */ + +double SubModel::mix_stiffnessG(double E1, double E2, + double pois1, double pois2) +{ + double factor1 = 2 * (2 - pois1) * (1 + pois1) / E1; + double factor2 = 2 * (2 - pois2) * (1 + pois2) / E2) + return 1 / (factor1 + factor2); +} + +/* ---------------------------------------------------------------------- + mixing of everything else +------------------------------------------------------------------------- */ + +double SubModel::mix_geom(double val1, double val2) +{ + return sqrt(val1 * val2); +} + + +} \ No newline at end of file diff --git a/src/GRANULAR/contact_sub_models.h b/src/GRANULAR/contact_sub_models.h index 771f0f0890..f659ef1504 100644 --- a/src/GRANULAR/contact_sub_models.h +++ b/src/GRANULAR/contact_sub_models.h @@ -21,7 +21,7 @@ using namespace LAMMPS_NS; namespace Contact{ class SubModel : Pointers{ - SubModel(){}; + SubModel(); virtual ~SubModel(); public: int num_coeffs; @@ -35,13 +35,18 @@ public: void read_restart(FILE*, int); virtual void coeffs_to_local(); void allocate_coeffs(); - std::string model_name; + std::string name; private: ContactModel &contact; int allocated; - int material_prop_flag; int size_history; int history_index; + int beyond_contact; + int allow_limit_damping; + + double mix_stiffnessE(double, double, double, double); + double mix_stiffnessG(double, double, double, double); + double mix_geom(double, double); }; } diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 1ceb940111..9f092aaf29 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -21,188 +21,101 @@ using namespace MathConst; namespace Contact{ -// ************************ -// Default behaviors where needed -// ************************ +/* ---------------------------------------------------------------------- + Linear model with no history +------------------------------------------------------------------------- */ -//----------------------------------------- - -//****************** -// Hooke -//****************** -void LinearNohistory::calculate_forces(){ - contact = c; +TangentialLinearNoHistory::TangentialLinearNoHistory() +{ num_coeffs = 2; - allocate_coeffs(); + size_history = 3; } -void Hooke::coeffs_to_local(){ - k_norm = coeffs[0]; - damp = coeffs[1]; -} - -double Hooke::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = k_norm * contact.area; - return contact.knfac * contact.delta; -} - - -//****************** -// Hertz -//****************** -void Hertz::Hertz(ContactModel &c, int mat_flag){ - contact = c; - material_prop_flag = mat_flag; - if (material_prop_flag){ - num_coeffs = 3; - } - else{ - num_coeffs = 2; - } - allocate_coeffs(); -} - -void Hertz::coeffs_to_local(){ - if (material_prop_flag){ - Emod = coeffs[0]; - poiss = coeffs[1]; - k_norm = 4/3*Emod; - } - else{ - k_norm = coeffs[0]; - } -} - -double Hertz::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - return contact.knfac * contact.delta; -} - -//****************** -// DMT -//****************** -void DMT::DMT(ContactModel &c){ - contact = c; - material_prop_flag = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -double DMT::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - double Fne = contact.knfac * contact.delta; - F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; - Fne -= F_pulloff; - return Fne; -} - -void DMT::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); -} - -//****************** -// JKR -//****************** -void JKR::JKR(ContactModel &c){ - contact = c; - material_prop_flag = 1; - beyond_contact = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -bool JKR::touch(int touch){ - double Escaled, R2, delta_pulloff, dist_pulloff; - bool touchflag; - - Escaled = k_norm * THREEQUARTERS; - if (touch) { - R2 = contact.Reff * contact.Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = contact.radsum - delta_pulloff; - touchflag = (contact.rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rcontact.sq < contact.radsum * contact.radsum); - } - return touchflag; -} - -double JKR::calculate_forces(){ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - - Escaled = k_norm * THREEQUARTERS; - - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; - - knfac = Escaled * a; - return Fne; -} - -void JKR::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); -} - - - - - /* ---------------------------------------------------------------------- */ -void ContactModel::tangential_no_history() +void TangentialLinearNoHistory::coeffs_to_local() { - double gamma_scaled = gamma_tang * damp_normal_prefactor; - double fsmag, Ft; + xt = coeffs[0]; + mu = coeffs[1]; + damp = xt * contact.damping_model.damp; +} + +/* ---------------------------------------------------------------------- */ + +void TangentialLinearNoHistory::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +void TangentialLinearNoHistory::calculate_forces() +{ + double Fscrit, fsmag, Ft; // classic pair gran/hooke (no history) - fsmag = gamma_scaled * vrel; - if (vrel != 0.0) Ft = MIN(Fscrit,fsmag) / vrel; + Fscrit = mu * contact.normal_model.Fncrit + fsmag = damp * contact.vrel; + if (contact.vrel != 0.0) Ft = MIN(Fscrit, fsmag) / contact.vrel; else Ft = 0.0; Ft = -Ft; - scale3(Ft, vtr, fs); + scale3(Ft, contact.vtr, contact.fs); +} + +/* ---------------------------------------------------------------------- + Linear model with history +------------------------------------------------------------------------- */ + +TangentialLinearHistory::TangentialLinearHistory() +{ + num_coeffs = 3; + size_history = 3; } /* ---------------------------------------------------------------------- */ -void ContactModel::tangential_history(double *history) +void TangentialLinearHistory::coeffs_to_local() { - double gamma_scaled = gamma_tang * damp_normal_prefactor; - double k = k_tang; + kt = coeffs[0]; + xt = coeffs[1]; + mu = coeffs[2]; + damp = xt * contact.damping_model.damp; +} + +/* ---------------------------------------------------------------------- */ + +void TangentialLinearHistory::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +void TangentialLinearHistory::calculate_forces() +{ + double Fscrit, magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; int frame_update = 0; - double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + + Fscrit = contact.normal_model.Fncrit * mu; + + double *history = & contact.history[history_index]; // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (history_update) { - rsht = dot3(history, nx); - frame_update = fabs(rsht) * k > EPSILON * Fscrit; + if (contact.history_update) { + rsht = dot3(history, contact.nx); + frame_update = fabs(rsht) * kt > EPSILON * Fscrit; if (frame_update) { shrmag = len3(history); // projection - scale3(rsht, nx, history); + scale3(rsht, contact.nx, history); // also rescale to preserve magnitude prjmag = len3(history); if (prjmag > 0) temp_dbl = shrmag / prjmag; @@ -213,54 +126,94 @@ void ContactModel::tangential_history(double *history) // update history // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = k * dt; - scale3(temp_dbl, vtr, temp_array); + temp_dbl = kt * contact.dt; + scale3(temp_dbl, contact.vtr, temp_array); sub3(history, temp_array, history); } // tangential forces = history + tangential velocity damping - temp_dbl = -gamma_norm; - scale3(temp_dbl, vtr, fs); + temp_dbl = -damp; + scale3(temp_dbl, contact.vtr, contact.fs); // rescale frictional displacements and forces if needed - magfs = len3(fs); + magfs = len3(contact.fs); if (magfs > Fscrit) { shrmag = len3(history); if (shrmag != 0.0) { temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs, history); - scale3(gamma_norm, vtr, temp_array); + scale3(temp_dbl, contact.fs, history); + scale3(damp, contact.vtr, temp_array); add3(history, temp_array, history); temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs); + scale3(temp_dbl, contact.fs); } else { - zero3(fs); + zero3(contact.fs); } } } +/* ---------------------------------------------------------------------- + Mindlin model +------------------------------------------------------------------------- */ + +TangentialMindlin::TangentialMindlin() +{ + num_coeffs = 3; + size_history = 3; + mindlin_force = 0; + mindlin_rescale = 0; +} + /* ---------------------------------------------------------------------- */ -void ContactModel::tangential_mindlin(double *history) +void TangentialMindlin::coeffs_to_local() { - double k_scaled, gamma_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; + kt = coeffs[0]; + xt = coeffs[1]; + mu = coeffs[2]; + + if (ke == -1) + kt = 8.0 * mix_stiffness(contact.normal_model.Emod, contact.normal_model.Emod, + contact.normal_model.poiss, contact.normal_model.poiss); + + damp = xt * contact.damping_model.damp; +} + +/* ---------------------------------------------------------------------- */ + +void TangentialMindlin::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +{ + if (imodel->coeffs[0] == -1 || imodel->coeffs[0] == -1) coeffs[0] = -1; + else coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +void TangentialMindlin::calculate_forces() +{ + double Fscrit, k_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; double temp_array[3]; int frame_update = 0; - gamma_scaled = gamma_tang * damp_normal_prefactor; - k_scaled = k_tang * a; + double *history = & contact.history[history_index]; + Fscrit = contact.normal_model.Fncrit * mu; + + k_scaled = k_tang * contact.area; if (mindlin_rescale) { // on unloading, rescale the shear displacements/force - if (a < history[3]) { - temp_dbl = a / history[3]; + if (contact.area < history[3]) { + temp_dbl = contact.area / history[3]; scale3(temp_dbl, history); } } // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (history_update) { - rsht = dot3(history, nx); + if (contact.history_update) { + rsht = dot3(history, contact.nx); if (mindlin_force) frame_update = fabs(rsht) > EPSILON * Fscrit; else @@ -269,7 +222,7 @@ void ContactModel::tangential_mindlin(double *history) if (frame_update) { shrmag = len3(history); // projection - scale3(rsht, nx, history); + scale3(rsht, contact.nx, history); // also rescale to preserve magnitude prjmag = len3(history); if (prjmag > 0) temp_dbl = shrmag / prjmag; @@ -281,44 +234,78 @@ void ContactModel::tangential_mindlin(double *history) if (mindlin_force) { // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = -k_scaled * dt; - scale3(temp_dbl, vtr, temp_array); + temp_dbl = -k_scaled * contact.dt; + scale3(temp_dbl, contact.vtr, temp_array); } else { - scale3(dt, vtr, temp_array); + scale3(contact.dt, contact.vtr, temp_array); } add3(history, temp_array, history); - if (mindlin_rescale) history[3] = a; + if (mindlin_rescale) history[3] = contact.area; } // tangential forces = history + tangential velocity damping - temp_dbl = -gamma_scaled; - scale3(temp_dbl, vtr, fs); + temp_dbl = -damp; + scale3(temp_dbl, contact.vtr, contact.fs); if (! mindlin_force) { scale3(k_scaled, history, temp_array); - add3(fs, temp_array, fs); + add3(contact.fs, temp_array, contact.fs); } // rescale frictional displacements and forces if needed - magfs = len3(fs); + magfs = len3(contact.fs); if (magfs > Fscrit) { shrmag = len3(history); if (shrmag != 0.0) { temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs, history); - scale3(gamma_tang, vtr, temp_array); + scale3(temp_dbl, contact.fs, history); + scale3(damp, contact.vtr, temp_array); add3(history, temp_array, history); if (! mindlin_force) { - temp_dbl = -1.0 / k_tang; + temp_dbl = -1.0 / k_scaled; scale3(temp_dbl, history); } temp_dbl = Fscrit / magfs; - scale3(temp_dbl, fs); + scale3(temp_dbl, contact.fs); } else { - zero3(fs); + zero3(contact.fs); } } } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Mindlin force model +------------------------------------------------------------------------- */ + +void TangentialMindlinForce::TangentialMindlinForce() +{ + num_coeffs = 3; + size_history = 3; + mindlin_force = 1; + mindlin_rescale = 0; +} + +/* ---------------------------------------------------------------------- + Mindlin rescale model +------------------------------------------------------------------------- */ + +void TangentialMindlinRescale::TangentialMindlinForce() +{ + num_coeffs = 3; + size_history = 4; + mindlin_force = 0; + mindlin_rescale = 1; +} + +/* ---------------------------------------------------------------------- + Mindlin rescale force model +------------------------------------------------------------------------- */ + +void TangentialMindlinRescaleForce::TangentialMindlinForce() +{ + num_coeffs = 3; + size_history = 4; + mindlin_force = 1; + mindlin_rescale = 1; +} diff --git a/src/GRANULAR/contact_tangential_models.h b/src/GRANULAR/contact_tangential_models.h index 207d129e7c..c0a5a727f0 100644 --- a/src/GRANULAR/contact_tangential_models.h +++ b/src/GRANULAR/contact_tangential_models.h @@ -19,59 +19,82 @@ namespace Contact { -class TangentialModel:SubModel{ +class TangentialModel:SubModel +{ public: - TangentialModel(){}; - virtual ~TangentialModel(){}; + TangentialModel() {}; + virtual ~TangentialModel() {}; virtual double calculate_forces() = 0; virtual void coeffs_to_local(); - virtual void mix_coeffs(TangentialModel*, TangentialModel*); //When mixing is needed - int rescale_flag = 0; + virtual void mix_coeffs(TangentialModel*, TangentialModel*); + int rescale_flag; private: - int beyond_contact = 0; - int allow_limit_damping = 1; - + int beyond_contact; + int allow_limit_damping; }; -class LinearNohistory:TangentialModel{ +/* ---------------------------------------------------------------------- */ + +class TangentialLinearNoHistory:TangentialModel +{ public: + TangentialLinearNoHistory() + virtual void coeffs_to_local(); + virtual void mix_coeffs(TangentialModel*, TangentialModel*); double calculate_forces(); private: - void allocate_coeffs(); - double k_t, damp; + double xt, damp, mu; }; -class LinearHistory:TangentialModel{ +/* ---------------------------------------------------------------------- */ + +class TangentialLinearHistory:TangentialModel +{ public: - LinearHistory(){} - ~LinearHistory(){}; - void coeffs_to_local(); + TangentialLinearHistory() + virtual void coeffs_to_local(); + virtual void mix_coeffs(TangentialModel*, TangentialModel*); double calculate_forces(); private: - double k_norm, damp, Emod, poiss; + double kt, xt, damp, mu; }; -class Mindlin:TangentialModel{ +/* ---------------------------------------------------------------------- */ + +class TangentialMindlin:TangentialModel +{ public: - Mindlin(int); - ~Mindlin(){}; + TangentialMindlin(); void coeffs_to_local(); void coeffs_to_local(TangentialModel*, TangentialModel*); double calculate_forces(); private: - double k_norm, damp, Emod, poiss, coh; + int mindlin_rescale, mindlin_force; }; -class MindlinForce:TangentialModel{ -public: - JKR(ContactModel &c); - ~JKR(){}; - void coeffs_to_local(); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; +/* ---------------------------------------------------------------------- */ +class TangentialMindlinForce:TangentialMindlin +{ +public: + TangentialMindlinForce(); +}; + +/* ---------------------------------------------------------------------- */ + +class TangentialMindlinRescale:TangentialMindlin +{ +public: + TangentialMindlinRescale(); +}; + +/* ---------------------------------------------------------------------- */ + +class TangentialMindlinRescaleForce:TangentialMindlinRescale +{ +public: + TangentialMindlinForceRescale(); }; } diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 7378df2f77..5816850ef2 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -376,7 +376,19 @@ void PairGranular::coeff(int narg, char **arg) //Parse optional arguments while (iarg < narg) { - if (strcmp(arg[iarg], "rolling") == 0) { + if (strcmp(arg[iarg], "damping") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + vec_models.back().init(arg[iarg], Contact::DAMPING); + ncoeff = vec_models.back().damping_model.num_coeffs; + iarg += 1; + if (iarg + ncoeff >= narg) + error->all(FLERR, "Illegal pair_coeff command" + "Insufficient arguments provided for damping model."); + vec_models.back().damping_model.parse_coeffs(arg, iarg); + iarg += ncoeff; + + } else if (strcmp(arg[iarg], "rolling") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); vec_models.back().init(arg[iarg], Contact::ROLLING); @@ -409,7 +421,6 @@ void PairGranular::coeff(int narg, char **arg) if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" "Insufficient arguments provided for heat model."); - ncoeff = vec_models.back().heat_model.num_coeffs; vec_models.back().heat_model.parse_coeffs(arg, iarg); iarg += ncoeff; heat_flag = 1; @@ -427,6 +438,12 @@ void PairGranular::coeff(int narg, char **arg) } else error->all(FLERR, "Illegal pair_coeff command"); } + // Define default damping model if unspecified, takes no args + if (!vec_models.back().damping_model) { + vec_models.back().init("viscoelastic", Contact::DAMPING); + vec_models.back().damping_model.parse_coeffs(arg, 0); + } + if (vec_models.back().limit_damping && !vec_models.back().normal_model->allow_limit_damping) error->all(FLERR,"Illegal pair_coeff command, " "Cannot limit damping with specified normal contact model"); @@ -584,11 +601,11 @@ double PairGranular::init_one(int i, int j) double cutoff = 0.0; if (setflag[i][j] == 0) { - if ((models[i][i]->normal_model != models[j][j]->normal_model) || - (models[i][i]->damping_model != models[j][j]->damping_model) || - (models[i][i]->tangential_model != models[j][j]->tangential_model) || - (models[i][i]->roll_model != models[j][j]->roll_model) || - (models[i][i]->twist_model != models[j][j]->twist_model)) { + if ((models[i][i]->normal_model.name != models[j][j]->normal_model.name) || + (models[i][i]->damping_model.name != models[j][j]->damping_model.name) || + (models[i][i]->tangential_model.name != models[j][j]->tangential_model.name) || + (models[i][i]->rolling_model.name != models[j][j]->rolling_model.name) || + (models[i][i]->twisting_model.name != models[j][j]->twisting_model.name)) { error->all(FLERR,"Granular pair style functional forms are different, " "cannot mix coefficients for types {} and {}. \n" "This combination must be set explicitly via a " @@ -597,6 +614,13 @@ double PairGranular::init_one(int i, int j) vec_models.push_back(ContactModel()); models[i][j] = models[j][i] = & vec_models.back(); + vec_models.back().init(models[i][i]->normal_model.name, Contact::NORMAL); + vec_models.back().init(models[i][i]->tangential_model.name, Contact::TANGENTIAL); + vec_models.back().init(models[i][i]->damping_model.name, Contact::DAMPING); + vec_models.back().init(models[i][i]->rolling_model.name, Contact::ROLLING); + vec_models.back().init(models[i][i]->twisting_model.name, Contact::TWISTING); + vec_models.back().init(models[i][i]->heat_model.name, Contact::HEAT); + vec_models.back().mix_coeffs(models[i][i], models[j][j]); } @@ -802,6 +826,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, torquesj = models[itype][jtype]->torquesj; // apply forces & torques + fforce = MathExtra::len3(forces); // set single_extra quantities @@ -863,35 +888,6 @@ double PairGranular::memory_usage() return bytes; } -/* ---------------------------------------------------------------------- - mixing of Young's modulus (E) -------------------------------------------------------------------------- */ - -double PairGranular::mix_stiffnessE(double Eii, double Ejj, - double poisii, double poisjj) -{ - return 1/((1-poisii*poisii)/Eii+(1-poisjj*poisjj)/Ejj); -} - -/* ---------------------------------------------------------------------- - mixing of shear modulus (G) ------------------------------------------------------------------------- */ - -double PairGranular::mix_stiffnessG(double Eii, double Ejj, - double poisii, double poisjj) -{ - return 1/((2*(2-poisii)*(1+poisii)/Eii) + (2*(2-poisjj)*(1+poisjj)/Ejj)); -} - -/* ---------------------------------------------------------------------- - mixing of everything else -------------------------------------------------------------------------- */ - -double PairGranular::mix_geom(double valii, double valjj) -{ - return sqrt(valii*valjj); -} - /* ---------------------------------------------------------------------- transfer history during fix/neigh/history exchange only needed if any history entries i-j are not just negative of j-i entries diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 503e3ed938..e018f9fe7c 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -88,10 +88,6 @@ class PairGranular : public Pair { // optional user-specified global cutoff, per-type user-specified cutoffs double **cutoff_type; double cutoff_global; - - double mix_stiffnessE(double, double, double, double); - double mix_stiffnessG(double, double, double, double); - double mix_geom(double, double); }; } // namespace LAMMPS_NS From 22de863da999a45f7fd3d16c270dedf5337a2665 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 1 Aug 2022 13:12:44 -0600 Subject: [PATCH 014/112] Fixing compilation errors and finishing model classes --- src/GRANULAR/contact.cpp | 209 ++++++++++------ src/GRANULAR/contact.h | 61 +++-- src/GRANULAR/contact_damping_models.cpp | 40 ++-- src/GRANULAR/contact_damping_models.h | 40 ++-- src/GRANULAR/contact_heat_models.cpp | 184 ++------------ src/GRANULAR/contact_heat_models.h | 83 ++----- src/GRANULAR/contact_normal_models.cpp | 184 ++++++++------ src/GRANULAR/contact_normal_models.h | 68 +++--- src/GRANULAR/contact_rolling_models.cpp | 236 +++++------------- src/GRANULAR/contact_rolling_models.h | 79 ++---- src/GRANULAR/contact_sub_models.cpp | 55 +---- src/GRANULAR/contact_sub_models.h | 42 ++-- src/GRANULAR/contact_tangential_models.cpp | 130 +++++----- src/GRANULAR/contact_tangential_models.h | 92 ++++--- src/GRANULAR/contact_twisting_models.cpp | 265 ++++++--------------- src/GRANULAR/contact_twisting_models.h | 81 ++----- src/GRANULAR/pair_granular.cpp | 169 +++++++------ src/GRANULAR/pair_granular.h | 6 +- src/contact.h | 129 +++++----- src/fix_neigh_history.cpp | 6 +- src/pair.h | 2 +- 21 files changed, 903 insertions(+), 1258 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 12a9476585..4358f6df1c 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -18,99 +18,140 @@ */ #include "contact.h" +#include "pointers.h" #include "math_const.h" #include "math_extra.h" -#include "pointers.h" +#include "contact_sub_models.h" +#include "contact_normal_models.h" +#include "contact_tangential_models.h" +#include "contact_damping_models.h" +#include "contact_rolling_models.h" +#include "contact_twisting_models.h" +#include "contact_heat_models.h" #include "comm.h" #include "error.h" #include -using namespace LAMMPS_NS; using namespace MathExtra; -using namespace MathConst; +using namespace LAMMPS_NS::MathConst; +using namespace LAMMPS_NS::Contact; -namespace Contact { - -enum {NORMAL, TANGENTIAL, DAMPING, ROLLING, TWISTING, HEAT} - -ContactModel::ContactModel() +ContactModel::ContactModel() : + Pointers(lmp) { limit_damping = 0; beyond_contact = 0; + nondefault_history_transfer = 0; cutoff_type = 0.0; - normal_model = nullptr; - tangential_model = nullptr; - damping_model = nullptr; - rolling_model = nullptr; - twisting_model = nullptr; + nmodels = 5; + reset_contact(); - sub_models = {nullptr}; + for (int i = 0; i < nmodels; i++) sub_models[i] = nullptr; } /* ---------------------------------------------------------------------- */ -void ContactModel::init_model(char *model_name, int model_type) +ContactModel::~ContactModel() +{ + delete[] transfer_history_factor; +} + +/* ---------------------------------------------------------------------- */ + +void ContactModel::init_model(std::string model_name, ModelType model_type) { if (model_type == NORMAL) { - if (strcmp(model_name, "hooke") == 0) normal_model = new NormalHooke(); - else if (strcmp(model_name, "hertz") == 0) normal_model = new NormalHertz(); - else if (strcmp(model_name, "hertz/material") == 0) normal_model = new NormalHertzMaterial(); - else if (strcmp(model_name, "dmt") == 0) normal_model = new NormalDMT(); - else if (strcmp(model_name, "jkr") == 0) normal_model = new NormalJKR(); + if (model_name == "hooke") normal_model = new NormalHooke(); + else if (model_name == "hertz") normal_model = new NormalHertz(); + else if (model_name == "hertz/material") normal_model = new NormalHertzMaterial(); + else if (model_name == "dmt") normal_model = new NormalDMT(); + else if (model_name == "jkr") normal_model = new NormalJKR(); else error->all(FLERR, "Normal model name not recognized"); - sub_models[model_type] = &normal_model; + sub_models[model_type] = normal_model; } else if (model_type == TANGENTIAL) { - if (strcmp(model_name, "linear_nohistory") == 0) tangential_model = new TangentialLinearNoHistory(); - else if (strcmp(model_name, "linear_history") == 0) tangential_model = new TangentialLinearHistory(); - else if (strcmp(model_name, "mindlin") == 0) tangential_model = new TangentialMindlin(); - else if (strcmp(model_name, "mindlin/force") == 0) tangential_model = new TangentialMindlinForce(); - else if (strcmp(model_name, "mindlin_rescale") == 0) tangential_model = new TangentialMindlinRescale(); - else if (strcmp(model_name, "mindlin_rescale/force") == 0) tangential_model = new TangentialMindlinRescaleForce(); + if (model_name =="linear_nohistory") tangential_model = new TangentialLinearNoHistory(); + else if (model_name =="linear_history") tangential_model = new TangentialLinearHistory(); + else if (model_name =="mindlin") tangential_model = new TangentialMindlin(); + else if (model_name =="mindlin/force") tangential_model = new TangentialMindlinForce(); + else if (model_name =="mindlin_rescale") tangential_model = new TangentialMindlinRescale(); + else if (model_name =="mindlin_rescale/force") tangential_model = new TangentialMindlinRescaleForce(); else error->all(FLERR, "Tangential model name not recognized"); - sub_models[model_type] = &tangential_model; + sub_models[model_type] = tangential_model; } else if (model_type == DAMPING) { - if (strcmp(model_name, "velocity") == 0) damping_model = new DampingVelocity(); - else if (strcmp(model_name, "mass_velocity") == 0) damping_model = new DampingMassVelocity(); - else if (strcmp(model_name, "viscoelastic") == 0) damping_model = new DampingViscoelastic(); - else if (strcmp(model_name, "tsuji") == 0) damping_model = new DampingTsuji(); + if (model_name =="velocity") damping_model = new DampingVelocity(); + else if (model_name =="mass_velocity") damping_model = new DampingMassVelocity(); + else if (model_name =="viscoelastic") damping_model = new DampingViscoelastic(); + else if (model_name =="tsuji") damping_model = new DampingTsuji(); else error->all(FLERR, "Damping model name not recognized"); - sub_models[model_type] = &damping_model; + sub_models[model_type] = damping_model; } else if (model_type == ROLLING) { - if (strcmp(model_name, "none") == 0) delete rolling_model; - else if (strcmp(model_name, "sds") == 0) rolling_model = new RollingSDS(); + if (model_name =="none") delete rolling_model; + else if (model_name =="sds") rolling_model = new RollingSDS(); else error->all(FLERR, "Rolling model name not recognized"); - sub_models[model_type] = &rolling_model; + sub_models[model_type] = rolling_model; } else if (model_type == TWISTING) { - if (strcmp(model_name, "none") == 0) delete twisting_model; - else if (strcmp(model_name, "sds") == 0) twisting_model = new TwistingSDS(); - else if (strcmp(model_name, "marshall") == 0) twisting_model = new TwistingMarshall(); + if (model_name =="none") delete twisting_model; + else if (model_name =="sds") twisting_model = new TwistingSDS(); + else if (model_name =="marshall") twisting_model = new TwistingMarshall(); else error->all(FLERR, "Twisting model name not recognized"); - sub_models[model_type] = &twisting_model; + sub_models[model_type] = twisting_model; } else if (model_type == HEAT) { - if (strcmp(model_name, "none") == 0) delete heat_model; - else if (strcmp(model_name, "area") == 0) heat_model = new HeatArea(); + if (model_name =="none") delete heat_model; + else if (model_name =="area") heat_model = new HeatArea(); else error->all(FLERR, "Heat model name not recognized"); - sub_models[model_type] = &heat_model; + sub_models[model_type] = heat_model; } sub_models[model_type]->name.assign(model_name); - sub_models[model_type]->contact = *this; + sub_models[model_type]->contact = this; sub_models[model_type]->allocate_coeffs(); } /* ---------------------------------------------------------------------- */ +void ContactModel::init() +{ + int i, j, size_cumulative; + for (i = 0; i < nmodels; i++) { + if (sub_models[i]->nondefault_history_transfer) + nondefault_history_transfer = 1; + if (sub_models[i]->beyond_contact) + beyond_contact = 1; + } + + transfer_history_factor = new double(size_history); + for (i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; + + if (nondefault_history_transfer) { + for (i = 0; i < size_history; i++) { + // Find which model controls this history value + size_cumulative = 0; + for (j = 0; j < nmodels; j++) { + if (size_cumulative + sub_models[j]->size_history > i) break; + size_cumulative += sub_models[j]->size_history; + } + + // Check if model has nondefault transfers, if so copy its array + if (sub_models[j]->nondefault_history_transfer) { + transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + void ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) { - for (int i = 0; i < 5; i++) - sum_model[i]->mix_coeffs(c1->submodel[i], c2->submodel[i]); + for (int i = 0; i < nmodels; i++) + sub_models[i]->mix_coeffs(c1->sub_models[i], c2->sub_models[i]); limit_damping = MAX(c1->limit_damping, c2->limit_damping); cutoff_type = MAX(c1->cutoff_type, c2->cutoff_type); @@ -120,11 +161,17 @@ void ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) void ContactModel::write_restart(FILE *fp) { - int num_char = -1; + int num_char, num_coeffs; - for (int i = 0; i < 5; i++) { + for (int i = 0; i < nmodels; i++) { + num_char = -1; if (sub_models[i]) { - sub_models[i]->write_restart(fp); + num_char = sub_models[i]->name.length(); + num_coeffs = sub_models[i]->num_coeffs; + fwrite(&num_char, sizeof(int), 1, fp); + fwrite(sub_models[i]->name.data(), sizeof(char), num_char, fp); + fwrite(&num_coeffs, sizeof(int), 1, fp); + fwrite(sub_models[i]->coeffs, sizeof(int), num_coeffs, fp); } else { fwrite(&num_char, sizeof(int), 1, fp); } @@ -135,21 +182,34 @@ void ContactModel::write_restart(FILE *fp) void ContactModel::read_restart(FILE *fp) { - int num_char; + int num_char, num_coeff; - for (int i = 0; i < 5; i++) { + for (int i = 0; i < nmodels; i++) { if (comm->me == 0) - utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); - MPI_BCast(&num_char, 1, MPI_INT, 0, world); + utils::sfread(FLERR, &num_char, sizeof(int), 1, fp, nullptr, error); + MPI_Bcast(&num_char, 1, MPI_INT, 0, world); if (num_char != -1) { - std::string model_name(num_char); + std::string model_name (num_char, ' '); if (comm->me == 0) - utils::sfread(FLERR,const_cast(model_name.data()),sizeof(char),num_char,fp,nullptr, error); - MPI_BCast(const_cast(model_name.data()), num_char, MPI_CHAR, world); + utils::sfread(FLERR, const_cast(model_name.data()), sizeof(char),num_char, fp, nullptr, error); + MPI_Bcast(const_cast(model_name.data()), num_char, MPI_CHAR, 0, world); - init_model(const_cast(model_name.data(), i)); - sub_models[i]->read_restart(); + init_model(model_name, (ModelType) i); + + if (comm->me == 0) { + utils::sfread(FLERR, &num_coeff, sizeof(int), 1, fp, nullptr, error); + if (num_coeff != sub_models[i]->num_coeffs) + error->one(FLERR, "Invalid contact model written to restart file"); + } + MPI_Bcast(&num_coeff, 1, MPI_INT, 0, world); + + if (comm->me == 0) { + utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(int), num_coeff, fp, nullptr, error); + } + MPI_Bcast(sub_models[i]->coeffs, num_coeff, MPI_DOUBLE, 0, world); + + sub_models[i]->coeffs_to_local(); } } } @@ -158,7 +218,7 @@ void ContactModel::read_restart(FILE *fp) void ContactModel::reset_contact() { - radi = radj = Fntot = Fncrit = magtortwist = 0.0; + radi = radj = Fntot = magtortwist = 0.0; xi = xj = vi = vj = omegai = omegaj = nullptr; forces = torquesi = torquesj = history = nullptr; @@ -177,10 +237,7 @@ bool ContactModel::check_contact() radsum = radi + radj; Reff = radi * radj / radsum; - touch = false; - if (normal_model.beyond_contact) normal_model.touch(touch); - else touch = (rsq < radsum*radsum); - + touch = normal_model->touch(); return touch; } @@ -220,7 +277,7 @@ void ContactModel::prep_contact() sub3(vt, temp, vtr); vrel = len3(vtr); - if (roll_model || twist_model) + if (rolling_model || twisting_model) sub3(omegai, omegaj, relrot); if (rolling_model) { @@ -250,20 +307,24 @@ void ContactModel::calculate_forces() } //********************************************** - // normal forces + // calculate forces //********************************************** double Fne, Fdamp; - Fne = normal_model.calculate_forces(); - Fdamp = damping_model.calculate_forces(); + area = normal_model->calculate_area(); + Fne = normal_model->calculate_forces(); + normal_model->set_knfac(); // Needed for damping + + Fdamp = damping_model->calculate_forces(); + + normal_model->set_fncrit(); // Needed for tangential, rolling, twisting Fntot = Fne + Fdamp; if (limit_damping && Fntot < 0.0) Fntot = 0.0; - normal_model.set_fncrit(); - tangential_model.calculate_forces(); - if (rolling_model) rolling_model.calculate_forces(); - if (twisting_model) twisting_model.calculate_forces(); + tangential_model->calculate_forces(); + if (rolling_model) rolling_model->calculate_forces(); + if (twisting_model) twisting_model->calculate_forces(); //********************************************** // sum contributions @@ -301,7 +362,7 @@ void ContactModel::calculate_forces() double ContactModel::calculate_heat() { - return heat_model.calculate_heat(); + return heat_model->calculate_heat(); } /* ---------------------------------------------------------------------- @@ -311,7 +372,5 @@ double ContactModel::calculate_heat() double ContactModel::pulloff_distance(double radi, double radj) { - return normal_model.pulloff_distance(radi, radj); -} - + return normal_model->pulloff_distance(radi, radj); } diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index f9f18a1eb4..96758771b4 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -14,32 +14,44 @@ #ifndef LMP_CONTACT_H #define LMP_CONTACT_H -#include "pointers.h" -#include "normal_contact_models.h" -#include "tangential_contact_models.h" -#include "damping_contact_models.h" -#include "rolling_contact_models.h" -#include "twisting_contact_models.h" -#include "heat_models.h" - -using namespace LAMMPS_NS; +#include "pointers.h" // IWYU pragma: export +namespace LAMMPS_NS { namespace Contact { +enum ModelType { + NORMAL = 0, + DAMPING = 1, + TANGENTIAL = 2, + ROLLING = 3, + TWISTING = 4, + HEAT = 5 +}; + #define EPSILON 1e-10 +// forward declaration +class NormalModel; +class DampingModel; +class TangentialModel; +class RollingModel; +class TwistingModel; +class HeatModel; +class SubModel; + class ContactModel : protected Pointers { -public: + public: ContactModel(); ~ContactModel(); - int init(); + void init(); bool check_contact(); void reset_contact(); + void prep_contact(); void calculate_forces(); double calculate_heat(); double pulloff_distance(double, double); - void init_model(char*, int); + void init_model(std::string, ModelType); void mix_coeffs(ContactModel*, ContactModel*); @@ -47,21 +59,25 @@ public: void read_restart(FILE *); // Sub models - NormalModel normal_model; - DampingModel damping_model; - TangentialModel tangential_model; - RollingModel rolling_model; - TwistingModel twisting_model; - HeatModel heat_model; + NormalModel *normal_model; + DampingModel *damping_model; + TangentialModel *tangential_model; + RollingModel *rolling_model; + TwistingModel *twisting_model; + HeatModel *heat_model; SubModel *sub_models[6]; // Need to resize if we add more model flavors // Extra options - int beyond_contact, limit_damping; + int beyond_contact, limit_damping, history_update; double cutoff_type; + // History variables + int size_history, nondefault_history_transfer; + double *transfer_history_factor; + double *history; + // Contact properties/output double *forces, *torquesi, *torquesj; - double *history; double radi, radj, meff, dt, Ti, Tj, area; double Fntot, magtortwist; @@ -69,15 +85,18 @@ public: double *xi, *xj, *vi, *vj, *omegai, *omegaj; double fs[3], fr[3], ft[3]; -private: double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; double magtwist; bool touch; + protected: + int prep_flag, check_flag; + int nmodels; }; } // namespace Contact +} // namespace LAMMPS_NS #endif diff --git a/src/GRANULAR/contact_damping_models.cpp b/src/GRANULAR/contact_damping_models.cpp index 1e233234b2..7a79c6946c 100644 --- a/src/GRANULAR/contact_damping_models.cpp +++ b/src/GRANULAR/contact_damping_models.cpp @@ -11,33 +11,22 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "damping_contact_models.h" -#include "math_const.h" +#include "contact_damping_models.h" +#include "contact_normal_models.h" #include "contact.h" - -#include #include "math_special.h" -using namespace MathConst; +using namespace LAMMPS_NS; +using namespace Contact; using namespace MathSpecial; -namespace Contact{ - - /* ---------------------------------------------------------------------- Default damping model ------------------------------------------------------------------------- */ -void DampingModel::DampingModel() -{ - num_coeffs = 0; -} - -/* ---------------------------------------------------------------------- */ - void DampingModel::coeffs_to_local() { - damp = contact.normal_model.damp; + damp = contact->normal_model->damp; } /* ---------------------------------------------------------------------- @@ -46,34 +35,34 @@ void DampingModel::coeffs_to_local() double DampingVelocity::calculate_forces() { - return -damp * contact.vnnr; + return -damp * contact->vnnr; } /* ---------------------------------------------------------------------- Mass velocity damping ------------------------------------------------------------------------- */ -double MassVelocity::calculate_forces() +double DampingMassVelocity::calculate_forces() { - return -damp * contact.meff * contact.vnnr; + return -damp * contact->meff * contact->vnnr; } /* ---------------------------------------------------------------------- Default, viscoelastic damping ------------------------------------------------------------------------- */ -double ViscoElastic::calculate_forces() +double DampingViscoelastic::calculate_forces() { - return -damp * contact.meff * contact.area * contact.vnnr; + return -damp * contact->meff * contact->area * contact->vnnr; } /* ---------------------------------------------------------------------- Tsuji damping ------------------------------------------------------------------------- */ -void Tsuji::coeffs_to_local() +void DampingTsuji::coeffs_to_local() { - double tmp = contact.normal_model.damp; + double tmp = contact->normal_model->damp; damp = 1.2728 - 4.2783 * tmp + 11.087 * square(tmp); damp += -22.348 * cube(tmp)+ 27.467 * powint(tmp, 4); damp += -18.022 * powint(tmp, 5) + 4.8218 * powint(tmp,6); @@ -81,8 +70,7 @@ void Tsuji::coeffs_to_local() /* ---------------------------------------------------------------------- */ -double Tsuji::calculate_forces() +double DampingTsuji::calculate_forces() { - return -damp_scaled * sqrt(contact.meff * contact.normal_model.knfac) * contact.vnnr; + return -damp * sqrt(contact->meff * contact->normal_model->knfac) * contact->vnnr; } - diff --git a/src/GRANULAR/contact_damping_models.h b/src/GRANULAR/contact_damping_models.h index 0fc4fd2c17..440ab36369 100644 --- a/src/GRANULAR/contact_damping_models.h +++ b/src/GRANULAR/contact_damping_models.h @@ -11,60 +11,54 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef DAMPING_CONTACT_MODELS_H_ -#define DAMPING_CONTACT_MODELS_H_ +#ifndef CONTACT_DAMPING_MODELS_H_ +#define CONTACT_DAMPING_MODELS_H_ -#include "contact.h"; -#include "sub_model.h" +#include "contact_sub_models.h" +namespace LAMMPS_NS { namespace Contact { -class DampingModel:SubModel -{ +class DampingModel : public SubModel { public: - DampingModel(); - virtual ~DampingModel() {}; - virtual double calculate_forces() = 0; + DampingModel() {}; + ~DampingModel() {}; virtual void coeffs_to_local(); - virtual void mix_coeffs(NormalModel*, NormalModel*); + virtual void mix_coeffs(DampingModel*, DampingModel*) {}; + virtual double calculate_forces() = 0; double damp; }; /* ---------------------------------------------------------------------- */ -class DampingVelocity:DampingModel -{ +class DampingVelocity: public DampingModel { public: double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class DampingMassVelocity:DampingModel -{ +class DampingMassVelocity: public DampingModel { public: double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class DampingViscoElastic:DampingModel -{ +class DampingViscoelastic: public DampingModel { public: double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class DampingTsuji:DampingModel -{ +class DampingTsuji: public DampingModel { public: - double calculate_forces(); void coeffs_to_local(); + double calculate_forces(); }; +} // namespace Contact +} // namespace LAMMPS_NS -} - -#endif /*DAMPING_CONTACT_MODELS_H_ */ - +#endif /*CONTACT_DAMPING_MODELS_H_ */ diff --git a/src/GRANULAR/contact_heat_models.cpp b/src/GRANULAR/contact_heat_models.cpp index e6bafe4b3c..29134b3e73 100644 --- a/src/GRANULAR/contact_heat_models.cpp +++ b/src/GRANULAR/contact_heat_models.cpp @@ -11,175 +11,39 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "normal_contact_models.h" -#include "math_const.h" +#include "contact_heat_models.h" #include "contact.h" -#include +using namespace LAMMPS_NS; +using namespace Contact; -using namespace MathConst; +/* ---------------------------------------------------------------------- + Area-based heat conduction +------------------------------------------------------------------------- */ -namespace Contact{ - -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define ONETHIRD (1.0/3.0) // 1/3 -#define THREEQUARTERS 0.75 // 3/4 - -// ************************ -// Default behaviors where needed -// ************************ -void NormalModel::set_fncrit(){ - contact->Fncrit = fabs(contact->Fntot); +HeatArea::HeatArea() +{ + num_coeffs = 1; } -void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ - for (int i = 0; i < num_coeffs; i++){ - coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); - } +/* ---------------------------------------------------------------------- */ + +void HeatArea::coeffs_to_local() +{ + conductivity = coeffs[0]; } -//----------------------------------------- +/* ---------------------------------------------------------------------- */ -//****************** -// Hooke -//****************** -void Hooke::Hooke(ContactModel &c){ - contact = c; - num_coeffs = 2; - allocate_coeffs(); +void HeatArea::mix_coeffs(HeatModel* imodel, HeatModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs_to_local(); } -void Hooke::coeffs_to_local(){ - k_norm = coeffs[0]; - damp = coeffs[1]; +/* ---------------------------------------------------------------------- */ + +double HeatArea::calculate_heat() +{ + return conductivity * contact->area * (contact->Ti - contact->Tj); } - -double Hooke::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = k_norm * contact.area; - return contact.knfac * contact.delta; -} - - -//****************** -// Hertz -//****************** -void Hertz::Hertz(ContactModel &c, int mat_flag){ - contact = c; - material_prop_flag = mat_flag; - if (material_prop_flag){ - num_coeffs = 3; - } - else{ - num_coeffs = 2; - } - allocate_coeffs(); -} - -void Hertz::coeffs_to_local(){ - if (material_prop_flag){ - Emod = coeffs[0]; - poiss = coeffs[1]; - k_norm = 4/3*Emod; - } - else{ - k_norm = coeffs[0]; - } -} - -double Hertz::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - return contact.knfac * contact.delta; -} - -//****************** -// DMT -//****************** -void DMT::DMT(ContactModel &c){ - contact = c; - material_prop_flag = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -double DMT::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - double Fne = contact.knfac * contact.delta; - F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; - Fne -= F_pulloff; - return Fne; -} - -void DMT::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); -} - -//****************** -// JKR -//****************** -void JKR::JKR(ContactModel &c){ - contact = c; - material_prop_flag = 1; - beyond_contact = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -bool JKR::touch(int touch){ - double Escaled, R2, delta_pulloff, dist_pulloff; - bool touchflag; - - Escaled = k_norm * THREEQUARTERS; - if (touch) { - R2 = contact.Reff * contact.Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = contact.radsum - delta_pulloff; - touchflag = (contact.rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rcontact.sq < contact.radsum * contact.radsum); - } - return touchflag; -} - -double JKR::calculate_forces(){ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - - Escaled = k_norm * THREEQUARTERS; - - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; - - knfac = Escaled * a; - return Fne; -} - -void JKR::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); -} - - - diff --git a/src/GRANULAR/contact_heat_models.h b/src/GRANULAR/contact_heat_models.h index 1a2f1ddb7d..469a53cb13 100644 --- a/src/GRANULAR/contact_heat_models.h +++ b/src/GRANULAR/contact_heat_models.h @@ -11,73 +11,36 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef NORMAL_CONTACT_MODELS_H_ -#define NORMAL_CONTACT_MODELS_H_ +#ifndef CONTACT_HEAT_MODELS_H_ +#define CONTACT_HEAT_MODELS_H_ -#include "contact.h"; -#include "sub_model.h" +#include "contact_sub_models.h" +namespace LAMMPS_NS { namespace Contact { -class NormalModel:SubModel{ -public: - NormalModel(){}; - virtual ~NormalModel(){}; - virtual bool check_contact(); - virtual void prep_contact(); - virtual void set_fncrit(); - virtual double calculate_forces() = 0; - virtual void coeffs_to_local(); - virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed - -private: - int beyond_contact = 0; - int allow_limit_damping = 1; - +class HeatModel : public SubModel { + public: + HeatModel() {}; + ~HeatModel() {}; + virtual void coeffs_to_local() {}; + virtual void mix_coeffs(HeatModel*, HeatModel*) {}; + virtual double calculate_heat() = 0; }; -class Hooke:NormalModel{ -public: - Hooke(ContactModel &c); - ~Hooke(){}; +/* ---------------------------------------------------------------------- */ + +class HeatArea: public HeatModel { + public: + HeatArea(); void coeffs_to_local(); - double calculate_forces(); -private: - double k_norm, damp; + void mix_coeffs(HeatModel*, HeatModel*); + double calculate_heat(); + private: + double conductivity; }; -class Hertz:NormalModel{ -public: - Hertz(ContactModel&, int); - ~Hertz(){}; - void coeffs_to_local(); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss; -}; - -class DMT:NormalModel{ -public: - DMT(ContactModel &c); - ~DMT(){}; - void coeffs_to_local(); - void coeffs_to_local(NormalModel*, NormalModel*); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; -}; - -class JKR:NormalModel{ -public: - JKR(ContactModel &c); - ~JKR(){}; - void coeffs_to_local(); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; - -}; -} - -#endif /*NORMAL_CONTACT_MODELS_H_ */ +} // namespace Contact +} // namespace LAMMPS_NS +#endif /*CONTACT_HEAT_MODELS_H_ */ diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index 9b1d85d123..c11fddb1d7 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -12,15 +12,13 @@ ------------------------------------------------------------------------- */ #include "contact_normal_models.h" -#include "math_const.h" #include "contact.h" +#include "math_const.h" -#include - +using namespace LAMMPS_NS; +using namespace Contact; using namespace MathConst; -namespace Contact{ - #define PI27SQ 266.47931882941264802866 // 27*PI**2 #define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) #define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) @@ -40,23 +38,40 @@ NormalModel::NormalModel() /* ---------------------------------------------------------------------- */ -void NormalModel::set_fncrit() +bool NormalModel::touch() { - Fncrit = fabs(contact.Fntot); + bool touchflag = (contact->rsq < contact->radsum * contact->radsum); + return touchflag; +} + +/* ---------------------------------------------------------------------- + called outside of compute(), do not assume geometry defined in contact +------------------------------------------------------------------------- */ + +double NormalModel::pulloff_distance(double radi, double radj) +{ + return radi + radj; } /* ---------------------------------------------------------------------- */ -void NormalModel::pulloff_distance(double radi, double radj) +double NormalModel::calculate_area() { - return radi + radj; + return sqrt(contact->dR); +} + +/* ---------------------------------------------------------------------- */ + +void NormalModel::set_fncrit() +{ + Fncrit = fabs(contact->Fntot); } /* ---------------------------------------------------------------------- Hookean normal force ------------------------------------------------------------------------- */ -void NormalHooke::NormalHooke() +NormalHooke::NormalHooke() { num_coeffs = 2; allocate_coeffs(); @@ -66,7 +81,7 @@ void NormalHooke::NormalHooke() void NormalHooke::coeffs_to_local() { - k_norm = coeffs[0]; + k = coeffs[0]; damp = coeffs[1]; } @@ -83,17 +98,22 @@ void NormalHooke::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) double NormalHooke::calculate_forces() { - contact.area = sqrt(contact.dR); - knfac = k_norm * contact.area; - Fne = knfac * contact.delta; + Fne = knfac * contact->delta; return Fne; } +/* ---------------------------------------------------------------------- */ + +void NormalHooke::set_knfac() +{ + knfac = k * contact->area; +} + /* ---------------------------------------------------------------------- Hertzian normal force ------------------------------------------------------------------------- */ -void NormalHertz::NormalHertz() +NormalHertz::NormalHertz() { num_coeffs = 2; } @@ -102,7 +122,7 @@ void NormalHertz::NormalHertz() void NormalHertz::coeffs_to_local() { - k_norm = coeffs[0]; + k = coeffs[0]; damp = coeffs[1]; } @@ -119,17 +139,23 @@ void NormalHertz::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) double NormalHertz::calculate_forces() { - contact.area = sqrt(contact.dR); - knfac = contact.k_norm * contact.area; - Fne = knfac * contact.delta; + contact->area = sqrt(contact->dR); + Fne = knfac * contact->delta; return Fne; } +/* ---------------------------------------------------------------------- */ + +void NormalHertz::set_knfac() +{ + knfac = k * contact->area; +} + /* ---------------------------------------------------------------------- Hertzian normal force with material properties ------------------------------------------------------------------------- */ -void NormalHertzMaterial::NormalHertzMaterial() +NormalHertzMaterial::NormalHertzMaterial() { material_properties = 1; num_coeffs = 3; @@ -142,7 +168,7 @@ void NormalHertzMaterial::coeffs_to_local() Emod = coeffs[0]; damp = coeffs[1]; poiss = coeffs[2]; - k_norm = 4 / 3 * Emod; + k = 4 / 3 * Emod; } /* ---------------------------------------------------------------------- */ @@ -159,7 +185,7 @@ void NormalHertzMaterial::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) DMT normal force ------------------------------------------------------------------------- */ -void NormalDMT::NormalDMT(ContactModel &c) +NormalDMT::NormalDMT() { allow_limit_damping = 0; material_properties = 1; @@ -174,7 +200,7 @@ void NormalDMT::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k_norm = 4 / 3 * Emod; + k = 4 / 3 * Emod; } /* ---------------------------------------------------------------------- */ @@ -192,30 +218,35 @@ void NormalDMT::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) double NormalDMT::calculate_forces() { - contact.area = sqrt(contact.dR); - knfac = k_norm * contact.area; - Fne = knfac * contact.delta; - F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; + Fne = knfac * contact->delta; + F_pulloff = 4 * MathConst::MY_PI * cohesion * contact->Reff; Fne -= F_pulloff; return Fne; } /* ---------------------------------------------------------------------- */ +void NormalDMT::set_knfac() +{ + knfac = k * contact->area; +} + +/* ---------------------------------------------------------------------- */ + void NormalDMT::set_fncrit() { - Fncrit = fabs(Fne + 2* F_pulloff); + Fncrit = fabs(Fne + 2 * F_pulloff); } /* ---------------------------------------------------------------------- JKR normal force ------------------------------------------------------------------------- */ -void NormalJKR::NormalJKR(ContactModel &c) +NormalJKR::NormalJKR() { allow_limit_damping = 0; material_properties = 1; - contact.beyond_contact = beyond_contact = 1; + beyond_contact = 1; num_coeffs = 4; } @@ -227,8 +258,8 @@ void NormalJKR::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k_norm = 4/3*Emod; - Escaled = k_norm * THREEQUARTERS; + k = 4/3*Emod; + Escaled = k * THREEQUARTERS; } /* ---------------------------------------------------------------------- */ @@ -244,70 +275,83 @@ void NormalJKR::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) /* ---------------------------------------------------------------------- */ -bool NormalJKR::touch(int touch) +bool NormalJKR::touch() { - double R2, delta_pulloff, dist_pulloff; + double area_at_pulloff, R2, delta_pulloff, dist_pulloff; bool touchflag; - if (touch) { - R2 = contact.Reff * contact.Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = contact.radsum - delta_pulloff; - touchflag = (contact.rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rcontact.sq < contact.radsum * contact.radsum); - } + R2 = contact->Reff * contact->Reff; + area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); + delta_pulloff = area_at_pulloff * area_at_pulloff / contact->Reff - 2 * sqrt(MY_PI * cohesion * area_at_pulloff /Escaled); + dist_pulloff = contact->radsum - delta_pulloff; + touchflag = (contact->rsq < dist_pulloff * dist_pulloff); + return touchflag; } +/* ---------------------------------------------------------------------- + called outside of compute(), do not assume geometry defined in contact +------------------------------------------------------------------------- */ + +double NormalJKR::pulloff_distance(double radi, double radj) +{ + double area_at_pulloff, Reff_tmp; + + Reff_tmp = radi * radj / (radi + radj); // May not be defined + if (Reff_tmp <= 0) return 0; + + area_at_pulloff = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Escaled)); + return area_at_pulloff * area_at_pulloff / Reff_tmp - 2 * sqrt(MY_PI * cohesion * area_at_pulloff / Escaled); +} + /* ---------------------------------------------------------------------- */ -double NormalJKR::calculate_forces() +double NormalJKR::calculate_area() { double R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2; + double sqrt1, sqrt2, sqrt3; - R2 = Reff * Reff; - dR2 = dR * dR; + R2 = contact->Reff * contact->Reff; + dR2 = contact->dR * contact->dR; t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; + t1 = PI27SQ * t0; + t2 = 8 * contact->dR * dR2 * Escaled * Escaled * Escaled; t3 = 4 * dR2 * Escaled; // in case sqrt(0) < 0 due to precision issues sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); + sqrt2 = MAX(0, 2 * contact->dR + t5); t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - contact.area = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = contact.area * contact.area; - Fne = Escaled * contact.area * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * contact.area)); - F_pulloff = 3 * MY_PI * cohesion * Reff; + sqrt3 = MAX(0, 4 * contact->dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + + return INVROOT6 * (t6 + sqrt(sqrt3)); +} + +/* ---------------------------------------------------------------------- */ + +double NormalJKR::calculate_forces() +{ + double a2; + + a2 = contact->area * contact->area; + Fne = Escaled * contact->area * a2 / contact->Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * contact->area)); + F_pulloff = 3 * MY_PI * cohesion * contact->Reff; - knfac = Escaled * contact.area; return Fne; } /* ---------------------------------------------------------------------- */ +void NormalJKR::set_knfac() +{ + knfac = Escaled * contact->area; +} + +/* ---------------------------------------------------------------------- */ + void NormalJKR::set_fncrit() { Fncrit = fabs(Fne + 2 * F_pulloff); } - -/* ---------------------------------------------------------------------- */ - -void NormalJKR::pulloff_distance(double radi, double radj) -{ - double a_tmp, Reff_tmp; - - Reff_tmp = radi * radj / (radi + radj); - if (Reff_tmp <= 0) return 0; - - a_tmp = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Ecaled)); - return a_tmp * a_tmp / Reff_tmp - 2 * sqrt(MY_PI * cohesion * a_tmp / Ecaled); -} - diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index e91d5af1c9..74e2800eaa 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -11,102 +11,108 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef NORMAL_CONTACT_MODELS_H_ -#define NORMAL_CONTACT_MODELS_H_ +#ifndef CONTACT_NORMAL_MODELS_H_ +#define CONTACT_NORMAL_MODELS_H_ -#include "contact.h"; -#include "sub_model.h" +#include "contact_sub_models.h" +namespace LAMMPS_NS { namespace Contact { -class NormalModel:SubModel{ +class NormalModel : public SubModel { public: NormalModel(); - virtual ~NormalModel() {}; - virtual bool check_contact(); - virtual void set_fncrit(); + ~NormalModel() {}; + virtual void coeffs_to_local() {}; + virtual void mix_coeffs(NormalModel*, NormalModel*) {}; + virtual bool touch(); + virtual double pulloff_distance(double, double); + virtual double calculate_area(); virtual double calculate_forces() = 0; - virtual void coeffs_to_local(); - virtual void mix_coeffs(NormalModel*, NormalModel*); - void pulloff_distance(double, double); + virtual void set_knfac() = 0; + virtual void set_fncrit(); double damp; // Vestigial argument needed by damping + double Emod, poiss; double Fncrit, Fne, knfac; int material_properties; }; /* ---------------------------------------------------------------------- */ -class NormalHooke:NormalModel -{ +class NormalHooke: public NormalModel { public: NormalHooke(); ~NormalHooke() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); double calculate_forces(); - double Emod, poiss; + void set_knfac(); + private: + double k; }; /* ---------------------------------------------------------------------- */ -class NormalHertz:NormalModel -{ +class NormalHertz: public NormalModel { public: NormalHertz(); ~NormalHertz() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); double calculate_forces(); + void set_knfac(); private: - double k_norm; + double k; }; /* ---------------------------------------------------------------------- */ -class NormalHertzMaterial:NormalHertz -{ +class NormalHertzMaterial: public NormalHertz { public: NormalHertzMaterial(); ~NormalHertzMaterial() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); private: - double k_norm; + double k; }; /* ---------------------------------------------------------------------- */ -class NormalDMT:NormalModel -{ +class NormalDMT: public NormalModel { public: NormalDMT(); ~NormalDMT() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); - void set_fncrit(); double calculate_forces(); + void set_knfac(); + void set_fncrit(); private: - double k_norm, cohesion; + double k, cohesion; double F_pulloff; }; /* ---------------------------------------------------------------------- */ -class NormalJKR:NormalModel -{ +class NormalJKR: public NormalModel { public: NormalJKR(); ~NormalJKR() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); - void set_fncrit(); + bool touch(); + double pulloff_distance(double, double); + double calculate_area(); double calculate_forces(); - void pulloff_distance(double, double); + void set_knfac(); + void set_fncrit(); private: - double k_norm, cohesion; + double k, cohesion; double Escaled, F_pulloff; }; -} -#endif /*NORMAL_CONTACT_MODELS_H_ */ +} // namespace Contact +} // namespace LAMMPS_NS +#endif /*CONTACT_NORMAL_MODELS_H_ */ diff --git a/src/GRANULAR/contact_rolling_models.cpp b/src/GRANULAR/contact_rolling_models.cpp index 5521e10aee..0c256b0fbf 100644 --- a/src/GRANULAR/contact_rolling_models.cpp +++ b/src/GRANULAR/contact_rolling_models.cpp @@ -11,202 +11,71 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "normal_contact_models.h" +#include "contact_normal_models.h" +#include "contact_rolling_models.h" #include "math_const.h" +#include "math_extra.h" #include "contact.h" -#include - +using namespace LAMMPS_NS; +using namespace Contact; using namespace MathConst; +using namespace MathExtra; -namespace Contact{ +/* ---------------------------------------------------------------------- + SDS rolling friction model +------------------------------------------------------------------------- */ -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define ONETHIRD (1.0/3.0) // 1/3 -#define THREEQUARTERS 0.75 // 3/4 - -// ************************ -// Default behaviors where needed -// ************************ -void NormalModel::set_fncrit(){ - contact->Fncrit = fabs(contact->Fntot); +RollingSDS::RollingSDS() +{ + num_coeffs = 3; + size_history = 3; } -void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ - for (int i = 0; i < num_coeffs; i++){ - coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); - } +/* ---------------------------------------------------------------------- */ + +void RollingSDS::coeffs_to_local() +{ + k = coeffs[0]; + mu = coeffs[1]; + gamma = coeffs[2]; } -//----------------------------------------- +/* ---------------------------------------------------------------------- */ -//****************** -// Hooke -//****************** -void Hooke::Hooke(ContactModel &c){ - contact = c; - num_coeffs = 2; - allocate_coeffs(); +void RollingSDS::mix_coeffs(RollingModel* imodel, RollingModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs_to_local(); } -void Hooke::coeffs_to_local(){ - k_norm = coeffs[0]; - damp = coeffs[1]; -} +/* ---------------------------------------------------------------------- */ -double Hooke::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = k_norm * contact.area; - return contact.knfac * contact.delta; -} - - -//****************** -// Hertz -//****************** -void Hertz::Hertz(ContactModel &c, int mat_flag){ - contact = c; - material_prop_flag = mat_flag; - if (material_prop_flag){ - num_coeffs = 3; - } - else{ - num_coeffs = 2; - } - allocate_coeffs(); -} - -void Hertz::coeffs_to_local(){ - if (material_prop_flag){ - Emod = coeffs[0]; - poiss = coeffs[1]; - k_norm = 4/3*Emod; - } - else{ - k_norm = coeffs[0]; - } -} - -double Hertz::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - return contact.knfac * contact.delta; -} - -//****************** -// DMT -//****************** -void DMT::DMT(ContactModel &c){ - contact = c; - material_prop_flag = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -double DMT::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - double Fne = contact.knfac * contact.delta; - F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; - Fne -= F_pulloff; - return Fne; -} - -void DMT::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); -} - -//****************** -// JKR -//****************** -void JKR::JKR(ContactModel &c){ - contact = c; - material_prop_flag = 1; - beyond_contact = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -bool JKR::touch(int touch){ - double Escaled, R2, delta_pulloff, dist_pulloff; - bool touchflag; - - Escaled = k_norm * THREEQUARTERS; - if (touch) { - R2 = contact.Reff * contact.Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = contact.radsum - delta_pulloff; - touchflag = (contact.rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rcontact.sq < contact.radsum * contact.radsum); - } - return touchflag; -} - -double JKR::calculate_forces(){ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - - Escaled = k_norm * THREEQUARTERS; - - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; - - knfac = Escaled * a; - return Fne; -} - -void JKR::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); -} - - - - -void ContactModel::rolling(double *history) +double RollingSDS::calculate_forces() { int rhist0, rhist1, rhist2, frameupdate; - double rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; + double Frcrit, rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; - rhist0 = roll_history_index; + rhist0 = history_index; rhist1 = rhist0 + 1; rhist2 = rhist1 + 1; - Frcrit = mu_roll * Fncrit; + Frcrit = mu * contact->normal_model->Fncrit; - if (history_update) { - hist_temp[0] = history[rhist0]; - hist_temp[1] = history[rhist1]; - hist_temp[2] = history[rhist2]; - rolldotn = dot3(hist_temp, nx); + if (contact->history_update) { + hist_temp[0] = contact->history[rhist0]; + hist_temp[1] = contact->history[rhist1]; + hist_temp[2] = contact->history[rhist2]; + rolldotn = dot3(hist_temp, contact->nx); - frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; + frameupdate = fabs(rolldotn) * k > EPSILON * Frcrit; if (frameupdate) { // rotate into tangential plane rollmag = len3(hist_temp); // projection temp_dbl = -rolldotn; - scale3(temp_dbl, nx, temp_array); + scale3(temp_dbl, contact->nx, temp_array); sub3(hist_temp, temp_array, hist_temp); // also rescale to preserve magnitude @@ -215,35 +84,36 @@ void ContactModel::rolling(double *history) else temp_dbl = 0; scale3(temp_dbl, hist_temp); } - scale3(dt, vrl, temp_array); + scale3(contact->dt, contact->vrl, temp_array); add3(hist_temp, temp_array, hist_temp); } - scaleadd3(k_roll, hist_temp, gamma_roll, vrl, fr); - negate3(fr); + scaleadd3(k, hist_temp, gamma, contact->vrl, contact->fr); + negate3(contact->fr); // rescale frictional displacements and forces if needed - magfr = len3(fr); + magfr = len3(contact->fr); if (magfr > Frcrit) { rollmag = len3(hist_temp); if (rollmag != 0.0) { - temp_dbl = -Frcrit / (magfr * k_roll); - scale3(temp_dbl, fr, temp_array); + temp_dbl = -Frcrit / (magfr * k); + scale3(temp_dbl, contact->fr, temp_array); add3(hist_temp, temp_array, hist_temp); - temp_dbl = -gamma_roll/k_roll; - scale3(temp_dbl, vrl, temp_array); + temp_dbl = -gamma/k; + scale3(temp_dbl, contact->vrl, temp_array); add3(hist_temp, temp_array, hist_temp); temp_dbl = Frcrit / magfr; - scale3(temp_dbl, fr); + scale3(temp_dbl, contact->fr); } else { - zero3(fr); + zero3(contact->fr); } } - history[rhist0] = hist_temp[0]; - history[rhist1] = hist_temp[1]; - history[rhist2] = hist_temp[2]; + contact->history[rhist0] = hist_temp[0]; + contact->history[rhist1] = hist_temp[1]; + contact->history[rhist2] = hist_temp[2]; + return 0; } diff --git a/src/GRANULAR/contact_rolling_models.h b/src/GRANULAR/contact_rolling_models.h index 1a2f1ddb7d..1cd23e1d5d 100644 --- a/src/GRANULAR/contact_rolling_models.h +++ b/src/GRANULAR/contact_rolling_models.h @@ -11,73 +11,36 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef NORMAL_CONTACT_MODELS_H_ -#define NORMAL_CONTACT_MODELS_H_ +#ifndef CONTACT_ROLLING_MODELS_H_ +#define CONTACT_ROLLING_MODELS_H_ -#include "contact.h"; -#include "sub_model.h" +#include "contact_sub_models.h" +namespace LAMMPS_NS { namespace Contact { -class NormalModel:SubModel{ -public: - NormalModel(){}; - virtual ~NormalModel(){}; - virtual bool check_contact(); - virtual void prep_contact(); - virtual void set_fncrit(); +class RollingModel : public SubModel { + public: + RollingModel() {}; + ~RollingModel() {}; + virtual void coeffs_to_local() {}; + virtual void mix_coeffs(RollingModel*, RollingModel*) {}; virtual double calculate_forces() = 0; - virtual void coeffs_to_local(); - virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed - -private: - int beyond_contact = 0; - int allow_limit_damping = 1; - }; -class Hooke:NormalModel{ -public: - Hooke(ContactModel &c); - ~Hooke(){}; +/* ---------------------------------------------------------------------- */ + +class RollingSDS: public RollingModel { + public: + RollingSDS(); void coeffs_to_local(); + void mix_coeffs(RollingModel*, RollingModel*); double calculate_forces(); -private: - double k_norm, damp; + private: + double k, mu, gamma; }; -class Hertz:NormalModel{ -public: - Hertz(ContactModel&, int); - ~Hertz(){}; - void coeffs_to_local(); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss; -}; - -class DMT:NormalModel{ -public: - DMT(ContactModel &c); - ~DMT(){}; - void coeffs_to_local(); - void coeffs_to_local(NormalModel*, NormalModel*); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; -}; - -class JKR:NormalModel{ -public: - JKR(ContactModel &c); - ~JKR(){}; - void coeffs_to_local(); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; - -}; -} - -#endif /*NORMAL_CONTACT_MODELS_H_ */ +} // namespace Contact +} // namespace LAMMPS_NS +#endif /*CONTACT_ROLLING_MODELS_H_ */ diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/GRANULAR/contact_sub_models.cpp index 99fcd638b4..2809204de7 100644 --- a/src/GRANULAR/contact_sub_models.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -16,23 +16,25 @@ Multiple models can be defined and used to calculate forces and torques based on contact geometry */ -#include "contact_sub_model.h" -#include "pointers.h" + +#include "contact_sub_models.h" #include "utils.h" -#include "error.h" -#include "comm.h" using namespace LAMMPS_NS; +using namespace Contact; -namespace Contact{ - -SubModel::SubModel() +SubModel::SubModel() : + Pointers(lmp) { allocated = 0; size_history = 0; history_index = 0; allow_limit_damping = 1; beyond_contact = 0; + num_coeffs = 0; + + nondefault_history_transfer = 0; + transfer_history_factor = nullptr; } /* ---------------------------------------------------------------------- */ @@ -40,6 +42,7 @@ SubModel::SubModel() SubModel::~SubModel() { if (allocated) delete [] coeffs; + delete [] transfer_history_factor; } /* ---------------------------------------------------------------------- */ @@ -62,39 +65,6 @@ void SubModel::parse_coeffs(char **arg, int iarg) coeffs_to_local(); } -/* ---------------------------------------------------------------------- */ - -void SubModel::write_restart(FILE *fp) -{ - fwrite(&model_name.length(),sizeof(int),1,fp); - fwrite(model_name.data(),sizeof(char),model_name.length(),fp); - fwrite(&num_coeffs,sizeof(int),1,fp); - fwrite(coeffs,sizeof(int),num_coeffs,fp); -} - -/* ---------------------------------------------------------------------- */ - -void SubModel::read_restart(FILE *fp, int num_char) -{ - if (comm->me == 0) { - utils::sfread(FLERR,&num_coeffs,sizeof(int),1,fp,nullptr,error); - } - MPI_BCast(const_cast(model_name.data()), num_char, MPI_CHAR, world); - allocate_coeffs(); -} - -/* ---------------------------------------------------------------------- */ - -void SubModel::read_restart(FILE *fp) -{ - int num_char; - if (me == 0) { - utils::sfread(FLERR,&num_char,sizeof(int),1,fp,nullptr,error); - } - MPI_BCast(&num_char, 1, MPI_INT, 0, world); - read_restart(fp, num_char); -} - /* ---------------------------------------------------------------------- mixing of Young's modulus (E) ------------------------------------------------------------------------- */ @@ -115,7 +85,7 @@ double SubModel::mix_stiffnessG(double E1, double E2, double pois1, double pois2) { double factor1 = 2 * (2 - pois1) * (1 + pois1) / E1; - double factor2 = 2 * (2 - pois2) * (1 + pois2) / E2) + double factor2 = 2 * (2 - pois2) * (1 + pois2) / E2; return 1 / (factor1 + factor2); } @@ -127,6 +97,3 @@ double SubModel::mix_geom(double val1, double val2) { return sqrt(val1 * val2); } - - -} \ No newline at end of file diff --git a/src/GRANULAR/contact_sub_models.h b/src/GRANULAR/contact_sub_models.h index f659ef1504..7eca7f4152 100644 --- a/src/GRANULAR/contact_sub_models.h +++ b/src/GRANULAR/contact_sub_models.h @@ -11,44 +11,48 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef GRANULAR_SUB_MODEL_H_ -#define GRANULAR_SUB_MODEL_H_ +#ifndef CONTACT_SUB_MODEL_H_ +#define CONTACT_SUB_MODEL_H_ #include "contact.h" +#include "pointers.h" -using namespace LAMMPS_NS; +namespace LAMMPS_NS { +namespace Contact { -namespace Contact{ - -class SubModel : Pointers{ +class SubModel : protected Pointers { + public: SubModel(); virtual ~SubModel(); -public: + int num_coeffs; double *coeffs; - virtual double calculate_forces() = 0; void read_restart(); - virtual void parse_coeffs(char **, int); - void mix_coeff(SubModel*, SubModel*); - void write_restart(FILE*); - void read_restart(FILE*); - void read_restart(FILE*, int); - virtual void coeffs_to_local(); + void parse_coeffs(char **, int); + virtual void mix_coeffs(SubModel*, SubModel*) {}; + virtual void coeffs_to_local() {}; void allocate_coeffs(); std::string name; -private: - ContactModel &contact; - int allocated; + int size_history; + int nondefault_history_transfer; + double *transfer_history_factor; + int history_index; int beyond_contact; int allow_limit_damping; + ContactModel *contact; + + protected: + int allocated; + double mix_stiffnessE(double, double, double, double); double mix_stiffnessG(double, double, double, double); double mix_geom(double, double); }; -} +} // namespace Contact +} // namespace LAMMPS_NS -#endif /* GRANULAR_SUB_MODEL_H_ */ +#endif /* CONTACT_SUB_MODEL_H_ */ diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 9f092aaf29..45ed993eeb 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -11,15 +11,18 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "tangential_contact_models.h" -#include "math_const.h" +#include "contact_damping_models.h" +#include "contact_normal_models.h" +#include "contact_tangential_models.h" #include "contact.h" +#include "error.h" +#include "math_const.h" +#include "math_extra.h" -#include - +using namespace LAMMPS_NS; +using namespace Contact; using namespace MathConst; - -namespace Contact{ +using namespace MathExtra; /* ---------------------------------------------------------------------- Linear model with no history @@ -35,14 +38,15 @@ TangentialLinearNoHistory::TangentialLinearNoHistory() void TangentialLinearNoHistory::coeffs_to_local() { + k = 0.0; // No tangential stiffness with no history xt = coeffs[0]; mu = coeffs[1]; - damp = xt * contact.damping_model.damp; + damp = xt * contact->damping_model->damp; } /* ---------------------------------------------------------------------- */ -void TangentialLinearNoHistory::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void TangentialLinearNoHistory::mix_coeffs(TangentialModel* imodel, TangentialModel* jmodel) { coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); @@ -56,13 +60,13 @@ void TangentialLinearNoHistory::calculate_forces() double Fscrit, fsmag, Ft; // classic pair gran/hooke (no history) - Fscrit = mu * contact.normal_model.Fncrit - fsmag = damp * contact.vrel; - if (contact.vrel != 0.0) Ft = MIN(Fscrit, fsmag) / contact.vrel; + Fscrit = mu * contact->normal_model->Fncrit; + fsmag = damp * contact->vrel; + if (contact->vrel != 0.0) Ft = MIN(Fscrit, fsmag) / contact->vrel; else Ft = 0.0; Ft = -Ft; - scale3(Ft, contact.vtr, contact.fs); + scale3(Ft, contact->vtr, contact->fs); } /* ---------------------------------------------------------------------- @@ -79,15 +83,15 @@ TangentialLinearHistory::TangentialLinearHistory() void TangentialLinearHistory::coeffs_to_local() { - kt = coeffs[0]; + k = coeffs[0]; xt = coeffs[1]; mu = coeffs[2]; - damp = xt * contact.damping_model.damp; + damp = xt * contact->damping_model->damp; } /* ---------------------------------------------------------------------- */ -void TangentialLinearHistory::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void TangentialLinearHistory::mix_coeffs(TangentialModel* imodel, TangentialModel* jmodel) { coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); @@ -102,20 +106,20 @@ void TangentialLinearHistory::calculate_forces() double Fscrit, magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; int frame_update = 0; - Fscrit = contact.normal_model.Fncrit * mu; + Fscrit = contact->normal_model->Fncrit * mu; - double *history = & contact.history[history_index]; + double *history = & contact->history[history_index]; // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (contact.history_update) { - rsht = dot3(history, contact.nx); - frame_update = fabs(rsht) * kt > EPSILON * Fscrit; + if (contact->history_update) { + rsht = dot3(history, contact->nx); + frame_update = fabs(rsht) * k > EPSILON * Fscrit; if (frame_update) { shrmag = len3(history); // projection - scale3(rsht, contact.nx, history); + scale3(rsht, contact->nx, history); // also rescale to preserve magnitude prjmag = len3(history); if (prjmag > 0) temp_dbl = shrmag / prjmag; @@ -126,28 +130,28 @@ void TangentialLinearHistory::calculate_forces() // update history // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = kt * contact.dt; - scale3(temp_dbl, contact.vtr, temp_array); + temp_dbl = k * contact->dt; + scale3(temp_dbl, contact->vtr, temp_array); sub3(history, temp_array, history); } // tangential forces = history + tangential velocity damping temp_dbl = -damp; - scale3(temp_dbl, contact.vtr, contact.fs); + scale3(temp_dbl, contact->vtr, contact->fs); // rescale frictional displacements and forces if needed - magfs = len3(contact.fs); + magfs = len3(contact->fs); if (magfs > Fscrit) { shrmag = len3(history); if (shrmag != 0.0) { temp_dbl = Fscrit / magfs; - scale3(temp_dbl, contact.fs, history); - scale3(damp, contact.vtr, temp_array); + scale3(temp_dbl, contact->fs, history); + scale3(damp, contact->vtr, temp_array); add3(history, temp_array, history); temp_dbl = Fscrit / magfs; - scale3(temp_dbl, contact.fs); + scale3(temp_dbl, contact->fs); } else { - zero3(contact.fs); + zero3(contact->fs); } } } @@ -168,20 +172,22 @@ TangentialMindlin::TangentialMindlin() void TangentialMindlin::coeffs_to_local() { - kt = coeffs[0]; + k = coeffs[0]; xt = coeffs[1]; mu = coeffs[2]; - if (ke == -1) - kt = 8.0 * mix_stiffness(contact.normal_model.Emod, contact.normal_model.Emod, - contact.normal_model.poiss, contact.normal_model.poiss); + if (k == -1) { + if (!contact->normal_model->material_properties) + error->all(FLERR, "Must either specify tangential stiffness or material properties for normal model for the Mindlin tangential style"); + k = 8.0 * mix_stiffnessE(contact->normal_model->Emod, contact->normal_model->Emod, contact->normal_model->poiss, contact->normal_model->poiss); + } - damp = xt * contact.damping_model.damp; + damp = xt * contact->damping_model->damp; } /* ---------------------------------------------------------------------- */ -void TangentialMindlin::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void TangentialMindlin::mix_coeffs(TangentialModel* imodel, TangentialModel* jmodel) { if (imodel->coeffs[0] == -1 || imodel->coeffs[0] == -1) coeffs[0] = -1; else coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); @@ -198,22 +204,22 @@ void TangentialMindlin::calculate_forces() double temp_array[3]; int frame_update = 0; - double *history = & contact.history[history_index]; - Fscrit = contact.normal_model.Fncrit * mu; + double *history = & contact->history[history_index]; + Fscrit = contact->normal_model->Fncrit * mu; - k_scaled = k_tang * contact.area; + k_scaled = k * contact->area; if (mindlin_rescale) { // on unloading, rescale the shear displacements/force - if (contact.area < history[3]) { - temp_dbl = contact.area / history[3]; + if (contact->area < history[3]) { + temp_dbl = contact->area / history[3]; scale3(temp_dbl, history); } } // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (contact.history_update) { - rsht = dot3(history, contact.nx); + if (contact->history_update) { + rsht = dot3(history, contact->nx); if (mindlin_force) frame_update = fabs(rsht) > EPSILON * Fscrit; else @@ -222,7 +228,7 @@ void TangentialMindlin::calculate_forces() if (frame_update) { shrmag = len3(history); // projection - scale3(rsht, contact.nx, history); + scale3(rsht, contact->nx, history); // also rescale to preserve magnitude prjmag = len3(history); if (prjmag > 0) temp_dbl = shrmag / prjmag; @@ -234,42 +240,42 @@ void TangentialMindlin::calculate_forces() if (mindlin_force) { // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = -k_scaled * contact.dt; - scale3(temp_dbl, contact.vtr, temp_array); + temp_dbl = -k_scaled * contact->dt; + scale3(temp_dbl, contact->vtr, temp_array); } else { - scale3(contact.dt, contact.vtr, temp_array); + scale3(contact->dt, contact->vtr, temp_array); } add3(history, temp_array, history); - if (mindlin_rescale) history[3] = contact.area; + if (mindlin_rescale) history[3] = contact->area; } // tangential forces = history + tangential velocity damping temp_dbl = -damp; - scale3(temp_dbl, contact.vtr, contact.fs); + scale3(temp_dbl, contact->vtr, contact->fs); if (! mindlin_force) { scale3(k_scaled, history, temp_array); - add3(contact.fs, temp_array, contact.fs); + add3(contact->fs, temp_array, contact->fs); } // rescale frictional displacements and forces if needed - magfs = len3(contact.fs); + magfs = len3(contact->fs); if (magfs > Fscrit) { shrmag = len3(history); if (shrmag != 0.0) { temp_dbl = Fscrit / magfs; - scale3(temp_dbl, contact.fs, history); - scale3(damp, contact.vtr, temp_array); + scale3(temp_dbl, contact->fs, history); + scale3(damp, contact->vtr, temp_array); add3(history, temp_array, history); if (! mindlin_force) { temp_dbl = -1.0 / k_scaled; scale3(temp_dbl, history); } temp_dbl = Fscrit / magfs; - scale3(temp_dbl, contact.fs); + scale3(temp_dbl, contact->fs); } else { - zero3(contact.fs); + zero3(contact->fs); } } } @@ -278,7 +284,7 @@ void TangentialMindlin::calculate_forces() Mindlin force model ------------------------------------------------------------------------- */ -void TangentialMindlinForce::TangentialMindlinForce() +TangentialMindlinForce::TangentialMindlinForce() { num_coeffs = 3; size_history = 3; @@ -290,22 +296,32 @@ void TangentialMindlinForce::TangentialMindlinForce() Mindlin rescale model ------------------------------------------------------------------------- */ -void TangentialMindlinRescale::TangentialMindlinForce() +TangentialMindlinRescale::TangentialMindlinRescale() { num_coeffs = 3; size_history = 4; mindlin_force = 0; mindlin_rescale = 1; + + nondefault_history_transfer = 1; + transfer_history_factor = new double(size_history); + for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; + transfer_history_factor[3] = +1; } /* ---------------------------------------------------------------------- Mindlin rescale force model ------------------------------------------------------------------------- */ -void TangentialMindlinRescaleForce::TangentialMindlinForce() +TangentialMindlinRescaleForce::TangentialMindlinRescaleForce() { num_coeffs = 3; size_history = 4; mindlin_force = 1; mindlin_rescale = 1; + + nondefault_history_transfer = 1; + transfer_history_factor = new double(size_history); + for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; + transfer_history_factor[3] = +1; } diff --git a/src/GRANULAR/contact_tangential_models.h b/src/GRANULAR/contact_tangential_models.h index c0a5a727f0..f5d83a57f7 100644 --- a/src/GRANULAR/contact_tangential_models.h +++ b/src/GRANULAR/contact_tangential_models.h @@ -11,92 +11,84 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef TANGENTIAL_CONTACT_MODELS_H_ -#define TANGENTIAL_CONTACT_MODELS_H_ +#ifndef CONTACT_TANGENTIAL_MODELS_H_ +#define CONTACT_TANGENTIAL_MODELS_H_ -#include "contact.h"; -#include "sub_model.h" +#include "contact_sub_models.h" +namespace LAMMPS_NS { namespace Contact { -class TangentialModel:SubModel -{ -public: +class TangentialModel : public SubModel { + public: TangentialModel() {}; virtual ~TangentialModel() {}; - virtual double calculate_forces() = 0; - virtual void coeffs_to_local(); - virtual void mix_coeffs(TangentialModel*, TangentialModel*); + virtual void coeffs_to_local() {}; + virtual void mix_coeffs(TangentialModel*, TangentialModel*) {}; + virtual void calculate_forces() = 0; int rescale_flag; -private: - int beyond_contact; - int allow_limit_damping; + double k, damp, mu; // Used by Marshall twisting model }; /* ---------------------------------------------------------------------- */ -class TangentialLinearNoHistory:TangentialModel -{ -public: - TangentialLinearNoHistory() - virtual void coeffs_to_local(); - virtual void mix_coeffs(TangentialModel*, TangentialModel*); - double calculate_forces(); -private: - double xt, damp, mu; +class TangentialLinearNoHistory: public TangentialModel { + public: + TangentialLinearNoHistory(); + void coeffs_to_local(); + void mix_coeffs(TangentialModel*, TangentialModel*); + void calculate_forces(); + private: + double xt; }; /* ---------------------------------------------------------------------- */ -class TangentialLinearHistory:TangentialModel -{ -public: - TangentialLinearHistory() - virtual void coeffs_to_local(); - virtual void mix_coeffs(TangentialModel*, TangentialModel*); - double calculate_forces(); -private: - double kt, xt, damp, mu; +class TangentialLinearHistory: public TangentialModel { + public: + TangentialLinearHistory(); + void coeffs_to_local(); + void mix_coeffs(TangentialModel*, TangentialModel*); + void calculate_forces(); + private: + double xt; }; /* ---------------------------------------------------------------------- */ -class TangentialMindlin:TangentialModel -{ -public: +class TangentialMindlin: public TangentialModel { + public: TangentialMindlin(); void coeffs_to_local(); - void coeffs_to_local(TangentialModel*, TangentialModel*); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; + void mix_coeffs(TangentialModel*, TangentialModel*); + void calculate_forces(); + protected: int mindlin_rescale, mindlin_force; + double xt; }; /* ---------------------------------------------------------------------- */ -class TangentialMindlinForce:TangentialMindlin -{ -public: +class TangentialMindlinForce: public TangentialMindlin { + public: TangentialMindlinForce(); }; /* ---------------------------------------------------------------------- */ -class TangentialMindlinRescale:TangentialMindlin -{ -public: +class TangentialMindlinRescale: public TangentialMindlin { + public: TangentialMindlinRescale(); }; /* ---------------------------------------------------------------------- */ -class TangentialMindlinRescaleForce:TangentialMindlinRescale -{ -public: - TangentialMindlinForceRescale(); +class TangentialMindlinRescaleForce: public TangentialMindlin { + public: + TangentialMindlinRescaleForce(); }; -} -#endif /*TANGENTIAL_CONTACT_MODELS_H_ */ +} // namespace Contact +} // namespace LAMMPS_NS +#endif /*CONTACT_TANGENTIAL_MODELS_H_ */ diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 0e9e9115ac..04d89a5b88 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -11,206 +11,99 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "normal_contact_models.h" -#include "math_const.h" +#include "contact_normal_models.h" +#include "contact_tangential_models.h" +#include "contact_twisting_models.h" #include "contact.h" +#include "math_const.h" -#include - +using namespace LAMMPS_NS; +using namespace Contact; using namespace MathConst; -namespace Contact{ +/* ---------------------------------------------------------------------- + Marshall twisting model +------------------------------------------------------------------------- */ -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define ONETHIRD (1.0/3.0) // 1/3 -#define THREEQUARTERS 0.75 // 3/4 - -// ************************ -// Default behaviors where needed -// ************************ -void NormalModel::set_fncrit(){ - contact->Fncrit = fabs(contact->Fntot); -} - -void NormalModel::mix_coeffs(NormalModel* imodel, NormalModel* jmodel){ - for (int i = 0; i < num_coeffs; i++){ - coeffs[i] = sqrt(imodel->coeffs[i]*jmodel->coeffs[i]); - } -} - -//----------------------------------------- - -//****************** -// Hooke -//****************** -void Hooke::Hooke(ContactModel &c){ - contact = c; - num_coeffs = 2; - allocate_coeffs(); -} - -void Hooke::coeffs_to_local(){ - k_norm = coeffs[0]; - damp = coeffs[1]; -} - -double Hooke::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = k_norm * contact.area; - return contact.knfac * contact.delta; -} - - -//****************** -// Hertz -//****************** -void Hertz::Hertz(ContactModel &c, int mat_flag){ - contact = c; - material_prop_flag = mat_flag; - if (material_prop_flag){ - num_coeffs = 3; - } - else{ - num_coeffs = 2; - } - allocate_coeffs(); -} - -void Hertz::coeffs_to_local(){ - if (material_prop_flag){ - Emod = coeffs[0]; - poiss = coeffs[1]; - k_norm = 4/3*Emod; - } - else{ - k_norm = coeffs[0]; - } -} - -double Hertz::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - return contact.knfac * contact.delta; -} - -//****************** -// DMT -//****************** -void DMT::DMT(ContactModel &c){ - contact = c; - material_prop_flag = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -double DMT::calculate_forces(){ - contact.area = sqrt(contact.dR); - contact.knfac = contact.k_norm * contact.area; - double Fne = contact.knfac * contact.delta; - F_pulloff = 4 * MathConst::MY_PI * cohesion * contact.Reff; - Fne -= F_pulloff; - return Fne; -} - -void DMT::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2* F_pulloff); -} - -//****************** -// JKR -//****************** -void JKR::JKR(ContactModel &c){ - contact = c; - material_prop_flag = 1; - beyond_contact = 1; - num_coeffs = 4; - allocate_coeffs(); -} - -bool JKR::touch(int touch){ - double Escaled, R2, delta_pulloff, dist_pulloff; - bool touchflag; - - Escaled = k_norm * THREEQUARTERS; - if (touch) { - R2 = contact.Reff * contact.Reff; - a = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = a * a / contact.Reff - 2 * sqrt(MY_PI * cohesion * a / Escaled); - dist_pulloff = contact.radsum - delta_pulloff; - touchflag = (contact.rsq < dist_pulloff * dist_pulloff); - } else { - touchflag = (rcontact.sq < contact.radsum * contact.radsum); - } - return touchflag; -} - -double JKR::calculate_forces(){ - double Escaled, R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3, a2, F_pulloff, Fne; - - Escaled = k_norm * THREEQUARTERS; - - R2 = Reff * Reff; - dR2 = dR * dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; - t1 = PI27SQ*t0; - t2 = 8 * dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); - a = INVROOT6 * (t6 + sqrt(sqrt3)); - a2 = a * a; - Fne = Escaled * a * a2 / Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * a)); - F_pulloff = 3 * MY_PI * cohesion * Reff; - - knfac = Escaled * a; - return Fne; -} - -void JKR::set_fncrit(){ - contact.Fncrit = fabs(contact.Fne + 2 * F_pulloff); -} - - - - -/* ---------------------------------------------------------------------- */ - -void ContactModel::twisting_marshall(double *history) +TwistingMarshall::TwistingMarshall() { - // Overwrite twist coefficients with derived values - k_twist = 0.5 * k_tang * a * a; // eq 32 of Marshall paper - gamma_twist = 0.5 * gamma_tang * a * a; - mu_twist = TWOTHIRDS * a * mu_tang; - - twisting_SDS(history); + num_coeffs = 0; + size_history = 3; } /* ---------------------------------------------------------------------- */ -void ContactModel::twisting_SDS(double *history) +double TwistingMarshall::calculate_forces() { double signtwist, Mtcrit; - if (history_update) { - history[twist_history_index] += magtwist * dt; + // Calculate twist coefficients from tangential model & contact geometry + // eq 32 of Marshall paper + double k = 0.5 * contact->tangential_model->k * contact->area * contact->area; + double damp = 0.5 * contact->tangential_model->damp * contact->area * contact->area; + double mu = TWOTHIRDS * contact->area * contact->tangential_model->mu; + + if (contact->history_update) { + contact->history[history_index] += contact->magtwist * contact->dt; } - magtortwist = -k_twist * history[twist_history_index] - gamma_twist*magtwist; // M_t torque (eq 30) - signtwist = (magtwist > 0) - (magtwist < 0); - Mtcrit = mu_twist * Fncrit; // critical torque (eq 44) - if (fabs(magtortwist) > Mtcrit) { - history[twist_history_index] = (Mtcrit * signtwist - gamma_twist * magtwist) / k_twist; - magtortwist = -Mtcrit * signtwist; // eq 34 + // M_t torque (eq 30) + contact->magtortwist = -k * contact->history[history_index] - damp * contact->magtwist; + signtwist = (contact->magtwist > 0) - (contact->magtwist < 0); + Mtcrit = mu * contact->normal_model->Fncrit; // critical torque (eq 44) + + if (fabs(contact->magtortwist) > Mtcrit) { + contact->history[history_index] = (Mtcrit * signtwist - damp * contact->magtwist) / k; + contact->magtortwist = -Mtcrit * signtwist; // eq 34 + } +} + +/* ---------------------------------------------------------------------- + SDS twisting model +------------------------------------------------------------------------- */ + +TwistingSDS::TwistingSDS() +{ + num_coeffs = 3; + size_history = 3; +} + +/* ---------------------------------------------------------------------- */ + +void TwistingSDS::coeffs_to_local() +{ + k = coeffs[0]; + mu = coeffs[1]; + damp = coeffs[2]; +} + +/* ---------------------------------------------------------------------- */ + +void TwistingSDS::mix_coeffs(TwistingModel* imodel, TwistingModel* jmodel) +{ + coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +double TwistingSDS::calculate_forces() +{ + double signtwist, Mtcrit; + + if (contact->history_update) { + contact->history[history_index] += contact->magtwist * contact->dt; + } + + // M_t torque (eq 30) + contact->magtortwist = -k * contact->history[history_index] - damp * contact->magtwist; + signtwist = (contact->magtwist > 0) - (contact->magtwist < 0); + Mtcrit = mu * contact->normal_model->Fncrit; // critical torque (eq 44) + + if (fabs(contact->magtortwist) > Mtcrit) { + contact->history[history_index] = (Mtcrit * signtwist - damp * contact->magtwist) / k; + contact->magtortwist = -Mtcrit * signtwist; // eq 34 } } diff --git a/src/GRANULAR/contact_twisting_models.h b/src/GRANULAR/contact_twisting_models.h index 1a2f1ddb7d..e689c8ed35 100644 --- a/src/GRANULAR/contact_twisting_models.h +++ b/src/GRANULAR/contact_twisting_models.h @@ -11,73 +11,44 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef NORMAL_CONTACT_MODELS_H_ -#define NORMAL_CONTACT_MODELS_H_ +#ifndef CONTACT_TWISTING_MODELS_H_ +#define CONTACT_TWISTING_MODELS_H_ -#include "contact.h"; -#include "sub_model.h" +#include "contact_sub_models.h" +namespace LAMMPS_NS { namespace Contact { -class NormalModel:SubModel{ -public: - NormalModel(){}; - virtual ~NormalModel(){}; - virtual bool check_contact(); - virtual void prep_contact(); - virtual void set_fncrit(); +class TwistingModel : public SubModel { + public: + TwistingModel() {}; + virtual ~TwistingModel() {}; + virtual void coeffs_to_local() {}; + virtual void mix_coeffs(TwistingModel*, TwistingModel*) {}; virtual double calculate_forces() = 0; - virtual void coeffs_to_local(); - virtual void mix_coeffs(NormalModel*, NormalModel*); //When mixing is needed - -private: - int beyond_contact = 0; - int allow_limit_damping = 1; - }; -class Hooke:NormalModel{ -public: - Hooke(ContactModel &c); - ~Hooke(){}; - void coeffs_to_local(); +/* ---------------------------------------------------------------------- */ + +class TwistingMarshall: public TwistingModel { + public: + TwistingMarshall(); double calculate_forces(); -private: - double k_norm, damp; }; -class Hertz:NormalModel{ -public: - Hertz(ContactModel&, int); - ~Hertz(){}; +/* ---------------------------------------------------------------------- */ + +class TwistingSDS: public TwistingModel { + public: + TwistingSDS(); void coeffs_to_local(); + void mix_coeffs(TwistingModel*, TwistingModel*); double calculate_forces(); -private: - double k_norm, damp, Emod, poiss; + private: + double k, mu, damp; }; -class DMT:NormalModel{ -public: - DMT(ContactModel &c); - ~DMT(){}; - void coeffs_to_local(); - void coeffs_to_local(NormalModel*, NormalModel*); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; -}; - -class JKR:NormalModel{ -public: - JKR(ContactModel &c); - ~JKR(){}; - void coeffs_to_local(); - double calculate_forces(); -private: - double k_norm, damp, Emod, poiss, coh; - -}; -} - -#endif /*NORMAL_CONTACT_MODELS_H_ */ +} // namespace Contact +} // namespace LAMMPS_NS +#endif /*CONTACT_TWISTING_MODELS_H_ */ diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 5816850ef2..e401f8cb84 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -23,14 +23,19 @@ #include "atom.h" #include "comm.h" #include "contact.h" +#include "contact_sub_models.h" +#include "contact_normal_models.h" +#include "contact_tangential_models.h" +#include "contact_damping_models.h" +#include "contact_rolling_models.h" +#include "contact_twisting_models.h" +#include "contact_heat_models.h" #include "error.h" #include "fix.h" #include "fix_dummy.h" #include "fix_neigh_history.h" #include "force.h" -#include "math_const.h" #include "math_extra.h" -#include "math_special.h" #include "memory.h" #include "modify.h" #include "neigh_list.h" @@ -38,14 +43,12 @@ #include "neighbor.h" #include "update.h" -#include #include #include using namespace LAMMPS_NS; -using namespace MathConst; -using namespace MathSpecial; using namespace Contact; +using namespace MathExtra; /* ---------------------------------------------------------------------- */ @@ -69,8 +72,6 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) maxrad_dynamic = nullptr; maxrad_frozen = nullptr; - history_transfer_factors = nullptr; - dt = update->dt; // set comm size needed by this Pair if used with fix rigid @@ -97,7 +98,6 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) PairGranular::~PairGranular() { delete[] svector; - delete[] history_transfer_factors; if (!fix_history) modify->delete_fix("NEIGH_HISTORY_GRANULAR_DUMMY"); else modify->delete_fix("NEIGH_HISTORY_GRANULAR"); @@ -121,7 +121,7 @@ void PairGranular::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; double factor_lj,mi,mj,meff,delx,dely,delz; - double forces[3], torquesi[3], torquesj[3]; + double *forces, *torquesi, *torquesj; int *ilist,*jlist,*numneigh,**firstneigh; int *touch,**firsttouch; @@ -259,17 +259,17 @@ void PairGranular::compute(int eflag, int vflag) torquesj = models[itype][jtype]->torquesj; // apply forces & torques - MathExtra::scale3(factor_lj, forces); - MathExtra::add3(f[i], forces, f[i]); + scale3(factor_lj, forces); + add3(f[i], forces, f[i]); - MathExtra::scale3(factor_lj, torquesi); - MathExtra::add3(torque[i], torquesi, torque[i]); + scale3(factor_lj, torquesi); + add3(torque[i], torquesi, torque[i]); if (heat_flag) heatflux[i] += dq; if (force->newton_pair || j < nlocal) { - MathExtra::sub3(f[j], forces, f[j]); - MathExtra::scale3(factor_lj, torquesj); - MathExtra::add3(torque[j], torquesj, torque[j]); + sub3(f[j], forces, f[j]); + scale3(factor_lj, torquesj); + add3(torque[j], torquesj, torque[j]); if (heat_flag) heatflux[j] -= dq; } @@ -301,8 +301,7 @@ void PairGranular::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutoff_type,n+1,n+1,"pair:cutoff_type"); - - models = (ContactModel **) memory->srealloc(fix, n+1,n+1, "pair:contact_models"); + memory->create(models,n+1,n+1,"pair:contact_models"); onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -349,26 +348,26 @@ void PairGranular::coeff(int narg, char **arg) //Parse mandatory normal and tangential specifications int iarg = 2; - vec_models.back().init(arg[iarg], Contact::NORMAL); - ncoeff = vec_models.back().normal_model.num_coeffs + vec_models.back().init_model(std::string(arg[iarg]), NORMAL); + ncoeff = vec_models.back().normal_model->num_coeffs; iarg += 1; if (iarg + ncoeff >= narg) error->all(FLERR,"Illegal pair_coeff command" "Insufficient arguments provided for normal model."); - vec_models.back().normal_model.parse_coeffs(arg, iarg); + vec_models.back().normal_model->parse_coeffs(arg, iarg); iarg += ncoeff; if (strcmp(arg[iarg], "tangential") == 0) { if (iarg + 1 >= narg) error->all(FLERR,"Illegal pair_coeff command, must specify " "tangential model after tangential keyword"); - vec_models.back().init(arg[iarg], Contact::TANGENTIAL); - ncoeff = vec_models.back().tangential_model.num_coeffs; + vec_models.back().init_model(std::string(arg[iarg]), TANGENTIAL); + ncoeff = vec_models.back().tangential_model->num_coeffs; iarg += 1; if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" "Insufficient arguments provided for tangential model."); - vec_models.back().tangential_model.parse_coeffs(arg, iarg); + vec_models.back().tangential_model->parse_coeffs(arg, iarg); iarg += ncoeff; } else{ error->all(FLERR, "Illegal pair_coeff command, 'tangential' keyword expected"); @@ -379,49 +378,49 @@ void PairGranular::coeff(int narg, char **arg) if (strcmp(arg[iarg], "damping") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init(arg[iarg], Contact::DAMPING); - ncoeff = vec_models.back().damping_model.num_coeffs; + vec_models.back().init_model(std::string(arg[iarg]), DAMPING); + ncoeff = vec_models.back().damping_model->num_coeffs; iarg += 1; if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" "Insufficient arguments provided for damping model."); - vec_models.back().damping_model.parse_coeffs(arg, iarg); + vec_models.back().damping_model->parse_coeffs(arg, iarg); iarg += ncoeff; } else if (strcmp(arg[iarg], "rolling") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init(arg[iarg], Contact::ROLLING); - ncoeff = vec_models.back().rolling_model.num_coeffs; + vec_models.back().init_model(std::string(arg[iarg]), ROLLING); + ncoeff = vec_models.back().rolling_model->num_coeffs; iarg += 1; if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" "Insufficient arguments provided for rolling model."); - vec_models.back().rolling_model.parse_coeffs(arg, iarg); + vec_models.back().rolling_model->parse_coeffs(arg, iarg); iarg += ncoeff; } else if (strcmp(arg[iarg], "twisting") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init(arg[iarg], Contact::TWISTING); - ncoeff = vec_models.back().twisting_model.num_coeffs; + vec_models.back().init_model(std::string(arg[iarg]), TWISTING); + ncoeff = vec_models.back().twisting_model->num_coeffs; iarg += 1; if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" "Insufficient arguments provided for twisting model."); - vec_models.back().twisting_model.parse_coeffs(arg, iarg); + vec_models.back().twisting_model->parse_coeffs(arg, iarg); iarg += ncoeff; } else if (strcmp(arg[iarg], "heat") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init(arg[iarg], Contact::HEAT); - ncoeff = vec_models.back().heat_model.num_coeffs; + vec_models.back().init_model(std::string(arg[iarg]), HEAT); + ncoeff = vec_models.back().heat_model->num_coeffs; iarg += 1; if (iarg + ncoeff >= narg) error->all(FLERR, "Illegal pair_coeff command" "Insufficient arguments provided for heat model."); - vec_models.back().heat_model.parse_coeffs(arg, iarg); + vec_models.back().heat_model->parse_coeffs(arg, iarg); iarg += ncoeff; heat_flag = 1; @@ -440,8 +439,8 @@ void PairGranular::coeff(int narg, char **arg) // Define default damping model if unspecified, takes no args if (!vec_models.back().damping_model) { - vec_models.back().init("viscoelastic", Contact::DAMPING); - vec_models.back().damping_model.parse_coeffs(arg, 0); + vec_models.back().init_model("viscoelastic", DAMPING); + vec_models.back().damping_model->parse_coeffs(arg, 0); } if (vec_models.back().limit_damping && !vec_models.back().normal_model->allow_limit_damping) @@ -475,38 +474,41 @@ void PairGranular::init_style() if (comm->ghost_velocity == 0) error->all(FLERR,"Pair granular requires ghost atoms store velocity"); - // allocate history + // allocate history and initialize models int size_normal_history = 0; + int size_damping_history = 0; int size_tangential_history = 0; int size_rolling_history = 0; int size_twisting_history = 0; for (int i = 1; i <= atom->ntypes; i++) { for (int j = i; j <= atom->ntypes; j++) { - if (models[i][j]->normal_model.history_flag || - models[i][j]->tangential_model.history_flag || - models[i][j]->rolling_model.history_flag || - models[i][j]->twisting_model.history_flag) use_history = 1; - - if (models[i][j]->nondefault_history_transfer) // ??? + if (models[i][j]->normal_model->size_history != 0 || + models[i][j]->damping_model->size_history != 0 || + models[i][j]->tangential_model->size_history != 0 || + models[i][j]->rolling_model->size_history != 0 || + models[i][j]->twisting_model->size_history != 0) use_history = 1; if (models[i][j]->normal_model->size_history > size_normal_history) - size_normal_history = models[i][j]->normal_model.size_history; + size_normal_history = models[i][j]->damping_model->size_history; + if (models[i][j]->damping_model->size_history > size_damping_history) + size_damping_history = models[i][j]->normal_model->size_history; if (models[i][j]->tangential_model->size_history > size_tangential_history) - size_tangential_history = models[i][j]->tangential_model.size_history; + size_tangential_history = models[i][j]->tangential_model->size_history; if (models[i][j]->rolling_model->size_history > size_rolling_history) - size_rolling_history = models[i][j]->rolling_model.size_history; + size_rolling_history = models[i][j]->rolling_model->size_history; if (models[i][j]->twisting_model->size_history > size_twisting_history) - size_twisting_history = models[i][j]->twisting_model.size_history; + size_twisting_history = models[i][j]->twisting_model->size_history; } } - size_history = size_normal_history + size_tangential_history + - size_rolling_history + size_twisting_history; + size_history = size_normal_history + size_damping_history + + size_tangential_history + size_rolling_history + size_twisting_history; - tangential_history_index = size_normal_history; - roll_history_index = size_normal_history + size_tangential_history; - twist_history_index = size_normal_history + size_tangential_history + size_rolling_history; + damping_history_index = size_normal_history; + tangential_history_index = size_normal_history + damping_history_index; + roll_history_index = size_normal_history + damping_history_index + size_tangential_history; + twist_history_index = size_normal_history + damping_history_index + size_tangential_history + size_rolling_history; if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE|NeighConst::REQ_HISTORY); else neighbor->add_request(this, NeighConst::REQ_SIZE); @@ -601,11 +603,11 @@ double PairGranular::init_one(int i, int j) double cutoff = 0.0; if (setflag[i][j] == 0) { - if ((models[i][i]->normal_model.name != models[j][j]->normal_model.name) || - (models[i][i]->damping_model.name != models[j][j]->damping_model.name) || - (models[i][i]->tangential_model.name != models[j][j]->tangential_model.name) || - (models[i][i]->rolling_model.name != models[j][j]->rolling_model.name) || - (models[i][i]->twisting_model.name != models[j][j]->twisting_model.name)) { + if ((models[i][i]->normal_model->name != models[j][j]->normal_model->name) || + (models[i][i]->damping_model->name != models[j][j]->damping_model->name) || + (models[i][i]->tangential_model->name != models[j][j]->tangential_model->name) || + (models[i][i]->rolling_model->name != models[j][j]->rolling_model->name) || + (models[i][i]->twisting_model->name != models[j][j]->twisting_model->name)) { error->all(FLERR,"Granular pair style functional forms are different, " "cannot mix coefficients for types {} and {}. \n" "This combination must be set explicitly via a " @@ -614,12 +616,12 @@ double PairGranular::init_one(int i, int j) vec_models.push_back(ContactModel()); models[i][j] = models[j][i] = & vec_models.back(); - vec_models.back().init(models[i][i]->normal_model.name, Contact::NORMAL); - vec_models.back().init(models[i][i]->tangential_model.name, Contact::TANGENTIAL); - vec_models.back().init(models[i][i]->damping_model.name, Contact::DAMPING); - vec_models.back().init(models[i][i]->rolling_model.name, Contact::ROLLING); - vec_models.back().init(models[i][i]->twisting_model.name, Contact::TWISTING); - vec_models.back().init(models[i][i]->heat_model.name, Contact::HEAT); + vec_models.back().init_model(models[i][i]->normal_model->name, NORMAL); + vec_models.back().init_model(models[i][i]->tangential_model->name, TANGENTIAL); + vec_models.back().init_model(models[i][i]->damping_model->name, DAMPING); + vec_models.back().init_model(models[i][i]->rolling_model->name, ROLLING); + vec_models.back().init_model(models[i][i]->twisting_model->name, TWISTING); + vec_models.back().init_model(models[i][i]->heat_model->name, HEAT); vec_models.back().mix_coeffs(models[i][i], models[j][j]); } @@ -675,10 +677,16 @@ double PairGranular::init_one(int i, int j) // Copy global options models[i][j]->dt = models[j][i]->dt = dt; - models[i][j]->normal_model.history_index = models[j][i]->normal_model.history_index = normal_history_index; - models[i][j]->tangential_model.history_index = models[j][i]->tangential_model.history_index = tangential_history_index; - models[i][j]->rolling_model.history_index = models[j][i]->rolling_model.history_index = rolling_history_index; - models[i][j]->twisting_model.history_index = models[j][i]->twisting_model.history_index = twisting_history_index; + models[i][j]->normal_model->history_index = models[j][i]->normal_model->history_index = normal_history_index; + models[i][j]->tangential_model->history_index = models[j][i]->tangential_model->history_index = tangential_history_index; + models[i][j]->rolling_model->history_index = models[j][i]->rolling_model->history_index = roll_history_index; + models[i][j]->twisting_model->history_index = models[j][i]->twisting_model->history_index = twist_history_index; + + models[i][j]->size_history = models[j][i]->size_history = size_history; + models[i][j]->init(); // Calculates cumulative properties of sub models + models[j][i]->init(); + + if (models[i][j]->nondefault_history_transfer) nondefault_history_transfer = 1; return cutoff; } @@ -718,7 +726,7 @@ void PairGranular::read_restart(FILE *fp) if (setflag[i][j]) { vec_models.push_back(ContactModel()); models[i][j] = & vec_models.back(); - models[i][j]->read_restart(); + models[i][j]->read_restart(fp); } } } @@ -729,6 +737,12 @@ void PairGranular::read_restart(FILE *fp) void PairGranular::reset_dt() { dt = update->dt; + + for (int i = 1; i <= atom->ntypes; i++) { + for (int j = i; j <= atom->ntypes; j++) { + models[i][j]->dt = dt; + } + } } /* ---------------------------------------------------------------------- */ @@ -819,7 +833,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, history = &allhistory[size_history*neighprev]; } - double forces[3], torquesi[3], torquesj[3]; + double *forces, *torquesi, *torquesj; models[itype][jtype]->calculate_forces(); forces = models[itype][jtype]->forces; torquesi = models[itype][jtype]->torquesi; @@ -893,11 +907,16 @@ double PairGranular::memory_usage() only needed if any history entries i-j are not just negative of j-i entries ------------------------------------------------------------------------- */ -void PairGranular::transfer_history(double* source, double* target, int source_type, int target_type) +void PairGranular::transfer_history(double* source, double* target, int itype, int jtype) { - models[itype][jtype]->transfer_history(); - for (int i = 0; i < size_history; i++){ - target[i] = history_transfer_factors[i]*source[i]; + if (models[itype][jtype]->nondefault_history_transfer) { + for (int i = 0; i < size_history; i++) { + target[i] = models[itype][jtype]->transfer_history_factor[i] * source [i]; + } + } else { + for (int i = 0; i < size_history; i++) { + target[i] = -source[i]; + } } } diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index e018f9fe7c..1032cf6b7c 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -22,7 +22,7 @@ PairStyle(granular,PairGranular); #include "contact.h" #include "pair.h" -#include "vector.h" +#include namespace LAMMPS_NS { @@ -65,11 +65,10 @@ class PairGranular : public Pair { int nmax; // allocated size of mass_rigid void allocate(); - void transfer_history(double *, double *) override; + void transfer_history(double *, double *, int, int) override; private: int size_history; - int *history_transfer_factors; int heat_flag; // contact models @@ -81,6 +80,7 @@ class PairGranular : public Pair { // indices of history entries int normal_history_index; + int damping_history_index; int tangential_history_index; int roll_history_index; int twist_history_index; diff --git a/src/contact.h b/src/contact.h index 167f88e9de..96758771b4 100644 --- a/src/contact.h +++ b/src/contact.h @@ -14,78 +14,89 @@ #ifndef LMP_CONTACT_H #define LMP_CONTACT_H +#include "pointers.h" // IWYU pragma: export + +namespace LAMMPS_NS { namespace Contact { - enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; - enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; - enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, - TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; - enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; - enum {ROLL_NONE, ROLL_SDS}; +enum ModelType { + NORMAL = 0, + DAMPING = 1, + TANGENTIAL = 2, + ROLLING = 3, + TWISTING = 4, + HEAT = 5 +}; - #define PI27SQ 266.47931882941264802866 // 27*PI**2 - #define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) - #define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) - #define INVROOT6 0.40824829046386307274 // 1/sqrt(6) - #define FOURTHIRDS (4.0/3.0) // 4/3 - #define ONETHIRD (1.0/3.0) // 1/3 - #define THREEQUARTERS 0.75 // 3/4 +#define EPSILON 1e-10 - #define EPSILON 1e-10 +// forward declaration +class NormalModel; +class DampingModel; +class TangentialModel; +class RollingModel; +class TwistingModel; +class HeatModel; +class SubModel; - class ContactModel { - public: - ContactModel(); - void reset_contact(); - bool check_contact(); - void prep_contact(); - void calculate_forces(double *, double *, double *, double *); - double calculate_heat(); - double pulloff_distance(double, double); +class ContactModel : protected Pointers { + public: + ContactModel(); + ~ContactModel(); + void init(); + bool check_contact(); + void reset_contact(); + void prep_contact(); + void calculate_forces(); + double calculate_heat(); + double pulloff_distance(double, double); - int normal_model, damping_model, tangential_model; - int roll_model, twist_model; - int limit_damping; - double cutoff_type; - double Emod, poisson; // variables used in defining mixed interactions - double k_norm, gamma_norm, cohesion; // normal_coeffs - double k_tang, gamma_tang, mu_tang; // tangential_coeffs - wutang? - double k_roll, gamma_roll, mu_roll; // roll_coeffs - double k_twist, gamma_twist, mu_twist; // twist_coeffs - double conductivity; + void init_model(std::string, ModelType); - double radi, radj, meff, dt, Ti, Tj; - double *xi, *xj, *vi, *vj, *omegai, *omegaj; - int history_update, roll_history_index, twist_history_index; + void mix_coeffs(ContactModel*, ContactModel*); - double fs[3], fr[3], ft[3], magtortwist; + void write_restart(FILE *); + void read_restart(FILE *); - private: - double a, knfac, Fntot, Fncrit, Fscrit, Frcrit, damp_normal_prefactor; - double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; - double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; - double magtwist; - bool touch; + // Sub models + NormalModel *normal_model; + DampingModel *damping_model; + TangentialModel *tangential_model; + RollingModel *rolling_model; + TwistingModel *twisting_model; + HeatModel *heat_model; + SubModel *sub_models[6]; // Need to resize if we add more model flavors - int prep_flag, check_flag; - int mindlin_rescale, mindlin_force; + // Extra options + int beyond_contact, limit_damping, history_update; + double cutoff_type; - bool touch_JKR(int); - double normal_JKR(); - double normal_DMT(); - double normal_Hertz(); - double normal_Hooke(); - double normal_damping(); - void tangential_no_history(); - void tangential_history(double *); - void tangential_mindlin(double *); - void rolling(double *); - void twisting_marshall(double *); - void twisting_SDS(double *); + // History variables + int size_history, nondefault_history_transfer; + double *transfer_history_factor; + double *history; - }; + // Contact properties/output + double *forces, *torquesi, *torquesj; + + double radi, radj, meff, dt, Ti, Tj, area; + double Fntot, magtortwist; + + double *xi, *xj, *vi, *vj, *omegai, *omegaj; + double fs[3], fr[3], ft[3]; + + double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; + double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; + double magtwist; + bool touch; + + protected: + + int prep_flag, check_flag; + int nmodels; +}; } // namespace Contact +} // namespace LAMMPS_NS #endif diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 37d1b37946..975d93ff83 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -337,6 +337,7 @@ void FixNeighHistory::pre_exchange_newton() int *ilist,*jlist,*numneigh,**firstneigh; int *allflags; double *allvalues,*onevalues,*jvalues; + int *type = atom->type; // NOTE: all operations until very end are with // nlocal_neigh <= current nlocal and nall_neigh @@ -430,7 +431,7 @@ void FixNeighHistory::pre_exchange_newton() partner[j][m] = tag[i]; jvalues = &valuepartner[j][dnum*m]; if (pair->nondefault_history_transfer) - pair->transfer_history(onevalues,jvalues); + pair->transfer_history(onevalues,jvalues,type[i],type[j]); else for (n = 0; n < dnum; n++) jvalues[n] = -onevalues[n]; } } @@ -469,6 +470,7 @@ void FixNeighHistory::pre_exchange_no_newton() int *ilist,*jlist,*numneigh,**firstneigh; int *allflags; double *allvalues,*onevalues,*jvalues; + int *type = atom->type; // NOTE: all operations until very end are with nlocal_neigh <= current nlocal // because previous neigh list was built with nlocal_neigh @@ -544,7 +546,7 @@ void FixNeighHistory::pre_exchange_no_newton() partner[j][m] = tag[i]; jvalues = &valuepartner[j][dnum*m]; if (pair->nondefault_history_transfer) - pair->transfer_history(onevalues, jvalues); + pair->transfer_history(onevalues, jvalues,type[i],type[j]); else for (n = 0; n < dnum; n++) jvalues[n] = -onevalues[n]; } } diff --git a/src/pair.h b/src/pair.h index 4763a225d2..9e72f03d23 100644 --- a/src/pair.h +++ b/src/pair.h @@ -211,7 +211,7 @@ class Pair : protected Pointers { virtual void min_xf_pointers(int, double **, double **) {} virtual void min_xf_get(int) {} virtual void min_x_set(int) {} - virtual void transfer_history(double *, double *) {} + virtual void transfer_history(double *, double *, int, int) {} virtual double atom2cut(int) { return 0.0; } virtual double radii2cut(double, double) { return 0.0; } From df22b91ac35ebe4d7faf0cacb6009fc1b47583cd Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 8 Aug 2022 08:01:48 -0600 Subject: [PATCH 015/112] Updating coeff parsing, first pass on fix wall/gran, misc fixes --- src/GRANULAR/contact.cpp | 114 +- src/GRANULAR/contact.h | 6 +- src/GRANULAR/contact_heat_models.cpp | 3 + src/GRANULAR/contact_normal_models.cpp | 11 + src/GRANULAR/contact_rolling_models.cpp | 6 +- src/GRANULAR/contact_sub_models.cpp | 8 +- src/GRANULAR/contact_sub_models.h | 2 +- src/GRANULAR/contact_tangential_models.cpp | 9 + src/GRANULAR/contact_twisting_models.cpp | 4 + src/GRANULAR/fix_wall_gran.cpp | 1357 +++----------------- src/GRANULAR/fix_wall_gran.h | 38 +- src/GRANULAR/fix_wall_gran_region.cpp | 167 +-- src/GRANULAR/pair_granular.cpp | 103 +- src/GRANULAR/pair_granular.h | 3 - src/contact.h | 6 +- 15 files changed, 477 insertions(+), 1360 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 4358f6df1c..7ce3d8c739 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -30,6 +30,7 @@ #include "contact_heat_models.h" #include "comm.h" #include "error.h" +#include "force.h" #include @@ -44,6 +45,7 @@ ContactModel::ContactModel() : beyond_contact = 0; nondefault_history_transfer = 0; cutoff_type = 0.0; + wall_flag = 0; nmodels = 5; reset_contact(); @@ -107,6 +109,8 @@ void ContactModel::init_model(std::string model_name, ModelType model_type) else if (model_name =="area") heat_model = new HeatArea(); else error->all(FLERR, "Heat model name not recognized"); sub_models[model_type] = heat_model; + } else { + error->all(FLERR, "Illegal model type"); } sub_models[model_type]->name.assign(model_name); @@ -116,14 +120,82 @@ void ContactModel::init_model(std::string model_name, ModelType model_type) /* ---------------------------------------------------------------------- */ +int ContactModel::init_classic_model(char **arg, int iarg, int narg) +{ + double kn, kt, gamman, gammat, xmu; + + if (iarg + 6 >= narg) + error->all(FLERR,"Insufficient arguments provided for classic gran model command"); + + kn = utils::numeric(FLERR,arg[iarg + 1],false,lmp); + if (strcmp(arg[iarg + 2],"NULL") == 0) kt = kn * 2.0 / 7.0; + else kt = utils::numeric(FLERR,arg[iarg + 2],false,lmp); + + gamman = utils::numeric(FLERR,arg[iarg + 3],false,lmp); + if (strcmp(arg[iarg + 4],"NULL") == 0) gammat = 0.5 * gamman; + else gammat = utils::numeric(FLERR,arg[iarg + 4],false,lmp); + + xmu = utils::numeric(FLERR,arg[iarg + 5],false,lmp); + int dampflag = utils::inumeric(FLERR,arg[iarg + 6],false,lmp); + if (dampflag == 0) gammat = 0.0; + + if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || + xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1) + error->all(FLERR,"Illegal classic gran model command"); + + if (strcmp(arg[iarg],"hooke") == 0) { + init_model("hooke", NORMAL); + init_model("linear_nohistory", TANGENTIAL); + } else if (strcmp(arg[iarg],"hooke/history") == 0) { + init_model("hooke", NORMAL); + init_model("linear_history", TANGENTIAL); + } else if (strcmp(arg[iarg],"hertz/history") == 0) { + // convert Kn and Kt from pressure units to force/distance^2 if Hertzian + kn /= force->nktv2p; + kt /= force->nktv2p; + init_model("hertz", NORMAL); + init_model("mindlin", TANGENTIAL); // Dan is this right? + } else error->all(FLERR,"Invalid classic gran model"); + init_model("mass_velocity", DAMPING); + + // ensure additional models are undefined + rolling_model = nullptr; + twisting_model = nullptr; + heat_model = nullptr; + + // manually parse coeffs + normal_model->coeffs[0] = kn; + normal_model->coeffs[1] = gamman; + tangential_model->coeffs[0] = kt; + tangential_model->coeffs[1] = gammat; + tangential_model->coeffs[2] = xmu; + + normal_model->coeffs_to_local(); + tangential_model->coeffs_to_local(); + damping_model->coeffs_to_local(); + + iarg += 7; + return iarg ; +} + +/* ---------------------------------------------------------------------- */ + void ContactModel::init() { + if (!normal_model) error->all(FLERR, "Must specify normal contact model"); + if (!damping_model) error->all(FLERR, "Must specify damping contact model"); + if (!tangential_model) error->all(FLERR, "Must specify tangential contact model"); + int i, j, size_cumulative; + size_history = 0; for (i = 0; i < nmodels; i++) { - if (sub_models[i]->nondefault_history_transfer) - nondefault_history_transfer = 1; - if (sub_models[i]->beyond_contact) - beyond_contact = 1; + if (sub_models[i]) { + if (sub_models[i]->nondefault_history_transfer) + nondefault_history_transfer = 1; + if (sub_models[i]->beyond_contact) + beyond_contact = 1; + size_history += sub_models[i]->size_history; + } } transfer_history_factor = new double(size_history); @@ -134,13 +206,17 @@ void ContactModel::init() // Find which model controls this history value size_cumulative = 0; for (j = 0; j < nmodels; j++) { - if (size_cumulative + sub_models[j]->size_history > i) break; - size_cumulative += sub_models[j]->size_history; + if (sub_models[j]) { + if (size_cumulative + sub_models[j]->size_history > i) break; + size_cumulative += sub_models[j]->size_history; + } } // Check if model has nondefault transfers, if so copy its array - if (sub_models[j]->nondefault_history_transfer) { - transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; + if (j != nmodels) { + if (sub_models[j]->nondefault_history_transfer) { + transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; + } } } } @@ -151,7 +227,8 @@ void ContactModel::init() void ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) { for (int i = 0; i < nmodels; i++) - sub_models[i]->mix_coeffs(c1->sub_models[i], c2->sub_models[i]); + if (sub_models[i]) + sub_models[i]->mix_coeffs(c1->sub_models[i], c2->sub_models[i]); limit_damping = MAX(c1->limit_damping, c2->limit_damping); cutoff_type = MAX(c1->cutoff_type, c2->cutoff_type); @@ -218,10 +295,6 @@ void ContactModel::read_restart(FILE *fp) void ContactModel::reset_contact() { - radi = radj = Fntot = magtortwist = 0.0; - xi = xj = vi = vj = omegai = omegaj = nullptr; - forces = torquesi = torquesj = history = nullptr; - prep_flag = check_flag = 0; touch = false; } @@ -232,10 +305,17 @@ bool ContactModel::check_contact() { check_flag = 1; - sub3(xi, xj, dx); - rsq = lensq3(dx); - radsum = radi + radj; - Reff = radi * radj / radsum; + if (wall_flag) { + rsq = lensq3(dx); + radsum = radi; + if (rwall == 0) Reff = radi; + else Reff = radi * rwall/(radi + rwall); + } else { + sub3(xi, xj, dx); + rsq = lensq3(dx); + radsum = radi + radj; + Reff = radi * radj / radsum; + } touch = normal_model->touch(); return touch; diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 96758771b4..bd04fe9ce1 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -52,7 +52,7 @@ class ContactModel : protected Pointers { double pulloff_distance(double, double); void init_model(std::string, ModelType); - + int init_classic_model(char **, int, int); void mix_coeffs(ContactModel*, ContactModel*); void write_restart(FILE *); @@ -68,7 +68,7 @@ class ContactModel : protected Pointers { SubModel *sub_models[6]; // Need to resize if we add more model flavors // Extra options - int beyond_contact, limit_damping, history_update; + int beyond_contact, limit_damping, history_update, wall_flag; double cutoff_type; // History variables @@ -79,7 +79,7 @@ class ContactModel : protected Pointers { // Contact properties/output double *forces, *torquesi, *torquesj; - double radi, radj, meff, dt, Ti, Tj, area; + double radi, radj, rwall, meff, dt, Ti, Tj, area; double Fntot, magtortwist; double *xi, *xj, *vi, *vj, *omegai, *omegaj; diff --git a/src/GRANULAR/contact_heat_models.cpp b/src/GRANULAR/contact_heat_models.cpp index 29134b3e73..3793f774c2 100644 --- a/src/GRANULAR/contact_heat_models.cpp +++ b/src/GRANULAR/contact_heat_models.cpp @@ -13,6 +13,7 @@ #include "contact_heat_models.h" #include "contact.h" +#include "error.h" using namespace LAMMPS_NS; using namespace Contact; @@ -31,6 +32,8 @@ HeatArea::HeatArea() void HeatArea::coeffs_to_local() { conductivity = coeffs[0]; + + if (conductivity < 0.0) error->all(FLERR, "Illegal area heat model"); } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index c11fddb1d7..6a6db39189 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -13,6 +13,7 @@ #include "contact_normal_models.h" #include "contact.h" +#include "error.h" #include "math_const.h" using namespace LAMMPS_NS; @@ -83,6 +84,8 @@ void NormalHooke::coeffs_to_local() { k = coeffs[0]; damp = coeffs[1]; + + if (k < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hooke normal model"); } /* ---------------------------------------------------------------------- */ @@ -124,6 +127,8 @@ void NormalHertz::coeffs_to_local() { k = coeffs[0]; damp = coeffs[1]; + + if (k < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz normal model"); } /* ---------------------------------------------------------------------- */ @@ -169,6 +174,8 @@ void NormalHertzMaterial::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; k = 4 / 3 * Emod; + + if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz material normal model"); } /* ---------------------------------------------------------------------- */ @@ -201,6 +208,8 @@ void NormalDMT::coeffs_to_local() poiss = coeffs[2]; cohesion = coeffs[3]; k = 4 / 3 * Emod; + + if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); } /* ---------------------------------------------------------------------- */ @@ -260,6 +269,8 @@ void NormalJKR::coeffs_to_local() cohesion = coeffs[3]; k = 4/3*Emod; Escaled = k * THREEQUARTERS; + + if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_rolling_models.cpp b/src/GRANULAR/contact_rolling_models.cpp index 0c256b0fbf..8074b14141 100644 --- a/src/GRANULAR/contact_rolling_models.cpp +++ b/src/GRANULAR/contact_rolling_models.cpp @@ -13,9 +13,10 @@ #include "contact_normal_models.h" #include "contact_rolling_models.h" +#include "contact.h" +#include "error.h" #include "math_const.h" #include "math_extra.h" -#include "contact.h" using namespace LAMMPS_NS; using namespace Contact; @@ -39,6 +40,9 @@ void RollingSDS::coeffs_to_local() k = coeffs[0]; mu = coeffs[1]; gamma = coeffs[2]; + + if (k < 0.0 || mu < 0.0 || gamma < 0.0) + error->all(FLERR, "Illegal SDS rolling model"); } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/GRANULAR/contact_sub_models.cpp index 2809204de7..a0bf99301d 100644 --- a/src/GRANULAR/contact_sub_models.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -18,6 +18,7 @@ */ #include "contact_sub_models.h" +#include "error.h" #include "utils.h" using namespace LAMMPS_NS; @@ -55,14 +56,19 @@ void SubModel::allocate_coeffs() /* ---------------------------------------------------------------------- */ -void SubModel::parse_coeffs(char **arg, int iarg) +int SubModel::parse_coeffs(char **arg, int iarg, int narg) { + if (iarg + num_coeffs >= narg) + error->all(FLERR, "Insufficient arguments provided for {} model", name); + for (int i = 0; i < num_coeffs; i++) { // A few parameters (eg.g kt for tangential mindlin) allow null if (strcmp(arg[iarg+i+1], "NULL") == 0) coeffs[i] = -1; else coeffs[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); } coeffs_to_local(); + + return iarg + num_coeffs; } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/contact_sub_models.h b/src/GRANULAR/contact_sub_models.h index 7eca7f4152..95da8d5cbf 100644 --- a/src/GRANULAR/contact_sub_models.h +++ b/src/GRANULAR/contact_sub_models.h @@ -28,7 +28,7 @@ class SubModel : protected Pointers { int num_coeffs; double *coeffs; void read_restart(); - void parse_coeffs(char **, int); + int parse_coeffs(char **, int, int); virtual void mix_coeffs(SubModel*, SubModel*) {}; virtual void coeffs_to_local() {}; void allocate_coeffs(); diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 45ed993eeb..4f25e96071 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -42,6 +42,9 @@ void TangentialLinearNoHistory::coeffs_to_local() xt = coeffs[0]; mu = coeffs[1]; damp = xt * contact->damping_model->damp; + + if (k < 0.0 || xt < 0.0 || mu < 0.0) + error->all(FLERR, "Illegal linear no history tangential model"); } /* ---------------------------------------------------------------------- */ @@ -87,6 +90,9 @@ void TangentialLinearHistory::coeffs_to_local() xt = coeffs[1]; mu = coeffs[2]; damp = xt * contact->damping_model->damp; + + if (k < 0.0 || xt < 0.0 || mu < 0.0) + error->all(FLERR, "Illegal linear tangential model"); } /* ---------------------------------------------------------------------- */ @@ -182,6 +188,9 @@ void TangentialMindlin::coeffs_to_local() k = 8.0 * mix_stiffnessE(contact->normal_model->Emod, contact->normal_model->Emod, contact->normal_model->poiss, contact->normal_model->poiss); } + if (k < 0.0 || xt < 0.0 || mu < 0.0) + error->all(FLERR, "Illegal Mindlin tangential model"); + damp = xt * contact->damping_model->damp; } diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 04d89a5b88..75a2414c21 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -15,6 +15,7 @@ #include "contact_tangential_models.h" #include "contact_twisting_models.h" #include "contact.h" +#include "error.h" #include "math_const.h" using namespace LAMMPS_NS; @@ -75,6 +76,9 @@ void TwistingSDS::coeffs_to_local() k = coeffs[0]; mu = coeffs[1]; damp = coeffs[2]; + + if (k < 0.0 || mu < 0.0 || damp < 0.0) + error->all(FLERR, "Illegal SDS twisting model"); } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index da7af48e82..b4d94d62fe 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -20,10 +20,18 @@ #include "fix_wall_gran.h" #include "atom.h" +#include "contact.h" +#include "contact_sub_models.h" +#include "contact_normal_models.h" +#include "contact_tangential_models.h" +#include "contact_damping_models.h" +#include "contact_rolling_models.h" +#include "contact_twisting_models.h" +#include "contact_heat_models.h" #include "domain.h" #include "error.h" -#include "force.h" #include "math_const.h" +#include "math_extra.h" #include "memory.h" #include "modify.h" #include "neighbor.h" @@ -34,31 +42,17 @@ #include using namespace LAMMPS_NS; +using namespace Contact; using namespace FixConst; using namespace MathConst; - -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS 1.333333333333333 // 4/3 -#define THREEQUARTERS 0.75 // 3/4 -#define TWOPI 6.28318530717959 // 2*PI +using namespace MathExtra; #define BIG 1.0e20 -#define EPSILON 1e-10 // XYZ PLANE need to be 0,1,2 enum {NOSTYLE=-1,XPLANE=0,YPLANE=1,ZPLANE=2,ZCYLINDER,REGION}; - enum {NONE,CONSTANT,EQUAL}; -enum {DAMPING_NONE, VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; -enum {TANGENTIAL_NONE, TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, - TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; -enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; -enum {ROLL_NONE, ROLL_SDS}; /* ---------------------------------------------------------------------- */ @@ -72,237 +66,70 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix wall/gran requires atom style sphere"); create_attribute = 1; - limit_damping = 0; // set interaction style // disable bonded/history option for now + model = new ContactModel(); + model->wall_flag = 1; - if (strcmp(arg[3],"hooke") == 0) pairstyle = HOOKE; - else if (strcmp(arg[3],"hooke/history") == 0) pairstyle = HOOKE_HISTORY; - else if (strcmp(arg[3],"hertz/history") == 0) pairstyle = HERTZ_HISTORY; - else if (strcmp(arg[3],"granular") == 0) pairstyle = GRANULAR; - else error->all(FLERR,"Invalid fix wall/gran interaction style"); - - use_history = restart_peratom = 1; - if (pairstyle == HOOKE) use_history = restart_peratom = 0; - tangential_history = roll_history = twist_history = 0; - normal_model = NORMAL_NONE; - tangential_model = TANGENTIAL_NONE; - damping_model = DAMPING_NONE; + if (strcmp(arg[3],"granular") == 0) classic_flag = 0; + else classic_flag = 1; + limit_damping = 0; + heat_flag = 0; + int Twall_defined = 0; // wall/particle coefficients int iarg; - if (pairstyle != GRANULAR) { - size_history = 3; - if (narg < 11) error->all(FLERR,"Illegal fix wall/gran command"); + if (classic_flag) { + iarg = 3; + iarg = model->init_classic_model(arg, iarg, narg); - kn = utils::numeric(FLERR,arg[4],false,lmp); - if (strcmp(arg[5],"NULL") == 0) kt = kn * 2.0/7.0; - else kt = utils::numeric(FLERR,arg[5],false,lmp); - - gamman = utils::numeric(FLERR,arg[6],false,lmp); - if (strcmp(arg[7],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = utils::numeric(FLERR,arg[7],false,lmp); - - xmu = utils::numeric(FLERR,arg[8],false,lmp); - int dampflag = utils::inumeric(FLERR,arg[9],false,lmp); - if (dampflag == 0) gammat = 0.0; - - if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || - xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1) - error->all(FLERR,"Illegal fix wall/gran command"); - - // convert Kn and Kt from pressure units to force/distance^2 if Hertzian - - if (pairstyle == HERTZ_HISTORY) { - kn /= force->nktv2p; - kt /= force->nktv2p; - } - iarg = 10; - - if (strcmp(arg[iarg],"limit_damping") == 0) { - limit_damping = 1; - iarg += 1; + if (iarg < narg) { + if (strcmp(arg[iarg],"limit_damping") == 0) { + model->limit_damping = 1; + iarg += 1; + } } } else { - iarg = 4; - damping_model = VISCOELASTIC; - roll_model = twist_model = NONE; + iarg = 3; + model->init_model(std::string(arg[iarg]), NORMAL); + iarg += 1; + iarg = model->normal_model->parse_coeffs(arg, iarg, narg); + while (iarg < narg) { - if (strcmp(arg[iarg], "hooke") == 0) { - if (iarg + 2 >= narg) - error->all(FLERR,"Illegal fix wall/gran command, " - "not enough parameters provided for Hooke option"); - normal_model = NORMAL_HOOKE; - normal_coeffs[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); //kn - normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping - iarg += 3; - } else if (strcmp(arg[iarg], "hertz") == 0) { - int num_coeffs = 2; - if (iarg + num_coeffs >= narg) - error->all(FLERR,"Illegal fix wall/gran command, " - "not enough parameters provided for Hertz option"); - normal_model = NORMAL_HERTZ; - normal_coeffs[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); //kn - normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping - iarg += num_coeffs+1; - } else if (strcmp(arg[iarg], "hertz/material") == 0) { - int num_coeffs = 3; - if (iarg + num_coeffs >= narg) - error->all(FLERR,"Illegal fix wall/gran command, " - "not enough parameters provided for Hertz option"); - normal_model = HERTZ_MATERIAL; - Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E - normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping - poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio - normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; - normal_coeffs[2] = poiss; - iarg += num_coeffs+1; - } else if (strcmp(arg[iarg], "dmt") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal fix wall/gran command, " - "not enough parameters provided for Hertz option"); - normal_model = DMT; - Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E - normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping - poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio - normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; - normal_coeffs[2] = poiss; - normal_coeffs[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //cohesion - iarg += 5; - } else if (strcmp(arg[iarg], "jkr") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal wall/gran command, " - "not enough parameters provided for JKR option"); - normal_model = JKR; - Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E - normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping - poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio - normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; - normal_coeffs[2] = poiss; - normal_coeffs[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //cohesion - iarg += 5; - } else if (strcmp(arg[iarg], "damping") == 0) { - if (iarg+1 >= narg) - error->all(FLERR, "Illegal wall/gran command, " - "not enough parameters provided for damping model"); - if (strcmp(arg[iarg+1], "velocity") == 0) { - damping_model = VELOCITY; - iarg += 1; - } else if (strcmp(arg[iarg+1], "mass_velocity") == 0) { - damping_model = MASS_VELOCITY; - iarg += 1; - } else if (strcmp(arg[iarg+1], "viscoelastic") == 0) { - damping_model = VISCOELASTIC; - iarg += 1; - } else if (strcmp(arg[iarg+1], "tsuji") == 0) { - damping_model = TSUJI; - iarg += 1; - } else error->all(FLERR, "Illegal wall/gran command, " - "unrecognized damping model"); + if (strcmp(arg[iarg], "damping") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + model->init_model(std::string(arg[iarg]), DAMPING); iarg += 1; + iarg = model->damping_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "tangential") == 0) { if (iarg + 1 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "must specify tangential model after tangential keyword"); - if (strcmp(arg[iarg+1], "linear_nohistory") == 0) { - if (iarg + 3 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for tangential model"); - tangential_model = TANGENTIAL_NOHISTORY; - tangential_coeffs[0] = 0; - // gammat and friction coeff - tangential_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); - tangential_coeffs[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - iarg += 4; - } else if ((strcmp(arg[iarg+1], "linear_history") == 0) || - (strcmp(arg[iarg+1], "mindlin") == 0) || - (strcmp(arg[iarg+1], "mindlin_rescale") == 0) || - (strcmp(arg[iarg+1], "mindlin/force") == 0) || - (strcmp(arg[iarg+1], "mindlin_rescale/force") == 0)) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal pair_coeff command, " - "not enough parameters provided for tangential model"); - if (strcmp(arg[iarg+1], "linear_history") == 0) - tangential_model = TANGENTIAL_HISTORY; - else if (strcmp(arg[iarg+1], "mindlin") == 0) - tangential_model = TANGENTIAL_MINDLIN; - else if (strcmp(arg[iarg+1], "mindlin_rescale") == 0) - tangential_model = TANGENTIAL_MINDLIN_RESCALE; - else if (strcmp(arg[iarg+1], "mindlin/force") == 0) - tangential_model = TANGENTIAL_MINDLIN_FORCE; - else if (strcmp(arg[iarg+1], "mindlin_rescale/force") == 0) - tangential_model = TANGENTIAL_MINDLIN_RESCALE_FORCE; - if ((tangential_model == TANGENTIAL_MINDLIN || - tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_FORCE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) && - (strcmp(arg[iarg+2], "NULL") == 0)) { - if (normal_model == NORMAL_HERTZ || normal_model == NORMAL_HOOKE) { - error->all(FLERR, "NULL setting for Mindlin tangential " - "stiffness requires a normal contact model " - "that specifies material properties"); - } - tangential_coeffs[0] = Emod/4*(2-poiss)*(1+poiss); - } else { - tangential_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //kt - } - tangential_history = 1; - // gammat and friction coeff - tangential_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - tangential_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); - iarg += 5; - } else { - error->all(FLERR, "Illegal pair_coeff command, " - "tangential model not recognized"); - } + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + model->init_model(std::string(arg[iarg]), TANGENTIAL); + iarg += 1; + iarg = model->tangential_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "rolling") == 0) { if (iarg + 1 >= narg) - error->all(FLERR, "Illegal wall/gran command, not enough parameters"); - if (strcmp(arg[iarg+1], "none") == 0) { - roll_model = ROLL_NONE; - iarg += 2; - } else if (strcmp(arg[iarg+1], "sds") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal wall/gran command, " - "not enough parameters provided for rolling model"); - roll_model = ROLL_SDS; - roll_history = 1; - // kR, gammaR, rolling friction coeff - roll_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); - roll_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - roll_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); - iarg += 5; - } else { - error->all(FLERR, "Illegal wall/gran command, " - "rolling friction model not recognized"); - } + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + model->init_model(std::string(arg[iarg]), ROLLING); + iarg += 1; + iarg = model->rolling_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "twisting") == 0) { if (iarg + 1 >= narg) - error->all(FLERR, "Illegal wall/gran command, not enough parameters"); - if (strcmp(arg[iarg+1], "none") == 0) { - twist_model = TWIST_NONE; - iarg += 2; - } else if (strcmp(arg[iarg+1], "marshall") == 0) { - twist_model = TWIST_MARSHALL; - twist_history = 1; - iarg += 2; - } else if (strcmp(arg[iarg+1], "sds") == 0) { - if (iarg + 4 >= narg) - error->all(FLERR,"Illegal wall/gran command, " - "not enough parameters provided for twist model"); - twist_model = TWIST_SDS; - twist_history = 1; - twist_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //kt - twist_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); //gammat - twist_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //friction coeff. - iarg += 5; - } else { - error->all(FLERR, "Illegal wall/gran command, " - "twisting friction model not recognized"); - } + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + model->init_model(std::string(arg[iarg]), TWISTING); + iarg += 1; + iarg = model->twisting_model->parse_coeffs(arg, iarg, narg); + } else if (strcmp(arg[iarg], "heat") == 0) { + if (iarg + 1 >= narg) + error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); + model->init_model(std::string(arg[iarg]), HEAT); + iarg += 1; + iarg = model->heat_model->parse_coeffs(arg, iarg, narg); + heat_flag = 1; } else if (strcmp(arg[iarg], "xplane") == 0 || strcmp(arg[iarg], "yplane") == 0 || strcmp(arg[iarg], "zplane") == 0 || @@ -310,32 +137,35 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : strcmp(arg[iarg], "region") == 0) { break; } else if (strcmp(arg[iarg],"limit_damping") == 0) { - limit_damping = 1; + model->limit_damping = 1; iarg += 1; } else { error->all(FLERR, "Illegal fix wall/gran command"); } } - size_history = 3*tangential_history + 3*roll_history + twist_history; - //Unlike the pair style, the wall style does not have a 'touch' - //array. Hence, an additional entry in the history is used to - //determine if particles previously contacted for JKR cohesion purposes. - if (normal_model == JKR) size_history += 1; - if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) size_history += 1; - - if (limit_damping && normal_model == JKR) - error->all(FLERR,"Illegal pair_coeff command, " - "cannot limit damping with JRK model"); - if (limit_damping && normal_model == DMT) - error->all(FLERR,"Illegal pair_coeff command, " - "Cannot limit damping with DMT model"); } + // Define default damping model if unspecified, takes no args + if (!model->damping_model) + model->init_model("viscoelastic", DAMPING); + + //Dan original code didn't require tangential? + if (!model->tangential_model) error->all(FLERR, "No tangential?"); + + if (model->limit_damping && !model->normal_model->allow_limit_damping) + error->all(FLERR,"Illegal pair_coeff command, " + "Cannot limit damping with specified normal contact model"); + + size_history = model->size_history; + if (size_history == 0) use_history = restart_peratom = 0; + else use_history = restart_peratom = 1; + // wallstyle args idregion = nullptr; + if (iarg >= narg) error->all(FLERR, "Illegal fix wall/gran command"); + if (strcmp(arg[iarg],"xplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = XPLANE; @@ -371,8 +201,16 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : wallstyle = REGION; idregion = utils::strdup(arg[iarg+1]); iarg += 2; + } else if (strcmp(arg[iarg],"temperature") == 0) { + if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); + Twall = utils::numeric(FLERR,arg[iarg+1],false,lmp); + Twall_defined = 1; + iarg += 2; } else wallstyle = NOSTYLE; + if (heat_flag != Twall_defined) + error->all(FLERR, "To model conduction, must define both heat model and wall temperature"); + // optional args wiggle = 0; @@ -472,6 +310,8 @@ FixWallGran::~FixWallGran() atom->delete_callback(id,Atom::GROW); atom->delete_callback(id,Atom::RESTART); + delete model; + // delete local storage delete [] idregion; @@ -496,6 +336,7 @@ void FixWallGran::init() int i; dt = update->dt; + model->dt = dt; if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = (dynamic_cast( update->integrate))->nlevels; @@ -507,40 +348,26 @@ void FixWallGran::init() if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; - if(pairstyle == GRANULAR) { - tangential_history_index = 0; - if (roll_history) { - if (tangential_history) roll_history_index = 3; - else roll_history_index = 0; - } - if (twist_history) { - if (tangential_history) { - if (roll_history) twist_history_index = 6; - else twist_history_index = 3; - } - else{ - if (roll_history) twist_history_index = 3; - else twist_history_index = 0; - } - } - if (normal_model == JKR) { - tangential_history_index += 1; - roll_history_index += 1; - twist_history_index += 1; - } - if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { - roll_history_index += 1; - twist_history_index += 1; - } + // Define history indices + int size_normal_history = model->normal_model->size_history; + int size_tangential_history = model->tangential_model->size_history; + int size_damping_history = model->damping_model->size_history; - if (damping_model == TSUJI) { - double cor = normal_coeffs[1]; - normal_coeffs[1] = 1.2728-4.2783*cor+11.087*pow(cor,2)-22.348*pow(cor,3)+ - 27.467*pow(cor,4)-18.022*pow(cor,5)+ - 4.8218*pow(cor,6); - } - } + int size_rolling_history = 0; + int size_twisting_history = 0; + if (model->rolling_model) size_rolling_history = model->rolling_model->size_history; + if (model->twisting_model) size_twisting_history = model->twisting_model->size_history; + + damping_history_index = size_normal_history; + tangential_history_index = damping_history_index + size_damping_history; + roll_history_index = tangential_history_index + size_tangential_history; + twist_history_index = roll_history_index + size_rolling_history; + + model->normal_model->history_index = 0; + model->damping_model->history_index = damping_history_index; + model->tangential_model->history_index = tangential_history_index; + if (model->rolling_model) model->rolling_model->history_index = roll_history_index; + if (model->twisting_model) model->twisting_model->history_index = twist_history_index; } /* ---------------------------------------------------------------------- */ @@ -561,8 +388,11 @@ void FixWallGran::setup(int vflag) void FixWallGran::post_force(int /*vflag*/) { int i,j; - double dx,dy,dz,del1,del2,delxy,delr,rsq,rwall,meff; + double dx,dy,dz,del1,del2,delxy,delr,rwall,meff; + double *forces, *torquesi, dq; double vwall[3]; + double w0[3] = {0.0}; + bool touchflag = false; // do not update history during setup @@ -622,6 +452,11 @@ void FixWallGran::post_force(int /*vflag*/) double **torque = atom->torque; double *radius = atom->radius; double *rmass = atom->rmass; + double *temperature, *heatflux; + if (heat_flag) { + temperature = atom->temperature; + heatflux = atom->heatflux; + } int *mask = atom->mask; int nlocal = atom->nlocal; @@ -631,107 +466,105 @@ void FixWallGran::post_force(int /*vflag*/) clear_stored_contacts(); } + // Define constant wall properties (atom j) + model->radj = 0.0; + model->vj = vwall; + model->omegaj = w0; + if (heat_flag) model->Tj = Twall; + for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { + if (! mask[i] & groupbit) continue; - dx = dy = dz = 0.0; + dx = dy = dz = 0.0; - if (wallstyle == XPLANE) { - del1 = x[i][0] - wlo; - del2 = whi - x[i][0]; - if (del1 < del2) dx = del1; - else dx = -del2; - } else if (wallstyle == YPLANE) { - del1 = x[i][1] - wlo; - del2 = whi - x[i][1]; - if (del1 < del2) dy = del1; - else dy = -del2; - } else if (wallstyle == ZPLANE) { - del1 = x[i][2] - wlo; - del2 = whi - x[i][2]; - if (del1 < del2) dz = del1; - else dz = -del2; - } else if (wallstyle == ZCYLINDER) { - delxy = sqrt(x[i][0]*x[i][0] + x[i][1]*x[i][1]); - delr = cylradius - delxy; - if (delr > radius[i]) { - dz = cylradius; - rwall = 0.0; - } else { - dx = -delr/delxy * x[i][0]; - dy = -delr/delxy * x[i][1]; - // rwall = -2r_c if inside cylinder, 2r_c outside - rwall = (delxy < cylradius) ? -2*cylradius : 2*cylradius; - if (wshear && axis != 2) { - vwall[0] += vshear * x[i][1]/delxy; - vwall[1] += -vshear * x[i][0]/delxy; - vwall[2] = 0.0; - } + if (wallstyle == XPLANE) { + del1 = x[i][0] - wlo; + del2 = whi - x[i][0]; + if (del1 < del2) dx = del1; + else dx = -del2; + } else if (wallstyle == YPLANE) { + del1 = x[i][1] - wlo; + del2 = whi - x[i][1]; + if (del1 < del2) dy = del1; + else dy = -del2; + } else if (wallstyle == ZPLANE) { + del1 = x[i][2] - wlo; + del2 = whi - x[i][2]; + if (del1 < del2) dz = del1; + else dz = -del2; + } else if (wallstyle == ZCYLINDER) { + delxy = sqrt(x[i][0]*x[i][0] + x[i][1]*x[i][1]); + delr = cylradius - delxy; + if (delr > radius[i]) { + dz = cylradius; + rwall = 0.0; + } else { + dx = -delr/delxy * x[i][0]; + dy = -delr/delxy * x[i][1]; + // rwall = -2r_c if inside cylinder, 2r_c outside + rwall = (delxy < cylradius) ? -2*cylradius : 2*cylradius; + if (wshear && axis != 2) { + vwall[0] += vshear * x[i][1]/delxy; + vwall[1] += -vshear * x[i][0]/delxy; + vwall[2] = 0.0; } } + } - rsq = dx*dx + dy*dy + dz*dz; + // Reset model and copy initial geometric data + model->reset_contact(); + model->xi = x[i]; + model->dx[0] = dx; + model->dx[1] = dy; + model->dx[2] = dz; + model->radi = radius[i]; + model->rwall = rwall; - double rad; - if (pairstyle == GRANULAR && normal_model == JKR) { - rad = radius[i] + pulloff_distance(radius[i]); - } - else - rad = radius[i]; + touchflag = model->check_contact(); - if (rsq > rad*rad) { - if (use_history) - for (j = 0; j < size_history; j++) - history_one[i][j] = 0.0; - } - else { - if (pairstyle == GRANULAR && normal_model == JKR && use_history) { - if ((history_one[i][0] == 0) && (rsq > radius[i]*radius[i])) { - // Particles have not contacted yet, - // and are outside of contact distance - for (j = 0; j < size_history; j++) - history_one[i][j] = 0.0; - continue; - } - } + if (!touchflag) { + if (use_history) + for (j = 0; j < size_history; j++) + history_one[i][j] = 0.0; + } else { - // meff = effective mass of sphere - // if I is part of rigid body, use body mass + // meff = effective mass of sphere + // if I is part of rigid body, use body mass - meff = rmass[i]; - if (fix_rigid && mass_rigid[i] > 0.0) meff = mass_rigid[i]; + meff = rmass[i]; + if (fix_rigid && mass_rigid[i] > 0.0) meff = mass_rigid[i]; - // store contact info - if (peratom_flag) { - array_atom[i][0] = 1.0; - array_atom[i][4] = x[i][0] - dx; - array_atom[i][5] = x[i][1] - dy; - array_atom[i][6] = x[i][2] - dz; - array_atom[i][7] = radius[i]; - } + // Copy additional information and prepare force calculations + model->meff = meff; + model->vi = v[i]; + model->omegai = omega[i]; + model->history_update = history_update; + if (use_history) model->history = history_one[i]; + if (heat_flag) model->Ti = temperature[i]; + model->prep_contact(); - // invoke sphere/wall interaction - double *contact; - if (peratom_flag) - contact = array_atom[i]; - else - contact = nullptr; + model->calculate_forces(); + if (heat_flag) dq = model->calculate_heat(); - if (pairstyle == HOOKE) - hooke(rsq,dx,dy,dz,vwall,v[i],f[i], - omega[i],torque[i],radius[i],meff, contact); - else if (pairstyle == HOOKE_HISTORY) - hooke_history(rsq,dx,dy,dz,vwall,v[i],f[i], - omega[i],torque[i],radius[i],meff,history_one[i], - contact); - else if (pairstyle == HERTZ_HISTORY) - hertz_history(rsq,dx,dy,dz,vwall,rwall,v[i],f[i], - omega[i],torque[i],radius[i],meff,history_one[i], - contact); - else if (pairstyle == GRANULAR) - granular(rsq,dx,dy,dz,vwall,rwall,v[i],f[i], - omega[i],torque[i],radius[i],meff,history_one[i], - contact); + forces = model->forces; + torquesi = model->torquesi; + + // apply forces & torques + add3(f[i], forces, f[i]); + + add3(torque[i], torquesi, torque[i]); + if (heat_flag) heatflux[i] += dq; + + // store contact info + if (peratom_flag) { + array_atom[i][0] = 1.0; + array_atom[i][1] = forces[0]; + array_atom[i][2] = forces[1]; + array_atom[i][3] = forces[2]; + array_atom[i][4] = x[i][0] - dx; + array_atom[i][5] = x[i][1] - dy; + array_atom[i][6] = x[i][2] - dz; + array_atom[i][7] = radius[i]; } } } @@ -753,789 +586,6 @@ void FixWallGran::post_force_respa(int vflag, int ilevel, int /*iloop*/) if (ilevel == nlevels_respa-1) post_force(vflag); } -/* ---------------------------------------------------------------------- */ - -void FixWallGran::hooke(double rsq, double dx, double dy, double dz, - double *vwall, double *v, - double *f, double *omega, double *torque, - double radius, double meff, double* contact) -{ - double r,vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; - double wr1,wr2,wr3,damp,ccel,vtr1,vtr2,vtr3,vrel; - double fn,fs,ft,fs1,fs2,fs3,fx,fy,fz,tor1,tor2,tor3,rinv,rsqinv; - - r = sqrt(rsq); - rinv = 1.0/r; - rsqinv = 1.0/rsq; - - // relative translational velocity - - vr1 = v[0] - vwall[0]; - vr2 = v[1] - vwall[1]; - vr3 = v[2] - vwall[2]; - - // normal component - - vnnr = vr1*dx + vr2*dy + vr3*dz; - vn1 = dx*vnnr * rsqinv; - vn2 = dy*vnnr * rsqinv; - vn3 = dz*vnnr * rsqinv; - - // tangential component - - vt1 = vr1 - vn1; - vt2 = vr2 - vn2; - vt3 = vr3 - vn3; - - // relative rotational velocity - - wr1 = radius*omega[0] * rinv; - wr2 = radius*omega[1] * rinv; - wr3 = radius*omega[2] * rinv; - - // normal forces = Hookian contact + normal velocity damping - - damp = meff*gamman*vnnr*rsqinv; - ccel = kn*(radius-r)*rinv - damp; - if (limit_damping && (ccel < 0.0)) ccel = 0.0; - - // relative velocities - - vtr1 = vt1 - (dz*wr2-dy*wr3); - vtr2 = vt2 - (dx*wr3-dz*wr1); - vtr3 = vt3 - (dy*wr1-dx*wr2); - vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3; - vrel = sqrt(vrel); - - // force normalization - - fn = xmu * fabs(ccel*r); - fs = meff*gammat*vrel; - if (vrel != 0.0) ft = MIN(fn,fs) / vrel; - else ft = 0.0; - - // tangential force due to tangential velocity damping - - fs1 = -ft*vtr1; - fs2 = -ft*vtr2; - fs3 = -ft*vtr3; - - // forces & torques - - fx = dx*ccel + fs1; - fy = dy*ccel + fs2; - fz = dz*ccel + fs3; - - if (peratom_flag) { - contact[1] = fx; - contact[2] = fy; - contact[3] = fz; - } - - f[0] += fx; - f[1] += fy; - f[2] += fz; - - tor1 = rinv * (dy*fs3 - dz*fs2); - tor2 = rinv * (dz*fs1 - dx*fs3); - tor3 = rinv * (dx*fs2 - dy*fs1); - torque[0] -= radius*tor1; - torque[1] -= radius*tor2; - torque[2] -= radius*tor3; -} - -/* ---------------------------------------------------------------------- */ - -void FixWallGran::hooke_history(double rsq, double dx, double dy, double dz, - double *vwall, double *v, - double *f, double *omega, double *torque, - double radius, double meff, double *history, - double *contact) -{ - double r,vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; - double wr1,wr2,wr3,damp,ccel,vtr1,vtr2,vtr3,vrel; - double fn,fs,fs1,fs2,fs3,fx,fy,fz,tor1,tor2,tor3; - double shrmag,rsht,rinv,rsqinv; - - r = sqrt(rsq); - rinv = 1.0/r; - rsqinv = 1.0/rsq; - - // relative translational velocity - - vr1 = v[0] - vwall[0]; - vr2 = v[1] - vwall[1]; - vr3 = v[2] - vwall[2]; - - // normal component - - vnnr = vr1*dx + vr2*dy + vr3*dz; - vn1 = dx*vnnr * rsqinv; - vn2 = dy*vnnr * rsqinv; - vn3 = dz*vnnr * rsqinv; - - // tangential component - - vt1 = vr1 - vn1; - vt2 = vr2 - vn2; - vt3 = vr3 - vn3; - - // relative rotational velocity - - wr1 = radius*omega[0] * rinv; - wr2 = radius*omega[1] * rinv; - wr3 = radius*omega[2] * rinv; - - // normal forces = Hookian contact + normal velocity damping - - damp = meff*gamman*vnnr*rsqinv; - ccel = kn*(radius-r)*rinv - damp; - if (limit_damping && (ccel < 0.0)) ccel = 0.0; - - // relative velocities - - vtr1 = vt1 - (dz*wr2-dy*wr3); - vtr2 = vt2 - (dx*wr3-dz*wr1); - vtr3 = vt3 - (dy*wr1-dx*wr2); - vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3; - vrel = sqrt(vrel); - - // shear history effects - - if (history_update) { - history[0] += vtr1*dt; - history[1] += vtr2*dt; - history[2] += vtr3*dt; - } - shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + - history[2]*history[2]); - - // rotate shear displacements - - rsht = history[0]*dx + history[1]*dy + history[2]*dz; - rsht = rsht*rsqinv; - if (history_update) { - history[0] -= rsht*dx; - history[1] -= rsht*dy; - history[2] -= rsht*dz; - } - - // tangential forces = shear + tangential velocity damping - - fs1 = - (kt*history[0] + meff*gammat*vtr1); - fs2 = - (kt*history[1] + meff*gammat*vtr2); - fs3 = - (kt*history[2] + meff*gammat*vtr3); - - // rescale frictional displacements and forces if needed - - fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3); - fn = xmu * fabs(ccel*r); - - if (fs > fn) { - if (shrmag != 0.0) { - history[0] = (fn/fs) * (history[0] + meff*gammat*vtr1/kt) - - meff*gammat*vtr1/kt; - history[1] = (fn/fs) * (history[1] + meff*gammat*vtr2/kt) - - meff*gammat*vtr2/kt; - history[2] = (fn/fs) * (history[2] + meff*gammat*vtr3/kt) - - meff*gammat*vtr3/kt; - fs1 *= fn/fs ; - fs2 *= fn/fs; - fs3 *= fn/fs; - } else fs1 = fs2 = fs3 = 0.0; - } - - // forces & torques - - fx = dx*ccel + fs1; - fy = dy*ccel + fs2; - fz = dz*ccel + fs3; - - f[0] += fx; - f[1] += fy; - f[2] += fz; - - if (peratom_flag) { - contact[1] = fx; - contact[2] = fy; - contact[3] = fz; - } - - tor1 = rinv * (dy*fs3 - dz*fs2); - tor2 = rinv * (dz*fs1 - dx*fs3); - tor3 = rinv * (dx*fs2 - dy*fs1); - torque[0] -= radius*tor1; - torque[1] -= radius*tor2; - torque[2] -= radius*tor3; -} - -/* ---------------------------------------------------------------------- */ - -void FixWallGran::hertz_history(double rsq, double dx, double dy, double dz, - double *vwall, double rwall, double *v, - double *f, double *omega, double *torque, - double radius, double meff, double *history, - double *contact) -{ - double r,vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; - double wr1,wr2,wr3,damp,ccel,vtr1,vtr2,vtr3,vrel; - double fn,fs,fs1,fs2,fs3,fx,fy,fz,tor1,tor2,tor3; - double shrmag,rsht,polyhertz,rinv,rsqinv; - - r = sqrt(rsq); - rinv = 1.0/r; - rsqinv = 1.0/rsq; - - // relative translational velocity - - vr1 = v[0] - vwall[0]; - vr2 = v[1] - vwall[1]; - vr3 = v[2] - vwall[2]; - - // normal component - - vnnr = vr1*dx + vr2*dy + vr3*dz; - vn1 = dx*vnnr / rsq; - vn2 = dy*vnnr / rsq; - vn3 = dz*vnnr / rsq; - - // tangential component - - vt1 = vr1 - vn1; - vt2 = vr2 - vn2; - vt3 = vr3 - vn3; - - // relative rotational velocity - - wr1 = radius*omega[0] * rinv; - wr2 = radius*omega[1] * rinv; - wr3 = radius*omega[2] * rinv; - - // normal forces = Hertzian contact + normal velocity damping - // rwall = 0 is flat wall case - // rwall positive or negative is curved wall - // will break (as it should) if rwall is negative and - // its absolute value < radius of particle - - damp = meff*gamman*vnnr*rsqinv; - ccel = kn*(radius-r)*rinv - damp; - if (rwall == 0.0) polyhertz = sqrt((radius-r)*radius); - else polyhertz = sqrt((radius-r)*radius*rwall/(rwall+radius)); - ccel *= polyhertz; - if (limit_damping && (ccel < 0.0)) ccel = 0.0; - - // relative velocities - - vtr1 = vt1 - (dz*wr2-dy*wr3); - vtr2 = vt2 - (dx*wr3-dz*wr1); - vtr3 = vt3 - (dy*wr1-dx*wr2); - vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3; - vrel = sqrt(vrel); - - // shear history effects - - if (history_update) { - history[0] += vtr1*dt; - history[1] += vtr2*dt; - history[2] += vtr3*dt; - } - shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + - history[2]*history[2]); - - // rotate history displacements - - rsht = history[0]*dx + history[1]*dy + history[2]*dz; - rsht = rsht*rsqinv; - if (history_update) { - history[0] -= rsht*dx; - history[1] -= rsht*dy; - history[2] -= rsht*dz; - } - - // tangential forces = shear + tangential velocity damping - - fs1 = -polyhertz * (kt*history[0] + meff*gammat*vtr1); - fs2 = -polyhertz * (kt*history[1] + meff*gammat*vtr2); - fs3 = -polyhertz * (kt*history[2] + meff*gammat*vtr3); - - // rescale frictional displacements and forces if needed - - fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3); - fn = xmu * fabs(ccel*r); - - if (fs > fn) { - if (shrmag != 0.0) { - history[0] = (fn/fs) * (history[0] + meff*gammat*vtr1/kt) - - meff*gammat*vtr1/kt; - history[1] = (fn/fs) * (history[1] + meff*gammat*vtr2/kt) - - meff*gammat*vtr2/kt; - history[2] = (fn/fs) * (history[2] + meff*gammat*vtr3/kt) - - meff*gammat*vtr3/kt; - fs1 *= fn/fs ; - fs2 *= fn/fs; - fs3 *= fn/fs; - } else fs1 = fs2 = fs3 = 0.0; - } - - // forces & torques - - fx = dx*ccel + fs1; - fy = dy*ccel + fs2; - fz = dz*ccel + fs3; - - if (peratom_flag) { - contact[1] = fx; - contact[2] = fy; - contact[3] = fz; - } - - f[0] += fx; - f[1] += fy; - f[2] += fz; - - tor1 = rinv * (dy*fs3 - dz*fs2); - tor2 = rinv * (dz*fs1 - dx*fs3); - tor3 = rinv * (dx*fs2 - dy*fs1); - torque[0] -= radius*tor1; - torque[1] -= radius*tor2; - torque[2] -= radius*tor3; -} - -/* ---------------------------------------------------------------------- */ - -void FixWallGran::granular(double rsq, double dx, double dy, double dz, - double *vwall, double rwall, double *v, - double *f, double *omega, double *torque, - double radius, double meff, double *history, - double *contact) -{ - double fx,fy,fz,nx,ny,nz; - double r,rinv; - double Reff, delta, dR, dR2; - - double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; - double wr1,wr2,wr3; - double vtr1,vtr2,vtr3,vrel; - - double knfac, damp_normal, damp_normal_prefactor; - double k_tangential, damp_tangential; - double Fne, Ft, Fdamp, Fntot, Fncrit, Fscrit, Frcrit; - double fs, fs1, fs2, fs3; - - double tor1,tor2,tor3; - double relrot1,relrot2,relrot3,vrl1,vrl2,vrl3; - - // for JKR - double R2, coh, F_pulloff, a, a2, E; - double t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3; - - // rolling - double k_roll, damp_roll; - double torroll1, torroll2, torroll3; - double rollmag, rolldotn, scalefac; - double fr, fr1, fr2, fr3; - - // twisting - double k_twist, damp_twist, mu_twist; - double signtwist, magtwist, magtortwist, Mtcrit; - double tortwist1, tortwist2, tortwist3; - - double shrmag,rsht,prjmag; - bool frameupdate; - - r = sqrt(rsq); - E = normal_coeffs[0]; - - if (rwall == 0) Reff = radius; - else Reff = radius*rwall/(radius+rwall); - - rinv = 1.0/r; - - nx = dx*rinv; - ny = dy*rinv; - nz = dz*rinv; - - // relative translational velocity - - vr1 = v[0] - vwall[0]; - vr2 = v[1] - vwall[1]; - vr3 = v[2] - vwall[2]; - - // normal component - - vnnr = vr1*nx + vr2*ny + vr3*nz; //v_R . n - vn1 = nx*vnnr; - vn2 = ny*vnnr; - vn3 = nz*vnnr; - - delta = radius - r; - dR = delta*Reff; - if (normal_model == JKR) { - history[0] = 1.0; - E *= THREEQUARTERS; - R2=Reff*Reff; - coh = normal_coeffs[3]; - dR2 = dR*dR; - t0 = coh*coh*R2*R2*E; - t1 = PI27SQ*t0; - t2 = 8*dR*dR2*E*E*E; - t3 = 4*dR2*E; - sqrt1 = MAX(0, t0*(t1+2*t2)); // in case sqrt(0) < 0 due to precision issues - t4 = cbrt(t1+t2+THREEROOT3*MY_PI*sqrt(sqrt1)); - t5 = t3/t4 + t4/E; - sqrt2 = MAX(0, 2*dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4*dR - t5 + SIXROOT6*coh*MY_PI*R2/(E*t6)); - a = INVROOT6*(t6 + sqrt(sqrt3)); - a2 = a*a; - knfac = normal_coeffs[0]*a; - Fne = knfac*a2/Reff - TWOPI*a2*sqrt(4*coh*E/(MY_PI*a)); - } else { - knfac = E; //Hooke - a = sqrt(dR); - Fne = knfac*delta; - if (normal_model != NORMAL_HOOKE) { - Fne *= a; - knfac *= a; - } - if (normal_model == DMT) - Fne -= 4*MY_PI*normal_coeffs[3]*Reff; - } - - if (damping_model == VELOCITY) { - damp_normal = 1; - } else if (damping_model == MASS_VELOCITY) { - damp_normal = meff; - } else if (damping_model == VISCOELASTIC) { - damp_normal = a*meff; - } else if (damping_model == TSUJI) { - damp_normal = sqrt(meff*knfac); - } else damp_normal = 0.0; - - damp_normal_prefactor = normal_coeffs[1]*damp_normal; - Fdamp = -damp_normal_prefactor*vnnr; - - Fntot = Fne + Fdamp; - if (limit_damping && (Fntot < 0.0)) Fntot = 0.0; - - //**************************************** - // tangential force, including history effects - //**************************************** - - // For linear, mindlin, mindlin_rescale: - // history = cumulative tangential displacement - // - // For mindlin/force, mindlin_rescale/force: - // history = cumulative tangential elastic force - - // tangential component - vt1 = vr1 - vn1; - vt2 = vr2 - vn2; - vt3 = vr3 - vn3; - - // relative rotational velocity - wr1 = radius*omega[0]; - wr2 = radius*omega[1]; - wr3 = radius*omega[2]; - - // relative tangential velocities - vtr1 = vt1 - (nz*wr2-ny*wr3); - vtr2 = vt2 - (nx*wr3-nz*wr1); - vtr3 = vt3 - (ny*wr1-nx*wr2); - vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3; - vrel = sqrt(vrel); - - if (normal_model == JKR) { - F_pulloff = 3*MY_PI*coh*Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } - else if (normal_model == DMT) { - F_pulloff = 4*MY_PI*coh*Reff; - Fncrit = fabs(Fne + 2*F_pulloff); - } - else{ - Fncrit = fabs(Fntot); - } - - //------------------------------ - // tangential forces - //------------------------------ - - k_tangential = tangential_coeffs[0]; - damp_tangential = tangential_coeffs[1]*damp_normal_prefactor; - Fscrit = tangential_coeffs[2] * Fncrit; - - int thist0 = tangential_history_index; - int thist1 = thist0 + 1; - int thist2 = thist1 + 1; - - if (tangential_history) { - if (tangential_model == TANGENTIAL_MINDLIN || - tangential_model == TANGENTIAL_MINDLIN_FORCE) { - k_tangential *= a; - } - else if (tangential_model == - TANGENTIAL_MINDLIN_RESCALE || - tangential_model == - TANGENTIAL_MINDLIN_RESCALE_FORCE){ - k_tangential *= a; - // on unloading, rescale the shear displacements/force - if (a < history[thist2+1]) { - double factor = a/history[thist2+1]; - history[thist0] *= factor; - history[thist1] *= factor; - history[thist2] *= factor; - } - } - - - // rotate and update displacements. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (history_update) { - rsht = history[thist0]*nx + history[thist1]*ny + history[thist2]*nz; - if (tangential_model == TANGENTIAL_MINDLIN_FORCE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - frameupdate = fabs(rsht) > EPSILON*Fscrit; - else - frameupdate = fabs(rsht)*k_tangential > EPSILON*Fscrit; - if (frameupdate) { - shrmag = sqrt(history[thist0]*history[thist0] + - history[thist1]*history[thist1] + - history[thist2]*history[thist2]); - // projection - history[thist0] -= rsht*nx; - history[thist1] -= rsht*ny; - history[thist2] -= rsht*nz; - - // also rescale to preserve magnitude - prjmag = sqrt(history[thist0]*history[thist0] + - history[thist1]*history[thist1] + history[thist2]*history[thist2]); - if (prjmag > 0) scalefac = shrmag/prjmag; - else scalefac = 0; - history[thist0] *= scalefac; - history[thist1] *= scalefac; - history[thist2] *= scalefac; - } - // update history - if (tangential_model == TANGENTIAL_HISTORY || - tangential_model == TANGENTIAL_MINDLIN || - tangential_model == TANGENTIAL_MINDLIN_RESCALE) { - history[thist0] += vtr1*dt; - history[thist1] += vtr2*dt; - history[thist2] += vtr3*dt; - } else{ - // tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - history[thist0] -= k_tangential*vtr1*dt; - history[thist1] -= k_tangential*vtr2*dt; - history[thist2] -= k_tangential*vtr3*dt; - } - if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) - history[thist2+1] = a; - } - - // tangential forces = history + tangential velocity damping - if (tangential_model == TANGENTIAL_HISTORY || - tangential_model == TANGENTIAL_MINDLIN || - tangential_model == TANGENTIAL_MINDLIN_RESCALE) { - fs1 = -k_tangential*history[thist0] - damp_tangential*vtr1; - fs2 = -k_tangential*history[thist1] - damp_tangential*vtr2; - fs3 = -k_tangential*history[thist2] - damp_tangential*vtr3; - } else { - fs1 = history[thist0] - damp_tangential*vtr1; - fs2 = history[thist1] - damp_tangential*vtr2; - fs3 = history[thist2] - damp_tangential*vtr3; - } - - // rescale frictional displacements and forces if needed - fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3); - if (fs > Fscrit) { - shrmag = sqrt(history[thist0]*history[thist0] + - history[thist1]*history[thist1] + - history[thist2]*history[thist2]); - if (shrmag != 0.0) { - if (tangential_model == TANGENTIAL_HISTORY || - tangential_model == TANGENTIAL_MINDLIN || - tangential_model == - TANGENTIAL_MINDLIN_RESCALE) { - history[thist0] = -1.0/k_tangential*(Fscrit*fs1/fs + - damp_tangential*vtr1); - history[thist1] = -1.0/k_tangential*(Fscrit*fs2/fs + - damp_tangential*vtr2); - history[thist2] = -1.0/k_tangential*(Fscrit*fs3/fs + - damp_tangential*vtr3); - } else { - history[thist0] = Fscrit*fs1/fs + damp_tangential*vtr1; - history[thist1] = Fscrit*fs2/fs + damp_tangential*vtr2; - history[thist2] = Fscrit*fs3/fs + damp_tangential*vtr3; - } - fs1 *= Fscrit/fs; - fs2 *= Fscrit/fs; - fs3 *= Fscrit/fs; - } else fs1 = fs2 = fs3 = 0.0; - } - } else { // classic pair gran/hooke (no history) - fs = damp_tangential*vrel; - if (vrel != 0.0) Ft = MIN(Fscrit,fs) / vrel; - else Ft = 0.0; - fs1 = -Ft*vtr1; - fs2 = -Ft*vtr2; - fs3 = -Ft*vtr3; - } - - //**************************************** - // rolling resistance - //**************************************** - - if (roll_model != ROLL_NONE || twist_model != TWIST_NONE) { - relrot1 = omega[0]; - relrot2 = omega[1]; - relrot3 = omega[2]; - } - if (roll_model != ROLL_NONE) { - // rolling velocity, - // see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) - // This is different from the Marshall papers, - // which use the Bagi/Kuhn formulation - // for rolling velocity (see Wang et al for why the latter is wrong) - vrl1 = Reff*(relrot2*nz - relrot3*ny); //- 0.5*((radj-radi)/radsum)*vtr1; - vrl2 = Reff*(relrot3*nx - relrot1*nz); //- 0.5*((radj-radi)/radsum)*vtr2; - vrl3 = Reff*(relrot1*ny - relrot2*nx); //- 0.5*((radj-radi)/radsum)*vtr3; - - int rhist0 = roll_history_index; - int rhist1 = rhist0 + 1; - int rhist2 = rhist1 + 1; - - k_roll = roll_coeffs[0]; - damp_roll = roll_coeffs[1]; - Frcrit = roll_coeffs[2] * Fncrit; - - if (history_update) { - rolldotn = history[rhist0]*nx + history[rhist1]*ny + history[rhist2]*nz; - frameupdate = fabs(rolldotn)*k_roll > EPSILON*Frcrit; - if (frameupdate) { // rotate into tangential plane - rollmag = sqrt(history[rhist0]*history[rhist0] + - history[rhist1]*history[rhist1] + - history[rhist2]*history[rhist2]); - // projection - history[rhist0] -= rolldotn*nx; - history[rhist1] -= rolldotn*ny; - history[rhist2] -= rolldotn*nz; - - // also rescale to preserve magnitude - prjmag = sqrt(history[rhist0]*history[rhist0] + - history[rhist1]*history[rhist1] + - history[rhist2]*history[rhist2]); - - if (prjmag > 0) scalefac = rollmag/prjmag; - else scalefac = 0; - history[rhist0] *= scalefac; - history[rhist1] *= scalefac; - history[rhist2] *= scalefac; - } - history[rhist0] += vrl1*dt; - history[rhist1] += vrl2*dt; - history[rhist2] += vrl3*dt; - } - - fr1 = -k_roll*history[rhist0] - damp_roll*vrl1; - fr2 = -k_roll*history[rhist1] - damp_roll*vrl2; - fr3 = -k_roll*history[rhist2] - damp_roll*vrl3; - - // rescale frictional displacements and forces if needed - fr = sqrt(fr1*fr1 + fr2*fr2 + fr3*fr3); - if (fr > Frcrit) { - rollmag = sqrt(history[rhist0]*history[rhist0] + - history[rhist1]*history[rhist1] + - history[rhist2]*history[rhist2]); - if (rollmag != 0.0) { - history[rhist0] = -1.0/k_roll*(Frcrit*fr1/fr + damp_roll*vrl1); - history[rhist1] = -1.0/k_roll*(Frcrit*fr2/fr + damp_roll*vrl2); - history[rhist2] = -1.0/k_roll*(Frcrit*fr3/fr + damp_roll*vrl3); - fr1 *= Frcrit/fr; - fr2 *= Frcrit/fr; - fr3 *= Frcrit/fr; - } else fr1 = fr2 = fr3 = 0.0; - } - } - - //**************************************** - // twisting torque, including history effects - //**************************************** - - if (twist_model != TWIST_NONE) { - magtwist = relrot1*nx + relrot2*ny + relrot3*nz; //Omega_T (eq 29 of Marshall) - if (twist_model == TWIST_MARSHALL) { - k_twist = 0.5*k_tangential*a*a;; // eq 32 of Marshall paper - damp_twist = 0.5*damp_tangential*a*a; - mu_twist = TWOTHIRDS*a*tangential_coeffs[2]; - } - else{ - k_twist = twist_coeffs[0]; - damp_twist = twist_coeffs[1]; - mu_twist = twist_coeffs[2]; - } - if (history_update) { - history[twist_history_index] += magtwist*dt; - } - // M_t torque (eq 30) - magtortwist = -k_twist*history[twist_history_index] - damp_twist*magtwist; - signtwist = (magtwist > 0) - (magtwist < 0); - Mtcrit = mu_twist*Fncrit; // critical torque (eq 44) - if (fabs(magtortwist) > Mtcrit) { - history[twist_history_index] = 1.0/k_twist*(Mtcrit*signtwist - - damp_twist*magtwist); - magtortwist = -Mtcrit * signtwist; // eq 34 - } - } - - // apply forces & torques - - fx = nx*Fntot + fs1; - fy = ny*Fntot + fs2; - fz = nz*Fntot + fs3; - - if (peratom_flag) { - contact[1] = fx; - contact[2] = fy; - contact[3] = fz; - } - - f[0] += fx; - f[1] += fy; - f[2] += fz; - - tor1 = ny*fs3 - nz*fs2; - tor2 = nz*fs1 - nx*fs3; - tor3 = nx*fs2 - ny*fs1; - - torque[0] -= radius*tor1; - torque[1] -= radius*tor2; - torque[2] -= radius*tor3; - - if (twist_model != TWIST_NONE) { - tortwist1 = magtortwist * nx; - tortwist2 = magtortwist * ny; - tortwist3 = magtortwist * nz; - - torque[0] += tortwist1; - torque[1] += tortwist2; - torque[2] += tortwist3; - } - - if (roll_model != ROLL_NONE) { - torroll1 = Reff*(ny*fr3 - nz*fr2); //n cross fr - torroll2 = Reff*(nz*fr1 - nx*fr3); - torroll3 = Reff*(nx*fr2 - ny*fr1); - - torque[0] += torroll1; - torque[1] += torroll2; - torque[2] += torroll3; - } -} - /* ---------------------------------------------------------------------- memory usage of local atom-based arrays ------------------------------------------------------------------------- */ @@ -1692,14 +742,3 @@ void FixWallGran::reset_dt() { dt = update->dt; } - -double FixWallGran::pulloff_distance(double radius) -{ - double coh, E, a, dist; - coh = normal_coeffs[3]; - E = normal_coeffs[0]*THREEQUARTERS; - a = cbrt(9*MY_PI*coh*radius/(4*E)); - dist = a*a/radius - 2*sqrt(MY_PI*coh*a/E); - return dist; -} - diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 8c69be6e16..d0202d65e8 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -20,15 +20,13 @@ FixStyle(wall/gran,FixWallGran); #ifndef LMP_FIX_WALL_GRAN_H #define LMP_FIX_WALL_GRAN_H +#include "contact.h" #include "fix.h" namespace LAMMPS_NS { class FixWallGran : public Fix { public: - enum { HOOKE, HOOKE_HISTORY, HERTZ_HISTORY, GRANULAR }; - enum { NORMAL_NONE, NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR }; - FixWallGran(class LAMMPS *, int, char **); ~FixWallGran() override; int setmask() override; @@ -49,54 +47,32 @@ class FixWallGran : public Fix { int maxsize_restart() override; void reset_dt() override; - void hooke(double, double, double, double, double *, double *, double *, double *, double *, - double, double, double *); - void hooke_history(double, double, double, double, double *, double *, double *, double *, - double *, double, double, double *, double *); - void hertz_history(double, double, double, double, double *, double, double *, double *, double *, - double *, double, double, double *, double *); - void granular(double, double, double, double, double *, double, double *, double *, double *, - double *, double, double, double *, double *); - - double pulloff_distance(double); - protected: int wallstyle, wiggle, wshear, axis; - int pairstyle, nlevels_respa; + int classic_flag, nlevels_respa; bigint time_origin; - double kn, kt, gamman, gammat, xmu; // for granular model choices - int normal_model, damping_model; - int tangential_model, roll_model, twist_model; - int limit_damping; - - // history flags - int normal_history, tangential_history, roll_history, twist_history; + Contact::ContactModel *model; // indices of history entries int normal_history_index; + int damping_history_index; int tangential_history_index; int roll_history_index; int twist_history_index; - // material coefficients - double Emod, poiss, Gmod; - - // contact model coefficients - double normal_coeffs[4]; - double tangential_coeffs[3]; - double roll_coeffs[3]; - double twist_coeffs[3]; - double lo, hi, cylradius; double amplitude, period, omega, vshear; double dt; + double Twall; char *idregion; int use_history; // if particle/wall interaction stores history int history_update; // flag for whether shear history is updated int size_history; // # of shear history values per contact + int heat_flag; + int limit_damping; // shear history for single contact per particle diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 6509c88a0b..c288abf92e 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -23,6 +23,7 @@ #include "error.h" #include "memory.h" #include "neighbor.h" +#include "math_extra.h" #include "region.h" #include "update.h" @@ -30,6 +31,7 @@ using namespace LAMMPS_NS; using namespace FixConst; +using namespace MathExtra; /* ---------------------------------------------------------------------- */ @@ -117,8 +119,11 @@ void FixWallGranRegion::init() void FixWallGranRegion::post_force(int /*vflag*/) { int i, m, nc, iwall; - double dx, dy, dz, rsq, meff; + double dx, dy, dz, meff; + double *forces, *torquesi, dq, rwall; double vwall[3]; + double w0[3] = {0.0}; + bool touchflag = false; // do not update shear history during setup @@ -158,7 +163,11 @@ void FixWallGranRegion::post_force(int /*vflag*/) double **torque = atom->torque; double *radius = atom->radius; double *rmass = atom->rmass; - + double *temperature, *heatflux; + if (heat_flag) { + temperature = atom->temperature; + heatflux = atom->heatflux; + } int *mask = atom->mask; int nlocal = atom->nlocal; @@ -172,95 +181,105 @@ void FixWallGranRegion::post_force(int /*vflag*/) if (peratom_flag) { clear_stored_contacts(); } + // Define constant wall properties (atom j) + model->radj = 0.0; + model->omegaj = w0; + if (heat_flag) model->Tj = Twall; + for (i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { - if (!region->match(x[i][0], x[i][1], x[i][2])) continue; + if (! mask[i] & groupbit) continue; + if (!region->match(x[i][0], x[i][1], x[i][2]))continue; - if (pairstyle == FixWallGran::GRANULAR && normal_model == FixWallGran::JKR) { - nc = region->surface(x[i][0], x[i][1], x[i][2], radius[i] + pulloff_distance(radius[i])); - } else { - nc = region->surface(x[i][0], x[i][1], x[i][2], radius[i]); + nc = region->surface(x[i][0], x[i][1], x[i][2], model->pulloff_distance(radius[i], 0.0)); + if (nc > tmax) error->one(FLERR, "Too many wallgran/region contacts for one particle"); + + // shear history maintenance + // update ncontact,walls,shear2many for particle I + // to reflect new and persistent shear historyvalues + // also set c2r[] = indices into region->contact[]for each of N contacts + // process zero or one contact here, otherwiseinvoke update_contacts() + + if (use_history) { + if (nc == 0) { + ncontact[i] = 0; + continue; } - if (nc > tmax) error->one(FLERR, "Too many wall/gran/region contacts for one particle"); + if (nc == 1) { + c2r[0] = 0; + iwall = region->contact[0].iwall; + if (ncontact[i] == 0) { + ncontact[i] = 1; + walls[i][0] = iwall; + for (m = 0; m < size_history; m++) history_many[i][0][m] = 0.0; + } else if (ncontact[i] > 1 || iwall != walls[i][0]) + update_contacts(i, nc); + } else + update_contacts(i, nc); + } - // shear history maintenance - // update ncontact,walls,shear2many for particle I - // to reflect new and persistent shear history values - // also set c2r[] = indices into region->contact[] for each of N contacts - // process zero or one contact here, otherwise invoke update_contacts() + // process current contacts + for (int ic = 0; ic < nc; ic++) { - if (use_history) { - if (nc == 0) { - ncontact[i] = 0; + // Reset model and copy initial geometric data + model->reset_contact(); + model->xi = x[i]; + model->dx[0] = region->contact[ic].delx; + model->dx[1] = region->contact[ic].dely; + model->dx[2] = region->contact[ic].delz; + model->radi = radius[i]; + model->rwall = rwall; + + touchflag = model->check_contact(); + + + if (model->beyond_contact) { + if (history_many[i][c2r[ic]][0] == 0.0 && model->rsq > model->radsum * model->radsum) { + for (m = 0; m < size_history; m++) history_many[i][0][m] = 0.0; continue; } - if (nc == 1) { - c2r[0] = 0; - iwall = region->contact[0].iwall; - if (ncontact[i] == 0) { - ncontact[i] = 1; - walls[i][0] = iwall; - for (m = 0; m < size_history; m++) history_many[i][0][m] = 0.0; - } else if (ncontact[i] > 1 || iwall != walls[i][0]) - update_contacts(i, nc); - } else - update_contacts(i, nc); - } + } // Dan: not quite sure about this - // process current contacts - for (int ic = 0; ic < nc; ic++) { - // rsq = squared contact distance - // xc = contact point + if (regiondynamic) region->velocity_contact(vwall, x[i], ic); + model->vj = vwall; - rsq = region->contact[ic].r * region->contact[ic].r; + // meff = effective mass of sphere + // if I is part of rigid body, use body mass - if (pairstyle == FixWallGran::GRANULAR && normal_model == FixWallGran::JKR) { - if (history_many[i][c2r[ic]][0] == 0.0 && rsq > radius[i] * radius[i]) { - for (m = 0; m < size_history; m++) history_many[i][0][m] = 0.0; - continue; - } - } + meff = rmass[i]; + if (fix_rigid && mass_rigid[i] > 0.0) meff = mass_rigid[i]; - dx = region->contact[ic].delx; - dy = region->contact[ic].dely; - dz = region->contact[ic].delz; + // Copy additional information and prepare force calculations + model->meff = meff; + model->vi = v[i]; + model->omegai = omega[i]; + model->history_update = history_update; + if (use_history) model->history = history_one[i]; + if (heat_flag) model->Ti = temperature[i]; + model->prep_contact(); - if (regiondynamic) region->velocity_contact(vwall, x[i], ic); + model->calculate_forces(); + if (heat_flag) dq = model->calculate_heat(); - // meff = effective mass of sphere - // if I is part of rigid body, use body mass + forces = model->forces; + torquesi = model->torquesi; - meff = rmass[i]; - if (fix_rigid && mass_rigid[i] > 0.0) meff = mass_rigid[i]; + // apply forces & torques + add3(f[i], forces, f[i]); - // store contact info - if (peratom_flag) { - array_atom[i][0] = 1.0; - array_atom[i][4] = x[i][0] - dx; - array_atom[i][5] = x[i][1] - dy; - array_atom[i][6] = x[i][2] - dz; - array_atom[i][7] = radius[i]; - } + add3(torque[i], torquesi, torque[i]); + if (heat_flag) heatflux[i] += dq; - // invoke sphere/wall interaction - double *contact; - if (peratom_flag) - contact = array_atom[i]; - else - contact = nullptr; - - if (pairstyle == FixWallGran::HOOKE) - hooke(rsq, dx, dy, dz, vwall, v[i], f[i], omega[i], torque[i], radius[i], meff, contact); - else if (pairstyle == FixWallGran::HOOKE_HISTORY) - hooke_history(rsq, dx, dy, dz, vwall, v[i], f[i], omega[i], torque[i], radius[i], meff, - history_many[i][c2r[ic]], contact); - else if (pairstyle == FixWallGran::HERTZ_HISTORY) - hertz_history(rsq, dx, dy, dz, vwall, region->contact[ic].radius, v[i], f[i], omega[i], - torque[i], radius[i], meff, history_many[i][c2r[ic]], contact); - else if (pairstyle == FixWallGran::GRANULAR) - granular(rsq, dx, dy, dz, vwall, region->contact[ic].radius, v[i], f[i], omega[i], - torque[i], radius[i], meff, history_many[i][c2r[ic]], contact); + // store contact info + if (peratom_flag) { + array_atom[i][0] = 1.0; + array_atom[i][1] = forces[0]; + array_atom[i][2] = forces[1]; + array_atom[i][3] = forces[2]; + array_atom[i][4] = x[i][0] - dx; + array_atom[i][5] = x[i][1] - dy; + array_atom[i][6] = x[i][2] - dz; + array_atom[i][7] = radius[i]; } } } diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index e401f8cb84..9b1a036928 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -121,14 +121,14 @@ void PairGranular::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; double factor_lj,mi,mj,meff,delx,dely,delz; - double *forces, *torquesi, *torquesj; + double *forces, *torquesi, *torquesj, dq; int *ilist,*jlist,*numneigh,**firstneigh; int *touch,**firsttouch; double *history,*allhistory,**firsthistory; bool touchflag = false; - const bool historyupdate = update->setupflag == 0; + const bool history_update = update->setupflag == 0; ev_init(eflag,vflag); @@ -163,7 +163,7 @@ void PairGranular::compute(int eflag, int vflag) int *mask = atom->mask; int nlocal = atom->nlocal; double *special_lj = force->special_lj; - double *heatflux, *temperature, dq; + double *heatflux, *temperature; if (heat_flag) { heatflux = atom->heatflux; temperature = atom->temperature; @@ -234,14 +234,13 @@ void PairGranular::compute(int eflag, int vflag) models[itype][jtype]->vj = v[j]; models[itype][jtype]->omegai = omega[i]; models[itype][jtype]->omegaj = omega[j]; - models[itype][jtype]->history_update = historyupdate; - models[itype][jtype]->history = history; - models[itype][jtype]->prep_contact(); - + models[itype][jtype]->history_update = history_update; + if (use_history) models[itype][jtype]->history = history; if (heat_flag) { models[itype][jtype]->Ti = temperature[i]; models[itype][jtype]->Tj = temperature[j]; } + models[itype][jtype]->prep_contact(); if (models[itype][jtype]->beyond_contact) touch[jj] = 1; @@ -320,9 +319,6 @@ void PairGranular::settings(int narg, char **arg) } else { cutoff_global = -1; // will be set based on particle sizes, model choice } - - normal_history = tangential_history = 0; - roll_history = twist_history = 0; } /* ---------------------------------------------------------------------- @@ -332,7 +328,6 @@ void PairGranular::settings(int narg, char **arg) void PairGranular::coeff(int narg, char **arg) { double cutoff_one = -1; - int ncoeff; if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients"); @@ -349,26 +344,16 @@ void PairGranular::coeff(int narg, char **arg) //Parse mandatory normal and tangential specifications int iarg = 2; vec_models.back().init_model(std::string(arg[iarg]), NORMAL); - ncoeff = vec_models.back().normal_model->num_coeffs; iarg += 1; - if (iarg + ncoeff >= narg) - error->all(FLERR,"Illegal pair_coeff command" - "Insufficient arguments provided for normal model."); - vec_models.back().normal_model->parse_coeffs(arg, iarg); - iarg += ncoeff; + iarg = vec_models.back().normal_model->parse_coeffs(arg, iarg, narg); if (strcmp(arg[iarg], "tangential") == 0) { if (iarg + 1 >= narg) error->all(FLERR,"Illegal pair_coeff command, must specify " "tangential model after tangential keyword"); vec_models.back().init_model(std::string(arg[iarg]), TANGENTIAL); - ncoeff = vec_models.back().tangential_model->num_coeffs; iarg += 1; - if (iarg + ncoeff >= narg) - error->all(FLERR, "Illegal pair_coeff command" - "Insufficient arguments provided for tangential model."); - vec_models.back().tangential_model->parse_coeffs(arg, iarg); - iarg += ncoeff; + iarg = vec_models.back().tangential_model->parse_coeffs(arg, iarg, narg); } else{ error->all(FLERR, "Illegal pair_coeff command, 'tangential' keyword expected"); } @@ -379,51 +364,27 @@ void PairGranular::coeff(int narg, char **arg) if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); vec_models.back().init_model(std::string(arg[iarg]), DAMPING); - ncoeff = vec_models.back().damping_model->num_coeffs; iarg += 1; - if (iarg + ncoeff >= narg) - error->all(FLERR, "Illegal pair_coeff command" - "Insufficient arguments provided for damping model."); - vec_models.back().damping_model->parse_coeffs(arg, iarg); - iarg += ncoeff; - + iarg = vec_models.back().damping_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "rolling") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); vec_models.back().init_model(std::string(arg[iarg]), ROLLING); - ncoeff = vec_models.back().rolling_model->num_coeffs; iarg += 1; - if (iarg + ncoeff >= narg) - error->all(FLERR, "Illegal pair_coeff command" - "Insufficient arguments provided for rolling model."); - vec_models.back().rolling_model->parse_coeffs(arg, iarg); - iarg += ncoeff; - + iarg = vec_models.back().rolling_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "twisting") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); vec_models.back().init_model(std::string(arg[iarg]), TWISTING); - ncoeff = vec_models.back().twisting_model->num_coeffs; iarg += 1; - if (iarg + ncoeff >= narg) - error->all(FLERR, "Illegal pair_coeff command" - "Insufficient arguments provided for twisting model."); - vec_models.back().twisting_model->parse_coeffs(arg, iarg); - iarg += ncoeff; - + iarg = vec_models.back().twisting_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "heat") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); vec_models.back().init_model(std::string(arg[iarg]), HEAT); - ncoeff = vec_models.back().heat_model->num_coeffs; iarg += 1; - if (iarg + ncoeff >= narg) - error->all(FLERR, "Illegal pair_coeff command" - "Insufficient arguments provided for heat model."); - vec_models.back().heat_model->parse_coeffs(arg, iarg); - iarg += ncoeff; + iarg = vec_models.back().heat_model->parse_coeffs(arg, iarg, narg); heat_flag = 1; - } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); @@ -437,11 +398,9 @@ void PairGranular::coeff(int narg, char **arg) } else error->all(FLERR, "Illegal pair_coeff command"); } - // Define default damping model if unspecified, takes no args - if (!vec_models.back().damping_model) { + // Define default damping model if unspecified, has no coeffs + if (!vec_models.back().damping_model) vec_models.back().init_model("viscoelastic", DAMPING); - vec_models.back().damping_model->parse_coeffs(arg, 0); - } if (vec_models.back().limit_damping && !vec_models.back().normal_model->allow_limit_damping) error->all(FLERR,"Illegal pair_coeff command, " @@ -483,11 +442,7 @@ void PairGranular::init_style() int size_twisting_history = 0; for (int i = 1; i <= atom->ntypes; i++) { for (int j = i; j <= atom->ntypes; j++) { - if (models[i][j]->normal_model->size_history != 0 || - models[i][j]->damping_model->size_history != 0 || - models[i][j]->tangential_model->size_history != 0 || - models[i][j]->rolling_model->size_history != 0 || - models[i][j]->twisting_model->size_history != 0) use_history = 1; + if (models[i][j]->size_history != 0) use_history = 1; if (models[i][j]->normal_model->size_history > size_normal_history) size_normal_history = models[i][j]->damping_model->size_history; @@ -495,10 +450,12 @@ void PairGranular::init_style() size_damping_history = models[i][j]->normal_model->size_history; if (models[i][j]->tangential_model->size_history > size_tangential_history) size_tangential_history = models[i][j]->tangential_model->size_history; - if (models[i][j]->rolling_model->size_history > size_rolling_history) - size_rolling_history = models[i][j]->rolling_model->size_history; - if (models[i][j]->twisting_model->size_history > size_twisting_history) - size_twisting_history = models[i][j]->twisting_model->size_history; + if (models[i][j]->rolling_model) + if (models[i][j]->rolling_model->size_history > size_rolling_history) + size_rolling_history = models[i][j]->rolling_model->size_history; + if (models[i][j]->twisting_model) + if (models[i][j]->twisting_model->size_history > size_twisting_history) + size_twisting_history = models[i][j]->twisting_model->size_history; } } @@ -506,9 +463,21 @@ void PairGranular::init_style() size_tangential_history + size_rolling_history + size_twisting_history; damping_history_index = size_normal_history; - tangential_history_index = size_normal_history + damping_history_index; - roll_history_index = size_normal_history + damping_history_index + size_tangential_history; - twist_history_index = size_normal_history + damping_history_index + size_tangential_history + size_rolling_history; + tangential_history_index = damping_history_index + size_damping_history; + roll_history_index = tangential_history_index + size_tangential_history; + twist_history_index = roll_history_index + size_rolling_history; + + for (int i = 1; i <= atom->ntypes; i++) { + for (int j = i; j <= atom->ntypes; j++) { + models[i][j]->normal_model->history_index = 0; + models[i][j]->damping_model->history_index = damping_history_index; + models[i][j]->tangential_model->history_index = tangential_history_index; + if (models[i][j]->rolling_model) + models[i][j]->rolling_model->history_index = roll_history_index; + if (models[i][j]->twisting_model) + models[i][j]->twisting_model->history_index = twist_history_index; + } + } if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE|NeighConst::REQ_HISTORY); else neighbor->add_request(this, NeighConst::REQ_SIZE); diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 1032cf6b7c..68b83d3686 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -75,9 +75,6 @@ class PairGranular : public Pair { std::vector vec_models; Contact::ContactModel ***models; - // history flags - int normal_history, tangential_history, roll_history, twist_history; - // indices of history entries int normal_history_index; int damping_history_index; diff --git a/src/contact.h b/src/contact.h index 96758771b4..bd04fe9ce1 100644 --- a/src/contact.h +++ b/src/contact.h @@ -52,7 +52,7 @@ class ContactModel : protected Pointers { double pulloff_distance(double, double); void init_model(std::string, ModelType); - + int init_classic_model(char **, int, int); void mix_coeffs(ContactModel*, ContactModel*); void write_restart(FILE *); @@ -68,7 +68,7 @@ class ContactModel : protected Pointers { SubModel *sub_models[6]; // Need to resize if we add more model flavors // Extra options - int beyond_contact, limit_damping, history_update; + int beyond_contact, limit_damping, history_update, wall_flag; double cutoff_type; // History variables @@ -79,7 +79,7 @@ class ContactModel : protected Pointers { // Contact properties/output double *forces, *torquesi, *torquesj; - double radi, radj, meff, dt, Ti, Tj, area; + double radi, radj, rwall, meff, dt, Ti, Tj, area; double Fntot, magtortwist; double *xi, *xj, *vi, *vj, *omegai, *omegaj; From 12c1923511e802b3b531e34b24fcf386f187dab5 Mon Sep 17 00:00:00 2001 From: Joel Thomas Clemmer Date: Fri, 12 Aug 2022 17:36:53 -0600 Subject: [PATCH 016/112] Updating mixing --- src/GRANULAR/contact_normal_models.cpp | 14 ++++++-------- src/GRANULAR/contact_normal_models.h | 2 +- src/GRANULAR/contact_tangential_models.cpp | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index 6a6db39189..514ed1338a 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -144,7 +144,6 @@ void NormalHertz::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) double NormalHertz::calculate_forces() { - contact->area = sqrt(contact->dR); Fne = knfac * contact->delta; return Fne; } @@ -173,7 +172,7 @@ void NormalHertzMaterial::coeffs_to_local() Emod = coeffs[0]; damp = coeffs[1]; poiss = coeffs[2]; - k = 4 / 3 * Emod; + k = 4 / 3 * mix_stiffnessE(Emod, Emod, poiss, poiss); if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz material normal model"); } @@ -182,7 +181,7 @@ void NormalHertzMaterial::coeffs_to_local() void NormalHertzMaterial::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); coeffs_to_local(); @@ -207,7 +206,7 @@ void NormalDMT::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k = 4 / 3 * Emod; + k = 4 / 3 * mix_stiffnessE(Emod, Emod, poiss, poiss); if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); } @@ -216,7 +215,7 @@ void NormalDMT::coeffs_to_local() void NormalDMT::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); @@ -267,8 +266,7 @@ void NormalJKR::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k = 4/3*Emod; - Escaled = k * THREEQUARTERS; + Escaled = mix_stiffnessE(Emod, Emod, poiss, poiss); //Dan, not sure why these coefficients are mixed in the regular pair style if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); } @@ -277,7 +275,7 @@ void NormalJKR::coeffs_to_local() void NormalJKR::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index 74e2800eaa..080e019d4d 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -108,7 +108,7 @@ class NormalJKR: public NormalModel { void set_knfac(); void set_fncrit(); private: - double k, cohesion; + double cohesion; double Escaled, F_pulloff; }; diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 4f25e96071..89817ba00c 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -185,7 +185,7 @@ void TangentialMindlin::coeffs_to_local() if (k == -1) { if (!contact->normal_model->material_properties) error->all(FLERR, "Must either specify tangential stiffness or material properties for normal model for the Mindlin tangential style"); - k = 8.0 * mix_stiffnessE(contact->normal_model->Emod, contact->normal_model->Emod, contact->normal_model->poiss, contact->normal_model->poiss); + k = 8.0 * mix_stiffnessG(contact->normal_model->Emod, contact->normal_model->Emod, contact->normal_model->poiss, contact->normal_model->poiss); } if (k < 0.0 || xt < 0.0 || mu < 0.0) From 92c10cc2103d1a80ab03b8cfc4de154b84077d87 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 24 Aug 2022 12:19:27 -0600 Subject: [PATCH 017/112] Fixing memory issues, passing lmp ptr to submodels, and other misc fixes/changes --- doc/src/pair_granular.rst | 2 +- src/GRANULAR/contact.cpp | 124 +++++---- src/GRANULAR/contact.h | 16 +- src/GRANULAR/contact_damping_models.cpp | 24 +- src/GRANULAR/contact_damping_models.h | 20 +- src/GRANULAR/contact_heat_models.cpp | 8 +- src/GRANULAR/contact_heat_models.h | 8 +- src/GRANULAR/contact_normal_models.cpp | 57 ++-- src/GRANULAR/contact_normal_models.h | 32 ++- src/GRANULAR/contact_rolling_models.cpp | 8 +- src/GRANULAR/contact_rolling_models.h | 8 +- src/GRANULAR/contact_sub_models.cpp | 14 +- src/GRANULAR/contact_sub_models.h | 5 +- src/GRANULAR/contact_tangential_models.cpp | 33 ++- src/GRANULAR/contact_tangential_models.h | 48 ++-- src/GRANULAR/contact_twisting_models.cpp | 14 +- src/GRANULAR/contact_twisting_models.h | 12 +- src/GRANULAR/fix_pour.cpp | 1 + src/GRANULAR/fix_wall_gran.cpp | 161 ++++++------ src/GRANULAR/fix_wall_gran.h | 7 - src/GRANULAR/fix_wall_gran_region.cpp | 34 ++- src/GRANULAR/pair_granular.cpp | 287 ++++++++++----------- src/GRANULAR/pair_granular.h | 9 +- src/contact.h | 16 +- 24 files changed, 511 insertions(+), 437 deletions(-) diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index c14d94a77a..d630b18a3a 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -659,7 +659,7 @@ is equivalent to *pair gran/hooke 1000.0 NULL 50.0 50.0 0.4 1*\ . The second example is equivalent to *pair gran/hooke/history 1000.0 500.0 50.0 50.0 0.4 1*\ . The third example is equivalent to -*pair gran/hertz/history 1000.0 500.0 50.0 50.0 0.4 1*\ . +*pair gran/hertz/history 1000.0 500.0 50.0 50.0 0.4 1 limit_damping*\ . ---------- diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 7ce3d8c739..a59eca9374 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -18,9 +18,6 @@ */ #include "contact.h" -#include "pointers.h" -#include "math_const.h" -#include "math_extra.h" #include "contact_sub_models.h" #include "contact_normal_models.h" #include "contact_tangential_models.h" @@ -31,33 +28,48 @@ #include "comm.h" #include "error.h" #include "force.h" +#include "math_extra.h" #include +using namespace LAMMPS_NS; +using namespace Contact; using namespace MathExtra; -using namespace LAMMPS_NS::MathConst; -using namespace LAMMPS_NS::Contact; -ContactModel::ContactModel() : - Pointers(lmp) +ContactModel::ContactModel(LAMMPS *lmp) : Pointers(lmp) { limit_damping = 0; beyond_contact = 0; nondefault_history_transfer = 0; - cutoff_type = 0.0; - wall_flag = 0; - nmodels = 5; + nmodels = 6; + + wall_type = NONE; reset_contact(); + normal_model = nullptr; + damping_model = nullptr; + tangential_model = nullptr; + rolling_model = nullptr; + twisting_model = nullptr; + heat_model = nullptr; + for (int i = 0; i < nmodels; i++) sub_models[i] = nullptr; + transfer_history_factor = nullptr; } /* ---------------------------------------------------------------------- */ ContactModel::~ContactModel() { - delete[] transfer_history_factor; + delete [] transfer_history_factor; + + delete normal_model; + delete damping_model; + delete tangential_model; + delete rolling_model; + delete twisting_model; + delete heat_model; } /* ---------------------------------------------------------------------- */ @@ -65,52 +77,52 @@ ContactModel::~ContactModel() void ContactModel::init_model(std::string model_name, ModelType model_type) { if (model_type == NORMAL) { - if (model_name == "hooke") normal_model = new NormalHooke(); - else if (model_name == "hertz") normal_model = new NormalHertz(); - else if (model_name == "hertz/material") normal_model = new NormalHertzMaterial(); - else if (model_name == "dmt") normal_model = new NormalDMT(); - else if (model_name == "jkr") normal_model = new NormalJKR(); - else error->all(FLERR, "Normal model name not recognized"); + if (model_name == "hooke") normal_model = new NormalHooke(lmp); + else if (model_name == "hertz") normal_model = new NormalHertz(lmp); + else if (model_name == "hertz/material") normal_model = new NormalHertzMaterial(lmp); + else if (model_name == "dmt") normal_model = new NormalDMT(lmp); + else if (model_name == "jkr") normal_model = new NormalJKR(lmp); + else error->all(FLERR, "Normal model name {} not recognized", model_name); sub_models[model_type] = normal_model; } else if (model_type == TANGENTIAL) { - if (model_name =="linear_nohistory") tangential_model = new TangentialLinearNoHistory(); - else if (model_name =="linear_history") tangential_model = new TangentialLinearHistory(); - else if (model_name =="mindlin") tangential_model = new TangentialMindlin(); - else if (model_name =="mindlin/force") tangential_model = new TangentialMindlinForce(); - else if (model_name =="mindlin_rescale") tangential_model = new TangentialMindlinRescale(); - else if (model_name =="mindlin_rescale/force") tangential_model = new TangentialMindlinRescaleForce(); - else error->all(FLERR, "Tangential model name not recognized"); + if (model_name == "linear_nohistory") tangential_model = new TangentialLinearNoHistory(lmp); + else if (model_name == "linear_history") tangential_model = new TangentialLinearHistory(lmp); + else if (model_name == "mindlin") tangential_model = new TangentialMindlin(lmp); + else if (model_name == "mindlin/force") tangential_model = new TangentialMindlinForce(lmp); + else if (model_name == "mindlin_rescale") tangential_model = new TangentialMindlinRescale(lmp); + else if (model_name == "mindlin_rescale/force") tangential_model = new TangentialMindlinRescaleForce(lmp); + else error->all(FLERR, "Tangential model name {} not recognized", model_name); sub_models[model_type] = tangential_model; } else if (model_type == DAMPING) { - if (model_name =="velocity") damping_model = new DampingVelocity(); - else if (model_name =="mass_velocity") damping_model = new DampingMassVelocity(); - else if (model_name =="viscoelastic") damping_model = new DampingViscoelastic(); - else if (model_name =="tsuji") damping_model = new DampingTsuji(); - else error->all(FLERR, "Damping model name not recognized"); + if (model_name == "velocity") damping_model = new DampingVelocity(lmp); + else if (model_name == "mass_velocity") damping_model = new DampingMassVelocity(lmp); + else if (model_name == "viscoelastic") damping_model = new DampingViscoelastic(lmp); + else if (model_name == "tsuji") damping_model = new DampingTsuji(lmp); + else error->all(FLERR, "Damping model name {} not recognized", model_name); sub_models[model_type] = damping_model; } else if (model_type == ROLLING) { - if (model_name =="none") delete rolling_model; - else if (model_name =="sds") rolling_model = new RollingSDS(); - else error->all(FLERR, "Rolling model name not recognized"); + if (model_name == "none") delete rolling_model; + else if (model_name == "sds") rolling_model = new RollingSDS(lmp); + else error->all(FLERR, "Rolling model name {} not recognized", model_name); sub_models[model_type] = rolling_model; } else if (model_type == TWISTING) { - if (model_name =="none") delete twisting_model; - else if (model_name =="sds") twisting_model = new TwistingSDS(); - else if (model_name =="marshall") twisting_model = new TwistingMarshall(); - else error->all(FLERR, "Twisting model name not recognized"); + if (model_name == "none") delete twisting_model; + else if (model_name == "sds") twisting_model = new TwistingSDS(lmp); + else if (model_name == "marshall") twisting_model = new TwistingMarshall(lmp); + else error->all(FLERR, "Twisting model name {} not recognized", model_name); sub_models[model_type] = twisting_model; } else if (model_type == HEAT) { - if (model_name =="none") delete heat_model; - else if (model_name =="area") heat_model = new HeatArea(); - else error->all(FLERR, "Heat model name not recognized"); + if (model_name == "none") delete heat_model; + else if (model_name == "area") heat_model = new HeatArea(lmp); + else error->all(FLERR, "Heat model name not {} recognized", model_name); sub_models[model_type] = heat_model; } else { - error->all(FLERR, "Illegal model type"); + error->all(FLERR, "Illegal model type {}", model_type); } sub_models[model_type]->name.assign(model_name); @@ -198,10 +210,9 @@ void ContactModel::init() } } - transfer_history_factor = new double(size_history); - for (i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; - if (nondefault_history_transfer) { + transfer_history_factor = new double[size_history]; + for (i = 0; i < size_history; i++) { // Find which model controls this history value size_cumulative = 0; @@ -216,10 +227,15 @@ void ContactModel::init() if (j != nmodels) { if (sub_models[j]->nondefault_history_transfer) { transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; + } else { + transfer_history_factor[i] = -1; } } } } + + for (i = 0; i < nmodels; i++) + if (sub_models[i]) sub_models[i]->init(); } /* ---------------------------------------------------------------------- */ @@ -231,7 +247,6 @@ void ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) sub_models[i]->mix_coeffs(c1->sub_models[i], c2->sub_models[i]); limit_damping = MAX(c1->limit_damping, c2->limit_damping); - cutoff_type = MAX(c1->cutoff_type, c2->cutoff_type); } /* ---------------------------------------------------------------------- */ @@ -301,15 +316,22 @@ void ContactModel::reset_contact() /* ---------------------------------------------------------------------- */ -bool ContactModel::check_contact() +bool ContactModel::check_contact(double rtemp) { check_flag = 1; - if (wall_flag) { + if (wall_type == RWALL) { + // Used by fix_wall_gran.cpp rsq = lensq3(dx); radsum = radi; - if (rwall == 0) Reff = radi; - else Reff = radi * rwall/(radi + rwall); + if (rtemp == 0) Reff = radi; + else Reff = radi * rtemp/(radi + rtemp); + } else if (wall_type == RDUPLICATE) { + // Used by fix_wall_gran_region.cpp + rsq = rtemp * rtemp; + radsum = radi + radi; + if (rtemp == 0) Reff = radi; + else Reff = radi * rtemp/(radi + rtemp); } else { sub3(xi, xj, dx); rsq = lensq3(dx); @@ -389,17 +411,17 @@ void ContactModel::calculate_forces() //********************************************** // calculate forces //********************************************** - + forces[0] = 0.0; double Fne, Fdamp; area = normal_model->calculate_area(); + normal_model->set_knfac(); Fne = normal_model->calculate_forces(); - normal_model->set_knfac(); // Needed for damping Fdamp = damping_model->calculate_forces(); + Fntot = Fne + Fdamp; normal_model->set_fncrit(); // Needed for tangential, rolling, twisting - Fntot = Fne + Fdamp; if (limit_damping && Fntot < 0.0) Fntot = 0.0; tangential_model->calculate_forces(); diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index bd04fe9ce1..4c38657ed7 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -26,6 +26,12 @@ enum ModelType { ROLLING = 3, TWISTING = 4, HEAT = 5 +}; // Relative order matters since some derive coeffs from others + +enum WallType { + NONE = 0, + RWALL = 1, + RDUPLICATE = 2 }; #define EPSILON 1e-10 @@ -41,10 +47,10 @@ class SubModel; class ContactModel : protected Pointers { public: - ContactModel(); + ContactModel(class LAMMPS *); ~ContactModel(); void init(); - bool check_contact(); + bool check_contact(double = 0); void reset_contact(); void prep_contact(); void calculate_forces(); @@ -68,8 +74,8 @@ class ContactModel : protected Pointers { SubModel *sub_models[6]; // Need to resize if we add more model flavors // Extra options - int beyond_contact, limit_damping, history_update, wall_flag; - double cutoff_type; + int beyond_contact, limit_damping, history_update; + WallType wall_type; // History variables int size_history, nondefault_history_transfer; @@ -77,7 +83,7 @@ class ContactModel : protected Pointers { double *history; // Contact properties/output - double *forces, *torquesi, *torquesj; + double forces[3], torquesi[3], torquesj[3]; double radi, radj, rwall, meff, dt, Ti, Tj, area; double Fntot, magtortwist; diff --git a/src/GRANULAR/contact_damping_models.cpp b/src/GRANULAR/contact_damping_models.cpp index 7a79c6946c..8d44746683 100644 --- a/src/GRANULAR/contact_damping_models.cpp +++ b/src/GRANULAR/contact_damping_models.cpp @@ -24,7 +24,11 @@ using namespace MathSpecial; Default damping model ------------------------------------------------------------------------- */ -void DampingModel::coeffs_to_local() +DampingModel::DampingModel(LAMMPS *lmp) : SubModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + +void DampingModel::init() { damp = contact->normal_model->damp; } @@ -33,6 +37,10 @@ void DampingModel::coeffs_to_local() Velocity damping ------------------------------------------------------------------------- */ +DampingVelocity::DampingVelocity(LAMMPS *lmp) : DampingModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + double DampingVelocity::calculate_forces() { return -damp * contact->vnnr; @@ -42,6 +50,10 @@ double DampingVelocity::calculate_forces() Mass velocity damping ------------------------------------------------------------------------- */ +DampingMassVelocity::DampingMassVelocity(LAMMPS *lmp) : DampingModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + double DampingMassVelocity::calculate_forces() { return -damp * contact->meff * contact->vnnr; @@ -51,6 +63,10 @@ double DampingMassVelocity::calculate_forces() Default, viscoelastic damping ------------------------------------------------------------------------- */ +DampingViscoelastic::DampingViscoelastic(LAMMPS *lmp) : DampingModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + double DampingViscoelastic::calculate_forces() { return -damp * contact->meff * contact->area * contact->vnnr; @@ -60,7 +76,11 @@ double DampingViscoelastic::calculate_forces() Tsuji damping ------------------------------------------------------------------------- */ -void DampingTsuji::coeffs_to_local() +DampingTsuji::DampingTsuji(LAMMPS *lmp) : DampingModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + +void DampingTsuji::init() { double tmp = contact->normal_model->damp; damp = 1.2728 - 4.2783 * tmp + 11.087 * square(tmp); diff --git a/src/GRANULAR/contact_damping_models.h b/src/GRANULAR/contact_damping_models.h index 440ab36369..70294edc6a 100644 --- a/src/GRANULAR/contact_damping_models.h +++ b/src/GRANULAR/contact_damping_models.h @@ -15,46 +15,52 @@ #define CONTACT_DAMPING_MODELS_H_ #include "contact_sub_models.h" +#include "pointers.h" namespace LAMMPS_NS { namespace Contact { class DampingModel : public SubModel { public: - DampingModel() {}; + DampingModel(class LAMMPS *); ~DampingModel() {}; - virtual void coeffs_to_local(); + virtual void coeffs_to_local() {}; virtual void mix_coeffs(DampingModel*, DampingModel*) {}; + virtual void init(); virtual double calculate_forces() = 0; double damp; }; /* ---------------------------------------------------------------------- */ -class DampingVelocity: public DampingModel { +class DampingVelocity : public DampingModel { public: + DampingVelocity(class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class DampingMassVelocity: public DampingModel { +class DampingMassVelocity : public DampingModel { public: + DampingMassVelocity(class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class DampingViscoelastic: public DampingModel { +class DampingViscoelastic : public DampingModel { public: + DampingViscoelastic(class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class DampingTsuji: public DampingModel { +class DampingTsuji : public DampingModel { public: - void coeffs_to_local(); + DampingTsuji(class LAMMPS *); + void init(); double calculate_forces(); }; diff --git a/src/GRANULAR/contact_heat_models.cpp b/src/GRANULAR/contact_heat_models.cpp index 3793f774c2..d25955b1c2 100644 --- a/src/GRANULAR/contact_heat_models.cpp +++ b/src/GRANULAR/contact_heat_models.cpp @@ -18,11 +18,17 @@ using namespace LAMMPS_NS; using namespace Contact; +/* ---------------------------------------------------------------------- + Default heat conduction +------------------------------------------------------------------------- */ + +HeatModel::HeatModel(LAMMPS *lmp) : SubModel(lmp) {} + /* ---------------------------------------------------------------------- Area-based heat conduction ------------------------------------------------------------------------- */ -HeatArea::HeatArea() +HeatArea::HeatArea(LAMMPS *lmp) : HeatModel(lmp) { num_coeffs = 1; } diff --git a/src/GRANULAR/contact_heat_models.h b/src/GRANULAR/contact_heat_models.h index 469a53cb13..b3104e9f3a 100644 --- a/src/GRANULAR/contact_heat_models.h +++ b/src/GRANULAR/contact_heat_models.h @@ -21,7 +21,7 @@ namespace Contact { class HeatModel : public SubModel { public: - HeatModel() {}; + HeatModel(class LAMMPS *); ~HeatModel() {}; virtual void coeffs_to_local() {}; virtual void mix_coeffs(HeatModel*, HeatModel*) {}; @@ -30,13 +30,13 @@ class HeatModel : public SubModel { /* ---------------------------------------------------------------------- */ -class HeatArea: public HeatModel { +class HeatArea : public HeatModel { public: - HeatArea(); + HeatArea(class LAMMPS *); void coeffs_to_local(); void mix_coeffs(HeatModel*, HeatModel*); double calculate_heat(); - private: + protected: double conductivity; }; diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index 6a6db39189..f4d4848833 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -32,7 +32,7 @@ using namespace MathConst; Default normal model ------------------------------------------------------------------------- */ -NormalModel::NormalModel() +NormalModel::NormalModel(LAMMPS *lmp) : SubModel(lmp) { material_properties = 0; } @@ -72,10 +72,9 @@ void NormalModel::set_fncrit() Hookean normal force ------------------------------------------------------------------------- */ -NormalHooke::NormalHooke() +NormalHooke::NormalHooke(LAMMPS *lmp) : NormalModel(lmp) { num_coeffs = 2; - allocate_coeffs(); } /* ---------------------------------------------------------------------- */ @@ -116,7 +115,7 @@ void NormalHooke::set_knfac() Hertzian normal force ------------------------------------------------------------------------- */ -NormalHertz::NormalHertz() +NormalHertz::NormalHertz(LAMMPS *lmp) : NormalModel(lmp) { num_coeffs = 2; } @@ -160,7 +159,7 @@ void NormalHertz::set_knfac() Hertzian normal force with material properties ------------------------------------------------------------------------- */ -NormalHertzMaterial::NormalHertzMaterial() +NormalHertzMaterial::NormalHertzMaterial(LAMMPS *lmp) : NormalHertz(lmp) { material_properties = 1; num_coeffs = 3; @@ -173,7 +172,7 @@ void NormalHertzMaterial::coeffs_to_local() Emod = coeffs[0]; damp = coeffs[1]; poiss = coeffs[2]; - k = 4 / 3 * Emod; + k = FOURTHIRDS * Emod; if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz material normal model"); } @@ -192,7 +191,7 @@ void NormalHertzMaterial::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) DMT normal force ------------------------------------------------------------------------- */ -NormalDMT::NormalDMT() +NormalDMT::NormalDMT(LAMMPS *lmp) : NormalModel(lmp) { allow_limit_damping = 0; material_properties = 1; @@ -207,7 +206,7 @@ void NormalDMT::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k = 4 / 3 * Emod; + k = FOURTHIRDS * Emod; if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); } @@ -228,7 +227,7 @@ void NormalDMT::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) double NormalDMT::calculate_forces() { Fne = knfac * contact->delta; - F_pulloff = 4 * MathConst::MY_PI * cohesion * contact->Reff; + F_pulloff = 4.0 * MathConst::MY_PI * cohesion * contact->Reff; Fne -= F_pulloff; return Fne; } @@ -244,14 +243,14 @@ void NormalDMT::set_knfac() void NormalDMT::set_fncrit() { - Fncrit = fabs(Fne + 2 * F_pulloff); + Fncrit = fabs(Fne + 2.0 * F_pulloff); } /* ---------------------------------------------------------------------- JKR normal force ------------------------------------------------------------------------- */ -NormalJKR::NormalJKR() +NormalJKR::NormalJKR(LAMMPS *lmp) : NormalModel(lmp) { allow_limit_damping = 0; material_properties = 1; @@ -267,7 +266,7 @@ void NormalJKR::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k = 4/3*Emod; + k = FOURTHIRDS * Emod; Escaled = k * THREEQUARTERS; if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); @@ -291,11 +290,15 @@ bool NormalJKR::touch() double area_at_pulloff, R2, delta_pulloff, dist_pulloff; bool touchflag; - R2 = contact->Reff * contact->Reff; - area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * R2 / (4 * Escaled)); - delta_pulloff = area_at_pulloff * area_at_pulloff / contact->Reff - 2 * sqrt(MY_PI * cohesion * area_at_pulloff /Escaled); - dist_pulloff = contact->radsum - delta_pulloff; - touchflag = (contact->rsq < dist_pulloff * dist_pulloff); + if (contact->touch) { + R2 = contact->Reff * contact->Reff; + area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * R2 / (4.0 * Escaled)); + delta_pulloff = area_at_pulloff * area_at_pulloff / contact->Reff - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff /Escaled); + dist_pulloff = contact->radsum - delta_pulloff; + touchflag = contact->rsq < (dist_pulloff * dist_pulloff); + } else { + touchflag = contact->rsq < (contact->radsum * contact->radsum); + } return touchflag; } @@ -311,8 +314,8 @@ double NormalJKR::pulloff_distance(double radi, double radj) Reff_tmp = radi * radj / (radi + radj); // May not be defined if (Reff_tmp <= 0) return 0; - area_at_pulloff = cbrt(9 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4 * Escaled)); - return area_at_pulloff * area_at_pulloff / Reff_tmp - 2 * sqrt(MY_PI * cohesion * area_at_pulloff / Escaled); + area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4.0 * Escaled)); + return area_at_pulloff * area_at_pulloff / Reff_tmp - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Escaled); } /* ---------------------------------------------------------------------- */ @@ -326,16 +329,16 @@ double NormalJKR::calculate_area() dR2 = contact->dR * contact->dR; t0 = cohesion * cohesion * R2 * R2 * Escaled; t1 = PI27SQ * t0; - t2 = 8 * contact->dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4 * dR2 * Escaled; + t2 = 8.0 * contact->dR * dR2 * Escaled * Escaled * Escaled; + t3 = 4.0 * dR2 * Escaled; // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2 * t2)); + sqrt1 = MAX(0, t0 * (t1 + 2.0 * t2)); t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); t5 = t3 / t4 + t4 / Escaled; - sqrt2 = MAX(0, 2 * contact->dR + t5); + sqrt2 = MAX(0, 2.0 * contact->dR + t5); t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4 * contact->dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + sqrt3 = MAX(0, 4.0 * contact->dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); return INVROOT6 * (t6 + sqrt(sqrt3)); } @@ -347,8 +350,8 @@ double NormalJKR::calculate_forces() double a2; a2 = contact->area * contact->area; - Fne = Escaled * contact->area * a2 / contact->Reff - MY_2PI * a2 * sqrt(4 * cohesion * Escaled / (MY_PI * contact->area)); - F_pulloff = 3 * MY_PI * cohesion * contact->Reff; + Fne = Escaled * contact->area * a2 / contact->Reff - MY_2PI * a2 * sqrt(4.0 * cohesion * Escaled / (MY_PI * contact->area)); + F_pulloff = 3.0 * MY_PI * cohesion * contact->Reff; return Fne; } @@ -364,5 +367,5 @@ void NormalJKR::set_knfac() void NormalJKR::set_fncrit() { - Fncrit = fabs(Fne + 2 * F_pulloff); + Fncrit = fabs(Fne + 2.0 * F_pulloff); } diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index 74e2800eaa..ec604d04ba 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -21,7 +21,7 @@ namespace Contact { class NormalModel : public SubModel { public: - NormalModel(); + NormalModel(class LAMMPS *); ~NormalModel() {}; virtual void coeffs_to_local() {}; virtual void mix_coeffs(NormalModel*, NormalModel*) {}; @@ -39,65 +39,63 @@ class NormalModel : public SubModel { /* ---------------------------------------------------------------------- */ -class NormalHooke: public NormalModel { +class NormalHooke : public NormalModel { public: - NormalHooke(); + NormalHooke(class LAMMPS *); ~NormalHooke() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); double calculate_forces(); void set_knfac(); - private: + protected: double k; }; /* ---------------------------------------------------------------------- */ -class NormalHertz: public NormalModel { +class NormalHertz : public NormalModel { public: - NormalHertz(); + NormalHertz(class LAMMPS *); ~NormalHertz() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); double calculate_forces(); void set_knfac(); - private: + protected: double k; }; /* ---------------------------------------------------------------------- */ -class NormalHertzMaterial: public NormalHertz { +class NormalHertzMaterial : public NormalHertz { public: - NormalHertzMaterial(); + NormalHertzMaterial(class LAMMPS *); ~NormalHertzMaterial() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); - private: - double k; }; /* ---------------------------------------------------------------------- */ -class NormalDMT: public NormalModel { +class NormalDMT : public NormalModel { public: - NormalDMT(); + NormalDMT(class LAMMPS *); ~NormalDMT() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); double calculate_forces(); void set_knfac(); void set_fncrit(); - private: + protected: double k, cohesion; double F_pulloff; }; /* ---------------------------------------------------------------------- */ -class NormalJKR: public NormalModel { +class NormalJKR : public NormalModel { public: - NormalJKR(); + NormalJKR(class LAMMPS *); ~NormalJKR() {}; void coeffs_to_local(); void mix_coeffs(NormalModel*, NormalModel*); @@ -107,7 +105,7 @@ class NormalJKR: public NormalModel { double calculate_forces(); void set_knfac(); void set_fncrit(); - private: + protected: double k, cohesion; double Escaled, F_pulloff; }; diff --git a/src/GRANULAR/contact_rolling_models.cpp b/src/GRANULAR/contact_rolling_models.cpp index 8074b14141..cc8e3e471e 100644 --- a/src/GRANULAR/contact_rolling_models.cpp +++ b/src/GRANULAR/contact_rolling_models.cpp @@ -23,11 +23,17 @@ using namespace Contact; using namespace MathConst; using namespace MathExtra; +/* ---------------------------------------------------------------------- + Default rolling friction model +------------------------------------------------------------------------- */ + +RollingModel::RollingModel(LAMMPS *lmp) : SubModel(lmp) {} + /* ---------------------------------------------------------------------- SDS rolling friction model ------------------------------------------------------------------------- */ -RollingSDS::RollingSDS() +RollingSDS::RollingSDS(LAMMPS *lmp) : RollingModel(lmp) { num_coeffs = 3; size_history = 3; diff --git a/src/GRANULAR/contact_rolling_models.h b/src/GRANULAR/contact_rolling_models.h index 1cd23e1d5d..e81d22301c 100644 --- a/src/GRANULAR/contact_rolling_models.h +++ b/src/GRANULAR/contact_rolling_models.h @@ -21,7 +21,7 @@ namespace Contact { class RollingModel : public SubModel { public: - RollingModel() {}; + RollingModel(class LAMMPS *); ~RollingModel() {}; virtual void coeffs_to_local() {}; virtual void mix_coeffs(RollingModel*, RollingModel*) {}; @@ -30,13 +30,13 @@ class RollingModel : public SubModel { /* ---------------------------------------------------------------------- */ -class RollingSDS: public RollingModel { +class RollingSDS : public RollingModel { public: - RollingSDS(); + RollingSDS(class LAMMPS *); void coeffs_to_local(); void mix_coeffs(RollingModel*, RollingModel*); double calculate_forces(); - private: + protected: double k, mu, gamma; }; diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/GRANULAR/contact_sub_models.cpp index a0bf99301d..8aafc0f2b5 100644 --- a/src/GRANULAR/contact_sub_models.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -24,8 +24,11 @@ using namespace LAMMPS_NS; using namespace Contact; -SubModel::SubModel() : - Pointers(lmp) +/* ---------------------------------------------------------------------- + Parent class for all types of contact forces +------------------------------------------------------------------------- */ + +SubModel::SubModel(LAMMPS *lmp) : Pointers(lmp) { allocated = 0; size_history = 0; @@ -58,13 +61,12 @@ void SubModel::allocate_coeffs() int SubModel::parse_coeffs(char **arg, int iarg, int narg) { - if (iarg + num_coeffs >= narg) + if (iarg + num_coeffs > narg) error->all(FLERR, "Insufficient arguments provided for {} model", name); - for (int i = 0; i < num_coeffs; i++) { // A few parameters (eg.g kt for tangential mindlin) allow null - if (strcmp(arg[iarg+i+1], "NULL") == 0) coeffs[i] = -1; - else coeffs[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); + if (strcmp(arg[iarg+i], "NULL") == 0) coeffs[i] = -1; + else coeffs[i] = utils::numeric(FLERR,arg[iarg+i],false,lmp); } coeffs_to_local(); diff --git a/src/GRANULAR/contact_sub_models.h b/src/GRANULAR/contact_sub_models.h index 95da8d5cbf..67e9c79e35 100644 --- a/src/GRANULAR/contact_sub_models.h +++ b/src/GRANULAR/contact_sub_models.h @@ -15,14 +15,14 @@ #define CONTACT_SUB_MODEL_H_ #include "contact.h" -#include "pointers.h" +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { namespace Contact { class SubModel : protected Pointers { public: - SubModel(); + SubModel(class LAMMPS *); virtual ~SubModel(); int num_coeffs; @@ -31,6 +31,7 @@ class SubModel : protected Pointers { int parse_coeffs(char **, int, int); virtual void mix_coeffs(SubModel*, SubModel*) {}; virtual void coeffs_to_local() {}; + virtual void init() {}; // called after all other submodel coeffs defined void allocate_coeffs(); std::string name; diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 4f25e96071..c73328ff10 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -24,11 +24,24 @@ using namespace Contact; using namespace MathConst; using namespace MathExtra; +/* ---------------------------------------------------------------------- + Default model +------------------------------------------------------------------------- */ + +TangentialModel::TangentialModel(LAMMPS *lmp) : SubModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + +void TangentialModel::init() +{ + damp = xt * contact->damping_model->damp; +} + /* ---------------------------------------------------------------------- Linear model with no history ------------------------------------------------------------------------- */ -TangentialLinearNoHistory::TangentialLinearNoHistory() +TangentialLinearNoHistory::TangentialLinearNoHistory(LAMMPS *lmp) : TangentialModel(lmp) { num_coeffs = 2; size_history = 3; @@ -41,7 +54,6 @@ void TangentialLinearNoHistory::coeffs_to_local() k = 0.0; // No tangential stiffness with no history xt = coeffs[0]; mu = coeffs[1]; - damp = xt * contact->damping_model->damp; if (k < 0.0 || xt < 0.0 || mu < 0.0) error->all(FLERR, "Illegal linear no history tangential model"); @@ -76,7 +88,7 @@ void TangentialLinearNoHistory::calculate_forces() Linear model with history ------------------------------------------------------------------------- */ -TangentialLinearHistory::TangentialLinearHistory() +TangentialLinearHistory::TangentialLinearHistory(LAMMPS *lmp) : TangentialModel(lmp) { num_coeffs = 3; size_history = 3; @@ -89,7 +101,6 @@ void TangentialLinearHistory::coeffs_to_local() k = coeffs[0]; xt = coeffs[1]; mu = coeffs[2]; - damp = xt * contact->damping_model->damp; if (k < 0.0 || xt < 0.0 || mu < 0.0) error->all(FLERR, "Illegal linear tangential model"); @@ -166,7 +177,7 @@ void TangentialLinearHistory::calculate_forces() Mindlin model ------------------------------------------------------------------------- */ -TangentialMindlin::TangentialMindlin() +TangentialMindlin::TangentialMindlin(LAMMPS *lmp) : TangentialModel(lmp) { num_coeffs = 3; size_history = 3; @@ -190,8 +201,6 @@ void TangentialMindlin::coeffs_to_local() if (k < 0.0 || xt < 0.0 || mu < 0.0) error->all(FLERR, "Illegal Mindlin tangential model"); - - damp = xt * contact->damping_model->damp; } /* ---------------------------------------------------------------------- */ @@ -293,7 +302,7 @@ void TangentialMindlin::calculate_forces() Mindlin force model ------------------------------------------------------------------------- */ -TangentialMindlinForce::TangentialMindlinForce() +TangentialMindlinForce::TangentialMindlinForce(LAMMPS *lmp) : TangentialMindlin(lmp) { num_coeffs = 3; size_history = 3; @@ -305,7 +314,7 @@ TangentialMindlinForce::TangentialMindlinForce() Mindlin rescale model ------------------------------------------------------------------------- */ -TangentialMindlinRescale::TangentialMindlinRescale() +TangentialMindlinRescale::TangentialMindlinRescale(LAMMPS *lmp) : TangentialMindlin(lmp) { num_coeffs = 3; size_history = 4; @@ -313,7 +322,7 @@ TangentialMindlinRescale::TangentialMindlinRescale() mindlin_rescale = 1; nondefault_history_transfer = 1; - transfer_history_factor = new double(size_history); + transfer_history_factor = new double[size_history]; for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; transfer_history_factor[3] = +1; } @@ -322,7 +331,7 @@ TangentialMindlinRescale::TangentialMindlinRescale() Mindlin rescale force model ------------------------------------------------------------------------- */ -TangentialMindlinRescaleForce::TangentialMindlinRescaleForce() +TangentialMindlinRescaleForce::TangentialMindlinRescaleForce(LAMMPS *lmp) : TangentialMindlin(lmp) { num_coeffs = 3; size_history = 4; @@ -330,7 +339,7 @@ TangentialMindlinRescaleForce::TangentialMindlinRescaleForce() mindlin_rescale = 1; nondefault_history_transfer = 1; - transfer_history_factor = new double(size_history); + transfer_history_factor = new double[size_history]; for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; transfer_history_factor[3] = +1; } diff --git a/src/GRANULAR/contact_tangential_models.h b/src/GRANULAR/contact_tangential_models.h index f5d83a57f7..4e2c85f678 100644 --- a/src/GRANULAR/contact_tangential_models.h +++ b/src/GRANULAR/contact_tangential_models.h @@ -21,71 +21,69 @@ namespace Contact { class TangentialModel : public SubModel { public: - TangentialModel() {}; + TangentialModel(class LAMMPS *); virtual ~TangentialModel() {}; virtual void coeffs_to_local() {}; virtual void mix_coeffs(TangentialModel*, TangentialModel*) {}; virtual void calculate_forces() = 0; + void init(); int rescale_flag; double k, damp, mu; // Used by Marshall twisting model -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialLinearNoHistory: public TangentialModel { - public: - TangentialLinearNoHistory(); - void coeffs_to_local(); - void mix_coeffs(TangentialModel*, TangentialModel*); - void calculate_forces(); - private: + protected: double xt; }; /* ---------------------------------------------------------------------- */ -class TangentialLinearHistory: public TangentialModel { +class TangentialLinearNoHistory : public TangentialModel { public: - TangentialLinearHistory(); + TangentialLinearNoHistory(class LAMMPS *); void coeffs_to_local(); void mix_coeffs(TangentialModel*, TangentialModel*); void calculate_forces(); - private: - double xt; }; /* ---------------------------------------------------------------------- */ -class TangentialMindlin: public TangentialModel { +class TangentialLinearHistory : public TangentialModel { public: - TangentialMindlin(); + TangentialLinearHistory(class LAMMPS *); + void coeffs_to_local(); + void mix_coeffs(TangentialModel*, TangentialModel*); + void calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class TangentialMindlin : public TangentialModel { + public: + TangentialMindlin(class LAMMPS *); void coeffs_to_local(); void mix_coeffs(TangentialModel*, TangentialModel*); void calculate_forces(); protected: int mindlin_rescale, mindlin_force; - double xt; }; /* ---------------------------------------------------------------------- */ -class TangentialMindlinForce: public TangentialMindlin { +class TangentialMindlinForce : public TangentialMindlin { public: - TangentialMindlinForce(); + TangentialMindlinForce(class LAMMPS *); }; /* ---------------------------------------------------------------------- */ -class TangentialMindlinRescale: public TangentialMindlin { +class TangentialMindlinRescale : public TangentialMindlin { public: - TangentialMindlinRescale(); + TangentialMindlinRescale(class LAMMPS *); }; /* ---------------------------------------------------------------------- */ -class TangentialMindlinRescaleForce: public TangentialMindlin { +class TangentialMindlinRescaleForce : public TangentialMindlin { public: - TangentialMindlinRescaleForce(); + TangentialMindlinRescaleForce(class LAMMPS *); }; } // namespace Contact diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 75a2414c21..089b4c686e 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -22,11 +22,21 @@ using namespace LAMMPS_NS; using namespace Contact; using namespace MathConst; +/* ---------------------------------------------------------------------- + Default twisting model +------------------------------------------------------------------------- */ + +TwistingModel::TwistingModel(LAMMPS *lmp) : SubModel(lmp) +{ + num_coeffs = 0; + size_history = 3; +} + /* ---------------------------------------------------------------------- Marshall twisting model ------------------------------------------------------------------------- */ -TwistingMarshall::TwistingMarshall() +TwistingMarshall::TwistingMarshall(LAMMPS *lmp) : TwistingModel(lmp) { num_coeffs = 0; size_history = 3; @@ -63,7 +73,7 @@ double TwistingMarshall::calculate_forces() SDS twisting model ------------------------------------------------------------------------- */ -TwistingSDS::TwistingSDS() +TwistingSDS::TwistingSDS(LAMMPS *lmp) : TwistingModel(lmp) { num_coeffs = 3; size_history = 3; diff --git a/src/GRANULAR/contact_twisting_models.h b/src/GRANULAR/contact_twisting_models.h index e689c8ed35..5bcdc6b2a3 100644 --- a/src/GRANULAR/contact_twisting_models.h +++ b/src/GRANULAR/contact_twisting_models.h @@ -21,7 +21,7 @@ namespace Contact { class TwistingModel : public SubModel { public: - TwistingModel() {}; + TwistingModel(class LAMMPS *); virtual ~TwistingModel() {}; virtual void coeffs_to_local() {}; virtual void mix_coeffs(TwistingModel*, TwistingModel*) {}; @@ -30,21 +30,21 @@ class TwistingModel : public SubModel { /* ---------------------------------------------------------------------- */ -class TwistingMarshall: public TwistingModel { +class TwistingMarshall : public TwistingModel { public: - TwistingMarshall(); + TwistingMarshall(class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class TwistingSDS: public TwistingModel { +class TwistingSDS : public TwistingModel { public: - TwistingSDS(); + TwistingSDS(class LAMMPS *); void coeffs_to_local(); void mix_coeffs(TwistingModel*, TwistingModel*); double calculate_forces(); - private: + protected: double k, mu, damp; }; diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 7a8bf630df..9cb71272f0 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -270,6 +270,7 @@ FixPour::~FixPour() delete[] molfrac; delete[] idrigid; delete[] idshake; + delete[] idregion; delete[] radius_poly; delete[] frac_poly; memory->destroy(coords); diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index b4d94d62fe..208ff10bdd 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -38,7 +38,6 @@ #include "respa.h" #include "update.h" -#include #include using namespace LAMMPS_NS; @@ -69,8 +68,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // set interaction style // disable bonded/history option for now - model = new ContactModel(); - model->wall_flag = 1; + model = new ContactModel(lmp); + model->wall_type = RWALL; if (strcmp(arg[3],"granular") == 0) classic_flag = 0; else classic_flag = 1; @@ -82,7 +81,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : int iarg; if (classic_flag) { - iarg = 3; + iarg = 4; iarg = model->init_classic_model(arg, iarg, narg); if (iarg < narg) { @@ -93,40 +92,46 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } } else { - iarg = 3; - model->init_model(std::string(arg[iarg]), NORMAL); - iarg += 1; + iarg = 4; + model->init_model(std::string(arg[iarg++]), NORMAL); iarg = model->normal_model->parse_coeffs(arg, iarg, narg); while (iarg < narg) { if (strcmp(arg[iarg], "damping") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - model->init_model(std::string(arg[iarg]), DAMPING); - iarg += 1; + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal fix wall/gran command, must specify " + "damping model after damping keyword"); + model->init_model(std::string(arg[iarg++]), DAMPING); iarg = model->damping_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "tangential") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - model->init_model(std::string(arg[iarg]), TANGENTIAL); - iarg += 1; + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal fix wall/gran command, must specify " + "tangential model after tangential keyword"); + model->init_model(std::string(arg[iarg++]), TANGENTIAL); iarg = model->tangential_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "rolling") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - model->init_model(std::string(arg[iarg]), ROLLING); - iarg += 1; + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal fix wall/gran command, must specify " + "rolling model after rolling keyword"); + model->init_model(std::string(arg[iarg++]), ROLLING); iarg = model->rolling_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "twisting") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - model->init_model(std::string(arg[iarg]), TWISTING); + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal fix wall/gran command, must specify " + "twisting model after twisting keyword"); + model->init_model(std::string(arg[iarg++]), TWISTING); iarg += 1; iarg = model->twisting_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "heat") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - model->init_model(std::string(arg[iarg]), HEAT); + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal fix wall/gran command, must specify " + "heat model after heat keyword"); + model->init_model(std::string(arg[iarg++]), HEAT); iarg += 1; iarg = model->heat_model->parse_coeffs(arg, iarg, narg); heat_flag = 1; @@ -156,7 +161,10 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal pair_coeff command, " "Cannot limit damping with specified normal contact model"); + model->init(); + size_history = model->size_history; + if (model->beyond_contact) size_history += 1; //Need to track if particle is touching if (size_history == 0) use_history = restart_peratom = 0; else use_history = restart_peratom = 1; @@ -349,25 +357,16 @@ void FixWallGran::init() if (i < modify->nfix) fix_rigid = modify->fix[i]; // Define history indices - int size_normal_history = model->normal_model->size_history; - int size_tangential_history = model->tangential_model->size_history; - int size_damping_history = model->damping_model->size_history; - int size_rolling_history = 0; - int size_twisting_history = 0; - if (model->rolling_model) size_rolling_history = model->rolling_model->size_history; - if (model->twisting_model) size_twisting_history = model->twisting_model->size_history; + int next_index = 0; + if (model->beyond_contact) next_index = 1; - damping_history_index = size_normal_history; - tangential_history_index = damping_history_index + size_damping_history; - roll_history_index = tangential_history_index + size_tangential_history; - twist_history_index = roll_history_index + size_rolling_history; - - model->normal_model->history_index = 0; - model->damping_model->history_index = damping_history_index; - model->tangential_model->history_index = tangential_history_index; - if (model->rolling_model) model->rolling_model->history_index = roll_history_index; - if (model->twisting_model) model->twisting_model->history_index = twist_history_index; + for (i = 0; i < 6; i++) { + if (model->sub_models[i]) { + model->sub_models[i]->history_index = next_index; + next_index += model->sub_models[i]->size_history; + } + } } /* ---------------------------------------------------------------------- */ @@ -513,59 +512,61 @@ void FixWallGran::post_force(int /*vflag*/) // Reset model and copy initial geometric data model->reset_contact(); - model->xi = x[i]; model->dx[0] = dx; model->dx[1] = dy; model->dx[2] = dz; model->radi = radius[i]; - model->rwall = rwall; + if (model->beyond_contact) model->touch = history_one[i][0]; - touchflag = model->check_contact(); + touchflag = model->check_contact(rwall); if (!touchflag) { if (use_history) for (j = 0; j < size_history; j++) history_one[i][j] = 0.0; - } else { + continue; + } // Dan: I tried to simplify this logic, not sure it's 100% correct - // meff = effective mass of sphere - // if I is part of rigid body, use body mass + if (model->beyond_contact) + history_one[i][0] = 1; - meff = rmass[i]; - if (fix_rigid && mass_rigid[i] > 0.0) meff = mass_rigid[i]; + // meff = effective mass of sphere + // if I is part of rigid body, use body mass - // Copy additional information and prepare force calculations - model->meff = meff; - model->vi = v[i]; - model->omegai = omega[i]; - model->history_update = history_update; - if (use_history) model->history = history_one[i]; - if (heat_flag) model->Ti = temperature[i]; - model->prep_contact(); + meff = rmass[i]; + if (fix_rigid && mass_rigid[i] > 0.0) meff = mass_rigid[i]; - model->calculate_forces(); - if (heat_flag) dq = model->calculate_heat(); + // Copy additional information and prepare force calculations + model->meff = meff; + model->vi = v[i]; + model->omegai = omega[i]; + model->history_update = history_update; + if (use_history) model->history = history_one[i]; + if (heat_flag) model->Ti = temperature[i]; + model->prep_contact(); - forces = model->forces; - torquesi = model->torquesi; + model->calculate_forces(); + if (heat_flag) dq = model->calculate_heat(); - // apply forces & torques - add3(f[i], forces, f[i]); + forces = model->forces; + torquesi = model->torquesi; - add3(torque[i], torquesi, torque[i]); - if (heat_flag) heatflux[i] += dq; + // apply forces & torques + add3(f[i], forces, f[i]); - // store contact info - if (peratom_flag) { - array_atom[i][0] = 1.0; - array_atom[i][1] = forces[0]; - array_atom[i][2] = forces[1]; - array_atom[i][3] = forces[2]; - array_atom[i][4] = x[i][0] - dx; - array_atom[i][5] = x[i][1] - dy; - array_atom[i][6] = x[i][2] - dz; - array_atom[i][7] = radius[i]; - } + add3(torque[i], torquesi, torque[i]); + if (heat_flag) heatflux[i] += dq; + + // store contact info + if (peratom_flag) { + array_atom[i][0] = 1.0; + array_atom[i][1] = forces[0]; + array_atom[i][2] = forces[1]; + array_atom[i][3] = forces[2]; + array_atom[i][4] = x[i][0] - dx; + array_atom[i][5] = x[i][1] - dy; + array_atom[i][6] = x[i][2] - dz; + array_atom[i][7] = radius[i]; } } } @@ -583,7 +584,7 @@ void FixWallGran::clear_stored_contacts() { void FixWallGran::post_force_respa(int vflag, int ilevel, int /*iloop*/) { - if (ilevel == nlevels_respa-1) post_force(vflag); + if (ilevel == nlevels_respa - 1) post_force(vflag); } /* ---------------------------------------------------------------------- @@ -594,10 +595,10 @@ double FixWallGran::memory_usage() { int nmax = atom->nmax; double bytes = 0.0; - if (use_history) bytes += (double)nmax*size_history * sizeof(double); // shear history + if (use_history) bytes += (double)nmax * size_history * sizeof(double); // shear history if (fix_rigid) bytes += (double)nmax * sizeof(int); // mass_rigid // store contacts - if (peratom_flag) bytes += (double)nmax*size_peratom_cols*sizeof(double); + if (peratom_flag) bytes += (double)nmax * size_peratom_cols * sizeof(double); return bytes; } diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index d0202d65e8..b61ac24d54 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -55,13 +55,6 @@ class FixWallGran : public Fix { // for granular model choices Contact::ContactModel *model; - // indices of history entries - int normal_history_index; - int damping_history_index; - int tangential_history_index; - int roll_history_index; - int twist_history_index; - double lo, hi, cylradius; double amplitude, period, omega, vshear; double dt; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index c288abf92e..59ad15c02d 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -18,6 +18,7 @@ #include "fix_wall_gran_region.h" #include "atom.h" +#include "contact.h" #include "comm.h" #include "domain.h" #include "error.h" @@ -30,6 +31,7 @@ #include using namespace LAMMPS_NS; +using namespace Contact; using namespace FixConst; using namespace MathExtra; @@ -48,6 +50,8 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : tmax = region->tmax; c2r = new int[tmax]; + model->wall_type = RDUPLICATE; + // re-allocate atom-based arrays with nshear // do not register with Atom class, since parent class did that @@ -120,7 +124,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) { int i, m, nc, iwall; double dx, dy, dz, meff; - double *forces, *torquesi, dq, rwall; + double *forces, *torquesi, dq; double vwall[3]; double w0[3] = {0.0}; bool touchflag = false; @@ -179,7 +183,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) region->set_velocity(); } - if (peratom_flag) { clear_stored_contacts(); } + if (peratom_flag) clear_stored_contacts(); // Define constant wall properties (atom j) model->radj = 0.0; @@ -188,7 +192,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) for (i = 0; i < nlocal; i++) { if (! mask[i] & groupbit) continue; - if (!region->match(x[i][0], x[i][1], x[i][2]))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], model->pulloff_distance(radius[i], 0.0)); if (nc > tmax) error->one(FLERR, "Too many wallgran/region contacts for one particle"); @@ -221,24 +225,25 @@ void FixWallGranRegion::post_force(int /*vflag*/) for (int ic = 0; ic < nc; ic++) { // Reset model and copy initial geometric data + // A bit unncessary since region->contact[ic] stores r model->reset_contact(); - model->xi = x[i]; model->dx[0] = region->contact[ic].delx; model->dx[1] = region->contact[ic].dely; model->dx[2] = region->contact[ic].delz; model->radi = radius[i]; - model->rwall = rwall; + if (model->beyond_contact) model->touch = history_many[i][c2r[ic]][0]; - touchflag = model->check_contact(); + touchflag = model->check_contact(region->contact[ic].r); + if (!touchflag) { + if (use_history) + for (m = 0; m < size_history; m++) + history_many[i][c2r[ic]][m] = 0.0; + continue; + } - if (model->beyond_contact) { - if (history_many[i][c2r[ic]][0] == 0.0 && model->rsq > model->radsum * model->radsum) { - for (m = 0; m < size_history; m++) history_many[i][0][m] = 0.0; - continue; - } - } // Dan: not quite sure about this - + if (model->beyond_contact) + history_many[i][c2r[ic]][0] = 1; if (regiondynamic) region->velocity_contact(vwall, x[i], ic); model->vj = vwall; @@ -254,7 +259,8 @@ void FixWallGranRegion::post_force(int /*vflag*/) model->vi = v[i]; model->omegai = omega[i]; model->history_update = history_update; - if (use_history) model->history = history_one[i]; + + if (use_history) model->history = history_many[i][c2r[ic]]; if (heat_flag) model->Ti = temperature[i]; model->prep_contact(); diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 9b1a036928..0c228a2936 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -81,9 +81,6 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) use_history = 0; beyond_contact = 0; nondefault_history_transfer = 0; - tangential_history_index = 0; - roll_history_index = 0; - twist_history_index = 0; heat_flag = 0; // create dummy fix as placeholder for FixNeighHistory @@ -105,6 +102,7 @@ PairGranular::~PairGranular() if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); + memory->destroy(cutoff_type); delete [] onerad_dynamic; delete [] onerad_frozen; @@ -119,7 +117,7 @@ PairGranular::~PairGranular() void PairGranular::compute(int eflag, int vflag) { - int i,j,ii,jj,inum,jnum,itype,jtype; + int i,j,k,ii,jj,inum,jnum,itype,jtype; double factor_lj,mi,mj,meff,delx,dely,delz; double *forces, *torquesi, *torquesj, dq; @@ -203,6 +201,7 @@ void PairGranular::compute(int eflag, int vflag) models[itype][jtype]->xj = x[j]; models[itype][jtype]->radi = radius[i]; models[itype][jtype]->radj = radius[j]; + models[itype][jtype]->touch = touch[jj]; touchflag = models[itype][jtype]->check_contact(); @@ -211,74 +210,77 @@ void PairGranular::compute(int eflag, int vflag) if (use_history) { touch[jj] = 0; history = &allhistory[size_history*jj]; - for (int k = 0; k < size_history; k++) history[k] = 0.0; + for (k = 0; k < size_history; k++) history[k] = 0.0; } - } else { + continue; + } - // meff = effective mass of pair of particles - // if I or J part of rigid body, use body mass - // if I or J is frozen, meff is other particle - mi = rmass[i]; - mj = rmass[j]; - if (fix_rigid) { - if (mass_rigid[i] > 0.0) mi = mass_rigid[i]; - if (mass_rigid[j] > 0.0) mj = mass_rigid[j]; - } - meff = mi * mj / (mi + mj); - if (mask[i] & freeze_group_bit) meff = mj; - if (mask[j] & freeze_group_bit) meff = mi; + if (use_history) { + touch[jj] = 1; + history = &allhistory[size_history*jj]; + } - // Copy additional information and prepare force calculations - models[itype][jtype]->meff = meff; - models[itype][jtype]->vi = v[i]; - models[itype][jtype]->vj = v[j]; - models[itype][jtype]->omegai = omega[i]; - models[itype][jtype]->omegaj = omega[j]; - models[itype][jtype]->history_update = history_update; - if (use_history) models[itype][jtype]->history = history; - if (heat_flag) { - models[itype][jtype]->Ti = temperature[i]; - models[itype][jtype]->Tj = temperature[j]; - } - models[itype][jtype]->prep_contact(); + // meff = effective mass of pair of particles + // if I or J part of rigid body, use body mass + // if I or J is frozen, meff is other particle + mi = rmass[i]; + mj = rmass[j]; + if (fix_rigid) { + if (mass_rigid[i] > 0.0) mi = mass_rigid[i]; + if (mass_rigid[j] > 0.0) mj = mass_rigid[j]; + } + meff = mi * mj / (mi + mj); + if (mask[i] & freeze_group_bit) meff = mj; + if (mask[j] & freeze_group_bit) meff = mi; - if (models[itype][jtype]->beyond_contact) touch[jj] = 1; + // Copy additional information and prepare force calculations + models[itype][jtype]->meff = meff; + models[itype][jtype]->vi = v[i]; + models[itype][jtype]->vj = v[j]; + models[itype][jtype]->omegai = omega[i]; + models[itype][jtype]->omegaj = omega[j]; + models[itype][jtype]->history_update = history_update; + if (use_history) models[itype][jtype]->history = history; + if (heat_flag) { + models[itype][jtype]->Ti = temperature[i]; + models[itype][jtype]->Tj = temperature[j]; + } + models[itype][jtype]->prep_contact(); - // if any history is needed - if (use_history) { - touch[jj] = 1; - history = &allhistory[size_history*jj]; - } + // if any history is needed + if (use_history) { + touch[jj] = 1; + history = &allhistory[size_history*jj]; + } - models[itype][jtype]->calculate_forces(); - if (heat_flag) dq = models[itype][jtype]->calculate_heat(); + models[itype][jtype]->calculate_forces(); + if (heat_flag) dq = models[itype][jtype]->calculate_heat(); - forces = models[itype][jtype]->forces; - torquesi = models[itype][jtype]->torquesi; - torquesj = models[itype][jtype]->torquesj; + forces = models[itype][jtype]->forces; + torquesi = models[itype][jtype]->torquesi; + torquesj = models[itype][jtype]->torquesj; - // apply forces & torques - scale3(factor_lj, forces); - add3(f[i], forces, f[i]); + // apply forces & torques + scale3(factor_lj, forces); + add3(f[i], forces, f[i]); - scale3(factor_lj, torquesi); - add3(torque[i], torquesi, torque[i]); - if (heat_flag) heatflux[i] += dq; + scale3(factor_lj, torquesi); + add3(torque[i], torquesi, torque[i]); + if (heat_flag) heatflux[i] += dq; - if (force->newton_pair || j < nlocal) { - sub3(f[j], forces, f[j]); - scale3(factor_lj, torquesj); - add3(torque[j], torquesj, torque[j]); - if (heat_flag) heatflux[j] -= dq; - } + if (force->newton_pair || j < nlocal) { + sub3(f[j], forces, f[j]); + scale3(factor_lj, torquesj); + add3(torque[j], torquesj, torque[j]); + if (heat_flag) heatflux[j] -= dq; + } - if (evflag) { - delx = x[i][0] - x[j][0]; - dely = x[i][1] - x[j][1]; - delz = x[i][2] - x[j][2]; - ev_tally_xyz(i,j,nlocal,force->newton_pair, - 0.0,0.0,forces[0],forces[1],forces[2],delx,dely,delz); - } + if (evflag) { + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + ev_tally_xyz(i,j,nlocal,force->newton_pair, + 0.0,0.0,forces[0],forces[1],forces[2],delx,dely,delz); } } } @@ -293,6 +295,9 @@ void PairGranular::allocate() allocated = 1; int n = atom->ntypes; + // Reserve enough memory for vector to avoid reallocation/changing pointers + vec_models.reserve(atom->ntypes * atom->ntypes); + memory->create(setflag,n+1,n+1,"pair:setflag"); for (int i = 1; i <= n; i++) for (int j = i; j <= n; j++) @@ -300,7 +305,7 @@ void PairGranular::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutoff_type,n+1,n+1,"pair:cutoff_type"); - memory->create(models,n+1,n+1,"pair:contact_models"); + models.resize(n+1, std::vector (n+1, nullptr)); onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -338,64 +343,68 @@ void PairGranular::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - // Create new model stored in vector - vec_models.push_back(ContactModel()); + // Construct new model within vector + vec_models.emplace_back(lmp); //Parse mandatory normal and tangential specifications int iarg = 2; - vec_models.back().init_model(std::string(arg[iarg]), NORMAL); - iarg += 1; + vec_models.back().init_model(std::string(arg[iarg++]), NORMAL); iarg = vec_models.back().normal_model->parse_coeffs(arg, iarg, narg); - if (strcmp(arg[iarg], "tangential") == 0) { - if (iarg + 1 >= narg) + if (strcmp(arg[iarg++], "tangential") == 0) { + if (iarg >= narg) error->all(FLERR,"Illegal pair_coeff command, must specify " "tangential model after tangential keyword"); - vec_models.back().init_model(std::string(arg[iarg]), TANGENTIAL); - iarg += 1; + vec_models.back().init_model(std::string(arg[iarg++]), TANGENTIAL); iarg = vec_models.back().tangential_model->parse_coeffs(arg, iarg, narg); } else{ error->all(FLERR, "Illegal pair_coeff command, 'tangential' keyword expected"); } //Parse optional arguments + while (iarg < narg) { if (strcmp(arg[iarg], "damping") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init_model(std::string(arg[iarg]), DAMPING); - iarg += 1; + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal pair_coeff command, must specify " + "damping model after damping keyword"); + vec_models.back().init_model(std::string(arg[iarg++]), DAMPING); iarg = vec_models.back().damping_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "rolling") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init_model(std::string(arg[iarg]), ROLLING); - iarg += 1; + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal pair_coeff command, must specify " + "rolling model after rolling keyword"); + vec_models.back().init_model(std::string(arg[iarg++]), ROLLING); iarg = vec_models.back().rolling_model->parse_coeffs(arg, iarg, narg); + } else if (strcmp(arg[iarg], "twisting") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init_model(std::string(arg[iarg]), TWISTING); - iarg += 1; + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal pair_coeff command, must specify " + "twisting model after twisting keyword"); + vec_models.back().init_model(std::string(arg[iarg++]), TWISTING); iarg = vec_models.back().twisting_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "heat") == 0) { - if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().init_model(std::string(arg[iarg]), HEAT); - iarg += 1; + iarg++; + if (iarg >= narg) + error->all(FLERR, "Illegal pair_coeff command, must specify " + "heat model after heat keyword"); + vec_models.back().init_model(std::string(arg[iarg++]), HEAT); iarg = vec_models.back().heat_model->parse_coeffs(arg, iarg, narg); heat_flag = 1; } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) - error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - vec_models.back().cutoff_type = utils::numeric(FLERR,arg[iarg+1],false,lmp); + error->all(FLERR, "Illegal pair_coeff command, not enough parameters for cutoff keyword"); + cutoff_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "limit_damping") == 0) { vec_models.back().limit_damping = 1; iarg += 1; - } else error->all(FLERR, "Illegal pair_coeff command"); + } else error->all(FLERR, "Illegal pair_coeff command {}", arg[iarg]); } // Define default damping model if unspecified, has no coeffs @@ -410,6 +419,7 @@ void PairGranular::coeff(int narg, char **arg) for (int i = ilo; i <= ihi; i++) { for (int j = MAX(jlo,i); j <= jhi; j++) { models[i][j] = & vec_models.back(); + cutoff_type[i][j] = cutoff_type[j][i] = cutoff_one; setflag[i][j] = 1; count++; } @@ -434,48 +444,30 @@ void PairGranular::init_style() error->all(FLERR,"Pair granular requires ghost atoms store velocity"); // allocate history and initialize models + int size_max[6] = {0,0,0,0,0,0}; - int size_normal_history = 0; - int size_damping_history = 0; - int size_tangential_history = 0; - int size_rolling_history = 0; - int size_twisting_history = 0; - for (int i = 1; i <= atom->ntypes; i++) { - for (int j = i; j <= atom->ntypes; j++) { - if (models[i][j]->size_history != 0) use_history = 1; + for (auto &model : vec_models) { + model.init(); + if (model.size_history != 0) use_history = 1; - if (models[i][j]->normal_model->size_history > size_normal_history) - size_normal_history = models[i][j]->damping_model->size_history; - if (models[i][j]->damping_model->size_history > size_damping_history) - size_damping_history = models[i][j]->normal_model->size_history; - if (models[i][j]->tangential_model->size_history > size_tangential_history) - size_tangential_history = models[i][j]->tangential_model->size_history; - if (models[i][j]->rolling_model) - if (models[i][j]->rolling_model->size_history > size_rolling_history) - size_rolling_history = models[i][j]->rolling_model->size_history; - if (models[i][j]->twisting_model) - if (models[i][j]->twisting_model->size_history > size_twisting_history) - size_twisting_history = models[i][j]->twisting_model->size_history; - } + for (i = 0; i < 6; i++) + if (model.sub_models[i]) + if (model.sub_models[i]->size_history > size_max[i]) + size_max[i] = model.sub_models[i]->size_history; + + if (model.nondefault_history_transfer) nondefault_history_transfer = 1; } - size_history = size_normal_history + size_damping_history + - size_tangential_history + size_rolling_history + size_twisting_history; + size_history = 0; + for (i = 0; i < 6; i++) size_history += size_max[i]; - damping_history_index = size_normal_history; - tangential_history_index = damping_history_index + size_damping_history; - roll_history_index = tangential_history_index + size_tangential_history; - twist_history_index = roll_history_index + size_rolling_history; - - for (int i = 1; i <= atom->ntypes; i++) { - for (int j = i; j <= atom->ntypes; j++) { - models[i][j]->normal_model->history_index = 0; - models[i][j]->damping_model->history_index = damping_history_index; - models[i][j]->tangential_model->history_index = tangential_history_index; - if (models[i][j]->rolling_model) - models[i][j]->rolling_model->history_index = roll_history_index; - if (models[i][j]->twisting_model) - models[i][j]->twisting_model->history_index = twist_history_index; + for (auto &model : vec_models) { + int next_index = 0; + for (i = 0; i < 6; i++) { + if (model.sub_models[i]) { + model.sub_models[i]->history_index = next_index; + next_index += size_max[i]; + } } } @@ -490,9 +482,7 @@ void PairGranular::init_style() if (use_history && fix_history == nullptr) { fix_history = dynamic_cast( modify->replace_fix("NEIGH_HISTORY_GRANULAR_DUMMY", - "NEIGH_HISTORY_GRANULAR" - " all NEIGH_HISTORY " - + std::to_string(size_history),1)); + "NEIGH_HISTORY_GRANULAR all NEIGH_HISTORY " + std::to_string(size_history),1)); fix_history->pair = this; } @@ -583,7 +573,7 @@ double PairGranular::init_one(int i, int j) "pair_coeff command",i,j); } - vec_models.push_back(ContactModel()); + vec_models.push_back(ContactModel(lmp)); models[i][j] = models[j][i] = & vec_models.back(); vec_models.back().init_model(models[i][i]->normal_model->name, NORMAL); vec_models.back().init_model(models[i][i]->tangential_model->name, TANGENTIAL); @@ -593,6 +583,10 @@ double PairGranular::init_one(int i, int j) vec_models.back().init_model(models[i][i]->heat_model->name, HEAT); vec_models.back().mix_coeffs(models[i][i], models[j][j]); + vec_models.back().init(); // Calculates cumulative properties of sub models + + for (int k = 0; k < 6; k++) + vec_models.back().sub_models[k]->history_index = models[i][i]->sub_models[k]->history_index; } // Check if heat model is defined for all type combinations @@ -608,7 +602,7 @@ double PairGranular::init_one(int i, int j) // we assign cutoff = max(cut[i][j]) for i,j such that cut[i][j] > 0.0. double pulloff; - if (models[i][j]->cutoff_type < 0 && cutoff_global < 0) { + if (cutoff_type[i][j] < 0 && cutoff_global < 0) { if (((maxrad_dynamic[i] > 0.0) && (maxrad_dynamic[j] > 0.0)) || ((maxrad_dynamic[i] > 0.0) && (maxrad_frozen[j] > 0.0)) || // radius info about both i and j exist @@ -626,7 +620,6 @@ double PairGranular::init_one(int i, int j) cutoff = MAX(cutoff,maxrad_dynamic[i] + maxrad_frozen[j] + pulloff); } } else { - // radius info about either i or j does not exist // (i.e. not present and not about to get poured; // set to largest value to not interfere with neighbor list) @@ -638,25 +631,15 @@ double PairGranular::init_one(int i, int j) } cutoff = cutmax; } - } else if (models[i][j]->cutoff_type > 0) { - cutoff = models[i][j]->cutoff_type; + } else if (cutoff_type[i][j] > 0) { + cutoff = cutoff_type[i][j]; } else if (cutoff_global > 0) { cutoff = cutoff_global; } // Copy global options - models[i][j]->dt = models[j][i]->dt = dt; - models[i][j]->normal_model->history_index = models[j][i]->normal_model->history_index = normal_history_index; - models[i][j]->tangential_model->history_index = models[j][i]->tangential_model->history_index = tangential_history_index; - models[i][j]->rolling_model->history_index = models[j][i]->rolling_model->history_index = roll_history_index; - models[i][j]->twisting_model->history_index = models[j][i]->twisting_model->history_index = twist_history_index; - - models[i][j]->size_history = models[j][i]->size_history = size_history; - models[i][j]->init(); // Calculates cumulative properties of sub models - models[j][i]->init(); - - if (models[i][j]->nondefault_history_transfer) nondefault_history_transfer = 1; - + models[i][j]->dt = dt; + models[j][i] = models[i][j]; return cutoff; } @@ -671,9 +654,8 @@ void PairGranular::write_restart(FILE *fp) for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { - if (comm->me == 0){ - models[i][j]->write_restart(fp); - } + fwrite(&cutoff_type[i][j],sizeof(double),1,fp); + models[i][j]->write_restart(fp); } } } @@ -693,9 +675,14 @@ void PairGranular::read_restart(FILE *fp) if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - vec_models.push_back(ContactModel()); + if (me == 0) + utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,nullptr,error); + MPI_Bcast(&cutoff_type[i][j],1,MPI_DOUBLE,0,world); + + vec_models.push_back(ContactModel(lmp)); models[i][j] = & vec_models.back(); models[i][j]->read_restart(fp); + models[i][j]->init(); } } } diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 68b83d3686..ae85748488 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -73,14 +73,7 @@ class PairGranular : public Pair { // contact models std::vector vec_models; - Contact::ContactModel ***models; - - // indices of history entries - int normal_history_index; - int damping_history_index; - int tangential_history_index; - int roll_history_index; - int twist_history_index; + std::vector > models; // optional user-specified global cutoff, per-type user-specified cutoffs double **cutoff_type; diff --git a/src/contact.h b/src/contact.h index bd04fe9ce1..4c38657ed7 100644 --- a/src/contact.h +++ b/src/contact.h @@ -26,6 +26,12 @@ enum ModelType { ROLLING = 3, TWISTING = 4, HEAT = 5 +}; // Relative order matters since some derive coeffs from others + +enum WallType { + NONE = 0, + RWALL = 1, + RDUPLICATE = 2 }; #define EPSILON 1e-10 @@ -41,10 +47,10 @@ class SubModel; class ContactModel : protected Pointers { public: - ContactModel(); + ContactModel(class LAMMPS *); ~ContactModel(); void init(); - bool check_contact(); + bool check_contact(double = 0); void reset_contact(); void prep_contact(); void calculate_forces(); @@ -68,8 +74,8 @@ class ContactModel : protected Pointers { SubModel *sub_models[6]; // Need to resize if we add more model flavors // Extra options - int beyond_contact, limit_damping, history_update, wall_flag; - double cutoff_type; + int beyond_contact, limit_damping, history_update; + WallType wall_type; // History variables int size_history, nondefault_history_transfer; @@ -77,7 +83,7 @@ class ContactModel : protected Pointers { double *history; // Contact properties/output - double *forces, *torquesi, *torquesj; + double forces[3], torquesi[3], torquesj[3]; double radi, radj, rwall, meff, dt, Ti, Tj, area; double Fntot, magtortwist; From 1cd18d2b371b98d814523f1620eeb545235783e8 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 24 Aug 2022 14:47:10 -0600 Subject: [PATCH 018/112] Replacing # of models with macro, may revise... --- src/GRANULAR/contact.cpp | 2 +- src/GRANULAR/contact.h | 9 +++++---- src/GRANULAR/contact_normal_models.cpp | 16 ++++------------ src/GRANULAR/fix_wall_gran.cpp | 2 +- src/GRANULAR/pair_granular.cpp | 10 +++++----- src/contact.h | 9 +++++---- 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index a59eca9374..c181d64f45 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -41,7 +41,7 @@ ContactModel::ContactModel(LAMMPS *lmp) : Pointers(lmp) limit_damping = 0; beyond_contact = 0; nondefault_history_transfer = 0; - nmodels = 6; + nmodels = NMODELS; wall_type = NONE; diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 4c38657ed7..5fbb8a8489 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -19,6 +19,9 @@ namespace LAMMPS_NS { namespace Contact { +#define EPSILON 1e-10 +#define NMODELS 6 + enum ModelType { NORMAL = 0, DAMPING = 1, @@ -34,8 +37,6 @@ enum WallType { RDUPLICATE = 2 }; -#define EPSILON 1e-10 - // forward declaration class NormalModel; class DampingModel; @@ -71,7 +72,7 @@ class ContactModel : protected Pointers { RollingModel *rolling_model; TwistingModel *twisting_model; HeatModel *heat_model; - SubModel *sub_models[6]; // Need to resize if we add more model flavors + SubModel *sub_models[NMODELS]; // Need to resize if we add more model flavors // Extra options int beyond_contact, limit_damping, history_update; @@ -95,11 +96,11 @@ class ContactModel : protected Pointers { double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; double magtwist; bool touch; + int nmodels; protected: int prep_flag, check_flag; - int nmodels; }; } // namespace Contact diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index 6c31cf2c70..d0dc19b14f 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -180,7 +180,7 @@ void NormalHertzMaterial::coeffs_to_local() void NormalHertzMaterial::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) { - coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0],imodel->coeffs[2], jmodel->coeffs[2]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); coeffs_to_local(); @@ -205,11 +205,7 @@ void NormalDMT::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; -<<<<<<< HEAD - k = FOURTHIRDS * Emod; -======= - k = 4 / 3 * mix_stiffnessE(Emod, Emod, poiss, poiss); ->>>>>>> 12c1923511e802b3b531e34b24fcf386f187dab5 + k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); } @@ -218,7 +214,7 @@ void NormalDMT::coeffs_to_local() void NormalDMT::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) { - coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0],imodel->coeffs[2], jmodel->coeffs[2]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); @@ -269,12 +265,8 @@ void NormalJKR::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; -<<<<<<< HEAD k = FOURTHIRDS * Emod; - Escaled = k * THREEQUARTERS; -======= Escaled = mix_stiffnessE(Emod, Emod, poiss, poiss); //Dan, not sure why these coefficients are mixed in the regular pair style ->>>>>>> 12c1923511e802b3b531e34b24fcf386f187dab5 if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); } @@ -283,7 +275,7 @@ void NormalJKR::coeffs_to_local() void NormalJKR::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) { - coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0],imodel->coeffs[2], jmodel->coeffs[2]); coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 208ff10bdd..c1640c6fdf 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -361,7 +361,7 @@ void FixWallGran::init() int next_index = 0; if (model->beyond_contact) next_index = 1; - for (i = 0; i < 6; i++) { + for (i = 0; i < NMODELS; i++) { if (model->sub_models[i]) { model->sub_models[i]->history_index = next_index; next_index += model->sub_models[i]->size_history; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 0c228a2936..b3c587af8b 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -444,13 +444,13 @@ void PairGranular::init_style() error->all(FLERR,"Pair granular requires ghost atoms store velocity"); // allocate history and initialize models - int size_max[6] = {0,0,0,0,0,0}; + int size_max[NMODELS] = {0}; for (auto &model : vec_models) { model.init(); if (model.size_history != 0) use_history = 1; - for (i = 0; i < 6; i++) + for (i = 0; i < NMODELS; i++) if (model.sub_models[i]) if (model.sub_models[i]->size_history > size_max[i]) size_max[i] = model.sub_models[i]->size_history; @@ -459,11 +459,11 @@ void PairGranular::init_style() } size_history = 0; - for (i = 0; i < 6; i++) size_history += size_max[i]; + for (i = 0; i < NMODELS; i++) size_history += size_max[i]; for (auto &model : vec_models) { int next_index = 0; - for (i = 0; i < 6; i++) { + for (i = 0; i < NMODELS; i++) { if (model.sub_models[i]) { model.sub_models[i]->history_index = next_index; next_index += size_max[i]; @@ -585,7 +585,7 @@ double PairGranular::init_one(int i, int j) vec_models.back().mix_coeffs(models[i][i], models[j][j]); vec_models.back().init(); // Calculates cumulative properties of sub models - for (int k = 0; k < 6; k++) + for (int k = 0; k < NMODELS; k++) vec_models.back().sub_models[k]->history_index = models[i][i]->sub_models[k]->history_index; } diff --git a/src/contact.h b/src/contact.h index 4c38657ed7..5fbb8a8489 100644 --- a/src/contact.h +++ b/src/contact.h @@ -19,6 +19,9 @@ namespace LAMMPS_NS { namespace Contact { +#define EPSILON 1e-10 +#define NMODELS 6 + enum ModelType { NORMAL = 0, DAMPING = 1, @@ -34,8 +37,6 @@ enum WallType { RDUPLICATE = 2 }; -#define EPSILON 1e-10 - // forward declaration class NormalModel; class DampingModel; @@ -71,7 +72,7 @@ class ContactModel : protected Pointers { RollingModel *rolling_model; TwistingModel *twisting_model; HeatModel *heat_model; - SubModel *sub_models[6]; // Need to resize if we add more model flavors + SubModel *sub_models[NMODELS]; // Need to resize if we add more model flavors // Extra options int beyond_contact, limit_damping, history_update; @@ -95,11 +96,11 @@ class ContactModel : protected Pointers { double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; double magtwist; bool touch; + int nmodels; protected: int prep_flag, check_flag; - int nmodels; }; } // namespace Contact From 3df0abd081e61d801eaa1997076d6b253c0a2c20 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 9 Sep 2022 14:13:52 -0600 Subject: [PATCH 019/112] Debugging restarts --- src/GRANULAR/contact.cpp | 16 ++++++++-------- src/GRANULAR/pair_granular.cpp | 32 +++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index c181d64f45..a5a6042347 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -225,17 +225,18 @@ void ContactModel::init() // Check if model has nondefault transfers, if so copy its array if (j != nmodels) { - if (sub_models[j]->nondefault_history_transfer) { - transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; - } else { - transfer_history_factor[i] = -1; + transfer_history_factor[i] = -1; + if (sub_models[j]) { + if (sub_models[j]->nondefault_history_transfer) { + transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; + } } } } } for (i = 0; i < nmodels; i++) - if (sub_models[i]) sub_models[i]->init(); + if (sub_models[i]) sub_models[i]->init(); } /* ---------------------------------------------------------------------- */ @@ -263,7 +264,7 @@ void ContactModel::write_restart(FILE *fp) fwrite(&num_char, sizeof(int), 1, fp); fwrite(sub_models[i]->name.data(), sizeof(char), num_char, fp); fwrite(&num_coeffs, sizeof(int), 1, fp); - fwrite(sub_models[i]->coeffs, sizeof(int), num_coeffs, fp); + fwrite(sub_models[i]->coeffs, sizeof(double), num_coeffs, fp); } else { fwrite(&num_char, sizeof(int), 1, fp); } @@ -297,10 +298,9 @@ void ContactModel::read_restart(FILE *fp) MPI_Bcast(&num_coeff, 1, MPI_INT, 0, world); if (comm->me == 0) { - utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(int), num_coeff, fp, nullptr, error); + utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(double), num_coeff, fp, nullptr, error); } MPI_Bcast(sub_models[i]->coeffs, num_coeff, MPI_DOUBLE, 0, world); - sub_models[i]->coeffs_to_local(); } } diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index b3c587af8b..44b81bbc87 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -435,7 +435,6 @@ void PairGranular::coeff(int narg, char **arg) void PairGranular::init_style() { int i; - // error and warning checks if (!atom->radius_flag || !atom->rmass_flag) @@ -649,13 +648,18 @@ double PairGranular::init_one(int i, int j) void PairGranular::write_restart(FILE *fp) { - int i,j; + int i,j,index; + int nmodels = vec_models.size(); + fwrite(&nmodels,sizeof(int),1,fp); + for (auto &model : vec_models) model.write_restart(fp); + for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { fwrite(&cutoff_type[i][j],sizeof(double),1,fp); - models[i][j]->write_restart(fp); + index = models[i][j] - &vec_models[0]; + fwrite(&index,sizeof(int),1,fp); // save index of model } } } @@ -668,21 +672,31 @@ void PairGranular::write_restart(FILE *fp) void PairGranular::read_restart(FILE *fp) { allocate(); - int i,j; + int i,j,index,nmodels; int me = comm->me; + + if (me == 0) utils::sfread(FLERR,&nmodels,sizeof(int),1,fp,nullptr,error); + MPI_Bcast(&nmodels,1,MPI_INT,0,world); + + for (i = 0; i < nmodels; i++) { + vec_models.push_back(ContactModel(lmp)); + vec_models.back().read_restart(fp); + vec_models.back().init(); + } + for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) + if (me == 0) { utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&index,sizeof(int),1,fp,nullptr,error); + } MPI_Bcast(&cutoff_type[i][j],1,MPI_DOUBLE,0,world); + MPI_Bcast(&index,1,MPI_INT,0,world); - vec_models.push_back(ContactModel(lmp)); - models[i][j] = & vec_models.back(); - models[i][j]->read_restart(fp); - models[i][j]->init(); + models[i][j] = & vec_models[index]; } } } From 6a6291827f32dc89f75870f978a661e2843c7b46 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 9 Sep 2022 15:11:24 -0600 Subject: [PATCH 020/112] Simplifying mixing coeffs, other misc clean ups --- src/GRANULAR/contact.cpp | 19 +++++----- src/GRANULAR/contact.h | 5 ++- src/GRANULAR/contact_damping_models.h | 4 +-- src/GRANULAR/contact_heat_models.cpp | 4 +-- src/GRANULAR/contact_heat_models.h | 7 ++-- src/GRANULAR/contact_normal_models.cpp | 40 +++++++++++----------- src/GRANULAR/contact_normal_models.h | 33 +++++++++--------- src/GRANULAR/contact_rolling_models.cpp | 8 ++--- src/GRANULAR/contact_rolling_models.h | 7 ++-- src/GRANULAR/contact_sub_models.h | 7 ++-- src/GRANULAR/contact_tangential_models.cpp | 24 ++++++------- src/GRANULAR/contact_tangential_models.h | 16 ++++----- src/GRANULAR/contact_twisting_models.cpp | 8 ++--- src/GRANULAR/contact_twisting_models.h | 7 ++-- src/GRANULAR/fix_wall_gran.cpp | 2 +- src/GRANULAR/pair_granular.cpp | 10 +++--- src/contact.h | 5 ++- 17 files changed, 104 insertions(+), 102 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index a5a6042347..488e175227 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -41,7 +41,6 @@ ContactModel::ContactModel(LAMMPS *lmp) : Pointers(lmp) limit_damping = 0; beyond_contact = 0; nondefault_history_transfer = 0; - nmodels = NMODELS; wall_type = NONE; @@ -54,7 +53,7 @@ ContactModel::ContactModel(LAMMPS *lmp) : Pointers(lmp) twisting_model = nullptr; heat_model = nullptr; - for (int i = 0; i < nmodels; i++) sub_models[i] = nullptr; + for (int i = 0; i < NSUBMODELS; i++) sub_models[i] = nullptr; transfer_history_factor = nullptr; } @@ -200,7 +199,7 @@ void ContactModel::init() int i, j, size_cumulative; size_history = 0; - for (i = 0; i < nmodels; i++) { + for (i = 0; i < NSUBMODELS; i++) { if (sub_models[i]) { if (sub_models[i]->nondefault_history_transfer) nondefault_history_transfer = 1; @@ -216,7 +215,7 @@ void ContactModel::init() for (i = 0; i < size_history; i++) { // Find which model controls this history value size_cumulative = 0; - for (j = 0; j < nmodels; j++) { + for (j = 0; j < NSUBMODELS; j++) { if (sub_models[j]) { if (size_cumulative + sub_models[j]->size_history > i) break; size_cumulative += sub_models[j]->size_history; @@ -224,7 +223,7 @@ void ContactModel::init() } // Check if model has nondefault transfers, if so copy its array - if (j != nmodels) { + if (j != NSUBMODELS) { transfer_history_factor[i] = -1; if (sub_models[j]) { if (sub_models[j]->nondefault_history_transfer) { @@ -235,7 +234,7 @@ void ContactModel::init() } } - for (i = 0; i < nmodels; i++) + for (i = 0; i < NSUBMODELS; i++) if (sub_models[i]) sub_models[i]->init(); } @@ -243,9 +242,9 @@ void ContactModel::init() void ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) { - for (int i = 0; i < nmodels; i++) + for (int i = 0; i < NSUBMODELS; i++) if (sub_models[i]) - sub_models[i]->mix_coeffs(c1->sub_models[i], c2->sub_models[i]); + sub_models[i]->mix_coeffs(c1->sub_models[i]->coeffs, c2->sub_models[i]->coeffs); limit_damping = MAX(c1->limit_damping, c2->limit_damping); } @@ -256,7 +255,7 @@ void ContactModel::write_restart(FILE *fp) { int num_char, num_coeffs; - for (int i = 0; i < nmodels; i++) { + for (int i = 0; i < NSUBMODELS; i++) { num_char = -1; if (sub_models[i]) { num_char = sub_models[i]->name.length(); @@ -277,7 +276,7 @@ void ContactModel::read_restart(FILE *fp) { int num_char, num_coeff; - for (int i = 0; i < nmodels; i++) { + for (int i = 0; i < NSUBMODELS; i++) { if (comm->me == 0) utils::sfread(FLERR, &num_char, sizeof(int), 1, fp, nullptr, error); MPI_Bcast(&num_char, 1, MPI_INT, 0, world); diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 5fbb8a8489..535ec4461e 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -20,7 +20,7 @@ namespace LAMMPS_NS { namespace Contact { #define EPSILON 1e-10 -#define NMODELS 6 +#define NSUBMODELS 6 enum ModelType { NORMAL = 0, @@ -72,7 +72,7 @@ class ContactModel : protected Pointers { RollingModel *rolling_model; TwistingModel *twisting_model; HeatModel *heat_model; - SubModel *sub_models[NMODELS]; // Need to resize if we add more model flavors + SubModel *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors // Extra options int beyond_contact, limit_damping, history_update; @@ -96,7 +96,6 @@ class ContactModel : protected Pointers { double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; double magtwist; bool touch; - int nmodels; protected: diff --git a/src/GRANULAR/contact_damping_models.h b/src/GRANULAR/contact_damping_models.h index 70294edc6a..b1e1b795e0 100644 --- a/src/GRANULAR/contact_damping_models.h +++ b/src/GRANULAR/contact_damping_models.h @@ -25,7 +25,7 @@ class DampingModel : public SubModel { DampingModel(class LAMMPS *); ~DampingModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(DampingModel*, DampingModel*) {}; + virtual void mix_coeffs(double*, double*) {}; virtual void init(); virtual double calculate_forces() = 0; double damp; @@ -60,7 +60,7 @@ class DampingViscoelastic : public DampingModel { class DampingTsuji : public DampingModel { public: DampingTsuji(class LAMMPS *); - void init(); + void init() override; double calculate_forces(); }; diff --git a/src/GRANULAR/contact_heat_models.cpp b/src/GRANULAR/contact_heat_models.cpp index d25955b1c2..60f2ef1cbe 100644 --- a/src/GRANULAR/contact_heat_models.cpp +++ b/src/GRANULAR/contact_heat_models.cpp @@ -44,9 +44,9 @@ void HeatArea::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void HeatArea::mix_coeffs(HeatModel* imodel, HeatModel* jmodel) +void HeatArea::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); + coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); coeffs_to_local(); } diff --git a/src/GRANULAR/contact_heat_models.h b/src/GRANULAR/contact_heat_models.h index b3104e9f3a..33b7eb2e90 100644 --- a/src/GRANULAR/contact_heat_models.h +++ b/src/GRANULAR/contact_heat_models.h @@ -24,7 +24,8 @@ class HeatModel : public SubModel { HeatModel(class LAMMPS *); ~HeatModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(HeatModel*, HeatModel*) {}; + virtual void mix_coeffs(double*, double*) {}; + virtual void init() {}; virtual double calculate_heat() = 0; }; @@ -33,8 +34,8 @@ class HeatModel : public SubModel { class HeatArea : public HeatModel { public: HeatArea(class LAMMPS *); - void coeffs_to_local(); - void mix_coeffs(HeatModel*, HeatModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; double calculate_heat(); protected: double conductivity; diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index d0dc19b14f..fb3523069c 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -89,10 +89,10 @@ void NormalHooke::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void NormalHooke::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void NormalHooke::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); coeffs_to_local(); } @@ -132,10 +132,10 @@ void NormalHertz::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void NormalHertz::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void NormalHertz::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); coeffs_to_local(); } @@ -178,11 +178,11 @@ void NormalHertzMaterial::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void NormalHertzMaterial::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void NormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0],imodel->coeffs[2], jmodel->coeffs[2]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); - coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs_to_local(); } @@ -212,12 +212,12 @@ void NormalDMT::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void NormalDMT::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void NormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0],imodel->coeffs[2], jmodel->coeffs[2]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); - coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); - coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); + coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); coeffs_to_local(); } @@ -273,12 +273,12 @@ void NormalJKR::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void NormalJKR::mix_coeffs(NormalModel* imodel, NormalModel* jmodel) +void NormalJKR::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_stiffnessE(imodel->coeffs[0], jmodel->coeffs[0],imodel->coeffs[2], jmodel->coeffs[2]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); - coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); - coeffs[3] = mix_geom(imodel->coeffs[3], jmodel->coeffs[3]); + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); + coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); coeffs_to_local(); } diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index ec604d04ba..f683e53308 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -24,7 +24,8 @@ class NormalModel : public SubModel { NormalModel(class LAMMPS *); ~NormalModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(NormalModel*, NormalModel*) {}; + virtual void mix_coeffs(double*, double*) {}; + virtual void init() {}; virtual bool touch(); virtual double pulloff_distance(double, double); virtual double calculate_area(); @@ -43,8 +44,8 @@ class NormalHooke : public NormalModel { public: NormalHooke(class LAMMPS *); ~NormalHooke() {}; - void coeffs_to_local(); - void mix_coeffs(NormalModel*, NormalModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; double calculate_forces(); void set_knfac(); protected: @@ -57,8 +58,8 @@ class NormalHertz : public NormalModel { public: NormalHertz(class LAMMPS *); ~NormalHertz() {}; - void coeffs_to_local(); - void mix_coeffs(NormalModel*, NormalModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; double calculate_forces(); void set_knfac(); protected: @@ -71,8 +72,8 @@ class NormalHertzMaterial : public NormalHertz { public: NormalHertzMaterial(class LAMMPS *); ~NormalHertzMaterial() {}; - void coeffs_to_local(); - void mix_coeffs(NormalModel*, NormalModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; }; /* ---------------------------------------------------------------------- */ @@ -81,11 +82,11 @@ class NormalDMT : public NormalModel { public: NormalDMT(class LAMMPS *); ~NormalDMT() {}; - void coeffs_to_local(); - void mix_coeffs(NormalModel*, NormalModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; double calculate_forces(); void set_knfac(); - void set_fncrit(); + void set_fncrit() override; protected: double k, cohesion; double F_pulloff; @@ -97,14 +98,14 @@ class NormalJKR : public NormalModel { public: NormalJKR(class LAMMPS *); ~NormalJKR() {}; - void coeffs_to_local(); - void mix_coeffs(NormalModel*, NormalModel*); - bool touch(); - double pulloff_distance(double, double); - double calculate_area(); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; + bool touch() override; + double pulloff_distance(double, double) override; + double calculate_area() override; double calculate_forces(); void set_knfac(); - void set_fncrit(); + void set_fncrit() override; protected: double k, cohesion; double Escaled, F_pulloff; diff --git a/src/GRANULAR/contact_rolling_models.cpp b/src/GRANULAR/contact_rolling_models.cpp index cc8e3e471e..8f90b4bc04 100644 --- a/src/GRANULAR/contact_rolling_models.cpp +++ b/src/GRANULAR/contact_rolling_models.cpp @@ -53,11 +53,11 @@ void RollingSDS::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void RollingSDS::mix_coeffs(RollingModel* imodel, RollingModel* jmodel) +void RollingSDS::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); - coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs_to_local(); } diff --git a/src/GRANULAR/contact_rolling_models.h b/src/GRANULAR/contact_rolling_models.h index e81d22301c..c3ab6810fa 100644 --- a/src/GRANULAR/contact_rolling_models.h +++ b/src/GRANULAR/contact_rolling_models.h @@ -24,7 +24,8 @@ class RollingModel : public SubModel { RollingModel(class LAMMPS *); ~RollingModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(RollingModel*, RollingModel*) {}; + virtual void mix_coeffs(double*, double*) {}; + virtual void init() {}; virtual double calculate_forces() = 0; }; @@ -33,8 +34,8 @@ class RollingModel : public SubModel { class RollingSDS : public RollingModel { public: RollingSDS(class LAMMPS *); - void coeffs_to_local(); - void mix_coeffs(RollingModel*, RollingModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; double calculate_forces(); protected: double k, mu, gamma; diff --git a/src/GRANULAR/contact_sub_models.h b/src/GRANULAR/contact_sub_models.h index 67e9c79e35..7b28bb4c57 100644 --- a/src/GRANULAR/contact_sub_models.h +++ b/src/GRANULAR/contact_sub_models.h @@ -29,9 +29,10 @@ class SubModel : protected Pointers { double *coeffs; void read_restart(); int parse_coeffs(char **, int, int); - virtual void mix_coeffs(SubModel*, SubModel*) {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; // called after all other submodel coeffs defined + virtual void mix_coeffs(double*, double*) = 0; + virtual void coeffs_to_local() = 0; + virtual void init() = 0; // called after all other submodel coeffs defined + void allocate_coeffs(); std::string name; diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index d518926c38..a4911cd5c2 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -61,10 +61,10 @@ void TangentialLinearNoHistory::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void TangentialLinearNoHistory::mix_coeffs(TangentialModel* imodel, TangentialModel* jmodel) +void TangentialLinearNoHistory::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); + coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); coeffs_to_local(); } @@ -108,11 +108,11 @@ void TangentialLinearHistory::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void TangentialLinearHistory::mix_coeffs(TangentialModel* imodel, TangentialModel* jmodel) +void TangentialLinearHistory::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); - coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs_to_local(); } @@ -205,12 +205,12 @@ void TangentialMindlin::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void TangentialMindlin::mix_coeffs(TangentialModel* imodel, TangentialModel* jmodel) +void TangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) { - if (imodel->coeffs[0] == -1 || imodel->coeffs[0] == -1) coeffs[0] = -1; - else coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); - coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + if (icoeffs[0] == -1 || jcoeffs[0] == -1) coeffs[0] = -1; + else coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs_to_local(); } diff --git a/src/GRANULAR/contact_tangential_models.h b/src/GRANULAR/contact_tangential_models.h index 4e2c85f678..620f3388da 100644 --- a/src/GRANULAR/contact_tangential_models.h +++ b/src/GRANULAR/contact_tangential_models.h @@ -24,9 +24,9 @@ class TangentialModel : public SubModel { TangentialModel(class LAMMPS *); virtual ~TangentialModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(TangentialModel*, TangentialModel*) {}; + virtual void mix_coeffs(double*, double*) {}; + virtual void init(); virtual void calculate_forces() = 0; - void init(); int rescale_flag; double k, damp, mu; // Used by Marshall twisting model protected: @@ -38,8 +38,8 @@ class TangentialModel : public SubModel { class TangentialLinearNoHistory : public TangentialModel { public: TangentialLinearNoHistory(class LAMMPS *); - void coeffs_to_local(); - void mix_coeffs(TangentialModel*, TangentialModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; void calculate_forces(); }; @@ -48,8 +48,8 @@ class TangentialLinearNoHistory : public TangentialModel { class TangentialLinearHistory : public TangentialModel { public: TangentialLinearHistory(class LAMMPS *); - void coeffs_to_local(); - void mix_coeffs(TangentialModel*, TangentialModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; void calculate_forces(); }; @@ -58,8 +58,8 @@ class TangentialLinearHistory : public TangentialModel { class TangentialMindlin : public TangentialModel { public: TangentialMindlin(class LAMMPS *); - void coeffs_to_local(); - void mix_coeffs(TangentialModel*, TangentialModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; void calculate_forces(); protected: int mindlin_rescale, mindlin_force; diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 089b4c686e..1fddda559c 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -93,11 +93,11 @@ void TwistingSDS::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void TwistingSDS::mix_coeffs(TwistingModel* imodel, TwistingModel* jmodel) +void TwistingSDS::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_geom(imodel->coeffs[0], jmodel->coeffs[0]); - coeffs[1] = mix_geom(imodel->coeffs[1], jmodel->coeffs[1]); - coeffs[2] = mix_geom(imodel->coeffs[2], jmodel->coeffs[2]); + coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs_to_local(); } diff --git a/src/GRANULAR/contact_twisting_models.h b/src/GRANULAR/contact_twisting_models.h index 5bcdc6b2a3..726eb163bf 100644 --- a/src/GRANULAR/contact_twisting_models.h +++ b/src/GRANULAR/contact_twisting_models.h @@ -24,7 +24,8 @@ class TwistingModel : public SubModel { TwistingModel(class LAMMPS *); virtual ~TwistingModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(TwistingModel*, TwistingModel*) {}; + virtual void mix_coeffs(double*, double*) {}; + virtual void init() {}; virtual double calculate_forces() = 0; }; @@ -41,8 +42,8 @@ class TwistingMarshall : public TwistingModel { class TwistingSDS : public TwistingModel { public: TwistingSDS(class LAMMPS *); - void coeffs_to_local(); - void mix_coeffs(TwistingModel*, TwistingModel*); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; double calculate_forces(); protected: double k, mu, damp; diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index c1640c6fdf..b0f87890f7 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -361,7 +361,7 @@ void FixWallGran::init() int next_index = 0; if (model->beyond_contact) next_index = 1; - for (i = 0; i < NMODELS; i++) { + for (i = 0; i < NSUBMODELS; i++) { if (model->sub_models[i]) { model->sub_models[i]->history_index = next_index; next_index += model->sub_models[i]->size_history; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 44b81bbc87..c4d7bc1490 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -443,13 +443,13 @@ void PairGranular::init_style() error->all(FLERR,"Pair granular requires ghost atoms store velocity"); // allocate history and initialize models - int size_max[NMODELS] = {0}; + int size_max[NSUBMODELS] = {0}; for (auto &model : vec_models) { model.init(); if (model.size_history != 0) use_history = 1; - for (i = 0; i < NMODELS; i++) + for (i = 0; i < NSUBMODELS; i++) if (model.sub_models[i]) if (model.sub_models[i]->size_history > size_max[i]) size_max[i] = model.sub_models[i]->size_history; @@ -458,11 +458,11 @@ void PairGranular::init_style() } size_history = 0; - for (i = 0; i < NMODELS; i++) size_history += size_max[i]; + for (i = 0; i < NSUBMODELS; i++) size_history += size_max[i]; for (auto &model : vec_models) { int next_index = 0; - for (i = 0; i < NMODELS; i++) { + for (i = 0; i < NSUBMODELS; i++) { if (model.sub_models[i]) { model.sub_models[i]->history_index = next_index; next_index += size_max[i]; @@ -584,7 +584,7 @@ double PairGranular::init_one(int i, int j) vec_models.back().mix_coeffs(models[i][i], models[j][j]); vec_models.back().init(); // Calculates cumulative properties of sub models - for (int k = 0; k < NMODELS; k++) + for (int k = 0; k < NSUBMODELS; k++) vec_models.back().sub_models[k]->history_index = models[i][i]->sub_models[k]->history_index; } diff --git a/src/contact.h b/src/contact.h index 5fbb8a8489..535ec4461e 100644 --- a/src/contact.h +++ b/src/contact.h @@ -20,7 +20,7 @@ namespace LAMMPS_NS { namespace Contact { #define EPSILON 1e-10 -#define NMODELS 6 +#define NSUBMODELS 6 enum ModelType { NORMAL = 0, @@ -72,7 +72,7 @@ class ContactModel : protected Pointers { RollingModel *rolling_model; TwistingModel *twisting_model; HeatModel *heat_model; - SubModel *sub_models[NMODELS]; // Need to resize if we add more model flavors + SubModel *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors // Extra options int beyond_contact, limit_damping, history_update; @@ -96,7 +96,6 @@ class ContactModel : protected Pointers { double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; double magtwist; bool touch; - int nmodels; protected: From 06953bd67aafed30f097f37aac7c45ad119d88cb Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 9 Sep 2022 17:12:51 -0600 Subject: [PATCH 021/112] Adding none submodels, further cleaning up mixing, misc edits --- doc/src/fix_temp_integrate.rst | 11 +- doc/src/pair_granular.rst | 28 +++- src/GRANULAR/contact.cpp | 180 +++++++++++---------- src/GRANULAR/contact.h | 7 +- src/GRANULAR/contact_damping_models.cpp | 13 ++ src/GRANULAR/contact_damping_models.h | 9 ++ src/GRANULAR/contact_heat_models.cpp | 21 ++- src/GRANULAR/contact_heat_models.h | 10 +- src/GRANULAR/contact_normal_models.cpp | 31 ++-- src/GRANULAR/contact_normal_models.h | 21 +-- src/GRANULAR/contact_rolling_models.cpp | 19 +-- src/GRANULAR/contact_rolling_models.h | 14 +- src/GRANULAR/contact_sub_models.cpp | 9 ++ src/GRANULAR/contact_sub_models.h | 2 +- src/GRANULAR/contact_tangential_models.cpp | 25 +-- src/GRANULAR/contact_tangential_models.h | 11 +- src/GRANULAR/contact_twisting_models.cpp | 26 ++- src/GRANULAR/contact_twisting_models.h | 16 +- src/GRANULAR/fix_wall_gran.cpp | 8 +- src/GRANULAR/fix_wall_gran_region.cpp | 2 +- src/GRANULAR/pair_granular.cpp | 40 ++--- src/contact.h | 7 +- 22 files changed, 275 insertions(+), 235 deletions(-) diff --git a/doc/src/fix_temp_integrate.rst b/doc/src/fix_temp_integrate.rst index c2f1257075..bd06b45c6e 100644 --- a/doc/src/fix_temp_integrate.rst +++ b/doc/src/fix_temp_integrate.rst @@ -52,11 +52,12 @@ of the specific heat are defined, one for each of the *N* types of atoms. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. 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 `. +No information about this fix is written to :doc:`binary restart files `. +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 `. Restrictions """""""""""" diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index d630b18a3a..675c8fe4ff 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -38,7 +38,7 @@ Examples pair_coeff 2 2 dmt 1000.0 50.0 0.3 10.0 tangential mindlin NULL 0.5 0.1 rolling sds 500.0 200.0 0.1 twisting marshall pair_style granular - pair_coeff * * hertz 1000.0 50.0 tangential mindlin 1000.0 1.0 0.4 heat 0.1 + pair_coeff * * hertz 1000.0 50.0 tangential mindlin 1000.0 1.0 0.4 heat area 0.1 Description """"""""""" @@ -634,18 +634,30 @@ attractive force. This keyword cannot be used with the JKR or DMT models. ---------- -The optional *heat* keyword enables heat conduction and it must be followed by -a non-negative numeric value for the conductivity :math:`k_{s}.`` The heat :math:`Q` -conducted across an interface is given by +The optional *heat* keyword enables heat conduction . The options currently +supported are: + +1. *none* +2. *area* : :math:`k_{s}` + +If the *heat* keyword is not specified, the model defaults to *none*. + +For *heat* *area*, the heat +:math:`Q` conducted across an interface is given by .. math:: Q = k_{s} a \Delta T -where :math:`\Delta T` is the difference in the two particles' temperature and :math:`a` -is the area of the contact and depends on the normal force model. Note that the *heat* keyword -must be included in either all or none of of the *pair_coeff* calls. See -:doc:`fix temp/integrate ` for more information on this option. + + +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. + +Note that the option *none* must either be used in all or none of of the +*pair_coeff* calls. See :doc:`fix temp/integrate ` for +more information on this option. ---------- diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 488e175227..a1a35afe47 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -76,7 +76,9 @@ ContactModel::~ContactModel() void ContactModel::init_model(std::string model_name, ModelType model_type) { if (model_type == NORMAL) { - if (model_name == "hooke") normal_model = new NormalHooke(lmp); + delete normal_model; + if (model_name == "none") normal_model = new NormalNone(lmp); + else if (model_name == "hooke") normal_model = new NormalHooke(lmp); else if (model_name == "hertz") normal_model = new NormalHertz(lmp); else if (model_name == "hertz/material") normal_model = new NormalHertzMaterial(lmp); else if (model_name == "dmt") normal_model = new NormalDMT(lmp); @@ -85,7 +87,9 @@ void ContactModel::init_model(std::string model_name, ModelType model_type) sub_models[model_type] = normal_model; } else if (model_type == TANGENTIAL) { - if (model_name == "linear_nohistory") tangential_model = new TangentialLinearNoHistory(lmp); + delete tangential_model; + if (model_name == "none") tangential_model = new TangentialNone(lmp); + else if (model_name == "linear_nohistory") tangential_model = new TangentialLinearNoHistory(lmp); else if (model_name == "linear_history") tangential_model = new TangentialLinearHistory(lmp); else if (model_name == "mindlin") tangential_model = new TangentialMindlin(lmp); else if (model_name == "mindlin/force") tangential_model = new TangentialMindlinForce(lmp); @@ -95,7 +99,9 @@ void ContactModel::init_model(std::string model_name, ModelType model_type) sub_models[model_type] = tangential_model; } else if (model_type == DAMPING) { - if (model_name == "velocity") damping_model = new DampingVelocity(lmp); + delete damping_model; + if (model_name == "none") damping_model = new DampingNone(lmp); + else if (model_name == "velocity") damping_model = new DampingVelocity(lmp); else if (model_name == "mass_velocity") damping_model = new DampingMassVelocity(lmp); else if (model_name == "viscoelastic") damping_model = new DampingViscoelastic(lmp); else if (model_name == "tsuji") damping_model = new DampingTsuji(lmp); @@ -103,21 +109,33 @@ void ContactModel::init_model(std::string model_name, ModelType model_type) sub_models[model_type] = damping_model; } else if (model_type == ROLLING) { - if (model_name == "none") delete rolling_model; - else if (model_name == "sds") rolling_model = new RollingSDS(lmp); + delete rolling_model; + rolling_defined = 1; + if (model_name == "none") { + rolling_model = new RollingNone(lmp); + rolling_defined = 0; + } else if (model_name == "sds") rolling_model = new RollingSDS(lmp); else error->all(FLERR, "Rolling model name {} not recognized", model_name); sub_models[model_type] = rolling_model; } else if (model_type == TWISTING) { - if (model_name == "none") delete twisting_model; - else if (model_name == "sds") twisting_model = new TwistingSDS(lmp); + delete twisting_model; + twisting_defined = 1; + if (model_name == "none") { + twisting_model = new TwistingNone(lmp); + twisting_defined = 0; + } else if (model_name == "sds") twisting_model = new TwistingSDS(lmp); else if (model_name == "marshall") twisting_model = new TwistingMarshall(lmp); else error->all(FLERR, "Twisting model name {} not recognized", model_name); sub_models[model_type] = twisting_model; } else if (model_type == HEAT) { - if (model_name == "none") delete heat_model; - else if (model_name == "area") heat_model = new HeatArea(lmp); + delete heat_model; + heat_defined = 1; + if (model_name == "none") { + heat_model = new HeatNone(lmp); + heat_defined = 0; + } else if (model_name == "area") heat_model = new HeatArea(lmp); else error->all(FLERR, "Heat model name not {} recognized", model_name); sub_models[model_type] = heat_model; } else { @@ -170,9 +188,9 @@ int ContactModel::init_classic_model(char **arg, int iarg, int narg) init_model("mass_velocity", DAMPING); // ensure additional models are undefined - rolling_model = nullptr; - twisting_model = nullptr; - heat_model = nullptr; + init_model("none", ROLLING); + init_model("none", TWISTING); + init_model("none", HEAT); // manually parse coeffs normal_model->coeffs[0] = kn; @@ -186,67 +204,71 @@ int ContactModel::init_classic_model(char **arg, int iarg, int narg) damping_model->coeffs_to_local(); iarg += 7; - return iarg ; + return iarg; } /* ---------------------------------------------------------------------- */ void ContactModel::init() { - if (!normal_model) error->all(FLERR, "Must specify normal contact model"); - if (!damping_model) error->all(FLERR, "Must specify damping contact model"); - if (!tangential_model) error->all(FLERR, "Must specify tangential contact model"); + int i, j; + for (i = 0; i < NSUBMODELS; i++) + if (!sub_models[i]) init_model("none", (ModelType) i); - int i, j, size_cumulative; + // Must have valid normal, damping, and tangential models + if (normal_model->name == "none") error->all(FLERR, "Must specify normal contact model"); + if (damping_model->name == "none") error->all(FLERR, "Must specify damping contact model"); + if (tangential_model->name == "none") error->all(FLERR, "Must specify tangential contact model"); + + int size_cumulative; size_history = 0; for (i = 0; i < NSUBMODELS; i++) { - if (sub_models[i]) { - if (sub_models[i]->nondefault_history_transfer) - nondefault_history_transfer = 1; - if (sub_models[i]->beyond_contact) - beyond_contact = 1; - size_history += sub_models[i]->size_history; - } + if (sub_models[i]->nondefault_history_transfer) + nondefault_history_transfer = 1; + if (sub_models[i]->beyond_contact) + beyond_contact = 1; + size_history += sub_models[i]->size_history; } if (nondefault_history_transfer) { transfer_history_factor = new double[size_history]; for (i = 0; i < size_history; i++) { - // Find which model controls this history value + // Find which model owns this history value size_cumulative = 0; for (j = 0; j < NSUBMODELS; j++) { - if (sub_models[j]) { - if (size_cumulative + sub_models[j]->size_history > i) break; - size_cumulative += sub_models[j]->size_history; - } + if (size_cumulative + sub_models[j]->size_history > i) break; + size_cumulative += sub_models[j]->size_history; } // Check if model has nondefault transfers, if so copy its array + transfer_history_factor[i] = -1; if (j != NSUBMODELS) { - transfer_history_factor[i] = -1; - if (sub_models[j]) { - if (sub_models[j]->nondefault_history_transfer) { - transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; - } + if (sub_models[j]->nondefault_history_transfer) { + transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; } } } } - for (i = 0; i < NSUBMODELS; i++) - if (sub_models[i]) sub_models[i]->init(); + for (i = 0; i < NSUBMODELS; i++) sub_models[i]->init(); } /* ---------------------------------------------------------------------- */ -void ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) +int ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) { - for (int i = 0; i < NSUBMODELS; i++) - if (sub_models[i]) - sub_models[i]->mix_coeffs(c1->sub_models[i]->coeffs, c2->sub_models[i]->coeffs); + int i; + for (i = 0; i < NSUBMODELS; i++) { + if (c1->sub_models[i]->name != c2->sub_models[i]->name) return i; + + init_model(c1->sub_models[i]->name, (ModelType) i); + sub_models[i]->mix_coeffs(c1->sub_models[i]->coeffs, c2->sub_models[i]->coeffs); + } limit_damping = MAX(c1->limit_damping, c2->limit_damping); + + return -1; } /* ---------------------------------------------------------------------- */ @@ -256,17 +278,12 @@ void ContactModel::write_restart(FILE *fp) int num_char, num_coeffs; for (int i = 0; i < NSUBMODELS; i++) { - num_char = -1; - if (sub_models[i]) { - num_char = sub_models[i]->name.length(); - num_coeffs = sub_models[i]->num_coeffs; - fwrite(&num_char, sizeof(int), 1, fp); - fwrite(sub_models[i]->name.data(), sizeof(char), num_char, fp); - fwrite(&num_coeffs, sizeof(int), 1, fp); - fwrite(sub_models[i]->coeffs, sizeof(double), num_coeffs, fp); - } else { - fwrite(&num_char, sizeof(int), 1, fp); - } + num_char = sub_models[i]->name.length(); + num_coeffs = sub_models[i]->num_coeffs; + fwrite(&num_char, sizeof(int), 1, fp); + fwrite(sub_models[i]->name.data(), sizeof(char), num_char, fp); + fwrite(&num_coeffs, sizeof(int), 1, fp); + fwrite(sub_models[i]->coeffs, sizeof(double), num_coeffs, fp); } } @@ -281,27 +298,25 @@ void ContactModel::read_restart(FILE *fp) utils::sfread(FLERR, &num_char, sizeof(int), 1, fp, nullptr, error); MPI_Bcast(&num_char, 1, MPI_INT, 0, world); - if (num_char != -1) { - std::string model_name (num_char, ' '); - if (comm->me == 0) - utils::sfread(FLERR, const_cast(model_name.data()), sizeof(char),num_char, fp, nullptr, error); - MPI_Bcast(const_cast(model_name.data()), num_char, MPI_CHAR, 0, world); + std::string model_name (num_char, ' '); + if (comm->me == 0) + utils::sfread(FLERR, const_cast(model_name.data()), sizeof(char),num_char, fp, nullptr, error); + MPI_Bcast(const_cast(model_name.data()), num_char, MPI_CHAR, 0, world); - init_model(model_name, (ModelType) i); + init_model(model_name, (ModelType) i); - if (comm->me == 0) { - utils::sfread(FLERR, &num_coeff, sizeof(int), 1, fp, nullptr, error); - if (num_coeff != sub_models[i]->num_coeffs) - error->one(FLERR, "Invalid contact model written to restart file"); - } - MPI_Bcast(&num_coeff, 1, MPI_INT, 0, world); - - if (comm->me == 0) { - utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(double), num_coeff, fp, nullptr, error); - } - MPI_Bcast(sub_models[i]->coeffs, num_coeff, MPI_DOUBLE, 0, world); - sub_models[i]->coeffs_to_local(); + if (comm->me == 0) { + utils::sfread(FLERR, &num_coeff, sizeof(int), 1, fp, nullptr, error); + if (num_coeff != sub_models[i]->num_coeffs) + error->one(FLERR, "Invalid contact model written to restart file"); } + MPI_Bcast(&num_coeff, 1, MPI_INT, 0, world); + + if (comm->me == 0) { + utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(double), num_coeff, fp, nullptr, error); + } + MPI_Bcast(sub_models[i]->coeffs, num_coeff, MPI_DOUBLE, 0, world); + sub_models[i]->coeffs_to_local(); } } @@ -378,10 +393,10 @@ void ContactModel::prep_contact() sub3(vt, temp, vtr); vrel = len3(vtr); - if (rolling_model || twisting_model) + if (rolling_defined || twisting_defined) sub3(omegai, omegaj, relrot); - if (rolling_model) { + if (rolling_defined) { // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) // this is different from the Marshall papers, which use the Bagi/Kuhn formulation // for rolling velocity (see Wang et al for why the latter is wrong) @@ -390,7 +405,7 @@ void ContactModel::prep_contact() vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); } - if (twisting_model) { + if (twisting_defined) { // omega_T (eq 29 of Marshall) magtwist = dot3(relrot, nx); } @@ -424,8 +439,8 @@ void ContactModel::calculate_forces() if (limit_damping && Fntot < 0.0) Fntot = 0.0; tangential_model->calculate_forces(); - if (rolling_model) rolling_model->calculate_forces(); - if (twisting_model) twisting_model->calculate_forces(); + if (rolling_defined) rolling_model->calculate_forces(); + if (twisting_defined) twisting_model->calculate_forces(); //********************************************** // sum contributions @@ -438,13 +453,13 @@ void ContactModel::calculate_forces() cross3(nx, fs, torquesi); copy3(torquesi, torquesj); - double dist_to_contact = radi-0.5*delta; + double dist_to_contact = radi - 0.5 * delta; scale3(dist_to_contact, torquesi); - dist_to_contact = radj-0.5*delta; + dist_to_contact = radj - 0.5 * delta; scale3(dist_to_contact, torquesj); double torroll[3]; - if (rolling_model) { + if (rolling_defined) { cross3(nx, fr, torroll); scale3(Reff, torroll); add3(torquesi, torroll, torquesi); @@ -452,18 +467,15 @@ void ContactModel::calculate_forces() } double tortwist[3]; - if (twisting_model) { + if (twisting_defined) { scale3(magtortwist, nx, tortwist); add3(torquesi, tortwist, torquesi); sub3(torquesj, tortwist, torquesj); } -} -/* ---------------------------------------------------------------------- */ - -double ContactModel::calculate_heat() -{ - return heat_model->calculate_heat(); + if (heat_defined) { + dq = heat_model->calculate_heat(); + } } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 535ec4461e..e0600146c3 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -55,12 +55,11 @@ class ContactModel : protected Pointers { void reset_contact(); void prep_contact(); void calculate_forces(); - double calculate_heat(); double pulloff_distance(double, double); void init_model(std::string, ModelType); int init_classic_model(char **, int, int); - void mix_coeffs(ContactModel*, ContactModel*); + int mix_coeffs(ContactModel*, ContactModel*); void write_restart(FILE *); void read_restart(FILE *); @@ -84,7 +83,7 @@ class ContactModel : protected Pointers { double *history; // Contact properties/output - double forces[3], torquesi[3], torquesj[3]; + double forces[3], torquesi[3], torquesj[3], dq; double radi, radj, rwall, meff, dt, Ti, Tj, area; double Fntot, magtortwist; @@ -98,7 +97,7 @@ class ContactModel : protected Pointers { bool touch; protected: - + int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels int prep_flag, check_flag; }; diff --git a/src/GRANULAR/contact_damping_models.cpp b/src/GRANULAR/contact_damping_models.cpp index 8d44746683..a003d181d9 100644 --- a/src/GRANULAR/contact_damping_models.cpp +++ b/src/GRANULAR/contact_damping_models.cpp @@ -33,6 +33,19 @@ void DampingModel::init() damp = contact->normal_model->damp; } +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +DampingNone::DampingNone(LAMMPS *lmp) : DampingModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + +double DampingNone::calculate_forces() +{ + return 0.0; +} + /* ---------------------------------------------------------------------- Velocity damping ------------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_damping_models.h b/src/GRANULAR/contact_damping_models.h index b1e1b795e0..611393da9f 100644 --- a/src/GRANULAR/contact_damping_models.h +++ b/src/GRANULAR/contact_damping_models.h @@ -33,6 +33,15 @@ class DampingModel : public SubModel { /* ---------------------------------------------------------------------- */ +class DampingNone : public DampingModel { + public: + DampingNone(class LAMMPS *); + void init() override {}; + double calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + class DampingVelocity : public DampingModel { public: DampingVelocity(class LAMMPS *); diff --git a/src/GRANULAR/contact_heat_models.cpp b/src/GRANULAR/contact_heat_models.cpp index 60f2ef1cbe..00ac0c0785 100644 --- a/src/GRANULAR/contact_heat_models.cpp +++ b/src/GRANULAR/contact_heat_models.cpp @@ -28,6 +28,19 @@ HeatModel::HeatModel(LAMMPS *lmp) : SubModel(lmp) {} Area-based heat conduction ------------------------------------------------------------------------- */ +HeatNone::HeatNone(LAMMPS *lmp) : HeatModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + +double HeatNone::calculate_heat() +{ + return 0.0; +} + +/* ---------------------------------------------------------------------- + Area-based heat conduction +------------------------------------------------------------------------- */ + HeatArea::HeatArea(LAMMPS *lmp) : HeatModel(lmp) { num_coeffs = 1; @@ -44,14 +57,6 @@ void HeatArea::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void HeatArea::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - double HeatArea::calculate_heat() { return conductivity * contact->area * (contact->Ti - contact->Tj); diff --git a/src/GRANULAR/contact_heat_models.h b/src/GRANULAR/contact_heat_models.h index 33b7eb2e90..5a0d495810 100644 --- a/src/GRANULAR/contact_heat_models.h +++ b/src/GRANULAR/contact_heat_models.h @@ -24,18 +24,24 @@ class HeatModel : public SubModel { HeatModel(class LAMMPS *); ~HeatModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(double*, double*) {}; virtual void init() {}; virtual double calculate_heat() = 0; }; /* ---------------------------------------------------------------------- */ +class HeatNone : public HeatModel { + public: + HeatNone(class LAMMPS *); + double calculate_heat(); +}; + +/* ---------------------------------------------------------------------- */ + class HeatArea : public HeatModel { public: HeatArea(class LAMMPS *); void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; double calculate_heat(); protected: double conductivity; diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index fb3523069c..2f59311edf 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -68,6 +68,19 @@ void NormalModel::set_fncrit() Fncrit = fabs(contact->Fntot); } +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +NormalNone::NormalNone(LAMMPS *lmp) : NormalModel(lmp) {} + +/* ---------------------------------------------------------------------- */ + +double NormalNone::calculate_forces() +{ + return 0.0; +} + /* ---------------------------------------------------------------------- Hookean normal force ------------------------------------------------------------------------- */ @@ -89,15 +102,6 @@ void NormalHooke::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void NormalHooke::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - double NormalHooke::calculate_forces() { Fne = knfac * contact->delta; @@ -132,15 +136,6 @@ void NormalHertz::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void NormalHertz::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - double NormalHertz::calculate_forces() { Fne = knfac * contact->delta; diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index f683e53308..6d47dd3736 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -24,7 +24,6 @@ class NormalModel : public SubModel { NormalModel(class LAMMPS *); ~NormalModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(double*, double*) {}; virtual void init() {}; virtual bool touch(); virtual double pulloff_distance(double, double); @@ -40,12 +39,19 @@ class NormalModel : public SubModel { /* ---------------------------------------------------------------------- */ +class NormalNone : public NormalModel { + public: + NormalNone(class LAMMPS *); + double calculate_forces(); + void set_knfac() {}; +}; + +/* ---------------------------------------------------------------------- */ + class NormalHooke : public NormalModel { public: NormalHooke(class LAMMPS *); - ~NormalHooke() {}; void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; double calculate_forces(); void set_knfac(); protected: @@ -57,9 +63,7 @@ class NormalHooke : public NormalModel { class NormalHertz : public NormalModel { public: NormalHertz(class LAMMPS *); - ~NormalHertz() {}; void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; double calculate_forces(); void set_knfac(); protected: @@ -71,7 +75,6 @@ class NormalHertz : public NormalModel { class NormalHertzMaterial : public NormalHertz { public: NormalHertzMaterial(class LAMMPS *); - ~NormalHertzMaterial() {}; void coeffs_to_local() override; void mix_coeffs(double*, double*) override; }; @@ -81,7 +84,6 @@ class NormalHertzMaterial : public NormalHertz { class NormalDMT : public NormalModel { public: NormalDMT(class LAMMPS *); - ~NormalDMT() {}; void coeffs_to_local() override; void mix_coeffs(double*, double*) override; double calculate_forces(); @@ -97,14 +99,13 @@ class NormalDMT : public NormalModel { class NormalJKR : public NormalModel { public: NormalJKR(class LAMMPS *); - ~NormalJKR() {}; void coeffs_to_local() override; void mix_coeffs(double*, double*) override; bool touch() override; double pulloff_distance(double, double) override; double calculate_area() override; - double calculate_forces(); - void set_knfac(); + double calculate_forces() override; + void set_knfac() override; void set_fncrit() override; protected: double k, cohesion; diff --git a/src/GRANULAR/contact_rolling_models.cpp b/src/GRANULAR/contact_rolling_models.cpp index 8f90b4bc04..956be65353 100644 --- a/src/GRANULAR/contact_rolling_models.cpp +++ b/src/GRANULAR/contact_rolling_models.cpp @@ -29,6 +29,12 @@ using namespace MathExtra; RollingModel::RollingModel(LAMMPS *lmp) : SubModel(lmp) {} +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +RollingNone::RollingNone(LAMMPS *lmp) : RollingModel(lmp) {} + /* ---------------------------------------------------------------------- SDS rolling friction model ------------------------------------------------------------------------- */ @@ -53,17 +59,7 @@ void RollingSDS::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void RollingSDS::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - -double RollingSDS::calculate_forces() +void RollingSDS::calculate_forces() { int rhist0, rhist1, rhist2, frameupdate; double Frcrit, rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; @@ -125,5 +121,4 @@ double RollingSDS::calculate_forces() contact->history[rhist0] = hist_temp[0]; contact->history[rhist1] = hist_temp[1]; contact->history[rhist2] = hist_temp[2]; - return 0; } diff --git a/src/GRANULAR/contact_rolling_models.h b/src/GRANULAR/contact_rolling_models.h index c3ab6810fa..f5af08c1b0 100644 --- a/src/GRANULAR/contact_rolling_models.h +++ b/src/GRANULAR/contact_rolling_models.h @@ -24,9 +24,16 @@ class RollingModel : public SubModel { RollingModel(class LAMMPS *); ~RollingModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(double*, double*) {}; virtual void init() {}; - virtual double calculate_forces() = 0; + virtual void calculate_forces() = 0; +}; + +/* ---------------------------------------------------------------------- */ + +class RollingNone : public RollingModel { + public: + RollingNone(class LAMMPS *); + void calculate_forces() {}; }; /* ---------------------------------------------------------------------- */ @@ -35,8 +42,7 @@ class RollingSDS : public RollingModel { public: RollingSDS(class LAMMPS *); void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; - double calculate_forces(); + void calculate_forces(); protected: double k, mu, gamma; }; diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/GRANULAR/contact_sub_models.cpp index 8aafc0f2b5..6ec7bbd017 100644 --- a/src/GRANULAR/contact_sub_models.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -73,6 +73,15 @@ int SubModel::parse_coeffs(char **arg, int iarg, int narg) return iarg + num_coeffs; } +/* ---------------------------------------------------------------------- */ + +void SubModel::mix_coeffs(double* icoeffs, double* jcoeffs) +{ + for (int i = 0; i < num_coeffs; i++) + coeffs[i] = mix_geom(icoeffs[i], jcoeffs[i]); + coeffs_to_local(); +} + /* ---------------------------------------------------------------------- mixing of Young's modulus (E) ------------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_sub_models.h b/src/GRANULAR/contact_sub_models.h index 7b28bb4c57..730790616d 100644 --- a/src/GRANULAR/contact_sub_models.h +++ b/src/GRANULAR/contact_sub_models.h @@ -29,7 +29,7 @@ class SubModel : protected Pointers { double *coeffs; void read_restart(); int parse_coeffs(char **, int, int); - virtual void mix_coeffs(double*, double*) = 0; + virtual void mix_coeffs(double*, double*); virtual void coeffs_to_local() = 0; virtual void init() = 0; // called after all other submodel coeffs defined diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index a4911cd5c2..437615441c 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -37,6 +37,12 @@ void TangentialModel::init() damp = xt * contact->damping_model->damp; } +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +TangentialNone::TangentialNone(LAMMPS *lmp) : TangentialModel(lmp) {} + /* ---------------------------------------------------------------------- Linear model with no history ------------------------------------------------------------------------- */ @@ -61,15 +67,6 @@ void TangentialLinearNoHistory::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void TangentialLinearNoHistory::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - void TangentialLinearNoHistory::calculate_forces() { double Fscrit, fsmag, Ft; @@ -108,16 +105,6 @@ void TangentialLinearHistory::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void TangentialLinearHistory::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - void TangentialLinearHistory::calculate_forces() { double Fscrit, magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; diff --git a/src/GRANULAR/contact_tangential_models.h b/src/GRANULAR/contact_tangential_models.h index 620f3388da..812eb62e55 100644 --- a/src/GRANULAR/contact_tangential_models.h +++ b/src/GRANULAR/contact_tangential_models.h @@ -24,7 +24,6 @@ class TangentialModel : public SubModel { TangentialModel(class LAMMPS *); virtual ~TangentialModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(double*, double*) {}; virtual void init(); virtual void calculate_forces() = 0; int rescale_flag; @@ -35,11 +34,18 @@ class TangentialModel : public SubModel { /* ---------------------------------------------------------------------- */ +class TangentialNone : public TangentialModel { + public: + TangentialNone(class LAMMPS *); + void calculate_forces() {}; +}; + +/* ---------------------------------------------------------------------- */ + class TangentialLinearNoHistory : public TangentialModel { public: TangentialLinearNoHistory(class LAMMPS *); void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; void calculate_forces(); }; @@ -49,7 +55,6 @@ class TangentialLinearHistory : public TangentialModel { public: TangentialLinearHistory(class LAMMPS *); void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; void calculate_forces(); }; diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 1fddda559c..8f3c5e571e 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -26,11 +26,13 @@ using namespace MathConst; Default twisting model ------------------------------------------------------------------------- */ -TwistingModel::TwistingModel(LAMMPS *lmp) : SubModel(lmp) -{ - num_coeffs = 0; - size_history = 3; -} +TwistingModel::TwistingModel(LAMMPS *lmp) : SubModel(lmp) {} + +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +TwistingNone::TwistingNone(LAMMPS *lmp) : TwistingModel(lmp) {} /* ---------------------------------------------------------------------- Marshall twisting model @@ -44,7 +46,7 @@ TwistingMarshall::TwistingMarshall(LAMMPS *lmp) : TwistingModel(lmp) /* ---------------------------------------------------------------------- */ -double TwistingMarshall::calculate_forces() +void TwistingMarshall::calculate_forces() { double signtwist, Mtcrit; @@ -93,17 +95,7 @@ void TwistingSDS::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void TwistingSDS::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - -double TwistingSDS::calculate_forces() +void TwistingSDS::calculate_forces() { double signtwist, Mtcrit; diff --git a/src/GRANULAR/contact_twisting_models.h b/src/GRANULAR/contact_twisting_models.h index 726eb163bf..15124ca378 100644 --- a/src/GRANULAR/contact_twisting_models.h +++ b/src/GRANULAR/contact_twisting_models.h @@ -24,9 +24,16 @@ class TwistingModel : public SubModel { TwistingModel(class LAMMPS *); virtual ~TwistingModel() {}; virtual void coeffs_to_local() {}; - virtual void mix_coeffs(double*, double*) {}; virtual void init() {}; - virtual double calculate_forces() = 0; + virtual void calculate_forces() = 0; +}; + +/* ---------------------------------------------------------------------- */ + +class TwistingNone : public TwistingModel { + public: + TwistingNone(class LAMMPS *); + void calculate_forces() {}; }; /* ---------------------------------------------------------------------- */ @@ -34,7 +41,7 @@ class TwistingModel : public SubModel { class TwistingMarshall : public TwistingModel { public: TwistingMarshall(class LAMMPS *); - double calculate_forces(); + void calculate_forces(); }; /* ---------------------------------------------------------------------- */ @@ -43,8 +50,7 @@ class TwistingSDS : public TwistingModel { public: TwistingSDS(class LAMMPS *); void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; - double calculate_forces(); + void calculate_forces(); protected: double k, mu, damp; }; diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index b0f87890f7..95cd4fc6e0 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -362,10 +362,8 @@ void FixWallGran::init() if (model->beyond_contact) next_index = 1; for (i = 0; i < NSUBMODELS; i++) { - if (model->sub_models[i]) { - model->sub_models[i]->history_index = next_index; - next_index += model->sub_models[i]->size_history; - } + model->sub_models[i]->history_index = next_index; + next_index += model->sub_models[i]->size_history; } } @@ -546,10 +544,10 @@ void FixWallGran::post_force(int /*vflag*/) model->prep_contact(); model->calculate_forces(); - if (heat_flag) dq = model->calculate_heat(); forces = model->forces; torquesi = model->torquesi; + if (heat_flag) dq = model->dq; // apply forces & torques add3(f[i], forces, f[i]); diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 59ad15c02d..7a774132f0 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -265,10 +265,10 @@ void FixWallGranRegion::post_force(int /*vflag*/) model->prep_contact(); model->calculate_forces(); - if (heat_flag) dq = model->calculate_heat(); forces = model->forces; torquesi = model->torquesi; + if (heat_flag) dq = model->dq; // apply forces & torques add3(f[i], forces, f[i]); diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index c4d7bc1490..52e4a84ded 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -254,11 +254,11 @@ void PairGranular::compute(int eflag, int vflag) } models[itype][jtype]->calculate_forces(); - if (heat_flag) dq = models[itype][jtype]->calculate_heat(); forces = models[itype][jtype]->forces; torquesi = models[itype][jtype]->torquesi; torquesj = models[itype][jtype]->torquesj; + if (heat_flag) dq = models[itype][jtype]->dq; // apply forces & torques scale3(factor_lj, forces); @@ -450,9 +450,8 @@ void PairGranular::init_style() if (model.size_history != 0) use_history = 1; for (i = 0; i < NSUBMODELS; i++) - if (model.sub_models[i]) - if (model.sub_models[i]->size_history > size_max[i]) - size_max[i] = model.sub_models[i]->size_history; + if (model.sub_models[i]->size_history > size_max[i]) + size_max[i] = model.sub_models[i]->size_history; if (model.nondefault_history_transfer) nondefault_history_transfer = 1; } @@ -463,10 +462,8 @@ void PairGranular::init_style() for (auto &model : vec_models) { int next_index = 0; for (i = 0; i < NSUBMODELS; i++) { - if (model.sub_models[i]) { - model.sub_models[i]->history_index = next_index; - next_index += size_max[i]; - } + model.sub_models[i]->history_index = next_index; + next_index += size_max[i]; } } @@ -561,27 +558,20 @@ double PairGranular::init_one(int i, int j) double cutoff = 0.0; if (setflag[i][j] == 0) { - if ((models[i][i]->normal_model->name != models[j][j]->normal_model->name) || - (models[i][i]->damping_model->name != models[j][j]->damping_model->name) || - (models[i][i]->tangential_model->name != models[j][j]->tangential_model->name) || - (models[i][i]->rolling_model->name != models[j][j]->rolling_model->name) || - (models[i][i]->twisting_model->name != models[j][j]->twisting_model->name)) { - error->all(FLERR,"Granular pair style functional forms are different, " - "cannot mix coefficients for types {} and {}. \n" - "This combination must be set explicitly via a " - "pair_coeff command",i,j); - } vec_models.push_back(ContactModel(lmp)); models[i][j] = models[j][i] = & vec_models.back(); - vec_models.back().init_model(models[i][i]->normal_model->name, NORMAL); - vec_models.back().init_model(models[i][i]->tangential_model->name, TANGENTIAL); - vec_models.back().init_model(models[i][i]->damping_model->name, DAMPING); - vec_models.back().init_model(models[i][i]->rolling_model->name, ROLLING); - vec_models.back().init_model(models[i][i]->twisting_model->name, TWISTING); - vec_models.back().init_model(models[i][i]->heat_model->name, HEAT); - vec_models.back().mix_coeffs(models[i][i], models[j][j]); + int error_code = vec_models.back().mix_coeffs(models[i][i], models[j][j]); + if (error_code != -1) + error->all(FLERR,"Granular pair style functional forms are different, " + "cannot mix coefficients for types {} and {} \n" + "with submodels {} and {}. \n" + "This combination must be set explicitly via a " + "pair_coeff command",i,j, + models[i][i]->sub_models[error_code]->name, + models[j][j]->sub_models[error_code]->name); + vec_models.back().init(); // Calculates cumulative properties of sub models for (int k = 0; k < NSUBMODELS; k++) diff --git a/src/contact.h b/src/contact.h index 535ec4461e..cd680b220a 100644 --- a/src/contact.h +++ b/src/contact.h @@ -55,12 +55,11 @@ class ContactModel : protected Pointers { void reset_contact(); void prep_contact(); void calculate_forces(); - double calculate_heat(); double pulloff_distance(double, double); void init_model(std::string, ModelType); int init_classic_model(char **, int, int); - void mix_coeffs(ContactModel*, ContactModel*); + int mix_coeffs(ContactModel*, ContactModel*); void write_restart(FILE *); void read_restart(FILE *); @@ -84,7 +83,7 @@ class ContactModel : protected Pointers { double *history; // Contact properties/output - double forces[3], torquesi[3], torquesj[3]; + double forces[3], torquesi[3], torquesj[3], dq; double radi, radj, rwall, meff, dt, Ti, Tj, area; double Fntot, magtortwist; @@ -98,7 +97,7 @@ class ContactModel : protected Pointers { bool touch; protected: - + int rolling_defined, twisting_defined, heat_defined; int prep_flag, check_flag; }; From 038f4a52105aa93bbd835310d65be697812109f8 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 14 Sep 2022 21:40:00 -0600 Subject: [PATCH 022/112] Adding variable temperature to fix gran/wall, misc fixes/updates --- src/GRANULAR/contact.cpp | 62 ++++++++-------------- src/GRANULAR/contact.h | 12 ++--- src/GRANULAR/contact_normal_models.cpp | 2 +- src/GRANULAR/contact_sub_models.cpp | 12 +++-- src/GRANULAR/contact_tangential_models.cpp | 2 +- src/GRANULAR/contact_twisting_models.cpp | 16 ++++-- src/GRANULAR/contact_twisting_models.h | 3 ++ src/GRANULAR/fix_wall_gran.cpp | 29 +++++++--- src/GRANULAR/fix_wall_gran.h | 3 ++ src/GRANULAR/fix_wall_gran_region.cpp | 5 +- src/GRANULAR/pair_granular.cpp | 33 ++++++------ 11 files changed, 98 insertions(+), 81 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index a1a35afe47..f72245def3 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -10,12 +10,16 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- +------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- This class contains a series of tools for DEM contacts Multiple models can be defined and used to calculate forces and torques based on contact geometry -*/ + + Contributing authors: + Dan Bolintineanu (SNL), Joel Clemmer (SNL) +----------------------------------------------------------------------- */ #include "contact.h" #include "contact_sub_models.h" @@ -42,7 +46,7 @@ ContactModel::ContactModel(LAMMPS *lmp) : Pointers(lmp) beyond_contact = 0; nondefault_history_transfer = 0; - wall_type = NONE; + contact_type = PAIR; reset_contact(); @@ -175,17 +179,19 @@ int ContactModel::init_classic_model(char **arg, int iarg, int narg) if (strcmp(arg[iarg],"hooke") == 0) { init_model("hooke", NORMAL); init_model("linear_nohistory", TANGENTIAL); + init_model("mass_velocity", DAMPING); } else if (strcmp(arg[iarg],"hooke/history") == 0) { init_model("hooke", NORMAL); init_model("linear_history", TANGENTIAL); + init_model("mass_velocity", DAMPING); } else if (strcmp(arg[iarg],"hertz/history") == 0) { // convert Kn and Kt from pressure units to force/distance^2 if Hertzian kn /= force->nktv2p; kt /= force->nktv2p; init_model("hertz", NORMAL); - init_model("mindlin", TANGENTIAL); // Dan is this right? + init_model("mindlin", TANGENTIAL); + init_model("viscoelastic", DAMPING); } else error->all(FLERR,"Invalid classic gran model"); - init_model("mass_velocity", DAMPING); // ensure additional models are undefined init_model("none", ROLLING); @@ -322,25 +328,15 @@ void ContactModel::read_restart(FILE *fp) /* ---------------------------------------------------------------------- */ -void ContactModel::reset_contact() -{ - prep_flag = check_flag = 0; - touch = false; -} - -/* ---------------------------------------------------------------------- */ - bool ContactModel::check_contact(double rtemp) { - check_flag = 1; - - if (wall_type == RWALL) { + if (contact_type == WALL) { // Used by fix_wall_gran.cpp rsq = lensq3(dx); radsum = radi; if (rtemp == 0) Reff = radi; else Reff = radi * rtemp/(radi + rtemp); - } else if (wall_type == RDUPLICATE) { + } else if (contact_type == WALLREGION) { // Used by fix_wall_gran_region.cpp rsq = rtemp * rtemp; radsum = radi + radi; @@ -361,11 +357,6 @@ bool ContactModel::check_contact(double rtemp) void ContactModel::prep_contact() { - prep_flag = 1; - // If it hasn't already been done, test if the contact exists - if (check_flag != 1) touch = check_contact(); - if (!touch) return; - double temp[3]; // Standard geometric quantities @@ -415,16 +406,8 @@ void ContactModel::prep_contact() void ContactModel::calculate_forces() { - // If it hasn't already been done, run prep calculations - if (prep_flag != 1) prep_contact(); - if (!touch) { - forces[0] = forces[1] = forces[2] = 0.0; - return; - } + // calculate forces/torques - //********************************************** - // calculate forces - //********************************************** forces[0] = 0.0; double Fne, Fdamp; area = normal_model->calculate_area(); @@ -442,35 +425,36 @@ void ContactModel::calculate_forces() if (rolling_defined) rolling_model->calculate_forces(); if (twisting_defined) twisting_model->calculate_forces(); - //********************************************** // sum contributions - //********************************************** scale3(Fntot, nx, forces); add3(forces, fs, forces); - //May need to rethink this for use with walls (and eventually tris).. + //May need to rethink eventually tris.. cross3(nx, fs, torquesi); - copy3(torquesi, torquesj); double dist_to_contact = radi - 0.5 * delta; scale3(dist_to_contact, torquesi); - dist_to_contact = radj - 0.5 * delta; - scale3(dist_to_contact, torquesj); + + if (contact_type == PAIR) { + copy3(torquesi, torquesj); + dist_to_contact = radj - 0.5 * delta; + scale3(dist_to_contact, torquesj); + } double torroll[3]; if (rolling_defined) { cross3(nx, fr, torroll); scale3(Reff, torroll); add3(torquesi, torroll, torquesi); - sub3(torquesj, torroll, torquesj); + if (contact_type == PAIR) sub3(torquesj, torroll, torquesj); } double tortwist[3]; if (twisting_defined) { scale3(magtortwist, nx, tortwist); add3(torquesi, tortwist, torquesi); - sub3(torquesj, tortwist, torquesj); + if (contact_type == PAIR) sub3(torquesj, tortwist, torquesj); } if (heat_defined) { diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index e0600146c3..4dc88132c0 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -31,10 +31,10 @@ enum ModelType { HEAT = 5 }; // Relative order matters since some derive coeffs from others -enum WallType { - NONE = 0, - RWALL = 1, - RDUPLICATE = 2 +enum ContactType { + PAIR = 0, + WALL = 1, + WALLREGION = 2 }; // forward declaration @@ -52,7 +52,6 @@ class ContactModel : protected Pointers { ~ContactModel(); void init(); bool check_contact(double = 0); - void reset_contact(); void prep_contact(); void calculate_forces(); double pulloff_distance(double, double); @@ -75,7 +74,7 @@ class ContactModel : protected Pointers { // Extra options int beyond_contact, limit_damping, history_update; - WallType wall_type; + ContactType contact_type; // History variables int size_history, nondefault_history_transfer; @@ -98,7 +97,6 @@ class ContactModel : protected Pointers { protected: int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels - int prep_flag, check_flag; }; } // namespace Contact diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index 2f59311edf..9e0a377eb9 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -261,7 +261,7 @@ void NormalJKR::coeffs_to_local() poiss = coeffs[2]; cohesion = coeffs[3]; k = FOURTHIRDS * Emod; - Escaled = mix_stiffnessE(Emod, Emod, poiss, poiss); //Dan, not sure why these coefficients are mixed in the regular pair style + Escaled = mix_stiffnessE(Emod, Emod, poiss, poiss); if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); } diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/GRANULAR/contact_sub_models.cpp index 6ec7bbd017..57834fc040 100644 --- a/src/GRANULAR/contact_sub_models.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -10,12 +10,16 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- +-------------------------------------------------------------------------*/ - This class contains a series of tools for DEM contacts - Multiple models can be defined and used to calculate forces +/* ---------------------------------------------------------------------- + This class contains a framework for normal, damping, tangential, + rolling, twisting, and heat models used to calculate forces and torques based on contact geometry -*/ + + Contributing authors: + Dan Bolintineanu (SNL), Joel Clemmer (SNL) +----------------------------------------------------------------------- */ #include "contact_sub_models.h" #include "error.h" diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 437615441c..46b370d15f 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -259,7 +259,7 @@ void TangentialMindlin::calculate_forces() temp_dbl = -damp; scale3(temp_dbl, contact->vtr, contact->fs); - if (! mindlin_force) { + if (!mindlin_force) { scale3(k_scaled, history, temp_array); add3(contact->fs, temp_array, contact->fs); } diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 8f3c5e571e..52b37d46e1 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -46,15 +46,25 @@ TwistingMarshall::TwistingMarshall(LAMMPS *lmp) : TwistingModel(lmp) /* ---------------------------------------------------------------------- */ + +void TwistingMarshall::init() +{ + k_tang = contact->tangential_model->k; + damp_tang = contact->tangential_model->damp; + mu_tang = contact->tangential_model->mu; +} + +/* ---------------------------------------------------------------------- */ + void TwistingMarshall::calculate_forces() { double signtwist, Mtcrit; // Calculate twist coefficients from tangential model & contact geometry // eq 32 of Marshall paper - double k = 0.5 * contact->tangential_model->k * contact->area * contact->area; - double damp = 0.5 * contact->tangential_model->damp * contact->area * contact->area; - double mu = TWOTHIRDS * contact->area * contact->tangential_model->mu; + double k = 0.5 * k_tang * contact->area * contact->area; + double damp = 0.5 * damp_tang * contact->area * contact->area; + double mu = TWOTHIRDS * mu_tang * contact->area; if (contact->history_update) { contact->history[history_index] += contact->magtwist * contact->dt; diff --git a/src/GRANULAR/contact_twisting_models.h b/src/GRANULAR/contact_twisting_models.h index 15124ca378..724448892a 100644 --- a/src/GRANULAR/contact_twisting_models.h +++ b/src/GRANULAR/contact_twisting_models.h @@ -42,6 +42,9 @@ class TwistingMarshall : public TwistingModel { public: TwistingMarshall(class LAMMPS *); void calculate_forces(); + void init(); + protected: + double k_tang, damp_tang, mu_tang; }; /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 95cd4fc6e0..aca9341a58 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -14,7 +14,7 @@ /* ---------------------------------------------------------------------- Contributing authors: Leo Silbert (SNL), Gary Grest (SNL), - Dan Bolintineanu (SNL) + Dan Bolintineanu (SNL), Joel Clemmer (SNL) ------------------------------------------------------------------------- */ #include "fix_wall_gran.h" @@ -69,7 +69,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // set interaction style // disable bonded/history option for now model = new ContactModel(lmp); - model->wall_type = RWALL; + model->contact_type = WALL; if (strcmp(arg[3],"granular") == 0) classic_flag = 0; else classic_flag = 1; @@ -171,6 +171,7 @@ 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"); @@ -211,7 +212,11 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"temperature") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); - Twall = utils::numeric(FLERR,arg[iarg+1],false,lmp); + if (utils::strmatch(arg[iarg+1], "^v_")) { + tstr = utils::strdup(arg[3] + 2); + } else { + Twall = utils::numeric(FLERR,arg[iarg+1],false,lmp); + } Twall_defined = 1; iarg += 2; } else wallstyle = NOSTYLE; @@ -318,10 +323,10 @@ FixWallGran::~FixWallGran() atom->delete_callback(id,Atom::GROW); atom->delete_callback(id,Atom::RESTART); - delete model; - // delete local storage + delete model; + delete [] tstr; delete [] idregion; memory->destroy(history_one); memory->destroy(mass_rigid); @@ -365,6 +370,13 @@ void FixWallGran::init() model->sub_models[i]->history_index = next_index; next_index += model->sub_models[i]->size_history; } + + if (tstr) { + tvar = input->variable->find(tstr); + if (tvar < 0) error->all(FLERR, "Variable {} for fix wall/gran does not exist", tstr); + if (! input->variable->equalstyle(tvar)) + error->all(FLERR, "Variable {} for fix wall/gran must be an equal style variable", tstr); + } } /* ---------------------------------------------------------------------- */ @@ -467,7 +479,11 @@ void FixWallGran::post_force(int /*vflag*/) model->radj = 0.0; model->vj = vwall; model->omegaj = w0; - if (heat_flag) model->Tj = Twall; + if (heat_flag) { + if (tstr) + Twall = input->variable->compute_equal(tvar); + model->Tj = Twall; + } for (int i = 0; i < nlocal; i++) { if (! mask[i] & groupbit) continue; @@ -509,7 +525,6 @@ void FixWallGran::post_force(int /*vflag*/) } // Reset model and copy initial geometric data - model->reset_contact(); model->dx[0] = dx; model->dx[1] = dy; model->dx[2] = dz; diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index b61ac24d54..fd4a0a0ec8 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -67,6 +67,9 @@ class FixWallGran : public Fix { int heat_flag; int limit_damping; + int tvar; + char *tstr; + // shear history for single contact per particle double **history_one; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 7a774132f0..155b872e10 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Dan Bolintineanu (SNL) + Contributing authors: Dan Bolintineanu (SNL), Joel Clemmer (SNL) ------------------------------------------------------------------------- */ #include "fix_wall_gran_region.h" @@ -50,7 +50,7 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : tmax = region->tmax; c2r = new int[tmax]; - model->wall_type = RDUPLICATE; + model->contact_type = WALLREGION; // re-allocate atom-based arrays with nshear // do not register with Atom class, since parent class did that @@ -226,7 +226,6 @@ void FixWallGranRegion::post_force(int /*vflag*/) // Reset model and copy initial geometric data // A bit unncessary since region->contact[ic] stores r - model->reset_contact(); model->dx[0] = region->contact[ic].delx; model->dx[1] = region->contact[ic].dely; model->dx[2] = region->contact[ic].delz; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 52e4a84ded..b376bb64c1 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -14,8 +14,8 @@ /* ---------------------------------------------------------------------- Contributing authors: - Dan Bolintineanu (SNL), Ishan Srivastava (SNL), Jeremy Lechman(SNL) - Leo Silbert (SNL), Gary Grest (SNL) + Dan Bolintineanu (SNL), Joel Clemmer (SNL), Ishan Srivastava (SNL), + Jeremy Lechman(SNL), Leo Silbert (SNL), Gary Grest (SNL) ----------------------------------------------------------------------- */ #include "pair_granular.h" @@ -196,7 +196,6 @@ void PairGranular::compute(int eflag, int vflag) jtype = type[j]; // Reset model and copy initial geometric data - models[itype][jtype]->reset_contact(); models[itype][jtype]->xi = x[i]; models[itype][jtype]->xj = x[j]; models[itype][jtype]->radi = radius[i]; @@ -346,31 +345,30 @@ void PairGranular::coeff(int narg, char **arg) // Construct new model within vector vec_models.emplace_back(lmp); - //Parse mandatory normal and tangential specifications + //Parse mandatory specification int iarg = 2; vec_models.back().init_model(std::string(arg[iarg++]), NORMAL); iarg = vec_models.back().normal_model->parse_coeffs(arg, iarg, narg); - if (strcmp(arg[iarg++], "tangential") == 0) { - if (iarg >= narg) - error->all(FLERR,"Illegal pair_coeff command, must specify " - "tangential model after tangential keyword"); - vec_models.back().init_model(std::string(arg[iarg++]), TANGENTIAL); - iarg = vec_models.back().tangential_model->parse_coeffs(arg, iarg, narg); - } else{ - error->all(FLERR, "Illegal pair_coeff command, 'tangential' keyword expected"); - } - //Parse optional arguments while (iarg < narg) { - if (strcmp(arg[iarg], "damping") == 0) { + + if (strcmp(arg[iarg++], "tangential") == 0) { + if (iarg >= narg) + error->all(FLERR,"Illegal pair_coeff command, must specify " + "tangential model after tangential keyword"); + vec_models.back().init_model(std::string(arg[iarg++]), TANGENTIAL); + iarg = vec_models.back().tangential_model->parse_coeffs(arg, iarg, narg); + + } else if (strcmp(arg[iarg], "damping") == 0) { iarg++; if (iarg >= narg) error->all(FLERR, "Illegal pair_coeff command, must specify " "damping model after damping keyword"); vec_models.back().init_model(std::string(arg[iarg++]), DAMPING); iarg = vec_models.back().damping_model->parse_coeffs(arg, iarg, narg); + } else if (strcmp(arg[iarg], "rolling") == 0) { iarg++; if (iarg >= narg) @@ -386,6 +384,7 @@ void PairGranular::coeff(int narg, char **arg) "twisting model after twisting keyword"); vec_models.back().init_model(std::string(arg[iarg++]), TWISTING); iarg = vec_models.back().twisting_model->parse_coeffs(arg, iarg, narg); + } else if (strcmp(arg[iarg], "heat") == 0) { iarg++; if (iarg >= narg) @@ -394,6 +393,7 @@ void PairGranular::coeff(int narg, char **arg) vec_models.back().init_model(std::string(arg[iarg++]), HEAT); iarg = vec_models.back().heat_model->parse_coeffs(arg, iarg, narg); heat_flag = 1; + } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters for cutoff keyword"); @@ -576,6 +576,8 @@ double PairGranular::init_one(int i, int j) for (int k = 0; k < NSUBMODELS; k++) vec_models.back().sub_models[k]->history_index = models[i][i]->sub_models[k]->history_index; + + cutoff_type[i][j] = cutoff_type[j][i] = MAX(cutoff_type[i][i], cutoff_type[j][j]); } // Check if heat model is defined for all type combinations @@ -732,7 +734,6 @@ double PairGranular::single(int i, int j, int itype, int jtype, double *radius = atom->radius; // Reset model and copy initial geometric data - models[itype][jtype]->reset_contact(); models[itype][jtype]->xi = x[i]; models[itype][jtype]->xj = x[j]; models[itype][jtype]->radi = radius[i]; From b61cfb7480bbc342468e01710ae7884bc9877d1b Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 16 Sep 2022 09:06:52 -0600 Subject: [PATCH 023/112] Fixing errors in gran/wall reff calculation and adding heat capabilities --- doc/src/fix_wall_gran.rst | 15 +++++++++++++-- doc/src/fix_wall_gran_region.rst | 14 +++++++++++++- src/GRANULAR/contact.cpp | 18 +++++++++++------- src/GRANULAR/contact.h | 4 ++-- src/GRANULAR/fix_wall_gran.cpp | 12 +++++++++++- src/GRANULAR/fix_wall_gran_region.cpp | 2 ++ src/GRANULAR/pair_granular.cpp | 7 +++++++ 7 files changed, 59 insertions(+), 13 deletions(-) diff --git a/doc/src/fix_wall_gran.rst b/doc/src/fix_wall_gran.rst index cf8b659df0..7fa047a07f 100644 --- a/doc/src/fix_wall_gran.rst +++ b/doc/src/fix_wall_gran.rst @@ -46,7 +46,7 @@ Syntax radius = cylinder radius (distance units) * zero or more keyword/value pairs may be appended to args -* keyword = *wiggle* or *shear* or *contacts* +* keyword = *wiggle* or *shear* or *contacts* or *temperature* .. parsed-literal:: @@ -59,6 +59,8 @@ Syntax vshear = magnitude of shear velocity (velocity units) *contacts* value = none generate contact information for each particle + *temperature* value = temperature + specify temperature of wall Examples @@ -71,7 +73,7 @@ Examples fix 2 all wall/gran hooke 100000.0 20000.0 50.0 30.0 0.5 1 zcylinder 15.0 wiggle z 3.0 2.0 fix 3 all wall/gran/region granular hooke 1000.0 50.0 tangential linear_nohistory 1.0 0.4 damping velocity region myBox fix 4 all wall/gran/region granular jkr 1e5 1500.0 0.3 10.0 tangential mindlin NULL 1.0 0.5 rolling sds 500.0 200.0 0.5 twisting marshall region myCone - fix 5 all wall/gran/region granular dmt 1e5 0.2 0.3 10.0 tangential mindlin NULL 1.0 0.5 rolling sds 500.0 200.0 0.5 twisting marshall damping tsuji region myCone + fix 5 all wall/gran/region granular dmt 1e5 0.2 0.3 10.0 tangential mindlin NULL 1.0 0.5 rolling sds 500.0 200.0 0.5 twisting marshall damping tsuji heat 10 region myCone temperature 1.0 fix 6 all wall/gran hooke 200000.0 NULL 50.0 NULL 0.5 0 xplane -10.0 10.0 contacts Description @@ -177,6 +179,15 @@ the clockwise direction for *vshear* > 0 or counter-clockwise for *vshear* < 0. In this case, *vshear* is the tangential velocity of the wall at whatever *radius* has been defined. +The *temperature* keyword is used to assign a temperature to the wall. +The following value can either be a numeric value or an equal-style +:doc:`variable `. If the value is a variable, it should be +specified as v_name, where name is the variable name. In this case, the +variable will be evaluated each timestep, and its value used to determine +the temperature. This option must be used in conjunction with a heat +conduction model defined in :doc:`pair_style granular ` +and a compatible atom style which stores temperature and a heat flux +as defined by the :doc:`atom_style sphere/temp ` command. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/doc/src/fix_wall_gran_region.rst b/doc/src/fix_wall_gran_region.rst index 5a4c983554..9dbf691ead 100644 --- a/doc/src/fix_wall_gran_region.rst +++ b/doc/src/fix_wall_gran_region.rst @@ -36,12 +36,14 @@ Syntax * wallstyle = region (see :doc:`fix wall/gran ` for options for other kinds of walls) * region-ID = region whose boundary will act as wall -* keyword = *contacts* +* keyword = *contacts* or *temperature* .. parsed-literal:: *contacts* value = none generate contact information for each particle + *temperature* value = temperature + specify temperature of wall Examples """""""" @@ -200,6 +202,16 @@ values for the 6 wall/particle coefficients than for particle/particle interactions. E.g. if you wish to model the wall as a different material. +The *temperature* keyword is used to assign a temperature to the wall. +The following value can either be a numeric value or an equal-style +:doc:`variable `. If the value is a variable, it should be +specified as v_name, where name is the variable name. In this case, the +variable will be evaluated each timestep, and its value used to determine +the temperature. This option must be used in conjunction with a heat +conduction model defined in :doc:`pair_style granular ` +and a compatible atom style which stores temperature and a heat flux +as defined by the :doc:`atom_style sphere/temp ` command. + Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index f72245def3..9e4542da08 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -328,20 +328,24 @@ void ContactModel::read_restart(FILE *fp) /* ---------------------------------------------------------------------- */ -bool ContactModel::check_contact(double rtemp) +bool ContactModel::check_contact() { if (contact_type == WALL) { // Used by fix_wall_gran.cpp + // radj = radius of wall + // dx already provided rsq = lensq3(dx); radsum = radi; - if (rtemp == 0) Reff = radi; - else Reff = radi * rtemp/(radi + rtemp); + if (radj == 0) Reff = radi; + else Reff = radi * radj / (radi + radj); } else if (contact_type == WALLREGION) { // Used by fix_wall_gran_region.cpp - rsq = rtemp * rtemp; - radsum = radi + radi; - if (rtemp == 0) Reff = radi; - else Reff = radi * rtemp/(radi + rtemp); + // radj = radius of wall + // dx and r already provided + rsq = r * r; + radsum = radi; + if (radj == 0) Reff = radi; + else Reff = radi * radj / (radi + radj); } else { sub3(xi, xj, dx); rsq = lensq3(dx); diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 4dc88132c0..54ecfeb757 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -51,7 +51,7 @@ class ContactModel : protected Pointers { ContactModel(class LAMMPS *); ~ContactModel(); void init(); - bool check_contact(double = 0); + bool check_contact(); void prep_contact(); void calculate_forces(); double pulloff_distance(double, double); @@ -84,7 +84,7 @@ class ContactModel : protected Pointers { // Contact properties/output double forces[3], torquesi[3], torquesj[3], dq; - double radi, radj, rwall, meff, dt, Ti, Tj, area; + double radi, radj, meff, dt, Ti, Tj, area; double Fntot, magtortwist; double *xi, *xj, *vi, *vj, *omegai, *omegaj; diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index aca9341a58..6672a67387 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -354,6 +354,15 @@ void FixWallGran::init() if (utils::strmatch(update->integrate_style,"^respa")) nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + // check for compatible heat conduction atom style + + if (heat_flag) { + if (!atom->temperature_flag) + error->all(FLERR,"Heat conduction in fix wall/gran requires atom style with temperature property"); + if (!atom->heatflux_flag) + error->all(FLERR,"Heat conduction in fix wall/gran requires atom style with heatflux property"); + } + // check for FixRigid so can extract rigid body masses fix_rigid = nullptr; @@ -529,9 +538,10 @@ void FixWallGran::post_force(int /*vflag*/) model->dx[1] = dy; model->dx[2] = dz; model->radi = radius[i]; + model->radj = rwall; if (model->beyond_contact) model->touch = history_one[i][0]; - touchflag = model->check_contact(rwall); + touchflag = model->check_contact(); if (!touchflag) { if (use_history) diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 155b872e10..4058a31614 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -230,6 +230,8 @@ void FixWallGranRegion::post_force(int /*vflag*/) model->dx[1] = region->contact[ic].dely; model->dx[2] = region->contact[ic].delz; model->radi = radius[i]; + model->radj = region->contact[ic].radius; + model->r = region->contact[ic].r; if (model->beyond_contact) model->touch = history_many[i][c2r[ic]][0]; touchflag = model->check_contact(region->contact[ic].r); diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index b376bb64c1..9e512c78c0 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -442,6 +442,13 @@ void PairGranular::init_style() if (comm->ghost_velocity == 0) error->all(FLERR,"Pair granular requires ghost atoms store velocity"); + if (heat_flag) { + if (!atom->temperature_flag) + error->all(FLERR,"Heat conduction in pair granular requires atom style with temperature property"); + if (!atom->heatflux_flag) + error->all(FLERR,"Heat conduction in pair granular requires atom style with heatflux property"); + } + // allocate history and initialize models int size_max[NSUBMODELS] = {0}; From 71db9f5e75d4bd21a195d9e3c006c2277d7c4617 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 16 Sep 2022 14:16:34 -0600 Subject: [PATCH 024/112] Fixing tangential damping coefficient --- src/GRANULAR/contact.cpp | 8 ++--- src/GRANULAR/contact_damping_models.cpp | 12 ++++--- src/GRANULAR/contact_damping_models.h | 2 +- src/GRANULAR/contact_normal_models.cpp | 7 ++-- src/GRANULAR/contact_normal_models.h | 14 ++++---- src/GRANULAR/contact_tangential_models.cpp | 37 ++++++++++------------ src/GRANULAR/contact_tangential_models.h | 1 - src/GRANULAR/contact_twisting_models.cpp | 2 +- 8 files changed, 39 insertions(+), 44 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 9e4542da08..cd2c323a59 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -202,7 +202,7 @@ int ContactModel::init_classic_model(char **arg, int iarg, int narg) normal_model->coeffs[0] = kn; normal_model->coeffs[1] = gamman; tangential_model->coeffs[0] = kt; - tangential_model->coeffs[1] = gammat; + tangential_model->coeffs[1] = gammat / gamman; tangential_model->coeffs[2] = xmu; normal_model->coeffs_to_local(); @@ -364,7 +364,7 @@ void ContactModel::prep_contact() double temp[3]; // Standard geometric quantities - r = sqrt(rsq); + if (contact_type != WALLREGION) r = sqrt(rsq); rinv = 1.0 / r; delta = radsum - r; dR = delta * Reff; @@ -420,11 +420,9 @@ void ContactModel::calculate_forces() Fdamp = damping_model->calculate_forces(); Fntot = Fne + Fdamp; - - normal_model->set_fncrit(); // Needed for tangential, rolling, twisting - if (limit_damping && Fntot < 0.0) Fntot = 0.0; + normal_model->set_fncrit(); // Needed for tangential, rolling, twisting tangential_model->calculate_forces(); if (rolling_defined) rolling_model->calculate_forces(); if (twisting_defined) twisting_model->calculate_forces(); diff --git a/src/GRANULAR/contact_damping_models.cpp b/src/GRANULAR/contact_damping_models.cpp index a003d181d9..07b6b88649 100644 --- a/src/GRANULAR/contact_damping_models.cpp +++ b/src/GRANULAR/contact_damping_models.cpp @@ -56,7 +56,8 @@ DampingVelocity::DampingVelocity(LAMMPS *lmp) : DampingModel(lmp) {} double DampingVelocity::calculate_forces() { - return -damp * contact->vnnr; + damp_prefactor = damp; + return -damp_prefactor * contact->vnnr; } /* ---------------------------------------------------------------------- @@ -69,7 +70,8 @@ DampingMassVelocity::DampingMassVelocity(LAMMPS *lmp) : DampingModel(lmp) {} double DampingMassVelocity::calculate_forces() { - return -damp * contact->meff * contact->vnnr; + damp_prefactor = damp * contact->meff; + return -damp_prefactor * contact->vnnr; } /* ---------------------------------------------------------------------- @@ -82,7 +84,8 @@ DampingViscoelastic::DampingViscoelastic(LAMMPS *lmp) : DampingModel(lmp) {} double DampingViscoelastic::calculate_forces() { - return -damp * contact->meff * contact->area * contact->vnnr; + damp_prefactor = damp * contact->meff * contact->area; + return -damp_prefactor * contact->vnnr; } /* ---------------------------------------------------------------------- @@ -105,5 +108,6 @@ void DampingTsuji::init() double DampingTsuji::calculate_forces() { - return -damp * sqrt(contact->meff * contact->normal_model->knfac) * contact->vnnr; + damp_prefactor = damp * sqrt(contact->meff * contact->normal_model->knfac); + return -damp_prefactor * contact->vnnr; } diff --git a/src/GRANULAR/contact_damping_models.h b/src/GRANULAR/contact_damping_models.h index 611393da9f..222e901160 100644 --- a/src/GRANULAR/contact_damping_models.h +++ b/src/GRANULAR/contact_damping_models.h @@ -28,7 +28,7 @@ class DampingModel : public SubModel { virtual void mix_coeffs(double*, double*) {}; virtual void init(); virtual double calculate_forces() = 0; - double damp; + double damp, damp_prefactor; }; /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index 9e0a377eb9..ed14eb93b4 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -45,12 +45,11 @@ bool NormalModel::touch() return touchflag; } -/* ---------------------------------------------------------------------- - called outside of compute(), do not assume geometry defined in contact -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ double NormalModel::pulloff_distance(double radi, double radj) { + //called outside of compute(), do not assume correct geometry defined in contact return radi + radj; } @@ -112,7 +111,7 @@ double NormalHooke::calculate_forces() void NormalHooke::set_knfac() { - knfac = k * contact->area; + knfac = k; } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index 6d47dd3736..66217e32a2 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -28,8 +28,8 @@ class NormalModel : public SubModel { virtual bool touch(); virtual double pulloff_distance(double, double); virtual double calculate_area(); - virtual double calculate_forces() = 0; virtual void set_knfac() = 0; + virtual double calculate_forces() = 0; virtual void set_fncrit(); double damp; // Vestigial argument needed by damping double Emod, poiss; @@ -42,8 +42,8 @@ class NormalModel : public SubModel { class NormalNone : public NormalModel { public: NormalNone(class LAMMPS *); - double calculate_forces(); void set_knfac() {}; + double calculate_forces(); }; /* ---------------------------------------------------------------------- */ @@ -52,8 +52,8 @@ class NormalHooke : public NormalModel { public: NormalHooke(class LAMMPS *); void coeffs_to_local() override; - double calculate_forces(); void set_knfac(); + double calculate_forces(); protected: double k; }; @@ -64,8 +64,8 @@ class NormalHertz : public NormalModel { public: NormalHertz(class LAMMPS *); void coeffs_to_local() override; - double calculate_forces(); void set_knfac(); + double calculate_forces(); protected: double k; }; @@ -86,8 +86,8 @@ class NormalDMT : public NormalModel { NormalDMT(class LAMMPS *); void coeffs_to_local() override; void mix_coeffs(double*, double*) override; - double calculate_forces(); void set_knfac(); + double calculate_forces(); void set_fncrit() override; protected: double k, cohesion; @@ -104,8 +104,8 @@ class NormalJKR : public NormalModel { bool touch() override; double pulloff_distance(double, double) override; double calculate_area() override; - double calculate_forces() override; - void set_knfac() override; + void set_knfac(); + double calculate_forces(); void set_fncrit() override; protected: double k, cohesion; diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 46b370d15f..0349927731 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -30,13 +30,6 @@ using namespace MathExtra; TangentialModel::TangentialModel(LAMMPS *lmp) : SubModel(lmp) {} -/* ---------------------------------------------------------------------- */ - -void TangentialModel::init() -{ - damp = xt * contact->damping_model->damp; -} - /* ---------------------------------------------------------------------- No model ------------------------------------------------------------------------- */ @@ -69,16 +62,17 @@ void TangentialLinearNoHistory::coeffs_to_local() void TangentialLinearNoHistory::calculate_forces() { - double Fscrit, fsmag, Ft; - // classic pair gran/hooke (no history) - Fscrit = mu * contact->normal_model->Fncrit; - fsmag = damp * contact->vrel; + damp = xt * contact->damping_model->damp_prefactor; + + double Fscrit = mu * contact->normal_model->Fncrit; + double fsmag = damp * contact->vrel; + + double Ft; if (contact->vrel != 0.0) Ft = MIN(Fscrit, fsmag) / contact->vrel; else Ft = 0.0; - Ft = -Ft; - scale3(Ft, contact->vtr, contact->fs); + scale3(-Ft, contact->vtr, contact->fs); } /* ---------------------------------------------------------------------- @@ -107,11 +101,12 @@ void TangentialLinearHistory::coeffs_to_local() void TangentialLinearHistory::calculate_forces() { - double Fscrit, magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; int frame_update = 0; - Fscrit = contact->normal_model->Fncrit * mu; + damp = xt * contact->damping_model->damp_prefactor; + double Fscrit = contact->normal_model->Fncrit * mu; double *history = & contact->history[history_index]; // rotate and update displacements / force. @@ -140,8 +135,7 @@ void TangentialLinearHistory::calculate_forces() } // tangential forces = history + tangential velocity damping - temp_dbl = -damp; - scale3(temp_dbl, contact->vtr, contact->fs); + scale3(-damp, contact->vtr, contact->fs); // rescale frictional displacements and forces if needed magfs = len3(contact->fs); @@ -205,12 +199,14 @@ void TangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) void TangentialMindlin::calculate_forces() { - double Fscrit, k_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; + double k_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; double temp_array[3]; int frame_update = 0; + damp = xt * contact->damping_model->damp_prefactor; + double *history = & contact->history[history_index]; - Fscrit = contact->normal_model->Fncrit * mu; + double Fscrit = contact->normal_model->Fncrit * mu; k_scaled = k * contact->area; if (mindlin_rescale) { @@ -256,8 +252,7 @@ void TangentialMindlin::calculate_forces() } // tangential forces = history + tangential velocity damping - temp_dbl = -damp; - scale3(temp_dbl, contact->vtr, contact->fs); + scale3(-damp, contact->vtr, contact->fs); if (!mindlin_force) { scale3(k_scaled, history, temp_array); diff --git a/src/GRANULAR/contact_tangential_models.h b/src/GRANULAR/contact_tangential_models.h index 812eb62e55..9c0092dabc 100644 --- a/src/GRANULAR/contact_tangential_models.h +++ b/src/GRANULAR/contact_tangential_models.h @@ -24,7 +24,6 @@ class TangentialModel : public SubModel { TangentialModel(class LAMMPS *); virtual ~TangentialModel() {}; virtual void coeffs_to_local() {}; - virtual void init(); virtual void calculate_forces() = 0; int rescale_flag; double k, damp, mu; // Used by Marshall twisting model diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 52b37d46e1..14b998d32f 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -50,7 +50,7 @@ TwistingMarshall::TwistingMarshall(LAMMPS *lmp) : TwistingModel(lmp) void TwistingMarshall::init() { k_tang = contact->tangential_model->k; - damp_tang = contact->tangential_model->damp; + damp_tang = contact->tangential_model->damp_tangential; mu_tang = contact->tangential_model->mu; } From c9ba3f415715e6a6cfa3dca780c24737d77b6f87 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 16 Sep 2022 16:56:20 -0600 Subject: [PATCH 025/112] Adding classic tangential models --- src/GRANULAR/contact.cpp | 22 ++-- src/GRANULAR/contact.h | 1 + src/GRANULAR/contact_tangential_models.cpp | 116 ++++++++++++++++++--- src/GRANULAR/contact_tangential_models.h | 17 +++ src/GRANULAR/contact_twisting_models.cpp | 2 +- src/GRANULAR/fix_wall_gran.cpp | 2 + src/GRANULAR/fix_wall_gran_region.cpp | 2 +- src/contact.h | 19 ++-- 8 files changed, 145 insertions(+), 36 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index cd2c323a59..b7c4e7c0e4 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -45,11 +45,9 @@ ContactModel::ContactModel(LAMMPS *lmp) : Pointers(lmp) limit_damping = 0; beyond_contact = 0; nondefault_history_transfer = 0; - + classic_model = 0; contact_type = PAIR; - reset_contact(); - normal_model = nullptr; damping_model = nullptr; tangential_model = nullptr; @@ -95,6 +93,7 @@ void ContactModel::init_model(std::string model_name, ModelType model_type) if (model_name == "none") tangential_model = new TangentialNone(lmp); else if (model_name == "linear_nohistory") tangential_model = new TangentialLinearNoHistory(lmp); else if (model_name == "linear_history") tangential_model = new TangentialLinearHistory(lmp); + else if (model_name == "linear_history_classic") tangential_model = new TangentialLinearHistoryClassic(lmp); else if (model_name == "mindlin") tangential_model = new TangentialMindlin(lmp); else if (model_name == "mindlin/force") tangential_model = new TangentialMindlinForce(lmp); else if (model_name == "mindlin_rescale") tangential_model = new TangentialMindlinRescale(lmp); @@ -157,6 +156,8 @@ int ContactModel::init_classic_model(char **arg, int iarg, int narg) { double kn, kt, gamman, gammat, xmu; + classic_model = 1; + if (iarg + 6 >= narg) error->all(FLERR,"Insufficient arguments provided for classic gran model command"); @@ -182,7 +183,7 @@ int ContactModel::init_classic_model(char **arg, int iarg, int narg) init_model("mass_velocity", DAMPING); } else if (strcmp(arg[iarg],"hooke/history") == 0) { init_model("hooke", NORMAL); - init_model("linear_history", TANGENTIAL); + init_model("linear_history_classic", TANGENTIAL); init_model("mass_velocity", DAMPING); } else if (strcmp(arg[iarg],"hertz/history") == 0) { // convert Kn and Kt from pressure units to force/distance^2 if Hertzian @@ -435,13 +436,18 @@ void ContactModel::calculate_forces() //May need to rethink eventually tris.. cross3(nx, fs, torquesi); - double dist_to_contact = radi - 0.5 * delta; - scale3(dist_to_contact, torquesi); + double dist_to_contact; + if (!classic_model) { + dist_to_contact = radi - 0.5 * delta; + scale3(dist_to_contact, torquesi); + } if (contact_type == PAIR) { copy3(torquesi, torquesj); - dist_to_contact = radj - 0.5 * delta; - scale3(dist_to_contact, torquesj); + if (!classic_model) { + dist_to_contact = radj - 0.5 * delta; + scale3(dist_to_contact, torquesj); + } } double torroll[3]; diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 54ecfeb757..632555a21f 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -97,6 +97,7 @@ class ContactModel : protected Pointers { protected: int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels + int classic_model; }; } // namespace Contact diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 0349927731..1ac8c1c44c 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -73,6 +73,7 @@ void TangentialLinearNoHistory::calculate_forces() else Ft = 0.0; scale3(-Ft, contact->vtr, contact->fs); + } /* ---------------------------------------------------------------------- @@ -101,7 +102,8 @@ void TangentialLinearHistory::coeffs_to_local() void TangentialLinearHistory::calculate_forces() { - double magfs, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + // Note: this is the same as the base Mindlin calculation except k isn't scaled by area + double magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; int frame_update = 0; damp = xt * contact->damping_model->damp_prefactor; @@ -117,8 +119,11 @@ void TangentialLinearHistory::calculate_forces() if (frame_update) { shrmag = len3(history); + // projection - scale3(rsht, contact->nx, history); + scale3(rsht, contact->nx, temp_array); + sub3(history, temp_array, history); + // also rescale to preserve magnitude prjmag = len3(history); if (prjmag > 0) temp_dbl = shrmag / prjmag; @@ -126,27 +131,30 @@ void TangentialLinearHistory::calculate_forces() scale3(temp_dbl, history); } - // update history - // tangential force + // update history, tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = k * contact->dt; - scale3(temp_dbl, contact->vtr, temp_array); - sub3(history, temp_array, history); + scale3(contact->dt, contact->vtr, temp_array); + add3(history, temp_array, history); } // tangential forces = history + tangential velocity damping - scale3(-damp, contact->vtr, contact->fs); + scale3(-k, history, contact->fs); + scale3(damp, contact->vtr, temp_array); + sub3(contact->fs, temp_array, contact->fs); // rescale frictional displacements and forces if needed magfs = len3(contact->fs); if (magfs > Fscrit) { shrmag = len3(history); if (shrmag != 0.0) { - temp_dbl = Fscrit / magfs; + magfs_inv = 1.0 / magfs; + temp_dbl = Fscrit * magfs_inv; scale3(temp_dbl, contact->fs, history); scale3(damp, contact->vtr, temp_array); add3(history, temp_array, history); - temp_dbl = Fscrit / magfs; + temp_dbl = -1.0 / k; + scale3(temp_dbl, history); + temp_dbl = Fscrit * magfs_inv; scale3(temp_dbl, contact->fs); } else { zero3(contact->fs); @@ -154,6 +162,80 @@ void TangentialLinearHistory::calculate_forces() } } +/* ---------------------------------------------------------------------- + Linear model with history from pair gran/hooke/history +------------------------------------------------------------------------- */ + +TangentialLinearHistoryClassic::TangentialLinearHistoryClassic(LAMMPS *lmp) : TangentialLinearHistory(lmp) +{ + scale_area = 0; +} + +/* ---------------------------------------------------------------------- */ + +void TangentialLinearHistoryClassic::calculate_forces() +{ + double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; + double temp_array[3]; + int frame_update = 0; + + k_scaled = k; + if (scale_area) k_scaled *= contact->area; + + damp = xt * contact->damping_model->damp_prefactor; + + double Fscrit = contact->normal_model->Fncrit * mu; + double *history = & contact->history[history_index]; + + // update history + if (contact->history_update) { + scale3(contact->dt, contact->vtr, temp_array); + add3(history, temp_array, history); + } + + shrmag = len3(history); + + // rotate shear displacements + if (contact->history_update) { + rsht = dot3(history, contact->nx); + scale3(rsht, contact->nx, temp_array); + sub3(history, temp_array, history); + } + + // tangential forces = history + tangential velocity damping + scale3(-k_scaled, history, contact->fs); + scale3(damp, contact->vtr, temp_array); + sub3(contact->fs, temp_array, contact->fs); + + // rescale frictional displacements and forces if needed + magfs = len3(contact->fs); + if (magfs > Fscrit) { + if (shrmag != 0.0) { + magfs_inv = 1.0 / magfs; + temp_dbl = Fscrit * magfs_inv; + scale3(temp_dbl, contact->fs, history); + scale3(damp, contact->vtr, temp_array); + add3(history, temp_array, history); + temp_dbl = -1.0 / k_scaled; + if (scale_area) temp_dbl /= contact->area; + scale3(temp_dbl, history); + temp_dbl = Fscrit * magfs_inv; + scale3(temp_dbl, contact->fs); + } else { + zero3(contact->fs); + } + } +} + +/* ---------------------------------------------------------------------- + Mindlin from pair gran/hertz/history +------------------------------------------------------------------------- */ + +TangentialMindlinClassic::TangentialMindlinClassic(LAMMPS *lmp) : TangentialLinearHistoryClassic(lmp) +{ + scale_area = 1; +} + /* ---------------------------------------------------------------------- Mindlin model ------------------------------------------------------------------------- */ @@ -199,7 +281,7 @@ void TangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) void TangentialMindlin::calculate_forces() { - double k_scaled, magfs, rsht, shrmag, prjmag, temp_dbl; + double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; double temp_array[3]; int frame_update = 0; @@ -229,7 +311,8 @@ void TangentialMindlin::calculate_forces() if (frame_update) { shrmag = len3(history); // projection - scale3(rsht, contact->nx, history); + scale3(rsht, contact->nx, temp_array); + sub3(history, temp_array, history); // also rescale to preserve magnitude prjmag = len3(history); if (prjmag > 0) temp_dbl = shrmag / prjmag; @@ -256,7 +339,7 @@ void TangentialMindlin::calculate_forces() if (!mindlin_force) { scale3(k_scaled, history, temp_array); - add3(contact->fs, temp_array, contact->fs); + sub3(contact->fs, temp_array, contact->fs); } // rescale frictional displacements and forces if needed @@ -264,15 +347,16 @@ void TangentialMindlin::calculate_forces() if (magfs > Fscrit) { shrmag = len3(history); if (shrmag != 0.0) { - temp_dbl = Fscrit / magfs; + magfs_inv = 1.0 / magfs; + temp_dbl = Fscrit * magfs_inv; scale3(temp_dbl, contact->fs, history); scale3(damp, contact->vtr, temp_array); add3(history, temp_array, history); - if (! mindlin_force) { + if (!mindlin_force) { temp_dbl = -1.0 / k_scaled; scale3(temp_dbl, history); } - temp_dbl = Fscrit / magfs; + temp_dbl = Fscrit * magfs_inv; scale3(temp_dbl, contact->fs); } else { zero3(contact->fs); diff --git a/src/GRANULAR/contact_tangential_models.h b/src/GRANULAR/contact_tangential_models.h index 9c0092dabc..a54d03c495 100644 --- a/src/GRANULAR/contact_tangential_models.h +++ b/src/GRANULAR/contact_tangential_models.h @@ -24,6 +24,7 @@ class TangentialModel : public SubModel { TangentialModel(class LAMMPS *); virtual ~TangentialModel() {}; virtual void coeffs_to_local() {}; + virtual void init() {}; virtual void calculate_forces() = 0; int rescale_flag; double k, damp, mu; // Used by Marshall twisting model @@ -59,6 +60,22 @@ class TangentialLinearHistory : public TangentialModel { /* ---------------------------------------------------------------------- */ +class TangentialLinearHistoryClassic : public TangentialLinearHistory { + public: + TangentialLinearHistoryClassic(class LAMMPS *); + void calculate_forces(); + int scale_area; +}; + +/* ---------------------------------------------------------------------- */ + +class TangentialMindlinClassic : public TangentialLinearHistoryClassic { + public: + TangentialMindlinClassic(class LAMMPS *); +}; + +/* ---------------------------------------------------------------------- */ + class TangentialMindlin : public TangentialModel { public: TangentialMindlin(class LAMMPS *); diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 14b998d32f..52b37d46e1 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -50,7 +50,7 @@ TwistingMarshall::TwistingMarshall(LAMMPS *lmp) : TwistingModel(lmp) void TwistingMarshall::init() { k_tang = contact->tangential_model->k; - damp_tang = contact->tangential_model->damp_tangential; + damp_tang = contact->tangential_model->damp; mu_tang = contact->tangential_model->mu; } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 6672a67387..05e060e61c 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -30,6 +30,7 @@ #include "contact_heat_models.h" #include "domain.h" #include "error.h" +#include "input.h" #include "math_const.h" #include "math_extra.h" #include "memory.h" @@ -37,6 +38,7 @@ #include "neighbor.h" #include "respa.h" #include "update.h" +#include "variable.h" #include diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 4058a31614..2e57e335f7 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -234,7 +234,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) model->r = region->contact[ic].r; if (model->beyond_contact) model->touch = history_many[i][c2r[ic]][0]; - touchflag = model->check_contact(region->contact[ic].r); + touchflag = model->check_contact(); if (!touchflag) { if (use_history) diff --git a/src/contact.h b/src/contact.h index cd680b220a..632555a21f 100644 --- a/src/contact.h +++ b/src/contact.h @@ -31,10 +31,10 @@ enum ModelType { HEAT = 5 }; // Relative order matters since some derive coeffs from others -enum WallType { - NONE = 0, - RWALL = 1, - RDUPLICATE = 2 +enum ContactType { + PAIR = 0, + WALL = 1, + WALLREGION = 2 }; // forward declaration @@ -51,8 +51,7 @@ class ContactModel : protected Pointers { ContactModel(class LAMMPS *); ~ContactModel(); void init(); - bool check_contact(double = 0); - void reset_contact(); + bool check_contact(); void prep_contact(); void calculate_forces(); double pulloff_distance(double, double); @@ -75,7 +74,7 @@ class ContactModel : protected Pointers { // Extra options int beyond_contact, limit_damping, history_update; - WallType wall_type; + ContactType contact_type; // History variables int size_history, nondefault_history_transfer; @@ -85,7 +84,7 @@ class ContactModel : protected Pointers { // Contact properties/output double forces[3], torquesi[3], torquesj[3], dq; - double radi, radj, rwall, meff, dt, Ti, Tj, area; + double radi, radj, meff, dt, Ti, Tj, area; double Fntot, magtortwist; double *xi, *xj, *vi, *vj, *omegai, *omegaj; @@ -97,8 +96,8 @@ class ContactModel : protected Pointers { bool touch; protected: - int rolling_defined, twisting_defined, heat_defined; - int prep_flag, check_flag; + int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels + int classic_model; }; } // namespace Contact From 7f16225ffbc8842239f34da434d75c9902602dbe Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 16 Sep 2022 16:57:32 -0600 Subject: [PATCH 026/112] Removing leftover file --- src/contact.h | 106 -------------------------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 src/contact.h diff --git a/src/contact.h b/src/contact.h deleted file mode 100644 index 632555a21f..0000000000 --- a/src/contact.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef LMP_CONTACT_H -#define LMP_CONTACT_H - -#include "pointers.h" // IWYU pragma: export - -namespace LAMMPS_NS { -namespace Contact { - -#define EPSILON 1e-10 -#define NSUBMODELS 6 - -enum ModelType { - NORMAL = 0, - DAMPING = 1, - TANGENTIAL = 2, - ROLLING = 3, - TWISTING = 4, - HEAT = 5 -}; // Relative order matters since some derive coeffs from others - -enum ContactType { - PAIR = 0, - WALL = 1, - WALLREGION = 2 -}; - -// forward declaration -class NormalModel; -class DampingModel; -class TangentialModel; -class RollingModel; -class TwistingModel; -class HeatModel; -class SubModel; - -class ContactModel : protected Pointers { - public: - ContactModel(class LAMMPS *); - ~ContactModel(); - void init(); - bool check_contact(); - void prep_contact(); - void calculate_forces(); - double pulloff_distance(double, double); - - void init_model(std::string, ModelType); - int init_classic_model(char **, int, int); - int mix_coeffs(ContactModel*, ContactModel*); - - void write_restart(FILE *); - void read_restart(FILE *); - - // Sub models - NormalModel *normal_model; - DampingModel *damping_model; - TangentialModel *tangential_model; - RollingModel *rolling_model; - TwistingModel *twisting_model; - HeatModel *heat_model; - SubModel *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors - - // Extra options - int beyond_contact, limit_damping, history_update; - ContactType contact_type; - - // History variables - int size_history, nondefault_history_transfer; - double *transfer_history_factor; - double *history; - - // Contact properties/output - double forces[3], torquesi[3], torquesj[3], dq; - - double radi, radj, meff, dt, Ti, Tj, area; - double Fntot, magtortwist; - - double *xi, *xj, *vi, *vj, *omegai, *omegaj; - double fs[3], fr[3], ft[3]; - - double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; - double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; - double magtwist; - bool touch; - - protected: - int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels - int classic_model; -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif From 13be68aecef770daf4559a6a69b62696bda7fd8a Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 19 Sep 2022 22:14:59 -0600 Subject: [PATCH 027/112] Fixing argument errors and adding note on datafiles to doc --- doc/src/pair_gran.rst | 5 +++++ doc/src/pair_granular.rst | 5 +++++ src/GRANULAR/contact_tangential_models.cpp | 4 ++-- src/GRANULAR/contact_twisting_models.cpp | 3 +-- src/GRANULAR/contact_twisting_models.h | 2 +- src/GRANULAR/fix_wall_gran.cpp | 3 +-- src/GRANULAR/pair_granular.cpp | 3 ++- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/src/pair_gran.rst b/doc/src/pair_gran.rst index f83fd6d6ab..3249bae866 100644 --- a/doc/src/pair_gran.rst +++ b/doc/src/pair_gran.rst @@ -279,6 +279,11 @@ statistically similar results. This is because the forces they compute depend on atom velocities. See the :doc:`read_restart ` command for more details. +Accumulated values for individual contacts are saved to to restart +files but are not saved to data files. Therefore, forces may +differ significantly when a system is reloaded using A +:doc:`read_data ` command. + Related commands """""""""""""""" diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index 675c8fe4ff..5856db307b 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -780,6 +780,11 @@ statistically similar results. This is because the forces they compute depend on atom velocities. See the :doc:`read_restart ` command for more details. +Accumulated values for individual contacts are saved to to restart +files but are not saved to data files. Therefore, forces may +differ significantly when a system is reloaded using A +:doc:`read_data ` command. + Related commands """""""""""""""" diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index 1ac8c1c44c..d9bb3320b8 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -168,7 +168,7 @@ void TangentialLinearHistory::calculate_forces() TangentialLinearHistoryClassic::TangentialLinearHistoryClassic(LAMMPS *lmp) : TangentialLinearHistory(lmp) { - scale_area = 0; + scale_area = 0; // Sets gran/hooke/history behavior } /* ---------------------------------------------------------------------- */ @@ -233,7 +233,7 @@ void TangentialLinearHistoryClassic::calculate_forces() TangentialMindlinClassic::TangentialMindlinClassic(LAMMPS *lmp) : TangentialLinearHistoryClassic(lmp) { - scale_area = 1; + scale_area = 1; // Sets gran/hertz/history behavior } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index 52b37d46e1..aca4f958e7 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -50,7 +50,6 @@ TwistingMarshall::TwistingMarshall(LAMMPS *lmp) : TwistingModel(lmp) void TwistingMarshall::init() { k_tang = contact->tangential_model->k; - damp_tang = contact->tangential_model->damp; mu_tang = contact->tangential_model->mu; } @@ -63,7 +62,7 @@ void TwistingMarshall::calculate_forces() // Calculate twist coefficients from tangential model & contact geometry // eq 32 of Marshall paper double k = 0.5 * k_tang * contact->area * contact->area; - double damp = 0.5 * damp_tang * contact->area * contact->area; + double damp = 0.5 * contact->tangential_model->damp * contact->area * contact->area; double mu = TWOTHIRDS * mu_tang * contact->area; if (contact->history_update) { diff --git a/src/GRANULAR/contact_twisting_models.h b/src/GRANULAR/contact_twisting_models.h index 724448892a..1fa5aa2c6a 100644 --- a/src/GRANULAR/contact_twisting_models.h +++ b/src/GRANULAR/contact_twisting_models.h @@ -44,7 +44,7 @@ class TwistingMarshall : public TwistingModel { void calculate_forces(); void init(); protected: - double k_tang, damp_tang, mu_tang; + double k_tang, mu_tang; }; /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 05e060e61c..0d6fc587fb 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -83,8 +83,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : int iarg; if (classic_flag) { - iarg = 4; - iarg = model->init_classic_model(arg, iarg, narg); + iarg = model->init_classic_model(arg, 3, narg); if (iarg < narg) { if (strcmp(arg[iarg],"limit_damping") == 0) { diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 9e512c78c0..1e423b92b3 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -354,7 +354,8 @@ void PairGranular::coeff(int narg, char **arg) while (iarg < narg) { - if (strcmp(arg[iarg++], "tangential") == 0) { + if (strcmp(arg[iarg], "tangential") == 0) { + iarg++; if (iarg >= narg) error->all(FLERR,"Illegal pair_coeff command, must specify " "tangential model after tangential keyword"); From dc1b7d4cfece31fd2379737b32a4bbe2db234624 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 21 Sep 2022 16:31:18 -0600 Subject: [PATCH 028/112] Fixing mathematical errors in force/torque calculations --- src/GRANULAR/contact.cpp | 18 +++--- src/GRANULAR/contact.h | 1 + src/GRANULAR/contact_normal_models.cpp | 45 +++++++++----- src/GRANULAR/contact_normal_models.h | 2 +- src/GRANULAR/contact_rolling_models.cpp | 43 +++++++------- src/GRANULAR/contact_sub_models.cpp | 20 +++++++ src/GRANULAR/contact_sub_models.h | 2 + src/GRANULAR/contact_tangential_models.cpp | 69 +++++++++++----------- src/GRANULAR/contact_twisting_models.cpp | 4 +- src/GRANULAR/fix_wall_gran.cpp | 1 + src/GRANULAR/fix_wall_gran_region.cpp | 2 +- src/GRANULAR/pair_granular.cpp | 21 ++++--- 12 files changed, 133 insertions(+), 95 deletions(-) diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index b7c4e7c0e4..5290f13629 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -414,7 +414,7 @@ void ContactModel::calculate_forces() // calculate forces/torques forces[0] = 0.0; - double Fne, Fdamp; + double Fne, Fdamp, dist_to_contact; area = normal_model->calculate_area(); normal_model->set_knfac(); Fne = normal_model->calculate_forces(); @@ -435,18 +435,18 @@ void ContactModel::calculate_forces() //May need to rethink eventually tris.. cross3(nx, fs, torquesi); + scale3(-1, torquesi); + if (contact_type == PAIR) copy3(torquesi, torquesj); - double dist_to_contact; if (!classic_model) { - dist_to_contact = radi - 0.5 * delta; - scale3(dist_to_contact, torquesi); - } - - if (contact_type == PAIR) { - copy3(torquesi, torquesj); - if (!classic_model) { + if (contact_type == PAIR) { + dist_to_contact = radi - 0.5 * delta; + scale3(dist_to_contact, torquesi); dist_to_contact = radj - 0.5 * delta; scale3(dist_to_contact, torquesj); + } else { + dist_to_contact = radi; + scale3(dist_to_contact, torquesi); } } diff --git a/src/GRANULAR/contact.h b/src/GRANULAR/contact.h index 632555a21f..d1a13c5eb1 100644 --- a/src/GRANULAR/contact.h +++ b/src/GRANULAR/contact.h @@ -87,6 +87,7 @@ class ContactModel : protected Pointers { double radi, radj, meff, dt, Ti, Tj, area; double Fntot, magtortwist; + int i, j; double *xi, *xj, *vi, *vj, *omegai, *omegaj; double fs[3], fr[3], ft[3]; diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/GRANULAR/contact_normal_models.cpp index ed14eb93b4..b377d5d027 100644 --- a/src/GRANULAR/contact_normal_models.cpp +++ b/src/GRANULAR/contact_normal_models.cpp @@ -165,7 +165,11 @@ void NormalHertzMaterial::coeffs_to_local() Emod = coeffs[0]; damp = coeffs[1]; poiss = coeffs[2]; - k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + if (contact->contact_type == PAIR) { + k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + } if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz material normal model"); } @@ -199,7 +203,11 @@ void NormalDMT::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + if (contact->contact_type == PAIR) { + k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + } if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); } @@ -259,8 +267,14 @@ void NormalJKR::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - k = FOURTHIRDS * Emod; - Escaled = mix_stiffnessE(Emod, Emod, poiss, poiss); + + if (contact->contact_type == PAIR) { + Emix = mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + Emix = mix_stiffnessE_wall(Emod, poiss); + } + + k = FOURTHIRDS * Emix; if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); } @@ -285,8 +299,8 @@ bool NormalJKR::touch() if (contact->touch) { R2 = contact->Reff * contact->Reff; - area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * R2 / (4.0 * Escaled)); - delta_pulloff = area_at_pulloff * area_at_pulloff / contact->Reff - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff /Escaled); + area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * R2 / (4.0 * Emix)); + delta_pulloff = area_at_pulloff * area_at_pulloff / contact->Reff - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Emix); dist_pulloff = contact->radsum - delta_pulloff; touchflag = contact->rsq < (dist_pulloff * dist_pulloff); } else { @@ -307,8 +321,8 @@ double NormalJKR::pulloff_distance(double radi, double radj) Reff_tmp = radi * radj / (radi + radj); // May not be defined if (Reff_tmp <= 0) return 0; - area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4.0 * Escaled)); - return area_at_pulloff * area_at_pulloff / Reff_tmp - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Escaled); + area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4.0 * Emix)); + return area_at_pulloff * area_at_pulloff / Reff_tmp - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Emix); } /* ---------------------------------------------------------------------- */ @@ -320,18 +334,18 @@ double NormalJKR::calculate_area() R2 = contact->Reff * contact->Reff; dR2 = contact->dR * contact->dR; - t0 = cohesion * cohesion * R2 * R2 * Escaled; + t0 = cohesion * cohesion * R2 * R2 * Emix; t1 = PI27SQ * t0; - t2 = 8.0 * contact->dR * dR2 * Escaled * Escaled * Escaled; - t3 = 4.0 * dR2 * Escaled; + t2 = 8.0 * contact->dR * dR2 * Emix * Emix * Emix; + t3 = 4.0 * dR2 * Emix; // in case sqrt(0) < 0 due to precision issues sqrt1 = MAX(0, t0 * (t1 + 2.0 * t2)); t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Escaled; + t5 = t3 / t4 + t4 / Emix; sqrt2 = MAX(0, 2.0 * contact->dR + t5); t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4.0 * contact->dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Escaled * t6)); + sqrt3 = MAX(0, 4.0 * contact->dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Emix * t6)); return INVROOT6 * (t6 + sqrt(sqrt3)); } @@ -341,9 +355,8 @@ double NormalJKR::calculate_area() double NormalJKR::calculate_forces() { double a2; - a2 = contact->area * contact->area; - Fne = Escaled * contact->area * a2 / contact->Reff - MY_2PI * a2 * sqrt(4.0 * cohesion * Escaled / (MY_PI * contact->area)); + Fne = knfac * a2 / contact->Reff - MY_2PI * a2 * sqrt(4.0 * cohesion * Emix / (MY_PI * contact->area)); F_pulloff = 3.0 * MY_PI * cohesion * contact->Reff; return Fne; @@ -353,7 +366,7 @@ double NormalJKR::calculate_forces() void NormalJKR::set_knfac() { - knfac = Escaled * contact->area; + knfac = k * contact->area; } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_normal_models.h b/src/GRANULAR/contact_normal_models.h index 66217e32a2..8159a4c620 100644 --- a/src/GRANULAR/contact_normal_models.h +++ b/src/GRANULAR/contact_normal_models.h @@ -109,7 +109,7 @@ class NormalJKR : public NormalModel { void set_fncrit() override; protected: double k, cohesion; - double Escaled, F_pulloff; + double Emix, F_pulloff; }; } // namespace Contact diff --git a/src/GRANULAR/contact_rolling_models.cpp b/src/GRANULAR/contact_rolling_models.cpp index 956be65353..3ee80c0e48 100644 --- a/src/GRANULAR/contact_rolling_models.cpp +++ b/src/GRANULAR/contact_rolling_models.cpp @@ -50,8 +50,8 @@ RollingSDS::RollingSDS(LAMMPS *lmp) : RollingModel(lmp) void RollingSDS::coeffs_to_local() { k = coeffs[0]; - mu = coeffs[1]; - gamma = coeffs[2]; + gamma = coeffs[1]; + mu = coeffs[2]; if (k < 0.0 || mu < 0.0 || gamma < 0.0) error->all(FLERR, "Illegal SDS rolling model"); @@ -62,7 +62,8 @@ void RollingSDS::coeffs_to_local() void RollingSDS::calculate_forces() { int rhist0, rhist1, rhist2, frameupdate; - double Frcrit, rolldotn, rollmag, prjmag, magfr, hist_temp[3], temp_dbl, temp_array[3]; + double Frcrit, rolldotn, rollmag, prjmag, magfr, hist_temp[3], scalefac, temp_array[3]; + double k_inv, magfr_inv; rhist0 = history_index; rhist1 = rhist0 + 1; @@ -76,49 +77,45 @@ void RollingSDS::calculate_forces() hist_temp[2] = contact->history[rhist2]; rolldotn = dot3(hist_temp, contact->nx); - frameupdate = fabs(rolldotn) * k > EPSILON * Frcrit; + frameupdate = (fabs(rolldotn) * k) > (EPSILON * Frcrit); if (frameupdate) { // rotate into tangential plane rollmag = len3(hist_temp); // projection - temp_dbl = -rolldotn; - scale3(temp_dbl, contact->nx, temp_array); + scale3(rolldotn, contact->nx, temp_array); sub3(hist_temp, temp_array, hist_temp); // also rescale to preserve magnitude prjmag = len3(hist_temp); - if (prjmag > 0) temp_dbl = rollmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, hist_temp); + if (prjmag > 0) scalefac = rollmag / prjmag; + else scalefac = 0; + scale3(scalefac, hist_temp); } scale3(contact->dt, contact->vrl, temp_array); add3(hist_temp, temp_array, hist_temp); } - scaleadd3(k, hist_temp, gamma, contact->vrl, contact->fr); - negate3(contact->fr); + scaleadd3(-k, hist_temp, -gamma, contact->vrl, contact->fr); // rescale frictional displacements and forces if needed - magfr = len3(contact->fr); if (magfr > Frcrit) { rollmag = len3(hist_temp); if (rollmag != 0.0) { - temp_dbl = -Frcrit / (magfr * k); - scale3(temp_dbl, contact->fr, temp_array); + k_inv = 1.0 / k; + magfr_inv = 1.0 / magfr; + scale3(-Frcrit * k_inv * magfr_inv, contact->fr, hist_temp); + scale3(-gamma * k_inv, contact->vrl, temp_array); add3(hist_temp, temp_array, hist_temp); - temp_dbl = -gamma/k; - scale3(temp_dbl, contact->vrl, temp_array); - add3(hist_temp, temp_array, hist_temp); - - temp_dbl = Frcrit / magfr; - scale3(temp_dbl, contact->fr); + scale3(Frcrit * magfr_inv, contact->fr); } else { zero3(contact->fr); } } - contact->history[rhist0] = hist_temp[0]; - contact->history[rhist1] = hist_temp[1]; - contact->history[rhist2] = hist_temp[2]; + if (contact->history_update) { + contact->history[rhist0] = hist_temp[0]; + contact->history[rhist1] = hist_temp[1]; + contact->history[rhist2] = hist_temp[2]; + } } diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/GRANULAR/contact_sub_models.cpp index 57834fc040..1c9fe6b4f5 100644 --- a/src/GRANULAR/contact_sub_models.cpp +++ b/src/GRANULAR/contact_sub_models.cpp @@ -110,6 +110,26 @@ double SubModel::mix_stiffnessG(double E1, double E2, return 1 / (factor1 + factor2); } +/* ---------------------------------------------------------------------- + mixing of Young's modulus (E) for walls +------------------------------------------------------------------------- */ + +double SubModel::mix_stiffnessE_wall(double E, double pois) +{ + double factor = 2 * (1 - pois); + return E / factor; +} + +/* ---------------------------------------------------------------------- + mixing of shear modulus (G) for walls +------------------------------------------------------------------------ */ + +double SubModel::mix_stiffnessG_wall(double E, double pois) +{ + double factor = 32.0 * (2 - pois) * (1 + pois); + return E / factor; +} + /* ---------------------------------------------------------------------- mixing of everything else ------------------------------------------------------------------------- */ diff --git a/src/GRANULAR/contact_sub_models.h b/src/GRANULAR/contact_sub_models.h index 730790616d..0f577bf08e 100644 --- a/src/GRANULAR/contact_sub_models.h +++ b/src/GRANULAR/contact_sub_models.h @@ -51,6 +51,8 @@ class SubModel : protected Pointers { double mix_stiffnessE(double, double, double, double); double mix_stiffnessG(double, double, double, double); + double mix_stiffnessE_wall(double, double); + double mix_stiffnessG_wall(double, double); double mix_geom(double, double); }; diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/GRANULAR/contact_tangential_models.cpp index d9bb3320b8..ca95d1d00b 100644 --- a/src/GRANULAR/contact_tangential_models.cpp +++ b/src/GRANULAR/contact_tangential_models.cpp @@ -73,7 +73,6 @@ void TangentialLinearNoHistory::calculate_forces() else Ft = 0.0; scale3(-Ft, contact->vtr, contact->fs); - } /* ---------------------------------------------------------------------- @@ -115,7 +114,7 @@ void TangentialLinearHistory::calculate_forces() // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 if (contact->history_update) { rsht = dot3(history, contact->nx); - frame_update = fabs(rsht) * k > EPSILON * Fscrit; + frame_update = (fabs(rsht) * k) > (EPSILON * Fscrit); if (frame_update) { shrmag = len3(history); @@ -137,6 +136,7 @@ void TangentialLinearHistory::calculate_forces() add3(history, temp_array, history); } + // tangential forces = history + tangential velocity damping scale3(-k, history, contact->fs); scale3(damp, contact->vtr, temp_array); @@ -148,14 +148,11 @@ void TangentialLinearHistory::calculate_forces() shrmag = len3(history); if (shrmag != 0.0) { magfs_inv = 1.0 / magfs; - temp_dbl = Fscrit * magfs_inv; - scale3(temp_dbl, contact->fs, history); + scale3(Fscrit * magfs_inv, contact->fs, history); scale3(damp, contact->vtr, temp_array); add3(history, temp_array, history); - temp_dbl = -1.0 / k; - scale3(temp_dbl, history); - temp_dbl = Fscrit * magfs_inv; - scale3(temp_dbl, contact->fs); + scale3(-1.0 / k, history); + scale3(Fscrit * magfs_inv, contact->fs); } else { zero3(contact->fs); } @@ -212,15 +209,13 @@ void TangentialLinearHistoryClassic::calculate_forces() if (magfs > Fscrit) { if (shrmag != 0.0) { magfs_inv = 1.0 / magfs; - temp_dbl = Fscrit * magfs_inv; - scale3(temp_dbl, contact->fs, history); + scale3(Fscrit * magfs_inv, contact->fs, history); scale3(damp, contact->vtr, temp_array); add3(history, temp_array, history); temp_dbl = -1.0 / k_scaled; if (scale_area) temp_dbl /= contact->area; scale3(temp_dbl, history); - temp_dbl = Fscrit * magfs_inv; - scale3(temp_dbl, contact->fs); + scale3(Fscrit * magfs_inv, contact->fs); } else { zero3(contact->fs); } @@ -259,7 +254,15 @@ void TangentialMindlin::coeffs_to_local() if (k == -1) { if (!contact->normal_model->material_properties) error->all(FLERR, "Must either specify tangential stiffness or material properties for normal model for the Mindlin tangential style"); - k = 8.0 * mix_stiffnessG(contact->normal_model->Emod, contact->normal_model->Emod, contact->normal_model->poiss, contact->normal_model->poiss); + + double Emod = contact->normal_model->Emod; + double poiss = contact->normal_model->poiss; + + if (contact->contact_type == PAIR) { + k = 8.0 * mix_stiffnessG(Emod, Emod, poiss, poiss); + } else { + k = 8.0 * mix_stiffnessG_wall(Emod, poiss); + } } if (k < 0.0 || xt < 0.0 || mu < 0.0) @@ -291,22 +294,21 @@ void TangentialMindlin::calculate_forces() double Fscrit = contact->normal_model->Fncrit * mu; k_scaled = k * contact->area; - if (mindlin_rescale) { - // on unloading, rescale the shear displacements/force - if (contact->area < history[3]) { - temp_dbl = contact->area / history[3]; - scale3(temp_dbl, history); - } - } + + // on unloading, rescale the shear displacements/force + if (mindlin_rescale) + if (contact->area < history[3]) + scale3(contact->area / history[3], history); // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 if (contact->history_update) { rsht = dot3(history, contact->nx); - if (mindlin_force) - frame_update = fabs(rsht) > EPSILON * Fscrit; - else - frame_update = fabs(rsht) * k_scaled > EPSILON * Fscrit; + if (mindlin_force) { + frame_update = fabs(rsht) > (EPSILON * Fscrit); + } else { + frame_update = (fabs(rsht) * k_scaled) > (EPSILON * Fscrit); + } if (frame_update) { shrmag = len3(history); @@ -324,8 +326,7 @@ void TangentialMindlin::calculate_forces() if (mindlin_force) { // tangential force // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - temp_dbl = -k_scaled * contact->dt; - scale3(temp_dbl, contact->vtr, temp_array); + scale3(-k_scaled * contact->dt, contact->vtr, temp_array); } else { scale3(contact->dt, contact->vtr, temp_array); } @@ -340,6 +341,8 @@ void TangentialMindlin::calculate_forces() if (!mindlin_force) { scale3(k_scaled, history, temp_array); sub3(contact->fs, temp_array, contact->fs); + } else { + add3(contact->fs, history, contact->fs); } // rescale frictional displacements and forces if needed @@ -348,16 +351,14 @@ void TangentialMindlin::calculate_forces() shrmag = len3(history); if (shrmag != 0.0) { magfs_inv = 1.0 / magfs; - temp_dbl = Fscrit * magfs_inv; - scale3(temp_dbl, contact->fs, history); + scale3(Fscrit * magfs_inv, contact->fs, history); scale3(damp, contact->vtr, temp_array); add3(history, temp_array, history); - if (!mindlin_force) { - temp_dbl = -1.0 / k_scaled; - scale3(temp_dbl, history); - } - temp_dbl = Fscrit * magfs_inv; - scale3(temp_dbl, contact->fs); + + if (!mindlin_force) + scale3(-1.0 / k_scaled, history); + + scale3(Fscrit * magfs_inv, contact->fs); } else { zero3(contact->fs); } diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/GRANULAR/contact_twisting_models.cpp index aca4f958e7..94a88161f3 100644 --- a/src/GRANULAR/contact_twisting_models.cpp +++ b/src/GRANULAR/contact_twisting_models.cpp @@ -95,8 +95,8 @@ TwistingSDS::TwistingSDS(LAMMPS *lmp) : TwistingModel(lmp) void TwistingSDS::coeffs_to_local() { k = coeffs[0]; - mu = coeffs[1]; - damp = coeffs[2]; + damp = coeffs[1]; + mu = coeffs[2]; if (k < 0.0 || mu < 0.0 || damp < 0.0) error->all(FLERR, "Illegal SDS twisting model"); diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 0d6fc587fb..c0221b0d34 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -535,6 +535,7 @@ void FixWallGran::post_force(int /*vflag*/) } // Reset model and copy initial geometric data + model->i = i; model->dx[0] = dx; model->dx[1] = dy; model->dx[2] = dz; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 2e57e335f7..93bca1485b 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -225,7 +225,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) for (int ic = 0; ic < nc; ic++) { // Reset model and copy initial geometric data - // A bit unncessary since region->contact[ic] stores r + model->i = i; model->dx[0] = region->contact[ic].delx; model->dx[1] = region->contact[ic].dely; model->dx[2] = region->contact[ic].delz; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 1e423b92b3..dddd1acdcb 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -196,6 +196,8 @@ void PairGranular::compute(int eflag, int vflag) jtype = type[j]; // Reset model and copy initial geometric data + models[itype][jtype]->i = i; + models[itype][jtype]->j = j; models[itype][jtype]->xi = x[i]; models[itype][jtype]->xj = x[j]; models[itype][jtype]->radi = radius[i]; @@ -214,9 +216,9 @@ void PairGranular::compute(int eflag, int vflag) continue; } - if (use_history) { + // if any history is needed + if (use_history || models[itype][jtype]->beyond_contact) { touch[jj] = 1; - history = &allhistory[size_history*jj]; } // meff = effective mass of pair of particles @@ -239,19 +241,17 @@ void PairGranular::compute(int eflag, int vflag) models[itype][jtype]->omegai = omega[i]; models[itype][jtype]->omegaj = omega[j]; models[itype][jtype]->history_update = history_update; - if (use_history) models[itype][jtype]->history = history; + if (use_history) { + history = &allhistory[size_history*jj]; + models[itype][jtype]->history = history; + } +; if (heat_flag) { models[itype][jtype]->Ti = temperature[i]; models[itype][jtype]->Tj = temperature[j]; } models[itype][jtype]->prep_contact(); - // if any history is needed - if (use_history) { - touch[jj] = 1; - history = &allhistory[size_history*jj]; - } - models[itype][jtype]->calculate_forces(); forces = models[itype][jtype]->forces; @@ -455,6 +455,7 @@ void PairGranular::init_style() for (auto &model : vec_models) { model.init(); + if (model.beyond_contact) beyond_contact = 1; if (model.size_history != 0) use_history = 1; for (i = 0; i < NSUBMODELS; i++) @@ -742,6 +743,8 @@ double PairGranular::single(int i, int j, int itype, int jtype, double *radius = atom->radius; // Reset model and copy initial geometric data + models[itype][jtype]->i = i; + models[itype][jtype]->j = j; models[itype][jtype]->xi = x[i]; models[itype][jtype]->xj = x[j]; models[itype][jtype]->radi = radius[i]; From cca7a5313267304a07ff8eef1bfc8793c0ebb784 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Sun, 25 Sep 2022 14:53:53 -0600 Subject: [PATCH 029/112] Patching heat implementation and adding example --- doc/src/dump.rst | 4 +- doc/src/fix_temp_integrate.rst | 2 +- doc/src/fix_wall_gran.rst | 2 +- doc/src/fix_wall_gran_region.rst | 2 +- doc/src/pair_granular.rst | 4 +- doc/src/set.rst | 2 +- examples/granular/in.pour.heat | 83 +++++++++++++++++++++++++++ src/GRANULAR/atom_vec_sphere_temp.cpp | 10 ++-- src/GRANULAR/atom_vec_sphere_temp.h | 2 +- src/GRANULAR/contact.cpp | 18 +++--- src/GRANULAR/contact_heat_models.cpp | 2 +- src/GRANULAR/fix_temp_integrate.cpp | 10 ++-- src/GRANULAR/fix_wall_gran.cpp | 43 ++++++-------- src/GRANULAR/fix_wall_gran_region.cpp | 21 ++++--- src/GRANULAR/pair_granular.cpp | 12 ++-- src/atom.cpp | 14 ++--- src/atom.h | 4 +- src/dump_custom.cpp | 22 +++---- src/dump_custom.h | 2 +- 19 files changed, 169 insertions(+), 90 deletions(-) create mode 100644 examples/granular/in.pour.heat diff --git a/doc/src/dump.rst b/doc/src/dump.rst index 4406c827bf..c324c945ee 100644 --- a/doc/src/dump.rst +++ b/doc/src/dump.rst @@ -81,7 +81,7 @@ Syntax q, mux, muy, muz, mu, radius, diameter, omegax, omegay, omegaz, angmomx, angmomy, angmomz, tqx, tqy, tqz, - heatflux, temperature, + heatflow, temperature, c_ID, c_ID[I], f_ID, f_ID[I], v_name, i_name, d_name, i2_name[I], d2_name[I] @@ -108,7 +108,7 @@ Syntax omegax,omegay,omegaz = angular velocity of spherical particle angmomx,angmomy,angmomz = angular momentum of aspherical particle tqx,tqy,tqz = torque on finite-size particles - heatflux = flux of heat into particle + heatflow = flow of heat into particle temperature = temperature of particle c_ID = per-atom vector calculated by a compute with ID c_ID[I] = Ith column of per-atom array calculated by a compute with ID, I can include wildcard (see below) diff --git a/doc/src/fix_temp_integrate.rst b/doc/src/fix_temp_integrate.rst index bd06b45c6e..03fae7a872 100644 --- a/doc/src/fix_temp_integrate.rst +++ b/doc/src/fix_temp_integrate.rst @@ -62,7 +62,7 @@ not invoked during :doc:`energy minimization `. Restrictions """""""""""" -This fix requires that atoms store temperature and a heat flux +This fix requires that atoms store temperature and heat flow as defined by the :doc:`atom_style sphere/temp ` command. Related commands diff --git a/doc/src/fix_wall_gran.rst b/doc/src/fix_wall_gran.rst index 7fa047a07f..0cc4798dd2 100644 --- a/doc/src/fix_wall_gran.rst +++ b/doc/src/fix_wall_gran.rst @@ -186,7 +186,7 @@ specified as v_name, where name is the variable name. In this case, the variable will be evaluated each timestep, and its value used to determine the temperature. This option must be used in conjunction with a heat conduction model defined in :doc:`pair_style granular ` -and a compatible atom style which stores temperature and a heat flux +and a compatible atom style which stores temperature and a heat flow as defined by the :doc:`atom_style sphere/temp ` command. Restart, fix_modify, output, run start/stop, minimize info diff --git a/doc/src/fix_wall_gran_region.rst b/doc/src/fix_wall_gran_region.rst index 9dbf691ead..73a2e9c973 100644 --- a/doc/src/fix_wall_gran_region.rst +++ b/doc/src/fix_wall_gran_region.rst @@ -209,7 +209,7 @@ specified as v_name, where name is the variable name. In this case, the variable will be evaluated each timestep, and its value used to determine the temperature. This option must be used in conjunction with a heat conduction model defined in :doc:`pair_style granular ` -and a compatible atom style which stores temperature and a heat flux +and a compatible atom style which stores temperature and a heat flow as defined by the :doc:`atom_style sphere/temp ` command. Restart, fix_modify, output, run start/stop, minimize info diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index 5856db307b..bc365814cd 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -634,7 +634,7 @@ attractive force. This keyword cannot be used with the JKR or DMT models. ---------- -The optional *heat* keyword enables heat conduction . The options currently +The optional *heat* keyword enables heat conduction. The options currently supported are: 1. *none* @@ -643,7 +643,7 @@ supported are: If the *heat* keyword is not specified, the model defaults to *none*. For *heat* *area*, the heat -:math:`Q` conducted across an interface is given by +:math:`Q` conducted between two particles is given by .. math:: diff --git a/doc/src/set.rst b/doc/src/set.rst index d11d3fc229..fdce40b72d 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -95,7 +95,7 @@ Syntax value can be an atom-style variable (see below) *density/disc* value = particle density for a 2d disc or ellipse (mass/distance\^2 units) value can be an atom-style variable (see below) - *temperature* value = particle temperature for a finite-size particle particle (temperature units)s + *temperature* value = temperature for finite-size particles (temperature units) value can be an atom-style variable (see below) *volume* value = particle volume for Peridynamic particle (distance\^3 units) value can be an atom-style variable (see below) diff --git a/examples/granular/in.pour.heat b/examples/granular/in.pour.heat new file mode 100644 index 0000000000..495a80454a --- /dev/null +++ b/examples/granular/in.pour.heat @@ -0,0 +1,83 @@ +# pour one types of particles into cylinder and oscillate +# temperature of the bottom plate + +variable name string heat_plate + +atom_style sphere/temp +units lj + +############################################### +# Geometry-related parameters +############################################### + +variable boxx equal 10 +variable boxy equal 10 +variable boxz equal 50 + +variable drum_rad equal ${boxx}*0.5 +variable drum_height equal 30 + +variable xc equal 0.5*${boxx} +variable yc equal 0.5*${boxx} +variable zc equal 0.5*${boxz} + +############################################### +# Particle-related parameters +############################################### +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dhi equal 2.0*${rhi} + +variable cyl_rad_inner equal ${drum_rad}-1.1*${rhi} + +variable dens equal 1.0 + +variable skin equal 0.4*${rhi} + +############# +processors * * 1 +region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} +create_box 2 boxreg +change_box all boundary p p f + +pair_style granular +pair_coeff * * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 + +region curved_wall cylinder z ${xc} ${yc} ${drum_rad} 0 ${drum_height} side in +region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in + +region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} + +fix 0 all balance 100 1.0 shift xy 5 1.1 +fix 1 all nve/sphere +fix 2 all temp/integrate constant 1.0 +fix grav all gravity 10 vector 0 0 -1 +fix ins1 all pour 1000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} + +comm_modify vel yes + +neighbor ${skin} bin +neigh_modify delay 0 every 1 check yes + +variable oscillate equal 1.0*sin(step*0.0001) + +fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate + +thermo_style custom step atoms ke pxx pyy pzz +thermo_modify lost warn +thermo 100 + +timestep 0.001 + +#dump 1 all custom 1000 ${name}.dump id type radius mass x y z temperature heatflow + +#For removal later +compute 1 all property/atom radius +variable zmax atom z+c_1>0.5*${drum_height} +group delgroup dynamic all var zmax every 10000 + +run 100000 + diff --git a/src/GRANULAR/atom_vec_sphere_temp.cpp b/src/GRANULAR/atom_vec_sphere_temp.cpp index a92486a1b5..bc3dcb7a2d 100644 --- a/src/GRANULAR/atom_vec_sphere_temp.cpp +++ b/src/GRANULAR/atom_vec_sphere_temp.cpp @@ -33,17 +33,17 @@ AtomVecSphereTemp::AtomVecSphereTemp(LAMMPS *lmp) : AtomVec(lmp) atom->sphere_flag = 1; atom->radius_flag = atom->rmass_flag = atom->omega_flag = atom->torque_flag = 1; - atom->temperature_flag = atom->heatflux_flag = 1; + atom->temperature_flag = atom->heatflow_flag = 1; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = {"radius", "rmass", "omega", "torque", "temperature", "heatflux"}; + fields_grow = {"radius", "rmass", "omega", "torque", "temperature", "heatflow"}; fields_copy = {"radius", "rmass", "omega", "temperature"}; fields_comm_vel = {"omega", "temperature"}; - fields_reverse = {"torque", "heatflux"}; + fields_reverse = {"torque", "heatflow"}; fields_border = {"radius", "rmass", "temperature"}; fields_border_vel = {"radius", "rmass", "omega", "temperature"}; fields_exchange = {"radius", "rmass", "omega", "temperature"}; @@ -107,7 +107,7 @@ void AtomVecSphereTemp::grow_pointers() rmass = atom->rmass; omega = atom->omega; temperature = atom->temperature; - heatflux = atom->heatflux; + heatflow = atom->heatflow; } /* ---------------------------------------------------------------------- @@ -117,7 +117,7 @@ void AtomVecSphereTemp::grow_pointers() void AtomVecSphereTemp::force_clear(int n, size_t nbytes) { - memset(&heatflux[n], 0, nbytes); + memset(&heatflow[n], 0, nbytes); } /* ---------------------------------------------------------------------- diff --git a/src/GRANULAR/atom_vec_sphere_temp.h b/src/GRANULAR/atom_vec_sphere_temp.h index 70e047a8cc..c93b0ee4dd 100644 --- a/src/GRANULAR/atom_vec_sphere_temp.h +++ b/src/GRANULAR/atom_vec_sphere_temp.h @@ -40,7 +40,7 @@ class AtomVecSphereTemp : public AtomVec { private: double *radius, *rmass; double **omega; - double *temperature, *heatflux; + double *temperature, *heatflow; int radvary; double radius_one, rmass_one; diff --git a/src/GRANULAR/contact.cpp b/src/GRANULAR/contact.cpp index 5290f13629..ae294d7db9 100644 --- a/src/GRANULAR/contact.cpp +++ b/src/GRANULAR/contact.cpp @@ -438,16 +438,14 @@ void ContactModel::calculate_forces() scale3(-1, torquesi); if (contact_type == PAIR) copy3(torquesi, torquesj); - if (!classic_model) { - if (contact_type == PAIR) { - dist_to_contact = radi - 0.5 * delta; - scale3(dist_to_contact, torquesi); - dist_to_contact = radj - 0.5 * delta; - scale3(dist_to_contact, torquesj); - } else { - dist_to_contact = radi; - scale3(dist_to_contact, torquesi); - } + if (!classic_model && contact_type == PAIR) { + dist_to_contact = radi - 0.5 * delta; + scale3(dist_to_contact, torquesi); + dist_to_contact = radj - 0.5 * delta; + scale3(dist_to_contact, torquesj); + } else { + dist_to_contact = radi; + scale3(dist_to_contact, torquesi); } double torroll[3]; diff --git a/src/GRANULAR/contact_heat_models.cpp b/src/GRANULAR/contact_heat_models.cpp index 00ac0c0785..1804ece9df 100644 --- a/src/GRANULAR/contact_heat_models.cpp +++ b/src/GRANULAR/contact_heat_models.cpp @@ -59,5 +59,5 @@ void HeatArea::coeffs_to_local() double HeatArea::calculate_heat() { - return conductivity * contact->area * (contact->Ti - contact->Tj); + return conductivity * contact->area * (contact->Tj - contact->Ti); } diff --git a/src/GRANULAR/fix_temp_integrate.cpp b/src/GRANULAR/fix_temp_integrate.cpp index f81442766b..e5fbae63dc 100644 --- a/src/GRANULAR/fix_temp_integrate.cpp +++ b/src/GRANULAR/fix_temp_integrate.cpp @@ -77,8 +77,8 @@ void FixTempIntegrate::init() if (!atom->temperature_flag) error->all(FLERR,"Fix temp/integrate requires atom style with temperature property"); - if (!atom->heatflux_flag) - error->all(FLERR,"Fix temp/integrate requires atom style with heatflux property"); + if (!atom->heatflow_flag) + error->all(FLERR,"Fix temp/integrate requires atom style with heatflow property"); } /* ---------------------------------------------------------------------- */ @@ -88,7 +88,7 @@ void FixTempIntegrate::final_integrate() // update temperature of atoms in group double *temperature = atom->temperature; - double *heatflux = atom->heatflux; + double *heatflow = atom->heatflow; double *rmass = atom->rmass; double *mass = atom->mass; int *type = atom->type; @@ -99,12 +99,12 @@ void FixTempIntegrate::final_integrate() if (rmass) { for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { - temperature[i] += dt * heatflux[i] / (calc_cp(i) * rmass[i]); + temperature[i] += dt * heatflow[i] / (calc_cp(i) * rmass[i]); } } else { for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { - temperature[i] += dt * heatflux[i] / (calc_cp(i) * mass[type[i]]); + temperature[i] += dt * heatflow[i] / (calc_cp(i) * mass[type[i]]); } } } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index c0221b0d34..96fbaeefb5 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -125,7 +125,6 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Illegal fix wall/gran command, must specify " "twisting model after twisting keyword"); model->init_model(std::string(arg[iarg++]), TWISTING); - iarg += 1; iarg = model->twisting_model->parse_coeffs(arg, iarg, narg); } else if (strcmp(arg[iarg], "heat") == 0) { iarg++; @@ -133,7 +132,6 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Illegal fix wall/gran command, must specify " "heat model after heat keyword"); model->init_model(std::string(arg[iarg++]), HEAT); - iarg += 1; iarg = model->heat_model->parse_coeffs(arg, iarg, narg); heat_flag = 1; } else if (strcmp(arg[iarg], "xplane") == 0 || @@ -211,20 +209,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : wallstyle = REGION; idregion = utils::strdup(arg[iarg+1]); iarg += 2; - } else if (strcmp(arg[iarg],"temperature") == 0) { - if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); - if (utils::strmatch(arg[iarg+1], "^v_")) { - tstr = utils::strdup(arg[3] + 2); - } else { - Twall = utils::numeric(FLERR,arg[iarg+1],false,lmp); - } - Twall_defined = 1; - iarg += 2; } else wallstyle = NOSTYLE; - if (heat_flag != Twall_defined) - error->all(FLERR, "To model conduction, must define both heat model and wall temperature"); - // optional args wiggle = 0; @@ -256,9 +242,21 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 8; peratom_freq = 1; iarg += 1; + } else if (strcmp(arg[iarg],"temperature") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/gran command"); + if (utils::strmatch(arg[iarg+1], "^v_")) { + tstr = utils::strdup(arg[iarg+1] + 2); + } else { + Twall = utils::numeric(FLERR,arg[iarg+1],false,lmp); + } + Twall_defined = 1; + iarg += 2; } else error->all(FLERR,"Illegal fix wall/gran command"); } + if (heat_flag != Twall_defined) + error->all(FLERR, "To model conduction, must define both heat model and wall temperature"); + if (wallstyle == NOSTYLE) error->all(FLERR,"No wall style defined"); if (wallstyle == XPLANE && domain->xperiodic) @@ -360,8 +358,8 @@ void FixWallGran::init() if (heat_flag) { if (!atom->temperature_flag) error->all(FLERR,"Heat conduction in fix wall/gran requires atom style with temperature property"); - if (!atom->heatflux_flag) - error->all(FLERR,"Heat conduction in fix wall/gran requires atom style with heatflux property"); + if (!atom->heatflow_flag) + error->all(FLERR,"Heat conduction in fix wall/gran requires atom style with heatflow property"); } // check for FixRigid so can extract rigid body masses @@ -408,7 +406,7 @@ void FixWallGran::post_force(int /*vflag*/) { int i,j; double dx,dy,dz,del1,del2,delxy,delr,rwall,meff; - double *forces, *torquesi, dq; + double *forces, *torquesi; double vwall[3]; double w0[3] = {0.0}; bool touchflag = false; @@ -471,11 +469,7 @@ void FixWallGran::post_force(int /*vflag*/) double **torque = atom->torque; double *radius = atom->radius; double *rmass = atom->rmass; - double *temperature, *heatflux; - if (heat_flag) { - temperature = atom->temperature; - heatflux = atom->heatflux; - } + double *temperature, *heatflow; int *mask = atom->mask; int nlocal = atom->nlocal; @@ -490,6 +484,8 @@ void FixWallGran::post_force(int /*vflag*/) model->vj = vwall; model->omegaj = w0; if (heat_flag) { + temperature = atom->temperature; + heatflow = atom->heatflow; if (tstr) Twall = input->variable->compute_equal(tvar); model->Tj = Twall; @@ -574,13 +570,12 @@ void FixWallGran::post_force(int /*vflag*/) forces = model->forces; torquesi = model->torquesi; - if (heat_flag) dq = model->dq; // apply forces & torques add3(f[i], forces, f[i]); add3(torque[i], torquesi, torque[i]); - if (heat_flag) heatflux[i] += dq; + if (heat_flag) heatflow[i] += model->dq; // store contact info if (peratom_flag) { diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 93bca1485b..2f57d90ad6 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -22,11 +22,13 @@ #include "comm.h" #include "domain.h" #include "error.h" +#include "input.h" #include "memory.h" #include "neighbor.h" #include "math_extra.h" #include "region.h" #include "update.h" +#include "variable.h" #include @@ -124,7 +126,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) { int i, m, nc, iwall; double dx, dy, dz, meff; - double *forces, *torquesi, dq; + double *forces, *torquesi; double vwall[3]; double w0[3] = {0.0}; bool touchflag = false; @@ -167,11 +169,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) double **torque = atom->torque; double *radius = atom->radius; double *rmass = atom->rmass; - double *temperature, *heatflux; - if (heat_flag) { - temperature = atom->temperature; - heatflux = atom->heatflux; - } + double *temperature, *heatflow; int *mask = atom->mask; int nlocal = atom->nlocal; @@ -188,7 +186,13 @@ void FixWallGranRegion::post_force(int /*vflag*/) // Define constant wall properties (atom j) model->radj = 0.0; model->omegaj = w0; - if (heat_flag) model->Tj = Twall; + if (heat_flag) { + temperature = atom->temperature; + heatflow = atom->heatflow; + if (tstr) + Twall = input->variable->compute_equal(tvar); + model->Tj = Twall; + } for (i = 0; i < nlocal; i++) { if (! mask[i] & groupbit) continue; @@ -269,13 +273,12 @@ void FixWallGranRegion::post_force(int /*vflag*/) forces = model->forces; torquesi = model->torquesi; - if (heat_flag) dq = model->dq; // apply forces & torques add3(f[i], forces, f[i]); add3(torque[i], torquesi, torque[i]); - if (heat_flag) heatflux[i] += dq; + if (heat_flag) heatflow[i] += model->dq; // store contact info if (peratom_flag) { diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index dddd1acdcb..63354a4eda 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -161,9 +161,9 @@ void PairGranular::compute(int eflag, int vflag) int *mask = atom->mask; int nlocal = atom->nlocal; double *special_lj = force->special_lj; - double *heatflux, *temperature; + double *heatflow, *temperature; if (heat_flag) { - heatflux = atom->heatflux; + heatflow = atom->heatflow; temperature = atom->temperature; } @@ -265,13 +265,13 @@ void PairGranular::compute(int eflag, int vflag) scale3(factor_lj, torquesi); add3(torque[i], torquesi, torque[i]); - if (heat_flag) heatflux[i] += dq; + if (heat_flag) heatflow[i] += dq; if (force->newton_pair || j < nlocal) { sub3(f[j], forces, f[j]); scale3(factor_lj, torquesj); add3(torque[j], torquesj, torque[j]); - if (heat_flag) heatflux[j] -= dq; + if (heat_flag) heatflow[j] -= dq; } if (evflag) { @@ -446,8 +446,8 @@ void PairGranular::init_style() if (heat_flag) { if (!atom->temperature_flag) error->all(FLERR,"Heat conduction in pair granular requires atom style with temperature property"); - if (!atom->heatflux_flag) - error->all(FLERR,"Heat conduction in pair granular requires atom style with heatflux property"); + if (!atom->heatflow_flag) + error->all(FLERR,"Heat conduction in pair granular requires atom style with heatflow property"); } // allocate history and initialize models diff --git a/src/atom.cpp b/src/atom.cpp index ce66742779..5e462dd8bd 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -124,7 +124,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) ellipsoid = line = tri = body = nullptr; quat = nullptr; temperature = nullptr; - heatflux = nullptr; + heatflow = nullptr; // molecular systems @@ -413,7 +413,7 @@ void Atom::peratom_create() add_peratom("body",&body,INT,0); add_peratom("temperature",&temperature,DOUBLE,0); - add_peratom("heatflux",&heatflux,DOUBLE,0); + add_peratom("heatflow",&heatflow,DOUBLE,0); // BPM package @@ -617,7 +617,7 @@ void Atom::set_atomflag_defaults() molecule_flag = molindex_flag = molatom_flag = 0; q_flag = mu_flag = 0; rmass_flag = radius_flag = omega_flag = torque_flag = angmom_flag = 0; - temperature_flag = heatflux_flag = 0; + temperature_flag = heatflow_flag = 0; vfrac_flag = spin_flag = eradius_flag = ervel_flag = erforce_flag = 0; cs_flag = csforce_flag = vforce_flag = ervelforce_flag = etag_flag = 0; rho_flag = esph_flag = cv_flag = vest_flag = 0; @@ -2612,10 +2612,10 @@ length of the data area, and a short description. - double - 1 - temperature of the particles - * - heatflux + * - heatflow - double - 1 - - heatflux of the particles + - heatflow of the particles * - i_name - int - 1 @@ -2673,7 +2673,7 @@ void *Atom::extract(const char *name) if (strcmp(name,"body") == 0) return (void *) body; if (strcmp(name,"quat") == 0) return (void *) quat; if (strcmp(name,"temperature") == 0) return (void *) temperature; - if (strcmp(name,"heatflux") == 0) return (void *) heatflux; + if (strcmp(name,"heatflow") == 0) return (void *) heatflow; if (strcmp(name,"vfrac") == 0) return (void *) vfrac; if (strcmp(name,"s0") == 0) return (void *) s0; @@ -2798,7 +2798,7 @@ int Atom::extract_datatype(const char *name) if (strcmp(name,"body") == 0) return LAMMPS_INT; if (strcmp(name,"quat") == 0) return LAMMPS_DOUBLE_2D; if (strcmp(name,"temperature") == 0) return LAMMPS_DOUBLE; - if (strcmp(name,"heatflux") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"heatflow") == 0) return LAMMPS_DOUBLE; if (strcmp(name,"vfrac") == 0) return LAMMPS_DOUBLE; if (strcmp(name,"s0") == 0) return LAMMPS_DOUBLE; diff --git a/src/atom.h b/src/atom.h index 7ac459317c..bfb79d4366 100644 --- a/src/atom.h +++ b/src/atom.h @@ -80,7 +80,7 @@ class Atom : protected Pointers { double **omega, **angmom, **torque; int *ellipsoid, *line, *tri, *body; double **quat; - double *temperature, *heatflux; + double *temperature, *heatflow; // molecular systems @@ -183,7 +183,7 @@ class Atom : protected Pointers { int molecule_flag, molindex_flag, molatom_flag; int q_flag, mu_flag; int rmass_flag, radius_flag, omega_flag, torque_flag, angmom_flag, quat_flag; - int temperature_flag, heatflux_flag; + int temperature_flag, heatflow_flag; int vfrac_flag, spin_flag, eradius_flag, ervel_flag, erforce_flag; int cs_flag, csforce_flag, vforce_flag, ervelforce_flag, etag_flag; int rho_flag, esph_flag, cv_flag, vest_flag; diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index a74e91c889..cc4fdbe20b 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -41,7 +41,7 @@ enum{ID,MOL,PROC,PROCP1,TYPE,ELEMENT,MASS, XSU,YSU,ZSU,XSUTRI,YSUTRI,ZSUTRI, IX,IY,IZ, VX,VY,VZ,FX,FY,FZ, - Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER,HEATFLUX,TEMPERATURE, + Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER,heatflow,TEMPERATURE, OMEGAX,OMEGAY,OMEGAZ,ANGMOMX,ANGMOMY,ANGMOMZ, TQX,TQY,TQZ, COMPUTE,FIX,VARIABLE,IVEC,DVEC,IARRAY,DARRAY}; @@ -930,11 +930,11 @@ int DumpCustom::count() for (i = 0; i < nlocal; i++) dchoose[i] = 2.0*radius[i]; ptr = dchoose; nstride = 1; - } else if (thresh_array[ithresh] == HEATFLUX) { - if (!atom->heatflux_flag) + } else if (thresh_array[ithresh] == heatflow) { + if (!atom->heatflow_flag) error->all(FLERR, "Threshold for an atom property that isn't allocated"); - ptr = atom->heatflux; + ptr = atom->heatflow; nstride = 1; } else if (thresh_array[ithresh] == TEMPERATURE) { if (!atom->temperature_flag) @@ -1392,10 +1392,10 @@ int DumpCustom::parse_fields(int narg, char **arg) error->all(FLERR,"Dumping an atom property that isn't allocated"); pack_choice[iarg] = &DumpCustom::pack_diameter; vtype[iarg] = Dump::DOUBLE; - } else if (strcmp(arg[iarg],"heatflux") == 0) { - if (!atom->heatflux_flag) + } else if (strcmp(arg[iarg],"heatflow") == 0) { + if (!atom->heatflow_flag) error->all(FLERR,"Dumping an atom property that isn't allocated"); - pack_choice[iarg] = &DumpCustom::pack_heatflux; + pack_choice[iarg] = &DumpCustom::pack_heatflow; vtype[iarg] = Dump::DOUBLE; } else if (strcmp(arg[iarg],"temperature") == 0) { if (!atom->temperature_flag) @@ -1867,7 +1867,7 @@ int DumpCustom::modify_param(int narg, char **arg) else if (strcmp(arg[1],"radius") == 0) thresh_array[nthresh] = RADIUS; else if (strcmp(arg[1],"diameter") == 0) thresh_array[nthresh] = DIAMETER; - else if (strcmp(arg[1],"heatflux") == 0) thresh_array[nthresh] = HEATFLUX; + else if (strcmp(arg[1],"heatflow") == 0) thresh_array[nthresh] = heatflow; else if (strcmp(arg[1],"temperature") == 0) thresh_array[nthresh] = TEMPERATURE; else if (strcmp(arg[1],"omegax") == 0) thresh_array[nthresh] = OMEGAX; else if (strcmp(arg[1],"omegay") == 0) thresh_array[nthresh] = OMEGAY; @@ -2783,12 +2783,12 @@ void DumpCustom::pack_diameter(int n) /* ---------------------------------------------------------------------- */ -void DumpCustom::pack_heatflux(int n) +void DumpCustom::pack_heatflow(int n) { - double *heatflux = atom->heatflux; + double *heatflow = atom->heatflow; for (int i = 0; i < nchoose; i++) { - buf[n] = heatflux[clist[i]]; + buf[n] = heatflow[clist[i]]; n += size_one; } } diff --git a/src/dump_custom.h b/src/dump_custom.h index fd4fd413c3..eeae415dd2 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -193,7 +193,7 @@ class DumpCustom : public Dump { void pack_mu(int); void pack_radius(int); void pack_diameter(int); - void pack_heatflux(int); + void pack_heatflow(int); void pack_temperature(int); void pack_omegax(int); From 955fbe46d12c12070a4068728cf310f9990608e9 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 26 Oct 2022 22:25:58 -0600 Subject: [PATCH 030/112] Renaming classes, adjusting initialization --- src/.gitignore | 32 +- src/GRANULAR/fix_wall_gran.cpp | 65 +-- src/GRANULAR/fix_wall_gran.h | 4 +- src/GRANULAR/fix_wall_gran_region.cpp | 5 +- src/GRANULAR/granular_model.cpp | 498 ++++++++++++++++++ src/GRANULAR/granular_model.h | 107 ++++ src/GRANULAR/gsm.cpp | 127 +++++ src/GRANULAR/gsm.h | 61 +++ src/GRANULAR/gsm_damping.cpp | 113 ++++ src/GRANULAR/gsm_damping.h | 79 +++ src/GRANULAR/gsm_heat.cpp | 63 +++ src/GRANULAR/gsm_heat.h | 53 ++ src/GRANULAR/gsm_normal.cpp | 377 +++++++++++++ src/GRANULAR/gsm_normal.h | 118 +++++ src/GRANULAR/gsm_rolling.cpp | 121 +++++ src/GRANULAR/gsm_rolling.h | 53 ++ src/GRANULAR/gsm_tangential.cpp | 412 +++++++++++++++ src/GRANULAR/gsm_tangential.h | 113 ++++ src/GRANULAR/gsm_twisting.cpp | 124 +++++ src/GRANULAR/gsm_twisting.h | 64 +++ src/GRANULAR/pair_granular.cpp | 97 +--- src/GRANULAR/pair_granular.h | 8 +- src/{GRANULAR => }/contact.cpp | 0 src/{GRANULAR => }/contact.h | 0 src/{GRANULAR => }/contact_damping_models.cpp | 0 src/{GRANULAR => }/contact_damping_models.h | 0 src/{GRANULAR => }/contact_heat_models.cpp | 0 src/{GRANULAR => }/contact_heat_models.h | 0 src/{GRANULAR => }/contact_normal_models.cpp | 0 src/{GRANULAR => }/contact_normal_models.h | 0 src/{GRANULAR => }/contact_rolling_models.cpp | 0 src/{GRANULAR => }/contact_rolling_models.h | 0 src/{GRANULAR => }/contact_sub_models.cpp | 0 src/{GRANULAR => }/contact_sub_models.h | 0 .../contact_tangential_models.cpp | 0 .../contact_tangential_models.h | 0 .../contact_twisting_models.cpp | 0 src/{GRANULAR => }/contact_twisting_models.h | 0 38 files changed, 2545 insertions(+), 149 deletions(-) create mode 100644 src/GRANULAR/granular_model.cpp create mode 100644 src/GRANULAR/granular_model.h create mode 100644 src/GRANULAR/gsm.cpp create mode 100644 src/GRANULAR/gsm.h create mode 100644 src/GRANULAR/gsm_damping.cpp create mode 100644 src/GRANULAR/gsm_damping.h create mode 100644 src/GRANULAR/gsm_heat.cpp create mode 100644 src/GRANULAR/gsm_heat.h create mode 100644 src/GRANULAR/gsm_normal.cpp create mode 100644 src/GRANULAR/gsm_normal.h create mode 100644 src/GRANULAR/gsm_rolling.cpp create mode 100644 src/GRANULAR/gsm_rolling.h create mode 100644 src/GRANULAR/gsm_tangential.cpp create mode 100644 src/GRANULAR/gsm_tangential.h create mode 100644 src/GRANULAR/gsm_twisting.cpp create mode 100644 src/GRANULAR/gsm_twisting.h rename src/{GRANULAR => }/contact.cpp (100%) rename src/{GRANULAR => }/contact.h (100%) rename src/{GRANULAR => }/contact_damping_models.cpp (100%) rename src/{GRANULAR => }/contact_damping_models.h (100%) rename src/{GRANULAR => }/contact_heat_models.cpp (100%) rename src/{GRANULAR => }/contact_heat_models.h (100%) rename src/{GRANULAR => }/contact_normal_models.cpp (100%) rename src/{GRANULAR => }/contact_normal_models.h (100%) rename src/{GRANULAR => }/contact_rolling_models.cpp (100%) rename src/{GRANULAR => }/contact_rolling_models.h (100%) rename src/{GRANULAR => }/contact_sub_models.cpp (100%) rename src/{GRANULAR => }/contact_sub_models.h (100%) rename src/{GRANULAR => }/contact_tangential_models.cpp (100%) rename src/{GRANULAR => }/contact_tangential_models.h (100%) rename src/{GRANULAR => }/contact_twisting_models.cpp (100%) rename src/{GRANULAR => }/contact_twisting_models.h (100%) diff --git a/src/.gitignore b/src/.gitignore index 07230a10b4..7c2b502f67 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1472,22 +1472,6 @@ /compute_xrd.cpp /compute_xrd.h /compute_xrd_consts.h -/contact.cpp -/contact.h -/contact_normal_models.cpp -/contact_normal_models.h -/contact_damping_models.cpp -/contact_damping_models.h -/contact_tangential_models.cpp -/contact_tangential_models.h -/contact_twisting_models.cpp -/contact_twisting_models.h -/contact_rolling_models.cpp -/contact_rolling_models.h -/contact_heat_models.cpp -/contact_heat_models.h -/contact_sub_models.cpp -/contact_sub_models.h /fix_atom_swap.cpp /fix_atom_swap.h /fix_ave_spatial_sphere.cpp @@ -1536,6 +1520,22 @@ /fix_ttm_grid.h /fix_ttm_mod.cpp /fix_ttm_mod.h +/granular_model.cpp +/granular_model.h +/gsm_normal.cpp +/gsm_normal.h +/gsm_damping.cpp +/gsm_damping.h +/gsm_tangential.cpp +/gsm_tangential.h +/gsm_twisting.cpp +/gsm_twisting.h +/gsm_rolling.cpp +/gsm_rolling.h +/gsm_heat.cpp +/gsm_heat.h +/gsm.cpp +/gsm.h /pair_born_coul_long_cs.cpp /pair_born_coul_long_cs.h /pair_born_coul_dsf_cs.cpp diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 96fbaeefb5..31913c6061 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -20,14 +20,8 @@ #include "fix_wall_gran.h" #include "atom.h" -#include "contact.h" -#include "contact_sub_models.h" -#include "contact_normal_models.h" -#include "contact_tangential_models.h" -#include "contact_damping_models.h" -#include "contact_rolling_models.h" -#include "contact_twisting_models.h" -#include "contact_heat_models.h" +#include "granular_model.h" +#include "gsm.h" #include "domain.h" #include "error.h" #include "input.h" @@ -43,7 +37,7 @@ #include using namespace LAMMPS_NS; -using namespace Contact; +using namespace Granular_NS; using namespace FixConst; using namespace MathConst; using namespace MathExtra; @@ -70,7 +64,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // set interaction style // disable bonded/history option for now - model = new ContactModel(lmp); + model = new GranularModel(lmp); model->contact_type = WALL; if (strcmp(arg[3],"granular") == 0) classic_flag = 0; @@ -94,45 +88,19 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } else { iarg = 4; - model->init_model(std::string(arg[iarg++]), NORMAL); - iarg = model->normal_model->parse_coeffs(arg, iarg, narg); + iarg = model->init_submodel(arg, iarg, narg, NORMAL); while (iarg < narg) { if (strcmp(arg[iarg], "damping") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal fix wall/gran command, must specify " - "damping model after damping keyword"); - model->init_model(std::string(arg[iarg++]), DAMPING); - iarg = model->damping_model->parse_coeffs(arg, iarg, narg); + iarg = model->init_submodel(arg, iarg + 1, narg, DAMPING); } else if (strcmp(arg[iarg], "tangential") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal fix wall/gran command, must specify " - "tangential model after tangential keyword"); - model->init_model(std::string(arg[iarg++]), TANGENTIAL); - iarg = model->tangential_model->parse_coeffs(arg, iarg, narg); + iarg = model->init_submodel(arg, iarg + 1, narg, TANGENTIAL); } else if (strcmp(arg[iarg], "rolling") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal fix wall/gran command, must specify " - "rolling model after rolling keyword"); - model->init_model(std::string(arg[iarg++]), ROLLING); - iarg = model->rolling_model->parse_coeffs(arg, iarg, narg); + iarg = model->init_submodel(arg, iarg + 1, narg, ROLLING); } else if (strcmp(arg[iarg], "twisting") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal fix wall/gran command, must specify " - "twisting model after twisting keyword"); - model->init_model(std::string(arg[iarg++]), TWISTING); - iarg = model->twisting_model->parse_coeffs(arg, iarg, narg); + iarg = model->init_submodel(arg, iarg + 1, narg, TWISTING); } else if (strcmp(arg[iarg], "heat") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal fix wall/gran command, must specify " - "heat model after heat keyword"); - model->init_model(std::string(arg[iarg++]), HEAT); - iarg = model->heat_model->parse_coeffs(arg, iarg, narg); + iarg = model->init_submodel(arg, iarg + 1, narg, HEAT); heat_flag = 1; } else if (strcmp(arg[iarg], "xplane") == 0 || strcmp(arg[iarg], "yplane") == 0 || @@ -151,14 +119,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // Define default damping model if unspecified, takes no args if (!model->damping_model) - model->init_model("viscoelastic", DAMPING); - - //Dan original code didn't require tangential? - if (!model->tangential_model) error->all(FLERR, "No tangential?"); - - if (model->limit_damping && !model->normal_model->allow_limit_damping) - error->all(FLERR,"Illegal pair_coeff command, " - "Cannot limit damping with specified normal contact model"); + model->construct_submodel("viscoelastic", DAMPING); + if (!model->tangential_model) error->all(FLERR, "No tangential model specified"); model->init(); @@ -546,7 +508,7 @@ void FixWallGran::post_force(int /*vflag*/) for (j = 0; j < size_history; j++) history_one[i][j] = 0.0; continue; - } // Dan: I tried to simplify this logic, not sure it's 100% correct + } if (model->beyond_contact) history_one[i][0] = 1; @@ -564,7 +526,6 @@ void FixWallGran::post_force(int /*vflag*/) model->history_update = history_update; if (use_history) model->history = history_one[i]; if (heat_flag) model->Ti = temperature[i]; - model->prep_contact(); model->calculate_forces(); diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index fd4a0a0ec8..73c95becc4 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -20,7 +20,7 @@ FixStyle(wall/gran,FixWallGran); #ifndef LMP_FIX_WALL_GRAN_H #define LMP_FIX_WALL_GRAN_H -#include "contact.h" +#include "granular_model.h" #include "fix.h" namespace LAMMPS_NS { @@ -53,7 +53,7 @@ class FixWallGran : public Fix { bigint time_origin; // for granular model choices - Contact::ContactModel *model; + Granular_NS::GranularModel *model; double lo, hi, cylradius; double amplitude, period, omega, vshear; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 2f57d90ad6..ddafb316c0 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -18,7 +18,7 @@ #include "fix_wall_gran_region.h" #include "atom.h" -#include "contact.h" +#include "granular_model.h" #include "comm.h" #include "domain.h" #include "error.h" @@ -33,7 +33,7 @@ #include using namespace LAMMPS_NS; -using namespace Contact; +using namespace Granular_NS; using namespace FixConst; using namespace MathExtra; @@ -267,7 +267,6 @@ void FixWallGranRegion::post_force(int /*vflag*/) if (use_history) model->history = history_many[i][c2r[ic]]; if (heat_flag) model->Ti = temperature[i]; - model->prep_contact(); model->calculate_forces(); diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp new file mode 100644 index 0000000000..b5987d222b --- /dev/null +++ b/src/GRANULAR/granular_model.cpp @@ -0,0 +1,498 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + This class contains a series of tools for DEM contacts + Multiple models can be defined and used to calculate forces + and torques based on contact geometry + + Contributing authors: + Dan Bolintineanu (SNL), Joel Clemmer (SNL) +----------------------------------------------------------------------- */ + +#include "granular_model.h" +#include "gsm.h" +#include "gsm_normal.h" +#include "gsm_tangential.h" +#include "gsm_damping.h" +#include "gsm_rolling.h" +#include "gsm_twisting.h" +#include "gsm_heat.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_extra.h" + +#include + +using namespace LAMMPS_NS; +using namespace Granular_NS; +using namespace MathExtra; + +GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) +{ + limit_damping = 0; + beyond_contact = 0; + nondefault_history_transfer = 0; + classic_model = 0; + contact_type = PAIR; + + normal_model = nullptr; + damping_model = nullptr; + tangential_model = nullptr; + rolling_model = nullptr; + twisting_model = nullptr; + heat_model = nullptr; + + for (int i = 0; i < NSUBMODELS; i++) sub_models[i] = nullptr; + transfer_history_factor = nullptr; +} + +/* ---------------------------------------------------------------------- */ + +GranularModel::~GranularModel() +{ + delete [] transfer_history_factor; + + delete normal_model; + delete damping_model; + delete tangential_model; + delete rolling_model; + delete twisting_model; + delete heat_model; +} + +/* ---------------------------------------------------------------------- */ + +int GranularModel::init_submodel(char **arg, int iarg, int narg, SubmodelType model_type) +{ + if (iarg >= narg) + error->all(FLERR, "Must specify granular submodel name"); + + std::string model_name = std::string(arg[iarg++]); + construct_submodel(model_name, model_type); + + int num_coeffs = sub_models[model_type]->num_coeffs; + if (iarg + num_coeffs > narg) + error->all(FLERR, "Insufficient arguments provided for {} model", model_name); + + for (int i = 0; i < num_coeffs; i++) { + // A few parameters (eg.g kt for tangential mindlin) allow null + if (strcmp(arg[iarg + i], "NULL") == 0) sub_models[model_type]->coeffs[i] = -1; + else sub_models[model_type]->coeffs[i] = utils::numeric(FLERR,arg[iarg + i],false,lmp); + } + sub_models[model_type]->coeffs_to_local(); + + return iarg + num_coeffs; +} + +/* ---------------------------------------------------------------------- */ + +void GranularModel::construct_submodel(std::string model_name, SubmodelType model_type) +{ +if (model_type == NORMAL) { + delete normal_model; + if (model_name == "none") normal_model = new GSMNormalNone(this, lmp); + else if (model_name == "hooke") normal_model = new GSMNormalHooke(this, lmp); + else if (model_name == "hertz") normal_model = new GSMNormalHertz(this, lmp); + else if (model_name == "hertz/material") normal_model = new GSMNormalHertzMaterial(this, lmp); + else if (model_name == "dmt") normal_model = new GSMNormalDMT(this, lmp); + else if (model_name == "jkr") normal_model = new GSMNormalJKR(this, lmp); + else error->all(FLERR, "Normal model name {} not recognized", model_name); + sub_models[model_type] = normal_model; + + } else if (model_type == TANGENTIAL) { + delete tangential_model; + if (model_name == "none") tangential_model = new GSMTangentialNone(this, lmp); + else if (model_name == "linear_nohistory") tangential_model = new GSMTangentialLinearNoHistory(this, lmp); + else if (model_name == "linear_history") tangential_model = new GSMTangentialLinearHistory(this, lmp); + else if (model_name == "linear_history_classic") tangential_model = new GSMTangentialLinearHistoryClassic(this, lmp); + else if (model_name == "mindlin") tangential_model = new GSMTangentialMindlin(this, lmp); + else if (model_name == "mindlin/force") tangential_model = new GSMTangentialMindlinForce(this, lmp); + else if (model_name == "mindlin_rescale") tangential_model = new GSMTangentialMindlinRescale(this, lmp); + else if (model_name == "mindlin_rescale/force") tangential_model = new GSMTangentialMindlinRescaleForce(this, lmp); + else error->all(FLERR, "Tangential model name {} not recognized", model_name); + sub_models[model_type] = tangential_model; + + } else if (model_type == DAMPING) { + delete damping_model; + if (model_name == "none") damping_model = new GSMDampingNone(this, lmp); + else if (model_name == "velocity") damping_model = new GSMDampingVelocity(this, lmp); + else if (model_name == "mass_velocity") damping_model = new GSMDampingMassVelocity(this, lmp); + else if (model_name == "viscoelastic") damping_model = new GSMDampingViscoelastic(this, lmp); + else if (model_name == "tsuji") damping_model = new GSMDampingTsuji(this, lmp); + else error->all(FLERR, "Damping model name {} not recognized", model_name); + sub_models[model_type] = damping_model; + + } else if (model_type == ROLLING) { + delete rolling_model; + rolling_defined = 1; + if (model_name == "none") { + rolling_model = new GSMRollingNone(this, lmp); + rolling_defined = 0; + } else if (model_name == "sds") rolling_model = new GSMRollingSDS(this, lmp); + else error->all(FLERR, "Rolling model name {} not recognized", model_name); + sub_models[model_type] = rolling_model; + + } else if (model_type == TWISTING) { + delete twisting_model; + twisting_defined = 1; + if (model_name == "none") { + twisting_model = new GSMTwistingNone(this, lmp); + twisting_defined = 0; + } else if (model_name == "sds") twisting_model = new GSMTwistingSDS(this, lmp); + else if (model_name == "marshall") twisting_model = new GSMTwistingMarshall(this, lmp); + else error->all(FLERR, "Twisting model name {} not recognized", model_name); + sub_models[model_type] = twisting_model; + + } else if (model_type == HEAT) { + delete heat_model; + heat_defined = 1; + if (model_name == "none") { + heat_model = new GSMHeatNone(this, lmp); + heat_defined = 0; + } else if (model_name == "area") heat_model = new GSMHeatArea(this, lmp); + else error->all(FLERR, "Heat model name not {} recognized", model_name); + sub_models[model_type] = heat_model; + } else { + error->all(FLERR, "Illegal model type {}", model_type); + } + + sub_models[model_type]->name.assign(model_name); +} + +/* ---------------------------------------------------------------------- */ + +int GranularModel::init_classic_model(char **arg, int iarg, int narg) +{ + double kn, kt, gamman, gammat, xmu; + + classic_model = 1; + + if (iarg + 6 >= narg) + error->all(FLERR,"Insufficient arguments provided for classic gran model command"); + + kn = utils::numeric(FLERR,arg[iarg + 1],false,lmp); + if (strcmp(arg[iarg + 2],"NULL") == 0) kt = kn * 2.0 / 7.0; + else kt = utils::numeric(FLERR,arg[iarg + 2],false,lmp); + + gamman = utils::numeric(FLERR,arg[iarg + 3],false,lmp); + if (strcmp(arg[iarg + 4],"NULL") == 0) gammat = 0.5 * gamman; + else gammat = utils::numeric(FLERR,arg[iarg + 4],false,lmp); + + xmu = utils::numeric(FLERR,arg[iarg + 5],false,lmp); + int dampflag = utils::inumeric(FLERR,arg[iarg + 6],false,lmp); + if (dampflag == 0) gammat = 0.0; + + if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || + xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1) + error->all(FLERR,"Illegal classic gran model command"); + + if (strcmp(arg[iarg],"hooke") == 0) { + construct_submodel("hooke", NORMAL); + construct_submodel("linear_nohistory", TANGENTIAL); + construct_submodel("mass_velocity", DAMPING); + } else if (strcmp(arg[iarg],"hooke/history") == 0) { + construct_submodel("hooke", NORMAL); + construct_submodel("linear_history_classic", TANGENTIAL); + construct_submodel("mass_velocity", DAMPING); + } else if (strcmp(arg[iarg],"hertz/history") == 0) { + // convert Kn and Kt from pressure units to force/distance^2 if Hertzian + kn /= force->nktv2p; + kt /= force->nktv2p; + construct_submodel("hertz", NORMAL); + construct_submodel("mindlin", TANGENTIAL); + construct_submodel("viscoelastic", DAMPING); + } else error->all(FLERR,"Invalid classic gran model"); + + // ensure additional models are undefined + construct_submodel("none", ROLLING); + construct_submodel("none", TWISTING); + construct_submodel("none", HEAT); + + // manually parse coeffs + normal_model->coeffs[0] = kn; + normal_model->coeffs[1] = gamman; + tangential_model->coeffs[0] = kt; + tangential_model->coeffs[1] = gammat / gamman; + tangential_model->coeffs[2] = xmu; + + normal_model->coeffs_to_local(); + tangential_model->coeffs_to_local(); + damping_model->coeffs_to_local(); + + iarg += 7; + return iarg; +} + +/* ---------------------------------------------------------------------- */ + +void GranularModel::init() +{ + int i, j; + for (i = 0; i < NSUBMODELS; i++) + if (!sub_models[i]) construct_submodel("none", (SubmodelType) i); + + // Must have valid normal, damping, and tangential models + if (normal_model->name == "none") error->all(FLERR, "Must specify normal granular model"); + if (damping_model->name == "none") error->all(FLERR, "Must specify damping granular model"); + if (tangential_model->name == "none") error->all(FLERR, "Must specify tangential granular model"); + + int size_cumulative; + size_history = 0; + for (i = 0; i < NSUBMODELS; i++) { + if (sub_models[i]->nondefault_history_transfer) + nondefault_history_transfer = 1; + if (sub_models[i]->beyond_contact) + beyond_contact = 1; + size_history += sub_models[i]->size_history; + if (limit_damping && (!sub_models[i]->allow_limit_damping)) + error->all(FLERR,"Cannot limit damping with {} model", sub_models[i]->name); + } + + if (nondefault_history_transfer) { + transfer_history_factor = new double[size_history]; + + for (i = 0; i < size_history; i++) { + // Find which model owns this history value + size_cumulative = 0; + for (j = 0; j < NSUBMODELS; j++) { + if (size_cumulative + sub_models[j]->size_history > i) break; + size_cumulative += sub_models[j]->size_history; + } + + // Check if model has nondefault transfers, if so copy its array + transfer_history_factor[i] = -1; + if (j != NSUBMODELS) { + if (sub_models[j]->nondefault_history_transfer) { + transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; + } + } + } + } + + for (i = 0; i < NSUBMODELS; i++) sub_models[i]->init(); +} + +/* ---------------------------------------------------------------------- */ + +int GranularModel::mix_coeffs(GranularModel *g1, GranularModel *g2) +{ + int i; + for (i = 0; i < NSUBMODELS; i++) { + if (g1->sub_models[i]->name != g2->sub_models[i]->name) return i; + + construct_submodel(g1->sub_models[i]->name, (SubmodelType) i); + sub_models[i]->mix_coeffs(g1->sub_models[i]->coeffs, g2->sub_models[i]->coeffs); + } + + limit_damping = MAX(g1->limit_damping, g2->limit_damping); + + return -1; +} + +/* ---------------------------------------------------------------------- */ + +void GranularModel::write_restart(FILE *fp) +{ + int num_char, num_coeffs; + + for (int i = 0; i < NSUBMODELS; i++) { + num_char = sub_models[i]->name.length(); + num_coeffs = sub_models[i]->num_coeffs; + fwrite(&num_char, sizeof(int), 1, fp); + fwrite(sub_models[i]->name.data(), sizeof(char), num_char, fp); + fwrite(&num_coeffs, sizeof(int), 1, fp); + fwrite(sub_models[i]->coeffs, sizeof(double), num_coeffs, fp); + } +} + +/* ---------------------------------------------------------------------- */ + +void GranularModel::read_restart(FILE *fp) +{ + int num_char, num_coeff; + + for (int i = 0; i < NSUBMODELS; i++) { + if (comm->me == 0) + utils::sfread(FLERR, &num_char, sizeof(int), 1, fp, nullptr, error); + MPI_Bcast(&num_char, 1, MPI_INT, 0, world); + + std::string model_name (num_char, ' '); + if (comm->me == 0) + utils::sfread(FLERR, const_cast(model_name.data()), sizeof(char),num_char, fp, nullptr, error); + MPI_Bcast(const_cast(model_name.data()), num_char, MPI_CHAR, 0, world); + + construct_submodel(model_name, (SubmodelType) i); + + if (comm->me == 0) { + utils::sfread(FLERR, &num_coeff, sizeof(int), 1, fp, nullptr, error); + if (num_coeff != sub_models[i]->num_coeffs) + error->one(FLERR, "Invalid granular model written to restart file"); + } + MPI_Bcast(&num_coeff, 1, MPI_INT, 0, world); + + if (comm->me == 0) { + utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(double), num_coeff, fp, nullptr, error); + } + MPI_Bcast(sub_models[i]->coeffs, num_coeff, MPI_DOUBLE, 0, world); + sub_models[i]->coeffs_to_local(); + } +} + +/* ---------------------------------------------------------------------- */ + +bool GranularModel::check_contact() +{ + if (contact_type == WALL) { + // Used by fix_wall_gran.cpp + // radj = radius of wall + // dx already provided + rsq = lensq3(dx); + radsum = radi; + if (radj == 0) Reff = radi; + else Reff = radi * radj / (radi + radj); + } else if (contact_type == WALLREGION) { + // Used by fix_wall_gran_region.cpp + // radj = radius of wall + // dx and r already provided + rsq = r * r; + radsum = radi; + if (radj == 0) Reff = radi; + else Reff = radi * radj / (radi + radj); + } else { + sub3(xi, xj, dx); + rsq = lensq3(dx); + radsum = radi + radj; + Reff = radi * radj / radsum; + } + + touch = normal_model->touch(); + return touch; +} + +/* ---------------------------------------------------------------------- */ + +void GranularModel::calculate_forces() +{ + double temp[3]; + + // Standard geometric quantities + if (contact_type != WALLREGION) r = sqrt(rsq); + rinv = 1.0 / r; + delta = radsum - r; + dR = delta * Reff; + scale3(rinv, dx, nx); + + // relative translational velocity + sub3(vi, vj, vr); + + // normal component + vnnr = dot3(vr, nx); //v_R . n + scale3(vnnr, nx, vn); + + // tangential component + sub3(vr, vn, vt); + + // relative rotational velocity + scaleadd3(radi, omegai, radj, omegaj, wr); + + // relative tangential velocities + cross3(wr, nx, temp); + sub3(vt, temp, vtr); + vrel = len3(vtr); + + if (rolling_defined || twisting_defined) + sub3(omegai, omegaj, relrot); + + if (rolling_defined) { + // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) + // this is different from the Marshall papers, which use the Bagi/Kuhn formulation + // for rolling velocity (see Wang et al for why the latter is wrong) + vrl[0] = Reff * (relrot[1] * nx[2] - relrot[2] * nx[1]); + vrl[1] = Reff * (relrot[2] * nx[0] - relrot[0] * nx[2]); + vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); + } + + if (twisting_defined) { + // omega_T (eq 29 of Marshall) + magtwist = dot3(relrot, nx); + } + + // calculate forces/torques + + forces[0] = 0.0; + double Fne, Fdamp, dist_to_contact; + area = normal_model->calculate_area(); + normal_model->set_knfac(); + Fne = normal_model->calculate_forces(); + + Fdamp = damping_model->calculate_forces(); + Fntot = Fne + Fdamp; + if (limit_damping && Fntot < 0.0) Fntot = 0.0; + + normal_model->set_fncrit(); // Needed for tangential, rolling, twisting + tangential_model->calculate_forces(); + if (rolling_defined) rolling_model->calculate_forces(); + if (twisting_defined) twisting_model->calculate_forces(); + + // sum contributions + + scale3(Fntot, nx, forces); + add3(forces, fs, forces); + + //May need to rethink eventually tris.. + cross3(nx, fs, torquesi); + scale3(-1, torquesi); + if (contact_type == PAIR) copy3(torquesi, torquesj); + + if (!classic_model && contact_type == PAIR) { + dist_to_contact = radi - 0.5 * delta; + scale3(dist_to_contact, torquesi); + dist_to_contact = radj - 0.5 * delta; + scale3(dist_to_contact, torquesj); + } else { + dist_to_contact = radi; + scale3(dist_to_contact, torquesi); + } + + double torroll[3]; + if (rolling_defined) { + cross3(nx, fr, torroll); + scale3(Reff, torroll); + add3(torquesi, torroll, torquesi); + if (contact_type == PAIR) sub3(torquesj, torroll, torquesj); + } + + double tortwist[3]; + if (twisting_defined) { + scale3(magtortwist, nx, tortwist); + add3(torquesi, tortwist, torquesi); + if (contact_type == PAIR) sub3(torquesj, tortwist, torquesj); + } + + if (heat_defined) { + dq = heat_model->calculate_heat(); + } +} + +/* ---------------------------------------------------------------------- + compute pull-off distance (beyond contact) for a given radius and atom type + use temporary variables since this does not use a specific contact geometry +------------------------------------------------------------------------- */ + +double GranularModel::pulloff_distance(double radi, double radj) +{ + return normal_model->pulloff_distance(radi, radj); +} diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h new file mode 100644 index 0000000000..cc94f49a1e --- /dev/null +++ b/src/GRANULAR/granular_model.h @@ -0,0 +1,107 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef LMP_GRANULAR_MODEL_H +#define LMP_GRANULAR_MODEL_H + +#include "pointers.h" // IWYU pragma: export + +namespace LAMMPS_NS { +namespace Granular_NS { + +#define EPSILON 1e-10 +#define NSUBMODELS 6 + +enum SubmodelType { + NORMAL = 0, + DAMPING = 1, + TANGENTIAL = 2, + ROLLING = 3, + TWISTING = 4, + HEAT = 5 +}; // Relative order matters since some derive coeffs from others + +enum ContactType { + PAIR = 0, + WALL = 1, + WALLREGION = 2 +}; + +// forward declaration +class GSM; +class GSMNormal; +class GSMDamping; +class GSMTangential; +class GSMRolling; +class GSMTwisting; +class GSMHeat; + +class GranularModel : protected Pointers { + public: + GranularModel(class LAMMPS *); + ~GranularModel(); + void init(); + bool check_contact(); + void calculate_forces(); + double pulloff_distance(double, double); + + int init_submodel(char **, int, int, SubmodelType); + int init_classic_model(char **, int, int); + void construct_submodel(std::string, SubmodelType); + int mix_coeffs(GranularModel*, GranularModel*); + + void write_restart(FILE *); + void read_restart(FILE *); + + // Sub models + GSMNormal *normal_model; + GSMDamping *damping_model; + GSMTangential *tangential_model; + GSMRolling *rolling_model; + GSMTwisting *twisting_model; + GSMHeat *heat_model; + GSM *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors + + // Extra options + int beyond_contact, limit_damping, history_update; + ContactType contact_type; + + // History variables + int size_history, nondefault_history_transfer; + double *transfer_history_factor; + double *history; + + // Contact properties/output + double forces[3], torquesi[3], torquesj[3], dq; + + double radi, radj, meff, dt, Ti, Tj, area; + double Fntot, magtortwist; + + int i, j; + double *xi, *xj, *vi, *vj, *omegai, *omegaj; + double fs[3], fr[3], ft[3]; + + double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; + double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; + double magtwist; + bool touch; + + protected: + int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels + int classic_model; +}; + +} // namespace Granular_NS +} // namespace LAMMPS_NS + +#endif diff --git a/src/GRANULAR/gsm.cpp b/src/GRANULAR/gsm.cpp new file mode 100644 index 0000000000..17b816ad21 --- /dev/null +++ b/src/GRANULAR/gsm.cpp @@ -0,0 +1,127 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +-------------------------------------------------------------------------*/ + +/* ---------------------------------------------------------------------- + This class contains a framework for granular submodels (GSM) including: + normal, damping, tangential, rolling, twisting, and heat + These are used to calculate forces/torques/etc based on contact geometry + + Contributing authors: + Dan Bolintineanu (SNL), Joel Clemmer (SNL) +----------------------------------------------------------------------- */ + +#include "gsm.h" +#include "error.h" +#include "utils.h" + +using namespace LAMMPS_NS; +using namespace Granular_NS; + +/* ---------------------------------------------------------------------- + Parent class for all types of granular submodels +------------------------------------------------------------------------- */ + +GSM::GSM(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) +{ + this->gm = gm; + + allocated = 0; + size_history = 0; + history_index = 0; + allow_limit_damping = 1; + beyond_contact = 0; + num_coeffs = 0; + + nondefault_history_transfer = 0; + transfer_history_factor = nullptr; + allocate_coeffs(); +} + +/* ---------------------------------------------------------------------- */ + +GSM::~GSM() +{ + if (allocated) delete [] coeffs; + delete [] transfer_history_factor; +} + +/* ---------------------------------------------------------------------- */ + +void GSM::allocate_coeffs() +{ + allocated = 1; + coeffs = new double[num_coeffs]; +} + +/* ---------------------------------------------------------------------- */ + +void GSM::mix_coeffs(double* icoeffs, double* jcoeffs) +{ + for (int i = 0; i < num_coeffs; i++) + coeffs[i] = mix_geom(icoeffs[i], jcoeffs[i]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- + mixing of Young's modulus (E) +------------------------------------------------------------------------- */ + +double GSM::mix_stiffnessE(double E1, double E2, + double pois1, double pois2) +{ + double factor1 = (1 - pois1 * pois1) / E1; + double factor2 = (1 - pois2 * pois2) / E2; + return 1 / (factor1 + factor2); +} + +/* ---------------------------------------------------------------------- + mixing of shear modulus (G) +------------------------------------------------------------------------ */ + +double GSM::mix_stiffnessG(double E1, double E2, + double pois1, double pois2) +{ + double factor1 = 2 * (2 - pois1) * (1 + pois1) / E1; + double factor2 = 2 * (2 - pois2) * (1 + pois2) / E2; + return 1 / (factor1 + factor2); +} + +/* ---------------------------------------------------------------------- + mixing of Young's modulus (E) for walls +------------------------------------------------------------------------- */ + +double GSM::mix_stiffnessE_wall(double E, double pois) +{ + double factor = 2 * (1 - pois); + return E / factor; +} + +/* ---------------------------------------------------------------------- + mixing of shear modulus (G) for walls +------------------------------------------------------------------------ */ + +double GSM::mix_stiffnessG_wall(double E, double pois) +{ + double factor = 32.0 * (2 - pois) * (1 + pois); + return E / factor; +} + +/* ---------------------------------------------------------------------- + mixing of everything else +------------------------------------------------------------------------- */ + +double GSM::mix_geom(double val1, double val2) +{ + return sqrt(val1 * val2); +} diff --git a/src/GRANULAR/gsm.h b/src/GRANULAR/gsm.h new file mode 100644 index 0000000000..b2df6bef2b --- /dev/null +++ b/src/GRANULAR/gsm.h @@ -0,0 +1,61 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef LMP_GSM_H_ +#define LMP_GSM_H_ + +#include "granular_model.h" +#include "pointers.h" // IWYU pragma: export + +namespace LAMMPS_NS { +namespace Granular_NS { + +class GSM : protected Pointers { + public: + GSM(class GranularModel *, class LAMMPS *); + virtual ~GSM(); + + int num_coeffs; + double *coeffs; + void read_restart(); + virtual void mix_coeffs(double*, double*); + virtual void coeffs_to_local() = 0; + virtual void init() = 0; // called after all submodel coeffs defined + + void allocate_coeffs(); + std::string name; + + int size_history; + int nondefault_history_transfer; + double *transfer_history_factor; + + int history_index; + int beyond_contact; + int allow_limit_damping; + + GranularModel *gm; + + protected: + int allocated; + + double mix_stiffnessE(double, double, double, double); + double mix_stiffnessG(double, double, double, double); + double mix_stiffnessE_wall(double, double); + double mix_stiffnessG_wall(double, double); + double mix_geom(double, double); +}; + +} // namespace GranularModel +} // namespace LAMMPS_NS + +#endif /* GSM_H_ */ diff --git a/src/GRANULAR/gsm_damping.cpp b/src/GRANULAR/gsm_damping.cpp new file mode 100644 index 0000000000..9b51651f30 --- /dev/null +++ b/src/GRANULAR/gsm_damping.cpp @@ -0,0 +1,113 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "gsm_damping.h" +#include "gsm_normal.h" +#include "granular_model.h" +#include "math_special.h" + +using namespace LAMMPS_NS; +using namespace Granular_NS; +using namespace MathSpecial; + +/* ---------------------------------------------------------------------- + Default damping model +------------------------------------------------------------------------- */ + +GSMDamping::GSMDamping(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +void GSMDamping::init() +{ + damp = gm->normal_model->damp; +} + +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +GSMDampingNone::GSMDampingNone(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +double GSMDampingNone::calculate_forces() +{ + return 0.0; +} + +/* ---------------------------------------------------------------------- + Velocity damping +------------------------------------------------------------------------- */ + +GSMDampingVelocity::GSMDampingVelocity(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +double GSMDampingVelocity::calculate_forces() +{ + damp_prefactor = damp; + return -damp_prefactor * gm->vnnr; +} + +/* ---------------------------------------------------------------------- + Mass velocity damping +------------------------------------------------------------------------- */ + +GSMDampingMassVelocity::GSMDampingMassVelocity(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +double GSMDampingMassVelocity::calculate_forces() +{ + damp_prefactor = damp * gm->meff; + return -damp_prefactor * gm->vnnr; +} + +/* ---------------------------------------------------------------------- + Default, viscoelastic damping +------------------------------------------------------------------------- */ + +GSMDampingViscoelastic::GSMDampingViscoelastic(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +double GSMDampingViscoelastic::calculate_forces() +{ + damp_prefactor = damp * gm->meff * gm->area; + return -damp_prefactor * gm->vnnr; +} + +/* ---------------------------------------------------------------------- + Tsuji damping +------------------------------------------------------------------------- */ + +GSMDampingTsuji::GSMDampingTsuji(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +void GSMDampingTsuji::init() +{ + double tmp = gm->normal_model->damp; + damp = 1.2728 - 4.2783 * tmp + 11.087 * square(tmp); + damp += -22.348 * cube(tmp)+ 27.467 * powint(tmp, 4); + damp += -18.022 * powint(tmp, 5) + 4.8218 * powint(tmp,6); +} + +/* ---------------------------------------------------------------------- */ + +double GSMDampingTsuji::calculate_forces() +{ + damp_prefactor = damp * sqrt(gm->meff * gm->normal_model->knfac); + return -damp_prefactor * gm->vnnr; +} diff --git a/src/GRANULAR/gsm_damping.h b/src/GRANULAR/gsm_damping.h new file mode 100644 index 0000000000..ab12cbc2d3 --- /dev/null +++ b/src/GRANULAR/gsm_damping.h @@ -0,0 +1,79 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef GSM_DAMPING_H_ +#define GSM_DAMPING_H_ + +#include "gsm.h" +#include "pointers.h" + +namespace LAMMPS_NS { +namespace Granular_NS { + +class GSMDamping : public GSM { + public: + GSMDamping(class GranularModel *, class LAMMPS *); + ~GSMDamping() {}; + virtual void coeffs_to_local() {}; + virtual void mix_coeffs(double*, double*) {}; + virtual void init(); + virtual double calculate_forces() = 0; + double damp, damp_prefactor; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMDampingNone : public GSMDamping { + public: + GSMDampingNone(class GranularModel *, class LAMMPS *); + void init() override {}; + double calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMDampingVelocity : public GSMDamping { + public: + GSMDampingVelocity(class GranularModel *, class LAMMPS *); + double calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMDampingMassVelocity : public GSMDamping { + public: + GSMDampingMassVelocity(class GranularModel *, class LAMMPS *); + double calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMDampingViscoelastic : public GSMDamping { + public: + GSMDampingViscoelastic(class GranularModel *, class LAMMPS *); + double calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMDampingTsuji : public GSMDamping { + public: + GSMDampingTsuji(class GranularModel *, class LAMMPS *); + void init() override; + double calculate_forces(); +}; + +} // namespace Granular_NS +} // namespace LAMMPS_NS + +#endif /*GSM_DAMPING_H_ */ diff --git a/src/GRANULAR/gsm_heat.cpp b/src/GRANULAR/gsm_heat.cpp new file mode 100644 index 0000000000..449df5520b --- /dev/null +++ b/src/GRANULAR/gsm_heat.cpp @@ -0,0 +1,63 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "gsm_heat.h" +#include "granular_model.h" +#include "error.h" + +using namespace LAMMPS_NS; +using namespace Granular_NS; + +/* ---------------------------------------------------------------------- + Default heat conduction +------------------------------------------------------------------------- */ + +GSMHeat::GSMHeat(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} + +/* ---------------------------------------------------------------------- + Area-based heat conduction +------------------------------------------------------------------------- */ + +GSMHeatNone::GSMHeatNone(GranularModel *gm, LAMMPS *lmp) : GSMHeat(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +double GSMHeatNone::calculate_heat() +{ + return 0.0; +} + +/* ---------------------------------------------------------------------- + Area-based heat conduction +------------------------------------------------------------------------- */ + +GSMHeatArea::GSMHeatArea(GranularModel *gm, LAMMPS *lmp) : GSMHeat(gm, lmp) +{ + num_coeffs = 1; +} + +/* ---------------------------------------------------------------------- */ + +void GSMHeatArea::coeffs_to_local() +{ + conductivity = coeffs[0]; + + if (conductivity < 0.0) error->all(FLERR, "Illegal area heat model"); +} + +/* ---------------------------------------------------------------------- */ + +double GSMHeatArea::calculate_heat() +{ + return conductivity * gm->area * (gm->Tj - gm->Ti); +} diff --git a/src/GRANULAR/gsm_heat.h b/src/GRANULAR/gsm_heat.h new file mode 100644 index 0000000000..f397d555b6 --- /dev/null +++ b/src/GRANULAR/gsm_heat.h @@ -0,0 +1,53 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef GSM_HEAT_H_ +#define GSM_HEAT_H_ + +#include "gsm.h" + +namespace LAMMPS_NS { +namespace Granular_NS { + +class GSMHeat : public GSM { + public: + GSMHeat(class GranularModel *, class LAMMPS *); + ~GSMHeat() {}; + virtual void coeffs_to_local() {}; + virtual void init() {}; + virtual double calculate_heat() = 0; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMHeatNone : public GSMHeat { + public: + GSMHeatNone(class GranularModel *, class LAMMPS *); + double calculate_heat(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMHeatArea : public GSMHeat { + public: + GSMHeatArea(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + double calculate_heat(); + protected: + double conductivity; +}; + +} // namespace Granular_NS +} // namespace LAMMPS_NS + +#endif /*GSM_HEAT_H_ */ diff --git a/src/GRANULAR/gsm_normal.cpp b/src/GRANULAR/gsm_normal.cpp new file mode 100644 index 0000000000..2b029ece6a --- /dev/null +++ b/src/GRANULAR/gsm_normal.cpp @@ -0,0 +1,377 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "gsm_normal.h" +#include "granular_model.h" +#include "error.h" +#include "math_const.h" + +using namespace LAMMPS_NS; +using namespace Granular_NS; +using namespace MathConst; + +#define PI27SQ 266.47931882941264802866 // 27*PI**2 +#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) +#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) +#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) +#define FOURTHIRDS (4.0/3.0) // 4/3 +#define ONETHIRD (1.0/3.0) // 1/3 +#define THREEQUARTERS 0.75 // 3/4 + +/* ---------------------------------------------------------------------- + Default normal model +------------------------------------------------------------------------- */ + +GSMNormal::GSMNormal(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) +{ + material_properties = 0; +} + +/* ---------------------------------------------------------------------- */ + +bool GSMNormal::touch() +{ + bool touchflag = (gm->rsq < gm->radsum * gm->radsum); + return touchflag; +} + +/* ---------------------------------------------------------------------- */ + +double GSMNormal::pulloff_distance(double radi, double radj) +{ + //called outside of compute(), do not assume correct geometry defined in contact + return radi + radj; +} + +/* ---------------------------------------------------------------------- */ + +double GSMNormal::calculate_area() +{ + return sqrt(gm->dR); +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormal::set_fncrit() +{ + Fncrit = fabs(gm->Fntot); +} + +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +GSMNormalNone::GSMNormalNone(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) {} + +/* ---------------------------------------------------------------------- */ + +double GSMNormalNone::calculate_forces() +{ + return 0.0; +} + +/* ---------------------------------------------------------------------- + Hookean normal force +------------------------------------------------------------------------- */ + +GSMNormalHooke::GSMNormalHooke(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +{ + num_coeffs = 2; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalHooke::coeffs_to_local() +{ + k = coeffs[0]; + damp = coeffs[1]; + + if (k < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hooke normal model"); +} + +/* ---------------------------------------------------------------------- */ + +double GSMNormalHooke::calculate_forces() +{ + Fne = knfac * gm->delta; + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalHooke::set_knfac() +{ + knfac = k; +} + +/* ---------------------------------------------------------------------- + Hertzian normal force +------------------------------------------------------------------------- */ + +GSMNormalHertz::GSMNormalHertz(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +{ + num_coeffs = 2; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalHertz::coeffs_to_local() +{ + k = coeffs[0]; + damp = coeffs[1]; + + if (k < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz normal model"); +} + +/* ---------------------------------------------------------------------- */ + +double GSMNormalHertz::calculate_forces() +{ + Fne = knfac * gm->delta; + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalHertz::set_knfac() +{ + knfac = k * gm->area; +} + +/* ---------------------------------------------------------------------- + Hertzian normal force with material properties +------------------------------------------------------------------------- */ + +GSMNormalHertzMaterial::GSMNormalHertzMaterial(GranularModel *gm, LAMMPS *lmp) : GSMNormalHertz(gm, lmp) +{ + material_properties = 1; + num_coeffs = 3; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalHertzMaterial::coeffs_to_local() +{ + Emod = coeffs[0]; + damp = coeffs[1]; + poiss = coeffs[2]; + if (gm->contact_type == PAIR) { + k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + } + + if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz material normal model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) +{ + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- + DMT normal force +------------------------------------------------------------------------- */ + +GSMNormalDMT::GSMNormalDMT(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +{ + allow_limit_damping = 0; + material_properties = 1; + num_coeffs = 4; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalDMT::coeffs_to_local() +{ + Emod = coeffs[0]; + damp = coeffs[1]; + poiss = coeffs[2]; + cohesion = coeffs[3]; + if (gm->contact_type == PAIR) { + k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + } + + if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) +{ + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); + coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +double GSMNormalDMT::calculate_forces() +{ + Fne = knfac * gm->delta; + F_pulloff = 4.0 * MathConst::MY_PI * cohesion * gm->Reff; + Fne -= F_pulloff; + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalDMT::set_knfac() +{ + knfac = k * gm->area; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalDMT::set_fncrit() +{ + Fncrit = fabs(Fne + 2.0 * F_pulloff); +} + +/* ---------------------------------------------------------------------- + JKR normal force +------------------------------------------------------------------------- */ + +GSMNormalJKR::GSMNormalJKR(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +{ + allow_limit_damping = 0; + material_properties = 1; + beyond_contact = 1; + num_coeffs = 4; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalJKR::coeffs_to_local() +{ + Emod = coeffs[0]; + damp = coeffs[1]; + poiss = coeffs[2]; + cohesion = coeffs[3]; + + if (gm->contact_type == PAIR) { + Emix = mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + Emix = mix_stiffnessE_wall(Emod, poiss); + } + + k = FOURTHIRDS * Emix; + + if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalJKR::mix_coeffs(double* icoeffs, double* jcoeffs) +{ + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); + coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +bool GSMNormalJKR::touch() +{ + double area_at_pulloff, R2, delta_pulloff, dist_pulloff; + bool touchflag; + + if (gm->touch) { + R2 = gm->Reff * gm->Reff; + area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * R2 / (4.0 * Emix)); + delta_pulloff = area_at_pulloff * area_at_pulloff / gm->Reff - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Emix); + dist_pulloff = gm->radsum - delta_pulloff; + touchflag = gm->rsq < (dist_pulloff * dist_pulloff); + } else { + touchflag = gm->rsq < (gm->radsum * gm->radsum); + } + + return touchflag; +} + +/* ---------------------------------------------------------------------- + called outside of compute(), do not assume geometry defined in contact +------------------------------------------------------------------------- */ + +double GSMNormalJKR::pulloff_distance(double radi, double radj) +{ + double area_at_pulloff, Reff_tmp; + + Reff_tmp = radi * radj / (radi + radj); // May not be defined + if (Reff_tmp <= 0) return 0; + + area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4.0 * Emix)); + return area_at_pulloff * area_at_pulloff / Reff_tmp - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Emix); +} + +/* ---------------------------------------------------------------------- */ + +double GSMNormalJKR::calculate_area() +{ + double R2, dR2, t0, t1, t2, t3, t4, t5, t6; + double sqrt1, sqrt2, sqrt3; + + R2 = gm->Reff * gm->Reff; + dR2 = gm->dR * gm->dR; + t0 = cohesion * cohesion * R2 * R2 * Emix; + t1 = PI27SQ * t0; + t2 = 8.0 * gm->dR * dR2 * Emix * Emix * Emix; + t3 = 4.0 * dR2 * Emix; + + // in case sqrt(0) < 0 due to precision issues + sqrt1 = MAX(0, t0 * (t1 + 2.0 * t2)); + t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); + t5 = t3 / t4 + t4 / Emix; + sqrt2 = MAX(0, 2.0 * gm->dR + t5); + t6 = sqrt(sqrt2); + sqrt3 = MAX(0, 4.0 * gm->dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Emix * t6)); + + return INVROOT6 * (t6 + sqrt(sqrt3)); +} + +/* ---------------------------------------------------------------------- */ + +double GSMNormalJKR::calculate_forces() +{ + double a2; + a2 = gm->area * gm->area; + Fne = knfac * a2 / gm->Reff - MY_2PI * a2 * sqrt(4.0 * cohesion * Emix / (MY_PI * gm->area)); + F_pulloff = 3.0 * MY_PI * cohesion * gm->Reff; + + return Fne; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalJKR::set_knfac() +{ + knfac = k * gm->area; +} + +/* ---------------------------------------------------------------------- */ + +void GSMNormalJKR::set_fncrit() +{ + Fncrit = fabs(Fne + 2.0 * F_pulloff); +} diff --git a/src/GRANULAR/gsm_normal.h b/src/GRANULAR/gsm_normal.h new file mode 100644 index 0000000000..31587dfd03 --- /dev/null +++ b/src/GRANULAR/gsm_normal.h @@ -0,0 +1,118 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef GSM_NORMAL_H_ +#define GSM_NORMAL_H_ + +#include "gsm.h" + +namespace LAMMPS_NS { +namespace Granular_NS { + +class GSMNormal : public GSM { + public: + GSMNormal(class GranularModel *, class LAMMPS *); + ~GSMNormal() {}; + virtual void coeffs_to_local() {}; + virtual void init() {}; + virtual bool touch(); + virtual double pulloff_distance(double, double); + virtual double calculate_area(); + virtual void set_knfac() = 0; + virtual double calculate_forces() = 0; + virtual void set_fncrit(); + double damp; // Vestigial argument needed by damping + double Emod, poiss; + double Fncrit, Fne, knfac; + int material_properties; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMNormalNone : public GSMNormal { + public: + GSMNormalNone(class GranularModel *, class LAMMPS *); + void set_knfac() {}; + double calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMNormalHooke : public GSMNormal { + public: + GSMNormalHooke(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void set_knfac(); + double calculate_forces(); + protected: + double k; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMNormalHertz : public GSMNormal { + public: + GSMNormalHertz(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void set_knfac(); + double calculate_forces(); + protected: + double k; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMNormalHertzMaterial : public GSMNormalHertz { + public: + GSMNormalHertzMaterial(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMNormalDMT : public GSMNormal { + public: + GSMNormalDMT(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; + void set_knfac(); + double calculate_forces(); + void set_fncrit() override; + protected: + double k, cohesion; + double F_pulloff; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMNormalJKR : public GSMNormal { + public: + GSMNormalJKR(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; + bool touch() override; + double pulloff_distance(double, double) override; + double calculate_area() override; + void set_knfac(); + double calculate_forces(); + void set_fncrit() override; + protected: + double k, cohesion; + double Emix, F_pulloff; +}; + +} // namespace Granular_NS +} // namespace LAMMPS_NS + +#endif /*GSM_NORMAL_H_ */ diff --git a/src/GRANULAR/gsm_rolling.cpp b/src/GRANULAR/gsm_rolling.cpp new file mode 100644 index 0000000000..efb0ea423b --- /dev/null +++ b/src/GRANULAR/gsm_rolling.cpp @@ -0,0 +1,121 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "gsm_normal.h" +#include "gsm_rolling.h" +#include "granular_model.h" +#include "error.h" +#include "math_const.h" +#include "math_extra.h" + +using namespace LAMMPS_NS; +using namespace Granular_NS; +using namespace MathConst; +using namespace MathExtra; + +/* ---------------------------------------------------------------------- + Default rolling friction model +------------------------------------------------------------------------- */ + +GSMRolling::GSMRolling(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} + +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +GSMRollingNone::GSMRollingNone(GranularModel *gm, LAMMPS *lmp) : GSMRolling(gm, lmp) {} + +/* ---------------------------------------------------------------------- + SDS rolling friction model +------------------------------------------------------------------------- */ + +GSMRollingSDS::GSMRollingSDS(GranularModel *gm, LAMMPS *lmp) : GSMRolling(gm, lmp) +{ + num_coeffs = 3; + size_history = 3; +} + +/* ---------------------------------------------------------------------- */ + +void GSMRollingSDS::coeffs_to_local() +{ + k = coeffs[0]; + gamma = coeffs[1]; + mu = coeffs[2]; + + if (k < 0.0 || mu < 0.0 || gamma < 0.0) + error->all(FLERR, "Illegal SDS rolling model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMRollingSDS::calculate_forces() +{ + int rhist0, rhist1, rhist2, frameupdate; + double Frcrit, rolldotn, rollmag, prjmag, magfr, hist_temp[3], scalefac, temp_array[3]; + double k_inv, magfr_inv; + + rhist0 = history_index; + rhist1 = rhist0 + 1; + rhist2 = rhist1 + 1; + + Frcrit = mu * gm->normal_model->Fncrit; + + if (gm->history_update) { + hist_temp[0] = gm->history[rhist0]; + hist_temp[1] = gm->history[rhist1]; + hist_temp[2] = gm->history[rhist2]; + rolldotn = dot3(hist_temp, gm->nx); + + frameupdate = (fabs(rolldotn) * k) > (EPSILON * Frcrit); + if (frameupdate) { // rotate into tangential plane + rollmag = len3(hist_temp); + // projection + scale3(rolldotn, gm->nx, temp_array); + sub3(hist_temp, temp_array, hist_temp); + + // also rescale to preserve magnitude + prjmag = len3(hist_temp); + if (prjmag > 0) scalefac = rollmag / prjmag; + else scalefac = 0; + scale3(scalefac, hist_temp); + } + scale3(gm->dt, gm->vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); + } + + scaleadd3(-k, hist_temp, -gamma, gm->vrl, gm->fr); + + // rescale frictional displacements and forces if needed + magfr = len3(gm->fr); + if (magfr > Frcrit) { + rollmag = len3(hist_temp); + if (rollmag != 0.0) { + k_inv = 1.0 / k; + magfr_inv = 1.0 / magfr; + scale3(-Frcrit * k_inv * magfr_inv, gm->fr, hist_temp); + scale3(-gamma * k_inv, gm->vrl, temp_array); + add3(hist_temp, temp_array, hist_temp); + + scale3(Frcrit * magfr_inv, gm->fr); + } else { + zero3(gm->fr); + } + } + + if (gm->history_update) { + gm->history[rhist0] = hist_temp[0]; + gm->history[rhist1] = hist_temp[1]; + gm->history[rhist2] = hist_temp[2]; + } +} diff --git a/src/GRANULAR/gsm_rolling.h b/src/GRANULAR/gsm_rolling.h new file mode 100644 index 0000000000..44f45b583d --- /dev/null +++ b/src/GRANULAR/gsm_rolling.h @@ -0,0 +1,53 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef GSM_ROLLING_H_ +#define GSM_ROLLING_H_ + +#include "gsm.h" + +namespace LAMMPS_NS { +namespace Granular_NS { + +class GSMRolling : public GSM { + public: + GSMRolling(class GranularModel *, class LAMMPS *); + ~GSMRolling() {}; + virtual void coeffs_to_local() {}; + virtual void init() {}; + virtual void calculate_forces() = 0; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMRollingNone : public GSMRolling { + public: + GSMRollingNone(class GranularModel *, class LAMMPS *); + void calculate_forces() {}; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMRollingSDS : public GSMRolling { + public: + GSMRollingSDS(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void calculate_forces(); + protected: + double k, mu, gamma; +}; + +} // namespace Granular_NS +} // namespace LAMMPS_NS + +#endif /*GSM_ROLLING_H_ */ diff --git a/src/GRANULAR/gsm_tangential.cpp b/src/GRANULAR/gsm_tangential.cpp new file mode 100644 index 0000000000..1f6213d708 --- /dev/null +++ b/src/GRANULAR/gsm_tangential.cpp @@ -0,0 +1,412 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "gsm_damping.h" +#include "gsm_normal.h" +#include "gsm_tangential.h" +#include "granular_model.h" +#include "error.h" +#include "math_const.h" +#include "math_extra.h" + +using namespace LAMMPS_NS; +using namespace Granular_NS; +using namespace MathConst; +using namespace MathExtra; + +/* ---------------------------------------------------------------------- + Default model +------------------------------------------------------------------------- */ + +GSMTangential::GSMTangential(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} + +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +GSMTangentialNone::GSMTangentialNone(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) {} + +/* ---------------------------------------------------------------------- + Linear model with no history +------------------------------------------------------------------------- */ + +GSMTangentialLinearNoHistory::GSMTangentialLinearNoHistory(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) +{ + num_coeffs = 2; + size_history = 3; +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialLinearNoHistory::coeffs_to_local() +{ + k = 0.0; // No tangential stiffness with no history + xt = coeffs[0]; + mu = coeffs[1]; + + if (k < 0.0 || xt < 0.0 || mu < 0.0) + error->all(FLERR, "Illegal linear no history tangential model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialLinearNoHistory::calculate_forces() +{ + // classic pair gran/hooke (no history) + damp = xt * gm->damping_model->damp_prefactor; + + double Fscrit = mu * gm->normal_model->Fncrit; + double fsmag = damp * gm->vrel; + + double Ft; + if (gm->vrel != 0.0) Ft = MIN(Fscrit, fsmag) / gm->vrel; + else Ft = 0.0; + + scale3(-Ft, gm->vtr, gm->fs); +} + +/* ---------------------------------------------------------------------- + Linear model with history +------------------------------------------------------------------------- */ + +GSMTangentialLinearHistory::GSMTangentialLinearHistory(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) +{ + num_coeffs = 3; + size_history = 3; +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialLinearHistory::coeffs_to_local() +{ + k = coeffs[0]; + xt = coeffs[1]; + mu = coeffs[2]; + + if (k < 0.0 || xt < 0.0 || mu < 0.0) + error->all(FLERR, "Illegal linear tangential model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialLinearHistory::calculate_forces() +{ + // Note: this is the same as the base Mindlin calculation except k isn't scaled by area + double magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; + int frame_update = 0; + + damp = xt * gm->damping_model->damp_prefactor; + + double Fscrit = gm->normal_model->Fncrit * mu; + double *history = & gm->history[history_index]; + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (gm->history_update) { + rsht = dot3(history, gm->nx); + frame_update = (fabs(rsht) * k) > (EPSILON * Fscrit); + + if (frame_update) { + shrmag = len3(history); + + // projection + scale3(rsht, gm->nx, temp_array); + sub3(history, temp_array, history); + + // also rescale to preserve magnitude + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); + } + + // update history, tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + scale3(gm->dt, gm->vtr, temp_array); + add3(history, temp_array, history); + } + + + // tangential forces = history + tangential velocity damping + scale3(-k, history, gm->fs); + scale3(damp, gm->vtr, temp_array); + sub3(gm->fs, temp_array, gm->fs); + + // rescale frictional displacements and forces if needed + magfs = len3(gm->fs); + if (magfs > Fscrit) { + shrmag = len3(history); + if (shrmag != 0.0) { + magfs_inv = 1.0 / magfs; + scale3(Fscrit * magfs_inv, gm->fs, history); + scale3(damp, gm->vtr, temp_array); + add3(history, temp_array, history); + scale3(-1.0 / k, history); + scale3(Fscrit * magfs_inv, gm->fs); + } else { + zero3(gm->fs); + } + } +} + +/* ---------------------------------------------------------------------- + Linear model with history from pair gran/hooke/history +------------------------------------------------------------------------- */ + +GSMTangentialLinearHistoryClassic::GSMTangentialLinearHistoryClassic(GranularModel *gm, LAMMPS *lmp) : GSMTangentialLinearHistory(gm, lmp) +{ + scale_area = 0; // Sets gran/hooke/history behavior +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialLinearHistoryClassic::calculate_forces() +{ + double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; + double temp_array[3]; + int frame_update = 0; + + k_scaled = k; + if (scale_area) k_scaled *= gm->area; + + damp = xt * gm->damping_model->damp_prefactor; + + double Fscrit = gm->normal_model->Fncrit * mu; + double *history = & gm->history[history_index]; + + // update history + if (gm->history_update) { + scale3(gm->dt, gm->vtr, temp_array); + add3(history, temp_array, history); + } + + shrmag = len3(history); + + // rotate shear displacements + if (gm->history_update) { + rsht = dot3(history, gm->nx); + scale3(rsht, gm->nx, temp_array); + sub3(history, temp_array, history); + } + + // tangential forces = history + tangential velocity damping + scale3(-k_scaled, history, gm->fs); + scale3(damp, gm->vtr, temp_array); + sub3(gm->fs, temp_array, gm->fs); + + // rescale frictional displacements and forces if needed + magfs = len3(gm->fs); + if (magfs > Fscrit) { + if (shrmag != 0.0) { + magfs_inv = 1.0 / magfs; + scale3(Fscrit * magfs_inv, gm->fs, history); + scale3(damp, gm->vtr, temp_array); + add3(history, temp_array, history); + temp_dbl = -1.0 / k_scaled; + if (scale_area) temp_dbl /= gm->area; + scale3(temp_dbl, history); + scale3(Fscrit * magfs_inv, gm->fs); + } else { + zero3(gm->fs); + } + } +} + +/* ---------------------------------------------------------------------- + Mindlin from pair gran/hertz/history +------------------------------------------------------------------------- */ + +GSMTangentialMindlinClassic::GSMTangentialMindlinClassic(GranularModel *gm, LAMMPS *lmp) : GSMTangentialLinearHistoryClassic(gm, lmp) +{ + scale_area = 1; // Sets gran/hertz/history behavior +} + +/* ---------------------------------------------------------------------- + Mindlin model +------------------------------------------------------------------------- */ + +GSMTangentialMindlin::GSMTangentialMindlin(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) +{ + num_coeffs = 3; + size_history = 3; + mindlin_force = 0; + mindlin_rescale = 0; +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialMindlin::coeffs_to_local() +{ + k = coeffs[0]; + xt = coeffs[1]; + mu = coeffs[2]; + + if (k == -1) { + if (!gm->normal_model->material_properties) + error->all(FLERR, "Must either specify tangential stiffness or material properties for normal model for the Mindlin tangential style"); + + double Emod = gm->normal_model->Emod; + double poiss = gm->normal_model->poiss; + + if (gm->contact_type == PAIR) { + k = 8.0 * mix_stiffnessG(Emod, Emod, poiss, poiss); + } else { + k = 8.0 * mix_stiffnessG_wall(Emod, poiss); + } + } + + if (k < 0.0 || xt < 0.0 || mu < 0.0) + error->all(FLERR, "Illegal Mindlin tangential model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) +{ + if (icoeffs[0] == -1 || jcoeffs[0] == -1) coeffs[0] = -1; + else coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); + coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); + coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); + coeffs_to_local(); +} + +/* ---------------------------------------------------------------------- */ + +void GSMTangentialMindlin::calculate_forces() +{ + double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; + double temp_array[3]; + int frame_update = 0; + + damp = xt * gm->damping_model->damp_prefactor; + + double *history = & gm->history[history_index]; + double Fscrit = gm->normal_model->Fncrit * mu; + + k_scaled = k * gm->area; + + // on unloading, rescale the shear displacements/force + if (mindlin_rescale) + if (gm->area < history[3]) + scale3(gm->area / history[3], history); + + // rotate and update displacements / force. + // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 + if (gm->history_update) { + rsht = dot3(history, gm->nx); + if (mindlin_force) { + frame_update = fabs(rsht) > (EPSILON * Fscrit); + } else { + frame_update = (fabs(rsht) * k_scaled) > (EPSILON * Fscrit); + } + + if (frame_update) { + shrmag = len3(history); + // projection + scale3(rsht, gm->nx, temp_array); + sub3(history, temp_array, history); + // also rescale to preserve magnitude + prjmag = len3(history); + if (prjmag > 0) temp_dbl = shrmag / prjmag; + else temp_dbl = 0; + scale3(temp_dbl, history); + } + + // update history + if (mindlin_force) { + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + scale3(-k_scaled * gm->dt, gm->vtr, temp_array); + } else { + scale3(gm->dt, gm->vtr, temp_array); + } + add3(history, temp_array, history); + + if (mindlin_rescale) history[3] = gm->area; + } + + // tangential forces = history + tangential velocity damping + scale3(-damp, gm->vtr, gm->fs); + + if (!mindlin_force) { + scale3(k_scaled, history, temp_array); + sub3(gm->fs, temp_array, gm->fs); + } else { + add3(gm->fs, history, gm->fs); + } + + // rescale frictional displacements and forces if needed + magfs = len3(gm->fs); + if (magfs > Fscrit) { + shrmag = len3(history); + if (shrmag != 0.0) { + magfs_inv = 1.0 / magfs; + scale3(Fscrit * magfs_inv, gm->fs, history); + scale3(damp, gm->vtr, temp_array); + add3(history, temp_array, history); + + if (!mindlin_force) + scale3(-1.0 / k_scaled, history); + + scale3(Fscrit * magfs_inv, gm->fs); + } else { + zero3(gm->fs); + } + } +} + +/* ---------------------------------------------------------------------- + Mindlin force model +------------------------------------------------------------------------- */ + +GSMTangentialMindlinForce::GSMTangentialMindlinForce(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) +{ + num_coeffs = 3; + size_history = 3; + mindlin_force = 1; + mindlin_rescale = 0; +} + +/* ---------------------------------------------------------------------- + Mindlin rescale model +------------------------------------------------------------------------- */ + +GSMTangentialMindlinRescale::GSMTangentialMindlinRescale(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) +{ + num_coeffs = 3; + size_history = 4; + mindlin_force = 0; + mindlin_rescale = 1; + + nondefault_history_transfer = 1; + transfer_history_factor = new double[size_history]; + for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; + transfer_history_factor[3] = +1; +} + +/* ---------------------------------------------------------------------- + Mindlin rescale force model +------------------------------------------------------------------------- */ + +GSMTangentialMindlinRescaleForce::GSMTangentialMindlinRescaleForce(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) +{ + num_coeffs = 3; + size_history = 4; + mindlin_force = 1; + mindlin_rescale = 1; + + nondefault_history_transfer = 1; + transfer_history_factor = new double[size_history]; + for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; + transfer_history_factor[3] = +1; +} diff --git a/src/GRANULAR/gsm_tangential.h b/src/GRANULAR/gsm_tangential.h new file mode 100644 index 0000000000..8e1d644fea --- /dev/null +++ b/src/GRANULAR/gsm_tangential.h @@ -0,0 +1,113 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef GSM_TANGENTIAL_H_ +#define GSM_TANGENTIAL_H_ + +#include "gsm.h" + +namespace LAMMPS_NS { +namespace Granular_NS { + +class GSMTangential : public GSM { + public: + GSMTangential(class GranularModel *, class LAMMPS *); + virtual ~GSMTangential() {}; + virtual void coeffs_to_local() {}; + virtual void init() {}; + virtual void calculate_forces() = 0; + int rescale_flag; + double k, damp, mu; // Used by Marshall twisting model + protected: + double xt; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialNone : public GSMTangential { + public: + GSMTangentialNone(class GranularModel *, class LAMMPS *); + void calculate_forces() {}; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialLinearNoHistory : public GSMTangential { + public: + GSMTangentialLinearNoHistory(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialLinearHistory : public GSMTangential { + public: + GSMTangentialLinearHistory(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void calculate_forces(); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialLinearHistoryClassic : public GSMTangentialLinearHistory { + public: + GSMTangentialLinearHistoryClassic(class GranularModel *, class LAMMPS *); + void calculate_forces(); + int scale_area; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialMindlinClassic : public GSMTangentialLinearHistoryClassic { + public: + GSMTangentialMindlinClassic(class GranularModel *, class LAMMPS *); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialMindlin : public GSMTangential { + public: + GSMTangentialMindlin(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void mix_coeffs(double*, double*) override; + void calculate_forces(); + protected: + int mindlin_rescale, mindlin_force; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialMindlinForce : public GSMTangentialMindlin { + public: + GSMTangentialMindlinForce(class GranularModel *, class LAMMPS *); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialMindlinRescale : public GSMTangentialMindlin { + public: + GSMTangentialMindlinRescale(class GranularModel *, class LAMMPS *); +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTangentialMindlinRescaleForce : public GSMTangentialMindlin { + public: + GSMTangentialMindlinRescaleForce(class GranularModel *, class LAMMPS *); +}; + +} // namespace Granular_NS +} // namespace LAMMPS_NS + +#endif /*GSM_TANGENTIAL_H_ */ diff --git a/src/GRANULAR/gsm_twisting.cpp b/src/GRANULAR/gsm_twisting.cpp new file mode 100644 index 0000000000..3704ac4ec8 --- /dev/null +++ b/src/GRANULAR/gsm_twisting.cpp @@ -0,0 +1,124 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "gsm_normal.h" +#include "gsm_tangential.h" +#include "gsm_twisting.h" +#include "granular_model.h" +#include "error.h" +#include "math_const.h" + +using namespace LAMMPS_NS; +using namespace Granular_NS; +using namespace MathConst; + +/* ---------------------------------------------------------------------- + Default twisting model +------------------------------------------------------------------------- */ + +GSMTwisting::GSMTwisting(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} + +/* ---------------------------------------------------------------------- + No model +------------------------------------------------------------------------- */ + +GSMTwistingNone::GSMTwistingNone(GranularModel *gm, LAMMPS *lmp) : GSMTwisting(gm, lmp) {} + +/* ---------------------------------------------------------------------- + Marshall twisting model +------------------------------------------------------------------------- */ + +GSMTwistingMarshall::GSMTwistingMarshall(GranularModel *gm, LAMMPS *lmp) : GSMTwisting(gm, lmp) +{ + num_coeffs = 0; + size_history = 3; +} + +/* ---------------------------------------------------------------------- */ + + +void GSMTwistingMarshall::init() +{ + k_tang = gm->tangential_model->k; + mu_tang = gm->tangential_model->mu; +} + +/* ---------------------------------------------------------------------- */ + +void GSMTwistingMarshall::calculate_forces() +{ + double signtwist, Mtcrit; + + // Calculate twist coefficients from tangential model & contact geometry + // eq 32 of Marshall paper + double k = 0.5 * k_tang * gm->area * gm->area; + double damp = 0.5 * gm->tangential_model->damp * gm->area * gm->area; + double mu = TWOTHIRDS * mu_tang * gm->area; + + if (gm->history_update) { + gm->history[history_index] += gm->magtwist * gm->dt; + } + + // M_t torque (eq 30) + gm->magtortwist = -k * gm->history[history_index] - damp * gm->magtwist; + signtwist = (gm->magtwist > 0) - (gm->magtwist < 0); + Mtcrit = mu * gm->normal_model->Fncrit; // critical torque (eq 44) + + if (fabs(gm->magtortwist) > Mtcrit) { + gm->history[history_index] = (Mtcrit * signtwist - damp * gm->magtwist) / k; + gm->magtortwist = -Mtcrit * signtwist; // eq 34 + } +} + +/* ---------------------------------------------------------------------- + SDS twisting model +------------------------------------------------------------------------- */ + +GSMTwistingSDS::GSMTwistingSDS(GranularModel *gm, LAMMPS *lmp) : GSMTwisting(gm, lmp) +{ + num_coeffs = 3; + size_history = 3; +} + +/* ---------------------------------------------------------------------- */ + +void GSMTwistingSDS::coeffs_to_local() +{ + k = coeffs[0]; + damp = coeffs[1]; + mu = coeffs[2]; + + if (k < 0.0 || mu < 0.0 || damp < 0.0) + error->all(FLERR, "Illegal SDS twisting model"); +} + +/* ---------------------------------------------------------------------- */ + +void GSMTwistingSDS::calculate_forces() +{ + double signtwist, Mtcrit; + + if (gm->history_update) { + gm->history[history_index] += gm->magtwist * gm->dt; + } + + // M_t torque (eq 30) + gm->magtortwist = -k * gm->history[history_index] - damp * gm->magtwist; + signtwist = (gm->magtwist > 0) - (gm->magtwist < 0); + Mtcrit = mu * gm->normal_model->Fncrit; // critical torque (eq 44) + + if (fabs(gm->magtortwist) > Mtcrit) { + gm->history[history_index] = (Mtcrit * signtwist - damp * gm->magtwist) / k; + gm->magtortwist = -Mtcrit * signtwist; // eq 34 + } +} diff --git a/src/GRANULAR/gsm_twisting.h b/src/GRANULAR/gsm_twisting.h new file mode 100644 index 0000000000..9fb859df08 --- /dev/null +++ b/src/GRANULAR/gsm_twisting.h @@ -0,0 +1,64 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef GSM_TWISTING_H_ +#define GSM_TWISTING_H_ + +#include "gsm.h" + +namespace LAMMPS_NS { +namespace Granular_NS { + +class GSMTwisting : public GSM { + public: + GSMTwisting(class GranularModel *, class LAMMPS *); + virtual ~GSMTwisting() {}; + virtual void coeffs_to_local() {}; + virtual void init() {}; + virtual void calculate_forces() = 0; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTwistingNone : public GSMTwisting { + public: + GSMTwistingNone(class GranularModel *, class LAMMPS *); + void calculate_forces() {}; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTwistingMarshall : public GSMTwisting { + public: + GSMTwistingMarshall(class GranularModel *, class LAMMPS *); + void calculate_forces(); + void init(); + protected: + double k_tang, mu_tang; +}; + +/* ---------------------------------------------------------------------- */ + +class GSMTwistingSDS : public GSMTwisting { + public: + GSMTwistingSDS(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void calculate_forces(); + protected: + double k, mu, damp; +}; + +} // namespace Granular_NS +} // namespace LAMMPS_NS + +#endif /*GSM_TWISTING_H_ */ diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 63354a4eda..6264d8baeb 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -22,14 +22,8 @@ #include "atom.h" #include "comm.h" -#include "contact.h" -#include "contact_sub_models.h" -#include "contact_normal_models.h" -#include "contact_tangential_models.h" -#include "contact_damping_models.h" -#include "contact_rolling_models.h" -#include "contact_twisting_models.h" -#include "contact_heat_models.h" +#include "granular_model.h" +#include "gsm.h" #include "error.h" #include "fix.h" #include "fix_dummy.h" @@ -47,7 +41,7 @@ #include using namespace LAMMPS_NS; -using namespace Contact; +using namespace Granular_NS; using namespace MathExtra; /* ---------------------------------------------------------------------- */ @@ -250,7 +244,6 @@ void PairGranular::compute(int eflag, int vflag) models[itype][jtype]->Ti = temperature[i]; models[itype][jtype]->Tj = temperature[j]; } - models[itype][jtype]->prep_contact(); models[itype][jtype]->calculate_forces(); @@ -304,7 +297,7 @@ void PairGranular::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutoff_type,n+1,n+1,"pair:cutoff_type"); - models.resize(n+1, std::vector (n+1, nullptr)); + models.resize(n+1, std::vector (n+1, nullptr)); onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -347,74 +340,37 @@ void PairGranular::coeff(int narg, char **arg) //Parse mandatory specification int iarg = 2; - vec_models.back().init_model(std::string(arg[iarg++]), NORMAL); - iarg = vec_models.back().normal_model->parse_coeffs(arg, iarg, narg); + iarg = vec_models.back().init_submodel(arg, iarg, narg, NORMAL); //Parse optional arguments while (iarg < narg) { if (strcmp(arg[iarg], "tangential") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR,"Illegal pair_coeff command, must specify " - "tangential model after tangential keyword"); - vec_models.back().init_model(std::string(arg[iarg++]), TANGENTIAL); - iarg = vec_models.back().tangential_model->parse_coeffs(arg, iarg, narg); - + iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, TANGENTIAL); } else if (strcmp(arg[iarg], "damping") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal pair_coeff command, must specify " - "damping model after damping keyword"); - vec_models.back().init_model(std::string(arg[iarg++]), DAMPING); - iarg = vec_models.back().damping_model->parse_coeffs(arg, iarg, narg); - + iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, DAMPING); } else if (strcmp(arg[iarg], "rolling") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal pair_coeff command, must specify " - "rolling model after rolling keyword"); - vec_models.back().init_model(std::string(arg[iarg++]), ROLLING); - iarg = vec_models.back().rolling_model->parse_coeffs(arg, iarg, narg); - + iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, ROLLING); } else if (strcmp(arg[iarg], "twisting") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal pair_coeff command, must specify " - "twisting model after twisting keyword"); - vec_models.back().init_model(std::string(arg[iarg++]), TWISTING); - iarg = vec_models.back().twisting_model->parse_coeffs(arg, iarg, narg); - + iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, TWISTING); } else if (strcmp(arg[iarg], "heat") == 0) { - iarg++; - if (iarg >= narg) - error->all(FLERR, "Illegal pair_coeff command, must specify " - "heat model after heat keyword"); - vec_models.back().init_model(std::string(arg[iarg++]), HEAT); - iarg = vec_models.back().heat_model->parse_coeffs(arg, iarg, narg); + iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, HEAT); heat_flag = 1; - } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters for cutoff keyword"); - cutoff_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); + cutoff_one = utils::numeric(FLERR,arg[iarg + 1],false,lmp); iarg += 2; - } else if (strcmp(arg[iarg], "limit_damping") == 0) { vec_models.back().limit_damping = 1; iarg += 1; - } else error->all(FLERR, "Illegal pair_coeff command {}", arg[iarg]); } // Define default damping model if unspecified, has no coeffs if (!vec_models.back().damping_model) - vec_models.back().init_model("viscoelastic", DAMPING); - - if (vec_models.back().limit_damping && !vec_models.back().normal_model->allow_limit_damping) - error->all(FLERR,"Illegal pair_coeff command, " - "Cannot limit damping with specified normal contact model"); + vec_models.back().construct_submodel("viscoelastic", DAMPING); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -568,7 +524,7 @@ double PairGranular::init_one(int i, int j) if (setflag[i][j] == 0) { - vec_models.push_back(ContactModel(lmp)); + vec_models.push_back(GranularModel(lmp)); models[i][j] = models[j][i] = & vec_models.back(); int error_code = vec_models.back().mix_coeffs(models[i][i], models[j][j]); @@ -680,7 +636,7 @@ void PairGranular::read_restart(FILE *fp) MPI_Bcast(&nmodels,1,MPI_INT,0,world); for (i = 0; i < nmodels; i++) { - vec_models.push_back(ContactModel(lmp)); + vec_models.push_back(GranularModel(lmp)); vec_models.back().read_restart(fp); vec_models.back().init(); } @@ -737,7 +693,6 @@ double PairGranular::single(int i, int j, int itype, int jtype, if ((i >= nall) || (j >= nall)) error->all(FLERR,"Not enough atoms for pair granular single function"); - int touchflag; double **x = atom->x; double *radius = atom->radius; @@ -776,20 +731,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, if (mask[i] & freeze_group_bit) meff = mj; if (mask[j] & freeze_group_bit) meff = mi; - // Copy additional information and prepare force calculations - double **v = atom->v; - double **omega = atom->omega; - - models[itype][jtype]->meff = meff; - models[itype][jtype]->vi = v[i]; - models[itype][jtype]->vj = v[j]; - models[itype][jtype]->omegai = omega[i]; - models[itype][jtype]->omegaj = omega[j]; - models[itype][jtype]->history = history; - models[itype][jtype]->prep_contact(); - // if any history is needed - jnum = list->numneigh[i]; jlist = list->firstneigh[i]; @@ -805,6 +747,17 @@ double PairGranular::single(int i, int j, int itype, int jtype, history = &allhistory[size_history*neighprev]; } + // Copy additional information and calculate forces + double **v = atom->v; + double **omega = atom->omega; + + models[itype][jtype]->meff = meff; + models[itype][jtype]->vi = v[i]; + models[itype][jtype]->vj = v[j]; + models[itype][jtype]->omegai = omega[i]; + models[itype][jtype]->omegaj = omega[j]; + models[itype][jtype]->history = history; + double *forces, *torquesi, *torquesj; models[itype][jtype]->calculate_forces(); forces = models[itype][jtype]->forces; diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index ae85748488..be8b6402a5 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -20,7 +20,7 @@ PairStyle(granular,PairGranular); #ifndef LMP_PAIR_GRANULAR_H #define LMP_PAIR_GRANULAR_H -#include "contact.h" +#include "granular_model.h" #include "pair.h" #include @@ -71,9 +71,9 @@ class PairGranular : public Pair { int size_history; int heat_flag; - // contact models - std::vector vec_models; - std::vector > models; + // granular models + std::vector vec_models; + std::vector > models; // optional user-specified global cutoff, per-type user-specified cutoffs double **cutoff_type; diff --git a/src/GRANULAR/contact.cpp b/src/contact.cpp similarity index 100% rename from src/GRANULAR/contact.cpp rename to src/contact.cpp diff --git a/src/GRANULAR/contact.h b/src/contact.h similarity index 100% rename from src/GRANULAR/contact.h rename to src/contact.h diff --git a/src/GRANULAR/contact_damping_models.cpp b/src/contact_damping_models.cpp similarity index 100% rename from src/GRANULAR/contact_damping_models.cpp rename to src/contact_damping_models.cpp diff --git a/src/GRANULAR/contact_damping_models.h b/src/contact_damping_models.h similarity index 100% rename from src/GRANULAR/contact_damping_models.h rename to src/contact_damping_models.h diff --git a/src/GRANULAR/contact_heat_models.cpp b/src/contact_heat_models.cpp similarity index 100% rename from src/GRANULAR/contact_heat_models.cpp rename to src/contact_heat_models.cpp diff --git a/src/GRANULAR/contact_heat_models.h b/src/contact_heat_models.h similarity index 100% rename from src/GRANULAR/contact_heat_models.h rename to src/contact_heat_models.h diff --git a/src/GRANULAR/contact_normal_models.cpp b/src/contact_normal_models.cpp similarity index 100% rename from src/GRANULAR/contact_normal_models.cpp rename to src/contact_normal_models.cpp diff --git a/src/GRANULAR/contact_normal_models.h b/src/contact_normal_models.h similarity index 100% rename from src/GRANULAR/contact_normal_models.h rename to src/contact_normal_models.h diff --git a/src/GRANULAR/contact_rolling_models.cpp b/src/contact_rolling_models.cpp similarity index 100% rename from src/GRANULAR/contact_rolling_models.cpp rename to src/contact_rolling_models.cpp diff --git a/src/GRANULAR/contact_rolling_models.h b/src/contact_rolling_models.h similarity index 100% rename from src/GRANULAR/contact_rolling_models.h rename to src/contact_rolling_models.h diff --git a/src/GRANULAR/contact_sub_models.cpp b/src/contact_sub_models.cpp similarity index 100% rename from src/GRANULAR/contact_sub_models.cpp rename to src/contact_sub_models.cpp diff --git a/src/GRANULAR/contact_sub_models.h b/src/contact_sub_models.h similarity index 100% rename from src/GRANULAR/contact_sub_models.h rename to src/contact_sub_models.h diff --git a/src/GRANULAR/contact_tangential_models.cpp b/src/contact_tangential_models.cpp similarity index 100% rename from src/GRANULAR/contact_tangential_models.cpp rename to src/contact_tangential_models.cpp diff --git a/src/GRANULAR/contact_tangential_models.h b/src/contact_tangential_models.h similarity index 100% rename from src/GRANULAR/contact_tangential_models.h rename to src/contact_tangential_models.h diff --git a/src/GRANULAR/contact_twisting_models.cpp b/src/contact_twisting_models.cpp similarity index 100% rename from src/GRANULAR/contact_twisting_models.cpp rename to src/contact_twisting_models.cpp diff --git a/src/GRANULAR/contact_twisting_models.h b/src/contact_twisting_models.h similarity index 100% rename from src/GRANULAR/contact_twisting_models.h rename to src/contact_twisting_models.h From 1eb048ef935d9c784f0435168e3c9aa24056d8eb Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 28 Oct 2022 16:00:04 -0600 Subject: [PATCH 031/112] Adding granular sub model style creator --- src/GRANULAR/fix_wall_gran.cpp | 15 ++-- src/GRANULAR/granular_model.cpp | 145 ++++++++++++++++---------------- src/GRANULAR/granular_model.h | 11 ++- src/GRANULAR/gsm.cpp | 1 - src/GRANULAR/gsm_damping.h | 25 ++++++ src/GRANULAR/gsm_heat.h | 13 +++ src/GRANULAR/gsm_normal.h | 29 +++++++ src/GRANULAR/gsm_rolling.h | 13 +++ src/GRANULAR/gsm_tangential.cpp | 12 +-- src/GRANULAR/gsm_tangential.h | 41 +++++++++ src/GRANULAR/gsm_twisting.h | 17 ++++ src/GRANULAR/pair_granular.cpp | 12 +-- src/Make.sh | 1 + 13 files changed, 236 insertions(+), 99 deletions(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 31913c6061..e6bd894f1e 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -77,7 +77,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : int iarg; if (classic_flag) { - iarg = model->init_classic_model(arg, 3, narg); + iarg = model->define_classic_model(arg, 3, narg); if (iarg < narg) { if (strcmp(arg[iarg],"limit_damping") == 0) { @@ -88,19 +88,19 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } else { iarg = 4; - iarg = model->init_submodel(arg, iarg, narg, NORMAL); + iarg = model->add_submodel(arg, iarg, narg, NORMAL); while (iarg < narg) { if (strcmp(arg[iarg], "damping") == 0) { - iarg = model->init_submodel(arg, iarg + 1, narg, DAMPING); + iarg = model->add_submodel(arg, iarg + 1, narg, DAMPING); } else if (strcmp(arg[iarg], "tangential") == 0) { - iarg = model->init_submodel(arg, iarg + 1, narg, TANGENTIAL); + iarg = model->add_submodel(arg, iarg + 1, narg, TANGENTIAL); } else if (strcmp(arg[iarg], "rolling") == 0) { - iarg = model->init_submodel(arg, iarg + 1, narg, ROLLING); + iarg = model->add_submodel(arg, iarg + 1, narg, ROLLING); } else if (strcmp(arg[iarg], "twisting") == 0) { - iarg = model->init_submodel(arg, iarg + 1, narg, TWISTING); + iarg = model->add_submodel(arg, iarg + 1, narg, TWISTING); } else if (strcmp(arg[iarg], "heat") == 0) { - iarg = model->init_submodel(arg, iarg + 1, narg, HEAT); + iarg = model->add_submodel(arg, iarg + 1, narg, HEAT); heat_flag = 1; } else if (strcmp(arg[iarg], "xplane") == 0 || strcmp(arg[iarg], "yplane") == 0 || @@ -120,7 +120,6 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // Define default damping model if unspecified, takes no args if (!model->damping_model) model->construct_submodel("viscoelastic", DAMPING); - if (!model->tangential_model) error->all(FLERR, "No tangential model specified"); model->init(); diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index b5987d222b..a7aaa1ed83 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -40,6 +40,17 @@ using namespace LAMMPS_NS; using namespace Granular_NS; using namespace MathExtra; +/* ---------------------------------------------------------------------- + one instance per GSM style in style_gsm.h +------------------------------------------------------------------------- */ + +template static GSM *gsm_creator(GranularModel *gm, LAMMPS *lmp) +{ + return new T(gm, lmp); +} + +/* ---------------------------------------------------------------------- */ + GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) { limit_damping = 0; @@ -57,6 +68,31 @@ GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) for (int i = 0; i < NSUBMODELS; i++) sub_models[i] = nullptr; transfer_history_factor = nullptr; + + // extract info from GSM classes listed in style_gsm.h + + nclass = 0; + +#define GSM_CLASS +#define GSMStyle(key,Class,type) nclass++; +#include "style_gsm.h" // IWYU pragma: keep +#undef GSMStyle +#undef GSM_CLASS + + gsmclass = new GSMCreator[nclass]; + gsmnames = new char*[nclass]; + gsmtypes = new int[nclass]; + nclass = 0; + +#define GSM_CLASS +#define GSMStyle(key,Class,type) \ + gsmclass[nclass] = &gsm_creator; \ + gsmnames[nclass] = (char *) #key; \ + gsmtypes[nclass++] = type; +#include "style_gsm.h" // IWYU pragma: keep +#undef GSMStyle +#undef GSM_CLASS + } /* ---------------------------------------------------------------------- */ @@ -75,7 +111,7 @@ GranularModel::~GranularModel() /* ---------------------------------------------------------------------- */ -int GranularModel::init_submodel(char **arg, int iarg, int narg, SubmodelType model_type) +int GranularModel::add_submodel(char **arg, int iarg, int narg, SubmodelType model_type) { if (iarg >= narg) error->all(FLERR, "Must specify granular submodel name"); @@ -92,6 +128,7 @@ int GranularModel::init_submodel(char **arg, int iarg, int narg, SubmodelType mo if (strcmp(arg[iarg + i], "NULL") == 0) sub_models[model_type]->coeffs[i] = -1; else sub_models[model_type]->coeffs[i] = utils::numeric(FLERR,arg[iarg + i],false,lmp); } + sub_models[model_type]->coeffs_to_local(); return iarg + num_coeffs; @@ -101,80 +138,34 @@ int GranularModel::init_submodel(char **arg, int iarg, int narg, SubmodelType mo void GranularModel::construct_submodel(std::string model_name, SubmodelType model_type) { -if (model_type == NORMAL) { - delete normal_model; - if (model_name == "none") normal_model = new GSMNormalNone(this, lmp); - else if (model_name == "hooke") normal_model = new GSMNormalHooke(this, lmp); - else if (model_name == "hertz") normal_model = new GSMNormalHertz(this, lmp); - else if (model_name == "hertz/material") normal_model = new GSMNormalHertzMaterial(this, lmp); - else if (model_name == "dmt") normal_model = new GSMNormalDMT(this, lmp); - else if (model_name == "jkr") normal_model = new GSMNormalJKR(this, lmp); - else error->all(FLERR, "Normal model name {} not recognized", model_name); - sub_models[model_type] = normal_model; - - } else if (model_type == TANGENTIAL) { - delete tangential_model; - if (model_name == "none") tangential_model = new GSMTangentialNone(this, lmp); - else if (model_name == "linear_nohistory") tangential_model = new GSMTangentialLinearNoHistory(this, lmp); - else if (model_name == "linear_history") tangential_model = new GSMTangentialLinearHistory(this, lmp); - else if (model_name == "linear_history_classic") tangential_model = new GSMTangentialLinearHistoryClassic(this, lmp); - else if (model_name == "mindlin") tangential_model = new GSMTangentialMindlin(this, lmp); - else if (model_name == "mindlin/force") tangential_model = new GSMTangentialMindlinForce(this, lmp); - else if (model_name == "mindlin_rescale") tangential_model = new GSMTangentialMindlinRescale(this, lmp); - else if (model_name == "mindlin_rescale/force") tangential_model = new GSMTangentialMindlinRescaleForce(this, lmp); - else error->all(FLERR, "Tangential model name {} not recognized", model_name); - sub_models[model_type] = tangential_model; - - } else if (model_type == DAMPING) { - delete damping_model; - if (model_name == "none") damping_model = new GSMDampingNone(this, lmp); - else if (model_name == "velocity") damping_model = new GSMDampingVelocity(this, lmp); - else if (model_name == "mass_velocity") damping_model = new GSMDampingMassVelocity(this, lmp); - else if (model_name == "viscoelastic") damping_model = new GSMDampingViscoelastic(this, lmp); - else if (model_name == "tsuji") damping_model = new GSMDampingTsuji(this, lmp); - else error->all(FLERR, "Damping model name {} not recognized", model_name); - sub_models[model_type] = damping_model; - - } else if (model_type == ROLLING) { - delete rolling_model; - rolling_defined = 1; - if (model_name == "none") { - rolling_model = new GSMRollingNone(this, lmp); - rolling_defined = 0; - } else if (model_name == "sds") rolling_model = new GSMRollingSDS(this, lmp); - else error->all(FLERR, "Rolling model name {} not recognized", model_name); - sub_models[model_type] = rolling_model; - - } else if (model_type == TWISTING) { - delete twisting_model; - twisting_defined = 1; - if (model_name == "none") { - twisting_model = new GSMTwistingNone(this, lmp); - twisting_defined = 0; - } else if (model_name == "sds") twisting_model = new GSMTwistingSDS(this, lmp); - else if (model_name == "marshall") twisting_model = new GSMTwistingMarshall(this, lmp); - else error->all(FLERR, "Twisting model name {} not recognized", model_name); - sub_models[model_type] = twisting_model; - - } else if (model_type == HEAT) { - delete heat_model; - heat_defined = 1; - if (model_name == "none") { - heat_model = new GSMHeatNone(this, lmp); - heat_defined = 0; - } else if (model_name == "area") heat_model = new GSMHeatArea(this, lmp); - else error->all(FLERR, "Heat model name not {} recognized", model_name); - sub_models[model_type] = heat_model; - } else { - error->all(FLERR, "Illegal model type {}", model_type); + int i; + for (i = 0; i < nclass; i++) { + if (gsmtypes[i] == model_type) { + if (strcmp(gsmnames[i], model_name.c_str()) == 0) { + GSMCreator &gsm_creator = gsmclass[i]; + sub_models[model_type] = gsm_creator(this, lmp); + break; + } + } } + if (i == nclass) + error->all(FLERR, "Illegal model type {}", model_type); + sub_models[model_type]->name.assign(model_name); + sub_models[model_type]->allocate_coeffs(); + + if (model_type == NORMAL) normal_model = dynamic_cast (sub_models[NORMAL]); + if (model_type == DAMPING) damping_model = dynamic_cast (sub_models[DAMPING]); + if (model_type == TANGENTIAL) tangential_model = dynamic_cast (sub_models[TANGENTIAL]); + if (model_type == ROLLING) rolling_model = dynamic_cast (sub_models[ROLLING]); + if (model_type == TWISTING) twisting_model = dynamic_cast (sub_models[TWISTING]); + if (model_type == HEAT) heat_model = dynamic_cast (sub_models[HEAT]); } /* ---------------------------------------------------------------------- */ -int GranularModel::init_classic_model(char **arg, int iarg, int narg) +int GranularModel::define_classic_model(char **arg, int iarg, int narg) { double kn, kt, gamman, gammat, xmu; @@ -212,7 +203,7 @@ int GranularModel::init_classic_model(char **arg, int iarg, int narg) kn /= force->nktv2p; kt /= force->nktv2p; construct_submodel("hertz", NORMAL); - construct_submodel("mindlin", TANGENTIAL); + construct_submodel("mindlin_classic", TANGENTIAL); construct_submodel("viscoelastic", DAMPING); } else error->all(FLERR,"Invalid classic gran model"); @@ -240,8 +231,7 @@ int GranularModel::init_classic_model(char **arg, int iarg, int narg) void GranularModel::init() { - int i, j; - for (i = 0; i < NSUBMODELS; i++) + for (int i = 0; i < NSUBMODELS; i++) if (!sub_models[i]) construct_submodel("none", (SubmodelType) i); // Must have valid normal, damping, and tangential models @@ -249,9 +239,15 @@ void GranularModel::init() if (damping_model->name == "none") error->all(FLERR, "Must specify damping granular model"); if (tangential_model->name == "none") error->all(FLERR, "Must specify tangential granular model"); + // Twisting, rolling, and heat are optional + twisting_defined = rolling_defined = heat_defined = 1; + if (twisting_model->name == "none") twisting_defined = 0; + if (rolling_model->name == "none") rolling_defined = 0; + if (heat_model->name == "none") heat_defined = 0; + int size_cumulative; size_history = 0; - for (i = 0; i < NSUBMODELS; i++) { + for (int i = 0; i < NSUBMODELS; i++) { if (sub_models[i]->nondefault_history_transfer) nondefault_history_transfer = 1; if (sub_models[i]->beyond_contact) @@ -264,7 +260,8 @@ void GranularModel::init() if (nondefault_history_transfer) { transfer_history_factor = new double[size_history]; - for (i = 0; i < size_history; i++) { + int j; + for (int i = 0; i < size_history; i++) { // Find which model owns this history value size_cumulative = 0; for (j = 0; j < NSUBMODELS; j++) { @@ -282,7 +279,7 @@ void GranularModel::init() } } - for (i = 0; i < NSUBMODELS; i++) sub_models[i]->init(); + for (int i = 0; i < NSUBMODELS; i++) sub_models[i]->init(); } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index cc94f49a1e..afc8f61ddc 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -55,8 +55,8 @@ class GranularModel : protected Pointers { void calculate_forces(); double pulloff_distance(double, double); - int init_submodel(char **, int, int, SubmodelType); - int init_classic_model(char **, int, int); + int add_submodel(char **, int, int, SubmodelType); + int define_classic_model(char **, int, int); void construct_submodel(std::string, SubmodelType); int mix_coeffs(GranularModel*, GranularModel*); @@ -99,6 +99,13 @@ class GranularModel : protected Pointers { protected: int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels int classic_model; + + int nclass; + + typedef class GSM *(*GSMCreator)(class GranularModel *, class LAMMPS *); + GSMCreator *gsmclass; + char **gsmnames; + int *gsmtypes; }; } // namespace Granular_NS diff --git a/src/GRANULAR/gsm.cpp b/src/GRANULAR/gsm.cpp index 17b816ad21..6430fb7403 100644 --- a/src/GRANULAR/gsm.cpp +++ b/src/GRANULAR/gsm.cpp @@ -45,7 +45,6 @@ GSM::GSM(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) nondefault_history_transfer = 0; transfer_history_factor = nullptr; - allocate_coeffs(); } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gsm_damping.h b/src/GRANULAR/gsm_damping.h index ab12cbc2d3..1904314cdc 100644 --- a/src/GRANULAR/gsm_damping.h +++ b/src/GRANULAR/gsm_damping.h @@ -11,6 +11,30 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifdef GSM_CLASS +// clang-format off +GSMStyle(none, + GSMDampingNone, + DAMPING); + +GSMStyle(velocity, + GSMDampingVelocity, + DAMPING); + +GSMStyle(mass_velocity, + GSMDampingMassVelocity, + DAMPING); + +GSMStyle(viscoelastic, + GSMDampingViscoelastic, + DAMPING); + +GSMStyle(tsuji, + GSMDampingTsuji, + DAMPING); +// clang-format on +#else + #ifndef GSM_DAMPING_H_ #define GSM_DAMPING_H_ @@ -77,3 +101,4 @@ class GSMDampingTsuji : public GSMDamping { } // namespace LAMMPS_NS #endif /*GSM_DAMPING_H_ */ +#endif /*GSM_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_heat.h b/src/GRANULAR/gsm_heat.h index f397d555b6..4b27979273 100644 --- a/src/GRANULAR/gsm_heat.h +++ b/src/GRANULAR/gsm_heat.h @@ -11,6 +11,18 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifdef GSM_CLASS +// clang-format off +GSMStyle(none, + GSMHeatNone, + HEAT); + +GSMStyle(area, + GSMHeatArea, + HEAT); +// clang-format on +#else + #ifndef GSM_HEAT_H_ #define GSM_HEAT_H_ @@ -51,3 +63,4 @@ class GSMHeatArea : public GSMHeat { } // namespace LAMMPS_NS #endif /*GSM_HEAT_H_ */ +#endif /*GSM_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_normal.h b/src/GRANULAR/gsm_normal.h index 31587dfd03..0c7ba30e41 100644 --- a/src/GRANULAR/gsm_normal.h +++ b/src/GRANULAR/gsm_normal.h @@ -11,6 +11,34 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifdef GSM_CLASS +// clang-format off +GSMStyle(none, + GSMNormalNone, + NORMAL); + +GSMStyle(hooke, + GSMNormalHooke, + NORMAL); + +GSMStyle(hertz, + GSMNormalHertz, + NORMAL); + +GSMStyle(hertz/material, + GSMNormalHertzMaterial, + NORMAL); + +GSMStyle(dmt, + GSMNormalDMT, + NORMAL); + +GSMStyle(jkr, + GSMNormalJKR, + NORMAL); +// clang-format on +#else + #ifndef GSM_NORMAL_H_ #define GSM_NORMAL_H_ @@ -116,3 +144,4 @@ class GSMNormalJKR : public GSMNormal { } // namespace LAMMPS_NS #endif /*GSM_NORMAL_H_ */ +#endif /*GSM_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_rolling.h b/src/GRANULAR/gsm_rolling.h index 44f45b583d..21e61ac4bc 100644 --- a/src/GRANULAR/gsm_rolling.h +++ b/src/GRANULAR/gsm_rolling.h @@ -11,6 +11,18 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifdef GSM_CLASS +// clang-format off +GSMStyle(none, + GSMRollingNone, + ROLLING); + +GSMStyle(sds, + GSMRollingSDS, + ROLLING); +// clang-format on +#else + #ifndef GSM_ROLLING_H_ #define GSM_ROLLING_H_ @@ -51,3 +63,4 @@ class GSMRollingSDS : public GSMRolling { } // namespace LAMMPS_NS #endif /*GSM_ROLLING_H_ */ +#endif /*GSM_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_tangential.cpp b/src/GRANULAR/gsm_tangential.cpp index 1f6213d708..b3e6266049 100644 --- a/src/GRANULAR/gsm_tangential.cpp +++ b/src/GRANULAR/gsm_tangential.cpp @@ -172,13 +172,10 @@ GSMTangentialLinearHistoryClassic::GSMTangentialLinearHistoryClassic(GranularMod void GSMTangentialLinearHistoryClassic::calculate_forces() { - double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; + double magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; double temp_array[3]; int frame_update = 0; - k_scaled = k; - if (scale_area) k_scaled *= gm->area; - damp = xt * gm->damping_model->damp_prefactor; double Fscrit = gm->normal_model->Fncrit * mu; @@ -200,7 +197,8 @@ void GSMTangentialLinearHistoryClassic::calculate_forces() } // tangential forces = history + tangential velocity damping - scale3(-k_scaled, history, gm->fs); + if (scale_area) scale3(-k * gm->area, history, gm->fs); + else scale3(-k, history, gm->fs); scale3(damp, gm->vtr, temp_array); sub3(gm->fs, temp_array, gm->fs); @@ -212,9 +210,7 @@ void GSMTangentialLinearHistoryClassic::calculate_forces() scale3(Fscrit * magfs_inv, gm->fs, history); scale3(damp, gm->vtr, temp_array); add3(history, temp_array, history); - temp_dbl = -1.0 / k_scaled; - if (scale_area) temp_dbl /= gm->area; - scale3(temp_dbl, history); + scale3(-1.0 / k, history); scale3(Fscrit * magfs_inv, gm->fs); } else { zero3(gm->fs); diff --git a/src/GRANULAR/gsm_tangential.h b/src/GRANULAR/gsm_tangential.h index 8e1d644fea..a420c7d314 100644 --- a/src/GRANULAR/gsm_tangential.h +++ b/src/GRANULAR/gsm_tangential.h @@ -11,6 +11,46 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifdef GSM_CLASS +// clang-format off +GSMStyle(none, + GSMTangentialNone, + TANGENTIAL); + +GSMStyle(linear_nohistory, + GSMTangentialLinearNoHistory, + TANGENTIAL); + +GSMStyle(linear_history, + GSMTangentialLinearHistory, + TANGENTIAL); + +GSMStyle(linear_history_classic, + GSMTangentialLinearHistoryClassic, + TANGENTIAL); + +GSMStyle(mindlin_classic, + GSMTangentialMindlinClassic, + TANGENTIAL); + +GSMStyle(mindlin, + GSMTangentialMindlin, + TANGENTIAL); + +GSMStyle(mindlin/force, + GSMTangentialMindlinForce, + TANGENTIAL); + +GSMStyle(mindlin_rescale, + GSMTangentialMindlinRescale, + TANGENTIAL); + +GSMStyle(mindlin_rescale/force, + GSMTangentialMindlinRescaleForce, + TANGENTIAL); +// clang-format on +#else + #ifndef GSM_TANGENTIAL_H_ #define GSM_TANGENTIAL_H_ @@ -111,3 +151,4 @@ class GSMTangentialMindlinRescaleForce : public GSMTangentialMindlin { } // namespace LAMMPS_NS #endif /*GSM_TANGENTIAL_H_ */ +#endif /*GSM_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_twisting.h b/src/GRANULAR/gsm_twisting.h index 9fb859df08..84759acce7 100644 --- a/src/GRANULAR/gsm_twisting.h +++ b/src/GRANULAR/gsm_twisting.h @@ -11,6 +11,22 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifdef GSM_CLASS +// clang-format off +GSMStyle(none, + GSMTwistingNone, + TWISTING); + +GSMStyle(marshall, + GSMTwistingMarshall, + TWISTING); + +GSMStyle(sds, + GSMTwistingSDS, + TWISTING); +// clang-format on +#else + #ifndef GSM_TWISTING_H_ #define GSM_TWISTING_H_ @@ -62,3 +78,4 @@ class GSMTwistingSDS : public GSMTwisting { } // namespace LAMMPS_NS #endif /*GSM_TWISTING_H_ */ +#endif /*GSM_CLASS_H_ */ diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 6264d8baeb..a6fcde4589 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -340,22 +340,22 @@ void PairGranular::coeff(int narg, char **arg) //Parse mandatory specification int iarg = 2; - iarg = vec_models.back().init_submodel(arg, iarg, narg, NORMAL); + iarg = vec_models.back().add_submodel(arg, iarg, narg, NORMAL); //Parse optional arguments while (iarg < narg) { if (strcmp(arg[iarg], "tangential") == 0) { - iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, TANGENTIAL); + iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, TANGENTIAL); } else if (strcmp(arg[iarg], "damping") == 0) { - iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, DAMPING); + iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, DAMPING); } else if (strcmp(arg[iarg], "rolling") == 0) { - iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, ROLLING); + iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, ROLLING); } else if (strcmp(arg[iarg], "twisting") == 0) { - iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, TWISTING); + iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, TWISTING); } else if (strcmp(arg[iarg], "heat") == 0) { - iarg = vec_models.back().init_submodel(arg, iarg + 1, narg, HEAT); + iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, HEAT); heat_flag = 1; } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) diff --git a/src/Make.sh b/src/Make.sh index 0fe39f0224..da034f8226 100755 --- a/src/Make.sh +++ b/src/Make.sh @@ -104,6 +104,7 @@ if (test $cmd = "style") || (test $cmd = "packages") then $cmd DIHEDRAL_CLASS dihedral_ dihedral force $cmd DUMP_CLASS dump_ dump output write_dump $cmd FIX_CLASS fix_ fix modify + $cmd GSM_CLASS gsm_ gsm granular_model $cmd IMPROPER_CLASS improper_ improper force $cmd INTEGRATE_CLASS "" integrate update $cmd KSPACE_CLASS "" kspace force From f66179f3364d2df1fc034aaf37f84e95d7b31712 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 28 Oct 2022 16:38:32 -0600 Subject: [PATCH 032/112] Removing old contact files, fixing capitalization in dump_custom.cpp --- src/contact.cpp | 479 ------------------------------ src/contact.h | 107 ------- src/contact_damping_models.cpp | 113 ------- src/contact_damping_models.h | 79 ----- src/contact_heat_models.cpp | 63 ---- src/contact_heat_models.h | 53 ---- src/contact_normal_models.cpp | 377 ----------------------- src/contact_normal_models.h | 118 -------- src/contact_rolling_models.cpp | 121 -------- src/contact_rolling_models.h | 53 ---- src/contact_sub_models.cpp | 140 --------- src/contact_sub_models.h | 62 ---- src/contact_tangential_models.cpp | 412 ------------------------- src/contact_tangential_models.h | 113 ------- src/contact_twisting_models.cpp | 124 -------- src/contact_twisting_models.h | 64 ---- src/dump_custom.cpp | 6 +- 17 files changed, 3 insertions(+), 2481 deletions(-) delete mode 100644 src/contact.cpp delete mode 100644 src/contact.h delete mode 100644 src/contact_damping_models.cpp delete mode 100644 src/contact_damping_models.h delete mode 100644 src/contact_heat_models.cpp delete mode 100644 src/contact_heat_models.h delete mode 100644 src/contact_normal_models.cpp delete mode 100644 src/contact_normal_models.h delete mode 100644 src/contact_rolling_models.cpp delete mode 100644 src/contact_rolling_models.h delete mode 100644 src/contact_sub_models.cpp delete mode 100644 src/contact_sub_models.h delete mode 100644 src/contact_tangential_models.cpp delete mode 100644 src/contact_tangential_models.h delete mode 100644 src/contact_twisting_models.cpp delete mode 100644 src/contact_twisting_models.h diff --git a/src/contact.cpp b/src/contact.cpp deleted file mode 100644 index ae294d7db9..0000000000 --- a/src/contact.cpp +++ /dev/null @@ -1,479 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- - This class contains a series of tools for DEM contacts - Multiple models can be defined and used to calculate forces - and torques based on contact geometry - - Contributing authors: - Dan Bolintineanu (SNL), Joel Clemmer (SNL) ------------------------------------------------------------------------ */ - -#include "contact.h" -#include "contact_sub_models.h" -#include "contact_normal_models.h" -#include "contact_tangential_models.h" -#include "contact_damping_models.h" -#include "contact_rolling_models.h" -#include "contact_twisting_models.h" -#include "contact_heat_models.h" -#include "comm.h" -#include "error.h" -#include "force.h" -#include "math_extra.h" - -#include - -using namespace LAMMPS_NS; -using namespace Contact; -using namespace MathExtra; - -ContactModel::ContactModel(LAMMPS *lmp) : Pointers(lmp) -{ - limit_damping = 0; - beyond_contact = 0; - nondefault_history_transfer = 0; - classic_model = 0; - contact_type = PAIR; - - normal_model = nullptr; - damping_model = nullptr; - tangential_model = nullptr; - rolling_model = nullptr; - twisting_model = nullptr; - heat_model = nullptr; - - for (int i = 0; i < NSUBMODELS; i++) sub_models[i] = nullptr; - transfer_history_factor = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -ContactModel::~ContactModel() -{ - delete [] transfer_history_factor; - - delete normal_model; - delete damping_model; - delete tangential_model; - delete rolling_model; - delete twisting_model; - delete heat_model; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::init_model(std::string model_name, ModelType model_type) -{ - if (model_type == NORMAL) { - delete normal_model; - if (model_name == "none") normal_model = new NormalNone(lmp); - else if (model_name == "hooke") normal_model = new NormalHooke(lmp); - else if (model_name == "hertz") normal_model = new NormalHertz(lmp); - else if (model_name == "hertz/material") normal_model = new NormalHertzMaterial(lmp); - else if (model_name == "dmt") normal_model = new NormalDMT(lmp); - else if (model_name == "jkr") normal_model = new NormalJKR(lmp); - else error->all(FLERR, "Normal model name {} not recognized", model_name); - sub_models[model_type] = normal_model; - - } else if (model_type == TANGENTIAL) { - delete tangential_model; - if (model_name == "none") tangential_model = new TangentialNone(lmp); - else if (model_name == "linear_nohistory") tangential_model = new TangentialLinearNoHistory(lmp); - else if (model_name == "linear_history") tangential_model = new TangentialLinearHistory(lmp); - else if (model_name == "linear_history_classic") tangential_model = new TangentialLinearHistoryClassic(lmp); - else if (model_name == "mindlin") tangential_model = new TangentialMindlin(lmp); - else if (model_name == "mindlin/force") tangential_model = new TangentialMindlinForce(lmp); - else if (model_name == "mindlin_rescale") tangential_model = new TangentialMindlinRescale(lmp); - else if (model_name == "mindlin_rescale/force") tangential_model = new TangentialMindlinRescaleForce(lmp); - else error->all(FLERR, "Tangential model name {} not recognized", model_name); - sub_models[model_type] = tangential_model; - - } else if (model_type == DAMPING) { - delete damping_model; - if (model_name == "none") damping_model = new DampingNone(lmp); - else if (model_name == "velocity") damping_model = new DampingVelocity(lmp); - else if (model_name == "mass_velocity") damping_model = new DampingMassVelocity(lmp); - else if (model_name == "viscoelastic") damping_model = new DampingViscoelastic(lmp); - else if (model_name == "tsuji") damping_model = new DampingTsuji(lmp); - else error->all(FLERR, "Damping model name {} not recognized", model_name); - sub_models[model_type] = damping_model; - - } else if (model_type == ROLLING) { - delete rolling_model; - rolling_defined = 1; - if (model_name == "none") { - rolling_model = new RollingNone(lmp); - rolling_defined = 0; - } else if (model_name == "sds") rolling_model = new RollingSDS(lmp); - else error->all(FLERR, "Rolling model name {} not recognized", model_name); - sub_models[model_type] = rolling_model; - - } else if (model_type == TWISTING) { - delete twisting_model; - twisting_defined = 1; - if (model_name == "none") { - twisting_model = new TwistingNone(lmp); - twisting_defined = 0; - } else if (model_name == "sds") twisting_model = new TwistingSDS(lmp); - else if (model_name == "marshall") twisting_model = new TwistingMarshall(lmp); - else error->all(FLERR, "Twisting model name {} not recognized", model_name); - sub_models[model_type] = twisting_model; - - } else if (model_type == HEAT) { - delete heat_model; - heat_defined = 1; - if (model_name == "none") { - heat_model = new HeatNone(lmp); - heat_defined = 0; - } else if (model_name == "area") heat_model = new HeatArea(lmp); - else error->all(FLERR, "Heat model name not {} recognized", model_name); - sub_models[model_type] = heat_model; - } else { - error->all(FLERR, "Illegal model type {}", model_type); - } - - sub_models[model_type]->name.assign(model_name); - sub_models[model_type]->contact = this; - sub_models[model_type]->allocate_coeffs(); -} - -/* ---------------------------------------------------------------------- */ - -int ContactModel::init_classic_model(char **arg, int iarg, int narg) -{ - double kn, kt, gamman, gammat, xmu; - - classic_model = 1; - - if (iarg + 6 >= narg) - error->all(FLERR,"Insufficient arguments provided for classic gran model command"); - - kn = utils::numeric(FLERR,arg[iarg + 1],false,lmp); - if (strcmp(arg[iarg + 2],"NULL") == 0) kt = kn * 2.0 / 7.0; - else kt = utils::numeric(FLERR,arg[iarg + 2],false,lmp); - - gamman = utils::numeric(FLERR,arg[iarg + 3],false,lmp); - if (strcmp(arg[iarg + 4],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = utils::numeric(FLERR,arg[iarg + 4],false,lmp); - - xmu = utils::numeric(FLERR,arg[iarg + 5],false,lmp); - int dampflag = utils::inumeric(FLERR,arg[iarg + 6],false,lmp); - if (dampflag == 0) gammat = 0.0; - - if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || - xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1) - error->all(FLERR,"Illegal classic gran model command"); - - if (strcmp(arg[iarg],"hooke") == 0) { - init_model("hooke", NORMAL); - init_model("linear_nohistory", TANGENTIAL); - init_model("mass_velocity", DAMPING); - } else if (strcmp(arg[iarg],"hooke/history") == 0) { - init_model("hooke", NORMAL); - init_model("linear_history_classic", TANGENTIAL); - init_model("mass_velocity", DAMPING); - } else if (strcmp(arg[iarg],"hertz/history") == 0) { - // convert Kn and Kt from pressure units to force/distance^2 if Hertzian - kn /= force->nktv2p; - kt /= force->nktv2p; - init_model("hertz", NORMAL); - init_model("mindlin", TANGENTIAL); - init_model("viscoelastic", DAMPING); - } else error->all(FLERR,"Invalid classic gran model"); - - // ensure additional models are undefined - init_model("none", ROLLING); - init_model("none", TWISTING); - init_model("none", HEAT); - - // manually parse coeffs - normal_model->coeffs[0] = kn; - normal_model->coeffs[1] = gamman; - tangential_model->coeffs[0] = kt; - tangential_model->coeffs[1] = gammat / gamman; - tangential_model->coeffs[2] = xmu; - - normal_model->coeffs_to_local(); - tangential_model->coeffs_to_local(); - damping_model->coeffs_to_local(); - - iarg += 7; - return iarg; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::init() -{ - int i, j; - for (i = 0; i < NSUBMODELS; i++) - if (!sub_models[i]) init_model("none", (ModelType) i); - - // Must have valid normal, damping, and tangential models - if (normal_model->name == "none") error->all(FLERR, "Must specify normal contact model"); - if (damping_model->name == "none") error->all(FLERR, "Must specify damping contact model"); - if (tangential_model->name == "none") error->all(FLERR, "Must specify tangential contact model"); - - int size_cumulative; - size_history = 0; - for (i = 0; i < NSUBMODELS; i++) { - if (sub_models[i]->nondefault_history_transfer) - nondefault_history_transfer = 1; - if (sub_models[i]->beyond_contact) - beyond_contact = 1; - size_history += sub_models[i]->size_history; - } - - if (nondefault_history_transfer) { - transfer_history_factor = new double[size_history]; - - for (i = 0; i < size_history; i++) { - // Find which model owns this history value - size_cumulative = 0; - for (j = 0; j < NSUBMODELS; j++) { - if (size_cumulative + sub_models[j]->size_history > i) break; - size_cumulative += sub_models[j]->size_history; - } - - // Check if model has nondefault transfers, if so copy its array - transfer_history_factor[i] = -1; - if (j != NSUBMODELS) { - if (sub_models[j]->nondefault_history_transfer) { - transfer_history_factor[i] = sub_models[j]->transfer_history_factor[i - size_cumulative]; - } - } - } - } - - for (i = 0; i < NSUBMODELS; i++) sub_models[i]->init(); -} - -/* ---------------------------------------------------------------------- */ - -int ContactModel::mix_coeffs(ContactModel *c1, ContactModel *c2) -{ - int i; - for (i = 0; i < NSUBMODELS; i++) { - if (c1->sub_models[i]->name != c2->sub_models[i]->name) return i; - - init_model(c1->sub_models[i]->name, (ModelType) i); - sub_models[i]->mix_coeffs(c1->sub_models[i]->coeffs, c2->sub_models[i]->coeffs); - } - - limit_damping = MAX(c1->limit_damping, c2->limit_damping); - - return -1; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::write_restart(FILE *fp) -{ - int num_char, num_coeffs; - - for (int i = 0; i < NSUBMODELS; i++) { - num_char = sub_models[i]->name.length(); - num_coeffs = sub_models[i]->num_coeffs; - fwrite(&num_char, sizeof(int), 1, fp); - fwrite(sub_models[i]->name.data(), sizeof(char), num_char, fp); - fwrite(&num_coeffs, sizeof(int), 1, fp); - fwrite(sub_models[i]->coeffs, sizeof(double), num_coeffs, fp); - } -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::read_restart(FILE *fp) -{ - int num_char, num_coeff; - - for (int i = 0; i < NSUBMODELS; i++) { - if (comm->me == 0) - utils::sfread(FLERR, &num_char, sizeof(int), 1, fp, nullptr, error); - MPI_Bcast(&num_char, 1, MPI_INT, 0, world); - - std::string model_name (num_char, ' '); - if (comm->me == 0) - utils::sfread(FLERR, const_cast(model_name.data()), sizeof(char),num_char, fp, nullptr, error); - MPI_Bcast(const_cast(model_name.data()), num_char, MPI_CHAR, 0, world); - - init_model(model_name, (ModelType) i); - - if (comm->me == 0) { - utils::sfread(FLERR, &num_coeff, sizeof(int), 1, fp, nullptr, error); - if (num_coeff != sub_models[i]->num_coeffs) - error->one(FLERR, "Invalid contact model written to restart file"); - } - MPI_Bcast(&num_coeff, 1, MPI_INT, 0, world); - - if (comm->me == 0) { - utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(double), num_coeff, fp, nullptr, error); - } - MPI_Bcast(sub_models[i]->coeffs, num_coeff, MPI_DOUBLE, 0, world); - sub_models[i]->coeffs_to_local(); - } -} - -/* ---------------------------------------------------------------------- */ - -bool ContactModel::check_contact() -{ - if (contact_type == WALL) { - // Used by fix_wall_gran.cpp - // radj = radius of wall - // dx already provided - rsq = lensq3(dx); - radsum = radi; - if (radj == 0) Reff = radi; - else Reff = radi * radj / (radi + radj); - } else if (contact_type == WALLREGION) { - // Used by fix_wall_gran_region.cpp - // radj = radius of wall - // dx and r already provided - rsq = r * r; - radsum = radi; - if (radj == 0) Reff = radi; - else Reff = radi * radj / (radi + radj); - } else { - sub3(xi, xj, dx); - rsq = lensq3(dx); - radsum = radi + radj; - Reff = radi * radj / radsum; - } - - touch = normal_model->touch(); - return touch; -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::prep_contact() -{ - double temp[3]; - - // Standard geometric quantities - if (contact_type != WALLREGION) r = sqrt(rsq); - rinv = 1.0 / r; - delta = radsum - r; - dR = delta * Reff; - scale3(rinv, dx, nx); - - // relative translational velocity - sub3(vi, vj, vr); - - // normal component - vnnr = dot3(vr, nx); //v_R . n - scale3(vnnr, nx, vn); - - // tangential component - sub3(vr, vn, vt); - - // relative rotational velocity - scaleadd3(radi, omegai, radj, omegaj, wr); - - // relative tangential velocities - cross3(wr, nx, temp); - sub3(vt, temp, vtr); - vrel = len3(vtr); - - if (rolling_defined || twisting_defined) - sub3(omegai, omegaj, relrot); - - if (rolling_defined) { - // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) - // this is different from the Marshall papers, which use the Bagi/Kuhn formulation - // for rolling velocity (see Wang et al for why the latter is wrong) - vrl[0] = Reff * (relrot[1] * nx[2] - relrot[2] * nx[1]); - vrl[1] = Reff * (relrot[2] * nx[0] - relrot[0] * nx[2]); - vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); - } - - if (twisting_defined) { - // omega_T (eq 29 of Marshall) - magtwist = dot3(relrot, nx); - } -} - -/* ---------------------------------------------------------------------- */ - -void ContactModel::calculate_forces() -{ - // calculate forces/torques - - forces[0] = 0.0; - double Fne, Fdamp, dist_to_contact; - area = normal_model->calculate_area(); - normal_model->set_knfac(); - Fne = normal_model->calculate_forces(); - - Fdamp = damping_model->calculate_forces(); - Fntot = Fne + Fdamp; - if (limit_damping && Fntot < 0.0) Fntot = 0.0; - - normal_model->set_fncrit(); // Needed for tangential, rolling, twisting - tangential_model->calculate_forces(); - if (rolling_defined) rolling_model->calculate_forces(); - if (twisting_defined) twisting_model->calculate_forces(); - - // sum contributions - - scale3(Fntot, nx, forces); - add3(forces, fs, forces); - - //May need to rethink eventually tris.. - cross3(nx, fs, torquesi); - scale3(-1, torquesi); - if (contact_type == PAIR) copy3(torquesi, torquesj); - - if (!classic_model && contact_type == PAIR) { - dist_to_contact = radi - 0.5 * delta; - scale3(dist_to_contact, torquesi); - dist_to_contact = radj - 0.5 * delta; - scale3(dist_to_contact, torquesj); - } else { - dist_to_contact = radi; - scale3(dist_to_contact, torquesi); - } - - double torroll[3]; - if (rolling_defined) { - cross3(nx, fr, torroll); - scale3(Reff, torroll); - add3(torquesi, torroll, torquesi); - if (contact_type == PAIR) sub3(torquesj, torroll, torquesj); - } - - double tortwist[3]; - if (twisting_defined) { - scale3(magtortwist, nx, tortwist); - add3(torquesi, tortwist, torquesi); - if (contact_type == PAIR) sub3(torquesj, tortwist, torquesj); - } - - if (heat_defined) { - dq = heat_model->calculate_heat(); - } -} - -/* ---------------------------------------------------------------------- - compute pull-off distance (beyond contact) for a given radius and atom type - use temporary variables since this does not use a specific contact geometry -------------------------------------------------------------------------- */ - -double ContactModel::pulloff_distance(double radi, double radj) -{ - return normal_model->pulloff_distance(radi, radj); -} diff --git a/src/contact.h b/src/contact.h deleted file mode 100644 index d1a13c5eb1..0000000000 --- a/src/contact.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef LMP_CONTACT_H -#define LMP_CONTACT_H - -#include "pointers.h" // IWYU pragma: export - -namespace LAMMPS_NS { -namespace Contact { - -#define EPSILON 1e-10 -#define NSUBMODELS 6 - -enum ModelType { - NORMAL = 0, - DAMPING = 1, - TANGENTIAL = 2, - ROLLING = 3, - TWISTING = 4, - HEAT = 5 -}; // Relative order matters since some derive coeffs from others - -enum ContactType { - PAIR = 0, - WALL = 1, - WALLREGION = 2 -}; - -// forward declaration -class NormalModel; -class DampingModel; -class TangentialModel; -class RollingModel; -class TwistingModel; -class HeatModel; -class SubModel; - -class ContactModel : protected Pointers { - public: - ContactModel(class LAMMPS *); - ~ContactModel(); - void init(); - bool check_contact(); - void prep_contact(); - void calculate_forces(); - double pulloff_distance(double, double); - - void init_model(std::string, ModelType); - int init_classic_model(char **, int, int); - int mix_coeffs(ContactModel*, ContactModel*); - - void write_restart(FILE *); - void read_restart(FILE *); - - // Sub models - NormalModel *normal_model; - DampingModel *damping_model; - TangentialModel *tangential_model; - RollingModel *rolling_model; - TwistingModel *twisting_model; - HeatModel *heat_model; - SubModel *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors - - // Extra options - int beyond_contact, limit_damping, history_update; - ContactType contact_type; - - // History variables - int size_history, nondefault_history_transfer; - double *transfer_history_factor; - double *history; - - // Contact properties/output - double forces[3], torquesi[3], torquesj[3], dq; - - double radi, radj, meff, dt, Ti, Tj, area; - double Fntot, magtortwist; - - int i, j; - double *xi, *xj, *vi, *vj, *omegai, *omegaj; - double fs[3], fr[3], ft[3]; - - double dx[3], nx[3], r, rsq, rinv, Reff, radsum, delta, dR; - double vr[3], vn[3], vnnr, vt[3], wr[3], vtr[3], vrl[3], relrot[3], vrel; - double magtwist; - bool touch; - - protected: - int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels - int classic_model; -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif diff --git a/src/contact_damping_models.cpp b/src/contact_damping_models.cpp deleted file mode 100644 index 07b6b88649..0000000000 --- a/src/contact_damping_models.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "contact_damping_models.h" -#include "contact_normal_models.h" -#include "contact.h" -#include "math_special.h" - -using namespace LAMMPS_NS; -using namespace Contact; -using namespace MathSpecial; - -/* ---------------------------------------------------------------------- - Default damping model -------------------------------------------------------------------------- */ - -DampingModel::DampingModel(LAMMPS *lmp) : SubModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -void DampingModel::init() -{ - damp = contact->normal_model->damp; -} - -/* ---------------------------------------------------------------------- - No model -------------------------------------------------------------------------- */ - -DampingNone::DampingNone(LAMMPS *lmp) : DampingModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -double DampingNone::calculate_forces() -{ - return 0.0; -} - -/* ---------------------------------------------------------------------- - Velocity damping -------------------------------------------------------------------------- */ - -DampingVelocity::DampingVelocity(LAMMPS *lmp) : DampingModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -double DampingVelocity::calculate_forces() -{ - damp_prefactor = damp; - return -damp_prefactor * contact->vnnr; -} - -/* ---------------------------------------------------------------------- - Mass velocity damping -------------------------------------------------------------------------- */ - -DampingMassVelocity::DampingMassVelocity(LAMMPS *lmp) : DampingModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -double DampingMassVelocity::calculate_forces() -{ - damp_prefactor = damp * contact->meff; - return -damp_prefactor * contact->vnnr; -} - -/* ---------------------------------------------------------------------- - Default, viscoelastic damping -------------------------------------------------------------------------- */ - -DampingViscoelastic::DampingViscoelastic(LAMMPS *lmp) : DampingModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -double DampingViscoelastic::calculate_forces() -{ - damp_prefactor = damp * contact->meff * contact->area; - return -damp_prefactor * contact->vnnr; -} - -/* ---------------------------------------------------------------------- - Tsuji damping -------------------------------------------------------------------------- */ - -DampingTsuji::DampingTsuji(LAMMPS *lmp) : DampingModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -void DampingTsuji::init() -{ - double tmp = contact->normal_model->damp; - damp = 1.2728 - 4.2783 * tmp + 11.087 * square(tmp); - damp += -22.348 * cube(tmp)+ 27.467 * powint(tmp, 4); - damp += -18.022 * powint(tmp, 5) + 4.8218 * powint(tmp,6); -} - -/* ---------------------------------------------------------------------- */ - -double DampingTsuji::calculate_forces() -{ - damp_prefactor = damp * sqrt(contact->meff * contact->normal_model->knfac); - return -damp_prefactor * contact->vnnr; -} diff --git a/src/contact_damping_models.h b/src/contact_damping_models.h deleted file mode 100644 index 222e901160..0000000000 --- a/src/contact_damping_models.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef CONTACT_DAMPING_MODELS_H_ -#define CONTACT_DAMPING_MODELS_H_ - -#include "contact_sub_models.h" -#include "pointers.h" - -namespace LAMMPS_NS { -namespace Contact { - -class DampingModel : public SubModel { - public: - DampingModel(class LAMMPS *); - ~DampingModel() {}; - virtual void coeffs_to_local() {}; - virtual void mix_coeffs(double*, double*) {}; - virtual void init(); - virtual double calculate_forces() = 0; - double damp, damp_prefactor; -}; - -/* ---------------------------------------------------------------------- */ - -class DampingNone : public DampingModel { - public: - DampingNone(class LAMMPS *); - void init() override {}; - double calculate_forces(); -}; - -/* ---------------------------------------------------------------------- */ - -class DampingVelocity : public DampingModel { - public: - DampingVelocity(class LAMMPS *); - double calculate_forces(); -}; - -/* ---------------------------------------------------------------------- */ - -class DampingMassVelocity : public DampingModel { - public: - DampingMassVelocity(class LAMMPS *); - double calculate_forces(); -}; - -/* ---------------------------------------------------------------------- */ - -class DampingViscoelastic : public DampingModel { - public: - DampingViscoelastic(class LAMMPS *); - double calculate_forces(); -}; - -/* ---------------------------------------------------------------------- */ - -class DampingTsuji : public DampingModel { - public: - DampingTsuji(class LAMMPS *); - void init() override; - double calculate_forces(); -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif /*CONTACT_DAMPING_MODELS_H_ */ diff --git a/src/contact_heat_models.cpp b/src/contact_heat_models.cpp deleted file mode 100644 index 1804ece9df..0000000000 --- a/src/contact_heat_models.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "contact_heat_models.h" -#include "contact.h" -#include "error.h" - -using namespace LAMMPS_NS; -using namespace Contact; - -/* ---------------------------------------------------------------------- - Default heat conduction -------------------------------------------------------------------------- */ - -HeatModel::HeatModel(LAMMPS *lmp) : SubModel(lmp) {} - -/* ---------------------------------------------------------------------- - Area-based heat conduction -------------------------------------------------------------------------- */ - -HeatNone::HeatNone(LAMMPS *lmp) : HeatModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -double HeatNone::calculate_heat() -{ - return 0.0; -} - -/* ---------------------------------------------------------------------- - Area-based heat conduction -------------------------------------------------------------------------- */ - -HeatArea::HeatArea(LAMMPS *lmp) : HeatModel(lmp) -{ - num_coeffs = 1; -} - -/* ---------------------------------------------------------------------- */ - -void HeatArea::coeffs_to_local() -{ - conductivity = coeffs[0]; - - if (conductivity < 0.0) error->all(FLERR, "Illegal area heat model"); -} - -/* ---------------------------------------------------------------------- */ - -double HeatArea::calculate_heat() -{ - return conductivity * contact->area * (contact->Tj - contact->Ti); -} diff --git a/src/contact_heat_models.h b/src/contact_heat_models.h deleted file mode 100644 index 5a0d495810..0000000000 --- a/src/contact_heat_models.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef CONTACT_HEAT_MODELS_H_ -#define CONTACT_HEAT_MODELS_H_ - -#include "contact_sub_models.h" - -namespace LAMMPS_NS { -namespace Contact { - -class HeatModel : public SubModel { - public: - HeatModel(class LAMMPS *); - ~HeatModel() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; - virtual double calculate_heat() = 0; -}; - -/* ---------------------------------------------------------------------- */ - -class HeatNone : public HeatModel { - public: - HeatNone(class LAMMPS *); - double calculate_heat(); -}; - -/* ---------------------------------------------------------------------- */ - -class HeatArea : public HeatModel { - public: - HeatArea(class LAMMPS *); - void coeffs_to_local() override; - double calculate_heat(); - protected: - double conductivity; -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif /*CONTACT_HEAT_MODELS_H_ */ diff --git a/src/contact_normal_models.cpp b/src/contact_normal_models.cpp deleted file mode 100644 index b377d5d027..0000000000 --- a/src/contact_normal_models.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "contact_normal_models.h" -#include "contact.h" -#include "error.h" -#include "math_const.h" - -using namespace LAMMPS_NS; -using namespace Contact; -using namespace MathConst; - -#define PI27SQ 266.47931882941264802866 // 27*PI**2 -#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3) -#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6) -#define INVROOT6 0.40824829046386307274 // 1/sqrt(6) -#define FOURTHIRDS (4.0/3.0) // 4/3 -#define ONETHIRD (1.0/3.0) // 1/3 -#define THREEQUARTERS 0.75 // 3/4 - -/* ---------------------------------------------------------------------- - Default normal model -------------------------------------------------------------------------- */ - -NormalModel::NormalModel(LAMMPS *lmp) : SubModel(lmp) -{ - material_properties = 0; -} - -/* ---------------------------------------------------------------------- */ - -bool NormalModel::touch() -{ - bool touchflag = (contact->rsq < contact->radsum * contact->radsum); - return touchflag; -} - -/* ---------------------------------------------------------------------- */ - -double NormalModel::pulloff_distance(double radi, double radj) -{ - //called outside of compute(), do not assume correct geometry defined in contact - return radi + radj; -} - -/* ---------------------------------------------------------------------- */ - -double NormalModel::calculate_area() -{ - return sqrt(contact->dR); -} - -/* ---------------------------------------------------------------------- */ - -void NormalModel::set_fncrit() -{ - Fncrit = fabs(contact->Fntot); -} - -/* ---------------------------------------------------------------------- - No model -------------------------------------------------------------------------- */ - -NormalNone::NormalNone(LAMMPS *lmp) : NormalModel(lmp) {} - -/* ---------------------------------------------------------------------- */ - -double NormalNone::calculate_forces() -{ - return 0.0; -} - -/* ---------------------------------------------------------------------- - Hookean normal force -------------------------------------------------------------------------- */ - -NormalHooke::NormalHooke(LAMMPS *lmp) : NormalModel(lmp) -{ - num_coeffs = 2; -} - -/* ---------------------------------------------------------------------- */ - -void NormalHooke::coeffs_to_local() -{ - k = coeffs[0]; - damp = coeffs[1]; - - if (k < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hooke normal model"); -} - -/* ---------------------------------------------------------------------- */ - -double NormalHooke::calculate_forces() -{ - Fne = knfac * contact->delta; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -void NormalHooke::set_knfac() -{ - knfac = k; -} - -/* ---------------------------------------------------------------------- - Hertzian normal force -------------------------------------------------------------------------- */ - -NormalHertz::NormalHertz(LAMMPS *lmp) : NormalModel(lmp) -{ - num_coeffs = 2; -} - -/* ---------------------------------------------------------------------- */ - -void NormalHertz::coeffs_to_local() -{ - k = coeffs[0]; - damp = coeffs[1]; - - if (k < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz normal model"); -} - -/* ---------------------------------------------------------------------- */ - -double NormalHertz::calculate_forces() -{ - Fne = knfac * contact->delta; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -void NormalHertz::set_knfac() -{ - knfac = k * contact->area; -} - -/* ---------------------------------------------------------------------- - Hertzian normal force with material properties -------------------------------------------------------------------------- */ - -NormalHertzMaterial::NormalHertzMaterial(LAMMPS *lmp) : NormalHertz(lmp) -{ - material_properties = 1; - num_coeffs = 3; -} - -/* ---------------------------------------------------------------------- */ - -void NormalHertzMaterial::coeffs_to_local() -{ - Emod = coeffs[0]; - damp = coeffs[1]; - poiss = coeffs[2]; - if (contact->contact_type == PAIR) { - k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); - } else { - k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); - } - - if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz material normal model"); -} - -/* ---------------------------------------------------------------------- */ - -void NormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- - DMT normal force -------------------------------------------------------------------------- */ - -NormalDMT::NormalDMT(LAMMPS *lmp) : NormalModel(lmp) -{ - allow_limit_damping = 0; - material_properties = 1; - num_coeffs = 4; -} - -/* ---------------------------------------------------------------------- */ - -void NormalDMT::coeffs_to_local() -{ - Emod = coeffs[0]; - damp = coeffs[1]; - poiss = coeffs[2]; - cohesion = coeffs[3]; - if (contact->contact_type == PAIR) { - k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); - } else { - k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); - } - - if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); -} - -/* ---------------------------------------------------------------------- */ - -void NormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); - coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - -double NormalDMT::calculate_forces() -{ - Fne = knfac * contact->delta; - F_pulloff = 4.0 * MathConst::MY_PI * cohesion * contact->Reff; - Fne -= F_pulloff; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -void NormalDMT::set_knfac() -{ - knfac = k * contact->area; -} - -/* ---------------------------------------------------------------------- */ - -void NormalDMT::set_fncrit() -{ - Fncrit = fabs(Fne + 2.0 * F_pulloff); -} - -/* ---------------------------------------------------------------------- - JKR normal force -------------------------------------------------------------------------- */ - -NormalJKR::NormalJKR(LAMMPS *lmp) : NormalModel(lmp) -{ - allow_limit_damping = 0; - material_properties = 1; - beyond_contact = 1; - num_coeffs = 4; -} - -/* ---------------------------------------------------------------------- */ - -void NormalJKR::coeffs_to_local() -{ - Emod = coeffs[0]; - damp = coeffs[1]; - poiss = coeffs[2]; - cohesion = coeffs[3]; - - if (contact->contact_type == PAIR) { - Emix = mix_stiffnessE(Emod, Emod, poiss, poiss); - } else { - Emix = mix_stiffnessE_wall(Emod, poiss); - } - - k = FOURTHIRDS * Emix; - - if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal JKR normal model"); -} - -/* ---------------------------------------------------------------------- */ - -void NormalJKR::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); - coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - -bool NormalJKR::touch() -{ - double area_at_pulloff, R2, delta_pulloff, dist_pulloff; - bool touchflag; - - if (contact->touch) { - R2 = contact->Reff * contact->Reff; - area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * R2 / (4.0 * Emix)); - delta_pulloff = area_at_pulloff * area_at_pulloff / contact->Reff - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Emix); - dist_pulloff = contact->radsum - delta_pulloff; - touchflag = contact->rsq < (dist_pulloff * dist_pulloff); - } else { - touchflag = contact->rsq < (contact->radsum * contact->radsum); - } - - return touchflag; -} - -/* ---------------------------------------------------------------------- - called outside of compute(), do not assume geometry defined in contact -------------------------------------------------------------------------- */ - -double NormalJKR::pulloff_distance(double radi, double radj) -{ - double area_at_pulloff, Reff_tmp; - - Reff_tmp = radi * radj / (radi + radj); // May not be defined - if (Reff_tmp <= 0) return 0; - - area_at_pulloff = cbrt(9.0 * MY_PI * cohesion * Reff_tmp * Reff_tmp / (4.0 * Emix)); - return area_at_pulloff * area_at_pulloff / Reff_tmp - 2.0 * sqrt(MY_PI * cohesion * area_at_pulloff / Emix); -} - -/* ---------------------------------------------------------------------- */ - -double NormalJKR::calculate_area() -{ - double R2, dR2, t0, t1, t2, t3, t4, t5, t6; - double sqrt1, sqrt2, sqrt3; - - R2 = contact->Reff * contact->Reff; - dR2 = contact->dR * contact->dR; - t0 = cohesion * cohesion * R2 * R2 * Emix; - t1 = PI27SQ * t0; - t2 = 8.0 * contact->dR * dR2 * Emix * Emix * Emix; - t3 = 4.0 * dR2 * Emix; - - // in case sqrt(0) < 0 due to precision issues - sqrt1 = MAX(0, t0 * (t1 + 2.0 * t2)); - t4 = cbrt(t1 + t2 + THREEROOT3 * MY_PI * sqrt(sqrt1)); - t5 = t3 / t4 + t4 / Emix; - sqrt2 = MAX(0, 2.0 * contact->dR + t5); - t6 = sqrt(sqrt2); - sqrt3 = MAX(0, 4.0 * contact->dR - t5 + SIXROOT6 * cohesion * MY_PI * R2 / (Emix * t6)); - - return INVROOT6 * (t6 + sqrt(sqrt3)); -} - -/* ---------------------------------------------------------------------- */ - -double NormalJKR::calculate_forces() -{ - double a2; - a2 = contact->area * contact->area; - Fne = knfac * a2 / contact->Reff - MY_2PI * a2 * sqrt(4.0 * cohesion * Emix / (MY_PI * contact->area)); - F_pulloff = 3.0 * MY_PI * cohesion * contact->Reff; - - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -void NormalJKR::set_knfac() -{ - knfac = k * contact->area; -} - -/* ---------------------------------------------------------------------- */ - -void NormalJKR::set_fncrit() -{ - Fncrit = fabs(Fne + 2.0 * F_pulloff); -} diff --git a/src/contact_normal_models.h b/src/contact_normal_models.h deleted file mode 100644 index 8159a4c620..0000000000 --- a/src/contact_normal_models.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef CONTACT_NORMAL_MODELS_H_ -#define CONTACT_NORMAL_MODELS_H_ - -#include "contact_sub_models.h" - -namespace LAMMPS_NS { -namespace Contact { - -class NormalModel : public SubModel { - public: - NormalModel(class LAMMPS *); - ~NormalModel() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; - virtual bool touch(); - virtual double pulloff_distance(double, double); - virtual double calculate_area(); - virtual void set_knfac() = 0; - virtual double calculate_forces() = 0; - virtual void set_fncrit(); - double damp; // Vestigial argument needed by damping - double Emod, poiss; - double Fncrit, Fne, knfac; - int material_properties; -}; - -/* ---------------------------------------------------------------------- */ - -class NormalNone : public NormalModel { - public: - NormalNone(class LAMMPS *); - void set_knfac() {}; - double calculate_forces(); -}; - -/* ---------------------------------------------------------------------- */ - -class NormalHooke : public NormalModel { - public: - NormalHooke(class LAMMPS *); - void coeffs_to_local() override; - void set_knfac(); - double calculate_forces(); - protected: - double k; -}; - -/* ---------------------------------------------------------------------- */ - -class NormalHertz : public NormalModel { - public: - NormalHertz(class LAMMPS *); - void coeffs_to_local() override; - void set_knfac(); - double calculate_forces(); - protected: - double k; -}; - -/* ---------------------------------------------------------------------- */ - -class NormalHertzMaterial : public NormalHertz { - public: - NormalHertzMaterial(class LAMMPS *); - void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; -}; - -/* ---------------------------------------------------------------------- */ - -class NormalDMT : public NormalModel { - public: - NormalDMT(class LAMMPS *); - void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; - void set_knfac(); - double calculate_forces(); - void set_fncrit() override; - protected: - double k, cohesion; - double F_pulloff; -}; - -/* ---------------------------------------------------------------------- */ - -class NormalJKR : public NormalModel { - public: - NormalJKR(class LAMMPS *); - void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; - bool touch() override; - double pulloff_distance(double, double) override; - double calculate_area() override; - void set_knfac(); - double calculate_forces(); - void set_fncrit() override; - protected: - double k, cohesion; - double Emix, F_pulloff; -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif /*CONTACT_NORMAL_MODELS_H_ */ diff --git a/src/contact_rolling_models.cpp b/src/contact_rolling_models.cpp deleted file mode 100644 index 3ee80c0e48..0000000000 --- a/src/contact_rolling_models.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "contact_normal_models.h" -#include "contact_rolling_models.h" -#include "contact.h" -#include "error.h" -#include "math_const.h" -#include "math_extra.h" - -using namespace LAMMPS_NS; -using namespace Contact; -using namespace MathConst; -using namespace MathExtra; - -/* ---------------------------------------------------------------------- - Default rolling friction model -------------------------------------------------------------------------- */ - -RollingModel::RollingModel(LAMMPS *lmp) : SubModel(lmp) {} - -/* ---------------------------------------------------------------------- - No model -------------------------------------------------------------------------- */ - -RollingNone::RollingNone(LAMMPS *lmp) : RollingModel(lmp) {} - -/* ---------------------------------------------------------------------- - SDS rolling friction model -------------------------------------------------------------------------- */ - -RollingSDS::RollingSDS(LAMMPS *lmp) : RollingModel(lmp) -{ - num_coeffs = 3; - size_history = 3; -} - -/* ---------------------------------------------------------------------- */ - -void RollingSDS::coeffs_to_local() -{ - k = coeffs[0]; - gamma = coeffs[1]; - mu = coeffs[2]; - - if (k < 0.0 || mu < 0.0 || gamma < 0.0) - error->all(FLERR, "Illegal SDS rolling model"); -} - -/* ---------------------------------------------------------------------- */ - -void RollingSDS::calculate_forces() -{ - int rhist0, rhist1, rhist2, frameupdate; - double Frcrit, rolldotn, rollmag, prjmag, magfr, hist_temp[3], scalefac, temp_array[3]; - double k_inv, magfr_inv; - - rhist0 = history_index; - rhist1 = rhist0 + 1; - rhist2 = rhist1 + 1; - - Frcrit = mu * contact->normal_model->Fncrit; - - if (contact->history_update) { - hist_temp[0] = contact->history[rhist0]; - hist_temp[1] = contact->history[rhist1]; - hist_temp[2] = contact->history[rhist2]; - rolldotn = dot3(hist_temp, contact->nx); - - frameupdate = (fabs(rolldotn) * k) > (EPSILON * Frcrit); - if (frameupdate) { // rotate into tangential plane - rollmag = len3(hist_temp); - // projection - scale3(rolldotn, contact->nx, temp_array); - sub3(hist_temp, temp_array, hist_temp); - - // also rescale to preserve magnitude - prjmag = len3(hist_temp); - if (prjmag > 0) scalefac = rollmag / prjmag; - else scalefac = 0; - scale3(scalefac, hist_temp); - } - scale3(contact->dt, contact->vrl, temp_array); - add3(hist_temp, temp_array, hist_temp); - } - - scaleadd3(-k, hist_temp, -gamma, contact->vrl, contact->fr); - - // rescale frictional displacements and forces if needed - magfr = len3(contact->fr); - if (magfr > Frcrit) { - rollmag = len3(hist_temp); - if (rollmag != 0.0) { - k_inv = 1.0 / k; - magfr_inv = 1.0 / magfr; - scale3(-Frcrit * k_inv * magfr_inv, contact->fr, hist_temp); - scale3(-gamma * k_inv, contact->vrl, temp_array); - add3(hist_temp, temp_array, hist_temp); - - scale3(Frcrit * magfr_inv, contact->fr); - } else { - zero3(contact->fr); - } - } - - if (contact->history_update) { - contact->history[rhist0] = hist_temp[0]; - contact->history[rhist1] = hist_temp[1]; - contact->history[rhist2] = hist_temp[2]; - } -} diff --git a/src/contact_rolling_models.h b/src/contact_rolling_models.h deleted file mode 100644 index f5af08c1b0..0000000000 --- a/src/contact_rolling_models.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef CONTACT_ROLLING_MODELS_H_ -#define CONTACT_ROLLING_MODELS_H_ - -#include "contact_sub_models.h" - -namespace LAMMPS_NS { -namespace Contact { - -class RollingModel : public SubModel { - public: - RollingModel(class LAMMPS *); - ~RollingModel() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; - virtual void calculate_forces() = 0; -}; - -/* ---------------------------------------------------------------------- */ - -class RollingNone : public RollingModel { - public: - RollingNone(class LAMMPS *); - void calculate_forces() {}; -}; - -/* ---------------------------------------------------------------------- */ - -class RollingSDS : public RollingModel { - public: - RollingSDS(class LAMMPS *); - void coeffs_to_local() override; - void calculate_forces(); - protected: - double k, mu, gamma; -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif /*CONTACT_ROLLING_MODELS_H_ */ diff --git a/src/contact_sub_models.cpp b/src/contact_sub_models.cpp deleted file mode 100644 index 1c9fe6b4f5..0000000000 --- a/src/contact_sub_models.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. --------------------------------------------------------------------------*/ - -/* ---------------------------------------------------------------------- - This class contains a framework for normal, damping, tangential, - rolling, twisting, and heat models used to calculate forces - and torques based on contact geometry - - Contributing authors: - Dan Bolintineanu (SNL), Joel Clemmer (SNL) ------------------------------------------------------------------------ */ - -#include "contact_sub_models.h" -#include "error.h" -#include "utils.h" - -using namespace LAMMPS_NS; -using namespace Contact; - -/* ---------------------------------------------------------------------- - Parent class for all types of contact forces -------------------------------------------------------------------------- */ - -SubModel::SubModel(LAMMPS *lmp) : Pointers(lmp) -{ - allocated = 0; - size_history = 0; - history_index = 0; - allow_limit_damping = 1; - beyond_contact = 0; - num_coeffs = 0; - - nondefault_history_transfer = 0; - transfer_history_factor = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -SubModel::~SubModel() -{ - if (allocated) delete [] coeffs; - delete [] transfer_history_factor; -} - -/* ---------------------------------------------------------------------- */ - -void SubModel::allocate_coeffs() -{ - allocated = 1; - coeffs = new double[num_coeffs]; -} - -/* ---------------------------------------------------------------------- */ - -int SubModel::parse_coeffs(char **arg, int iarg, int narg) -{ - if (iarg + num_coeffs > narg) - error->all(FLERR, "Insufficient arguments provided for {} model", name); - for (int i = 0; i < num_coeffs; i++) { - // A few parameters (eg.g kt for tangential mindlin) allow null - if (strcmp(arg[iarg+i], "NULL") == 0) coeffs[i] = -1; - else coeffs[i] = utils::numeric(FLERR,arg[iarg+i],false,lmp); - } - coeffs_to_local(); - - return iarg + num_coeffs; -} - -/* ---------------------------------------------------------------------- */ - -void SubModel::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - for (int i = 0; i < num_coeffs; i++) - coeffs[i] = mix_geom(icoeffs[i], jcoeffs[i]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- - mixing of Young's modulus (E) -------------------------------------------------------------------------- */ - -double SubModel::mix_stiffnessE(double E1, double E2, - double pois1, double pois2) -{ - double factor1 = (1 - pois1 * pois1) / E1; - double factor2 = (1 - pois2 * pois2) / E2; - return 1 / (factor1 + factor2); -} - -/* ---------------------------------------------------------------------- - mixing of shear modulus (G) ------------------------------------------------------------------------- */ - -double SubModel::mix_stiffnessG(double E1, double E2, - double pois1, double pois2) -{ - double factor1 = 2 * (2 - pois1) * (1 + pois1) / E1; - double factor2 = 2 * (2 - pois2) * (1 + pois2) / E2; - return 1 / (factor1 + factor2); -} - -/* ---------------------------------------------------------------------- - mixing of Young's modulus (E) for walls -------------------------------------------------------------------------- */ - -double SubModel::mix_stiffnessE_wall(double E, double pois) -{ - double factor = 2 * (1 - pois); - return E / factor; -} - -/* ---------------------------------------------------------------------- - mixing of shear modulus (G) for walls ------------------------------------------------------------------------- */ - -double SubModel::mix_stiffnessG_wall(double E, double pois) -{ - double factor = 32.0 * (2 - pois) * (1 + pois); - return E / factor; -} - -/* ---------------------------------------------------------------------- - mixing of everything else -------------------------------------------------------------------------- */ - -double SubModel::mix_geom(double val1, double val2) -{ - return sqrt(val1 * val2); -} diff --git a/src/contact_sub_models.h b/src/contact_sub_models.h deleted file mode 100644 index 0f577bf08e..0000000000 --- a/src/contact_sub_models.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef CONTACT_SUB_MODEL_H_ -#define CONTACT_SUB_MODEL_H_ - -#include "contact.h" -#include "pointers.h" // IWYU pragma: export - -namespace LAMMPS_NS { -namespace Contact { - -class SubModel : protected Pointers { - public: - SubModel(class LAMMPS *); - virtual ~SubModel(); - - int num_coeffs; - double *coeffs; - void read_restart(); - int parse_coeffs(char **, int, int); - virtual void mix_coeffs(double*, double*); - virtual void coeffs_to_local() = 0; - virtual void init() = 0; // called after all other submodel coeffs defined - - void allocate_coeffs(); - std::string name; - - int size_history; - int nondefault_history_transfer; - double *transfer_history_factor; - - int history_index; - int beyond_contact; - int allow_limit_damping; - - ContactModel *contact; - - protected: - int allocated; - - double mix_stiffnessE(double, double, double, double); - double mix_stiffnessG(double, double, double, double); - double mix_stiffnessE_wall(double, double); - double mix_stiffnessG_wall(double, double); - double mix_geom(double, double); -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif /* CONTACT_SUB_MODEL_H_ */ diff --git a/src/contact_tangential_models.cpp b/src/contact_tangential_models.cpp deleted file mode 100644 index ca95d1d00b..0000000000 --- a/src/contact_tangential_models.cpp +++ /dev/null @@ -1,412 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "contact_damping_models.h" -#include "contact_normal_models.h" -#include "contact_tangential_models.h" -#include "contact.h" -#include "error.h" -#include "math_const.h" -#include "math_extra.h" - -using namespace LAMMPS_NS; -using namespace Contact; -using namespace MathConst; -using namespace MathExtra; - -/* ---------------------------------------------------------------------- - Default model -------------------------------------------------------------------------- */ - -TangentialModel::TangentialModel(LAMMPS *lmp) : SubModel(lmp) {} - -/* ---------------------------------------------------------------------- - No model -------------------------------------------------------------------------- */ - -TangentialNone::TangentialNone(LAMMPS *lmp) : TangentialModel(lmp) {} - -/* ---------------------------------------------------------------------- - Linear model with no history -------------------------------------------------------------------------- */ - -TangentialLinearNoHistory::TangentialLinearNoHistory(LAMMPS *lmp) : TangentialModel(lmp) -{ - num_coeffs = 2; - size_history = 3; -} - -/* ---------------------------------------------------------------------- */ - -void TangentialLinearNoHistory::coeffs_to_local() -{ - k = 0.0; // No tangential stiffness with no history - xt = coeffs[0]; - mu = coeffs[1]; - - if (k < 0.0 || xt < 0.0 || mu < 0.0) - error->all(FLERR, "Illegal linear no history tangential model"); -} - -/* ---------------------------------------------------------------------- */ - -void TangentialLinearNoHistory::calculate_forces() -{ - // classic pair gran/hooke (no history) - damp = xt * contact->damping_model->damp_prefactor; - - double Fscrit = mu * contact->normal_model->Fncrit; - double fsmag = damp * contact->vrel; - - double Ft; - if (contact->vrel != 0.0) Ft = MIN(Fscrit, fsmag) / contact->vrel; - else Ft = 0.0; - - scale3(-Ft, contact->vtr, contact->fs); -} - -/* ---------------------------------------------------------------------- - Linear model with history -------------------------------------------------------------------------- */ - -TangentialLinearHistory::TangentialLinearHistory(LAMMPS *lmp) : TangentialModel(lmp) -{ - num_coeffs = 3; - size_history = 3; -} - -/* ---------------------------------------------------------------------- */ - -void TangentialLinearHistory::coeffs_to_local() -{ - k = coeffs[0]; - xt = coeffs[1]; - mu = coeffs[2]; - - if (k < 0.0 || xt < 0.0 || mu < 0.0) - error->all(FLERR, "Illegal linear tangential model"); -} - -/* ---------------------------------------------------------------------- */ - -void TangentialLinearHistory::calculate_forces() -{ - // Note: this is the same as the base Mindlin calculation except k isn't scaled by area - double magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; - int frame_update = 0; - - damp = xt * contact->damping_model->damp_prefactor; - - double Fscrit = contact->normal_model->Fncrit * mu; - double *history = & contact->history[history_index]; - - // rotate and update displacements / force. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (contact->history_update) { - rsht = dot3(history, contact->nx); - frame_update = (fabs(rsht) * k) > (EPSILON * Fscrit); - - if (frame_update) { - shrmag = len3(history); - - // projection - scale3(rsht, contact->nx, temp_array); - sub3(history, temp_array, history); - - // also rescale to preserve magnitude - prjmag = len3(history); - if (prjmag > 0) temp_dbl = shrmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, history); - } - - // update history, tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - scale3(contact->dt, contact->vtr, temp_array); - add3(history, temp_array, history); - } - - - // tangential forces = history + tangential velocity damping - scale3(-k, history, contact->fs); - scale3(damp, contact->vtr, temp_array); - sub3(contact->fs, temp_array, contact->fs); - - // rescale frictional displacements and forces if needed - magfs = len3(contact->fs); - if (magfs > Fscrit) { - shrmag = len3(history); - if (shrmag != 0.0) { - magfs_inv = 1.0 / magfs; - scale3(Fscrit * magfs_inv, contact->fs, history); - scale3(damp, contact->vtr, temp_array); - add3(history, temp_array, history); - scale3(-1.0 / k, history); - scale3(Fscrit * magfs_inv, contact->fs); - } else { - zero3(contact->fs); - } - } -} - -/* ---------------------------------------------------------------------- - Linear model with history from pair gran/hooke/history -------------------------------------------------------------------------- */ - -TangentialLinearHistoryClassic::TangentialLinearHistoryClassic(LAMMPS *lmp) : TangentialLinearHistory(lmp) -{ - scale_area = 0; // Sets gran/hooke/history behavior -} - -/* ---------------------------------------------------------------------- */ - -void TangentialLinearHistoryClassic::calculate_forces() -{ - double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; - double temp_array[3]; - int frame_update = 0; - - k_scaled = k; - if (scale_area) k_scaled *= contact->area; - - damp = xt * contact->damping_model->damp_prefactor; - - double Fscrit = contact->normal_model->Fncrit * mu; - double *history = & contact->history[history_index]; - - // update history - if (contact->history_update) { - scale3(contact->dt, contact->vtr, temp_array); - add3(history, temp_array, history); - } - - shrmag = len3(history); - - // rotate shear displacements - if (contact->history_update) { - rsht = dot3(history, contact->nx); - scale3(rsht, contact->nx, temp_array); - sub3(history, temp_array, history); - } - - // tangential forces = history + tangential velocity damping - scale3(-k_scaled, history, contact->fs); - scale3(damp, contact->vtr, temp_array); - sub3(contact->fs, temp_array, contact->fs); - - // rescale frictional displacements and forces if needed - magfs = len3(contact->fs); - if (magfs > Fscrit) { - if (shrmag != 0.0) { - magfs_inv = 1.0 / magfs; - scale3(Fscrit * magfs_inv, contact->fs, history); - scale3(damp, contact->vtr, temp_array); - add3(history, temp_array, history); - temp_dbl = -1.0 / k_scaled; - if (scale_area) temp_dbl /= contact->area; - scale3(temp_dbl, history); - scale3(Fscrit * magfs_inv, contact->fs); - } else { - zero3(contact->fs); - } - } -} - -/* ---------------------------------------------------------------------- - Mindlin from pair gran/hertz/history -------------------------------------------------------------------------- */ - -TangentialMindlinClassic::TangentialMindlinClassic(LAMMPS *lmp) : TangentialLinearHistoryClassic(lmp) -{ - scale_area = 1; // Sets gran/hertz/history behavior -} - -/* ---------------------------------------------------------------------- - Mindlin model -------------------------------------------------------------------------- */ - -TangentialMindlin::TangentialMindlin(LAMMPS *lmp) : TangentialModel(lmp) -{ - num_coeffs = 3; - size_history = 3; - mindlin_force = 0; - mindlin_rescale = 0; -} - -/* ---------------------------------------------------------------------- */ - -void TangentialMindlin::coeffs_to_local() -{ - k = coeffs[0]; - xt = coeffs[1]; - mu = coeffs[2]; - - if (k == -1) { - if (!contact->normal_model->material_properties) - error->all(FLERR, "Must either specify tangential stiffness or material properties for normal model for the Mindlin tangential style"); - - double Emod = contact->normal_model->Emod; - double poiss = contact->normal_model->poiss; - - if (contact->contact_type == PAIR) { - k = 8.0 * mix_stiffnessG(Emod, Emod, poiss, poiss); - } else { - k = 8.0 * mix_stiffnessG_wall(Emod, poiss); - } - } - - if (k < 0.0 || xt < 0.0 || mu < 0.0) - error->all(FLERR, "Illegal Mindlin tangential model"); -} - -/* ---------------------------------------------------------------------- */ - -void TangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) -{ - if (icoeffs[0] == -1 || jcoeffs[0] == -1) coeffs[0] = -1; - else coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); - coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); - coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); - coeffs_to_local(); -} - -/* ---------------------------------------------------------------------- */ - -void TangentialMindlin::calculate_forces() -{ - double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; - double temp_array[3]; - int frame_update = 0; - - damp = xt * contact->damping_model->damp_prefactor; - - double *history = & contact->history[history_index]; - double Fscrit = contact->normal_model->Fncrit * mu; - - k_scaled = k * contact->area; - - // on unloading, rescale the shear displacements/force - if (mindlin_rescale) - if (contact->area < history[3]) - scale3(contact->area / history[3], history); - - // rotate and update displacements / force. - // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 - if (contact->history_update) { - rsht = dot3(history, contact->nx); - if (mindlin_force) { - frame_update = fabs(rsht) > (EPSILON * Fscrit); - } else { - frame_update = (fabs(rsht) * k_scaled) > (EPSILON * Fscrit); - } - - if (frame_update) { - shrmag = len3(history); - // projection - scale3(rsht, contact->nx, temp_array); - sub3(history, temp_array, history); - // also rescale to preserve magnitude - prjmag = len3(history); - if (prjmag > 0) temp_dbl = shrmag / prjmag; - else temp_dbl = 0; - scale3(temp_dbl, history); - } - - // update history - if (mindlin_force) { - // tangential force - // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 - scale3(-k_scaled * contact->dt, contact->vtr, temp_array); - } else { - scale3(contact->dt, contact->vtr, temp_array); - } - add3(history, temp_array, history); - - if (mindlin_rescale) history[3] = contact->area; - } - - // tangential forces = history + tangential velocity damping - scale3(-damp, contact->vtr, contact->fs); - - if (!mindlin_force) { - scale3(k_scaled, history, temp_array); - sub3(contact->fs, temp_array, contact->fs); - } else { - add3(contact->fs, history, contact->fs); - } - - // rescale frictional displacements and forces if needed - magfs = len3(contact->fs); - if (magfs > Fscrit) { - shrmag = len3(history); - if (shrmag != 0.0) { - magfs_inv = 1.0 / magfs; - scale3(Fscrit * magfs_inv, contact->fs, history); - scale3(damp, contact->vtr, temp_array); - add3(history, temp_array, history); - - if (!mindlin_force) - scale3(-1.0 / k_scaled, history); - - scale3(Fscrit * magfs_inv, contact->fs); - } else { - zero3(contact->fs); - } - } -} - -/* ---------------------------------------------------------------------- - Mindlin force model -------------------------------------------------------------------------- */ - -TangentialMindlinForce::TangentialMindlinForce(LAMMPS *lmp) : TangentialMindlin(lmp) -{ - num_coeffs = 3; - size_history = 3; - mindlin_force = 1; - mindlin_rescale = 0; -} - -/* ---------------------------------------------------------------------- - Mindlin rescale model -------------------------------------------------------------------------- */ - -TangentialMindlinRescale::TangentialMindlinRescale(LAMMPS *lmp) : TangentialMindlin(lmp) -{ - num_coeffs = 3; - size_history = 4; - mindlin_force = 0; - mindlin_rescale = 1; - - nondefault_history_transfer = 1; - transfer_history_factor = new double[size_history]; - for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; - transfer_history_factor[3] = +1; -} - -/* ---------------------------------------------------------------------- - Mindlin rescale force model -------------------------------------------------------------------------- */ - -TangentialMindlinRescaleForce::TangentialMindlinRescaleForce(LAMMPS *lmp) : TangentialMindlin(lmp) -{ - num_coeffs = 3; - size_history = 4; - mindlin_force = 1; - mindlin_rescale = 1; - - nondefault_history_transfer = 1; - transfer_history_factor = new double[size_history]; - for (int i = 0; i < size_history; i++) transfer_history_factor[i] = -1.0; - transfer_history_factor[3] = +1; -} diff --git a/src/contact_tangential_models.h b/src/contact_tangential_models.h deleted file mode 100644 index a54d03c495..0000000000 --- a/src/contact_tangential_models.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef CONTACT_TANGENTIAL_MODELS_H_ -#define CONTACT_TANGENTIAL_MODELS_H_ - -#include "contact_sub_models.h" - -namespace LAMMPS_NS { -namespace Contact { - -class TangentialModel : public SubModel { - public: - TangentialModel(class LAMMPS *); - virtual ~TangentialModel() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; - virtual void calculate_forces() = 0; - int rescale_flag; - double k, damp, mu; // Used by Marshall twisting model - protected: - double xt; -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialNone : public TangentialModel { - public: - TangentialNone(class LAMMPS *); - void calculate_forces() {}; -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialLinearNoHistory : public TangentialModel { - public: - TangentialLinearNoHistory(class LAMMPS *); - void coeffs_to_local() override; - void calculate_forces(); -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialLinearHistory : public TangentialModel { - public: - TangentialLinearHistory(class LAMMPS *); - void coeffs_to_local() override; - void calculate_forces(); -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialLinearHistoryClassic : public TangentialLinearHistory { - public: - TangentialLinearHistoryClassic(class LAMMPS *); - void calculate_forces(); - int scale_area; -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialMindlinClassic : public TangentialLinearHistoryClassic { - public: - TangentialMindlinClassic(class LAMMPS *); -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialMindlin : public TangentialModel { - public: - TangentialMindlin(class LAMMPS *); - void coeffs_to_local() override; - void mix_coeffs(double*, double*) override; - void calculate_forces(); - protected: - int mindlin_rescale, mindlin_force; -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialMindlinForce : public TangentialMindlin { - public: - TangentialMindlinForce(class LAMMPS *); -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialMindlinRescale : public TangentialMindlin { - public: - TangentialMindlinRescale(class LAMMPS *); -}; - -/* ---------------------------------------------------------------------- */ - -class TangentialMindlinRescaleForce : public TangentialMindlin { - public: - TangentialMindlinRescaleForce(class LAMMPS *); -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif /*CONTACT_TANGENTIAL_MODELS_H_ */ diff --git a/src/contact_twisting_models.cpp b/src/contact_twisting_models.cpp deleted file mode 100644 index 94a88161f3..0000000000 --- a/src/contact_twisting_models.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "contact_normal_models.h" -#include "contact_tangential_models.h" -#include "contact_twisting_models.h" -#include "contact.h" -#include "error.h" -#include "math_const.h" - -using namespace LAMMPS_NS; -using namespace Contact; -using namespace MathConst; - -/* ---------------------------------------------------------------------- - Default twisting model -------------------------------------------------------------------------- */ - -TwistingModel::TwistingModel(LAMMPS *lmp) : SubModel(lmp) {} - -/* ---------------------------------------------------------------------- - No model -------------------------------------------------------------------------- */ - -TwistingNone::TwistingNone(LAMMPS *lmp) : TwistingModel(lmp) {} - -/* ---------------------------------------------------------------------- - Marshall twisting model -------------------------------------------------------------------------- */ - -TwistingMarshall::TwistingMarshall(LAMMPS *lmp) : TwistingModel(lmp) -{ - num_coeffs = 0; - size_history = 3; -} - -/* ---------------------------------------------------------------------- */ - - -void TwistingMarshall::init() -{ - k_tang = contact->tangential_model->k; - mu_tang = contact->tangential_model->mu; -} - -/* ---------------------------------------------------------------------- */ - -void TwistingMarshall::calculate_forces() -{ - double signtwist, Mtcrit; - - // Calculate twist coefficients from tangential model & contact geometry - // eq 32 of Marshall paper - double k = 0.5 * k_tang * contact->area * contact->area; - double damp = 0.5 * contact->tangential_model->damp * contact->area * contact->area; - double mu = TWOTHIRDS * mu_tang * contact->area; - - if (contact->history_update) { - contact->history[history_index] += contact->magtwist * contact->dt; - } - - // M_t torque (eq 30) - contact->magtortwist = -k * contact->history[history_index] - damp * contact->magtwist; - signtwist = (contact->magtwist > 0) - (contact->magtwist < 0); - Mtcrit = mu * contact->normal_model->Fncrit; // critical torque (eq 44) - - if (fabs(contact->magtortwist) > Mtcrit) { - contact->history[history_index] = (Mtcrit * signtwist - damp * contact->magtwist) / k; - contact->magtortwist = -Mtcrit * signtwist; // eq 34 - } -} - -/* ---------------------------------------------------------------------- - SDS twisting model -------------------------------------------------------------------------- */ - -TwistingSDS::TwistingSDS(LAMMPS *lmp) : TwistingModel(lmp) -{ - num_coeffs = 3; - size_history = 3; -} - -/* ---------------------------------------------------------------------- */ - -void TwistingSDS::coeffs_to_local() -{ - k = coeffs[0]; - damp = coeffs[1]; - mu = coeffs[2]; - - if (k < 0.0 || mu < 0.0 || damp < 0.0) - error->all(FLERR, "Illegal SDS twisting model"); -} - -/* ---------------------------------------------------------------------- */ - -void TwistingSDS::calculate_forces() -{ - double signtwist, Mtcrit; - - if (contact->history_update) { - contact->history[history_index] += contact->magtwist * contact->dt; - } - - // M_t torque (eq 30) - contact->magtortwist = -k * contact->history[history_index] - damp * contact->magtwist; - signtwist = (contact->magtwist > 0) - (contact->magtwist < 0); - Mtcrit = mu * contact->normal_model->Fncrit; // critical torque (eq 44) - - if (fabs(contact->magtortwist) > Mtcrit) { - contact->history[history_index] = (Mtcrit * signtwist - damp * contact->magtwist) / k; - contact->magtortwist = -Mtcrit * signtwist; // eq 34 - } -} diff --git a/src/contact_twisting_models.h b/src/contact_twisting_models.h deleted file mode 100644 index 1fa5aa2c6a..0000000000 --- a/src/contact_twisting_models.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef CONTACT_TWISTING_MODELS_H_ -#define CONTACT_TWISTING_MODELS_H_ - -#include "contact_sub_models.h" - -namespace LAMMPS_NS { -namespace Contact { - -class TwistingModel : public SubModel { - public: - TwistingModel(class LAMMPS *); - virtual ~TwistingModel() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; - virtual void calculate_forces() = 0; -}; - -/* ---------------------------------------------------------------------- */ - -class TwistingNone : public TwistingModel { - public: - TwistingNone(class LAMMPS *); - void calculate_forces() {}; -}; - -/* ---------------------------------------------------------------------- */ - -class TwistingMarshall : public TwistingModel { - public: - TwistingMarshall(class LAMMPS *); - void calculate_forces(); - void init(); - protected: - double k_tang, mu_tang; -}; - -/* ---------------------------------------------------------------------- */ - -class TwistingSDS : public TwistingModel { - public: - TwistingSDS(class LAMMPS *); - void coeffs_to_local() override; - void calculate_forces(); - protected: - double k, mu, damp; -}; - -} // namespace Contact -} // namespace LAMMPS_NS - -#endif /*CONTACT_TWISTING_MODELS_H_ */ diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index cc4fdbe20b..f5b86b6069 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -41,7 +41,7 @@ enum{ID,MOL,PROC,PROCP1,TYPE,ELEMENT,MASS, XSU,YSU,ZSU,XSUTRI,YSUTRI,ZSUTRI, IX,IY,IZ, VX,VY,VZ,FX,FY,FZ, - Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER,heatflow,TEMPERATURE, + Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER,HEATFLOW,TEMPERATURE, OMEGAX,OMEGAY,OMEGAZ,ANGMOMX,ANGMOMY,ANGMOMZ, TQX,TQY,TQZ, COMPUTE,FIX,VARIABLE,IVEC,DVEC,IARRAY,DARRAY}; @@ -930,7 +930,7 @@ int DumpCustom::count() for (i = 0; i < nlocal; i++) dchoose[i] = 2.0*radius[i]; ptr = dchoose; nstride = 1; - } else if (thresh_array[ithresh] == heatflow) { + } else if (thresh_array[ithresh] == HEATFLOW) { if (!atom->heatflow_flag) error->all(FLERR, "Threshold for an atom property that isn't allocated"); @@ -1867,7 +1867,7 @@ int DumpCustom::modify_param(int narg, char **arg) else if (strcmp(arg[1],"radius") == 0) thresh_array[nthresh] = RADIUS; else if (strcmp(arg[1],"diameter") == 0) thresh_array[nthresh] = DIAMETER; - else if (strcmp(arg[1],"heatflow") == 0) thresh_array[nthresh] = heatflow; + else if (strcmp(arg[1],"heatflow") == 0) thresh_array[nthresh] = HEATFLOW; else if (strcmp(arg[1],"temperature") == 0) thresh_array[nthresh] = TEMPERATURE; else if (strcmp(arg[1],"omegax") == 0) thresh_array[nthresh] = OMEGAX; else if (strcmp(arg[1],"omegay") == 0) thresh_array[nthresh] = OMEGAY; From 5dcbbc084ba0c42f8ed2be3f0f07ac6b9f575cb6 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 1 Nov 2022 13:30:24 -0600 Subject: [PATCH 033/112] Adding developers documentation page --- doc/src/Howto_granular.rst | 11 +++ doc/src/Modify_gsm.rst | 183 +++++++++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 doc/src/Modify_gsm.rst diff --git a/doc/src/Howto_granular.rst b/doc/src/Howto_granular.rst index 9492e5755e..af52904204 100644 --- a/doc/src/Howto_granular.rst +++ b/doc/src/Howto_granular.rst @@ -43,6 +43,14 @@ The fix style *freeze* zeroes both the force and torque of frozen atoms, and should be used for granular system instead of the fix style *setforce*\ . +To model heat conduction, one must use the atom style: +* :doc:`atom_style sphere/temp ` +a temperature integration fix +* :doc:`fix temp/integrate ` +and a heat conduction option defined in both +* :doc:`pair_style granular ` +* :doc:`fix wall/gran ` + For computational efficiency, you can eliminate needless pairwise computations between frozen atoms by using this command: @@ -55,3 +63,6 @@ computations between frozen atoms by using this command: will be the same as in 3d. If you wish to model granular particles in 2d as 2d discs, see the note on this topic on the :doc:`Howto 2d ` doc page, where 2d simulations are discussed. + +To add custom granular contact models, see the +:doc:`modifying granular submodels page `. diff --git a/doc/src/Modify_gsm.rst b/doc/src/Modify_gsm.rst new file mode 100644 index 0000000000..06172b4dec --- /dev/null +++ b/doc/src/Modify_gsm.rst @@ -0,0 +1,183 @@ +Granular Submodel (GSM) styles +=========== + +In granular models, particles are spheres with a finite radius and rotational +degrees of freedom as further described in the +:doc:`Howto granular page `. Interactions between pair of +particles or particles and walls may therefore depend on many different modes +of motion as described in :doc:`pair granular ` and +:doc:`fix wall/gran `. In both cases, the exchange of forces, +torques, and heat flow between two types of bodies is defined using a +GranularModel class. The GranularModel class organizes the details of an +interaction using a series of granular submodels each of which describe a +particular interaction mode (e.g. normal forces or rolling friction). From a +parent GSM class, several types of submodel classes are derived: + +* GSMNormal: normal force submodel +* GSMDamping: normal damping submodel +* GSMTangential: tangential forces and sliding friction submodel +* GSMRolling: rolling friction submodel +* GSMTwisting: twisting friction submodel +* GSMHeat: heat conduction submodel + +For each type of submodel, more classes are further derived, each describing +a specific implementation. For instance, from the GSMNormal class the +GSMNormalHooke, GSMNormalHertz, and GSMNormalJKR classes are derived which +calculate Hookean, Hertzian, or JKR normal forces, respectively. This modular +structure simplifies the addition of new granualar contact models as as one only +needs to create a new GSM class without having to modify the more complex +PairGranular, FixGranWall, and GranularModel classes. Most GSM methods are also +already defined by the parent classes so new contact models typically only require +edits to a few relevant methods (e.g. methods that define coefficients and +calculate forces). + +Each GSM class has a pointer to both the LAMMPS class and the GranularModel +class which owns it, ``lmp`` and ``gm``, respectively. The GranularModel class +includes several public variables that describe the geometry/dynamics of the +contact such as + +.. list-table:: + + * - ``xi`` and ``xj`` + - Positions of the two contacting bodies + * - ``vi`` and ``vj`` + - Velocities of the two contacting bodies + * - ``omegai`` and ``omegaj`` + - Angular velocities of the two contacting bodies + * - ``dx`` and ``nx`` + - The displacement and normalized displacement vectors + * - ``r``, ``rsq``, and ``rinv`` + - The distance, distance squared, and inverse distance + * - ``radsum`` + - The sum of particle radii + * - ``vr``, ``vn``, and ``vt`` + - The relative velocity vector and its normal and tangential components + * - ``wr`` + - The relative rotational velocity + +These quantities, among others, are calculated in the ``GranularModel->check_contact()`` +and ``GranularModel->calculate_forces()`` methods which can be referred to for more +details. + +To create a new GSM class, it is recommended that one first looks at similar GSM +classes. All GSM classes share several general methods which may need to be defined + +.. list-table:: + + * - ``GSM->mix_coeff()`` + - Optional method to define how coefficients are mixed for different atom types. By default, coefficients are mixed using a geometric mean. + * - ``GSM->coeffs_to_local()`` + - Parses coefficients to define local variables, run once at model construction. + * - ``GSM->init()`` + - Optional method to define local variables after other GSM types were created. For instance, this method may be used by a tangential model that derives parameters from the normal stiffness. + +There are also several type-specific methods + +.. list-table:: + + * - ``GSMNormal->touch()`` + - Optional method to test when particles are in contact. By default, this is when particles overlap. + * - ``GSMNormal->pulloff_distance()`` + - Optional method to return the distance at which particles stop interacting. By default, this is when particles no longer overlap. + * - ``GSMNormal->calculate_area()`` + - Optional method to return the surface area of the contact. By default, this returns the geometric cross section. + * - ``GSMNormal->set_fncrit()`` + - Optional method that defines the critical force to break the contact used by some tangential, rolling, and twisting submodels. By default, this is the current total normal force, including damping. + * - ``GSMNormal->calculate_forces()`` + - Required method that returns the normal contact force + * - ``GSMDamping->calculate_forces()`` + - Required method that returns the normal damping force + * - ``GSMTangential->calculate_forces()`` + - Required method that calculates tangential forces/torques + * - ``GSMTwisting->calculate_forces()`` + - Required method that calculates twisting friction forces/torques + * - ``GSMRolling->calculate_forces()`` + - Required method that calculates rolling friction forces/torques + * - ``GSMHeat->calculate_heat()`` + - Required method that returns the rate of heat flow + +As an example, say one wanted to create a new normal force option that consisted +of a Hookean force with a piecewise stiffness. This could be done by adding a new +set of files ``gsm_custom.h``: + +.. code-block:: c++ + + #ifdef GSM_CLASS + // clang-format off + GSMStyle(hooke/piecewise, + GSMNormalHookePiecewise, + NORMAL); + // clang-format on + #else + + #ifndef GSM_CUSTOM_H_ + #define GSM_CUSTOM_H_ + + #include "gsm.h" + #include "gsm_normal.h" + + namespace LAMMPS_NS { + namespace Granular_NS { + + class GSMNormalHookePiecewise : public GSMNormal { + public: + GSMNormalHookePiecewise(class GranularModel *, class LAMMPS *); + void coeffs_to_local() override; + void set_knfac(); + double calculate_forces(); + protected: + double k1, k2, delta_switch; + }; + + } // namespace Granular_NS + } // namespace LAMMPS_NS + + #endif /*GSM_CUSTOM_H_ */ + #endif /*GSM_CLASS_H_ */ + + +and ``gsm_custom.cpp`` + +.. code-block:: c++ + + #include "gsm_custom.h" + #include "gsm_normal.h" + #include "granular_model.h" + + using namespace LAMMPS_NS; + using namespace Granular_NS; + + GSMNormalHookePiecewise::GSMNormalHookePiecewise(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) + { + num_coeffs = 4; + } + + /* ---------------------------------------------------------------------- */ + + void GSMNormalHookePiecewise::coeffs_to_local() + { + k1 = coeffs[0]; + k2 = coeffs[1]; + damp = coeffs[2]; + delta_switch = coeffs[3]; + } + + /* ---------------------------------------------------------------------- */ + + double GSMNormalHookePiecewise::calculate_forces() + { + if (gm->delta >= delta_switch { + Fne = k1 * delta_switch + k2 * (gm->delta - delta_switch); + } else { + Fne = k1 * gm->delta; + } + return Fne; + } + + /* ---------------------------------------------------------------------- */ + + void GSMNormalHookePiecewise::set_knfac() + { + if (gm->delta < delta_switch) knfac = k1; + else knfac = k2; + } From dca901617eb6c177ed3ec362e4d9ac9ba7d0c72a Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 1 Nov 2022 13:30:57 -0600 Subject: [PATCH 034/112] Removing knfac, removing unnecessary global variables, updating dev ref text --- src/GRANULAR/atom_vec_sphere_temp.cpp | 4 +-- src/GRANULAR/atom_vec_sphere_temp.h | 2 +- src/GRANULAR/fix_temp_integrate.cpp | 4 +-- src/GRANULAR/fix_temp_integrate.h | 2 +- src/GRANULAR/granular_model.cpp | 25 +++++++-------- src/GRANULAR/granular_model.h | 4 +-- src/GRANULAR/gsm.cpp | 8 ++--- src/GRANULAR/gsm.h | 4 +-- src/GRANULAR/gsm_damping.cpp | 5 +-- src/GRANULAR/gsm_damping.h | 6 ++-- src/GRANULAR/gsm_heat.cpp | 3 +- src/GRANULAR/gsm_heat.h | 2 +- src/GRANULAR/gsm_normal.cpp | 46 ++++++--------------------- src/GRANULAR/gsm_normal.h | 18 ++++------- src/GRANULAR/gsm_rolling.cpp | 3 +- src/GRANULAR/gsm_rolling.h | 2 +- src/GRANULAR/gsm_tangential.cpp | 4 +-- src/GRANULAR/gsm_tangential.h | 12 ++++--- src/GRANULAR/gsm_twisting.cpp | 3 +- src/GRANULAR/gsm_twisting.h | 2 +- 20 files changed, 66 insertions(+), 93 deletions(-) diff --git a/src/GRANULAR/atom_vec_sphere_temp.cpp b/src/GRANULAR/atom_vec_sphere_temp.cpp index bc3dcb7a2d..283a55e2da 100644 --- a/src/GRANULAR/atom_vec_sphere_temp.cpp +++ b/src/GRANULAR/atom_vec_sphere_temp.cpp @@ -1,7 +1,7 @@ -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/atom_vec_sphere_temp.h b/src/GRANULAR/atom_vec_sphere_temp.h index c93b0ee4dd..de6d5266a5 100644 --- a/src/GRANULAR/atom_vec_sphere_temp.h +++ b/src/GRANULAR/atom_vec_sphere_temp.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/fix_temp_integrate.cpp b/src/GRANULAR/fix_temp_integrate.cpp index e5fbae63dc..ab9739e874 100644 --- a/src/GRANULAR/fix_temp_integrate.cpp +++ b/src/GRANULAR/fix_temp_integrate.cpp @@ -1,8 +1,8 @@ // clang-format off -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/fix_temp_integrate.h b/src/GRANULAR/fix_temp_integrate.h index 738cb28a6f..8356d00433 100644 --- a/src/GRANULAR/fix_temp_integrate.h +++ b/src/GRANULAR/fix_temp_integrate.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index a7aaa1ed83..3f500d0431 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -1,8 +1,8 @@ // clang-format off -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -23,16 +23,11 @@ #include "granular_model.h" #include "gsm.h" -#include "gsm_normal.h" -#include "gsm_tangential.h" -#include "gsm_damping.h" -#include "gsm_rolling.h" -#include "gsm_twisting.h" -#include "gsm_heat.h" #include "comm.h" #include "error.h" #include "force.h" #include "math_extra.h" +#include "style_gsm.h" // IWYU pragma: keep #include @@ -253,10 +248,13 @@ void GranularModel::init() if (sub_models[i]->beyond_contact) beyond_contact = 1; size_history += sub_models[i]->size_history; - if (limit_damping && (!sub_models[i]->allow_limit_damping)) - error->all(FLERR,"Cannot limit damping with {} model", sub_models[i]->name); + if (!sub_models[i]->allow_cohesion && normal_model->cohesive_flag) + error->all(FLERR,"Cannot use {} model with a cohesive normal model, {}", sub_models[i]->name, normal_model->name); } + if (limit_damping && (normal_model->cohesive_flag)) + error->all(FLERR,"Cannot limit damping with a cohesive normal model, {}", normal_model->name); + if (nondefault_history_transfer) { transfer_history_factor = new double[size_history]; @@ -430,13 +428,12 @@ void GranularModel::calculate_forces() // calculate forces/torques forces[0] = 0.0; - double Fne, Fdamp, dist_to_contact; + double Fdamp, dist_to_contact; area = normal_model->calculate_area(); - normal_model->set_knfac(); - Fne = normal_model->calculate_forces(); + Fnormal = normal_model->calculate_forces(); Fdamp = damping_model->calculate_forces(); - Fntot = Fne + Fdamp; + Fntot = Fnormal + Fdamp; if (limit_damping && Fntot < 0.0) Fntot = 0.0; normal_model->set_fncrit(); // Needed for tangential, rolling, twisting diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index afc8f61ddc..b45c916580 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -82,7 +82,7 @@ class GranularModel : protected Pointers { double *history; // Contact properties/output - double forces[3], torquesi[3], torquesj[3], dq; + double Fnormal, forces[3], torquesi[3], torquesj[3], dq; double radi, radj, meff, dt, Ti, Tj, area; double Fntot, magtortwist; diff --git a/src/GRANULAR/gsm.cpp b/src/GRANULAR/gsm.cpp index 6430fb7403..fb0ae48615 100644 --- a/src/GRANULAR/gsm.cpp +++ b/src/GRANULAR/gsm.cpp @@ -1,8 +1,8 @@ // clang-format off -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -10,7 +10,7 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. --------------------------------------------------------------------------*/ +------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- This class contains a framework for granular submodels (GSM) including: @@ -39,7 +39,7 @@ GSM::GSM(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) allocated = 0; size_history = 0; history_index = 0; - allow_limit_damping = 1; + allow_cohesion = 1; beyond_contact = 0; num_coeffs = 0; diff --git a/src/GRANULAR/gsm.h b/src/GRANULAR/gsm.h index b2df6bef2b..4695749d64 100644 --- a/src/GRANULAR/gsm.h +++ b/src/GRANULAR/gsm.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -41,7 +41,7 @@ class GSM : protected Pointers { int history_index; int beyond_contact; - int allow_limit_damping; + int allow_cohesion; GranularModel *gm; diff --git a/src/GRANULAR/gsm_damping.cpp b/src/GRANULAR/gsm_damping.cpp index 9b51651f30..0280f61771 100644 --- a/src/GRANULAR/gsm_damping.cpp +++ b/src/GRANULAR/gsm_damping.cpp @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -108,6 +109,6 @@ void GSMDampingTsuji::init() double GSMDampingTsuji::calculate_forces() { - damp_prefactor = damp * sqrt(gm->meff * gm->normal_model->knfac); + damp_prefactor = damp * sqrt(gm->meff * gm->Fnormal / gm->delta); return -damp_prefactor * gm->vnnr; } diff --git a/src/GRANULAR/gsm_damping.h b/src/GRANULAR/gsm_damping.h index 1904314cdc..75c0f96356 100644 --- a/src/GRANULAR/gsm_damping.h +++ b/src/GRANULAR/gsm_damping.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -52,7 +52,9 @@ class GSMDamping : public GSM { virtual void mix_coeffs(double*, double*) {}; virtual void init(); virtual double calculate_forces() = 0; - double damp, damp_prefactor; + double damp_prefactor; // Used by tangential models + protected: + double damp; }; /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gsm_heat.cpp b/src/GRANULAR/gsm_heat.cpp index 449df5520b..7512e372a0 100644 --- a/src/GRANULAR/gsm_heat.cpp +++ b/src/GRANULAR/gsm_heat.cpp @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/gsm_heat.h b/src/GRANULAR/gsm_heat.h index 4b27979273..c913593f19 100644 --- a/src/GRANULAR/gsm_heat.h +++ b/src/GRANULAR/gsm_heat.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/gsm_normal.cpp b/src/GRANULAR/gsm_normal.cpp index 2b029ece6a..0ae288f6fd 100644 --- a/src/GRANULAR/gsm_normal.cpp +++ b/src/GRANULAR/gsm_normal.cpp @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -35,6 +36,7 @@ using namespace MathConst; GSMNormal::GSMNormal(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) { material_properties = 0; + cohesive_flag = 0; } /* ---------------------------------------------------------------------- */ @@ -103,15 +105,7 @@ void GSMNormalHooke::coeffs_to_local() double GSMNormalHooke::calculate_forces() { - Fne = knfac * gm->delta; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -void GSMNormalHooke::set_knfac() -{ - knfac = k; + return k * gm->delta; } /* ---------------------------------------------------------------------- @@ -137,15 +131,7 @@ void GSMNormalHertz::coeffs_to_local() double GSMNormalHertz::calculate_forces() { - Fne = knfac * gm->delta; - return Fne; -} - -/* ---------------------------------------------------------------------- */ - -void GSMNormalHertz::set_knfac() -{ - knfac = k * gm->area; + return k * gm->area * gm->delta; } /* ---------------------------------------------------------------------- @@ -190,8 +176,8 @@ void GSMNormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) GSMNormalDMT::GSMNormalDMT(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) { - allow_limit_damping = 0; material_properties = 1; + cohesive_flag = 1; num_coeffs = 4; } @@ -227,7 +213,7 @@ void GSMNormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) double GSMNormalDMT::calculate_forces() { - Fne = knfac * gm->delta; + Fne = k * gm->area * gm->delta; F_pulloff = 4.0 * MathConst::MY_PI * cohesion * gm->Reff; Fne -= F_pulloff; return Fne; @@ -235,13 +221,6 @@ double GSMNormalDMT::calculate_forces() /* ---------------------------------------------------------------------- */ -void GSMNormalDMT::set_knfac() -{ - knfac = k * gm->area; -} - -/* ---------------------------------------------------------------------- */ - void GSMNormalDMT::set_fncrit() { Fncrit = fabs(Fne + 2.0 * F_pulloff); @@ -253,8 +232,8 @@ void GSMNormalDMT::set_fncrit() GSMNormalJKR::GSMNormalJKR(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) { - allow_limit_damping = 0; material_properties = 1; + cohesive_flag = 1; beyond_contact = 1; num_coeffs = 4; } @@ -356,7 +335,7 @@ double GSMNormalJKR::calculate_forces() { double a2; a2 = gm->area * gm->area; - Fne = knfac * a2 / gm->Reff - MY_2PI * a2 * sqrt(4.0 * cohesion * Emix / (MY_PI * gm->area)); + Fne = k * gm->area * a2 / gm->Reff - MY_2PI * a2 * sqrt(4.0 * cohesion * Emix / (MY_PI * gm->area)); F_pulloff = 3.0 * MY_PI * cohesion * gm->Reff; return Fne; @@ -364,13 +343,6 @@ double GSMNormalJKR::calculate_forces() /* ---------------------------------------------------------------------- */ -void GSMNormalJKR::set_knfac() -{ - knfac = k * gm->area; -} - -/* ---------------------------------------------------------------------- */ - void GSMNormalJKR::set_fncrit() { Fncrit = fabs(Fne + 2.0 * F_pulloff); diff --git a/src/GRANULAR/gsm_normal.h b/src/GRANULAR/gsm_normal.h index 0c7ba30e41..2d7391f3c8 100644 --- a/src/GRANULAR/gsm_normal.h +++ b/src/GRANULAR/gsm_normal.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -56,13 +56,12 @@ class GSMNormal : public GSM { virtual bool touch(); virtual double pulloff_distance(double, double); virtual double calculate_area(); - virtual void set_knfac() = 0; virtual double calculate_forces() = 0; virtual void set_fncrit(); - double damp; // Vestigial argument needed by damping + double damp; // argument historically needed by damping double Emod, poiss; - double Fncrit, Fne, knfac; - int material_properties; + double Fncrit, knfac; + int material_properties, cohesive_flag; }; /* ---------------------------------------------------------------------- */ @@ -70,7 +69,6 @@ class GSMNormal : public GSM { class GSMNormalNone : public GSMNormal { public: GSMNormalNone(class GranularModel *, class LAMMPS *); - void set_knfac() {}; double calculate_forces(); }; @@ -80,7 +78,6 @@ class GSMNormalHooke : public GSMNormal { public: GSMNormalHooke(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; - void set_knfac(); double calculate_forces(); protected: double k; @@ -92,7 +89,6 @@ class GSMNormalHertz : public GSMNormal { public: GSMNormalHertz(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; - void set_knfac(); double calculate_forces(); protected: double k; @@ -114,12 +110,11 @@ class GSMNormalDMT : public GSMNormal { GSMNormalDMT(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void mix_coeffs(double*, double*) override; - void set_knfac(); double calculate_forces(); void set_fncrit() override; protected: double k, cohesion; - double F_pulloff; + double F_pulloff, Fne; }; /* ---------------------------------------------------------------------- */ @@ -132,12 +127,11 @@ class GSMNormalJKR : public GSMNormal { bool touch() override; double pulloff_distance(double, double) override; double calculate_area() override; - void set_knfac(); double calculate_forces(); void set_fncrit() override; protected: double k, cohesion; - double Emix, F_pulloff; + double Emix, F_pulloff, Fne; }; } // namespace Granular_NS diff --git a/src/GRANULAR/gsm_rolling.cpp b/src/GRANULAR/gsm_rolling.cpp index efb0ea423b..ceda262853 100644 --- a/src/GRANULAR/gsm_rolling.cpp +++ b/src/GRANULAR/gsm_rolling.cpp @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/gsm_rolling.h b/src/GRANULAR/gsm_rolling.h index 21e61ac4bc..054b22954f 100644 --- a/src/GRANULAR/gsm_rolling.h +++ b/src/GRANULAR/gsm_rolling.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/gsm_tangential.cpp b/src/GRANULAR/gsm_tangential.cpp index b3e6266049..b2e7ca8762 100644 --- a/src/GRANULAR/gsm_tangential.cpp +++ b/src/GRANULAR/gsm_tangential.cpp @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -136,7 +137,6 @@ void GSMTangentialLinearHistory::calculate_forces() add3(history, temp_array, history); } - // tangential forces = history + tangential velocity damping scale3(-k, history, gm->fs); scale3(damp, gm->vtr, temp_array); diff --git a/src/GRANULAR/gsm_tangential.h b/src/GRANULAR/gsm_tangential.h index a420c7d314..1d6dfa3d04 100644 --- a/src/GRANULAR/gsm_tangential.h +++ b/src/GRANULAR/gsm_tangential.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -66,10 +66,7 @@ class GSMTangential : public GSM { virtual void coeffs_to_local() {}; virtual void init() {}; virtual void calculate_forces() = 0; - int rescale_flag; double k, damp, mu; // Used by Marshall twisting model - protected: - double xt; }; /* ---------------------------------------------------------------------- */ @@ -87,6 +84,8 @@ class GSMTangentialLinearNoHistory : public GSMTangential { GSMTangentialLinearNoHistory(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void calculate_forces(); + protected: + double xt; }; /* ---------------------------------------------------------------------- */ @@ -96,6 +95,8 @@ class GSMTangentialLinearHistory : public GSMTangential { GSMTangentialLinearHistory(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void calculate_forces(); + protected: + double xt; }; /* ---------------------------------------------------------------------- */ @@ -104,7 +105,9 @@ class GSMTangentialLinearHistoryClassic : public GSMTangentialLinearHistory { public: GSMTangentialLinearHistoryClassic(class GranularModel *, class LAMMPS *); void calculate_forces(); + protected: int scale_area; + double xt; }; /* ---------------------------------------------------------------------- */ @@ -124,6 +127,7 @@ class GSMTangentialMindlin : public GSMTangential { void calculate_forces(); protected: int mindlin_rescale, mindlin_force; + double xt; }; /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gsm_twisting.cpp b/src/GRANULAR/gsm_twisting.cpp index 3704ac4ec8..73149b099b 100644 --- a/src/GRANULAR/gsm_twisting.cpp +++ b/src/GRANULAR/gsm_twisting.cpp @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/GRANULAR/gsm_twisting.h b/src/GRANULAR/gsm_twisting.h index 84759acce7..b9ab7826a6 100644 --- a/src/GRANULAR/gsm_twisting.h +++ b/src/GRANULAR/gsm_twisting.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains From c8347df494efde32a2556d8b671eabfb568092ae Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 1 Nov 2022 13:34:07 -0600 Subject: [PATCH 035/112] Removing knfac from documentation --- doc/src/Modify_gsm.rst | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/doc/src/Modify_gsm.rst b/doc/src/Modify_gsm.rst index 06172b4dec..56b38fd573 100644 --- a/doc/src/Modify_gsm.rst +++ b/doc/src/Modify_gsm.rst @@ -82,7 +82,7 @@ There are also several type-specific methods * - ``GSMNormal->calculate_area()`` - Optional method to return the surface area of the contact. By default, this returns the geometric cross section. * - ``GSMNormal->set_fncrit()`` - - Optional method that defines the critical force to break the contact used by some tangential, rolling, and twisting submodels. By default, this is the current total normal force, including damping. + - Optional method that defines the critical force to break the contact used by some tangential, rolling, and twisting submodels. By default, this is the current total normal force including damping. * - ``GSMNormal->calculate_forces()`` - Required method that returns the normal contact force * - ``GSMDamping->calculate_forces()`` @@ -123,7 +123,6 @@ set of files ``gsm_custom.h``: public: GSMNormalHookePiecewise(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; - void set_knfac(); double calculate_forces(); protected: double k1, k2, delta_switch; @@ -166,6 +165,7 @@ and ``gsm_custom.cpp`` double GSMNormalHookePiecewise::calculate_forces() { + double Fne; if (gm->delta >= delta_switch { Fne = k1 * delta_switch + k2 * (gm->delta - delta_switch); } else { @@ -174,10 +174,3 @@ and ``gsm_custom.cpp`` return Fne; } - /* ---------------------------------------------------------------------- */ - - void GSMNormalHookePiecewise::set_knfac() - { - if (gm->delta < delta_switch) knfac = k1; - else knfac = k2; - } From 88be5a37812186ce989f2ca55cc5ad2cceeed3bd Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 1 Nov 2022 14:01:07 -0600 Subject: [PATCH 036/112] Minor fixes to doc pages --- doc/src/Modify_gsm.rst | 6 +++--- doc/src/dump.rst | 2 +- doc/src/pair_granular.rst | 13 ++++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/src/Modify_gsm.rst b/doc/src/Modify_gsm.rst index 56b38fd573..f549a9bb45 100644 --- a/doc/src/Modify_gsm.rst +++ b/doc/src/Modify_gsm.rst @@ -67,9 +67,9 @@ classes. All GSM classes share several general methods which may need to be defi * - ``GSM->mix_coeff()`` - Optional method to define how coefficients are mixed for different atom types. By default, coefficients are mixed using a geometric mean. * - ``GSM->coeffs_to_local()`` - - Parses coefficients to define local variables, run once at model construction. + - Parses coefficients to define local variables. Run once at model construction. * - ``GSM->init()`` - - Optional method to define local variables after other GSM types were created. For instance, this method may be used by a tangential model that derives parameters from the normal stiffness. + - Optional method to define local variables after other GSM types were created. For instance, this method may be used by a tangential model that derives parameters from the normal model. There are also several type-specific methods @@ -166,7 +166,7 @@ and ``gsm_custom.cpp`` double GSMNormalHookePiecewise::calculate_forces() { double Fne; - if (gm->delta >= delta_switch { + if (gm->delta >= delta_switch) { Fne = k1 * delta_switch + k2 * (gm->delta - delta_switch); } else { Fne = k1 * gm->delta; diff --git a/doc/src/dump.rst b/doc/src/dump.rst index c324c945ee..f5a121517a 100644 --- a/doc/src/dump.rst +++ b/doc/src/dump.rst @@ -108,7 +108,7 @@ Syntax omegax,omegay,omegaz = angular velocity of spherical particle angmomx,angmomy,angmomz = angular momentum of aspherical particle tqx,tqy,tqz = torque on finite-size particles - heatflow = flow of heat into particle + heatflow = rate of heat flow into particle temperature = temperature of particle c_ID = per-atom vector calculated by a compute with ID c_ID[I] = Ith column of per-atom array calculated by a compute with ID, I can include wildcard (see below) diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index bc365814cd..8109e6709a 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -226,16 +226,19 @@ for all models except *jkr*, for which it is given implicitly according to :math:`\delta = a^2/R - 2\sqrt{\pi \gamma a/E}`. For *damping viscoelastic*, :math:`\eta_{n0}` is in units of 1/(\ *time*\ \*\ *distance*\ ). -The *tsuji* model is based on the work of :ref:`(Tsuji et al) `. Here, the damping coefficient specified as part of -the normal model is interpreted as a restitution coefficient -:math:`e`. The damping constant :math:`\eta_n` is given by: +The *tsuji* model is based on the work of :ref:`(Tsuji et al) `. +Here, the damping coefficient specified as part of the normal model is interpreted +as a restitution coefficient :math:`e`. The damping constant :math:`\eta_n` is +given by: .. math:: \eta_n = \alpha (m_{eff}k_n)^{1/2} -For normal contact models based on material parameters, :math:`k_n = 4/3Ea`. The parameter :math:`\alpha` is related to the restitution -coefficient *e* according to: +For normal contact models based on material parameters, :math:`k_n = 4/3Ea`. This +damping model is not compatible with cohesive normal models such as *JKR* or *DMT*. +The parameter :math:`\alpha` is related to the restitution coefficient *e* +according to: .. math:: From 95a8d2cc25d7686e8d5f0319523ca0fba1fa743f Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 2 Nov 2022 15:38:12 -0600 Subject: [PATCH 037/112] Patching pair tracker --- src/MISC/pair_tracker.cpp | 2 +- src/MISC/pair_tracker.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MISC/pair_tracker.cpp b/src/MISC/pair_tracker.cpp index c994b02df5..adbd832eae 100644 --- a/src/MISC/pair_tracker.cpp +++ b/src/MISC/pair_tracker.cpp @@ -514,7 +514,7 @@ double PairTracker::single(int /*i*/, int /*j*/, int /*itype*/, int /*jtype*/, d only needed if any history entries i-j are not just negative of j-i entries ------------------------------------------------------------------------- */ -void PairTracker::transfer_history(double *source, double *target) +void PairTracker::transfer_history(double *source, double *target, int itype, int jtype) { for (int i = 0; i < size_history; i++) target[i] = source[i]; } diff --git a/src/MISC/pair_tracker.h b/src/MISC/pair_tracker.h index 47128b8073..e072f51f21 100644 --- a/src/MISC/pair_tracker.h +++ b/src/MISC/pair_tracker.h @@ -40,7 +40,7 @@ class PairTracker : public Pair { double single(int, int, int, int, double, double, double, double &) override; double atom2cut(int) override; double radii2cut(double, double) override; - void transfer_history(double *, double *) override; + void transfer_history(double *, double *, int, int) override; protected: int sizeflag; From 74122040a392de78a4b04ca2cf2142c79fe32892 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Nov 2022 20:20:06 -0400 Subject: [PATCH 038/112] add cmake support for generating gsm style header file --- cmake/Modules/StyleHeaderUtils.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Modules/StyleHeaderUtils.cmake b/cmake/Modules/StyleHeaderUtils.cmake index 7590d822eb..2bc84252d3 100644 --- a/cmake/Modules/StyleHeaderUtils.cmake +++ b/cmake/Modules/StyleHeaderUtils.cmake @@ -104,6 +104,7 @@ function(RegisterStyles search_path) FindStyleHeaders(${search_path} DIHEDRAL_CLASS dihedral_ DIHEDRAL ) # dihedral ) # force FindStyleHeaders(${search_path} DUMP_CLASS dump_ DUMP ) # dump ) # output write_dump FindStyleHeaders(${search_path} FIX_CLASS fix_ FIX ) # fix ) # modify + FindStyleHeaders(${search_path} GSM_CLASS gsm_ GSM ) # gsm ) # granular_model FindStyleHeaders(${search_path} IMPROPER_CLASS improper_ IMPROPER ) # improper ) # force FindStyleHeaders(${search_path} INTEGRATE_CLASS "[^.]" INTEGRATE ) # integrate ) # update FindStyleHeaders(${search_path} KSPACE_CLASS "[^.]" KSPACE ) # kspace ) # force @@ -127,6 +128,7 @@ function(RegisterStylesExt search_path extension sources) FindStyleHeadersExt(${search_path} DIHEDRAL_CLASS ${extension} DIHEDRAL ${sources}) FindStyleHeadersExt(${search_path} DUMP_CLASS ${extension} DUMP ${sources}) FindStyleHeadersExt(${search_path} FIX_CLASS ${extension} FIX ${sources}) + FindStyleHeadersExt(${search_path} GSM_CLASS ${extension} GSM ${sources}) FindStyleHeadersExt(${search_path} IMPROPER_CLASS ${extension} IMPROPER ${sources}) FindStyleHeadersExt(${search_path} INTEGRATE_CLASS ${extension} INTEGRATE ${sources}) FindStyleHeadersExt(${search_path} KSPACE_CLASS ${extension} KSPACE ${sources}) @@ -151,6 +153,7 @@ function(GenerateStyleHeaders output_path) GenerateStyleHeader(${output_path} DIHEDRAL dihedral ) # force GenerateStyleHeader(${output_path} DUMP dump ) # output write_dump GenerateStyleHeader(${output_path} FIX fix ) # modify + GenerateStyleHeader(${output_path} GSM gsm ) # granular_model GenerateStyleHeader(${output_path} IMPROPER improper ) # force GenerateStyleHeader(${output_path} INTEGRATE integrate ) # update GenerateStyleHeader(${output_path} KSPACE kspace ) # force From 3561bbe88724834718be98b11eef2dfc6f07fb03 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Nov 2022 20:20:56 -0400 Subject: [PATCH 039/112] simplify --- src/GRANULAR/granular_model.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index b45c916580..d3ce11b799 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -20,15 +20,15 @@ namespace LAMMPS_NS { namespace Granular_NS { #define EPSILON 1e-10 -#define NSUBMODELS 6 enum SubmodelType { NORMAL = 0, - DAMPING = 1, - TANGENTIAL = 2, - ROLLING = 3, - TWISTING = 4, - HEAT = 5 + DAMPING, + TANGENTIAL, + ROLLING, + TWISTING, + HEAT, + NSUBMODELS }; // Relative order matters since some derive coeffs from others enum ContactType { @@ -37,7 +37,7 @@ enum ContactType { WALLREGION = 2 }; -// forward declaration +// forward declarations class GSM; class GSMNormal; class GSMDamping; From b5d57531d930b328cca9e0a94b5bdae513c37fbd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Nov 2022 20:38:43 -0400 Subject: [PATCH 040/112] complete integration into the manual build process --- doc/src/Commands_fix.rst | 1 + doc/src/Modify.rst | 1 + doc/src/fix.rst | 1 + 3 files changed, 3 insertions(+) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index c5c2fb7cba..ec8174a370 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -235,6 +235,7 @@ OPT. * :doc:`temp/berendsen ` * :doc:`temp/csld ` * :doc:`temp/csvr ` + * :doc:`temp/integrate ` * :doc:`temp/rescale ` * :doc:`temp/rescale/eff ` * :doc:`tfmc ` diff --git a/doc/src/Modify.rst b/doc/src/Modify.rst index e42da61387..39a1faeb87 100644 --- a/doc/src/Modify.rst +++ b/doc/src/Modify.rst @@ -34,5 +34,6 @@ style requirements and recommendations `. Modify_min Modify_region Modify_body + Modify_gsm Modify_thermo Modify_variable diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 333e920bd9..461cfc1465 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -382,6 +382,7 @@ accelerated styles exist. * :doc:`temp/berendsen ` - temperature control by Berendsen thermostat * :doc:`temp/csld ` - canonical sampling thermostat with Langevin dynamics * :doc:`temp/csvr ` - canonical sampling thermostat with Hamiltonian dynamics +* :doc:`temp/integrate ` - plain time integration with per-atom temperature updates * :doc:`temp/rescale ` - temperature control by velocity rescaling * :doc:`temp/rescale/eff ` - temperature control by velocity rescaling in the electron force field model * :doc:`tfmc ` - perform force-bias Monte Carlo with time-stamped method From 871efda589c4c7119a1f1738e53a02e217439ffa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Nov 2022 20:39:10 -0400 Subject: [PATCH 041/112] a few formal changes and spelling updates --- doc/src/Modify_gsm.rst | 26 ++++++++-------- doc/src/fix_temp_integrate.rst | 6 ---- doc/src/pair_granular.rst | 33 +++++++++++---------- doc/utils/sphinx-config/false_positives.txt | 1 + 4 files changed, 32 insertions(+), 34 deletions(-) diff --git a/doc/src/Modify_gsm.rst b/doc/src/Modify_gsm.rst index f549a9bb45..515c776c6c 100644 --- a/doc/src/Modify_gsm.rst +++ b/doc/src/Modify_gsm.rst @@ -1,5 +1,5 @@ -Granular Submodel (GSM) styles -=========== +Granular Sub-model (GSM) styles +=============================== In granular models, particles are spheres with a finite radius and rotational degrees of freedom as further described in the @@ -9,22 +9,22 @@ of motion as described in :doc:`pair granular ` and :doc:`fix wall/gran `. In both cases, the exchange of forces, torques, and heat flow between two types of bodies is defined using a GranularModel class. The GranularModel class organizes the details of an -interaction using a series of granular submodels each of which describe a +interaction using a series of granular sub-models each of which describe a particular interaction mode (e.g. normal forces or rolling friction). From a -parent GSM class, several types of submodel classes are derived: +parent GSM class, several types of sub-model classes are derived: -* GSMNormal: normal force submodel -* GSMDamping: normal damping submodel -* GSMTangential: tangential forces and sliding friction submodel -* GSMRolling: rolling friction submodel -* GSMTwisting: twisting friction submodel -* GSMHeat: heat conduction submodel +* GSMNormal: normal force sub-model +* GSMDamping: normal damping sub-model +* GSMTangential: tangential forces and sliding friction sub-model +* GSMRolling: rolling friction sub-model +* GSMTwisting: twisting friction sub-model +* GSMHeat: heat conduction sub-model -For each type of submodel, more classes are further derived, each describing +For each type of sub-model, more classes are further derived, each describing a specific implementation. For instance, from the GSMNormal class the GSMNormalHooke, GSMNormalHertz, and GSMNormalJKR classes are derived which calculate Hookean, Hertzian, or JKR normal forces, respectively. This modular -structure simplifies the addition of new granualar contact models as as one only +structure simplifies the addition of new granular contact models as as one only needs to create a new GSM class without having to modify the more complex PairGranular, FixGranWall, and GranularModel classes. Most GSM methods are also already defined by the parent classes so new contact models typically only require @@ -82,7 +82,7 @@ There are also several type-specific methods * - ``GSMNormal->calculate_area()`` - Optional method to return the surface area of the contact. By default, this returns the geometric cross section. * - ``GSMNormal->set_fncrit()`` - - Optional method that defines the critical force to break the contact used by some tangential, rolling, and twisting submodels. By default, this is the current total normal force including damping. + - Optional method that defines the critical force to break the contact used by some tangential, rolling, and twisting sub-models. By default, this is the current total normal force including damping. * - ``GSMNormal->calculate_forces()`` - Required method that returns the normal contact force * - ``GSMDamping->calculate_forces()`` diff --git a/doc/src/fix_temp_integrate.rst b/doc/src/fix_temp_integrate.rst index 03fae7a872..efcf450d8f 100644 --- a/doc/src/fix_temp_integrate.rst +++ b/doc/src/fix_temp_integrate.rst @@ -41,12 +41,6 @@ the *constant* or *type* keywords. For style *constant*, the specific heat is a constant value *cp* for all atoms. For style *type*, *N* different values of the specific heat are defined, one for each of the *N* types of atoms. - - ----------- - -.. include:: accel_styles.rst - ---------- Restart, fix_modify, output, run start/stop, minimize info diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index a6533957df..cb044252da 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -766,26 +766,29 @@ These extra quantities can be accessed by the :doc:`compute pair/local ` page for more info. +This pair style is part of the GRANULAR package. It is +only enabled if LAMMPS was built with that package. +See the :doc:`Build package ` page for more info. -These pair styles require that atoms store torque and angular velocity -(omega) as defined by the :doc:`atom_style `. They also -require a per-particle radius is stored. The *sphere* atom style does -all of this. +This pair style requires that atoms store per-particle radius, +torque, and angular velocity (omega) as defined by the +:doc:`atom_style sphere `. -This pair style requires you to use the :doc:`comm_modify vel yes ` command so that velocities are stored by ghost -atoms. +This pair style requires you to use the :doc:`comm_modify vel yes ` +command so that velocities are stored by ghost atoms. -These pair styles will not restart exactly when using the -:doc:`read_restart ` command, though they should provide -statistically similar results. This is because the forces they -compute depend on atom velocities. See the -:doc:`read_restart ` command for more details. +This pair style will not restart exactly when using the +:doc:`read_restart ` command, though it should provide +statistically similar results. This is because the forces it +computes depend on atom velocities and the atom velocities have +been propagated half a timestep between the force computation and +when the restart is written, due to using Velocity Verlet time +integration. See the :doc:`read_restart ` command +for more details. -Accumulated values for individual contacts are saved to to restart +Accumulated values for individual contacts are saved to restart files but are not saved to data files. Therefore, forces may -differ significantly when a system is reloaded using A +differ significantly when a system is reloaded using the :doc:`read_data ` command. Related commands diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 61c1d45ba7..5aeb259ee6 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1336,6 +1336,7 @@ hdnnp HDNNP Hearn heatconduction +heatflow Hebbeker Hebenstreit Hecht From bc74fef3f4f51f9691b1135e9420d638c1363cd2 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 2 Nov 2022 21:11:30 -0600 Subject: [PATCH 042/112] Fixing memory leaks, misc clean ups, adding cohesive flag to Tsuji --- src/GRANULAR/granular_model.cpp | 25 ++++++++++++------------- src/GRANULAR/granular_model.h | 2 +- src/GRANULAR/gsm.cpp | 1 + src/GRANULAR/gsm_damping.cpp | 5 ++++- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index 3f500d0431..10113cdf78 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -95,13 +95,11 @@ GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) GranularModel::~GranularModel() { delete [] transfer_history_factor; + delete [] gsmclass; + delete [] gsmnames; + delete [] gsmtypes; - delete normal_model; - delete damping_model; - delete tangential_model; - delete rolling_model; - delete twisting_model; - delete heat_model; + for (int i = 0; i < NSUBMODELS; i ++) delete sub_models[i]; } /* ---------------------------------------------------------------------- */ @@ -119,7 +117,7 @@ int GranularModel::add_submodel(char **arg, int iarg, int narg, SubmodelType mod error->all(FLERR, "Insufficient arguments provided for {} model", model_name); for (int i = 0; i < num_coeffs; i++) { - // A few parameters (eg.g kt for tangential mindlin) allow null + // A few parameters (e.g. kt for tangential mindlin) allow null if (strcmp(arg[iarg + i], "NULL") == 0) sub_models[model_type]->coeffs[i] = -1; else sub_models[model_type]->coeffs[i] = utils::numeric(FLERR,arg[iarg + i],false,lmp); } @@ -138,6 +136,7 @@ void GranularModel::construct_submodel(std::string model_name, SubmodelType mode if (gsmtypes[i] == model_type) { if (strcmp(gsmnames[i], model_name.c_str()) == 0) { GSMCreator &gsm_creator = gsmclass[i]; + delete sub_models[model_type]; sub_models[model_type] = gsm_creator(this, lmp); break; } @@ -145,7 +144,7 @@ void GranularModel::construct_submodel(std::string model_name, SubmodelType mode } if (i == nclass) - error->all(FLERR, "Illegal model type {}", model_type); + error->all(FLERR, "Illegal model type {}", model_name); sub_models[model_type]->name.assign(model_name); sub_models[model_type]->allocate_coeffs(); @@ -252,7 +251,7 @@ void GranularModel::init() error->all(FLERR,"Cannot use {} model with a cohesive normal model, {}", sub_models[i]->name, normal_model->name); } - if (limit_damping && (normal_model->cohesive_flag)) + if (limit_damping && normal_model->cohesive_flag) error->all(FLERR,"Cannot limit damping with a cohesive normal model, {}", normal_model->name); if (nondefault_history_transfer) { @@ -263,7 +262,7 @@ void GranularModel::init() // Find which model owns this history value size_cumulative = 0; for (j = 0; j < NSUBMODELS; j++) { - if (size_cumulative + sub_models[j]->size_history > i) break; + if ((size_cumulative + sub_models[j]->size_history) > i) break; size_cumulative += sub_models[j]->size_history; } @@ -451,7 +450,7 @@ void GranularModel::calculate_forces() scale3(-1, torquesi); if (contact_type == PAIR) copy3(torquesi, torquesj); - if (!classic_model && contact_type == PAIR) { + if (!classic_model && (contact_type == PAIR)) { dist_to_contact = radi - 0.5 * delta; scale3(dist_to_contact, torquesi); dist_to_contact = radj - 0.5 * delta; @@ -461,16 +460,16 @@ void GranularModel::calculate_forces() scale3(dist_to_contact, torquesi); } - double torroll[3]; if (rolling_defined) { + double torroll[3]; cross3(nx, fr, torroll); scale3(Reff, torroll); add3(torquesi, torroll, torquesi); if (contact_type == PAIR) sub3(torquesj, torroll, torquesj); } - double tortwist[3]; if (twisting_defined) { + double tortwist[3]; scale3(magtortwist, nx, tortwist); add3(torquesi, tortwist, torquesi); if (contact_type == PAIR) sub3(torquesj, tortwist, torquesj); diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index d3ce11b799..b5a4d9ef4b 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -29,7 +29,7 @@ enum SubmodelType { TWISTING, HEAT, NSUBMODELS -}; // Relative order matters since some derive coeffs from others +}; enum ContactType { PAIR = 0, diff --git a/src/GRANULAR/gsm.cpp b/src/GRANULAR/gsm.cpp index fb0ae48615..1848a1743a 100644 --- a/src/GRANULAR/gsm.cpp +++ b/src/GRANULAR/gsm.cpp @@ -45,6 +45,7 @@ GSM::GSM(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) nondefault_history_transfer = 0; transfer_history_factor = nullptr; + coeffs = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gsm_damping.cpp b/src/GRANULAR/gsm_damping.cpp index 0280f61771..ed4bfd8ae1 100644 --- a/src/GRANULAR/gsm_damping.cpp +++ b/src/GRANULAR/gsm_damping.cpp @@ -93,7 +93,10 @@ double GSMDampingViscoelastic::calculate_forces() Tsuji damping ------------------------------------------------------------------------- */ -GSMDampingTsuji::GSMDampingTsuji(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} +GSMDampingTsuji::GSMDampingTsuji(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) +{ + allow_cohesion = 0; +} /* ---------------------------------------------------------------------- */ From cd658e67794ba9b102f3d690220f255f984d6f6f Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 7 Nov 2022 10:41:09 -0700 Subject: [PATCH 043/112] Fixing few bugs with histories, removing indices from granular model --- src/GRANULAR/fix_wall_gran.cpp | 1 - src/GRANULAR/fix_wall_gran_region.cpp | 1 - src/GRANULAR/granular_model.h | 1 - src/GRANULAR/gsm_tangential.cpp | 2 +- src/GRANULAR/pair_granular.cpp | 50 ++++++++++++++------------- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index e0bb941525..4956e9d900 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -492,7 +492,6 @@ void FixWallGran::post_force(int /*vflag*/) } // Reset model and copy initial geometric data - model->i = i; model->dx[0] = dx; model->dx[1] = dy; model->dx[2] = dz; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index ad58d3e624..7ee794133c 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -229,7 +229,6 @@ void FixWallGranRegion::post_force(int /*vflag*/) for (int ic = 0; ic < nc; ic++) { // Reset model and copy initial geometric data - model->i = i; model->dx[0] = region->contact[ic].delx; model->dx[1] = region->contact[ic].dely; model->dx[2] = region->contact[ic].delz; diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index b5a4d9ef4b..dc404b332c 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -87,7 +87,6 @@ class GranularModel : protected Pointers { double radi, radj, meff, dt, Ti, Tj, area; double Fntot, magtortwist; - int i, j; double *xi, *xj, *vi, *vj, *omegai, *omegaj; double fs[3], fr[3], ft[3]; diff --git a/src/GRANULAR/gsm_tangential.cpp b/src/GRANULAR/gsm_tangential.cpp index b2e7ca8762..862159c386 100644 --- a/src/GRANULAR/gsm_tangential.cpp +++ b/src/GRANULAR/gsm_tangential.cpp @@ -44,7 +44,7 @@ GSMTangentialNone::GSMTangentialNone(GranularModel *gm, LAMMPS *lmp) : GSMTangen GSMTangentialLinearNoHistory::GSMTangentialLinearNoHistory(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) { num_coeffs = 2; - size_history = 3; + size_history = 0; } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index aa93dd7a0b..973daff5c9 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -122,6 +122,9 @@ void PairGranular::compute(int eflag, int vflag) bool touchflag = false; const bool history_update = update->setupflag == 0; + for (int i = 0; i < vec_models.size(); i++) + vec_models[i].history_update = history_update; + ev_init(eflag,vflag); // update rigid body info for owned & ghost atoms if using FixRigid masses @@ -190,13 +193,12 @@ void PairGranular::compute(int eflag, int vflag) jtype = type[j]; // Reset model and copy initial geometric data - models[itype][jtype]->i = i; - models[itype][jtype]->j = j; models[itype][jtype]->xi = x[i]; models[itype][jtype]->xj = x[j]; models[itype][jtype]->radi = radius[i]; models[itype][jtype]->radj = radius[j]; - models[itype][jtype]->touch = touch[jj]; + if (use_history || models[itype][jtype]->beyond_contact) + models[itype][jtype]->touch = touch[jj]; touchflag = models[itype][jtype]->check_contact(); @@ -234,12 +236,11 @@ void PairGranular::compute(int eflag, int vflag) models[itype][jtype]->vj = v[j]; models[itype][jtype]->omegai = omega[i]; models[itype][jtype]->omegaj = omega[j]; - models[itype][jtype]->history_update = history_update; if (use_history) { history = &allhistory[size_history*jj]; models[itype][jtype]->history = history; } -; + if (heat_flag) { models[itype][jtype]->Ti = temperature[i]; models[itype][jtype]->Tj = temperature[j]; @@ -411,7 +412,10 @@ void PairGranular::init_style() for (auto &model : vec_models) { model.init(); - if (model.beyond_contact) beyond_contact = 1; + if (model.beyond_contact) { + beyond_contact = 1; + use_history = 1; // Need to track if in contact + } if (model.size_history != 0) use_history = 1; for (i = 0; i < NSUBMODELS; i++) @@ -700,14 +704,28 @@ double PairGranular::single(int i, int j, int itype, int jtype, double *radius = atom->radius; // Reset model and copy initial geometric data - models[itype][jtype]->i = i; - models[itype][jtype]->j = j; models[itype][jtype]->xi = x[i]; models[itype][jtype]->xj = x[j]; models[itype][jtype]->radi = radius[i]; models[itype][jtype]->radj = radius[j]; models[i][j]->history_update = 0; // Don't update history + // If history is needed + jnum = list->numneigh[i]; + jlist = list->firstneigh[i]; + if (use_history) { + if ((fix_history == nullptr) || (fix_history->firstvalue == nullptr)) + error->one(FLERR,"Pair granular single computation needs history"); + allhistory = fix_history->firstvalue[i]; + for (int jj = 0; jj < jnum; jj++) { + neighprev++; + if (neighprev >= jnum) neighprev = 0; + if (jlist[neighprev] == j) break; + } + history = &allhistory[size_history*neighprev]; + models[itype][jtype]->touch = fix_history->firstflag[i][neighprev]; + } + touchflag = models[itype][jtype]->check_contact(); if (!touchflag) { @@ -733,22 +751,6 @@ double PairGranular::single(int i, int j, int itype, int jtype, if (mask[i] & freeze_group_bit) meff = mj; if (mask[j] & freeze_group_bit) meff = mi; - // if any history is needed - jnum = list->numneigh[i]; - jlist = list->firstneigh[i]; - - if (use_history) { - if ((fix_history == nullptr) || (fix_history->firstvalue == nullptr)) - error->one(FLERR,"Pair granular single computation needs history"); - allhistory = fix_history->firstvalue[i]; - for (int jj = 0; jj < jnum; jj++) { - neighprev++; - if (neighprev >= jnum) neighprev = 0; - if (jlist[neighprev] == j) break; - } - history = &allhistory[size_history*neighprev]; - } - // Copy additional information and calculate forces double **v = atom->v; double **omega = atom->omega; From a1db5fda70e04c8a1c925a677f7dc354ab9e62ec Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 7 Nov 2022 11:30:12 -0700 Subject: [PATCH 044/112] Simplifying variables and logic --- src/GRANULAR/granular_model.cpp | 56 +++++++------- src/GRANULAR/pair_granular.cpp | 128 ++++++++++++++++---------------- 2 files changed, 91 insertions(+), 93 deletions(-) diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index 10113cdf78..f8a53c5cf2 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -380,9 +380,8 @@ bool GranularModel::check_contact() void GranularModel::calculate_forces() { - double temp[3]; - // Standard geometric quantities + if (contact_type != WALLREGION) r = sqrt(rsq); rinv = 1.0 / r; delta = radsum - r; @@ -403,29 +402,12 @@ void GranularModel::calculate_forces() scaleadd3(radi, omegai, radj, omegaj, wr); // relative tangential velocities + double temp[3]; cross3(wr, nx, temp); sub3(vt, temp, vtr); vrel = len3(vtr); - if (rolling_defined || twisting_defined) - sub3(omegai, omegaj, relrot); - - if (rolling_defined) { - // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) - // this is different from the Marshall papers, which use the Bagi/Kuhn formulation - // for rolling velocity (see Wang et al for why the latter is wrong) - vrl[0] = Reff * (relrot[1] * nx[2] - relrot[2] * nx[1]); - vrl[1] = Reff * (relrot[2] * nx[0] - relrot[0] * nx[2]); - vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); - } - - if (twisting_defined) { - // omega_T (eq 29 of Marshall) - magtwist = dot3(relrot, nx); - } - // calculate forces/torques - forces[0] = 0.0; double Fdamp, dist_to_contact; area = normal_model->calculate_area(); @@ -437,30 +419,43 @@ void GranularModel::calculate_forces() normal_model->set_fncrit(); // Needed for tangential, rolling, twisting tangential_model->calculate_forces(); - if (rolling_defined) rolling_model->calculate_forces(); - if (twisting_defined) twisting_model->calculate_forces(); - // sum contributions + // sum normal + tangential contributions scale3(Fntot, nx, forces); add3(forces, fs, forces); - //May need to rethink eventually tris.. + // May need to eventually rethink tris.. cross3(nx, fs, torquesi); scale3(-1, torquesi); - if (contact_type == PAIR) copy3(torquesi, torquesj); - if (!classic_model && (contact_type == PAIR)) { + if (contact_type == PAIR) { + copy3(torquesi, torquesj); + + // Classic pair styles wouldn't scale, but classic option is only used by walls dist_to_contact = radi - 0.5 * delta; scale3(dist_to_contact, torquesi); dist_to_contact = radj - 0.5 * delta; scale3(dist_to_contact, torquesj); } else { - dist_to_contact = radi; - scale3(dist_to_contact, torquesi); + scale3(radi, torquesi); } + // Extra modes + + if (rolling_defined || twisting_defined) + sub3(omegai, omegaj, relrot); + if (rolling_defined) { + // rolling velocity, see eq. 31 of Wang et al, Particuology v 23, p 49 (2015) + // this is different from the Marshall papers, which use the Bagi/Kuhn formulation + // for rolling velocity (see Wang et al for why the latter is wrong) + vrl[0] = Reff * (relrot[1] * nx[2] - relrot[2] * nx[1]); + vrl[1] = Reff * (relrot[2] * nx[0] - relrot[0] * nx[2]); + vrl[2] = Reff * (relrot[0] * nx[1] - relrot[1] * nx[0]); + + rolling_model->calculate_forces(); + double torroll[3]; cross3(nx, fr, torroll); scale3(Reff, torroll); @@ -469,6 +464,11 @@ void GranularModel::calculate_forces() } if (twisting_defined) { + // omega_T (eq 29 of Marshall) + magtwist = dot3(relrot, nx); + + twisting_model->calculate_forces(); + double tortwist[3]; scale3(magtortwist, nx, tortwist); add3(torquesi, tortwist, torquesi); diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 973daff5c9..9601b87382 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -112,7 +112,7 @@ PairGranular::~PairGranular() void PairGranular::compute(int eflag, int vflag) { int i,j,k,ii,jj,inum,jnum,itype,jtype; - double factor_lj,mi,mj,meff,delx,dely,delz; + double factor_lj,mi,mj,meff; double *forces, *torquesi, *torquesj, dq; int *ilist,*jlist,*numneigh,**firstneigh; @@ -122,6 +122,8 @@ void PairGranular::compute(int eflag, int vflag) bool touchflag = false; const bool history_update = update->setupflag == 0; + class GranularModel* model; + for (int i = 0; i < vec_models.size(); i++) vec_models[i].history_update = history_update; @@ -191,31 +193,29 @@ void PairGranular::compute(int eflag, int vflag) if (factor_lj == 0) continue; jtype = type[j]; + model = models[itype][jtype]; // Reset model and copy initial geometric data - models[itype][jtype]->xi = x[i]; - models[itype][jtype]->xj = x[j]; - models[itype][jtype]->radi = radius[i]; - models[itype][jtype]->radj = radius[j]; - if (use_history || models[itype][jtype]->beyond_contact) - models[itype][jtype]->touch = touch[jj]; + model->xi = x[i]; + model->xj = x[j]; + model->radi = radius[i]; + model->radj = radius[j]; + if (use_history) model->touch = touch[jj]; - touchflag = models[itype][jtype]->check_contact(); + touchflag = model->check_contact(); if (!touchflag) { // unset non-touching neighbors if (use_history) { touch[jj] = 0; - history = &allhistory[size_history*jj]; + history = &allhistory[size_history * jj]; for (k = 0; k < size_history; k++) history[k] = 0.0; } continue; } // if any history is needed - if (use_history || models[itype][jtype]->beyond_contact) { - touch[jj] = 1; - } + if (use_history) touch[jj] = 1; // meff = effective mass of pair of particles // if I or J part of rigid body, use body mass @@ -231,27 +231,26 @@ void PairGranular::compute(int eflag, int vflag) if (mask[j] & freeze_group_bit) meff = mi; // Copy additional information and prepare force calculations - models[itype][jtype]->meff = meff; - models[itype][jtype]->vi = v[i]; - models[itype][jtype]->vj = v[j]; - models[itype][jtype]->omegai = omega[i]; - models[itype][jtype]->omegaj = omega[j]; + model->meff = meff; + model->vi = v[i]; + model->vj = v[j]; + model->omegai = omega[i]; + model->omegaj = omega[j]; if (use_history) { - history = &allhistory[size_history*jj]; - models[itype][jtype]->history = history; + history = &allhistory[size_history * jj]; + model->history = history; } if (heat_flag) { - models[itype][jtype]->Ti = temperature[i]; - models[itype][jtype]->Tj = temperature[j]; + model->Ti = temperature[i]; + model->Tj = temperature[j]; } - models[itype][jtype]->calculate_forces(); + model->calculate_forces(); - forces = models[itype][jtype]->forces; - torquesi = models[itype][jtype]->torquesi; - torquesj = models[itype][jtype]->torquesj; - if (heat_flag) dq = models[itype][jtype]->dq; + forces = model->forces; + torquesi = model->torquesi; + torquesj = model->torquesj; // apply forces & torques scale3(factor_lj, forces); @@ -259,21 +258,22 @@ void PairGranular::compute(int eflag, int vflag) scale3(factor_lj, torquesi); add3(torque[i], torquesi, torque[i]); - if (heat_flag) heatflow[i] += dq; if (force->newton_pair || j < nlocal) { sub3(f[j], forces, f[j]); scale3(factor_lj, torquesj); add3(torque[j], torquesj, torque[j]); - if (heat_flag) heatflow[j] -= dq; + } + + if (heat_flag) { + dq = model->dq; + heatflow[i] += dq; + if (force->newton_pair || j < nlocal) heatflow[j] -= dq; } if (evflag) { - delx = x[i][0] - x[j][0]; - dely = x[i][1] - x[j][1]; - delz = x[i][2] - x[j][2]; ev_tally_xyz(i,j,nlocal,force->newton_pair, - 0.0,0.0,forces[0],forces[1],forces[2],delx,dely,delz); + 0.0,0.0,forces[0],forces[1],forces[2],model->dx[0],model->dx[1],model->dx[2]); } } } @@ -703,12 +703,14 @@ double PairGranular::single(int i, int j, int itype, int jtype, double **x = atom->x; double *radius = atom->radius; + class GranularModel* model = models[itype][jtype]; + // Reset model and copy initial geometric data - models[itype][jtype]->xi = x[i]; - models[itype][jtype]->xj = x[j]; - models[itype][jtype]->radi = radius[i]; - models[itype][jtype]->radj = radius[j]; - models[i][j]->history_update = 0; // Don't update history + model->xi = x[i]; + model->xj = x[j]; + model->radi = radius[i]; + model->radj = radius[j]; + model->history_update = 0; // Don't update history // If history is needed jnum = list->numneigh[i]; @@ -723,10 +725,10 @@ double PairGranular::single(int i, int j, int itype, int jtype, if (jlist[neighprev] == j) break; } history = &allhistory[size_history*neighprev]; - models[itype][jtype]->touch = fix_history->firstflag[i][neighprev]; + model->touch = fix_history->firstflag[i][neighprev]; } - touchflag = models[itype][jtype]->check_contact(); + touchflag = model->check_contact(); if (!touchflag) { fforce = 0.0; @@ -755,18 +757,18 @@ double PairGranular::single(int i, int j, int itype, int jtype, double **v = atom->v; double **omega = atom->omega; - models[itype][jtype]->meff = meff; - models[itype][jtype]->vi = v[i]; - models[itype][jtype]->vj = v[j]; - models[itype][jtype]->omegai = omega[i]; - models[itype][jtype]->omegaj = omega[j]; - models[itype][jtype]->history = history; + model->meff = meff; + model->vi = v[i]; + model->vj = v[j]; + model->omegai = omega[i]; + model->omegaj = omega[j]; + model->history = history; double *forces, *torquesi, *torquesj; - models[itype][jtype]->calculate_forces(); - forces = models[itype][jtype]->forces; - torquesi = models[itype][jtype]->torquesi; - torquesj = models[itype][jtype]->torquesj; + model->calculate_forces(); + forces = model->forces; + torquesi = model->torquesi; + torquesj = model->torquesj; // apply forces & torques @@ -774,22 +776,18 @@ double PairGranular::single(int i, int j, int itype, int jtype, // set single_extra quantities - double delx = x[i][0] - x[j][0]; - double dely = x[i][1] - x[j][1]; - double delz = x[i][2] - x[j][2]; - - svector[0] = models[itype][jtype]->fs[0]; - svector[1] = models[itype][jtype]->fs[1]; - svector[2] = models[itype][jtype]->fs[2]; - svector[3] = MathExtra::len3(models[itype][jtype]->fs); - svector[4] = models[itype][jtype]->fr[0]; - svector[5] = models[itype][jtype]->fr[1]; - svector[6] = models[itype][jtype]->fr[2]; - svector[7] = MathExtra::len3(models[itype][jtype]->fr); - svector[8] = models[itype][jtype]->magtortwist; - svector[9] = delx; - svector[10] = dely; - svector[11] = delz; + svector[0] = model->fs[0]; + svector[1] = model->fs[1]; + svector[2] = model->fs[2]; + svector[3] = MathExtra::len3(model->fs); + svector[4] = model->fr[0]; + svector[5] = model->fr[1]; + svector[6] = model->fr[2]; + svector[7] = MathExtra::len3(model->fr); + svector[8] = model->magtortwist; + svector[9] = model->dx[0]; + svector[10] = model->dx[1]; + svector[11] = model->dx[2]; return 0.0; } From 971b932387a841c3b4e283ebb1b6b79b24049fd1 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 7 Nov 2022 17:39:40 -0700 Subject: [PATCH 045/112] Adding area flag for submodels --- src/GRANULAR/granular_model.cpp | 6 ++++-- src/GRANULAR/granular_model.h | 1 + src/GRANULAR/gsm.cpp | 1 + src/GRANULAR/gsm.h | 5 +++-- src/GRANULAR/gsm_damping.cpp | 6 +++++- src/GRANULAR/gsm_heat.cpp | 1 + src/GRANULAR/gsm_normal.cpp | 4 ++++ src/GRANULAR/gsm_tangential.cpp | 13 ++++--------- src/GRANULAR/gsm_tangential.h | 1 - src/GRANULAR/gsm_twisting.cpp | 1 + 10 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index f8a53c5cf2..66e34386ed 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -87,7 +87,6 @@ GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) #include "style_gsm.h" // IWYU pragma: keep #undef GSMStyle #undef GSM_CLASS - } /* ---------------------------------------------------------------------- */ @@ -241,6 +240,7 @@ void GranularModel::init() int size_cumulative; size_history = 0; + area_flag = 0; for (int i = 0; i < NSUBMODELS; i++) { if (sub_models[i]->nondefault_history_transfer) nondefault_history_transfer = 1; @@ -249,6 +249,7 @@ void GranularModel::init() size_history += sub_models[i]->size_history; if (!sub_models[i]->allow_cohesion && normal_model->cohesive_flag) error->all(FLERR,"Cannot use {} model with a cohesive normal model, {}", sub_models[i]->name, normal_model->name); + if (sub_models[i]->area_flag) area_flag = 1; } if (limit_damping && normal_model->cohesive_flag) @@ -410,7 +411,8 @@ void GranularModel::calculate_forces() // calculate forces/torques forces[0] = 0.0; double Fdamp, dist_to_contact; - area = normal_model->calculate_area(); + if (area_flag) + area = normal_model->calculate_area(); Fnormal = normal_model->calculate_forces(); Fdamp = damping_model->calculate_forces(); diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index dc404b332c..3ea3d9e4b3 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -98,6 +98,7 @@ class GranularModel : protected Pointers { protected: int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels int classic_model; + int area_flag; int nclass; diff --git a/src/GRANULAR/gsm.cpp b/src/GRANULAR/gsm.cpp index 1848a1743a..4ac7473504 100644 --- a/src/GRANULAR/gsm.cpp +++ b/src/GRANULAR/gsm.cpp @@ -42,6 +42,7 @@ GSM::GSM(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) allow_cohesion = 1; beyond_contact = 0; num_coeffs = 0; + area_flag = 0; nondefault_history_transfer = 0; transfer_history_factor = nullptr; diff --git a/src/GRANULAR/gsm.h b/src/GRANULAR/gsm.h index 4695749d64..3c19179d52 100644 --- a/src/GRANULAR/gsm.h +++ b/src/GRANULAR/gsm.h @@ -40,8 +40,9 @@ class GSM : protected Pointers { double *transfer_history_factor; int history_index; - int beyond_contact; - int allow_cohesion; + int beyond_contact; // If the submodel contact extends beyond overlap + int allow_cohesion; // If the submodel works with a cohesive normal force + int area_flag; // If the submodel requires area GranularModel *gm; diff --git a/src/GRANULAR/gsm_damping.cpp b/src/GRANULAR/gsm_damping.cpp index ed4bfd8ae1..db7f0f3371 100644 --- a/src/GRANULAR/gsm_damping.cpp +++ b/src/GRANULAR/gsm_damping.cpp @@ -44,6 +44,7 @@ GSMDampingNone::GSMDampingNone(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, double GSMDampingNone::calculate_forces() { + damp_prefactor = 0.0; return 0.0; } @@ -79,7 +80,10 @@ double GSMDampingMassVelocity::calculate_forces() Default, viscoelastic damping ------------------------------------------------------------------------- */ -GSMDampingViscoelastic::GSMDampingViscoelastic(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} +GSMDampingViscoelastic::GSMDampingViscoelastic(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) +{ + area_flag = 1; +} /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gsm_heat.cpp b/src/GRANULAR/gsm_heat.cpp index 7512e372a0..1a0cff5301 100644 --- a/src/GRANULAR/gsm_heat.cpp +++ b/src/GRANULAR/gsm_heat.cpp @@ -45,6 +45,7 @@ double GSMHeatNone::calculate_heat() GSMHeatArea::GSMHeatArea(GranularModel *gm, LAMMPS *lmp) : GSMHeat(gm, lmp) { num_coeffs = 1; + area_flag = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gsm_normal.cpp b/src/GRANULAR/gsm_normal.cpp index 0ae288f6fd..28e4d7af79 100644 --- a/src/GRANULAR/gsm_normal.cpp +++ b/src/GRANULAR/gsm_normal.cpp @@ -115,6 +115,7 @@ double GSMNormalHooke::calculate_forces() GSMNormalHertz::GSMNormalHertz(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) { num_coeffs = 2; + area_flag = 1; } /* ---------------------------------------------------------------------- */ @@ -142,6 +143,7 @@ GSMNormalHertzMaterial::GSMNormalHertzMaterial(GranularModel *gm, LAMMPS *lmp) : { material_properties = 1; num_coeffs = 3; + area_flag = 1; } /* ---------------------------------------------------------------------- */ @@ -179,6 +181,7 @@ GSMNormalDMT::GSMNormalDMT(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) material_properties = 1; cohesive_flag = 1; num_coeffs = 4; + area_flag = 1; } /* ---------------------------------------------------------------------- */ @@ -236,6 +239,7 @@ GSMNormalJKR::GSMNormalJKR(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) cohesive_flag = 1; beyond_contact = 1; num_coeffs = 4; + area_flag = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gsm_tangential.cpp b/src/GRANULAR/gsm_tangential.cpp index 862159c386..a5dabde8fd 100644 --- a/src/GRANULAR/gsm_tangential.cpp +++ b/src/GRANULAR/gsm_tangential.cpp @@ -165,7 +165,7 @@ void GSMTangentialLinearHistory::calculate_forces() GSMTangentialLinearHistoryClassic::GSMTangentialLinearHistoryClassic(GranularModel *gm, LAMMPS *lmp) : GSMTangentialLinearHistory(gm, lmp) { - scale_area = 0; // Sets gran/hooke/history behavior + area_flag = 1; // Sets gran/hooke/history behavior } /* ---------------------------------------------------------------------- */ @@ -197,7 +197,7 @@ void GSMTangentialLinearHistoryClassic::calculate_forces() } // tangential forces = history + tangential velocity damping - if (scale_area) scale3(-k * gm->area, history, gm->fs); + if (area_flag) scale3(-k * gm->area, history, gm->fs); else scale3(-k, history, gm->fs); scale3(damp, gm->vtr, temp_array); sub3(gm->fs, temp_array, gm->fs); @@ -224,7 +224,7 @@ void GSMTangentialLinearHistoryClassic::calculate_forces() GSMTangentialMindlinClassic::GSMTangentialMindlinClassic(GranularModel *gm, LAMMPS *lmp) : GSMTangentialLinearHistoryClassic(gm, lmp) { - scale_area = 1; // Sets gran/hertz/history behavior + area_flag = 1; // Sets gran/hertz/history behavior } /* ---------------------------------------------------------------------- @@ -237,6 +237,7 @@ GSMTangentialMindlin::GSMTangentialMindlin(GranularModel *gm, LAMMPS *lmp) : GSM size_history = 3; mindlin_force = 0; mindlin_rescale = 0; + area_flag = 1; } /* ---------------------------------------------------------------------- */ @@ -367,10 +368,7 @@ void GSMTangentialMindlin::calculate_forces() GSMTangentialMindlinForce::GSMTangentialMindlinForce(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) { - num_coeffs = 3; - size_history = 3; mindlin_force = 1; - mindlin_rescale = 0; } /* ---------------------------------------------------------------------- @@ -379,9 +377,7 @@ GSMTangentialMindlinForce::GSMTangentialMindlinForce(GranularModel *gm, LAMMPS * GSMTangentialMindlinRescale::GSMTangentialMindlinRescale(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) { - num_coeffs = 3; size_history = 4; - mindlin_force = 0; mindlin_rescale = 1; nondefault_history_transfer = 1; @@ -396,7 +392,6 @@ GSMTangentialMindlinRescale::GSMTangentialMindlinRescale(GranularModel *gm, LAMM GSMTangentialMindlinRescaleForce::GSMTangentialMindlinRescaleForce(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) { - num_coeffs = 3; size_history = 4; mindlin_force = 1; mindlin_rescale = 1; diff --git a/src/GRANULAR/gsm_tangential.h b/src/GRANULAR/gsm_tangential.h index 1d6dfa3d04..e755f63304 100644 --- a/src/GRANULAR/gsm_tangential.h +++ b/src/GRANULAR/gsm_tangential.h @@ -106,7 +106,6 @@ class GSMTangentialLinearHistoryClassic : public GSMTangentialLinearHistory { GSMTangentialLinearHistoryClassic(class GranularModel *, class LAMMPS *); void calculate_forces(); protected: - int scale_area; double xt; }; diff --git a/src/GRANULAR/gsm_twisting.cpp b/src/GRANULAR/gsm_twisting.cpp index 73149b099b..42609bf632 100644 --- a/src/GRANULAR/gsm_twisting.cpp +++ b/src/GRANULAR/gsm_twisting.cpp @@ -43,6 +43,7 @@ GSMTwistingMarshall::GSMTwistingMarshall(GranularModel *gm, LAMMPS *lmp) : GSMTw { num_coeffs = 0; size_history = 3; + area_flag = 1; } /* ---------------------------------------------------------------------- */ From ea8ded470bf0b62a886c7b3a8d15b3e14a53b556 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 9 Nov 2022 10:17:07 -0700 Subject: [PATCH 046/112] Removing vectors to avoid resizing issues with coeff redefinitions --- src/GRANULAR/fix_wall_gran.cpp | 1 + src/GRANULAR/pair_granular.cpp | 212 ++++++++++++++++++++------------- src/GRANULAR/pair_granular.h | 7 +- 3 files changed, 131 insertions(+), 89 deletions(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 4956e9d900..583cbba62e 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -721,4 +721,5 @@ int FixWallGran::size_restart(int /*nlocal*/) void FixWallGran::reset_dt() { dt = update->dt; + model->dt = dt; } diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 9601b87382..dcac8e32c3 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -57,7 +57,8 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) svector = new double[single_extra]; neighprev = 0; - + nmodels = 0; + maxmodels = 0; nmax = 0; mass_rigid = nullptr; @@ -66,8 +67,6 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) maxrad_dynamic = nullptr; maxrad_frozen = nullptr; - dt = update->dt; - // set comm size needed by this Pair if used with fix rigid comm_forward = 1; @@ -97,6 +96,9 @@ PairGranular::~PairGranular() memory->destroy(setflag); memory->destroy(cutsq); memory->destroy(cutoff_type); + memory->destroy(types_indices); + for (int i = 0; i < nmodels; i++) delete models_list[i]; + memory->sfree(models_list); delete [] onerad_dynamic; delete [] onerad_frozen; @@ -124,8 +126,8 @@ void PairGranular::compute(int eflag, int vflag) class GranularModel* model; - for (int i = 0; i < vec_models.size(); i++) - vec_models[i].history_update = history_update; + for (int i = 0; i < nmodels; i++) + models_list[i]->history_update = history_update; ev_init(eflag,vflag); @@ -193,7 +195,7 @@ void PairGranular::compute(int eflag, int vflag) if (factor_lj == 0) continue; jtype = type[j]; - model = models[itype][jtype]; + model = models_list[types_indices[itype][jtype]]; // Reset model and copy initial geometric data model->xi = x[i]; @@ -288,9 +290,6 @@ void PairGranular::allocate() allocated = 1; int n = atom->ntypes; - // Reserve enough memory for vector to avoid reallocation/changing pointers - vec_models.reserve(atom->ntypes * atom->ntypes); - memory->create(setflag,n+1,n+1,"pair:setflag"); for (int i = 1; i <= n; i++) for (int j = i; j <= n; j++) @@ -298,7 +297,11 @@ void PairGranular::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutoff_type,n+1,n+1,"pair:cutoff_type"); - models.resize(n+1, std::vector (n+1, nullptr)); + memory->create(types_indices,n+1,n+1,"pair:types_indices"); + + maxmodels = n * n + 1; // should never need any more space + models_list = (GranularModel **) memory->smalloc(maxmodels * sizeof(GranularModel *), "pair:models_list"); + for (int i = 0; i < maxmodels; i++) models_list[i] = nullptr; onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -336,27 +339,29 @@ void PairGranular::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - // Construct new model within vector - vec_models.emplace_back(lmp); + + // Construct new model + models_list[nmodels] = new GranularModel(lmp); + class GranularModel* model = models_list[nmodels]; + nmodels += 1; //Parse mandatory specification int iarg = 2; - iarg = vec_models.back().add_submodel(arg, iarg, narg, NORMAL); + iarg = model->add_submodel(arg, iarg, narg, NORMAL); //Parse optional arguments - while (iarg < narg) { if (strcmp(arg[iarg], "tangential") == 0) { - iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, TANGENTIAL); + iarg = model->add_submodel(arg, iarg + 1, narg, TANGENTIAL); } else if (strcmp(arg[iarg], "damping") == 0) { - iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, DAMPING); + iarg = model->add_submodel(arg, iarg + 1, narg, DAMPING); } else if (strcmp(arg[iarg], "rolling") == 0) { - iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, ROLLING); + iarg = model->add_submodel(arg, iarg + 1, narg, ROLLING); } else if (strcmp(arg[iarg], "twisting") == 0) { - iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, TWISTING); + iarg = model->add_submodel(arg, iarg + 1, narg, TWISTING); } else if (strcmp(arg[iarg], "heat") == 0) { - iarg = vec_models.back().add_submodel(arg, iarg + 1, narg, HEAT); + iarg = model->add_submodel(arg, iarg + 1, narg, HEAT); heat_flag = 1; } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) @@ -364,25 +369,28 @@ void PairGranular::coeff(int narg, char **arg) cutoff_one = utils::numeric(FLERR,arg[iarg + 1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "limit_damping") == 0) { - vec_models.back().limit_damping = 1; + model->limit_damping = 1; iarg += 1; } else error->all(FLERR, "Illegal pair_coeff command {}", arg[iarg]); } // Define default damping model if unspecified, has no coeffs - if (!vec_models.back().damping_model) - vec_models.back().construct_submodel("viscoelastic", DAMPING); + if (!model->damping_model) + model->construct_submodel("viscoelastic", DAMPING); int count = 0; for (int i = ilo; i <= ihi; i++) { for (int j = MAX(jlo,i); j <= jhi; j++) { - models[i][j] = & vec_models.back(); + types_indices[i][j] = nmodels - 1; cutoff_type[i][j] = cutoff_type[j][i] = cutoff_one; setflag[i][j] = 1; count++; } } + // If there are > ntype^2 models, delete unused ones + if (nmodels == maxmodels) prune_models(); + if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); } @@ -392,7 +400,6 @@ void PairGranular::coeff(int narg, char **arg) void PairGranular::init_style() { - int i; // error and warning checks if (!atom->radius_flag || !atom->rmass_flag) @@ -408,30 +415,33 @@ void PairGranular::init_style() } // allocate history and initialize models + class GranularModel* model; int size_max[NSUBMODELS] = {0}; + for (int n = 0; n < nmodels; n++) { + model = models_list[n]; + model->init(); - for (auto &model : vec_models) { - model.init(); - if (model.beyond_contact) { + if (model->beyond_contact) { beyond_contact = 1; use_history = 1; // Need to track if in contact } - if (model.size_history != 0) use_history = 1; + if (model->size_history != 0) use_history = 1; - for (i = 0; i < NSUBMODELS; i++) - if (model.sub_models[i]->size_history > size_max[i]) - size_max[i] = model.sub_models[i]->size_history; + for (int i = 0; i < NSUBMODELS; i++) + if (model->sub_models[i]->size_history > size_max[i]) + size_max[i] = model->sub_models[i]->size_history; - if (model.nondefault_history_transfer) nondefault_history_transfer = 1; + if (model->nondefault_history_transfer) nondefault_history_transfer = 1; } size_history = 0; - for (i = 0; i < NSUBMODELS; i++) size_history += size_max[i]; + for (int i = 0; i < NSUBMODELS; i++) size_history += size_max[i]; - for (auto &model : vec_models) { + for (int n = 0; n < nmodels; n++) { + model = models_list[n]; int next_index = 0; - for (i = 0; i < NSUBMODELS; i++) { - model.sub_models[i]->history_index = next_index; + for (int i = 0; i < NSUBMODELS; i++) { + model->sub_models[i]->history_index = next_index; next_index += size_max[i]; } } @@ -439,8 +449,6 @@ void PairGranular::init_style() if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE|NeighConst::REQ_HISTORY); else neighbor->add_request(this, NeighConst::REQ_SIZE); - dt = update->dt; - // if history is stored and first init, create Fix to store history // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved @@ -483,7 +491,7 @@ void PairGranular::init_style() // include future FixPour and FixDeposit particles as dynamic int itype; - for (i = 1; i <= atom->ntypes; i++) { + for (int i = 1; i <= atom->ntypes; i++) { onerad_dynamic[i] = onerad_frozen[i] = 0.0; for (auto &ipour : pours) { itype = i; @@ -502,7 +510,7 @@ void PairGranular::init_style() int *type = atom->type; int nlocal = atom->nlocal; - for (i = 0; i < nlocal; i++) { + for (int i = 0; i < nlocal; i++) { if (mask[i] & freeze_group_bit) onerad_frozen[type[i]] = MAX(onerad_frozen[type[i]], radius[i]); else @@ -527,32 +535,42 @@ void PairGranular::init_style() double PairGranular::init_one(int i, int j) { double cutoff = 0.0; + class GranularModel* model; if (setflag[i][j] == 0) { - vec_models.push_back(GranularModel(lmp)); - models[i][j] = models[j][i] = & vec_models.back(); + models_list[nmodels] = new GranularModel(lmp); + types_indices[i][j] = nmodels; + model = models_list[nmodels]; - int error_code = vec_models.back().mix_coeffs(models[i][i], models[j][j]); + nmodels += 1; + if (nmodels == maxmodels) prune_models(); + + class GranularModel* model1 = models_list[types_indices[i][i]]; + class GranularModel* model2 = models_list[types_indices[j][j]]; + + int error_code = model->mix_coeffs(model1, model2); if (error_code != -1) error->all(FLERR,"Granular pair style functional forms are different, " "cannot mix coefficients for types {} and {} \n" "with submodels {} and {}. \n" "This combination must be set explicitly via a " "pair_coeff command",i,j, - models[i][i]->sub_models[error_code]->name, - models[j][j]->sub_models[error_code]->name); + model1->sub_models[error_code]->name, + model2->sub_models[error_code]->name); - vec_models.back().init(); // Calculates cumulative properties of sub models + // Initialize new model, init_one() occurs after init_style + model->init(); for (int k = 0; k < NSUBMODELS; k++) - vec_models.back().sub_models[k]->history_index = models[i][i]->sub_models[k]->history_index; + model->sub_models[k]->history_index = model1->sub_models[k]->history_index; cutoff_type[i][j] = cutoff_type[j][i] = MAX(cutoff_type[i][i], cutoff_type[j][j]); } + model = models_list[types_indices[i][j]]; // Check if heat model is defined for all type combinations - if (heat_flag && !models[i][j]->heat_model) + if (heat_flag && !model->heat_model) error->all(FLERR, "Must specify a heat model for all pair types"); // It is possible that cut[i][j] at this point is still 0.0. @@ -571,14 +589,14 @@ double PairGranular::init_one(int i, int j) ((maxrad_frozen[i] > 0.0) && (maxrad_dynamic[j] > 0.0))) { cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; pulloff = 0.0; - if (models[i][j]->beyond_contact) { - pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j]); + if (model->beyond_contact) { + pulloff = model->pulloff_distance(maxrad_dynamic[i], maxrad_dynamic[j]); cutoff += pulloff; - pulloff = models[i][j]->pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j]); + pulloff = model->pulloff_distance(maxrad_frozen[i], maxrad_dynamic[j]); cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j] + pulloff); - pulloff = models[i][j]->pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j]); + pulloff = model->pulloff_distance(maxrad_dynamic[i], maxrad_frozen[j]); cutoff = MAX(cutoff,maxrad_dynamic[i] + maxrad_frozen[j] + pulloff); } } else { @@ -599,9 +617,8 @@ double PairGranular::init_one(int i, int j) cutoff = cutoff_global; } - // Copy global options - models[i][j]->dt = dt; - models[j][i] = models[i][j]; + model->dt = update->dt; + types_indices[j][i] = types_indices[i][j]; return cutoff; } @@ -611,18 +628,16 @@ double PairGranular::init_one(int i, int j) void PairGranular::write_restart(FILE *fp) { - int i,j,index; - int nmodels = vec_models.size(); + int i,j; fwrite(&nmodels,sizeof(int),1,fp); - for (auto &model : vec_models) model.write_restart(fp); + for (i = 0; i < nmodels; i++) models_list[i]->write_restart(fp); for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { fwrite(&cutoff_type[i][j],sizeof(double),1,fp); - index = models[i][j] - &vec_models[0]; - fwrite(&index,sizeof(int),1,fp); // save index of model + fwrite(&types_indices[i][j],sizeof(int),1,fp); } } } @@ -635,16 +650,15 @@ void PairGranular::write_restart(FILE *fp) void PairGranular::read_restart(FILE *fp) { allocate(); - int i,j,index,nmodels; + int i,j; int me = comm->me; if (me == 0) utils::sfread(FLERR,&nmodels,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nmodels,1,MPI_INT,0,world); for (i = 0; i < nmodels; i++) { - vec_models.push_back(GranularModel(lmp)); - vec_models.back().read_restart(fp); - vec_models.back().init(); + models_list[i] = new GranularModel(lmp); + models_list[i]->read_restart(fp); } for (i = 1; i <= atom->ntypes; i++) { @@ -654,12 +668,10 @@ void PairGranular::read_restart(FILE *fp) if (setflag[i][j]) { if (me == 0) { utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&index,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&types_indices[i][j],sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cutoff_type[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&index,1,MPI_INT,0,world); - - models[i][j] = & vec_models[index]; + MPI_Bcast(&types_indices[i][j],1,MPI_INT,0,world); } } } @@ -669,13 +681,7 @@ void PairGranular::read_restart(FILE *fp) void PairGranular::reset_dt() { - dt = update->dt; - - for (int i = 1; i <= atom->ntypes; i++) { - for (int j = i; j <= atom->ntypes; j++) { - models[i][j]->dt = dt; - } - } + for (int i = 0; i < nmodels; i++) models_list[i]->dt = update->dt; } /* ---------------------------------------------------------------------- */ @@ -703,7 +709,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, double **x = atom->x; double *radius = atom->radius; - class GranularModel* model = models[itype][jtype]; + class GranularModel* model = models_list[types_indices[itype][jtype]]; // Reset model and copy initial geometric data model->xi = x[i]; @@ -771,11 +777,9 @@ double PairGranular::single(int i, int j, int itype, int jtype, torquesj = model->torquesj; // apply forces & torques - fforce = MathExtra::len3(forces); // set single_extra quantities - svector[0] = model->fs[0]; svector[1] = model->fs[1]; svector[2] = model->fs[2]; @@ -836,9 +840,10 @@ double PairGranular::memory_usage() void PairGranular::transfer_history(double* source, double* target, int itype, int jtype) { - if (models[itype][jtype]->nondefault_history_transfer) { + class GranularModel* model = models_list[types_indices[itype][jtype]]; + if (model->nondefault_history_transfer) { for (int i = 0; i < size_history; i++) { - target[i] = models[itype][jtype]->transfer_history_factor[i] * source [i]; + target[i] = model->transfer_history_factor[i] * source [i]; } } else { for (int i = 0; i < size_history; i++) { @@ -858,8 +863,9 @@ double PairGranular::atom2cut(int i) cut = atom->radius[i] * 2; if (beyond_contact) { int itype = atom->type[i]; - if (models[itype][itype]->beyond_contact) { - cut += models[itype][itype]->pulloff_distance(cut, cut); + class GranularModel* model = models_list[types_indices[itype][itype]]; + if (model->beyond_contact) { + cut += model->pulloff_distance(cut, cut); } } @@ -879,10 +885,12 @@ double PairGranular::radii2cut(double r1, double r2) double temp; // Check all combinations of i and j to find theoretical maximum pull off distance - for (int i = 0; i < n; i++){ - for (int j = 0; j < n; j++){ - if (models[i][j]->beyond_contact) { - temp = models[i][j]->pulloff_distance(r1, r2); + class GranularModel* model; + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= n; j++) { + model = models_list[types_indices[i][j]]; + if (model->beyond_contact) { + temp = model->pulloff_distance(r1, r2); if (temp > cut) cut = temp; } } @@ -893,3 +901,35 @@ double PairGranular::radii2cut(double r1, double r2) return cut; } + +/* ---------------------------------------------------------------------- + remove unused models +------------------------------------------------------------------------- */ + +void PairGranular::prune_models() +{ + int ntypes = atom->ntypes; + for (int n = nmodels-1; n >= 0; n--) { + + // Find and delete unused models + int in_use = 0; + for (int i = 1; i <= ntypes; i++) + for (int j = 1; j <= ntypes; j++) + if (types_indices[i][j] == n) in_use = 1; + + if (in_use) continue; + delete models_list[n]; + + // Shift models if needed + if (n != nmodels - 1) { + models_list[n] = models_list[nmodels-1]; + for (int i = 1; i <= ntypes; i++) + for (int j = 1; j <= ntypes; j++) + if (types_indices[i][j] == nmodels-1) + types_indices[i][j] = n; + } + + models_list[nmodels-1] = nullptr; + nmodels -= 1; + } +} diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index ae09e37f5e..9ae02a200a 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -46,7 +46,6 @@ class PairGranular : public Pair { double radii2cut(double, double) override; protected: - double dt; int freeze_group_bit; int use_history; @@ -66,14 +65,16 @@ class PairGranular : public Pair { void allocate(); void transfer_history(double *, double *, int, int) override; + void prune_models(); private: int size_history; int heat_flag; // granular models - std::vector vec_models; - std::vector > models; + int nmodels, maxmodels; + Granular_NS::GranularModel** models_list; + int **types_indices; // optional user-specified global cutoff, per-type user-specified cutoffs double **cutoff_type; From d1dd8d3c110c117ce49e8144df7a68deae789156 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Thu, 10 Nov 2022 16:06:36 -0700 Subject: [PATCH 047/112] Renaming files/classes, other small, misc updates --- cmake/Modules/StyleHeaderUtils.cmake | 42 +++---- doc/src/Modify.rst | 2 +- ...Modify_gsm.rst => Modify_gran_sub_mod.rst} | 103 +++++++++--------- ...rate.rst => fix_heat_flow_sphere_temp.rst} | 12 +- src/.gitignore | 32 +++--- ...rate.cpp => fix_heat_flow_sphere_temp.cpp} | 17 ++- ...ntegrate.h => fix_heat_flow_sphere_temp.h} | 10 +- src/GRANULAR/fix_wall_gran.cpp | 2 +- src/GRANULAR/fix_wall_gran.h | 6 +- src/GRANULAR/{gsm.cpp => gran_sub_mod.cpp} | 22 ++-- src/GRANULAR/{gsm.h => gran_sub_mod.h} | 12 +- ...m_damping.cpp => gran_sub_mod_damping.cpp} | 30 ++--- .../{gsm_damping.h => gran_sub_mod_damping.h} | 58 +++++----- .../{gsm_heat.cpp => gran_sub_mod_heat.cpp} | 14 +-- .../{gsm_heat.h => gran_sub_mod_heat.h} | 34 +++--- ...gsm_normal.cpp => gran_sub_mod_normal.cpp} | 60 +++++----- .../{gsm_normal.h => gran_sub_mod_normal.h} | 66 +++++------ ...m_rolling.cpp => gran_sub_mod_rolling.cpp} | 16 +-- .../{gsm_rolling.h => gran_sub_mod_rolling.h} | 34 +++--- ...ential.cpp => gran_sub_mod_tangential.cpp} | 44 ++++---- ...tangential.h => gran_sub_mod_tangential.h} | 90 +++++++-------- ...twisting.cpp => gran_sub_mod_twisting.cpp} | 22 ++-- ...gsm_twisting.h => gran_sub_mod_twisting.h} | 42 +++---- src/GRANULAR/granular_model.cpp | 68 ++++++------ src/GRANULAR/granular_model.h | 38 +++---- src/GRANULAR/pair_granular.cpp | 2 +- src/GRANULAR/pair_granular.h | 7 +- src/Make.sh | 42 +++---- 28 files changed, 468 insertions(+), 459 deletions(-) rename doc/src/{Modify_gsm.rst => Modify_gran_sub_mod.rst} (59%) rename doc/src/{fix_temp_integrate.rst => fix_heat_flow_sphere_temp.rst} (85%) rename src/GRANULAR/{fix_temp_integrate.cpp => fix_heat_flow_sphere_temp.cpp} (89%) rename src/GRANULAR/{fix_temp_integrate.h => fix_heat_flow_sphere_temp.h} (82%) rename src/GRANULAR/{gsm.cpp => gran_sub_mod.cpp} (85%) rename src/GRANULAR/{gsm.h => gran_sub_mod.h} (89%) rename src/GRANULAR/{gsm_damping.cpp => gran_sub_mod_damping.cpp} (74%) rename src/GRANULAR/{gsm_damping.h => gran_sub_mod_damping.h} (58%) rename src/GRANULAR/{gsm_heat.cpp => gran_sub_mod_heat.cpp} (79%) rename src/GRANULAR/{gsm_heat.h => gran_sub_mod_heat.h} (66%) rename src/GRANULAR/{gsm_normal.cpp => gran_sub_mod_normal.cpp} (82%) rename src/GRANULAR/{gsm_normal.h => gran_sub_mod_normal.h} (65%) rename src/GRANULAR/{gsm_rolling.cpp => gran_sub_mod_rolling.cpp} (87%) rename src/GRANULAR/{gsm_rolling.h => gran_sub_mod_rolling.h} (65%) rename src/GRANULAR/{gsm_tangential.cpp => gran_sub_mod_tangential.cpp} (84%) rename src/GRANULAR/{gsm_tangential.h => gran_sub_mod_tangential.h} (50%) rename src/GRANULAR/{gsm_twisting.cpp => gran_sub_mod_twisting.cpp} (82%) rename src/GRANULAR/{gsm_twisting.h => gran_sub_mod_twisting.h} (62%) diff --git a/cmake/Modules/StyleHeaderUtils.cmake b/cmake/Modules/StyleHeaderUtils.cmake index 2bc84252d3..d95e265c4a 100644 --- a/cmake/Modules/StyleHeaderUtils.cmake +++ b/cmake/Modules/StyleHeaderUtils.cmake @@ -95,27 +95,27 @@ function(RegisterIntegrateStyle path) endfunction(RegisterIntegrateStyle) function(RegisterStyles search_path) - FindStyleHeaders(${search_path} ANGLE_CLASS angle_ ANGLE ) # angle ) # force - FindStyleHeaders(${search_path} ATOM_CLASS atom_vec_ ATOM_VEC ) # atom ) # atom atom_vec_hybrid - FindStyleHeaders(${search_path} BODY_CLASS body_ BODY ) # body ) # atom_vec_body - FindStyleHeaders(${search_path} BOND_CLASS bond_ BOND ) # bond ) # force - FindStyleHeaders(${search_path} COMMAND_CLASS "[^.]" COMMAND ) # command ) # input - FindStyleHeaders(${search_path} COMPUTE_CLASS compute_ COMPUTE ) # compute ) # modify - FindStyleHeaders(${search_path} DIHEDRAL_CLASS dihedral_ DIHEDRAL ) # dihedral ) # force - FindStyleHeaders(${search_path} DUMP_CLASS dump_ DUMP ) # dump ) # output write_dump - FindStyleHeaders(${search_path} FIX_CLASS fix_ FIX ) # fix ) # modify - FindStyleHeaders(${search_path} GSM_CLASS gsm_ GSM ) # gsm ) # granular_model - FindStyleHeaders(${search_path} IMPROPER_CLASS improper_ IMPROPER ) # improper ) # force - FindStyleHeaders(${search_path} INTEGRATE_CLASS "[^.]" INTEGRATE ) # integrate ) # update - FindStyleHeaders(${search_path} KSPACE_CLASS "[^.]" KSPACE ) # kspace ) # force - FindStyleHeaders(${search_path} MINIMIZE_CLASS min_ MINIMIZE ) # minimize ) # update - FindStyleHeaders(${search_path} NBIN_CLASS nbin_ NBIN ) # nbin ) # neighbor - FindStyleHeaders(${search_path} NPAIR_CLASS npair_ NPAIR ) # npair ) # neighbor - FindStyleHeaders(${search_path} NSTENCIL_CLASS nstencil_ NSTENCIL ) # nstencil ) # neighbor - FindStyleHeaders(${search_path} NTOPO_CLASS ntopo_ NTOPO ) # ntopo ) # neighbor - FindStyleHeaders(${search_path} PAIR_CLASS pair_ PAIR ) # pair ) # force - FindStyleHeaders(${search_path} READER_CLASS reader_ READER ) # reader ) # read_dump - FindStyleHeaders(${search_path} REGION_CLASS region_ REGION ) # region ) # domain + FindStyleHeaders(${search_path} ANGLE_CLASS angle_ ANGLE ) # angle ) # force + FindStyleHeaders(${search_path} ATOM_CLASS atom_vec_ ATOM_VEC ) # atom ) # atom atom_vec_hybrid + FindStyleHeaders(${search_path} BODY_CLASS body_ BODY ) # body ) # atom_vec_body + FindStyleHeaders(${search_path} BOND_CLASS bond_ BOND ) # bond ) # force + FindStyleHeaders(${search_path} COMMAND_CLASS "[^.]" COMMAND ) # command ) # input + FindStyleHeaders(${search_path} COMPUTE_CLASS compute_ COMPUTE ) # compute ) # modify + FindStyleHeaders(${search_path} DIHEDRAL_CLASS dihedral_ DIHEDRAL ) # dihedral ) # force + FindStyleHeaders(${search_path} DUMP_CLASS dump_ DUMP ) # dump ) # output write_dump + FindStyleHeaders(${search_path} FIX_CLASS fix_ FIX ) # fix ) # modify + FindStyleHeaders(${search_path} GRAN_SUB_MOD_CLASS gran_sub_mod_ GRAN_SUB_MOD ) # gran_sub_mod ) # granular_model + FindStyleHeaders(${search_path} IMPROPER_CLASS improper_ IMPROPER ) # improper ) # force + FindStyleHeaders(${search_path} INTEGRATE_CLASS "[^.]" INTEGRATE ) # integrate ) # update + FindStyleHeaders(${search_path} KSPACE_CLASS "[^.]" KSPACE ) # kspace ) # force + FindStyleHeaders(${search_path} MINIMIZE_CLASS min_ MINIMIZE ) # minimize ) # update + FindStyleHeaders(${search_path} NBIN_CLASS nbin_ NBIN ) # nbin ) # neighbor + FindStyleHeaders(${search_path} NPAIR_CLASS npair_ NPAIR ) # npair ) # neighbor + FindStyleHeaders(${search_path} NSTENCIL_CLASS nstencil_ NSTENCIL ) # nstencil ) # neighbor + FindStyleHeaders(${search_path} NTOPO_CLASS ntopo_ NTOPO ) # ntopo ) # neighbor + FindStyleHeaders(${search_path} PAIR_CLASS pair_ PAIR ) # pair ) # force + FindStyleHeaders(${search_path} READER_CLASS reader_ READER ) # reader ) # read_dump + FindStyleHeaders(${search_path} REGION_CLASS region_ REGION ) # region ) # domain endfunction(RegisterStyles) function(RegisterStylesExt search_path extension sources) diff --git a/doc/src/Modify.rst b/doc/src/Modify.rst index 39a1faeb87..8ea7850fc5 100644 --- a/doc/src/Modify.rst +++ b/doc/src/Modify.rst @@ -34,6 +34,6 @@ style requirements and recommendations `. Modify_min Modify_region Modify_body - Modify_gsm + Modify_gran_sub_mod Modify_thermo Modify_variable diff --git a/doc/src/Modify_gsm.rst b/doc/src/Modify_gran_sub_mod.rst similarity index 59% rename from doc/src/Modify_gsm.rst rename to doc/src/Modify_gran_sub_mod.rst index 515c776c6c..fe8b0da275 100644 --- a/doc/src/Modify_gsm.rst +++ b/doc/src/Modify_gran_sub_mod.rst @@ -1,4 +1,4 @@ -Granular Sub-model (GSM) styles +Granular Sub-Model styles =============================== In granular models, particles are spheres with a finite radius and rotational @@ -11,27 +11,27 @@ torques, and heat flow between two types of bodies is defined using a GranularModel class. The GranularModel class organizes the details of an interaction using a series of granular sub-models each of which describe a particular interaction mode (e.g. normal forces or rolling friction). From a -parent GSM class, several types of sub-model classes are derived: +parent GranSubMod class, several types of sub-model classes are derived: -* GSMNormal: normal force sub-model -* GSMDamping: normal damping sub-model -* GSMTangential: tangential forces and sliding friction sub-model -* GSMRolling: rolling friction sub-model -* GSMTwisting: twisting friction sub-model -* GSMHeat: heat conduction sub-model +* GranSubModNormal: normal force sub-model +* GranSubModDamping: normal damping sub-model +* GranSubModTangential: tangential forces and sliding friction sub-model +* GranSubModRolling: rolling friction sub-model +* GranSubModTwisting: twisting friction sub-model +* GranSubModHeat: heat conduction sub-model For each type of sub-model, more classes are further derived, each describing -a specific implementation. For instance, from the GSMNormal class the -GSMNormalHooke, GSMNormalHertz, and GSMNormalJKR classes are derived which -calculate Hookean, Hertzian, or JKR normal forces, respectively. This modular -structure simplifies the addition of new granular contact models as as one only -needs to create a new GSM class without having to modify the more complex -PairGranular, FixGranWall, and GranularModel classes. Most GSM methods are also -already defined by the parent classes so new contact models typically only require -edits to a few relevant methods (e.g. methods that define coefficients and +a specific implementation. For instance, from the GranSubModNormal class the +GranSubModNormalHooke, GranSubModNormalHertz, and GranSubModNormalJKR classes +are derived which calculate Hookean, Hertzian, or JKR normal forces, respectively. +This modular structure simplifies the addition of new granular contact models as +as one onlyneeds to create a new GranSubMod class without having to modify the more +complex PairGranular, FixGranWall, and GranularModel classes. Most GranSubMod methods +are also already defined by the parent classes so new contact models typically only +require edits to a few relevant methods (e.g. methods that define coefficients and calculate forces). -Each GSM class has a pointer to both the LAMMPS class and the GranularModel +Each GranSubMod class has a pointer to both the LAMMPS class and the GranularModel class which owns it, ``lmp`` and ``gm``, respectively. The GranularModel class includes several public variables that describe the geometry/dynamics of the contact such as @@ -59,69 +59,70 @@ These quantities, among others, are calculated in the ``GranularModel->check_con and ``GranularModel->calculate_forces()`` methods which can be referred to for more details. -To create a new GSM class, it is recommended that one first looks at similar GSM -classes. All GSM classes share several general methods which may need to be defined +To create a new GranSubMod class, it is recommended that one first looks at similar +GranSubMod classes. All GranSubMod classes share several general methods which may +need to be defined .. list-table:: - * - ``GSM->mix_coeff()`` + * - ``GranSubMod->mix_coeff()`` - Optional method to define how coefficients are mixed for different atom types. By default, coefficients are mixed using a geometric mean. - * - ``GSM->coeffs_to_local()`` + * - ``GranSubMod->coeffs_to_local()`` - Parses coefficients to define local variables. Run once at model construction. - * - ``GSM->init()`` - - Optional method to define local variables after other GSM types were created. For instance, this method may be used by a tangential model that derives parameters from the normal model. + * - ``GranSubMod->init()`` + - Optional method to define local variables after other GranSubMod types were created. For instance, this method may be used by a tangential model that derives parameters from the normal model. There are also several type-specific methods .. list-table:: - * - ``GSMNormal->touch()`` + * - ``GranSubModNormal->touch()`` - Optional method to test when particles are in contact. By default, this is when particles overlap. - * - ``GSMNormal->pulloff_distance()`` + * - ``GranSubModNormal->pulloff_distance()`` - Optional method to return the distance at which particles stop interacting. By default, this is when particles no longer overlap. - * - ``GSMNormal->calculate_area()`` + * - ``GranSubModNormal->calculate_area()`` - Optional method to return the surface area of the contact. By default, this returns the geometric cross section. - * - ``GSMNormal->set_fncrit()`` + * - ``GranSubModNormal->set_fncrit()`` - Optional method that defines the critical force to break the contact used by some tangential, rolling, and twisting sub-models. By default, this is the current total normal force including damping. - * - ``GSMNormal->calculate_forces()`` + * - ``GranSubModNormal->calculate_forces()`` - Required method that returns the normal contact force - * - ``GSMDamping->calculate_forces()`` + * - ``GranSubModDamping->calculate_forces()`` - Required method that returns the normal damping force - * - ``GSMTangential->calculate_forces()`` + * - ``GranSubModTangential->calculate_forces()`` - Required method that calculates tangential forces/torques - * - ``GSMTwisting->calculate_forces()`` + * - ``GranSubModTwisting->calculate_forces()`` - Required method that calculates twisting friction forces/torques - * - ``GSMRolling->calculate_forces()`` + * - ``GranSubModRolling->calculate_forces()`` - Required method that calculates rolling friction forces/torques - * - ``GSMHeat->calculate_heat()`` + * - ``GranSubModHeat->calculate_heat()`` - Required method that returns the rate of heat flow As an example, say one wanted to create a new normal force option that consisted of a Hookean force with a piecewise stiffness. This could be done by adding a new -set of files ``gsm_custom.h``: +set of files ``gran_sub_mod_custom.h``: .. code-block:: c++ - #ifdef GSM_CLASS + #ifdef GranSubMod_CLASS // clang-format off - GSMStyle(hooke/piecewise, - GSMNormalHookePiecewise, + GranSubModStyle(hooke/piecewise, + GranSubModNormalHookePiecewise, NORMAL); // clang-format on #else - #ifndef GSM_CUSTOM_H_ - #define GSM_CUSTOM_H_ + #ifndef GRAN_SUB_MOD_CUSTOM_H_ + #define GRAN_SUB_MOD_CUSTOM_H_ - #include "gsm.h" - #include "gsm_normal.h" + #include "gran_sub_mod.h" + #include "gran_sub_mod_normal.h" namespace LAMMPS_NS { namespace Granular_NS { - class GSMNormalHookePiecewise : public GSMNormal { + class GranSubModNormalHookePiecewise : public GranSubModNormal { public: - GSMNormalHookePiecewise(class GranularModel *, class LAMMPS *); + GranSubModNormalHookePiecewise(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; double calculate_forces(); protected: @@ -131,29 +132,29 @@ set of files ``gsm_custom.h``: } // namespace Granular_NS } // namespace LAMMPS_NS - #endif /*GSM_CUSTOM_H_ */ - #endif /*GSM_CLASS_H_ */ + #endif /*GRAN_SUB_MOD_CUSTOM_H_ */ + #endif /*GRAN_SUB_MOD_CLASS_H_ */ -and ``gsm_custom.cpp`` +and ``gran_sub_mod_custom.cpp`` .. code-block:: c++ - #include "gsm_custom.h" - #include "gsm_normal.h" + #include "gran_sub_mod_custom.h" + #include "gran_sub_mod_normal.h" #include "granular_model.h" using namespace LAMMPS_NS; using namespace Granular_NS; - GSMNormalHookePiecewise::GSMNormalHookePiecewise(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) + GranSubModNormalHookePiecewise::GranSubModNormalHookePiecewise(GranularModel *gm, LAMMPS *lmp) : GranSubModNormal(gm, lmp) { num_coeffs = 4; } /* ---------------------------------------------------------------------- */ - void GSMNormalHookePiecewise::coeffs_to_local() + void GranSubModNormalHookePiecewise::coeffs_to_local() { k1 = coeffs[0]; k2 = coeffs[1]; @@ -163,7 +164,7 @@ and ``gsm_custom.cpp`` /* ---------------------------------------------------------------------- */ - double GSMNormalHookePiecewise::calculate_forces() + double GranSubModNormalHookePiecewise::calculate_forces() { double Fne; if (gm->delta >= delta_switch) { diff --git a/doc/src/fix_temp_integrate.rst b/doc/src/fix_heat_flow_sphere_temp.rst similarity index 85% rename from doc/src/fix_temp_integrate.rst rename to doc/src/fix_heat_flow_sphere_temp.rst index efcf450d8f..c604b041ad 100644 --- a/doc/src/fix_temp_integrate.rst +++ b/doc/src/fix_heat_flow_sphere_temp.rst @@ -1,6 +1,6 @@ -.. index:: fix temp/integrate +.. index:: fix heat/flow/sphere/temp -fix temp/integrate command +fix heat/flow/sphere/temp command ========================== Syntax @@ -8,10 +8,10 @@ Syntax .. parsed-literal:: - fix ID group-ID temp/integrate style values ... + fix ID group-ID heat/flow/sphere/temp style values ... * ID, group-ID are documented in :doc:`fix ` command -* temp/integrate = style name of this fix command +* heat/flow/sphere/temp = style name of this fix command * one style with corresponding value(s) needs to be listed .. parsed-literal:: @@ -29,8 +29,8 @@ Examples .. code-block:: LAMMPS - fix 1 all temp/integrate constant 1.0 - fix 1 all temp/integrate type 1.0 0.5 + fix 1 all heat/flow/sphere/temp constant 1.0 + fix 1 all heat/flow/sphere/temp type 1.0 0.5 Description """"""""""" diff --git a/src/.gitignore b/src/.gitignore index c03af484ee..f2f2d3c110 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1533,8 +1533,8 @@ /fix_srp.h /fix_srp_react.cpp /fix_srp_react.h -/fix_temp_integrate.cpp -/fix_temp_integrate.h +/fix_heat_flow_sphere_temp.cpp +/fix_heat_flow_sphere_temp.h /fix_tfmc.cpp /fix_tfmc.h /fix_ttm.cpp @@ -1545,20 +1545,20 @@ /fix_ttm_mod.h /granular_model.cpp /granular_model.h -/gsm_normal.cpp -/gsm_normal.h -/gsm_damping.cpp -/gsm_damping.h -/gsm_tangential.cpp -/gsm_tangential.h -/gsm_twisting.cpp -/gsm_twisting.h -/gsm_rolling.cpp -/gsm_rolling.h -/gsm_heat.cpp -/gsm_heat.h -/gsm.cpp -/gsm.h +/gran_sub_mod_normal.cpp +/gran_sub_mod_normal.h +/gran_sub_mod_damping.cpp +/gran_sub_mod_damping.h +/gran_sub_mod_tangential.cpp +/gran_sub_mod_tangential.h +/gran_sub_mod_twisting.cpp +/gran_sub_mod_twisting.h +/gran_sub_mod_rolling.cpp +/gran_sub_mod_rolling.h +/gran_sub_mod_heat.cpp +/gran_sub_mod_heat.h +/gran_sub_mod.cpp +/gran_sub_mod.h /pair_born_coul_long_cs.cpp /pair_born_coul_long_cs.h /pair_born_coul_dsf_cs.cpp diff --git a/src/GRANULAR/fix_temp_integrate.cpp b/src/GRANULAR/fix_heat_flow_sphere_temp.cpp similarity index 89% rename from src/GRANULAR/fix_temp_integrate.cpp rename to src/GRANULAR/fix_heat_flow_sphere_temp.cpp index ab9739e874..fe7fc49324 100644 --- a/src/GRANULAR/fix_temp_integrate.cpp +++ b/src/GRANULAR/fix_heat_flow_sphere_temp.cpp @@ -12,7 +12,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "fix_temp_integrate.h" +#include "fix_heat_flow_sphere_temp.h" #include "atom.h" #include "error.h" @@ -28,7 +28,7 @@ enum {NONE, CONSTANT, TYPE}; /* ---------------------------------------------------------------------- */ -FixTempIntegrate::FixTempIntegrate(LAMMPS *lmp, int narg, char **arg) : +FixHeatFlowSphereTemp::FixHeatFlowSphereTemp(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal fix command"); @@ -56,12 +56,11 @@ FixTempIntegrate::FixTempIntegrate(LAMMPS *lmp, int narg, char **arg) : if (cp_style == NONE) error->all(FLERR, "Must specify specific heat in fix temp/integrate"); dynamic_group_allow = 1; - time_integrate = 1; } /* ---------------------------------------------------------------------- */ -int FixTempIntegrate::setmask() +int FixHeatFlowSphereTemp::setmask() { int mask = 0; mask |= FINAL_INTEGRATE; @@ -71,7 +70,7 @@ int FixTempIntegrate::setmask() /* ---------------------------------------------------------------------- */ -void FixTempIntegrate::init() +void FixHeatFlowSphereTemp::init() { dt = update->dt; @@ -83,7 +82,7 @@ void FixTempIntegrate::init() /* ---------------------------------------------------------------------- */ -void FixTempIntegrate::final_integrate() +void FixHeatFlowSphereTemp::final_integrate() { // update temperature of atoms in group @@ -111,7 +110,7 @@ void FixTempIntegrate::final_integrate() /* ---------------------------------------------------------------------- */ -void FixTempIntegrate::final_integrate_respa(int ilevel, int /*iloop*/) +void FixHeatFlowSphereTemp::final_integrate_respa(int ilevel, int /*iloop*/) { dt = update->dt; final_integrate(); @@ -119,14 +118,14 @@ void FixTempIntegrate::final_integrate_respa(int ilevel, int /*iloop*/) /* ---------------------------------------------------------------------- */ -void FixTempIntegrate::reset_dt() +void FixHeatFlowSphereTemp::reset_dt() { dt = update->dt; } /* ---------------------------------------------------------------------- */ -double FixTempIntegrate::calc_cp(int i) +double FixHeatFlowSphereTemp::calc_cp(int i) { if (cp_style == TYPE) { return cp_type[atom->type[i]]; diff --git a/src/GRANULAR/fix_temp_integrate.h b/src/GRANULAR/fix_heat_flow_sphere_temp.h similarity index 82% rename from src/GRANULAR/fix_temp_integrate.h rename to src/GRANULAR/fix_heat_flow_sphere_temp.h index 8356d00433..6bc2d50373 100644 --- a/src/GRANULAR/fix_temp_integrate.h +++ b/src/GRANULAR/fix_heat_flow_sphere_temp.h @@ -13,20 +13,20 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(temp/integrate,FixTempIntegrate); +FixStyle(heat/flow/sphere/temp,FixHeatFlowSphereTemp); // clang-format on #else -#ifndef LMP_FIX_TEMP_INTEGRATE_H -#define LMP_FIX_TEMP_INTEGRATE_H +#ifndef LMP_FIX_HEAT_FLOW_SPHERE_TEMP_H +#define LMP_FIX_HEAT_FLOW_SPHERE_TEMP_H #include "fix.h" namespace LAMMPS_NS { -class FixTempIntegrate : public Fix { +class FixHeatFlowSphereTemp : public Fix { public: - FixTempIntegrate(class LAMMPS *, int, char **); + FixHeatFlowSphereTemp(class LAMMPS *, int, char **); int setmask() override; void init() override; diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 583cbba62e..fe2286a0fa 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "granular_model.h" -#include "gsm.h" +#include "gran_sub_mod.h" #include "domain.h" #include "error.h" #include "input.h" diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index a621a973e2..16a2fe5dc0 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -25,6 +25,10 @@ FixStyle(wall/gran,FixWallGran); namespace LAMMPS_NS { +namespace Granular_NS { + class GranularModel; +} + class FixWallGran : public Fix { public: FixWallGran(class LAMMPS *, int, char **); @@ -53,7 +57,7 @@ class FixWallGran : public Fix { bigint time_origin; // for granular model choices - Granular_NS::GranularModel *model; + class Granular_NS::GranularModel *model; double lo, hi, cylradius; double amplitude, period, omega, vshear; diff --git a/src/GRANULAR/gsm.cpp b/src/GRANULAR/gran_sub_mod.cpp similarity index 85% rename from src/GRANULAR/gsm.cpp rename to src/GRANULAR/gran_sub_mod.cpp index 4ac7473504..2d836151f8 100644 --- a/src/GRANULAR/gsm.cpp +++ b/src/GRANULAR/gran_sub_mod.cpp @@ -13,7 +13,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - This class contains a framework for granular submodels (GSM) including: + This class contains a framework for granular submodels (GranSubMod): normal, damping, tangential, rolling, twisting, and heat These are used to calculate forces/torques/etc based on contact geometry @@ -21,7 +21,7 @@ Dan Bolintineanu (SNL), Joel Clemmer (SNL) ----------------------------------------------------------------------- */ -#include "gsm.h" +#include "gran_sub_mod.h" #include "error.h" #include "utils.h" @@ -32,7 +32,7 @@ using namespace Granular_NS; Parent class for all types of granular submodels ------------------------------------------------------------------------- */ -GSM::GSM(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) +GranSubMod::GranSubMod(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) { this->gm = gm; @@ -51,7 +51,7 @@ GSM::GSM(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) /* ---------------------------------------------------------------------- */ -GSM::~GSM() +GranSubMod::~GranSubMod() { if (allocated) delete [] coeffs; delete [] transfer_history_factor; @@ -59,7 +59,7 @@ GSM::~GSM() /* ---------------------------------------------------------------------- */ -void GSM::allocate_coeffs() +void GranSubMod::allocate_coeffs() { allocated = 1; coeffs = new double[num_coeffs]; @@ -67,7 +67,7 @@ void GSM::allocate_coeffs() /* ---------------------------------------------------------------------- */ -void GSM::mix_coeffs(double* icoeffs, double* jcoeffs) +void GranSubMod::mix_coeffs(double* icoeffs, double* jcoeffs) { for (int i = 0; i < num_coeffs; i++) coeffs[i] = mix_geom(icoeffs[i], jcoeffs[i]); @@ -78,7 +78,7 @@ void GSM::mix_coeffs(double* icoeffs, double* jcoeffs) mixing of Young's modulus (E) ------------------------------------------------------------------------- */ -double GSM::mix_stiffnessE(double E1, double E2, +double GranSubMod::mix_stiffnessE(double E1, double E2, double pois1, double pois2) { double factor1 = (1 - pois1 * pois1) / E1; @@ -90,7 +90,7 @@ double GSM::mix_stiffnessE(double E1, double E2, mixing of shear modulus (G) ------------------------------------------------------------------------ */ -double GSM::mix_stiffnessG(double E1, double E2, +double GranSubMod::mix_stiffnessG(double E1, double E2, double pois1, double pois2) { double factor1 = 2 * (2 - pois1) * (1 + pois1) / E1; @@ -102,7 +102,7 @@ double GSM::mix_stiffnessG(double E1, double E2, mixing of Young's modulus (E) for walls ------------------------------------------------------------------------- */ -double GSM::mix_stiffnessE_wall(double E, double pois) +double GranSubMod::mix_stiffnessE_wall(double E, double pois) { double factor = 2 * (1 - pois); return E / factor; @@ -112,7 +112,7 @@ double GSM::mix_stiffnessE_wall(double E, double pois) mixing of shear modulus (G) for walls ------------------------------------------------------------------------ */ -double GSM::mix_stiffnessG_wall(double E, double pois) +double GranSubMod::mix_stiffnessG_wall(double E, double pois) { double factor = 32.0 * (2 - pois) * (1 + pois); return E / factor; @@ -122,7 +122,7 @@ double GSM::mix_stiffnessG_wall(double E, double pois) mixing of everything else ------------------------------------------------------------------------- */ -double GSM::mix_geom(double val1, double val2) +double GranSubMod::mix_geom(double val1, double val2) { return sqrt(val1 * val2); } diff --git a/src/GRANULAR/gsm.h b/src/GRANULAR/gran_sub_mod.h similarity index 89% rename from src/GRANULAR/gsm.h rename to src/GRANULAR/gran_sub_mod.h index 3c19179d52..78f4229b29 100644 --- a/src/GRANULAR/gsm.h +++ b/src/GRANULAR/gran_sub_mod.h @@ -11,8 +11,8 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef LMP_GSM_H_ -#define LMP_GSM_H_ +#ifndef LMP_GRAN_SUB_MOD_H_ +#define LMP_GRAN_SUB_MOD_H_ #include "granular_model.h" #include "pointers.h" // IWYU pragma: export @@ -20,10 +20,10 @@ namespace LAMMPS_NS { namespace Granular_NS { -class GSM : protected Pointers { +class GranSubMod : protected Pointers { public: - GSM(class GranularModel *, class LAMMPS *); - virtual ~GSM(); + GranSubMod(class GranularModel *, class LAMMPS *); + virtual ~GranSubMod(); int num_coeffs; double *coeffs; @@ -59,4 +59,4 @@ class GSM : protected Pointers { } // namespace GranularModel } // namespace LAMMPS_NS -#endif /* GSM_H_ */ +#endif /* GRAN_SUB_MOD_H_ */ diff --git a/src/GRANULAR/gsm_damping.cpp b/src/GRANULAR/gran_sub_mod_damping.cpp similarity index 74% rename from src/GRANULAR/gsm_damping.cpp rename to src/GRANULAR/gran_sub_mod_damping.cpp index db7f0f3371..e78233735a 100644 --- a/src/GRANULAR/gsm_damping.cpp +++ b/src/GRANULAR/gran_sub_mod_damping.cpp @@ -12,8 +12,8 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "gsm_damping.h" -#include "gsm_normal.h" +#include "gran_sub_mod_damping.h" +#include "gran_sub_mod_normal.h" #include "granular_model.h" #include "math_special.h" @@ -25,11 +25,11 @@ using namespace MathSpecial; Default damping model ------------------------------------------------------------------------- */ -GSMDamping::GSMDamping(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} +GranSubModDamping::GranSubModDamping(GranularModel *gm, LAMMPS *lmp) : GranSubMod(gm, lmp) {} /* ---------------------------------------------------------------------- */ -void GSMDamping::init() +void GranSubModDamping::init() { damp = gm->normal_model->damp; } @@ -38,11 +38,11 @@ void GSMDamping::init() No model ------------------------------------------------------------------------- */ -GSMDampingNone::GSMDampingNone(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} +GranSubModDampingNone::GranSubModDampingNone(GranularModel *gm, LAMMPS *lmp) : GranSubModDamping(gm, lmp) {} /* ---------------------------------------------------------------------- */ -double GSMDampingNone::calculate_forces() +double GranSubModDampingNone::calculate_forces() { damp_prefactor = 0.0; return 0.0; @@ -52,11 +52,11 @@ double GSMDampingNone::calculate_forces() Velocity damping ------------------------------------------------------------------------- */ -GSMDampingVelocity::GSMDampingVelocity(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} +GranSubModDampingVelocity::GranSubModDampingVelocity(GranularModel *gm, LAMMPS *lmp) : GranSubModDamping(gm, lmp) {} /* ---------------------------------------------------------------------- */ -double GSMDampingVelocity::calculate_forces() +double GranSubModDampingVelocity::calculate_forces() { damp_prefactor = damp; return -damp_prefactor * gm->vnnr; @@ -66,11 +66,11 @@ double GSMDampingVelocity::calculate_forces() Mass velocity damping ------------------------------------------------------------------------- */ -GSMDampingMassVelocity::GSMDampingMassVelocity(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) {} +GranSubModDampingMassVelocity::GranSubModDampingMassVelocity(GranularModel *gm, LAMMPS *lmp) : GranSubModDamping(gm, lmp) {} /* ---------------------------------------------------------------------- */ -double GSMDampingMassVelocity::calculate_forces() +double GranSubModDampingMassVelocity::calculate_forces() { damp_prefactor = damp * gm->meff; return -damp_prefactor * gm->vnnr; @@ -80,14 +80,14 @@ double GSMDampingMassVelocity::calculate_forces() Default, viscoelastic damping ------------------------------------------------------------------------- */ -GSMDampingViscoelastic::GSMDampingViscoelastic(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) +GranSubModDampingViscoelastic::GranSubModDampingViscoelastic(GranularModel *gm, LAMMPS *lmp) : GranSubModDamping(gm, lmp) { area_flag = 1; } /* ---------------------------------------------------------------------- */ -double GSMDampingViscoelastic::calculate_forces() +double GranSubModDampingViscoelastic::calculate_forces() { damp_prefactor = damp * gm->meff * gm->area; return -damp_prefactor * gm->vnnr; @@ -97,14 +97,14 @@ double GSMDampingViscoelastic::calculate_forces() Tsuji damping ------------------------------------------------------------------------- */ -GSMDampingTsuji::GSMDampingTsuji(GranularModel *gm, LAMMPS *lmp) : GSMDamping(gm, lmp) +GranSubModDampingTsuji::GranSubModDampingTsuji(GranularModel *gm, LAMMPS *lmp) : GranSubModDamping(gm, lmp) { allow_cohesion = 0; } /* ---------------------------------------------------------------------- */ -void GSMDampingTsuji::init() +void GranSubModDampingTsuji::init() { double tmp = gm->normal_model->damp; damp = 1.2728 - 4.2783 * tmp + 11.087 * square(tmp); @@ -114,7 +114,7 @@ void GSMDampingTsuji::init() /* ---------------------------------------------------------------------- */ -double GSMDampingTsuji::calculate_forces() +double GranSubModDampingTsuji::calculate_forces() { damp_prefactor = damp * sqrt(gm->meff * gm->Fnormal / gm->delta); return -damp_prefactor * gm->vnnr; diff --git a/src/GRANULAR/gsm_damping.h b/src/GRANULAR/gran_sub_mod_damping.h similarity index 58% rename from src/GRANULAR/gsm_damping.h rename to src/GRANULAR/gran_sub_mod_damping.h index 75c0f96356..04316a950d 100644 --- a/src/GRANULAR/gsm_damping.h +++ b/src/GRANULAR/gran_sub_mod_damping.h @@ -11,43 +11,43 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef GSM_CLASS +#ifdef GRAN_SUB_MOD_CLASS // clang-format off -GSMStyle(none, - GSMDampingNone, +GranSubModStyle(none, + GranSubModDampingNone, DAMPING); -GSMStyle(velocity, - GSMDampingVelocity, +GranSubModStyle(velocity, + GranSubModDampingVelocity, DAMPING); -GSMStyle(mass_velocity, - GSMDampingMassVelocity, +GranSubModStyle(mass_velocity, + GranSubModDampingMassVelocity, DAMPING); -GSMStyle(viscoelastic, - GSMDampingViscoelastic, +GranSubModStyle(viscoelastic, + GranSubModDampingViscoelastic, DAMPING); -GSMStyle(tsuji, - GSMDampingTsuji, +GranSubModStyle(tsuji, + GranSubModDampingTsuji, DAMPING); // clang-format on #else -#ifndef GSM_DAMPING_H_ -#define GSM_DAMPING_H_ +#ifndef GRAN_SUB_MOD_DAMPING_H_ +#define GRAN_SUB_MOD_DAMPING_H_ -#include "gsm.h" +#include "gran_sub_mod.h" #include "pointers.h" namespace LAMMPS_NS { namespace Granular_NS { -class GSMDamping : public GSM { +class GranSubModDamping : public GranSubMod { public: - GSMDamping(class GranularModel *, class LAMMPS *); - ~GSMDamping() {}; + GranSubModDamping(class GranularModel *, class LAMMPS *); + ~GranSubModDamping() {}; virtual void coeffs_to_local() {}; virtual void mix_coeffs(double*, double*) {}; virtual void init(); @@ -59,42 +59,42 @@ class GSMDamping : public GSM { /* ---------------------------------------------------------------------- */ -class GSMDampingNone : public GSMDamping { +class GranSubModDampingNone : public GranSubModDamping { public: - GSMDampingNone(class GranularModel *, class LAMMPS *); + GranSubModDampingNone(class GranularModel *, class LAMMPS *); void init() override {}; double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class GSMDampingVelocity : public GSMDamping { +class GranSubModDampingVelocity : public GranSubModDamping { public: - GSMDampingVelocity(class GranularModel *, class LAMMPS *); + GranSubModDampingVelocity(class GranularModel *, class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class GSMDampingMassVelocity : public GSMDamping { +class GranSubModDampingMassVelocity : public GranSubModDamping { public: - GSMDampingMassVelocity(class GranularModel *, class LAMMPS *); + GranSubModDampingMassVelocity(class GranularModel *, class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class GSMDampingViscoelastic : public GSMDamping { +class GranSubModDampingViscoelastic : public GranSubModDamping { public: - GSMDampingViscoelastic(class GranularModel *, class LAMMPS *); + GranSubModDampingViscoelastic(class GranularModel *, class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class GSMDampingTsuji : public GSMDamping { +class GranSubModDampingTsuji : public GranSubModDamping { public: - GSMDampingTsuji(class GranularModel *, class LAMMPS *); + GranSubModDampingTsuji(class GranularModel *, class LAMMPS *); void init() override; double calculate_forces(); }; @@ -102,5 +102,5 @@ class GSMDampingTsuji : public GSMDamping { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GSM_DAMPING_H_ */ -#endif /*GSM_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_DAMPING_H_ */ +#endif /*GRAN_SUB_MOD_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_heat.cpp b/src/GRANULAR/gran_sub_mod_heat.cpp similarity index 79% rename from src/GRANULAR/gsm_heat.cpp rename to src/GRANULAR/gran_sub_mod_heat.cpp index 1a0cff5301..02a18117ff 100644 --- a/src/GRANULAR/gsm_heat.cpp +++ b/src/GRANULAR/gran_sub_mod_heat.cpp @@ -12,7 +12,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "gsm_heat.h" +#include "gran_sub_mod_heat.h" #include "granular_model.h" #include "error.h" @@ -23,17 +23,17 @@ using namespace Granular_NS; Default heat conduction ------------------------------------------------------------------------- */ -GSMHeat::GSMHeat(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} +GranSubModHeat::GranSubModHeat(GranularModel *gm, LAMMPS *lmp) : GranSubMod(gm, lmp) {} /* ---------------------------------------------------------------------- Area-based heat conduction ------------------------------------------------------------------------- */ -GSMHeatNone::GSMHeatNone(GranularModel *gm, LAMMPS *lmp) : GSMHeat(gm, lmp) {} +GranSubModHeatNone::GranSubModHeatNone(GranularModel *gm, LAMMPS *lmp) : GranSubModHeat(gm, lmp) {} /* ---------------------------------------------------------------------- */ -double GSMHeatNone::calculate_heat() +double GranSubModHeatNone::calculate_heat() { return 0.0; } @@ -42,7 +42,7 @@ double GSMHeatNone::calculate_heat() Area-based heat conduction ------------------------------------------------------------------------- */ -GSMHeatArea::GSMHeatArea(GranularModel *gm, LAMMPS *lmp) : GSMHeat(gm, lmp) +GranSubModHeatArea::GranSubModHeatArea(GranularModel *gm, LAMMPS *lmp) : GranSubModHeat(gm, lmp) { num_coeffs = 1; area_flag = 1; @@ -50,7 +50,7 @@ GSMHeatArea::GSMHeatArea(GranularModel *gm, LAMMPS *lmp) : GSMHeat(gm, lmp) /* ---------------------------------------------------------------------- */ -void GSMHeatArea::coeffs_to_local() +void GranSubModHeatArea::coeffs_to_local() { conductivity = coeffs[0]; @@ -59,7 +59,7 @@ void GSMHeatArea::coeffs_to_local() /* ---------------------------------------------------------------------- */ -double GSMHeatArea::calculate_heat() +double GranSubModHeatArea::calculate_heat() { return conductivity * gm->area * (gm->Tj - gm->Ti); } diff --git a/src/GRANULAR/gsm_heat.h b/src/GRANULAR/gran_sub_mod_heat.h similarity index 66% rename from src/GRANULAR/gsm_heat.h rename to src/GRANULAR/gran_sub_mod_heat.h index c913593f19..3520a41a06 100644 --- a/src/GRANULAR/gsm_heat.h +++ b/src/GRANULAR/gran_sub_mod_heat.h @@ -11,30 +11,30 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef GSM_CLASS +#ifdef GRAN_SUB_MOD_CLASS // clang-format off -GSMStyle(none, - GSMHeatNone, +GranSubModStyle(none, + GranSubModHeatNone, HEAT); -GSMStyle(area, - GSMHeatArea, +GranSubModStyle(area, + GranSubModHeatArea, HEAT); // clang-format on #else -#ifndef GSM_HEAT_H_ -#define GSM_HEAT_H_ +#ifndef GRAN_SUB_MOD_HEAT_H_ +#define GRAN_SUB_MOD_HEAT_H_ -#include "gsm.h" +#include "gran_sub_mod.h" namespace LAMMPS_NS { namespace Granular_NS { -class GSMHeat : public GSM { +class GranSubModHeat : public GranSubMod { public: - GSMHeat(class GranularModel *, class LAMMPS *); - ~GSMHeat() {}; + GranSubModHeat(class GranularModel *, class LAMMPS *); + ~GranSubModHeat() {}; virtual void coeffs_to_local() {}; virtual void init() {}; virtual double calculate_heat() = 0; @@ -42,17 +42,17 @@ class GSMHeat : public GSM { /* ---------------------------------------------------------------------- */ -class GSMHeatNone : public GSMHeat { +class GranSubModHeatNone : public GranSubModHeat { public: - GSMHeatNone(class GranularModel *, class LAMMPS *); + GranSubModHeatNone(class GranularModel *, class LAMMPS *); double calculate_heat(); }; /* ---------------------------------------------------------------------- */ -class GSMHeatArea : public GSMHeat { +class GranSubModHeatArea : public GranSubModHeat { public: - GSMHeatArea(class GranularModel *, class LAMMPS *); + GranSubModHeatArea(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; double calculate_heat(); protected: @@ -62,5 +62,5 @@ class GSMHeatArea : public GSMHeat { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GSM_HEAT_H_ */ -#endif /*GSM_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_HEAT_H_ */ +#endif /*GRAN_SUB_MOD_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_normal.cpp b/src/GRANULAR/gran_sub_mod_normal.cpp similarity index 82% rename from src/GRANULAR/gsm_normal.cpp rename to src/GRANULAR/gran_sub_mod_normal.cpp index 28e4d7af79..d10c984a51 100644 --- a/src/GRANULAR/gsm_normal.cpp +++ b/src/GRANULAR/gran_sub_mod_normal.cpp @@ -12,7 +12,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "gsm_normal.h" +#include "gran_sub_mod_normal.h" #include "granular_model.h" #include "error.h" #include "math_const.h" @@ -33,7 +33,7 @@ using namespace MathConst; Default normal model ------------------------------------------------------------------------- */ -GSMNormal::GSMNormal(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) +GranSubModNormal::GranSubModNormal(GranularModel *gm, LAMMPS *lmp) : GranSubMod(gm, lmp) { material_properties = 0; cohesive_flag = 0; @@ -41,7 +41,7 @@ GSMNormal::GSMNormal(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) /* ---------------------------------------------------------------------- */ -bool GSMNormal::touch() +bool GranSubModNormal::touch() { bool touchflag = (gm->rsq < gm->radsum * gm->radsum); return touchflag; @@ -49,7 +49,7 @@ bool GSMNormal::touch() /* ---------------------------------------------------------------------- */ -double GSMNormal::pulloff_distance(double radi, double radj) +double GranSubModNormal::pulloff_distance(double radi, double radj) { //called outside of compute(), do not assume correct geometry defined in contact return radi + radj; @@ -57,14 +57,14 @@ double GSMNormal::pulloff_distance(double radi, double radj) /* ---------------------------------------------------------------------- */ -double GSMNormal::calculate_area() +double GranSubModNormal::calculate_area() { return sqrt(gm->dR); } /* ---------------------------------------------------------------------- */ -void GSMNormal::set_fncrit() +void GranSubModNormal::set_fncrit() { Fncrit = fabs(gm->Fntot); } @@ -73,11 +73,11 @@ void GSMNormal::set_fncrit() No model ------------------------------------------------------------------------- */ -GSMNormalNone::GSMNormalNone(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) {} +GranSubModNormalNone::GranSubModNormalNone(GranularModel *gm, LAMMPS *lmp) : GranSubModNormal(gm, lmp) {} /* ---------------------------------------------------------------------- */ -double GSMNormalNone::calculate_forces() +double GranSubModNormalNone::calculate_forces() { return 0.0; } @@ -86,14 +86,14 @@ double GSMNormalNone::calculate_forces() Hookean normal force ------------------------------------------------------------------------- */ -GSMNormalHooke::GSMNormalHooke(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +GranSubModNormalHooke::GranSubModNormalHooke(GranularModel *gm, LAMMPS *lmp) : GranSubModNormal(gm, lmp) { num_coeffs = 2; } /* ---------------------------------------------------------------------- */ -void GSMNormalHooke::coeffs_to_local() +void GranSubModNormalHooke::coeffs_to_local() { k = coeffs[0]; damp = coeffs[1]; @@ -103,7 +103,7 @@ void GSMNormalHooke::coeffs_to_local() /* ---------------------------------------------------------------------- */ -double GSMNormalHooke::calculate_forces() +double GranSubModNormalHooke::calculate_forces() { return k * gm->delta; } @@ -112,7 +112,7 @@ double GSMNormalHooke::calculate_forces() Hertzian normal force ------------------------------------------------------------------------- */ -GSMNormalHertz::GSMNormalHertz(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +GranSubModNormalHertz::GranSubModNormalHertz(GranularModel *gm, LAMMPS *lmp) : GranSubModNormal(gm, lmp) { num_coeffs = 2; area_flag = 1; @@ -120,7 +120,7 @@ GSMNormalHertz::GSMNormalHertz(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, l /* ---------------------------------------------------------------------- */ -void GSMNormalHertz::coeffs_to_local() +void GranSubModNormalHertz::coeffs_to_local() { k = coeffs[0]; damp = coeffs[1]; @@ -130,7 +130,7 @@ void GSMNormalHertz::coeffs_to_local() /* ---------------------------------------------------------------------- */ -double GSMNormalHertz::calculate_forces() +double GranSubModNormalHertz::calculate_forces() { return k * gm->area * gm->delta; } @@ -139,7 +139,7 @@ double GSMNormalHertz::calculate_forces() Hertzian normal force with material properties ------------------------------------------------------------------------- */ -GSMNormalHertzMaterial::GSMNormalHertzMaterial(GranularModel *gm, LAMMPS *lmp) : GSMNormalHertz(gm, lmp) +GranSubModNormalHertzMaterial::GranSubModNormalHertzMaterial(GranularModel *gm, LAMMPS *lmp) : GranSubModNormalHertz(gm, lmp) { material_properties = 1; num_coeffs = 3; @@ -148,7 +148,7 @@ GSMNormalHertzMaterial::GSMNormalHertzMaterial(GranularModel *gm, LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -void GSMNormalHertzMaterial::coeffs_to_local() +void GranSubModNormalHertzMaterial::coeffs_to_local() { Emod = coeffs[0]; damp = coeffs[1]; @@ -164,7 +164,7 @@ void GSMNormalHertzMaterial::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMNormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) +void GranSubModNormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) { coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); @@ -176,7 +176,7 @@ void GSMNormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) DMT normal force ------------------------------------------------------------------------- */ -GSMNormalDMT::GSMNormalDMT(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +GranSubModNormalDMT::GranSubModNormalDMT(GranularModel *gm, LAMMPS *lmp) : GranSubModNormal(gm, lmp) { material_properties = 1; cohesive_flag = 1; @@ -186,7 +186,7 @@ GSMNormalDMT::GSMNormalDMT(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) /* ---------------------------------------------------------------------- */ -void GSMNormalDMT::coeffs_to_local() +void GranSubModNormalDMT::coeffs_to_local() { Emod = coeffs[0]; damp = coeffs[1]; @@ -203,7 +203,7 @@ void GSMNormalDMT::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMNormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) +void GranSubModNormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) { coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); @@ -214,7 +214,7 @@ void GSMNormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) /* ---------------------------------------------------------------------- */ -double GSMNormalDMT::calculate_forces() +double GranSubModNormalDMT::calculate_forces() { Fne = k * gm->area * gm->delta; F_pulloff = 4.0 * MathConst::MY_PI * cohesion * gm->Reff; @@ -224,7 +224,7 @@ double GSMNormalDMT::calculate_forces() /* ---------------------------------------------------------------------- */ -void GSMNormalDMT::set_fncrit() +void GranSubModNormalDMT::set_fncrit() { Fncrit = fabs(Fne + 2.0 * F_pulloff); } @@ -233,7 +233,7 @@ void GSMNormalDMT::set_fncrit() JKR normal force ------------------------------------------------------------------------- */ -GSMNormalJKR::GSMNormalJKR(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) +GranSubModNormalJKR::GranSubModNormalJKR(GranularModel *gm, LAMMPS *lmp) : GranSubModNormal(gm, lmp) { material_properties = 1; cohesive_flag = 1; @@ -244,7 +244,7 @@ GSMNormalJKR::GSMNormalJKR(GranularModel *gm, LAMMPS *lmp) : GSMNormal(gm, lmp) /* ---------------------------------------------------------------------- */ -void GSMNormalJKR::coeffs_to_local() +void GranSubModNormalJKR::coeffs_to_local() { Emod = coeffs[0]; damp = coeffs[1]; @@ -264,7 +264,7 @@ void GSMNormalJKR::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMNormalJKR::mix_coeffs(double* icoeffs, double* jcoeffs) +void GranSubModNormalJKR::mix_coeffs(double* icoeffs, double* jcoeffs) { coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); @@ -275,7 +275,7 @@ void GSMNormalJKR::mix_coeffs(double* icoeffs, double* jcoeffs) /* ---------------------------------------------------------------------- */ -bool GSMNormalJKR::touch() +bool GranSubModNormalJKR::touch() { double area_at_pulloff, R2, delta_pulloff, dist_pulloff; bool touchflag; @@ -297,7 +297,7 @@ bool GSMNormalJKR::touch() called outside of compute(), do not assume geometry defined in contact ------------------------------------------------------------------------- */ -double GSMNormalJKR::pulloff_distance(double radi, double radj) +double GranSubModNormalJKR::pulloff_distance(double radi, double radj) { double area_at_pulloff, Reff_tmp; @@ -310,7 +310,7 @@ double GSMNormalJKR::pulloff_distance(double radi, double radj) /* ---------------------------------------------------------------------- */ -double GSMNormalJKR::calculate_area() +double GranSubModNormalJKR::calculate_area() { double R2, dR2, t0, t1, t2, t3, t4, t5, t6; double sqrt1, sqrt2, sqrt3; @@ -335,7 +335,7 @@ double GSMNormalJKR::calculate_area() /* ---------------------------------------------------------------------- */ -double GSMNormalJKR::calculate_forces() +double GranSubModNormalJKR::calculate_forces() { double a2; a2 = gm->area * gm->area; @@ -347,7 +347,7 @@ double GSMNormalJKR::calculate_forces() /* ---------------------------------------------------------------------- */ -void GSMNormalJKR::set_fncrit() +void GranSubModNormalJKR::set_fncrit() { Fncrit = fabs(Fne + 2.0 * F_pulloff); } diff --git a/src/GRANULAR/gsm_normal.h b/src/GRANULAR/gran_sub_mod_normal.h similarity index 65% rename from src/GRANULAR/gsm_normal.h rename to src/GRANULAR/gran_sub_mod_normal.h index 2d7391f3c8..8fb0c01d4b 100644 --- a/src/GRANULAR/gsm_normal.h +++ b/src/GRANULAR/gran_sub_mod_normal.h @@ -11,46 +11,46 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef GSM_CLASS +#ifdef GRAN_SUB_MOD_CLASS // clang-format off -GSMStyle(none, - GSMNormalNone, +GranSubModStyle(none, + GranSubModNormalNone, NORMAL); -GSMStyle(hooke, - GSMNormalHooke, +GranSubModStyle(hooke, + GranSubModNormalHooke, NORMAL); -GSMStyle(hertz, - GSMNormalHertz, +GranSubModStyle(hertz, + GranSubModNormalHertz, NORMAL); -GSMStyle(hertz/material, - GSMNormalHertzMaterial, +GranSubModStyle(hertz/material, + GranSubModNormalHertzMaterial, NORMAL); -GSMStyle(dmt, - GSMNormalDMT, +GranSubModStyle(dmt, + GranSubModNormalDMT, NORMAL); -GSMStyle(jkr, - GSMNormalJKR, +GranSubModStyle(jkr, + GranSubModNormalJKR, NORMAL); // clang-format on #else -#ifndef GSM_NORMAL_H_ -#define GSM_NORMAL_H_ +#ifndef GRAN_SUB_MOD_NORMAL_H_ +#define GRAN_SUB_MOD_NORMAL_H_ -#include "gsm.h" +#include "gran_sub_mod.h" namespace LAMMPS_NS { namespace Granular_NS { -class GSMNormal : public GSM { +class GranSubModNormal : public GranSubMod { public: - GSMNormal(class GranularModel *, class LAMMPS *); - ~GSMNormal() {}; + GranSubModNormal(class GranularModel *, class LAMMPS *); + ~GranSubModNormal() {}; virtual void coeffs_to_local() {}; virtual void init() {}; virtual bool touch(); @@ -66,17 +66,17 @@ class GSMNormal : public GSM { /* ---------------------------------------------------------------------- */ -class GSMNormalNone : public GSMNormal { +class GranSubModNormalNone : public GranSubModNormal { public: - GSMNormalNone(class GranularModel *, class LAMMPS *); + GranSubModNormalNone(class GranularModel *, class LAMMPS *); double calculate_forces(); }; /* ---------------------------------------------------------------------- */ -class GSMNormalHooke : public GSMNormal { +class GranSubModNormalHooke : public GranSubModNormal { public: - GSMNormalHooke(class GranularModel *, class LAMMPS *); + GranSubModNormalHooke(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; double calculate_forces(); protected: @@ -85,9 +85,9 @@ class GSMNormalHooke : public GSMNormal { /* ---------------------------------------------------------------------- */ -class GSMNormalHertz : public GSMNormal { +class GranSubModNormalHertz : public GranSubModNormal { public: - GSMNormalHertz(class GranularModel *, class LAMMPS *); + GranSubModNormalHertz(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; double calculate_forces(); protected: @@ -96,18 +96,18 @@ class GSMNormalHertz : public GSMNormal { /* ---------------------------------------------------------------------- */ -class GSMNormalHertzMaterial : public GSMNormalHertz { +class GranSubModNormalHertzMaterial : public GranSubModNormalHertz { public: - GSMNormalHertzMaterial(class GranularModel *, class LAMMPS *); + GranSubModNormalHertzMaterial(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void mix_coeffs(double*, double*) override; }; /* ---------------------------------------------------------------------- */ -class GSMNormalDMT : public GSMNormal { +class GranSubModNormalDMT : public GranSubModNormal { public: - GSMNormalDMT(class GranularModel *, class LAMMPS *); + GranSubModNormalDMT(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void mix_coeffs(double*, double*) override; double calculate_forces(); @@ -119,9 +119,9 @@ class GSMNormalDMT : public GSMNormal { /* ---------------------------------------------------------------------- */ -class GSMNormalJKR : public GSMNormal { +class GranSubModNormalJKR : public GranSubModNormal { public: - GSMNormalJKR(class GranularModel *, class LAMMPS *); + GranSubModNormalJKR(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void mix_coeffs(double*, double*) override; bool touch() override; @@ -137,5 +137,5 @@ class GSMNormalJKR : public GSMNormal { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GSM_NORMAL_H_ */ -#endif /*GSM_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_NORMAL_H_ */ +#endif /*GRAN_SUB_MOD_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_rolling.cpp b/src/GRANULAR/gran_sub_mod_rolling.cpp similarity index 87% rename from src/GRANULAR/gsm_rolling.cpp rename to src/GRANULAR/gran_sub_mod_rolling.cpp index ceda262853..c1dc53fcc8 100644 --- a/src/GRANULAR/gsm_rolling.cpp +++ b/src/GRANULAR/gran_sub_mod_rolling.cpp @@ -12,8 +12,8 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "gsm_normal.h" -#include "gsm_rolling.h" +#include "gran_sub_mod_normal.h" +#include "gran_sub_mod_rolling.h" #include "granular_model.h" #include "error.h" #include "math_const.h" @@ -24,23 +24,25 @@ using namespace Granular_NS; using namespace MathConst; using namespace MathExtra; +#define EPSILON 1e-10 + /* ---------------------------------------------------------------------- Default rolling friction model ------------------------------------------------------------------------- */ -GSMRolling::GSMRolling(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} +GranSubModRolling::GranSubModRolling(GranularModel *gm, LAMMPS *lmp) : GranSubMod(gm, lmp) {} /* ---------------------------------------------------------------------- No model ------------------------------------------------------------------------- */ -GSMRollingNone::GSMRollingNone(GranularModel *gm, LAMMPS *lmp) : GSMRolling(gm, lmp) {} +GranSubModRollingNone::GranSubModRollingNone(GranularModel *gm, LAMMPS *lmp) : GranSubModRolling(gm, lmp) {} /* ---------------------------------------------------------------------- SDS rolling friction model ------------------------------------------------------------------------- */ -GSMRollingSDS::GSMRollingSDS(GranularModel *gm, LAMMPS *lmp) : GSMRolling(gm, lmp) +GranSubModRollingSDS::GranSubModRollingSDS(GranularModel *gm, LAMMPS *lmp) : GranSubModRolling(gm, lmp) { num_coeffs = 3; size_history = 3; @@ -48,7 +50,7 @@ GSMRollingSDS::GSMRollingSDS(GranularModel *gm, LAMMPS *lmp) : GSMRolling(gm, lm /* ---------------------------------------------------------------------- */ -void GSMRollingSDS::coeffs_to_local() +void GranSubModRollingSDS::coeffs_to_local() { k = coeffs[0]; gamma = coeffs[1]; @@ -60,7 +62,7 @@ void GSMRollingSDS::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMRollingSDS::calculate_forces() +void GranSubModRollingSDS::calculate_forces() { int rhist0, rhist1, rhist2, frameupdate; double Frcrit, rolldotn, rollmag, prjmag, magfr, hist_temp[3], scalefac, temp_array[3]; diff --git a/src/GRANULAR/gsm_rolling.h b/src/GRANULAR/gran_sub_mod_rolling.h similarity index 65% rename from src/GRANULAR/gsm_rolling.h rename to src/GRANULAR/gran_sub_mod_rolling.h index 054b22954f..cb64c94219 100644 --- a/src/GRANULAR/gsm_rolling.h +++ b/src/GRANULAR/gran_sub_mod_rolling.h @@ -11,30 +11,30 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef GSM_CLASS +#ifdef GRAN_SUB_MOD_CLASS // clang-format off -GSMStyle(none, - GSMRollingNone, +GranSubModStyle(none, + GranSubModRollingNone, ROLLING); -GSMStyle(sds, - GSMRollingSDS, +GranSubModStyle(sds, + GranSubModRollingSDS, ROLLING); // clang-format on #else -#ifndef GSM_ROLLING_H_ -#define GSM_ROLLING_H_ +#ifndef GRAN_SUB_MOD_ROLLING_H_ +#define GRAN_SUB_MOD_ROLLING_H_ -#include "gsm.h" +#include "gran_sub_mod.h" namespace LAMMPS_NS { namespace Granular_NS { -class GSMRolling : public GSM { +class GranSubModRolling : public GranSubMod { public: - GSMRolling(class GranularModel *, class LAMMPS *); - ~GSMRolling() {}; + GranSubModRolling(class GranularModel *, class LAMMPS *); + ~GranSubModRolling() {}; virtual void coeffs_to_local() {}; virtual void init() {}; virtual void calculate_forces() = 0; @@ -42,17 +42,17 @@ class GSMRolling : public GSM { /* ---------------------------------------------------------------------- */ -class GSMRollingNone : public GSMRolling { +class GranSubModRollingNone : public GranSubModRolling { public: - GSMRollingNone(class GranularModel *, class LAMMPS *); + GranSubModRollingNone(class GranularModel *, class LAMMPS *); void calculate_forces() {}; }; /* ---------------------------------------------------------------------- */ -class GSMRollingSDS : public GSMRolling { +class GranSubModRollingSDS : public GranSubModRolling { public: - GSMRollingSDS(class GranularModel *, class LAMMPS *); + GranSubModRollingSDS(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void calculate_forces(); protected: @@ -62,5 +62,5 @@ class GSMRollingSDS : public GSMRolling { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GSM_ROLLING_H_ */ -#endif /*GSM_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_ROLLING_H_ */ +#endif /*GRAN_SUB_MOD_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_tangential.cpp b/src/GRANULAR/gran_sub_mod_tangential.cpp similarity index 84% rename from src/GRANULAR/gsm_tangential.cpp rename to src/GRANULAR/gran_sub_mod_tangential.cpp index a5dabde8fd..677ba4d363 100644 --- a/src/GRANULAR/gsm_tangential.cpp +++ b/src/GRANULAR/gran_sub_mod_tangential.cpp @@ -12,9 +12,9 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "gsm_damping.h" -#include "gsm_normal.h" -#include "gsm_tangential.h" +#include "gran_sub_mod_damping.h" +#include "gran_sub_mod_normal.h" +#include "gran_sub_mod_tangential.h" #include "granular_model.h" #include "error.h" #include "math_const.h" @@ -25,23 +25,25 @@ using namespace Granular_NS; using namespace MathConst; using namespace MathExtra; +#define EPSILON 1e-10 + /* ---------------------------------------------------------------------- Default model ------------------------------------------------------------------------- */ -GSMTangential::GSMTangential(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} +GranSubModTangential::GranSubModTangential(GranularModel *gm, LAMMPS *lmp) : GranSubMod(gm, lmp) {} /* ---------------------------------------------------------------------- No model ------------------------------------------------------------------------- */ -GSMTangentialNone::GSMTangentialNone(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) {} +GranSubModTangentialNone::GranSubModTangentialNone(GranularModel *gm, LAMMPS *lmp) : GranSubModTangential(gm, lmp) {} /* ---------------------------------------------------------------------- Linear model with no history ------------------------------------------------------------------------- */ -GSMTangentialLinearNoHistory::GSMTangentialLinearNoHistory(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) +GranSubModTangentialLinearNoHistory::GranSubModTangentialLinearNoHistory(GranularModel *gm, LAMMPS *lmp) : GranSubModTangential(gm, lmp) { num_coeffs = 2; size_history = 0; @@ -49,7 +51,7 @@ GSMTangentialLinearNoHistory::GSMTangentialLinearNoHistory(GranularModel *gm, LA /* ---------------------------------------------------------------------- */ -void GSMTangentialLinearNoHistory::coeffs_to_local() +void GranSubModTangentialLinearNoHistory::coeffs_to_local() { k = 0.0; // No tangential stiffness with no history xt = coeffs[0]; @@ -61,7 +63,7 @@ void GSMTangentialLinearNoHistory::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMTangentialLinearNoHistory::calculate_forces() +void GranSubModTangentialLinearNoHistory::calculate_forces() { // classic pair gran/hooke (no history) damp = xt * gm->damping_model->damp_prefactor; @@ -80,7 +82,7 @@ void GSMTangentialLinearNoHistory::calculate_forces() Linear model with history ------------------------------------------------------------------------- */ -GSMTangentialLinearHistory::GSMTangentialLinearHistory(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) +GranSubModTangentialLinearHistory::GranSubModTangentialLinearHistory(GranularModel *gm, LAMMPS *lmp) : GranSubModTangential(gm, lmp) { num_coeffs = 3; size_history = 3; @@ -88,7 +90,7 @@ GSMTangentialLinearHistory::GSMTangentialLinearHistory(GranularModel *gm, LAMMPS /* ---------------------------------------------------------------------- */ -void GSMTangentialLinearHistory::coeffs_to_local() +void GranSubModTangentialLinearHistory::coeffs_to_local() { k = coeffs[0]; xt = coeffs[1]; @@ -100,7 +102,7 @@ void GSMTangentialLinearHistory::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMTangentialLinearHistory::calculate_forces() +void GranSubModTangentialLinearHistory::calculate_forces() { // Note: this is the same as the base Mindlin calculation except k isn't scaled by area double magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl, temp_array[3]; @@ -163,14 +165,14 @@ void GSMTangentialLinearHistory::calculate_forces() Linear model with history from pair gran/hooke/history ------------------------------------------------------------------------- */ -GSMTangentialLinearHistoryClassic::GSMTangentialLinearHistoryClassic(GranularModel *gm, LAMMPS *lmp) : GSMTangentialLinearHistory(gm, lmp) +GranSubModTangentialLinearHistoryClassic::GranSubModTangentialLinearHistoryClassic(GranularModel *gm, LAMMPS *lmp) : GranSubModTangentialLinearHistory(gm, lmp) { area_flag = 1; // Sets gran/hooke/history behavior } /* ---------------------------------------------------------------------- */ -void GSMTangentialLinearHistoryClassic::calculate_forces() +void GranSubModTangentialLinearHistoryClassic::calculate_forces() { double magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; double temp_array[3]; @@ -222,7 +224,7 @@ void GSMTangentialLinearHistoryClassic::calculate_forces() Mindlin from pair gran/hertz/history ------------------------------------------------------------------------- */ -GSMTangentialMindlinClassic::GSMTangentialMindlinClassic(GranularModel *gm, LAMMPS *lmp) : GSMTangentialLinearHistoryClassic(gm, lmp) +GranSubModTangentialMindlinClassic::GranSubModTangentialMindlinClassic(GranularModel *gm, LAMMPS *lmp) : GranSubModTangentialLinearHistoryClassic(gm, lmp) { area_flag = 1; // Sets gran/hertz/history behavior } @@ -231,7 +233,7 @@ GSMTangentialMindlinClassic::GSMTangentialMindlinClassic(GranularModel *gm, LAMM Mindlin model ------------------------------------------------------------------------- */ -GSMTangentialMindlin::GSMTangentialMindlin(GranularModel *gm, LAMMPS *lmp) : GSMTangential(gm, lmp) +GranSubModTangentialMindlin::GranSubModTangentialMindlin(GranularModel *gm, LAMMPS *lmp) : GranSubModTangential(gm, lmp) { num_coeffs = 3; size_history = 3; @@ -242,7 +244,7 @@ GSMTangentialMindlin::GSMTangentialMindlin(GranularModel *gm, LAMMPS *lmp) : GSM /* ---------------------------------------------------------------------- */ -void GSMTangentialMindlin::coeffs_to_local() +void GranSubModTangentialMindlin::coeffs_to_local() { k = coeffs[0]; xt = coeffs[1]; @@ -268,7 +270,7 @@ void GSMTangentialMindlin::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMTangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) +void GranSubModTangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) { if (icoeffs[0] == -1 || jcoeffs[0] == -1) coeffs[0] = -1; else coeffs[0] = mix_geom(icoeffs[0], jcoeffs[0]); @@ -279,7 +281,7 @@ void GSMTangentialMindlin::mix_coeffs(double* icoeffs, double* jcoeffs) /* ---------------------------------------------------------------------- */ -void GSMTangentialMindlin::calculate_forces() +void GranSubModTangentialMindlin::calculate_forces() { double k_scaled, magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; double temp_array[3]; @@ -366,7 +368,7 @@ void GSMTangentialMindlin::calculate_forces() Mindlin force model ------------------------------------------------------------------------- */ -GSMTangentialMindlinForce::GSMTangentialMindlinForce(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) +GranSubModTangentialMindlinForce::GranSubModTangentialMindlinForce(GranularModel *gm, LAMMPS *lmp) : GranSubModTangentialMindlin(gm, lmp) { mindlin_force = 1; } @@ -375,7 +377,7 @@ GSMTangentialMindlinForce::GSMTangentialMindlinForce(GranularModel *gm, LAMMPS * Mindlin rescale model ------------------------------------------------------------------------- */ -GSMTangentialMindlinRescale::GSMTangentialMindlinRescale(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) +GranSubModTangentialMindlinRescale::GranSubModTangentialMindlinRescale(GranularModel *gm, LAMMPS *lmp) : GranSubModTangentialMindlin(gm, lmp) { size_history = 4; mindlin_rescale = 1; @@ -390,7 +392,7 @@ GSMTangentialMindlinRescale::GSMTangentialMindlinRescale(GranularModel *gm, LAMM Mindlin rescale force model ------------------------------------------------------------------------- */ -GSMTangentialMindlinRescaleForce::GSMTangentialMindlinRescaleForce(GranularModel *gm, LAMMPS *lmp) : GSMTangentialMindlin(gm, lmp) +GranSubModTangentialMindlinRescaleForce::GranSubModTangentialMindlinRescaleForce(GranularModel *gm, LAMMPS *lmp) : GranSubModTangentialMindlin(gm, lmp) { size_history = 4; mindlin_force = 1; diff --git a/src/GRANULAR/gsm_tangential.h b/src/GRANULAR/gran_sub_mod_tangential.h similarity index 50% rename from src/GRANULAR/gsm_tangential.h rename to src/GRANULAR/gran_sub_mod_tangential.h index e755f63304..56d72f80d3 100644 --- a/src/GRANULAR/gsm_tangential.h +++ b/src/GRANULAR/gran_sub_mod_tangential.h @@ -11,58 +11,58 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef GSM_CLASS +#ifdef GRAN_SUB_MOD_CLASS // clang-format off -GSMStyle(none, - GSMTangentialNone, +GranSubModStyle(none, + GranSubModTangentialNone, TANGENTIAL); -GSMStyle(linear_nohistory, - GSMTangentialLinearNoHistory, +GranSubModStyle(linear_nohistory, + GranSubModTangentialLinearNoHistory, TANGENTIAL); -GSMStyle(linear_history, - GSMTangentialLinearHistory, +GranSubModStyle(linear_history, + GranSubModTangentialLinearHistory, TANGENTIAL); -GSMStyle(linear_history_classic, - GSMTangentialLinearHistoryClassic, +GranSubModStyle(linear_history_classic, + GranSubModTangentialLinearHistoryClassic, TANGENTIAL); -GSMStyle(mindlin_classic, - GSMTangentialMindlinClassic, +GranSubModStyle(mindlin_classic, + GranSubModTangentialMindlinClassic, TANGENTIAL); -GSMStyle(mindlin, - GSMTangentialMindlin, +GranSubModStyle(mindlin, + GranSubModTangentialMindlin, TANGENTIAL); -GSMStyle(mindlin/force, - GSMTangentialMindlinForce, +GranSubModStyle(mindlin/force, + GranSubModTangentialMindlinForce, TANGENTIAL); -GSMStyle(mindlin_rescale, - GSMTangentialMindlinRescale, +GranSubModStyle(mindlin_rescale, + GranSubModTangentialMindlinRescale, TANGENTIAL); -GSMStyle(mindlin_rescale/force, - GSMTangentialMindlinRescaleForce, +GranSubModStyle(mindlin_rescale/force, + GranSubModTangentialMindlinRescaleForce, TANGENTIAL); // clang-format on #else -#ifndef GSM_TANGENTIAL_H_ -#define GSM_TANGENTIAL_H_ +#ifndef GRAN_SUB_MOD_TANGENTIAL_H_ +#define GRAN_SUB_MOD_TANGENTIAL_H_ -#include "gsm.h" +#include "gran_sub_mod.h" namespace LAMMPS_NS { namespace Granular_NS { -class GSMTangential : public GSM { +class GranSubModTangential : public GranSubMod { public: - GSMTangential(class GranularModel *, class LAMMPS *); - virtual ~GSMTangential() {}; + GranSubModTangential(class GranularModel *, class LAMMPS *); + virtual ~GranSubModTangential() {}; virtual void coeffs_to_local() {}; virtual void init() {}; virtual void calculate_forces() = 0; @@ -71,17 +71,17 @@ class GSMTangential : public GSM { /* ---------------------------------------------------------------------- */ -class GSMTangentialNone : public GSMTangential { +class GranSubModTangentialNone : public GranSubModTangential { public: - GSMTangentialNone(class GranularModel *, class LAMMPS *); + GranSubModTangentialNone(class GranularModel *, class LAMMPS *); void calculate_forces() {}; }; /* ---------------------------------------------------------------------- */ -class GSMTangentialLinearNoHistory : public GSMTangential { +class GranSubModTangentialLinearNoHistory : public GranSubModTangential { public: - GSMTangentialLinearNoHistory(class GranularModel *, class LAMMPS *); + GranSubModTangentialLinearNoHistory(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void calculate_forces(); protected: @@ -90,9 +90,9 @@ class GSMTangentialLinearNoHistory : public GSMTangential { /* ---------------------------------------------------------------------- */ -class GSMTangentialLinearHistory : public GSMTangential { +class GranSubModTangentialLinearHistory : public GranSubModTangential { public: - GSMTangentialLinearHistory(class GranularModel *, class LAMMPS *); + GranSubModTangentialLinearHistory(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void calculate_forces(); protected: @@ -101,9 +101,9 @@ class GSMTangentialLinearHistory : public GSMTangential { /* ---------------------------------------------------------------------- */ -class GSMTangentialLinearHistoryClassic : public GSMTangentialLinearHistory { +class GranSubModTangentialLinearHistoryClassic : public GranSubModTangentialLinearHistory { public: - GSMTangentialLinearHistoryClassic(class GranularModel *, class LAMMPS *); + GranSubModTangentialLinearHistoryClassic(class GranularModel *, class LAMMPS *); void calculate_forces(); protected: double xt; @@ -111,16 +111,16 @@ class GSMTangentialLinearHistoryClassic : public GSMTangentialLinearHistory { /* ---------------------------------------------------------------------- */ -class GSMTangentialMindlinClassic : public GSMTangentialLinearHistoryClassic { +class GranSubModTangentialMindlinClassic : public GranSubModTangentialLinearHistoryClassic { public: - GSMTangentialMindlinClassic(class GranularModel *, class LAMMPS *); + GranSubModTangentialMindlinClassic(class GranularModel *, class LAMMPS *); }; /* ---------------------------------------------------------------------- */ -class GSMTangentialMindlin : public GSMTangential { +class GranSubModTangentialMindlin : public GranSubModTangential { public: - GSMTangentialMindlin(class GranularModel *, class LAMMPS *); + GranSubModTangentialMindlin(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void mix_coeffs(double*, double*) override; void calculate_forces(); @@ -131,27 +131,27 @@ class GSMTangentialMindlin : public GSMTangential { /* ---------------------------------------------------------------------- */ -class GSMTangentialMindlinForce : public GSMTangentialMindlin { +class GranSubModTangentialMindlinForce : public GranSubModTangentialMindlin { public: - GSMTangentialMindlinForce(class GranularModel *, class LAMMPS *); + GranSubModTangentialMindlinForce(class GranularModel *, class LAMMPS *); }; /* ---------------------------------------------------------------------- */ -class GSMTangentialMindlinRescale : public GSMTangentialMindlin { +class GranSubModTangentialMindlinRescale : public GranSubModTangentialMindlin { public: - GSMTangentialMindlinRescale(class GranularModel *, class LAMMPS *); + GranSubModTangentialMindlinRescale(class GranularModel *, class LAMMPS *); }; /* ---------------------------------------------------------------------- */ -class GSMTangentialMindlinRescaleForce : public GSMTangentialMindlin { +class GranSubModTangentialMindlinRescaleForce : public GranSubModTangentialMindlin { public: - GSMTangentialMindlinRescaleForce(class GranularModel *, class LAMMPS *); + GranSubModTangentialMindlinRescaleForce(class GranularModel *, class LAMMPS *); }; } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GSM_TANGENTIAL_H_ */ -#endif /*GSM_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_TANGENTIAL_H_ */ +#endif /*GRAN_SUB_MOD_CLASS_H_ */ diff --git a/src/GRANULAR/gsm_twisting.cpp b/src/GRANULAR/gran_sub_mod_twisting.cpp similarity index 82% rename from src/GRANULAR/gsm_twisting.cpp rename to src/GRANULAR/gran_sub_mod_twisting.cpp index 42609bf632..9cb6d69dc8 100644 --- a/src/GRANULAR/gsm_twisting.cpp +++ b/src/GRANULAR/gran_sub_mod_twisting.cpp @@ -12,9 +12,9 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "gsm_normal.h" -#include "gsm_tangential.h" -#include "gsm_twisting.h" +#include "gran_sub_mod_normal.h" +#include "gran_sub_mod_tangential.h" +#include "gran_sub_mod_twisting.h" #include "granular_model.h" #include "error.h" #include "math_const.h" @@ -27,19 +27,19 @@ using namespace MathConst; Default twisting model ------------------------------------------------------------------------- */ -GSMTwisting::GSMTwisting(GranularModel *gm, LAMMPS *lmp) : GSM(gm, lmp) {} +GranSubModTwisting::GranSubModTwisting(GranularModel *gm, LAMMPS *lmp) : GranSubMod(gm, lmp) {} /* ---------------------------------------------------------------------- No model ------------------------------------------------------------------------- */ -GSMTwistingNone::GSMTwistingNone(GranularModel *gm, LAMMPS *lmp) : GSMTwisting(gm, lmp) {} +GranSubModTwistingNone::GranSubModTwistingNone(GranularModel *gm, LAMMPS *lmp) : GranSubModTwisting(gm, lmp) {} /* ---------------------------------------------------------------------- Marshall twisting model ------------------------------------------------------------------------- */ -GSMTwistingMarshall::GSMTwistingMarshall(GranularModel *gm, LAMMPS *lmp) : GSMTwisting(gm, lmp) +GranSubModTwistingMarshall::GranSubModTwistingMarshall(GranularModel *gm, LAMMPS *lmp) : GranSubModTwisting(gm, lmp) { num_coeffs = 0; size_history = 3; @@ -49,7 +49,7 @@ GSMTwistingMarshall::GSMTwistingMarshall(GranularModel *gm, LAMMPS *lmp) : GSMTw /* ---------------------------------------------------------------------- */ -void GSMTwistingMarshall::init() +void GranSubModTwistingMarshall::init() { k_tang = gm->tangential_model->k; mu_tang = gm->tangential_model->mu; @@ -57,7 +57,7 @@ void GSMTwistingMarshall::init() /* ---------------------------------------------------------------------- */ -void GSMTwistingMarshall::calculate_forces() +void GranSubModTwistingMarshall::calculate_forces() { double signtwist, Mtcrit; @@ -86,7 +86,7 @@ void GSMTwistingMarshall::calculate_forces() SDS twisting model ------------------------------------------------------------------------- */ -GSMTwistingSDS::GSMTwistingSDS(GranularModel *gm, LAMMPS *lmp) : GSMTwisting(gm, lmp) +GranSubModTwistingSDS::GranSubModTwistingSDS(GranularModel *gm, LAMMPS *lmp) : GranSubModTwisting(gm, lmp) { num_coeffs = 3; size_history = 3; @@ -94,7 +94,7 @@ GSMTwistingSDS::GSMTwistingSDS(GranularModel *gm, LAMMPS *lmp) : GSMTwisting(gm, /* ---------------------------------------------------------------------- */ -void GSMTwistingSDS::coeffs_to_local() +void GranSubModTwistingSDS::coeffs_to_local() { k = coeffs[0]; damp = coeffs[1]; @@ -106,7 +106,7 @@ void GSMTwistingSDS::coeffs_to_local() /* ---------------------------------------------------------------------- */ -void GSMTwistingSDS::calculate_forces() +void GranSubModTwistingSDS::calculate_forces() { double signtwist, Mtcrit; diff --git a/src/GRANULAR/gsm_twisting.h b/src/GRANULAR/gran_sub_mod_twisting.h similarity index 62% rename from src/GRANULAR/gsm_twisting.h rename to src/GRANULAR/gran_sub_mod_twisting.h index b9ab7826a6..7f8addec97 100644 --- a/src/GRANULAR/gsm_twisting.h +++ b/src/GRANULAR/gran_sub_mod_twisting.h @@ -11,34 +11,34 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef GSM_CLASS +#ifdef GRAN_SUB_MOD_CLASS // clang-format off -GSMStyle(none, - GSMTwistingNone, +GranSubModStyle(none, + GranSubModTwistingNone, TWISTING); -GSMStyle(marshall, - GSMTwistingMarshall, +GranSubModStyle(marshall, + GranSubModTwistingMarshall, TWISTING); -GSMStyle(sds, - GSMTwistingSDS, +GranSubModStyle(sds, + GranSubModTwistingSDS, TWISTING); // clang-format on #else -#ifndef GSM_TWISTING_H_ -#define GSM_TWISTING_H_ +#ifndef GRAN_SUB_MOD_TWISTING_H_ +#define GRAN_SUB_MOD_TWISTING_H_ -#include "gsm.h" +#include "gran_sub_mod.h" namespace LAMMPS_NS { namespace Granular_NS { -class GSMTwisting : public GSM { +class GranSubModTwisting : public GranSubMod { public: - GSMTwisting(class GranularModel *, class LAMMPS *); - virtual ~GSMTwisting() {}; + GranSubModTwisting(class GranularModel *, class LAMMPS *); + virtual ~GranSubModTwisting() {}; virtual void coeffs_to_local() {}; virtual void init() {}; virtual void calculate_forces() = 0; @@ -46,17 +46,17 @@ class GSMTwisting : public GSM { /* ---------------------------------------------------------------------- */ -class GSMTwistingNone : public GSMTwisting { +class GranSubModTwistingNone : public GranSubModTwisting { public: - GSMTwistingNone(class GranularModel *, class LAMMPS *); + GranSubModTwistingNone(class GranularModel *, class LAMMPS *); void calculate_forces() {}; }; /* ---------------------------------------------------------------------- */ -class GSMTwistingMarshall : public GSMTwisting { +class GranSubModTwistingMarshall : public GranSubModTwisting { public: - GSMTwistingMarshall(class GranularModel *, class LAMMPS *); + GranSubModTwistingMarshall(class GranularModel *, class LAMMPS *); void calculate_forces(); void init(); protected: @@ -65,9 +65,9 @@ class GSMTwistingMarshall : public GSMTwisting { /* ---------------------------------------------------------------------- */ -class GSMTwistingSDS : public GSMTwisting { +class GranSubModTwistingSDS : public GranSubModTwisting { public: - GSMTwistingSDS(class GranularModel *, class LAMMPS *); + GranSubModTwistingSDS(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void calculate_forces(); protected: @@ -77,5 +77,5 @@ class GSMTwistingSDS : public GSMTwisting { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GSM_TWISTING_H_ */ -#endif /*GSM_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_TWISTING_H_ */ +#endif /*GRAN_SUB_MOD_CLASS_H_ */ diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index 66e34386ed..872bfa6c8d 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -22,12 +22,12 @@ ----------------------------------------------------------------------- */ #include "granular_model.h" -#include "gsm.h" +#include "gran_sub_mod.h" #include "comm.h" #include "error.h" #include "force.h" #include "math_extra.h" -#include "style_gsm.h" // IWYU pragma: keep +#include "style_gran_sub_mod.h" // IWYU pragma: keep #include @@ -36,10 +36,10 @@ using namespace Granular_NS; using namespace MathExtra; /* ---------------------------------------------------------------------- - one instance per GSM style in style_gsm.h + one instance per GranSubMod style in style_gran_sub_mod.h ------------------------------------------------------------------------- */ -template static GSM *gsm_creator(GranularModel *gm, LAMMPS *lmp) +template static GranSubMod *gran_sub_mod_creator(GranularModel *gm, LAMMPS *lmp) { return new T(gm, lmp); } @@ -64,29 +64,29 @@ GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) for (int i = 0; i < NSUBMODELS; i++) sub_models[i] = nullptr; transfer_history_factor = nullptr; - // extract info from GSM classes listed in style_gsm.h + // extract info from GranSubMod classes listed in style_gran_sub_mod.h nclass = 0; -#define GSM_CLASS -#define GSMStyle(key,Class,type) nclass++; -#include "style_gsm.h" // IWYU pragma: keep -#undef GSMStyle -#undef GSM_CLASS +#define GRANSUBMOD_CLASS +#define GranSubModStyle(key,Class,type) nclass++; +#include "style_gran_sub_mod.h" // IWYU pragma: keep +#undef GranSubModStyle +#undef GRANSUBMOD_CLASS - gsmclass = new GSMCreator[nclass]; - gsmnames = new char*[nclass]; - gsmtypes = new int[nclass]; + gran_sub_mod_class = new GranSubModCreator[nclass]; + gran_sub_mod_names = new char*[nclass]; + gran_sub_mod_types = new int[nclass]; nclass = 0; -#define GSM_CLASS -#define GSMStyle(key,Class,type) \ - gsmclass[nclass] = &gsm_creator; \ - gsmnames[nclass] = (char *) #key; \ - gsmtypes[nclass++] = type; -#include "style_gsm.h" // IWYU pragma: keep -#undef GSMStyle -#undef GSM_CLASS +#define GRANSUBMOD_CLASS +#define GranSubModStyle(key,Class,type) \ + gran_sub_mod_class[nclass] = &gran_sub_mod_creator; \ + gran_sub_mod_names[nclass] = (char *) #key; \ + gran_sub_mod_types[nclass++] = type; +#include "style_gran_sub_mod.h" // IWYU pragma: keep +#undef GranSubModStyle +#undef GRANSUBMOD_CLASS } /* ---------------------------------------------------------------------- */ @@ -94,9 +94,9 @@ GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) GranularModel::~GranularModel() { delete [] transfer_history_factor; - delete [] gsmclass; - delete [] gsmnames; - delete [] gsmtypes; + delete [] gran_sub_mod_class; + delete [] gran_sub_mod_names; + delete [] gran_sub_mod_types; for (int i = 0; i < NSUBMODELS; i ++) delete sub_models[i]; } @@ -132,11 +132,11 @@ void GranularModel::construct_submodel(std::string model_name, SubmodelType mode { int i; for (i = 0; i < nclass; i++) { - if (gsmtypes[i] == model_type) { - if (strcmp(gsmnames[i], model_name.c_str()) == 0) { - GSMCreator &gsm_creator = gsmclass[i]; + if (gran_sub_mod_types[i] == model_type) { + if (strcmp(gran_sub_mod_names[i], model_name.c_str()) == 0) { + GranSubModCreator &gran_sub_mod_creator = gran_sub_mod_class[i]; delete sub_models[model_type]; - sub_models[model_type] = gsm_creator(this, lmp); + sub_models[model_type] = gran_sub_mod_creator(this, lmp); break; } } @@ -148,12 +148,12 @@ void GranularModel::construct_submodel(std::string model_name, SubmodelType mode sub_models[model_type]->name.assign(model_name); sub_models[model_type]->allocate_coeffs(); - if (model_type == NORMAL) normal_model = dynamic_cast (sub_models[NORMAL]); - if (model_type == DAMPING) damping_model = dynamic_cast (sub_models[DAMPING]); - if (model_type == TANGENTIAL) tangential_model = dynamic_cast (sub_models[TANGENTIAL]); - if (model_type == ROLLING) rolling_model = dynamic_cast (sub_models[ROLLING]); - if (model_type == TWISTING) twisting_model = dynamic_cast (sub_models[TWISTING]); - if (model_type == HEAT) heat_model = dynamic_cast (sub_models[HEAT]); + if (model_type == NORMAL) normal_model = dynamic_cast (sub_models[NORMAL]); + if (model_type == DAMPING) damping_model = dynamic_cast (sub_models[DAMPING]); + if (model_type == TANGENTIAL) tangential_model = dynamic_cast (sub_models[TANGENTIAL]); + if (model_type == ROLLING) rolling_model = dynamic_cast (sub_models[ROLLING]); + if (model_type == TWISTING) twisting_model = dynamic_cast (sub_models[TWISTING]); + if (model_type == HEAT) heat_model = dynamic_cast (sub_models[HEAT]); } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index 3ea3d9e4b3..de4f82c01e 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -19,8 +19,6 @@ namespace LAMMPS_NS { namespace Granular_NS { -#define EPSILON 1e-10 - enum SubmodelType { NORMAL = 0, DAMPING, @@ -38,13 +36,13 @@ enum ContactType { }; // forward declarations -class GSM; -class GSMNormal; -class GSMDamping; -class GSMTangential; -class GSMRolling; -class GSMTwisting; -class GSMHeat; +class GranSubMod; +class GranSubModNormal; +class GranSubModDamping; +class GranSubModTangential; +class GranSubModRolling; +class GranSubModTwisting; +class GranSubModHeat; class GranularModel : protected Pointers { public: @@ -64,13 +62,13 @@ class GranularModel : protected Pointers { void read_restart(FILE *); // Sub models - GSMNormal *normal_model; - GSMDamping *damping_model; - GSMTangential *tangential_model; - GSMRolling *rolling_model; - GSMTwisting *twisting_model; - GSMHeat *heat_model; - GSM *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors + GranSubModNormal *normal_model; + GranSubModDamping *damping_model; + GranSubModTangential *tangential_model; + GranSubModRolling *rolling_model; + GranSubModTwisting *twisting_model; + GranSubModHeat *heat_model; + GranSubMod *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors // Extra options int beyond_contact, limit_damping, history_update; @@ -102,10 +100,10 @@ class GranularModel : protected Pointers { int nclass; - typedef class GSM *(*GSMCreator)(class GranularModel *, class LAMMPS *); - GSMCreator *gsmclass; - char **gsmnames; - int *gsmtypes; + typedef class GranSubMod *(*GranSubModCreator)(class GranularModel *, class LAMMPS *); + GranSubModCreator *gran_sub_mod_class; + char **gran_sub_mod_names; + int *gran_sub_mod_types; }; } // namespace Granular_NS diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index dcac8e32c3..b6c9bba705 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -23,7 +23,7 @@ #include "atom.h" #include "comm.h" #include "granular_model.h" -#include "gsm.h" +#include "gran_sub_mod.h" #include "error.h" #include "fix.h" #include "fix_dummy.h" diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 9ae02a200a..956717d598 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -20,12 +20,15 @@ PairStyle(granular,PairGranular); #ifndef LMP_PAIR_GRANULAR_H #define LMP_PAIR_GRANULAR_H -#include "granular_model.h" #include "pair.h" #include namespace LAMMPS_NS { +namespace Granular_NS { + class GranularModel; +} + class PairGranular : public Pair { public: PairGranular(class LAMMPS *); @@ -73,7 +76,7 @@ class PairGranular : public Pair { // granular models int nmodels, maxmodels; - Granular_NS::GranularModel** models_list; + class Granular_NS::GranularModel** models_list; int **types_indices; // optional user-specified global cutoff, per-type user-specified cutoffs diff --git a/src/Make.sh b/src/Make.sh index da034f8226..8f63adea4a 100755 --- a/src/Make.sh +++ b/src/Make.sh @@ -95,27 +95,27 @@ cmd=$1 if (test $cmd = "style") || (test $cmd = "packages") then - $cmd ANGLE_CLASS angle_ angle force - $cmd ATOM_CLASS atom_vec_ atom atom atom_vec_hybrid - $cmd BODY_CLASS body_ body atom_vec_body - $cmd BOND_CLASS bond_ bond force - $cmd COMMAND_CLASS "" command input - $cmd COMPUTE_CLASS compute_ compute modify - $cmd DIHEDRAL_CLASS dihedral_ dihedral force - $cmd DUMP_CLASS dump_ dump output write_dump - $cmd FIX_CLASS fix_ fix modify - $cmd GSM_CLASS gsm_ gsm granular_model - $cmd IMPROPER_CLASS improper_ improper force - $cmd INTEGRATE_CLASS "" integrate update - $cmd KSPACE_CLASS "" kspace force - $cmd MINIMIZE_CLASS min_ minimize update - $cmd NBIN_CLASS nbin_ nbin neighbor - $cmd NPAIR_CLASS npair_ npair neighbor - $cmd NSTENCIL_CLASS nstencil_ nstencil neighbor - $cmd NTOPO_CLASS ntopo_ ntopo neighbor - $cmd PAIR_CLASS pair_ pair force - $cmd READER_CLASS reader_ reader read_dump - $cmd REGION_CLASS region_ region domain + $cmd ANGLE_CLASS angle_ angle force + $cmd ATOM_CLASS atom_vec_ atom atom atom_vec_hybrid + $cmd BODY_CLASS body_ body atom_vec_body + $cmd BOND_CLASS bond_ bond force + $cmd COMMAND_CLASS "" command input + $cmd COMPUTE_CLASS compute_ compute modify + $cmd DIHEDRAL_CLASS dihedral_ dihedral force + $cmd DUMP_CLASS dump_ dump output write_dump + $cmd FIX_CLASS fix_ fix modify + $cmd GRAN_SUB_MOD_CLASS gran_sub_mod_ gran_sub_mod granular_model + $cmd IMPROPER_CLASS improper_ improper force + $cmd INTEGRATE_CLASS "" integrate update + $cmd KSPACE_CLASS "" kspace force + $cmd MINIMIZE_CLASS min_ minimize update + $cmd NBIN_CLASS nbin_ nbin neighbor + $cmd NPAIR_CLASS npair_ npair neighbor + $cmd NSTENCIL_CLASS nstencil_ nstencil neighbor + $cmd NTOPO_CLASS ntopo_ ntopo neighbor + $cmd PAIR_CLASS pair_ pair force + $cmd READER_CLASS reader_ reader read_dump + $cmd REGION_CLASS region_ region domain # edit Makefile.lib, for creating non-shared lib # called by "make makelib" From d6b5878dce42aa9bf1aac6f82daa92ccd6035e2c Mon Sep 17 00:00:00 2001 From: jtclemm Date: Thu, 10 Nov 2022 16:25:34 -0700 Subject: [PATCH 048/112] Adding/removing underscores --- src/GRANULAR/gran_sub_mod.h | 6 +++--- src/GRANULAR/gran_sub_mod_damping.h | 8 ++++---- src/GRANULAR/gran_sub_mod_heat.h | 8 ++++---- src/GRANULAR/gran_sub_mod_normal.h | 8 ++++---- src/GRANULAR/gran_sub_mod_rolling.h | 8 ++++---- src/GRANULAR/gran_sub_mod_tangential.h | 8 ++++---- src/GRANULAR/gran_sub_mod_twisting.h | 8 ++++---- src/GRANULAR/granular_model.cpp | 8 ++++---- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/GRANULAR/gran_sub_mod.h b/src/GRANULAR/gran_sub_mod.h index 78f4229b29..b2335e8cfb 100644 --- a/src/GRANULAR/gran_sub_mod.h +++ b/src/GRANULAR/gran_sub_mod.h @@ -11,8 +11,8 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef LMP_GRAN_SUB_MOD_H_ -#define LMP_GRAN_SUB_MOD_H_ +#ifndef LMP_GRAN_SUB_MOD_H +#define LMP_GRAN_SUB_MOD_H #include "granular_model.h" #include "pointers.h" // IWYU pragma: export @@ -59,4 +59,4 @@ class GranSubMod : protected Pointers { } // namespace GranularModel } // namespace LAMMPS_NS -#endif /* GRAN_SUB_MOD_H_ */ +#endif /* GRAN_SUB_MOD_H */ diff --git a/src/GRANULAR/gran_sub_mod_damping.h b/src/GRANULAR/gran_sub_mod_damping.h index 04316a950d..e5f4227ce8 100644 --- a/src/GRANULAR/gran_sub_mod_damping.h +++ b/src/GRANULAR/gran_sub_mod_damping.h @@ -35,8 +35,8 @@ GranSubModStyle(tsuji, // clang-format on #else -#ifndef GRAN_SUB_MOD_DAMPING_H_ -#define GRAN_SUB_MOD_DAMPING_H_ +#ifndef GRAN_SUB_MOD_DAMPING_H +#define GRAN_SUB_MOD_DAMPING_H #include "gran_sub_mod.h" #include "pointers.h" @@ -102,5 +102,5 @@ class GranSubModDampingTsuji : public GranSubModDamping { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GRAN_SUB_MOD_DAMPING_H_ */ -#endif /*GRAN_SUB_MOD_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_DAMPING_H */ +#endif /*GRAN_SUB_MOD_CLASS_H */ diff --git a/src/GRANULAR/gran_sub_mod_heat.h b/src/GRANULAR/gran_sub_mod_heat.h index 3520a41a06..a5408a0fc2 100644 --- a/src/GRANULAR/gran_sub_mod_heat.h +++ b/src/GRANULAR/gran_sub_mod_heat.h @@ -23,8 +23,8 @@ GranSubModStyle(area, // clang-format on #else -#ifndef GRAN_SUB_MOD_HEAT_H_ -#define GRAN_SUB_MOD_HEAT_H_ +#ifndef GRAN_SUB_MOD_HEAT_H +#define GRAN_SUB_MOD_HEAT_H #include "gran_sub_mod.h" @@ -62,5 +62,5 @@ class GranSubModHeatArea : public GranSubModHeat { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GRAN_SUB_MOD_HEAT_H_ */ -#endif /*GRAN_SUB_MOD_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_HEAT_H */ +#endif /*GRAN_SUB_MOD_CLASS_H */ diff --git a/src/GRANULAR/gran_sub_mod_normal.h b/src/GRANULAR/gran_sub_mod_normal.h index 8fb0c01d4b..49e7d012c4 100644 --- a/src/GRANULAR/gran_sub_mod_normal.h +++ b/src/GRANULAR/gran_sub_mod_normal.h @@ -39,8 +39,8 @@ GranSubModStyle(jkr, // clang-format on #else -#ifndef GRAN_SUB_MOD_NORMAL_H_ -#define GRAN_SUB_MOD_NORMAL_H_ +#ifndef GRAN_SUB_MOD_NORMAL_H +#define GRAN_SUB_MOD_NORMAL_H #include "gran_sub_mod.h" @@ -137,5 +137,5 @@ class GranSubModNormalJKR : public GranSubModNormal { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GRAN_SUB_MOD_NORMAL_H_ */ -#endif /*GRAN_SUB_MOD_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_NORMAL_H */ +#endif /*GRAN_SUB_MOD_CLASS_H */ diff --git a/src/GRANULAR/gran_sub_mod_rolling.h b/src/GRANULAR/gran_sub_mod_rolling.h index cb64c94219..5739067f50 100644 --- a/src/GRANULAR/gran_sub_mod_rolling.h +++ b/src/GRANULAR/gran_sub_mod_rolling.h @@ -23,8 +23,8 @@ GranSubModStyle(sds, // clang-format on #else -#ifndef GRAN_SUB_MOD_ROLLING_H_ -#define GRAN_SUB_MOD_ROLLING_H_ +#ifndef GRAN_SUB_MOD_ROLLING_H +#define GRAN_SUB_MOD_ROLLING_H #include "gran_sub_mod.h" @@ -62,5 +62,5 @@ class GranSubModRollingSDS : public GranSubModRolling { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GRAN_SUB_MOD_ROLLING_H_ */ -#endif /*GRAN_SUB_MOD_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_ROLLING_H */ +#endif /*GRAN_SUB_MOD_CLASS_H */ diff --git a/src/GRANULAR/gran_sub_mod_tangential.h b/src/GRANULAR/gran_sub_mod_tangential.h index 56d72f80d3..b5a195a1d6 100644 --- a/src/GRANULAR/gran_sub_mod_tangential.h +++ b/src/GRANULAR/gran_sub_mod_tangential.h @@ -51,8 +51,8 @@ GranSubModStyle(mindlin_rescale/force, // clang-format on #else -#ifndef GRAN_SUB_MOD_TANGENTIAL_H_ -#define GRAN_SUB_MOD_TANGENTIAL_H_ +#ifndef GRAN_SUB_MOD_TANGENTIAL_H +#define GRAN_SUB_MOD_TANGENTIAL_H #include "gran_sub_mod.h" @@ -153,5 +153,5 @@ class GranSubModTangentialMindlinRescaleForce : public GranSubModTangentialMindl } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GRAN_SUB_MOD_TANGENTIAL_H_ */ -#endif /*GRAN_SUB_MOD_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_TANGENTIAL_H */ +#endif /*GRAN_SUB_MOD_CLASS_H */ diff --git a/src/GRANULAR/gran_sub_mod_twisting.h b/src/GRANULAR/gran_sub_mod_twisting.h index 7f8addec97..c365cba331 100644 --- a/src/GRANULAR/gran_sub_mod_twisting.h +++ b/src/GRANULAR/gran_sub_mod_twisting.h @@ -27,8 +27,8 @@ GranSubModStyle(sds, // clang-format on #else -#ifndef GRAN_SUB_MOD_TWISTING_H_ -#define GRAN_SUB_MOD_TWISTING_H_ +#ifndef GRAN_SUB_MOD_TWISTING_H +#define GRAN_SUB_MOD_TWISTING_H #include "gran_sub_mod.h" @@ -77,5 +77,5 @@ class GranSubModTwistingSDS : public GranSubModTwisting { } // namespace Granular_NS } // namespace LAMMPS_NS -#endif /*GRAN_SUB_MOD_TWISTING_H_ */ -#endif /*GRAN_SUB_MOD_CLASS_H_ */ +#endif /*GRAN_SUB_MOD_TWISTING_H */ +#endif /*GRAN_SUB_MOD_CLASS_H */ diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index 872bfa6c8d..47d84b2495 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -68,25 +68,25 @@ GranularModel::GranularModel(LAMMPS *lmp) : Pointers(lmp) nclass = 0; -#define GRANSUBMOD_CLASS +#define GRAN_SUB_MOD_CLASS #define GranSubModStyle(key,Class,type) nclass++; #include "style_gran_sub_mod.h" // IWYU pragma: keep #undef GranSubModStyle -#undef GRANSUBMOD_CLASS +#undef GRAN_SUB_MOD_CLASS gran_sub_mod_class = new GranSubModCreator[nclass]; gran_sub_mod_names = new char*[nclass]; gran_sub_mod_types = new int[nclass]; nclass = 0; -#define GRANSUBMOD_CLASS +#define GRAN_SUB_MOD_CLASS #define GranSubModStyle(key,Class,type) \ gran_sub_mod_class[nclass] = &gran_sub_mod_creator; \ gran_sub_mod_names[nclass] = (char *) #key; \ gran_sub_mod_types[nclass++] = type; #include "style_gran_sub_mod.h" // IWYU pragma: keep #undef GranSubModStyle -#undef GRANSUBMOD_CLASS +#undef GRAN_SUB_MOD_CLASS } /* ---------------------------------------------------------------------- */ From b2c5c1fda41966987064d6f19543ba2c416f7e6a Mon Sep 17 00:00:00 2001 From: jtclemm Date: Thu, 10 Nov 2022 21:06:47 -0700 Subject: [PATCH 049/112] Fixing cmake style header --- cmake/Modules/StyleHeaderUtils.cmake | 84 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/cmake/Modules/StyleHeaderUtils.cmake b/cmake/Modules/StyleHeaderUtils.cmake index d95e265c4a..2ce7c44d87 100644 --- a/cmake/Modules/StyleHeaderUtils.cmake +++ b/cmake/Modules/StyleHeaderUtils.cmake @@ -119,52 +119,52 @@ function(RegisterStyles search_path) endfunction(RegisterStyles) function(RegisterStylesExt search_path extension sources) - FindStyleHeadersExt(${search_path} ANGLE_CLASS ${extension} ANGLE ${sources}) - FindStyleHeadersExt(${search_path} ATOM_CLASS ${extension} ATOM_VEC ${sources}) - FindStyleHeadersExt(${search_path} BODY_CLASS ${extension} BODY ${sources}) - FindStyleHeadersExt(${search_path} BOND_CLASS ${extension} BOND ${sources}) - FindStyleHeadersExt(${search_path} COMMAND_CLASS ${extension} COMMAND ${sources}) - FindStyleHeadersExt(${search_path} COMPUTE_CLASS ${extension} COMPUTE ${sources}) - FindStyleHeadersExt(${search_path} DIHEDRAL_CLASS ${extension} DIHEDRAL ${sources}) - FindStyleHeadersExt(${search_path} DUMP_CLASS ${extension} DUMP ${sources}) - FindStyleHeadersExt(${search_path} FIX_CLASS ${extension} FIX ${sources}) - FindStyleHeadersExt(${search_path} GSM_CLASS ${extension} GSM ${sources}) - FindStyleHeadersExt(${search_path} IMPROPER_CLASS ${extension} IMPROPER ${sources}) - FindStyleHeadersExt(${search_path} INTEGRATE_CLASS ${extension} INTEGRATE ${sources}) - FindStyleHeadersExt(${search_path} KSPACE_CLASS ${extension} KSPACE ${sources}) - FindStyleHeadersExt(${search_path} MINIMIZE_CLASS ${extension} MINIMIZE ${sources}) - FindStyleHeadersExt(${search_path} NBIN_CLASS ${extension} NBIN ${sources}) - FindStyleHeadersExt(${search_path} NPAIR_CLASS ${extension} NPAIR ${sources}) - FindStyleHeadersExt(${search_path} NSTENCIL_CLASS ${extension} NSTENCIL ${sources}) - FindStyleHeadersExt(${search_path} NTOPO_CLASS ${extension} NTOPO ${sources}) - FindStyleHeadersExt(${search_path} PAIR_CLASS ${extension} PAIR ${sources}) - FindStyleHeadersExt(${search_path} READER_CLASS ${extension} READER ${sources}) - FindStyleHeadersExt(${search_path} REGION_CLASS ${extension} REGION ${sources}) + FindStyleHeadersExt(${search_path} ANGLE_CLASS ${extension} ANGLE ${sources}) + FindStyleHeadersExt(${search_path} ATOM_CLASS ${extension} ATOM_VEC ${sources}) + FindStyleHeadersExt(${search_path} BODY_CLASS ${extension} BODY ${sources}) + FindStyleHeadersExt(${search_path} BOND_CLASS ${extension} BOND ${sources}) + FindStyleHeadersExt(${search_path} COMMAND_CLASS ${extension} COMMAND ${sources}) + FindStyleHeadersExt(${search_path} COMPUTE_CLASS ${extension} COMPUTE ${sources}) + FindStyleHeadersExt(${search_path} DIHEDRAL_CLASS ${extension} DIHEDRAL ${sources}) + FindStyleHeadersExt(${search_path} DUMP_CLASS ${extension} DUMP ${sources}) + FindStyleHeadersExt(${search_path} FIX_CLASS ${extension} FIX ${sources}) + FindStyleHeadersExt(${search_path} GRAN_SUB_MOD_CLASS ${extension} GRAN_SUB_MOD ${sources}) + FindStyleHeadersExt(${search_path} IMPROPER_CLASS ${extension} IMPROPER ${sources}) + FindStyleHeadersExt(${search_path} INTEGRATE_CLASS ${extension} INTEGRATE ${sources}) + FindStyleHeadersExt(${search_path} KSPACE_CLASS ${extension} KSPACE ${sources}) + FindStyleHeadersExt(${search_path} MINIMIZE_CLASS ${extension} MINIMIZE ${sources}) + FindStyleHeadersExt(${search_path} NBIN_CLASS ${extension} NBIN ${sources}) + FindStyleHeadersExt(${search_path} NPAIR_CLASS ${extension} NPAIR ${sources}) + FindStyleHeadersExt(${search_path} NSTENCIL_CLASS ${extension} NSTENCIL ${sources}) + FindStyleHeadersExt(${search_path} NTOPO_CLASS ${extension} NTOPO ${sources}) + FindStyleHeadersExt(${search_path} PAIR_CLASS ${extension} PAIR ${sources}) + FindStyleHeadersExt(${search_path} READER_CLASS ${extension} READER ${sources}) + FindStyleHeadersExt(${search_path} REGION_CLASS ${extension} REGION ${sources}) endfunction(RegisterStylesExt) function(GenerateStyleHeaders output_path) message(STATUS "Generating style headers...") - GenerateStyleHeader(${output_path} ANGLE angle ) # force - GenerateStyleHeader(${output_path} ATOM_VEC atom ) # atom atom_vec_hybrid - GenerateStyleHeader(${output_path} BODY body ) # atom_vec_body - GenerateStyleHeader(${output_path} BOND bond ) # force - GenerateStyleHeader(${output_path} COMMAND command ) # input - GenerateStyleHeader(${output_path} COMPUTE compute ) # modify - GenerateStyleHeader(${output_path} DIHEDRAL dihedral ) # force - GenerateStyleHeader(${output_path} DUMP dump ) # output write_dump - GenerateStyleHeader(${output_path} FIX fix ) # modify - GenerateStyleHeader(${output_path} GSM gsm ) # granular_model - GenerateStyleHeader(${output_path} IMPROPER improper ) # force - GenerateStyleHeader(${output_path} INTEGRATE integrate ) # update - GenerateStyleHeader(${output_path} KSPACE kspace ) # force - GenerateStyleHeader(${output_path} MINIMIZE minimize ) # update - GenerateStyleHeader(${output_path} NBIN nbin ) # neighbor - GenerateStyleHeader(${output_path} NPAIR npair ) # neighbor - GenerateStyleHeader(${output_path} NSTENCIL nstencil ) # neighbor - GenerateStyleHeader(${output_path} NTOPO ntopo ) # neighbor - GenerateStyleHeader(${output_path} PAIR pair ) # force - GenerateStyleHeader(${output_path} READER reader ) # read_dump - GenerateStyleHeader(${output_path} REGION region ) # domain + GenerateStyleHeader(${output_path} ANGLE angle ) # force + GenerateStyleHeader(${output_path} ATOM_VEC atom ) # atom atom_vec_hybrid + GenerateStyleHeader(${output_path} BODY body ) # atom_vec_body + GenerateStyleHeader(${output_path} BOND bond ) # force + GenerateStyleHeader(${output_path} COMMAND command ) # input + GenerateStyleHeader(${output_path} COMPUTE compute ) # modify + GenerateStyleHeader(${output_path} DIHEDRAL dihedral ) # force + GenerateStyleHeader(${output_path} DUMP dump ) # output write_dump + GenerateStyleHeader(${output_path} FIX fix ) # modify + GenerateStyleHeader(${output_path} GRAN_SUB_MOD gran_sub_mod ) # granular_model + GenerateStyleHeader(${output_path} IMPROPER improper ) # force + GenerateStyleHeader(${output_path} INTEGRATE integrate ) # update + GenerateStyleHeader(${output_path} KSPACE kspace ) # force + GenerateStyleHeader(${output_path} MINIMIZE minimize ) # update + GenerateStyleHeader(${output_path} NBIN nbin ) # neighbor + GenerateStyleHeader(${output_path} NPAIR npair ) # neighbor + GenerateStyleHeader(${output_path} NSTENCIL nstencil ) # neighbor + GenerateStyleHeader(${output_path} NTOPO ntopo ) # neighbor + GenerateStyleHeader(${output_path} PAIR pair ) # force + GenerateStyleHeader(${output_path} READER reader ) # read_dump + GenerateStyleHeader(${output_path} REGION region ) # domain endfunction(GenerateStyleHeaders) function(DetectBuildSystemConflict lammps_src_dir) From 5f0fff58ac133135821103a8a6559fd17aac8cf1 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 14 Nov 2022 21:16:03 -0700 Subject: [PATCH 050/112] fixing broken doc references --- doc/src/Commands_fix.rst | 2 +- doc/src/Howto_granular.rst | 4 ++-- doc/src/fix.rst | 2 +- doc/src/pair_granular.rst | 5 +++-- src/GRANULAR/granular_model.cpp | 1 - 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index ec8174a370..604280c73c 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -91,6 +91,7 @@ OPT. * :doc:`grem ` * :doc:`halt ` * :doc:`heat ` + * :doc:`heat/flow/sphere/temp ` * :doc:`hyper/global ` * :doc:`hyper/local ` * :doc:`imd ` @@ -235,7 +236,6 @@ OPT. * :doc:`temp/berendsen ` * :doc:`temp/csld ` * :doc:`temp/csvr ` - * :doc:`temp/integrate ` * :doc:`temp/rescale ` * :doc:`temp/rescale/eff ` * :doc:`tfmc ` diff --git a/doc/src/Howto_granular.rst b/doc/src/Howto_granular.rst index af52904204..6a2346746b 100644 --- a/doc/src/Howto_granular.rst +++ b/doc/src/Howto_granular.rst @@ -46,7 +46,7 @@ atoms, and should be used for granular system instead of the fix style To model heat conduction, one must use the atom style: * :doc:`atom_style sphere/temp ` a temperature integration fix -* :doc:`fix temp/integrate ` +* :doc:`fix heat/flow/sphere/temp ` and a heat conduction option defined in both * :doc:`pair_style granular ` * :doc:`fix wall/gran ` @@ -65,4 +65,4 @@ computations between frozen atoms by using this command: doc page, where 2d simulations are discussed. To add custom granular contact models, see the -:doc:`modifying granular submodels page `. +:doc:`modifying granular sub-models page `. diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 461cfc1465..b87a151061 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -238,6 +238,7 @@ accelerated styles exist. * :doc:`grem ` - implements the generalized replica exchange method * :doc:`halt ` - terminate a dynamics run or minimization * :doc:`heat ` - add/subtract momentum-conserving heat +* :doc:`heat/flow/sphere/temp ` - plain time integration of heat flow with per-atom temperature updates * :doc:`hyper/global ` - global hyperdynamics * :doc:`hyper/local ` - local hyperdynamics * :doc:`imd ` - implements the "Interactive MD" (IMD) protocol @@ -382,7 +383,6 @@ accelerated styles exist. * :doc:`temp/berendsen ` - temperature control by Berendsen thermostat * :doc:`temp/csld ` - canonical sampling thermostat with Langevin dynamics * :doc:`temp/csvr ` - canonical sampling thermostat with Hamiltonian dynamics -* :doc:`temp/integrate ` - plain time integration with per-atom temperature updates * :doc:`temp/rescale ` - temperature control by velocity rescaling * :doc:`temp/rescale/eff ` - temperature control by velocity rescaling in the electron force field model * :doc:`tfmc ` - perform force-bias Monte Carlo with time-stamped method diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index cb044252da..491061b5fb 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -659,8 +659,9 @@ where :math:`\Delta T` is the difference in the two particles' temperature, :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 temp/integrate ` for -more information on this option. +*pair_coeff* calls. See +:doc:`fix heat/flow/sphere/temp ` for more +information on this option. ---------- diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index 47d84b2495..5d89e22d03 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -409,7 +409,6 @@ void GranularModel::calculate_forces() vrel = len3(vtr); // calculate forces/torques - forces[0] = 0.0; double Fdamp, dist_to_contact; if (area_flag) area = normal_model->calculate_area(); From f51ab2c4401c9fe6e01e7b3cb72bf97bacb4b200 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 16 Nov 2022 16:36:22 -0700 Subject: [PATCH 051/112] Restarting limit_damping, other minor simplifications/cleanups --- examples/granular/in.pour.drum | 2 +- src/GRANULAR/fix_wall_gran.cpp | 32 ++++++++--------- src/GRANULAR/fix_wall_gran.h | 3 +- src/GRANULAR/fix_wall_gran_region.cpp | 2 +- src/GRANULAR/gran_sub_mod.h | 4 +-- src/GRANULAR/gran_sub_mod_damping.cpp | 2 +- src/GRANULAR/gran_sub_mod_damping.h | 2 -- src/GRANULAR/gran_sub_mod_heat.h | 2 -- src/GRANULAR/gran_sub_mod_normal.h | 4 +-- src/GRANULAR/gran_sub_mod_rolling.h | 2 -- src/GRANULAR/gran_sub_mod_tangential.h | 4 --- src/GRANULAR/gran_sub_mod_twisting.h | 4 +-- src/GRANULAR/granular_model.cpp | 44 ++++++++++++----------- src/GRANULAR/granular_model.h | 8 ++--- src/GRANULAR/pair_granular.cpp | 50 +++++++++++--------------- 15 files changed, 72 insertions(+), 93 deletions(-) diff --git a/examples/granular/in.pour.drum b/examples/granular/in.pour.drum index e0a0455f61..6c93b700d6 100644 --- a/examples/granular/in.pour.drum +++ b/examples/granular/in.pour.drum @@ -44,7 +44,7 @@ change_box all boundary p p f pair_style granular pair_coeff 1 * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji -pair_coeff 2 2 jkr 1e5 0.1 0.3 50 tangential mindlin NULL 1.0 0.5 rolling sds 1e3 1e3 0.1 twisting marshall damping tsuji +pair_coeff 2 2 jkr 1e5 0.1 0.3 50 tangential mindlin NULL 1.0 0.5 rolling sds 1e3 1e3 0.1 twisting marshall variable theta equal 0 diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index fe2286a0fa..3afb0dc60e 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -67,11 +67,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : model = new GranularModel(lmp); model->contact_type = WALL; - if (strcmp(arg[3],"granular") == 0) classic_flag = 0; - else classic_flag = 1; - limit_damping = 0; heat_flag = 0; - int Twall_defined = 0; + int classic_flag = 1; + if (strcmp(arg[3],"granular") == 0) classic_flag = 0; // wall/particle coefficients @@ -117,10 +115,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } } - // Define default damping model if unspecified, takes no args + // Define default damping submodel if unspecified, takes no args if (!model->damping_model) model->construct_submodel("viscoelastic", DAMPING); - model->init(); size_history = model->size_history; @@ -177,6 +174,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : wiggle = 0; wshear = 0; peratom_flag = 0; + int Twall_defined = 0; while (iarg < narg) { if (strcmp(arg[iarg],"wiggle") == 0) { @@ -216,7 +214,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } if (heat_flag != Twall_defined) - error->all(FLERR, "To model conduction, must define both heat model and wall temperature"); + error->all(FLERR, "Must define wall temperature with heat model"); if (wallstyle == NOSTYLE) error->all(FLERR,"No wall style defined"); @@ -376,6 +374,7 @@ void FixWallGran::post_force(int /*vflag*/) history_update = 1; if (update->setupflag) history_update = 0; + model->history_update = history_update; // if just reneighbored: // update rigid body masses for owned atoms if using FixRigid @@ -407,10 +406,10 @@ void FixWallGran::post_force(int /*vflag*/) if (wiggle) { double arg = omega * (update->ntimestep - time_origin) * dt; if (wallstyle == axis) { - wlo = lo + amplitude - amplitude*cos(arg); - whi = hi + amplitude - amplitude*cos(arg); + wlo = lo + amplitude - amplitude * cos(arg); + whi = hi + amplitude - amplitude * cos(arg); } - vwall[axis] = amplitude*omega*sin(arg); + vwall[axis] = amplitude * omega * sin(arg); } else if (wshear) vwall[axis] = vshear; // loop over all my atoms @@ -473,19 +472,19 @@ void FixWallGran::post_force(int /*vflag*/) if (del1 < del2) dz = del1; else dz = -del2; } else if (wallstyle == ZCYLINDER) { - delxy = sqrt(x[i][0]*x[i][0] + x[i][1]*x[i][1]); + delxy = sqrt(x[i][0] * x[i][0] + x[i][1] * x[i][1]); delr = cylradius - delxy; if (delr > radius[i]) { dz = cylradius; rwall = 0.0; } else { - dx = -delr/delxy * x[i][0]; - dy = -delr/delxy * x[i][1]; + dx = -delr / delxy * x[i][0]; + dy = -delr / delxy * x[i][1]; // rwall = -2r_c if inside cylinder, 2r_c outside - rwall = (delxy < cylradius) ? -2*cylradius : 2*cylradius; + rwall = (delxy < cylradius) ? -2 * cylradius : 2 * cylradius; if (wshear && axis != 2) { - vwall[0] += vshear * x[i][1]/delxy; - vwall[1] += -vshear * x[i][0]/delxy; + vwall[0] += vshear * x[i][1] / delxy; + vwall[1] += -vshear * x[i][0] / delxy; vwall[2] = 0.0; } } @@ -521,7 +520,6 @@ void FixWallGran::post_force(int /*vflag*/) model->meff = meff; model->vi = v[i]; model->omegai = omega[i]; - model->history_update = history_update; if (use_history) model->history = history_one[i]; if (heat_flag) model->Ti = temperature[i]; diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 16a2fe5dc0..45e4e43844 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -53,7 +53,7 @@ class FixWallGran : public Fix { protected: int wallstyle, wiggle, wshear, axis; - int classic_flag, nlevels_respa; + int nlevels_respa; bigint time_origin; // for granular model choices @@ -69,7 +69,6 @@ class FixWallGran : public Fix { int history_update; // flag for whether shear history is updated int size_history; // # of shear history values per contact int heat_flag; - int limit_damping; int tvar; char *tstr; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 7ee794133c..f7b772cb7f 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -135,6 +135,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) history_update = 1; if (update->setupflag) history_update = 0; + model->history_update = history_update; // if just reneighbored: // update rigid body masses for owned atoms if using FixRigid @@ -262,7 +263,6 @@ void FixWallGranRegion::post_force(int /*vflag*/) model->meff = meff; model->vi = v[i]; model->omegai = omega[i]; - model->history_update = history_update; if (use_history) model->history = history_many[i][c2r[ic]]; if (heat_flag) model->Ti = temperature[i]; diff --git a/src/GRANULAR/gran_sub_mod.h b/src/GRANULAR/gran_sub_mod.h index b2335e8cfb..22f1f4e85a 100644 --- a/src/GRANULAR/gran_sub_mod.h +++ b/src/GRANULAR/gran_sub_mod.h @@ -29,8 +29,8 @@ class GranSubMod : protected Pointers { double *coeffs; void read_restart(); virtual void mix_coeffs(double*, double*); - virtual void coeffs_to_local() = 0; - virtual void init() = 0; // called after all submodel coeffs defined + virtual void coeffs_to_local() {}; + virtual void init() {}; // called after all submodels + coeffs defined void allocate_coeffs(); std::string name; diff --git a/src/GRANULAR/gran_sub_mod_damping.cpp b/src/GRANULAR/gran_sub_mod_damping.cpp index e78233735a..820d552679 100644 --- a/src/GRANULAR/gran_sub_mod_damping.cpp +++ b/src/GRANULAR/gran_sub_mod_damping.cpp @@ -108,7 +108,7 @@ void GranSubModDampingTsuji::init() { double tmp = gm->normal_model->damp; damp = 1.2728 - 4.2783 * tmp + 11.087 * square(tmp); - damp += -22.348 * cube(tmp)+ 27.467 * powint(tmp, 4); + damp += -22.348 * cube(tmp) + 27.467 * powint(tmp, 4); damp += -18.022 * powint(tmp, 5) + 4.8218 * powint(tmp,6); } diff --git a/src/GRANULAR/gran_sub_mod_damping.h b/src/GRANULAR/gran_sub_mod_damping.h index e5f4227ce8..5d245c384d 100644 --- a/src/GRANULAR/gran_sub_mod_damping.h +++ b/src/GRANULAR/gran_sub_mod_damping.h @@ -48,8 +48,6 @@ class GranSubModDamping : public GranSubMod { public: GranSubModDamping(class GranularModel *, class LAMMPS *); ~GranSubModDamping() {}; - virtual void coeffs_to_local() {}; - virtual void mix_coeffs(double*, double*) {}; virtual void init(); virtual double calculate_forces() = 0; double damp_prefactor; // Used by tangential models diff --git a/src/GRANULAR/gran_sub_mod_heat.h b/src/GRANULAR/gran_sub_mod_heat.h index a5408a0fc2..ca7e82313a 100644 --- a/src/GRANULAR/gran_sub_mod_heat.h +++ b/src/GRANULAR/gran_sub_mod_heat.h @@ -35,8 +35,6 @@ class GranSubModHeat : public GranSubMod { public: GranSubModHeat(class GranularModel *, class LAMMPS *); ~GranSubModHeat() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; virtual double calculate_heat() = 0; }; diff --git a/src/GRANULAR/gran_sub_mod_normal.h b/src/GRANULAR/gran_sub_mod_normal.h index 49e7d012c4..7dd9f82349 100644 --- a/src/GRANULAR/gran_sub_mod_normal.h +++ b/src/GRANULAR/gran_sub_mod_normal.h @@ -51,8 +51,6 @@ class GranSubModNormal : public GranSubMod { public: GranSubModNormal(class GranularModel *, class LAMMPS *); ~GranSubModNormal() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; virtual bool touch(); virtual double pulloff_distance(double, double); virtual double calculate_area(); @@ -60,7 +58,7 @@ class GranSubModNormal : public GranSubMod { virtual void set_fncrit(); double damp; // argument historically needed by damping double Emod, poiss; - double Fncrit, knfac; + double Fncrit; int material_properties, cohesive_flag; }; diff --git a/src/GRANULAR/gran_sub_mod_rolling.h b/src/GRANULAR/gran_sub_mod_rolling.h index 5739067f50..980daeca89 100644 --- a/src/GRANULAR/gran_sub_mod_rolling.h +++ b/src/GRANULAR/gran_sub_mod_rolling.h @@ -35,8 +35,6 @@ class GranSubModRolling : public GranSubMod { public: GranSubModRolling(class GranularModel *, class LAMMPS *); ~GranSubModRolling() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; virtual void calculate_forces() = 0; }; diff --git a/src/GRANULAR/gran_sub_mod_tangential.h b/src/GRANULAR/gran_sub_mod_tangential.h index b5a195a1d6..27588d49ba 100644 --- a/src/GRANULAR/gran_sub_mod_tangential.h +++ b/src/GRANULAR/gran_sub_mod_tangential.h @@ -63,8 +63,6 @@ class GranSubModTangential : public GranSubMod { public: GranSubModTangential(class GranularModel *, class LAMMPS *); virtual ~GranSubModTangential() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; virtual void calculate_forces() = 0; double k, damp, mu; // Used by Marshall twisting model }; @@ -105,8 +103,6 @@ class GranSubModTangentialLinearHistoryClassic : public GranSubModTangentialLine public: GranSubModTangentialLinearHistoryClassic(class GranularModel *, class LAMMPS *); void calculate_forces(); - protected: - double xt; }; /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/gran_sub_mod_twisting.h b/src/GRANULAR/gran_sub_mod_twisting.h index c365cba331..46f56d37ce 100644 --- a/src/GRANULAR/gran_sub_mod_twisting.h +++ b/src/GRANULAR/gran_sub_mod_twisting.h @@ -39,8 +39,6 @@ class GranSubModTwisting : public GranSubMod { public: GranSubModTwisting(class GranularModel *, class LAMMPS *); virtual ~GranSubModTwisting() {}; - virtual void coeffs_to_local() {}; - virtual void init() {}; virtual void calculate_forces() = 0; }; @@ -57,8 +55,8 @@ class GranSubModTwistingNone : public GranSubModTwisting { class GranSubModTwistingMarshall : public GranSubModTwisting { public: GranSubModTwistingMarshall(class GranularModel *, class LAMMPS *); + void init() override; void calculate_forces(); - void init(); protected: double k_tang, mu_tang; }; diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index 5d89e22d03..afb3328d70 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -148,12 +148,13 @@ void GranularModel::construct_submodel(std::string model_name, SubmodelType mode sub_models[model_type]->name.assign(model_name); sub_models[model_type]->allocate_coeffs(); - if (model_type == NORMAL) normal_model = dynamic_cast (sub_models[NORMAL]); - if (model_type == DAMPING) damping_model = dynamic_cast (sub_models[DAMPING]); - if (model_type == TANGENTIAL) tangential_model = dynamic_cast (sub_models[TANGENTIAL]); - if (model_type == ROLLING) rolling_model = dynamic_cast (sub_models[ROLLING]); - if (model_type == TWISTING) twisting_model = dynamic_cast (sub_models[TWISTING]); - if (model_type == HEAT) heat_model = dynamic_cast (sub_models[HEAT]); + // Assign specific submodel pointer + if (model_type == NORMAL) normal_model = dynamic_cast (sub_models[model_type]); + if (model_type == DAMPING) damping_model = dynamic_cast (sub_models[model_type]); + if (model_type == TANGENTIAL) tangential_model = dynamic_cast (sub_models[model_type]); + if (model_type == ROLLING) rolling_model = dynamic_cast (sub_models[model_type]); + if (model_type == TWISTING) twisting_model = dynamic_cast (sub_models[model_type]); + if (model_type == HEAT) heat_model = dynamic_cast (sub_models[model_type]); } /* ---------------------------------------------------------------------- */ @@ -248,7 +249,8 @@ void GranularModel::init() beyond_contact = 1; size_history += sub_models[i]->size_history; if (!sub_models[i]->allow_cohesion && normal_model->cohesive_flag) - error->all(FLERR,"Cannot use {} model with a cohesive normal model, {}", sub_models[i]->name, normal_model->name); + error->all(FLERR,"Cannot use {} model with a cohesive normal model, {}", + sub_models[i]->name, normal_model->name); if (sub_models[i]->area_flag) area_flag = 1; } @@ -260,14 +262,14 @@ void GranularModel::init() int j; for (int i = 0; i < size_history; i++) { - // Find which model owns this history value + // Find which submodel owns this history value size_cumulative = 0; for (j = 0; j < NSUBMODELS; j++) { if ((size_cumulative + sub_models[j]->size_history) > i) break; size_cumulative += sub_models[j]->size_history; } - // Check if model has nondefault transfers, if so copy its array + // Check if submodel has nondefault transfers, if so copy its array transfer_history_factor[i] = -1; if (j != NSUBMODELS) { if (sub_models[j]->nondefault_history_transfer) { @@ -284,8 +286,7 @@ void GranularModel::init() int GranularModel::mix_coeffs(GranularModel *g1, GranularModel *g2) { - int i; - for (i = 0; i < NSUBMODELS; i++) { + for (int i = 0; i < NSUBMODELS; i++) { if (g1->sub_models[i]->name != g2->sub_models[i]->name) return i; construct_submodel(g1->sub_models[i]->name, (SubmodelType) i); @@ -311,6 +312,8 @@ void GranularModel::write_restart(FILE *fp) fwrite(&num_coeffs, sizeof(int), 1, fp); fwrite(sub_models[i]->coeffs, sizeof(double), num_coeffs, fp); } + + fwrite(&limit_damping, sizeof(int), 1, fp); } /* ---------------------------------------------------------------------- */ @@ -328,22 +331,23 @@ void GranularModel::read_restart(FILE *fp) if (comm->me == 0) utils::sfread(FLERR, const_cast(model_name.data()), sizeof(char),num_char, fp, nullptr, error); MPI_Bcast(const_cast(model_name.data()), num_char, MPI_CHAR, 0, world); - construct_submodel(model_name, (SubmodelType) i); - if (comm->me == 0) { + if (comm->me == 0) utils::sfread(FLERR, &num_coeff, sizeof(int), 1, fp, nullptr, error); - if (num_coeff != sub_models[i]->num_coeffs) - error->one(FLERR, "Invalid granular model written to restart file"); - } MPI_Bcast(&num_coeff, 1, MPI_INT, 0, world); + if (num_coeff != sub_models[i]->num_coeffs) + error->all(FLERR, "Invalid granular model written to restart file"); - if (comm->me == 0) { + if (comm->me == 0) utils::sfread(FLERR, sub_models[i]->coeffs, sizeof(double), num_coeff, fp, nullptr, error); - } MPI_Bcast(sub_models[i]->coeffs, num_coeff, MPI_DOUBLE, 0, world); sub_models[i]->coeffs_to_local(); } + + if (comm->me == 0) + utils::sfread(FLERR, &limit_damping, sizeof(int), 1, fp, nullptr, error); + MPI_Bcast(&limit_damping, 1, MPI_INT, 0, world); } /* ---------------------------------------------------------------------- */ @@ -393,7 +397,7 @@ void GranularModel::calculate_forces() sub3(vi, vj, vr); // normal component - vnnr = dot3(vr, nx); //v_R . n + vnnr = dot3(vr, nx); scale3(vnnr, nx, vn); // tangential component @@ -433,7 +437,7 @@ void GranularModel::calculate_forces() if (contact_type == PAIR) { copy3(torquesi, torquesj); - // Classic pair styles wouldn't scale, but classic option is only used by walls + // Classic pair styles don't scale, but classic option is currently only used by walls dist_to_contact = radi - 0.5 * delta; scale3(dist_to_contact, torquesi); dist_to_contact = radj - 0.5 * delta; diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index de4f82c01e..a047bc27e5 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -68,7 +68,7 @@ class GranularModel : protected Pointers { GranSubModRolling *rolling_model; GranSubModTwisting *twisting_model; GranSubModHeat *heat_model; - GranSubMod *sub_models[NSUBMODELS]; // Need to resize if we add more model flavors + GranSubMod *sub_models[NSUBMODELS]; // Extra options int beyond_contact, limit_damping, history_update; @@ -94,9 +94,9 @@ class GranularModel : protected Pointers { bool touch; protected: - int rolling_defined, twisting_defined, heat_defined; // Used to quickly skip undefined submodels - int classic_model; - int area_flag; + int rolling_defined, twisting_defined, heat_defined; // Flag optional submodels + int classic_model; // Flag original pair/gran calculations + int area_flag; // Flag whether area is needed int nclass; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index b6c9bba705..47bfa89da0 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -57,8 +57,6 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) svector = new double[single_extra]; neighprev = 0; - nmodels = 0; - maxmodels = 0; nmax = 0; mass_rigid = nullptr; @@ -302,6 +300,7 @@ void PairGranular::allocate() maxmodels = n * n + 1; // should never need any more space models_list = (GranularModel **) memory->smalloc(maxmodels * sizeof(GranularModel *), "pair:models_list"); for (int i = 0; i < maxmodels; i++) models_list[i] = nullptr; + nmodels = 0; onerad_dynamic = new double[n+1]; onerad_frozen = new double[n+1]; @@ -339,7 +338,6 @@ void PairGranular::coeff(int narg, char **arg) utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - // Construct new model models_list[nmodels] = new GranularModel(lmp); class GranularModel* model = models_list[nmodels]; @@ -374,9 +372,10 @@ void PairGranular::coeff(int narg, char **arg) } else error->all(FLERR, "Illegal pair_coeff command {}", arg[iarg]); } - // Define default damping model if unspecified, has no coeffs + // Define default damping submodel if unspecified, has no coeffs if (!model->damping_model) model->construct_submodel("viscoelastic", DAMPING); + model->init(); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -388,7 +387,7 @@ void PairGranular::coeff(int narg, char **arg) } } - // If there are > ntype^2 models, delete unused ones + // If there are > ntype^2 models, delete unused models if (nmodels == maxmodels) prune_models(); if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); @@ -419,7 +418,6 @@ void PairGranular::init_style() int size_max[NSUBMODELS] = {0}; for (int n = 0; n < nmodels; n++) { model = models_list[n]; - model->init(); if (model->beyond_contact) { beyond_contact = 1; @@ -559,7 +557,6 @@ double PairGranular::init_one(int i, int j) model1->sub_models[error_code]->name, model2->sub_models[error_code]->name); - // Initialize new model, init_one() occurs after init_style model->init(); for (int k = 0; k < NSUBMODELS; k++) @@ -657,8 +654,10 @@ void PairGranular::read_restart(FILE *fp) MPI_Bcast(&nmodels,1,MPI_INT,0,world); for (i = 0; i < nmodels; i++) { + delete models_list[i]; models_list[i] = new GranularModel(lmp); models_list[i]->read_restart(fp); + models_list[i]->init(); } for (i = 1; i <= atom->ntypes; i++) { @@ -690,28 +689,22 @@ double PairGranular::single(int i, int j, int itype, int jtype, double rsq, double /* factor_coul */, double factor_lj, double &fforce) { - if (factor_lj == 0) { fforce = 0.0; for (int m = 0; m < single_extra; m++) svector[m] = 0.0; return 0.0; } - int jnum; - int *jlist; - double *history,*allhistory; - int nall = atom->nlocal + atom->nghost; if ((i >= nall) || (j >= nall)) error->all(FLERR,"Not enough atoms for pair granular single function"); - int touchflag; - double **x = atom->x; - double *radius = atom->radius; - class GranularModel* model = models_list[types_indices[itype][jtype]]; // Reset model and copy initial geometric data + double **x = atom->x; + double *radius = atom->radius; + model->xi = x[i]; model->xj = x[j]; model->radi = radius[i]; @@ -719,8 +712,9 @@ double PairGranular::single(int i, int j, int itype, int jtype, model->history_update = 0; // Don't update history // If history is needed - jnum = list->numneigh[i]; - jlist = list->firstneigh[i]; + double *history,*allhistory; + int jnum = list->numneigh[i]; + int *jlist = list->firstneigh[i]; if (use_history) { if ((fix_history == nullptr) || (fix_history->firstvalue == nullptr)) error->one(FLERR,"Pair granular single computation needs history"); @@ -730,11 +724,11 @@ double PairGranular::single(int i, int j, int itype, int jtype, if (neighprev >= jnum) neighprev = 0; if (jlist[neighprev] == j) break; } - history = &allhistory[size_history*neighprev]; + history = &allhistory[size_history * neighprev]; model->touch = fix_history->firstflag[i][neighprev]; } - touchflag = model->check_contact(); + int touchflag = model->check_contact(); if (!touchflag) { fforce = 0.0; @@ -745,17 +739,16 @@ double PairGranular::single(int i, int j, int itype, int jtype, // meff = effective mass of pair of particles // if I or J part of rigid body, use body mass // if I or J is frozen, meff is other particle - double mi, mj, meff; double *rmass = atom->rmass; int *mask = atom->mask; - mi = rmass[i]; - mj = rmass[j]; + double mi = rmass[i]; + double mj = rmass[j]; if (fix_rigid) { if (mass_rigid[i] > 0.0) mi = mass_rigid[i]; if (mass_rigid[j] > 0.0) mj = mass_rigid[j]; } - meff = mi * mj / (mi + mj); + double meff = mi * mj / (mi + mj); if (mask[i] & freeze_group_bit) meff = mj; if (mask[j] & freeze_group_bit) meff = mi; @@ -770,11 +763,10 @@ double PairGranular::single(int i, int j, int itype, int jtype, model->omegaj = omega[j]; model->history = history; - double *forces, *torquesi, *torquesj; model->calculate_forces(); - forces = model->forces; - torquesi = model->torquesi; - torquesj = model->torquesj; + double *forces = model->forces; + double *torquesi = model->torquesi; + double *torquesj = model->torquesj; // apply forces & torques fforce = MathExtra::len3(forces); @@ -843,7 +835,7 @@ void PairGranular::transfer_history(double* source, double* target, int itype, i class GranularModel* model = models_list[types_indices[itype][jtype]]; if (model->nondefault_history_transfer) { for (int i = 0; i < size_history; i++) { - target[i] = model->transfer_history_factor[i] * source [i]; + target[i] = model->transfer_history_factor[i] * source[i]; } } else { for (int i = 0; i < size_history; i++) { From 1a467233fb1920f19d7caffcefa255d2d2e3688a Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 29 Nov 2022 12:24:43 -0700 Subject: [PATCH 052/112] adding examples, fixing wall algebra, updating labels --- src/GRANULAR/fix_wall_gran.cpp | 16 ++++++------ src/GRANULAR/gran_sub_mod.cpp | 24 +++++++++--------- src/GRANULAR/gran_sub_mod.h | 8 +++--- src/GRANULAR/granular_model.cpp | 44 ++++++++++++++++----------------- src/GRANULAR/granular_model.h | 8 +++--- src/GRANULAR/pair_granular.cpp | 22 ++++++++--------- 6 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 3afb0dc60e..7029074fe8 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -86,19 +86,19 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } else { iarg = 4; - iarg = model->add_submodel(arg, iarg, narg, NORMAL); + iarg = model->add_sub_model(arg, iarg, narg, NORMAL); while (iarg < narg) { if (strcmp(arg[iarg], "damping") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, DAMPING); + iarg = model->add_sub_model(arg, iarg + 1, narg, DAMPING); } else if (strcmp(arg[iarg], "tangential") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, TANGENTIAL); + iarg = model->add_sub_model(arg, iarg + 1, narg, TANGENTIAL); } else if (strcmp(arg[iarg], "rolling") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, ROLLING); + iarg = model->add_sub_model(arg, iarg + 1, narg, ROLLING); } else if (strcmp(arg[iarg], "twisting") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, TWISTING); + iarg = model->add_sub_model(arg, iarg + 1, narg, TWISTING); } else if (strcmp(arg[iarg], "heat") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, HEAT); + iarg = model->add_sub_model(arg, iarg + 1, narg, HEAT); heat_flag = 1; } else if (strcmp(arg[iarg], "xplane") == 0 || strcmp(arg[iarg], "yplane") == 0 || @@ -115,9 +115,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } } - // Define default damping submodel if unspecified, takes no args + // Define default damping sub model if unspecified, takes no args if (!model->damping_model) - model->construct_submodel("viscoelastic", DAMPING); + model->construct_sub_model("viscoelastic", DAMPING); model->init(); size_history = model->size_history; diff --git a/src/GRANULAR/gran_sub_mod.cpp b/src/GRANULAR/gran_sub_mod.cpp index 2d836151f8..5650f4f45a 100644 --- a/src/GRANULAR/gran_sub_mod.cpp +++ b/src/GRANULAR/gran_sub_mod.cpp @@ -13,7 +13,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - This class contains a framework for granular submodels (GranSubMod): + This class contains a framework for granular sub models (GranSubMod): normal, damping, tangential, rolling, twisting, and heat These are used to calculate forces/torques/etc based on contact geometry @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; using namespace Granular_NS; /* ---------------------------------------------------------------------- - Parent class for all types of granular submodels + Parent class for all types of granular sub models ------------------------------------------------------------------------- */ GranSubMod::GranSubMod(class GranularModel *gm, LAMMPS *lmp) : Pointers(lmp) @@ -79,10 +79,10 @@ void GranSubMod::mix_coeffs(double* icoeffs, double* jcoeffs) ------------------------------------------------------------------------- */ double GranSubMod::mix_stiffnessE(double E1, double E2, - double pois1, double pois2) + double poiss1, double poiss2) { - double factor1 = (1 - pois1 * pois1) / E1; - double factor2 = (1 - pois2 * pois2) / E2; + double factor1 = (1 - poiss1 * poiss1) / E1; + double factor2 = (1 - poiss2 * poiss2) / E2; return 1 / (factor1 + factor2); } @@ -91,10 +91,10 @@ double GranSubMod::mix_stiffnessE(double E1, double E2, ------------------------------------------------------------------------ */ double GranSubMod::mix_stiffnessG(double E1, double E2, - double pois1, double pois2) + double poiss1, double poiss2) { - double factor1 = 2 * (2 - pois1) * (1 + pois1) / E1; - double factor2 = 2 * (2 - pois2) * (1 + pois2) / E2; + double factor1 = 2 * (2 - poiss1) * (1 + poiss1) / E1; + double factor2 = 2 * (2 - poiss2) * (1 + poiss2) / E2; return 1 / (factor1 + factor2); } @@ -102,9 +102,9 @@ double GranSubMod::mix_stiffnessG(double E1, double E2, mixing of Young's modulus (E) for walls ------------------------------------------------------------------------- */ -double GranSubMod::mix_stiffnessE_wall(double E, double pois) +double GranSubMod::mix_stiffnessE_wall(double E, double poiss) { - double factor = 2 * (1 - pois); + double factor = 2 * (1 - poiss * poiss); return E / factor; } @@ -112,9 +112,9 @@ double GranSubMod::mix_stiffnessE_wall(double E, double pois) mixing of shear modulus (G) for walls ------------------------------------------------------------------------ */ -double GranSubMod::mix_stiffnessG_wall(double E, double pois) +double GranSubMod::mix_stiffnessG_wall(double E, double poiss) { - double factor = 32.0 * (2 - pois) * (1 + pois); + double factor = 4.0 * (2 - poiss) * (1 + poiss); return E / factor; } diff --git a/src/GRANULAR/gran_sub_mod.h b/src/GRANULAR/gran_sub_mod.h index 22f1f4e85a..a8bc430857 100644 --- a/src/GRANULAR/gran_sub_mod.h +++ b/src/GRANULAR/gran_sub_mod.h @@ -30,7 +30,7 @@ class GranSubMod : protected Pointers { void read_restart(); virtual void mix_coeffs(double*, double*); virtual void coeffs_to_local() {}; - virtual void init() {}; // called after all submodels + coeffs defined + virtual void init() {}; // called after all sub models + coeffs defined void allocate_coeffs(); std::string name; @@ -40,9 +40,9 @@ class GranSubMod : protected Pointers { double *transfer_history_factor; int history_index; - int beyond_contact; // If the submodel contact extends beyond overlap - int allow_cohesion; // If the submodel works with a cohesive normal force - int area_flag; // If the submodel requires area + int beyond_contact; // If the sub model contact extends beyond overlap + int allow_cohesion; // If the sub model works with a cohesive normal force + int area_flag; // If the sub model requires area GranularModel *gm; diff --git a/src/GRANULAR/granular_model.cpp b/src/GRANULAR/granular_model.cpp index afb3328d70..6b5ba1bedf 100644 --- a/src/GRANULAR/granular_model.cpp +++ b/src/GRANULAR/granular_model.cpp @@ -103,13 +103,13 @@ GranularModel::~GranularModel() /* ---------------------------------------------------------------------- */ -int GranularModel::add_submodel(char **arg, int iarg, int narg, SubmodelType model_type) +int GranularModel::add_sub_model(char **arg, int iarg, int narg, SubModelType model_type) { if (iarg >= narg) - error->all(FLERR, "Must specify granular submodel name"); + error->all(FLERR, "Must specify granular sub model name"); std::string model_name = std::string(arg[iarg++]); - construct_submodel(model_name, model_type); + construct_sub_model(model_name, model_type); int num_coeffs = sub_models[model_type]->num_coeffs; if (iarg + num_coeffs > narg) @@ -128,7 +128,7 @@ int GranularModel::add_submodel(char **arg, int iarg, int narg, SubmodelType mod /* ---------------------------------------------------------------------- */ -void GranularModel::construct_submodel(std::string model_name, SubmodelType model_type) +void GranularModel::construct_sub_model(std::string model_name, SubModelType model_type) { int i; for (i = 0; i < nclass; i++) { @@ -148,7 +148,7 @@ void GranularModel::construct_submodel(std::string model_name, SubmodelType mode sub_models[model_type]->name.assign(model_name); sub_models[model_type]->allocate_coeffs(); - // Assign specific submodel pointer + // Assign specific sub model pointer if (model_type == NORMAL) normal_model = dynamic_cast (sub_models[model_type]); if (model_type == DAMPING) damping_model = dynamic_cast (sub_models[model_type]); if (model_type == TANGENTIAL) tangential_model = dynamic_cast (sub_models[model_type]); @@ -185,26 +185,26 @@ int GranularModel::define_classic_model(char **arg, int iarg, int narg) error->all(FLERR,"Illegal classic gran model command"); if (strcmp(arg[iarg],"hooke") == 0) { - construct_submodel("hooke", NORMAL); - construct_submodel("linear_nohistory", TANGENTIAL); - construct_submodel("mass_velocity", DAMPING); + construct_sub_model("hooke", NORMAL); + construct_sub_model("linear_nohistory", TANGENTIAL); + construct_sub_model("mass_velocity", DAMPING); } else if (strcmp(arg[iarg],"hooke/history") == 0) { - construct_submodel("hooke", NORMAL); - construct_submodel("linear_history_classic", TANGENTIAL); - construct_submodel("mass_velocity", DAMPING); + construct_sub_model("hooke", NORMAL); + construct_sub_model("linear_history_classic", TANGENTIAL); + construct_sub_model("mass_velocity", DAMPING); } else if (strcmp(arg[iarg],"hertz/history") == 0) { // convert Kn and Kt from pressure units to force/distance^2 if Hertzian kn /= force->nktv2p; kt /= force->nktv2p; - construct_submodel("hertz", NORMAL); - construct_submodel("mindlin_classic", TANGENTIAL); - construct_submodel("viscoelastic", DAMPING); + construct_sub_model("hertz", NORMAL); + construct_sub_model("mindlin_classic", TANGENTIAL); + construct_sub_model("viscoelastic", DAMPING); } else error->all(FLERR,"Invalid classic gran model"); // ensure additional models are undefined - construct_submodel("none", ROLLING); - construct_submodel("none", TWISTING); - construct_submodel("none", HEAT); + construct_sub_model("none", ROLLING); + construct_sub_model("none", TWISTING); + construct_sub_model("none", HEAT); // manually parse coeffs normal_model->coeffs[0] = kn; @@ -226,7 +226,7 @@ int GranularModel::define_classic_model(char **arg, int iarg, int narg) void GranularModel::init() { for (int i = 0; i < NSUBMODELS; i++) - if (!sub_models[i]) construct_submodel("none", (SubmodelType) i); + if (!sub_models[i]) construct_sub_model("none", (SubModelType) i); // Must have valid normal, damping, and tangential models if (normal_model->name == "none") error->all(FLERR, "Must specify normal granular model"); @@ -262,14 +262,14 @@ void GranularModel::init() int j; for (int i = 0; i < size_history; i++) { - // Find which submodel owns this history value + // Find which sub model owns this history value size_cumulative = 0; for (j = 0; j < NSUBMODELS; j++) { if ((size_cumulative + sub_models[j]->size_history) > i) break; size_cumulative += sub_models[j]->size_history; } - // Check if submodel has nondefault transfers, if so copy its array + // Check if sub model has nondefault transfers, if so copy its array transfer_history_factor[i] = -1; if (j != NSUBMODELS) { if (sub_models[j]->nondefault_history_transfer) { @@ -289,7 +289,7 @@ int GranularModel::mix_coeffs(GranularModel *g1, GranularModel *g2) for (int i = 0; i < NSUBMODELS; i++) { if (g1->sub_models[i]->name != g2->sub_models[i]->name) return i; - construct_submodel(g1->sub_models[i]->name, (SubmodelType) i); + construct_sub_model(g1->sub_models[i]->name, (SubModelType) i); sub_models[i]->mix_coeffs(g1->sub_models[i]->coeffs, g2->sub_models[i]->coeffs); } @@ -331,7 +331,7 @@ void GranularModel::read_restart(FILE *fp) if (comm->me == 0) utils::sfread(FLERR, const_cast(model_name.data()), sizeof(char),num_char, fp, nullptr, error); MPI_Bcast(const_cast(model_name.data()), num_char, MPI_CHAR, 0, world); - construct_submodel(model_name, (SubmodelType) i); + construct_sub_model(model_name, (SubModelType) i); if (comm->me == 0) utils::sfread(FLERR, &num_coeff, sizeof(int), 1, fp, nullptr, error); diff --git a/src/GRANULAR/granular_model.h b/src/GRANULAR/granular_model.h index a047bc27e5..62b3007b0e 100644 --- a/src/GRANULAR/granular_model.h +++ b/src/GRANULAR/granular_model.h @@ -19,7 +19,7 @@ namespace LAMMPS_NS { namespace Granular_NS { -enum SubmodelType { +enum SubModelType { NORMAL = 0, DAMPING, TANGENTIAL, @@ -53,9 +53,9 @@ class GranularModel : protected Pointers { void calculate_forces(); double pulloff_distance(double, double); - int add_submodel(char **, int, int, SubmodelType); + int add_sub_model(char **, int, int, SubModelType); int define_classic_model(char **, int, int); - void construct_submodel(std::string, SubmodelType); + void construct_sub_model(std::string, SubModelType); int mix_coeffs(GranularModel*, GranularModel*); void write_restart(FILE *); @@ -94,7 +94,7 @@ class GranularModel : protected Pointers { bool touch; protected: - int rolling_defined, twisting_defined, heat_defined; // Flag optional submodels + int rolling_defined, twisting_defined, heat_defined; // Flag optional sub models int classic_model; // Flag original pair/gran calculations int area_flag; // Flag whether area is needed diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 47bfa89da0..21278d2891 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -345,21 +345,21 @@ void PairGranular::coeff(int narg, char **arg) //Parse mandatory specification int iarg = 2; - iarg = model->add_submodel(arg, iarg, narg, NORMAL); + iarg = model->add_sub_model(arg, iarg, narg, NORMAL); //Parse optional arguments while (iarg < narg) { if (strcmp(arg[iarg], "tangential") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, TANGENTIAL); + iarg = model->add_sub_model(arg, iarg + 1, narg, TANGENTIAL); } else if (strcmp(arg[iarg], "damping") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, DAMPING); + iarg = model->add_sub_model(arg, iarg + 1, narg, DAMPING); } else if (strcmp(arg[iarg], "rolling") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, ROLLING); + iarg = model->add_sub_model(arg, iarg + 1, narg, ROLLING); } else if (strcmp(arg[iarg], "twisting") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, TWISTING); + iarg = model->add_sub_model(arg, iarg + 1, narg, TWISTING); } else if (strcmp(arg[iarg], "heat") == 0) { - iarg = model->add_submodel(arg, iarg + 1, narg, HEAT); + iarg = model->add_sub_model(arg, iarg + 1, narg, HEAT); heat_flag = 1; } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) @@ -372,9 +372,9 @@ void PairGranular::coeff(int narg, char **arg) } else error->all(FLERR, "Illegal pair_coeff command {}", arg[iarg]); } - // Define default damping submodel if unspecified, has no coeffs + // Define default damping sub model if unspecified, has no coeffs if (!model->damping_model) - model->construct_submodel("viscoelastic", DAMPING); + model->construct_sub_model("viscoelastic", DAMPING); model->init(); int count = 0; @@ -551,7 +551,7 @@ double PairGranular::init_one(int i, int j) if (error_code != -1) error->all(FLERR,"Granular pair style functional forms are different, " "cannot mix coefficients for types {} and {} \n" - "with submodels {} and {}. \n" + "with sub models {} and {}. \n" "This combination must be set explicitly via a " "pair_coeff command",i,j, model1->sub_models[error_code]->name, @@ -834,11 +834,11 @@ void PairGranular::transfer_history(double* source, double* target, int itype, i { class GranularModel* model = models_list[types_indices[itype][jtype]]; if (model->nondefault_history_transfer) { - for (int i = 0; i < size_history; i++) { + for (int i = 0; i < model->size_history; i++) { target[i] = model->transfer_history_factor[i] * source[i]; } } else { - for (int i = 0; i < size_history; i++) { + for (int i = 0; i < model->size_history; i++) { target[i] = -source[i]; } } From e8c271cc1608d050088b01de3ae73df0da67db93 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 26 Nov 2022 15:29:32 -0500 Subject: [PATCH 053/112] update python to version to 3.11 and disable png/jpeg for now --- .github/workflows/compile-msvc.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 3ec5fc4cb0..d756e9fa82 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -26,7 +26,7 @@ jobs: - name: Select Python version uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Building LAMMPS via CMake shell: bash @@ -35,6 +35,8 @@ jobs: python3 -m pip install pyyaml cmake -C cmake/presets/windows.cmake \ -D PKG_PYTHON=on \ + -D WITH_PNG=off \ + -D WITH_JPEG=off \ -S cmake -B build \ -D BUILD_SHARED_LIBS=on \ -D LAMMPS_EXCEPTIONS=on \ From f2d866420a51e66e88dab9ceac688c22892428f5 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 7 Dec 2022 11:41:53 -0700 Subject: [PATCH 054/112] Updated examples --- .../log.15Sep22.granregion.box.g++.1 | 493 +++++++ .../log.15Sep22.granregion.box.g++.4 | 493 +++++++ .../log.15Sep22.granregion.funnel.g++.1 | 633 +++++++++ .../log.15Sep22.granregion.funnel.g++.4 | 633 +++++++++ .../log.15Sep22.granregion.mixer.g++.1 | 632 +++++++++ .../log.15Sep22.granregion.mixer.g++.4 | 632 +++++++++ .../log.27Nov18.granregion.box.g++.1 | 475 ------- .../log.27Nov18.granregion.box.g++.4 | 475 ------- .../log.27Nov18.granregion.funnel.g++.1 | 601 --------- .../log.27Nov18.granregion.funnel.g++.4 | 601 --------- .../log.27Nov18.granregion.mixer.g++.1 | 602 --------- .../log.27Nov18.granregion.mixer.g++.4 | 602 --------- examples/granular/in.pour.heat | 2 +- examples/granular/log.15Sep22.pour.drum.g++.1 | 272 ++++ examples/granular/log.15Sep22.pour.drum.g++.4 | 272 ++++ .../granular/log.15Sep22.pour.flatwall.g++.1 | 195 +++ .../granular/log.15Sep22.pour.flatwall.g++.4 | 195 +++ examples/granular/log.15Sep22.pour.heat.g++.1 | 1172 +++++++++++++++++ examples/granular/log.15Sep22.pour.heat.g++.4 | 1172 +++++++++++++++++ examples/granular/log.29Oct20.pour.drum.g++.1 | 271 ---- examples/granular/log.29Oct20.pour.drum.g++.4 | 271 ---- .../granular/log.29Oct20.pour.flatwall.g++.1 | 188 --- .../granular/log.29Oct20.pour.flatwall.g++.4 | 188 --- 23 files changed, 6795 insertions(+), 4275 deletions(-) create mode 100644 examples/granregion/log.15Sep22.granregion.box.g++.1 create mode 100644 examples/granregion/log.15Sep22.granregion.box.g++.4 create mode 100644 examples/granregion/log.15Sep22.granregion.funnel.g++.1 create mode 100644 examples/granregion/log.15Sep22.granregion.funnel.g++.4 create mode 100644 examples/granregion/log.15Sep22.granregion.mixer.g++.1 create mode 100644 examples/granregion/log.15Sep22.granregion.mixer.g++.4 delete mode 100644 examples/granregion/log.27Nov18.granregion.box.g++.1 delete mode 100644 examples/granregion/log.27Nov18.granregion.box.g++.4 delete mode 100644 examples/granregion/log.27Nov18.granregion.funnel.g++.1 delete mode 100644 examples/granregion/log.27Nov18.granregion.funnel.g++.4 delete mode 100644 examples/granregion/log.27Nov18.granregion.mixer.g++.1 delete mode 100644 examples/granregion/log.27Nov18.granregion.mixer.g++.4 create mode 100644 examples/granular/log.15Sep22.pour.drum.g++.1 create mode 100644 examples/granular/log.15Sep22.pour.drum.g++.4 create mode 100644 examples/granular/log.15Sep22.pour.flatwall.g++.1 create mode 100644 examples/granular/log.15Sep22.pour.flatwall.g++.4 create mode 100644 examples/granular/log.15Sep22.pour.heat.g++.1 create mode 100644 examples/granular/log.15Sep22.pour.heat.g++.4 delete mode 100644 examples/granular/log.29Oct20.pour.drum.g++.1 delete mode 100644 examples/granular/log.29Oct20.pour.drum.g++.4 delete mode 100644 examples/granular/log.29Oct20.pour.flatwall.g++.1 delete mode 100644 examples/granular/log.29Oct20.pour.flatwall.g++.4 diff --git a/examples/granregion/log.15Sep22.granregion.box.g++.1 b/examples/granregion/log.15Sep22.granregion.box.g++.1 new file mode 100644 index 0000000000..0df89d49ee --- /dev/null +++ b/examples/granregion/log.15Sep22.granregion.box.g++.1 @@ -0,0 +1,493 @@ +LAMMPS (15 Sep 2022) +# pouring spheres into container box + +units lj +atom_style sphere +boundary f f f +dimension 3 +comm_modify vel yes + +region box block -10 10 -10 10 -10 10 units box +create_box 2 box +Created orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 1 by 1 MPI processor grid + +pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 +pair_coeff * * gran/hooke + +region container block -6 6 -6 6 -6 6 units box +fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 2 all nve/sphere +fix 3 all gravity 1.0 vector 0 0 -1 + +region slab block -2 2 -2 2 -2 2 units box +fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore +Particle insertion: 48 every 566 steps, 100 by step 1133 + +timestep 0.005 + +compute 1 all temp +compute_modify 1 dynamic/dof yes + +compute 2 all temp/sphere +compute_modify 2 dynamic/dof yes + +thermo 100 +thermo_style custom step atoms temp c_1 c_2 press +thermo_modify lost ignore +compute_modify thermo_temp dynamic/dof yes + +#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 +#dump_modify 2 pad 5 + +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 1.3 + binsize = 0.65, bins = 31 31 31 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke, perpetual + attributes: half, newton on, size + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.5861 | 0.5861 | 0.5861 Mbytes + Step Atoms Temp c_1 c_2 Press + 0 0 0 0 0 0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 100 30 0.803783 0.803783 0.39507978 0.0029137134 + 200 30 1.1967995 1.1967995 0.5882574 0.0043383984 + 300 30 1.2814686 1.2814686 0.62987441 0.0046453238 + 400 30 0.82331082 0.82331082 0.41173176 0.0029845017 + 500 30 0.7708462 0.7708462 0.38777784 0.0043831147 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 600 64 0.51564897 0.51564897 0.26631577 0.0040059368 + 700 64 0.57239348 0.57239348 0.29566901 0.0045075987 + 800 64 0.61837087 0.61837087 0.32195387 0.0048123564 + 900 64 0.53061888 0.53061888 0.28564763 0.0055906552 + 1000 64 0.496299 0.496299 0.26801572 0.0061169128 + 1100 64 0.46068308 0.46068308 0.24699057 0.0055717699 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 1200 99 0.39206225 0.39206225 0.21356546 0.0066294211 + 1300 99 0.38624966 0.38624966 0.21345854 0.0049051051 + 1400 99 0.35615284 0.35615284 0.19785725 0.0046170772 + 1500 99 0.31486693 0.31486693 0.17429055 0.0064903432 + 1600 99 0.26369001 0.26369001 0.15095266 0.0045226847 + 1700 100 0.1925923 0.1925923 0.11308104 0.007362313 + 1800 100 0.13724978 0.13724978 0.083276845 0.0058136373 + 1900 100 0.077212636 0.077212636 0.053159386 0.0016509598 + 2000 100 0.065294031 0.065294031 0.04372752 0.0020346467 + 2100 100 0.057431398 0.057431398 0.037977068 0.0012681098 + 2200 100 0.059093045 0.059093045 0.037435193 0.00096610799 + 2300 100 0.03422338 0.03422338 0.025491304 0.00069886052 + 2400 100 0.020558284 0.020558284 0.016163009 0.0017260663 + 2500 100 0.015339709 0.015339709 0.012329236 0.00041308031 + 2600 100 0.012891354 0.012891354 0.009766054 0.00030356722 + 2700 100 0.0092634449 0.0092634449 0.0073580108 0.00077723051 + 2800 100 0.0073925841 0.0073925841 0.0059932218 0.00016466767 + 2900 100 0.0081228267 0.0081228267 0.006281761 0.00013828388 + 3000 100 0.0041833223 0.0041833223 0.0035147096 0.00013160599 + 3100 100 0.0035930775 0.0035930775 0.0030039922 0.00060639771 + 3200 100 0.0030824465 0.0030824465 0.0026541293 0.00047391014 + 3300 100 0.0035087522 0.0035087522 0.0027664508 0.00014080317 + 3400 100 0.0018537868 0.0018537868 0.0017099705 6.3326674e-05 + 3500 100 0.0015371228 0.0015371228 0.0014155433 0.00021612522 + 3600 100 0.001708556 0.001708556 0.0014369892 8.1034202e-05 + 3700 100 0.00095948652 0.00095948652 0.0009788528 3.4694023e-05 + 3800 100 0.00091875668 0.00091875668 0.00086805146 3.9373686e-05 + 3900 100 0.001557068 0.001557068 0.001159526 2.5178607e-05 + 4000 100 0.00062012451 0.00062012451 0.00066806922 5.6680551e-06 + 4100 100 0.00060940771 0.00060940771 0.00065614741 1.0137901e-05 + 4200 100 0.00059538437 0.00059538437 0.00064501521 7.3679744e-06 + 4300 100 0.00052946048 0.00052946048 0.00059353641 5.9225081e-06 + 4400 100 0.00051202281 0.00051202281 0.00057524772 3.6198435e-05 + 4500 100 0.00049986632 0.00049986632 0.00055754521 2.2275519e-05 + 4600 100 0.00048187334 0.00048187334 0.00053988815 2.2015243e-05 + 4700 100 0.00045261491 0.00045261491 0.00050298355 8.9681339e-05 + 4800 100 0.00034965427 0.00034965427 0.0004278781 1.0983535e-05 + 4900 100 0.00033555621 0.00033555621 0.00041435167 2.9266598e-05 + 5000 100 0.00031387148 0.00031387148 0.00039605781 2.5628425e-05 +Loop time of 0.078687 on 1 procs for 5000 steps with 100 atoms + +Performance: 27450544.413 tau/day, 63542.927 timesteps/s, 6.354 Matom-step/s +80.5% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0084151 | 0.0084151 | 0.0084151 | 0.0 | 10.69 +Neigh | 0.012728 | 0.012728 | 0.012728 | 0.0 | 16.18 +Comm | 0.0056143 | 0.0056143 | 0.0056143 | 0.0 | 7.14 +Output | 0.00051411 | 0.00051411 | 0.00051411 | 0.0 | 0.65 +Modify | 0.041412 | 0.041412 | 0.041412 | 0.0 | 52.63 +Other | | 0.01 | | | 12.71 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 164 ave 164 max 164 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 164 +Ave neighs/atom = 1.64 +Neighbor list builds = 281 +Dangerous builds = 0 + +region container delete +variable theta equal (step-5000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 1.3 + binsize = 0.65, bins = 31 31 31 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke, perpetual + attributes: half, newton on, size + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 5000 100 0.00031387148 0.00031387148 0.00039605781 2.6174978e-05 + 5100 100 0.54537023 0.54537023 0.30042175 0.0087427352 + 5200 100 0.57210852 0.57210852 0.3192468 0.0098134067 + 5300 100 0.7168108 0.7168108 0.38577893 0.011004584 + 5400 100 0.78895524 0.78895524 0.41889428 0.013555713 + 5500 100 0.87797874 0.87797874 0.45689223 0.01565356 + 5600 100 0.95424379 0.95424379 0.48830429 0.014707858 + 5700 100 1.0046012 1.0046012 0.51054927 0.01469179 + 5800 100 1.0371453 1.0371453 0.5262568 0.015576788 + 5900 100 1.0545743 1.0545743 0.5361173 0.01589889 + 6000 100 1.0932949 1.0932949 0.55402214 0.017484573 + 6100 100 1.1148364 1.1148364 0.56241126 0.01721788 + 6200 100 1.1315267 1.1315267 0.57050887 0.017961246 + 6300 100 1.1506124 1.1506124 0.58009471 0.017159062 + 6400 100 1.1663328 1.1663328 0.5876586 0.017935311 + 6500 100 1.1821086 1.1821086 0.59595162 0.018005316 + 6600 100 1.2039397 1.2039397 0.60567524 0.021604669 + 6700 100 1.2269911 1.2269911 0.61770224 0.018907995 + 6800 100 1.2447035 1.2447035 0.6257652 0.02053766 + 6900 100 1.2625323 1.2625323 0.63486698 0.020106134 + 7000 100 1.2617127 1.2617127 0.63318163 0.019670429 + 7100 100 1.260715 1.260715 0.63311254 0.019810631 + 7200 100 1.2790404 1.2790404 0.64079001 0.020218903 + 7300 100 1.2760228 1.2760228 0.6395331 0.021749906 + 7400 100 1.2799658 1.2799658 0.64139084 0.020472922 + 7500 100 1.2846473 1.2846473 0.64343085 0.020610025 + 7600 100 1.2883965 1.2883965 0.64491873 0.02074884 + 7700 100 1.2926891 1.2926891 0.64684545 0.020599654 + 7800 100 1.3032201 1.3032201 0.65119455 0.02183405 + 7900 100 1.3025628 1.3025628 0.65068661 0.021248589 + 8000 100 1.3052302 1.3052302 0.65208602 0.021399549 + 8100 100 1.3069867 1.3069867 0.65304849 0.021254794 + 8200 100 1.3092024 1.3092024 0.6543837 0.021220909 + 8300 100 1.3101468 1.3101468 0.65519741 0.021328361 + 8400 100 1.3116005 1.3116005 0.65545253 0.021493555 + 8500 100 1.3153616 1.3153616 0.65731542 0.021433279 + 8600 100 1.3164556 1.3164556 0.65791227 0.021531213 + 8700 100 1.3187245 1.3187245 0.65915974 0.02170181 + 8800 100 1.3215981 1.3215981 0.66036644 0.022358849 + 8900 100 1.3206845 1.3206845 0.65984651 0.021901337 + 9000 100 1.3213046 1.3213046 0.66020378 0.021876353 + 9100 100 1.3225084 1.3225084 0.66088847 0.021811098 + 9200 100 1.3240309 1.3240309 0.66180646 0.021768929 + 9300 100 1.325458 1.325458 0.66280401 0.02165852 + 9400 100 1.3322968 1.3322968 0.66615126 0.022139018 + 9500 100 1.3416035 1.3416035 0.67030794 0.022243129 + 9600 100 1.3353326 1.3353326 0.66692811 0.022622122 + 9700 100 1.336265 1.336265 0.66727395 0.022171165 + 9800 100 1.3344531 1.3344531 0.66634538 0.022025131 + 9900 100 1.3337098 1.3337098 0.66601721 0.022111706 + 10000 100 1.3335539 1.3335539 0.66597627 0.022133817 +Loop time of 0.235008 on 1 procs for 5000 steps with 100 atoms + +Performance: 9191156.994 tau/day, 21275.826 timesteps/s, 2.128 Matom-step/s +94.1% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.029846 | 0.029846 | 0.029846 | 0.0 | 12.70 +Neigh | 0.030211 | 0.030211 | 0.030211 | 0.0 | 12.86 +Comm | 0.005731 | 0.005731 | 0.005731 | 0.0 | 2.44 +Output | 0.00051873 | 0.00051873 | 0.00051873 | 0.0 | 0.22 +Modify | 0.1583 | 0.1583 | 0.1583 | 0.0 | 67.36 +Other | | 0.01041 | | | 4.43 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 186 ave 186 max 186 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 186 +Ave neighs/atom = 1.86 +Neighbor list builds = 626 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 10000 100 1.3335539 1.3335539 0.66597627 0.022207076 + 10100 100 0.29976134 0.29976134 0.1752962 0.0091355801 + 10200 100 0.1548002 0.1548002 0.1005356 0.0062509071 + 10300 100 0.082468613 0.082468613 0.066729575 0.0017315098 + 10400 100 0.06731284 0.06731284 0.056685383 0.0011965765 + 10500 100 0.050167538 0.050167538 0.042388389 0.0010830279 + 10600 100 0.041091371 0.041091371 0.034743534 0.00092984522 + 10700 100 0.033199041 0.033199041 0.027954031 0.0018451338 + 10800 100 0.027880411 0.027880411 0.024437224 0.0013039536 + 10900 100 0.024634597 0.024634597 0.021815184 0.00030935286 + 11000 100 0.020741105 0.020741105 0.018754221 0.0006306901 + 11100 100 0.017210914 0.017210914 0.015842306 0.00075930229 + 11200 100 0.01254319 0.01254319 0.012145795 0.00047388541 + 11300 100 0.010032468 0.010032468 0.0095918697 0.0014677116 + 11400 100 0.0081538458 0.0081538458 0.0080985914 0.00032485316 + 11500 100 0.0072918155 0.0072918155 0.0070156789 0.00023642827 + 11600 100 0.0070136586 0.0070136586 0.0067263114 7.8490444e-05 + 11700 100 0.0061722946 0.0061722946 0.0058832419 0.00013450793 + 11800 100 0.0052444487 0.0052444487 0.0049294304 8.6973121e-05 + 11900 100 0.0048212279 0.0048212279 0.0045261412 0.00010458031 + 12000 100 0.0046782797 0.0046782797 0.0044011937 0.00018881094 + 12100 100 0.0042066617 0.0042066617 0.0040330976 0.00015507521 + 12200 100 0.0038529032 0.0038529032 0.003664712 1.1476621e-05 + 12300 100 0.0033203238 0.0033203238 0.0032404054 0.00027622191 + 12400 100 0.003113731 0.003113731 0.0030491123 3.8532421e-05 + 12500 100 0.0029925149 0.0029925149 0.0029415075 4.2673261e-05 + 12600 100 0.0028383323 0.0028383323 0.0027902992 9.328552e-05 + 12700 100 0.0026386104 0.0026386104 0.0026095714 7.7740986e-05 + 12800 100 0.0023509873 0.0023509873 0.0023518594 3.1944764e-05 + 12900 100 0.0022296104 0.0022296104 0.0022030693 4.5393502e-05 + 13000 100 0.0021991358 0.0021991358 0.0021560478 0.0001221212 + 13100 100 0.0021011001 0.0021011001 0.0020752855 2.4605107e-05 + 13200 100 0.002004495 0.002004495 0.0020040212 2.4805625e-05 + 13300 100 0.0018394135 0.0018394135 0.0018288384 6.2227066e-05 + 13400 100 0.0016314086 0.0016314086 0.0016058102 0.00010372886 + 13500 100 0.0015042857 0.0015042857 0.0014660263 0.00020805178 + 13600 100 0.0013584764 0.0013584764 0.0013177418 5.1603333e-05 + 13700 100 0.0012407449 0.0012407449 0.0011902637 8.87401e-05 + 13800 100 0.0011673364 0.0011673364 0.0011324247 2.3668551e-05 + 13900 100 0.0011429204 0.0011429204 0.0011072347 1.414364e-05 + 14000 100 0.001087543 0.001087543 0.0010616439 3.0874865e-05 + 14100 100 0.00098839393 0.00098839393 0.00096445684 6.5331515e-05 + 14200 100 0.00095139076 0.00095139076 0.00093658993 2.5649208e-05 + 14300 100 0.00089532494 0.00089532494 0.00082626435 2.6200482e-05 + 14400 100 0.00077973015 0.00077973015 0.00070733785 2.29298e-05 + 14500 100 0.00068559117 0.00068559117 0.00062297009 8.4841907e-06 + 14600 100 0.00059199698 0.00059199698 0.00052453148 1.2737231e-05 + 14700 100 0.00055052378 0.00055052378 0.00048459372 1.3028328e-05 + 14800 100 0.00049397913 0.00049397913 0.00044094284 6.1129918e-06 + 14900 100 0.00048082746 0.00048082746 0.00043128724 3.7301936e-06 + 15000 100 0.00046847825 0.00046847825 0.00041484245 5.7974184e-06 +Loop time of 0.0802044 on 1 procs for 5000 steps with 100 atoms + +Performance: 26931180.398 tau/day, 62340.695 timesteps/s, 6.234 Matom-step/s +82.1% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0080809 | 0.0080809 | 0.0080809 | 0.0 | 10.08 +Neigh | 0.0048815 | 0.0048815 | 0.0048815 | 0.0 | 6.09 +Comm | 0.0055605 | 0.0055605 | 0.0055605 | 0.0 | 6.93 +Output | 0.00050386 | 0.00050386 | 0.00050386 | 0.0 | 0.63 +Modify | 0.051104 | 0.051104 | 0.051104 | 0.0 | 63.72 +Other | | 0.01007 | | | 12.56 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 157 ave 157 max 157 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 157 +Ave neighs/atom = 1.57 +Neighbor list builds = 100 +Dangerous builds = 0 + +region container delete +variable theta equal (step-15000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 15000 100 0.00046847825 0.00046847825 0.00041484245 5.7974184e-06 + 15100 100 0.96677694 0.96677694 0.64420785 0.01431184 + 15200 100 1.0659255 1.0659255 0.69293741 0.013240486 + 15300 100 1.1647631 1.1647631 0.75191941 0.014622673 + 15400 100 1.3411593 1.3411593 0.85696383 0.02561549 + 15500 100 1.6033758 1.6033758 0.99094919 0.026221789 + 15600 100 1.7889645 1.7889645 1.075315 0.024116301 + 15700 100 1.8077023 1.8077023 1.0842652 0.031781756 + 15800 100 2.0252655 2.0252655 1.1517407 0.037201818 + 15900 100 2.1479427 2.1479427 1.2061238 0.027668435 + 16000 100 2.1788838 2.1788838 1.2205599 0.029114273 + 16100 100 2.3257431 2.3257431 1.2921157 0.035663063 + 16200 100 2.3885449 2.3885449 1.3282237 0.032255517 + 16300 100 2.3670966 2.3670966 1.3091694 0.029579008 + 16400 100 2.5097781 2.5097781 1.3712036 0.034579196 + 16500 100 2.6440883 2.6440883 1.4440043 0.03347813 + 16600 100 2.7230084 2.7230084 1.481565 0.036660339 + 16700 100 2.8246108 2.8246108 1.5298387 0.035623641 + 16800 100 3.0338694 3.0338694 1.6333504 0.038818594 + 16900 100 3.1219584 3.1219584 1.6790766 0.043444123 + 17000 100 3.4103817 3.4103817 1.8222668 0.044524654 + 17100 100 3.3869069 3.3869069 1.8170743 0.050670801 + 17200 100 3.4220314 3.4220314 1.8312364 0.045956123 + 17300 100 3.396894 3.396894 1.8158291 0.050420297 + 17400 100 3.4508224 3.4508224 1.8429996 0.049923733 + 17500 100 3.5039601 3.5039601 1.8822352 0.051047713 + 17600 100 3.3743905 3.3743905 1.8380347 0.047922214 + 17700 100 3.3729709 3.3729709 1.8224123 0.04758126 + 17800 100 3.3237798 3.3237798 1.7962316 0.045427975 + 17900 100 3.2441052 3.2441052 1.7782748 0.044651231 + 18000 100 3.1169205 3.1169205 1.704639 0.047440495 + 18100 100 3.1704608 3.1704608 1.7326375 0.045656546 + 18200 100 3.1113438 3.1113438 1.7002232 0.041619255 + 18300 100 3.2506111 3.2506111 1.7693075 0.048028527 + 18400 100 3.3840681 3.3840681 1.8370672 0.04443243 + 18500 100 3.4822823 3.4822823 1.9125273 0.043687118 + 18600 100 3.5214372 3.5214372 1.9364829 0.049798605 + 18700 100 3.5439229 3.5439229 1.9441301 0.046240266 + 18800 100 3.6046761 3.6046761 1.9791448 0.054369382 + 18900 100 3.8598403 3.8598403 2.0999449 0.049863074 + 19000 100 3.8606461 3.8606461 2.0885493 0.050269245 + 19100 100 4.076627 4.076627 2.2025766 0.058050893 + 19200 100 3.8280814 3.8280814 2.0749884 0.05730905 + 19300 100 3.8211633 3.8211633 2.0759453 0.05145071 + 19400 100 3.7726284 3.7726284 2.0466555 0.053566404 + 19500 100 3.7468403 3.7468403 2.03218 0.048422025 + 19600 100 3.6408955 3.6408955 1.9873843 0.046565134 + 19700 100 3.6454187 3.6454187 2.0042204 0.049299897 + 19800 100 3.5165071 3.5165071 1.937379 0.046319859 + 19900 100 3.4670702 3.4670702 1.9140316 0.045650114 + 20000 100 3.6114294 3.6114294 1.9798674 0.05431148 +Loop time of 0.203164 on 1 procs for 5000 steps with 100 atoms + +Performance: 10631806.993 tau/day, 24610.664 timesteps/s, 2.461 Matom-step/s +92.3% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.01242 | 0.01242 | 0.01242 | 0.0 | 6.11 +Neigh | 0.044478 | 0.044478 | 0.044478 | 0.0 | 21.89 +Comm | 0.0057766 | 0.0057766 | 0.0057766 | 0.0 | 2.84 +Output | 0.00051702 | 0.00051702 | 0.00051702 | 0.0 | 0.25 +Modify | 0.12923 | 0.12923 | 0.12923 | 0.0 | 63.61 +Other | | 0.01074 | | | 5.29 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 142 ave 142 max 142 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 142 +Ave neighs/atom = 1.42 +Neighbor list builds = 909 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 20000 100 3.6114294 3.6114294 1.9798674 0.053887263 + 20100 100 1.0907336 1.0907336 0.69799767 0.013925984 + 20200 100 0.92304387 0.92304387 0.59520318 0.012377709 + 20300 100 0.84004201 0.84004201 0.55081472 0.012108246 + 20400 100 0.89491209 0.89491209 0.56269969 0.01221427 + 20500 100 0.92011482 0.92011482 0.56971815 0.011353588 + 20600 100 0.95722998 0.95722998 0.58038747 0.01185569 + 20700 100 0.92635786 0.92635786 0.55373959 0.011953734 + 20800 100 0.93088162 0.93088162 0.55094813 0.012887472 + 20900 100 0.97288373 0.97288373 0.56309599 0.013731021 + 21000 100 0.63378762 0.63378762 0.3779177 0.010114787 + 21100 100 0.34618473 0.34618473 0.21652381 0.0070717708 + 21200 100 0.18660008 0.18660008 0.1302051 0.006504227 + 21300 100 0.13917709 0.13917709 0.09667499 0.0032593765 + 21400 100 0.11627047 0.11627047 0.080272858 0.0028891045 + 21500 100 0.086269781 0.086269781 0.064184981 0.0019374959 + 21600 100 0.08052393 0.08052393 0.059561101 0.001214522 + 21700 100 0.036026032 0.036026032 0.030243348 0.001199233 + 21800 100 0.02392645 0.02392645 0.022284244 0.00060060634 + 21900 100 0.016991266 0.016991266 0.017366625 0.00065672411 + 22000 100 0.016974877 0.016974877 0.016399245 0.0005903103 + 22100 100 0.015491818 0.015491818 0.014806105 0.00051181051 + 22200 100 0.011908698 0.011908698 0.011206673 0.00099478656 + 22300 100 0.010002714 0.010002714 0.0093749794 0.00028214624 + 22400 100 0.0081652616 0.0081652616 0.0079594664 0.00026841276 + 22500 100 0.0067602843 0.0067602843 0.0067498831 0.00019472612 + 22600 100 0.0061024058 0.0061024058 0.0062958451 0.00016615781 + 22700 100 0.005331422 0.005331422 0.0056152366 0.00021543475 + 22800 100 0.0040796708 0.0040796708 0.004140932 0.00024397062 + 22900 100 0.0042042089 0.0042042089 0.0040406804 0.00015880055 + 23000 100 0.0056083872 0.0056083872 0.0046056699 0.00029203396 + 23100 100 0.0035006398 0.0035006398 0.003343101 0.00010571574 + 23200 100 0.0032402473 0.0032402473 0.003122476 0.00012784403 + 23300 100 0.0030100724 0.0030100724 0.0029649423 8.5613724e-05 + 23400 100 0.002746305 0.002746305 0.0027519317 9.6521844e-05 + 23500 100 0.0028543876 0.0028543876 0.002842845 0.00012566665 + 23600 100 0.0036979234 0.0036979234 0.0032448309 8.6321879e-05 + 23700 100 0.0030503565 0.0030503565 0.0027392305 5.9716835e-05 + 23800 100 0.0021564041 0.0021564041 0.0022097768 0.00028317769 + 23900 100 0.0018905956 0.0018905956 0.0020002233 4.5205733e-05 + 24000 100 0.0015705513 0.0015705513 0.0017262538 0.00026550225 + 24100 100 0.0013341334 0.0013341334 0.0015663921 4.8307183e-05 + 24200 100 0.0012426828 0.0012426828 0.0014960127 5.5195907e-05 + 24300 100 0.0011933799 0.0011933799 0.0014508697 5.2781568e-05 + 24400 100 0.0010126015 0.0010126015 0.0012821281 0.00011096457 + 24500 100 0.00094102576 0.00094102576 0.0012265703 3.3454252e-05 + 24600 100 0.00092243997 0.00092243997 0.0011970533 3.7288789e-05 + 24700 100 0.00080565605 0.00080565605 0.0010864406 0.00015797228 + 24800 100 0.00075303124 0.00075303124 0.0010103671 5.4727635e-05 + 24900 100 0.00074808599 0.00074808599 0.0010053951 8.6607732e-05 + 25000 100 0.00071720457 0.00071720457 0.00096622937 0.00015861964 +Loop time of 0.0845534 on 1 procs for 5000 steps with 100 atoms + +Performance: 25545994.179 tau/day, 59134.246 timesteps/s, 5.913 Matom-step/s +90.2% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0091411 | 0.0091411 | 0.0091411 | 0.0 | 10.81 +Neigh | 0.013557 | 0.013557 | 0.013557 | 0.0 | 16.03 +Comm | 0.0056205 | 0.0056205 | 0.0056205 | 0.0 | 6.65 +Output | 0.0005087 | 0.0005087 | 0.0005087 | 0.0 | 0.60 +Modify | 0.045578 | 0.045578 | 0.045578 | 0.0 | 53.90 +Other | | 0.01015 | | | 12.00 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 151 ave 151 max 151 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 151 +Ave neighs/atom = 1.51 +Neighbor list builds = 286 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/granregion/log.15Sep22.granregion.box.g++.4 b/examples/granregion/log.15Sep22.granregion.box.g++.4 new file mode 100644 index 0000000000..3e83d3bb04 --- /dev/null +++ b/examples/granregion/log.15Sep22.granregion.box.g++.4 @@ -0,0 +1,493 @@ +LAMMPS (15 Sep 2022) +# pouring spheres into container box + +units lj +atom_style sphere +boundary f f f +dimension 3 +comm_modify vel yes + +region box block -10 10 -10 10 -10 10 units box +create_box 2 box +Created orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 2 by 2 MPI processor grid + +pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 +pair_coeff * * gran/hooke + +region container block -6 6 -6 6 -6 6 units box +fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 2 all nve/sphere +fix 3 all gravity 1.0 vector 0 0 -1 + +region slab block -2 2 -2 2 -2 2 units box +fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore +Particle insertion: 48 every 566 steps, 100 by step 1133 + +timestep 0.005 + +compute 1 all temp +compute_modify 1 dynamic/dof yes + +compute 2 all temp/sphere +compute_modify 2 dynamic/dof yes + +thermo 100 +thermo_style custom step atoms temp c_1 c_2 press +thermo_modify lost ignore +compute_modify thermo_temp dynamic/dof yes + +#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 +#dump_modify 2 pad 5 + +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 1.3 + binsize = 0.65, bins = 31 31 31 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke, perpetual + attributes: half, newton on, size + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.4843 | 0.4843 | 0.4843 Mbytes + Step Atoms Temp c_1 c_2 Press + 0 0 0 0 0 0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 100 30 0.803783 0.803783 0.39507978 0.0029137134 + 200 30 1.1967995 1.1967995 0.5882574 0.0043383984 + 300 30 1.2814686 1.2814686 0.62987441 0.0046453238 + 400 30 0.82331082 0.82331082 0.41173176 0.0029845017 + 500 30 0.7708462 0.7708462 0.38777784 0.0043831147 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 600 64 0.51564897 0.51564897 0.26631577 0.0040059368 + 700 64 0.57239348 0.57239348 0.29566901 0.0045075987 + 800 64 0.61837087 0.61837087 0.32195387 0.0048123564 + 900 64 0.53061888 0.53061888 0.28564763 0.0055906552 + 1000 64 0.496299 0.496299 0.26801572 0.0061169128 + 1100 64 0.46068308 0.46068308 0.24699057 0.0055717699 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 1200 99 0.39206225 0.39206225 0.21356546 0.0066294211 + 1300 99 0.38624966 0.38624966 0.21345854 0.0049051051 + 1400 99 0.35615284 0.35615284 0.19785725 0.0046170774 + 1500 99 0.31486691 0.31486691 0.17429054 0.0064903404 + 1600 99 0.26369 0.26369 0.15095263 0.0045226821 + 1700 100 0.19259352 0.19259352 0.11308184 0.0073603886 + 1800 100 0.1372448 0.1372448 0.083273652 0.0058163062 + 1900 100 0.077253038 0.077253038 0.053166156 0.0017440856 + 2000 100 0.065472093 0.065472093 0.04375349 0.0018416047 + 2100 100 0.057213469 0.057213469 0.037773954 0.001226231 + 2200 100 0.058857437 0.058857437 0.0372655 0.00090812381 + 2300 100 0.035066108 0.035066108 0.025934054 0.00072114554 + 2400 100 0.021272125 0.021272125 0.016635107 0.0018506654 + 2500 100 0.015530432 0.015530432 0.012533546 0.0013883971 + 2600 100 0.012603946 0.012603946 0.0096981459 0.00038648118 + 2700 100 0.0097347475 0.0097347475 0.0076016624 0.00057313888 + 2800 100 0.0067081771 0.0067081771 0.0056944431 0.00085080075 + 2900 100 0.0089177981 0.0089177981 0.0065036822 0.00028986539 + 3000 100 0.0057840287 0.0057840287 0.0044989265 0.00016111737 + 3100 100 0.0038909621 0.0038909621 0.0031511938 0.0001708892 + 3200 100 0.0029043214 0.0029043214 0.0025807767 9.2473673e-05 + 3300 100 0.0022769336 0.0022769336 0.0021487157 0.00022312666 + 3400 100 0.0015571397 0.0015571397 0.0016669068 0.0003381372 + 3500 100 0.0015978184 0.0015978184 0.001707772 4.9930818e-05 + 3600 100 0.0023358916 0.0023358916 0.0020709426 9.7687609e-05 + 3700 100 0.0011186736 0.0011186736 0.0012146914 9.3338234e-05 + 3800 100 0.0011657036 0.0011657036 0.0012313764 3.1931251e-05 + 3900 100 0.0014998387 0.0014998387 0.0014015491 2.4226798e-05 + 4000 100 0.0010858335 0.0010858335 0.0010623286 1.6359241e-05 + 4100 100 0.0010464314 0.0010464314 0.0010123557 1.2949588e-05 + 4200 100 0.0010022428 0.0010022428 0.00097338971 1.2402332e-05 + 4300 100 0.00080622372 0.00080622372 0.00084329652 0.00033857037 + 4400 100 0.00073613921 0.00073613921 0.00078373608 1.0103949e-05 + 4500 100 0.00071402196 0.00071402196 0.00076658004 8.8360218e-06 + 4600 100 0.00064851765 0.00064851765 0.00071533461 1.0736438e-05 + 4700 100 0.00061146699 0.00061146699 0.00068274687 4.1341755e-06 + 4800 100 0.00059511472 0.00059511472 0.0006625527 7.3645447e-06 + 4900 100 0.00057700347 0.00057700347 0.0006468562 1.5411897e-05 + 5000 100 0.00056205001 0.00056205001 0.00063592505 7.8813845e-06 +Loop time of 0.0856033 on 4 procs for 5000 steps with 100 atoms + +Performance: 25232672.400 tau/day, 58408.964 timesteps/s, 5.841 Matom-step/s +88.4% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0034695 | 0.0050634 | 0.0068805 | 2.2 | 5.91 +Neigh | 0.0016916 | 0.0024175 | 0.0032212 | 1.5 | 2.82 +Comm | 0.020003 | 0.026482 | 0.033796 | 3.5 | 30.94 +Output | 0.0010864 | 0.001327 | 0.0014374 | 0.4 | 1.55 +Modify | 0.0067352 | 0.015857 | 0.025751 | 7.2 | 18.52 +Other | | 0.03446 | | | 40.25 + +Nlocal: 25 ave 53 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Nghost: 4 ave 8 max 0 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 40.5 ave 92 max 0 min +Histogram: 2 0 0 0 0 0 0 1 0 1 + +Total # of neighbors = 162 +Ave neighs/atom = 1.62 +Neighbor list builds = 288 +Dangerous builds = 0 + +region container delete +variable theta equal (step-5000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 1.3 + binsize = 0.65, bins = 31 31 31 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke, perpetual + attributes: half, newton on, size + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.734 Mbytes + Step Atoms Temp c_1 c_2 Press + 5000 100 0.00056205001 0.00056205001 0.00063592505 7.871665e-06 + 5100 100 0.59585977 0.59585977 0.32464933 0.0141718 + 5200 100 0.67306764 0.67306764 0.35872096 0.013373672 + 5300 100 0.76065187 0.76065187 0.39925025 0.011460301 + 5400 100 0.87984446 0.87984446 0.45261417 0.013937042 + 5500 100 0.95548319 0.95548319 0.48706892 0.013601658 + 5600 100 0.9993278 0.9993278 0.50830306 0.015663766 + 5700 100 1.0449415 1.0449415 0.52967249 0.016797841 + 5800 100 1.0767598 1.0767598 0.54508699 0.016128855 + 5900 100 1.118688 1.118688 0.56530849 0.016830117 + 6000 100 1.1535698 1.1535698 0.58290663 0.01715335 + 6100 100 1.1753828 1.1753828 0.59419088 0.019273207 + 6200 100 1.1994171 1.1994171 0.60433264 0.018391566 + 6300 100 1.2244707 1.2244707 0.61626199 0.018842556 + 6400 100 1.2507994 1.2507994 0.62829386 0.019538413 + 6500 100 1.2684644 1.2684644 0.63747702 0.020794729 + 6600 100 1.2704726 1.2704726 0.63929889 0.020253985 + 6700 100 1.2737302 1.2737302 0.63970688 0.020858602 + 6800 100 1.287922 1.287922 0.64460894 0.021589773 + 6900 100 1.3028782 1.3028782 0.65197802 0.02135295 + 7000 100 1.306633 1.306633 0.65371741 0.021291182 + 7100 100 1.3161393 1.3161393 0.65785404 0.022554896 + 7200 100 1.3228158 1.3228158 0.6609031 0.021811977 + 7300 100 1.3245632 1.3245632 0.66161966 0.02206776 + 7400 100 1.3266822 1.3266822 0.662738 0.022070761 + 7500 100 1.3265138 1.3265138 0.6624472 0.021944768 + 7600 100 1.3286802 1.3286802 0.66338775 0.0219393 + 7700 100 1.332829 1.332829 0.66547051 0.022142398 + 7800 100 1.3323535 1.3323535 0.66534513 0.022787777 + 7900 100 1.3372424 1.3372424 0.66777556 0.02192759 + 8000 100 1.3396201 1.3396201 0.66910123 0.022439596 + 8100 100 1.3422271 1.3422271 0.67060566 0.023784952 + 8200 100 1.3468062 1.3468062 0.6728991 0.02243345 + 8300 100 1.3439408 1.3439408 0.6717529 0.022312339 + 8400 100 1.3484134 1.3484134 0.67346027 0.022770922 + 8500 100 1.3490032 1.3490032 0.67378177 0.022427863 + 8600 100 1.349789 1.349789 0.67398897 0.022494049 + 8700 100 1.3513512 1.3513512 0.67475613 0.022413559 + 8800 100 1.3535168 1.3535168 0.67589784 0.022356566 + 8900 100 1.3505765 1.3505765 0.67442168 0.022240615 + 9000 100 1.3499918 1.3499918 0.67419831 0.02226049 + 9100 100 1.3518103 1.3518103 0.67489482 0.022399038 + 9200 100 1.3526275 1.3526275 0.67529852 0.022395079 + 9300 100 1.353741 1.353741 0.67585205 0.022471008 + 9400 100 1.3538758 1.3538758 0.67589523 0.022461734 + 9500 100 1.3537199 1.3537199 0.67586527 0.022370169 + 9600 100 1.3539788 1.3539788 0.67602899 0.022400771 + 9700 100 1.3544874 1.3544874 0.67619552 0.022648464 + 9800 100 1.3555422 1.3555422 0.67666186 0.022367319 + 9900 100 1.3560106 1.3560106 0.6768751 0.02236585 + 10000 100 1.3563578 1.3563578 0.6770434 0.022359307 +Loop time of 0.139615 on 4 procs for 5000 steps with 100 atoms + +Performance: 15471121.710 tau/day, 35812.782 timesteps/s, 3.581 Matom-step/s +89.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0034672 | 0.011349 | 0.019511 | 7.2 | 8.13 +Neigh | 0.0032972 | 0.0053674 | 0.0074946 | 2.8 | 3.84 +Comm | 0.011049 | 0.018572 | 0.027876 | 5.6 | 13.30 +Output | 0.0010807 | 0.0015593 | 0.0018738 | 0.8 | 1.12 +Modify | 0.013556 | 0.040435 | 0.066715 | 13.0 | 28.96 +Other | | 0.06233 | | | 44.65 + +Nlocal: 25 ave 52 max 0 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 3 ave 6 max 0 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 48.25 ave 109 max 0 min +Histogram: 2 0 0 0 0 0 0 1 0 1 + +Total # of neighbors = 193 +Ave neighs/atom = 1.93 +Neighbor list builds = 626 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.735 Mbytes + Step Atoms Temp c_1 c_2 Press + 10000 100 1.3563578 1.3563578 0.6770434 0.022433108 + 10100 100 0.32881547 0.32881547 0.18968913 0.0063460187 + 10200 100 0.19880113 0.19880113 0.12812646 0.0074601538 + 10300 100 0.12614062 0.12614062 0.090121373 0.0028337336 + 10400 100 0.088358363 0.088358363 0.067236815 0.0020269846 + 10500 100 0.071199344 0.071199344 0.055567135 0.0016191769 + 10600 100 0.053909616 0.053909616 0.042301996 0.00098643468 + 10700 100 0.039560745 0.039560745 0.032482256 0.00089240864 + 10800 100 0.032130432 0.032130432 0.02705329 0.00058669881 + 10900 100 0.02462494 0.02462494 0.021121496 0.0017376127 + 11000 100 0.020941068 0.020941068 0.017866781 0.00031112553 + 11100 100 0.016775675 0.016775675 0.014620214 0.00026856842 + 11200 100 0.015005732 0.015005732 0.012803923 0.00067036626 + 11300 100 0.012099209 0.012099209 0.010308221 0.00032666902 + 11400 100 0.010559421 0.010559421 0.0090243729 0.00013645685 + 11500 100 0.0093738615 0.0093738615 0.0080176514 0.00098541099 + 11600 100 0.0081900702 0.0081900702 0.0070256953 0.00025935992 + 11700 100 0.0068100165 0.0068100165 0.0058703223 0.00014866816 + 11800 100 0.0060475708 0.0060475708 0.0052518105 0.00017895168 + 11900 100 0.0055607485 0.0055607485 0.0047184164 0.00011358846 + 12000 100 0.0053149064 0.0053149064 0.0045168418 0.00015222428 + 12100 100 0.0050909525 0.0050909525 0.0043196952 6.3000537e-05 + 12200 100 0.0041810842 0.0041810842 0.0036835522 4.6423956e-05 + 12300 100 0.0034305227 0.0034305227 0.0031222649 0.00020251115 + 12400 100 0.0031763077 0.0031763077 0.0028956456 0.00030307787 + 12500 100 0.0027440829 0.0027440829 0.0025087304 0.00010418607 + 12600 100 0.0024581964 0.0024581964 0.0022200229 3.042018e-05 + 12700 100 0.002259527 0.002259527 0.0020708869 4.192368e-05 + 12800 100 0.0019143448 0.0019143448 0.0018088032 4.6200439e-05 + 12900 100 0.0017935964 0.0017935964 0.0017028317 2.2195756e-05 + 13000 100 0.0017286429 0.0017286429 0.0016396753 2.3108871e-05 + 13100 100 0.0017055291 0.0017055291 0.0016122058 2.2444611e-05 + 13200 100 0.0016539275 0.0016539275 0.0015570166 2.0467353e-05 + 13300 100 0.0015777788 0.0015777788 0.0014852505 1.9525012e-05 + 13400 100 0.0015372199 0.0015372199 0.0014497102 2.3203566e-05 + 13500 100 0.0015066638 0.0015066638 0.0014097203 1.8644964e-05 + 13600 100 0.0012290618 0.0012290618 0.0012056216 1.3235643e-05 + 13700 100 0.0011781948 0.0011781948 0.0011685226 3.4312262e-05 + 13800 100 0.0011530136 0.0011530136 0.0011433171 2.8832126e-05 + 13900 100 0.0011085224 0.0011085224 0.0011052764 1.444139e-05 + 14000 100 0.0010656788 0.0010656788 0.0010702461 1.3187775e-05 + 14100 100 0.001029277 0.001029277 0.0010469537 1.2837267e-05 + 14200 100 0.0009750904 0.0009750904 0.0009915384 1.209089e-05 + 14300 100 0.00094893337 0.00094893337 0.00096909301 1.1743051e-05 + 14400 100 0.00087708427 0.00087708427 0.00087575318 1.9027338e-05 + 14500 100 0.00086229913 0.00086229913 0.0008643568 1.0670952e-05 + 14600 100 0.00084206808 0.00084206808 0.0008268172 3.2391722e-05 + 14700 100 0.00077682873 0.00077682873 0.00077186085 9.6132555e-06 + 14800 100 0.00074736908 0.00074736908 0.00074958372 9.2486924e-06 + 14900 100 0.00074456847 0.00074456847 0.00074779946 9.2140349e-06 + 15000 100 0.00073830282 0.00073830282 0.0007426924 9.1364974e-06 +Loop time of 0.0808149 on 4 procs for 5000 steps with 100 atoms + +Performance: 26727738.394 tau/day, 61869.765 timesteps/s, 6.187 Matom-step/s +86.6% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0034354 | 0.0050332 | 0.0069329 | 2.2 | 6.23 +Neigh | 0.00051999 | 0.00084906 | 0.0012075 | 0.0 | 1.05 +Comm | 0.0063631 | 0.014527 | 0.023754 | 6.8 | 17.98 +Output | 0.0010373 | 0.001342 | 0.001464 | 0.5 | 1.66 +Modify | 0.0051837 | 0.017338 | 0.031605 | 9.3 | 21.45 +Other | | 0.04173 | | | 51.63 + +Nlocal: 25 ave 53 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Nghost: 3.75 ave 8 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Neighs: 39.25 ave 82 max 0 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 157 +Ave neighs/atom = 1.57 +Neighbor list builds = 100 +Dangerous builds = 0 + +region container delete +variable theta equal (step-15000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.735 Mbytes + Step Atoms Temp c_1 c_2 Press + 15000 100 0.00073830282 0.00073830282 0.0007426924 9.1364974e-06 + 15100 100 1.1048281 1.1048281 0.7023727 0.018379275 + 15200 100 1.2022249 1.2022249 0.77748962 0.015662439 + 15300 100 1.2561351 1.2561351 0.82563065 0.01835048 + 15400 100 1.4372446 1.4372446 0.92907923 0.02087065 + 15500 100 1.6414713 1.6414713 1.0284489 0.025654324 + 15600 100 1.7844655 1.7844655 1.0861866 0.025170346 + 15700 100 2.034248 2.034248 1.2017171 0.040341642 + 15800 100 2.1253699 2.1253699 1.2228657 0.029297194 + 15900 100 2.1940232 2.1940232 1.2470589 0.033866758 + 16000 100 2.2624419 2.2624419 1.2828225 0.030063645 + 16100 100 2.3208536 2.3208536 1.3118956 0.0323489 + 16200 100 2.3564971 2.3564971 1.3261173 0.032882494 + 16300 100 2.3956066 2.3956066 1.3260307 0.03292972 + 16400 100 2.5025831 2.5025831 1.3817693 0.031132988 + 16500 100 2.5947914 2.5947914 1.4152657 0.036126782 + 16600 100 2.7688769 2.7688769 1.4975686 0.037497127 + 16700 100 2.812503 2.812503 1.5216659 0.039316167 + 16800 100 2.8977424 2.8977424 1.5599254 0.039996029 + 16900 100 3.045802 3.045802 1.6332888 0.041406156 + 17000 100 3.2195366 3.2195366 1.7247171 0.040023634 + 17100 100 3.2597294 3.2597294 1.7527958 0.04828292 + 17200 100 3.293587 3.293587 1.7693254 0.044001441 + 17300 100 3.1861836 3.1861836 1.7142076 0.049158822 + 17400 100 3.4593561 3.4593561 1.8426619 0.053469673 + 17500 100 3.3813767 3.3813767 1.8079958 0.058776299 + 17600 100 3.5834203 3.5834203 1.9094759 0.053256842 + 17700 100 3.2243306 3.2243306 1.7425111 0.064354789 + 17800 100 3.358228 3.358228 1.8202932 0.046798524 + 17900 100 3.2257908 3.2257908 1.7678964 0.043655204 + 18000 100 3.237732 3.237732 1.7598181 0.050850672 + 18100 100 3.2042441 3.2042441 1.751979 0.045582006 + 18200 100 3.1562775 3.1562775 1.7336068 0.042210739 + 18300 100 3.2630507 3.2630507 1.7925333 0.046412778 + 18400 100 3.4150588 3.4150588 1.8668408 0.044386435 + 18500 100 3.4913198 3.4913198 1.9125495 0.043329829 + 18600 100 3.5290036 3.5290036 1.9184098 0.048302721 + 18700 100 3.4852698 3.4852698 1.8865833 0.059566124 + 18800 100 3.7157551 3.7157551 2.0082235 0.051356305 + 18900 100 3.9504619 3.9504619 2.1377018 0.051553987 + 19000 100 3.9711274 3.9711274 2.1549121 0.051555312 + 19100 100 3.90954 3.90954 2.1135174 0.0548311 + 19200 100 4.0672819 4.0672819 2.1837089 0.064431553 + 19300 100 3.998355 3.998355 2.1572884 0.056830399 + 19400 100 3.9172127 3.9172127 2.1130164 0.051264041 + 19500 100 3.9120291 3.9120291 2.1088399 0.052545115 + 19600 100 3.8613614 3.8613614 2.0752883 0.055466569 + 19700 100 3.8428824 3.8428824 2.0787804 0.05129261 + 19800 100 3.5686751 3.5686751 1.9356553 0.059177256 + 19900 100 3.5573788 3.5573788 1.9430183 0.054618794 + 20000 100 3.5453022 3.5453022 1.9413343 0.047640543 +Loop time of 0.13841 on 4 procs for 5000 steps with 100 atoms + +Performance: 15605800.739 tau/day, 36124.539 timesteps/s, 3.612 Matom-step/s +89.0% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0047469 | 0.0062771 | 0.0080644 | 1.5 | 4.54 +Neigh | 0.0062517 | 0.0079248 | 0.0094271 | 1.3 | 5.73 +Comm | 0.047109 | 0.048595 | 0.050543 | 0.6 | 35.11 +Output | 0.0011807 | 0.0013428 | 0.0015517 | 0.4 | 0.97 +Modify | 0.022766 | 0.033256 | 0.039993 | 3.5 | 24.03 +Other | | 0.04101 | | | 29.63 + +Nlocal: 25 ave 36 max 13 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Nghost: 5 ave 9 max 2 min +Histogram: 1 0 1 0 1 0 0 0 0 1 +Neighs: 37.5 ave 53 max 15 min +Histogram: 1 0 0 0 0 1 0 1 0 1 + +Total # of neighbors = 150 +Ave neighs/atom = 1.5 +Neighbor list builds = 913 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.734 | 5.735 | 5.735 Mbytes + Step Atoms Temp c_1 c_2 Press + 20000 100 3.5453022 3.5453022 1.9413343 0.047178052 + 20100 100 1.0878587 1.0878587 0.68666704 0.016139979 + 20200 100 1.0230655 1.0230655 0.63593494 0.014642345 + 20300 100 0.94958824 0.94958824 0.59306601 0.011745659 + 20400 100 0.93038108 0.93038108 0.57232527 0.01154829 + 20500 100 0.92183816 0.92183816 0.55466942 0.01212559 + 20600 100 1.0175846 1.0175846 0.59940035 0.013815361 + 20700 100 1.0564615 1.0564615 0.60726745 0.013073711 + 20800 100 0.99967869 0.99967869 0.57665019 0.012450813 + 20900 100 0.97051084 0.97051084 0.5574217 0.015686955 + 21000 100 0.639185 0.639185 0.37441942 0.017594616 + 21100 100 0.24979014 0.24979014 0.17121567 0.0084027295 + 21200 100 0.15147941 0.15147941 0.11124349 0.0030435746 + 21300 100 0.13117502 0.13117502 0.091432638 0.0029110318 + 21400 100 0.11158272 0.11158272 0.076264692 0.0021951204 + 21500 100 0.056660993 0.056660993 0.043503807 0.0010993096 + 21600 100 0.028640836 0.028640836 0.026000267 0.0010440792 + 21700 100 0.025816483 0.025816483 0.021922896 0.00081674646 + 21800 100 0.023929555 0.023929555 0.019936972 0.0010383614 + 21900 100 0.022271339 0.022271339 0.017947505 0.0014630387 + 22000 100 0.019277834 0.019277834 0.015483116 0.00058751407 + 22100 100 0.019997809 0.019997809 0.015919504 0.00064176101 + 22200 100 0.015870543 0.015870543 0.01244838 0.0004205505 + 22300 100 0.011797587 0.011797587 0.0096491363 0.00034907063 + 22400 100 0.010745212 0.010745212 0.008874218 0.00035427537 + 22500 100 0.0082372399 0.0082372399 0.0071217811 0.00028179943 + 22600 100 0.007942576 0.007942576 0.0067248822 0.001507115 + 22700 100 0.0061733667 0.0061733667 0.0053092324 0.00056018554 + 22800 100 0.0058287651 0.0058287651 0.004972189 0.00023807695 + 22900 100 0.0051352339 0.0051352339 0.004324157 0.00020849263 + 23000 100 0.0040107769 0.0040107769 0.0035769703 0.00022626101 + 23100 100 0.0040288854 0.0040288854 0.0034355474 0.00019107621 + 23200 100 0.003277858 0.003277858 0.0030013165 0.00016119888 + 23300 100 0.0033633749 0.0033633749 0.0030188927 0.00014459404 + 23400 100 0.003468042 0.003468042 0.0030079205 0.00013778427 + 23500 100 0.0027616702 0.0027616702 0.0024994596 0.00011834915 + 23600 100 0.0022531303 0.0022531303 0.0021182802 0.0002279623 + 23700 100 0.002067768 0.002067768 0.0019631752 0.00014341503 + 23800 100 0.0020069255 0.0020069255 0.0019209587 0.00010673435 + 23900 100 0.0019630617 0.0019630617 0.0018748221 0.00011856923 + 24000 100 0.0018800646 0.0018800646 0.0018190347 0.00010707562 + 24100 100 0.0018028137 0.0018028137 0.0017067233 0.00010884117 + 24200 100 0.0017278932 0.0017278932 0.0016251004 0.00013664683 + 24300 100 0.0016373288 0.0016373288 0.0015529481 0.00010025414 + 24400 100 0.0019876848 0.0019876848 0.0016912033 0.00011235942 + 24500 100 0.0013677345 0.0013677345 0.0012839488 7.8669645e-05 + 24600 100 0.0012852614 0.0012852614 0.0012065052 0.00010172361 + 24700 100 0.0011145002 0.0011145002 0.0010748344 7.5021689e-05 + 24800 100 0.0012860792 0.0012860792 0.0011429675 5.7939624e-05 + 24900 100 0.00097198499 0.00097198499 0.00096175911 5.443837e-05 + 25000 100 0.00096224466 0.00096224466 0.00095159089 5.4245409e-05 +Loop time of 0.0846408 on 4 procs for 5000 steps with 100 atoms + +Performance: 25519602.289 tau/day, 59073.153 timesteps/s, 5.907 Matom-step/s +82.3% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0035473 | 0.0055294 | 0.0082454 | 2.7 | 6.53 +Neigh | 0.0016391 | 0.0022521 | 0.0028115 | 1.1 | 2.66 +Comm | 0.014697 | 0.021565 | 0.029045 | 4.1 | 25.48 +Output | 0.0010785 | 0.00132 | 0.0014171 | 0.4 | 1.56 +Modify | 0.0059648 | 0.01618 | 0.027615 | 7.9 | 19.12 +Other | | 0.03779 | | | 44.65 + +Nlocal: 25 ave 56 max 0 min +Histogram: 2 0 0 0 0 0 0 1 0 1 +Nghost: 5.5 ave 12 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Neighs: 40 ave 101 max 0 min +Histogram: 2 0 0 0 0 1 0 0 0 1 + +Total # of neighbors = 160 +Ave neighs/atom = 1.6 +Neighbor list builds = 275 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/granregion/log.15Sep22.granregion.funnel.g++.1 b/examples/granregion/log.15Sep22.granregion.funnel.g++.1 new file mode 100644 index 0000000000..fc60ca4928 --- /dev/null +++ b/examples/granregion/log.15Sep22.granregion.funnel.g++.1 @@ -0,0 +1,633 @@ +LAMMPS (15 Sep 2022) +# pour particles into cone-shaped funnel, settle them, let them run out bottom + +variable name string funnel_pour + +thermo_modify flush yes +units si +variable PI equal 3.141592653589 +variable seed equal 14314 + +############################################### +# Geometry-related parameters +############################################### + +variable xlo equal 10 +variable xhi equal 40 +variable ylo equal 10 +variable yhi equal 40 +variable zlo equal -20 +variable zhi equal 50 + +variable xc equal 25 +variable yc equal 25 + +variable zconehi equal 50 +variable zconelo equal 10 +variable zcyllo equal 0 +variable radconelo equal 2 +variable radconehi equal 20 + +################################################ +# Particle sizes +################################################ + +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable skin equal ${rhi} +variable skin equal 0.5 + +############################################### +# Granular contact parameters +############################################### + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable density equal 1.0 +variable EYoung equal 10^5 +variable Poisson equal 2.0/7.0 +variable GShear equal ${EYoung}/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+0.285714285714286)) + +variable gravity equal 1.0 + +variable reff equal 0.5*(${rhi}+${rlo}) +variable reff equal 0.5*(0.5+${rlo}) +variable reff equal 0.5*(0.5+0.25) +variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 +variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 +variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 + +## Typical way to set kn, kt, etc.: +variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) +variable kt equal 4.0*${GShear}/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) + +variable a equal (-2.0*log(${coeffRes})/${PI})^2 +variable a equal (-2.0*log(0.1)/${PI})^2 +variable a equal (-2.0*log(0.1)/3.141592653589)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 903.503751814138*0.5 + +variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) + +variable dt equal ${tcol}*0.05 +variable dt equal 0.00210943016014969*0.05 +timestep ${dt} +timestep 0.000105471508007485 + +############################################### +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton off +atom_style sphere + +boundary p p f + +region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 40 ${zlo} ${zhi} +region boxreg block 10 40 10 40 -20 ${zhi} +region boxreg block 10 40 10 40 -20 50 +create_box 1 boxreg +Created orthogonal box = (10 10 -20) to (40 40 50) + 1 by 1 by 1 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.5 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 30, bins = 1 1 3 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/multi/newtoff + stencil: full/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +# insertion region for fix/pour + +region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box +region insreg cylinder z 25 ${yc} 10 30 50 side in units box +region insreg cylinder z 25 25 10 30 50 side in units box + +# define cone and cylinder regions - see lammps doc on region command +# note new open options + +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 2 + +region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open +region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 + +region hopreg union 2 conereg cylreg + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + + +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 3000 every 59965 steps, 2000 by step 1 + +#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke +WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) +thermo_modify flush yes lost warn + +# Initial run to fill up the cone + +run 20000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 6.648 | 6.648 | 6.648 Mbytes + Step CPU Atoms KinEng + 0 0 0 -0 + 1000 0.39961733 2000 -0 + 2000 0.61811961 2000 -0 + 3000 0.83512725 2000 -0 + 4000 1.0492881 2000 -0 + 5000 1.2650657 2000 -0 + 6000 1.479921 2000 -0 + 7000 1.6970993 2000 -0 + 8000 1.9107924 2000 -0 + 9000 2.1251713 2000 -0 + 10000 2.3403682 2000 -0 + 11000 2.549912 2000 -0 + 12000 2.7584788 2000 -0 + 13000 2.9712482 2000 -0 + 14000 3.1877015 2000 -0 + 15000 3.4017175 2000 -0 + 16000 3.6127477 2000 -0 + 17000 3.8250134 2000 -0 + 18000 4.0320643 2000 -0 + 19000 4.2371057 2000 -0 + 20000 4.4450882 2000 -0 +Loop time of 4.44512 on 1 procs for 20000 steps with 2000 atoms + +98.7% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.40438 | 0.40438 | 0.40438 | 0.0 | 9.10 +Neigh | 0.078634 | 0.078634 | 0.078634 | 0.0 | 1.77 +Comm | 0.01999 | 0.01999 | 0.01999 | 0.0 | 0.45 +Output | 0.00069031 | 0.00069031 | 0.00069031 | 0.0 | 0.02 +Modify | 3.795 | 3.795 | 3.795 | 0.0 | 85.38 +Other | | 0.1464 | | | 3.29 + +Nlocal: 2000 ave 2000 max 2000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1607 ave 1607 max 1607 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1607 +Ave neighs/atom = 0.8035 +Neighbor list builds = 71 +Dangerous builds = 0 +unfix ins +run 150000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.69 | 12.69 | 12.69 Mbytes + Step CPU Atoms KinEng + 20000 0 2000 6652.2957 + 21000 0.2135317 2000 6807.2201 + 22000 0.4235523 2000 6973.9359 + 23000 0.63502794 2000 7142.3648 + 24000 0.84593615 2000 7276.9717 + 25000 1.0580291 2000 7369.4191 + 26000 1.2719892 2000 7497.6526 + 27000 1.4843056 2000 7638.946 + 28000 1.9685336 2000 7780.0339 + 29000 2.1850097 2000 7881.8177 + 30000 2.4033006 2000 7967.2641 + 31000 2.6219694 2000 7994.9273 + 32000 2.8455468 2000 7937.0671 + 33000 3.0720066 2000 7774.0508 + 34000 3.3070513 2000 7591.1491 + 35000 3.5468777 2000 7357.5176 + 36000 3.7908265 2000 7147.2024 + 37000 4.0388657 2000 6979.1604 + 38000 4.2873223 2000 6813.2152 + 39000 4.5424244 2000 6660.2701 + 40000 4.8055367 2000 6502.8957 + 41000 5.0754561 2000 6324.3951 + 42000 5.3564118 2000 6132.7516 + 43000 5.6357256 2000 5913.1841 + 44000 5.9130645 2000 5732.2095 + 45000 6.1943539 2000 5508.8322 + 46000 6.4862302 2000 5306.8932 + 47000 6.7796417 2000 5152.0521 + 48000 7.0750069 2000 5028.2274 + 49000 7.3705252 2000 4896.102 + 50000 7.6693894 2000 4723.5189 + 51000 7.9685182 2000 4583.7526 + 52000 8.2774033 2000 4447.0187 + 53000 8.591482 2000 4303.2307 + 54000 8.9156439 2000 4168.5251 + 55000 9.2437364 2000 4036.9704 + 56000 9.5745684 2000 3901.1183 + 57000 9.9173689 2000 3716.7071 + 58000 10.270229 2000 3473.5422 + 59000 10.629101 2000 3245.1223 + 60000 10.989479 2000 3039.7845 + 61000 11.349843 2000 2780.0187 + 62000 11.716916 2000 2577.3345 + 63000 12.093666 2000 2346.2488 + 64000 12.474788 2000 2116.7298 + 65000 12.861438 2000 1903.7828 + 66000 13.25464 2000 1631.1676 + 67000 13.658382 2000 1431.0198 + 68000 14.067584 2000 1212.875 + 69000 14.480877 2000 995.45046 + 70000 14.894765 2000 811.54766 + 71000 15.309158 2000 624.08622 + 72000 15.732937 2000 471.00862 + 73000 16.158388 2000 358.33486 + 74000 16.583847 2000 284.39416 + 75000 17.008335 2000 234.26671 + 76000 17.429582 2000 185.61836 + 77000 17.852799 2000 152.95918 + 78000 18.276783 2000 122.49023 + 79000 18.697016 2000 102.29396 + 80000 19.12318 2000 86.284684 + 81000 19.54992 2000 73.984781 + 82000 19.986149 2000 63.042918 + 83000 20.430305 2000 53.338428 + 84000 20.876061 2000 45.89585 + 85000 21.32714 2000 40.412826 + 86000 21.781352 2000 34.183381 + 87000 22.238656 2000 29.671524 + 88000 22.698093 2000 26.90414 + 89000 23.160614 2000 24.362631 + 90000 23.630639 2000 21.887341 + 91000 24.095463 2000 19.985662 + 92000 24.570659 2000 18.728162 + 93000 25.047431 2000 16.99941 + 94000 25.549041 2000 15.71941 + 95000 26.03281 2000 14.744057 + 96000 26.513659 2000 14.214918 + 97000 26.998918 2000 13.450182 + 98000 27.486584 2000 12.79222 + 99000 27.986785 2000 12.10595 + 100000 28.48799 2000 11.281863 + 101000 28.986622 2000 10.025419 + 102000 29.491312 2000 9.9574468 + 103000 29.999421 2000 9.4078117 + 104000 30.507211 2000 8.9079161 + 105000 31.016484 2000 8.6269302 + 106000 31.527511 2000 8.5512649 + 107000 32.042612 2000 8.4703948 + 108000 32.555041 2000 8.2747542 + 109000 33.07064 2000 8.2895118 + 110000 33.593773 2000 8.1785613 + 111000 34.107129 2000 7.8443234 + 112000 34.619185 2000 7.7436124 + 113000 35.13418 2000 7.8118604 + 114000 35.653352 2000 7.3806177 + 115000 36.179577 2000 7.0857235 + 116000 36.69882 2000 7.1346752 + 117000 37.224612 2000 7.0653751 + 118000 37.756738 2000 6.6314104 + 119000 38.283151 2000 6.2169614 + 120000 38.808288 2000 5.8988829 + 121000 39.334913 2000 5.4197277 + 122000 39.862081 2000 4.6381303 + 123000 40.390252 2000 4.4949206 + 124000 40.920744 2000 4.4261118 + 125000 41.4469 2000 4.4223703 + 126000 41.977937 2000 4.4858898 + 127000 42.51483 2000 4.3312536 + 128000 43.046324 2000 3.7124973 + 129000 43.573687 2000 3.5467396 + 130000 44.103102 2000 3.5104139 + 131000 44.629869 2000 3.5725612 + 132000 45.156621 2000 3.669455 + 133000 45.69364 2000 3.6168912 + 134000 46.23133 2000 3.3598517 + 135000 46.765487 2000 3.3743407 + 136000 47.323693 2000 3.1109764 + 137000 47.881617 2000 3.0720146 + 138000 48.439179 2000 3.1303776 + 139000 49.001417 2000 3.2052806 + 140000 49.558061 2000 2.8958882 + 141000 50.097789 2000 2.9931572 + 142000 50.636089 2000 3.0967832 + 143000 51.175873 2000 3.0576365 + 144000 51.706799 2000 3.2016943 + 145000 52.239356 2000 3.3817709 + 146000 52.769944 2000 3.4527239 + 147000 53.30872 2000 3.5928733 + 148000 53.847762 2000 3.7784682 + 149000 54.387455 2000 3.6587944 + 150000 54.931594 2000 3.7945669 + 151000 55.470076 2000 3.5551557 + 152000 56.01448 2000 3.6248848 + 153000 56.552259 2000 3.7361463 + 154000 57.092655 2000 3.8534319 + 155000 57.635767 2000 4.0101408 + 156000 58.180249 2000 3.7670652 + 157000 58.724032 2000 3.1487676 + 158000 59.262015 2000 2.980076 + 159000 59.794312 2000 3.0350592 + 160000 60.331617 2000 3.125389 + 161000 60.861827 2000 2.7516115 + 162000 61.396691 2000 2.413911 + 163000 61.930145 2000 2.297713 + 164000 62.466983 2000 2.3190806 + 165000 63.00535 2000 2.2868879 + 166000 63.546881 2000 2.1658547 + 167000 64.091461 2000 1.7511071 + 168000 64.63141 2000 1.4112478 + 169000 65.17459 2000 1.3623558 + 170000 65.719571 2000 1.3701579 +Loop time of 65.7196 on 1 procs for 150000 steps with 2000 atoms + +98.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 32.424 | 32.424 | 32.424 | 0.0 | 49.34 +Neigh | 0.65326 | 0.65326 | 0.65326 | 0.0 | 0.99 +Comm | 0.14207 | 0.14207 | 0.14207 | 0.0 | 0.22 +Output | 0.26326 | 0.26326 | 0.26326 | 0.0 | 0.40 +Modify | 31.109 | 31.109 | 31.109 | 0.0 | 47.34 +Other | | 1.128 | | | 1.72 + +Nlocal: 2000 ave 2000 max 2000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 15308 ave 15308 max 15308 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 15308 +Ave neighs/atom = 7.654 +Neighbor list builds = 367 +Dangerous builds = 0 + +# remove "plug" - need to redefine cylinder region & union + +region cylreg delete +region hopreg delete +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 + +region hopreg union 2 cylreg conereg + +unfix hopper3 +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +run 100000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.69 | 12.69 | 12.69 Mbytes + Step CPU Atoms KinEng + 170000 0 2000 1.3701579 + 171000 0.54961146 2000 2.3724823 + 172000 1.0905775 2000 3.5881441 + 173000 1.6190656 2000 5.3771633 + 174000 2.1428619 2000 7.5896471 + 175000 2.6623327 2000 10.77251 + 176000 3.1738773 2000 14.806868 + 177000 3.6751053 2000 19.607624 + 178000 4.17465 2000 25.426227 + 179000 4.6736143 2000 32.23584 + 180000 5.1769137 2000 39.930468 + 181000 5.6766809 2000 47.686304 + 182000 6.1722504 2000 56.506806 + 183000 6.6603586 2000 66.514326 + 184000 7.1473381 2000 77.554644 + 185000 7.6343824 2000 89.224002 + 186000 8.1170225 2000 102.07846 + 187000 8.598305 2000 116.08141 + 188000 9.0708108 2000 130.97964 + 189000 9.5435695 2000 146.77806 + 190000 10.015069 2000 162.79858 + 191000 10.480992 2000 179.02052 + 192000 10.941896 2000 196.26683 + 193000 11.398748 2000 214.38928 + 194000 11.856098 2000 232.32068 + 195000 12.314324 2000 251.74644 + 196000 12.765746 2000 272.25231 + 197000 13.216453 2000 294.64075 + 198000 13.663698 2000 318.32895 + 199000 14.109901 2000 342.44005 + 200000 14.560399 2000 368.35469 + 201000 15.008158 2000 395.2465 + 202000 15.460487 2000 422.63599 + 203000 15.913115 2000 450.45248 + 204000 16.363656 2000 479.60812 + 205000 16.816929 2000 510.44155 + 206000 17.265488 2000 543.25751 + 207000 17.707782 2000 577.35928 + 208000 18.151051 2000 612.29718 + 209000 18.588363 2000 647.8951 + 210000 19.027167 2000 683.79409 + 211000 19.463213 2000 720.36556 + 212000 19.901783 2000 759.27331 + 213000 20.340436 2000 798.27302 + 214000 20.775782 2000 837.93849 + 215000 21.207465 2000 877.92945 + 216000 21.641572 2000 919.62532 + 217000 22.077351 2000 962.83509 + 218000 22.517089 2000 1008.5243 + 219000 22.948683 2000 1054.5769 + 220000 23.381029 2000 1103.1843 + 221000 23.809214 2000 1153.0349 + 222000 24.246127 2000 1204.5599 + 223000 24.677676 2000 1257.1367 + 224000 25.113989 2000 1308.6735 +WARNING: Lost atoms: original 2000 current 1999 (../thermo.cpp:486) + 225000 25.549621 1999 1360.1205 + 226000 25.977155 1998 1404.8405 + 227000 26.406475 1996 1448.4869 + 228000 26.832152 1992 1491.8112 + 229000 27.25327 1985 1518.7013 + 230000 27.672907 1971 1507.6699 + 231000 28.086761 1965 1533.5096 + 232000 28.500134 1948 1489.4128 + 233000 28.912212 1933 1477.4536 + 234000 29.320197 1915 1425.8398 + 235000 29.723669 1904 1410.1451 + 236000 30.124339 1892 1401.7595 + 237000 30.523539 1880 1368.893 + 238000 30.919483 1868 1341.8885 + 239000 31.313194 1850 1286.7968 + 240000 31.711659 1833 1219.5123 + 241000 32.106468 1820 1173.3608 + 242000 32.505486 1806 1106.0727 + 243000 32.905579 1788 1035.912 + 244000 33.303155 1779 1021.6147 + 245000 33.696614 1767 969.40032 + 246000 34.083545 1757 939.12022 + 247000 34.472486 1739 840.9396 + 248000 34.858907 1730 822.06575 + 249000 35.248061 1719 762.11057 + 250000 35.639608 1707 708.50308 + 251000 36.029812 1700 692.12647 + 252000 36.428881 1697 694.5812 + 253000 36.821304 1686 652.36951 + 254000 37.203008 1682 662.95256 + 255000 37.576678 1677 637.34619 + 256000 37.952398 1672 630.71277 + 257000 38.336834 1669 641.87365 + 258000 38.719421 1665 635.862 + 259000 39.104236 1664 658.5339 + 260000 39.484223 1662 669.95468 + 261000 39.861203 1660 676.93495 + 262000 40.240183 1657 681.72646 + 263000 40.614974 1655 687.4078 + 264000 40.99447 1651 681.61352 + 265000 41.368018 1647 673.20622 + 266000 41.740288 1644 677.30073 + 267000 42.111704 1641 671.05897 + 268000 42.479868 1639 689.55776 + 269000 42.851008 1637 711.98809 + 270000 43.22438 1633 705.29974 +Loop time of 43.2244 on 1 procs for 100000 steps with 1633 atoms + +99.2% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 22.312 | 22.312 | 22.312 | 0.0 | 51.62 +Neigh | 0.47451 | 0.47451 | 0.47451 | 0.0 | 1.10 +Comm | 0.093822 | 0.093822 | 0.093822 | 0.0 | 0.22 +Output | 0.0028326 | 0.0028326 | 0.0028326 | 0.0 | 0.01 +Modify | 19.626 | 19.626 | 19.626 | 0.0 | 45.40 +Other | | 0.7152 | | | 1.65 + +Nlocal: 1633 ave 1633 max 1633 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 11358 ave 11358 max 11358 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 11358 +Ave neighs/atom = 6.955297 +Neighbor list builds = 244 +Dangerous builds = 0 +Total wall time: 0:01:53 diff --git a/examples/granregion/log.15Sep22.granregion.funnel.g++.4 b/examples/granregion/log.15Sep22.granregion.funnel.g++.4 new file mode 100644 index 0000000000..3c18217deb --- /dev/null +++ b/examples/granregion/log.15Sep22.granregion.funnel.g++.4 @@ -0,0 +1,633 @@ +LAMMPS (15 Sep 2022) +# pour particles into cone-shaped funnel, settle them, let them run out bottom + +variable name string funnel_pour + +thermo_modify flush yes +units si +variable PI equal 3.141592653589 +variable seed equal 14314 + +############################################### +# Geometry-related parameters +############################################### + +variable xlo equal 10 +variable xhi equal 40 +variable ylo equal 10 +variable yhi equal 40 +variable zlo equal -20 +variable zhi equal 50 + +variable xc equal 25 +variable yc equal 25 + +variable zconehi equal 50 +variable zconelo equal 10 +variable zcyllo equal 0 +variable radconelo equal 2 +variable radconehi equal 20 + +################################################ +# Particle sizes +################################################ + +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable skin equal ${rhi} +variable skin equal 0.5 + +############################################### +# Granular contact parameters +############################################### + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable density equal 1.0 +variable EYoung equal 10^5 +variable Poisson equal 2.0/7.0 +variable GShear equal ${EYoung}/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+0.285714285714286)) + +variable gravity equal 1.0 + +variable reff equal 0.5*(${rhi}+${rlo}) +variable reff equal 0.5*(0.5+${rlo}) +variable reff equal 0.5*(0.5+0.25) +variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 +variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 +variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 + +## Typical way to set kn, kt, etc.: +variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) +variable kt equal 4.0*${GShear}/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) + +variable a equal (-2.0*log(${coeffRes})/${PI})^2 +variable a equal (-2.0*log(0.1)/${PI})^2 +variable a equal (-2.0*log(0.1)/3.141592653589)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 903.503751814138*0.5 + +variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) + +variable dt equal ${tcol}*0.05 +variable dt equal 0.00210943016014969*0.05 +timestep ${dt} +timestep 0.000105471508007485 + +############################################### +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton off +atom_style sphere + +boundary p p f + +region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 40 ${zlo} ${zhi} +region boxreg block 10 40 10 40 -20 ${zhi} +region boxreg block 10 40 10 40 -20 50 +create_box 1 boxreg +Created orthogonal box = (10 10 -20) to (40 40 50) + 1 by 1 by 4 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.5 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 30, bins = 1 1 3 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/multi/newtoff + stencil: full/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +# insertion region for fix/pour + +region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box +region insreg cylinder z 25 ${yc} 10 30 50 side in units box +region insreg cylinder z 25 25 10 30 50 side in units box + +# define cone and cylinder regions - see lammps doc on region command +# note new open options + +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 2 + +region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open +region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 + +region hopreg union 2 conereg cylreg + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + + +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 3000 every 59965 steps, 2000 by step 1 + +#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke +WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) +thermo_modify flush yes lost warn + +# Initial run to fill up the cone + +run 20000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 6.049 | 6.049 | 6.049 Mbytes + Step CPU Atoms KinEng + 0 0 0 -0 + 1000 0.4194951 2000 -0 + 2000 0.61516729 2000 -0 + 3000 0.80702516 2000 -0 + 4000 0.99253349 2000 -0 + 5000 1.172741 2000 -0 + 6000 1.3484682 2000 -0 + 7000 1.5206253 2000 -0 + 8000 1.6875025 2000 -0 + 9000 1.8503087 2000 -0 + 10000 2.0125622 2000 -0 + 11000 2.0890872 2000 -0 + 12000 2.1663582 2000 -0 + 13000 2.2430386 2000 -0 + 14000 2.320045 2000 -0 + 15000 2.3989769 2000 -0 + 16000 2.4824747 2000 -0 + 17000 2.5693391 2000 -0 + 18000 2.6595183 2000 -0 + 19000 2.752627 2000 -0 + 20000 2.8503071 2000 -0 +Loop time of 2.85034 on 4 procs for 20000 steps with 2000 atoms + +98.0% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.04057 | 0.088166 | 0.18377 | 18.9 | 3.09 +Neigh | 0.0072649 | 0.014273 | 0.025073 | 5.5 | 0.50 +Comm | 0.097843 | 0.19506 | 0.29871 | 19.9 | 6.84 +Output | 0.00099986 | 0.0018246 | 0.0023299 | 1.2 | 0.06 +Modify | 0.68567 | 1.1174 | 1.9527 | 46.8 | 39.20 +Other | | 1.434 | | | 50.30 + +Nlocal: 500 ave 510 max 493 min +Histogram: 1 1 0 0 0 1 0 0 0 1 +Nghost: 154 ave 227 max 79 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Neighs: 415.5 ave 610 max 258 min +Histogram: 1 1 0 0 0 0 1 0 0 1 + +Total # of neighbors = 1662 +Ave neighs/atom = 0.831 +Neighbor list builds = 71 +Dangerous builds = 0 +unfix ins +run 150000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.33 | 12.5 | 12.68 Mbytes + Step CPU Atoms KinEng + 20000 0 2000 6652.2957 + 21000 0.069761009 2000 6807.2201 + 22000 0.14277925 2000 6973.9359 + 23000 0.21755553 2000 7142.3648 + 24000 0.29656838 2000 7276.9717 + 25000 0.3791331 2000 7369.4191 + 26000 0.46663378 2000 7497.6526 + 27000 0.55670237 2000 7638.946 + 28000 0.65212555 2000 7780.0339 + 29000 0.75032507 2000 7881.8177 + 30000 0.85580942 2000 7967.2641 + 31000 0.93204785 2000 7994.9273 + 32000 1.0168325 2000 7937.0672 + 33000 1.1081585 2000 7774.0508 + 34000 1.2084122 2000 7591.1511 + 35000 1.3164174 2000 7357.5032 + 36000 1.4326847 2000 7147.3776 + 37000 1.5548919 2000 6980.0719 + 38000 1.6806183 2000 6813.0872 + 39000 1.8171138 2000 6657.0693 + 40000 1.9655069 2000 6505.1155 + 41000 2.0788398 2000 6330.2864 + 42000 2.1972941 2000 6147.8022 + 43000 2.3180177 2000 5932.9244 + 44000 2.4424194 2000 5755.296 + 45000 2.5679759 2000 5511.622 + 46000 2.7042099 2000 5332.3171 + 47000 2.8436403 2000 5162.4926 + 48000 2.983017 2000 5044.5764 + 49000 3.1228322 2000 4901.1141 + 50000 3.2614172 2000 4731.1949 + 51000 3.3835559 2000 4575.418 + 52000 3.5097034 2000 4428.9425 + 53000 3.6438561 2000 4291.7282 + 54000 3.7823058 2000 4154.1885 + 55000 3.9269393 2000 3994.9402 + 56000 4.0761939 2000 3855.5977 + 57000 4.2262191 2000 3672.9504 + 58000 4.3809045 2000 3435.3395 + 59000 4.5439971 2000 3200.7379 + 60000 4.7111867 2000 2986.5411 + 61000 4.8700167 2000 2747.3628 + 62000 5.030656 2000 2542.0805 + 63000 5.1932098 2000 2336.7687 + 64000 5.3585095 2000 2151.6388 + 65000 5.5278279 2000 1933.6773 + 66000 5.7032072 2000 1699.0747 + 67000 5.8804545 2000 1467.7209 + 68000 6.0598984 2000 1227.3577 + 69000 6.2471961 2000 1016.2766 + 70000 6.4413532 2000 812.90843 + 71000 6.615215 2000 632.88108 + 72000 6.7897335 2000 470.67731 + 73000 6.964705 2000 360.47748 + 74000 7.1361808 2000 286.10584 + 75000 7.3068097 2000 229.70386 + 76000 7.4771974 2000 179.62654 + 77000 7.6485358 2000 142.40417 + 78000 7.8200771 2000 113.55745 + 79000 7.9923688 2000 93.787669 + 80000 8.164219 2000 80.646319 + 81000 8.3372059 2000 70.944319 + 82000 8.5130035 2000 59.2275 + 83000 8.6877383 2000 49.633808 + 84000 8.8675712 2000 42.882698 + 85000 9.0509682 2000 36.841824 + 86000 9.2393665 2000 31.776681 + 87000 9.4296116 2000 28.25076 + 88000 9.622196 2000 25.228966 + 89000 9.8176023 2000 22.593627 + 90000 10.01325 2000 21.15796 + 91000 10.204474 2000 19.941629 + 92000 10.399553 2000 18.375654 + 93000 10.596683 2000 17.056701 + 94000 10.796988 2000 16.192511 + 95000 10.998545 2000 15.572922 + 96000 11.200614 2000 14.827788 + 97000 11.402484 2000 13.919613 + 98000 11.606219 2000 13.19525 + 99000 11.81042 2000 11.993376 + 100000 12.018294 2000 11.258787 + 101000 12.223702 2000 10.641688 + 102000 12.432026 2000 10.430435 + 103000 12.640962 2000 9.518069 + 104000 12.849109 2000 9.1332086 + 105000 13.05872 2000 9.2151611 + 106000 13.269956 2000 9.0035132 + 107000 13.481882 2000 8.7835861 + 108000 13.693895 2000 8.5124479 + 109000 13.906381 2000 8.2975453 + 110000 14.120217 2000 8.3483043 + 111000 14.332078 2000 8.4658572 + 112000 14.54349 2000 8.4771784 + 113000 14.755719 2000 7.8937975 + 114000 14.968619 2000 7.2472953 + 115000 15.180485 2000 6.5812074 + 116000 15.394405 2000 5.5651566 + 117000 15.607523 2000 5.3015807 + 118000 15.821873 2000 5.0133941 + 119000 16.035675 2000 4.8746036 + 120000 16.24964 2000 4.9133073 + 121000 16.462102 2000 4.3337392 + 122000 16.676371 2000 4.3374836 + 123000 16.890252 2000 4.3721818 + 124000 17.106594 2000 4.3894508 + 125000 17.321433 2000 4.1811774 + 126000 17.536692 2000 4.3011002 + 127000 17.748238 2000 4.442228 + 128000 17.962609 2000 4.6170394 + 129000 18.175315 2000 4.8184318 + 130000 18.389056 2000 4.8442096 + 131000 18.600872 2000 4.9668117 + 132000 18.81412 2000 4.8364562 + 133000 19.027514 2000 4.6658645 + 134000 19.23975 2000 4.5758487 + 135000 19.451085 2000 4.7251949 + 136000 19.663874 2000 4.5846492 + 137000 19.87624 2000 4.7565986 + 138000 20.088654 2000 4.8186623 + 139000 20.29935 2000 4.6571647 + 140000 20.510911 2000 4.0730143 + 141000 20.722072 2000 4.0605542 + 142000 20.933113 2000 4.1457179 + 143000 21.143916 2000 4.3418042 + 144000 21.353873 2000 4.0323813 + 145000 21.567015 2000 3.8064958 + 146000 21.781334 2000 3.1802044 + 147000 21.996799 2000 2.7947641 + 148000 22.209808 2000 2.7384164 + 149000 22.423177 2000 2.7428829 + 150000 22.638044 2000 2.7802186 + 151000 22.851676 2000 2.6703451 + 152000 23.065354 2000 2.3357647 + 153000 23.278882 2000 1.9855305 + 154000 23.494254 2000 1.9442713 + 155000 23.708192 2000 1.7348027 + 156000 23.923005 2000 1.5699942 + 157000 24.13827 2000 1.5224944 + 158000 24.352068 2000 1.4850914 + 159000 24.565616 2000 1.4461048 + 160000 24.779118 2000 1.3759525 + 161000 24.99111 2000 0.83754463 + 162000 25.205935 2000 0.7952922 + 163000 25.420817 2000 0.69670143 + 164000 25.632672 2000 0.66253723 + 165000 25.846901 2000 0.64602969 + 166000 26.060074 2000 0.60229858 + 167000 26.273714 2000 0.5757589 + 168000 26.484855 2000 0.5996023 + 169000 26.698151 2000 0.62130448 + 170000 26.911208 2000 0.63888277 +Loop time of 26.9112 on 4 procs for 150000 steps with 2000 atoms + +95.1% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 4.5517 | 8.6135 | 10.872 | 82.7 | 32.01 +Neigh | 0.092491 | 0.15402 | 0.19598 | 9.7 | 0.57 +Comm | 2.0054 | 3.8686 | 4.6494 | 55.0 | 14.38 +Output | 0.0047033 | 0.0096766 | 0.016452 | 4.6 | 0.04 +Modify | 5.6498 | 7.9588 | 9.4012 | 49.7 | 29.57 +Other | | 6.307 | | | 23.43 + +Nlocal: 500 ave 538 max 419 min +Histogram: 1 0 0 0 0 0 0 1 0 2 +Nghost: 445.5 ave 688 max 200 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Neighs: 4500.25 ave 5610 max 3443 min +Histogram: 1 0 1 0 0 0 1 0 0 1 + +Total # of neighbors = 18001 +Ave neighs/atom = 9.0005 +Neighbor list builds = 362 +Dangerous builds = 0 + +# remove "plug" - need to redefine cylinder region & union + +region cylreg delete +region hopreg delete +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 + +region hopreg union 2 cylreg conereg + +unfix hopper3 +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +run 100000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.34 | 12.53 | 12.68 Mbytes + Step CPU Atoms KinEng + 170000 0 2000 0.63888277 + 171000 0.21419748 2000 1.4139245 + 172000 0.42844271 2000 2.2400138 + 173000 0.64333145 2000 3.8034979 + 174000 0.85456696 2000 6.116727 + 175000 1.0672981 2000 8.9536458 + 176000 1.2790911 2000 12.74348 + 177000 1.491721 2000 17.410816 + 178000 1.7033452 2000 22.879174 + 179000 1.9168047 2000 28.966022 + 180000 2.1329071 2000 35.449239 + 181000 2.3490841 2000 42.694882 + 182000 2.565508 2000 50.913279 + 183000 2.780369 2000 60.098465 + 184000 2.9967771 2000 70.133474 + 185000 3.2116891 2000 80.950013 + 186000 3.4248923 2000 92.495525 + 187000 3.6394206 2000 104.83034 + 188000 3.8527533 2000 118.04659 + 189000 4.0650838 2000 132.7403 + 190000 4.2781031 2000 148.31955 + 191000 4.476226 2000 164.26321 + 192000 4.6750263 2000 180.6933 + 193000 4.8710737 2000 197.72012 + 194000 5.0677642 2000 215.43637 + 195000 5.2639974 2000 234.29738 + 196000 5.4599746 2000 254.03407 + 197000 5.6534894 2000 274.58626 + 198000 5.8462402 2000 296.88915 + 199000 6.0400194 2000 320.45001 + 200000 6.2329415 2000 344.75891 + 201000 6.4235068 2000 370.14016 + 202000 6.6142055 2000 395.72827 + 203000 6.8048206 2000 420.42026 + 204000 6.9987454 2000 446.08079 + 205000 7.1925778 2000 473.62963 + 206000 7.3846227 2000 501.05693 + 207000 7.5775122 2000 530.40427 + 208000 7.77052 2000 560.62015 + 209000 7.964984 2000 593.00113 + 210000 8.1601405 2000 626.36661 + 211000 8.3504978 2000 661.34861 + 212000 8.5425141 2000 697.41001 + 213000 8.736112 2000 735.12299 + 214000 8.9267615 2000 773.89126 + 215000 9.1154738 2000 813.83268 + 216000 9.3019826 2000 854.63669 + 217000 9.4878433 2000 896.59089 + 218000 9.6739682 2000 938.70251 + 219000 9.8566518 2000 982.10773 + 220000 10.042289 2000 1025.2953 + 221000 10.227275 2000 1069.8382 + 222000 10.412363 2000 1115.4449 + 223000 10.602757 2000 1161.6742 + 224000 10.789101 2000 1211.289 + 225000 10.974854 2000 1262.8074 + 226000 11.157089 2000 1316.6353 + 227000 11.337044 2000 1370.7434 +WARNING: Lost atoms: original 2000 current 1991 (../thermo.cpp:486) + 228000 11.518718 1991 1382.0924 + 229000 11.700488 1986 1407.1543 + 230000 11.883057 1975 1415.708 + 231000 12.063962 1968 1430.6498 + 232000 12.246917 1957 1421.0352 + 233000 12.429345 1939 1376.0322 + 234000 12.6113 1925 1350.1292 + 235000 12.791233 1912 1337.0529 + 236000 12.968444 1893 1273.2219 + 237000 13.146668 1879 1207.0473 + 238000 13.327542 1861 1132.0109 + 239000 13.50936 1846 1083.1042 + 240000 13.693504 1826 1004.3265 + 241000 13.863443 1819 989.36186 + 242000 14.03294 1812 983.26132 + 243000 14.20032 1805 985.79932 + 244000 14.366236 1794 936.34844 + 245000 14.532759 1784 889.17423 + 246000 14.703029 1770 846.65018 + 247000 14.873941 1753 751.16306 + 248000 15.045272 1740 709.23095 + 249000 15.217896 1732 687.61586 + 250000 15.388727 1721 638.82967 + 251000 15.558032 1714 618.71543 + 252000 15.725309 1709 611.25444 + 253000 15.888727 1705 606.6846 + 254000 16.050605 1702 601.7236 + 255000 16.212982 1697 575.97244 + 256000 16.378352 1695 577.1712 + 257000 16.547488 1691 576.93668 + 258000 16.718964 1688 586.63687 + 259000 16.892601 1686 581.52487 + 260000 17.066036 1682 566.49544 + 261000 17.22488 1681 586.18628 + 262000 17.379249 1678 582.11927 + 263000 17.534079 1675 589.96041 + 264000 17.690288 1672 577.55581 + 265000 17.847805 1669 570.45998 + 266000 18.006261 1666 574.0576 + 267000 18.1674 1662 578.07385 + 268000 18.326753 1660 587.65705 + 269000 18.488052 1657 584.43358 + 270000 18.647474 1654 591.22601 +Loop time of 18.6475 on 4 procs for 100000 steps with 1654 atoms + +94.4% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.7714 | 6.1879 | 8.8765 | 88.8 | 33.18 +Neigh | 0.094692 | 0.11244 | 0.13298 | 4.6 | 0.60 +Comm | 1.2471 | 2.918 | 3.5873 | 57.0 | 15.65 +Output | 0.0013438 | 0.0067176 | 0.014709 | 6.0 | 0.04 +Modify | 4.4355 | 5.0416 | 5.5692 | 21.9 | 27.04 +Other | | 4.381 | | | 23.49 + +Nlocal: 413.5 ave 429 max 408 min +Histogram: 3 0 0 0 0 0 0 0 0 1 +Nghost: 408.25 ave 653 max 182 min +Histogram: 1 0 0 1 0 1 0 0 0 1 +Neighs: 3486.25 ave 4367 max 2213 min +Histogram: 1 0 0 0 0 1 0 0 1 1 + +Total # of neighbors = 13945 +Ave neighs/atom = 8.4310762 +Neighbor list builds = 227 +Dangerous builds = 0 +Total wall time: 0:00:48 diff --git a/examples/granregion/log.15Sep22.granregion.mixer.g++.1 b/examples/granregion/log.15Sep22.granregion.mixer.g++.1 new file mode 100644 index 0000000000..2a3402c642 --- /dev/null +++ b/examples/granregion/log.15Sep22.granregion.mixer.g++.1 @@ -0,0 +1,632 @@ +LAMMPS (15 Sep 2022) +variable name string mixer + +thermo_modify flush yes +variable seed equal 14314 + +############################################### +# Particle parameters +################################################ + +variable rlo equal 0.3 +variable rhi equal 0.6 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.3 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.6 +variable skin equal ${rhi} +variable skin equal 0.6 + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable kn equal 10^5 +variable kt equal 0.2*${kn} +variable kt equal 0.2*100000 + +variable gravity equal 1.0 +variable density equal 1.0 + +variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 +variable a equal (-2.0*log(${coeffRes})/PI)^2 +variable a equal (-2.0*log(0.1)/PI)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 806.699778405191*0.5 + +variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) + +variable dt equal ${tcol}*0.02 +variable dt equal 0.00236257621510454*0.02 +timestep ${dt} +timestep 4.72515243020908e-05 + +############################################### + +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton on +atom_style sphere + +boundary p p f + +region boxreg block 0 20 0 20 0 20 +create_box 1 boxreg +Created orthogonal box = (0 0 0) to (20 20 20) + 1 by 1 by 1 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.6 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 20, bins = 1 1 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton on, size, history + pair build: half/size/multi/newton + stencil: half/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +region insreg cylinder z 10 10 8 10 18 side in units box +region cylreg cylinder z 10 10 10 0 20 side in units box + +variable theta equal (step/400000)*2*PI + +region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box +region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box + +region mixer intersect 3 cylreg b1 b2 side in + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + +fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer + +fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 +Particle insertion: 444 every 84653 steps, 1000 by step 169307 + +#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke v_theta +WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) +thermo_modify flush yes lost warn + +run 200000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.861 | 5.861 | 5.861 Mbytes + Step CPU Atoms KinEng v_theta + 0 0 0 -0 0 + 1000 0.10672296 444 -0 0.015707963 + 2000 0.2090638 444 -0 0.031415927 + 3000 0.31029663 444 -0 0.04712389 + 4000 0.41047624 444 -0 0.062831853 + 5000 0.51132361 444 -0 0.078539816 + 6000 0.61279172 444 -0 0.09424778 + 7000 0.71396622 444 -0 0.10995574 + 8000 0.81644319 444 -0 0.12566371 + 9000 0.91730959 444 -0 0.14137167 + 10000 1.0181635 444 -0 0.15707963 + 11000 1.1182214 444 -0 0.1727876 + 12000 1.2190013 444 -0 0.18849556 + 13000 1.3196138 444 -0 0.20420352 + 14000 1.4183593 444 -0 0.21991149 + 15000 1.5178458 444 -0 0.23561945 + 16000 1.6169535 444 -0 0.25132741 + 17000 1.7219188 444 -0 0.26703538 + 18000 1.8266303 444 -0 0.28274334 + 19000 1.9331589 444 -0 0.2984513 + 20000 2.0392693 444 -0 0.31415927 + 21000 2.1457521 444 -0 0.32986723 + 22000 2.2507526 444 -0 0.34557519 + 23000 2.3548243 444 -0 0.36128316 + 24000 2.4606335 444 -0 0.37699112 + 25000 2.5657643 444 -0 0.39269908 + 26000 2.6698254 444 -0 0.40840704 + 27000 2.7732221 444 -0 0.42411501 + 28000 2.8766441 444 -0 0.43982297 + 29000 2.9801547 444 -0 0.45553093 + 30000 3.0839748 444 -0 0.4712389 + 31000 3.1880063 444 -0 0.48694686 + 32000 3.2923439 444 -0 0.50265482 + 33000 3.3969501 444 -0 0.51836279 + 34000 3.5012646 444 -0 0.53407075 + 35000 3.6057831 444 -0 0.54977871 + 36000 3.7098273 444 -0 0.56548668 + 37000 3.8146061 444 -0 0.58119464 + 38000 3.9215588 444 -0 0.5969026 + 39000 4.0474026 444 -0 0.61261057 + 40000 4.1544945 444 -0 0.62831853 + 41000 4.2605761 444 -0 0.64402649 + 42000 4.3665287 444 -0 0.65973446 + 43000 4.4728216 444 -0 0.67544242 + 44000 4.5782483 444 -0 0.69115038 + 45000 4.6833043 444 -0 0.70685835 + 46000 4.7902207 444 -0 0.72256631 + 47000 4.8968527 444 -0 0.73827427 + 48000 5.0035027 444 -0 0.75398224 + 49000 5.1117191 444 -0 0.7696902 + 50000 5.2186233 444 -0 0.78539816 + 51000 5.3244005 444 -0 0.80110613 + 52000 5.4316153 444 -0 0.81681409 + 53000 5.5381785 444 -0 0.83252205 + 54000 5.6458179 444 -0 0.84823002 + 55000 5.759203 444 -0 0.86393798 + 56000 5.8779849 444 -0 0.87964594 + 57000 5.9953108 444 -0 0.89535391 + 58000 6.1115532 444 -0 0.91106187 + 59000 6.2298342 444 -0 0.92676983 + 60000 6.3474382 444 -0 0.9424778 + 61000 6.4642217 444 -0 0.95818576 + 62000 6.5815141 444 -0 0.97389372 + 63000 6.6999766 444 -0 0.98960169 + 64000 6.8181369 444 -0 1.0053096 + 65000 6.9368124 444 -0 1.0210176 + 66000 7.0560733 444 -0 1.0367256 + 67000 7.1761749 444 -0 1.0524335 + 68000 7.2942246 444 -0 1.0681415 + 69000 7.4146786 444 -0 1.0838495 + 70000 7.5364025 444 -0 1.0995574 + 71000 7.6565177 444 -0 1.1152654 + 72000 7.7776652 444 -0 1.1309734 + 73000 7.8972494 444 -0 1.1466813 + 74000 8.0183599 444 -0 1.1623893 + 75000 8.1423045 444 -0 1.1780972 + 76000 8.2667013 444 -0 1.1938052 + 77000 8.3876604 444 -0 1.2095132 + 78000 8.5095993 444 -0 1.2252211 + 79000 8.6317663 444 -0 1.2409291 + 80000 8.7562108 444 -0 1.2566371 + 81000 8.8812625 444 -0 1.272345 + 82000 9.006825 444 -0 1.288053 + 83000 9.1310939 444 -0 1.303761 + 84000 9.2540049 444 -0 1.3194689 + 85000 9.4210019 888 -0 1.3351769 + 86000 9.6509014 888 -0 1.3508848 + 87000 9.8827304 888 -0 1.3665928 + 88000 10.113857 888 -0 1.3823008 + 89000 10.34324 888 -0 1.3980087 + 90000 10.574203 888 -0 1.4137167 + 91000 10.806069 888 -0 1.4294247 + 92000 11.037044 888 -0 1.4451326 + 93000 11.262596 888 -0 1.4608406 + 94000 11.490532 888 -0 1.4765485 + 95000 11.716452 888 -0 1.4922565 + 96000 11.943883 888 -0 1.5079645 + 97000 12.171353 888 -0 1.5236724 + 98000 12.396787 888 -0 1.5393804 + 99000 12.623788 888 -0 1.5550884 + 100000 12.849633 888 -0 1.5707963 + 101000 13.082904 888 -0 1.5865043 + 102000 13.316986 888 -0 1.6022123 + 103000 13.54777 888 -0 1.6179202 + 104000 13.77928 888 -0 1.6336282 + 105000 14.014818 888 -0 1.6493361 + 106000 14.250986 888 -0 1.6650441 + 107000 14.485754 888 -0 1.6807521 + 108000 14.720106 888 -0 1.69646 + 109000 14.970869 888 -0 1.712168 + 110000 15.219203 888 -0 1.727876 + 111000 15.469876 888 -0 1.7435839 + 112000 15.721351 888 -0 1.7592919 + 113000 15.972099 888 -0 1.7749998 + 114000 16.222357 888 -0 1.7907078 + 115000 16.474863 888 -0 1.8064158 + 116000 16.725352 888 -0 1.8221237 + 117000 16.979634 888 -0 1.8378317 + 118000 17.231379 888 -0 1.8535397 + 119000 17.483691 888 -0 1.8692476 + 120000 17.737897 888 -0 1.8849556 + 121000 17.991241 888 -0 1.9006636 + 122000 18.245626 888 -0 1.9163715 + 123000 18.499984 888 -0 1.9320795 + 124000 18.754367 888 -0 1.9477874 + 125000 19.006448 888 -0 1.9634954 + 126000 19.260545 888 -0 1.9792034 + 127000 19.513633 888 -0 1.9949113 + 128000 19.769389 888 -0 2.0106193 + 129000 20.025088 888 -0 2.0263273 + 130000 20.277534 888 -0 2.0420352 + 131000 20.529284 888 -0 2.0577432 + 132000 20.785132 888 -0 2.0734512 + 133000 21.038442 888 -0 2.0891591 + 134000 21.293932 888 -0 2.1048671 + 135000 21.545354 888 -0 2.120575 + 136000 21.799547 888 -0 2.136283 + 137000 22.053639 888 -0 2.151991 + 138000 22.310106 888 -0 2.1676989 + 139000 22.569362 888 -0 2.1834069 + 140000 22.829416 888 -0 2.1991149 + 141000 23.089132 888 -0 2.2148228 + 142000 23.345737 888 -0 2.2305308 + 143000 23.60621 888 -0 2.2462387 + 144000 23.867414 888 -0 2.2619467 + 145000 24.132954 888 -0 2.2776547 + 146000 24.39395 888 -0 2.2933626 + 147000 24.657881 888 -0 2.3090706 + 148000 24.918563 888 -0 2.3247786 + 149000 25.177446 888 -0 2.3404865 + 150000 25.446598 888 -0 2.3561945 + 151000 25.715494 888 -0 2.3719025 + 152000 25.985991 888 -0 2.3876104 + 153000 26.256676 888 -0 2.4033184 + 154000 26.525639 888 -0 2.4190263 + 155000 26.82656 888 -0 2.4347343 + 156000 27.157272 888 -0 2.4504423 + 157000 27.481755 888 -0 2.4661502 + 158000 27.80198 888 -0 2.4818582 + 159000 28.123258 888 -0 2.4975662 + 160000 28.437502 888 -0 2.5132741 + 161000 28.756496 888 -0 2.5289821 + 162000 29.080609 888 -0 2.54469 + 163000 29.399252 888 -0 2.560398 + 164000 29.718986 888 -0 2.576106 + 165000 30.045206 888 -0 2.5918139 + 166000 30.365168 888 -0 2.6075219 + 167000 30.684007 888 -0 2.6232299 + 168000 31.006154 888 -0 2.6389378 + 169000 31.330336 888 -0 2.6546458 + 170000 31.681761 1000 -0 2.6703538 + 171000 32.049778 1000 -0 2.6860617 + 172000 32.421067 1000 -0 2.7017697 + 173000 32.79935 1000 -0 2.7174776 + 174000 33.178002 1000 -0 2.7331856 + 175000 33.54236 1000 -0 2.7488936 + 176000 33.904734 1000 -0 2.7646015 + 177000 34.269671 1000 -0 2.7803095 + 178000 34.633106 1000 -0 2.7960175 + 179000 35.001441 1000 -0 2.8117254 + 180000 35.374769 1000 -0 2.8274334 + 181000 35.742362 1000 -0 2.8431414 + 182000 36.115908 1000 -0 2.8588493 + 183000 36.490149 1000 -0 2.8745573 + 184000 36.866289 1000 -0 2.8902652 + 185000 37.252911 1000 -0 2.9059732 + 186000 37.644586 1000 -0 2.9216812 + 187000 38.028002 1000 -0 2.9373891 + 188000 38.40724 1000 -0 2.9530971 + 189000 38.77431 1000 -0 2.9688051 + 190000 39.14138 1000 -0 2.984513 + 191000 39.519083 1000 -0 3.000221 + 192000 39.895243 1000 -0 3.0159289 + 193000 40.237532 1000 -0 3.0316369 + 194000 40.587663 1000 -0 3.0473449 + 195000 40.939032 1000 -0 3.0630528 + 196000 41.290257 1000 -0 3.0787608 + 197000 41.643778 1000 -0 3.0944688 + 198000 41.992818 1000 -0 3.1101767 + 199000 42.335934 1000 -0 3.1258847 + 200000 42.681071 1000 -0 3.1415927 +Loop time of 42.6811 on 1 procs for 200000 steps with 1000 atoms + +Performance: 19130.397 tau/day, 4685.915 timesteps/s, 4.686 Matom-step/s +98.5% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.6365 | 2.6365 | 2.6365 | 0.0 | 6.18 +Neigh | 0.051681 | 0.051681 | 0.051681 | 0.0 | 0.12 +Comm | 0.52007 | 0.52007 | 0.52007 | 0.0 | 1.22 +Output | 0.02209 | 0.02209 | 0.02209 | 0.0 | 0.05 +Modify | 38.71 | 38.71 | 38.71 | 0.0 | 90.70 +Other | | 0.7407 | | | 1.74 + +Nlocal: 1000 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 183 ave 183 max 183 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 3757 ave 3757 max 3757 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 3757 +Ave neighs/atom = 3.757 +Neighbor list builds = 200 +Dangerous builds = 0 +unfix ins +run 200000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 11.89 | 11.89 | 11.89 Mbytes + Step CPU Atoms KinEng v_theta + 200000 0 1000 1.0515941 3.1415927 + 201000 0.35477257 1000 1.0348185 3.1573006 + 202000 0.71436123 1000 1.0220859 3.1730086 + 203000 1.0642832 1000 1.0225785 3.1887165 + 204000 1.4165213 1000 1.0206121 3.2044245 + 205000 1.7728133 1000 1.009961 3.2201325 + 206000 2.1279101 1000 0.9993323 3.2358404 + 207000 2.480623 1000 0.99602628 3.2515484 + 208000 2.8321106 1000 0.98341818 3.2672564 + 209000 3.2138945 1000 0.96700718 3.2829643 + 210000 3.5921146 1000 0.95226699 3.2986723 + 211000 3.9643569 1000 0.93911691 3.3143802 + 212000 4.3368151 1000 0.92920029 3.3300882 + 213000 4.7130192 1000 0.91893472 3.3457962 + 214000 5.0881313 1000 0.90873324 3.3615041 + 215000 5.4660106 1000 0.88925817 3.3772121 + 216000 5.8455926 1000 0.89108236 3.3929201 + 217000 6.2204827 1000 0.90176711 3.408628 + 218000 6.6046736 1000 0.90149435 3.424336 + 219000 6.9931145 1000 0.89629307 3.440044 + 220000 7.3771565 1000 0.90390589 3.4557519 + 221000 7.7635603 1000 0.87858148 3.4714599 + 222000 8.1502771 1000 0.88862314 3.4871678 + 223000 8.5393557 1000 0.90394098 3.5028758 + 224000 8.9327212 1000 0.91005462 3.5185838 + 225000 9.315331 1000 0.91753865 3.5342917 + 226000 9.6930994 1000 0.91741233 3.5499997 + 227000 10.077148 1000 0.9041879 3.5657077 + 228000 10.463223 1000 0.9085712 3.5814156 + 229000 10.850271 1000 0.8937854 3.5971236 + 230000 11.230235 1000 0.88740571 3.6128316 + 231000 11.61003 1000 0.88350028 3.6285395 + 232000 11.988134 1000 0.88344474 3.6442475 + 233000 12.365856 1000 0.88003311 3.6599554 + 234000 12.745397 1000 0.87416727 3.6756634 + 235000 13.120344 1000 0.86154585 3.6913714 + 236000 13.489521 1000 0.85705071 3.7070793 + 237000 13.858736 1000 0.85297378 3.7227873 + 238000 14.230242 1000 0.84879486 3.7384953 + 239000 14.609692 1000 0.86978407 3.7542032 + 240000 14.998899 1000 0.86758733 3.7699112 + 241000 15.40773 1000 0.86123097 3.7856191 + 242000 15.81537 1000 0.86088136 3.8013271 + 243000 16.221448 1000 0.85270311 3.8170351 + 244000 16.619008 1000 0.8524395 3.832743 + 245000 17.003986 1000 0.84054009 3.848451 + 246000 17.380362 1000 0.82623612 3.864159 + 247000 17.756477 1000 0.82787746 3.8798669 + 248000 18.136456 1000 0.83027177 3.8955749 + 249000 18.521277 1000 0.83307565 3.9112829 + 250000 18.906407 1000 0.82612362 3.9269908 + 251000 19.28348 1000 0.8404639 3.9426988 + 252000 19.66549 1000 0.83550946 3.9584067 + 253000 20.053842 1000 0.81516472 3.9741147 + 254000 20.451357 1000 0.79127421 3.9898227 + 255000 20.844416 1000 0.78373024 4.0055306 + 256000 21.228637 1000 0.79885661 4.0212386 + 257000 21.613641 1000 0.80322118 4.0369466 + 258000 21.99162 1000 0.79861523 4.0526545 + 259000 22.367158 1000 0.79216962 4.0683625 + 260000 22.746158 1000 0.79543097 4.0840704 + 261000 23.125626 1000 0.79394211 4.0997784 + 262000 23.504282 1000 0.79269346 4.1154864 + 263000 23.883609 1000 0.80022854 4.1311943 + 264000 24.261864 1000 0.79885184 4.1469023 + 265000 24.639269 1000 0.79595018 4.1626103 + 266000 25.016335 1000 0.78191184 4.1783182 + 267000 25.389754 1000 0.76329279 4.1940262 + 268000 25.762053 1000 0.7342663 4.2097342 + 269000 26.133966 1000 0.72303366 4.2254421 + 270000 26.511157 1000 0.70016481 4.2411501 + 271000 26.888842 1000 0.68891731 4.256858 + 272000 27.26804 1000 0.68545775 4.272566 + 273000 27.644067 1000 0.68712156 4.288274 + 274000 28.024704 1000 0.69249813 4.3039819 + 275000 28.404842 1000 0.70187847 4.3196899 + 276000 28.785799 1000 0.70679419 4.3353979 + 277000 29.165857 1000 0.70955357 4.3511058 + 278000 29.545291 1000 0.70183408 4.3668138 + 279000 29.926113 1000 0.69979273 4.3825218 + 280000 30.302095 1000 0.70822139 4.3982297 + 281000 30.684406 1000 0.71629209 4.4139377 + 282000 31.065873 1000 0.73094905 4.4296456 + 283000 31.445972 1000 0.74554115 4.4453536 + 284000 31.828184 1000 0.74390104 4.4610616 + 285000 32.207807 1000 0.74675359 4.4767695 + 286000 32.58802 1000 0.75330713 4.4924775 + 287000 32.964457 1000 0.75525926 4.5081855 + 288000 33.343222 1000 0.75174884 4.5238934 + 289000 33.717663 1000 0.74062375 4.5396014 + 290000 34.094722 1000 0.72784613 4.5553093 + 291000 34.46982 1000 0.72151574 4.5710173 + 292000 34.843777 1000 0.71712409 4.5867253 + 293000 35.208307 1000 0.71803758 4.6024332 + 294000 35.576207 1000 0.71002715 4.6181412 + 295000 35.942972 1000 0.7070911 4.6338492 + 296000 36.3107 1000 0.71082175 4.6495571 + 297000 36.682044 1000 0.70438977 4.6652651 + 298000 37.054664 1000 0.70240345 4.6809731 + 299000 37.424717 1000 0.70525357 4.696681 + 300000 37.796148 1000 0.70636846 4.712389 + 301000 38.166828 1000 0.70443346 4.7280969 + 302000 38.538428 1000 0.71187973 4.7438049 + 303000 38.907221 1000 0.71047139 4.7595129 + 304000 39.280263 1000 0.71405925 4.7752208 + 305000 39.652902 1000 0.71277063 4.7909288 + 306000 40.02752 1000 0.72005331 4.8066368 + 307000 40.402955 1000 0.72466112 4.8223447 + 308000 40.784177 1000 0.72001329 4.8380527 + 309000 41.173226 1000 0.70611982 4.8537606 + 310000 41.559195 1000 0.70810918 4.8694686 + 311000 41.946697 1000 0.70377166 4.8851766 + 312000 42.337059 1000 0.70434458 4.9008845 + 313000 42.728304 1000 0.70707385 4.9165925 + 314000 43.120803 1000 0.71412995 4.9323005 + 315000 43.510705 1000 0.72228946 4.9480084 + 316000 43.901867 1000 0.72715835 4.9637164 + 317000 44.295667 1000 0.73833476 4.9794244 + 318000 44.687503 1000 0.75953014 4.9951323 + 319000 45.077121 1000 0.76413836 5.0108403 + 320000 45.465317 1000 0.76745045 5.0265482 + 321000 45.86931 1000 0.75813288 5.0422562 + 322000 46.277029 1000 0.75324661 5.0579642 + 323000 46.680799 1000 0.75004276 5.0736721 + 324000 47.082361 1000 0.74316264 5.0893801 + 325000 47.481252 1000 0.74087383 5.1050881 + 326000 47.87511 1000 0.73244882 5.120796 + 327000 48.274582 1000 0.73096631 5.136504 + 328000 48.671718 1000 0.72955403 5.152212 + 329000 49.066335 1000 0.73464916 5.1679199 + 330000 49.459765 1000 0.73130257 5.1836279 + 331000 49.850698 1000 0.73008711 5.1993358 + 332000 50.241012 1000 0.72561074 5.2150438 + 333000 50.643245 1000 0.7214495 5.2307518 + 334000 51.039153 1000 0.71274232 5.2464597 + 335000 51.430328 1000 0.71335777 5.2621677 + 336000 51.819148 1000 0.71317423 5.2778757 + 337000 52.202763 1000 0.70965743 5.2935836 + 338000 52.585061 1000 0.69648518 5.3092916 + 339000 52.967678 1000 0.68985842 5.3249995 + 340000 53.351472 1000 0.6846783 5.3407075 + 341000 53.737731 1000 0.69031602 5.3564155 + 342000 54.131413 1000 0.69035259 5.3721234 + 343000 54.526384 1000 0.69843983 5.3878314 + 344000 54.921609 1000 0.69566088 5.4035394 + 345000 55.314258 1000 0.68309182 5.4192473 + 346000 55.701119 1000 0.68360919 5.4349553 + 347000 56.088194 1000 0.68034628 5.4506633 + 348000 56.467878 1000 0.67155093 5.4663712 + 349000 56.857709 1000 0.66504603 5.4820792 + 350000 57.250758 1000 0.66533658 5.4977871 + 351000 57.643438 1000 0.67726804 5.5134951 + 352000 58.04256 1000 0.68880987 5.5292031 + 353000 58.437369 1000 0.71377276 5.544911 + 354000 58.832421 1000 0.71715625 5.560619 + 355000 59.222221 1000 0.71729576 5.576327 + 356000 59.621431 1000 0.71088872 5.5920349 + 357000 60.013262 1000 0.70564615 5.6077429 + 358000 60.406494 1000 0.69291739 5.6234508 + 359000 60.800632 1000 0.68237469 5.6391588 + 360000 61.195364 1000 0.69105856 5.6548668 + 361000 61.588291 1000 0.69563351 5.6705747 + 362000 61.984821 1000 0.69762747 5.6862827 + 363000 62.377158 1000 0.69717346 5.7019907 + 364000 62.77604 1000 0.69413964 5.7176986 + 365000 63.165863 1000 0.68584257 5.7334066 + 366000 63.5503 1000 0.67653762 5.7491146 + 367000 63.930717 1000 0.66880284 5.7648225 + 368000 64.313698 1000 0.66024732 5.7805305 + 369000 64.708193 1000 0.65451701 5.7962384 + 370000 65.10142 1000 0.64352268 5.8119464 + 371000 65.49169 1000 0.63715296 5.8276544 + 372000 65.879115 1000 0.63840106 5.8433623 + 373000 66.268258 1000 0.64537192 5.8590703 + 374000 66.661807 1000 0.64498753 5.8747783 + 375000 67.052521 1000 0.64666103 5.8904862 + 376000 67.443168 1000 0.65957055 5.9061942 + 377000 67.835892 1000 0.65964257 5.9219022 + 378000 68.229282 1000 0.65720396 5.9376101 + 379000 68.623557 1000 0.66304265 5.9533181 + 380000 69.015967 1000 0.67465814 5.969026 + 381000 69.408981 1000 0.68582945 5.984734 + 382000 69.796561 1000 0.69516677 6.000442 + 383000 70.186403 1000 0.69835516 6.0161499 + 384000 70.5765 1000 0.70403284 6.0318579 + 385000 70.966205 1000 0.6955862 6.0475659 + 386000 71.360054 1000 0.704932 6.0632738 + 387000 71.757912 1000 0.71954173 6.0789818 + 388000 72.147544 1000 0.72347529 6.0946897 + 389000 72.535029 1000 0.72738907 6.1103977 + 390000 72.925842 1000 0.74783091 6.1261057 + 391000 73.306871 1000 0.76739039 6.1418136 + 392000 73.692746 1000 0.77184224 6.1575216 + 393000 74.053385 1000 0.76813357 6.1732296 + 394000 74.416323 1000 0.75994091 6.1889375 + 395000 74.777021 1000 0.74970188 6.2046455 + 396000 75.139847 1000 0.7523174 6.2203535 + 397000 75.502888 1000 0.74652931 6.2360614 + 398000 75.865442 1000 0.74418096 6.2517694 + 399000 76.225245 1000 0.75110038 6.2674773 + 400000 76.590032 1000 0.7609274 6.2831853 +Loop time of 76.5901 on 1 procs for 200000 steps with 1000 atoms + +Performance: 10660.735 tau/day, 2611.305 timesteps/s, 2.611 Matom-step/s +99.0% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 8.693 | 8.693 | 8.693 | 0.0 | 11.35 +Neigh | 0.082655 | 0.082655 | 0.082655 | 0.0 | 0.11 +Comm | 1.1618 | 1.1618 | 1.1618 | 0.0 | 1.52 +Output | 0.0052644 | 0.0052644 | 0.0052644 | 0.0 | 0.01 +Modify | 65.713 | 65.713 | 65.713 | 0.0 | 85.80 +Other | | 0.934 | | | 1.22 + +Nlocal: 1000 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 268 ave 268 max 268 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 5015 ave 5015 max 5015 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 5015 +Ave neighs/atom = 5.015 +Neighbor list builds = 163 +Dangerous builds = 0 +Total wall time: 0:01:59 diff --git a/examples/granregion/log.15Sep22.granregion.mixer.g++.4 b/examples/granregion/log.15Sep22.granregion.mixer.g++.4 new file mode 100644 index 0000000000..57c517a063 --- /dev/null +++ b/examples/granregion/log.15Sep22.granregion.mixer.g++.4 @@ -0,0 +1,632 @@ +LAMMPS (15 Sep 2022) +variable name string mixer + +thermo_modify flush yes +variable seed equal 14314 + +############################################### +# Particle parameters +################################################ + +variable rlo equal 0.3 +variable rhi equal 0.6 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.3 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.6 +variable skin equal ${rhi} +variable skin equal 0.6 + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable kn equal 10^5 +variable kt equal 0.2*${kn} +variable kt equal 0.2*100000 + +variable gravity equal 1.0 +variable density equal 1.0 + +variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 +variable a equal (-2.0*log(${coeffRes})/PI)^2 +variable a equal (-2.0*log(0.1)/PI)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 806.699778405191*0.5 + +variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) + +variable dt equal ${tcol}*0.02 +variable dt equal 0.00236257621510454*0.02 +timestep ${dt} +timestep 4.72515243020908e-05 + +############################################### + +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton on +atom_style sphere + +boundary p p f + +region boxreg block 0 20 0 20 0 20 +create_box 1 boxreg +Created orthogonal box = (0 0 0) to (20 20 20) + 1 by 2 by 2 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.6 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 20, bins = 1 1 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton on, size, history + pair build: half/size/multi/newton + stencil: half/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +region insreg cylinder z 10 10 8 10 18 side in units box +region cylreg cylinder z 10 10 10 0 20 side in units box + +variable theta equal (step/400000)*2*PI + +region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box +region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box + +region mixer intersect 3 cylreg b1 b2 side in + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + +fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer + +fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 +Particle insertion: 444 every 84653 steps, 1000 by step 169307 + +#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke v_theta +WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) +thermo_modify flush yes lost warn + +run 200000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.816 | 5.816 | 5.816 Mbytes + Step CPU Atoms KinEng v_theta + 0 0 0 -0 0 + 1000 0.089993907 444 -0 0.015707963 + 2000 0.14885989 444 -0 0.031415927 + 3000 0.20954563 444 -0 0.04712389 + 4000 0.27002257 444 -0 0.062831853 + 5000 0.33034347 444 -0 0.078539816 + 6000 0.39049526 444 -0 0.09424778 + 7000 0.45002664 444 -0 0.10995574 + 8000 0.50911338 444 -0 0.12566371 + 9000 0.56771745 444 -0 0.14137167 + 10000 0.62699472 444 -0 0.15707963 + 11000 0.67300351 444 -0 0.1727876 + 12000 0.71981356 444 -0 0.18849556 + 13000 0.76697682 444 -0 0.20420352 + 14000 0.81412229 444 -0 0.21991149 + 15000 0.86284749 444 -0 0.23561945 + 16000 0.91199522 444 -0 0.25132741 + 17000 0.96230663 444 -0 0.26703538 + 18000 1.0118327 444 -0 0.28274334 + 19000 1.0617397 444 -0 0.2984513 + 20000 1.111586 444 -0 0.31415927 + 21000 1.1556637 444 -0 0.32986723 + 22000 1.2005913 444 -0 0.34557519 + 23000 1.2455061 444 -0 0.36128316 + 24000 1.2910181 444 -0 0.37699112 + 25000 1.3370577 444 -0 0.39269908 + 26000 1.383595 444 -0 0.40840704 + 27000 1.430922 444 -0 0.42411501 + 28000 1.478627 444 -0 0.43982297 + 29000 1.5278607 444 -0 0.45553093 + 30000 1.576597 444 -0 0.4712389 + 31000 1.6202694 444 -0 0.48694686 + 32000 1.6646667 444 -0 0.50265482 + 33000 1.7092726 444 -0 0.51836279 + 34000 1.7535573 444 -0 0.53407075 + 35000 1.7985995 444 -0 0.54977871 + 36000 1.8440346 444 -0 0.56548668 + 37000 1.8900841 444 -0 0.58119464 + 38000 1.9368772 444 -0 0.5969026 + 39000 1.9842867 444 -0 0.61261057 + 40000 2.0318482 444 -0 0.62831853 + 41000 2.0753049 444 -0 0.64402649 + 42000 2.1196274 444 -0 0.65973446 + 43000 2.1647071 444 -0 0.67544242 + 44000 2.2101195 444 -0 0.69115038 + 45000 2.2564642 444 -0 0.70685835 + 46000 2.3033573 444 -0 0.72256631 + 47000 2.3500515 444 -0 0.73827427 + 48000 2.3972268 444 -0 0.75398224 + 49000 2.4444727 444 -0 0.7696902 + 50000 2.4921003 444 -0 0.78539816 + 51000 2.535088 444 -0 0.80110613 + 52000 2.5785564 444 -0 0.81681409 + 53000 2.6221392 444 -0 0.83252205 + 54000 2.6664169 444 -0 0.84823002 + 55000 2.7108951 444 -0 0.86393798 + 56000 2.7560522 444 -0 0.87964594 + 57000 2.8010254 444 -0 0.89535391 + 58000 2.8484456 444 -0 0.91106187 + 59000 2.8951674 444 -0 0.92676983 + 60000 2.9424205 444 -0 0.9424778 + 61000 2.9885999 444 -0 0.95818576 + 62000 3.0338676 444 -0 0.97389372 + 63000 3.0793674 444 -0 0.98960169 + 64000 3.1253557 444 -0 1.0053096 + 65000 3.1723823 444 -0 1.0210176 + 66000 3.2203846 444 -0 1.0367256 + 67000 3.2690443 444 -0 1.0524335 + 68000 3.317707 444 -0 1.0681415 + 69000 3.3670196 444 -0 1.0838495 + 70000 3.4160505 444 -0 1.0995574 + 71000 3.4621197 444 -0 1.1152654 + 72000 3.5086434 444 -0 1.1309734 + 73000 3.555691 444 -0 1.1466813 + 74000 3.6032072 444 -0 1.1623893 + 75000 3.6514849 444 -0 1.1780972 + 76000 3.7002713 444 -0 1.1938052 + 77000 3.7497321 444 -0 1.2095132 + 78000 3.7997711 444 -0 1.2252211 + 79000 3.8504338 444 -0 1.2409291 + 80000 3.9020416 444 -0 1.2566371 + 81000 3.9496762 444 -0 1.272345 + 82000 3.9968215 444 -0 1.288053 + 83000 4.04496 444 -0 1.303761 + 84000 4.0936477 444 -0 1.3194689 + 85000 4.1618384 888 -0 1.3351769 + 86000 4.2472086 888 -0 1.3508848 + 87000 4.3322855 888 -0 1.3665928 + 88000 4.4169835 888 -0 1.3823008 + 89000 4.5014588 888 -0 1.3980087 + 90000 4.5861842 888 -0 1.4137167 + 91000 4.653654 888 -0 1.4294247 + 92000 4.7217642 888 -0 1.4451326 + 93000 4.791842 888 -0 1.4608406 + 94000 4.8601789 888 -0 1.4765485 + 95000 4.92849 888 -0 1.4922565 + 96000 4.9976811 888 -0 1.5079645 + 97000 5.0687073 888 -0 1.5236724 + 98000 5.1387234 888 -0 1.5393804 + 99000 5.2086037 888 -0 1.5550884 + 100000 5.2786924 888 -0 1.5707963 + 101000 5.3466895 888 -0 1.5865043 + 102000 5.417132 888 -0 1.6022123 + 103000 5.4865633 888 -0 1.6179202 + 104000 5.5565911 888 -0 1.6336282 + 105000 5.6266394 888 -0 1.6493361 + 106000 5.6975394 888 -0 1.6650441 + 107000 5.7687753 888 -0 1.6807521 + 108000 5.8408498 888 -0 1.69646 + 109000 5.9132618 888 -0 1.712168 + 110000 5.9872629 888 -0 1.727876 + 111000 6.0588115 888 -0 1.7435839 + 112000 6.1308729 888 -0 1.7592919 + 113000 6.2047311 888 -0 1.7749998 + 114000 6.2780757 888 -0 1.7907078 + 115000 6.3528542 888 -0 1.8064158 + 116000 6.4277704 888 -0 1.8221237 + 117000 6.5034683 888 -0 1.8378317 + 118000 6.5795779 888 -0 1.8535397 + 119000 6.655928 888 -0 1.8692476 + 120000 6.7335119 888 -0 1.8849556 + 121000 6.806827 888 -0 1.9006636 + 122000 6.881052 888 -0 1.9163715 + 123000 6.9559647 888 -0 1.9320795 + 124000 7.0300829 888 -0 1.9477874 + 125000 7.1047925 888 -0 1.9634954 + 126000 7.1797025 888 -0 1.9792034 + 127000 7.2556934 888 -0 1.9949113 + 128000 7.3317803 888 -0 2.0106193 + 129000 7.4088096 888 -0 2.0263273 + 130000 7.4862461 888 -0 2.0420352 + 131000 7.5633585 888 -0 2.0577432 + 132000 7.641939 888 -0 2.0734512 + 133000 7.7192741 888 -0 2.0891591 + 134000 7.7970156 888 -0 2.1048671 + 135000 7.8760712 888 -0 2.120575 + 136000 7.9563099 888 -0 2.136283 + 137000 8.0381808 888 -0 2.151991 + 138000 8.1210957 888 -0 2.1676989 + 139000 8.20401 888 -0 2.1834069 + 140000 8.2871705 888 -0 2.1991149 + 141000 8.364321 888 -0 2.2148228 + 142000 8.4426744 888 -0 2.2305308 + 143000 8.5238377 888 -0 2.2462387 + 144000 8.6050517 888 -0 2.2619467 + 145000 8.6865872 888 -0 2.2776547 + 146000 8.767621 888 -0 2.2933626 + 147000 8.8496616 888 -0 2.3090706 + 148000 8.9329599 888 -0 2.3247786 + 149000 9.0165929 888 -0 2.3404865 + 150000 9.1015214 888 -0 2.3561945 + 151000 9.1847289 888 -0 2.3719025 + 152000 9.2689185 888 -0 2.3876104 + 153000 9.3518862 888 -0 2.4033184 + 154000 9.4367057 888 -0 2.4190263 + 155000 9.5227466 888 -0 2.4347343 + 156000 9.6087196 888 -0 2.4504423 + 157000 9.6955661 888 -0 2.4661502 + 158000 9.7838227 888 -0 2.4818582 + 159000 9.8731804 888 -0 2.4975662 + 160000 9.9626648 888 -0 2.5132741 + 161000 10.050473 888 -0 2.5289821 + 162000 10.137725 888 -0 2.54469 + 163000 10.227259 888 -0 2.560398 + 164000 10.318501 888 -0 2.576106 + 165000 10.409218 888 -0 2.5918139 + 166000 10.502055 888 -0 2.6075219 + 167000 10.593786 888 -0 2.6232299 + 168000 10.688536 888 -0 2.6389378 + 169000 10.786033 888 -0 2.6546458 + 170000 10.886377 1000 -0 2.6703538 + 171000 10.987493 1000 -0 2.6860617 + 172000 11.084584 1000 -0 2.7017697 + 173000 11.181502 1000 -0 2.7174776 + 174000 11.28434 1000 -0 2.7331856 + 175000 11.387838 1000 -0 2.7488936 + 176000 11.490915 1000 -0 2.7646015 + 177000 11.595473 1000 -0 2.7803095 + 178000 11.699823 1000 -0 2.7960175 + 179000 11.803927 1000 -0 2.8117254 + 180000 11.90548 1000 -0 2.8274334 + 181000 12.00857 1000 -0 2.8431414 + 182000 12.112787 1000 -0 2.8588493 + 183000 12.217943 1000 -0 2.8745573 + 184000 12.322668 1000 -0 2.8902652 + 185000 12.428332 1000 -0 2.9059732 + 186000 12.535414 1000 -0 2.9216812 + 187000 12.642404 1000 -0 2.9373891 + 188000 12.749332 1000 -0 2.9530971 + 189000 12.856872 1000 -0 2.9688051 + 190000 12.965335 1000 -0 2.984513 + 191000 13.073275 1000 -0 3.000221 + 192000 13.180122 1000 -0 3.0159289 + 193000 13.288112 1000 -0 3.0316369 + 194000 13.394688 1000 -0 3.0473449 + 195000 13.501251 1000 -0 3.0630528 + 196000 13.607472 1000 -0 3.0787608 + 197000 13.71396 1000 -0 3.0944688 + 198000 13.821133 1000 -0 3.1101767 + 199000 13.929192 1000 -0 3.1258847 + 200000 14.036724 1000 -0 3.1415927 +Loop time of 14.0368 on 4 procs for 200000 steps with 1000 atoms + +Performance: 58169.166 tau/day, 14248.307 timesteps/s, 14.248 Matom-step/s +95.5% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.47004 | 0.75698 | 1.1 | 33.1 | 5.39 +Neigh | 0.0078501 | 0.010659 | 0.013902 | 2.7 | 0.08 +Comm | 3.9589 | 4.4102 | 4.9322 | 21.6 | 31.42 +Output | 0.0031054 | 0.0046208 | 0.0069341 | 2.1 | 0.03 +Modify | 6.1829 | 6.8363 | 7.6135 | 24.8 | 48.70 +Other | | 2.018 | | | 14.38 + +Nlocal: 250 ave 260 max 242 min +Histogram: 1 0 1 0 0 1 0 0 0 1 +Nghost: 279.25 ave 325 max 232 min +Histogram: 1 1 0 0 0 0 0 0 1 1 +Neighs: 939.75 ave 1397 max 509 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 3759 +Ave neighs/atom = 3.759 +Neighbor list builds = 201 +Dangerous builds = 0 +unfix ins +run 200000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 11.87 | 11.88 | 11.89 Mbytes + Step CPU Atoms KinEng v_theta + 200000 0 1000 1.0071568 3.1415927 + 201000 0.099357585 1000 1.0036239 3.1573006 + 202000 0.19922889 1000 0.99846844 3.1730086 + 203000 0.29896537 1000 0.98236169 3.1887165 + 204000 0.39875771 1000 0.98625572 3.2044245 + 205000 0.49759454 1000 0.9893407 3.2201325 + 206000 0.59609243 1000 1.0012123 3.2358404 + 207000 0.69408206 1000 1.0231892 3.2515484 + 208000 0.79216806 1000 1.0265912 3.2672564 + 209000 0.8902274 1000 1.0190202 3.2829643 + 210000 0.98909509 1000 1.0267754 3.2986723 + 211000 1.0882901 1000 1.0186847 3.3143802 + 212000 1.1895753 1000 1.0159848 3.3300882 + 213000 1.2891277 1000 0.99326329 3.3457962 + 214000 1.387486 1000 0.97263135 3.3615041 + 215000 1.4850078 1000 0.97246409 3.3772121 + 216000 1.58405 1000 0.96000626 3.3929201 + 217000 1.6853829 1000 0.95730432 3.408628 + 218000 1.7911163 1000 0.95605591 3.424336 + 219000 1.8974141 1000 0.94983 3.440044 + 220000 2.0029829 1000 0.95291888 3.4557519 + 221000 2.108723 1000 0.93612997 3.4714599 + 222000 2.2151561 1000 0.93414081 3.4871678 + 223000 2.3220866 1000 0.93321246 3.5028758 + 224000 2.4285504 1000 0.93026943 3.5185838 + 225000 2.5356173 1000 0.930478 3.5342917 + 226000 2.6415516 1000 0.92909096 3.5499997 + 227000 2.747634 1000 0.92308495 3.5657077 + 228000 2.8524082 1000 0.91075986 3.5814156 + 229000 2.9570172 1000 0.9006662 3.5971236 + 230000 3.0627535 1000 0.88869212 3.6128316 + 231000 3.1683919 1000 0.8877611 3.6285395 + 232000 3.2749534 1000 0.89409636 3.6442475 + 233000 3.3824185 1000 0.90866091 3.6599554 + 234000 3.4917899 1000 0.90454601 3.6756634 + 235000 3.6009156 1000 0.89408327 3.6913714 + 236000 3.7111309 1000 0.8881044 3.7070793 + 237000 3.8197619 1000 0.89322168 3.7227873 + 238000 3.9302291 1000 0.89018045 3.7384953 + 239000 4.0407242 1000 0.88771268 3.7542032 + 240000 4.1521989 1000 0.88957717 3.7699112 + 241000 4.2639861 1000 0.89362036 3.7856191 + 242000 4.3782856 1000 0.90967472 3.8013271 + 243000 4.4925107 1000 0.91366381 3.8170351 + 244000 4.6057342 1000 0.9150959 3.832743 + 245000 4.7199383 1000 0.92725789 3.848451 + 246000 4.8346784 1000 0.93024722 3.864159 + 247000 4.9515438 1000 0.93297974 3.8798669 + 248000 5.0696512 1000 0.94755869 3.8955749 + 249000 5.1838845 1000 0.94761679 3.9112829 + 250000 5.297991 1000 0.92701064 3.9269908 + 251000 5.412562 1000 0.91365252 3.9426988 + 252000 5.5274859 1000 0.90918381 3.9584067 + 253000 5.6418647 1000 0.90612685 3.9741147 + 254000 5.7593721 1000 0.90352142 3.9898227 + 255000 5.8759086 1000 0.90421567 4.0055306 + 256000 5.993588 1000 0.90024688 4.0212386 + 257000 6.1142027 1000 0.88540341 4.0369466 + 258000 6.2318882 1000 0.87890423 4.0526545 + 259000 6.3502765 1000 0.86833748 4.0683625 + 260000 6.4677878 1000 0.85465694 4.0840704 + 261000 6.5875341 1000 0.83941242 4.0997784 + 262000 6.7063481 1000 0.81790404 4.1154864 + 263000 6.8249742 1000 0.82284562 4.1311943 + 264000 6.9421188 1000 0.80961447 4.1469023 + 265000 7.0588866 1000 0.80567073 4.1626103 + 266000 7.1763855 1000 0.79577448 4.1783182 + 267000 7.295632 1000 0.78489106 4.1940262 + 268000 7.4144463 1000 0.77348757 4.2097342 + 269000 7.5333839 1000 0.76606696 4.2254421 + 270000 7.6527119 1000 0.7649744 4.2411501 + 271000 7.7704222 1000 0.76050309 4.256858 + 272000 7.8903012 1000 0.75378759 4.272566 + 273000 8.0106197 1000 0.75633811 4.288274 + 274000 8.1309707 1000 0.75703106 4.3039819 + 275000 8.2522837 1000 0.75227453 4.3196899 + 276000 8.3730898 1000 0.76003902 4.3353979 + 277000 8.4955037 1000 0.76274661 4.3511058 + 278000 8.6153206 1000 0.75888482 4.3668138 + 279000 8.7339569 1000 0.75071875 4.3825218 + 280000 8.8515447 1000 0.75454927 4.3982297 + 281000 8.9685253 1000 0.75617824 4.4139377 + 282000 9.0856168 1000 0.75230835 4.4296456 + 283000 9.2018894 1000 0.75417571 4.4453536 + 284000 9.3179777 1000 0.74559345 4.4610616 + 285000 9.4341721 1000 0.73274661 4.4767695 + 286000 9.5498722 1000 0.72385193 4.4924775 + 287000 9.6651326 1000 0.72398899 4.5081855 + 288000 9.7810274 1000 0.72009027 4.5238934 + 289000 9.8959471 1000 0.72026686 4.5396014 + 290000 10.010007 1000 0.72330145 4.5553093 + 291000 10.123304 1000 0.71630656 4.5710173 + 292000 10.238277 1000 0.71089192 4.5867253 + 293000 10.351465 1000 0.70584923 4.6024332 + 294000 10.464794 1000 0.71350398 4.6181412 + 295000 10.57818 1000 0.72781836 4.6338492 + 296000 10.692249 1000 0.72285512 4.6495571 + 297000 10.80741 1000 0.71649517 4.6652651 + 298000 10.923694 1000 0.71132209 4.6809731 + 299000 11.039173 1000 0.73602072 4.696681 + 300000 11.157002 1000 0.74400837 4.712389 + 301000 11.272462 1000 0.76618562 4.7280969 + 302000 11.386581 1000 0.77476041 4.7438049 + 303000 11.499191 1000 0.77124283 4.7595129 + 304000 11.611585 1000 0.7625748 4.7752208 + 305000 11.725012 1000 0.74979361 4.7909288 + 306000 11.838032 1000 0.74515733 4.8066368 + 307000 11.949194 1000 0.74302741 4.8223447 + 308000 12.060586 1000 0.73732959 4.8380527 + 309000 12.171445 1000 0.73368237 4.8537606 + 310000 12.283518 1000 0.72374292 4.8694686 + 311000 12.393447 1000 0.72107784 4.8851766 + 312000 12.505136 1000 0.72944426 4.9008845 + 313000 12.616959 1000 0.73958637 4.9165925 + 314000 12.730312 1000 0.75160847 4.9323005 + 315000 12.846163 1000 0.74419683 4.9480084 + 316000 12.960328 1000 0.74652593 4.9637164 + 317000 13.073994 1000 0.74933482 4.9794244 + 318000 13.186549 1000 0.74200509 4.9951323 + 319000 13.296925 1000 0.7346024 5.0108403 + 320000 13.406825 1000 0.72806145 5.0265482 + 321000 13.51703 1000 0.72147888 5.0422562 + 322000 13.628261 1000 0.71460041 5.0579642 + 323000 13.74063 1000 0.70255075 5.0736721 + 324000 13.853826 1000 0.70640327 5.0893801 + 325000 13.968533 1000 0.70643428 5.1050881 + 326000 14.081456 1000 0.69751794 5.120796 + 327000 14.195505 1000 0.69035108 5.136504 + 328000 14.310048 1000 0.68068243 5.152212 + 329000 14.426048 1000 0.69123492 5.1679199 + 330000 14.543349 1000 0.70326515 5.1836279 + 331000 14.662021 1000 0.70551726 5.1993358 + 332000 14.782194 1000 0.70514444 5.2150438 + 333000 14.901573 1000 0.71102045 5.2307518 + 334000 15.020642 1000 0.71336747 5.2464597 + 335000 15.136739 1000 0.70816388 5.2621677 + 336000 15.252554 1000 0.69502472 5.2778757 + 337000 15.368496 1000 0.69314289 5.2935836 + 338000 15.483744 1000 0.68565794 5.3092916 + 339000 15.599584 1000 0.67268053 5.3249995 + 340000 15.717342 1000 0.68313196 5.3407075 + 341000 15.835594 1000 0.68782815 5.3564155 + 342000 15.954546 1000 0.6989326 5.3721234 + 343000 16.074184 1000 0.694926 5.3878314 + 344000 16.193902 1000 0.7006474 5.4035394 + 345000 16.314878 1000 0.70783177 5.4192473 + 346000 16.434704 1000 0.71334276 5.4349553 + 347000 16.554708 1000 0.72917419 5.4506633 + 348000 16.673034 1000 0.74315705 5.4663712 + 349000 16.791269 1000 0.76731311 5.4820792 + 350000 16.912554 1000 0.79761434 5.4977871 + 351000 17.03323 1000 0.80447724 5.5134951 + 352000 17.155644 1000 0.80118728 5.5292031 + 353000 17.281134 1000 0.77990459 5.544911 + 354000 17.406672 1000 0.76453299 5.560619 + 355000 17.532346 1000 0.76538392 5.576327 + 356000 17.657256 1000 0.76310698 5.5920349 + 357000 17.782477 1000 0.75897095 5.6077429 + 358000 17.909642 1000 0.75071115 5.6234508 + 359000 18.035032 1000 0.74034801 5.6391588 + 360000 18.160696 1000 0.72671924 5.6548668 + 361000 18.285089 1000 0.72111017 5.6705747 + 362000 18.408849 1000 0.71875181 5.6862827 + 363000 18.533901 1000 0.71469706 5.7019907 + 364000 18.659326 1000 0.70470493 5.7176986 + 365000 18.784109 1000 0.70863047 5.7334066 + 366000 18.911344 1000 0.70850561 5.7491146 + 367000 19.039756 1000 0.71413452 5.7648225 + 368000 19.169907 1000 0.71314184 5.7805305 + 369000 19.299066 1000 0.71309549 5.7962384 + 370000 19.428116 1000 0.71132937 5.8119464 + 371000 19.553027 1000 0.70788039 5.8276544 + 372000 19.678121 1000 0.71780071 5.8433623 + 373000 19.804465 1000 0.72352571 5.8590703 + 374000 19.92949 1000 0.71723739 5.8747783 + 375000 20.053554 1000 0.71556941 5.8904862 + 376000 20.177991 1000 0.70935312 5.9061942 + 377000 20.301972 1000 0.71551157 5.9219022 + 378000 20.427612 1000 0.7235163 5.9376101 + 379000 20.554742 1000 0.73896421 5.9533181 + 380000 20.680899 1000 0.74906169 5.969026 + 381000 20.805515 1000 0.75303336 5.984734 + 382000 20.931483 1000 0.75359492 6.000442 + 383000 21.05731 1000 0.75579354 6.0161499 + 384000 21.184712 1000 0.75178368 6.0318579 + 385000 21.310667 1000 0.74412159 6.0475659 + 386000 21.433509 1000 0.7360955 6.0632738 + 387000 21.554251 1000 0.73461103 6.0789818 + 388000 21.674477 1000 0.72496617 6.0946897 + 389000 21.794698 1000 0.7219047 6.1103977 + 390000 21.914083 1000 0.71837013 6.1261057 + 391000 22.033188 1000 0.71495923 6.1418136 + 392000 22.152689 1000 0.71436707 6.1575216 + 393000 22.271183 1000 0.71447834 6.1732296 + 394000 22.389775 1000 0.71334298 6.1889375 + 395000 22.509106 1000 0.71510229 6.2046455 + 396000 22.628068 1000 0.7121714 6.2203535 + 397000 22.746926 1000 0.70818894 6.2360614 + 398000 22.865086 1000 0.70059455 6.2517694 + 399000 22.982394 1000 0.69960089 6.2674773 + 400000 23.100381 1000 0.70261998 6.2831853 +Loop time of 23.1004 on 4 procs for 200000 steps with 1000 atoms + +Performance: 35345.963 tau/day, 8657.854 timesteps/s, 8.658 Matom-step/s +92.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.263 | 2.1388 | 3.0295 | 58.6 | 9.26 +Neigh | 0.012633 | 0.017793 | 0.023147 | 3.7 | 0.08 +Comm | 7.8521 | 9.0474 | 10.284 | 39.6 | 39.17 +Output | 0.0029549 | 0.004916 | 0.0068506 | 2.0 | 0.02 +Modify | 8.3635 | 9.8066 | 11.142 | 41.0 | 42.45 +Other | | 2.085 | | | 9.03 + +Nlocal: 250 ave 258 max 241 min +Histogram: 1 0 0 0 1 0 0 1 0 1 +Nghost: 412 ave 492 max 332 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 1258.5 ave 1588 max 953 min +Histogram: 2 0 0 0 0 0 0 0 1 1 + +Total # of neighbors = 5034 +Ave neighs/atom = 5.034 +Neighbor list builds = 159 +Dangerous builds = 0 +Total wall time: 0:00:37 diff --git a/examples/granregion/log.27Nov18.granregion.box.g++.1 b/examples/granregion/log.27Nov18.granregion.box.g++.1 deleted file mode 100644 index ef004b7398..0000000000 --- a/examples/granregion/log.27Nov18.granregion.box.g++.1 +++ /dev/null @@ -1,475 +0,0 @@ -LAMMPS (27 Nov 2018) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) - using 1 OpenMP thread(s) per MPI task -# pouring spheres into container box - -units lj -atom_style sphere -boundary f f f -dimension 3 -comm_modify vel yes - -region box block -10 10 -10 10 -10 10 units box -create_box 2 box -Created orthogonal box = (-10 -10 -10) to (10 10 10) - 1 by 1 by 1 MPI processor grid - -pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 -pair_coeff * * gran/hooke - -region container block -6 6 -6 6 -6 6 units box -fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 2 all nve/sphere -fix 3 all gravity 1.0 vector 0 0 -1 - -region slab block -2 2 -2 2 -2 2 units box -fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore -Particle insertion: 48 every 566 steps, 100 by step 1133 - -timestep 0.005 - -compute 1 all temp -compute_modify 1 dynamic/dof yes - -compute 2 all temp/sphere -compute_modify 2 dynamic/dof yes - -thermo 100 -thermo_style custom step atoms temp c_1 c_2 press -thermo_modify lost ignore -compute_modify thermo_temp dynamic/dof yes - -#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 -#dump_modify 2 pad 5 - -run 5000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 31 31 31 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke, perpetual - attributes: half, newton on, size - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 0.5855 | 0.5855 | 0.5855 Mbytes -Step Atoms Temp c_1 c_2 Press - 0 0 0 0 0 0 - 100 21 0.54270729 0.54270729 0.26473526 0.0013567682 - 200 21 0.87606961 0.87606961 0.42735103 0.002190174 - 300 21 1.1428374 1.1428374 0.55748167 0.0028570936 - 400 21 1.3543103 1.3543103 0.66829516 0.0033857758 - 500 21 1.0677786 1.0677786 0.53582407 0.0045048164 - 600 56 0.6744286 0.6744286 0.3502938 0.0047464584 - 700 56 0.75569283 0.75569283 0.39779462 0.0051953882 - 800 56 0.61597505 0.61597505 0.32943642 0.0086022783 - 900 56 0.65260802 0.65260802 0.34474044 0.0059298996 - 1000 56 0.51624952 0.51624952 0.28326898 0.0067827337 - 1100 56 0.46050076 0.46050076 0.25656319 0.0061891094 - 1200 81 0.39112346 0.39112346 0.21690172 0.0086559316 - 1300 81 0.33302617 0.33302617 0.19109398 0.0033381104 - 1400 81 0.3933533 0.3933533 0.21221692 0.004135078 - 1500 81 0.35495297 0.35495297 0.19925984 0.0037374946 - 1600 81 0.34150606 0.34150606 0.19025811 0.0053492835 - 1700 100 0.2561647 0.2561647 0.14186278 0.0090767057 - 1800 100 0.21124278 0.21124278 0.12154878 0.0028545759 - 1900 100 0.21793955 0.21793955 0.12173867 0.0029049155 - 2000 100 0.25530858 0.25530858 0.13892272 0.0035528009 - 2100 100 0.24671808 0.24671808 0.13687783 0.0076812435 - 2200 100 0.22465216 0.22465216 0.12513603 0.0042528715 - 2300 100 0.19362854 0.19362854 0.10914305 0.0061173739 - 2400 100 0.061627608 0.061627608 0.045907717 0.0010422721 - 2500 100 0.052700901 0.052700901 0.038883014 0.0019341647 - 2600 100 0.037332018 0.037332018 0.028357146 0.0028364476 - 2700 100 0.033526602 0.033526602 0.024609055 0.00044524562 - 2800 100 0.0194148 0.0194148 0.014491377 0.00056526591 - 2900 100 0.012346108 0.012346108 0.009857017 0.00081855699 - 3000 100 0.0107344 0.0107344 0.008669364 0.00040371396 - 3100 100 0.0092678291 0.0092678291 0.0073003108 0.00033287397 - 3200 100 0.0085847001 0.0085847001 0.0064045591 0.00023253547 - 3300 100 0.0049475182 0.0049475182 0.0041173627 0.00019876269 - 3400 100 0.0030471097 0.0030471097 0.0026940466 0.00013462604 - 3500 100 0.0031188371 0.0031188371 0.002612223 0.00026148578 - 3600 100 0.0017616584 0.0017616584 0.0017464137 0.00019049724 - 3700 100 0.0015475923 0.0015475923 0.0015560356 0.00025062814 - 3800 100 0.0012547887 0.0012547887 0.0012622678 0.00014132236 - 3900 100 0.0010047282 0.0010047282 0.0010379262 9.7665594e-05 - 4000 100 0.00080895307 0.00080895307 0.00088263027 8.1278842e-05 - 4100 100 0.00079078739 0.00079078739 0.00085810727 8.1271694e-05 - 4200 100 0.00075192318 0.00075192318 0.00083085046 8.9352453e-05 - 4300 100 0.00063546457 0.00063546457 0.00073222177 8.9264255e-05 - 4400 100 0.00062398391 0.00062398391 0.00071312118 8.4200615e-05 - 4500 100 0.00056464934 0.00056464934 0.00066087801 9.2097641e-05 - 4600 100 0.00066951894 0.00066951894 0.00071633313 8.2457941e-05 - 4700 100 0.001128837 0.001128837 0.00095293877 0.00011716361 - 4800 100 0.00049580391 0.00049580391 0.00056710488 0.00010718794 - 4900 100 0.00054374371 0.00054374371 0.00058671699 5.6580257e-05 - 5000 100 0.00043016232 0.00043016232 0.00050264172 2.8640786e-05 -Loop time of 0.0807264 on 1 procs for 5000 steps with 100 atoms - -Performance: 26757050.955 tau/day, 61937.618 timesteps/s -97.4% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0089066 | 0.0089066 | 0.0089066 | 0.0 | 11.03 -Neigh | 0.017107 | 0.017107 | 0.017107 | 0.0 | 21.19 -Comm | 0.00091505 | 0.00091505 | 0.00091505 | 0.0 | 1.13 -Output | 0.00051451 | 0.00051451 | 0.00051451 | 0.0 | 0.64 -Modify | 0.047671 | 0.047671 | 0.047671 | 0.0 | 59.05 -Other | | 0.005612 | | | 6.95 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 158 ave 158 max 158 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 158 -Ave neighs/atom = 1.58 -Neighbor list builds = 310 -Dangerous builds = 0 - -region container delete -variable theta equal (step-5000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.836 | 5.836 | 5.836 Mbytes -Step Atoms Temp c_1 c_2 Press - 5000 100 0.00043016232 0.00043016232 0.00050264172 2.8677624e-05 - 5100 100 0.56489668 0.56489668 0.31137762 0.011848041 - 5200 100 0.66068288 0.66068288 0.35915482 0.010199755 - 5300 100 0.74068022 0.74068022 0.39643217 0.010806409 - 5400 100 0.80913562 0.80913562 0.42748505 0.01190892 - 5500 100 0.89409135 0.89409135 0.46135116 0.013093474 - 5600 100 0.97585093 0.97585093 0.50021126 0.013588886 - 5700 100 1.0151954 1.0151954 0.5174624 0.01601347 - 5800 100 1.0452728 1.0452728 0.53122496 0.01879329 - 5900 100 1.0881689 1.0881689 0.55152229 0.017120714 - 6000 100 1.1133186 1.1133186 0.5638022 0.017284617 - 6100 100 1.1532099 1.1532099 0.58310076 0.017031384 - 6200 100 1.1798849 1.1798849 0.5959516 0.017971323 - 6300 100 1.19387 1.19387 0.60173877 0.020140984 - 6400 100 1.2126705 1.2126705 0.61086899 0.018426638 - 6500 100 1.2137646 1.2137646 0.61284198 0.019127381 - 6600 100 1.2339012 1.2339012 0.62199324 0.019378799 - 6700 100 1.2439326 1.2439326 0.62488425 0.021049447 - 6800 100 1.2489549 1.2489549 0.6278167 0.019552409 - 6900 100 1.2733303 1.2733303 0.63898149 0.020237284 - 7000 100 1.2835029 1.2835029 0.6440245 0.020798586 - 7100 100 1.2866111 1.2866111 0.64522896 0.020355019 - 7200 100 1.2886381 1.2886381 0.6467497 0.02062322 - 7300 100 1.2885085 1.2885085 0.64617988 0.020350755 - 7400 100 1.2912349 1.2912349 0.64691898 0.020197503 - 7500 100 1.2963062 1.2963062 0.64926335 0.020349791 - 7600 100 1.3016488 1.3016488 0.65150178 0.021001457 - 7700 100 1.3009311 1.3009311 0.65106234 0.021546471 - 7800 100 1.3016987 1.3016987 0.65143099 0.020994967 - 7900 100 1.3028811 1.3028811 0.65164558 0.022200425 - 8000 100 1.3087855 1.3087855 0.65439023 0.021310808 - 8100 100 1.3102001 1.3102001 0.65514941 0.021177764 - 8200 100 1.3133931 1.3133931 0.65681861 0.021591267 - 8300 100 1.3148898 1.3148898 0.65775353 0.021335384 - 8400 100 1.3160355 1.3160355 0.65845913 0.021238095 - 8500 100 1.3171797 1.3171797 0.65934185 0.021172983 - 8600 100 1.3176785 1.3176785 0.65964311 0.020747457 - 8700 100 1.3180425 1.3180425 0.66019624 0.021275913 - 8800 100 1.3287501 1.3287501 0.66444242 0.021832635 - 8900 100 1.3249847 1.3249847 0.6625848 0.021337451 - 9000 100 1.326216 1.326216 0.66297827 0.021470663 - 9100 100 1.3261662 1.3261662 0.66303852 0.021423573 - 9200 100 1.3312132 1.3312132 0.6653609 0.021385943 - 9300 100 1.3300976 1.3300976 0.66504574 0.021489888 - 9400 100 1.3377335 1.3377335 0.66820989 0.021565001 - 9500 100 1.3421956 1.3421956 0.67027168 0.022402346 - 9600 100 1.3464217 1.3464217 0.67228206 0.021991922 - 9700 100 1.3470623 1.3470623 0.67258349 0.022035729 - 9800 100 1.3446725 1.3446725 0.67135725 0.022295251 - 9900 100 1.343146 1.343146 0.67066672 0.022049041 - 10000 100 1.3435397 1.3435397 0.67093067 0.022451365 -Loop time of 0.247549 on 1 procs for 5000 steps with 100 atoms - -Performance: 8725560.044 tau/day, 20198.056 timesteps/s -99.4% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.031783 | 0.031783 | 0.031783 | 0.0 | 12.84 -Neigh | 0.038383 | 0.038383 | 0.038383 | 0.0 | 15.51 -Comm | 0.0012343 | 0.0012343 | 0.0012343 | 0.0 | 0.50 -Output | 0.00056028 | 0.00056028 | 0.00056028 | 0.0 | 0.23 -Modify | 0.1687 | 0.1687 | 0.1687 | 0.0 | 68.15 -Other | | 0.00689 | | | 2.78 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 199 ave 199 max 199 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 199 -Ave neighs/atom = 1.99 -Neighbor list builds = 621 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.836 | 5.836 | 5.836 Mbytes -Step Atoms Temp c_1 c_2 Press - 10000 100 1.3435397 1.3435397 0.67093067 0.022411116 - 10100 100 0.31352763 0.31352763 0.18877908 0.01321582 - 10200 100 0.13367611 0.13367611 0.090010637 0.0074171016 - 10300 100 0.068195658 0.068195658 0.052632714 0.0019696287 - 10400 100 0.053814936 0.053814936 0.043037586 0.0017121584 - 10500 100 0.04032072 0.04032072 0.032944572 0.0011809154 - 10600 100 0.029178161 0.029178161 0.023951873 0.0007804529 - 10700 100 0.025978206 0.025978206 0.021045025 0.00099531465 - 10800 100 0.023205036 0.023205036 0.01898502 0.00040036401 - 10900 100 0.019994638 0.019994638 0.016451227 0.00027385559 - 11000 100 0.017838131 0.017838131 0.014730762 0.00040399762 - 11100 100 0.014863196 0.014863196 0.012314308 0.00019097464 - 11200 100 0.012131256 0.012131256 0.010102122 0.00018514926 - 11300 100 0.010881385 0.010881385 0.0090013541 0.00016579157 - 11400 100 0.0076519814 0.0076519814 0.0064604568 0.00035399997 - 11500 100 0.0067507315 0.0067507315 0.0057378868 0.00049116726 - 11600 100 0.0053146649 0.0053146649 0.0047005938 0.00019625233 - 11700 100 0.0044162463 0.0044162463 0.0039534657 0.00012548039 - 11800 100 0.0037025387 0.0037025387 0.0033604103 6.2969827e-05 - 11900 100 0.0032632211 0.0032632211 0.0030406641 8.1600622e-05 - 12000 100 0.0028944057 0.0028944057 0.0026875858 6.6435833e-05 - 12100 100 0.0027644728 0.0027644728 0.0025859762 5.5899271e-05 - 12200 100 0.002480367 0.002480367 0.0023685117 6.0201418e-05 - 12300 100 0.0024136475 0.0024136475 0.0023107986 4.4386874e-05 - 12400 100 0.0021911567 0.0021911567 0.0021413262 5.0213175e-05 - 12500 100 0.0019775905 0.0019775905 0.0019927698 0.00035250097 - 12600 100 0.0017410363 0.0017410363 0.001830428 5.7885177e-05 - 12700 100 0.0015749276 0.0015749276 0.0016816771 4.5530192e-05 - 12800 100 0.0015187705 0.0015187705 0.0016218625 4.0589413e-05 - 12900 100 0.0014778376 0.0014778376 0.001580232 4.0085455e-05 - 13000 100 0.0014693491 0.0014693491 0.0015681809 4.0407656e-05 - 13100 100 0.0014434495 0.0014434495 0.0015356278 5.7849212e-05 - 13200 100 0.0014121959 0.0014121959 0.0015058758 3.2720737e-05 - 13300 100 0.0012876041 0.0012876041 0.0013838998 3.7725702e-05 - 13400 100 0.0012304951 0.0012304951 0.0013373457 3.6784546e-05 - 13500 100 0.0011954303 0.0011954303 0.0012877627 3.6584963e-05 - 13600 100 0.0011028947 0.0011028947 0.0011955404 2.3767582e-05 - 13700 100 0.0010611762 0.0010611762 0.0011504675 3.485879e-05 - 13800 100 0.0010080835 0.0010080835 0.0010997919 3.7905404e-05 - 13900 100 0.00096495712 0.00096495712 0.0010530767 3.5273885e-05 - 14000 100 0.00094945029 0.00094945029 0.0010409175 3.3718395e-05 - 14100 100 0.00092386757 0.00092386757 0.0010217415 3.3313256e-05 - 14200 100 0.00088928389 0.00088928389 0.000983023 3.290941e-05 - 14300 100 0.00082696485 0.00082696485 0.00092690771 3.1651431e-05 - 14400 100 0.00081086188 0.00081086188 0.00091681096 3.1845632e-05 - 14500 100 0.00077732305 0.00077732305 0.00087592983 4.8087361e-05 - 14600 100 0.00073386005 0.00073386005 0.00082546873 3.0892065e-05 - 14700 100 0.00068701098 0.00068701098 0.00075953521 0.00010208859 - 14800 100 0.00065860451 0.00065860451 0.00073738846 2.9272912e-05 - 14900 100 0.00064706564 0.00064706564 0.00072748391 2.9817955e-05 - 15000 100 0.00064227996 0.00064227996 0.00070964586 3.2547768e-05 -Loop time of 0.0840213 on 1 procs for 5000 steps with 100 atoms - -Performance: 25707757.817 tau/day, 59508.699 timesteps/s -98.2% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.01004 | 0.01004 | 0.01004 | 0.0 | 11.95 -Neigh | 0.0057366 | 0.0057366 | 0.0057366 | 0.0 | 6.83 -Comm | 0.00086808 | 0.00086808 | 0.00086808 | 0.0 | 1.03 -Output | 0.00049472 | 0.00049472 | 0.00049472 | 0.0 | 0.59 -Modify | 0.060893 | 0.060893 | 0.060893 | 0.0 | 72.47 -Other | | 0.005989 | | | 7.13 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 151 ave 151 max 151 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 151 -Ave neighs/atom = 1.51 -Neighbor list builds = 92 -Dangerous builds = 0 - -region container delete -variable theta equal (step-15000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.836 | 5.836 | 5.836 Mbytes -Step Atoms Temp c_1 c_2 Press - 15000 100 0.00064227996 0.00064227996 0.00070964586 3.2291286e-05 - 15100 100 0.81230775 0.81230775 0.53266834 0.010948517 - 15200 100 0.87957637 0.87957637 0.57559572 0.012401402 - 15300 100 1.0262431 1.0262431 0.66535656 0.015239294 - 15400 100 1.2863564 1.2863564 0.82026439 0.020115365 - 15500 100 1.4721549 1.4721549 0.92138954 0.022400442 - 15600 100 1.7140429 1.7140429 1.0103822 0.02558084 - 15700 100 1.8963287 1.8963287 1.0916756 0.032032318 - 15800 100 2.0741177 2.0741177 1.1706233 0.034251942 - 15900 100 2.1434733 2.1434733 1.2054242 0.030132271 - 16000 100 2.1409892 2.1409892 1.2019761 0.030914205 - 16100 100 2.2496058 2.2496058 1.2476438 0.030939743 - 16200 100 2.233356 2.233356 1.2499888 0.030097445 - 16300 100 2.2673491 2.2673491 1.272321 0.030968524 - 16400 100 2.3735648 2.3735648 1.3126117 0.034532377 - 16500 100 2.4510087 2.4510087 1.3588349 0.036685351 - 16600 100 2.497406 2.497406 1.3811443 0.032019982 - 16700 100 2.6800518 2.6800518 1.4661941 0.037455527 - 16800 100 2.8673997 2.8673997 1.5558303 0.03606532 - 16900 100 3.1229488 3.1229488 1.6918439 0.039753213 - 17000 100 3.117815 3.117815 1.6996841 0.046210837 - 17100 100 3.3336225 3.3336225 1.7834517 0.047865361 - 17200 100 3.1773164 3.1773164 1.7113961 0.047778334 - 17300 100 3.4336759 3.4336759 1.8343073 0.049673718 - 17400 100 3.3142326 3.3142326 1.7796613 0.055329946 - 17500 100 3.3205493 3.3205493 1.7853946 0.043558145 - 17600 100 3.2764553 3.2764553 1.7640702 0.051463316 - 17700 100 3.1909643 3.1909643 1.7407995 0.043248948 - 17800 100 3.1958324 3.1958324 1.735056 0.050123145 - 17900 100 3.2431806 3.2431806 1.7380638 0.050838878 - 18000 100 3.2967417 3.2967417 1.7705821 0.042176084 - 18100 100 3.4270672 3.4270672 1.8459819 0.043589925 - 18200 100 3.3638494 3.3638494 1.8159436 0.048949648 - 18300 100 3.3192279 3.3192279 1.8122198 0.043629595 - 18400 100 3.2627211 3.2627211 1.796316 0.045504529 - 18500 100 3.5669172 3.5669172 1.9257062 0.048460393 - 18600 100 3.5546411 3.5546411 1.9154318 0.046890968 - 18700 100 3.7288485 3.7288485 2.011106 0.046906531 - 18800 100 3.6800347 3.6800347 1.9936406 0.049985172 - 18900 100 3.7151898 3.7151898 2.007659 0.050394561 - 19000 100 3.9693368 3.9693368 2.1311549 0.053710204 - 19100 100 3.6907732 3.6907732 1.9939387 0.05480136 - 19200 100 3.8808777 3.8808777 2.0790125 0.055093552 - 19300 100 3.8422142 3.8422142 2.0756951 0.058090774 - 19400 100 3.7836875 3.7836875 2.0399805 0.06965907 - 19500 100 4.0480195 4.0480195 2.169214 0.053420651 - 19600 100 3.965917 3.965917 2.1245227 0.059077084 - 19700 100 3.8980869 3.8980869 2.0956306 0.050857062 - 19800 100 4.008079 4.008079 2.1501421 0.054938689 - 19900 100 3.7244506 3.7244506 2.0080877 0.055481507 - 20000 100 3.8146094 3.8146094 2.0541416 0.053187111 -Loop time of 0.210396 on 1 procs for 5000 steps with 100 atoms - -Performance: 10266363.999 tau/day, 23764.731 timesteps/s -98.3% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.013991 | 0.013991 | 0.013991 | 0.0 | 6.65 -Neigh | 0.056947 | 0.056947 | 0.056947 | 0.0 | 27.07 -Comm | 0.0013928 | 0.0013928 | 0.0013928 | 0.0 | 0.66 -Output | 0.00054646 | 0.00054646 | 0.00054646 | 0.0 | 0.26 -Modify | 0.13027 | 0.13027 | 0.13027 | 0.0 | 61.92 -Other | | 0.007249 | | | 3.45 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 144 ave 144 max 144 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 144 -Ave neighs/atom = 1.44 -Neighbor list builds = 910 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.836 | 5.836 | 5.836 Mbytes -Step Atoms Temp c_1 c_2 Press - 20000 100 3.8146094 3.8146094 2.0541416 0.052956687 - 20100 100 1.3848453 1.3848453 0.82244153 0.017544632 - 20200 100 0.89469578 0.89469578 0.55929611 0.0111604 - 20300 100 0.83962013 0.83962013 0.52665461 0.010396174 - 20400 100 0.77264252 0.77264252 0.48961142 0.0095493901 - 20500 100 0.78613208 0.78613208 0.48683715 0.012166835 - 20600 100 0.88411633 0.88411633 0.52854942 0.011725323 - 20700 100 0.89833225 0.89833225 0.52549693 0.012193413 - 20800 100 0.90216089 0.90216089 0.51167019 0.014289685 - 20900 100 0.98665057 0.98665057 0.5468893 0.013794318 - 21000 100 0.7576342 0.7576342 0.42758791 0.011720156 - 21100 100 0.3821563 0.3821563 0.23426423 0.005324458 - 21200 100 0.17486973 0.17486973 0.12876582 0.0029726352 - 21300 100 0.17940562 0.17940562 0.12400155 0.0026179917 - 21400 100 0.15526876 0.15526876 0.10526802 0.002341177 - 21500 100 0.079493361 0.079493361 0.062289324 0.0017379534 - 21600 100 0.057299519 0.057299519 0.047939171 0.0020095941 - 21700 100 0.056900097 0.056900097 0.045799124 0.0017782068 - 21800 100 0.039847861 0.039847861 0.035138066 0.0018265057 - 21900 100 0.03919167 0.03919167 0.031815619 0.0012160098 - 22000 100 0.025499317 0.025499317 0.022126202 0.0010056809 - 22100 100 0.018956113 0.018956113 0.017843095 0.0016109368 - 22200 100 0.017337018 0.017337018 0.016063068 0.00042537508 - 22300 100 0.014785686 0.014785686 0.013007571 0.00049466367 - 22400 100 0.011754087 0.011754087 0.010399793 0.00042349151 - 22500 100 0.010362474 0.010362474 0.009077435 0.00025198478 - 22600 100 0.0089484896 0.0089484896 0.0079474121 0.00035239475 - 22700 100 0.0089936432 0.0089936432 0.0077908763 0.00018548371 - 22800 100 0.0068663718 0.0068663718 0.0064061667 0.00025641972 - 22900 100 0.0050272392 0.0050272392 0.0046676214 0.00040466013 - 23000 100 0.0049250142 0.0049250142 0.0044849467 0.00035704909 - 23100 100 0.0050508148 0.0050508148 0.0043117775 0.00030051828 - 23200 100 0.0037293467 0.0037293467 0.0033592517 0.00038108923 - 23300 100 0.0032823722 0.0032823722 0.0030511575 0.00040421775 - 23400 100 0.0026913866 0.0026913866 0.0025493429 9.2813733e-05 - 23500 100 0.0025590632 0.0025590632 0.0024466447 8.4695125e-05 - 23600 100 0.0025270441 0.0025270441 0.0024236554 8.4237376e-05 - 23700 100 0.0026406527 0.0026406527 0.0024501963 0.00015009901 - 23800 100 0.0024633391 0.0024633391 0.0023470594 3.8990761e-05 - 23900 100 0.0029505606 0.0029505606 0.0025122613 4.9810757e-05 - 24000 100 0.0019535519 0.0019535519 0.0019112421 3.5804751e-05 - 24100 100 0.0017505151 0.0017505151 0.001726233 2.380737e-05 - 24200 100 0.0015864857 0.0015864857 0.0015479949 1.963276e-05 - 24300 100 0.0014535898 0.0014535898 0.0014221262 3.6607862e-05 - 24400 100 0.0013744934 0.0013744934 0.0013523293 1.4522467e-05 - 24500 100 0.0013286378 0.0013286378 0.0013097089 3.2389792e-05 - 24600 100 0.0012093624 0.0012093624 0.0011617482 4.848694e-05 - 24700 100 0.0011817062 0.0011817062 0.0011409092 3.8898899e-05 - 24800 100 0.0011142524 0.0011142524 0.0010877723 1.4560662e-05 - 24900 100 0.0010941199 0.0010941199 0.0010614415 7.0209336e-05 - 25000 100 0.0010773559 0.0010773559 0.0010389783 1.3332279e-05 -Loop time of 0.0912137 on 1 procs for 5000 steps with 100 atoms - -Performance: 23680652.416 tau/day, 54816.325 timesteps/s -99.3% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.010053 | 0.010053 | 0.010053 | 0.0 | 11.02 -Neigh | 0.017597 | 0.017597 | 0.017597 | 0.0 | 19.29 -Comm | 0.00092912 | 0.00092912 | 0.00092912 | 0.0 | 1.02 -Output | 0.00049806 | 0.00049806 | 0.00049806 | 0.0 | 0.55 -Modify | 0.056085 | 0.056085 | 0.056085 | 0.0 | 61.49 -Other | | 0.006052 | | | 6.63 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 143 ave 143 max 143 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 143 -Ave neighs/atom = 1.43 -Neighbor list builds = 289 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/granregion/log.27Nov18.granregion.box.g++.4 b/examples/granregion/log.27Nov18.granregion.box.g++.4 deleted file mode 100644 index 170c8be867..0000000000 --- a/examples/granregion/log.27Nov18.granregion.box.g++.4 +++ /dev/null @@ -1,475 +0,0 @@ -LAMMPS (27 Nov 2018) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) - using 1 OpenMP thread(s) per MPI task -# pouring spheres into container box - -units lj -atom_style sphere -boundary f f f -dimension 3 -comm_modify vel yes - -region box block -10 10 -10 10 -10 10 units box -create_box 2 box -Created orthogonal box = (-10 -10 -10) to (10 10 10) - 1 by 2 by 2 MPI processor grid - -pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 -pair_coeff * * gran/hooke - -region container block -6 6 -6 6 -6 6 units box -fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 2 all nve/sphere -fix 3 all gravity 1.0 vector 0 0 -1 - -region slab block -2 2 -2 2 -2 2 units box -fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore -Particle insertion: 48 every 566 steps, 100 by step 1133 - -timestep 0.005 - -compute 1 all temp -compute_modify 1 dynamic/dof yes - -compute 2 all temp/sphere -compute_modify 2 dynamic/dof yes - -thermo 100 -thermo_style custom step atoms temp c_1 c_2 press -thermo_modify lost ignore -compute_modify thermo_temp dynamic/dof yes - -#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 -#dump_modify 2 pad 5 - -run 5000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 31 31 31 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke, perpetual - attributes: half, newton on, size - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 0.4834 | 0.4834 | 0.4834 Mbytes -Step Atoms Temp c_1 c_2 Press - 0 0 0 0 0 0 - 100 21 0.54270729 0.54270729 0.26473526 0.0013567682 - 200 21 0.87606961 0.87606961 0.42735103 0.002190174 - 300 21 1.1428374 1.1428374 0.55748167 0.0028570936 - 400 21 1.3543103 1.3543103 0.66829516 0.0033857758 - 500 21 1.0677786 1.0677786 0.53582407 0.0045048164 - 600 56 0.6744286 0.6744286 0.3502938 0.0047464584 - 700 56 0.75569283 0.75569283 0.39779462 0.0051953882 - 800 56 0.61597505 0.61597505 0.32943642 0.0086022783 - 900 56 0.65260802 0.65260802 0.34474044 0.0059298996 - 1000 56 0.51624952 0.51624952 0.28326898 0.0067827337 - 1100 56 0.46050076 0.46050076 0.25656319 0.0061891094 - 1200 81 0.39112346 0.39112346 0.21690172 0.0086559316 - 1300 81 0.33302617 0.33302617 0.19109398 0.0033381104 - 1400 81 0.3933533 0.3933533 0.21221692 0.004135078 - 1500 81 0.35495297 0.35495297 0.19925984 0.0037374946 - 1600 81 0.34150606 0.34150606 0.19025811 0.0053492835 - 1700 100 0.2561647 0.2561647 0.14186278 0.0090767057 - 1800 100 0.21124278 0.21124278 0.12154878 0.002854576 - 1900 100 0.21793955 0.21793955 0.12173867 0.0029049175 - 2000 100 0.25530858 0.25530858 0.13892272 0.0035528022 - 2100 100 0.24671805 0.24671805 0.13687782 0.0076812357 - 2200 100 0.22465212 0.22465212 0.12513612 0.0042526344 - 2300 100 0.19362805 0.19362805 0.10914275 0.0061175383 - 2400 100 0.061626039 0.061626039 0.045905953 0.0010393593 - 2500 100 0.052690575 0.052690575 0.038879745 0.0018543933 - 2600 100 0.037256691 0.037256691 0.02833916 0.0027683815 - 2700 100 0.033416362 0.033416362 0.024551243 0.00046725913 - 2800 100 0.019617758 0.019617758 0.014619416 0.00064550316 - 2900 100 0.012313874 0.012313874 0.0098188153 0.00033470181 - 3000 100 0.010948455 0.010948455 0.0087981878 0.00034401243 - 3100 100 0.009359431 0.009359431 0.0073642412 0.00045497356 - 3200 100 0.008129885 0.008129885 0.0061460516 0.00029944201 - 3300 100 0.0050682533 0.0050682533 0.0042692811 0.00026543293 - 3400 100 0.0031539312 0.0031539312 0.0027256511 0.00012475748 - 3500 100 0.0023621311 0.0023621311 0.0021691817 0.0001186392 - 3600 100 0.0018305354 0.0018305354 0.0018004128 0.00015926282 - 3700 100 0.0016522492 0.0016522492 0.0017231072 0.0002193159 - 3800 100 0.0011715102 0.0011715102 0.0012739973 0.0001747857 - 3900 100 0.0010607606 0.0010607606 0.0010974725 0.00012476088 - 4000 100 0.00087570802 0.00087570802 0.00095828935 6.5544103e-05 - 4100 100 0.00078598203 0.00078598203 0.00088068743 9.4560761e-05 - 4200 100 0.00088317454 0.00088317454 0.00092784605 8.1108122e-05 - 4300 100 0.0015013254 0.0015013254 0.0012069505 8.8289686e-05 - 4400 100 0.00070054041 0.00070054041 0.00079451193 5.195712e-05 - 4500 100 0.00096259073 0.00096259073 0.00091232511 3.4895669e-05 - 4600 100 0.00056641848 0.00056641848 0.00069083146 3.9657253e-05 - 4700 100 0.0005455099 0.0005455099 0.00064816699 2.8131762e-05 - 4800 100 0.00048254366 0.00048254366 0.00057192255 4.7914432e-05 - 4900 100 0.00037108125 0.00037108125 0.00048035333 6.4711817e-05 - 5000 100 0.00031290399 0.00031290399 0.00042398478 4.6025975e-05 -Loop time of 0.075416 on 4 procs for 5000 steps with 100 atoms - -Performance: 28641126.336 tau/day, 66298.904 timesteps/s -93.7% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0022948 | 0.0041364 | 0.0061705 | 2.8 | 5.48 -Neigh | 0.0043123 | 0.0057145 | 0.0070784 | 1.8 | 7.58 -Comm | 0.014259 | 0.018658 | 0.024313 | 3.3 | 24.74 -Output | 0.0011525 | 0.001404 | 0.0015383 | 0.4 | 1.86 -Modify | 0.0030508 | 0.014543 | 0.026602 | 9.5 | 19.28 -Other | | 0.03096 | | | 41.05 - -Nlocal: 25 ave 51 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 5.5 ave 12 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Neighs: 39.75 ave 84 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 - -Total # of neighbors = 159 -Ave neighs/atom = 1.59 -Neighbor list builds = 310 -Dangerous builds = 0 - -region container delete -variable theta equal (step-5000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.733 | 5.733 | 5.734 Mbytes -Step Atoms Temp c_1 c_2 Press - 5000 100 0.00031290399 0.00031290399 0.00042398478 4.4282259e-05 - 5100 100 0.62661084 0.62661084 0.33840611 0.012020153 - 5200 100 0.67371678 0.67371678 0.36218522 0.0093514044 - 5300 100 0.75892331 0.75892331 0.4000747 0.010693252 - 5400 100 0.86207426 0.86207426 0.44630388 0.013540097 - 5500 100 0.96205334 0.96205334 0.49432848 0.017375079 - 5600 100 1.0261194 1.0261194 0.52203912 0.016045333 - 5700 100 1.0584366 1.0584366 0.53794336 0.018621676 - 5800 100 1.0881674 1.0881674 0.55300469 0.01930602 - 5900 100 1.1214233 1.1214233 0.56613492 0.021141141 - 6000 100 1.1666836 1.1666836 0.58759377 0.017655361 - 6100 100 1.1785775 1.1785775 0.59365148 0.01829443 - 6200 100 1.2092305 1.2092305 0.60798809 0.018752443 - 6300 100 1.2331787 1.2331787 0.62003386 0.020291021 - 6400 100 1.2561616 1.2561616 0.63143643 0.019899235 - 6500 100 1.284432 1.284432 0.6460504 0.02083284 - 6600 100 1.2678801 1.2678801 0.63882384 0.019456553 - 6700 100 1.2662641 1.2662641 0.63676836 0.020235578 - 6800 100 1.2785484 1.2785484 0.64129093 0.020335162 - 6900 100 1.2916608 1.2916608 0.64764298 0.020154225 - 7000 100 1.2907774 1.2907774 0.64724849 0.020550885 - 7100 100 1.3074473 1.3074473 0.65460147 0.020847362 - 7200 100 1.3124592 1.3124592 0.65641332 0.020897348 - 7300 100 1.3206191 1.3206191 0.66011491 0.021444077 - 7400 100 1.3273988 1.3273988 0.66350669 0.02129418 - 7500 100 1.3343911 1.3343911 0.66707269 0.021337376 - 7600 100 1.3368998 1.3368998 0.66869327 0.021415901 - 7700 100 1.330658 1.330658 0.66535295 0.021500761 - 7800 100 1.330801 1.330801 0.66555123 0.022806058 - 7900 100 1.3392828 1.3392828 0.66926796 0.02194009 - 8000 100 1.3432728 1.3432728 0.67142337 0.022393719 - 8100 100 1.3411612 1.3411612 0.66989302 0.022366895 - 8200 100 1.3427451 1.3427451 0.67054285 0.021966329 - 8300 100 1.3418147 1.3418147 0.67023132 0.022513459 - 8400 100 1.346493 1.346493 0.67247837 0.022705366 - 8500 100 1.3513958 1.3513958 0.6749092 0.022834077 - 8600 100 1.3520297 1.3520297 0.67506261 0.023227676 - 8700 100 1.3517157 1.3517157 0.67485073 0.023043414 - 8800 100 1.3530071 1.3530071 0.67547212 0.022933766 - 8900 100 1.3550454 1.3550454 0.67657277 0.022744182 - 9000 100 1.3554069 1.3554069 0.67673505 0.022802134 - 9100 100 1.3556675 1.3556675 0.67698335 0.022868449 - 9200 100 1.3534709 1.3534709 0.67600677 0.022537792 - 9300 100 1.3525103 1.3525103 0.67569499 0.022687849 - 9400 100 1.3612673 1.3612673 0.67967213 0.022703588 - 9500 100 1.3649439 1.3649439 0.68147385 0.023498539 - 9600 100 1.3629376 1.3629376 0.68063814 0.023515579 - 9700 100 1.3648924 1.3648924 0.68137104 0.023641856 - 9800 100 1.3662063 1.3662063 0.68196538 0.023576884 - 9900 100 1.3689695 1.3689695 0.68326751 0.023572622 - 10000 100 1.3701139 1.3701139 0.68383343 0.023720885 -Loop time of 0.174251 on 4 procs for 5000 steps with 100 atoms - -Performance: 12395939.906 tau/day, 28694.305 timesteps/s -96.5% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0024631 | 0.010709 | 0.020461 | 8.0 | 6.15 -Neigh | 0.0078361 | 0.012368 | 0.016955 | 4.0 | 7.10 -Comm | 0.0059071 | 0.013641 | 0.023547 | 6.6 | 7.83 -Output | 0.0011749 | 0.0021775 | 0.0030091 | 1.4 | 1.25 -Modify | 0.015055 | 0.055709 | 0.097013 | 17.2 | 31.97 -Other | | 0.07965 | | | 45.71 - -Nlocal: 25 ave 51 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 4.5 ave 10 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Neighs: 49.25 ave 101 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 - -Total # of neighbors = 197 -Ave neighs/atom = 1.97 -Neighbor list builds = 627 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.733 | 5.733 | 5.734 Mbytes -Step Atoms Temp c_1 c_2 Press - 10000 100 1.3701139 1.3701139 0.68383343 0.023895921 - 10100 100 0.25960098 0.25960098 0.15183967 0.0049554084 - 10200 100 0.15017576 0.15017576 0.10081112 0.0045433238 - 10300 100 0.10129671 0.10129671 0.078049099 0.0014012658 - 10400 100 0.06742425 0.06742425 0.055603816 0.0010184792 - 10500 100 0.053446366 0.053446366 0.045338293 0.00089291689 - 10600 100 0.041898231 0.041898231 0.036081995 0.00060703885 - 10700 100 0.03580041 0.03580041 0.031118724 0.00067731964 - 10800 100 0.030933755 0.030933755 0.026372348 0.00039362325 - 10900 100 0.027278004 0.027278004 0.022868898 0.0003680788 - 11000 100 0.021566952 0.021566952 0.017994879 0.0013056062 - 11100 100 0.019143625 0.019143625 0.015833865 0.00050998112 - 11200 100 0.015659868 0.015659868 0.013119379 0.00012755696 - 11300 100 0.013554605 0.013554605 0.01147808 0.00027393437 - 11400 100 0.01204033 0.01204033 0.010273026 0.00033430792 - 11500 100 0.010958991 0.010958991 0.0093924566 0.00049023273 - 11600 100 0.01012553 0.01012553 0.0084556996 0.00021457333 - 11700 100 0.0083584131 0.0083584131 0.0071118766 7.7149089e-05 - 11800 100 0.007044883 0.007044883 0.0058675523 0.00036165381 - 11900 100 0.0059875106 0.0059875106 0.0050610372 7.4095443e-05 - 12000 100 0.0045180275 0.0045180275 0.0039006565 0.00014607704 - 12100 100 0.0036631356 0.0036631356 0.0031154279 7.031064e-05 - 12200 100 0.0034443424 0.0034443424 0.0029190637 0.00020974475 - 12300 100 0.0030853504 0.0030853504 0.0026315266 3.4873541e-05 - 12400 100 0.0025451749 0.0025451749 0.0022290833 0.00041551536 - 12500 100 0.0021624857 0.0021624857 0.0019127734 2.6760761e-05 - 12600 100 0.0020637862 0.0020637862 0.0018186641 4.9446655e-05 - 12700 100 0.0019889538 0.0019889538 0.0017604689 3.326943e-05 - 12800 100 0.0018706349 0.0018706349 0.0016669237 2.3327318e-05 - 12900 100 0.0017472824 0.0017472824 0.001579469 8.816765e-05 - 13000 100 0.0016034824 0.0016034824 0.0014549852 3.5407524e-05 - 13100 100 0.00151798 0.00151798 0.0013826659 1.8754149e-05 - 13200 100 0.0013049781 0.0013049781 0.0012137907 0.00015263775 - 13300 100 0.0012270536 0.0012270536 0.0011590841 4.77636e-06 - 13400 100 0.0011395128 0.0011395128 0.0010860297 2.5606328e-05 - 13500 100 0.0010858414 0.0010858414 0.0010486713 5.8563931e-05 - 13600 100 0.0010474389 0.0010474389 0.001015904 1.4319658e-05 - 13700 100 0.00099241549 0.00099241549 0.00097825038 1.2281142e-05 - 13800 100 0.00084449252 0.00084449252 0.00084141963 1.0451215e-05 - 13900 100 0.00084004792 0.00084004792 0.00083755495 3.7174162e-05 - 14000 100 0.00082183505 0.00082183505 0.00082027058 1.0170209e-05 - 14100 100 0.00082377076 0.00082377076 0.00080489795 1.181976e-05 - 14200 100 0.00076903208 0.00076903208 0.00076216608 4.4590341e-05 - 14300 100 0.00075173269 0.00075173269 0.00074828209 2.2134371e-05 - 14400 100 0.00074379148 0.00074379148 0.00074072001 1.5746014e-05 - 14500 100 0.00072454029 0.00072454029 0.0007174429 8.9830398e-06 - 14600 100 0.00072372648 0.00072372648 0.00071678769 9.1111512e-06 - 14700 100 0.00071541587 0.00071541587 0.00070893868 7.8446375e-05 - 14800 100 0.0006820307 0.0006820307 0.00066675502 8.4401299e-06 - 14900 100 0.00067050627 0.00067050627 0.00065751846 0.0001228548 - 15000 100 0.00064977132 0.00064977132 0.00062305247 7.8887775e-06 -Loop time of 0.0746691 on 4 procs for 5000 steps with 100 atoms - -Performance: 28927619.905 tau/day, 66962.083 timesteps/s -96.6% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0021737 | 0.0042608 | 0.0063519 | 3.2 | 5.71 -Neigh | 0.0012126 | 0.0019009 | 0.0026193 | 1.6 | 2.55 -Comm | 0.0023425 | 0.0092477 | 0.016876 | 7.2 | 12.38 -Output | 0.0010619 | 0.0017995 | 0.0030522 | 1.8 | 2.41 -Modify | 0.00097013 | 0.017151 | 0.03415 | 12.3 | 22.97 -Other | | 0.04031 | | | 53.98 - -Nlocal: 25 ave 55 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Nghost: 3.75 ave 9 max 0 min -Histogram: 2 0 0 0 0 0 1 0 0 1 -Neighs: 42.5 ave 88 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 - -Total # of neighbors = 170 -Ave neighs/atom = 1.7 -Neighbor list builds = 97 -Dangerous builds = 0 - -region container delete -variable theta equal (step-15000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.733 | 5.733 | 5.734 Mbytes -Step Atoms Temp c_1 c_2 Press - 15000 100 0.00064977132 0.00064977132 0.00062305247 7.9405607e-06 - 15100 100 1.0123899 1.0123899 0.66185504 0.014587215 - 15200 100 1.0332828 1.0332828 0.67443308 0.014002815 - 15300 100 1.0804076 1.0804076 0.72450056 0.016985272 - 15400 100 1.2868163 1.2868163 0.8708132 0.022190597 - 15500 100 1.5180471 1.5180471 0.99613124 0.026761866 - 15600 100 1.5422016 1.5422016 1.0021746 0.024490139 - 15700 100 1.7142241 1.7142241 1.0611146 0.0301368 - 15800 100 1.8747057 1.8747057 1.1207858 0.027612699 - 15900 100 1.9294819 1.9294819 1.1289025 0.027270228 - 16000 100 1.953275 1.953275 1.1264475 0.031568811 - 16100 100 2.0434228 2.0434228 1.1665365 0.026358952 - 16200 100 2.2129393 2.2129393 1.2448327 0.029613382 - 16300 100 2.2558224 2.2558224 1.2373264 0.028306021 - 16400 100 2.367398 2.367398 1.293448 0.029659303 - 16500 100 2.4221549 2.4221549 1.3198966 0.032541712 - 16600 100 2.510283 2.510283 1.3618001 0.034740544 - 16700 100 2.6776293 2.6776293 1.4508262 0.034556341 - 16800 100 2.8095841 2.8095841 1.5190571 0.035183782 - 16900 100 2.8485646 2.8485646 1.5344387 0.037153336 - 17000 100 3.0298285 3.0298285 1.6321623 0.040745906 - 17100 100 3.0218054 3.0218054 1.6187189 0.042082135 - 17200 100 3.1981705 3.1981705 1.7090597 0.041770208 - 17300 100 3.3178559 3.3178559 1.7723201 0.044604756 - 17400 100 3.3940903 3.3940903 1.8229846 0.049231759 - 17500 100 3.3274817 3.3274817 1.7870996 0.051649102 - 17600 100 3.3204358 3.3204358 1.791527 0.043875639 - 17700 100 3.2185649 3.2185649 1.7480866 0.049941218 - 17800 100 3.2507826 3.2507826 1.7727758 0.048622479 - 17900 100 3.2432767 3.2432767 1.7796296 0.044343902 - 18000 100 3.0841272 3.0841272 1.6978832 0.045344433 - 18100 100 3.0953909 3.0953909 1.699898 0.040070963 - 18200 100 3.1405704 3.1405704 1.7316463 0.042528194 - 18300 100 3.1904871 3.1904871 1.7555188 0.041141165 - 18400 100 3.3256779 3.3256779 1.8243767 0.043908318 - 18500 100 3.5161823 3.5161823 1.9150861 0.045165166 - 18600 100 3.5668273 3.5668273 1.9217975 0.048127705 - 18700 100 3.6648305 3.6648305 1.9685241 0.051205352 - 18800 100 3.9000502 3.9000502 2.0886668 0.05262835 - 18900 100 4.0217758 4.0217758 2.1465498 0.054502839 - 19000 100 3.8431174 3.8431174 2.0581611 0.054852333 - 19100 100 4.1721454 4.1721454 2.2221193 0.053831555 - 19200 100 3.9061181 3.9061181 2.096323 0.058077678 - 19300 100 4.0191085 4.0191085 2.1408069 0.05475437 - 19400 100 3.8840871 3.8840871 2.0887677 0.061905092 - 19500 100 3.8388062 3.8388062 2.0567095 0.051076414 - 19600 100 3.6331742 3.6331742 1.9574769 0.04748008 - 19700 100 3.6996954 3.6996954 1.9887285 0.053305043 - 19800 100 3.8649872 3.8649872 2.0827424 0.060484008 - 19900 100 3.8305733 3.8305733 2.0700281 0.052926584 - 20000 100 3.7948463 3.7948463 2.0657301 0.048516953 -Loop time of 0.156359 on 4 procs for 5000 steps with 100 atoms - -Performance: 13814330.011 tau/day, 31977.616 timesteps/s -94.9% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0040646 | 0.0058124 | 0.0074518 | 1.6 | 3.72 -Neigh | 0.014813 | 0.018389 | 0.020829 | 1.6 | 11.76 -Comm | 0.031892 | 0.034103 | 0.036658 | 1.0 | 21.81 -Output | 0.0013497 | 0.0019822 | 0.003484 | 2.0 | 1.27 -Modify | 0.031006 | 0.046878 | 0.056364 | 4.5 | 29.98 -Other | | 0.0492 | | | 31.46 - -Nlocal: 25 ave 37 max 10 min -Histogram: 1 0 0 0 0 1 0 1 0 1 -Nghost: 3.75 ave 6 max 2 min -Histogram: 1 0 1 0 0 1 0 0 0 1 -Neighs: 36.25 ave 57 max 9 min -Histogram: 1 0 0 0 0 0 2 0 0 1 - -Total # of neighbors = 145 -Ave neighs/atom = 1.45 -Neighbor list builds = 921 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Per MPI rank memory allocation (min/avg/max) = 5.733 | 5.734 | 5.734 Mbytes -Step Atoms Temp c_1 c_2 Press - 20000 100 3.7948463 3.7948463 2.0657301 0.048381317 - 20100 100 1.1359931 1.1359931 0.70170151 0.015300556 - 20200 100 0.87354617 0.87354617 0.55969299 0.012181983 - 20300 100 0.84424484 0.84424484 0.52849351 0.017724782 - 20400 100 0.82422562 0.82422562 0.50175766 0.0098154181 - 20500 100 0.83731289 0.83731289 0.49814627 0.010465327 - 20600 100 0.93125924 0.93125924 0.53803834 0.011624902 - 20700 100 1.0810919 1.0810919 0.60974741 0.01425935 - 20800 100 1.0646343 1.0646343 0.60037545 0.013418132 - 20900 100 1.0608055 1.0608055 0.58353908 0.015119612 - 21000 100 0.68173094 0.68173094 0.3941588 0.0099947535 - 21100 100 0.35407592 0.35407592 0.21306735 0.0043859494 - 21200 100 0.19247432 0.19247432 0.12989264 0.0031808422 - 21300 100 0.13493768 0.13493768 0.093987634 0.0025990872 - 21400 100 0.085735857 0.085735857 0.062091707 0.001434207 - 21500 100 0.074307566 0.074307566 0.05224051 0.0022163094 - 21600 100 0.069932382 0.069932382 0.045388838 0.0020296572 - 21700 100 0.041749712 0.041749712 0.031422931 0.001211155 - 21800 100 0.03378055 0.03378055 0.026248846 0.0020596463 - 21900 100 0.030608528 0.030608528 0.022868294 0.0016282878 - 22000 100 0.025632448 0.025632448 0.019606402 0.0011659657 - 22100 100 0.013785062 0.013785062 0.011561769 0.00069006322 - 22200 100 0.013139066 0.013139066 0.010559726 0.00038424576 - 22300 100 0.01455318 0.01455318 0.011094558 0.00054735929 - 22400 100 0.0096885414 0.0096885414 0.008012617 0.00055875777 - 22500 100 0.0081193116 0.0081193116 0.006802973 0.00052914932 - 22600 100 0.0057159621 0.0057159621 0.0048680253 0.00054864875 - 22700 100 0.0052344376 0.0052344376 0.0045511708 0.00026333033 - 22800 100 0.0054554177 0.0054554177 0.0045005479 0.0002085972 - 22900 100 0.0039455776 0.0039455776 0.0035287888 0.00022514017 - 23000 100 0.0042620461 0.0042620461 0.0035747729 0.00020030999 - 23100 100 0.0035303095 0.0035303095 0.0031995108 0.00016007298 - 23200 100 0.0029747457 0.0029747457 0.0027095904 0.00029775807 - 23300 100 0.0032404433 0.0032404433 0.002769389 0.00019627995 - 23400 100 0.0024965262 0.0024965262 0.0022343473 0.00018870133 - 23500 100 0.00251617 0.00251617 0.0022533604 0.0002661237 - 23600 100 0.0025923653 0.0025923653 0.0022887204 0.00018475201 - 23700 100 0.0023016545 0.0023016545 0.0019829032 0.00014888334 - 23800 100 0.0028358441 0.0028358441 0.0021790504 0.00064613131 - 23900 100 0.0016682403 0.0016682403 0.0014930521 8.8407075e-05 - 24000 100 0.0016341577 0.0016341577 0.0014597606 0.00011262081 - 24100 100 0.0015433636 0.0015433636 0.0013981581 8.364568e-05 - 24200 100 0.0015033978 0.0015033978 0.0013582013 8.4539006e-05 - 24300 100 0.0014513098 0.0014513098 0.0012943981 0.00010546194 - 24400 100 0.0013293352 0.0013293352 0.001206366 8.4967509e-05 - 24500 100 0.0013732518 0.0013732518 0.001202532 0.00014787559 - 24600 100 0.00091890041 0.00091890041 0.00084499923 0.00010080638 - 24700 100 0.00083467915 0.00083467915 0.00077071316 5.3934025e-05 - 24800 100 0.00080701934 0.00080701934 0.0007477161 5.3982095e-05 - 24900 100 0.00080620771 0.00080620771 0.0007471026 5.3581294e-05 - 25000 100 0.00080568604 0.00080568604 0.00074625735 5.3574637e-05 -Loop time of 0.0792506 on 4 procs for 5000 steps with 100 atoms - -Performance: 27255302.560 tau/day, 63090.978 timesteps/s -95.0% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0023611 | 0.0047854 | 0.0077851 | 3.4 | 6.04 -Neigh | 0.0042653 | 0.005571 | 0.0067258 | 1.5 | 7.03 -Comm | 0.0077977 | 0.013373 | 0.019515 | 4.4 | 16.87 -Output | 0.0010924 | 0.0017727 | 0.0030222 | 1.8 | 2.24 -Modify | 0.0023608 | 0.015964 | 0.030545 | 10.5 | 20.14 -Other | | 0.03778 | | | 47.68 - -Nlocal: 25 ave 50 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 5 ave 10 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 35.75 ave 78 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 - -Total # of neighbors = 143 -Ave neighs/atom = 1.43 -Neighbor list builds = 287 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/granregion/log.27Nov18.granregion.funnel.g++.1 b/examples/granregion/log.27Nov18.granregion.funnel.g++.1 deleted file mode 100644 index 0268ed000a..0000000000 --- a/examples/granregion/log.27Nov18.granregion.funnel.g++.1 +++ /dev/null @@ -1,601 +0,0 @@ -LAMMPS (27 Nov 2018) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) - using 1 OpenMP thread(s) per MPI task -# pour particles into cone-shaped funnel, settle them, let them run out bottom - -variable name string funnel_pour - -thermo_modify flush yes -units si -variable PI equal 3.141592653589 -variable seed equal 14314 - -############################################### -# Geometry-related parameters -############################################### - -variable xlo equal 10 -variable xhi equal 40 -variable ylo equal 10 -variable yhi equal 40 -variable zlo equal -20 -variable zhi equal 50 - -variable xc equal 25 -variable yc equal 25 - -variable zconehi equal 50 -variable zconelo equal 10 -variable zcyllo equal 0 -variable radconelo equal 2 -variable radconehi equal 20 - -################################################ -# Particle sizes -################################################ - -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable skin equal ${rhi} -variable skin equal 0.5 - -############################################### -# Granular contact parameters -############################################### - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable density equal 1.0 -variable EYoung equal 10^5 -variable Poisson equal 2.0/7.0 -variable GShear equal ${EYoung}/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+0.285714285714286)) - -variable gravity equal 1.0 - -variable reff equal 0.5*(${rhi}+${rlo}) -variable reff equal 0.5*(0.5+${rlo}) -variable reff equal 0.5*(0.5+0.25) -variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 -variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 -variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 - -## Typical way to set kn, kt, etc.: -variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) -variable kt equal 4.0*${GShear}/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) - -variable a equal (-2.0*log(${coeffRes})/${PI})^2 -variable a equal (-2.0*log(0.1)/${PI})^2 -variable a equal (-2.0*log(0.1)/3.141592653589)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 903.503751814138*0.5 - -variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) - -variable dt equal ${tcol}*0.05 -variable dt equal 0.00210943016014969*0.05 -timestep ${dt} -timestep 0.000105471508007485 - -############################################### -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton off -atom_style sphere - -boundary p p f - -region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 40 ${zlo} ${zhi} -region boxreg block 10 40 10 40 -20 ${zhi} -region boxreg block 10 40 10 40 -20 50 -create_box 1 boxreg -Created orthogonal box = (10 10 -20) to (40 40 50) - 1 by 1 by 1 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 -pair_coeff * * - -neighbor ${skin} bin -neighbor 0.5 bin -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 30, bins = 1 1 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -# insertion region for fix/pour - -region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box -region insreg cylinder z 25 ${yc} 10 30 50 side in units box -region insreg cylinder z 25 25 10 30 50 side in units box - -# define cone and cylinder regions - see lammps doc on region command -# note new open options - -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 2 - -region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open -region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 - -region hopreg union 2 conereg cylreg - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - - -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 3000 every 59965 steps, 2000 by step 1 - -#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke -WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:705) -thermo_modify flush yes lost warn - -# Initial run to fill up the cone - -run 20000 -Per MPI rank memory allocation (min/avg/max) = 6.649 | 6.649 | 6.649 Mbytes -Step CPU Atoms KinEng - 0 0 0 -0 - 1000 0.63593698 2000 -0 - 2000 1.0282419 2000 -0 - 3000 1.4184453 2000 -0 - 4000 1.8055785 2000 -0 - 5000 2.1941335 2000 -0 - 6000 2.5804653 2000 -0 - 7000 2.9660621 2000 -0 - 8000 3.3506265 2000 -0 - 9000 3.7344413 2000 -0 - 10000 4.1212304 2000 -0 - 11000 4.5044594 2000 -0 - 12000 4.8875456 2000 -0 - 13000 5.2698007 2000 -0 - 14000 5.6527214 2000 -0 - 15000 6.0349295 2000 -0 - 16000 6.4172938 2000 -0 - 17000 6.8001184 2000 -0 - 18000 7.1826644 2000 -0 - 19000 7.5654378 2000 -0 - 20000 7.9511659 2000 -0 -Loop time of 7.95118 on 1 procs for 20000 steps with 2000 atoms - -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.6189 | 0.6189 | 0.6189 | 0.0 | 7.78 -Neigh | 0.09361 | 0.09361 | 0.09361 | 0.0 | 1.18 -Comm | 0.016098 | 0.016098 | 0.016098 | 0.0 | 0.20 -Output | 0.00048828 | 0.00048828 | 0.00048828 | 0.0 | 0.01 -Modify | 6.9973 | 6.9973 | 6.9973 | 0.0 | 88.00 -Other | | 0.2248 | | | 2.83 - -Nlocal: 2000 ave 2000 max 2000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1537 ave 1537 max 1537 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1537 -Ave neighs/atom = 0.7685 -Neighbor list builds = 69 -Dangerous builds = 0 -unfix ins -run 150000 -Per MPI rank memory allocation (min/avg/max) = 12.77 | 12.77 | 12.77 Mbytes -Step CPU Atoms KinEng - 20000 0 2000 6443.7665 - 21000 0.3826313 2000 6572.3531 - 22000 0.76688981 2000 6723.8376 - 23000 1.1534231 2000 6853.1812 - 24000 1.5391715 2000 6976.0209 - 25000 1.9263508 2000 7096.9955 - 26000 2.3168406 2000 7215.5795 - 27000 2.7065961 2000 7349.2382 - 28000 3.096664 2000 7471.8719 - 29000 3.4905531 2000 7574.8228 - 30000 3.8877606 2000 7659.3836 - 31000 4.2839894 2000 7703.6856 - 32000 4.6859732 2000 7644.279 - 33000 5.0932801 2000 7526.6944 - 34000 5.5045564 2000 7370.0821 - 35000 5.9206297 2000 7193.0457 - 36000 6.343729 2000 6990.9899 - 37000 6.7719142 2000 6849.2841 - 38000 7.2016783 2000 6701.7433 - 39000 7.6354482 2000 6538.9557 - 40000 8.078445 2000 6381.9346 - 41000 8.5191586 2000 6217.5253 - 42000 8.9630713 2000 6093.5344 - 43000 9.4097741 2000 5943.0479 - 44000 9.8652256 2000 5841.0782 - 45000 10.331057 2000 5652.8319 - 46000 10.803253 2000 5476.1466 - 47000 11.278766 2000 5267.7855 - 48000 11.759121 2000 5131.4036 - 49000 12.248896 2000 4972.7696 - 50000 12.747719 2000 4867.0868 - 51000 13.246704 2000 4681.897 - 52000 13.757842 2000 4506.8185 - 53000 14.276078 2000 4346.8045 - 54000 14.795933 2000 4193.8194 - 55000 15.311241 2000 4058.2049 - 56000 15.828737 2000 3879.0325 - 57000 16.359453 2000 3696.3154 - 58000 16.905406 2000 3504.0399 - 59000 17.460454 2000 3284.6522 - 60000 18.027276 2000 3061.0727 - 61000 18.586931 2000 2874.2926 - 62000 19.158563 2000 2653.0722 - 63000 19.738442 2000 2437.4941 - 64000 20.331411 2000 2124.1876 - 65000 20.936204 2000 1864.5661 - 66000 21.547443 2000 1610.2335 - 67000 22.166888 2000 1390.0428 - 68000 22.789106 2000 1163.7679 - 69000 23.416016 2000 933.0928 - 70000 24.038879 2000 745.66667 - 71000 24.663115 2000 605.58458 - 72000 25.294193 2000 444.31183 - 73000 25.932019 2000 357.19162 - 74000 26.568184 2000 291.16762 - 75000 27.203393 2000 230.58362 - 76000 27.836079 2000 197.59502 - 77000 28.467344 2000 166.55702 - 78000 29.099997 2000 139.89052 - 79000 29.741694 2000 117.1145 - 80000 30.388097 2000 100.12353 - 81000 31.036193 2000 85.233155 - 82000 31.688463 2000 71.145302 - 83000 32.343411 2000 61.545348 - 84000 32.999346 2000 54.099358 - 85000 33.652976 2000 46.922028 - 86000 34.306931 2000 41.606645 - 87000 34.967787 2000 37.462793 - 88000 35.633721 2000 33.698298 - 89000 36.310035 2000 29.340455 - 90000 36.995441 2000 26.072122 - 91000 37.67904 2000 23.20848 - 92000 38.367699 2000 21.015862 - 93000 39.058641 2000 20.134175 - 94000 39.749342 2000 19.196075 - 95000 40.442651 2000 18.285127 - 96000 41.140177 2000 17.476411 - 97000 41.840761 2000 16.55882 - 98000 42.543845 2000 15.444541 - 99000 43.256415 2000 14.41642 - 100000 43.97382 2000 13.818738 - 101000 44.684596 2000 12.878373 - 102000 45.401082 2000 12.11804 - 103000 46.120936 2000 11.016885 - 104000 46.83935 2000 10.531044 - 105000 47.559419 2000 10.46735 - 106000 48.286016 2000 10.246007 - 107000 49.012266 2000 9.6423041 - 108000 49.74013 2000 9.3948808 - 109000 50.471961 2000 9.5178141 - 110000 51.206152 2000 9.4143884 - 111000 51.939123 2000 9.5058226 - 112000 52.673443 2000 9.6911516 - 113000 53.410485 2000 9.7756849 - 114000 54.152537 2000 9.3876232 - 115000 54.891784 2000 8.6725333 - 116000 55.631474 2000 8.6691065 - 117000 56.371762 2000 8.0156055 - 118000 57.110131 2000 7.9150786 - 119000 57.8533 2000 7.5310892 - 120000 58.599064 2000 7.2940498 - 121000 59.340753 2000 6.8347898 - 122000 60.084676 2000 6.696484 - 123000 60.826952 2000 6.7799146 - 124000 61.569413 2000 6.7901567 - 125000 62.316334 2000 6.7532108 - 126000 63.061374 2000 6.762162 - 127000 63.806385 2000 6.6317366 - 128000 64.555969 2000 6.8246399 - 129000 65.308131 2000 6.9130358 - 130000 66.060967 2000 7.1750566 - 131000 66.809725 2000 6.9507379 - 132000 67.559796 2000 6.7987445 - 133000 68.314249 2000 6.8535775 - 134000 69.065513 2000 7.0255144 - 135000 69.817604 2000 6.7381064 - 136000 70.572079 2000 6.5567748 - 137000 71.324444 2000 6.2655395 - 138000 72.079147 2000 6.1923013 - 139000 72.831323 2000 6.0958081 - 140000 73.59117 2000 5.9185709 - 141000 74.343753 2000 5.9151241 - 142000 75.096509 2000 5.4743035 - 143000 75.852151 2000 5.438642 - 144000 76.605005 2000 4.6646664 - 145000 77.357571 2000 4.6899837 - 146000 78.113125 2000 4.5357917 - 147000 78.867751 2000 4.5993842 - 148000 79.625344 2000 4.7076884 - 149000 80.37992 2000 4.8306642 - 150000 81.143175 2000 4.8282147 - 151000 81.899326 2000 4.546308 - 152000 82.658645 2000 4.6700755 - 153000 83.41837 2000 4.7557633 - 154000 84.17509 2000 4.9004538 - 155000 84.934161 2000 5.0552949 - 156000 85.695466 2000 4.0672495 - 157000 86.453115 2000 3.5819543 - 158000 87.212663 2000 3.3533477 - 159000 87.967768 2000 3.3281001 - 160000 88.729631 2000 3.0831743 - 161000 89.498983 2000 3.0519269 - 162000 90.259424 2000 3.0951675 - 163000 91.019656 2000 2.9868352 - 164000 91.776359 2000 2.9195788 - 165000 92.536374 2000 2.5637813 - 166000 93.296332 2000 2.5553272 - 167000 94.05653 2000 2.0752912 - 168000 94.814559 2000 1.9689845 - 169000 95.576005 2000 1.9117916 - 170000 96.337863 2000 1.8568914 -Loop time of 96.3379 on 1 procs for 150000 steps with 2000 atoms - -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 37.121 | 37.121 | 37.121 | 0.0 | 38.53 -Neigh | 0.8454 | 0.8454 | 0.8454 | 0.0 | 0.88 -Comm | 0.11506 | 0.11506 | 0.11506 | 0.0 | 0.12 -Output | 0.004431 | 0.004431 | 0.004431 | 0.0 | 0.00 -Modify | 56.517 | 56.517 | 56.517 | 0.0 | 58.67 -Other | | 1.735 | | | 1.80 - -Nlocal: 2000 ave 2000 max 2000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 15524 ave 15524 max 15524 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 15524 -Ave neighs/atom = 7.762 -Neighbor list builds = 388 -Dangerous builds = 0 - -# remove "plug" - need to redefine cylinder region & union - -region cylreg delete -region hopreg delete -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 - -region hopreg union 2 cylreg conereg - -unfix hopper3 -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -run 100000 -Per MPI rank memory allocation (min/avg/max) = 18.64 | 18.64 | 18.64 Mbytes -Step CPU Atoms KinEng - 170000 0 2000 1.8568914 - 171000 0.75704765 2000 2.4011583 - 172000 1.5101345 2000 3.176628 - 173000 2.2556529 2000 4.5364486 - 174000 2.9946566 2000 6.5494125 - 175000 3.7253478 2000 9.1934319 - 176000 4.4570525 2000 12.25765 - 177000 5.1876664 2000 15.799657 - 178000 5.9178619 2000 19.982558 - 179000 6.6439464 2000 24.927165 - 180000 7.3749168 2000 30.428362 - 181000 8.1011977 2000 36.74232 - 182000 8.8207343 2000 43.820448 - 183000 9.5397925 2000 50.903222 - 184000 10.253098 2000 59.425781 - 185000 10.965505 2000 69.143119 - 186000 11.673319 2000 79.210705 - 187000 12.373966 2000 90.411346 - 188000 13.075475 2000 102.35389 - 189000 13.770632 2000 114.93888 - 190000 14.469445 2000 128.63341 - 191000 15.158381 2000 143.44526 - 192000 15.846267 2000 159.04574 - 193000 16.527754 2000 174.3114 - 194000 17.204808 2000 190.42123 - 195000 17.881059 2000 207.70459 - 196000 18.556555 2000 224.90931 - 197000 19.229818 2000 242.64914 - 198000 19.905086 2000 261.48312 - 199000 20.578518 2000 281.28308 - 200000 21.25632 2000 302.95108 - 201000 21.921347 2000 325.95534 - 202000 22.583873 2000 350.6874 - 203000 23.244724 2000 376.31773 - 204000 23.904842 2000 404.21947 - 205000 24.562788 2000 432.96116 - 206000 25.217762 2000 462.4113 - 207000 25.875814 2000 491.91207 - 208000 26.531285 2000 522.15395 - 209000 27.184766 2000 553.1024 - 210000 27.842961 2000 585.7133 - 211000 28.489339 2000 619.96357 - 212000 29.139612 2000 653.96189 - 213000 29.783866 2000 689.8027 - 214000 30.426881 2000 727.28401 - 215000 31.06706 2000 766.40354 - 216000 31.706399 2000 805.65433 - 217000 32.343033 2000 845.40981 - 218000 32.989384 2000 884.24637 - 219000 33.633664 2000 923.5998 - 220000 34.285172 2000 965.01779 - 221000 34.931959 2000 1009.1763 - 222000 35.571624 2000 1054.7789 - 223000 36.207868 2000 1101.9922 - 224000 36.836062 2000 1151.1205 - 225000 37.464514 2000 1201.3979 - 226000 38.09746 2000 1252.4054 - 227000 38.732507 1999 1296.6784 - 228000 39.371367 1997 1342.3466 - 229000 40.012553 1992 1368.8559 - 230000 40.652111 1977 1360.2259 - 231000 41.275478 1965 1340.3793 - 232000 41.892734 1953 1318.8318 - 233000 42.50588 1938 1295.5667 - 234000 43.121427 1924 1270.0641 - 235000 43.740727 1914 1258.296 - 236000 44.359241 1902 1224.3945 - 237000 44.979463 1899 1248.3905 - 238000 45.597358 1885 1206.9229 - 239000 46.210114 1875 1195.5429 - 240000 46.818148 1861 1142.6591 - 241000 47.411079 1851 1131.5523 - 242000 48.002522 1841 1116.8741 - 243000 48.594254 1830 1099.9978 - 244000 49.191798 1822 1078.6068 - 245000 49.791332 1814 1072.1498 - 246000 50.389728 1803 1020.7842 - 247000 50.984212 1794 1000.1936 - 248000 51.571047 1781 942.02462 - 249000 52.149428 1772 916.83697 - 250000 52.726202 1758 825.10751 - 251000 53.29913 1748 789.06351 - 252000 53.871912 1739 753.92258 - 253000 54.441009 1729 697.83686 - 254000 55.010203 1718 648.98541 - 255000 55.573602 1710 620.38129 - 256000 56.134709 1705 622.43466 - 257000 56.701827 1700 595.79102 - 258000 57.264463 1698 608.49223 - 259000 57.827817 1695 614.0119 - 260000 58.398994 1690 601.50438 - 261000 58.964611 1687 608.5892 - 262000 59.526765 1683 597.07884 - 263000 60.082729 1682 618.65041 - 264000 60.640105 1678 615.47784 - 265000 61.195717 1675 605.27658 - 266000 61.751087 1671 583.69853 - 267000 62.305546 1669 600.11043 - 268000 62.86105 1666 598.79807 - 269000 63.417551 1663 588.40338 - 270000 63.974486 1660 579.59387 -Loop time of 63.9745 on 1 procs for 100000 steps with 1660 atoms - -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 26.514 | 26.514 | 26.514 | 0.0 | 41.44 -Neigh | 0.60324 | 0.60324 | 0.60324 | 0.0 | 0.94 -Comm | 0.075881 | 0.075881 | 0.075881 | 0.0 | 0.12 -Output | 0.0029137 | 0.0029137 | 0.0029137 | 0.0 | 0.00 -Modify | 35.686 | 35.686 | 35.686 | 0.0 | 55.78 -Other | | 1.092 | | | 1.71 - -Nlocal: 1660 ave 1660 max 1660 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 11681 ave 11681 max 11681 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 11681 -Ave neighs/atom = 7.03675 -Neighbor list builds = 249 -Dangerous builds = 0 -Total wall time: 0:02:48 diff --git a/examples/granregion/log.27Nov18.granregion.funnel.g++.4 b/examples/granregion/log.27Nov18.granregion.funnel.g++.4 deleted file mode 100644 index 67c307d212..0000000000 --- a/examples/granregion/log.27Nov18.granregion.funnel.g++.4 +++ /dev/null @@ -1,601 +0,0 @@ -LAMMPS (27 Nov 2018) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) - using 1 OpenMP thread(s) per MPI task -# pour particles into cone-shaped funnel, settle them, let them run out bottom - -variable name string funnel_pour - -thermo_modify flush yes -units si -variable PI equal 3.141592653589 -variable seed equal 14314 - -############################################### -# Geometry-related parameters -############################################### - -variable xlo equal 10 -variable xhi equal 40 -variable ylo equal 10 -variable yhi equal 40 -variable zlo equal -20 -variable zhi equal 50 - -variable xc equal 25 -variable yc equal 25 - -variable zconehi equal 50 -variable zconelo equal 10 -variable zcyllo equal 0 -variable radconelo equal 2 -variable radconehi equal 20 - -################################################ -# Particle sizes -################################################ - -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable skin equal ${rhi} -variable skin equal 0.5 - -############################################### -# Granular contact parameters -############################################### - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable density equal 1.0 -variable EYoung equal 10^5 -variable Poisson equal 2.0/7.0 -variable GShear equal ${EYoung}/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+0.285714285714286)) - -variable gravity equal 1.0 - -variable reff equal 0.5*(${rhi}+${rlo}) -variable reff equal 0.5*(0.5+${rlo}) -variable reff equal 0.5*(0.5+0.25) -variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 -variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 -variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 - -## Typical way to set kn, kt, etc.: -variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) -variable kt equal 4.0*${GShear}/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) - -variable a equal (-2.0*log(${coeffRes})/${PI})^2 -variable a equal (-2.0*log(0.1)/${PI})^2 -variable a equal (-2.0*log(0.1)/3.141592653589)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 903.503751814138*0.5 - -variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) - -variable dt equal ${tcol}*0.05 -variable dt equal 0.00210943016014969*0.05 -timestep ${dt} -timestep 0.000105471508007485 - -############################################### -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton off -atom_style sphere - -boundary p p f - -region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 40 ${zlo} ${zhi} -region boxreg block 10 40 10 40 -20 ${zhi} -region boxreg block 10 40 10 40 -20 50 -create_box 1 boxreg -Created orthogonal box = (10 10 -20) to (40 40 50) - 1 by 1 by 4 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 -pair_coeff * * - -neighbor ${skin} bin -neighbor 0.5 bin -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 30, bins = 1 1 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -# insertion region for fix/pour - -region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box -region insreg cylinder z 25 ${yc} 10 30 50 side in units box -region insreg cylinder z 25 25 10 30 50 side in units box - -# define cone and cylinder regions - see lammps doc on region command -# note new open options - -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 2 - -region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open -region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 - -region hopreg union 2 conereg cylreg - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - - -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 3000 every 59965 steps, 2000 by step 1 - -#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke -WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:705) -thermo_modify flush yes lost warn - -# Initial run to fill up the cone - -run 20000 -Per MPI rank memory allocation (min/avg/max) = 6.05 | 6.05 | 6.05 Mbytes -Step CPU Atoms KinEng - 0 0 0 -0 - 1000 0.63366675 2000 -0 - 2000 1.0221362 2000 -0 - 3000 1.3905275 2000 -0 - 4000 1.7514329 2000 -0 - 5000 2.1040537 2000 -0 - 6000 2.4468088 2000 -0 - 7000 2.7853072 2000 -0 - 8000 3.1109948 2000 -0 - 9000 3.4281557 2000 -0 - 10000 3.7435207 2000 -0 - 11000 3.8612552 2000 -0 - 12000 3.9786677 2000 -0 - 13000 4.0988154 2000 -0 - 14000 4.2249811 2000 -0 - 15000 4.3562138 2000 -0 - 16000 4.4940333 2000 -0 - 17000 4.6394637 2000 -0 - 18000 4.7909062 2000 -0 - 19000 4.9482198 2000 -0 - 20000 5.1116607 2000 -0 -Loop time of 5.11176 on 4 procs for 20000 steps with 2000 atoms - -97.4% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.050997 | 0.14884 | 0.36048 | 32.0 | 2.91 -Neigh | 0.01374 | 0.025199 | 0.043743 | 7.0 | 0.49 -Comm | 0.063387 | 0.1781 | 0.29748 | 22.6 | 3.48 -Output | 0.0016627 | 0.0060938 | 0.015082 | 6.8 | 0.12 -Modify | 1.1198 | 1.987 | 3.7195 | 72.6 | 38.87 -Other | | 2.767 | | | 54.12 - -Nlocal: 500 ave 505 max 493 min -Histogram: 1 0 0 0 0 1 0 1 0 1 -Nghost: 159.25 ave 254 max 71 min -Histogram: 1 0 0 1 0 1 0 0 0 1 -Neighs: 397.5 ave 616 max 214 min -Histogram: 1 0 1 0 0 0 1 0 0 1 - -Total # of neighbors = 1590 -Ave neighs/atom = 0.795 -Neighbor list builds = 69 -Dangerous builds = 0 -unfix ins -run 150000 -Per MPI rank memory allocation (min/avg/max) = 12.37 | 12.51 | 12.7 Mbytes -Step CPU Atoms KinEng - 20000 0 2000 6443.7665 - 21000 0.11261106 2000 6572.3531 - 22000 0.23091817 2000 6723.8376 - 23000 0.35577631 2000 6853.1812 - 24000 0.48790455 2000 6976.0209 - 25000 0.63509274 2000 7096.9955 - 26000 0.78251743 2000 7215.5795 - 27000 0.93707466 2000 7349.2382 - 28000 1.1032445 2000 7471.8719 - 29000 1.2721858 2000 7574.8228 - 30000 1.449265 2000 7659.3836 - 31000 1.5742557 2000 7703.6856 - 32000 1.7076068 2000 7644.279 - 33000 1.8527873 2000 7526.6944 - 34000 2.009855 2000 7370.0821 - 35000 2.1766446 2000 7193.0459 - 36000 2.3557482 2000 6990.9912 - 37000 2.5468907 2000 6849.286 - 38000 2.7480681 2000 6701.7548 - 39000 2.9574037 2000 6538.6915 - 40000 3.1807711 2000 6382.3209 - 41000 3.3486595 2000 6216.424 - 42000 3.5162592 2000 6091.29 - 43000 3.687057 2000 5945.3256 - 44000 3.8662596 2000 5840.875 - 45000 4.0557241 2000 5649.763 - 46000 4.2541051 2000 5476.2837 - 47000 4.4571214 2000 5277.0701 - 48000 4.6628008 2000 5123.9796 - 49000 4.8686502 2000 4968.3344 - 50000 5.0788848 2000 4869.5754 - 51000 5.2552598 2000 4704.8517 - 52000 5.4428713 2000 4522.8978 - 53000 5.6520596 2000 4393.8047 - 54000 5.8613031 2000 4235.438 - 55000 6.0776098 2000 4082.3073 - 56000 6.2998042 2000 3901.0483 - 57000 6.5321434 2000 3718.0882 - 58000 6.7745438 2000 3504.621 - 59000 7.0237701 2000 3285.7484 - 60000 7.2791855 2000 3047.3386 - 61000 7.489058 2000 2875.4032 - 62000 7.7044094 2000 2647.83 - 63000 7.9194827 2000 2396.5343 - 64000 8.1429474 2000 2107.2113 - 65000 8.3745618 2000 1858.1977 - 66000 8.610673 2000 1615.8096 - 67000 8.8505244 2000 1416.5065 - 68000 9.0955915 2000 1206.8534 - 69000 9.3609676 2000 953.93974 - 70000 9.6382594 2000 766.9148 - 71000 9.8719468 2000 611.45063 - 72000 10.095534 2000 464.94805 - 73000 10.317962 2000 364.31415 - 74000 10.547287 2000 298.77524 - 75000 10.764052 2000 245.73022 - 76000 10.978769 2000 207.8035 - 77000 11.199921 2000 179.1305 - 78000 11.410296 2000 151.21032 - 79000 11.624499 2000 124.49675 - 80000 11.849562 2000 106.71504 - 81000 12.077449 2000 93.299034 - 82000 12.306904 2000 81.220408 - 83000 12.539016 2000 67.383955 - 84000 12.773108 2000 57.287165 - 85000 13.009487 2000 49.255887 - 86000 13.252544 2000 44.082536 - 87000 13.502564 2000 40.193574 - 88000 13.747198 2000 36.903867 - 89000 13.993028 2000 33.55332 - 90000 14.240036 2000 30.730912 - 91000 14.472719 2000 28.650574 - 92000 14.708542 2000 26.377609 - 93000 14.948106 2000 24.433165 - 94000 15.186653 2000 22.933076 - 95000 15.428022 2000 22.31788 - 96000 15.676323 2000 20.829124 - 97000 15.916326 2000 19.401354 - 98000 16.160197 2000 18.943699 - 99000 16.404796 2000 17.690599 - 100000 16.659731 2000 17.215943 - 101000 16.904498 2000 15.948087 - 102000 17.150993 2000 15.140324 - 103000 17.39584 2000 14.885674 - 104000 17.643707 2000 14.414752 - 105000 17.889343 2000 14.270676 - 106000 18.136159 2000 13.943799 - 107000 18.383653 2000 13.840145 - 108000 18.630952 2000 12.826341 - 109000 18.878218 2000 12.209012 - 110000 19.125558 2000 11.916194 - 111000 19.3726 2000 11.970849 - 112000 19.621494 2000 11.56909 - 113000 19.869978 2000 11.390562 - 114000 20.123402 2000 11.276545 - 115000 20.370963 2000 11.171298 - 116000 20.619975 2000 11.686225 - 117000 20.869585 2000 11.379805 - 118000 21.118875 2000 10.539511 - 119000 21.36837 2000 10.064595 - 120000 21.629511 2000 10.003722 - 121000 21.877867 2000 9.6974586 - 122000 22.127922 2000 9.7156209 - 123000 22.378215 2000 9.615256 - 124000 22.630463 2000 8.8979008 - 125000 22.882154 2000 8.2220003 - 126000 23.135763 2000 8.3153866 - 127000 23.392389 2000 8.0945497 - 128000 23.645521 2000 7.8942467 - 129000 23.89965 2000 7.4794776 - 130000 24.153195 2000 7.3635341 - 131000 24.406239 2000 7.5757743 - 132000 24.66016 2000 7.7047492 - 133000 24.914093 2000 8.0142133 - 134000 25.173429 2000 8.1716714 - 135000 25.433318 2000 7.7803343 - 136000 25.692997 2000 6.3545482 - 137000 25.947787 2000 6.313769 - 138000 26.200427 2000 6.4948596 - 139000 26.452514 2000 6.6183259 - 140000 26.714963 2000 6.7922281 - 141000 26.968235 2000 7.0752448 - 142000 27.220962 2000 7.2328717 - 143000 27.474819 2000 7.626453 - 144000 27.728029 2000 7.4576787 - 145000 27.981958 2000 7.124435 - 146000 28.236591 2000 7.2581589 - 147000 28.489842 2000 7.0622049 - 148000 28.744432 2000 7.1672801 - 149000 28.998739 2000 7.3248363 - 150000 29.253511 2000 7.0092266 - 151000 29.50567 2000 6.8124438 - 152000 29.759836 2000 6.9808705 - 153000 30.015359 2000 7.1516731 - 154000 30.275488 2000 6.6245443 - 155000 30.533407 2000 5.5867165 - 156000 30.788683 2000 5.318949 - 157000 31.043126 2000 5.1195805 - 158000 31.297011 2000 5.2045485 - 159000 31.551327 2000 5.24992 - 160000 31.807728 2000 5.3270577 - 161000 32.061371 2000 4.995281 - 162000 32.315467 2000 5.0755874 - 163000 32.57628 2000 5.0788135 - 164000 32.83119 2000 4.5917317 - 165000 33.085634 2000 4.6255452 - 166000 33.344148 2000 4.2563299 - 167000 33.599342 2000 3.3808566 - 168000 33.853488 2000 3.218931 - 169000 34.121464 2000 3.0839289 - 170000 34.378727 2000 3.0358838 -Loop time of 34.3788 on 4 procs for 150000 steps with 2000 atoms - -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 6.5861 | 10.058 | 12.152 | 68.4 | 29.26 -Neigh | 0.17612 | 0.25274 | 0.30005 | 9.2 | 0.74 -Comm | 1.5024 | 2.6626 | 3.4174 | 44.9 | 7.74 -Output | 0.006542 | 0.019532 | 0.046425 | 11.5 | 0.06 -Modify | 11.945 | 14.674 | 16.29 | 42.7 | 42.68 -Other | | 6.711 | | | 19.52 - -Nlocal: 500 ave 508 max 489 min -Histogram: 1 0 0 1 0 0 0 0 0 2 -Nghost: 446.75 ave 708 max 191 min -Histogram: 1 0 0 1 0 1 0 0 0 1 -Neighs: 4498 ave 5441 max 3786 min -Histogram: 1 1 0 0 0 0 1 0 0 1 - -Total # of neighbors = 17992 -Ave neighs/atom = 8.996 -Neighbor list builds = 403 -Dangerous builds = 0 - -# remove "plug" - need to redefine cylinder region & union - -region cylreg delete -region hopreg delete -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 - -region hopreg union 2 cylreg conereg - -unfix hopper3 -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -run 100000 -Per MPI rank memory allocation (min/avg/max) = 13.68 | 15.35 | 16.59 Mbytes -Step CPU Atoms KinEng - 170000 0 2000 3.0358838 - 171000 0.25455499 2000 3.7725185 - 172000 0.50768304 2000 4.727285 - 173000 0.76122355 2000 5.9840449 - 174000 1.0141416 2000 8.0335022 - 175000 1.2750733 2000 10.177259 - 176000 1.5277736 2000 13.655163 - 177000 1.7810826 2000 17.987975 - 178000 2.0348532 2000 23.266471 - 179000 2.2915859 2000 29.266364 - 180000 2.547174 2000 35.84089 - 181000 2.8009758 2000 43.130989 - 182000 3.0531759 2000 51.177142 - 183000 3.3130636 2000 60.031831 - 184000 3.5651338 2000 69.52374 - 185000 3.8185399 2000 79.941907 - 186000 4.070199 2000 91.195382 - 187000 4.3204038 2000 102.1696 - 188000 4.5699775 2000 112.73657 - 189000 4.8184452 2000 123.57252 - 190000 5.0653601 2000 135.59942 - 191000 5.3119307 2000 147.37757 - 192000 5.5574484 2000 159.12931 - 193000 5.8029084 2000 170.90271 - 194000 6.0463562 2000 185.71189 - 195000 6.2883332 2000 201.83733 - 196000 6.5281694 2000 218.30785 - 197000 6.7682493 2000 236.05694 - 198000 7.0084231 2000 255.23099 - 199000 7.2519951 2000 273.94566 - 200000 7.5010133 2000 293.91107 - 201000 7.7396591 2000 316.52142 - 202000 7.9784184 2000 340.91391 - 203000 8.224021 2000 364.81801 - 204000 8.4597676 2000 390.06478 - 205000 8.6934731 2000 415.90918 - 206000 8.9342225 2000 441.0995 - 207000 9.1714027 2000 467.40314 - 208000 9.4081488 2000 494.93631 - 209000 9.6457636 2000 524.70539 - 210000 9.8831718 2000 556.52058 - 211000 10.118018 2000 589.36821 - 212000 10.3541 2000 622.6887 - 213000 10.587226 2000 657.05888 - 214000 10.820744 2000 691.14292 - 215000 11.055785 2000 726.94959 - 216000 11.298702 2000 762.92802 - 217000 11.534793 2000 801.23648 - 218000 11.769849 2000 841.1559 - 219000 12.000917 2000 882.4342 - 220000 12.232812 2000 924.8466 - 221000 12.461166 2000 968.86229 - 222000 12.698451 2000 1013.1381 - 223000 12.930287 2000 1058.2988 - 224000 13.172862 2000 1105.2911 - 225000 13.405001 2000 1152.8617 - 226000 13.633187 1999 1197.6777 - 227000 13.857126 1998 1243.1211 - 228000 14.079622 1992 1262.1402 - 229000 14.303362 1987 1281.9162 - 230000 14.530392 1973 1264.0674 - 231000 14.756486 1964 1277.8347 - 232000 14.984495 1953 1266.7926 - 233000 15.213102 1940 1244.0038 - 234000 15.441666 1925 1206.4472 - 235000 15.667547 1914 1193.33 - 236000 15.895047 1901 1160.4096 - 237000 16.120833 1890 1141.6816 - 238000 16.346628 1883 1149.1584 - 239000 16.573303 1877 1141.7514 - 240000 16.801035 1871 1146.8662 - 241000 17.024775 1866 1152.561 - 242000 17.248651 1858 1148.2529 - 243000 17.47241 1847 1114.7239 - 244000 17.70222 1832 1070.9996 - 245000 17.926477 1824 1066.7549 - 246000 18.157588 1813 1027.1865 - 247000 18.378868 1804 1011.5024 - 248000 18.599988 1797 993.10451 - 249000 18.819007 1787 951.89778 - 250000 19.044634 1777 926.30475 - 251000 19.254408 1764 875.07091 - 252000 19.465788 1755 824.89358 - 253000 19.676327 1742 742.51957 - 254000 19.887648 1731 708.30958 - 255000 20.094912 1722 690.09761 - 256000 20.299963 1713 638.00218 - 257000 20.506153 1705 596.86839 - 258000 20.713994 1701 583.71937 - 259000 20.919755 1691 549.0049 - 260000 21.123122 1688 549.4278 - 261000 21.332215 1684 535.35719 - 262000 21.533673 1682 546.74031 - 263000 21.737042 1678 532.69324 - 264000 21.941306 1676 537.89254 - 265000 22.15135 1676 559.50898 - 266000 22.358371 1670 540.21452 - 267000 22.563236 1668 557.19857 - 268000 22.764648 1665 569.52869 - 269000 22.96391 1658 543.77057 - 270000 23.172415 1656 550.23716 -Loop time of 23.1725 on 4 procs for 100000 steps with 1656 atoms - -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 3.3849 | 7.3002 | 10.192 | 91.3 | 31.50 -Neigh | 0.14271 | 0.16781 | 0.19054 | 4.5 | 0.72 -Comm | 1.086 | 1.9721 | 2.6157 | 42.7 | 8.51 -Output | 0.0018437 | 0.013918 | 0.041359 | 13.5 | 0.06 -Modify | 8.6598 | 9.3198 | 9.8874 | 16.6 | 40.22 -Other | | 4.399 | | | 18.98 - -Nlocal: 414 ave 454 max 385 min -Histogram: 2 0 0 0 0 0 1 0 0 1 -Nghost: 395.25 ave 645 max 157 min -Histogram: 1 0 0 1 0 1 0 0 0 1 -Neighs: 3498.5 ave 4524 max 2034 min -Histogram: 1 0 0 0 1 0 0 0 0 2 - -Total # of neighbors = 13994 -Ave neighs/atom = 8.45048 -Neighbor list builds = 240 -Dangerous builds = 0 -Total wall time: 0:01:02 diff --git a/examples/granregion/log.27Nov18.granregion.mixer.g++.1 b/examples/granregion/log.27Nov18.granregion.mixer.g++.1 deleted file mode 100644 index f2ba9d7122..0000000000 --- a/examples/granregion/log.27Nov18.granregion.mixer.g++.1 +++ /dev/null @@ -1,602 +0,0 @@ -LAMMPS (27 Nov 2018) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) - using 1 OpenMP thread(s) per MPI task -variable name string mixer - -thermo_modify flush yes -variable seed equal 14314 - -############################################### -# Particle parameters -################################################ - -variable rlo equal 0.3 -variable rhi equal 0.6 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.3 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.6 -variable skin equal ${rhi} -variable skin equal 0.6 - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable kn equal 10^5 -variable kt equal 0.2*${kn} -variable kt equal 0.2*100000 - -variable gravity equal 1.0 -variable density equal 1.0 - -variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 -variable a equal (-2.0*log(${coeffRes})/PI)^2 -variable a equal (-2.0*log(0.1)/PI)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 806.699778405191*0.5 - -variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) - -variable dt equal ${tcol}*0.02 -variable dt equal 0.00236257621510454*0.02 -timestep ${dt} -timestep 4.72515243020908e-05 - -############################################### - -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton on -atom_style sphere - -boundary p p f - -region boxreg block 0 20 0 20 0 20 -create_box 1 boxreg -Created orthogonal box = (0 0 0) to (20 20 20) - 1 by 1 by 1 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 -pair_coeff * * - -neighbor ${skin} bin -neighbor 0.6 bin -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 20, bins = 1 1 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton on, size, history - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -region insreg cylinder z 10 10 8 10 18 side in units box -region cylreg cylinder z 10 10 10 0 20 side in units box - -variable theta equal (step/400000)*2*PI - -region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box -region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box - -region mixer intersect 3 cylreg b1 b2 side in - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - -fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer - -fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 -Particle insertion: 444 every 84653 steps, 1000 by step 169307 - -#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke v_theta -WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:705) -thermo_modify flush yes lost warn - -run 200000 -Per MPI rank memory allocation (min/avg/max) = 5.862 | 5.862 | 5.862 Mbytes -Step CPU Atoms KinEng v_theta - 0 0 0 -0 0 - 1000 0.15327144 444 -0 0.015707963 - 2000 0.30070925 444 -0 0.031415927 - 3000 0.44653535 444 -0 0.04712389 - 4000 0.59226131 444 -0 0.062831853 - 5000 0.73794818 444 -0 0.078539816 - 6000 0.88327622 444 -0 0.09424778 - 7000 1.0286083 444 -0 0.10995574 - 8000 1.1740625 444 -0 0.12566371 - 9000 1.3224797 444 -0 0.14137167 - 10000 1.4717772 444 -0 0.15707963 - 11000 1.6204555 444 -0 0.1727876 - 12000 1.7690799 444 -0 0.18849556 - 13000 1.918304 444 -0 0.20420352 - 14000 2.0670426 444 -0 0.21991149 - 15000 2.2157068 444 -0 0.23561945 - 16000 2.3642888 444 -0 0.25132741 - 17000 2.5129776 444 -0 0.26703538 - 18000 2.6614521 444 -0 0.28274334 - 19000 2.8100598 444 -0 0.2984513 - 20000 2.9591351 444 -0 0.31415927 - 21000 3.1073661 444 -0 0.32986723 - 22000 3.2557554 444 -0 0.34557519 - 23000 3.4041324 444 -0 0.36128316 - 24000 3.5526814 444 -0 0.37699112 - 25000 3.700824 444 -0 0.39269908 - 26000 3.8496137 444 -0 0.40840704 - 27000 3.9986103 444 -0 0.42411501 - 28000 4.1475384 444 -0 0.43982297 - 29000 4.2963772 444 -0 0.45553093 - 30000 4.4454341 444 -0 0.4712389 - 31000 4.5942066 444 -0 0.48694686 - 32000 4.7434044 444 -0 0.50265482 - 33000 4.893549 444 -0 0.51836279 - 34000 5.0427935 444 -0 0.53407075 - 35000 5.1920972 444 -0 0.54977871 - 36000 5.3411844 444 -0 0.56548668 - 37000 5.4904606 444 -0 0.58119464 - 38000 5.6397707 444 -0 0.5969026 - 39000 5.7900345 444 -0 0.61261057 - 40000 5.9405882 444 -0 0.62831853 - 41000 6.089345 444 -0 0.64402649 - 42000 6.2388933 444 -0 0.65973446 - 43000 6.3888056 444 -0 0.67544242 - 44000 6.5379841 444 -0 0.69115038 - 45000 6.6875141 444 -0 0.70685835 - 46000 6.8370855 444 -0 0.72256631 - 47000 6.9866009 444 -0 0.73827427 - 48000 7.1364653 444 -0 0.75398224 - 49000 7.2859883 444 -0 0.7696902 - 50000 7.4368248 444 -0 0.78539816 - 51000 7.5870779 444 -0 0.80110613 - 52000 7.7370813 444 -0 0.81681409 - 53000 7.8879561 444 -0 0.83252205 - 54000 8.0383027 444 -0 0.84823002 - 55000 8.1916294 444 -0 0.86393798 - 56000 8.3458471 444 -0 0.87964594 - 57000 8.5010631 444 -0 0.89535391 - 58000 8.6560545 444 -0 0.91106187 - 59000 8.8110209 444 -0 0.92676983 - 60000 8.9674675 444 -0 0.9424778 - 61000 9.1231239 444 -0 0.95818576 - 62000 9.2785382 444 -0 0.97389372 - 63000 9.4343674 444 -0 0.98960169 - 64000 9.5911541 444 -0 1.0053096 - 65000 9.7477772 444 -0 1.0210176 - 66000 9.9050307 444 -0 1.0367256 - 67000 10.063978 444 -0 1.0524335 - 68000 10.221835 444 -0 1.0681415 - 69000 10.37944 444 -0 1.0838495 - 70000 10.537409 444 -0 1.0995574 - 71000 10.695649 444 -0 1.1152654 - 72000 10.85453 444 -0 1.1309734 - 73000 11.013438 444 -0 1.1466813 - 74000 11.172689 444 -0 1.1623893 - 75000 11.332172 444 -0 1.1780972 - 76000 11.492824 444 -0 1.1938052 - 77000 11.653915 444 -0 1.2095132 - 78000 11.815798 444 -0 1.2252211 - 79000 11.97868 444 -0 1.2409291 - 80000 12.141392 444 -0 1.2566371 - 81000 12.30536 444 -0 1.272345 - 82000 12.468797 444 -0 1.288053 - 83000 12.633028 444 -0 1.303761 - 84000 12.797936 444 -0 1.3194689 - 85000 13.019726 888 -0 1.3351769 - 86000 13.333436 888 -0 1.3508848 - 87000 13.648179 888 -0 1.3665928 - 88000 13.962435 888 -0 1.3823008 - 89000 14.276158 888 -0 1.3980087 - 90000 14.590669 888 -0 1.4137167 - 91000 14.904268 888 -0 1.4294247 - 92000 15.216788 888 -0 1.4451326 - 93000 15.529868 888 -0 1.4608406 - 94000 15.843157 888 -0 1.4765485 - 95000 16.156564 888 -0 1.4922565 - 96000 16.469569 888 -0 1.5079645 - 97000 16.784048 888 -0 1.5236724 - 98000 17.100451 888 -0 1.5393804 - 99000 17.416338 888 -0 1.5550884 - 100000 17.733482 888 -0 1.5707963 - 101000 18.052522 888 -0 1.5865043 - 102000 18.371428 888 -0 1.6022123 - 103000 18.690222 888 -0 1.6179202 - 104000 19.009665 888 -0 1.6336282 - 105000 19.328189 888 -0 1.6493361 - 106000 19.647804 888 -0 1.6650441 - 107000 19.96805 888 -0 1.6807521 - 108000 20.286857 888 -0 1.69646 - 109000 20.607965 888 -0 1.712168 - 110000 20.931749 888 -0 1.727876 - 111000 21.251903 888 -0 1.7435839 - 112000 21.572158 888 -0 1.7592919 - 113000 21.892612 888 -0 1.7749998 - 114000 22.214408 888 -0 1.7907078 - 115000 22.535498 888 -0 1.8064158 - 116000 22.856752 888 -0 1.8221237 - 117000 23.178885 888 -0 1.8378317 - 118000 23.501127 888 -0 1.8535397 - 119000 23.8241 888 -0 1.8692476 - 120000 24.147258 888 -0 1.8849556 - 121000 24.472969 888 -0 1.9006636 - 122000 24.799108 888 -0 1.9163715 - 123000 25.125275 888 -0 1.9320795 - 124000 25.453866 888 -0 1.9477874 - 125000 25.784766 888 -0 1.9634954 - 126000 26.117013 888 -0 1.9792034 - 127000 26.448734 888 -0 1.9949113 - 128000 26.780032 888 -0 2.0106193 - 129000 27.113678 888 -0 2.0263273 - 130000 27.450001 888 -0 2.0420352 - 131000 27.782047 888 -0 2.0577432 - 132000 28.114287 888 -0 2.0734512 - 133000 28.446648 888 -0 2.0891591 - 134000 28.780438 888 -0 2.1048671 - 135000 29.116443 888 -0 2.120575 - 136000 29.451848 888 -0 2.136283 - 137000 29.787778 888 -0 2.151991 - 138000 30.12804 888 -0 2.1676989 - 139000 30.46814 888 -0 2.1834069 - 140000 30.808946 888 -0 2.1991149 - 141000 31.147584 888 -0 2.2148228 - 142000 31.486475 888 -0 2.2305308 - 143000 31.826754 888 -0 2.2462387 - 144000 32.165796 888 -0 2.2619467 - 145000 32.506074 888 -0 2.2776547 - 146000 32.847604 888 -0 2.2933626 - 147000 33.188988 888 -0 2.3090706 - 148000 33.532869 888 -0 2.3247786 - 149000 33.876629 888 -0 2.3404865 - 150000 34.221172 888 -0 2.3561945 - 151000 34.562559 888 -0 2.3719025 - 152000 34.904679 888 -0 2.3876104 - 153000 35.247727 888 -0 2.4033184 - 154000 35.591228 888 -0 2.4190263 - 155000 35.949192 888 -0 2.4347343 - 156000 36.320157 888 -0 2.4504423 - 157000 36.693571 888 -0 2.4661502 - 158000 37.069463 888 -0 2.4818582 - 159000 37.44221 888 -0 2.4975662 - 160000 37.81863 888 -0 2.5132741 - 161000 38.195121 888 -0 2.5289821 - 162000 38.573424 888 -0 2.54469 - 163000 38.950044 888 -0 2.560398 - 164000 39.331977 888 -0 2.576106 - 165000 39.714367 888 -0 2.5918139 - 166000 40.097099 888 -0 2.6075219 - 167000 40.477443 888 -0 2.6232299 - 168000 40.860404 888 -0 2.6389378 - 169000 41.244357 888 -0 2.6546458 - 170000 41.658126 1000 -0 2.6703538 - 171000 42.082517 1000 -0 2.6860617 - 172000 42.507502 1000 -0 2.7017697 - 173000 42.93363 1000 -0 2.7174776 - 174000 43.361133 1000 -0 2.7331856 - 175000 43.792381 1000 -0 2.7488936 - 176000 44.223827 1000 -0 2.7646015 - 177000 44.656581 1000 -0 2.7803095 - 178000 45.087615 1000 -0 2.7960175 - 179000 45.521129 1000 -0 2.8117254 - 180000 45.957808 1000 -0 2.8274334 - 181000 46.391451 1000 -0 2.8431414 - 182000 46.825486 1000 -0 2.8588493 - 183000 47.26091 1000 -0 2.8745573 - 184000 47.694263 1000 -0 2.8902652 - 185000 48.123312 1000 -0 2.9059732 - 186000 48.554081 1000 -0 2.9216812 - 187000 48.982617 1000 -0 2.9373891 - 188000 49.414355 1000 -0 2.9530971 - 189000 49.84753 1000 -0 2.9688051 - 190000 50.284462 1000 -0 2.984513 - 191000 50.71899 1000 -0 3.000221 - 192000 51.157278 1000 -0 3.0159289 - 193000 51.586171 1000 -0 3.0316369 - 194000 52.011691 1000 -0 3.0473449 - 195000 52.437732 1000 -0 3.0630528 - 196000 52.863703 1000 -0 3.0787608 - 197000 53.290403 1000 -0 3.0944688 - 198000 53.7191 1000 -0 3.1101767 - 199000 54.147195 1000 -0 3.1258847 - 200000 54.575967 1000 -0 3.1415927 -Loop time of 54.576 on 1 procs for 200000 steps with 1000 atoms - -Performance: 14960.907 tau/day, 3664.615 timesteps/s -98.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 3.7989 | 3.7989 | 3.7989 | 0.0 | 6.96 -Neigh | 0.067629 | 0.067629 | 0.067629 | 0.0 | 0.12 -Comm | 0.63734 | 0.63734 | 0.63734 | 0.0 | 1.17 -Output | 0.0049303 | 0.0049303 | 0.0049303 | 0.0 | 0.01 -Modify | 49.1 | 49.1 | 49.1 | 0.0 | 89.97 -Other | | 0.9668 | | | 1.77 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 196 ave 196 max 196 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 3910 ave 3910 max 3910 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 3910 -Ave neighs/atom = 3.91 -Neighbor list builds = 219 -Dangerous builds = 0 -unfix ins -run 200000 -Per MPI rank memory allocation (min/avg/max) = 12.65 | 12.65 | 12.65 Mbytes -Step CPU Atoms KinEng v_theta - 200000 0 1000 0.93873133 3.1415927 - 201000 0.4261198 1000 0.93239566 3.1573006 - 202000 0.84928846 1000 0.90333835 3.1730086 - 203000 1.2720087 1000 0.89351493 3.1887165 - 204000 1.6929317 1000 0.87648478 3.2044245 - 205000 2.114043 1000 0.86818482 3.2201325 - 206000 2.5357664 1000 0.86033251 3.2358404 - 207000 2.9579847 1000 0.85442625 3.2515484 - 208000 3.3812878 1000 0.8517451 3.2672564 - 209000 3.8124611 1000 0.84406987 3.2829643 - 210000 4.2440236 1000 0.83964642 3.2986723 - 211000 4.6781921 1000 0.82994066 3.3143802 - 212000 5.1116509 1000 0.82908369 3.3300882 - 213000 5.5468135 1000 0.83115482 3.3457962 - 214000 5.9802556 1000 0.82680518 3.3615041 - 215000 6.4107294 1000 0.8223909 3.3772121 - 216000 6.8419023 1000 0.81872537 3.3929201 - 217000 7.2763367 1000 0.82446065 3.408628 - 218000 7.7160695 1000 0.82278874 3.424336 - 219000 8.1540956 1000 0.83017397 3.440044 - 220000 8.5917952 1000 0.82232305 3.4557519 - 221000 9.0296218 1000 0.82584132 3.4714599 - 222000 9.4719794 1000 0.82143909 3.4871678 - 223000 9.9180939 1000 0.82925587 3.5028758 - 224000 10.361852 1000 0.84546265 3.5185838 - 225000 10.803539 1000 0.84436452 3.5342917 - 226000 11.248456 1000 0.84849375 3.5499997 - 227000 11.695092 1000 0.8409057 3.5657077 - 228000 12.136044 1000 0.83139305 3.5814156 - 229000 12.579807 1000 0.83098473 3.5971236 - 230000 13.02219 1000 0.81335147 3.6128316 - 231000 13.463863 1000 0.78946649 3.6285395 - 232000 13.906293 1000 0.78807613 3.6442475 - 233000 14.348807 1000 0.79086655 3.6599554 - 234000 14.793175 1000 0.79358862 3.6756634 - 235000 15.238316 1000 0.79444252 3.6913714 - 236000 15.683342 1000 0.79392156 3.7070793 - 237000 16.12611 1000 0.80416034 3.7227873 - 238000 16.5711 1000 0.80365093 3.7384953 - 239000 17.014355 1000 0.80860323 3.7542032 - 240000 17.454467 1000 0.80245788 3.7699112 - 241000 17.89162 1000 0.79602568 3.7856191 - 242000 18.330859 1000 0.79023692 3.8013271 - 243000 18.769301 1000 0.79066782 3.8170351 - 244000 19.211293 1000 0.77671368 3.832743 - 245000 19.651443 1000 0.77121874 3.848451 - 246000 20.092102 1000 0.74658977 3.864159 - 247000 20.532732 1000 0.73825017 3.8798669 - 248000 20.975646 1000 0.7187986 3.8955749 - 249000 21.418807 1000 0.71707058 3.9112829 - 250000 21.862497 1000 0.72983635 3.9269908 - 251000 22.311832 1000 0.7355358 3.9426988 - 252000 22.75883 1000 0.74427811 3.9584067 - 253000 23.203455 1000 0.74968093 3.9741147 - 254000 23.651472 1000 0.75350303 3.9898227 - 255000 24.102152 1000 0.75617916 4.0055306 - 256000 24.554236 1000 0.74949839 4.0212386 - 257000 25.008718 1000 0.73534118 4.0369466 - 258000 25.461913 1000 0.73761942 4.0526545 - 259000 25.916674 1000 0.75485851 4.0683625 - 260000 26.373941 1000 0.77147511 4.0840704 - 261000 26.832072 1000 0.76658917 4.0997784 - 262000 27.28741 1000 0.76441563 4.1154864 - 263000 27.742157 1000 0.74449444 4.1311943 - 264000 28.192718 1000 0.7403314 4.1469023 - 265000 28.642541 1000 0.74262656 4.1626103 - 266000 29.09406 1000 0.74117022 4.1783182 - 267000 29.547747 1000 0.73877643 4.1940262 - 268000 29.998243 1000 0.75062626 4.2097342 - 269000 30.449751 1000 0.74649396 4.2254421 - 270000 30.901232 1000 0.75371324 4.2411501 - 271000 31.354755 1000 0.75254842 4.256858 - 272000 31.810717 1000 0.74245946 4.272566 - 273000 32.265754 1000 0.73056023 4.288274 - 274000 32.719719 1000 0.72004393 4.3039819 - 275000 33.173929 1000 0.70665742 4.3196899 - 276000 33.628581 1000 0.69417262 4.3353979 - 277000 34.080936 1000 0.67343474 4.3511058 - 278000 34.532053 1000 0.66922758 4.3668138 - 279000 34.985569 1000 0.66239909 4.3825218 - 280000 35.443496 1000 0.66406486 4.3982297 - 281000 35.901536 1000 0.67123654 4.4139377 - 282000 36.357765 1000 0.67660885 4.4296456 - 283000 36.811956 1000 0.6809288 4.4453536 - 284000 37.266937 1000 0.69561154 4.4610616 - 285000 37.720866 1000 0.70874512 4.4767695 - 286000 38.177032 1000 0.72957833 4.4924775 - 287000 38.633109 1000 0.72891066 4.5081855 - 288000 39.086933 1000 0.72673285 4.5238934 - 289000 39.538699 1000 0.72583062 4.5396014 - 290000 39.991294 1000 0.7209406 4.5553093 - 291000 40.437987 1000 0.70642559 4.5710173 - 292000 40.885753 1000 0.69074151 4.5867253 - 293000 41.326601 1000 0.68041469 4.6024332 - 294000 41.763719 1000 0.6712034 4.6181412 - 295000 42.198532 1000 0.66140336 4.6338492 - 296000 42.635139 1000 0.65458145 4.6495571 - 297000 43.071132 1000 0.63884999 4.6652651 - 298000 43.507309 1000 0.63182296 4.6809731 - 299000 43.943936 1000 0.6324286 4.696681 - 300000 44.383148 1000 0.62640427 4.712389 - 301000 44.819379 1000 0.62138494 4.7280969 - 302000 45.260834 1000 0.62902694 4.7438049 - 303000 45.705719 1000 0.63308052 4.7595129 - 304000 46.14622 1000 0.63266845 4.7752208 - 305000 46.586693 1000 0.63464534 4.7909288 - 306000 47.028768 1000 0.62941378 4.8066368 - 307000 47.470183 1000 0.62801025 4.8223447 - 308000 47.914518 1000 0.62291875 4.8380527 - 309000 48.365654 1000 0.62529494 4.8537606 - 310000 48.817185 1000 0.62504442 4.8694686 - 311000 49.269423 1000 0.63074915 4.8851766 - 312000 49.722869 1000 0.64292914 4.9008845 - 313000 50.175859 1000 0.65319818 4.9165925 - 314000 50.630132 1000 0.66755513 4.9323005 - 315000 51.084836 1000 0.67585436 4.9480084 - 316000 51.539391 1000 0.67676226 4.9637164 - 317000 51.995233 1000 0.67394312 4.9794244 - 318000 52.453581 1000 0.67299959 4.9951323 - 319000 52.906322 1000 0.68074615 5.0108403 - 320000 53.362206 1000 0.67696004 5.0265482 - 321000 53.813824 1000 0.67899008 5.0422562 - 322000 54.264433 1000 0.67901671 5.0579642 - 323000 54.715627 1000 0.67620354 5.0736721 - 324000 55.168 1000 0.67165541 5.0893801 - 325000 55.620891 1000 0.67820953 5.1050881 - 326000 56.073685 1000 0.67490808 5.120796 - 327000 56.526012 1000 0.67238149 5.136504 - 328000 56.977525 1000 0.66885914 5.152212 - 329000 57.431088 1000 0.66876389 5.1679199 - 330000 57.886694 1000 0.66879597 5.1836279 - 331000 58.338381 1000 0.66577546 5.1993358 - 332000 58.791084 1000 0.6602875 5.2150438 - 333000 59.242965 1000 0.65879422 5.2307518 - 334000 59.698559 1000 0.6581474 5.2464597 - 335000 60.153261 1000 0.6521249 5.2621677 - 336000 60.605605 1000 0.63371979 5.2778757 - 337000 61.059824 1000 0.62373279 5.2935836 - 338000 61.510606 1000 0.6212013 5.3092916 - 339000 61.962049 1000 0.62303395 5.3249995 - 340000 62.413564 1000 0.63183785 5.3407075 - 341000 62.86366 1000 0.64387158 5.3564155 - 342000 63.317623 1000 0.65045982 5.3721234 - 343000 63.772034 1000 0.65401192 5.3878314 - 344000 64.225206 1000 0.65181077 5.4035394 - 345000 64.681317 1000 0.64098248 5.4192473 - 346000 65.136483 1000 0.63163559 5.4349553 - 347000 65.588996 1000 0.64182161 5.4506633 - 348000 66.042215 1000 0.65528889 5.4663712 - 349000 66.501687 1000 0.66603277 5.4820792 - 350000 66.960896 1000 0.67362185 5.4977871 - 351000 67.417316 1000 0.68867905 5.5134951 - 352000 67.876742 1000 0.6907547 5.5292031 - 353000 68.336836 1000 0.69043981 5.544911 - 354000 68.797396 1000 0.68676964 5.560619 - 355000 69.255062 1000 0.68019369 5.576327 - 356000 69.711663 1000 0.66189875 5.5920349 - 357000 70.172728 1000 0.65275709 5.6077429 - 358000 70.632655 1000 0.64560617 5.6234508 - 359000 71.091165 1000 0.63865266 5.6391588 - 360000 71.548341 1000 0.6366388 5.6548668 - 361000 72.006137 1000 0.63619567 5.6705747 - 362000 72.466621 1000 0.63986167 5.6862827 - 363000 72.928505 1000 0.656198 5.7019907 - 364000 73.391876 1000 0.66522563 5.7176986 - 365000 73.852366 1000 0.67330205 5.7334066 - 366000 74.317924 1000 0.67997811 5.7491146 - 367000 74.781431 1000 0.67734915 5.7648225 - 368000 75.24363 1000 0.66811078 5.7805305 - 369000 75.704319 1000 0.67232161 5.7962384 - 370000 76.165294 1000 0.67262944 5.8119464 - 371000 76.624971 1000 0.68614241 5.8276544 - 372000 77.085918 1000 0.70293842 5.8433623 - 373000 77.544679 1000 0.71889856 5.8590703 - 374000 78.007103 1000 0.7170296 5.8747783 - 375000 78.468913 1000 0.71258031 5.8904862 - 376000 78.93354 1000 0.70758873 5.9061942 - 377000 79.39396 1000 0.69486822 5.9219022 - 378000 79.850685 1000 0.68311194 5.9376101 - 379000 80.307228 1000 0.67317549 5.9533181 - 380000 80.767418 1000 0.67691049 5.969026 - 381000 81.227579 1000 0.69231691 5.984734 - 382000 81.686924 1000 0.69998609 6.000442 - 383000 82.145783 1000 0.69328258 6.0161499 - 384000 82.604827 1000 0.69903908 6.0318579 - 385000 83.056443 1000 0.69455744 6.0475659 - 386000 83.507131 1000 0.68865933 6.0632738 - 387000 83.95695 1000 0.68630439 6.0789818 - 388000 84.404079 1000 0.6800564 6.0946897 - 389000 84.851053 1000 0.66747339 6.1103977 - 390000 85.298614 1000 0.65695883 6.1261057 - 391000 85.744507 1000 0.65659359 6.1418136 - 392000 86.191348 1000 0.65933663 6.1575216 - 393000 86.632782 1000 0.65170236 6.1732296 - 394000 87.074105 1000 0.65631817 6.1889375 - 395000 87.5177 1000 0.66205838 6.2046455 - 396000 87.963111 1000 0.65512694 6.2203535 - 397000 88.408348 1000 0.65266011 6.2360614 - 398000 88.854042 1000 0.64593806 6.2517694 - 399000 89.298754 1000 0.64940473 6.2674773 - 400000 89.745445 1000 0.66033435 6.2831853 -Loop time of 89.7455 on 1 procs for 200000 steps with 1000 atoms - -Performance: 9098.023 tau/day, 2228.525 timesteps/s -98.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 10.924 | 10.924 | 10.924 | 0.0 | 12.17 -Neigh | 0.10266 | 0.10266 | 0.10266 | 0.0 | 0.11 -Comm | 1.9424 | 1.9424 | 1.9424 | 0.0 | 2.16 -Output | 0.0056458 | 0.0056458 | 0.0056458 | 0.0 | 0.01 -Modify | 75.442 | 75.442 | 75.442 | 0.0 | 84.06 -Other | | 1.329 | | | 1.48 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 272 ave 272 max 272 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 4933 ave 4933 max 4933 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 4933 -Ave neighs/atom = 4.933 -Neighbor list builds = 171 -Dangerous builds = 0 -Total wall time: 0:02:24 diff --git a/examples/granregion/log.27Nov18.granregion.mixer.g++.4 b/examples/granregion/log.27Nov18.granregion.mixer.g++.4 deleted file mode 100644 index be690a7df5..0000000000 --- a/examples/granregion/log.27Nov18.granregion.mixer.g++.4 +++ /dev/null @@ -1,602 +0,0 @@ -LAMMPS (27 Nov 2018) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87) - using 1 OpenMP thread(s) per MPI task -variable name string mixer - -thermo_modify flush yes -variable seed equal 14314 - -############################################### -# Particle parameters -################################################ - -variable rlo equal 0.3 -variable rhi equal 0.6 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.3 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.6 -variable skin equal ${rhi} -variable skin equal 0.6 - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable kn equal 10^5 -variable kt equal 0.2*${kn} -variable kt equal 0.2*100000 - -variable gravity equal 1.0 -variable density equal 1.0 - -variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 -variable a equal (-2.0*log(${coeffRes})/PI)^2 -variable a equal (-2.0*log(0.1)/PI)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 806.699778405191*0.5 - -variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) - -variable dt equal ${tcol}*0.02 -variable dt equal 0.00236257621510454*0.02 -timestep ${dt} -timestep 4.72515243020908e-05 - -############################################### - -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton on -atom_style sphere - -boundary p p f - -region boxreg block 0 20 0 20 0 20 -create_box 1 boxreg -Created orthogonal box = (0 0 0) to (20 20 20) - 1 by 2 by 2 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 -pair_coeff * * - -neighbor ${skin} bin -neighbor 0.6 bin -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 20, bins = 1 1 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton on, size, history - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -region insreg cylinder z 10 10 8 10 18 side in units box -region cylreg cylinder z 10 10 10 0 20 side in units box - -variable theta equal (step/400000)*2*PI - -region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box -region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box - -region mixer intersect 3 cylreg b1 b2 side in - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - -fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer - -fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 -Particle insertion: 444 every 84653 steps, 1000 by step 169307 - -#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke v_theta -WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:705) -thermo_modify flush yes lost warn - -run 200000 -Per MPI rank memory allocation (min/avg/max) = 5.817 | 5.817 | 5.817 Mbytes -Step CPU Atoms KinEng v_theta - 0 0 0 -0 0 - 1000 0.096722603 444 -0 0.015707963 - 2000 0.18796778 444 -0 0.031415927 - 3000 0.27916241 444 -0 0.04712389 - 4000 0.37111688 444 -0 0.062831853 - 5000 0.46224833 444 -0 0.078539816 - 6000 0.55190682 444 -0 0.09424778 - 7000 0.64120579 444 -0 0.10995574 - 8000 0.73025131 444 -0 0.12566371 - 9000 0.82121348 444 -0 0.14137167 - 10000 0.91006637 444 -0 0.15707963 - 11000 0.97034311 444 -0 0.1727876 - 12000 1.030247 444 -0 0.18849556 - 13000 1.0894752 444 -0 0.20420352 - 14000 1.1483686 444 -0 0.21991149 - 15000 1.2138393 444 -0 0.23561945 - 16000 1.2744856 444 -0 0.25132741 - 17000 1.3361425 444 -0 0.26703538 - 18000 1.3998857 444 -0 0.28274334 - 19000 1.4625463 444 -0 0.2984513 - 20000 1.5255082 444 -0 0.31415927 - 21000 1.5845048 444 -0 0.32986723 - 22000 1.6437175 444 -0 0.34557519 - 23000 1.7022173 444 -0 0.36128316 - 24000 1.7614172 444 -0 0.37699112 - 25000 1.8209105 444 -0 0.39269908 - 26000 1.8818901 444 -0 0.40840704 - 27000 1.9439991 444 -0 0.42411501 - 28000 2.0067189 444 -0 0.43982297 - 29000 2.0697014 444 -0 0.45553093 - 30000 2.1327429 444 -0 0.4712389 - 31000 2.1904151 444 -0 0.48694686 - 32000 2.2478669 444 -0 0.50265482 - 33000 2.3062997 444 -0 0.51836279 - 34000 2.3723967 444 -0 0.53407075 - 35000 2.4331915 444 -0 0.54977871 - 36000 2.4937904 444 -0 0.56548668 - 37000 2.5550685 444 -0 0.58119464 - 38000 2.6170652 444 -0 0.5969026 - 39000 2.6789875 444 -0 0.61261057 - 40000 2.7414019 444 -0 0.62831853 - 41000 2.799027 444 -0 0.64402649 - 42000 2.8570235 444 -0 0.65973446 - 43000 2.9140713 444 -0 0.67544242 - 44000 2.9702985 444 -0 0.69115038 - 45000 3.0274565 444 -0 0.70685835 - 46000 3.0860338 444 -0 0.72256631 - 47000 3.1450455 444 -0 0.73827427 - 48000 3.2057948 444 -0 0.75398224 - 49000 3.267339 444 -0 0.7696902 - 50000 3.3300545 444 -0 0.78539816 - 51000 3.3942592 444 -0 0.80110613 - 52000 3.4522727 444 -0 0.81681409 - 53000 3.5117693 444 -0 0.83252205 - 54000 3.5717957 444 -0 0.84823002 - 55000 3.6338761 444 -0 0.86393798 - 56000 3.7006576 444 -0 0.87964594 - 57000 3.7648654 444 -0 0.89535391 - 58000 3.829128 444 -0 0.91106187 - 59000 3.8930187 444 -0 0.92676983 - 60000 3.9581499 444 -0 0.9424778 - 61000 4.0213017 444 -0 0.95818576 - 62000 4.0822632 444 -0 0.97389372 - 63000 4.1443422 444 -0 0.98960169 - 64000 4.2072315 444 -0 1.0053096 - 65000 4.2711387 444 -0 1.0210176 - 66000 4.3361402 444 -0 1.0367256 - 67000 4.4031398 444 -0 1.0524335 - 68000 4.4698064 444 -0 1.0681415 - 69000 4.5374978 444 -0 1.0838495 - 70000 4.6051283 444 -0 1.0995574 - 71000 4.6694169 444 -0 1.1152654 - 72000 4.7335079 444 -0 1.1309734 - 73000 4.7967482 444 -0 1.1466813 - 74000 4.8603547 444 -0 1.1623893 - 75000 4.9250085 444 -0 1.1780972 - 76000 4.9909372 444 -0 1.1938052 - 77000 5.0578024 444 -0 1.2095132 - 78000 5.1250138 444 -0 1.2252211 - 79000 5.1929755 444 -0 1.2409291 - 80000 5.2627637 444 -0 1.2566371 - 81000 5.3280981 444 -0 1.272345 - 82000 5.3957336 444 -0 1.288053 - 83000 5.4648135 444 -0 1.303761 - 84000 5.5368683 444 -0 1.3194689 - 85000 5.6352935 888 -0 1.3351769 - 86000 5.7708502 888 -0 1.3508848 - 87000 5.9051492 888 -0 1.3665928 - 88000 6.0384896 888 -0 1.3823008 - 89000 6.1714747 888 -0 1.3980087 - 90000 6.3042989 888 -0 1.4137167 - 91000 6.4114611 888 -0 1.4294247 - 92000 6.5164247 888 -0 1.4451326 - 93000 6.6219602 888 -0 1.4608406 - 94000 6.728405 888 -0 1.4765485 - 95000 6.8411646 888 -0 1.4922565 - 96000 6.9479821 888 -0 1.5079645 - 97000 7.0569239 888 -0 1.5236724 - 98000 7.1673372 888 -0 1.5393804 - 99000 7.2778809 888 -0 1.5550884 - 100000 7.398834 888 -0 1.5707963 - 101000 7.5066864 888 -0 1.5865043 - 102000 7.6158357 888 -0 1.6022123 - 103000 7.725111 888 -0 1.6179202 - 104000 7.8344197 888 -0 1.6336282 - 105000 7.9532022 888 -0 1.6493361 - 106000 8.0643187 888 -0 1.6650441 - 107000 8.1765473 888 -0 1.6807521 - 108000 8.2890661 888 -0 1.69646 - 109000 8.4048562 888 -0 1.712168 - 110000 8.5208168 888 -0 1.727876 - 111000 8.6303153 888 -0 1.7435839 - 112000 8.7401052 888 -0 1.7592919 - 113000 8.8518219 888 -0 1.7749998 - 114000 8.9638157 888 -0 1.7907078 - 115000 9.0766122 888 -0 1.8064158 - 116000 9.1908746 888 -0 1.8221237 - 117000 9.306145 888 -0 1.8378317 - 118000 9.4229569 888 -0 1.8535397 - 119000 9.5407412 888 -0 1.8692476 - 120000 9.6574531 888 -0 1.8849556 - 121000 9.7683234 888 -0 1.9006636 - 122000 9.8812008 888 -0 1.9163715 - 123000 9.9952521 888 -0 1.9320795 - 124000 10.111879 888 -0 1.9477874 - 125000 10.228812 888 -0 1.9634954 - 126000 10.347842 888 -0 1.9792034 - 127000 10.47052 888 -0 1.9949113 - 128000 10.593136 888 -0 2.0106193 - 129000 10.718124 888 -0 2.0263273 - 130000 10.844211 888 -0 2.0420352 - 131000 10.959177 888 -0 2.0577432 - 132000 11.075781 888 -0 2.0734512 - 133000 11.191418 888 -0 2.0891591 - 134000 11.313376 888 -0 2.1048671 - 135000 11.432321 888 -0 2.120575 - 136000 11.551893 888 -0 2.136283 - 137000 11.672695 888 -0 2.151991 - 138000 11.793487 888 -0 2.1676989 - 139000 11.914089 888 -0 2.1834069 - 140000 12.037441 888 -0 2.1991149 - 141000 12.161974 888 -0 2.2148228 - 142000 12.286641 888 -0 2.2305308 - 143000 12.414012 888 -0 2.2462387 - 144000 12.540939 888 -0 2.2619467 - 145000 12.66985 888 -0 2.2776547 - 146000 12.79975 888 -0 2.2933626 - 147000 12.932702 888 -0 2.3090706 - 148000 13.066088 888 -0 2.3247786 - 149000 13.200814 888 -0 2.3404865 - 150000 13.33565 888 -0 2.3561945 - 151000 13.465995 888 -0 2.3719025 - 152000 13.586622 888 -0 2.3876104 - 153000 13.711423 888 -0 2.4033184 - 154000 13.835058 888 -0 2.4190263 - 155000 13.967661 888 -0 2.4347343 - 156000 14.100609 888 -0 2.4504423 - 157000 14.234485 888 -0 2.4661502 - 158000 14.373325 888 -0 2.4818582 - 159000 14.510608 888 -0 2.4975662 - 160000 14.651416 888 -0 2.5132741 - 161000 14.785767 888 -0 2.5289821 - 162000 14.921569 888 -0 2.54469 - 163000 15.058895 888 -0 2.560398 - 164000 15.198786 888 -0 2.576106 - 165000 15.341662 888 -0 2.5918139 - 166000 15.487128 888 -0 2.6075219 - 167000 15.649383 888 -0 2.6232299 - 168000 15.795388 888 -0 2.6389378 - 169000 15.942671 888 -0 2.6546458 - 170000 16.091824 1000 -0 2.6703538 - 171000 16.239863 1000 -0 2.6860617 - 172000 16.391118 1000 -0 2.7017697 - 173000 16.5417 1000 -0 2.7174776 - 174000 16.69479 1000 -0 2.7331856 - 175000 16.847412 1000 -0 2.7488936 - 176000 17.000374 1000 -0 2.7646015 - 177000 17.15471 1000 -0 2.7803095 - 178000 17.31284 1000 -0 2.7960175 - 179000 17.46991 1000 -0 2.8117254 - 180000 17.629018 1000 -0 2.8274334 - 181000 17.787736 1000 -0 2.8431414 - 182000 17.946197 1000 -0 2.8588493 - 183000 18.105271 1000 -0 2.8745573 - 184000 18.263731 1000 -0 2.8902652 - 185000 18.433277 1000 -0 2.9059732 - 186000 18.594456 1000 -0 2.9216812 - 187000 18.755532 1000 -0 2.9373891 - 188000 18.918447 1000 -0 2.9530971 - 189000 19.080359 1000 -0 2.9688051 - 190000 19.243927 1000 -0 2.984513 - 191000 19.395044 1000 -0 3.000221 - 192000 19.546837 1000 -0 3.0159289 - 193000 19.695827 1000 -0 3.0316369 - 194000 19.843856 1000 -0 3.0473449 - 195000 19.993821 1000 -0 3.0630528 - 196000 20.145787 1000 -0 3.0787608 - 197000 20.298114 1000 -0 3.0944688 - 198000 20.45074 1000 -0 3.1101767 - 199000 20.607595 1000 -0 3.1258847 - 200000 20.760979 1000 -0 3.1415927 -Loop time of 20.7611 on 4 procs for 200000 steps with 1000 atoms - -Performance: 39328.699 tau/day, 9633.409 timesteps/s -98.0% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.57172 | 0.93292 | 1.2995 | 37.1 | 4.49 -Neigh | 0.015648 | 0.018747 | 0.02175 | 2.1 | 0.09 -Comm | 3.17 | 3.6151 | 4.0856 | 23.0 | 17.41 -Output | 0.0051017 | 0.012686 | 0.033359 | 10.6 | 0.06 -Modify | 12.36 | 13.269 | 14.095 | 21.8 | 63.91 -Other | | 2.912 | | | 14.03 - -Nlocal: 250 ave 270 max 230 min -Histogram: 1 0 0 0 1 0 1 0 0 1 -Nghost: 297 ave 337 max 234 min -Histogram: 1 0 0 0 0 1 0 0 0 2 -Neighs: 982.5 ave 1580 max 496 min -Histogram: 2 0 0 0 0 0 0 1 0 1 - -Total # of neighbors = 3930 -Ave neighs/atom = 3.93 -Neighbor list builds = 218 -Dangerous builds = 0 -unfix ins -run 200000 -Per MPI rank memory allocation (min/avg/max) = 12 | 12.19 | 12.35 Mbytes -Step CPU Atoms KinEng v_theta - 200000 0 1000 0.89289812 3.1415927 - 201000 0.15554476 1000 0.90162438 3.1573006 - 202000 0.31118774 1000 0.89175077 3.1730086 - 203000 0.47266722 1000 0.88068523 3.1887165 - 204000 0.64758801 1000 0.88775074 3.2044245 - 205000 0.85137105 1000 0.89009449 3.2201325 - 206000 1.0712745 1000 0.89031724 3.2358404 - 207000 1.3620427 1000 0.90901476 3.2515484 - 208000 1.6051998 1000 0.91977358 3.2672564 - 209000 1.7975032 1000 0.92044257 3.2829643 - 210000 1.9654117 1000 0.90550844 3.2986723 - 211000 2.1186137 1000 0.90179135 3.3143802 - 212000 2.2714169 1000 0.90474936 3.3300882 - 213000 2.4236252 1000 0.9011002 3.3457962 - 214000 2.5737655 1000 0.89619815 3.3615041 - 215000 2.7326233 1000 0.89129064 3.3772121 - 216000 2.8794787 1000 0.88785486 3.3929201 - 217000 3.0264313 1000 0.89448821 3.408628 - 218000 3.1743443 1000 0.89323746 3.424336 - 219000 3.3225086 1000 0.88176869 3.440044 - 220000 3.4717121 1000 0.86989815 3.4557519 - 221000 3.6229391 1000 0.85900389 3.4714599 - 222000 3.7768724 1000 0.85440461 3.4871678 - 223000 3.9287963 1000 0.8604449 3.5028758 - 224000 4.082505 1000 0.84537374 3.5185838 - 225000 4.234731 1000 0.84526488 3.5342917 - 226000 4.3872988 1000 0.85877362 3.5499997 - 227000 4.5396216 1000 0.86762074 3.5657077 - 228000 4.7092509 1000 0.86460359 3.5814156 - 229000 4.8631954 1000 0.85409682 3.5971236 - 230000 5.0194352 1000 0.83902718 3.6128316 - 231000 5.1765387 1000 0.83908755 3.6285395 - 232000 5.3335299 1000 0.83178808 3.6442475 - 233000 5.4917257 1000 0.83369584 3.6599554 - 234000 5.654233 1000 0.8530074 3.6756634 - 235000 5.8163757 1000 0.86385009 3.6913714 - 236000 5.9791231 1000 0.86453337 3.7070793 - 237000 6.1401029 1000 0.86137572 3.7227873 - 238000 6.300632 1000 0.8656285 3.7384953 - 239000 6.4597898 1000 0.85993724 3.7542032 - 240000 6.6216707 1000 0.8484153 3.7699112 - 241000 6.7793672 1000 0.84624799 3.7856191 - 242000 6.939244 1000 0.83739227 3.8013271 - 243000 7.1013088 1000 0.83026469 3.8170351 - 244000 7.267416 1000 0.81060567 3.832743 - 245000 7.4318523 1000 0.81081038 3.848451 - 246000 7.6077905 1000 0.80857771 3.864159 - 247000 7.7763391 1000 0.80353315 3.8798669 - 248000 7.9485247 1000 0.80191903 3.8955749 - 249000 8.1208956 1000 0.79865102 3.9112829 - 250000 8.2921841 1000 0.79407385 3.9269908 - 251000 8.4614651 1000 0.7880275 3.9426988 - 252000 8.6266186 1000 0.79212521 3.9584067 - 253000 8.7913449 1000 0.78976714 3.9741147 - 254000 8.9596558 1000 0.79720779 3.9898227 - 255000 9.1278918 1000 0.79329363 4.0055306 - 256000 9.3016815 1000 0.80851295 4.0212386 - 257000 9.4701304 1000 0.82322071 4.0369466 - 258000 9.6399531 1000 0.83042211 4.0526545 - 259000 9.8090186 1000 0.82773068 4.0683625 - 260000 9.9798045 1000 0.8246773 4.0840704 - 261000 10.148952 1000 0.81374287 4.0997784 - 262000 10.318855 1000 0.79936963 4.1154864 - 263000 10.496092 1000 0.78124408 4.1311943 - 264000 10.671031 1000 0.77790646 4.1469023 - 265000 10.843052 1000 0.77212005 4.1626103 - 266000 11.01867 1000 0.77977752 4.1783182 - 267000 11.192151 1000 0.79237542 4.1940262 - 268000 11.362491 1000 0.80631398 4.2097342 - 269000 11.53223 1000 0.82380407 4.2254421 - 270000 11.7123 1000 0.82477127 4.2411501 - 271000 11.883593 1000 0.81655074 4.256858 - 272000 12.052348 1000 0.80678676 4.272566 - 273000 12.220196 1000 0.79162789 4.288274 - 274000 12.395164 1000 0.78896081 4.3039819 - 275000 12.569757 1000 0.77904648 4.3196899 - 276000 12.748754 1000 0.78252999 4.3353979 - 277000 12.91648 1000 0.78293295 4.3511058 - 278000 13.086087 1000 0.78311337 4.3668138 - 279000 13.260159 1000 0.77657634 4.3825218 - 280000 13.428503 1000 0.76835711 4.3982297 - 281000 13.596094 1000 0.75586438 4.4139377 - 282000 13.763325 1000 0.74600306 4.4296456 - 283000 13.932867 1000 0.73228762 4.4453536 - 284000 14.098865 1000 0.72344939 4.4610616 - 285000 14.269317 1000 0.72160289 4.4767695 - 286000 14.441196 1000 0.71321619 4.4924775 - 287000 14.614458 1000 0.72631772 4.5081855 - 288000 14.783358 1000 0.74390396 4.5238934 - 289000 14.953564 1000 0.77320352 4.5396014 - 290000 15.12428 1000 0.77249469 4.5553093 - 291000 15.283974 1000 0.7583723 4.5710173 - 292000 15.449553 1000 0.74568347 4.5867253 - 293000 15.611965 1000 0.74108034 4.6024332 - 294000 15.770807 1000 0.72706174 4.6181412 - 295000 15.927151 1000 0.71122597 4.6338492 - 296000 16.086734 1000 0.70272297 4.6495571 - 297000 16.245418 1000 0.6945394 4.6652651 - 298000 16.406617 1000 0.69541258 4.6809731 - 299000 16.568989 1000 0.71696092 4.696681 - 300000 16.754911 1000 0.72939561 4.712389 - 301000 16.919453 1000 0.73621801 4.7280969 - 302000 17.07794 1000 0.72052605 4.7438049 - 303000 17.234397 1000 0.71057318 4.7595129 - 304000 17.39014 1000 0.70014814 4.7752208 - 305000 17.550789 1000 0.68855925 4.7909288 - 306000 17.718802 1000 0.68665019 4.8066368 - 307000 17.874036 1000 0.6831349 4.8223447 - 308000 18.029367 1000 0.67929468 4.8380527 - 309000 18.188065 1000 0.67833006 4.8537606 - 310000 18.348243 1000 0.67764037 4.8694686 - 311000 18.512475 1000 0.68271978 4.8851766 - 312000 18.676519 1000 0.69021026 4.9008845 - 313000 18.836426 1000 0.68795473 4.9165925 - 314000 18.997681 1000 0.68308892 4.9323005 - 315000 19.158794 1000 0.68086977 4.9480084 - 316000 19.318186 1000 0.67879169 4.9637164 - 317000 19.479364 1000 0.68128526 4.9794244 - 318000 19.645085 1000 0.68718719 4.9951323 - 319000 19.806831 1000 0.68419901 5.0108403 - 320000 19.97005 1000 0.68045269 5.0265482 - 321000 20.130643 1000 0.68430036 5.0422562 - 322000 20.291637 1000 0.68195368 5.0579642 - 323000 20.457605 1000 0.67964011 5.0736721 - 324000 20.621699 1000 0.67681293 5.0893801 - 325000 20.78525 1000 0.67601868 5.1050881 - 326000 20.950321 1000 0.67600265 5.120796 - 327000 21.11346 1000 0.68484094 5.136504 - 328000 21.276964 1000 0.68526189 5.152212 - 329000 21.440971 1000 0.67602072 5.1679199 - 330000 21.609791 1000 0.68222852 5.1836279 - 331000 21.773574 1000 0.68825647 5.1993358 - 332000 21.93854 1000 0.68168415 5.2150438 - 333000 22.102281 1000 0.67460357 5.2307518 - 334000 22.265741 1000 0.67747925 5.2464597 - 335000 22.436954 1000 0.681763 5.2621677 - 336000 22.614367 1000 0.67611867 5.2778757 - 337000 22.779064 1000 0.66903217 5.2935836 - 338000 22.945739 1000 0.6684293 5.3092916 - 339000 23.111375 1000 0.66465194 5.3249995 - 340000 23.278674 1000 0.66226848 5.3407075 - 341000 23.444642 1000 0.66407188 5.3564155 - 342000 23.614615 1000 0.65762812 5.3721234 - 343000 23.785007 1000 0.66936507 5.3878314 - 344000 23.956265 1000 0.67424224 5.4035394 - 345000 24.129057 1000 0.684271 5.4192473 - 346000 24.303073 1000 0.68294352 5.4349553 - 347000 24.475812 1000 0.69795697 5.4506633 - 348000 24.652771 1000 0.69818863 5.4663712 - 349000 24.830973 1000 0.69578798 5.4820792 - 350000 25.00923 1000 0.69377251 5.4977871 - 351000 25.185421 1000 0.69638202 5.5134951 - 352000 25.363647 1000 0.70115823 5.5292031 - 353000 25.540517 1000 0.70891635 5.544911 - 354000 25.718709 1000 0.70876639 5.560619 - 355000 25.893633 1000 0.71130235 5.576327 - 356000 26.068423 1000 0.69380913 5.5920349 - 357000 26.243801 1000 0.67934899 5.6077429 - 358000 26.418883 1000 0.67024516 5.6234508 - 359000 26.594722 1000 0.66145645 5.6391588 - 360000 26.770322 1000 0.65335546 5.6548668 - 361000 26.946396 1000 0.65495192 5.6705747 - 362000 27.12296 1000 0.64973833 5.6862827 - 363000 27.298461 1000 0.64532381 5.7019907 - 364000 27.473586 1000 0.64282855 5.7176986 - 365000 27.653872 1000 0.64451862 5.7334066 - 366000 27.830317 1000 0.64366439 5.7491146 - 367000 28.007037 1000 0.64395479 5.7648225 - 368000 28.184079 1000 0.65827587 5.7805305 - 369000 28.376009 1000 0.66311341 5.7962384 - 370000 28.557287 1000 0.66165026 5.8119464 - 371000 28.736569 1000 0.66878374 5.8276544 - 372000 28.91063 1000 0.66944548 5.8433623 - 373000 29.084648 1000 0.66061945 5.8590703 - 374000 29.258649 1000 0.65320954 5.8747783 - 375000 29.433156 1000 0.64641195 5.8904862 - 376000 29.611781 1000 0.64631388 5.9061942 - 377000 29.78531 1000 0.64232398 5.9219022 - 378000 29.955917 1000 0.63805257 5.9376101 - 379000 30.126378 1000 0.63666047 5.9533181 - 380000 30.297285 1000 0.63651856 5.969026 - 381000 30.471635 1000 0.6377374 5.984734 - 382000 30.644813 1000 0.64750107 6.000442 - 383000 30.816208 1000 0.65655138 6.0161499 - 384000 30.986444 1000 0.65408935 6.0318579 - 385000 31.156501 1000 0.64437236 6.0475659 - 386000 31.327665 1000 0.63862174 6.0632738 - 387000 31.49731 1000 0.64133807 6.0789818 - 388000 31.682031 1000 0.64174374 6.0946897 - 389000 31.85148 1000 0.64480071 6.1103977 - 390000 32.020336 1000 0.64982943 6.1261057 - 391000 32.187634 1000 0.6461109 6.1418136 - 392000 32.357282 1000 0.64044412 6.1575216 - 393000 32.527796 1000 0.64662995 6.1732296 - 394000 32.704323 1000 0.65330527 6.1889375 - 395000 32.880643 1000 0.66026265 6.2046455 - 396000 33.048614 1000 0.6718969 6.2203535 - 397000 33.222059 1000 0.66481385 6.2360614 - 398000 33.391738 1000 0.66685494 6.2517694 - 399000 33.560431 1000 0.6612594 6.2674773 - 400000 33.729715 1000 0.65289572 6.2831853 -Loop time of 33.7298 on 4 procs for 200000 steps with 1000 atoms - -Performance: 24207.249 tau/day, 5929.470 timesteps/s -97.9% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.6748 | 2.6848 | 3.6646 | 58.4 | 7.96 -Neigh | 0.021206 | 0.026438 | 0.03191 | 3.1 | 0.08 -Comm | 6.133 | 7.3745 | 8.6652 | 45.0 | 21.86 -Output | 0.0053763 | 0.016101 | 0.044719 | 13.0 | 0.05 -Modify | 18.26 | 20.115 | 22.413 | 39.2 | 59.64 -Other | | 3.513 | | | 10.42 - -Nlocal: 250 ave 266 max 230 min -Histogram: 1 0 0 0 0 1 1 0 0 1 -Nghost: 401.5 ave 476 max 325 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 1264 ave 1634 max 895 min -Histogram: 1 0 1 0 0 0 0 1 0 1 - -Total # of neighbors = 5056 -Ave neighs/atom = 5.056 -Neighbor list builds = 160 -Dangerous builds = 0 -Total wall time: 0:00:54 diff --git a/examples/granular/in.pour.heat b/examples/granular/in.pour.heat index 495a80454a..69590389b5 100644 --- a/examples/granular/in.pour.heat +++ b/examples/granular/in.pour.heat @@ -51,7 +51,7 @@ region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${ fix 0 all balance 100 1.0 shift xy 5 1.1 fix 1 all nve/sphere -fix 2 all temp/integrate constant 1.0 +fix 2 all heat/flow/sphere/temp constant 1.0 fix grav all gravity 10 vector 0 0 -1 fix ins1 all pour 1000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} fix ins2 all pour 1000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} diff --git a/examples/granular/log.15Sep22.pour.drum.g++.1 b/examples/granular/log.15Sep22.pour.drum.g++.1 new file mode 100644 index 0000000000..75cc115dd1 --- /dev/null +++ b/examples/granular/log.15Sep22.pour.drum.g++.1 @@ -0,0 +1,272 @@ +LAMMPS (15 Sep 2022) +# pour two types of particles (cohesive and non-cohesive) into cylinder +# 'turn' cylinder by changing direction of gravity, then rotate it. +# This simulates a rotating drum powder characterization experiment. + +variable name string rotating_drum_two_types + +atom_style sphere +units lj + +############################################### +# Geometry-related parameters +############################################### + +variable boxx equal 30 +variable boxy equal 30 +variable boxz equal 50 + +variable drum_rad equal ${boxx}*0.5 +variable drum_rad equal 30*0.5 +variable drum_height equal 20 + +variable xc equal 0.5*${boxx} +variable xc equal 0.5*30 +variable yc equal 0.5*${boxx} +variable yc equal 0.5*30 +variable zc equal 0.5*${boxz} +variable zc equal 0.5*50 + +############################################### +# Particle-related parameters +############################################### +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable cyl_rad_inner equal ${drum_rad}-1.1*${rhi} +variable cyl_rad_inner equal 15-1.1*${rhi} +variable cyl_rad_inner equal 15-1.1*0.5 + +variable dens equal 1.0 + +variable skin equal 0.4*${rhi} +variable skin equal 0.4*0.5 + +############# +processors * * 1 +region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} +region boxreg block 0 30 0 ${boxy} 0 ${boxz} +region boxreg block 0 30 0 30 0 ${boxz} +region boxreg block 0 30 0 30 0 50 +create_box 2 boxreg +Created orthogonal box = (0 0 0) to (30 30 50) + 1 by 1 by 1 MPI processor grid +change_box all boundary p p f +Changing box ... + +pair_style granular +pair_coeff 1 * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji +pair_coeff 2 2 jkr 1e5 0.1 0.3 50 tangential mindlin NULL 1.0 0.5 rolling sds 1e3 1e3 0.1 twisting marshall + +variable theta equal 0 + +region curved_wall cylinder z ${xc} ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 15 0 0 0 1 +region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region bottom_wall plane 15 ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 ${yc} 0 0 0 1 +region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 15 0 0 0 1 + +region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 15 ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 15 15 ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 15 15 14.45 ${drum_height} ${boxz} +region insreg cylinder z 15 15 14.45 20 ${boxz} +region insreg cylinder z 15 15 14.45 20 50 + +fix 0 all balance 100 1.0 shift xy 5 1.1 +fix 1 all nve/sphere +fix grav all gravity 10 vector 0 0 -1 +fix ins1 all pour 2000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 9396 every 490 steps, 2000 by step 1 +fix ins2 all pour 2000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 9396 every 490 steps, 2000 by step 1 + +comm_modify vel yes + +neighbor ${skin} bin +neighbor 0.2 bin +neigh_modify delay 0 every 1 check yes + +fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region bottom_wall + +thermo_style custom step atoms ke v_theta +thermo_modify lost warn +thermo 100 + +timestep 0.001 + +#dump 1 all custom 100 ${name}.dump id type radius mass x y z + +#For removal later +compute 1 all property/atom radius +variable zmax atom z+c_1>0.5*${drum_height} +variable zmax atom z+c_1>0.5*20 +group delgroup dynamic all var zmax every 10000 +dynamic group delgroup defined + +run 2000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 50 50 84 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair granular, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 16.08 | 16.08 | 16.08 Mbytes + Step Atoms KinEng v_theta + 0 0 -0 0 + 100 4000 -0 0 + 200 4000 -0 0 + 300 4000 -0 0 + 400 4000 -0 0 + 500 4000 -0 0 + 600 4000 -0 0 + 700 4000 -0 0 + 800 4000 -0 0 + 900 4000 -0 0 + 1000 4000 -0 0 + 1100 4000 -0 0 + 1200 4000 -0 0 + 1300 4000 -0 0 + 1400 4000 -0 0 + 1500 4000 -0 0 + 1600 4000 -0 0 + 1700 4000 -0 0 + 1800 4000 -0 0 + 1900 4000 -0 0 + 2000 4000 -0 0 +Loop time of 2.81549 on 1 procs for 2000 steps with 4000 atoms + +Performance: 61374.657 tau/day, 710.355 timesteps/s, 2.841 Matom-step/s +98.4% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.35362 | 0.35362 | 0.35362 | 0.0 | 12.56 +Neigh | 1.0852 | 1.0852 | 1.0852 | 0.0 | 38.54 +Comm | 0.041891 | 0.041891 | 0.041891 | 0.0 | 1.49 +Output | 0.00059151 | 0.00059151 | 0.00059151 | 0.0 | 0.02 +Modify | 1.2814 | 1.2814 | 1.2814 | 0.0 | 45.51 +Other | | 0.0528 | | | 1.88 + +Nlocal: 4000 ave 4000 max 4000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 179 ave 179 max 179 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 7019 ave 7019 max 7019 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 7019 +Ave neighs/atom = 1.75475 +Neighbor list builds = 1000 +Dangerous builds = 0 + +#Remove any particles that are above z > 0.5*drum_height +delete_atoms group delgroup +Deleted 0 atoms, new total = 4000 + +#Add top lid +region top_wall plane ${xc} ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 15 ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 ${yc} 0 0 0 1 +region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 15 0 0 0 1 +fix 5 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region top_wall + +# 'Turn' drum by switching the direction of gravity +unfix grav +unfix ins1 +unfix ins2 +fix grav all gravity 10 vector 0 -1 0 + +variable theta equal 2*PI*elapsed/20000.0 +run 3000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 22.42 | 22.42 | 22.42 Mbytes + Step Atoms KinEng v_theta + 2000 4000 59.969827 0 + 2100 4000 47.251389 0.031415927 + 2200 4000 33.726755 0.062831853 + 2300 4000 24.212479 0.09424778 + 2400 4000 17.366268 0.12566371 + 2500 4000 18.502318 0.15707963 + 2600 4000 17.44981 0.18849556 + 2700 4000 16.068315 0.21991149 + 2800 4000 14.252644 0.25132741 + 2900 4000 11.544019 0.28274334 + 3000 4000 9.0353662 0.31415927 + 3100 4000 6.9955912 0.34557519 + 3200 4000 5.955137 0.37699112 + 3300 4000 5.8947849 0.40840704 + 3400 4000 6.0544729 0.43982297 + 3500 4000 6.5326359 0.4712389 + 3600 4000 6.6047764 0.50265482 + 3700 4000 6.7073614 0.53407075 + 3800 4000 6.7367804 0.56548668 + 3900 4000 6.6178006 0.5969026 + 4000 4000 6.3834858 0.62831853 + 4100 4000 5.8660652 0.65973446 + 4200 4000 5.308513 0.69115038 + 4300 4000 4.7270842 0.72256631 + 4400 4000 4.1920733 0.75398224 + 4500 4000 3.7068814 0.78539816 + 4600 4000 3.3259615 0.81681409 + 4700 4000 2.9339231 0.84823002 + 4800 4000 2.670752 0.87964594 + 4900 4000 2.4509115 0.91106187 + 5000 4000 2.2609335 0.9424778 +Loop time of 9.82178 on 1 procs for 3000 steps with 4000 atoms + +Performance: 26390.330 tau/day, 305.444 timesteps/s, 1.222 Matom-step/s +99.4% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.2932 | 3.2932 | 3.2932 | 0.0 | 33.53 +Neigh | 2.2872 | 2.2872 | 2.2872 | 0.0 | 23.29 +Comm | 0.067117 | 0.067117 | 0.067117 | 0.0 | 0.68 +Output | 0.00093425 | 0.00093425 | 0.00093425 | 0.0 | 0.01 +Modify | 4.0986 | 4.0986 | 4.0986 | 0.0 | 41.73 +Other | | 0.07476 | | | 0.76 + +Nlocal: 4000 ave 4000 max 4000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 363 ave 363 max 363 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 13089 ave 13089 max 13089 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 13089 +Ave neighs/atom = 3.27225 +Neighbor list builds = 1247 +Dangerous builds = 130 +Total wall time: 0:00:12 diff --git a/examples/granular/log.15Sep22.pour.drum.g++.4 b/examples/granular/log.15Sep22.pour.drum.g++.4 new file mode 100644 index 0000000000..4ab6f92b8b --- /dev/null +++ b/examples/granular/log.15Sep22.pour.drum.g++.4 @@ -0,0 +1,272 @@ +LAMMPS (15 Sep 2022) +# pour two types of particles (cohesive and non-cohesive) into cylinder +# 'turn' cylinder by changing direction of gravity, then rotate it. +# This simulates a rotating drum powder characterization experiment. + +variable name string rotating_drum_two_types + +atom_style sphere +units lj + +############################################### +# Geometry-related parameters +############################################### + +variable boxx equal 30 +variable boxy equal 30 +variable boxz equal 50 + +variable drum_rad equal ${boxx}*0.5 +variable drum_rad equal 30*0.5 +variable drum_height equal 20 + +variable xc equal 0.5*${boxx} +variable xc equal 0.5*30 +variable yc equal 0.5*${boxx} +variable yc equal 0.5*30 +variable zc equal 0.5*${boxz} +variable zc equal 0.5*50 + +############################################### +# Particle-related parameters +############################################### +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable cyl_rad_inner equal ${drum_rad}-1.1*${rhi} +variable cyl_rad_inner equal 15-1.1*${rhi} +variable cyl_rad_inner equal 15-1.1*0.5 + +variable dens equal 1.0 + +variable skin equal 0.4*${rhi} +variable skin equal 0.4*0.5 + +############# +processors * * 1 +region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} +region boxreg block 0 30 0 ${boxy} 0 ${boxz} +region boxreg block 0 30 0 30 0 ${boxz} +region boxreg block 0 30 0 30 0 50 +create_box 2 boxreg +Created orthogonal box = (0 0 0) to (30 30 50) + 2 by 2 by 1 MPI processor grid +change_box all boundary p p f +Changing box ... + +pair_style granular +pair_coeff 1 * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji +pair_coeff 2 2 jkr 1e5 0.1 0.3 50 tangential mindlin NULL 1.0 0.5 rolling sds 1e3 1e3 0.1 twisting marshall + +variable theta equal 0 + +region curved_wall cylinder z ${xc} ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 ${yc} 0 0 0 1 +region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 15 0 0 0 1 +region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region bottom_wall plane 15 ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 ${yc} 0 0 0 1 +region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 15 0 0 0 1 + +region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 15 ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 15 15 ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 15 15 14.45 ${drum_height} ${boxz} +region insreg cylinder z 15 15 14.45 20 ${boxz} +region insreg cylinder z 15 15 14.45 20 50 + +fix 0 all balance 100 1.0 shift xy 5 1.1 +fix 1 all nve/sphere +fix grav all gravity 10 vector 0 0 -1 +fix ins1 all pour 2000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 9396 every 490 steps, 2000 by step 1 +fix ins2 all pour 2000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 9396 every 490 steps, 2000 by step 1 + +comm_modify vel yes + +neighbor ${skin} bin +neighbor 0.2 bin +neigh_modify delay 0 every 1 check yes + +fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region bottom_wall + +thermo_style custom step atoms ke v_theta +thermo_modify lost warn +thermo 100 + +timestep 0.001 + +#dump 1 all custom 100 ${name}.dump id type radius mass x y z + +#For removal later +compute 1 all property/atom radius +variable zmax atom z+c_1>0.5*${drum_height} +variable zmax atom z+c_1>0.5*20 +group delgroup dynamic all var zmax every 10000 +dynamic group delgroup defined + +run 2000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 50 50 84 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair granular, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 15.3 | 15.3 | 15.3 Mbytes + Step Atoms KinEng v_theta + 0 0 -0 0 + 100 4000 -0 0 + 200 4000 -0 0 + 300 4000 -0 0 + 400 4000 -0 0 + 500 4000 -0 0 + 600 4000 -0 0 + 700 4000 -0 0 + 800 4000 -0 0 + 900 4000 -0 0 + 1000 4000 -0 0 + 1100 4000 -0 0 + 1200 4000 -0 0 + 1300 4000 -0 0 + 1400 4000 -0 0 + 1500 4000 -0 0 + 1600 4000 -0 0 + 1700 4000 -0 0 + 1800 4000 -0 0 + 1900 4000 -0 0 + 2000 4000 -0 0 +Loop time of 0.744926 on 4 procs for 2000 steps with 4000 atoms + +Performance: 231969.322 tau/day, 2684.830 timesteps/s, 10.739 Matom-step/s +98.1% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.064917 | 0.069813 | 0.074844 | 1.7 | 9.37 +Neigh | 0.15075 | 0.15915 | 0.1692 | 1.9 | 21.36 +Comm | 0.11223 | 0.11821 | 0.12247 | 1.1 | 15.87 +Output | 0.00030739 | 0.00036898 | 0.00046777 | 0.0 | 0.05 +Modify | 0.36068 | 0.36657 | 0.37031 | 0.7 | 49.21 +Other | | 0.03082 | | | 4.14 + +Nlocal: 1000 ave 1010 max 990 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 285 ave 287 max 283 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 1714.25 ave 1764 max 1651 min +Histogram: 1 0 1 0 0 0 0 0 0 2 + +Total # of neighbors = 6857 +Ave neighs/atom = 1.71425 +Neighbor list builds = 1000 +Dangerous builds = 0 + +#Remove any particles that are above z > 0.5*drum_height +delete_atoms group delgroup +Deleted 0 atoms, new total = 4000 + +#Add top lid +region top_wall plane ${xc} ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 15 ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 +region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 ${yc} 0 0 0 1 +region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 15 0 0 0 1 +fix 5 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region top_wall + +# 'Turn' drum by switching the direction of gravity +unfix grav +unfix ins1 +unfix ins2 +fix grav all gravity 10 vector 0 -1 0 + +variable theta equal 2*PI*elapsed/20000.0 +run 3000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 21.6 | 21.6 | 21.6 Mbytes + Step Atoms KinEng v_theta + 2000 4000 60.10546 0 + 2100 4000 47.274123 0.031415927 + 2200 4000 33.475582 0.062831853 + 2300 4000 24.083669 0.09424778 + 2400 4000 17.36351 0.12566371 + 2500 4000 18.576501 0.15707963 + 2600 4000 17.39 0.18849556 + 2700 4000 15.789254 0.21991149 + 2800 4000 14.08156 0.25132741 + 2900 4000 11.636681 0.28274334 + 3000 4000 8.9897685 0.31415927 + 3100 4000 7.0703519 0.34557519 + 3200 4000 6.0741809 0.37699112 + 3300 4000 5.8286097 0.40840704 + 3400 4000 6.059001 0.43982297 + 3500 4000 6.4310861 0.4712389 + 3600 4000 6.3957528 0.50265482 + 3700 4000 6.4858292 0.53407075 + 3800 4000 6.4685962 0.56548668 + 3900 4000 6.3469676 0.5969026 + 4000 4000 6.2808022 0.62831853 + 4100 4000 5.957048 0.65973446 + 4200 4000 5.5378951 0.69115038 + 4300 4000 4.8523264 0.72256631 + 4400 4000 4.2485239 0.75398224 + 4500 4000 3.7587486 0.78539816 + 4600 4000 3.327008 0.81681409 + 4700 4000 2.9421013 0.84823002 + 4800 4000 2.75247 0.87964594 + 4900 4000 2.5306332 0.91106187 + 5000 4000 2.352504 0.9424778 +Loop time of 2.48704 on 4 procs for 3000 steps with 4000 atoms + +Performance: 104220.238 tau/day, 1206.253 timesteps/s, 4.825 Matom-step/s +98.6% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.51605 | 0.70407 | 0.86299 | 14.7 | 28.31 +Neigh | 0.3522 | 0.42808 | 0.50041 | 8.0 | 17.21 +Comm | 0.17318 | 0.42324 | 0.7046 | 29.0 | 17.02 +Output | 0.00079725 | 0.0013956 | 0.002092 | 1.3 | 0.06 +Modify | 0.68507 | 0.79676 | 0.90954 | 8.9 | 32.04 +Other | | 0.1335 | | | 5.37 + +Nlocal: 1000 ave 1330 max 670 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 525.5 ave 781 max 417 min +Histogram: 2 1 0 0 0 0 0 0 0 1 +Neighs: 3243.75 ave 4460 max 2012 min +Histogram: 1 1 0 0 0 0 0 0 1 1 + +Total # of neighbors = 12975 +Ave neighs/atom = 3.24375 +Neighbor list builds = 1299 +Dangerous builds = 129 +Total wall time: 0:00:03 diff --git a/examples/granular/log.15Sep22.pour.flatwall.g++.1 b/examples/granular/log.15Sep22.pour.flatwall.g++.1 new file mode 100644 index 0000000000..f863993b46 --- /dev/null +++ b/examples/granular/log.15Sep22.pour.flatwall.g++.1 @@ -0,0 +1,195 @@ +LAMMPS (15 Sep 2022) +# pour two types of particles (cohesive and non-cohesive) on flat wall + +variable name string pour_two_types + +atom_style sphere +units lj + +############################################### +# Geometry-related parameters +############################################### + +variable boxx equal 20 +variable boxy equal 20 +variable boxz equal 30 + +variable xc1 equal 0.3*${boxx} +variable xc1 equal 0.3*20 +variable xc2 equal 0.7*${boxx} +variable xc2 equal 0.7*20 +variable yc equal 0.5*${boxy} +variable yc equal 0.5*20 + +############################################### +# Particle-related parameters +############################################### +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable dens equal 1.0 + +variable skin equal 0.3*${rhi} +variable skin equal 0.3*0.5 + +############# +processors * * 1 +region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} +region boxreg block 0 20 0 ${boxy} 0 ${boxz} +region boxreg block 0 20 0 20 0 ${boxz} +region boxreg block 0 20 0 20 0 30 +create_box 2 boxreg +Created orthogonal box = (0 0 0) to (20 20 30) + 1 by 1 by 1 MPI processor grid +change_box all boundary p p f +Changing box ... + +pair_style granular +pair_coeff 1 * jkr 1000.0 50.0 0.3 10 tangential mindlin 800.0 1.0 0.5 rolling sds 500.0 200.0 0.5 twisting marshall +pair_coeff 2 2 hertz 200.0 20.0 tangential linear_history 300.0 1.0 0.1 rolling sds 200.0 100.0 0.1 twisting marshall + +comm_modify vel yes + +region insreg1 cylinder z ${xc1} ${yc} 5 15 ${boxz} +region insreg1 cylinder z 6 ${yc} 5 15 ${boxz} +region insreg1 cylinder z 6 10 5 15 ${boxz} +region insreg1 cylinder z 6 10 5 15 30 +region insreg2 cylinder z ${xc2} ${yc} 5 15 ${boxz} +region insreg2 cylinder z 14 ${yc} 5 15 ${boxz} +region insreg2 cylinder z 14 10 5 15 ${boxz} +region insreg2 cylinder z 14 10 5 15 30 + +fix 1 all nve/sphere +fix grav all gravity 10.0 vector 0 0 -1 +fix ins1 all pour 1500 1 3123 region insreg1 diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens ${dens} ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 1 +Particle insertion: 562 every 346 steps, 1500 by step 693 +fix ins2 all pour 1500 2 3123 region insreg2 diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens ${dens} ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 1 +Particle insertion: 562 every 346 steps, 1500 by step 693 + +neighbor ${skin} bin +neighbor 0.15 bin +neigh_modify delay 0 every 1 check yes + +fix 3 all wall/gran granular hertz/material 1e5 1e3 0.3 tangential mindlin NULL 1.0 0.5 zplane 0 NULL + +thermo_style custom step atoms ke +thermo_modify lost warn +thermo 100 + +timestep 0.001 + +#dump 1 all custom 100 ${name}.dump id type radius mass x y z + +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.15 + ghost atom cutoff = 1.15 + binsize = 0.575, bins = 35 35 53 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair granular, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 15.27 | 15.27 | 15.27 Mbytes + Step Atoms KinEng + 0 0 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 100 926 -0 + 200 926 -0 + 300 926 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 400 1498 -0 + 500 1498 -0 + 600 1498 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 700 2275 -0 + 800 2275 -0 + 900 2275 -0 + 1000 2275 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 1100 2954 -0 + 1200 2954 -0 + 1300 2954 -0 + 1400 3000 -0 + 1500 3000 -0 + 1600 3000 -0 + 1700 3000 -0 + 1800 3000 -0 + 1900 3000 -0 + 2000 3000 -0 + 2100 3000 -0 + 2200 3000 -0 + 2300 3000 -0 + 2400 3000 -0 + 2500 3000 -0 + 2600 3000 -0 + 2700 3000 -0 + 2800 3000 -0 + 2900 3000 -0 + 3000 3000 -0 + 3100 3000 -0 + 3200 3000 -0 + 3300 3000 -0 + 3400 3000 -0 + 3500 3000 -0 + 3600 3000 -0 + 3700 3000 -0 + 3800 3000 -0 + 3900 3000 -0 + 4000 3000 -0 + 4100 3000 -0 + 4200 3000 -0 + 4300 3000 -0 + 4400 3000 -0 + 4500 3000 -0 + 4600 3000 -0 + 4700 3000 -0 + 4800 3000 -0 + 4900 3000 -0 + 5000 3000 -0 +Loop time of 10.7721 on 1 procs for 5000 steps with 3000 atoms + +Performance: 40103.467 tau/day, 464.160 timesteps/s, 1.392 Matom-step/s +99.5% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 8.1117 | 8.1117 | 8.1117 | 0.0 | 75.30 +Neigh | 1.2885 | 1.2885 | 1.2885 | 0.0 | 11.96 +Comm | 0.059888 | 0.059888 | 0.059888 | 0.0 | 0.56 +Output | 0.0011158 | 0.0011158 | 0.0011158 | 0.0 | 0.01 +Modify | 1.2436 | 1.2436 | 1.2436 | 0.0 | 11.54 +Other | | 0.06727 | | | 0.62 + +Nlocal: 3000 ave 3000 max 3000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 471 ave 471 max 471 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 16713 ave 16713 max 16713 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 16713 +Ave neighs/atom = 5.571 +Neighbor list builds = 1102 +Dangerous builds = 0 +Total wall time: 0:00:10 diff --git a/examples/granular/log.15Sep22.pour.flatwall.g++.4 b/examples/granular/log.15Sep22.pour.flatwall.g++.4 new file mode 100644 index 0000000000..5fb99ea042 --- /dev/null +++ b/examples/granular/log.15Sep22.pour.flatwall.g++.4 @@ -0,0 +1,195 @@ +LAMMPS (15 Sep 2022) +# pour two types of particles (cohesive and non-cohesive) on flat wall + +variable name string pour_two_types + +atom_style sphere +units lj + +############################################### +# Geometry-related parameters +############################################### + +variable boxx equal 20 +variable boxy equal 20 +variable boxz equal 30 + +variable xc1 equal 0.3*${boxx} +variable xc1 equal 0.3*20 +variable xc2 equal 0.7*${boxx} +variable xc2 equal 0.7*20 +variable yc equal 0.5*${boxy} +variable yc equal 0.5*20 + +############################################### +# Particle-related parameters +############################################### +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable dens equal 1.0 + +variable skin equal 0.3*${rhi} +variable skin equal 0.3*0.5 + +############# +processors * * 1 +region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} +region boxreg block 0 20 0 ${boxy} 0 ${boxz} +region boxreg block 0 20 0 20 0 ${boxz} +region boxreg block 0 20 0 20 0 30 +create_box 2 boxreg +Created orthogonal box = (0 0 0) to (20 20 30) + 2 by 2 by 1 MPI processor grid +change_box all boundary p p f +Changing box ... + +pair_style granular +pair_coeff 1 * jkr 1000.0 50.0 0.3 10 tangential mindlin 800.0 1.0 0.5 rolling sds 500.0 200.0 0.5 twisting marshall +pair_coeff 2 2 hertz 200.0 20.0 tangential linear_history 300.0 1.0 0.1 rolling sds 200.0 100.0 0.1 twisting marshall + +comm_modify vel yes + +region insreg1 cylinder z ${xc1} ${yc} 5 15 ${boxz} +region insreg1 cylinder z 6 ${yc} 5 15 ${boxz} +region insreg1 cylinder z 6 10 5 15 ${boxz} +region insreg1 cylinder z 6 10 5 15 30 +region insreg2 cylinder z ${xc2} ${yc} 5 15 ${boxz} +region insreg2 cylinder z 14 ${yc} 5 15 ${boxz} +region insreg2 cylinder z 14 10 5 15 ${boxz} +region insreg2 cylinder z 14 10 5 15 30 + +fix 1 all nve/sphere +fix grav all gravity 10.0 vector 0 0 -1 +fix ins1 all pour 1500 1 3123 region insreg1 diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens ${dens} ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 ${dens} +fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 1 +Particle insertion: 562 every 346 steps, 1500 by step 693 +fix ins2 all pour 1500 2 3123 region insreg2 diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens ${dens} ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 ${dens} +fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 1 +Particle insertion: 562 every 346 steps, 1500 by step 693 + +neighbor ${skin} bin +neighbor 0.15 bin +neigh_modify delay 0 every 1 check yes + +fix 3 all wall/gran granular hertz/material 1e5 1e3 0.3 tangential mindlin NULL 1.0 0.5 zplane 0 NULL + +thermo_style custom step atoms ke +thermo_modify lost warn +thermo 100 + +timestep 0.001 + +#dump 1 all custom 100 ${name}.dump id type radius mass x y z + +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.15 + ghost atom cutoff = 1.15 + binsize = 0.575, bins = 35 35 53 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair granular, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 15.04 | 15.04 | 15.04 Mbytes + Step Atoms KinEng + 0 0 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 100 926 -0 + 200 926 -0 + 300 926 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 400 1498 -0 + 500 1498 -0 + 600 1498 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 700 2275 -0 + 800 2275 -0 + 900 2275 -0 + 1000 2275 -0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 1100 2954 -0 + 1200 2954 -0 + 1300 2954 -0 + 1400 3000 -0 + 1500 3000 -0 + 1600 3000 -0 + 1700 3000 -0 + 1800 3000 -0 + 1900 3000 -0 + 2000 3000 -0 + 2100 3000 -0 + 2200 3000 -0 + 2300 3000 -0 + 2400 3000 -0 + 2500 3000 -0 + 2600 3000 -0 + 2700 3000 -0 + 2800 3000 -0 + 2900 3000 -0 + 3000 3000 -0 + 3100 3000 -0 + 3200 3000 -0 + 3300 3000 -0 + 3400 3000 -0 + 3500 3000 -0 + 3600 3000 -0 + 3700 3000 -0 + 3800 3000 -0 + 3900 3000 -0 + 4000 3000 -0 + 4100 3000 -0 + 4200 3000 -0 + 4300 3000 -0 + 4400 3000 -0 + 4500 3000 -0 + 4600 3000 -0 + 4700 3000 -0 + 4800 3000 -0 + 4900 3000 -0 + 5000 3000 -0 +Loop time of 4.06277 on 4 procs for 5000 steps with 3000 atoms + +Performance: 106331.276 tau/day, 1230.686 timesteps/s, 3.692 Matom-step/s +98.7% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.85426 | 1.7801 | 2.7631 | 64.4 | 43.82 +Neigh | 0.18775 | 0.25657 | 0.3279 | 11.5 | 6.32 +Comm | 0.23605 | 1.3334 | 2.3703 | 81.6 | 32.82 +Output | 0.00059456 | 0.0008165 | 0.0012002 | 0.0 | 0.02 +Modify | 0.59336 | 0.64066 | 0.6864 | 4.3 | 15.77 +Other | | 0.05122 | | | 1.26 + +Nlocal: 750 ave 1032 max 463 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 426.5 ave 482 max 375 min +Histogram: 1 1 0 0 0 0 0 1 0 1 +Neighs: 4164.25 ave 6310 max 1941 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 16657 +Ave neighs/atom = 5.5523333 +Neighbor list builds = 1114 +Dangerous builds = 0 +Total wall time: 0:00:04 diff --git a/examples/granular/log.15Sep22.pour.heat.g++.1 b/examples/granular/log.15Sep22.pour.heat.g++.1 new file mode 100644 index 0000000000..d232752c74 --- /dev/null +++ b/examples/granular/log.15Sep22.pour.heat.g++.1 @@ -0,0 +1,1172 @@ +LAMMPS (15 Sep 2022) +# pour one types of particles into cylinder and oscillate +# temperature of the bottom plate + +variable name string heat_plate + +atom_style sphere/temp +units lj + +############################################### +# Geometry-related parameters +############################################### + +variable boxx equal 10 +variable boxy equal 10 +variable boxz equal 50 + +variable drum_rad equal ${boxx}*0.5 +variable drum_rad equal 10*0.5 +variable drum_height equal 30 + +variable xc equal 0.5*${boxx} +variable xc equal 0.5*10 +variable yc equal 0.5*${boxx} +variable yc equal 0.5*10 +variable zc equal 0.5*${boxz} +variable zc equal 0.5*50 + +############################################### +# Particle-related parameters +############################################### +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable cyl_rad_inner equal ${drum_rad}-1.1*${rhi} +variable cyl_rad_inner equal 5-1.1*${rhi} +variable cyl_rad_inner equal 5-1.1*0.5 + +variable dens equal 1.0 + +variable skin equal 0.4*${rhi} +variable skin equal 0.4*0.5 + +############# +processors * * 1 +region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} +region boxreg block 0 10 0 ${boxy} 0 ${boxz} +region boxreg block 0 10 0 10 0 ${boxz} +region boxreg block 0 10 0 10 0 50 +create_box 2 boxreg +Created orthogonal box = (0 0 0) to (10 10 50) + 1 by 1 by 1 MPI processor grid +change_box all boundary p p f +Changing box ... + +pair_style granular +pair_coeff * * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 + +region curved_wall cylinder z ${xc} ${yc} ${drum_rad} 0 ${drum_height} side in +region curved_wall cylinder z 5 ${yc} ${drum_rad} 0 ${drum_height} side in +region curved_wall cylinder z 5 5 ${drum_rad} 0 ${drum_height} side in +region curved_wall cylinder z 5 5 5 0 ${drum_height} side in +region curved_wall cylinder z 5 5 5 0 30 side in +region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in +region bottom_wall plane 5 ${yc} 0 0 0 1 side in +region bottom_wall plane 5 5 0 0 0 1 side in + +region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 5 ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 5 5 ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 5 5 4.45 ${drum_height} ${boxz} +region insreg cylinder z 5 5 4.45 30 ${boxz} +region insreg cylinder z 5 5 4.45 30 50 + +fix 0 all balance 100 1.0 shift xy 5 1.1 +fix 1 all nve/sphere +fix 2 all heat/flow/sphere/temp constant 1.0 +fix grav all gravity 10 vector 0 0 -1 +fix ins1 all pour 1000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 594 every 400 steps, 1000 by step 401 +fix ins2 all pour 1000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 594 every 400 steps, 1000 by step 401 + +comm_modify vel yes + +neighbor ${skin} bin +neighbor 0.2 bin +neigh_modify delay 0 every 1 check yes + +variable oscillate equal 1.0*sin(step*0.0001) + +fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate + +thermo_style custom step atoms ke pxx pyy pzz +thermo_modify lost warn +thermo 100 + +timestep 0.001 + +#dump 1 all custom 1000 ${name}.dump id type radius mass x y z temperature heatflow + +#For removal later +compute 1 all property/atom radius +variable zmax atom z+c_1>0.5*${drum_height} +variable zmax atom z+c_1>0.5*30 +group delgroup dynamic all var zmax every 10000 +dynamic group delgroup defined + +run 100000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 17 17 84 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair granular, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.944 | 5.944 | 5.944 Mbytes + Step Atoms KinEng Pxx Pyy Pzz + 0 0 -0 0 0 0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 100 536 -0 0 0 7.4220499 + 200 536 -0 0 0 10.753096 + 300 536 -0 0 0 13.500241 + 400 536 -0 0 0 18.036636 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 500 903 -0 0 0 25.955524 + 600 903 -0 0 0 32.116907 + 700 903 -0 0.03620165 0.033499977 32.179357 + 800 903 -0 0.2106713 0.26431108 36.206318 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 900 1265 -0 0.2667335 0.20266671 44.177757 + 1000 1265 -0 0.51829264 0.67739216 49.904079 + 1100 1265 -0 0.87526847 0.66040207 53.13465 + 1200 1265 -0 0.7989492 0.81976513 54.277194 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 1300 1618 -0 1.0736038 1.2317728 60.921948 + 1400 1618 -0 3.6835952 3.1929764 60.725834 + 1500 1618 -0 2.756994 2.611876 61.575807 + 1600 1618 -0 3.3981246 3.253067 61.920098 + 1700 2000 -0 3.8273855 3.6731016 68.643557 + 1800 2000 -0 4.7528855 4.4495018 69.914035 + 1900 2000 -0 5.1197897 5.3612522 76.341875 + 2000 2000 -0 7.4609619 7.3959134 76.619654 + 2100 2000 -0 6.8808532 7.6237902 73.684129 + 2200 2000 -0 10.034925 9.4881564 72.897703 + 2300 2000 -0 10.110575 10.379096 70.330499 + 2400 2000 -0 12.458237 12.285825 68.726515 + 2500 2000 -0 11.081771 11.120864 59.216898 + 2600 2000 -0 11.441977 11.532286 57.698842 + 2700 2000 -0 12.285359 11.905254 56.086117 + 2800 2000 -0 13.392058 13.168532 54.678918 + 2900 2000 -0 12.439277 12.212282 49.214122 + 3000 2000 -0 11.12664 11.09865 43.35763 + 3100 2000 -0 12.899283 12.735645 45.72121 + 3200 2000 -0 13.397802 12.892421 40.82795 + 3300 2000 -0 11.935141 11.858897 33.412627 + 3400 2000 -0 12.005889 11.539848 29.290034 + 3500 2000 -0 13.311405 13.11741 27.54997 + 3600 2000 -0 11.985219 11.954031 21.79518 + 3700 2000 -0 10.728636 9.800667 14.497682 + 3800 2000 -0 10.082744 9.6420894 12.241554 + 3900 2000 -0 9.6227604 9.1331298 10.31104 + 4000 2000 -0 8.9197423 8.5118438 7.6564098 + 4100 2000 -0 8.224539 7.765121 6.4246439 + 4200 2000 -0 7.8352874 7.3855212 5.9657978 + 4300 2000 -0 7.84891 7.3973377 6.2217099 + 4400 2000 -0 7.9743441 7.5242803 6.7082653 + 4500 2000 -0 7.9906412 7.5831386 6.7093176 + 4600 2000 -0 7.9382395 7.4929459 6.4150432 + 4700 2000 -0 7.9318996 7.4971722 6.4746841 + 4800 2000 -0 7.9685751 7.5471868 6.6574514 + 4900 2000 -0 7.9524289 7.516294 6.5660525 + 5000 2000 -0 7.9378811 7.5115542 6.5001617 + 5100 2000 -0 7.9266301 7.5073503 6.5253548 + 5200 2000 -0 7.9434374 7.5177496 6.5845847 + 5300 2000 -0 7.9305032 7.5191693 6.5372085 + 5400 2000 -0 7.9402877 7.5254309 6.5520449 + 5500 2000 -0 7.9427052 7.5280949 6.5557961 + 5600 2000 -0 7.9391493 7.5233972 6.5331874 + 5700 2000 -0 7.9399937 7.5202519 6.543535 + 5800 2000 -0 7.9398529 7.5228566 6.54443 + 5900 2000 -0 7.9410688 7.5260002 6.5435973 + 6000 2000 -0 7.941019 7.5216292 6.5431831 + 6100 2000 -0 7.9390808 7.5219254 6.5415317 + 6200 2000 -0 7.9481596 7.5395611 6.5622388 + 6300 2000 -0 7.9490652 7.5315638 6.5562056 + 6400 2000 -0 7.9427506 7.5243388 6.5431344 + 6500 2000 -0 7.9452629 7.5265503 6.5495796 + 6600 2000 -0 7.9458414 7.5249099 6.5533876 + 6700 2000 -0 7.94418 7.525769 6.5394106 + 6800 2000 -0 7.943729 7.5287032 6.5405826 + 6900 2000 -0 7.947609 7.5300725 6.5559575 + 7000 2000 -0 7.9443102 7.5257838 6.5463817 + 7100 2000 -0 7.9441301 7.5276861 6.5381619 + 7200 2000 -0 7.9454486 7.5282359 6.5456825 + 7300 2000 -0 7.945263 7.5286763 6.5512798 + 7400 2000 -0 7.9420874 7.527752 6.5445142 + 7500 2000 -0 7.9441062 7.5272938 6.5441649 + 7600 2000 -0 7.9457317 7.528108 6.5503985 + 7700 2000 -0 7.9440802 7.5278111 6.5470895 + 7800 2000 -0 7.9431937 7.5265385 6.541355 + 7900 2000 -0 7.9443162 7.5279484 6.5500105 + 8000 2000 -0 7.9494361 7.5285053 6.5534428 + 8100 2000 -0 7.946984 7.5263991 6.5455634 + 8200 2000 -0 7.9484464 7.5274982 6.5494966 + 8300 2000 -0 7.9481535 7.5274655 6.5501241 + 8400 2000 -0 7.9479539 7.5273074 6.5488317 + 8500 2000 -0 7.9485734 7.5277795 6.5512236 + 8600 2000 -0 7.9479221 7.528244 6.5500855 + 8700 2000 -0 7.9478183 7.5276603 6.5489063 + 8800 2000 -0 7.948203 7.5284835 6.5517141 + 8900 2000 -0 7.9485476 7.5282914 6.5523536 + 9000 2000 -0 7.9480852 7.527842 6.5485105 + 9100 2000 -0 7.9503303 7.5292996 6.5521516 + 9200 2000 -0 7.9484069 7.5284723 6.5532887 + 9300 2000 -0 7.9477781 7.5273643 6.5479285 + 9400 2000 -0 7.9480058 7.5281007 6.5494258 + 9500 2000 -0 7.9502363 7.5292831 6.5551525 + 9600 2000 -0 7.9491036 7.5284568 6.5495709 + 9700 2000 -0 7.9486046 7.5277883 6.5479749 + 9800 2000 -0 7.949523 7.5288246 6.5522055 + 9900 2000 -0 7.9494267 7.5284447 6.5514459 + 10000 2000 -0 7.9488016 7.5280346 6.5482727 + 10100 2000 -0 7.9490863 7.5283793 6.5508377 + 10200 2000 -0 7.9494738 7.5286559 6.5521934 + 10300 2000 -0 7.94897 7.5280769 6.5494088 + 10400 2000 -0 7.9491066 7.52825 6.5501939 + 10500 2000 -0 7.9493209 7.5285384 6.5519118 + 10600 2000 -0 7.9491644 7.5282301 6.5502712 + 10700 2000 -0 7.9491801 7.5281441 6.5499963 + 10800 2000 -0 7.9493282 7.5284381 6.5515091 + 10900 2000 -0 7.9492367 7.5283402 6.5507061 + 11000 2000 -0 7.9491668 7.5282029 6.5500415 + 11100 2000 -0 7.9493582 7.5283461 6.5510357 + 11200 2000 -0 7.949305 7.5283898 6.55098 + 11300 2000 -0 7.9491619 7.5282773 6.5501609 + 11400 2000 -0 7.9492854 7.5283288 6.5506804 + 11500 2000 -0 7.9493516 7.5283815 6.5509932 + 11600 2000 -0 7.9492185 7.5283196 6.5504137 + 11700 2000 -0 7.9492341 7.5283288 6.5505111 + 11800 2000 -0 7.9493062 7.5283673 6.5508542 + 11900 2000 -0 7.9492738 7.5283272 6.5506104 + 12000 2000 -0 7.9492546 7.5283062 6.5505492 + 12100 2000 -0 7.9492631 7.5283416 6.5507445 + 12200 2000 -0 7.9492627 7.5283173 6.5506804 + 12300 2000 -0 7.9492692 7.5282802 6.5506371 + 12400 2000 -0 7.9492646 7.5282953 6.550753 + 12500 2000 -0 7.9492316 7.5282905 6.5507057 + 12600 2000 -0 7.9492342 7.5282624 6.5506826 + 12700 2000 -0 7.9492517 7.5282775 6.5507828 + 12800 2000 -0 7.9492092 7.5282666 6.5507381 + 12900 2000 -0 7.9491704 7.528266 6.550672 + 13000 2000 -0 7.9491743 7.5282771 6.550743 + 13100 2000 -0 7.9491605 7.5282824 6.5507079 + 13200 2000 -0 7.9491217 7.5282926 6.5506177 + 13300 2000 -0 7.9491063 7.5283202 6.5506443 + 13400 2000 -0 7.949103 7.5283325 6.5506231 + 13500 2000 -0 7.9490907 7.5283364 6.5505438 + 13600 2000 -0 7.9490835 7.5283584 6.5505599 + 13700 2000 -0 7.9490777 7.5283759 6.5505599 + 13800 2000 -0 7.9490712 7.5283756 6.5504932 + 13900 2000 -0 7.9490785 7.5283817 6.5505065 + 14000 2000 -0 7.9490815 7.5283933 6.5505387 + 14100 2000 -0 7.9490684 7.528393 6.5504862 + 14200 2000 -0 7.9490688 7.5283905 6.5504794 + 14300 2000 -0 7.9490814 7.5283907 6.5505315 + 14400 2000 -0 7.9490755 7.5283879 6.5505125 + 14500 2000 -0 7.949065 7.5283808 6.5504867 + 14600 2000 -0 7.9490721 7.5283768 6.5505326 + 14700 2000 -0 7.9490774 7.5283658 6.5505527 + 14800 2000 -0 7.9490719 7.5283503 6.5505371 + 14900 2000 -0 7.9490734 7.5283397 6.5505695 + 15000 2000 -0 7.9490832 7.5283255 6.5506123 + 15100 2000 -0 7.9490922 7.5283034 6.5506235 + 15200 2000 -0 7.9491032 7.5282854 6.550654 + 15300 2000 -0 7.9491184 7.5282713 6.5507005 + 15400 2000 -0 7.9491364 7.5282536 6.5507233 + 15500 2000 -0 7.9491577 7.5282382 6.5507454 + 15600 2000 -0 7.949183 7.5282317 6.550776 + 15700 2000 -0 7.9491951 7.5282268 6.5507835 + 15800 2000 -0 7.9492105 7.5282249 6.5507815 + 15900 2000 -0 7.9492261 7.5282273 6.5507862 + 16000 2000 -0 7.949236 7.5282329 6.5507802 + 16100 2000 -0 7.9492433 7.5282403 6.5507646 + 16200 2000 -0 7.9492443 7.5282461 6.5507548 + 16300 2000 -0 7.9492487 7.528255 6.5507491 + 16400 2000 -0 7.9492492 7.5282612 6.5507372 + 16500 2000 -0 7.9492486 7.5282664 6.5507287 + 16600 2000 -0 7.9492482 7.5282702 6.5507259 + 16700 2000 -0 7.9492484 7.528271 6.550724 + 16800 2000 -0 7.949248 7.5282702 6.550724 + 16900 2000 -0 7.9492465 7.5282682 6.5507268 + 17000 2000 -0 7.9492458 7.5282638 6.550732 + 17100 2000 -0 7.9492503 7.5282577 6.5507415 + 17200 2000 -0 7.949245 7.528249 6.5507522 + 17300 2000 -0 7.949242 7.5282399 6.5507633 + 17400 2000 -0 7.9492423 7.5282314 6.5507781 + 17500 2000 -0 7.9492337 7.5282196 6.5507929 + 17600 2000 -0 7.9492257 7.5282097 6.5508056 + 17700 2000 -0 7.9492144 7.528202 6.5508153 + 17800 2000 -0 7.9492005 7.5281972 6.5508223 + 17900 2000 -0 7.9491836 7.5281958 6.5508215 + 18000 2000 -0 7.949164 7.5281986 6.550812 + 18100 2000 -0 7.949143 7.5282062 6.5507959 + 18200 2000 -0 7.9491222 7.5282177 6.550773 + 18300 2000 -0 7.9491032 7.5282315 6.5507447 + 18400 2000 -0 7.9490869 7.5282471 6.5507157 + 18500 2000 -0 7.9490738 7.5282631 6.5506876 + 18600 2000 -0 7.9490639 7.5282782 6.5506612 + 18700 2000 -0 7.9490575 7.5282917 6.5506397 + 18800 2000 -0 7.9490536 7.5283031 6.5506231 + 18900 2000 -0 7.9490511 7.5283122 6.5506095 + 19000 2000 -0 7.9490498 7.528319 6.5505999 + 19100 2000 -0 7.9490494 7.5283236 6.5505947 + 19200 2000 -0 7.9490504 7.5283266 6.5505913 + 19300 2000 -0 7.9490487 7.5283271 6.5505908 + 19400 2000 -0 7.9490481 7.5283251 6.5505927 + 19500 2000 -0 7.9490469 7.5283215 6.550597 + 19600 2000 -0 7.949046 7.5283161 6.5506036 + 19700 2000 -0 7.9490455 7.5283086 6.5506131 + 19800 2000 -0 7.9490454 7.5282989 6.5506262 + 19900 2000 -0 7.9490466 7.528287 6.550643 + 20000 2000 -0 7.9490497 7.5282729 6.5506641 + 20100 2000 -0 7.9490553 7.5282568 6.5506893 + 20200 2000 -0 7.949064 7.5282394 6.5507187 + 20300 2000 -0 7.9490762 7.5282213 6.5507507 + 20400 2000 -0 7.949092 7.5282037 6.5507836 + 20500 2000 -0 7.94911 7.5281878 6.5508144 + 20600 2000 -0 7.9491297 7.5281748 6.5508407 + 20700 2000 -0 7.9491494 7.5281658 6.5508604 + 20800 2000 -0 7.9491678 7.528161 6.5508721 + 20900 2000 -0 7.9491837 7.5281604 6.5508761 + 21000 2000 -0 7.9491965 7.5281634 6.5508735 + 21100 2000 -0 7.949206 7.5281691 6.5508664 + 21200 2000 -0 7.9492125 7.5281763 6.5508566 + 21300 2000 -0 7.9492165 7.5281841 6.5508459 + 21400 2000 -0 7.9492186 7.5281916 6.5508355 + 21500 2000 -0 7.9492193 7.5281981 6.5508266 + 21600 2000 -0 7.9492209 7.5282042 6.5508206 + 21700 2000 -0 7.9492183 7.5282068 6.5508151 + 21800 2000 -0 7.9492181 7.5282082 6.550813 + 21900 2000 -0 7.9492172 7.5282078 6.5508133 + 22000 2000 -0 7.9492165 7.5282053 6.5508164 + 22100 2000 -0 7.949216 7.5282009 6.5508221 + 22200 2000 -0 7.9492152 7.5281947 6.5508303 + 22300 2000 -0 7.9492139 7.5281868 6.5508407 + 22400 2000 -0 7.9492119 7.5281776 6.5508533 + 22500 2000 -0 7.9492085 7.5281675 6.5508672 + 22600 2000 -0 7.9492032 7.5281571 6.5508813 + 22700 2000 -0 7.9491954 7.5281475 6.5508947 + 22800 2000 -0 7.9491847 7.5281397 6.5509055 + 22900 2000 -0 7.9491707 7.5281345 6.5509114 + 23000 2000 -0 7.9491537 7.5281331 6.5509109 + 23100 2000 -0 7.9491342 7.528136 6.5509027 + 23200 2000 -0 7.9491134 7.5281433 6.5508866 + 23300 2000 -0 7.9490926 7.5281544 6.5508637 + 23400 2000 -0 7.9490734 7.5281684 6.5508363 + 23500 2000 -0 7.9490569 7.528184 6.550807 + 23600 2000 -0 7.9490436 7.5281999 6.5507785 + 23700 2000 -0 7.9490338 7.5282151 6.5507528 + 23800 2000 -0 7.9490271 7.5282287 6.550731 + 23900 2000 -0 7.9490229 7.5282402 6.5507135 + 24000 2000 -0 7.949022 7.5282475 6.5507052 + 24100 2000 -0 7.9490192 7.5282571 6.5506903 + 24200 2000 -0 7.9490187 7.5282612 6.5506857 + 24300 2000 -0 7.9490182 7.5282637 6.5506814 + 24400 2000 -0 7.9490176 7.5282644 6.5506802 + 24500 2000 -0 7.9490169 7.5282632 6.5506827 + 24600 2000 -0 7.9490162 7.52826 6.5506869 + 24700 2000 -0 7.949015 7.5282547 6.5506925 + 24800 2000 -0 7.9490143 7.5282475 6.5507019 + 24900 2000 -0 7.9490142 7.5282382 6.5507152 + 25000 2000 -0 7.949015 7.5282266 6.5507309 + 25100 2000 -0 7.9490178 7.5282127 6.5507512 + 25200 2000 -0 7.9490231 7.5281971 6.5507767 + 25300 2000 -0 7.9490313 7.5281798 6.5508053 + 25400 2000 -0 7.949043 7.5281617 6.5508367 + 25500 2000 -0 7.9490581 7.5281441 6.5508697 + 25600 2000 -0 7.949076 7.5281281 6.5509009 + 25700 2000 -0 7.9490959 7.528112 6.550928 + 25800 2000 -0 7.9491161 7.5281041 6.5509477 + 25900 2000 -0 7.9491345 7.5280996 6.5509612 + 26000 2000 -0 7.9491506 7.5280986 6.5509657 + 26100 2000 -0 7.9491638 7.5281011 6.5509636 + 26200 2000 -0 7.949174 7.5281064 6.5509573 + 26300 2000 -0 7.949181 7.5281134 6.5509475 + 26400 2000 -0 7.9491854 7.5281211 6.5509367 + 26500 2000 -0 7.9491879 7.5281286 6.5509264 + 26600 2000 -0 7.9491889 7.5281353 6.5509172 + 26700 2000 -0 7.9491886 7.5281409 6.5509104 + 26800 2000 -0 7.9491886 7.5281441 6.5509048 + 26900 2000 -0 7.9491879 7.5281458 6.5509024 + 27000 2000 -0 7.9491875 7.5281457 6.5509025 + 27100 2000 -0 7.949187 7.5281435 6.5509052 + 27200 2000 -0 7.9491866 7.5281393 6.5509102 + 27300 2000 -0 7.9491861 7.5281333 6.5509181 + 27400 2000 -0 7.9491851 7.5281257 6.5509283 + 27500 2000 -0 7.9491834 7.5281166 6.5509402 + 27600 2000 -0 7.9491805 7.5281065 6.550954 + 27700 2000 -0 7.9491758 7.5280961 6.5509683 + 27800 2000 -0 7.9491687 7.5280862 6.5509818 + 27900 2000 -0 7.9491588 7.5280779 6.5509931 + 28000 2000 -0 7.9491457 7.5280721 6.5510002 + 28100 2000 -0 7.9491294 7.5280699 6.551001 + 28200 2000 -0 7.9491105 7.5280718 6.5509942 + 28300 2000 -0 7.9490901 7.5280782 6.5509797 + 28400 2000 -0 7.9490695 7.5280885 6.550958 + 28500 2000 -0 7.9490501 7.5281019 6.5509312 + 28600 2000 -0 7.9490332 7.5281172 6.5509022 + 28700 2000 -0 7.9490195 7.5281331 6.5508735 + 28800 2000 -0 7.9490075 7.528149 6.5508475 + 28900 2000 -0 7.9490015 7.528163 6.5508246 + 29000 2000 -0 7.9489976 7.5281742 6.5508062 + 29100 2000 -0 7.9489952 7.5281837 6.5507921 + 29200 2000 -0 7.948994 7.5281911 6.550782 + 29300 2000 -0 7.9489934 7.5281962 6.5507753 + 29400 2000 -0 7.9489932 7.5281992 6.5507715 + 29500 2000 -0 7.9489929 7.5282002 6.5507702 + 29600 2000 -0 7.9489925 7.5281992 6.5507714 + 29700 2000 -0 7.9489918 7.5281964 6.5507748 + 29800 2000 -0 7.948991 7.5281916 6.5507805 + 29900 2000 -0 7.9489903 7.5281848 6.5507891 + 30000 2000 -0 7.9489901 7.5281759 6.5508007 + 30100 2000 -0 7.9489909 7.5281648 6.5508159 + 30200 2000 -0 7.9489933 7.5281515 6.5508353 + 30300 2000 -0 7.948998 7.5281362 6.550859 + 30400 2000 -0 7.9490056 7.5281192 6.5508868 + 30500 2000 -0 7.9490165 7.5281012 6.5509178 + 30600 2000 -0 7.9490309 7.5280833 6.5509503 + 30700 2000 -0 7.9490483 7.5280667 6.5509821 + 30800 2000 -0 7.9490676 7.5280525 6.5510103 + 30900 2000 -0 7.9490876 7.5280418 6.5510325 + 31000 2000 -0 7.9491067 7.5280353 6.5510472 + 31100 2000 -0 7.9491237 7.5280331 6.551054 + 31200 2000 -0 7.9491378 7.5280348 6.5510539 + 31300 2000 -0 7.9491487 7.5280394 6.5510483 + 31400 2000 -0 7.9491564 7.5280461 6.5510392 + 31500 2000 -0 7.9491615 7.5280537 6.5510287 + 31600 2000 -0 7.9491644 7.5280614 6.551018 + 31700 2000 -0 7.9491657 7.5280683 6.5510084 + 31800 2000 -0 7.949166 7.528074 6.5510005 + 31900 2000 -0 7.9491658 7.5280781 6.5509948 + 32000 2000 -0 7.9491652 7.5280804 6.5509914 + 32100 2000 -0 7.949165 7.5280809 6.5509907 + 32200 2000 -0 7.9491641 7.5280793 6.5509925 + 32300 2000 -0 7.9491637 7.5280757 6.5509969 + 32400 2000 -0 7.9491632 7.5280703 6.5510038 + 32500 2000 -0 7.9491625 7.5280632 6.5510132 + 32600 2000 -0 7.9491611 7.5280545 6.5510247 + 32700 2000 -0 7.9491587 7.5280447 6.5510379 + 32800 2000 -0 7.9491546 7.5280344 6.551052 + 32900 2000 -0 7.9491484 7.5280242 6.5510659 + 33000 2000 -0 7.9491395 7.5280153 6.5510781 + 33100 2000 -0 7.9491275 7.5280085 6.5510867 + 33200 2000 -0 7.9491123 7.528005 6.5510898 + 33300 2000 -0 7.9490942 7.5280055 6.5510857 + 33400 2000 -0 7.9490743 7.5280104 6.5510737 + 33500 2000 -0 7.9490536 7.5280195 6.5510543 + 33600 2000 -0 7.9490337 7.5280319 6.5510291 + 33700 2000 -0 7.9490159 7.5280467 6.5510006 + 33800 2000 -0 7.9490011 7.5280624 6.5509715 + 33900 2000 -0 7.9489897 7.528078 6.5509442 + 34000 2000 -0 7.9489816 7.5280924 6.5509203 + 34100 2000 -0 7.9489763 7.528105 6.5509004 + 34200 2000 -0 7.9489732 7.5281155 6.5508849 + 34300 2000 -0 7.9489717 7.5281236 6.5508735 + 34400 2000 -0 7.948971 7.5281295 6.5508656 + 34500 2000 -0 7.9489707 7.5281332 6.5508608 + 34600 2000 -0 7.9489705 7.5281349 6.5508586 + 34700 2000 -0 7.9489701 7.5281347 6.5508588 + 34800 2000 -0 7.9489695 7.5281326 6.5508613 + 34900 2000 -0 7.9489672 7.5281294 6.5508657 + 35000 2000 -0 7.9489679 7.5281227 6.5508731 + 35100 2000 -0 7.9489674 7.5281145 6.5508833 + 35200 2000 -0 7.9489677 7.5281044 6.5508973 + 35300 2000 -0 7.9489695 7.5280919 6.550915 + 35400 2000 -0 7.948973 7.5280774 6.5509365 + 35500 2000 -0 7.9489794 7.5280611 6.5509628 + 35600 2000 -0 7.9489889 7.5280435 6.5509926 + 35700 2000 -0 7.9490018 7.5280255 6.5510245 + 35800 2000 -0 7.949018 7.5280082 6.5510567 + 35900 2000 -0 7.9490366 7.5279929 6.5510867 + 36000 2000 -0 7.9490564 7.5279807 6.5511115 + 36100 2000 -0 7.949076 7.5279725 6.5511293 + 36200 2000 -0 7.949094 7.5279685 6.5511394 + 36300 2000 -0 7.9491093 7.5279687 6.5511419 + 36400 2000 -0 7.9491215 7.5279722 6.5511382 + 36500 2000 -0 7.9491305 7.5279782 6.5511304 + 36600 2000 -0 7.9491366 7.5279855 6.5511203 + 36700 2000 -0 7.9491403 7.5279933 6.5511095 + 36800 2000 -0 7.9491422 7.5280006 6.5510994 + 36900 2000 -0 7.9491429 7.5280069 6.5510907 + 37000 2000 -0 7.9491428 7.5280118 6.551084 + 37100 2000 -0 7.9491423 7.5280149 6.5510796 + 37200 2000 -0 7.9491417 7.5280162 6.5510777 + 37300 2000 -0 7.9491412 7.5280155 6.5510784 + 37400 2000 -0 7.9491407 7.5280129 6.5510816 + 37500 2000 -0 7.9491403 7.5280083 6.5510874 + 37600 2000 -0 7.9491397 7.528002 6.5510957 + 37700 2000 -0 7.9491387 7.527994 6.5511062 + 37800 2000 -0 7.9491368 7.5279847 6.5511187 + 37900 2000 -0 7.9491337 7.5279745 6.5511324 + 38000 2000 -0 7.9491286 7.5279642 6.5511466 + 38100 2000 -0 7.9491211 7.5279546 6.5511598 + 38200 2000 -0 7.9491106 7.5279467 6.5511704 + 38300 2000 -0 7.9490969 7.5279415 6.5511764 + 38400 2000 -0 7.9490802 7.52794 6.5511759 + 38500 2000 -0 7.9490611 7.5279428 6.5511678 + 38600 2000 -0 7.9490407 7.5279499 6.5511519 + 38700 2000 -0 7.9490203 7.5279608 6.5511293 + 38800 2000 -0 7.9490014 7.5279745 6.5511022 + 38900 2000 -0 7.9489851 7.5279899 6.5510732 + 39000 2000 -0 7.9489721 7.5280057 6.5510448 + 39100 2000 -0 7.9489624 7.5280208 6.5510192 + 39200 2000 -0 7.9489558 7.5280344 6.5509973 + 39300 2000 -0 7.9489516 7.528046 6.5509797 + 39400 2000 -0 7.9489493 7.5280554 6.5509663 + 39500 2000 -0 7.9489481 7.5280625 6.5509567 + 39600 2000 -0 7.9489476 7.5280674 6.5509503 + 39700 2000 -0 7.9489475 7.5280702 6.5509463 + 39800 2000 -0 7.9489472 7.5280711 6.5509448 + 39900 2000 -0 7.9489468 7.5280701 6.5509455 + 40000 2000 -0 7.9489461 7.5280673 6.5509484 + 40100 2000 -0 7.9489453 7.5280625 6.5509538 + 40200 2000 -0 7.9489445 7.5280556 6.5509619 + 40300 2000 -0 7.9489443 7.5280466 6.550973 + 40400 2000 -0 7.948945 7.5280353 6.5509879 + 40500 2000 -0 7.9489474 7.5280219 6.5510068 + 40600 2000 -0 7.9489521 7.5280065 6.5510299 + 40700 2000 -0 7.9489597 7.5279895 6.5510571 + 40800 2000 -0 7.9489706 7.5279716 6.5510876 + 40900 2000 -0 7.9489848 7.5279537 6.5511196 + 41000 2000 -0 7.9490019 7.5279372 6.5511508 + 41100 2000 -0 7.949021 7.5279231 6.5511783 + 41200 2000 -0 7.9490405 7.5279137 6.5512001 + 41300 2000 -0 7.9490593 7.5279062 6.551214 + 41400 2000 -0 7.9490759 7.527904 6.5512202 + 41500 2000 -0 7.9490897 7.5279058 6.5512195 + 41600 2000 -0 7.9491004 7.5279105 6.5512136 + 41700 2000 -0 7.9491078 7.5279171 6.5512042 + 41800 2000 -0 7.9491126 7.5279247 6.5511933 + 41900 2000 -0 7.9491153 7.5279324 6.5511823 + 42000 2000 -0 7.9491164 7.5279393 6.5511724 + 42100 2000 -0 7.9491165 7.527945 6.5511641 + 42200 2000 -0 7.949116 7.5279491 6.5511581 + 42300 2000 -0 7.9491153 7.5279515 6.5511543 + 42400 2000 -0 7.9491145 7.5279519 6.5511532 + 42500 2000 -0 7.9491138 7.5279504 6.5511545 + 42600 2000 -0 7.9491132 7.527947 6.5511584 + 42700 2000 -0 7.9491125 7.5279417 6.5511649 + 42800 2000 -0 7.9491115 7.5279347 6.5511737 + 42900 2000 -0 7.9491099 7.5279262 6.5511847 + 43000 2000 -0 7.9491074 7.5279165 6.5511975 + 43100 2000 -0 7.9491033 7.5279061 6.5512112 + 43200 2000 -0 7.9490971 7.5278959 6.5512249 + 43300 2000 -0 7.9490883 7.5278868 6.5512371 + 43400 2000 -0 7.9490764 7.5278798 6.5512459 + 43500 2000 -0 7.9490614 7.5278759 6.5512494 + 43600 2000 -0 7.9490435 7.5278759 6.5512459 + 43700 2000 -0 7.9490235 7.5278802 6.5512346 + 43800 2000 -0 7.9490027 7.5278887 6.5512158 + 43900 2000 -0 7.9489825 7.5279007 6.551191 + 44000 2000 -0 7.9489642 7.5279152 6.5511627 + 44100 2000 -0 7.9489489 7.5279308 6.5511334 + 44200 2000 -0 7.9489368 7.5279464 6.5511056 + 44300 2000 -0 7.9489281 7.5279609 6.5510809 + 44400 2000 -0 7.9489222 7.5279737 6.5510603 + 44500 2000 -0 7.9489186 7.5279844 6.551044 + 44600 2000 -0 7.9489166 7.5279929 6.5510317 + 44700 2000 -0 7.9489156 7.527999 6.551023 + 44800 2000 -0 7.948915 7.5280031 6.5510175 + 44900 2000 -0 7.9489146 7.5280051 6.5510146 + 45000 2000 -0 7.948914 7.5280052 6.5510141 + 45100 2000 -0 7.9489131 7.5280035 6.5510158 + 45200 2000 -0 7.948912 7.5279999 6.5510197 + 45300 2000 -0 7.9489109 7.5279944 6.5510261 + 45400 2000 -0 7.94891 7.5279869 6.5510353 + 45500 2000 -0 7.9489098 7.5279772 6.5510478 + 45600 2000 -0 7.9489107 7.5279654 6.551064 + 45700 2000 -0 7.9489134 7.5279514 6.5510843 + 45800 2000 -0 7.9489186 7.5279356 6.5511089 + 45900 2000 -0 7.9489269 7.5279183 6.5511373 + 46000 2000 -0 7.9489386 7.5279003 6.5511685 + 46100 2000 -0 7.9489535 7.5278828 6.5512004 + 46200 2000 -0 7.9489712 7.5278669 6.5512307 + 46300 2000 -0 7.9489904 7.5278538 6.5512567 + 46400 2000 -0 7.9490097 7.5278445 6.5512762 + 46500 2000 -0 7.9490278 7.5278394 6.551288 + 46600 2000 -0 7.9490435 7.5278384 6.5512921 + 46700 2000 -0 7.9490563 7.5278411 6.5512897 + 46800 2000 -0 7.9490658 7.5278464 6.5512826 + 46900 2000 -0 7.9490723 7.5278535 6.5512727 + 47000 2000 -0 7.9490763 7.5278612 6.5512617 + 47100 2000 -0 7.9490784 7.5278687 6.5512509 + 47200 2000 -0 7.949079 7.5278753 6.5512414 + 47300 2000 -0 7.9490788 7.5278807 6.5512337 + 47400 2000 -0 7.9490781 7.5278843 6.5512283 + 47500 2000 -0 7.9490772 7.5278862 6.5512252 + 47600 2000 -0 7.9490763 7.5278863 6.5512251 + 47700 2000 -0 7.9490756 7.5278844 6.5512274 + 47800 2000 -0 7.9490749 7.5278805 6.5512317 + 47900 2000 -0 7.9490741 7.5278748 6.5512387 + 48000 2000 -0 7.949073 7.5278674 6.5512483 + 48100 2000 -0 7.9490713 7.5278586 6.5512597 + 48200 2000 -0 7.9490684 7.5278487 6.5512726 + 48300 2000 -0 7.949064 7.5278383 6.5512866 + 48400 2000 -0 7.9490573 7.5278282 6.5513001 + 48500 2000 -0 7.9490478 7.5278194 6.5513115 + 48600 2000 -0 7.9490353 7.5278129 6.5513193 + 48700 2000 -0 7.9490196 7.5278097 6.5513215 + 48800 2000 -0 7.9490012 7.5278105 6.5513163 + 48900 2000 -0 7.948981 7.5278157 6.5513034 + 49000 2000 -0 7.9489603 7.527825 6.5512834 + 49100 2000 -0 7.9489405 7.5278375 6.5512576 + 49200 2000 -0 7.9489228 7.5278522 6.5512289 + 49300 2000 -0 7.9489081 7.5278678 6.5512 + 49400 2000 -0 7.9488969 7.5278831 6.5511728 + 49500 2000 -0 7.9488888 7.5278972 6.551149 + 49600 2000 -0 7.9488835 7.5279095 6.5511293 + 49700 2000 -0 7.9488803 7.5279197 6.5511139 + 49800 2000 -0 7.9488785 7.5279275 6.5511024 + 49900 2000 -0 7.9488776 7.5279332 6.5510945 + 50000 2000 -0 7.9488771 7.5279368 6.5510895 + 50100 2000 -0 7.9488767 7.5279384 6.5510871 + 50200 2000 -0 7.948876 7.5279381 6.551087 + 50300 2000 -0 7.9488752 7.5279359 6.5510891 + 50400 2000 -0 7.9488741 7.527932 6.5510934 + 50500 2000 -0 7.948873 7.5279261 6.5511002 + 50600 2000 -0 7.9488722 7.5279182 6.5511099 + 50700 2000 -0 7.9488721 7.5279081 6.5511229 + 50800 2000 -0 7.9488732 7.5278959 6.5511396 + 50900 2000 -0 7.9488763 7.5278816 6.5511605 + 51000 2000 -0 7.9488819 7.5278655 6.5511857 + 51100 2000 -0 7.9488907 7.527848 6.5512145 + 51200 2000 -0 7.9489028 7.52783 6.5512458 + 51300 2000 -0 7.9489182 7.5278126 6.5512776 + 51400 2000 -0 7.9489361 7.527797 6.5513073 + 51500 2000 -0 7.9489553 7.5277844 6.5513324 + 51600 2000 -0 7.9489746 7.5277755 6.5513508 + 51700 2000 -0 7.9489924 7.527771 6.5513615 + 51800 2000 -0 7.9490076 7.5277705 6.5513647 + 51900 2000 -0 7.9490195 7.5277737 6.5513615 + 52000 2000 -0 7.9490283 7.5277794 6.5513539 + 52100 2000 -0 7.949034 7.5277866 6.5513439 + 52200 2000 -0 7.949037 7.5277943 6.551333 + 52300 2000 -0 7.9490382 7.5278017 6.5513225 + 52400 2000 -0 7.9490381 7.5278081 6.5513134 + 52500 2000 -0 7.9490372 7.5278132 6.5513061 + 52600 2000 -0 7.9490358 7.5278167 6.5513011 + 52700 2000 -0 7.9490343 7.5278183 6.5512985 + 52800 2000 -0 7.9490329 7.5278181 6.5512989 + 52900 2000 -0 7.9490315 7.527816 6.5513015 + 53000 2000 -0 7.9490302 7.5278118 6.5513062 + 53100 2000 -0 7.9490288 7.5278059 6.5513136 + 53200 2000 -0 7.9490279 7.5277975 6.5513237 + 53300 2000 -0 7.9490241 7.5277891 6.5513356 + 53400 2000 -0 7.9490211 7.5277793 6.5513482 + 53500 2000 -0 7.949016 7.527769 6.5513626 + 53600 2000 -0 7.9490084 7.527759 6.5513764 + 53700 2000 -0 7.948998 7.5277502 6.5513874 + 53800 2000 -0 7.9489846 7.5277439 6.5513952 + 53900 2000 -0 7.9489681 7.527741 6.5513973 + 54000 2000 -0 7.9489489 7.5277421 6.5513917 + 54100 2000 -0 7.9489279 7.5277475 6.5513784 + 54200 2000 -0 7.9489066 7.527757 6.5513584 + 54300 2000 -0 7.9488862 7.5277697 6.5513326 + 54400 2000 -0 7.948868 7.5277844 6.5513039 + 54500 2000 -0 7.9488529 7.5278 6.5512754 + 54600 2000 -0 7.9488411 7.5278152 6.5512487 + 54700 2000 -0 7.9488325 7.5278292 6.5512253 + 54800 2000 -0 7.9488266 7.5278414 6.5512062 + 54900 2000 -0 7.9488228 7.5278514 6.5511912 + 55000 2000 -0 7.9488204 7.5278592 6.5511801 + 55100 2000 -0 7.9488188 7.5278647 6.5511725 + 55200 2000 -0 7.9488176 7.5278682 6.5511679 + 55300 2000 -0 7.9488165 7.5278697 6.5511657 + 55400 2000 -0 7.9488151 7.5278693 6.5511659 + 55500 2000 -0 7.9488136 7.5278672 6.5511683 + 55600 2000 -0 7.9488118 7.5278632 6.5511728 + 55700 2000 -0 7.94881 7.5278573 6.5511798 + 55800 2000 -0 7.9488085 7.5278494 6.5511897 + 55900 2000 -0 7.9488076 7.5278393 6.5512028 + 56000 2000 -0 7.9488081 7.5278272 6.5512196 + 56100 2000 -0 7.9488104 7.5278129 6.5512407 + 56200 2000 -0 7.9488153 7.5277968 6.5512659 + 56300 2000 -0 7.9488233 7.5277793 6.5512948 + 56400 2000 -0 7.9488347 7.5277613 6.5513262 + 56500 2000 -0 7.9488493 7.527744 6.5513581 + 56600 2000 -0 7.9488664 7.5277283 6.5513879 + 56700 2000 -0 7.9488849 7.5277157 6.5514132 + 56800 2000 -0 7.9489034 7.5277068 6.5514318 + 56900 2000 -0 7.9489205 7.5277022 6.5514428 + 57000 2000 -0 7.9489351 7.5277016 6.5514462 + 57100 2000 -0 7.9489467 7.5277046 6.5514434 + 57200 2000 -0 7.9489551 7.5277101 6.5514361 + 57300 2000 -0 7.9489606 7.5277172 6.5514261 + 57400 2000 -0 7.9489636 7.5277248 6.5514153 + 57500 2000 -0 7.9489647 7.5277322 6.5514049 + 57600 2000 -0 7.9489645 7.5277387 6.5513957 + 57700 2000 -0 7.9489634 7.5277438 6.5513885 + 57800 2000 -0 7.9489619 7.5277473 6.5513834 + 57900 2000 -0 7.9489603 7.527749 6.5513807 + 58000 2000 -0 7.9489587 7.5277489 6.551381 + 58100 2000 -0 7.9489572 7.5277469 6.5513835 + 58200 2000 -0 7.9489558 7.5277428 6.5513881 + 58300 2000 -0 7.9489543 7.527737 6.5513954 + 58400 2000 -0 7.9489526 7.5277295 6.5514052 + 58500 2000 -0 7.9489538 7.5277215 6.551417 + 58600 2000 -0 7.948947 7.5277103 6.5514298 + 58700 2000 -0 7.9489424 7.5276998 6.551444 + 58800 2000 -0 7.9489357 7.5276895 6.5514576 + 58900 2000 -0 7.9489261 7.5276803 6.5514692 + 59000 2000 -0 7.9489135 7.5276736 6.5514773 + 59100 2000 -0 7.9488978 7.5276701 6.5514798 + 59200 2000 -0 7.9488794 7.5276706 6.551475 + 59300 2000 -0 7.9488592 7.5276754 6.5514625 + 59400 2000 -0 7.9488384 7.5276843 6.5514429 + 59500 2000 -0 7.9488184 7.5276965 6.5514176 + 59600 2000 -0 7.9488006 7.5277108 6.5513894 + 59700 2000 -0 7.9487858 7.5277262 6.5513607 + 59800 2000 -0 7.9487742 7.5277411 6.5513338 + 59900 2000 -0 7.9487658 7.527755 6.5513102 + 60000 2000 -0 7.9487603 7.5277672 6.5512907 + 60100 2000 -0 7.9487569 7.5277771 6.5512753 + 60200 2000 -0 7.9487549 7.5277849 6.5512639 + 60300 2000 -0 7.9487538 7.5277905 6.551256 + 60400 2000 -0 7.9487531 7.5277939 6.551251 + 60500 2000 -0 7.9487525 7.5277954 6.5512486 + 60600 2000 -0 7.9487517 7.5277951 6.5512485 + 60700 2000 -0 7.9487507 7.5277929 6.5512505 + 60800 2000 -0 7.9487495 7.527789 6.5512547 + 60900 2000 -0 7.9487482 7.5277831 6.5512613 + 61000 2000 -0 7.9487471 7.5277753 6.5512707 + 61100 2000 -0 7.9487466 7.5277654 6.5512832 + 61200 2000 -0 7.9487474 7.5277534 6.5512994 + 61300 2000 -0 7.9487499 7.5277392 6.5513196 + 61400 2000 -0 7.9487549 7.5277231 6.551344 + 61500 2000 -0 7.9487629 7.5277057 6.5513722 + 61600 2000 -0 7.9487743 7.5276875 6.5514032 + 61700 2000 -0 7.9487889 7.5276698 6.5514349 + 61800 2000 -0 7.9488062 7.5276536 6.5514651 + 61900 2000 -0 7.9488251 7.5276402 6.5514912 + 62000 2000 -0 7.9488442 7.5276305 6.5515108 + 62100 2000 -0 7.9488621 7.5276249 6.5515229 + 62200 2000 -0 7.9488777 7.5276235 6.5515275 + 62300 2000 -0 7.9488903 7.5276257 6.5515255 + 62400 2000 -0 7.9488998 7.5276306 6.5515188 + 62500 2000 -0 7.9489063 7.5276373 6.5515091 + 62600 2000 -0 7.9489103 7.5276446 6.5514983 + 62700 2000 -0 7.9489123 7.5276519 6.5514876 + 62800 2000 -0 7.9489128 7.5276583 6.5514781 + 62900 2000 -0 7.9489125 7.5276635 6.5514704 + 63000 2000 -0 7.9489117 7.5276671 6.5514648 + 63100 2000 -0 7.9489107 7.5276689 6.5514616 + 63200 2000 -0 7.9489097 7.527669 6.5514611 + 63300 2000 -0 7.9489089 7.5276672 6.5514631 + 63400 2000 -0 7.9489086 7.5276637 6.5514673 + 63500 2000 -0 7.9489073 7.5276575 6.5514739 + 63600 2000 -0 7.9489063 7.5276501 6.551483 + 63700 2000 -0 7.9489046 7.5276413 6.5514942 + 63800 2000 -0 7.948902 7.5276313 6.5515069 + 63900 2000 -0 7.9488979 7.5276207 6.5515208 + 64000 2000 -0 7.9488918 7.5276102 6.5515346 + 64100 2000 -0 7.9488831 7.5276008 6.5515467 + 64200 2000 -0 7.9488713 7.5275934 6.5515557 + 64300 2000 -0 7.9488564 7.5275891 6.5515596 + 64400 2000 -0 7.9488387 7.5275886 6.5515566 + 64500 2000 -0 7.948819 7.5275923 6.551546 + 64600 2000 -0 7.9487983 7.5276002 6.551528 + 64700 2000 -0 7.9487782 7.5276117 6.5515039 + 64800 2000 -0 7.9487598 7.5276255 6.5514762 + 64900 2000 -0 7.9487443 7.5276407 6.5514474 + 65000 2000 -0 7.9487321 7.5276559 6.5514199 + 65100 2000 -0 7.9487231 7.5276701 6.5513954 + 65200 2000 -0 7.948717 7.5276826 6.5513748 + 65300 2000 -0 7.9487132 7.5276931 6.5513585 + 65400 2000 -0 7.948711 7.5277014 6.5513461 + 65500 2000 -0 7.9487098 7.5277075 6.5513372 + 65600 2000 -0 7.9487092 7.5277115 6.5513315 + 65700 2000 -0 7.9487086 7.5277135 6.5513284 + 65800 2000 -0 7.948708 7.5277137 6.5513277 + 65900 2000 -0 7.9487071 7.527712 6.5513291 + 66000 2000 -0 7.948706 7.5277085 6.5513326 + 66100 2000 -0 7.9487047 7.5277032 6.5513384 + 66200 2000 -0 7.9487036 7.527696 6.5513467 + 66300 2000 -0 7.9487029 7.5276867 6.5513582 + 66400 2000 -0 7.9487033 7.5276753 6.5513731 + 66500 2000 -0 7.9487052 7.5276618 6.551392 + 66600 2000 -0 7.9487093 7.5276463 6.5514151 + 66700 2000 -0 7.9487163 7.5276292 6.5514421 + 66800 2000 -0 7.9487266 7.5276112 6.5514722 + 66900 2000 -0 7.9487402 7.5275932 6.5515039 + 67000 2000 -0 7.9487567 7.5275765 6.5515348 + 67100 2000 -0 7.9487752 7.5275621 6.5515623 + 67200 2000 -0 7.9487943 7.5275511 6.5515841 + 67300 2000 -0 7.9488127 7.5275442 6.5515986 + 67400 2000 -0 7.9488291 7.5275415 6.5516055 + 67500 2000 -0 7.9488435 7.5275438 6.5516054 + 67600 2000 -0 7.9488528 7.5275468 6.5515999 + 67700 2000 -0 7.9488606 7.5275528 6.5515912 + 67800 2000 -0 7.9488653 7.52756 6.5515805 + 67900 2000 -0 7.9488678 7.5275674 6.5515696 + 68000 2000 -0 7.9488689 7.5275741 6.5515598 + 68100 2000 -0 7.9488688 7.5275798 6.5515513 + 68200 2000 -0 7.9488681 7.5275839 6.5515449 + 68300 2000 -0 7.9488671 7.5275863 6.5515409 + 68400 2000 -0 7.9488661 7.527587 6.5515394 + 68500 2000 -0 7.9488652 7.5275857 6.5515407 + 68600 2000 -0 7.9488645 7.5275825 6.551544 + 68700 2000 -0 7.9488637 7.5275774 6.5515497 + 68800 2000 -0 7.9488629 7.5275707 6.5515579 + 68900 2000 -0 7.9488616 7.5275623 6.5515684 + 69000 2000 -0 7.9488595 7.5275526 6.5515805 + 69100 2000 -0 7.9488561 7.5275422 6.551594 + 69200 2000 -0 7.9488509 7.5275315 6.5516081 + 69300 2000 -0 7.9488433 7.5275215 6.551621 + 69400 2000 -0 7.9488328 7.5275132 6.5516314 + 69500 2000 -0 7.9488192 7.5275075 6.5516376 + 69600 2000 -0 7.9488027 7.5275054 6.5516375 + 69700 2000 -0 7.9487837 7.5275074 6.5516299 + 69800 2000 -0 7.9487633 7.5275136 6.5516148 + 69900 2000 -0 7.9487429 7.5275237 6.551593 + 70000 2000 -0 7.9487238 7.5275367 6.5515664 + 70100 2000 -0 7.9487071 7.5275514 6.5515379 + 70200 2000 -0 7.9486936 7.5275666 6.5515098 + 70300 2000 -0 7.9486834 7.5275813 6.551484 + 70400 2000 -0 7.9486763 7.5275945 6.5514618 + 70500 2000 -0 7.9486716 7.5276059 6.5514438 + 70600 2000 -0 7.9486689 7.5276151 6.5514298 + 70700 2000 -0 7.9486674 7.527622 6.5514196 + 70800 2000 -0 7.9486667 7.5276269 6.5514127 + 70900 2000 -0 7.9486661 7.5276297 6.5514086 + 71000 2000 -0 7.9486656 7.5276306 6.5514069 + 71100 2000 -0 7.9486648 7.5276297 6.5514073 + 71200 2000 -0 7.9486638 7.527627 6.5514099 + 71300 2000 -0 7.9486626 7.5276226 6.5514146 + 71400 2000 -0 7.9486614 7.5276163 6.5514217 + 71500 2000 -0 7.9486605 7.527608 6.5514317 + 71600 2000 -0 7.9486603 7.5275976 6.5514449 + 71700 2000 -0 7.9486614 7.5275851 6.5514619 + 71800 2000 -0 7.9486644 7.5275705 6.5514829 + 71900 2000 -0 7.94867 7.5275542 6.5515081 + 72000 2000 -0 7.9486787 7.5275366 6.5515368 + 72100 2000 -0 7.9486908 7.5275189 6.551568 + 72200 2000 -0 7.9487059 7.5275011 6.5515994 + 72300 2000 -0 7.9487235 7.5274855 6.5516286 + 72400 2000 -0 7.9487426 7.5274729 6.5516533 + 72500 2000 -0 7.9487614 7.527464 6.5516713 + 72600 2000 -0 7.9487788 7.5274593 6.5516817 + 72700 2000 -0 7.9487938 7.5274587 6.5516848 + 72800 2000 -0 7.9488058 7.5274616 6.5516817 + 72900 2000 -0 7.9488146 7.5274669 6.5516742 + 73000 2000 -0 7.9488205 7.5274738 6.5516642 + 73100 2000 -0 7.9488269 7.5274812 6.5516534 + 73200 2000 -0 7.9488257 7.5274883 6.5516429 + 73300 2000 -0 7.9488261 7.5274945 6.5516336 + 73400 2000 -0 7.9488256 7.5274994 6.5516262 + 73500 2000 -0 7.9488248 7.5275027 6.551621 + 73600 2000 -0 7.9488238 7.5275043 6.5516181 + 73700 2000 -0 7.9488228 7.5275041 6.551618 + 73800 2000 -0 7.948822 7.527502 6.5516204 + 73900 2000 -0 7.9488212 7.5274979 6.5516247 + 74000 2000 -0 7.9488205 7.527492 6.5516315 + 74100 2000 -0 7.9488195 7.5274845 6.551641 + 74200 2000 -0 7.9488179 7.5274755 6.5516522 + 74300 2000 -0 7.9488153 7.5274655 6.551665 + 74400 2000 -0 7.9488112 7.5274549 6.5516789 + 74500 2000 -0 7.9488049 7.5274445 6.5516926 + 74600 2000 -0 7.9487961 7.5274352 6.5517045 + 74700 2000 -0 7.9487842 7.527428 6.5517132 + 74800 2000 -0 7.9487693 7.5274239 6.5517167 + 74900 2000 -0 7.9487516 7.5274236 6.5517132 + 75000 2000 -0 7.9487319 7.5274276 6.5517022 + 75100 2000 -0 7.9487114 7.5274356 6.551684 + 75200 2000 -0 7.9486914 7.5274472 6.5516598 + 75300 2000 -0 7.9486734 7.5274611 6.5516321 + 75400 2000 -0 7.9486581 7.5274761 6.5516036 + 75500 2000 -0 7.9486462 7.5274912 6.5515764 + 75600 2000 -0 7.9486374 7.5275053 6.5515521 + 75700 2000 -0 7.9486315 7.5275177 6.5515319 + 75800 2000 -0 7.9486278 7.5275281 6.5515157 + 75900 2000 -0 7.9486258 7.5275363 6.5515035 + 76000 2000 -0 7.9486247 7.5275423 6.5514948 + 76100 2000 -0 7.9486241 7.5275463 6.5514892 + 76200 2000 -0 7.9486236 7.5275483 6.5514861 + 76300 2000 -0 7.948623 7.5275484 6.5514853 + 76400 2000 -0 7.9486222 7.5275468 6.5514867 + 76500 2000 -0 7.9486211 7.5275435 6.5514901 + 76600 2000 -0 7.9486198 7.5275383 6.5514957 + 76700 2000 -0 7.9486187 7.5275312 6.5515039 + 76800 2000 -0 7.948618 7.5275222 6.551515 + 76900 2000 -0 7.9486182 7.527511 6.5515295 + 77000 2000 -0 7.9486199 7.5274977 6.551548 + 77100 2000 -0 7.9486238 7.5274825 6.5515706 + 77200 2000 -0 7.9486305 7.5274656 6.5515971 + 77300 2000 -0 7.9486405 7.5274478 6.5516268 + 77400 2000 -0 7.9486537 7.5274299 6.5516582 + 77500 2000 -0 7.9486699 7.527413 6.551689 + 77600 2000 -0 7.9486881 7.5273985 6.5517168 + 77700 2000 -0 7.9487072 7.5273872 6.5517391 + 77800 2000 -0 7.9487256 7.5273799 6.5517543 + 77900 2000 -0 7.9487421 7.5273768 6.5517619 + 78000 2000 -0 7.948756 7.5273776 6.5517625 + 78100 2000 -0 7.9487668 7.5273814 6.5517576 + 78200 2000 -0 7.9487745 7.5273874 6.551749 + 78300 2000 -0 7.9487795 7.5273946 6.5517385 + 78400 2000 -0 7.9487822 7.527402 6.5517276 + 78500 2000 -0 7.9487834 7.5274089 6.5517175 + 78600 2000 -0 7.9487834 7.5274147 6.5517089 + 78700 2000 -0 7.9487828 7.5274191 6.5517022 + 78800 2000 -0 7.9487818 7.5274218 6.5516978 + 78900 2000 -0 7.9487808 7.5274228 6.5516958 + 79000 2000 -0 7.9487799 7.5274219 6.5516967 + 79100 2000 -0 7.9487792 7.5274192 6.5516996 + 79200 2000 -0 7.9487784 7.5274145 6.5517047 + 79300 2000 -0 7.9487776 7.5274081 6.5517124 + 79400 2000 -0 7.9487765 7.5274002 6.5517225 + 79500 2000 -0 7.9487747 7.5273908 6.5517341 + 79600 2000 -0 7.9487717 7.5273805 6.5517474 + 79700 2000 -0 7.948767 7.52737 6.5517614 + 79800 2000 -0 7.9487601 7.5273598 6.5517746 + 79900 2000 -0 7.9487504 7.527351 6.5517858 + 80000 2000 -0 7.9487377 7.5273446 6.5517931 + 80100 2000 -0 7.9487219 7.5273416 6.5517947 + 80200 2000 -0 7.9487036 7.5273426 6.551789 + 80300 2000 -0 7.9486836 7.5273478 6.5517759 + 80400 2000 -0 7.9486632 7.5273569 6.5517558 + 80500 2000 -0 7.9486437 7.5273692 6.5517304 + 80600 2000 -0 7.9486265 7.5273836 6.5517023 + 80700 2000 -0 7.9486122 7.5273987 6.5516741 + 80800 2000 -0 7.9486012 7.5274136 6.5516477 + 80900 2000 -0 7.9485934 7.5274272 6.5516246 + 81000 2000 -0 7.9485882 7.5274391 6.5516056 + 81100 2000 -0 7.9485859 7.5274494 6.5515908 + 81200 2000 -0 7.9485834 7.5274563 6.5515794 + 81300 2000 -0 7.9485825 7.5274618 6.5515718 + 81400 2000 -0 7.948582 7.5274652 6.5515669 + 81500 2000 -0 7.9485815 7.5274667 6.5515644 + 81600 2000 -0 7.9485809 7.5274664 6.5515643 + 81700 2000 -0 7.94858 7.5274644 6.5515662 + 81800 2000 -0 7.9485788 7.5274606 6.55157 + 81900 2000 -0 7.9485776 7.527455 6.5515762 + 82000 2000 -0 7.9485765 7.5274475 6.5515851 + 82100 2000 -0 7.9485759 7.527438 6.5515969 + 82200 2000 -0 7.9485764 7.5274264 6.5516123 + 82300 2000 -0 7.9485786 7.5274127 6.5516316 + 82400 2000 -0 7.9485831 7.5273971 6.551655 + 82500 2000 -0 7.9485904 7.52738 6.5516822 + 82600 2000 -0 7.948601 7.5273621 6.5517124 + 82700 2000 -0 7.9486149 7.5273443 6.5517438 + 82800 2000 -0 7.9486316 7.5273279 6.5517741 + 82900 2000 -0 7.9486501 7.527314 6.5518008 + 83000 2000 -0 7.948669 7.5273036 6.5518216 + 83100 2000 -0 7.9486871 7.5272973 6.5518351 + 83200 2000 -0 7.9487031 7.527295 6.5518411 + 83300 2000 -0 7.9487163 7.5272965 6.5518404 + 83400 2000 -0 7.9487263 7.5273009 6.5518346 + 83500 2000 -0 7.9487334 7.5273073 6.5518255 + 83600 2000 -0 7.9487379 7.5273145 6.5518149 + 83700 2000 -0 7.9487402 7.5273219 6.5518041 + 83800 2000 -0 7.9487411 7.5273286 6.5517942 + 83900 2000 -0 7.948741 7.5273342 6.551786 + 84000 2000 -0 7.9487402 7.5273383 6.5517797 + 84100 2000 -0 7.9487392 7.5273407 6.5517757 + 84200 2000 -0 7.9487383 7.5273413 6.5517743 + 84300 2000 -0 7.9487374 7.5273402 6.5517756 + 84400 2000 -0 7.9487366 7.5273371 6.5517789 + 84500 2000 -0 7.9487359 7.5273321 6.5517843 + 84600 2000 -0 7.9487351 7.5273255 6.5517925 + 84700 2000 -0 7.948734 7.5273173 6.5518029 + 84800 2000 -0 7.948732 7.5273078 6.5518148 + 84900 2000 -0 7.9487288 7.5272974 6.5518282 + 85000 2000 -0 7.9487239 7.5272869 6.5518422 + 85100 2000 -0 7.9487166 7.5272769 6.5518552 + 85200 2000 -0 7.9487066 7.5272684 6.5518659 + 85300 2000 -0 7.9486935 7.5272625 6.5518726 + 85400 2000 -0 7.9486774 7.52726 6.5518732 + 85500 2000 -0 7.9486588 7.5272615 6.5518665 + 85600 2000 -0 7.9486387 7.5272673 6.5518525 + 85700 2000 -0 7.9486184 7.5272769 6.5518316 + 85800 2000 -0 7.9485993 7.5272895 6.5518058 + 85900 2000 -0 7.9485825 7.527304 6.5517777 + 86000 2000 -0 7.9485687 7.5273192 6.5517496 + 86100 2000 -0 7.9485582 7.5273338 6.5517237 + 86200 2000 -0 7.9485508 7.5273473 6.5517012 + 86300 2000 -0 7.9485459 7.5273589 6.5516828 + 86400 2000 -0 7.948543 7.5273683 6.5516683 + 86500 2000 -0 7.9485415 7.5273756 6.5516577 + 86600 2000 -0 7.9485407 7.5273808 6.5516504 + 86700 2000 -0 7.9485402 7.527384 6.5516458 + 86800 2000 -0 7.9485398 7.5273853 6.5516437 + 86900 2000 -0 7.9485391 7.5273848 6.5516437 + 87000 2000 -0 7.9485382 7.5273826 6.5516457 + 87100 2000 -0 7.948537 7.5273787 6.5516498 + 87200 2000 -0 7.9485358 7.527373 6.5516562 + 87300 2000 -0 7.9485347 7.5273654 6.5516652 + 87400 2000 -0 7.9485342 7.5273557 6.5516772 + 87500 2000 -0 7.9485348 7.527344 6.5516928 + 87600 2000 -0 7.9485371 7.5273302 6.5517124 + 87700 2000 -0 7.9485417 7.5273145 6.551736 + 87800 2000 -0 7.9485492 7.5272974 6.5517634 + 87900 2000 -0 7.9485605 7.5272797 6.5517928 + 88000 2000 -0 7.9485752 7.5272622 6.5518233 + 88100 2000 -0 7.9485926 7.5272462 6.5518526 + 88200 2000 -0 7.9486117 7.5272327 6.5518779 + 88300 2000 -0 7.9486313 7.5272227 6.5518973 + 88400 2000 -0 7.9486498 7.5272169 6.5519096 + 88500 2000 -0 7.9486663 7.5272151 6.5519142 + 88600 2000 -0 7.9486799 7.5272169 6.5519123 + 88700 2000 -0 7.9486904 7.5272216 6.5519055 + 88800 2000 -0 7.9486979 7.5272282 6.5518954 + 88900 2000 -0 7.9487028 7.5272357 6.5518839 + 89000 2000 -0 7.9487057 7.5272433 6.5518724 + 89100 2000 -0 7.9487072 7.5272501 6.5518617 + 89200 2000 -0 7.9487076 7.5272558 6.5518526 + 89300 2000 -0 7.9487074 7.5272601 6.5518456 + 89400 2000 -0 7.9487071 7.5272626 6.5518409 + 89500 2000 -0 7.9487067 7.5272635 6.5518386 + 89600 2000 -0 7.9487065 7.5272625 6.5518391 + 89700 2000 -0 7.9487063 7.5272596 6.5518416 + 89800 2000 -0 7.9487063 7.5272548 6.5518462 + 89900 2000 -0 7.9487061 7.5272484 6.5518535 + 90000 2000 -0 7.9487056 7.5272404 6.551863 + 90100 2000 -0 7.9487043 7.5272311 6.551874 + 90200 2000 -0 7.9487018 7.527221 6.5518866 + 90300 2000 -0 7.9486975 7.5272106 6.5518997 + 90400 2000 -0 7.948691 7.5272008 6.5519118 + 90500 2000 -0 7.9486816 7.5271925 6.5519217 + 90600 2000 -0 7.9486692 7.5271867 6.5519276 + 90700 2000 -0 7.9486538 7.5271843 6.5519275 + 90800 2000 -0 7.948636 7.527186 6.5519202 + 90900 2000 -0 7.9486166 7.5271918 6.5519055 + 91000 2000 -0 7.948597 7.5272016 6.551884 + 91100 2000 -0 7.9485784 7.5272143 6.5518575 + 91200 2000 -0 7.9485622 7.5272289 6.5518287 + 91300 2000 -0 7.948549 7.5272442 6.5517999 + 91400 2000 -0 7.9485391 7.5272591 6.5517731 + 91500 2000 -0 7.9485322 7.5272727 6.5517498 + 91600 2000 -0 7.9485279 7.5272845 6.5517305 + 91700 2000 -0 7.9485256 7.5272942 6.5517151 + 91800 2000 -0 7.9485247 7.5273018 6.5517036 + 91900 2000 -0 7.9485245 7.5273072 6.5516953 + 92000 2000 -0 7.9485247 7.5273107 6.5516898 + 92100 2000 -0 7.9485248 7.5273122 6.5516867 + 92200 2000 -0 7.9485251 7.5273121 6.5516858 + 92300 2000 -0 7.9485248 7.5273103 6.5516869 + 92400 2000 -0 7.948524 7.5273066 6.5516899 + 92500 2000 -0 7.9485234 7.5273012 6.5516952 + 92600 2000 -0 7.9485229 7.527294 6.5517031 + 92700 2000 -0 7.9485229 7.5272848 6.5517139 + 92800 2000 -0 7.948524 7.5272735 6.5517283 + 92900 2000 -0 7.9485267 7.5272601 6.5517465 + 93000 2000 -0 7.9485317 7.5272448 6.5517688 + 93100 2000 -0 7.9485395 7.527228 6.5517949 + 93200 2000 -0 7.9485506 7.5272104 6.5518239 + 93300 2000 -0 7.9485649 7.527193 6.5518542 + 93400 2000 -0 7.9485821 7.5271768 6.5518835 + 93500 2000 -0 7.948601 7.527163 6.5519093 + 93600 2000 -0 7.9486206 7.5271527 6.5519294 + 93700 2000 -0 7.9486392 7.5271464 6.5519423 + 93800 2000 -0 7.9486559 7.5271442 6.5519477 + 93900 2000 -0 7.9486698 7.5271457 6.5519465 + 94000 2000 -0 7.9486807 7.5271502 6.55194 + 94100 2000 -0 7.9486885 7.5271566 6.5519303 + 94200 2000 -0 7.9486937 7.527164 6.5519188 + 94300 2000 -0 7.9486968 7.5271716 6.5519072 + 94400 2000 -0 7.9486984 7.5271785 6.5518964 + 94500 2000 -0 7.948699 7.5271843 6.5518871 + 94600 2000 -0 7.948699 7.5271887 6.5518798 + 94700 2000 -0 7.9486987 7.5271915 6.5518747 + 94800 2000 -0 7.9486984 7.5271925 6.5518721 + 94900 2000 -0 7.9486982 7.5271918 6.5518722 + 95000 2000 -0 7.9486982 7.5271891 6.5518743 + 95100 2000 -0 7.9486982 7.5271846 6.5518785 + 95200 2000 -0 7.948698 7.5271783 6.5518855 + 95300 2000 -0 7.9486978 7.5271706 6.5518946 + 95400 2000 -0 7.9486968 7.5271614 6.5519053 + 95500 2000 -0 7.9486946 7.5271514 6.5519176 + 95600 2000 -0 7.9486908 7.527141 6.5519306 + 95700 2000 -0 7.9486848 7.527131 6.551943 + 95800 2000 -0 7.948676 7.5271224 6.5519533 + 95900 2000 -0 7.9486643 7.5271161 6.55196 + 96000 2000 -0 7.9486496 7.527113 6.5519611 + 96100 2000 -0 7.9486322 7.5271138 6.5519551 + 96200 2000 -0 7.9486132 7.5271189 6.5519417 + 96300 2000 -0 7.9485937 7.5271279 6.5519214 + 96400 2000 -0 7.948575 7.5271401 6.5518957 + 96500 2000 -0 7.9485584 7.5271543 6.5518672 + 96600 2000 -0 7.9485447 7.5271695 6.5518384 + 96700 2000 -0 7.9485343 7.5271845 6.5518111 + 96800 2000 -0 7.948527 7.5271983 6.5517871 + 96900 2000 -0 7.9485224 7.5272105 6.5517671 + 97000 2000 -0 7.9485199 7.5272206 6.551751 + 97100 2000 -0 7.9485188 7.5272285 6.5517387 + 97200 2000 -0 7.9485186 7.5272343 6.5517298 + 97300 2000 -0 7.9485188 7.5272381 6.5517238 + 97400 2000 -0 7.9485191 7.52724 6.5517202 + 97500 2000 -0 7.9485192 7.5272402 6.5517188 + 97600 2000 -0 7.9485191 7.5272387 6.5517194 + 97700 2000 -0 7.9485187 7.5272354 6.551722 + 97800 2000 -0 7.9485181 7.5272305 6.5517267 + 97900 2000 -0 7.9485176 7.5272237 6.5517339 + 98000 2000 -0 7.9485176 7.5272149 6.5517439 + 98100 2000 -0 7.9485184 7.5272041 6.5517572 + 98200 2000 -0 7.9485207 7.5271913 6.5517744 + 98300 2000 -0 7.9485251 7.5271764 6.5517956 + 98400 2000 -0 7.9485322 7.52716 6.5518207 + 98500 2000 -0 7.9485424 7.5271426 6.5518489 + 98600 2000 -0 7.948556 7.527125 6.5518789 + 98700 2000 -0 7.9485724 7.5271084 6.5519086 + 98800 2000 -0 7.948591 7.5270939 6.5519354 + 98900 2000 -0 7.9486105 7.5270826 6.551957 + 99000 2000 -0 7.9486296 7.5270752 6.5519718 + 99100 2000 -0 7.9486469 7.5270719 6.5519792 + 99200 2000 -0 7.9486615 7.5270725 6.5519795 + 99300 2000 -0 7.9486732 7.5270763 6.5519743 + 99400 2000 -0 7.9486818 7.5270822 6.5519652 + 99500 2000 -0 7.9486877 7.5270895 6.551954 + 99600 2000 -0 7.9486913 7.527097 6.5519424 + 99700 2000 -0 7.9486933 7.5271042 6.5519313 + 99800 2000 -0 7.9486941 7.5271104 6.5519215 + 99900 2000 -0 7.9486942 7.5271152 6.5519136 + 100000 2000 -0 7.9486939 7.5271185 6.5519079 +Loop time of 87.7116 on 1 procs for 100000 steps with 2000 atoms + +Performance: 98504.589 tau/day, 1140.099 timesteps/s, 2.280 Matom-step/s +99.5% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 66.081 | 66.081 | 66.081 | 0.0 | 75.34 +Neigh | 2.7411 | 2.7411 | 2.7411 | 0.0 | 3.13 +Comm | 1.3393 | 1.3393 | 1.3393 | 0.0 | 1.53 +Output | 0.029473 | 0.029473 | 0.029473 | 0.0 | 0.03 +Modify | 16.598 | 16.598 | 16.598 | 0.0 | 18.92 +Other | | 0.9233 | | | 1.05 + +Nlocal: 2000 ave 2000 max 2000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 494 ave 494 max 494 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 9635 ave 9635 max 9635 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 9635 +Ave neighs/atom = 4.8175 +Neighbor list builds = 3285 +Dangerous builds = 0 + +Total wall time: 0:01:27 diff --git a/examples/granular/log.15Sep22.pour.heat.g++.4 b/examples/granular/log.15Sep22.pour.heat.g++.4 new file mode 100644 index 0000000000..f159302d65 --- /dev/null +++ b/examples/granular/log.15Sep22.pour.heat.g++.4 @@ -0,0 +1,1172 @@ +LAMMPS (15 Sep 2022) +# pour one types of particles into cylinder and oscillate +# temperature of the bottom plate + +variable name string heat_plate + +atom_style sphere/temp +units lj + +############################################### +# Geometry-related parameters +############################################### + +variable boxx equal 10 +variable boxy equal 10 +variable boxz equal 50 + +variable drum_rad equal ${boxx}*0.5 +variable drum_rad equal 10*0.5 +variable drum_height equal 30 + +variable xc equal 0.5*${boxx} +variable xc equal 0.5*10 +variable yc equal 0.5*${boxx} +variable yc equal 0.5*10 +variable zc equal 0.5*${boxz} +variable zc equal 0.5*50 + +############################################### +# Particle-related parameters +############################################### +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable cyl_rad_inner equal ${drum_rad}-1.1*${rhi} +variable cyl_rad_inner equal 5-1.1*${rhi} +variable cyl_rad_inner equal 5-1.1*0.5 + +variable dens equal 1.0 + +variable skin equal 0.4*${rhi} +variable skin equal 0.4*0.5 + +############# +processors * * 1 +region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} +region boxreg block 0 10 0 ${boxy} 0 ${boxz} +region boxreg block 0 10 0 10 0 ${boxz} +region boxreg block 0 10 0 10 0 50 +create_box 2 boxreg +Created orthogonal box = (0 0 0) to (10 10 50) + 2 by 2 by 1 MPI processor grid +change_box all boundary p p f +Changing box ... + +pair_style granular +pair_coeff * * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 + +region curved_wall cylinder z ${xc} ${yc} ${drum_rad} 0 ${drum_height} side in +region curved_wall cylinder z 5 ${yc} ${drum_rad} 0 ${drum_height} side in +region curved_wall cylinder z 5 5 ${drum_rad} 0 ${drum_height} side in +region curved_wall cylinder z 5 5 5 0 ${drum_height} side in +region curved_wall cylinder z 5 5 5 0 30 side in +region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in +region bottom_wall plane 5 ${yc} 0 0 0 1 side in +region bottom_wall plane 5 5 0 0 0 1 side in + +region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 5 ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 5 5 ${cyl_rad_inner} ${drum_height} ${boxz} +region insreg cylinder z 5 5 4.45 ${drum_height} ${boxz} +region insreg cylinder z 5 5 4.45 30 ${boxz} +region insreg cylinder z 5 5 4.45 30 50 + +fix 0 all balance 100 1.0 shift xy 5 1.1 +fix 1 all nve/sphere +fix 2 all heat/flow/sphere/temp constant 1.0 +fix grav all gravity 10 vector 0 0 -1 +fix ins1 all pour 1000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 594 every 400 steps, 1000 by step 401 +fix ins2 all pour 1000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 1 dens 1 ${dens} +fix ins2 all pour 1000 2 1234 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 594 every 400 steps, 1000 by step 401 + +comm_modify vel yes + +neighbor ${skin} bin +neighbor 0.2 bin +neigh_modify delay 0 every 1 check yes + +variable oscillate equal 1.0*sin(step*0.0001) + +fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate + +thermo_style custom step atoms ke pxx pyy pzz +thermo_modify lost warn +thermo 100 + +timestep 0.001 + +#dump 1 all custom 1000 ${name}.dump id type radius mass x y z temperature heatflow + +#For removal later +compute 1 all property/atom radius +variable zmax atom z+c_1>0.5*${drum_height} +variable zmax atom z+c_1>0.5*30 +group delgroup dynamic all var zmax every 10000 +dynamic group delgroup defined + +run 100000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 17 17 84 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair granular, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.847 | 5.847 | 5.847 Mbytes + Step Atoms KinEng Pxx Pyy Pzz + 0 0 -0 0 0 0 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 100 536 -0 0 0 7.4220499 + 200 536 -0 0 0 10.753096 + 300 536 -0 0 0 13.500241 + 400 536 -0 0 0 18.036636 +WARNING: Less insertions than requested (../fix_pour.cpp:681) +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 500 903 -0 0 0 25.955524 + 600 903 -0 0 0 32.116907 + 700 903 -0 0.03620165 0.033499977 32.179357 + 800 903 -0 0.2106713 0.26431108 36.206318 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 900 1265 -0 0.2667335 0.20266671 44.177757 + 1000 1265 -0 0.51829265 0.67739212 49.904079 + 1100 1265 -0 0.87525564 0.6604066 53.13465 + 1200 1265 -0 0.8016023 0.82120199 54.27487 +WARNING: Less insertions than requested (../fix_pour.cpp:681) + 1300 1618 -0 1.0922969 1.2299526 61.033455 + 1400 1618 -0 3.4739827 3.2058732 60.989867 + 1500 1618 -0 2.952107 2.7920855 61.208615 + 1600 1618 -0 3.4540208 3.5863396 62.262722 + 1700 2000 -0 3.8875418 4.0835421 69.087737 + 1800 2000 -0 4.1780246 5.0584026 70.734293 + 1900 2000 -0 4.5873576 4.7767119 76.481264 + 2000 2000 -0 7.1355414 6.9027373 76.136305 + 2100 2000 -0 7.3292721 6.9457021 74.022659 + 2200 2000 -0 9.1771132 9.0399042 72.911506 + 2300 2000 -0 9.5743887 10.359952 70.996904 + 2400 2000 -0 12.1002 12.023765 68.246157 + 2500 2000 -0 10.68678 11.126488 59.337387 + 2600 2000 -0 10.444117 10.845713 57.115639 + 2700 2000 -0 12.012219 11.766618 56.397063 + 2800 2000 -0 12.987283 13.30882 55.411279 + 2900 2000 -0 11.55722 12.213726 48.690822 + 3000 2000 -0 11.124576 11.369397 43.425073 + 3100 2000 -0 12.54896 12.507632 45.15522 + 3200 2000 -0 13.119307 13.345554 41.469993 + 3300 2000 -0 12.07449 11.769699 32.849662 + 3400 2000 -0 11.409224 11.606583 28.228622 + 3500 2000 -0 13.30178 13.057278 28.120788 + 3600 2000 -0 12.362318 12.451842 22.030785 + 3700 2000 -0 10.065639 10.350313 14.404919 + 3800 2000 -0 9.2215449 9.4216178 10.78298 + 3900 2000 -0 9.1484555 9.2548793 9.4609704 + 4000 2000 -0 8.7679202 8.7720055 7.9592505 + 4100 2000 -0 7.9639161 8.0843783 6.2748484 + 4200 2000 -0 7.4475613 7.662972 5.7240274 + 4300 2000 -0 7.3834943 7.5643205 5.8884721 + 4400 2000 -0 7.5767328 7.7567295 6.4335134 + 4500 2000 -0 7.6350768 7.7802709 6.5220595 + 4600 2000 -0 7.5680597 7.7360764 6.2252142 + 4700 2000 -0 7.5455586 7.7200666 6.1870466 + 4800 2000 -0 7.5889323 7.7502568 6.3364001 + 4900 2000 -0 7.5976185 7.7506557 6.3511631 + 5000 2000 -0 7.5729575 7.7396108 6.226979 + 5100 2000 -0 7.5828423 7.7333361 6.2543182 + 5200 2000 -0 7.5997211 7.7682298 6.3300795 + 5300 2000 -0 7.5951405 7.7598744 6.3224087 + 5400 2000 -0 7.5703525 7.7452048 6.2321318 + 5500 2000 -0 7.5893936 7.7516359 6.2777047 + 5600 2000 -0 7.596363 7.7645306 6.3388976 + 5700 2000 -0 7.5889409 7.7570078 6.2848334 + 5800 2000 -0 7.5820271 7.7456337 6.2569579 + 5900 2000 -0 7.5946475 7.7646155 6.3117599 + 6000 2000 -0 7.5979789 7.7656429 6.3160667 + 6100 2000 -0 7.586255 7.7584393 6.2682341 + 6200 2000 -0 7.5860817 7.7574904 6.2792591 + 6300 2000 -0 7.5952765 7.7646058 6.3189922 + 6400 2000 -0 7.5996199 7.7770424 6.2986723 + 6500 2000 -0 7.5902888 7.7688566 6.2761571 + 6600 2000 -0 7.5950388 7.76863 6.2895943 + 6700 2000 -0 7.5966236 7.7691368 6.302048 + 6800 2000 -0 7.5939532 7.7641262 6.2726096 + 6900 2000 -0 7.5951993 7.7682327 6.2895245 + 7000 2000 -0 7.6023185 7.7697092 6.3080702 + 7100 2000 -0 7.5960578 7.7674031 6.2848334 + 7200 2000 -0 7.5982345 7.7654466 6.2788045 + 7300 2000 -0 7.6023187 7.7710769 6.3041624 + 7400 2000 -0 7.5974296 7.7673886 6.283173 + 7500 2000 -0 7.5973168 7.7670675 6.2788593 + 7600 2000 -0 7.5996473 7.7703847 6.2996016 + 7700 2000 -0 7.5973523 7.7680426 6.2917276 + 7800 2000 -0 7.5955633 7.7663282 6.2774422 + 7900 2000 -0 7.596774 7.7680408 6.2913039 + 8000 2000 -0 7.5990211 7.7682504 6.2971218 + 8100 2000 -0 7.5969667 7.7674553 6.2827596 + 8200 2000 -0 7.5968217 7.768405 6.2864438 + 8300 2000 -0 7.6003301 7.7675972 6.2968783 + 8400 2000 -0 7.5968968 7.7675447 6.2851363 + 8500 2000 -0 7.5964945 7.7664669 6.2821348 + 8600 2000 -0 7.59847 7.7686981 6.2935599 + 8700 2000 -0 7.5973531 7.7680237 6.2892401 + 8800 2000 -0 7.5962388 7.7660642 6.2824211 + 8900 2000 -0 7.5974758 7.7679467 6.2894374 + 9000 2000 -0 7.5980837 7.7680794 6.2922818 + 9100 2000 -0 7.5964734 7.766756 6.2837584 + 9200 2000 -0 7.5970307 7.7673294 6.2867417 + 9300 2000 -0 7.5979654 7.7680887 6.2924025 + 9400 2000 -0 7.5968814 7.7671306 6.2861078 + 9500 2000 -0 7.5967607 7.7670542 6.2853516 + 9600 2000 -0 7.5978051 7.7679583 6.2911802 + 9700 2000 -0 7.597238 7.767496 6.2880951 + 9800 2000 -0 7.596697 7.7670074 6.2853135 + 9900 2000 -0 7.5974854 7.7676519 6.2894109 + 10000 2000 -0 7.5974415 7.7676866 6.2894089 + 10100 2000 -0 7.5968332 7.7671611 6.2858705 + 10200 2000 -0 7.5971895 7.7673771 6.2881001 + 10300 2000 -0 7.5974344 7.7675998 6.2897713 + 10400 2000 -0 7.5969756 7.767279 6.2867879 + 10500 2000 -0 7.5970506 7.7672894 6.2872789 + 10600 2000 -0 7.5973817 7.7675529 6.2895398 + 10700 2000 -0 7.597085 7.7673281 6.2876393 + 10800 2000 -0 7.5969757 7.7672429 6.2869852 + 10900 2000 -0 7.5973016 7.7675261 6.2890364 + 11000 2000 -0 7.5971776 7.7674059 6.2882417 + 11100 2000 -0 7.596955 7.7672303 6.2870489 + 11200 2000 -0 7.5971842 7.7674346 6.288507 + 11300 2000 -0 7.5972149 7.7674441 6.2885796 + 11400 2000 -0 7.5969922 7.7672746 6.2872884 + 11500 2000 -0 7.5970948 7.7673717 6.2880589 + 11600 2000 -0 7.5971991 7.7674426 6.2886788 + 11700 2000 -0 7.5970217 7.7673051 6.2876396 + 11800 2000 -0 7.5970385 7.767356 6.2877736 + 11900 2000 -0 7.5971592 7.7674896 6.2885954 + 12000 2000 -0 7.5970437 7.7673831 6.2879896 + 12100 2000 -0 7.5969799 7.7673414 6.2876892 + 12200 2000 -0 7.597104 7.7674691 6.2883867 + 12300 2000 -0 7.5970688 7.7674421 6.2882073 + 12400 2000 -0 7.5969667 7.7673544 6.2877266 + 12500 2000 -0 7.5970342 7.7674299 6.2881961 + 12600 2000 -0 7.5970575 7.7674563 6.2883162 + 12700 2000 -0 7.5969702 7.7673919 6.2878499 + 12800 2000 -0 7.5969875 7.7674105 6.2880279 + 12900 2000 -0 7.5970261 7.7674542 6.2883236 + 13000 2000 -0 7.5969638 7.7674093 6.2880003 + 13100 2000 -0 7.5969523 7.7674055 6.2879583 + 13200 2000 -0 7.5969948 7.7674543 6.2882605 + 13300 2000 -0 7.5969671 7.7674324 6.2881167 + 13400 2000 -0 7.5969481 7.7674096 6.2879707 + 13500 2000 -0 7.5969704 7.7674472 6.2881927 + 13600 2000 -0 7.5969604 7.7674502 6.2881801 + 13700 2000 -0 7.5969111 7.7674226 6.2880031 + 13800 2000 -0 7.5969206 7.7674314 6.288133 + 13900 2000 -0 7.5969259 7.7674429 6.2882037 + 14000 2000 -0 7.5968972 7.7674314 6.2880579 + 14100 2000 -0 7.5968963 7.7674369 6.2880968 + 14200 2000 -0 7.5969042 7.7674469 6.2882024 + 14300 2000 -0 7.5968803 7.7674344 6.2881112 + 14400 2000 -0 7.59687 7.7674353 6.2880896 + 14500 2000 -0 7.5968808 7.7674514 6.2881879 + 14600 2000 -0 7.5968666 7.7674452 6.28815 + 14700 2000 -0 7.5968485 7.7674368 6.2880988 + 14800 2000 -0 7.5968535 7.767448 6.2881738 + 14900 2000 -0 7.5968474 7.7674514 6.2881775 + 15000 2000 -0 7.5968308 7.7674448 6.2881173 + 15100 2000 -0 7.5968288 7.7674504 6.2881599 + 15200 2000 -0 7.5968259 7.7674545 6.2881943 + 15300 2000 -0 7.5968096 7.7674493 6.2881446 + 15400 2000 -0 7.5968036 7.7674548 6.2881534 + 15500 2000 -0 7.5968025 7.7674625 6.2881974 + 15600 2000 -0 7.5967877 7.7674575 6.2881698 + 15700 2000 -0 7.5967763 7.7674574 6.2881574 + 15800 2000 -0 7.5967748 7.7674674 6.2881956 + 15900 2000 -0 7.5967648 7.7674695 6.2881883 + 16000 2000 -0 7.5967506 7.7674666 6.2881665 + 16100 2000 -0 7.5967447 7.7674721 6.2881929 + 16200 2000 -0 7.596737 7.7674775 6.2882018 + 16300 2000 -0 7.596724 7.7674779 6.2881798 + 16400 2000 -0 7.5967156 7.7674817 6.2881911 + 16500 2000 -0 7.5967078 7.7674863 6.2882086 + 16600 2000 -0 7.5966952 7.7674871 6.288195 + 16700 2000 -0 7.5966855 7.7674905 6.288195 + 16800 2000 -0 7.5966849 7.7675018 6.2882111 + 16900 2000 -0 7.5966659 7.767499 6.2882084 + 17000 2000 -0 7.5966553 7.7674989 6.288203 + 17100 2000 -0 7.5966481 7.7675039 6.288216 + 17200 2000 -0 7.5966391 7.7675079 6.2882174 + 17300 2000 -0 7.5966284 7.7675095 6.2882114 + 17400 2000 -0 7.5966197 7.7675124 6.2882207 + 17500 2000 -0 7.5966116 7.7675184 6.2882274 + 17600 2000 -0 7.5966015 7.7675179 6.2882213 + 17700 2000 -0 7.596598 7.7675217 6.2882271 + 17800 2000 -0 7.5965839 7.7675249 6.2882319 + 17900 2000 -0 7.5965764 7.7675277 6.2882321 + 18000 2000 -0 7.5965694 7.7675324 6.2882345 + 18100 2000 -0 7.5965606 7.7675381 6.288242 + 18200 2000 -0 7.5965529 7.7675402 6.2882446 + 18300 2000 -0 7.5965448 7.7675416 6.2882447 + 18400 2000 -0 7.5965376 7.7675437 6.2882479 + 18500 2000 -0 7.5965312 7.7675449 6.2882502 + 18600 2000 -0 7.5965234 7.7675465 6.2882488 + 18700 2000 -0 7.5965164 7.7675489 6.2882532 + 18800 2000 -0 7.5965092 7.7675524 6.2882585 + 18900 2000 -0 7.5965015 7.7675553 6.2882605 + 19000 2000 -0 7.5964943 7.7675579 6.288263 + 19100 2000 -0 7.5964874 7.7675604 6.2882669 + 19200 2000 -0 7.59648 7.7675614 6.2882681 + 19300 2000 -0 7.5964723 7.7675626 6.2882686 + 19400 2000 -0 7.596465 7.7675656 6.2882725 + 19500 2000 -0 7.5964572 7.7675691 6.2882763 + 19600 2000 -0 7.5964488 7.767572 6.2882784 + 19700 2000 -0 7.5964406 7.7675747 6.2882815 + 19800 2000 -0 7.5964328 7.7675771 6.2882844 + 19900 2000 -0 7.5964247 7.7675792 6.288285 + 20000 2000 -0 7.5964164 7.7675815 6.2882866 + 20100 2000 -0 7.5964079 7.7675846 6.28829 + 20200 2000 -0 7.596399 7.7675881 6.2882925 + 20300 2000 -0 7.5963909 7.7675919 6.2882955 + 20400 2000 -0 7.5963809 7.7675953 6.2882972 + 20500 2000 -0 7.5963752 7.7676011 6.2883018 + 20600 2000 -0 7.5963619 7.7676092 6.2883037 + 20700 2000 -0 7.5963522 7.767611 6.2883069 + 20800 2000 -0 7.5963411 7.7676172 6.28831 + 20900 2000 -0 7.5963304 7.7676213 6.2883118 + 21000 2000 -0 7.5963203 7.767625 6.2883148 + 21100 2000 -0 7.5963105 7.7676285 6.2883181 + 21200 2000 -0 7.5963007 7.7676317 6.2883195 + 21300 2000 -0 7.5962911 7.7676349 6.2883215 + 21400 2000 -0 7.5962816 7.7676382 6.2883246 + 21500 2000 -0 7.5962731 7.7676543 6.288331 + 21600 2000 -0 7.5962632 7.7676583 6.2883332 + 21700 2000 -0 7.5962548 7.767661 6.2883366 + 21800 2000 -0 7.5962459 7.7676634 6.2883395 + 21900 2000 -0 7.5962373 7.7676655 6.2883415 + 22000 2000 -0 7.5962319 7.7676679 6.2883449 + 22100 2000 -0 7.5962209 7.7676703 6.2883465 + 22200 2000 -0 7.5962128 7.7676725 6.2883506 + 22300 2000 -0 7.5962054 7.7676747 6.2883528 + 22400 2000 -0 7.5961978 7.7676768 6.2883553 + 22500 2000 -0 7.5961903 7.7676789 6.288359 + 22600 2000 -0 7.596183 7.7676807 6.2883613 + 22700 2000 -0 7.5961756 7.7676824 6.288363 + 22800 2000 -0 7.5961685 7.7676843 6.2883669 + 22900 2000 -0 7.5961616 7.7676859 6.2883701 + 23000 2000 -0 7.5961555 7.7676881 6.2883726 + 23100 2000 -0 7.5961478 7.7676894 6.2883761 + 23200 2000 -0 7.5961408 7.7676905 6.2883794 + 23300 2000 -0 7.5961337 7.7676917 6.2883816 + 23400 2000 -0 7.5961266 7.7676931 6.2883848 + 23500 2000 -0 7.5961196 7.7676947 6.2883884 + 23600 2000 -0 7.5961122 7.7676962 6.2883911 + 23700 2000 -0 7.5961047 7.7676979 6.2883942 + 23800 2000 -0 7.5960972 7.7676997 6.2883977 + 23900 2000 -0 7.5960894 7.7677015 6.2884004 + 24000 2000 -0 7.5960814 7.7677033 6.288403 + 24100 2000 -0 7.5960734 7.7677054 6.2884061 + 24200 2000 -0 7.5960651 7.7677076 6.2884089 + 24300 2000 -0 7.5960576 7.76771 6.2884124 + 24400 2000 -0 7.5960487 7.7677127 6.288415 + 24500 2000 -0 7.596039 7.7677152 6.2884169 + 24600 2000 -0 7.59603 7.7677178 6.2884192 + 24700 2000 -0 7.5960208 7.7677205 6.2884216 + 24800 2000 -0 7.5960115 7.7677234 6.2884242 + 24900 2000 -0 7.5960021 7.7677264 6.2884266 + 25000 2000 -0 7.5959926 7.7677293 6.288429 + 25100 2000 -0 7.595983 7.7677323 6.2884316 + 25200 2000 -0 7.5959735 7.7677352 6.2884341 + 25300 2000 -0 7.5959639 7.7677381 6.2884365 + 25400 2000 -0 7.5959544 7.7677409 6.2884391 + 25500 2000 -0 7.5959449 7.7677437 6.2884418 + 25600 2000 -0 7.5959355 7.7677464 6.2884444 + 25700 2000 -0 7.5959262 7.7677491 6.2884471 + 25800 2000 -0 7.5959171 7.7677518 6.2884498 + 25900 2000 -0 7.5959081 7.7677543 6.2884525 + 26000 2000 -0 7.5958993 7.7677567 6.2884551 + 26100 2000 -0 7.5958907 7.7677591 6.2884578 + 26200 2000 -0 7.595883 7.7677616 6.2884607 + 26300 2000 -0 7.5958752 7.7677633 6.2884628 + 26400 2000 -0 7.5958661 7.7677658 6.288466 + 26500 2000 -0 7.5958577 7.7677683 6.2884697 + 26600 2000 -0 7.5958499 7.7677701 6.2884712 + 26700 2000 -0 7.5958424 7.767772 6.2884735 + 26800 2000 -0 7.5958352 7.7677742 6.2884777 + 26900 2000 -0 7.5958278 7.767776 6.2884798 + 27000 2000 -0 7.5958205 7.7677777 6.2884817 + 27100 2000 -0 7.5958171 7.7677861 6.2884867 + 27200 2000 -0 7.5958058 7.767782 6.2884877 + 27300 2000 -0 7.5957995 7.767783 6.2884897 + 27400 2000 -0 7.5957928 7.7677845 6.2884941 + 27500 2000 -0 7.5957858 7.7677862 6.2884971 + 27600 2000 -0 7.5957786 7.7677876 6.2884991 + 27700 2000 -0 7.5957716 7.7677894 6.2885028 + 27800 2000 -0 7.5957644 7.7677911 6.2885058 + 27900 2000 -0 7.595757 7.7677927 6.2885082 + 28000 2000 -0 7.5957496 7.7677945 6.2885114 + 28100 2000 -0 7.5957421 7.7677965 6.2885146 + 28200 2000 -0 7.5957342 7.7677984 6.288517 + 28300 2000 -0 7.5957263 7.7678006 6.2885197 + 28400 2000 -0 7.5957182 7.7678029 6.2885227 + 28500 2000 -0 7.5957098 7.7678053 6.2885251 + 28600 2000 -0 7.595701 7.7678109 6.2885275 + 28700 2000 -0 7.5956927 7.7678104 6.2885301 + 28800 2000 -0 7.5956839 7.7678133 6.2885325 + 28900 2000 -0 7.5956749 7.7678161 6.2885345 + 29000 2000 -0 7.5956658 7.7678191 6.2885369 + 29100 2000 -0 7.5956566 7.7678222 6.2885392 + 29200 2000 -0 7.5956473 7.7678253 6.2885412 + 29300 2000 -0 7.5956379 7.7678284 6.2885434 + 29400 2000 -0 7.5956285 7.7678315 6.2885458 + 29500 2000 -0 7.595619 7.7678346 6.288548 + 29600 2000 -0 7.5956096 7.7678376 6.2885502 + 29700 2000 -0 7.5956004 7.7678407 6.2885528 + 29800 2000 -0 7.5955908 7.7678436 6.2885551 + 29900 2000 -0 7.5955816 7.7678465 6.2885573 + 30000 2000 -0 7.5955725 7.7678494 6.2885598 + 30100 2000 -0 7.5955635 7.7678522 6.2885623 + 30200 2000 -0 7.5955547 7.7678548 6.2885646 + 30300 2000 -0 7.5955461 7.7678575 6.2885671 + 30400 2000 -0 7.5955377 7.7678601 6.2885696 + 30500 2000 -0 7.5955317 7.7678632 6.288572 + 30600 2000 -0 7.5955209 7.7678646 6.2885732 + 30700 2000 -0 7.5955138 7.7678673 6.2885773 + 30800 2000 -0 7.5955057 7.7678698 6.2885802 + 30900 2000 -0 7.5954978 7.7678719 6.2885813 + 31000 2000 -0 7.5954905 7.7678739 6.2885838 + 31100 2000 -0 7.5954836 7.7678764 6.2885876 + 31200 2000 -0 7.5954763 7.7678782 6.2885891 + 31300 2000 -0 7.5954742 7.7678842 6.2885893 + 31400 2000 -0 7.5954635 7.7678813 6.2885963 + 31500 2000 -0 7.5954662 7.7678813 6.2885978 + 31600 2000 -0 7.5954651 7.767881 6.2885992 + 31700 2000 -0 7.5954652 7.7678813 6.2886059 + 31800 2000 -0 7.5954642 7.7678815 6.2886093 + 31900 2000 -0 7.5954627 7.7678812 6.2886098 + 32000 2000 -0 7.5954619 7.7678816 6.2886155 + 32100 2000 -0 7.5954608 7.767882 6.2886199 + 32200 2000 -0 7.595459 7.7678819 6.2886212 + 32300 2000 -0 7.5954574 7.7678824 6.2886253 + 32400 2000 -0 7.5954559 7.7678831 6.2886303 + 32500 2000 -0 7.5954537 7.7678834 6.2886323 + 32600 2000 -0 7.5954513 7.7678841 6.2886353 + 32700 2000 -0 7.5954491 7.767885 6.2886401 + 32800 2000 -0 7.5954463 7.7678859 6.2886428 + 32900 2000 -0 7.5954433 7.7678868 6.2886452 + 33000 2000 -0 7.5954404 7.7678881 6.2886494 + 33100 2000 -0 7.5954372 7.7678894 6.2886525 + 33200 2000 -0 7.5954345 7.76789 6.2886545 + 33300 2000 -0 7.5954319 7.7678907 6.2886578 + 33400 2000 -0 7.5954292 7.7678914 6.2886612 + 33500 2000 -0 7.5954262 7.767892 6.2886633 + 33600 2000 -0 7.5954232 7.7678927 6.2886662 + 33700 2000 -0 7.5954203 7.7678934 6.2886697 + 33800 2000 -0 7.5954172 7.767894 6.2886722 + 33900 2000 -0 7.5954142 7.7678945 6.288675 + 34000 2000 -0 7.5954113 7.7678952 6.2886785 + 34100 2000 -0 7.5954084 7.7678956 6.2886814 + 34200 2000 -0 7.5954056 7.767896 6.2886841 + 34300 2000 -0 7.595403 7.7678964 6.2886876 + 34400 2000 -0 7.5954005 7.7678968 6.2886908 + 34500 2000 -0 7.5953981 7.7678969 6.2886936 + 34600 2000 -0 7.5953959 7.7678971 6.2886968 + 34700 2000 -0 7.595394 7.7678972 6.2887001 + 34800 2000 -0 7.5953953 7.7678972 6.288703 + 34900 2000 -0 7.5953889 7.767897 6.2887047 + 35000 2000 -0 7.5953908 7.7678971 6.2887098 + 35100 2000 -0 7.5953877 7.7678973 6.2887122 + 35200 2000 -0 7.5953867 7.767897 6.2887144 + 35300 2000 -0 7.5953863 7.7678962 6.2887182 + 35400 2000 -0 7.5953856 7.7678962 6.288722 + 35500 2000 -0 7.5953849 7.7678956 6.2887237 + 35600 2000 -0 7.5953846 7.7678951 6.2887271 + 35700 2000 -0 7.5953844 7.7678947 6.2887309 + 35800 2000 -0 7.595384 7.767894 6.2887334 + 35900 2000 -0 7.5953838 7.7678933 6.2887362 + 36000 2000 -0 7.5953837 7.7678927 6.2887403 + 36100 2000 -0 7.5953834 7.767892 6.2887432 + 36200 2000 -0 7.595383 7.7678913 6.2887459 + 36300 2000 -0 7.5953827 7.7678907 6.2887498 + 36400 2000 -0 7.5953821 7.7678901 6.2887531 + 36500 2000 -0 7.5953814 7.7678895 6.2887558 + 36600 2000 -0 7.5953807 7.7678891 6.2887593 + 36700 2000 -0 7.5953797 7.7678887 6.2887627 + 36800 2000 -0 7.5953785 7.7678884 6.2887654 + 36900 2000 -0 7.5953772 7.7678883 6.2887685 + 37000 2000 -0 7.5953757 7.7678884 6.2887717 + 37100 2000 -0 7.595374 7.7678885 6.2887744 + 37200 2000 -0 7.5953721 7.7678888 6.2887771 + 37300 2000 -0 7.59537 7.7678892 6.2887801 + 37400 2000 -0 7.5953678 7.7678897 6.2887827 + 37500 2000 -0 7.5953654 7.7678903 6.2887851 + 37600 2000 -0 7.5953628 7.767891 6.2887879 + 37700 2000 -0 7.5953602 7.7678918 6.2887906 + 37800 2000 -0 7.5953571 7.7678929 6.288793 + 37900 2000 -0 7.5953545 7.7678935 6.2887957 + 38000 2000 -0 7.5953517 7.7678941 6.2887985 + 38100 2000 -0 7.5953488 7.7678949 6.2888011 + 38200 2000 -0 7.5953459 7.7678956 6.2888037 + 38300 2000 -0 7.5953431 7.7678962 6.2888066 + 38400 2000 -0 7.5953404 7.7678969 6.2888094 + 38500 2000 -0 7.5953377 7.7678974 6.2888122 + 38600 2000 -0 7.5953352 7.7678979 6.2888151 + 38700 2000 -0 7.5953328 7.7678983 6.288818 + 38800 2000 -0 7.5953306 7.7678987 6.2888209 + 38900 2000 -0 7.5953285 7.7678991 6.2888238 + 39000 2000 -0 7.5953266 7.7678994 6.2888267 + 39100 2000 -0 7.5953284 7.7678993 6.2888299 + 39200 2000 -0 7.5953221 7.7679002 6.2888311 + 39300 2000 -0 7.5953225 7.7678998 6.2888359 + 39400 2000 -0 7.5953215 7.7678999 6.2888384 + 39500 2000 -0 7.5953234 7.7678996 6.2888401 + 39600 2000 -0 7.5953197 7.7678996 6.2888437 + 39700 2000 -0 7.5953193 7.7678996 6.2888471 + 39800 2000 -0 7.5953187 7.7678992 6.2888486 + 39900 2000 -0 7.5953185 7.7678989 6.2888519 + 40000 2000 -0 7.5953185 7.7678987 6.2888555 + 40100 2000 -0 7.5953171 7.7678976 6.2888576 + 40200 2000 -0 7.595318 7.7678977 6.2888603 + 40300 2000 -0 7.5953181 7.7678973 6.2888642 + 40400 2000 -0 7.5953178 7.7678967 6.2888668 + 40500 2000 -0 7.5953175 7.7678962 6.2888695 + 40600 2000 -0 7.5953174 7.7678958 6.2888733 + 40700 2000 -0 7.5953169 7.7678954 6.2888761 + 40800 2000 -0 7.5953162 7.767895 6.2888787 + 40900 2000 -0 7.5953155 7.7678947 6.288882 + 41000 2000 -0 7.5953147 7.7678946 6.2888851 + 41100 2000 -0 7.5953136 7.7678944 6.2888876 + 41200 2000 -0 7.5953123 7.7678945 6.2888905 + 41300 2000 -0 7.5953109 7.7678948 6.2888936 + 41400 2000 -0 7.5953091 7.7678948 6.2888961 + 41500 2000 -0 7.595307 7.7678943 6.2888989 + 41600 2000 -0 7.5953046 7.7678939 6.2889022 + 41700 2000 -0 7.5953019 7.7678935 6.2889051 + 41800 2000 -0 7.595299 7.7678933 6.2889079 + 41900 2000 -0 7.5952973 7.7678931 6.2889112 + 42000 2000 -0 7.595293 7.7678931 6.2889142 + 42100 2000 -0 7.5952897 7.7678929 6.2889165 + 42200 2000 -0 7.5952864 7.7678928 6.2889198 + 42300 2000 -0 7.5952831 7.7678928 6.288923 + 42400 2000 -0 7.5952797 7.7678926 6.2889256 + 42500 2000 -0 7.5952764 7.7678925 6.2889289 + 42600 2000 -0 7.595274 7.7678914 6.2889322 + 42700 2000 -0 7.5952704 7.7678916 6.2889354 + 42800 2000 -0 7.595267 7.7678911 6.2889384 + 42900 2000 -0 7.5952656 7.7678941 6.2889425 + 43000 2000 -0 7.5952627 7.7678921 6.2889451 + 43100 2000 -0 7.5952594 7.7678889 6.2889481 + 43200 2000 -0 7.5952565 7.7678879 6.2889509 + 43300 2000 -0 7.5952547 7.7678871 6.2889548 + 43400 2000 -0 7.5952557 7.767886 6.2889583 + 43500 2000 -0 7.5952503 7.7678854 6.2889594 + 43600 2000 -0 7.5952493 7.7678839 6.288965 + 43700 2000 -0 7.5952482 7.7678827 6.2889677 + 43800 2000 -0 7.5952467 7.7678813 6.2889694 + 43900 2000 -0 7.5952458 7.7678801 6.2889739 + 44000 2000 -0 7.5952454 7.7678787 6.2889774 + 44100 2000 -0 7.5952449 7.7678768 6.2889786 + 44200 2000 -0 7.5952449 7.7678753 6.2889822 + 44300 2000 -0 7.595245 7.7678737 6.288986 + 44400 2000 -0 7.5952448 7.7678718 6.2889879 + 44500 2000 -0 7.5952448 7.7678699 6.2889908 + 44600 2000 -0 7.595245 7.7678683 6.2889949 + 44700 2000 -0 7.5952448 7.7678663 6.2889974 + 44800 2000 -0 7.5952446 7.7678644 6.289 + 44900 2000 -0 7.595245 7.7678622 6.2890034 + 45000 2000 -0 7.5952444 7.767861 6.2890073 + 45100 2000 -0 7.5952437 7.7678593 6.2890094 + 45200 2000 -0 7.595243 7.7678577 6.2890129 + 45300 2000 -0 7.5952422 7.7678563 6.289016 + 45400 2000 -0 7.5952411 7.7678549 6.2890185 + 45500 2000 -0 7.5952399 7.7678537 6.2890214 + 45600 2000 -0 7.5952386 7.7678526 6.2890245 + 45700 2000 -0 7.595237 7.7678516 6.2890269 + 45800 2000 -0 7.5952352 7.7678508 6.2890295 + 45900 2000 -0 7.5952333 7.7678501 6.2890323 + 46000 2000 -0 7.5952312 7.7678495 6.2890348 + 46100 2000 -0 7.5952289 7.767849 6.289037 + 46200 2000 -0 7.5952265 7.7678486 6.2890397 + 46300 2000 -0 7.595224 7.7678482 6.2890422 + 46400 2000 -0 7.5952213 7.7678478 6.2890445 + 46500 2000 -0 7.5952186 7.7678474 6.2890471 + 46600 2000 -0 7.5952159 7.767847 6.2890498 + 46700 2000 -0 7.5952132 7.7678466 6.2890522 + 46800 2000 -0 7.5952105 7.7678462 6.2890548 + 46900 2000 -0 7.5952078 7.7678457 6.2890576 + 47000 2000 -0 7.5952052 7.767848 6.2890603 + 47100 2000 -0 7.5952028 7.7678445 6.2890629 + 47200 2000 -0 7.5952004 7.7678438 6.2890658 + 47300 2000 -0 7.5951983 7.767843 6.2890684 + 47400 2000 -0 7.5951963 7.7678421 6.289071 + 47500 2000 -0 7.5951945 7.7678412 6.2890739 + 47600 2000 -0 7.5951928 7.7678403 6.2890766 + 47700 2000 -0 7.5951936 7.7678391 6.2890792 + 47800 2000 -0 7.5951902 7.7678383 6.2890813 + 47900 2000 -0 7.5951889 7.7678373 6.2890856 + 48000 2000 -0 7.5951881 7.7678358 6.2890872 + 48100 2000 -0 7.5951873 7.7678344 6.2890892 + 48200 2000 -0 7.595187 7.7678333 6.2890933 + 48300 2000 -0 7.5951866 7.7678318 6.2890956 + 48400 2000 -0 7.5951861 7.7678302 6.2890972 + 48500 2000 -0 7.5951861 7.7678288 6.289101 + 48600 2000 -0 7.5951861 7.7678272 6.289104 + 48700 2000 -0 7.5951858 7.7678254 6.2891058 + 48800 2000 -0 7.5951858 7.7678255 6.2891126 + 48900 2000 -0 7.5951857 7.767822 6.2891123 + 49000 2000 -0 7.5951856 7.7678203 6.2891153 + 49100 2000 -0 7.5951853 7.7678184 6.2891183 + 49200 2000 -0 7.595185 7.7678166 6.289121 + 49300 2000 -0 7.5951845 7.7678149 6.2891242 + 49400 2000 -0 7.595184 7.7678133 6.2891272 + 49500 2000 -0 7.5951831 7.7678116 6.2891298 + 49600 2000 -0 7.5951822 7.7678102 6.2891328 + 49700 2000 -0 7.5951811 7.7678089 6.2891358 + 49800 2000 -0 7.5951797 7.7678076 6.2891384 + 49900 2000 -0 7.5951782 7.7678065 6.2891412 + 50000 2000 -0 7.5951765 7.7678056 6.289144 + 50100 2000 -0 7.5951746 7.7678048 6.2891464 + 50200 2000 -0 7.5951725 7.7678041 6.2891489 + 50300 2000 -0 7.5951703 7.7678035 6.2891515 + 50400 2000 -0 7.5951679 7.767803 6.2891539 + 50500 2000 -0 7.5951653 7.7678025 6.2891563 + 50600 2000 -0 7.5951627 7.7678021 6.2891588 + 50700 2000 -0 7.59516 7.7678018 6.2891612 + 50800 2000 -0 7.5951572 7.7678014 6.2891637 + 50900 2000 -0 7.5951543 7.767801 6.2891662 + 51000 2000 -0 7.5951515 7.7678035 6.2891689 + 51100 2000 -0 7.5951486 7.7678002 6.2891713 + 51200 2000 -0 7.5951459 7.7677995 6.2891739 + 51300 2000 -0 7.5951433 7.7677989 6.2891766 + 51400 2000 -0 7.5951407 7.7677982 6.2891793 + 51500 2000 -0 7.5951383 7.7677975 6.289182 + 51600 2000 -0 7.595136 7.7677966 6.2891847 + 51700 2000 -0 7.5951339 7.7677957 6.2891875 + 51800 2000 -0 7.595132 7.7677948 6.2891902 + 51900 2000 -0 7.5951305 7.7677938 6.289193 + 52000 2000 -0 7.5951299 7.7677923 6.289195 + 52100 2000 -0 7.5951278 7.7677914 6.2891981 + 52200 2000 -0 7.5951262 7.7677905 6.2892017 + 52300 2000 -0 7.5951252 7.767789 6.2892033 + 52400 2000 -0 7.5951244 7.7677876 6.2892055 + 52500 2000 -0 7.595124 7.7677865 6.2892095 + 52600 2000 -0 7.5951234 7.7677849 6.2892116 + 52700 2000 -0 7.5951229 7.7677832 6.2892135 + 52800 2000 -0 7.5951229 7.7677818 6.2892173 + 52900 2000 -0 7.5951227 7.7677801 6.28922 + 53000 2000 -0 7.5951223 7.7677783 6.289222 + 53100 2000 -0 7.5951223 7.7677766 6.2892254 + 53200 2000 -0 7.5951221 7.7677749 6.2892286 + 53300 2000 -0 7.5951218 7.7677731 6.2892308 + 53400 2000 -0 7.5951215 7.7677713 6.289234 + 53500 2000 -0 7.5951213 7.7677724 6.2892375 + 53600 2000 -0 7.5951205 7.7677678 6.2892398 + 53700 2000 -0 7.5951197 7.7677663 6.2892426 + 53800 2000 -0 7.5951189 7.7677649 6.2892459 + 53900 2000 -0 7.5951178 7.7677635 6.2892486 + 54000 2000 -0 7.5951165 7.7677622 6.289251 + 54100 2000 -0 7.5951151 7.7677611 6.289254 + 54200 2000 -0 7.5951135 7.7677602 6.2892567 + 54300 2000 -0 7.5951116 7.7677592 6.2892589 + 54400 2000 -0 7.5951095 7.7677585 6.2892615 + 54500 2000 -0 7.5951073 7.7677579 6.2892641 + 54600 2000 -0 7.5951059 7.7677573 6.2892662 + 54700 2000 -0 7.5951022 7.7677569 6.2892686 + 54800 2000 -0 7.5950995 7.7677565 6.2892711 + 54900 2000 -0 7.5950966 7.7677562 6.2892734 + 55000 2000 -0 7.5950936 7.7677558 6.2892757 + 55100 2000 -0 7.5950906 7.7677555 6.2892782 + 55200 2000 -0 7.5950876 7.7677552 6.2892806 + 55300 2000 -0 7.5950846 7.7677547 6.289283 + 55400 2000 -0 7.5950816 7.7677543 6.2892856 + 55500 2000 -0 7.5950787 7.7677538 6.2892882 + 55600 2000 -0 7.5950758 7.7677532 6.2892907 + 55700 2000 -0 7.5950731 7.7677526 6.2892934 + 55800 2000 -0 7.5950705 7.7677519 6.2892961 + 55900 2000 -0 7.5950681 7.7677511 6.2892987 + 56000 2000 -0 7.5950658 7.7677503 6.2893013 + 56100 2000 -0 7.5950637 7.7677494 6.289304 + 56200 2000 -0 7.5950636 7.7677489 6.2893069 + 56300 2000 -0 7.5950599 7.7677469 6.2893081 + 56400 2000 -0 7.5950591 7.7677461 6.2893121 + 56500 2000 -0 7.5950575 7.7677452 6.2893152 + 56600 2000 -0 7.595056 7.7677438 6.2893165 + 56700 2000 -0 7.5950551 7.7677425 6.2893191 + 56800 2000 -0 7.5950546 7.7677414 6.289323 + 56900 2000 -0 7.5950537 7.7677398 6.2893246 + 57000 2000 -0 7.5950531 7.7677383 6.2893268 + 57100 2000 -0 7.5950528 7.7677369 6.2893306 + 57200 2000 -0 7.5950524 7.7677352 6.289333 + 57300 2000 -0 7.5950519 7.7677334 6.289335 + 57400 2000 -0 7.5950517 7.7677318 6.2893386 + 57500 2000 -0 7.5950513 7.7677302 6.2893415 + 57600 2000 -0 7.5950507 7.7677283 6.2893436 + 57700 2000 -0 7.5950502 7.7677267 6.2893469 + 57800 2000 -0 7.5950496 7.7677251 6.2893501 + 57900 2000 -0 7.5950486 7.7677235 6.2893525 + 58000 2000 -0 7.5950476 7.767722 6.2893554 + 58100 2000 -0 7.5950465 7.7677207 6.2893585 + 58200 2000 -0 7.5950451 7.7677194 6.289361 + 58300 2000 -0 7.5950436 7.7677183 6.2893635 + 58400 2000 -0 7.5950421 7.7677174 6.2893664 + 58500 2000 -0 7.5950402 7.7677166 6.2893688 + 58600 2000 -0 7.5950381 7.7677158 6.289371 + 58700 2000 -0 7.595036 7.7677153 6.2893736 + 58800 2000 -0 7.5950336 7.7677148 6.289376 + 58900 2000 -0 7.595031 7.7677144 6.2893781 + 59000 2000 -0 7.5950283 7.7677141 6.2893804 + 59100 2000 -0 7.5950254 7.7677139 6.2893828 + 59200 2000 -0 7.5950225 7.7677137 6.2893849 + 59300 2000 -0 7.5950194 7.7677135 6.2893872 + 59400 2000 -0 7.5950163 7.7677134 6.2893896 + 59500 2000 -0 7.5950132 7.7677131 6.2893919 + 59600 2000 -0 7.5950101 7.7677129 6.2893942 + 59700 2000 -0 7.595007 7.7677126 6.2893968 + 59800 2000 -0 7.5950047 7.7677123 6.2893992 + 59900 2000 -0 7.5950011 7.7677118 6.2894016 + 60000 2000 -0 7.5949983 7.7677113 6.2894042 + 60100 2000 -0 7.5949956 7.7677107 6.2894068 + 60200 2000 -0 7.5949931 7.7677101 6.2894093 + 60300 2000 -0 7.5949908 7.7677094 6.2894119 + 60400 2000 -0 7.5949886 7.7677087 6.2894145 + 60500 2000 -0 7.5949893 7.7677082 6.2894169 + 60600 2000 -0 7.5949834 7.7677067 6.2894183 + 60700 2000 -0 7.5949837 7.7677058 6.2894226 + 60800 2000 -0 7.5949821 7.767705 6.2894252 + 60900 2000 -0 7.5949805 7.7677038 6.2894264 + 61000 2000 -0 7.5949795 7.7677026 6.2894293 + 61100 2000 -0 7.5949789 7.7677016 6.2894329 + 61200 2000 -0 7.5949779 7.7677001 6.2894343 + 61300 2000 -0 7.5949772 7.7676987 6.2894368 + 61400 2000 -0 7.5949768 7.7676974 6.2894404 + 61500 2000 -0 7.5949762 7.7676959 6.2894425 + 61600 2000 -0 7.5949757 7.7676942 6.2894446 + 61700 2000 -0 7.5949753 7.7676928 6.2894483 + 61800 2000 -0 7.5949748 7.7676912 6.2894509 + 61900 2000 -0 7.5949741 7.7676895 6.289453 + 62000 2000 -0 7.5949735 7.767688 6.2894564 + 62100 2000 -0 7.5949727 7.7676865 6.2894593 + 62200 2000 -0 7.5949717 7.767685 6.2894616 + 62300 2000 -0 7.5949706 7.7676836 6.2894646 + 62400 2000 -0 7.5949694 7.7676824 6.2894676 + 62500 2000 -0 7.5949679 7.7676812 6.2894699 + 62600 2000 -0 7.5949663 7.7676801 6.2894725 + 62700 2000 -0 7.5949645 7.7676792 6.2894754 + 62800 2000 -0 7.5949624 7.7676785 6.2894777 + 62900 2000 -0 7.5949602 7.7676778 6.2894799 + 63000 2000 -0 7.5949578 7.7676773 6.2894825 + 63100 2000 -0 7.5949553 7.7676769 6.2894848 + 63200 2000 -0 7.5949525 7.7676765 6.2894868 + 63300 2000 -0 7.5949496 7.7676763 6.2894892 + 63400 2000 -0 7.5949466 7.7676761 6.2894915 + 63500 2000 -0 7.5949435 7.7676759 6.2894935 + 63600 2000 -0 7.5949404 7.7676757 6.2894957 + 63700 2000 -0 7.5949373 7.7676755 6.2894981 + 63800 2000 -0 7.5949341 7.7676752 6.2895003 + 63900 2000 -0 7.594931 7.7676749 6.2895025 + 64000 2000 -0 7.5949281 7.7676746 6.289505 + 64100 2000 -0 7.5949249 7.7676742 6.2895073 + 64200 2000 -0 7.5949219 7.7676737 6.2895097 + 64300 2000 -0 7.5949191 7.7676731 6.2895122 + 64400 2000 -0 7.5949165 7.7676725 6.2895147 + 64500 2000 -0 7.594914 7.7676718 6.2895171 + 64600 2000 -0 7.5949116 7.7676711 6.2895196 + 64700 2000 -0 7.5949095 7.7676702 6.2895221 + 64800 2000 -0 7.5949105 7.7676688 6.2895247 + 64900 2000 -0 7.5949039 7.767668 6.2895261 + 65000 2000 -0 7.5949041 7.7676665 6.2895306 + 65100 2000 -0 7.5949026 7.7676653 6.2895328 + 65200 2000 -0 7.5949005 7.7676632 6.2895342 + 65300 2000 -0 7.5948956 7.7676549 6.2895391 + 65400 2000 -0 7.5948925 7.7676486 6.2895389 + 65500 2000 -0 7.5948924 7.7676487 6.2895397 + 65600 2000 -0 7.5948923 7.767647 6.289549 + 65700 2000 -0 7.5948909 7.7676452 6.2895471 + 65800 2000 -0 7.5948899 7.7676429 6.289548 + 65900 2000 -0 7.5948899 7.7676418 6.2895556 + 66000 2000 -0 7.5948891 7.7676399 6.2895571 + 66100 2000 -0 7.5948876 7.7676375 6.2895567 + 66200 2000 -0 7.5948874 7.7676361 6.2895627 + 66300 2000 -0 7.5948866 7.7676344 6.2895663 + 66400 2000 -0 7.5948851 7.7676323 6.2895661 + 66500 2000 -0 7.5948842 7.7676308 6.2895704 + 66600 2000 -0 7.5948833 7.7676295 6.2895749 + 66700 2000 -0 7.5948815 7.7676277 6.2895755 + 66800 2000 -0 7.5948799 7.7676263 6.2895782 + 66900 2000 -0 7.5948784 7.7676253 6.2895826 + 67000 2000 -0 7.5948762 7.7676241 6.2895841 + 67100 2000 -0 7.5948739 7.767623 6.2895858 + 67200 2000 -0 7.5948718 7.7676223 6.2895898 + 67300 2000 -0 7.5948692 7.7676216 6.289592 + 67400 2000 -0 7.5948662 7.7676208 6.2895932 + 67500 2000 -0 7.5948635 7.7676203 6.2895964 + 67600 2000 -0 7.5948605 7.7676199 6.2895991 + 67700 2000 -0 7.5948572 7.7676193 6.2896004 + 67800 2000 -0 7.594854 7.767619 6.289603 + 67900 2000 -0 7.5948508 7.7676187 6.2896061 + 68000 2000 -0 7.5948473 7.7676182 6.2896078 + 68100 2000 -0 7.5948438 7.7676178 6.28961 + 68200 2000 -0 7.5948406 7.7676174 6.2896131 + 68300 2000 -0 7.5948372 7.7676168 6.2896153 + 68400 2000 -0 7.5948339 7.7676161 6.2896175 + 68500 2000 -0 7.5948308 7.7676156 6.2896206 + 68600 2000 -0 7.5948278 7.7676148 6.2896232 + 68700 2000 -0 7.5948248 7.767614 6.2896254 + 68800 2000 -0 7.5948221 7.7676131 6.2896283 + 68900 2000 -0 7.5948196 7.7676122 6.2896311 + 69000 2000 -0 7.5948172 7.7676111 6.2896334 + 69100 2000 -0 7.5948182 7.7676099 6.2896363 + 69200 2000 -0 7.5948122 7.7676096 6.2896377 + 69300 2000 -0 7.594811 7.7676081 6.2896421 + 69400 2000 -0 7.5948092 7.767607 6.2896441 + 69500 2000 -0 7.5948073 7.7676059 6.2896459 + 69600 2000 -0 7.5948058 7.7676043 6.2896498 + 69700 2000 -0 7.5948044 7.7676026 6.2896529 + 69800 2000 -0 7.5948029 7.7676005 6.2896547 + 69900 2000 -0 7.5948018 7.7675987 6.2896584 + 70000 2000 -0 7.5948007 7.7675967 6.2896619 + 70100 2000 -0 7.5947995 7.7675945 6.2896642 + 70200 2000 -0 7.5947984 7.7675924 6.2896674 + 70300 2000 -0 7.5947974 7.7675903 6.2896713 + 70400 2000 -0 7.5947962 7.7675881 6.2896739 + 70500 2000 -0 7.594795 7.7675859 6.289677 + 70600 2000 -0 7.5947937 7.7675838 6.2896808 + 70700 2000 -0 7.5947922 7.7675817 6.2896838 + 70800 2000 -0 7.5947906 7.7675796 6.2896868 + 70900 2000 -0 7.5947889 7.7675777 6.2896903 + 71000 2000 -0 7.594787 7.7675758 6.2896935 + 71100 2000 -0 7.5947848 7.7675741 6.2896963 + 71200 2000 -0 7.5947826 7.7675725 6.2896995 + 71300 2000 -0 7.5947801 7.767571 6.2897026 + 71400 2000 -0 7.5947774 7.7675697 6.2897053 + 71500 2000 -0 7.5947745 7.7675684 6.2897081 + 71600 2000 -0 7.5947715 7.7675673 6.2897111 + 71700 2000 -0 7.5947683 7.7675663 6.2897137 + 71800 2000 -0 7.5947648 7.7675654 6.2897162 + 71900 2000 -0 7.5947613 7.7675645 6.2897191 + 72000 2000 -0 7.5947575 7.7675638 6.2897217 + 72100 2000 -0 7.5947535 7.7675631 6.2897242 + 72200 2000 -0 7.5947494 7.7675625 6.289727 + 72300 2000 -0 7.5947453 7.7675618 6.2897298 + 72400 2000 -0 7.594741 7.7675611 6.2897324 + 72500 2000 -0 7.5947368 7.7675604 6.2897352 + 72600 2000 -0 7.5947325 7.7675597 6.2897381 + 72700 2000 -0 7.5947283 7.7675588 6.2897408 + 72800 2000 -0 7.5947242 7.7675578 6.2897437 + 72900 2000 -0 7.5947201 7.7675568 6.2897466 + 73000 2000 -0 7.5947162 7.7675557 6.2897494 + 73100 2000 -0 7.5947122 7.7675546 6.2897523 + 73200 2000 -0 7.5947083 7.7675536 6.2897553 + 73300 2000 -0 7.5947045 7.7675525 6.2897583 + 73400 2000 -0 7.5947035 7.7675515 6.2897613 + 73500 2000 -0 7.5946973 7.767551 6.2897633 + 73600 2000 -0 7.5946939 7.7675499 6.2897681 + 73700 2000 -0 7.5946909 7.7675487 6.2897703 + 73800 2000 -0 7.5946877 7.7675475 6.2897725 + 73900 2000 -0 7.5946849 7.7675465 6.2897768 + 74000 2000 -0 7.5946821 7.7675453 6.2897798 + 74100 2000 -0 7.5946792 7.7675439 6.2897817 + 74200 2000 -0 7.5946768 7.7675427 6.2897857 + 74300 2000 -0 7.5946742 7.7675414 6.2897892 + 74400 2000 -0 7.5946714 7.7675399 6.2897916 + 74500 2000 -0 7.5946688 7.7675385 6.2897951 + 74600 2000 -0 7.5946662 7.7675371 6.2897992 + 74700 2000 -0 7.5946634 7.7675355 6.2898019 + 74800 2000 -0 7.5946605 7.7675341 6.2898052 + 74900 2000 -0 7.5946577 7.7675328 6.2898092 + 75000 2000 -0 7.5946545 7.7675314 6.2898123 + 75100 2000 -0 7.5946512 7.76753 6.2898154 + 75200 2000 -0 7.5946478 7.7675289 6.2898193 + 75300 2000 -0 7.5946442 7.7675278 6.2898225 + 75400 2000 -0 7.5946403 7.7675268 6.2898255 + 75500 2000 -0 7.5946363 7.767526 6.2898289 + 75600 2000 -0 7.5946321 7.7675253 6.2898322 + 75700 2000 -0 7.5946277 7.7675247 6.2898349 + 75800 2000 -0 7.594623 7.7675243 6.2898379 + 75900 2000 -0 7.5946182 7.767524 6.289841 + 76000 2000 -0 7.5946184 7.7675222 6.2898477 + 76100 2000 -0 7.5946168 7.7675198 6.2898534 + 76200 2000 -0 7.5946059 7.7675208 6.2898537 + 76300 2000 -0 7.5945934 7.7675229 6.2898545 + 76400 2000 -0 7.5945858 7.7675222 6.2898578 + 76500 2000 -0 7.594578 7.7675215 6.2898604 + 76600 2000 -0 7.5945704 7.767521 6.289865 + 76700 2000 -0 7.5945627 7.7675205 6.2898692 + 76800 2000 -0 7.5945548 7.7675198 6.2898721 + 76900 2000 -0 7.5945472 7.7675191 6.2898763 + 77000 2000 -0 7.5945397 7.7675184 6.2898809 + 77100 2000 -0 7.5945321 7.7675175 6.2898842 + 77200 2000 -0 7.5945247 7.7675166 6.289888 + 77300 2000 -0 7.5945177 7.7675156 6.2898926 + 77400 2000 -0 7.5945106 7.7675145 6.2898964 + 77500 2000 -0 7.5945037 7.7675133 6.2899 + 77600 2000 -0 7.5944972 7.7675122 6.2899045 + 77700 2000 -0 7.5944924 7.7675106 6.2899081 + 77800 2000 -0 7.5944847 7.7675094 6.2899116 + 77900 2000 -0 7.5944783 7.7675083 6.2899171 + 78000 2000 -0 7.5944725 7.7675065 6.2899202 + 78100 2000 -0 7.5944668 7.7675048 6.2899232 + 78200 2000 -0 7.5944616 7.7675034 6.2899286 + 78300 2000 -0 7.5944563 7.7675016 6.2899324 + 78400 2000 -0 7.5944509 7.7674996 6.2899353 + 78500 2000 -0 7.594446 7.7674978 6.2899402 + 78600 2000 -0 7.5944411 7.7674959 6.2899446 + 78700 2000 -0 7.594436 7.7674938 6.2899477 + 78800 2000 -0 7.5944312 7.7674918 6.2899523 + 78900 2000 -0 7.5944263 7.7674898 6.2899571 + 79000 2000 -0 7.5944211 7.7674876 6.2899606 + 79100 2000 -0 7.594416 7.7674855 6.2899649 + 79200 2000 -0 7.5944109 7.7674835 6.2899697 + 79300 2000 -0 7.5944055 7.7674815 6.2899736 + 79400 2000 -0 7.5944 7.7674795 6.2899776 + 79500 2000 -0 7.5943944 7.7674777 6.2899823 + 79600 2000 -0 7.5943887 7.767476 6.2899864 + 79700 2000 -0 7.5943826 7.7674743 6.2899902 + 79800 2000 -0 7.5943766 7.7674728 6.2899944 + 79900 2000 -0 7.5943703 7.7674715 6.2899985 + 80000 2000 -0 7.5943639 7.7674702 6.2900021 + 80100 2000 -0 7.5943573 7.7674691 6.290006 + 80200 2000 -0 7.5943506 7.7674681 6.2900099 + 80300 2000 -0 7.5943437 7.7674671 6.2900134 + 80400 2000 -0 7.5943367 7.7674662 6.2900171 + 80500 2000 -0 7.5943296 7.7674655 6.2900209 + 80600 2000 -0 7.5943224 7.7674647 6.2900245 + 80700 2000 -0 7.5943151 7.7674639 6.2900281 + 80800 2000 -0 7.5943077 7.7674632 6.290032 + 80900 2000 -0 7.5943001 7.7674623 6.290036 + 81000 2000 -0 7.5942925 7.7674614 6.2900398 + 81100 2000 -0 7.594285 7.7674604 6.2900439 + 81200 2000 -0 7.5942776 7.7674594 6.290048 + 81300 2000 -0 7.5942702 7.7674582 6.290052 + 81400 2000 -0 7.594263 7.767457 6.2900562 + 81500 2000 -0 7.594256 7.7674558 6.2900604 + 81600 2000 -0 7.5942491 7.7674544 6.2900645 + 81700 2000 -0 7.5942424 7.767453 6.2900686 + 81800 2000 -0 7.5942359 7.7674515 6.2900729 + 81900 2000 -0 7.5942312 7.7674504 6.2900799 + 82000 2000 -0 7.5942237 7.7674478 6.29008 + 82100 2000 -0 7.5942182 7.7674465 6.2900859 + 82200 2000 -0 7.5942121 7.767445 6.2900901 + 82300 2000 -0 7.5942063 7.7674429 6.2900926 + 82400 2000 -0 7.5942013 7.7674409 6.2900972 + 82500 2000 -0 7.5941965 7.7674392 6.2901025 + 82600 2000 -0 7.5941914 7.7674369 6.2901052 + 82700 2000 -0 7.5941866 7.7674347 6.2901091 + 82800 2000 -0 7.5941822 7.7674326 6.2901146 + 82900 2000 -0 7.5941776 7.7674302 6.2901181 + 83000 2000 -0 7.5941729 7.7674277 6.2901216 + 83100 2000 -0 7.5941686 7.7674254 6.2901269 + 83200 2000 -0 7.5941641 7.767423 6.2901311 + 83300 2000 -0 7.5941594 7.7674205 6.2901346 + 83400 2000 -0 7.5941549 7.7674181 6.2901396 + 83500 2000 -0 7.5941502 7.7674158 6.2901442 + 83600 2000 -0 7.5941452 7.7674133 6.2901479 + 83700 2000 -0 7.5941402 7.7674111 6.2901524 + 83800 2000 -0 7.5941351 7.7674089 6.2901572 + 83900 2000 -0 7.5941297 7.7674068 6.290161 + 84000 2000 -0 7.5941242 7.7674048 6.290165 + 84100 2000 -0 7.5941186 7.767403 6.2901696 + 84200 2000 -0 7.5941126 7.7674013 6.2901734 + 84300 2000 -0 7.5941065 7.7673997 6.2901771 + 84400 2000 -0 7.5941003 7.7673983 6.2901814 + 84500 2000 -0 7.5940939 7.767397 6.2901852 + 84600 2000 -0 7.5940872 7.7673957 6.2901888 + 84700 2000 -0 7.5940805 7.7673944 6.2901928 + 84800 2000 -0 7.5940737 7.7673931 6.2901967 + 84900 2000 -0 7.5940667 7.7673918 6.2902004 + 85000 2000 -0 7.5940597 7.7673906 6.2902042 + 85100 2000 -0 7.5940526 7.7673893 6.2902083 + 85200 2000 -0 7.5940454 7.767388 6.2902121 + 85300 2000 -0 7.5940382 7.7673867 6.290216 + 85400 2000 -0 7.5940312 7.7673853 6.2902202 + 85500 2000 -0 7.5940241 7.7673839 6.2902243 + 85600 2000 -0 7.5940172 7.7673823 6.2902282 + 85700 2000 -0 7.5940104 7.7673808 6.2902325 + 85800 2000 -0 7.5940037 7.7673791 6.2902367 + 85900 2000 -0 7.5939971 7.7673773 6.2902409 + 86000 2000 -0 7.5939906 7.7673755 6.2902452 + 86100 2000 -0 7.5939844 7.7673736 6.2902496 + 86200 2000 -0 7.5939805 7.7673722 6.2902539 + 86300 2000 -0 7.5939717 7.7673693 6.2902569 + 86400 2000 -0 7.5939672 7.7673674 6.2902627 + 86500 2000 -0 7.5939615 7.7673655 6.2902672 + 86600 2000 -0 7.5939558 7.7673632 6.2902702 + 86700 2000 -0 7.5939508 7.7673608 6.2902746 + 86800 2000 -0 7.5939461 7.7673587 6.2902801 + 86900 2000 -0 7.5939411 7.7673561 6.2902832 + 87000 2000 -0 7.5939363 7.7673536 6.2902873 + 87100 2000 -0 7.5939319 7.7673513 6.2902927 + 87200 2000 -0 7.5939273 7.7673486 6.2902967 + 87300 2000 -0 7.5939223 7.7673461 6.2903004 + 87400 2000 -0 7.5939183 7.7673434 6.2903057 + 87500 2000 -0 7.5939138 7.7673407 6.2903103 + 87600 2000 -0 7.5939091 7.7673378 6.2903141 + 87700 2000 -0 7.5939045 7.7673352 6.2903191 + 87800 2000 -0 7.5938997 7.7673326 6.290324 + 87900 2000 -0 7.5938947 7.76733 6.2903281 + 88000 2000 -0 7.5938896 7.7673275 6.2903326 + 88100 2000 -0 7.5938843 7.7673252 6.2903375 + 88200 2000 -0 7.5938785 7.767323 6.2903417 + 88300 2000 -0 7.5938726 7.767321 6.2903459 + 88400 2000 -0 7.5938666 7.7673191 6.2903505 + 88500 2000 -0 7.5938603 7.7673174 6.2903546 + 88600 2000 -0 7.5938538 7.7673157 6.2903585 + 88700 2000 -0 7.5938471 7.7673142 6.2903628 + 88800 2000 -0 7.5938403 7.7673128 6.290367 + 88900 2000 -0 7.5938333 7.7673115 6.2903707 + 89000 2000 -0 7.5938261 7.7673103 6.2903748 + 89100 2000 -0 7.5938189 7.7673091 6.2903789 + 89200 2000 -0 7.5938115 7.7673079 6.2903827 + 89300 2000 -0 7.593804 7.7673068 6.2903867 + 89400 2000 -0 7.5937967 7.7673056 6.2903909 + 89500 2000 -0 7.5937891 7.7673045 6.290395 + 89600 2000 -0 7.5937814 7.7673033 6.2903989 + 89700 2000 -0 7.593774 7.7673021 6.2904033 + 89800 2000 -0 7.5937665 7.7673008 6.2904075 + 89900 2000 -0 7.5937592 7.7672994 6.2904116 + 90000 2000 -0 7.593752 7.7672979 6.2904159 + 90100 2000 -0 7.5937449 7.7672964 6.2904203 + 90200 2000 -0 7.593738 7.7672948 6.2904245 + 90300 2000 -0 7.5937313 7.7672931 6.2904288 + 90400 2000 -0 7.5937247 7.7672914 6.2904332 + 90500 2000 -0 7.5937212 7.7672898 6.2904372 + 90600 2000 -0 7.5937109 7.7672874 6.2904407 + 90700 2000 -0 7.5937069 7.7672852 6.2904466 + 90800 2000 -0 7.5937012 7.7672832 6.2904508 + 90900 2000 -0 7.5936954 7.7672808 6.2904539 + 91000 2000 -0 7.5936902 7.7672783 6.2904586 + 91100 2000 -0 7.5936853 7.7672761 6.2904639 + 91200 2000 -0 7.5936801 7.7672734 6.290467 + 91300 2000 -0 7.5936753 7.7672708 6.2904714 + 91400 2000 -0 7.5936707 7.7672683 6.2904767 + 91500 2000 -0 7.5936659 7.7672655 6.2904805 + 91600 2000 -0 7.5936611 7.7672627 6.2904845 + 91700 2000 -0 7.5936566 7.76726 6.2904899 + 91800 2000 -0 7.5936518 7.7672571 6.2904943 + 91900 2000 -0 7.5936469 7.7672543 6.2904983 + 92000 2000 -0 7.5936421 7.7672515 6.2905034 + 92100 2000 -0 7.5936371 7.7672488 6.2905081 + 92200 2000 -0 7.5936318 7.7672461 6.2905122 + 92300 2000 -0 7.5936265 7.7672435 6.290517 + 92400 2000 -0 7.5936211 7.767241 6.2905217 + 92500 2000 -0 7.5936154 7.7672386 6.2905258 + 92600 2000 -0 7.5936095 7.7672363 6.2905302 + 92700 2000 -0 7.5936035 7.7672343 6.2905348 + 92800 2000 -0 7.5935971 7.7672324 6.2905388 + 92900 2000 -0 7.5935906 7.7672307 6.2905428 + 93000 2000 -0 7.5935838 7.7672293 6.2905471 + 93100 2000 -0 7.5935769 7.7672279 6.2905511 + 93200 2000 -0 7.5935698 7.7672265 6.2905549 + 93300 2000 -0 7.5935625 7.7672254 6.290559 + 93400 2000 -0 7.5935551 7.7672242 6.290563 + 93500 2000 -0 7.5935476 7.7672231 6.2905668 + 93600 2000 -0 7.5935401 7.7672219 6.2905708 + 93700 2000 -0 7.5935325 7.7672208 6.290575 + 93800 2000 -0 7.5935248 7.7672196 6.2905789 + 93900 2000 -0 7.5935172 7.7672184 6.290583 + 94000 2000 -0 7.5935097 7.767217 6.2905873 + 94100 2000 -0 7.5935023 7.7672156 6.2905915 + 94200 2000 -0 7.593495 7.767214 6.2905957 + 94300 2000 -0 7.5934878 7.7672123 6.2906 + 94400 2000 -0 7.5934808 7.7672106 6.2906044 + 94500 2000 -0 7.593474 7.7672087 6.2906086 + 94600 2000 -0 7.5934675 7.7672069 6.290613 + 94700 2000 -0 7.5934609 7.7672048 6.2906173 + 94800 2000 -0 7.5934577 7.7672024 6.2906217 + 94900 2000 -0 7.5934471 7.767201 6.2906246 + 95000 2000 -0 7.5934428 7.7671984 6.2906309 + 95100 2000 -0 7.5934372 7.7671962 6.2906347 + 95200 2000 -0 7.5934313 7.7671938 6.2906378 + 95300 2000 -0 7.5934261 7.7671914 6.290643 + 95400 2000 -0 7.5934211 7.7671891 6.2906478 + 95500 2000 -0 7.5934157 7.7671863 6.2906508 + 95600 2000 -0 7.5934109 7.7671838 6.2906556 + 95700 2000 -0 7.5934061 7.7671813 6.2906607 + 95800 2000 -0 7.5934012 7.7671785 6.2906643 + 95900 2000 -0 7.5933963 7.7671757 6.2906686 + 96000 2000 -0 7.5933917 7.767173 6.2906739 + 96100 2000 -0 7.5933867 7.7671702 6.290678 + 96200 2000 -0 7.5933817 7.7671673 6.2906822 + 96300 2000 -0 7.5933768 7.7671646 6.2906873 + 96400 2000 -0 7.5933716 7.7671619 6.2906918 + 96500 2000 -0 7.5933663 7.7671592 6.2906959 + 96600 2000 -0 7.5933609 7.7671567 6.2907008 + 96700 2000 -0 7.5933553 7.7671542 6.2907054 + 96800 2000 -0 7.5933494 7.7671518 6.2907095 + 96900 2000 -0 7.5933434 7.7671496 6.2907139 + 97000 2000 -0 7.5933372 7.7671476 6.2907184 + 97100 2000 -0 7.5933308 7.7671456 6.2907224 + 97200 2000 -0 7.5933242 7.7671437 6.2907265 + 97300 2000 -0 7.5933174 7.7671421 6.2907308 + 97400 2000 -0 7.5933105 7.7671404 6.2907348 + 97500 2000 -0 7.5933033 7.7671389 6.2907386 + 97600 2000 -0 7.5932961 7.7671375 6.2907428 + 97700 2000 -0 7.5932888 7.7671359 6.2907468 + 97800 2000 -0 7.5932813 7.7671343 6.2907507 + 97900 2000 -0 7.5932739 7.7671327 6.2907548 + 98000 2000 -0 7.5932664 7.7671312 6.290759 + 98100 2000 -0 7.5932588 7.7671296 6.290763 + 98200 2000 -0 7.5932513 7.7671279 6.2907672 + 98300 2000 -0 7.5932438 7.7671262 6.2907715 + 98400 2000 -0 7.5932364 7.7671245 6.2907757 + 98500 2000 -0 7.5932291 7.7671226 6.2907799 + 98600 2000 -0 7.5932219 7.7671208 6.2907843 + 98700 2000 -0 7.5932149 7.7671188 6.2907886 + 98800 2000 -0 7.593208 7.7671167 6.2907928 + 98900 2000 -0 7.5932013 7.7671147 6.2907972 + 99000 2000 -0 7.5931948 7.7671125 6.2908015 + 99100 2000 -0 7.5931916 7.7671102 6.2908061 + 99200 2000 -0 7.5931818 7.7671085 6.2908089 + 99300 2000 -0 7.5931764 7.7671057 6.2908152 + 99400 2000 -0 7.5931708 7.7671032 6.2908188 + 99500 2000 -0 7.593165 7.7671007 6.290822 + 99600 2000 -0 7.5931598 7.7670982 6.2908274 + 99700 2000 -0 7.5931546 7.7670957 6.2908319 + 99800 2000 -0 7.5931492 7.7670928 6.2908349 + 99900 2000 -0 7.5931443 7.7670902 6.29084 + 100000 2000 -0 7.5931395 7.7670875 6.2908449 +Loop time of 28.4684 on 4 procs for 100000 steps with 2000 atoms + +Performance: 303494.659 tau/day, 3512.670 timesteps/s, 7.025 Matom-step/s +96.7% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 14.471 | 15.426 | 16.874 | 24.3 | 54.19 +Neigh | 0.50185 | 0.52867 | 0.55379 | 3.1 | 1.86 +Comm | 5.277 | 6.8933 | 7.8956 | 40.4 | 24.21 +Output | 0.019683 | 0.022775 | 0.031664 | 3.4 | 0.08 +Modify | 4.7145 | 4.8537 | 5.0111 | 6.1 | 17.05 +Other | | 0.7439 | | | 2.61 + +Nlocal: 500 ave 504 max 496 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 545.75 ave 553 max 538 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Neighs: 2409.75 ave 2523 max 2343 min +Histogram: 1 1 0 1 0 0 0 0 0 1 + +Total # of neighbors = 9639 +Ave neighs/atom = 4.8195 +Neighbor list builds = 3151 +Dangerous builds = 0 + +Total wall time: 0:00:28 diff --git a/examples/granular/log.29Oct20.pour.drum.g++.1 b/examples/granular/log.29Oct20.pour.drum.g++.1 deleted file mode 100644 index 8c4b828488..0000000000 --- a/examples/granular/log.29Oct20.pour.drum.g++.1 +++ /dev/null @@ -1,271 +0,0 @@ -LAMMPS (29 Oct 2020) - using 1 OpenMP thread(s) per MPI task -# pour two types of particles (cohesive and non-cohesive) into cylinder -# 'turn' cylinder by changing direction of gravity, then rotate it. -# This simulates a rotating drum powder characterization experiment. - -variable name string rotating_drum_two_types - -atom_style sphere -units lj - -############################################### -# Geometry-related parameters -############################################### - -variable boxx equal 30 -variable boxy equal 30 -variable boxz equal 50 - -variable drum_rad equal ${boxx}*0.5 -variable drum_rad equal 30*0.5 -variable drum_height equal 20 - -variable xc equal 0.5*${boxx} -variable xc equal 0.5*30 -variable yc equal 0.5*${boxx} -variable yc equal 0.5*30 -variable zc equal 0.5*${boxz} -variable zc equal 0.5*50 - -############################################### -# Particle-related parameters -############################################### -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable cyl_rad_inner equal ${drum_rad}-1.1*${rhi} -variable cyl_rad_inner equal 15-1.1*${rhi} -variable cyl_rad_inner equal 15-1.1*0.5 - -variable dens equal 1.0 - -variable skin equal 0.4*${rhi} -variable skin equal 0.4*0.5 - -############# -processors * * 1 -region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} -region boxreg block 0 30 0 ${boxy} 0 ${boxz} -region boxreg block 0 30 0 30 0 ${boxz} -region boxreg block 0 30 0 30 0 50 -create_box 2 boxreg -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (30.000000 30.000000 50.000000) - 1 by 1 by 1 MPI processor grid -change_box all boundary p p f -Changing box ... - -pair_style granular -pair_coeff 1 * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji -pair_coeff 2 2 jkr 1e5 0.1 0.3 50 tangential mindlin NULL 1.0 0.5 rolling sds 1e3 1e3 0.1 twisting marshall damping tsuji - -variable theta equal 0 - -region curved_wall cylinder z ${xc} ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 15 0 0 0 1 -region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region bottom_wall plane 15 ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 ${yc} 0 0 0 1 -region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 15 0 0 0 1 - -region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} -region insreg cylinder z 15 ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} -region insreg cylinder z 15 15 ${cyl_rad_inner} ${drum_height} ${boxz} -region insreg cylinder z 15 15 14.45 ${drum_height} ${boxz} -region insreg cylinder z 15 15 14.45 20 ${boxz} -region insreg cylinder z 15 15 14.45 20 50 - -fix 0 all balance 100 1.0 shift xy 5 1.1 -fix 1 all nve/sphere -fix grav all gravity 10 vector 0 0 -1 -fix ins1 all pour 2000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 9396 every 490 steps, 2000 by step 1 -fix ins2 all pour 2000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 9396 every 490 steps, 2000 by step 1 - -comm_modify vel yes - -neighbor ${skin} bin -neighbor 0.2 bin -neigh_modify delay 0 every 1 check yes - -fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall -fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region bottom_wall - -thermo_style custom step atoms ke v_theta -thermo_modify lost warn -thermo 100 - -timestep 0.001 - -#dump 1 all custom 100 ${name}.dump id type radius mass x y z - -#For removal later -compute 1 all property/atom radius -variable zmax atom z+c_1>0.5*${drum_height} -variable zmax atom z+c_1>0.5*20 -group delgroup dynamic all var zmax every 10000 -dynamic group delgroup defined - -run 2000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 1.2 - binsize = 0.6, bins = 50 50 84 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair granular, perpetual - attributes: half, newton on, size, history - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 13.03 | 13.03 | 13.03 Mbytes -Step Atoms KinEng v_theta - 0 0 -0 0 - 100 4000 -0 0 - 200 4000 -0 0 - 300 4000 -0 0 - 400 4000 -0 0 - 500 4000 -0 0 - 600 4000 -0 0 - 700 4000 -0 0 - 800 4000 -0 0 - 900 4000 -0 0 - 1000 4000 -0 0 - 1100 4000 -0 0 - 1200 4000 -0 0 - 1300 4000 -0 0 - 1400 4000 -0 0 - 1500 4000 -0 0 - 1600 4000 -0 0 - 1700 4000 -0 0 - 1800 4000 -0 0 - 1900 4000 -0 0 - 2000 4000 -0 0 -Loop time of 10.5178 on 1 procs for 2000 steps with 4000 atoms - -Performance: 16429.309 tau/day, 190.154 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.0701 | 1.0701 | 1.0701 | 0.0 | 10.17 -Neigh | 4.2135 | 4.2135 | 4.2135 | 0.0 | 40.06 -Comm | 0.38276 | 0.38276 | 0.38276 | 0.0 | 3.64 -Output | 0.0013647 | 0.0013647 | 0.0013647 | 0.0 | 0.01 -Modify | 4.7076 | 4.7076 | 4.7076 | 0.0 | 44.76 -Other | | 0.1424 | | | 1.35 - -Nlocal: 4000.00 ave 4000 max 4000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 171.000 ave 171 max 171 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 8093.00 ave 8093 max 8093 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 8093 -Ave neighs/atom = 2.0232500 -Neighbor list builds = 1004 -Dangerous builds = 4 - -#Remove any particles that are above z > 0.5*drum_height -delete_atoms group delgroup -Deleted 0 atoms, new total = 4000 - -#Add top lid -region top_wall plane ${xc} ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 15 ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 ${yc} 0 0 0 1 -region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 15 0 0 0 1 -fix 5 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region top_wall - -# 'Turn' drum by switching the direction of gravity -unfix grav -unfix ins1 -unfix ins2 -fix grav all gravity 10 vector 0 -1 0 - -variable theta equal 2*PI*elapsed/20000.0 -run 3000 -Per MPI rank memory allocation (min/avg/max) = 19.37 | 19.37 | 19.37 Mbytes -Step Atoms KinEng v_theta - 2000 4000 65.647582 0 - 2100 4000 105.60001 0.031415927 - 2200 4000 112.27573 0.062831853 - 2300 4000 92.758671 0.09424778 - 2400 4000 88.925835 0.12566371 - 2500 4000 81.369163 0.15707963 - 2600 4000 32.046943 0.18849556 - 2700 4000 4.1926368 0.21991149 - 2800 4000 3.9933453 0.25132741 - 2900 4000 4.5062193 0.28274334 - 3000 4000 5.3409521 0.31415927 - 3100 4000 6.0165991 0.34557519 - 3200 4000 6.606767 0.37699112 - 3300 4000 7.3997751 0.40840704 - 3400 4000 8.1098807 0.43982297 - 3500 4000 8.6552424 0.4712389 - 3600 4000 9.8445204 0.50265482 - 3700 4000 10.098753 0.53407075 - 3800 4000 10.039489 0.56548668 - 3900 4000 9.6376278 0.5969026 - 4000 4000 9.2598836 0.62831853 - 4100 4000 8.7116037 0.65973446 - 4200 4000 8.1274117 0.69115038 - 4300 4000 7.1487627 0.72256631 - 4400 4000 6.2253778 0.75398224 - 4500 4000 5.3061398 0.78539816 - 4600 4000 4.4319316 0.81681409 - 4700 4000 4.205607 0.84823002 - 4800 4000 3.2112987 0.87964594 - 4900 4000 2.6449777 0.91106187 - 5000 4000 2.3475497 0.9424778 -Loop time of 32.4926 on 1 procs for 3000 steps with 4000 atoms - -Performance: 7977.205 tau/day, 92.329 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 8.0124 | 8.0124 | 8.0124 | 0.0 | 24.66 -Neigh | 10.993 | 10.993 | 10.993 | 0.0 | 33.83 -Comm | 0.86697 | 0.86697 | 0.86697 | 0.0 | 2.67 -Output | 0.0021827 | 0.0021827 | 0.0021827 | 0.0 | 0.01 -Modify | 12.367 | 12.367 | 12.367 | 0.0 | 38.06 -Other | | 0.2515 | | | 0.77 - -Nlocal: 4000.00 ave 4000 max 4000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 318.000 ave 318 max 318 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 14807.0 ave 14807 max 14807 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 14807 -Ave neighs/atom = 3.7017500 -Neighbor list builds = 2189 -Dangerous builds = 1536 -Total wall time: 0:00:43 diff --git a/examples/granular/log.29Oct20.pour.drum.g++.4 b/examples/granular/log.29Oct20.pour.drum.g++.4 deleted file mode 100644 index e53da50b9b..0000000000 --- a/examples/granular/log.29Oct20.pour.drum.g++.4 +++ /dev/null @@ -1,271 +0,0 @@ -LAMMPS (29 Oct 2020) - using 1 OpenMP thread(s) per MPI task -# pour two types of particles (cohesive and non-cohesive) into cylinder -# 'turn' cylinder by changing direction of gravity, then rotate it. -# This simulates a rotating drum powder characterization experiment. - -variable name string rotating_drum_two_types - -atom_style sphere -units lj - -############################################### -# Geometry-related parameters -############################################### - -variable boxx equal 30 -variable boxy equal 30 -variable boxz equal 50 - -variable drum_rad equal ${boxx}*0.5 -variable drum_rad equal 30*0.5 -variable drum_height equal 20 - -variable xc equal 0.5*${boxx} -variable xc equal 0.5*30 -variable yc equal 0.5*${boxx} -variable yc equal 0.5*30 -variable zc equal 0.5*${boxz} -variable zc equal 0.5*50 - -############################################### -# Particle-related parameters -############################################### -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable cyl_rad_inner equal ${drum_rad}-1.1*${rhi} -variable cyl_rad_inner equal 15-1.1*${rhi} -variable cyl_rad_inner equal 15-1.1*0.5 - -variable dens equal 1.0 - -variable skin equal 0.4*${rhi} -variable skin equal 0.4*0.5 - -############# -processors * * 1 -region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} -region boxreg block 0 30 0 ${boxy} 0 ${boxz} -region boxreg block 0 30 0 30 0 ${boxz} -region boxreg block 0 30 0 30 0 50 -create_box 2 boxreg -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (30.000000 30.000000 50.000000) - 2 by 2 by 1 MPI processor grid -change_box all boundary p p f -Changing box ... - -pair_style granular -pair_coeff 1 * hertz/material 1e5 0.2 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji -pair_coeff 2 2 jkr 1e5 0.1 0.3 50 tangential mindlin NULL 1.0 0.5 rolling sds 1e3 1e3 0.1 twisting marshall damping tsuji - -variable theta equal 0 - -region curved_wall cylinder z ${xc} ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 ${yc} ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 ${drum_rad} 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 ${drum_height} side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 ${yc} 0 0 0 1 -region curved_wall cylinder z 15 15 15 0 20 side in rotate v_theta 15 15 0 0 0 1 -region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region bottom_wall plane 15 ${yc} 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 ${yc} 0 0 0 1 -region bottom_wall plane 15 15 0 0 0 1 side in rotate v_theta 15 15 0 0 0 1 - -region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} -region insreg cylinder z 15 ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} -region insreg cylinder z 15 15 ${cyl_rad_inner} ${drum_height} ${boxz} -region insreg cylinder z 15 15 14.45 ${drum_height} ${boxz} -region insreg cylinder z 15 15 14.45 20 ${boxz} -region insreg cylinder z 15 15 14.45 20 50 - -fix 0 all balance 100 1.0 shift xy 5 1.1 -fix 1 all nve/sphere -fix grav all gravity 10 vector 0 0 -1 -fix ins1 all pour 2000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 ${dens} -fix ins1 all pour 2000 1 1234 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 9396 every 490 steps, 2000 by step 1 -fix ins2 all pour 2000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens ${dens} ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 ${dens} -fix ins2 all pour 2000 2 1234 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 9396 every 490 steps, 2000 by step 1 - -comm_modify vel yes - -neighbor ${skin} bin -neighbor 0.2 bin -neigh_modify delay 0 every 1 check yes - -fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall -fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region bottom_wall - -thermo_style custom step atoms ke v_theta -thermo_modify lost warn -thermo 100 - -timestep 0.001 - -#dump 1 all custom 100 ${name}.dump id type radius mass x y z - -#For removal later -compute 1 all property/atom radius -variable zmax atom z+c_1>0.5*${drum_height} -variable zmax atom z+c_1>0.5*20 -group delgroup dynamic all var zmax every 10000 -dynamic group delgroup defined - -run 2000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 1.2 - binsize = 0.6, bins = 50 50 84 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair granular, perpetual - attributes: half, newton on, size, history - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 12.25 | 12.25 | 12.25 Mbytes -Step Atoms KinEng v_theta - 0 0 -0 0 - 100 4000 -0 0 - 200 4000 -0 0 - 300 4000 -0 0 - 400 4000 -0 0 - 500 4000 -0 0 - 600 4000 -0 0 - 700 4000 -0 0 - 800 4000 -0 0 - 900 4000 -0 0 - 1000 4000 -0 0 - 1100 4000 -0 0 - 1200 4000 -0 0 - 1300 4000 -0 0 - 1400 4000 -0 0 - 1500 4000 -0 0 - 1600 4000 -0 0 - 1700 4000 -0 0 - 1800 4000 -0 0 - 1900 4000 -0 0 - 2000 4000 -0 0 -Loop time of 3.86825 on 4 procs for 2000 steps with 4000 atoms - -Performance: 44671.398 tau/day, 517.030 timesteps/s -96.7% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.26114 | 0.27918 | 0.28728 | 2.0 | 7.22 -Neigh | 1.2044 | 1.2414 | 1.3105 | 3.7 | 32.09 -Comm | 0.38592 | 0.47065 | 0.51052 | 7.4 | 12.17 -Output | 0.0007236 | 0.0013456 | 0.0024846 | 1.8 | 0.03 -Modify | 1.6217 | 1.6723 | 1.7801 | 5.0 | 43.23 -Other | | 0.2034 | | | 5.26 - -Nlocal: 1000.00 ave 1012 max 988 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 269.250 ave 278 max 256 min -Histogram: 1 0 0 0 0 0 1 1 0 1 -Neighs: 2060.50 ave 2156 max 1921 min -Histogram: 1 0 0 1 0 0 0 0 0 2 - -Total # of neighbors = 8242 -Ave neighs/atom = 2.0605000 -Neighbor list builds = 1004 -Dangerous builds = 4 - -#Remove any particles that are above z > 0.5*drum_height -delete_atoms group delgroup -Deleted 0 atoms, new total = 4000 - -#Add top lid -region top_wall plane ${xc} ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 ${yc} ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 15 ${drum_height} 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta ${xc} ${yc} 0 0 0 1 -region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 ${yc} 0 0 0 1 -region top_wall plane 15 15 20 0 0 -1 side in rotate v_theta 15 15 0 0 0 1 -fix 5 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region top_wall - -# 'Turn' drum by switching the direction of gravity -unfix grav -unfix ins1 -unfix ins2 -fix grav all gravity 10 vector 0 -1 0 - -variable theta equal 2*PI*elapsed/20000.0 -run 3000 -Per MPI rank memory allocation (min/avg/max) = 18.55 | 18.55 | 18.55 Mbytes -Step Atoms KinEng v_theta - 2000 4000 65.819213 0 - 2100 4000 105.02389 0.031415927 - 2200 4000 112.02469 0.062831853 - 2300 4000 92.271262 0.09424778 - 2400 4000 89.369506 0.12566371 - 2500 4000 80.910925 0.15707963 - 2600 4000 31.620722 0.18849556 - 2700 4000 4.3019937 0.21991149 - 2800 4000 3.9913967 0.25132741 - 2900 4000 4.5203726 0.28274334 - 3000 4000 5.484886 0.31415927 - 3100 4000 6.1085958 0.34557519 - 3200 4000 6.7085635 0.37699112 - 3300 4000 7.4787777 0.40840704 - 3400 4000 8.2116413 0.43982297 - 3500 4000 8.7979302 0.4712389 - 3600 4000 9.871649 0.50265482 - 3700 4000 10.012426 0.53407075 - 3800 4000 9.9067754 0.56548668 - 3900 4000 9.725458 0.5969026 - 4000 4000 9.3350056 0.62831853 - 4100 4000 8.8337295 0.65973446 - 4200 4000 8.2712493 0.69115038 - 4300 4000 6.9609934 0.72256631 - 4400 4000 6.0120294 0.75398224 - 4500 4000 5.0490036 0.78539816 - 4600 4000 4.2796544 0.81681409 - 4700 4000 4.1736483 0.84823002 - 4800 4000 3.0860106 0.87964594 - 4900 4000 2.6670909 0.91106187 - 5000 4000 2.2901814 0.9424778 -Loop time of 10.7627 on 4 procs for 3000 steps with 4000 atoms - -Performance: 24083.252 tau/day, 278.741 timesteps/s -97.9% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.6731 | 2.0701 | 2.3327 | 18.9 | 19.23 -Neigh | 2.7389 | 3.1706 | 3.5146 | 15.7 | 29.46 -Comm | 0.93507 | 1.5441 | 2.1182 | 39.1 | 14.35 -Output | 0.0021682 | 0.0044412 | 0.006026 | 2.2 | 0.04 -Modify | 3.0031 | 3.4223 | 3.9262 | 18.3 | 31.80 -Other | | 0.5511 | | | 5.12 - -Nlocal: 1000.00 ave 1277 max 723 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 569.750 ave 809 max 454 min -Histogram: 1 2 0 0 0 0 0 0 0 1 -Neighs: 3690.50 ave 4937 max 2426 min -Histogram: 1 1 0 0 0 0 0 0 0 2 - -Total # of neighbors = 14762 -Ave neighs/atom = 3.6905000 -Neighbor list builds = 2187 -Dangerous builds = 1610 -Total wall time: 0:00:14 diff --git a/examples/granular/log.29Oct20.pour.flatwall.g++.1 b/examples/granular/log.29Oct20.pour.flatwall.g++.1 deleted file mode 100644 index 00fc8e31a1..0000000000 --- a/examples/granular/log.29Oct20.pour.flatwall.g++.1 +++ /dev/null @@ -1,188 +0,0 @@ -LAMMPS (29 Oct 2020) - using 1 OpenMP thread(s) per MPI task -# pour two types of particles (cohesive and non-cohesive) on flat wall - -variable name string pour_two_types - -atom_style sphere -units lj - -############################################### -# Geometry-related parameters -############################################### - -variable boxx equal 20 -variable boxy equal 20 -variable boxz equal 30 - -variable xc1 equal 0.3*${boxx} -variable xc1 equal 0.3*20 -variable xc2 equal 0.7*${boxx} -variable xc2 equal 0.7*20 -variable yc equal 0.5*${boxy} -variable yc equal 0.5*20 - -############################################### -# Particle-related parameters -############################################### -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable dens equal 1.0 - -variable skin equal 0.3*${rhi} -variable skin equal 0.3*0.5 - -############# -processors * * 1 -region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} -region boxreg block 0 20 0 ${boxy} 0 ${boxz} -region boxreg block 0 20 0 20 0 ${boxz} -region boxreg block 0 20 0 20 0 30 -create_box 2 boxreg -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (20.000000 20.000000 30.000000) - 1 by 1 by 1 MPI processor grid -change_box all boundary p p f -Changing box ... - -pair_style granular -pair_coeff 1 * jkr 1000.0 50.0 0.3 10 tangential mindlin 800.0 1.0 0.5 rolling sds 500.0 200.0 0.5 twisting marshall -pair_coeff 2 2 hertz 200.0 20.0 tangential linear_history 300.0 1.0 0.1 rolling sds 200.0 100.0 0.1 twisting marshall - -comm_modify vel yes - -region insreg1 cylinder z ${xc1} ${yc} 5 15 ${boxz} -region insreg1 cylinder z 6 ${yc} 5 15 ${boxz} -region insreg1 cylinder z 6 10 5 15 ${boxz} -region insreg1 cylinder z 6 10 5 15 30 -region insreg2 cylinder z ${xc2} ${yc} 5 15 ${boxz} -region insreg2 cylinder z 14 ${yc} 5 15 ${boxz} -region insreg2 cylinder z 14 10 5 15 ${boxz} -region insreg2 cylinder z 14 10 5 15 30 - -fix 1 all nve/sphere -fix grav all gravity 10.0 vector 0 0 -1 -fix ins1 all pour 1500 1 3123 region insreg1 diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens ${dens} ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 1 -Particle insertion: 562 every 346 steps, 1500 by step 693 -fix ins2 all pour 1500 2 3123 region insreg2 diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens ${dens} ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 1 -Particle insertion: 562 every 346 steps, 1500 by step 693 - -neighbor ${skin} bin -neighbor 0.15 bin -neigh_modify delay 0 every 1 check yes - -fix 3 all wall/gran granular hertz/material 1e5 1e3 0.3 tangential mindlin NULL 1.0 0.5 zplane 0 NULL - -thermo_style custom step atoms ke -thermo_modify lost warn -thermo 100 - -timestep 0.001 - -#dump 1 all custom 100 ${name}.dump id type radius mass x y z - -run 5000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.15 - ghost atom cutoff = 1.15 - binsize = 0.575, bins = 35 35 53 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair granular, perpetual - attributes: half, newton on, size, history - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 12.22 | 12.22 | 12.22 Mbytes -Step Atoms KinEng - 0 0 -0 - 100 926 -0 - 200 926 -0 - 300 926 -0 - 400 1498 -0 - 500 1498 -0 - 600 1498 -0 - 700 2275 -0 - 800 2275 -0 - 900 2275 -0 - 1000 2275 -0 - 1100 2954 -0 - 1200 2954 -0 - 1300 2954 -0 - 1400 3000 -0 - 1500 3000 -0 - 1600 3000 -0 - 1700 3000 -0 - 1800 3000 -0 - 1900 3000 -0 - 2000 3000 -0 - 2100 3000 -0 - 2200 3000 -0 - 2300 3000 -0 - 2400 3000 -0 - 2500 3000 -0 - 2600 3000 -0 - 2700 3000 -0 - 2800 3000 -0 - 2900 3000 -0 - 3000 3000 -0 - 3100 3000 -0 - 3200 3000 -0 - 3300 3000 -0 - 3400 3000 -0 - 3500 3000 -0 - 3600 3000 -0 - 3700 3000 -0 - 3800 3000 -0 - 3900 3000 -0 - 4000 3000 -0 - 4100 3000 -0 - 4200 3000 -0 - 4300 3000 -0 - 4400 3000 -0 - 4500 3000 -0 - 4600 3000 -0 - 4700 3000 -0 - 4800 3000 -0 - 4900 3000 -0 - 5000 3000 -0 -Loop time of 24.3889 on 1 procs for 5000 steps with 3000 atoms - -Performance: 17713.003 tau/day, 205.012 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 14.362 | 14.362 | 14.362 | 0.0 | 58.89 -Neigh | 3.3483 | 3.3483 | 3.3483 | 0.0 | 13.73 -Comm | 0.42893 | 0.42893 | 0.42893 | 0.0 | 1.76 -Output | 0.0025065 | 0.0025065 | 0.0025065 | 0.0 | 0.01 -Modify | 6.059 | 6.059 | 6.059 | 0.0 | 24.84 -Other | | 0.1876 | | | 0.77 - -Nlocal: 3000.00 ave 3000 max 3000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 462.000 ave 462 max 462 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 17694.0 ave 17694 max 17694 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 17694 -Ave neighs/atom = 5.8980000 -Neighbor list builds = 1133 -Dangerous builds = 0 -Total wall time: 0:00:24 diff --git a/examples/granular/log.29Oct20.pour.flatwall.g++.4 b/examples/granular/log.29Oct20.pour.flatwall.g++.4 deleted file mode 100644 index 1688e52b43..0000000000 --- a/examples/granular/log.29Oct20.pour.flatwall.g++.4 +++ /dev/null @@ -1,188 +0,0 @@ -LAMMPS (29 Oct 2020) - using 1 OpenMP thread(s) per MPI task -# pour two types of particles (cohesive and non-cohesive) on flat wall - -variable name string pour_two_types - -atom_style sphere -units lj - -############################################### -# Geometry-related parameters -############################################### - -variable boxx equal 20 -variable boxy equal 20 -variable boxz equal 30 - -variable xc1 equal 0.3*${boxx} -variable xc1 equal 0.3*20 -variable xc2 equal 0.7*${boxx} -variable xc2 equal 0.7*20 -variable yc equal 0.5*${boxy} -variable yc equal 0.5*20 - -############################################### -# Particle-related parameters -############################################### -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable dens equal 1.0 - -variable skin equal 0.3*${rhi} -variable skin equal 0.3*0.5 - -############# -processors * * 1 -region boxreg block 0 ${boxx} 0 ${boxy} 0 ${boxz} -region boxreg block 0 20 0 ${boxy} 0 ${boxz} -region boxreg block 0 20 0 20 0 ${boxz} -region boxreg block 0 20 0 20 0 30 -create_box 2 boxreg -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (20.000000 20.000000 30.000000) - 2 by 2 by 1 MPI processor grid -change_box all boundary p p f -Changing box ... - -pair_style granular -pair_coeff 1 * jkr 1000.0 50.0 0.3 10 tangential mindlin 800.0 1.0 0.5 rolling sds 500.0 200.0 0.5 twisting marshall -pair_coeff 2 2 hertz 200.0 20.0 tangential linear_history 300.0 1.0 0.1 rolling sds 200.0 100.0 0.1 twisting marshall - -comm_modify vel yes - -region insreg1 cylinder z ${xc1} ${yc} 5 15 ${boxz} -region insreg1 cylinder z 6 ${yc} 5 15 ${boxz} -region insreg1 cylinder z 6 10 5 15 ${boxz} -region insreg1 cylinder z 6 10 5 15 30 -region insreg2 cylinder z ${xc2} ${yc} 5 15 ${boxz} -region insreg2 cylinder z 14 ${yc} 5 15 ${boxz} -region insreg2 cylinder z 14 10 5 15 ${boxz} -region insreg2 cylinder z 14 10 5 15 30 - -fix 1 all nve/sphere -fix grav all gravity 10.0 vector 0 0 -1 -fix ins1 all pour 1500 1 3123 region insreg1 diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens ${dens} ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 ${dens} -fix ins1 all pour 1500 1 3123 region insreg1 diam range 0.5 1 dens 1 1 -Particle insertion: 562 every 346 steps, 1500 by step 693 -fix ins2 all pour 1500 2 3123 region insreg2 diam range ${dlo} ${dhi} dens ${dens} ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 ${dhi} dens ${dens} ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens ${dens} ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 ${dens} -fix ins2 all pour 1500 2 3123 region insreg2 diam range 0.5 1 dens 1 1 -Particle insertion: 562 every 346 steps, 1500 by step 693 - -neighbor ${skin} bin -neighbor 0.15 bin -neigh_modify delay 0 every 1 check yes - -fix 3 all wall/gran granular hertz/material 1e5 1e3 0.3 tangential mindlin NULL 1.0 0.5 zplane 0 NULL - -thermo_style custom step atoms ke -thermo_modify lost warn -thermo 100 - -timestep 0.001 - -#dump 1 all custom 100 ${name}.dump id type radius mass x y z - -run 5000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.15 - ghost atom cutoff = 1.15 - binsize = 0.575, bins = 35 35 53 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair granular, perpetual - attributes: half, newton on, size, history - pair build: half/size/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 11.98 | 11.98 | 11.98 Mbytes -Step Atoms KinEng - 0 0 -0 - 100 926 -0 - 200 926 -0 - 300 926 -0 - 400 1498 -0 - 500 1498 -0 - 600 1498 -0 - 700 2275 -0 - 800 2275 -0 - 900 2275 -0 - 1000 2275 -0 - 1100 2954 -0 - 1200 2954 -0 - 1300 2954 -0 - 1400 3000 -0 - 1500 3000 -0 - 1600 3000 -0 - 1700 3000 -0 - 1800 3000 -0 - 1900 3000 -0 - 2000 3000 -0 - 2100 3000 -0 - 2200 3000 -0 - 2300 3000 -0 - 2400 3000 -0 - 2500 3000 -0 - 2600 3000 -0 - 2700 3000 -0 - 2800 3000 -0 - 2900 3000 -0 - 3000 3000 -0 - 3100 3000 -0 - 3200 3000 -0 - 3300 3000 -0 - 3400 3000 -0 - 3500 3000 -0 - 3600 3000 -0 - 3700 3000 -0 - 3800 3000 -0 - 3900 3000 -0 - 4000 3000 -0 - 4100 3000 -0 - 4200 3000 -0 - 4300 3000 -0 - 4400 3000 -0 - 4500 3000 -0 - 4600 3000 -0 - 4700 3000 -0 - 4800 3000 -0 - 4900 3000 -0 - 5000 3000 -0 -Loop time of 12.1982 on 4 procs for 5000 steps with 3000 atoms - -Performance: 35414.923 tau/day, 409.895 timesteps/s -97.0% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.7141 | 3.8131 | 6.2143 | 107.3 | 31.26 -Neigh | 0.77648 | 0.96585 | 1.1892 | 18.3 | 7.92 -Comm | 0.7427 | 3.5566 | 5.9731 | 128.4 | 29.16 -Output | 0.0067544 | 0.0086352 | 0.011408 | 1.8 | 0.07 -Modify | 3.3476 | 3.5826 | 3.8235 | 11.5 | 29.37 -Other | | 0.2715 | | | 2.23 - -Nlocal: 750.000 ave 1033 max 463 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 435.000 ave 492 max 378 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 4434.50 ave 7028 max 1967 min -Histogram: 2 0 0 0 0 0 0 0 0 2 - -Total # of neighbors = 17738 -Ave neighs/atom = 5.9126667 -Neighbor list builds = 1139 -Dangerous builds = 0 -Total wall time: 0:00:12 From 4a5d7c671c1ad9fee6ff8f5b9f5cf1441c6f2f82 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Tue, 14 Feb 2023 15:02:12 -0700 Subject: [PATCH 055/112] Switching from new atom style to property/atom --- src/.gitignore | 6 +- src/GRANULAR/atom_vec_sphere_temp.cpp | 173 ------------------ src/GRANULAR/atom_vec_sphere_temp.h | 52 ------ ...flow_sphere_temp.cpp => fix_heat_flow.cpp} | 113 +++++++++++- ...eat_flow_sphere_temp.h => fix_heat_flow.h} | 18 +- src/fix_property_atom.cpp | 111 ++++++++++- src/fix_property_atom.h | 1 + 7 files changed, 226 insertions(+), 248 deletions(-) delete mode 100644 src/GRANULAR/atom_vec_sphere_temp.cpp delete mode 100644 src/GRANULAR/atom_vec_sphere_temp.h rename src/GRANULAR/{fix_heat_flow_sphere_temp.cpp => fix_heat_flow.cpp} (58%) rename src/GRANULAR/{fix_heat_flow_sphere_temp.h => fix_heat_flow.h} (69%) diff --git a/src/.gitignore b/src/.gitignore index fe31736776..bead2e87e5 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -464,8 +464,6 @@ /atom_vec_oxdna.h /atom_vec_peri.cpp /atom_vec_peri.h -/atom_vec_sphere_temp.cpp -/atom_vec_sphere_temp.h /atom_vec_template.cpp /atom_vec_template.h /body_nparticle.cpp @@ -1557,8 +1555,8 @@ /fix_srp.h /fix_srp_react.cpp /fix_srp_react.h -/fix_heat_flow_sphere_temp.cpp -/fix_heat_flow_sphere_temp.h +/fix_heat_flow.cpp +/fix_heat_flow.h /fix_tfmc.cpp /fix_tfmc.h /fix_ttm.cpp diff --git a/src/GRANULAR/atom_vec_sphere_temp.cpp b/src/GRANULAR/atom_vec_sphere_temp.cpp deleted file mode 100644 index 283a55e2da..0000000000 --- a/src/GRANULAR/atom_vec_sphere_temp.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "atom_vec_sphere_temp.h" - -#include "atom.h" -#include "error.h" -#include "fix.h" -#include "fix_adapt.h" -#include "math_const.h" -#include "modify.h" - -using namespace LAMMPS_NS; -using namespace MathConst; - -/* ---------------------------------------------------------------------- */ - -AtomVecSphereTemp::AtomVecSphereTemp(LAMMPS *lmp) : AtomVec(lmp) -{ - mass_type = PER_ATOM; - forceclearflag = 1; - molecular = Atom::ATOMIC; - - atom->sphere_flag = 1; - atom->radius_flag = atom->rmass_flag = atom->omega_flag = atom->torque_flag = 1; - atom->temperature_flag = atom->heatflow_flag = 1; - - // strings with peratom variables to include in each AtomVec method - // strings cannot contain fields in corresponding AtomVec default strings - // order of fields in a string does not matter - // except: fields_data_atom & fields_data_vel must match data file - - fields_grow = {"radius", "rmass", "omega", "torque", "temperature", "heatflow"}; - fields_copy = {"radius", "rmass", "omega", "temperature"}; - fields_comm_vel = {"omega", "temperature"}; - fields_reverse = {"torque", "heatflow"}; - fields_border = {"radius", "rmass", "temperature"}; - fields_border_vel = {"radius", "rmass", "omega", "temperature"}; - fields_exchange = {"radius", "rmass", "omega", "temperature"}; - fields_restart = {"radius", "rmass", "omega", "temperature"}; - fields_create = {"radius", "rmass", "omega", "temperature"}; - fields_data_atom = {"id", "type", "radius", "rmass", "x", "temperature"}; - fields_data_vel = {"id", "v", "omega"}; -} - -/* ---------------------------------------------------------------------- - process sub-style args - optional arg = 0/1 for static/dynamic particle radii -------------------------------------------------------------------------- */ - -void AtomVecSphereTemp::process_args(int narg, char **arg) -{ - if (narg != 0 && narg != 1) error->all(FLERR, "Illegal atom_style sphere command"); - - radvary = 0; - if (narg == 1) { - radvary = utils::numeric(FLERR, arg[0], true, lmp); - if (radvary < 0 || radvary > 1) error->all(FLERR, "Illegal atom_style sphere command"); - } - - // dynamic particle radius and mass must be communicated every step - - if (radvary) { - fields_comm = {"radius", "rmass"}; - fields_comm_vel = {"radius", "rmass", "omega"}; - } - - // delay setting up of fields until now - - setup_fields(); -} - -/* ---------------------------------------------------------------------- */ - -void AtomVecSphereTemp::init() -{ - AtomVec::init(); - - // check if optional radvary setting should have been set to 1 - - for (int i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style, "adapt") == 0) { - auto fix = dynamic_cast(modify->fix[i]); - if (fix->diamflag && radvary == 0) - error->all(FLERR, "Fix adapt changes particle radii but atom_style sphere is not dynamic"); - } -} - -/* ---------------------------------------------------------------------- - set local copies of all grow ptrs used by this class, except defaults - needed in replicate when 2 atom classes exist and it calls pack_restart() -------------------------------------------------------------------------- */ - -void AtomVecSphereTemp::grow_pointers() -{ - radius = atom->radius; - rmass = atom->rmass; - omega = atom->omega; - temperature = atom->temperature; - heatflow = atom->heatflow; -} - -/* ---------------------------------------------------------------------- - clear extra forces starting at atom N - nbytes = # of bytes to clear for a per-atom vector -------------------------------------------------------------------------- */ - -void AtomVecSphereTemp::force_clear(int n, size_t nbytes) -{ - memset(&heatflow[n], 0, nbytes); -} - -/* ---------------------------------------------------------------------- - initialize non-zero atom quantities -------------------------------------------------------------------------- */ - -void AtomVecSphereTemp::create_atom_post(int ilocal) -{ - radius[ilocal] = 0.5; - rmass[ilocal] = 4.0 * MY_PI / 3.0 * 0.5 * 0.5 * 0.5; -} - -/* ---------------------------------------------------------------------- - modify what AtomVec::data_atom() just unpacked - or initialize other atom quantities -------------------------------------------------------------------------- */ - -void AtomVecSphereTemp::data_atom_post(int ilocal) -{ - radius_one = 0.5 * atom->radius[ilocal]; - radius[ilocal] = radius_one; - if (radius_one > 0.0) rmass[ilocal] *= 4.0 * MY_PI / 3.0 * radius_one * radius_one * radius_one; - - if (rmass[ilocal] <= 0.0) error->one(FLERR, "Invalid density in Atoms section of data file"); - - omega[ilocal][0] = 0.0; - omega[ilocal][1] = 0.0; - omega[ilocal][2] = 0.0; -} - -/* ---------------------------------------------------------------------- - modify values for AtomVec::pack_data() to pack -------------------------------------------------------------------------- */ - -void AtomVecSphereTemp::pack_data_pre(int ilocal) -{ - radius_one = radius[ilocal]; - rmass_one = rmass[ilocal]; - - radius[ilocal] *= 2.0; - if (radius_one != 0.0) - rmass[ilocal] = rmass_one / (4.0 * MY_PI / 3.0 * radius_one * radius_one * radius_one); -} - -/* ---------------------------------------------------------------------- - unmodify values packed by AtomVec::pack_data() -------------------------------------------------------------------------- */ - -void AtomVecSphereTemp::pack_data_post(int ilocal) -{ - radius[ilocal] = radius_one; - rmass[ilocal] = rmass_one; -} diff --git a/src/GRANULAR/atom_vec_sphere_temp.h b/src/GRANULAR/atom_vec_sphere_temp.h deleted file mode 100644 index de6d5266a5..0000000000 --- a/src/GRANULAR/atom_vec_sphere_temp.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef ATOM_CLASS -// clang-format off -AtomStyle(sphere/temp,AtomVecSphereTemp); -// clang-format on -#else - -#ifndef LMP_ATOM_VEC_SPHERE_TEMP_H -#define LMP_ATOM_VEC_SPHERE_TEMP_H - -#include "atom_vec.h" - -namespace LAMMPS_NS { - -class AtomVecSphereTemp : public AtomVec { - public: - AtomVecSphereTemp(class LAMMPS *); - void process_args(int, char **) override; - void init() override; - - void grow_pointers() override; - void force_clear(int, size_t) override; - void create_atom_post(int) override; - void data_atom_post(int) override; - void pack_data_pre(int) override; - void pack_data_post(int) override; - - private: - double *radius, *rmass; - double **omega; - double *temperature, *heatflow; - - int radvary; - double radius_one, rmass_one; -}; - -} // namespace LAMMPS_NS - -#endif -#endif diff --git a/src/GRANULAR/fix_heat_flow_sphere_temp.cpp b/src/GRANULAR/fix_heat_flow.cpp similarity index 58% rename from src/GRANULAR/fix_heat_flow_sphere_temp.cpp rename to src/GRANULAR/fix_heat_flow.cpp index fe7fc49324..d62f914577 100644 --- a/src/GRANULAR/fix_heat_flow_sphere_temp.cpp +++ b/src/GRANULAR/fix_heat_flow.cpp @@ -12,12 +12,14 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "fix_heat_flow_sphere_temp.h" +#include "fix_heat_flow.h" #include "atom.h" +#include "comm.h" #include "error.h" #include "force.h" #include "memory.h" +#include "modify.h" #include "respa.h" #include "update.h" @@ -28,12 +30,14 @@ enum {NONE, CONSTANT, TYPE}; /* ---------------------------------------------------------------------- */ -FixHeatFlowSphereTemp::FixHeatFlowSphereTemp(LAMMPS *lmp, int narg, char **arg) : +FixHeatFlow::FixHeatFlow(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal fix command"); cp_style = NONE; + comm_forward = 1; + comm_reverse = 1; int ntypes = atom->ntypes; if (strcmp(arg[3],"constant") == 0) { @@ -60,7 +64,7 @@ FixHeatFlowSphereTemp::FixHeatFlowSphereTemp(LAMMPS *lmp, int narg, char **arg) /* ---------------------------------------------------------------------- */ -int FixHeatFlowSphereTemp::setmask() +int FixHeatFlow::setmask() { int mask = 0; mask |= FINAL_INTEGRATE; @@ -70,7 +74,7 @@ int FixHeatFlowSphereTemp::setmask() /* ---------------------------------------------------------------------- */ -void FixHeatFlowSphereTemp::init() +void FixHeatFlow::init() { dt = update->dt; @@ -82,7 +86,26 @@ void FixHeatFlowSphereTemp::init() /* ---------------------------------------------------------------------- */ -void FixHeatFlowSphereTemp::final_integrate() +void FixHeatFlow::setup(int /*vflag*/) +{ + // Identify whether this is the first/last instance of fix heat/flow + first_flag = 0; + last_flag = 0; + + int i = 0; + auto fixlist = modify->get_fix_by_style("heat/flow"); + for (const auto &ifix : fixlist) { + if (strcmp(ifix->id, id) == 0) break; + i++; + } + + if (i == 0) first_flag = 1; + if ((i + 1) == fixlist.size()) last_flag = 1; +} + +/* ---------------------------------------------------------------------- */ + +void FixHeatFlow::final_integrate() { // update temperature of atoms in group @@ -95,6 +118,10 @@ void FixHeatFlowSphereTemp::final_integrate() int nlocal = atom->nlocal; if (igroup == atom->firstgroup) nlocal = atom->nfirst; + // add ghost contributions to heatflow if first instance of fix + if (first_flag) + comm->reverse_comm(this); + if (rmass) { for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { @@ -106,11 +133,18 @@ void FixHeatFlowSphereTemp::final_integrate() temperature[i] += dt * heatflow[i] / (calc_cp(i) * mass[type[i]]); } } + + // send updated temperatures to ghosts if last instance of fix + // then clear heatflow for next force calculation + if (last_flag) { + comm->forward_comm(this); + for (int i = 0; i < atom->nmax; i++) heatflow[i] = 0.0; + } } /* ---------------------------------------------------------------------- */ -void FixHeatFlowSphereTemp::final_integrate_respa(int ilevel, int /*iloop*/) +void FixHeatFlow::final_integrate_respa(int ilevel, int /*iloop*/) { dt = update->dt; final_integrate(); @@ -118,14 +152,14 @@ void FixHeatFlowSphereTemp::final_integrate_respa(int ilevel, int /*iloop*/) /* ---------------------------------------------------------------------- */ -void FixHeatFlowSphereTemp::reset_dt() +void FixHeatFlow::reset_dt() { dt = update->dt; } /* ---------------------------------------------------------------------- */ -double FixHeatFlowSphereTemp::calc_cp(int i) +double FixHeatFlow::calc_cp(int i) { if (cp_style == TYPE) { return cp_type[atom->type[i]]; @@ -133,3 +167,66 @@ double FixHeatFlowSphereTemp::calc_cp(int i) return cp; } } + +/* ---------------------------------------------------------------------- */ + +int FixHeatFlow::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) +{ + int i, j, m; + + double *temperature = atom->temperature; + + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = temperature[j]; + } + + return m; +} + +/* ---------------------------------------------------------------------- */ + +void FixHeatFlow::unpack_forward_comm(int n, int first, double *buf) +{ + int i, m, last; + + m = 0; + last = first + n; + + double *temperature = atom->temperature; + + for (i = first; i < last; i++) temperature[i] = buf[m++]; +} + +/* ---------------------------------------------------------------------- */ + +int FixHeatFlow::pack_reverse_comm(int n, int first, double *buf) +{ + int i,k,last; + + int m = 0; + last = first + n; + double *heatflow = atom->heatflow; + + for (i = first; i < last; i++) { + buf[m++] = heatflow[i]; + } + + return m; +} + +/* ---------------------------------------------------------------------- */ + +void FixHeatFlow::unpack_reverse_comm(int n, int *list, double *buf) +{ + int i,j,k,kk,ncount; + + int m = 0; + double *heatflow = atom->heatflow; + + for (i = 0; i < n; i++) { + j = list[i]; + heatflow[j] += buf[m++]; + } +} diff --git a/src/GRANULAR/fix_heat_flow_sphere_temp.h b/src/GRANULAR/fix_heat_flow.h similarity index 69% rename from src/GRANULAR/fix_heat_flow_sphere_temp.h rename to src/GRANULAR/fix_heat_flow.h index 6bc2d50373..2d311d0104 100644 --- a/src/GRANULAR/fix_heat_flow_sphere_temp.h +++ b/src/GRANULAR/fix_heat_flow.h @@ -13,33 +13,37 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(heat/flow/sphere/temp,FixHeatFlowSphereTemp); +FixStyle(heat/flow,FixHeatFlow); // clang-format on #else -#ifndef LMP_FIX_HEAT_FLOW_SPHERE_TEMP_H -#define LMP_FIX_HEAT_FLOW_SPHERE_TEMP_H +#ifndef LMP_FIX_HEAT_FLOW_H +#define LMP_FIX_HEAT_FLOW_H #include "fix.h" namespace LAMMPS_NS { -class FixHeatFlowSphereTemp : public Fix { +class FixHeatFlow : public Fix { public: - FixHeatFlowSphereTemp(class LAMMPS *, int, char **); + FixHeatFlow(class LAMMPS *, int, char **); int setmask() override; void init() override; + void setup(int) override; void final_integrate() override; void final_integrate_respa(int, int) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; void reset_dt() override; protected: double dt; double cp, *cp_type; int cp_style; - - int mass_require; + int first_flag, last_flag; double calc_cp(int); }; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 95e25c59b2..4b43feca74 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum { MOLECULE, CHARGE, RMASS, IVEC, DVEC, IARRAY, DARRAY }; +enum { MOLECULE, CHARGE, RMASS, TEMPERATURE, HEATFLOW, IVEC, DVEC, IARRAY, DARRAY }; /* ---------------------------------------------------------------------- */ @@ -46,6 +46,8 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : molecule_flag = 0; q_flag = 0; rmass_flag = 0; + temperature_flag = 0; + heatflow_flag = 0; nvalue = 0; values_peratom = 0; @@ -81,6 +83,26 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : values_peratom++; nvalue++; iarg++; + } else if (strcmp(arg[iarg], "temperature") == 0) { + if (atom->temperature_flag) + error->all(FLERR, "Fix property/atom temperature when atom_style already has temperature attribute"); + if (temperature_flag) error->all(FLERR, "Fix property/atom cannot specify temperature twice"); + styles[nvalue] = TEMPERATURE; + cols[nvalue] = 0; + atom->temperature_flag = temperature_flag = 1; + values_peratom++; + nvalue++; + iarg++; + } else if (strcmp(arg[iarg], "heatflow") == 0) { + if (atom->heatflow_flag) + error->all(FLERR, "Fix property/atom heatflow when atom_style already has heatflow attribute"); + if (heatflow_flag) error->all(FLERR, "Fix property/atom cannot specify heatflow twice"); + styles[nvalue] = HEATFLOW; + cols[nvalue] = 0; + atom->heatflow_flag = heatflow_flag = 1; + values_peratom++; + nvalue++; + iarg++; // custom atom vector @@ -163,14 +185,15 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : if (border) comm_border = values_peratom; - // warn if mol or charge keyword used without ghost yes + // warn if mol, charge, rmass, temperature, or heatflow keyword used without ghost yes if (border == 0) { int flag = 0; for (int i = 0; i < nvalue; i++) - if (styles[i] == MOLECULE || styles[i] == CHARGE || styles[i] == RMASS) flag = 1; + if (styles[i] == MOLECULE || styles[i] == CHARGE || styles[i] == RMASS || + styles[i] == TEMPERATURE || styles[i] == HEATFLOW) flag = 1; if (flag && comm->me == 0) - error->warning(FLERR, "Fix property/atom mol or charge or rmass w/out ghost communication"); + error->warning(FLERR, "Fix property/atom mol, charge, rmass, temperature, or heatflow w/out ghost communication"); } // store current atom style @@ -213,6 +236,14 @@ FixPropertyAtom::~FixPropertyAtom() atom->rmass_flag = 0; memory->destroy(atom->rmass); atom->rmass = nullptr; + } else if (styles[nv] == TEMPERATURE) { + atom->temperature_flag = 0; + memory->destroy(atom->temperature); + atom->temperature = nullptr; + } else if (styles[nv] == HEATFLOW) { + atom->heatflow_flag = 0; + memory->destroy(atom->heatflow); + atom->heatflow = nullptr; } else if (styles[nv] == IVEC) { atom->remove_custom(index[nv], 0, cols[nv]); } else if (styles[nv] == DVEC) { @@ -298,6 +329,10 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint atom->q[m] = values.next_double(); } else if (styles[j] == RMASS) { atom->rmass[m] = values.next_double(); + } else if (styles[j] == TEMPERATURE) { + atom->temperature[m] = values.next_double(); + } else if (styles[j] == HEATFLOW) { + atom->heatflow[m] = values.next_double(); } else if (styles[j] == IVEC) { atom->ivector[index[j]][m] = values.next_int(); } else if (styles[j] == DVEC) { @@ -377,6 +412,14 @@ void FixPropertyAtom::write_data_section_pack(int /*mth*/, double **buf) double *rmass = atom->rmass; for (i = 0; i < nlocal; i++) buf[i][icol] = rmass[i]; icol++; + } else if (styles[nv] == TEMPERATURE) { + double *temperature = atom->temperature; + for (i = 0; i < nlocal; i++) buf[i][icol] = temperature[i]; + icol++; + } else if (styles[nv] == HEATFLOW) { + double *heatflow = atom->heatflow; + for (i = 0; i < nlocal; i++) buf[i][icol] = heatflow[i]; + icol++; } else if (styles[nv] == IVEC) { int *ivec = atom->ivector[index[nv]]; for (i = 0; i < nlocal; i++) buf[i][icol] = ubuf(ivec[i]).d; @@ -424,6 +467,10 @@ void FixPropertyAtom::write_data_section_keyword(int /*mth*/, FILE *fp) fputs(" q", fp); else if (styles[i] == RMASS) fputs(" rmass", fp); + else if (styles[i] == TEMPERATURE) + fputs(" temperature", fp); + else if (styles[i] == HEATFLOW) + fputs(" heatflow", fp); else if (styles[i] == IVEC) fprintf(fp, " i_%s", atom->ivname[index[i]]); else if (styles[i] == DVEC) @@ -459,6 +506,10 @@ void FixPropertyAtom::write_data_section(int /*mth*/, FILE *fp, int n, double ** line += fmt::format(" {}", buf[i][icol++]); else if (styles[nv] == RMASS) line += fmt::format(" {}", buf[i][icol++]); + else if (styles[nv] == TEMPERATURE) + line += fmt::format(" {}", buf[i][icol++]); + else if (styles[nv] == HEATFLOW) + line += fmt::format(" {}", buf[i][icol++]); else if (styles[nv] == IVEC) line += fmt::format(" {}", (int) ubuf(buf[i][icol++]).i); else if (styles[nv] == DVEC) @@ -491,6 +542,10 @@ double FixPropertyAtom::memory_usage() bytes = atom->nmax * sizeof(double); else if (styles[m] == RMASS) bytes = atom->nmax * sizeof(double); + else if (styles[m] == TEMPERATURE) + bytes = atom->nmax * sizeof(double); + else if (styles[m] == HEATFLOW) + bytes = atom->nmax * sizeof(double); else if (styles[m] == IVEC) bytes = atom->nmax * sizeof(int); else if (styles[m] == DVEC) @@ -525,6 +580,14 @@ void FixPropertyAtom::grow_arrays(int nmax) memory->grow(atom->rmass, nmax, "atom:rmass"); size_t nbytes = (nmax - nmax_old) * sizeof(double); memset(&atom->rmass[nmax_old], 0, nbytes); + } else if (styles[nv] == TEMPERATURE) { + memory->grow(atom->temperature, nmax, "atom:temperature"); + size_t nbytes = (nmax - nmax_old) * sizeof(double); + memset(&atom->temperature[nmax_old], 0, nbytes); + } else if (styles[nv] == HEATFLOW) { + memory->grow(atom->heatflow, nmax, "atom:heatflow"); + size_t nbytes = (nmax - nmax_old) * sizeof(double); + memset(&atom->heatflow[nmax_old], 0, nbytes); } else if (styles[nv] == IVEC) { memory->grow(atom->ivector[index[nv]], nmax, "atom:ivector"); size_t nbytes = (nmax - nmax_old) * sizeof(int); @@ -562,6 +625,10 @@ void FixPropertyAtom::copy_arrays(int i, int j, int /*delflag*/) atom->q[j] = atom->q[i]; else if (styles[nv] == RMASS) atom->rmass[j] = atom->rmass[i]; + else if (styles[nv] == TEMPERATURE) + atom->temperature[j] = atom->temperature[i]; + else if (styles[nv] == HEATFLOW) + atom->heatflow[j] = atom->heatflow[i]; else if (styles[nv] == IVEC) atom->ivector[index[nv]][j] = atom->ivector[index[nv]][i]; else if (styles[nv] == DVEC) @@ -604,6 +671,18 @@ int FixPropertyAtom::pack_border(int n, int *list, double *buf) j = list[i]; buf[m++] = rmass[j]; } + } else if (styles[nv] == TEMPERATURE) { + double *temperature = atom->temperature; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = temperature[j]; + } + } else if (styles[nv] == HEATFLOW) { + double *heatflow = atom->heatflow; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = heatflow[j]; + } } else if (styles[nv] == IVEC) { int *ivector = atom->ivector[index[nv]]; for (i = 0; i < n; i++) { @@ -658,6 +737,14 @@ int FixPropertyAtom::unpack_border(int n, int first, double *buf) double *rmass = atom->rmass; last = first + n; for (i = first; i < last; i++) rmass[i] = buf[m++]; + } else if (styles[nv] == TEMPERATURE) { + double *temperature = atom->temperature; + last = first + n; + for (i = first; i < last; i++) temperature[i] = buf[m++]; + } else if (styles[nv] == HEATFLOW) { + double *heatflow = atom->heatflow; + last = first + n; + for (i = first; i < last; i++) heatflow[i] = buf[m++]; } else if (styles[nv] == IVEC) { int *ivector = atom->ivector[index[nv]]; last = first + n; @@ -700,6 +787,10 @@ int FixPropertyAtom::pack_exchange(int i, double *buf) buf[m++] = atom->q[i]; else if (styles[nv] == RMASS) buf[m++] = atom->rmass[i]; + else if (styles[nv] == TEMPERATURE) + buf[m++] = atom->temperature[i]; + else if (styles[nv] == HEATFLOW) + buf[m++] = atom->heatflow[i]; else if (styles[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d; else if (styles[nv] == DVEC) @@ -732,6 +823,10 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) atom->q[nlocal] = buf[m++]; else if (styles[nv] == RMASS) atom->rmass[nlocal] = buf[m++]; + else if (styles[nv] == TEMPERATURE) + atom->temperature[nlocal] = buf[m++]; + else if (styles[nv] == HEATFLOW) + atom->heatflow[nlocal] = buf[m++]; else if (styles[nv] == IVEC) atom->ivector[index[nv]][nlocal] = (int) ubuf(buf[m++]).i; else if (styles[nv] == DVEC) @@ -768,6 +863,10 @@ int FixPropertyAtom::pack_restart(int i, double *buf) buf[m++] = atom->q[i]; else if (styles[nv] == RMASS) buf[m++] = atom->rmass[i]; + else if (styles[nv] == TEMPERATURE) + buf[m++] = atom->temperature[i]; + else if (styles[nv] == HEATFLOW) + buf[m++] = atom->heatflow[i]; else if (styles[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d; else if (styles[nv] == DVEC) @@ -807,6 +906,10 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth) atom->q[nlocal] = extra[nlocal][m++]; else if (styles[nv] == RMASS) atom->rmass[nlocal] = extra[nlocal][m++]; + else if (styles[nv] == TEMPERATURE) + atom->temperature[nlocal] = extra[nlocal][m++]; + else if (styles[nv] == HEATFLOW) + atom->heatflow[nlocal] = extra[nlocal][m++]; else if (styles[nv] == IVEC) atom->ivector[index[nv]][nlocal] = (int) ubuf(extra[nlocal][m++]).i; else if (styles[nv] == DVEC) diff --git a/src/fix_property_atom.h b/src/fix_property_atom.h index 18a4b61529..7d9f50b75e 100644 --- a/src/fix_property_atom.h +++ b/src/fix_property_atom.h @@ -54,6 +54,7 @@ class FixPropertyAtom : public Fix { protected: int nvalue, border; int molecule_flag, q_flag, rmass_flag; // flags for specific fields + int temperature_flag, heatflow_flag; int *styles; // style of each value, see enum int *index; // indices into atom custom data structs int *cols; // columns per value, for arrays From 329dbd04852281640f8ec5b1e1251da83c40a490 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 15 Feb 2023 11:00:19 -0700 Subject: [PATCH 056/112] Updating doc/examples, moving forward comm to pre_force --- doc/src/Commands_fix.rst | 2 +- doc/src/Howto_granular.rst | 7 ++-- doc/src/atom_style.rst | 14 ++++---- doc/src/fix.rst | 2 +- ...flow_sphere_temp.rst => fix_heat_flow.rst} | 16 ++++----- doc/src/fix_wall_gran.rst | 7 ++-- doc/src/fix_wall_gran_region.rst | 7 ++-- doc/src/pair_granular.rst | 6 ++-- doc/src/set.rst | 9 ++--- examples/granular/in.pour.heat | 13 +++---- examples/granular/log.15Sep22.pour.heat.g++.1 | 36 ++++++++++--------- examples/granular/log.15Sep22.pour.heat.g++.4 | 36 ++++++++++--------- src/GRANULAR/fix_heat_flow.cpp | 32 +++++++++++------ src/GRANULAR/fix_heat_flow.h | 4 ++- 14 files changed, 106 insertions(+), 85 deletions(-) rename doc/src/{fix_heat_flow_sphere_temp.rst => fix_heat_flow.rst} (80%) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 714485983d..1552861129 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -92,7 +92,7 @@ OPT. * :doc:`grem ` * :doc:`halt ` * :doc:`heat ` - * :doc:`heat/flow/sphere/temp ` + * :doc:`heat/flow ` * :doc:`hyper/global ` * :doc:`hyper/local ` * :doc:`imd ` diff --git a/doc/src/Howto_granular.rst b/doc/src/Howto_granular.rst index 6a2346746b..c22cab66bc 100644 --- a/doc/src/Howto_granular.rst +++ b/doc/src/Howto_granular.rst @@ -43,10 +43,11 @@ The fix style *freeze* zeroes both the force and torque of frozen atoms, and should be used for granular system instead of the fix style *setforce*\ . -To model heat conduction, one must use the atom style: -* :doc:`atom_style sphere/temp ` +To model heat conduction, one must add the temperature and heatflow +atom variables with: +* :doc:`fix property/atom ` a temperature integration fix -* :doc:`fix heat/flow/sphere/temp ` +* :doc:`fix heat/flow ` and a heat conduction option defined in both * :doc:`pair_style granular ` * :doc:`fix wall/gran ` diff --git a/doc/src/atom_style.rst b/doc/src/atom_style.rst index bd8843fd2c..2131cd12b2 100644 --- a/doc/src/atom_style.rst +++ b/doc/src/atom_style.rst @@ -123,8 +123,6 @@ quantities. +--------------+-----------------------------------------------------+--------------------------------------+ | *sphere* | diameter, mass, angular velocity | granular models | +--------------+-----------------------------------------------------+--------------------------------------+ -| *sphere/temp*| diameter, mass, angular velocity, temperature | thermal granular models | -+--------------+-----------------------------------------------------+--------------------------------------+ | *bpm/sphere* | diameter, mass, angular velocity, quaternion | granular bonded particle models (BPM)| +--------------+-----------------------------------------------------+--------------------------------------+ | *spin* | magnetic moment | system with magnetic particles | @@ -150,7 +148,7 @@ quantities. custom values. All of the above styles define point particles, except the *sphere*, -*sphere/temp*, *bpm/sphere*, *ellipsoid*, *electron*, *peri*, *wavepacket*, *line*, +*bpm/sphere*, *ellipsoid*, *electron*, *peri*, *wavepacket*, *line*, *tri*, and *body* styles, which define finite-size particles. See the :doc:`Howto spherical ` page for an overview of using finite-size particle models with LAMMPS. @@ -160,11 +158,11 @@ per-type basis, using the :doc:`mass ` command, The finite-size particle styles assign mass to individual particles on a per-particle basis. -For the *sphere*, *sphere/temp*, and *bpm/sphere* styles, the particles -are spheres and each stores a per-particle diameter and mass. If the -diameter > 0.0, the particle is a finite-size sphere. If the diameter -= 0.0, it is a point particle. Note that by use of the *disc* keyword -with the :doc:`fix nve/sphere `, :doc:`fix nvt/sphere +For the *sphere* and *bpm/sphere* styles, the particles are spheres +and each stores a per-particle diameter and mass. If the diameter > +0.0, the particle is a finite-size sphere. If the diameter = 0.0, it +is a point particle. Note that by use of the *disc* keyword with the +:doc:`fix nve/sphere `, :doc:`fix nvt/sphere `, :doc:`fix nph/sphere `, :doc:`fix npt/sphere ` commands for the *sphere* style, spheres can be effectively treated as 2d discs for a 2d simulation if diff --git a/doc/src/fix.rst b/doc/src/fix.rst index d524b06551..ed8349c953 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -244,7 +244,7 @@ accelerated styles exist. * :doc:`grem ` - implements the generalized replica exchange method * :doc:`halt ` - terminate a dynamics run or minimization * :doc:`heat ` - add/subtract momentum-conserving heat -* :doc:`heat/flow/sphere/temp ` - plain time integration of heat flow with per-atom temperature updates +* :doc:`heat/flow ` - plain time integration of heat flow with per-atom temperature updates * :doc:`hyper/global ` - global hyperdynamics * :doc:`hyper/local ` - local hyperdynamics * :doc:`imd ` - implements the "Interactive MD" (IMD) protocol diff --git a/doc/src/fix_heat_flow_sphere_temp.rst b/doc/src/fix_heat_flow.rst similarity index 80% rename from doc/src/fix_heat_flow_sphere_temp.rst rename to doc/src/fix_heat_flow.rst index c604b041ad..ee73d7d4f2 100644 --- a/doc/src/fix_heat_flow_sphere_temp.rst +++ b/doc/src/fix_heat_flow.rst @@ -1,6 +1,6 @@ -.. index:: fix heat/flow/sphere/temp +.. index:: fix heat/flow -fix heat/flow/sphere/temp command +fix heat/flow command ========================== Syntax @@ -8,10 +8,10 @@ Syntax .. parsed-literal:: - fix ID group-ID heat/flow/sphere/temp style values ... + fix ID group-ID heat/flow style values ... * ID, group-ID are documented in :doc:`fix ` command -* heat/flow/sphere/temp = style name of this fix command +* heat/flow = style name of this fix command * one style with corresponding value(s) needs to be listed .. parsed-literal:: @@ -29,8 +29,8 @@ Examples .. code-block:: LAMMPS - fix 1 all heat/flow/sphere/temp constant 1.0 - fix 1 all heat/flow/sphere/temp type 1.0 0.5 + fix 1 all heat/flow constant 1.0 + fix 1 all heat/flow type 1.0 0.5 Description """"""""""" @@ -57,12 +57,12 @@ Restrictions """""""""""" This fix requires that atoms store temperature and heat flow -as defined by the :doc:`atom_style sphere/temp ` command. +as defined by the :doc:`fix property/atom ` command. Related commands """""""""""""""" -:doc:`pair granular ` +:doc:`pair granular `, :doc:`fix property/atom ` Default """"""" diff --git a/doc/src/fix_wall_gran.rst b/doc/src/fix_wall_gran.rst index 0cc4798dd2..0006e1750b 100644 --- a/doc/src/fix_wall_gran.rst +++ b/doc/src/fix_wall_gran.rst @@ -185,9 +185,10 @@ The following value can either be a numeric value or an equal-style specified as v_name, where name is the variable name. In this case, the variable will be evaluated each timestep, and its value used to determine the temperature. This option must be used in conjunction with a heat -conduction model defined in :doc:`pair_style granular ` -and a compatible atom style which stores temperature and a heat flow -as defined by the :doc:`atom_style sphere/temp ` command. +conduction model defined in :doc:`pair_style granular `, +:doc:`fix property/atom ` to store temperature and a +heat flow, and :doc:`fix heat/flow ` to integrate heat +flow. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/doc/src/fix_wall_gran_region.rst b/doc/src/fix_wall_gran_region.rst index 73a2e9c973..94edebbcf1 100644 --- a/doc/src/fix_wall_gran_region.rst +++ b/doc/src/fix_wall_gran_region.rst @@ -208,9 +208,10 @@ The following value can either be a numeric value or an equal-style specified as v_name, where name is the variable name. In this case, the variable will be evaluated each timestep, and its value used to determine the temperature. This option must be used in conjunction with a heat -conduction model defined in :doc:`pair_style granular ` -and a compatible atom style which stores temperature and a heat flow -as defined by the :doc:`atom_style sphere/temp ` command. +conduction model defined in :doc:`pair_style granular `, +:doc:`fix property/atom ` to store temperature and a +heat flow, and :doc:`fix heat/flow ` to integrate heat +flow. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index 491061b5fb..0911a3486a 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -659,9 +659,9 @@ where :math:`\Delta T` is the difference in the two particles' temperature, :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/sphere/temp ` for more -information on this option. +*pair_coeff* calls. See :doc:`fix heat/flow ` and +:doc:`fix property/atom ` for more information on this +option. ---------- diff --git a/doc/src/set.rst b/doc/src/set.rst index 5563d3199c..6add1de9f3 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -431,10 +431,11 @@ assumed to be in mass/distance\^2 units). If none of these cases are valid, then the mass is set to the density value directly (the input density is assumed to be in mass units). -Keyword *temperature* sets the temperature of a finite-size particle -as defined by the GRANULAR package. Currently, only -:doc:`atom_style sphere/temperature ` defines particles -with this attribute. The values for the temperature must be positive. +Keyword *temperature* sets the temperature of a finite-size particle. +Currently, only the GRANULAR package supports this attribute. The +temperature must be added using an instance of +:doc:`fix property/atom ` The values for the +temperature must be positive. Keyword *volume* sets the volume of all selected particles. Currently, only the :doc:`atom_style peri ` command defines particles diff --git a/examples/granular/in.pour.heat b/examples/granular/in.pour.heat index 69590389b5..f3bf9bcccc 100644 --- a/examples/granular/in.pour.heat +++ b/examples/granular/in.pour.heat @@ -3,7 +3,7 @@ variable name string heat_plate -atom_style sphere/temp +atom_style sphere units lj ############################################### @@ -49,9 +49,10 @@ region bottom_wall plane ${xc} ${yc} 0 0 0 1 side in region insreg cylinder z ${xc} ${yc} ${cyl_rad_inner} ${drum_height} ${boxz} -fix 0 all balance 100 1.0 shift xy 5 1.1 -fix 1 all nve/sphere -fix 2 all heat/flow/sphere/temp constant 1.0 +fix 0 all property/atom temperature heatflow +fix 1 all balance 100 1.0 shift xy 5 1.1 +fix 2 all nve/sphere +fix 3 all heat/flow constant 1.0 fix grav all gravity 10 vector 0 0 -1 fix ins1 all pour 1000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} fix ins2 all pour 1000 2 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} @@ -63,8 +64,8 @@ neigh_modify delay 0 every 1 check yes variable oscillate equal 1.0*sin(step*0.0001) -fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall -fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 5 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate thermo_style custom step atoms ke pxx pyy pzz thermo_modify lost warn diff --git a/examples/granular/log.15Sep22.pour.heat.g++.1 b/examples/granular/log.15Sep22.pour.heat.g++.1 index d232752c74..24c128c0a6 100644 --- a/examples/granular/log.15Sep22.pour.heat.g++.1 +++ b/examples/granular/log.15Sep22.pour.heat.g++.1 @@ -1,10 +1,10 @@ -LAMMPS (15 Sep 2022) +LAMMPS (22 Dec 2022) # pour one types of particles into cylinder and oscillate # temperature of the bottom plate variable name string heat_plate -atom_style sphere/temp +atom_style sphere units lj ############################################### @@ -76,9 +76,11 @@ region insreg cylinder z 5 5 4.45 ${drum_height} ${boxz} region insreg cylinder z 5 5 4.45 30 ${boxz} region insreg cylinder z 5 5 4.45 30 50 -fix 0 all balance 100 1.0 shift xy 5 1.1 -fix 1 all nve/sphere -fix 2 all heat/flow/sphere/temp constant 1.0 +fix 0 all property/atom temperature heatflow +WARNING: Fix property/atom mol, charge, rmass, temperature, or heatflow w/out ghost communication (../fix_property_atom.cpp:196) +fix 1 all balance 100 1.0 shift xy 5 1.1 +fix 2 all nve/sphere +fix 3 all heat/flow constant 1.0 fix grav all gravity 10 vector 0 0 -1 fix ins1 all pour 1000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} @@ -101,8 +103,8 @@ neigh_modify delay 0 every 1 check yes variable oscillate equal 1.0*sin(step*0.0001) -fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall -fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 5 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate thermo_style custom step atoms ke pxx pyy pzz thermo_modify lost warn @@ -1142,20 +1144,20 @@ WARNING: Less insertions than requested (../fix_pour.cpp:681) 99800 2000 -0 7.9486941 7.5271104 6.5519215 99900 2000 -0 7.9486942 7.5271152 6.5519136 100000 2000 -0 7.9486939 7.5271185 6.5519079 -Loop time of 87.7116 on 1 procs for 100000 steps with 2000 atoms +Loop time of 85.1866 on 1 procs for 100000 steps with 2000 atoms -Performance: 98504.589 tau/day, 1140.099 timesteps/s, 2.280 Matom-step/s -99.5% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 101424.442 tau/day, 1173.894 timesteps/s, 2.348 Matom-step/s +99.4% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 66.081 | 66.081 | 66.081 | 0.0 | 75.34 -Neigh | 2.7411 | 2.7411 | 2.7411 | 0.0 | 3.13 -Comm | 1.3393 | 1.3393 | 1.3393 | 0.0 | 1.53 -Output | 0.029473 | 0.029473 | 0.029473 | 0.0 | 0.03 -Modify | 16.598 | 16.598 | 16.598 | 0.0 | 18.92 -Other | | 0.9233 | | | 1.05 +Pair | 63.448 | 63.448 | 63.448 | 0.0 | 74.48 +Neigh | 2.7318 | 2.7318 | 2.7318 | 0.0 | 3.21 +Comm | 1.2139 | 1.2139 | 1.2139 | 0.0 | 1.43 +Output | 0.030165 | 0.030165 | 0.030165 | 0.0 | 0.04 +Modify | 16.878 | 16.878 | 16.878 | 0.0 | 19.81 +Other | | 0.8845 | | | 1.04 Nlocal: 2000 ave 2000 max 2000 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -1169,4 +1171,4 @@ Ave neighs/atom = 4.8175 Neighbor list builds = 3285 Dangerous builds = 0 -Total wall time: 0:01:27 +Total wall time: 0:01:25 diff --git a/examples/granular/log.15Sep22.pour.heat.g++.4 b/examples/granular/log.15Sep22.pour.heat.g++.4 index f159302d65..864a7898c3 100644 --- a/examples/granular/log.15Sep22.pour.heat.g++.4 +++ b/examples/granular/log.15Sep22.pour.heat.g++.4 @@ -1,10 +1,10 @@ -LAMMPS (15 Sep 2022) +LAMMPS (22 Dec 2022) # pour one types of particles into cylinder and oscillate # temperature of the bottom plate variable name string heat_plate -atom_style sphere/temp +atom_style sphere units lj ############################################### @@ -76,9 +76,11 @@ region insreg cylinder z 5 5 4.45 ${drum_height} ${boxz} region insreg cylinder z 5 5 4.45 30 ${boxz} region insreg cylinder z 5 5 4.45 30 50 -fix 0 all balance 100 1.0 shift xy 5 1.1 -fix 1 all nve/sphere -fix 2 all heat/flow/sphere/temp constant 1.0 +fix 0 all property/atom temperature heatflow +WARNING: Fix property/atom mol, charge, rmass, temperature, or heatflow w/out ghost communication (../fix_property_atom.cpp:196) +fix 1 all balance 100 1.0 shift xy 5 1.1 +fix 2 all nve/sphere +fix 3 all heat/flow constant 1.0 fix grav all gravity 10 vector 0 0 -1 fix ins1 all pour 1000 1 1234 region insreg diam range ${dlo} ${dhi} dens ${dens} ${dens} fix ins1 all pour 1000 1 1234 region insreg diam range 0.5 ${dhi} dens ${dens} ${dens} @@ -101,8 +103,8 @@ neigh_modify delay 0 every 1 check yes variable oscillate equal 1.0*sin(step*0.0001) -fix 3 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall -fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate +fix 4 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji region curved_wall +fix 5 all wall/gran/region granular hertz/material 1e5 0.1 0.3 tangential mindlin NULL 1.0 0.5 damping tsuji heat area 5.0 region bottom_wall temperature v_oscillate thermo_style custom step atoms ke pxx pyy pzz thermo_modify lost warn @@ -1142,20 +1144,20 @@ WARNING: Less insertions than requested (../fix_pour.cpp:681) 99800 2000 -0 7.5931492 7.7670928 6.2908349 99900 2000 -0 7.5931443 7.7670902 6.29084 100000 2000 -0 7.5931395 7.7670875 6.2908449 -Loop time of 28.4684 on 4 procs for 100000 steps with 2000 atoms +Loop time of 29.8443 on 4 procs for 100000 steps with 2000 atoms -Performance: 303494.659 tau/day, 3512.670 timesteps/s, 7.025 Matom-step/s -96.7% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 289502.519 tau/day, 3350.724 timesteps/s, 6.701 Matom-step/s +96.9% CPU use with 4 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 14.471 | 15.426 | 16.874 | 24.3 | 54.19 -Neigh | 0.50185 | 0.52867 | 0.55379 | 3.1 | 1.86 -Comm | 5.277 | 6.8933 | 7.8956 | 40.4 | 24.21 -Output | 0.019683 | 0.022775 | 0.031664 | 3.4 | 0.08 -Modify | 4.7145 | 4.8537 | 5.0111 | 6.1 | 17.05 -Other | | 0.7439 | | | 2.61 +Pair | 14.343 | 15.321 | 16.586 | 22.2 | 51.34 +Neigh | 0.50641 | 0.541 | 0.58175 | 3.8 | 1.81 +Comm | 4.9356 | 6.3418 | 7.3742 | 38.3 | 21.25 +Output | 0.019257 | 0.022039 | 0.029648 | 3.0 | 0.07 +Modify | 6.8727 | 6.9724 | 7.084 | 2.9 | 23.36 +Other | | 0.6461 | | | 2.16 Nlocal: 500 ave 504 max 496 min Histogram: 2 0 0 0 0 0 0 0 0 2 @@ -1169,4 +1171,4 @@ Ave neighs/atom = 4.8195 Neighbor list builds = 3151 Dangerous builds = 0 -Total wall time: 0:00:28 +Total wall time: 0:00:29 diff --git a/src/GRANULAR/fix_heat_flow.cpp b/src/GRANULAR/fix_heat_flow.cpp index d62f914577..f9ad309f98 100644 --- a/src/GRANULAR/fix_heat_flow.cpp +++ b/src/GRANULAR/fix_heat_flow.cpp @@ -67,6 +67,7 @@ FixHeatFlow::FixHeatFlow(LAMMPS *lmp, int narg, char **arg) : int FixHeatFlow::setmask() { int mask = 0; + mask |= PRE_FORCE; mask |= FINAL_INTEGRATE; mask |= FINAL_INTEGRATE_RESPA; return mask; @@ -88,9 +89,8 @@ void FixHeatFlow::init() void FixHeatFlow::setup(int /*vflag*/) { - // Identify whether this is the first/last instance of fix heat/flow + // Identify whether this is the first instance of fix heat/flow first_flag = 0; - last_flag = 0; int i = 0; auto fixlist = modify->get_fix_by_style("heat/flow"); @@ -100,7 +100,26 @@ void FixHeatFlow::setup(int /*vflag*/) } if (i == 0) first_flag = 1; - if ((i + 1) == fixlist.size()) last_flag = 1; +} + +/* ---------------------------------------------------------------------- */ + +void FixHeatFlow::setup_pre_force(int /*vflag*/) +{ + pre_force(0); +} + +/* ---------------------------------------------------------------------- */ + +void FixHeatFlow::pre_force(int /*vflag*/) +{ + // send updated temperatures to ghosts if first instance of fix + // then clear heatflow for next force calculation + double *heatflow = atom->heatflow; + if (first_flag) { + comm->forward_comm(this); + for (int i = 0; i < atom->nmax; i++) heatflow[i] = 0.0; + } } /* ---------------------------------------------------------------------- */ @@ -133,13 +152,6 @@ void FixHeatFlow::final_integrate() temperature[i] += dt * heatflow[i] / (calc_cp(i) * mass[type[i]]); } } - - // send updated temperatures to ghosts if last instance of fix - // then clear heatflow for next force calculation - if (last_flag) { - comm->forward_comm(this); - for (int i = 0; i < atom->nmax; i++) heatflow[i] = 0.0; - } } /* ---------------------------------------------------------------------- */ diff --git a/src/GRANULAR/fix_heat_flow.h b/src/GRANULAR/fix_heat_flow.h index 2d311d0104..5a06eed4d3 100644 --- a/src/GRANULAR/fix_heat_flow.h +++ b/src/GRANULAR/fix_heat_flow.h @@ -31,6 +31,8 @@ class FixHeatFlow : public Fix { int setmask() override; void init() override; void setup(int) override; + void setup_pre_force(int) override; + void pre_force(int) override; void final_integrate() override; void final_integrate_respa(int, int) override; int pack_forward_comm(int, int *, double *, int, int *) override; @@ -43,7 +45,7 @@ class FixHeatFlow : public Fix { double dt; double cp, *cp_type; int cp_style; - int first_flag, last_flag; + int first_flag; double calc_cp(int); }; From a92c9e3b91e52483340b62447b16f6988e938a8f Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 22 Feb 2023 19:48:46 -0700 Subject: [PATCH 057/112] cmake: remove pip install from install target --- cmake/CMakeLists.txt | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 41229e9cd6..5a30cd5aa5 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -856,35 +856,6 @@ else() ${CMAKE_COMMAND} -E echo "Must build LAMMPS as a shared library to use the Python module") endif() -############################################################################### -# Add LAMMPS python module to "install" target. This is taylored for building -# LAMMPS for package managers and with different prefix settings. -# This requires either a shared library or that the PYTHON package is included. -############################################################################### -if(BUILD_SHARED_LIBS OR PKG_PYTHON) - if(CMAKE_VERSION VERSION_LESS 3.12) - # adjust so we find Python 3 versions before Python 2 on old systems with old CMake - set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6) - find_package(PythonInterp) # Deprecated since version 3.12 - if(PYTHONINTERP_FOUND) - set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) - endif() - else() - # backward compatibility - if(PYTHON_EXECUTABLE) - set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) - endif() - find_package(Python COMPONENTS Interpreter) - endif() - if(Python_EXECUTABLE) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/lib) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/src) - file(COPY ${LAMMPS_SOURCE_DIR}/version.h DESTINATION ${CMAKE_BINARY_DIR}/python/src) - file(COPY ${LAMMPS_PYTHON_DIR}/README ${LAMMPS_PYTHON_DIR}/pyproject.toml ${LAMMPS_PYTHON_DIR}/setup.py ${LAMMPS_PYTHON_DIR}/lammps DESTINATION ${CMAKE_BINARY_DIR}/python/lib) - install(CODE "if(\"\$ENV{DESTDIR}\" STREQUAL \"\")\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX})\n else()\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX} --root=\$ENV{DESTDIR})\n endif()") - endif() -endif() - include(Testing) include(CodeCoverage) include(CodingStandard) From c9e300f76f4ab31bb1a5fa1d8aa03bfcb3c71a56 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 3 Mar 2023 16:18:31 -0500 Subject: [PATCH 058/112] implementation of bond style harmonic/restrain /w docs --- doc/src/Commands_bond.rst | 1 + doc/src/bond_harmonic_restrain.rst | 79 ++++++ doc/src/bond_style.rst | 3 +- doc/utils/sphinx-config/false_positives.txt | 1 + src/.gitignore | 2 + src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 244 ++++++++++++++++++ src/EXTRA-MOLECULE/bond_harmonic_restrain.h | 52 ++++ 7 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 doc/src/bond_harmonic_restrain.rst create mode 100644 src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp create mode 100644 src/EXTRA-MOLECULE/bond_harmonic_restrain.h diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index cfc896aa0e..aaf706b5df 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -42,6 +42,7 @@ OPT. * :doc:`gaussian ` * :doc:`gromos (o) ` * :doc:`harmonic (iko) ` + * :doc:`harmonic/restrain ` * :doc:`harmonic/shift (o) ` * :doc:`harmonic/shift/cut (o) ` * :doc:`lepton (o) ` diff --git a/doc/src/bond_harmonic_restrain.rst b/doc/src/bond_harmonic_restrain.rst new file mode 100644 index 0000000000..a9918d8b5d --- /dev/null +++ b/doc/src/bond_harmonic_restrain.rst @@ -0,0 +1,79 @@ +.. index:: bond_style harmonic/restrain + +bond_style harmonic/restrain command +==================================== + +Syntax +"""""" + +.. code-block:: LAMMPS + + bond_style harmonic/restrain + +Examples +"""""""" + +.. code-block:: LAMMPS + + bond_style harmonic + bond_coeff 5 80.0 + +Description +""""""""""" + +The *harmonic/restrain* bond style uses the potential + +.. math:: + + E = K (r - r_{t=0})^2 + +where :math:`r_{t=0}` is the distance between the bond atoms at the +beginning of the first :doc:`run ` or :doc:`minimize ` +command after the bond style has been defined (*t=0*). Note that the +usual 1/2 factor is included in :math:`K`. This will effectively +restrain bonds to their initial length, whatever that is. + +The following coefficient must be defined for each bond type via the +:doc:`bond_coeff ` command as in the example above, or in +the data file or restart files read by the :doc:`read_data ` +or :doc:`read_restart ` commands + +* :math:`K` (energy/distance\^2) + +Restart info +"""""""""""" + +This bond style supports the :doc:`write_restart ` and +:doc:`read_restart ` commands. The state of the initial +bond lengths is stored with the restart files and read back. + +Restrictions +"""""""""""" + +This bond style can only be used if LAMMPS was built with the +EXTRA-MOLECULE package. See the :doc:`Build package ` +page for more info. + +This bond style does not write its coefficients to a data file since the +:math:`r_{t=0}` values are for individual bonds and not bond types. +Since it uses :doc:`fix property/atom ` internally, +you should use the "nofix" argument to the :doc:`write_data command +` to avoid writing a section to the data file can cannot be +read back in by the bond style. + +This bond style cannot be used with :doc:`fix shake or fix rattle +`, with :doc:`fix filter/corotate `, or +any :doc:`tip4p pair style ` since there is no specific +equilibrium distance for a given bond type. + + +Related commands +"""""""""""""""" + +:doc:`bond_coeff `, :doc:`delete_bonds `, +:doc:`bond_harmonic ` + +Default +""""""" + +none diff --git a/doc/src/bond_style.rst b/doc/src/bond_style.rst index 23b89d00a2..b33d0a9e9a 100644 --- a/doc/src/bond_style.rst +++ b/doc/src/bond_style.rst @@ -10,7 +10,7 @@ Syntax bond_style style args -* style = *none* or *zero* or *hybrid* or *bpm/rotational* or *bpm/spring* or *class2* or *fene* or *fene/expand* or *fene/nm* or *gaussian* or *gromos* or *harmonic* or *harmonic/shift* or *harmonic/shift/cut* or *lepton* or *morse* or *nonlinear* or *oxdna/fene* or *oxdena2/fene* or *oxrna2/fene* or *quartic* or *special* or *table* +* style = *none* or *zero* or *hybrid* or *bpm/rotational* or *bpm/spring* or *class2* or *fene* or *fene/expand* or *fene/nm* or *gaussian* or *gromos* or *harmonic* or *harmonic/restrain* *harmonic/shift* or *harmonic/shift/cut* or *lepton* or *morse* or *nonlinear* or *oxdna/fene* or *oxdena2/fene* or *oxrna2/fene* or *quartic* or *special* or *table* * args = none for any style except *hybrid* @@ -93,6 +93,7 @@ accelerated styles exist. * :doc:`gaussian ` - multicentered Gaussian-based bond potential * :doc:`gromos ` - GROMOS force field bond * :doc:`harmonic ` - harmonic bond +* :doc:`harmonic/restrain ` - harmonic bond to restrain to original bond distance * :doc:`harmonic/shift ` - shifted harmonic bond * :doc:`harmonic/shift/cut ` - shifted harmonic bond with a cutoff * :doc:`lepton ` - bond potential from evaluating a string diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index d03300439f..ff8f0d455b 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2463,6 +2463,7 @@ nodeless nodeset nodesets Noehring +nofix Noffset noforce noguess diff --git a/src/.gitignore b/src/.gitignore index df02ab3397..aa57927669 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -492,6 +492,8 @@ /bond_gromos.h /bond_harmonic.cpp /bond_harmonic.h +/bond_harmonic_restrain.cpp +/bond_harmonic_restrain.h /bond_harmonic_shift.cpp /bond_harmonic_shift.h /bond_harmonic_shift_cut.cpp diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp new file mode 100644 index 0000000000..413d00226d --- /dev/null +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -0,0 +1,244 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "bond_harmonic_restrain.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "fix_property_atom.h" +#include "force.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" + +#include +#include + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +BondHarmonicRestrain::BondHarmonicRestrain(LAMMPS *_lmp) : Bond(_lmp), initial(nullptr) +{ + writedata = 0; + natoms = -1; +} + +/* ---------------------------------------------------------------------- */ + +BondHarmonicRestrain::~BondHarmonicRestrain() +{ + modify->delete_fix("BOND_RESTRAIN"); + if (allocated) { + memory->destroy(setflag); + memory->destroy(k); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondHarmonicRestrain::compute(int eflag, int vflag) +{ + int i1, i2, n, type; + double delx, dely, delz, ebond, fbond; + double rsq, r, r0, dr, rk; + + ebond = 0.0; + ev_init(eflag, vflag); + + double **x = atom->x; + double **x0 = (double **) atom->extract("d2_x0"); + double **f = atom->f; + int **bondlist = neighbor->bondlist; + int nbondlist = neighbor->nbondlist; + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + + for (n = 0; n < nbondlist; n++) { + i1 = bondlist[n][0]; + i2 = bondlist[n][1]; + type = bondlist[n][2]; + + delx = x0[i1][0] - x0[i2][0]; + dely = x0[i1][1] - x0[i2][1]; + delz = x0[i1][2] - x0[i2][2]; + rsq = delx * delx + dely * dely + delz * delz; + r0 = sqrt(rsq); + + delx = x[i1][0] - x[i2][0]; + dely = x[i1][1] - x[i2][1]; + delz = x[i1][2] - x[i2][2]; + + rsq = delx * delx + dely * dely + delz * delz; + r = sqrt(rsq); + dr = r - r0; + rk = k[type] * dr; + + // force & energy + + if (r > 0.0) + fbond = -2.0 * rk / r; + else + fbond = 0.0; + + if (eflag) ebond = rk * dr; + + // apply force to each of 2 atoms + + if (newton_bond || i1 < nlocal) { + f[i1][0] += delx * fbond; + f[i1][1] += dely * fbond; + f[i1][2] += delz * fbond; + } + + if (newton_bond || i2 < nlocal) { + f[i2][0] -= delx * fbond; + f[i2][1] -= dely * fbond; + f[i2][2] -= delz * fbond; + } + + if (evflag) ev_tally(i1, i2, nlocal, newton_bond, ebond, fbond, delx, dely, delz); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondHarmonicRestrain::allocate() +{ + allocated = 1; + const int np1 = atom->nbondtypes + 1; + + memory->create(k, np1, "bond:k"); + + memory->create(setflag, np1, "bond:setflag"); + for (int i = 1; i < np1; i++) setflag[i] = 0; +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types +------------------------------------------------------------------------- */ + +void BondHarmonicRestrain::coeff(int narg, char **arg) +{ + if (narg != 2) error->all(FLERR, "Incorrect args for bond coefficients"); + if (!allocated) allocate(); + + int ilo, ihi; + utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error); + + double k_one = utils::numeric(FLERR, arg[1], false, lmp); + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + k[i] = k_one; + setflag[i] = 1; + count++; + } + + if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients"); +} + +/* ---------------------------------------------------------------------- + initialize custom data storage +------------------------------------------------------------------------- */ + +void BondHarmonicRestrain::init_style() +{ + // create internal fix to store initial positions + initial = dynamic_cast( + modify->add_fix("BOND_RESTRAIN all property/atom d2_x0 3 ghost yes")); + if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); + + // store initial positions + if (natoms < 0) { + natoms = atom->natoms; + double *const *const x0 = (double **) atom->extract("d2_x0"); + const double *const *const x = atom->x; + for (int i = 0; i < atom->nlocal; ++i) + for (int j = 0; j < 3; ++j) x0[i][j] = x[i][j]; + } + + // must not add atoms + if (natoms < atom->natoms) + error->all(FLERR, "Bond style harmonic/restrain does not support adding atoms"); +} + +/* ---------------------------------------------------------------------- + proc 0 writes out coeffs to restart file +------------------------------------------------------------------------- */ + +void BondHarmonicRestrain::write_restart(FILE *fp) +{ + fwrite(&natoms, sizeof(bigint), 1, fp); + fwrite(&k[1], sizeof(double), atom->nbondtypes, fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads coeffs from restart file, bcasts them +------------------------------------------------------------------------- */ + +void BondHarmonicRestrain::read_restart(FILE *fp) +{ + allocate(); + + if (comm->me == 0) { + utils::sfread(FLERR, &natoms, sizeof(bigint), 1, fp, nullptr, error); + utils::sfread(FLERR, &k[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + } + MPI_Bcast(&natoms, 1, MPI_LMP_BIGINT, 0, world); + MPI_Bcast(&k[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + + for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; +} + +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void BondHarmonicRestrain::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) fprintf(fp, "%d %g\n", i, k[i]); +} + +/* ---------------------------------------------------------------------- */ + +double BondHarmonicRestrain::single(int type, double rsq, int i, int j, double &fforce) +{ + double **x0 = (double **) atom->extract("d2_x0"); + + double delx = x0[i][0] - x0[j][0]; + double dely = x0[i][1] - x0[j][1]; + double delz = x0[i][2] - x0[j][2]; + double r0 = sqrt(delx * delx + dely * dely + delz * delz); + + double r = sqrt(rsq); + double dr = r - r0; + double rk = k[type] * dr; + fforce = 0; + if (r > 0.0) fforce = -2.0 * rk / r; + return rk * dr; +} + +/* ---------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + return ptr to internal members upon request +------------------------------------------------------------------------ */ + +void *BondHarmonicRestrain::extract(const char *str, int &dim) +{ + dim = 1; + if (strcmp(str, "k") == 0) return (void *) k; + return nullptr; +} diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.h b/src/EXTRA-MOLECULE/bond_harmonic_restrain.h new file mode 100644 index 0000000000..e17c21e125 --- /dev/null +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.h @@ -0,0 +1,52 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef BOND_CLASS +// clang-format off +BondStyle(harmonic/restrain,BondHarmonicRestrain); +// clang-format on +#else + +#ifndef LMP_BOND_HARMONIC_RESTRAIN_H +#define LMP_BOND_HARMONIC_RESTRAIN_H + +#include "bond.h" + +namespace LAMMPS_NS { + +class BondHarmonicRestrain : public Bond { + public: + BondHarmonicRestrain(class LAMMPS *); + ~BondHarmonicRestrain() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_distance(int) override { return -1.0; }; // return invalid value since not applicable + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; + + protected: + double *k; + bigint natoms; + class FixPropertyAtom *initial; + + virtual void allocate(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif From 77ae215047b6b5ec65239f42aac8e9028347cfb2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 3 Mar 2023 17:16:12 -0500 Subject: [PATCH 059/112] add versionadded tag --- doc/src/bond_harmonic_restrain.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/src/bond_harmonic_restrain.rst b/doc/src/bond_harmonic_restrain.rst index a9918d8b5d..5ffbfb424c 100644 --- a/doc/src/bond_harmonic_restrain.rst +++ b/doc/src/bond_harmonic_restrain.rst @@ -21,6 +21,8 @@ Examples Description """"""""""" +.. versionadded:: TBD + The *harmonic/restrain* bond style uses the potential .. math:: @@ -46,7 +48,7 @@ Restart info This bond style supports the :doc:`write_restart ` and :doc:`read_restart ` commands. The state of the initial bond lengths is stored with the restart files and read back. - + Restrictions """""""""""" From d32411f61a37f671afdc610316982a51f66e9c3d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 7 Mar 2023 16:37:14 -0500 Subject: [PATCH 060/112] recover restart ability and avoid memory leak --- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index 413d00226d..76e7347ada 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -15,6 +15,7 @@ #include "atom.h" #include "comm.h" +#include "domain.h" #include "error.h" #include "fix_property_atom.h" #include "force.h" @@ -73,6 +74,7 @@ void BondHarmonicRestrain::compute(int eflag, int vflag) delx = x0[i1][0] - x0[i2][0]; dely = x0[i1][1] - x0[i2][1]; delz = x0[i1][2] - x0[i2][2]; + domain->minimum_image(delx, dely, delz); rsq = delx * delx + dely * dely + delz * delz; r0 = sqrt(rsq); @@ -155,19 +157,32 @@ void BondHarmonicRestrain::coeff(int narg, char **arg) void BondHarmonicRestrain::init_style() { - // create internal fix to store initial positions - initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN all property/atom d2_x0 3 ghost yes")); - if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); - // store initial positions + if (natoms < 0) { + + // create internal fix to store initial positions + initial = dynamic_cast( + modify->add_fix("BOND_RESTRAIN all property/atom d2_x0 3 ghost yes")); + if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); + natoms = atom->natoms; double *const *const x0 = (double **) atom->extract("d2_x0"); const double *const *const x = atom->x; for (int i = 0; i < atom->nlocal; ++i) for (int j = 0; j < 3; ++j) x0[i][j] = x[i][j]; - } + + } else { + + // after a restart, natoms is set but initial is a null pointer. + // we add the fix, but do not initialize it. It will pull the data from the restart. + + if (!initial) { + initial = dynamic_cast( + modify->add_fix("BOND_RESTRAIN all property/atom d2_x0 3 ghost yes")); + if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); + } + } // must not add atoms if (natoms < atom->natoms) From 010b030b567d9c057b92f227a3ad6f38190fe777 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 7 Mar 2023 19:38:34 -0500 Subject: [PATCH 061/112] update docs and mention alternatives and describe differences --- doc/src/bond_harmonic_restrain.rst | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/doc/src/bond_harmonic_restrain.rst b/doc/src/bond_harmonic_restrain.rst index 5ffbfb424c..d4c34ae622 100644 --- a/doc/src/bond_harmonic_restrain.rst +++ b/doc/src/bond_harmonic_restrain.rst @@ -29,11 +29,13 @@ The *harmonic/restrain* bond style uses the potential E = K (r - r_{t=0})^2 -where :math:`r_{t=0}` is the distance between the bond atoms at the +where :math:`r_{t=0}` is the distance between the bonded atoms at the beginning of the first :doc:`run ` or :doc:`minimize ` command after the bond style has been defined (*t=0*). Note that the usual 1/2 factor is included in :math:`K`. This will effectively -restrain bonds to their initial length, whatever that is. +restrain bonds to their initial length, whatever that is. This is where +this bond style differs from :doc:`bond style harmonic ` +where the bond length is set through the per bond type coefficients. The following coefficient must be defined for each bond type via the :doc:`bond_coeff ` command as in the example above, or in @@ -42,12 +44,19 @@ or :doc:`read_restart ` commands * :math:`K` (energy/distance\^2) +This bond style differs from other options to add harmonic restraints +like :doc:`fix restrain ` or :doc:`pair style list +` or :doc:`fix colvars ` in that it requires a +bond topology, and thus the defined bonds will trigger exclusion of +special neighbors from the neighbor list according to the +:doc:`special_bonds ` settings. + Restart info """""""""""" This bond style supports the :doc:`write_restart ` and :doc:`read_restart ` commands. The state of the initial -bond lengths is stored with the restart files and read back. +bond lengths is stored with restart files and read back. Restrictions """""""""""" @@ -56,24 +65,24 @@ This bond style can only be used if LAMMPS was built with the EXTRA-MOLECULE package. See the :doc:`Build package ` page for more info. -This bond style does not write its coefficients to a data file since the +This bond style does NOT write its coefficients to a data file since the :math:`r_{t=0}` values are for individual bonds and not bond types. + Since it uses :doc:`fix property/atom ` internally, you should use the "nofix" argument to the :doc:`write_data command -` to avoid writing a section to the data file can cannot be -read back in by the bond style. +` to avoid writing a section to the data file that cannot be +read back by the bond style. This bond style cannot be used with :doc:`fix shake or fix rattle `, with :doc:`fix filter/corotate `, or any :doc:`tip4p pair style ` since there is no specific equilibrium distance for a given bond type. - Related commands """""""""""""""" -:doc:`bond_coeff `, :doc:`delete_bonds `, -:doc:`bond_harmonic ` +:doc:`bond_coeff `, :doc:`bond_harmonic `, +:doc:`fix restrain `, :doc:`pair style list ` Default """"""" From fd2cda66bbb22ccfcb2db522a6e4866834074e77 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 7 Mar 2023 20:18:41 -0500 Subject: [PATCH 062/112] handle the case when the bond style is recreated after a restart --- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index 76e7347ada..32e1226347 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -40,7 +40,7 @@ BondHarmonicRestrain::BondHarmonicRestrain(LAMMPS *_lmp) : Bond(_lmp), initial(n BondHarmonicRestrain::~BondHarmonicRestrain() { - modify->delete_fix("BOND_RESTRAIN"); + if (initial) modify->delete_fix("BOND_RESTRAIN"); if (allocated) { memory->destroy(setflag); memory->destroy(k); From 9a8b5ebae0e1d93136fb1b833a250252ddf917af Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 7 Mar 2023 20:36:28 -0500 Subject: [PATCH 063/112] use more unusual name for per-atom property --- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index 32e1226347..2054884e3e 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -40,7 +40,7 @@ BondHarmonicRestrain::BondHarmonicRestrain(LAMMPS *_lmp) : Bond(_lmp), initial(n BondHarmonicRestrain::~BondHarmonicRestrain() { - if (initial) modify->delete_fix("BOND_RESTRAIN"); + if (initial) modify->delete_fix("BOND_RESTRAIN_X0"); if (allocated) { memory->destroy(setflag); memory->destroy(k); @@ -59,7 +59,7 @@ void BondHarmonicRestrain::compute(int eflag, int vflag) ev_init(eflag, vflag); double **x = atom->x; - double **x0 = (double **) atom->extract("d2_x0"); + double **x0 = (double **) atom->extract("d2_BOND_RESTRAIN_X0"); double **f = atom->f; int **bondlist = neighbor->bondlist; int nbondlist = neighbor->nbondlist; @@ -163,11 +163,11 @@ void BondHarmonicRestrain::init_style() // create internal fix to store initial positions initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN all property/atom d2_x0 3 ghost yes")); + modify->add_fix("BOND_RESTRAIN_X0 all property/atom d2_BOND_RESTRAIN_X0 3 ghost yes")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); natoms = atom->natoms; - double *const *const x0 = (double **) atom->extract("d2_x0"); + double *const *const x0 = (double **) atom->extract("d2_BOND_RESTRAIN_X0"); const double *const *const x = atom->x; for (int i = 0; i < atom->nlocal; ++i) for (int j = 0; j < 3; ++j) x0[i][j] = x[i][j]; @@ -179,7 +179,7 @@ void BondHarmonicRestrain::init_style() if (!initial) { initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN all property/atom d2_x0 3 ghost yes")); + modify->add_fix("BOND_RESTRAIN_X0 all property/atom d2_BOND_RESTRAIN_X0 3 ghost yes")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); } } @@ -230,11 +230,12 @@ void BondHarmonicRestrain::write_data(FILE *fp) double BondHarmonicRestrain::single(int type, double rsq, int i, int j, double &fforce) { - double **x0 = (double **) atom->extract("d2_x0"); + double **x0 = (double **) atom->extract("d2_BOND_RESTRAIN_X0"); double delx = x0[i][0] - x0[j][0]; double dely = x0[i][1] - x0[j][1]; double delz = x0[i][2] - x0[j][2]; + domain->minimum_image(delx, dely, delz); double r0 = sqrt(delx * delx + dely * dely + delz * delz); double r = sqrt(rsq); From fc8a048662107dc9185331264e59edb1cd07caa2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 7 Mar 2023 21:22:57 -0500 Subject: [PATCH 064/112] add unit test --- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 4 +- unittest/force-styles/test_bond_style.cpp | 2 +- .../tests/bond-harmonic_restrain.yaml | 90 +++++++++++++++++++ 3 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 unittest/force-styles/tests/bond-harmonic_restrain.yaml diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index 2054884e3e..a15642f90b 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -163,7 +163,7 @@ void BondHarmonicRestrain::init_style() // create internal fix to store initial positions initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN_X0 all property/atom d2_BOND_RESTRAIN_X0 3 ghost yes")); + modify->add_fix("BOND_RESTRAIN_X0 all property/atom d2_BOND_RESTRAIN_X0 3 ghost yes")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); natoms = atom->natoms; @@ -182,7 +182,7 @@ void BondHarmonicRestrain::init_style() modify->add_fix("BOND_RESTRAIN_X0 all property/atom d2_BOND_RESTRAIN_X0 3 ghost yes")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); } - } + } // must not add atoms if (natoms < atom->natoms) diff --git a/unittest/force-styles/test_bond_style.cpp b/unittest/force-styles/test_bond_style.cpp index d056fdc876..c723541366 100644 --- a/unittest/force-styles/test_bond_style.cpp +++ b/unittest/force-styles/test_bond_style.cpp @@ -123,7 +123,7 @@ LAMMPS *init_lammps(int argc, char **argv, const TestConfig &cfg, const bool new command("run 0 post no"); command("write_restart " + cfg.basename + ".restart"); - command("write_data " + cfg.basename + ".data"); + command("write_data " + cfg.basename + ".data nofix"); command("write_coeff " + cfg.basename + "-coeffs.in"); return lmp; diff --git a/unittest/force-styles/tests/bond-harmonic_restrain.yaml b/unittest/force-styles/tests/bond-harmonic_restrain.yaml new file mode 100644 index 0000000000..1fd04b818e --- /dev/null +++ b/unittest/force-styles/tests/bond-harmonic_restrain.yaml @@ -0,0 +1,90 @@ +--- +lammps_version: 8 Feb 2023 +tags: generated +date_generated: Tue Mar 7 21:07:27 2023 +epsilon: 2.5e-13 +skip_tests: extract +prerequisites: ! | + atom full + bond harmonic/restrain +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +bond_style: harmonic/restrain +bond_coeff: ! | + 1 250.0 + 2 300.0 + 3 350.0 + 4 650.0 + 5 450.0 +equilibrium: 5 -1 -1 -1 -1 -1 +extract: ! | + k 1 +natoms: 29 +init_energy: 0 +init_stress: ! |2- + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +init_forces: ! |2 + 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 9 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 10 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +run_energy: 0.009384424442608962 +run_stress: ! |2- + 1.3334287184173488e+00 3.1110677999939773e-01 -1.4064657849540130e+00 2.6546279385354110e-01 1.5492956756466219e+00 7.2358876924785698e-01 +run_forces: ! |2 + 1 1.1485941046856593e-01 1.4088049450172524e-01 -8.5852076971833030e-02 + 2 -9.3217481807658653e-02 -7.6867386712704044e-02 1.0932532178570745e-01 + 3 -2.3741413942894266e-01 -8.5667734110971339e-02 -8.2143831089792743e-02 + 4 2.3324188168788909e-01 -6.5094431822773302e-02 1.6591701889629748e-01 + 5 2.6793200848186677e-02 4.1227376782380774e-02 -1.3685685314886964e-01 + 6 2.4862628338772436e-01 -3.6125357500552457e-01 -7.8230634578348013e-01 + 7 -3.8706943762359766e-02 1.9888379369193138e-01 9.8933719851963053e-01 + 8 -3.5267248957722913e-01 4.2911503092501313e-01 1.0190469073820968e-01 + 9 -5.1632048293607458e-02 -5.5343430872859360e-02 -2.2821606693951479e-01 + 10 1.2860877826855494e-01 -7.5971599169706849e-01 -5.5343112593256227e-01 + 11 1.6956002318038377e-01 4.2001247662003161e-01 6.8896503378985918e-01 + 12 3.4231534762621078e-02 -2.4857235824638585e-01 -6.3964642589377518e-01 + 13 -2.7815178906130594e-01 1.0946454990993748e-01 5.1669158882660616e-03 + 14 2.2738751895410908e-01 -4.5437525741145839e-02 5.8956676893113813e-01 + 15 -4.6207378210972273e-03 1.6438094307388113e-01 5.8917445017986604e-02 + 16 -1.1399994473799732e-02 1.1329499720204761e-01 -5.0720152745025260e-01 + 17 -1.1549300733203431e-01 8.0692771502484495e-02 3.0655385964298520e-01 + 18 1.9145703373728828e+00 1.8373130373081787e+00 -3.9519344330792983e-01 + 19 -4.7317441908503255e-01 -3.0353033418925196e-01 -5.7175303978447201e-01 + 20 -1.4413959182878502e+00 -1.5337827031189268e+00 9.6694648309240183e-01 + 21 -3.3244533656237202e-01 -3.0309080808086836e-01 6.5775553694406208e-01 + 22 -2.9549353211149859e-01 -7.2150425050573716e-02 -4.6194669575592789e-01 + 23 6.2793886867387061e-01 3.7524123313144209e-01 -1.9580884118813421e-01 + 24 8.2698432709098157e-01 -1.4448474780063469e+00 1.2133188519739595e+00 + 25 -1.5417378702379472e+00 2.4470962384652978e-01 -1.2964818258023694e+00 + 26 7.1475354314696560e-01 1.2001378541598171e+00 8.3162973828409884e-02 + 27 2.1885007758012770e-01 -5.7423924185981945e-01 2.7745249319135684e-01 + 28 -5.2036258696458004e-01 2.2330647386191435e-01 -3.5136945845348061e-01 + 29 3.0151250938445234e-01 3.5093276799790507e-01 7.3916965262123782e-02 +... From 4220944ace092cb3cf02236745a84ce2e776bf8f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 8 Mar 2023 00:25:08 -0500 Subject: [PATCH 065/112] cosmetic --- unittest/force-styles/test_angle_style.cpp | 4 ++-- unittest/force-styles/tests/bond-harmonic_restrain.yaml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/unittest/force-styles/test_angle_style.cpp b/unittest/force-styles/test_angle_style.cpp index d9f541df96..e9f4a3f7fc 100644 --- a/unittest/force-styles/test_angle_style.cpp +++ b/unittest/force-styles/test_angle_style.cpp @@ -691,8 +691,8 @@ TEST(AngleStyle, extract) } auto angle = lmp->force->angle; - void *ptr = nullptr; - int dim = 0; + void *ptr = nullptr; + int dim = 0; for (auto extract : test_config.extract) { ptr = angle->extract(extract.first.c_str(), dim); EXPECT_NE(ptr, nullptr); diff --git a/unittest/force-styles/tests/bond-harmonic_restrain.yaml b/unittest/force-styles/tests/bond-harmonic_restrain.yaml index 1fd04b818e..07546775ab 100644 --- a/unittest/force-styles/tests/bond-harmonic_restrain.yaml +++ b/unittest/force-styles/tests/bond-harmonic_restrain.yaml @@ -1,6 +1,5 @@ --- lammps_version: 8 Feb 2023 -tags: generated date_generated: Tue Mar 7 21:07:27 2023 epsilon: 2.5e-13 skip_tests: extract From b6756c03194fbe26781f46bedc448a5d618825ca Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 9 Mar 2023 13:00:59 -0500 Subject: [PATCH 066/112] update docs about using data files --- doc/src/bond_harmonic_restrain.rst | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/src/bond_harmonic_restrain.rst b/doc/src/bond_harmonic_restrain.rst index d4c34ae622..c48e68917c 100644 --- a/doc/src/bond_harmonic_restrain.rst +++ b/doc/src/bond_harmonic_restrain.rst @@ -65,13 +65,18 @@ This bond style can only be used if LAMMPS was built with the EXTRA-MOLECULE package. See the :doc:`Build package ` page for more info. -This bond style does NOT write its coefficients to a data file since the -:math:`r_{t=0}` values are for individual bonds and not bond types. - -Since it uses :doc:`fix property/atom ` internally, -you should use the "nofix" argument to the :doc:`write_data command -` to avoid writing a section to the data file that cannot be -read back by the bond style. +This bond style uses :doc:`fix property/atom ` +internally to be able to determine the original bond lengths. This fix +will write its state to :doc:`data files `, but it is +currently not possible to read that stored data back with +:doc:`read_data ` for such an internally defined fix. You +are thus advised to use the "nofix" argument to the :doc:`write_data +command ` in order to avoid writing that section to the data +file that would cause an error when reading the data file. When +continuing from such a "nofix" data file, the reference bond lengths +will not be the original lengths but those of the current geometry. +Thus restarting is currently *only* possible with :doc:`binary restart +files `. This bond style cannot be used with :doc:`fix shake or fix rattle `, with :doc:`fix filter/corotate `, or From 53056f47edf5c0be533af5f771b8212d074edb82 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Thu, 9 Mar 2023 22:04:08 -0500 Subject: [PATCH 067/112] encode improper symmetries --- src/AMOEBA/improper_amoeba.cpp | 4 ++++ src/CLASS2/improper_class2.cpp | 4 ++++ src/EXTRA-MOLECULE/improper_cossq.cpp | 7 ++++++- src/EXTRA-MOLECULE/improper_distance.cpp | 7 ++++++- src/EXTRA-MOLECULE/improper_fourier.cpp | 8 +++++++- src/EXTRA-MOLECULE/improper_ring.cpp | 7 ++++++- src/MOFFF/improper_inversion_harmonic.cpp | 4 ++++ src/MOLECULE/improper_cvff.cpp | 4 ++++ src/MOLECULE/improper_harmonic.cpp | 4 ++++ src/MOLECULE/improper_umbrella.cpp | 5 +++++ src/YAFF/improper_distharm.cpp | 5 +++++ src/YAFF/improper_sqdistharm.cpp | 7 ++++++- src/improper.cpp | 1 + src/improper.h | 1 + 14 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/AMOEBA/improper_amoeba.cpp b/src/AMOEBA/improper_amoeba.cpp index cb9db01b59..32c31b0af9 100644 --- a/src/AMOEBA/improper_amoeba.cpp +++ b/src/AMOEBA/improper_amoeba.cpp @@ -36,6 +36,10 @@ using namespace MathConst; ImproperAmoeba::ImproperAmoeba(LAMMPS *lmp) : Improper(lmp) { writedata = 1; + + // the second atom in the quadruplet is the atom of symmetry + + symmatoms[1] = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index 6e6541919a..1e172757b0 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -39,6 +39,10 @@ using namespace MathConst; ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp) { writedata = 1; + + // the second atom in the quadruplet is the atom of symmetry + + symmatoms[1] = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-MOLECULE/improper_cossq.cpp b/src/EXTRA-MOLECULE/improper_cossq.cpp index d08c2afebe..bd21fa12e7 100644 --- a/src/EXTRA-MOLECULE/improper_cossq.cpp +++ b/src/EXTRA-MOLECULE/improper_cossq.cpp @@ -37,7 +37,12 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -ImproperCossq::ImproperCossq(LAMMPS *lmp) : Improper(lmp) {} +ImproperCossq::ImproperCossq(LAMMPS *lmp) : Improper(lmp) +{ + // the first atom in the quadruplet is the atom of symmetry + + symmatoms[0] = 1; +} /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-MOLECULE/improper_distance.cpp b/src/EXTRA-MOLECULE/improper_distance.cpp index b16e2cc674..18f6dd9a3f 100644 --- a/src/EXTRA-MOLECULE/improper_distance.cpp +++ b/src/EXTRA-MOLECULE/improper_distance.cpp @@ -35,7 +35,12 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ImproperDistance::ImproperDistance(LAMMPS *lmp) : Improper(lmp) {} +ImproperDistance::ImproperDistance(LAMMPS *lmp) : Improper(lmp) +{ + // the first atom in the quadruplet is the atom of symmetry + + symmatoms[0] = 1; +} /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-MOLECULE/improper_fourier.cpp b/src/EXTRA-MOLECULE/improper_fourier.cpp index 58f8677fd6..3eef060204 100644 --- a/src/EXTRA-MOLECULE/improper_fourier.cpp +++ b/src/EXTRA-MOLECULE/improper_fourier.cpp @@ -35,7 +35,13 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ImproperFourier::ImproperFourier(LAMMPS *lmp) : Improper(lmp) {} +ImproperFourier::ImproperFourier(LAMMPS *lmp) : Improper(lmp) +{ + // the first and fourth atoms in the quadruplet are the atoms of symmetry + + symmatoms[0] = 1; + symmatoms[3] = 1; +} /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-MOLECULE/improper_ring.cpp b/src/EXTRA-MOLECULE/improper_ring.cpp index ce3f16a696..36d6277e46 100644 --- a/src/EXTRA-MOLECULE/improper_ring.cpp +++ b/src/EXTRA-MOLECULE/improper_ring.cpp @@ -59,7 +59,12 @@ using namespace MathSpecial; /* ---------------------------------------------------------------------- */ -ImproperRing::ImproperRing(LAMMPS *lmp) : Improper(lmp) {} +ImproperRing::ImproperRing(LAMMPS *lmp) : Improper(lmp) +{ + // the second atom in the quadruplet is the atom of symmetry + + symmatoms[1] = 1; +} /* ---------------------------------------------------------------------- */ diff --git a/src/MOFFF/improper_inversion_harmonic.cpp b/src/MOFFF/improper_inversion_harmonic.cpp index 50ec3b0737..817b35332a 100644 --- a/src/MOFFF/improper_inversion_harmonic.cpp +++ b/src/MOFFF/improper_inversion_harmonic.cpp @@ -43,6 +43,10 @@ using namespace MathConst; ImproperInversionHarmonic::ImproperInversionHarmonic(LAMMPS *lmp) : Improper(lmp) { writedata = 1; + + // the first atom in the quadruplet is the atom of symmetry + + symmatoms[0] = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp index afe3bd9d73..ad8f709541 100644 --- a/src/MOLECULE/improper_cvff.cpp +++ b/src/MOLECULE/improper_cvff.cpp @@ -32,6 +32,10 @@ static constexpr double SMALL = 0.001; ImproperCvff::ImproperCvff(LAMMPS *_lmp) : Improper(_lmp) { writedata = 1; + + // the first atom in the quadruplet is the atom of symmetry + + symmatoms[0] = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp index d2cd505e68..06647fb93b 100644 --- a/src/MOLECULE/improper_harmonic.cpp +++ b/src/MOLECULE/improper_harmonic.cpp @@ -35,6 +35,10 @@ static constexpr double SMALL = 0.001; ImproperHarmonic::ImproperHarmonic(LAMMPS *_lmp) : Improper(_lmp) { writedata = 1; + + // the first atom in the quadruplet is the atom of symmetry + + symmatoms[0] = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp index fdf9870083..52bc692670 100644 --- a/src/MOLECULE/improper_umbrella.cpp +++ b/src/MOLECULE/improper_umbrella.cpp @@ -39,6 +39,11 @@ static constexpr double SMALL = 0.001; ImproperUmbrella::ImproperUmbrella(LAMMPS *_lmp) : Improper(_lmp) { writedata = 1; + + // the first and fourth atoms in the quadruplet are the atoms of symmetry + + symmatoms[0] = 1; + symmatoms[3] = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/YAFF/improper_distharm.cpp b/src/YAFF/improper_distharm.cpp index 3e67b6a436..92327bb996 100644 --- a/src/YAFF/improper_distharm.cpp +++ b/src/YAFF/improper_distharm.cpp @@ -37,6 +37,11 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ImproperDistHarm::ImproperDistHarm(LAMMPS *lmp) : Improper(lmp) {} +{ + // the fourth atom in the quadruplet is the atom of symmetry + + symmatoms[3] = 1; +} /* ---------------------------------------------------------------------- */ diff --git a/src/YAFF/improper_sqdistharm.cpp b/src/YAFF/improper_sqdistharm.cpp index 1b366c058f..1cd8515d9a 100644 --- a/src/YAFF/improper_sqdistharm.cpp +++ b/src/YAFF/improper_sqdistharm.cpp @@ -36,7 +36,12 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ImproperSQDistHarm::ImproperSQDistHarm(LAMMPS *lmp) : Improper(lmp) {} +ImproperSQDistHarm::ImproperSQDistHarm(LAMMPS *lmp) : Improper(lmp) +{ + // the fourth atom in the quadruplet is the atom of symmetry + + symmatoms[3] = 1; +} /* ---------------------------------------------------------------------- */ diff --git a/src/improper.cpp b/src/improper.cpp index b135dfbac8..dd4b1b2b25 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -30,6 +30,7 @@ Improper::Improper(LAMMPS *_lmp) : Pointers(_lmp) { energy = 0.0; writedata = 0; + for (int i = 0; i < 4; i++) symmatoms[i] = 0; allocated = 0; suffix_flag = Suffix::NONE; diff --git a/src/improper.h b/src/improper.h index 59302485e2..dfdfabae21 100644 --- a/src/improper.h +++ b/src/improper.h @@ -27,6 +27,7 @@ class Improper : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file int born_matrix_enable; + int symmatoms[4]; // symmetry atom(s) of improper style double energy; // accumulated energies double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom, **vatom; // accumulated per-atom energy/virial From 882df6ad237736df80d4da9759c7056ecc667bab Mon Sep 17 00:00:00 2001 From: jrgissing Date: Thu, 9 Mar 2023 22:08:03 -0500 Subject: [PATCH 068/112] typo --- src/YAFF/improper_distharm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/YAFF/improper_distharm.cpp b/src/YAFF/improper_distharm.cpp index 92327bb996..27516fa416 100644 --- a/src/YAFF/improper_distharm.cpp +++ b/src/YAFF/improper_distharm.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ImproperDistHarm::ImproperDistHarm(LAMMPS *lmp) : Improper(lmp) {} +ImproperDistHarm::ImproperDistHarm(LAMMPS *lmp) : Improper(lmp) { // the fourth atom in the quadruplet is the atom of symmetry From 416df96c1b132c1a6042b501e719020280e7f438 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 9 Mar 2023 17:53:03 -0500 Subject: [PATCH 069/112] add extract support for TIP4P parameters to cutoff versions --- src/MOLECULE/pair_lj_cut_tip4p_cut.cpp | 22 ++++++++++++------- src/MOLECULE/pair_tip4p_cut.cpp | 14 ++++++++++++ src/MOLECULE/pair_tip4p_cut.h | 1 + .../tests/mol-pair-lj_cut_tip4p_cut.yaml | 5 +++++ .../tests/mol-pair-tip4p_cut.yaml | 8 ++++++- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 19b4d6585f..5be1de82a9 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -18,20 +18,20 @@ #include "pair_lj_cut_tip4p_cut.h" -#include -#include -#include "atom.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "domain.h" #include "angle.h" +#include "atom.h" #include "bond.h" #include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" #include "math_const.h" #include "memory.h" -#include "error.h" +#include "neigh_list.h" +#include "neighbor.h" +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -743,12 +743,18 @@ void PairLJCutTIP4PCut::compute_newsite(double *xO, double *xH1, void *PairLJCutTIP4PCut::extract(const char *str, int &dim) { dim = 0; + if (strcmp(str,"qdist") == 0) return (void *) &qdist; + if (strcmp(str,"typeO") == 0) return (void *) &typeO; + if (strcmp(str,"typeH") == 0) return (void *) &typeH; + if (strcmp(str,"typeA") == 0) return (void *) &typeA; + if (strcmp(str,"typeB") == 0) return (void *) &typeB; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; return nullptr; } + /* ---------------------------------------------------------------------- memory usage of hneigh ------------------------------------------------------------------------- */ diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 25c9b82468..6d27c1a164 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -562,3 +562,17 @@ double PairTIP4PCut::memory_usage() bytes += (double)2 * nmax * sizeof(double); return bytes; } + +/* ---------------------------------------------------------------------- */ + +void *PairTIP4PCut::extract(const char *str, int &dim) +{ + dim = 0; + if (strcmp(str,"qdist") == 0) return (void *) &qdist; + if (strcmp(str,"typeO") == 0) return (void *) &typeO; + if (strcmp(str,"typeH") == 0) return (void *) &typeH; + if (strcmp(str,"typeA") == 0) return (void *) &typeA; + if (strcmp(str,"typeB") == 0) return (void *) &typeB; + if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; + return nullptr; +} diff --git a/src/MOLECULE/pair_tip4p_cut.h b/src/MOLECULE/pair_tip4p_cut.h index 85f9e4a72b..73dced7432 100644 --- a/src/MOLECULE/pair_tip4p_cut.h +++ b/src/MOLECULE/pair_tip4p_cut.h @@ -38,6 +38,7 @@ class PairTIP4PCut : public Pair { void write_restart(FILE *) override; void read_restart(FILE *) override; double memory_usage() override; + void *extract(const char *, int &) override; protected: double cut_coul_global; diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml index 36607e3a22..141d61f8ae 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml @@ -21,6 +21,11 @@ pair_coeff: ! | 4 4 0.015 3.1 5 5 0.015 3.1 extract: ! | + qdist 0 + typeO 0 + typeH 0 + typeA 0 + typeB 0 epsilon 2 sigma 2 cut_coul 0 diff --git a/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml b/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml index bcd16233b8..52fea193d5 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml @@ -15,7 +15,13 @@ input_file: in.fourmol pair_style: tip4p/cut 5 2 5 1 0.15 10.0 pair_coeff: ! | * * -extract: ! "" +extract: ! | + qdist 0 + typeO 0 + typeH 0 + typeA 0 + typeB 0 + cut_coul 0 natoms: 29 init_vdwl: 0 init_coul: -128.97793216803515 From 02854c1d5c09bfbd44c50890b97fae8fa2a61b35 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 9 Mar 2023 19:04:28 -0500 Subject: [PATCH 070/112] add compute dipole/tip4p and compute dipole/tip4p/chunk --- doc/src/Commands_compute.rst | 2 + doc/src/compute.rst | 2 + doc/src/compute_dipole.rst | 45 ++- doc/src/compute_dipole_chunk.rst | 47 ++- src/.gitignore | 4 + src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp | 219 +++++++++++ src/EXTRA-COMPUTE/compute_dipole_tip4p.h | 46 +++ .../compute_dipole_tip4p_chunk.cpp | 364 ++++++++++++++++++ .../compute_dipole_tip4p_chunk.h | 64 +++ 9 files changed, 764 insertions(+), 29 deletions(-) create mode 100644 src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp create mode 100644 src/EXTRA-COMPUTE/compute_dipole_tip4p.h create mode 100644 src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp create mode 100644 src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.h diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index c2753b2afc..f073212524 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -52,6 +52,8 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`dilatation/atom ` * :doc:`dipole ` * :doc:`dipole/chunk ` + * :doc:`dipole/tip4p ` + * :doc:`dipole/tip4p/chunk ` * :doc:`displace/atom ` * :doc:`dpd ` * :doc:`dpd/atom ` diff --git a/doc/src/compute.rst b/doc/src/compute.rst index 3d74b3884e..880f60a8a6 100644 --- a/doc/src/compute.rst +++ b/doc/src/compute.rst @@ -206,6 +206,8 @@ The individual style names on the :doc:`Commands compute ` pag * :doc:`dilatation/atom ` - Peridynamic dilatation for each atom * :doc:`dipole ` - dipole vector and total dipole * :doc:`dipole/chunk ` - dipole vector and total dipole for each chunk +* :doc:`dipole/tip4p ` - dipole vector and total dipole with TIP4P pair style +* :doc:`dipole/tip4p/chunk ` - dipole vector and total dipole for each chunk with TIP4P pair style * :doc:`displace/atom ` - displacement of each atom * :doc:`dpd ` - total values of internal conductive energy, internal mechanical energy, chemical energy, and harmonic average of internal temperature * :doc:`dpd/atom ` - per-particle values of internal conductive energy, internal mechanical energy, chemical energy, and internal temperature diff --git a/doc/src/compute_dipole.rst b/doc/src/compute_dipole.rst index 95c5e216f0..fa1ca4ce0b 100644 --- a/doc/src/compute_dipole.rst +++ b/doc/src/compute_dipole.rst @@ -1,6 +1,10 @@ .. index:: compute dipole +.. index:: compute dipole/tip4p compute dipole command +====================== + +compute dipole/tip4p command ============================ Syntax @@ -8,10 +12,10 @@ Syntax .. code-block:: LAMMPS - compute ID group-ID dipole arg + compute ID group-ID style arg * ID, group-ID are documented in :doc:`compute ` command -* dipole = style name of this compute command +* style = *dipole* or *dipole/tip4p* * arg = *mass* or *geometry* = use COM or geometric center for charged chunk correction (optional) Examples @@ -21,6 +25,7 @@ Examples compute 1 fluid dipole compute dw water dipole geometry + compute dw water dipole/tip4p Description """"""""""" @@ -28,13 +33,20 @@ Description Define a computation that calculates the dipole vector and total dipole for a group of atoms. -This compute calculates the x,y,z coordinates of the dipole vector -and the total dipole moment for the atoms in the compute group. -This includes all effects due to atoms passing through periodic boundaries. -For a group with a net charge the resulting dipole is made position independent -by subtracting the position vector of the center of mass or geometric center -times the net charge from the computed dipole vector. Both per-atom charges -and per-atom dipole moments, if present, contribute to the computed dipole. +These computes calculate the x,y,z coordinates of the dipole vector and +the total dipole moment for the atoms in the compute group. This +includes all effects due to atoms passing through periodic boundaries. +For a group with a net charge the resulting dipole is made position +independent by subtracting the position vector of the center of mass or +geometric center times the net charge from the computed dipole +vector. Both per-atom charges and per-atom dipole moments, if present, +contribute to the computed dipole. + +.. versionadded:: TBD + +Compute *dipole/tip4p* includes adjustments for the charge carrying +point M in molecules with TIP4P water geometry. The corresponding +parameters are extracted from the pair style. .. note:: @@ -49,10 +61,10 @@ and per-atom dipole moments, if present, contribute to the computed dipole. Output info """"""""""" -This compute calculations a global scalar containing the magnitude of -the computed dipole moment and a global vector of length 3 with the -dipole vector. See the :doc:`Howto output ` page for -an overview of LAMMPS output options. +These computes calculate a global scalar containing the magnitude of the +computed dipole moment and a global vector of length 3 with the dipole +vector. See the :doc:`Howto output ` page for an overview +of LAMMPS output options. The computed values are "intensive". The array values will be in dipole units (i.e., charge :doc:`units ` times distance @@ -60,7 +72,12 @@ dipole units (i.e., charge :doc:`units ` times distance Restrictions """""""""""" - none + +Compute style *dipole/tip4p* is part of the EXTRA-COMPUTE package. It is +only enabled if LAMMPS was built with that package. See the :doc:`Build +package ` page for more info. + +Compute style *dipole/tip4p* can only be used with tip4p pair styles. Related commands """""""""""""""" diff --git a/doc/src/compute_dipole_chunk.rst b/doc/src/compute_dipole_chunk.rst index 504e6f20d0..4e89bb748a 100644 --- a/doc/src/compute_dipole_chunk.rst +++ b/doc/src/compute_dipole_chunk.rst @@ -1,17 +1,21 @@ .. index:: compute dipole/chunk +.. index:: compute dipole/tip4p/chunk compute dipole/chunk command ============================ +compute dipole/tip4p/chunk command +================================== + Syntax """""" .. code-block:: LAMMPS - compute ID group-ID dipole/chunk chunkID arg + compute ID group-ID style chunkID arg * ID, group-ID are documented in :doc:`compute ` command -* dipole/chunk = style name of this compute command +* style = *dipole/chunk* or *dipole/tip4p/chunk* * chunkID = ID of :doc:`compute chunk/atom ` command * arg = *mass* or *geometry* = use COM or geometric center for charged chunk correction (optional) @@ -38,13 +42,20 @@ or atoms in a spatial bin. See the :doc:`compute chunk/atom details of how chunks can be defined and examples of how they can be used to measure properties of a system. -This compute calculates the :math:`(x,y,z)` coordinates of the dipole vector -and the total dipole moment for each chunk, which includes all effects due -to atoms passing through periodic boundaries. For chunks with a net -charge the resulting dipole is made position independent by subtracting -the position vector of the center of mass or geometric center times the -net charge from the computed dipole vector. Both per-atom charges and -per-atom dipole moments, if present, contribute to the computed dipole. +These computes calculate the :math:`(x,y,z)` coordinates of the dipole +vector and the total dipole moment for each chunk, which includes all +effects due to atoms passing through periodic boundaries. For chunks +with a net charge the resulting dipole is made position independent by +subtracting the position vector of the center of mass or geometric +center times the net charge from the computed dipole vector. Both +per-atom charges and per-atom dipole moments, if present, contribute to +the computed dipole. + +.. versionadded:: TBD + +Compute *dipole/tip4p/chunk* includes adjustments for the charge +carrying point M in molecules with TIP4P water geometry. The +corresponding parameters are extracted from the pair style. Note that only atoms in the specified group contribute to the calculation. The :doc:`compute chunk/atom ` command @@ -78,12 +89,12 @@ command, for example: Output info """"""""""" -This compute calculates a global array where the number of rows = the +These computes calculate a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute -chunk/atom ` command. The number of columns is 4 for -the :math:`(x,y,z)` dipole vector components and the total dipole of each -chunk. These values can be accessed by any command that uses global -array values from a compute as input. See the :doc:`Howto output +chunk/atom ` command. The number of columns is 4 +for the :math:`(x,y,z)` dipole vector components and the total dipole of +each chunk. These values can be accessed by any command that uses +global array values from a compute as input. See the :doc:`Howto output ` page for an overview of LAMMPS output options. The array values are "intensive". The array values will be in @@ -92,7 +103,13 @@ dipole units (i.e., charge :doc:`units ` times distance Restrictions """""""""""" - none + +Compute style *dipole/tip4p/chunk* is part of the EXTRA-COMPUTE +package. It is only enabled if LAMMPS was built with that package. See +the :doc:`Build package ` page for more info. + +Compute style *dipole/tip4p/chunk* can only be used with tip4p pair +styles. Related commands """""""""""""""" diff --git a/src/.gitignore b/src/.gitignore index df02ab3397..0e3a69bdc7 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -534,6 +534,10 @@ /compute_damage_atom.h /compute_dilatation_atom.cpp /compute_dilatation_atom.h +/compute_dipole_tip4p.cpp +/compute_dipole_tip4p.h +/compute_dipole_tip4p_chunk.cpp +/compute_dipole_tip4p_chunk.h /compute_dpd.cpp /compute_dpd.h /compute_dpd_atom.cpp diff --git a/src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp b/src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp new file mode 100644 index 0000000000..c81cd3787c --- /dev/null +++ b/src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp @@ -0,0 +1,219 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "compute_dipole_tip4p.h" + +#include "angle.h" +#include "atom.h" +#include "bond.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "pair.h" +#include "update.h" + +#include +#include + +using namespace LAMMPS_NS; + +enum { MASSCENTER, GEOMCENTER }; + +/* ---------------------------------------------------------------------- */ + +ComputeDipoleTIP4P::ComputeDipoleTIP4P(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) +{ + if ((narg < 3) || (narg > 4)) error->all(FLERR, "Illegal compute dipole command"); + + scalar_flag = 1; + vector_flag = 1; + size_vector = 3; + extscalar = 0; + extvector = 0; + + vector = new double[size_vector]; + vector[0] = vector[1] = vector[2] = 0.0; + usecenter = MASSCENTER; + + if (narg == 4) { + if (utils::strmatch(arg[3], "^geom")) + usecenter = GEOMCENTER; + else if (strcmp(arg[3], "mass") == 0) + usecenter = MASSCENTER; + else + error->all(FLERR, "Illegal compute dipole command"); + } +} + +/* ---------------------------------------------------------------------- */ + +ComputeDipoleTIP4P::~ComputeDipoleTIP4P() +{ + delete[] vector; +} + +/* ---------------------------------------------------------------------- */ + +void ComputeDipoleTIP4P::init() +{ + int itmp; + double *p_qdist = (double *) force->pair->extract("qdist", itmp); + int *p_typeO = (int *) force->pair->extract("typeO", itmp); + int *p_typeH = (int *) force->pair->extract("typeH", itmp); + int *p_typeA = (int *) force->pair->extract("typeA", itmp); + int *p_typeB = (int *) force->pair->extract("typeB", itmp); + if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB) + error->all(FLERR, "Pair style is incompatible with compute {}", style); + typeO = *p_typeO; + typeH = *p_typeH; + int typeA = *p_typeA; + int typeB = *p_typeB; + + if (force->angle == nullptr || force->bond == nullptr || force->angle->setflag == nullptr || + force->bond->setflag == nullptr) + error->all(FLERR, "Bond and angle potentials must be defined for compute {}", style); + if ((typeA < 1) || (typeA > atom->nangletypes) || (force->angle->setflag[typeA] == 0)) + error->all(FLERR, "Bad TIP4P angle type for compute {}", style); + if ((typeB < 1) || (typeB > atom->nbondtypes) || (force->bond->setflag[typeB] == 0)) + error->all(FLERR, "Bad TIP4P bond type for PPPM/TIP4P"); + double theta = force->angle->equilibrium_angle(typeA); + double blen = force->bond->equilibrium_distance(typeB); + alpha = *p_qdist / (cos(0.5 * theta) * blen); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeDipoleTIP4P::compute_vector() +{ + invoked_vector = update->ntimestep; + + const auto x = atom->x; + const auto mask = atom->mask; + const auto type = atom->type; + const auto image = atom->image; + const auto mass = atom->mass; + const auto rmass = atom->rmass; + const auto q = atom->q; + const auto mu = atom->mu; + const auto nlocal = atom->nlocal; + + double dipole[3] = {0.0, 0.0, 0.0}; + double comproc[3] = {0.0, 0.0, 0.0}; + double com[3] = {0.0, 0.0, 0.0}; + double masstotal = 0.0; + double chrgtotal = 0.0; + double massproc = 0.0; + double chrgproc = 0.0; + double unwrap[3], xM[3]; + double *xi; + + for (int i = 0; i < nlocal; ++i) { + if (mask[i] & groupbit) { + double massone = 1.0; // for usecenter == GEOMCENTER + if (usecenter == MASSCENTER) { + if (rmass) + massone = rmass[i]; + else + massone = mass[type[i]]; + } + massproc += massone; + if (atom->q_flag) chrgproc += q[i]; + domain->unmap(x[i], image[i], unwrap); + comproc[0] += unwrap[0] * massone; + comproc[1] += unwrap[1] * massone; + comproc[2] += unwrap[2] * massone; + } + } + MPI_Allreduce(&massproc, &masstotal, 1, MPI_DOUBLE, MPI_SUM, world); + MPI_Allreduce(&chrgproc, &chrgtotal, 1, MPI_DOUBLE, MPI_SUM, world); + MPI_Allreduce(comproc, com, 3, MPI_DOUBLE, MPI_SUM, world); + + if (masstotal > 0.0) { + com[0] /= masstotal; + com[1] /= masstotal; + com[2] /= masstotal; + } + + // compute dipole moment + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + if (type[i] == typeO) { + find_M(i,xM); + xi = xM; + } else { + xi = x[i]; + } + domain->unmap(xi, image[i], unwrap); + if (atom->q_flag) { + dipole[0] += q[i] * unwrap[0]; + dipole[1] += q[i] * unwrap[1]; + dipole[2] += q[i] * unwrap[2]; + } + if (atom->mu_flag) { + dipole[0] += mu[i][0]; + dipole[1] += mu[i][1]; + dipole[2] += mu[i][2]; + } + } + } + + MPI_Allreduce(dipole, vector, 3, MPI_DOUBLE, MPI_SUM, world); + + // correct for position dependence with a net charged group + vector[0] -= chrgtotal * com[0]; + vector[1] -= chrgtotal * com[1]; + vector[2] -= chrgtotal * com[2]; +} + +/* ---------------------------------------------------------------------- */ + +double ComputeDipoleTIP4P::compute_scalar() +{ + if (invoked_vector != update->ntimestep) compute_vector(); + + invoked_scalar = update->ntimestep; + scalar = sqrt(vector[0] * vector[0] + vector[1] * vector[1] + vector[2] * vector[2]); + return scalar; +} + +/* ---------------------------------------------------------------------- */ + +void ComputeDipoleTIP4P::find_M(int i, double *xM) +{ + double **x = atom->x; + + int iH1 = atom->map(atom->tag[i] + 1); + int iH2 = atom->map(atom->tag[i] + 2); + + if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR,"TIP4P hydrogen is missing"); + if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) + error->one(FLERR,"TIP4P hydrogen has incorrect atom type"); + + // set iH1,iH2 to index of closest image to O + + iH1 = domain->closest_image(i,iH1); + iH2 = domain->closest_image(i,iH2); + + double delx1 = x[iH1][0] - x[i][0]; + double dely1 = x[iH1][1] - x[i][1]; + double delz1 = x[iH1][2] - x[i][2]; + + double delx2 = x[iH2][0] - x[i][0]; + double dely2 = x[iH2][1] - x[i][1]; + double delz2 = x[iH2][2] - x[i][2]; + + xM[0] = x[i][0] + alpha * 0.5 * (delx1 + delx2); + xM[1] = x[i][1] + alpha * 0.5 * (dely1 + dely2); + xM[2] = x[i][2] + alpha * 0.5 * (delz1 + delz2); +} diff --git a/src/EXTRA-COMPUTE/compute_dipole_tip4p.h b/src/EXTRA-COMPUTE/compute_dipole_tip4p.h new file mode 100644 index 0000000000..75784b83ec --- /dev/null +++ b/src/EXTRA-COMPUTE/compute_dipole_tip4p.h @@ -0,0 +1,46 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS +// clang-format off +ComputeStyle(dipole/tip4p,ComputeDipoleTIP4P); +// clang-format on +#else + +#ifndef LMP_COMPUTE_DIPOLE_TIP4P_H +#define LMP_COMPUTE_DIPOLE_TIP4P_H + +#include "compute.h" + +namespace LAMMPS_NS { + +class ComputeDipoleTIP4P : public Compute { + public: + ComputeDipoleTIP4P(class LAMMPS *, int, char **); + ~ComputeDipoleTIP4P() override; + void init() override; + void compute_vector() override; + double compute_scalar() override; + + private: + int usecenter; + + int typeO, typeH; + double alpha; + void find_M(int i, double *xM); +}; + +} // namespace LAMMPS_NS + +#endif +#endif diff --git a/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp b/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp new file mode 100644 index 0000000000..92e0d6fab2 --- /dev/null +++ b/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp @@ -0,0 +1,364 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "compute_dipole_tip4p_chunk.h" + +#include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" +#include "compute_chunk_atom.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "pair.h" +#include "math_special.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace MathSpecial; + +enum { MASSCENTER, GEOMCENTER }; + +/* ---------------------------------------------------------------------- */ + +ComputeDipoleTIP4PChunk::ComputeDipoleTIP4PChunk(LAMMPS *lmp, int narg, char **arg) : + Compute(lmp, narg, arg), + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), chrgproc(nullptr), + chrgtotal(nullptr), com(nullptr), + comall(nullptr), dipole(nullptr), dipoleall(nullptr) +{ + if ((narg != 4) && (narg != 5)) + error->all(FLERR,"Illegal compute dipole/chunk command"); + + array_flag = 1; + size_array_cols = 4; + size_array_rows = 0; + size_array_rows_variable = 1; + extarray = 0; + + // ID of compute chunk/atom + + idchunk = utils::strdup(arg[3]); + + usecenter = MASSCENTER; + + if (narg == 5) { + if (strncmp(arg[4],"geom",4) == 0) usecenter = GEOMCENTER; + else if (strcmp(arg[4],"mass") == 0) usecenter = MASSCENTER; + else error->all(FLERR,"Illegal compute dipole/chunk command"); + } + + ComputeDipoleTIP4PChunk::init(); + + // chunk-based data + + nchunk = 1; + maxchunk = 0; + allocate(); +} + +/* ---------------------------------------------------------------------- */ + +ComputeDipoleTIP4PChunk::~ComputeDipoleTIP4PChunk() +{ + delete[] idchunk; + memory->destroy(massproc); + memory->destroy(masstotal); + memory->destroy(chrgproc); + memory->destroy(chrgtotal); + memory->destroy(com); + memory->destroy(comall); + memory->destroy(dipole); + memory->destroy(dipoleall); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::init() +{ + int icompute = modify->find_compute(idchunk); + if (icompute < 0) + error->all(FLERR,"Chunk/atom compute does not exist for compute dipole/chunk"); + cchunk = dynamic_cast(modify->compute[icompute]); + if (strcmp(cchunk->style,"chunk/atom") != 0) + error->all(FLERR,"Compute dipole/chunk does not use chunk/atom compute"); + + int itmp; + double *p_qdist = (double *) force->pair->extract("qdist", itmp); + int *p_typeO = (int *) force->pair->extract("typeO", itmp); + int *p_typeH = (int *) force->pair->extract("typeH", itmp); + int *p_typeA = (int *) force->pair->extract("typeA", itmp); + int *p_typeB = (int *) force->pair->extract("typeB", itmp); + if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB) + error->all(FLERR, "Pair style is incompatible with compute {}", style); + typeO = *p_typeO; + typeH = *p_typeH; + int typeA = *p_typeA; + int typeB = *p_typeB; + + if (force->angle == nullptr || force->bond == nullptr || force->angle->setflag == nullptr || + force->bond->setflag == nullptr) + error->all(FLERR, "Bond and angle potentials must be defined for compute {}", style); + if ((typeA < 1) || (typeA > atom->nangletypes) || (force->angle->setflag[typeA] == 0)) + error->all(FLERR, "Bad TIP4P angle type for compute {}", style); + if ((typeB < 1) || (typeB > atom->nbondtypes) || (force->bond->setflag[typeB] == 0)) + error->all(FLERR, "Bad TIP4P bond type for PPPM/TIP4P"); + double theta = force->angle->equilibrium_angle(typeA); + double blen = force->bond->equilibrium_distance(typeB); + alpha = *p_qdist / (cos(0.5 * theta) * blen); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::compute_array() +{ + int i,index; + double massone; + double unwrap[3]; + + invoked_array = update->ntimestep; + + // compute chunk/atom assigns atoms to chunk IDs + // extract ichunk index vector from compute + // ichunk = 1 to Nchunk for included atoms, 0 for excluded atoms + + nchunk = cchunk->setup_chunks(); + cchunk->compute_ichunk(); + int *ichunk = cchunk->ichunk; + + if (nchunk > maxchunk) allocate(); + size_array_rows = nchunk; + + // zero local per-chunk values + + for (i = 0; i < nchunk; i++) { + massproc[i] = chrgproc[i] = 0.0; + com[i][0] = com[i][1] = com[i][2] = 0.0; + dipole[i][0] = dipole[i][1] = dipole[i][2] = dipole[i][3] = 0.0; + } + + // compute COM for each chunk + + double **x = atom->x; + int *mask = atom->mask; + int *type = atom->type; + imageint *image = atom->image; + double *mass = atom->mass; + double *rmass = atom->rmass; + double *q = atom->q; + double **mu = atom->mu; + double xM[3]; + double *xi; + + int nlocal = atom->nlocal; + + for (i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + index = ichunk[i]-1; + if (index < 0) continue; + if (usecenter == MASSCENTER) { + if (rmass) massone = rmass[i]; + else massone = mass[type[i]]; + } else massone = 1.0; // usecenter == GEOMCENTER + domain->unmap(x[i],image[i],unwrap); + massproc[index] += massone; + if (atom->q_flag) chrgproc[index] += q[i]; + com[index][0] += unwrap[0] * massone; + com[index][1] += unwrap[1] * massone; + com[index][2] += unwrap[2] * massone; + } + + MPI_Allreduce(massproc,masstotal,nchunk,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(chrgproc,chrgtotal,nchunk,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world); + + for (i = 0; i < nchunk; i++) { + if (masstotal[i] > 0.0) { + comall[i][0] /= masstotal[i]; + comall[i][1] /= masstotal[i]; + comall[i][2] /= masstotal[i]; + } + } + + // compute dipole for each chunk + + for (i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + index = ichunk[i]-1; + if (index < 0) continue; + + if (type[i] == typeO) { + find_M(i,xM); + xi = xM; + } else { + xi = x[i]; + } + domain->unmap(xi,image[i],unwrap); + if (atom->q_flag) { + dipole[index][0] += q[i]*unwrap[0]; + dipole[index][1] += q[i]*unwrap[1]; + dipole[index][2] += q[i]*unwrap[2]; + } + if (atom->mu_flag) { + dipole[index][0] += mu[i][0]; + dipole[index][1] += mu[i][1]; + dipole[index][2] += mu[i][2]; + } + } + } + + MPI_Allreduce(&dipole[0][0],&dipoleall[0][0],4*nchunk,MPI_DOUBLE,MPI_SUM,world); + + for (i = 0; i < nchunk; i++) { + // correct for position dependence with charged chunks + dipoleall[i][0] -= chrgtotal[i]*comall[i][0]; + dipoleall[i][1] -= chrgtotal[i]*comall[i][1]; + dipoleall[i][2] -= chrgtotal[i]*comall[i][2]; + // compute total dipole moment + dipoleall[i][3] = sqrt(square(dipoleall[i][0]) + + square(dipoleall[i][1]) + + square(dipoleall[i][2])); + } +} + +/* ---------------------------------------------------------------------- + lock methods: called by fix ave/time + these methods ensure vector/array size is locked for Nfreq epoch + by passing lock info along to compute chunk/atom +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + increment lock counter +------------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::lock_enable() +{ + cchunk->lockcount++; +} + +/* ---------------------------------------------------------------------- + decrement lock counter in compute chunk/atom, it if still exists +------------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::lock_disable() +{ + int icompute = modify->find_compute(idchunk); + if (icompute >= 0) { + cchunk = dynamic_cast(modify->compute[icompute]); + cchunk->lockcount--; + } +} + +/* ---------------------------------------------------------------------- + calculate and return # of chunks = length of vector/array +------------------------------------------------------------------------- */ + +int ComputeDipoleTIP4PChunk::lock_length() +{ + nchunk = cchunk->setup_chunks(); + return nchunk; +} + +/* ---------------------------------------------------------------------- + set the lock from startstep to stopstep +------------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::lock(Fix *fixptr, bigint startstep, bigint stopstep) +{ + cchunk->lock(fixptr,startstep,stopstep); +} + +/* ---------------------------------------------------------------------- + unset the lock +------------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::unlock(Fix *fixptr) +{ + cchunk->unlock(fixptr); +} + +/* ---------------------------------------------------------------------- + free and reallocate per-chunk arrays +------------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::allocate() +{ + memory->destroy(massproc); + memory->destroy(masstotal); + memory->destroy(chrgproc); + memory->destroy(chrgtotal); + memory->destroy(com); + memory->destroy(comall); + memory->destroy(dipole); + memory->destroy(dipoleall); + maxchunk = nchunk; + memory->create(massproc,maxchunk,"dipole/chunk:massproc"); + memory->create(masstotal,maxchunk,"dipole/chunk:masstotal"); + memory->create(chrgproc,maxchunk,"dipole/chunk:chrgproc"); + memory->create(chrgtotal,maxchunk,"dipole/chunk:chrgtotal"); + memory->create(com,maxchunk,3,"dipole/chunk:com"); + memory->create(comall,maxchunk,3,"dipole/chunk:comall"); + memory->create(dipole,maxchunk,4,"dipole/chunk:dipole"); + memory->create(dipoleall,maxchunk,4,"dipole/chunk:dipoleall"); + array = dipoleall; +} + +/* ---------------------------------------------------------------------- + memory usage of local data +------------------------------------------------------------------------- */ + +double ComputeDipoleTIP4PChunk::memory_usage() +{ + double bytes = (bigint) maxchunk * 2 * sizeof(double); + bytes += (double)maxchunk * 2*3 * sizeof(double); + bytes += (double)maxchunk * 2*4 * sizeof(double); + return bytes; +} + +/* ---------------------------------------------------------------------- */ + +void ComputeDipoleTIP4PChunk::find_M(int i, double *xM) +{ + double **x = atom->x; + + int iH1 = atom->map(atom->tag[i] + 1); + int iH2 = atom->map(atom->tag[i] + 2); + + if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR,"TIP4P hydrogen is missing"); + if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) + error->one(FLERR,"TIP4P hydrogen has incorrect atom type"); + + // set iH1,iH2 to index of closest image to O + + iH1 = domain->closest_image(i,iH1); + iH2 = domain->closest_image(i,iH2); + + double delx1 = x[iH1][0] - x[i][0]; + double dely1 = x[iH1][1] - x[i][1]; + double delz1 = x[iH1][2] - x[i][2]; + + double delx2 = x[iH2][0] - x[i][0]; + double dely2 = x[iH2][1] - x[i][1]; + double delz2 = x[iH2][2] - x[i][2]; + + xM[0] = x[i][0] + alpha * 0.5 * (delx1 + delx2); + xM[1] = x[i][1] + alpha * 0.5 * (dely1 + dely2); + xM[2] = x[i][2] + alpha * 0.5 * (delz1 + delz2); +} diff --git a/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.h b/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.h new file mode 100644 index 0000000000..63d6e8401e --- /dev/null +++ b/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.h @@ -0,0 +1,64 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS +// clang-format off +ComputeStyle(dipole/tip4p/chunk,ComputeDipoleTIP4PChunk); +// clang-format on +#else + +#ifndef LMP_COMPUTE_DIPOLE_TIP4P_CHUNK_H +#define LMP_COMPUTE_DIPOLE_TIP4P_CHUNK_H + +#include "compute.h" + +namespace LAMMPS_NS { +class Fix; + +class ComputeDipoleTIP4PChunk : public Compute { + public: + ComputeDipoleTIP4PChunk(class LAMMPS *, int, char **); + ~ComputeDipoleTIP4PChunk() override; + void init() override; + void compute_array() override; + + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(Fix *, bigint, bigint) override; + void unlock(Fix *) override; + + double memory_usage() override; + + private: + int nchunk, maxchunk; + char *idchunk; + class ComputeChunkAtom *cchunk; + + double *massproc, *masstotal; + double *chrgproc, *chrgtotal; + double **com, **comall; + double **dipole, **dipoleall; + int usecenter; + + int typeO, typeH; + double alpha; + void find_M(int i, double *xM); + + void allocate(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif From 2a6515f765acdcebefe7ce96a9a3acd255354a1d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 9 Mar 2023 21:38:13 -0500 Subject: [PATCH 071/112] use consistent names in error messages --- src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp | 27 +++++++------- .../compute_dipole_tip4p_chunk.cpp | 37 ++++++++++--------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp b/src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp index c81cd3787c..f57fe6a9fb 100644 --- a/src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp +++ b/src/EXTRA-COMPUTE/compute_dipole_tip4p.cpp @@ -33,7 +33,7 @@ enum { MASSCENTER, GEOMCENTER }; ComputeDipoleTIP4P::ComputeDipoleTIP4P(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if ((narg < 3) || (narg > 4)) error->all(FLERR, "Illegal compute dipole command"); + if ((narg < 3) || (narg > 4)) error->all(FLERR, "Illegal compute dipole/tip4p command"); scalar_flag = 1; vector_flag = 1; @@ -51,7 +51,7 @@ ComputeDipoleTIP4P::ComputeDipoleTIP4P(LAMMPS *lmp, int narg, char **arg) : Comp else if (strcmp(arg[3], "mass") == 0) usecenter = MASSCENTER; else - error->all(FLERR, "Illegal compute dipole command"); + error->all(FLERR, "Illegal compute dipole/tip4p command"); } } @@ -66,6 +66,8 @@ ComputeDipoleTIP4P::~ComputeDipoleTIP4P() void ComputeDipoleTIP4P::init() { + if (!force->pair) error->all(FLERR, "Pair style must be defined for compute dipole/ti4p"); + int itmp; double *p_qdist = (double *) force->pair->extract("qdist", itmp); int *p_typeO = (int *) force->pair->extract("typeO", itmp); @@ -73,19 +75,18 @@ void ComputeDipoleTIP4P::init() int *p_typeA = (int *) force->pair->extract("typeA", itmp); int *p_typeB = (int *) force->pair->extract("typeB", itmp); if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB) - error->all(FLERR, "Pair style is incompatible with compute {}", style); + error->all(FLERR, "Pair style is incompatible with compute dipole/tip4p"); typeO = *p_typeO; typeH = *p_typeH; int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == nullptr || force->bond == nullptr || force->angle->setflag == nullptr || - force->bond->setflag == nullptr) - error->all(FLERR, "Bond and angle potentials must be defined for compute {}", style); + if (!force->angle || !force->bond || !force->angle->setflag || !force->bond->setflag) + error->all(FLERR, "Bond and angle potentials must be defined for compute dipole/tip4p"); if ((typeA < 1) || (typeA > atom->nangletypes) || (force->angle->setflag[typeA] == 0)) - error->all(FLERR, "Bad TIP4P angle type for compute {}", style); + error->all(FLERR, "Bad TIP4P angle type for compute dipole/tip4p"); if ((typeB < 1) || (typeB > atom->nbondtypes) || (force->bond->setflag[typeB] == 0)) - error->all(FLERR, "Bad TIP4P bond type for PPPM/TIP4P"); + error->all(FLERR, "Bad TIP4P bond type for compute dipole/tip4p"); double theta = force->angle->equilibrium_angle(typeA); double blen = force->bond->equilibrium_distance(typeB); alpha = *p_qdist / (cos(0.5 * theta) * blen); @@ -149,7 +150,7 @@ void ComputeDipoleTIP4P::compute_vector() for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (type[i] == typeO) { - find_M(i,xM); + find_M(i, xM); xi = xM; } else { xi = x[i]; @@ -196,14 +197,14 @@ void ComputeDipoleTIP4P::find_M(int i, double *xM) int iH1 = atom->map(atom->tag[i] + 1); int iH2 = atom->map(atom->tag[i] + 2); - if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR,"TIP4P hydrogen is missing"); + if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR, "TIP4P hydrogen is missing"); if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) - error->one(FLERR,"TIP4P hydrogen has incorrect atom type"); + error->one(FLERR, "TIP4P hydrogen has incorrect atom type"); // set iH1,iH2 to index of closest image to O - iH1 = domain->closest_image(i,iH1); - iH2 = domain->closest_image(i,iH2); + iH1 = domain->closest_image(i, iH1); + iH2 = domain->closest_image(i, iH2); double delx1 = x[iH1][0] - x[i][0]; double dely1 = x[iH1][1] - x[i][1]; diff --git a/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp b/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp index 92e0d6fab2..651811bba5 100644 --- a/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp +++ b/src/EXTRA-COMPUTE/compute_dipole_tip4p_chunk.cpp @@ -45,7 +45,7 @@ ComputeDipoleTIP4PChunk::ComputeDipoleTIP4PChunk(LAMMPS *lmp, int narg, char **a comall(nullptr), dipole(nullptr), dipoleall(nullptr) { if ((narg != 4) && (narg != 5)) - error->all(FLERR,"Illegal compute dipole/chunk command"); + error->all(FLERR,"Illegal compute dipole/tip4p/chunk command"); array_flag = 1; size_array_cols = 4; @@ -62,7 +62,7 @@ ComputeDipoleTIP4PChunk::ComputeDipoleTIP4PChunk(LAMMPS *lmp, int narg, char **a if (narg == 5) { if (strncmp(arg[4],"geom",4) == 0) usecenter = GEOMCENTER; else if (strcmp(arg[4],"mass") == 0) usecenter = MASSCENTER; - else error->all(FLERR,"Illegal compute dipole/chunk command"); + else error->all(FLERR,"Illegal compute dipole/tip4p/chunk command"); } ComputeDipoleTIP4PChunk::init(); @@ -95,10 +95,12 @@ void ComputeDipoleTIP4PChunk::init() { int icompute = modify->find_compute(idchunk); if (icompute < 0) - error->all(FLERR,"Chunk/atom compute does not exist for compute dipole/chunk"); + error->all(FLERR,"Chunk/atom compute does not exist for compute dipole/tip4p/chunk"); cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) - error->all(FLERR,"Compute dipole/chunk does not use chunk/atom compute"); + error->all(FLERR,"Compute dipole/tip4p/chunk does not use chunk/atom compute"); + + if (!force->pair) error->all(FLERR, "Pair style must be defined for compute dipole/tip4p/chunk"); int itmp; double *p_qdist = (double *) force->pair->extract("qdist", itmp); @@ -107,19 +109,18 @@ void ComputeDipoleTIP4PChunk::init() int *p_typeA = (int *) force->pair->extract("typeA", itmp); int *p_typeB = (int *) force->pair->extract("typeB", itmp); if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB) - error->all(FLERR, "Pair style is incompatible with compute {}", style); + error->all(FLERR, "Pair style is incompatible with compute dipole/tip4p/chunk"); typeO = *p_typeO; typeH = *p_typeH; int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == nullptr || force->bond == nullptr || force->angle->setflag == nullptr || - force->bond->setflag == nullptr) - error->all(FLERR, "Bond and angle potentials must be defined for compute {}", style); + if (!force->angle || !force->bond || !force->angle->setflag || !force->bond->setflag) + error->all(FLERR, "Bond and angle potentials must be defined for compute dipole/tip4p/chunk"); if ((typeA < 1) || (typeA > atom->nangletypes) || (force->angle->setflag[typeA] == 0)) - error->all(FLERR, "Bad TIP4P angle type for compute {}", style); + error->all(FLERR, "Bad TIP4P angle type for compute dipole/tip4p/chunk"); if ((typeB < 1) || (typeB > atom->nbondtypes) || (force->bond->setflag[typeB] == 0)) - error->all(FLERR, "Bad TIP4P bond type for PPPM/TIP4P"); + error->all(FLERR, "Bad TIP4P bond type for compute dipole/tip4p/chunk"); double theta = force->angle->equilibrium_angle(typeA); double blen = force->bond->equilibrium_distance(typeB); alpha = *p_qdist / (cos(0.5 * theta) * blen); @@ -309,14 +310,14 @@ void ComputeDipoleTIP4PChunk::allocate() memory->destroy(dipole); memory->destroy(dipoleall); maxchunk = nchunk; - memory->create(massproc,maxchunk,"dipole/chunk:massproc"); - memory->create(masstotal,maxchunk,"dipole/chunk:masstotal"); - memory->create(chrgproc,maxchunk,"dipole/chunk:chrgproc"); - memory->create(chrgtotal,maxchunk,"dipole/chunk:chrgtotal"); - memory->create(com,maxchunk,3,"dipole/chunk:com"); - memory->create(comall,maxchunk,3,"dipole/chunk:comall"); - memory->create(dipole,maxchunk,4,"dipole/chunk:dipole"); - memory->create(dipoleall,maxchunk,4,"dipole/chunk:dipoleall"); + memory->create(massproc,maxchunk,"dipole/tip4p/chunk:massproc"); + memory->create(masstotal,maxchunk,"dipole/tip4p/chunk:masstotal"); + memory->create(chrgproc,maxchunk,"dipole/tip4p/chunk:chrgproc"); + memory->create(chrgtotal,maxchunk,"dipole/tip4p/chunk:chrgtotal"); + memory->create(com,maxchunk,3,"dipole/tip4p/chunk:com"); + memory->create(comall,maxchunk,3,"dipole/tip4p/chunk:comall"); + memory->create(dipole,maxchunk,4,"dipole/tip4p/chunk:dipole"); + memory->create(dipoleall,maxchunk,4,"dipole/tip4p/chunk:dipoleall"); array = dipoleall; } From b5804b320c202a5fa71302235c69b55888219a0f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 10 Mar 2023 11:13:01 -0500 Subject: [PATCH 072/112] update/improve/correct error messages in fix efield and make compatible with derived class --- src/fix_efield.cpp | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp index 3514ad1c34..99482f8459 100644 --- a/src/fix_efield.cpp +++ b/src/fix_efield.cpp @@ -42,7 +42,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), idregion(nullptr), region(nullptr), efield(nullptr) { - if (narg < 6) utils::missing_cmd_args(FLERR, "fix efield", error); + if (narg < 6) utils::missing_cmd_args(FLERR, std::string("fix ")+style, error); dynamic_group_allow = 1; vector_flag = 1; @@ -85,20 +85,21 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : int iarg = 6; while (iarg < narg) { if (strcmp(arg[iarg], "region") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "fix efield region", error); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, std::string("fix ") + style + " region", error); region = domain->get_region_by_id(arg[iarg + 1]); if (!region) error->all(FLERR, "Region {} for fix efield does not exist", arg[iarg + 1]); idregion = utils::strdup(arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "energy") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "fix efield energy", error); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, std::string("fix ") + style + "energy", error); if (utils::strmatch(arg[iarg + 1], "^v_")) { estr = utils::strdup(arg[iarg + 1] + 2); } else - error->all(FLERR, "Illegal fix efield energy value argument"); + error->all(FLERR, "Unsupported argument for fix {} energy command: {}", style, arg[iarg]); iarg += 2; - } else - error->all(FLERR, "Unknown fix efield keyword: {}", arg[iarg]); + } else { + error->all(FLERR, "Unknown keyword for fix {} command: {}", style, arg[iarg]); + } } force_flag = 0; @@ -140,47 +141,47 @@ void FixEfield::init() qflag = muflag = 0; if (atom->q_flag) qflag = 1; if (atom->mu_flag && atom->torque_flag) muflag = 1; - if (!qflag && !muflag) error->all(FLERR, "Fix efield requires atom attribute q or mu"); + if (!qflag && !muflag) error->all(FLERR, "Fix {} requires atom attribute q or mu", style); // check variables if (xstr) { xvar = input->variable->find(xstr); - if (xvar < 0) error->all(FLERR, "Variable {} for fix efield does not exist", xstr); + if (xvar < 0) error->all(FLERR, "Variable {} for fix {} does not exist", xstr, style); if (input->variable->equalstyle(xvar)) xstyle = EQUAL; else if (input->variable->atomstyle(xvar)) xstyle = ATOM; else - error->all(FLERR, "Variable {} for fix efield is invalid style", xstr); + error->all(FLERR, "Variable {} for fix {} is invalid style", xstr, style); } if (ystr) { yvar = input->variable->find(ystr); - if (yvar < 0) error->all(FLERR, "Variable {} for fix efield does not exist", ystr); + if (yvar < 0) error->all(FLERR, "Variable {} for fix {} does not exist", ystr, style); if (input->variable->equalstyle(yvar)) ystyle = EQUAL; else if (input->variable->atomstyle(yvar)) ystyle = ATOM; else - error->all(FLERR, "Variable {} for fix efield is invalid style", ystr); + error->all(FLERR, "Variable {} for fix {} is invalid style", ystr, style); } if (zstr) { zvar = input->variable->find(zstr); - if (zvar < 0) error->all(FLERR, "Variable {} for fix efield does not exist", zstr); + if (zvar < 0) error->all(FLERR, "Variable {} for fix {} does not exist", zstr, style); if (input->variable->equalstyle(zvar)) zstyle = EQUAL; else if (input->variable->atomstyle(zvar)) zstyle = ATOM; else - error->all(FLERR, "Variable {} for fix efield is invalid style", zstr); + error->all(FLERR, "Variable {} for fix {} is invalid style", zstr, style); } if (estr) { evar = input->variable->find(estr); - if (evar < 0) error->all(FLERR, "Variable {} for fix efield does not exist", estr); + if (evar < 0) error->all(FLERR, "Variable {} for fix {} does not exist", estr, style); if (input->variable->atomstyle(evar)) estyle = ATOM; else - error->all(FLERR, "Variable {} for fix efield is invalid style", estr); + error->all(FLERR, "Variable {} for fix {} is invalid style", estr, style); } else estyle = NONE; @@ -188,7 +189,7 @@ void FixEfield::init() if (idregion) { region = domain->get_region_by_id(idregion); - if (!region) error->all(FLERR, "Region {} for fix efield does not exist", idregion); + if (!region) error->all(FLERR, "Region {} for fix {} does not exist", idregion, style); } if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM) @@ -199,15 +200,15 @@ void FixEfield::init() varflag = CONSTANT; if (muflag && varflag == ATOM) - error->all(FLERR, "Fix efield with dipoles cannot use atom-style variables"); + error->all(FLERR, "Fix {} with dipoles cannot use atom-style variables", style); if (muflag && update->whichflag == 2 && comm->me == 0) - error->warning(FLERR, "The minimizer does not re-orient dipoles when using fix efield"); + error->warning(FLERR, "The minimizer does not re-orient dipoles when using fix {}", style); if (varflag == CONSTANT && estyle != NONE) - error->all(FLERR, "Cannot use variable energy with constant efield in fix efield"); + error->all(FLERR, "Cannot use variable energy with constant efield in fix {}", style); if ((varflag == EQUAL || varflag == ATOM) && update->whichflag == 2 && estyle == NONE) - error->all(FLERR, "Must use variable energy with fix efield"); + error->all(FLERR, "Must use variable energy with fix {}", style); if (utils::strmatch(update->integrate_style, "^respa")) { ilevel_respa = (dynamic_cast(update->integrate))->nlevels - 1; @@ -254,7 +255,7 @@ void FixEfield::post_force(int vflag) // reallocate efield array if necessary - if (varflag == ATOM && atom->nmax > maxatom) { + if ((varflag == ATOM) && (atom->nmax > maxatom)) { maxatom = atom->nmax; memory->destroy(efield); memory->create(efield, maxatom, 4, "efield:efield"); From 2de3f4d261e162df6afe66388a22d9fcd1e5de08 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 10 Mar 2023 12:32:26 -0500 Subject: [PATCH 073/112] implementation for fix efield/tip4p for static field (untested) --- src/EXTRA-FIX/fix_efield_tip4p.cpp | 342 +++++++++++++++++++++++++++++ src/EXTRA-FIX/fix_efield_tip4p.h | 43 ++++ src/fix_efield.h | 2 - 3 files changed, 385 insertions(+), 2 deletions(-) create mode 100644 src/EXTRA-FIX/fix_efield_tip4p.cpp create mode 100644 src/EXTRA-FIX/fix_efield_tip4p.h diff --git a/src/EXTRA-FIX/fix_efield_tip4p.cpp b/src/EXTRA-FIX/fix_efield_tip4p.cpp new file mode 100644 index 0000000000..c5ecc313ec --- /dev/null +++ b/src/EXTRA-FIX/fix_efield_tip4p.cpp @@ -0,0 +1,342 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "fix_efield_tip4p.h" + +#include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "pair.h" +#include "region.h" +#include "respa.h" +#include "update.h" +#include "variable.h" + +#include + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixEfieldTIP4P::FixEfieldTIP4P(LAMMPS *_lmp, int narg, char **arg) : FixEfield(_lmp, narg, arg) {} + +/* ---------------------------------------------------------------------- */ + +void FixEfieldTIP4P::init() +{ + FixEfield::init(); + + if (atom->tag_enable == 0) error->all(FLERR, "Fix efield/tip4p requires atom IDs"); + if (!atom->q_flag) error->all(FLERR, "Fix efield/tip4p requires atom attribute q"); + + int itmp; + double *p_qdist = (double *) force->pair->extract("qdist", itmp); + int *p_typeO = (int *) force->pair->extract("typeO", itmp); + int *p_typeH = (int *) force->pair->extract("typeH", itmp); + int *p_typeA = (int *) force->pair->extract("typeA", itmp); + int *p_typeB = (int *) force->pair->extract("typeB", itmp); + if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB) + error->all(FLERR, "Pair style is incompatible with compute {}", style); + typeO = *p_typeO; + typeH = *p_typeH; + int typeA = *p_typeA; + int typeB = *p_typeB; + + if (force->angle == nullptr || force->bond == nullptr || force->angle->setflag == nullptr || + force->bond->setflag == nullptr) + error->all(FLERR, "Bond and angle potentials must be defined for compute {}", style); + if ((typeA < 1) || (typeA > atom->nangletypes) || (force->angle->setflag[typeA] == 0)) + error->all(FLERR, "Bad TIP4P angle type for compute {}", style); + if ((typeB < 1) || (typeB > atom->nbondtypes) || (force->bond->setflag[typeB] == 0)) + error->all(FLERR, "Bad TIP4P bond type for PPPM/TIP4P"); + + // determine alpha parameter + + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); + alpha = *p_qdist / (cos(0.5 * theta) * blen); +} + +/* ---------------------------------------------------------------------- + apply F = qE +------------------------------------------------------------------------- */ + +void FixEfieldTIP4P::post_force(int vflag) +{ + double **f = atom->f; + double *q = atom->q; + tagint *tag = atom->tag; + int *type = atom->type; + int *mask = atom->mask; + imageint *image = atom->image; + int nlocal = atom->nlocal; + + // virial setup + + v_init(vflag); + + // reallocate efield array if necessary + + if ((varflag == ATOM) && (atom->nmax > maxatom)) { + maxatom = atom->nmax; + memory->destroy(efield); + memory->create(efield, maxatom, 4, "efield:efield"); + } + + // update region if necessary + + if (region) region->prematch(); + + // fsum[0] = "potential energy" for added force + // fsum[123] = extra force added to atoms + + fsum[0] = fsum[1] = fsum[2] = fsum[3] = 0.0; + force_flag = 0; + + double **x = atom->x; + double fx, fy, fz, xM[3]; + double v[6]; + int iO, iH1, iH2; + + // constant efield + + if (varflag == CONSTANT) { + double unwrap[3]; + + // charge interactions + // force = qE, potential energy = F dot x in unwrapped coords + + if (qflag) { + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + // this is an atom belonging to a TIP4P molecule + + if ((type[i] == typeO) || (type[i] == typeH)) { + + if (type[i] == typeO) { + iO = i; + iH1 = atom->map(tag[i] + 1); + iH2 = atom->map(tag[i] + 2); + } else { + // set indices for first or second hydrogen + iO = atom->map(tag[i] - 1); + if ((iO != -1) && (type[iO] == typeO)) { + iH1 = i; + iH2 = atom->map(tag[i] + 1); + } else { + iO = atom->map(tag[i] - 2); + iH1 = atom->map(tag[i] - 1); + iH2 = i; + } + } + if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR, "TIP4P hydrogen is missing"); + if (iO == -1) error->one(FLERR, "TIP4P oxygen is missing"); + if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) + error->one(FLERR, "TIP4P hydrogen has incorrect atom type"); + if (atom->type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); + + find_M(x[iO], x[iH1], x[iH2], xM); + if (region && !region->match(xM[0], xM[1], xM[2])) continue; + + fx = q[iO] * ex; + fy = q[iO] * ey; + fz = q[iO] * ez; + + // distribute and apply forces, but only to local atoms + if (iO < nlocal) { + f[iO][0] += fx * (1.0 - alpha); + f[iO][1] += fy * (1.0 - alpha); + f[iO][2] += fz * (1.0 - alpha); + } + if (iH1 < nlocal) { + f[iH1][0] += 0.5 * alpha * fx; + f[iH1][1] += 0.5 * alpha * fy; + f[iH1][2] += 0.5 * alpha * fz; + } + if (iH2 < nlocal) { + f[iH2][0] += 0.5 * alpha * fx; + f[iH2][1] += 0.5 * alpha * fy; + f[iH2][2] += 0.5 * alpha * fz; + } + + domain->unmap(xM, image[i], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + + // tally virial contribution with Oxygen + if (evflag && (iO < nlocal)) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iO, v); + } + + } else { + + if (region && !region->match(x[i][0], x[i][1], x[i][2])) continue; + fx = q[i] * ex; + fy = q[i] * ey; + fz = q[i] * ez; + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + + domain->unmap(x[i], image[i], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + if (evflag) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(i, v); + } + } + } + } + } + + // dipole interactions + // no force, torque = mu cross E, potential energy = -mu dot E + + if (muflag) { + double **mu = atom->mu; + double **t = atom->torque; + double tx, ty, tz; + 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; + tx = ez * mu[i][1] - ey * mu[i][2]; + ty = ex * mu[i][2] - ez * mu[i][0]; + tz = ey * mu[i][0] - ex * mu[i][1]; + t[i][0] += tx; + t[i][1] += ty; + t[i][2] += tz; + fsum[0] -= mu[i][0] * ex + mu[i][1] * ey + mu[i][2] * ez; + } + } + + // variable efield, wrap with clear/add + // potential energy = evar if defined, else 0.0 + + } else { + + modify->clearstep_compute(); + + if (xstyle == EQUAL) { + ex = qe2f * input->variable->compute_equal(xvar); + } else if (xstyle == ATOM) { + input->variable->compute_atom(xvar, igroup, &efield[0][0], 4, 0); + } + if (ystyle == EQUAL) { + ey = qe2f * input->variable->compute_equal(yvar); + } else if (ystyle == ATOM) { + input->variable->compute_atom(yvar, igroup, &efield[0][1], 4, 0); + } + if (zstyle == EQUAL) { + ez = qe2f * input->variable->compute_equal(zvar); + } else if (zstyle == ATOM) { + input->variable->compute_atom(zvar, igroup, &efield[0][2], 4, 0); + } + if (estyle == ATOM) input->variable->compute_atom(evar, igroup, &efield[0][3], 4, 0); + + modify->addstep_compute(update->ntimestep + 1); + + // charge interactions + // force = qE + + if (qflag) { + 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; + if (xstyle == ATOM) { + fx = qe2f * q[i] * efield[i][0]; + } else { + fx = q[i] * ex; + } + f[i][0] += fx; + fsum[1] += fx; + if (ystyle == ATOM) { + fy = qe2f * q[i] * efield[i][1]; + } else { + fy = q[i] * ey; + } + f[i][1] += fy; + fsum[2] += fy; + if (zstyle == ATOM) { + fz = qe2f * q[i] * efield[i][2]; + } else { + fz = q[i] * ez; + } + f[i][2] += fz; + fsum[3] += fz; + if (estyle == ATOM) fsum[0] += efield[0][3]; + } + } + } + + // dipole interactions + // no force, torque = mu cross E + + if (muflag) { + double **mu = atom->mu; + double **t = atom->torque; + double tx, ty, tz; + 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; + tx = ez * mu[i][1] - ey * mu[i][2]; + ty = ex * mu[i][2] - ez * mu[i][0]; + tz = ey * mu[i][0] - ex * mu[i][1]; + t[i][0] += tx; + t[i][1] += ty; + t[i][2] += tz; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixEfieldTIP4P::find_M(double *xO, double *xH1, double *xH2, double *xM) +{ + double delx1 = xH1[0] - xO[0]; + double dely1 = xH1[1] - xO[1]; + double delz1 = xH1[2] - xO[2]; + + double delx2 = xH2[0] - xO[0]; + double dely2 = xH2[1] - xO[1]; + double delz2 = xH2[2] - xO[2]; + + xM[0] = xO[0] + alpha * 0.5 * (delx1 + delx2); + xM[1] = xO[1] + alpha * 0.5 * (dely1 + dely2); + xM[2] = xO[2] + alpha * 0.5 * (delz1 + delz2); +} diff --git a/src/EXTRA-FIX/fix_efield_tip4p.h b/src/EXTRA-FIX/fix_efield_tip4p.h new file mode 100644 index 0000000000..7970e67b3b --- /dev/null +++ b/src/EXTRA-FIX/fix_efield_tip4p.h @@ -0,0 +1,43 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS +// clang-format off +FixStyle(efield/tip4p,FixEfieldTIP4P); +// clang-format on +#else + +#ifndef LMP_FIX_EFIELD_TIP4P_H +#define LMP_FIX_EFIELD_TIP4P_H + +#include "fix_efield.h" + +namespace LAMMPS_NS { + +class FixEfieldTIP4P : public FixEfield { + + public: + FixEfieldTIP4P(class LAMMPS *, int, char **); + + void init() override; + void post_force(int) override; + + protected: + double alpha; + int typeO, typeH; // atom types for TIP4P molecule + void find_M(double *, double *, double *, double *); +}; +} // namespace LAMMPS_NS + +#endif +#endif diff --git a/src/fix_efield.h b/src/fix_efield.h index 2ebdcbfaed..52c827bb50 100644 --- a/src/fix_efield.h +++ b/src/fix_efield.h @@ -60,8 +60,6 @@ class FixEfield : public Fix { int force_flag; double fsum[4], fsum_all[4]; }; - } // namespace LAMMPS_NS - #endif #endif From 37b7ba7cae5358e71782af82df25bd783a7aca17 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Mar 2023 13:58:20 -0500 Subject: [PATCH 074/112] all functionality of fix efield/tip4p present (untested) --- src/EXTRA-FIX/fix_efield_tip4p.cpp | 412 ++++++++++++++++++++++++----- 1 file changed, 352 insertions(+), 60 deletions(-) diff --git a/src/EXTRA-FIX/fix_efield_tip4p.cpp b/src/EXTRA-FIX/fix_efield_tip4p.cpp index c5ecc313ec..0862c8a310 100644 --- a/src/EXTRA-FIX/fix_efield_tip4p.cpp +++ b/src/EXTRA-FIX/fix_efield_tip4p.cpp @@ -113,13 +113,12 @@ void FixEfieldTIP4P::post_force(int vflag) double **x = atom->x; double fx, fy, fz, xM[3]; - double v[6]; + double v[6], unwrap[3]; int iO, iH1, iH2; // constant efield if (varflag == CONSTANT) { - double unwrap[3]; // charge interactions // force = qE, potential energy = F dot x in unwrapped coords @@ -128,7 +127,8 @@ void FixEfieldTIP4P::post_force(int vflag) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - // this is an atom belonging to a TIP4P molecule + // process *all* atoms belonging to a TIP4P molecule which means we compute all + // contributions 3 times but only add a third and only when the atom is local if ((type[i] == typeO) || (type[i] == typeH)) { @@ -155,46 +155,129 @@ void FixEfieldTIP4P::post_force(int vflag) if (atom->type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); find_M(x[iO], x[iH1], x[iH2], xM); - if (region && !region->match(xM[0], xM[1], xM[2])) continue; - fx = q[iO] * ex; - fy = q[iO] * ey; - fz = q[iO] * ez; + // M site contributions - // distribute and apply forces, but only to local atoms - if (iO < nlocal) { - f[iO][0] += fx * (1.0 - alpha); - f[iO][1] += fy * (1.0 - alpha); - f[iO][2] += fz * (1.0 - alpha); - } - if (iH1 < nlocal) { - f[iH1][0] += 0.5 * alpha * fx; - f[iH1][1] += 0.5 * alpha * fy; - f[iH1][2] += 0.5 * alpha * fz; - } - if (iH2 < nlocal) { - f[iH2][0] += 0.5 * alpha * fx; - f[iH2][1] += 0.5 * alpha * fy; - f[iH2][2] += 0.5 * alpha * fz; + if (!region || region->match(xM[0], xM[1], xM[2])) { + + // we match a TIP4P molecule 3 times, so divide force contributions by 3. + + fx = q[iO] * ex / 3.0; + fy = q[iO] * ey / 3.0; + fz = q[iO] * ez / 3.0; + + // distribute and apply forces, but only to local atoms + + if (iO < nlocal) { + f[iO][0] += fx * (1.0 - alpha); + f[iO][1] += fy * (1.0 - alpha); + f[iO][2] += fz * (1.0 - alpha); + } + if (iH1 < nlocal) { + f[iH1][0] += 0.5 * alpha * fx; + f[iH1][1] += 0.5 * alpha * fy; + f[iH1][2] += 0.5 * alpha * fz; + } + if (iH2 < nlocal) { + f[iH2][0] += 0.5 * alpha * fx; + f[iH2][1] += 0.5 * alpha * fy; + f[iH2][2] += 0.5 * alpha * fz; + } + + domain->unmap(xM, image[iO], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + + // tally virial contribution with Oxygen + if (evflag && (iO < nlocal)) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iO, v); + } } - domain->unmap(xM, image[i], unwrap); - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - fsum[1] += fx; - fsum[2] += fy; - fsum[3] += fz; + // H1 site contributions - // tally virial contribution with Oxygen - if (evflag && (iO < nlocal)) { - v[0] = fx * unwrap[0]; - v[1] = fy * unwrap[1]; - v[2] = fz * unwrap[2]; - v[3] = fx * unwrap[1]; - v[4] = fx * unwrap[2]; - v[5] = fy * unwrap[2]; - v_tally(iO, v); + if (!region || region->match(x[iH1][0], x[iH1][1], x[iH1][2])) { + + // we match a TIP4P molecule 3 times, so divide force contributions by 3. + + fx = q[iH1] * ex / 3.0; + fy = q[iH1] * ey / 3.0; + fz = q[iH1] * ez / 3.0; + + if (iH1 < nlocal) { + f[iH1][0] += fx; + f[iH1][1] += fy; + f[iH1][2] += fz; + } + + // tally global force + + domain->unmap(x[iH1], image[iH1], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + + // tally virial contributions + + if (evflag && (iH1 < nlocal)) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH1, v); + } } + // H2 site contributions + + if (!region || region->match(x[iH2][0], x[iH2][1], x[iH2][2])) { + + // we match 3 atoms per molecule, so divide force contributions by 3. + + fx = q[iH2] * ex / 3.0; + fy = q[iH2] * ey / 3.0; + fz = q[iH2] * ez / 3.0; + + if (iH2 < nlocal) { + f[iH2][0] += fx; + f[iH2][1] += fy; + f[iH2][2] += fz; + } + + // tally global force + + domain->unmap(x[iH2], image[iH2], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + + // tally virial contributions + + if (evflag && (iH2 < nlocal)) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH2, v); + } + } + + // non-TIP4P atoms + } else { if (region && !region->match(x[i][0], x[i][1], x[i][2])) continue; @@ -224,7 +307,7 @@ void FixEfieldTIP4P::post_force(int vflag) } } - // dipole interactions + // dipole interactions, no special TIP4P treatment needed // no force, torque = mu cross E, potential energy = -mu dot E if (muflag) { @@ -244,11 +327,11 @@ void FixEfieldTIP4P::post_force(int vflag) } } + } else { + // variable efield, wrap with clear/add // potential energy = evar if defined, else 0.0 - } else { - modify->clearstep_compute(); if (xstyle == EQUAL) { @@ -276,29 +359,238 @@ void FixEfieldTIP4P::post_force(int vflag) if (qflag) { 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; - if (xstyle == ATOM) { - fx = qe2f * q[i] * efield[i][0]; + + // process *all* atoms belonging to a TIP4P molecule which means we compute all + // contributions 3 times but only add a third and only when the atom is local + + if ((type[i] == typeO) || (type[i] == typeH)) { + + if (type[i] == typeO) { + iO = i; + iH1 = atom->map(tag[i] + 1); + iH2 = atom->map(tag[i] + 2); + } else { + // set indices for first or second hydrogen + iO = atom->map(tag[i] - 1); + if ((iO != -1) && (type[iO] == typeO)) { + iH1 = i; + iH2 = atom->map(tag[i] + 1); + } else { + iO = atom->map(tag[i] - 2); + iH1 = atom->map(tag[i] - 1); + iH2 = i; + } + } + if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR, "TIP4P hydrogen is missing"); + if (iO == -1) error->one(FLERR, "TIP4P oxygen is missing"); + if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) + error->one(FLERR, "TIP4P hydrogen has incorrect atom type"); + if (atom->type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); + + find_M(x[iO], x[iH1], x[iH2], xM); + + // M site contributions + + if (!region || region->match(xM[0], xM[1], xM[2])) { + + // we match a TIP3P molecule 3 times, so divide force contributions by 3. + + if (xstyle == ATOM) { + fx = qe2f * q[iO] * efield[iO][0] / 3.0; + } else { + fx = q[iO] * ex / 3.0; + } + if (ystyle == ATOM) { + fy = qe2f * q[iO] * efield[iO][1] / 3.0; + } else { + fy = q[iO] * ey / 3.0; + } + if (zstyle == ATOM) { + fz = qe2f * q[iO] * efield[iO][2] / 3.0; + } else { + fz = q[iO] * ez / 3.0; + } + + // distribute and apply forces, but only to local atoms + + if (iO < nlocal) { + f[iO][0] += fx * (1.0 - alpha); + f[iO][1] += fy * (1.0 - alpha); + f[iO][2] += fz * (1.0 - alpha); + } + if (iH1 < nlocal) { + f[iH1][0] += 0.5 * alpha * fx; + f[iH1][1] += 0.5 * alpha * fy; + f[iH1][2] += 0.5 * alpha * fz; + } + if (iH2 < nlocal) { + f[iH2][0] += 0.5 * alpha * fx; + f[iH2][1] += 0.5 * alpha * fy; + f[iH2][2] += 0.5 * alpha * fz; + } + + domain->unmap(xM, image[iO], unwrap); + if (estyle == ATOM) + fsum[0] += efield[0][3]; + else + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + + // tally virial contribution for point M with Oxygen + + if (evflag && (iO < nlocal)) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iO, v); + } + } + + // H1 site contributions + + if (!region || region->match(x[iH1][0], x[iH1][1], x[iH1][2])) { + + // we match a TIP4P molecule 3 times, so divide force contributions by 3. + + if (xstyle == ATOM) { + fx = qe2f * q[iH1] * efield[iH1][0] / 3.0; + } else { + fx = q[iH1] * ex / 3.0; + } + if (ystyle == ATOM) { + fy = qe2f * q[iH1] * efield[iH1][1] / 3.0; + } else { + fy = q[iH1] * ey / 3.0; + } + if (zstyle == ATOM) { + fz = qe2f * q[iH1] * efield[iH1][2] / 3.0; + } else { + fz = q[iH1] * ez / 3.0; + } + + if (iH1 < nlocal) { + f[iH1][0] += fx; + f[iH1][1] += fy; + f[iH1][2] += fz; + } + + // tally global force + + domain->unmap(x[iH1], image[iH1], unwrap); + if (estyle == ATOM) + fsum[0] += efield[0][3]; + else + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + + // tally virial contribution + + if (evflag && (iH1 < nlocal)) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH1, v); + } + } + + // H2 site contributions + + if (!region || region->match(x[iH2][0], x[iH2][1], x[iH2][2])) { + + // we match a TIP4P molecule 3 times, so divide force contributions by 3. + + if (xstyle == ATOM) { + fx = qe2f * q[iH2] * efield[iH2][0] / 3.0; + } else { + fx = q[iH2] * ex / 3.0; + } + if (ystyle == ATOM) { + fy = qe2f * q[iH2] * efield[iH2][1] / 3.0; + } else { + fy = q[iH2] * ey / 3.0; + } + if (zstyle == ATOM) { + fz = qe2f * q[iH2] * efield[iH2][2] / 3.0; + } else { + fz = q[iH2] * ez / 3.0; + } + + if (iH2 < nlocal) { + f[iH2][0] += fx; + f[iH2][1] += fy; + f[iH2][2] += fz; + } + + // tally global force + + domain->unmap(x[iH2], image[iH2], unwrap); + if (estyle == ATOM) + fsum[0] += efield[0][3]; + else + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; + + // tally virial contribution + + if (evflag && (iH2 < nlocal)) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH2, v); + } + } + } else { - fx = q[i] * ex; + + // non-TIP4P charge interactions + // force = qE + + if (region && !region->match(x[i][0], x[i][1], x[i][2])) continue; + + if (xstyle == ATOM) { + fx = qe2f * q[i] * efield[i][0]; + } else { + fx = q[i] * ex; + } + f[i][0] += fx; + fsum[1] += fx; + if (ystyle == ATOM) { + fy = qe2f * q[i] * efield[i][1]; + } else { + fy = q[i] * ey; + } + f[i][1] += fy; + fsum[2] += fy; + if (zstyle == ATOM) { + fz = qe2f * q[i] * efield[i][2]; + } else { + fz = q[i] * ez; + } + f[i][2] += fz; + fsum[3] += fz; + + if (estyle == ATOM) { + fsum[0] += efield[0][3]; + } else { + domain->unmap(x[i], image[i], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + } } - f[i][0] += fx; - fsum[1] += fx; - if (ystyle == ATOM) { - fy = qe2f * q[i] * efield[i][1]; - } else { - fy = q[i] * ey; - } - f[i][1] += fy; - fsum[2] += fy; - if (zstyle == ATOM) { - fz = qe2f * q[i] * efield[i][2]; - } else { - fz = q[i] * ez; - } - f[i][2] += fz; - fsum[3] += fz; - if (estyle == ATOM) fsum[0] += efield[0][3]; } } } From 6b6f8087d3deaa7bcd3e8019d107d27cd90a885b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Mar 2023 17:45:38 -0500 Subject: [PATCH 075/112] output potential energy with fix efield with equal style variables --- src/fix_efield.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp index 99482f8459..9d54ccb848 100644 --- a/src/fix_efield.cpp +++ b/src/fix_efield.cpp @@ -273,12 +273,12 @@ void FixEfield::post_force(int vflag) double **x = atom->x; double fx, fy, fz; - double v[6]; + double v[6], unwrap[3]; + ; // constant efield if (varflag == CONSTANT) { - double unwrap[3]; // charge interactions // force = qE, potential energy = F dot x in unwrapped coords @@ -385,7 +385,12 @@ void FixEfield::post_force(int vflag) } f[i][2] += fz; fsum[3] += fz; - if (estyle == ATOM) fsum[0] += efield[0][3]; + if (estyle == ATOM) { + fsum[0] += efield[0][3]; + } else { + domain->unmap(x[i], image[i], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + } } } From cf6f6829ae03e85e16552ca87fd8e108dabdac78 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Mar 2023 17:45:48 -0500 Subject: [PATCH 076/112] cosmetic --- src/fix_efield.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp index 9d54ccb848..f8ff377518 100644 --- a/src/fix_efield.cpp +++ b/src/fix_efield.cpp @@ -42,7 +42,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), idregion(nullptr), region(nullptr), efield(nullptr) { - if (narg < 6) utils::missing_cmd_args(FLERR, std::string("fix ")+style, error); + if (narg < 6) utils::missing_cmd_args(FLERR, std::string("fix ") + style, error); dynamic_group_allow = 1; vector_flag = 1; @@ -85,13 +85,15 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : int iarg = 6; while (iarg < narg) { if (strcmp(arg[iarg], "region") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, std::string("fix ") + style + " region", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, std::string("fix ") + style + " region", error); region = domain->get_region_by_id(arg[iarg + 1]); if (!region) error->all(FLERR, "Region {} for fix efield does not exist", arg[iarg + 1]); idregion = utils::strdup(arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "energy") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, std::string("fix ") + style + "energy", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, std::string("fix ") + style + "energy", error); if (utils::strmatch(arg[iarg + 1], "^v_")) { estr = utils::strdup(arg[iarg + 1] + 2); } else From da9559d92ce15be59a249b5c3c1cf6d574fafbb6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Mar 2023 17:47:13 -0500 Subject: [PATCH 077/112] rewrite TIP4P molecule handling to process each force contribution only once --- src/EXTRA-FIX/fix_efield_tip4p.cpp | 371 ++++++++++++++++------------- 1 file changed, 199 insertions(+), 172 deletions(-) diff --git a/src/EXTRA-FIX/fix_efield_tip4p.cpp b/src/EXTRA-FIX/fix_efield_tip4p.cpp index 0862c8a310..4bd35882f9 100644 --- a/src/EXTRA-FIX/fix_efield_tip4p.cpp +++ b/src/EXTRA-FIX/fix_efield_tip4p.cpp @@ -127,8 +127,8 @@ void FixEfieldTIP4P::post_force(int vflag) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - // process *all* atoms belonging to a TIP4P molecule which means we compute all - // contributions 3 times but only add a third and only when the atom is local + // process *all* atoms belonging to a TIP4P molecule since we need + // to consider molecules where parts of the molecule are ghost atoms if ((type[i] == typeO) || (type[i] == typeH)) { @@ -137,7 +137,9 @@ void FixEfieldTIP4P::post_force(int vflag) iH1 = atom->map(tag[i] + 1); iH2 = atom->map(tag[i] + 2); } else { + // set indices for first or second hydrogen + iO = atom->map(tag[i] - 1); if ((iO != -1) && (type[iO] == typeO)) { iH1 = i; @@ -153,6 +155,8 @@ void FixEfieldTIP4P::post_force(int vflag) if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) error->one(FLERR, "TIP4P hydrogen has incorrect atom type"); if (atom->type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); + iH1 = domain->closest_image(i, iH1); + iH2 = domain->closest_image(i, iH2); find_M(x[iO], x[iH1], x[iH2], xM); @@ -160,45 +164,59 @@ void FixEfieldTIP4P::post_force(int vflag) if (!region || region->match(xM[0], xM[1], xM[2])) { - // we match a TIP4P molecule 3 times, so divide force contributions by 3. + fx = q[iO] * ex; + fy = q[iO] * ey; + fz = q[iO] * ez; - fx = q[iO] * ex / 3.0; - fy = q[iO] * ey / 3.0; - fz = q[iO] * ez / 3.0; + // distribute and apply forces - // distribute and apply forces, but only to local atoms - - if (iO < nlocal) { + if (i == iO) { f[iO][0] += fx * (1.0 - alpha); f[iO][1] += fy * (1.0 - alpha); f[iO][2] += fz * (1.0 - alpha); - } - if (iH1 < nlocal) { - f[iH1][0] += 0.5 * alpha * fx; - f[iH1][1] += 0.5 * alpha * fy; - f[iH1][2] += 0.5 * alpha * fz; - } - if (iH2 < nlocal) { - f[iH2][0] += 0.5 * alpha * fx; - f[iH2][1] += 0.5 * alpha * fy; - f[iH2][2] += 0.5 * alpha * fz; + if (iH1 < nlocal) { + f[iH1][0] += 0.5 * alpha * fx; + f[iH1][1] += 0.5 * alpha * fy; + f[iH1][2] += 0.5 * alpha * fz; + } + if (iH2 < nlocal) { + f[iH2][0] += 0.5 * alpha * fx; + f[iH2][1] += 0.5 * alpha * fy; + f[iH2][2] += 0.5 * alpha * fz; + } + } else { + if (iO >= nlocal) { + if (i == iH1) { + f[iH1][0] += 0.5 * alpha * fx; + f[iH1][1] += 0.5 * alpha * fy; + f[iH1][2] += 0.5 * alpha * fz; + } + if (i == iH2) { + f[iH2][0] += 0.5 * alpha * fx; + f[iH2][1] += 0.5 * alpha * fy; + f[iH2][2] += 0.5 * alpha * fz; + } + } } - domain->unmap(xM, image[iO], unwrap); - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - fsum[1] += fx; - fsum[2] += fy; - fsum[3] += fz; + if (i == iO) { + domain->unmap(xM, image[iO], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; - // tally virial contribution with Oxygen - if (evflag && (iO < nlocal)) { - v[0] = fx * unwrap[0]; - v[1] = fy * unwrap[1]; - v[2] = fz * unwrap[2]; - v[3] = fx * unwrap[1]; - v[4] = fx * unwrap[2]; - v[5] = fy * unwrap[2]; - v_tally(iO, v); + // tally virial contribution with Oxygen + + if (evflag) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iO, v); + } } } @@ -206,36 +224,34 @@ void FixEfieldTIP4P::post_force(int vflag) if (!region || region->match(x[iH1][0], x[iH1][1], x[iH1][2])) { - // we match a TIP4P molecule 3 times, so divide force contributions by 3. + fx = q[iH1] * ex; + fy = q[iH1] * ey; + fz = q[iH1] * ez; - fx = q[iH1] * ex / 3.0; - fy = q[iH1] * ey / 3.0; - fz = q[iH1] * ez / 3.0; - - if (iH1 < nlocal) { + if (i == iH1) { f[iH1][0] += fx; f[iH1][1] += fy; f[iH1][2] += fz; - } - // tally global force + // tally global force - domain->unmap(x[iH1], image[iH1], unwrap); - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - fsum[1] += fx; - fsum[2] += fy; - fsum[3] += fz; + domain->unmap(x[iH1], image[iH1], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; - // tally virial contributions + // tally virial contributions - if (evflag && (iH1 < nlocal)) { - v[0] = fx * unwrap[0]; - v[1] = fy * unwrap[1]; - v[2] = fz * unwrap[2]; - v[3] = fx * unwrap[1]; - v[4] = fx * unwrap[2]; - v[5] = fy * unwrap[2]; - v_tally(iH1, v); + if (evflag) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH1, v); + } } } @@ -243,36 +259,34 @@ void FixEfieldTIP4P::post_force(int vflag) if (!region || region->match(x[iH2][0], x[iH2][1], x[iH2][2])) { - // we match 3 atoms per molecule, so divide force contributions by 3. + fx = q[iH2] * ex; + fy = q[iH2] * ey; + fz = q[iH2] * ez; - fx = q[iH2] * ex / 3.0; - fy = q[iH2] * ey / 3.0; - fz = q[iH2] * ez / 3.0; - - if (iH2 < nlocal) { + if (i == iH2) { f[iH2][0] += fx; f[iH2][1] += fy; f[iH2][2] += fz; - } - // tally global force + // tally global force - domain->unmap(x[iH2], image[iH2], unwrap); - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - fsum[1] += fx; - fsum[2] += fy; - fsum[3] += fz; + domain->unmap(x[iH2], image[iH2], unwrap); + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; - // tally virial contributions + // tally virial contributions - if (evflag && (iH2 < nlocal)) { - v[0] = fx * unwrap[0]; - v[1] = fy * unwrap[1]; - v[2] = fz * unwrap[2]; - v[3] = fx * unwrap[1]; - v[4] = fx * unwrap[2]; - v[5] = fy * unwrap[2]; - v_tally(iH2, v); + if (evflag) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH2, v); + } } } @@ -360,8 +374,8 @@ void FixEfieldTIP4P::post_force(int vflag) for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - // process *all* atoms belonging to a TIP4P molecule which means we compute all - // contributions 3 times but only add a third and only when the atom is local + // process *all* atoms belonging to a TIP4P molecule since we need + // to consider molecules where parts of the molecule are ghost atoms if ((type[i] == typeO) || (type[i] == typeH)) { @@ -370,7 +384,9 @@ void FixEfieldTIP4P::post_force(int vflag) iH1 = atom->map(tag[i] + 1); iH2 = atom->map(tag[i] + 2); } else { + // set indices for first or second hydrogen + iO = atom->map(tag[i] - 1); if ((iO != -1) && (type[iO] == typeO)) { iH1 = i; @@ -386,6 +402,8 @@ void FixEfieldTIP4P::post_force(int vflag) if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) error->one(FLERR, "TIP4P hydrogen has incorrect atom type"); if (atom->type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); + iH1 = domain->closest_image(i, iH1); + iH2 = domain->closest_image(i, iH2); find_M(x[iO], x[iH1], x[iH2], xM); @@ -393,61 +411,74 @@ void FixEfieldTIP4P::post_force(int vflag) if (!region || region->match(xM[0], xM[1], xM[2])) { - // we match a TIP3P molecule 3 times, so divide force contributions by 3. - if (xstyle == ATOM) { - fx = qe2f * q[iO] * efield[iO][0] / 3.0; + fx = qe2f * q[iO] * efield[iO][0]; } else { - fx = q[iO] * ex / 3.0; + fx = q[iO] * ex; } if (ystyle == ATOM) { - fy = qe2f * q[iO] * efield[iO][1] / 3.0; + fy = qe2f * q[iO] * efield[iO][1]; } else { - fy = q[iO] * ey / 3.0; + fy = q[iO] * ey; } if (zstyle == ATOM) { - fz = qe2f * q[iO] * efield[iO][2] / 3.0; + fz = qe2f * q[iO] * efield[iO][2]; } else { - fz = q[iO] * ez / 3.0; + fz = q[iO] * ez; } // distribute and apply forces, but only to local atoms - if (iO < nlocal) { + if (i == iO) { f[iO][0] += fx * (1.0 - alpha); f[iO][1] += fy * (1.0 - alpha); f[iO][2] += fz * (1.0 - alpha); - } - if (iH1 < nlocal) { - f[iH1][0] += 0.5 * alpha * fx; - f[iH1][1] += 0.5 * alpha * fy; - f[iH1][2] += 0.5 * alpha * fz; - } - if (iH2 < nlocal) { - f[iH2][0] += 0.5 * alpha * fx; - f[iH2][1] += 0.5 * alpha * fy; - f[iH2][2] += 0.5 * alpha * fz; + if (iH1 < nlocal) { + f[iH1][0] += 0.5 * alpha * fx; + f[iH1][1] += 0.5 * alpha * fy; + f[iH1][2] += 0.5 * alpha * fz; + } + if (iH2 < nlocal) { + f[iH2][0] += 0.5 * alpha * fx; + f[iH2][1] += 0.5 * alpha * fy; + f[iH2][2] += 0.5 * alpha * fz; + } + } else { + if (iO >= nlocal) { + if (i == iH1) { + f[iH1][0] += 0.5 * alpha * fx; + f[iH1][1] += 0.5 * alpha * fy; + f[iH1][2] += 0.5 * alpha * fz; + } + if (i == iH2) { + f[iH2][0] += 0.5 * alpha * fx; + f[iH2][1] += 0.5 * alpha * fy; + f[iH2][2] += 0.5 * alpha * fz; + } + } } - domain->unmap(xM, image[iO], unwrap); - if (estyle == ATOM) - fsum[0] += efield[0][3]; - else - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - fsum[1] += fx; - fsum[2] += fy; - fsum[3] += fz; + if (i == iO) { + domain->unmap(xM, image[iO], unwrap); + if (estyle == ATOM) + fsum[0] += efield[0][3]; + else + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; - // tally virial contribution for point M with Oxygen + // tally virial contribution for point M with Oxygen - if (evflag && (iO < nlocal)) { - v[0] = fx * unwrap[0]; - v[1] = fy * unwrap[1]; - v[2] = fz * unwrap[2]; - v[3] = fx * unwrap[1]; - v[4] = fx * unwrap[2]; - v[5] = fy * unwrap[2]; - v_tally(iO, v); + if (evflag) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iO, v); + } } } @@ -455,51 +486,49 @@ void FixEfieldTIP4P::post_force(int vflag) if (!region || region->match(x[iH1][0], x[iH1][1], x[iH1][2])) { - // we match a TIP4P molecule 3 times, so divide force contributions by 3. - if (xstyle == ATOM) { - fx = qe2f * q[iH1] * efield[iH1][0] / 3.0; + fx = qe2f * q[iH1] * efield[iH1][0]; } else { - fx = q[iH1] * ex / 3.0; + fx = q[iH1] * ex; } if (ystyle == ATOM) { - fy = qe2f * q[iH1] * efield[iH1][1] / 3.0; + fy = qe2f * q[iH1] * efield[iH1][1]; } else { - fy = q[iH1] * ey / 3.0; + fy = q[iH1] * ey; } if (zstyle == ATOM) { - fz = qe2f * q[iH1] * efield[iH1][2] / 3.0; + fz = qe2f * q[iH1] * efield[iH1][2]; } else { - fz = q[iH1] * ez / 3.0; + fz = q[iH1] * ez; } - if (iH1 < nlocal) { + if (i == iH1) { f[iH1][0] += fx; f[iH1][1] += fy; f[iH1][2] += fz; - } - // tally global force + // tally global force - domain->unmap(x[iH1], image[iH1], unwrap); - if (estyle == ATOM) - fsum[0] += efield[0][3]; - else - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - fsum[1] += fx; - fsum[2] += fy; - fsum[3] += fz; + domain->unmap(x[iH1], image[iH1], unwrap); + if (estyle == ATOM) + fsum[0] += efield[0][3]; + else + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; - // tally virial contribution + // tally virial contribution - if (evflag && (iH1 < nlocal)) { - v[0] = fx * unwrap[0]; - v[1] = fy * unwrap[1]; - v[2] = fz * unwrap[2]; - v[3] = fx * unwrap[1]; - v[4] = fx * unwrap[2]; - v[5] = fy * unwrap[2]; - v_tally(iH1, v); + if (evflag) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH1, v); + } } } @@ -507,54 +536,52 @@ void FixEfieldTIP4P::post_force(int vflag) if (!region || region->match(x[iH2][0], x[iH2][1], x[iH2][2])) { - // we match a TIP4P molecule 3 times, so divide force contributions by 3. - if (xstyle == ATOM) { - fx = qe2f * q[iH2] * efield[iH2][0] / 3.0; + fx = qe2f * q[iH2] * efield[iH2][0]; } else { - fx = q[iH2] * ex / 3.0; + fx = q[iH2] * ex; } if (ystyle == ATOM) { - fy = qe2f * q[iH2] * efield[iH2][1] / 3.0; + fy = qe2f * q[iH2] * efield[iH2][1]; } else { - fy = q[iH2] * ey / 3.0; + fy = q[iH2] * ey; } if (zstyle == ATOM) { - fz = qe2f * q[iH2] * efield[iH2][2] / 3.0; + fz = qe2f * q[iH2] * efield[iH2][2]; } else { - fz = q[iH2] * ez / 3.0; + fz = q[iH2] * ez; } - if (iH2 < nlocal) { + if (i == iH2) { f[iH2][0] += fx; f[iH2][1] += fy; f[iH2][2] += fz; - } - // tally global force + // tally global force - domain->unmap(x[iH2], image[iH2], unwrap); - if (estyle == ATOM) - fsum[0] += efield[0][3]; - else - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - fsum[1] += fx; - fsum[2] += fy; - fsum[3] += fz; + domain->unmap(x[iH2], image[iH2], unwrap); + if (estyle == ATOM) + fsum[0] += efield[0][3]; + else + fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + fsum[1] += fx; + fsum[2] += fy; + fsum[3] += fz; - // tally virial contribution + // tally virial contribution - if (evflag && (iH2 < nlocal)) { - v[0] = fx * unwrap[0]; - v[1] = fy * unwrap[1]; - v[2] = fz * unwrap[2]; - v[3] = fx * unwrap[1]; - v[4] = fx * unwrap[2]; - v[5] = fy * unwrap[2]; - v_tally(iH2, v); + if (evflag) { + v[0] = fx * unwrap[0]; + v[1] = fy * unwrap[1]; + v[2] = fz * unwrap[2]; + v[3] = fx * unwrap[1]; + v[4] = fx * unwrap[2]; + v[5] = fy * unwrap[2]; + v_tally(iH2, v); + } } } - + } else { // non-TIP4P charge interactions From 91aae79fdca235ed87a06e36be94ce939719625a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Mar 2023 18:11:57 -0500 Subject: [PATCH 078/112] add docs for fix efield/tip4p --- doc/src/Commands_fix.rst | 1 + doc/src/fix.rst | 1 + doc/src/fix_efield.rst | 96 +++++++++++++++++++++++++--------------- src/.gitignore | 2 + 4 files changed, 64 insertions(+), 36 deletions(-) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 89cf3e880a..13bdc34137 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -70,6 +70,7 @@ OPT. * :doc:`dt/reset (k) ` * :doc:`edpd/source ` * :doc:`efield ` + * :doc:`efield/tip4p ` * :doc:`ehex ` * :doc:`electrode/conp (i) ` * :doc:`electrode/conq (i) ` diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 7d505fec63..9b7ada9369 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -222,6 +222,7 @@ accelerated styles exist. * :doc:`dt/reset ` - reset the timestep based on velocity, forces * :doc:`edpd/source ` - add heat source to eDPD simulations * :doc:`efield ` - impose electric field on system +* :doc:`efield/tip4p ` - impose electric field on system with TIP4P molecules * :doc:`ehex ` - enhanced heat exchange algorithm * :doc:`electrode/conp ` - impose electric potential * :doc:`electrode/conq ` - impose total electric charge diff --git a/doc/src/fix_efield.rst b/doc/src/fix_efield.rst index a44f8ddb9d..eebfaba8c6 100644 --- a/doc/src/fix_efield.rst +++ b/doc/src/fix_efield.rst @@ -1,17 +1,21 @@ .. index:: fix efield +.. index:: fix efield/tip4p fix efield command ================== +fix efield/tip4p command +======================== + Syntax """""" .. parsed-literal:: - fix ID group-ID efield ex ey ez keyword value ... + fix ID group-ID style ex ey ez keyword value ... * ID, group-ID are documented in :doc:`fix ` command -* efield = style name of this fix command +* style = *efield* or *efield/tip4p* * ex,ey,ez = E-field component values (electric field units) * any of ex,ey,ez can be a variable (see below) * zero or more keyword/value pairs may be appended to args @@ -31,27 +35,36 @@ Examples fix kick external-field efield 1.0 0.0 0.0 fix kick external-field efield 0.0 0.0 v_oscillate + fix kick external-field efield/tip4p 1.0 0.0 0.0 Description """"""""""" -Add a force F = qE to each charged atom in the group due to an +Add a force :math:`\vec{F} = q\vec{E}` to each charged atom in the group due to an external electric field being applied to the system. If the system contains point-dipoles, also add a torque on the dipoles due to the external electric field. -For charges, any of the 3 quantities defining the E-field components -can be specified as an equal-style or atom-style -:doc:`variable `, namely *ex*, *ey*, *ez*\ . If the value is a -variable, it should be specified as v_name, where name is the variable -name. In this case, the variable will be evaluated each timestep, and -its value used to determine the E-field component. +.. versionadded:: TBD + +When the *efield/tip4p* style is used, the E-field will be applied to +the position of the virtual charge site M of a TIP4P molecule instead of +the oxygen position as it is defined by a corresponding :doc:`TIP4P pair +style `. The forces on the M site due to the +external field are projected on the oxygen and hydrogen atoms of the +TIP4P molecules. + +For charges, any of the 3 quantities defining the E-field components can +be specified as an equal-style or atom-style :doc:`variable `, +namely *ex*, *ey*, *ez*\ . If the value is a variable, it should be +specified as v_name, where name is the variable name. In this case, the +variable will be evaluated each timestep, and its value used to +determine the E-field component. For point-dipoles, equal-style variables can be used, but atom-style variables are not currently supported, since they imply a spatial gradient in the electric field which means additional terms with -gradients of the field are required for the force and torque on -dipoles. +gradients of the field are required for the force and torque on dipoles. Equal-style variables can specify formulas with various mathematical functions, and include :doc:`thermo_style ` command @@ -81,10 +94,18 @@ self-consistent minimization problem (see below). The *energy* keyword is not allowed if the added field is a constant vector (ex,ey,ez), with all components defined as numeric constants and not as variables. This is because LAMMPS can compute the energy -for each charged particle directly as E = -x dot qE = -q (x\*ex + y\*ey -+ z\*ez), so that -Grad(E) = F. Similarly for point-dipole particles -the energy can be computed as E = -mu dot E = -(mux\*ex + muy\*ey + -muz\*ez). +for each charged particle directly as + +.. math:: + + U_{efield} = -\vec{x} \cdot q\vec{E} = -q (x\cdot E_x + y\cdot E_y + z\cdot Ez), + +so that :math:`-\nabla U_{efield} = \vec{F}`. Similarly for point-dipole particles +the energy can be computed as + +.. math:: + + U_{efield} = -\vec{\mu} \cdot \vec{E} = -\mu_x\cdot E_x + \mu_y\cdot E_y + \mu_z\cdot E_z The *energy* keyword is optional if the added force is defined with one or more variables, and if you are performing dynamics via the @@ -120,29 +141,28 @@ Restart, fix_modify, output, run start/stop, minimize info No information about this fix is written to :doc:`binary restart files `. -The :doc:`fix_modify ` *energy* option is supported by -this fix to add the potential energy inferred by the added force due -to the electric field to the global potential energy of the system as -part of :doc:`thermodynamic output `. The default -setting for this fix is :doc:`fix_modify energy no `. -Note that this energy is a fictitious quantity but is needed so that -the :doc:`minimize ` command can include the forces added by -this fix in a consistent manner. I.e. there is a decrease in -potential energy when atoms move in the direction of the added force -due to the electric field. +The :doc:`fix_modify ` *energy* option is supported by this +fix to add the potential energy inferred by the added force due to the +electric field to the global potential energy of the system as part of +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify energy no `. Note that this +energy is a fictitious quantity but is needed so that the :doc:`minimize +` command can include the forces added by this fix in a +consistent manner. I.e. there is a decrease in potential energy when +atoms move in the direction of the added force due to the electric +field. -The :doc:`fix_modify ` *virial* option is supported by -this fix to add the contribution due to the added forces on atoms to -both the global pressure and per-atom stress of the system via the -:doc:`compute pressure ` and :doc:`compute -stress/atom ` commands. The former can be -accessed by :doc:`thermodynamic output `. The default -setting for this fix is :doc:`fix_modify virial no `. +The :doc:`fix_modify ` *virial* option is supported by this +fix to add the contribution due to the added forces on atoms to both the +global pressure and per-atom stress of the system via the :doc:`compute +pressure ` and :doc:`compute stress/atom +` commands. The former can be accessed by +:doc:`thermodynamic output `. The default setting for +this fix is :doc:`fix_modify virial no `. The :doc:`fix_modify ` *respa* option is supported by this -fix. This allows to set at which level of the :doc:`r-RESPA -` integrator the fix adding its forces. Default is the -outermost level. +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 @@ -169,7 +189,11 @@ the iteration count during the minimization. Restrictions """""""""""" -None +Fix style *efield/tip4p* is part of the EXTRA-FIX package. It is only +enabled if LAMMPS was built with that package. See the :doc:`Build +package ` page for more info. + +Fix style *efield/tip4p* can only be used with tip4p pair styles. Related commands """""""""""""""" diff --git a/src/.gitignore b/src/.gitignore index 0e3a69bdc7..cc57048294 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -756,6 +756,8 @@ /fix_damping_cundall.h /fix_dpd_energy.cpp /fix_dpd_energy.h +/fix_efield_tip4p.cpp +/fix_efield_tip4p.h /fix_electron_stopping.cpp /fix_electron_stopping.h /fix_electron_stopping_fit.cpp From 251fac2c6046a01e6b271c3686cb1bd293688003 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Mar 2023 18:43:46 -0500 Subject: [PATCH 079/112] add unit tests for fix efield/tip4p --- .../fix-timestep-efield_tip4p_const.yaml | 85 ++++++++++++++++++ .../fix-timestep-efield_tip4p_variable.yaml | 90 +++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 unittest/force-styles/tests/fix-timestep-efield_tip4p_const.yaml create mode 100644 unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml diff --git a/unittest/force-styles/tests/fix-timestep-efield_tip4p_const.yaml b/unittest/force-styles/tests/fix-timestep-efield_tip4p_const.yaml new file mode 100644 index 0000000000..06d9ac6788 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-efield_tip4p_const.yaml @@ -0,0 +1,85 @@ +--- +lammps_version: 8 Feb 2023 +date_generated: Sat Mar 11 18:36:57 2023 +epsilon: 2e-13 +skip_tests: +prerequisites: ! | + atom full + fix efield/tip4p + pair tip4p/cut +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! | + pair_style tip4p/cut 5 2 5 1 0.15 8 + pair_coeff * * + set mol 1*3 type 1 + pair_modify compute off + fix move all nve + fix test all efield/tip4p 0.0 -0.1 0.1 +input_file: in.fourmol +natoms: 29 +global_scalar: 4.491995770754199 +global_vector: ! |- + 3 0 3.3306690738754696e-16 -3.3306690738754696e-16 +run_pos: ! |2 + 1 -2.7552415093234162e-01 2.4719487659017276e+00 -1.7659260155592149e-01 + 2 3.0667295195551686e-01 2.9595207006091298e+00 -8.4948873046248308e-01 + 3 -6.9501841828317501e-01 1.2527375852468967e+00 -6.1999248956326514e-01 + 4 -1.5797583064222933e+00 1.4872506539147059e+00 -1.2557393847172438e+00 + 5 -9.0059081341694203e-01 9.3371332191055079e-01 4.0123828894262992e-01 + 6 2.9466004201322965e-01 2.3098154203185278e-01 -1.2847818233212565e+00 + 7 3.3883194064643740e-01 -9.4939443955616154e-03 -2.4648068462973325e+00 + 8 1.1652661823392052e+00 -4.8788892293481145e-01 -6.7051084726427845e-01 + 9 1.3792181599117415e+00 -2.5785144806547511e-01 2.7127116166812570e-01 + 10 2.0205755944752375e+00 -1.4248083043774298e+00 -9.7168038781705335e-01 + 11 1.7908052895357973e+00 -1.9906451925361470e+00 -1.8892937481668459e+00 + 12 3.0048165232344948e+00 -4.9103749217400644e-01 -1.6223692885574461e+00 + 13 4.0522477613596308e+00 -8.9351481123719190e-01 -1.6399777605636197e+00 + 14 2.6043344097441490e+00 -4.1669249548232629e-01 -2.6631499467387134e+00 + 15 2.9678538772616037e+00 5.5587250140887356e-01 -1.2363630117859896e+00 + 16 2.6503290482597039e+00 -2.3948066095776737e+00 3.7940961923343369e-02 + 17 2.2332493442069845e+00 -2.1021976986931690e+00 1.1486155813700776e+00 + 18 2.1368656301495856e+00 3.0159850430539912e+00 -3.5184857372030947e+00 + 19 1.5342191259863922e+00 2.6247080014171758e+00 -4.2375259746262710e+00 + 20 2.7733620959877663e+00 3.6930851299036145e+00 -3.9339459598190301e+00 + 21 4.9045879801671548e+00 -4.0745123882892225e+00 -3.6229125886346081e+00 + 22 4.3617321654820183e+00 -4.2118993857238047e+00 -4.4557088010084982e+00 + 23 5.7381475002461277e+00 -3.5857943422556979e+00 -3.8747045101649773e+00 + 24 2.0686006913404285e+00 3.1531330464503946e+00 3.1540340249574279e+00 + 25 1.3094870938232261e+00 3.2656011662469178e+00 2.5154941909251844e+00 + 26 2.5772659745607247e+00 4.0054947408934565e+00 3.2209131657742485e+00 + 27 -1.9615465740567124e+00 -4.3544512503622474e+00 2.1090363824362317e+00 + 28 -2.7415808583638364e+00 -4.0226893662371292e+00 1.5870458306784345e+00 + 29 -1.3167312777782281e+00 -3.6011902209042037e+00 2.2737597954628499e+00 +run_vel: ! |2 + 1 3.5866086122019378e-03 -1.2154347473708673e-03 -4.2392200362722891e-03 + 2 2.0082524022385501e-03 3.3511787841678979e-03 3.7688429839581980e-03 + 3 6.2192542069958688e-04 6.9301276762936742e-03 2.5708729584915588e-03 + 4 -1.6431765497648366e-03 -2.9960364454768916e-03 -2.8741662319631094e-03 + 5 -4.3853806891633691e-03 -2.6901128825407325e-03 -1.1121197568886760e-03 + 6 8.7148031038297540e-04 2.4954313330053800e-03 -1.2309066226600864e-03 + 7 -1.2568415210119106e-03 4.0807509738615430e-04 -6.9712338524110520e-04 + 8 6.8689620421805110e-04 -3.2780884533380726e-03 5.8272396977482131e-03 + 9 2.3640248488616234e-04 -1.5224658663571485e-03 1.4175297300497880e-03 + 10 1.6082301926220160e-03 2.9963750033118689e-03 -4.0623208158007441e-03 + 11 -1.7960053899953208e-03 -1.9848960612000211e-03 -2.2845602155362049e-03 + 12 7.1704667350825442e-04 -1.1633952760482067e-03 -2.2137502152034124e-03 + 13 3.4262167231009551e-03 4.2909145176285319e-03 -7.4448972505535764e-04 + 14 1.1671343597943564e-03 -4.6984783616368505e-03 -3.7471832948834287e-03 + 15 -3.4509552609576417e-03 -4.2688014665352289e-03 4.1647084114789104e-03 + 16 -1.2920232746597238e-03 1.3898109477904978e-03 3.4080654373162835e-03 + 17 1.5549230284425913e-03 -2.4052541544723738e-04 -1.3250375236016142e-03 + 18 -8.8068025374161475e-04 -7.0649672396011162e-04 -1.9975231159692470e-03 + 19 -2.1408231218136301e-05 -3.2882182579271491e-03 5.3923401875054571e-03 + 20 4.3713031453335733e-03 4.5512662640716187e-03 2.3532301247409359e-03 + 21 -9.2462567997913224e-04 4.1213962901802100e-04 -1.0839649018049458e-03 + 22 -3.7082492847362717e-03 -3.5677336805362207e-03 5.5992552065310119e-03 + 23 5.1261812506730889e-04 -4.8292196668287962e-03 4.4061275828068932e-03 + 24 -8.5477751371944852e-06 7.2834656439669328e-04 -8.2723276308350297e-04 + 25 4.9711072680197884e-03 -5.2985686094745897e-03 3.3843456016457627e-03 + 26 -1.4738757253221410e-03 -3.2290060494108487e-03 4.0272837484112388e-03 + 27 7.3001515368261834e-05 7.6655436532142407e-04 -5.3634821214295335e-04 + 28 -7.6962825083727625e-04 -1.0470804470619696e-03 1.9904866134623045e-03 + 29 -3.3162166593954292e-03 -1.5880017630017177e-03 2.8796190980974416e-03 +... diff --git a/unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml b/unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml new file mode 100644 index 0000000000..9d3eb78b8a --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml @@ -0,0 +1,90 @@ +--- +lammps_version: 8 Feb 2023 +date_generated: Sat Mar 11 18:36:57 2023 +epsilon: 2e-13 +skip_tests: +prerequisites: ! | + atom full + fix efield/tip4p + pair tip4p/cut +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! | + pair_style tip4p/cut 5 2 5 1 0.15 8.0 + pair_coeff * * + set mol 1*3 type 1 + pair_modify compute off + fix init all store/state 0 x y z + variable xforce delete + variable xforce atom f_init[1] + variable zforce delete + variable zforce equal 0.1*step/10.0 + fix move all nve + fix test all efield/tip4p v_xforce 0.0 v_zforce +input_file: in.fourmol +natoms: 29 +global_scalar: -108.06823025980506 +global_vector: ! |- + 3 9.596230365887404 0 -4.440892098500626e-16 +run_pos: ! |2 + 1 -2.7531286450623932e-01 2.4718738394938558e+00 -1.7653750622874620e-01 + 2 3.0682277741052061e-01 2.9595699761707506e+00 -8.4952487409977362e-01 + 3 -6.9499689283442667e-01 1.2527341715135745e+00 -6.1999076705548650e-01 + 4 -1.5799847405798819e+00 1.4872652200436742e+00 -1.2557496756887883e+00 + 5 -9.0071967709813461e-01 9.3372768633609737e-01 4.0122756859740766e-01 + 6 2.9489677035093576e-01 2.3106805370014455e-01 -1.2848415584173214e+00 + 7 3.3855383234893327e-01 -9.5765527451944828e-03 -2.4647480539199424e+00 + 8 1.1643962409868904e+00 -4.8797342487030382e-01 -6.7045108599319103e-01 + 9 1.3799023150910010e+00 -2.5780046066835277e-01 2.7123202628826903e-01 + 10 2.0207975889886196e+00 -1.4247994958278709e+00 -9.7168706713719422e-01 + 11 1.7910648474147319e+00 -1.9906312942531232e+00 -1.8893042032132690e+00 + 12 3.0035425420205333e+00 -4.9107995377108410e-01 -1.6223383760887220e+00 + 13 4.0528201523622283e+00 -8.9349969755442493e-01 -1.6399873319065361e+00 + 14 2.6047057144491697e+00 -4.1667644840131191e-01 -2.6631622713789995e+00 + 15 2.9682779280011724e+00 5.5588692229168801e-01 -1.2363744303219071e+00 + 16 2.6524868604870657e+00 -2.3947127635091343e+00 3.7898084963605735e-02 + 17 2.2314319778419343e+00 -2.1022876263990393e+00 1.1486586486933228e+00 + 18 2.1339901615202725e+00 3.0158791355914092e+00 -3.5183828730903643e+00 + 19 1.5352491765678440e+00 2.6247671297589257e+00 -4.2375921810526602e+00 + 20 2.7752225351538069e+00 3.6931319090244483e+00 -3.9339826175053725e+00 + 21 4.9009803165421442e+00 -4.0745404736656203e+00 -3.6228510538925023e+00 + 22 4.3679206782268585e+00 -4.2117777340324549e+00 -4.4559421729556803e+00 + 23 5.7469587988417672e+00 -3.5858038792020333e+00 -3.8747167803563598e+00 + 24 2.0670666352241178e+00 3.1530720129788077e+00 3.1541041395003924e+00 + 25 1.3109853135785989e+00 3.2657703855053795e+00 2.5153388842970363e+00 + 26 2.5813689868123637e+00 4.0055691627387287e+00 3.2207885803334761e+00 + 27 -1.9601054593669249e+00 -4.3545249904253041e+00 2.1090702834664450e+00 + 28 -2.7460065388962032e+00 -4.0225877485635015e+00 1.5870129241176147e+00 + 29 -1.3183210257363591e+00 -3.6009974737008963e+00 2.2736573716188233e+00 +run_vel: ! |2 + 1 3.7977419185848097e-03 -1.2897669714584856e-03 -4.1950151251349604e-03 + 2 2.1575172581734408e-03 3.3999203430656075e-03 3.7400839475233913e-03 + 3 6.4262848510624609e-04 6.9265031484497313e-03 2.5714895877023557e-03 + 4 -1.8679239811759064e-03 -2.9813578087670117e-03 -2.8820882510653990e-03 + 5 -4.5136571372885112e-03 -2.6758289003017102e-03 -1.1209155388337711e-03 + 6 1.1037671134296492e-03 2.5866105050619246e-03 -1.2789549161066559e-03 + 7 -1.5342861422661686e-03 3.2481824192138846e-04 -6.5106555914167202e-04 + 8 -1.7354144798367277e-04 -3.3718731447888424e-03 5.8810120566168342e-03 + 9 9.1842435073134841e-04 -1.4702773441316094e-03 1.3826250682568268e-03 + 10 1.8250546263153188e-03 3.0026348558799894e-03 -4.0657750868727510e-03 + 11 -1.5361372713327986e-03 -1.9715983670545788e-03 -2.2928062204248456e-03 + 12 -5.2715705670034873e-04 -1.2049239009499940e-03 -2.1898118814179450e-03 + 13 3.9856626950166771e-03 4.3066930552004591e-03 -7.5097419634071252e-04 + 14 1.5331088183544960e-03 -4.6807759413229257e-03 -3.7592753709259140e-03 + 15 -3.0333470556333213e-03 -4.2544006359050701e-03 4.1544659083419620e-03 + 16 8.5032527220227317e-04 1.4960209341250981e-03 3.3943991963756425e-03 + 17 -2.5150987291715812e-04 -3.3871968539122063e-04 -1.3110122226154578e-03 + 18 -3.7194157533833472e-03 -7.8097728820252952e-04 -1.9105012016605539e-03 + 19 9.9357069481510198e-04 -3.2384951918997540e-03 5.3187556083604745e-03 + 20 6.2100808371219670e-03 4.5760237622866403e-03 2.3397927895772242e-03 + 21 -4.4361083278321254e-03 4.3281730793372350e-04 -1.0265740062531993e-03 + 22 2.3759782136059185e-03 -3.4766457991458125e-03 5.2602144818325288e-03 + 23 9.0442546211972809e-03 -5.0028513128573702e-03 4.5160680978488929e-03 + 24 -1.5158245979151304e-03 6.8210911564513992e-04 -7.5228991658315980e-04 + 25 6.4198421777612721e-03 -5.1099391053400440e-03 3.2035258023780651e-03 + 26 2.5717204131090240e-03 -3.2330590784595391e-03 3.9089372482089858e-03 + 27 1.4748018001575585e-03 6.9455594382931529e-04 -5.3514527521761964e-04 + 28 -5.0752470104177567e-03 -9.9571139633829468e-04 2.0584364913419587e-03 + 29 -4.8690861937706323e-03 -1.3519584410798830e-03 2.8068671849969034e-03 +... From a8c1359c54ed394e8e52a347b2a94a92692c910f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 11 Mar 2023 18:56:29 -0500 Subject: [PATCH 080/112] make energy handling consistent for variable field --- src/EXTRA-FIX/fix_efield_tip4p.cpp | 33 +++++-------------- src/EXTRA-FIX/fix_efield_tip4p.h | 2 +- src/fix_efield.cpp | 7 +--- .../fix-timestep-efield_tip4p_variable.yaml | 4 +-- 4 files changed, 12 insertions(+), 34 deletions(-) diff --git a/src/EXTRA-FIX/fix_efield_tip4p.cpp b/src/EXTRA-FIX/fix_efield_tip4p.cpp index 4bd35882f9..a204fe6f7d 100644 --- a/src/EXTRA-FIX/fix_efield_tip4p.cpp +++ b/src/EXTRA-FIX/fix_efield_tip4p.cpp @@ -152,9 +152,9 @@ void FixEfieldTIP4P::post_force(int vflag) } if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR, "TIP4P hydrogen is missing"); if (iO == -1) error->one(FLERR, "TIP4P oxygen is missing"); - if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) + if ((type[iH1] != typeH) || (type[iH2] != typeH)) error->one(FLERR, "TIP4P hydrogen has incorrect atom type"); - if (atom->type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); + if (type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); iH1 = domain->closest_image(i, iH1); iH2 = domain->closest_image(i, iH2); @@ -399,9 +399,9 @@ void FixEfieldTIP4P::post_force(int vflag) } if ((iH1 == -1) || (iH2 == -1)) error->one(FLERR, "TIP4P hydrogen is missing"); if (iO == -1) error->one(FLERR, "TIP4P oxygen is missing"); - if ((atom->type[iH1] != typeH) || (atom->type[iH2] != typeH)) + if ((type[iH1] != typeH) || (type[iH2] != typeH)) error->one(FLERR, "TIP4P hydrogen has incorrect atom type"); - if (atom->type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); + if (type[iO] != typeO) error->one(FLERR, "TIP4P oxygen has incorrect atom type"); iH1 = domain->closest_image(i, iH1); iH2 = domain->closest_image(i, iH2); @@ -459,11 +459,7 @@ void FixEfieldTIP4P::post_force(int vflag) } if (i == iO) { - domain->unmap(xM, image[iO], unwrap); - if (estyle == ATOM) - fsum[0] += efield[0][3]; - else - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + if (estyle == ATOM) fsum[0] += efield[0][3]; fsum[1] += fx; fsum[2] += fy; fsum[3] += fz; @@ -509,11 +505,7 @@ void FixEfieldTIP4P::post_force(int vflag) // tally global force - domain->unmap(x[iH1], image[iH1], unwrap); - if (estyle == ATOM) - fsum[0] += efield[0][3]; - else - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + if (estyle == ATOM) fsum[0] += efield[0][3]; fsum[1] += fx; fsum[2] += fy; fsum[3] += fz; @@ -559,11 +551,7 @@ void FixEfieldTIP4P::post_force(int vflag) // tally global force - domain->unmap(x[iH2], image[iH2], unwrap); - if (estyle == ATOM) - fsum[0] += efield[0][3]; - else - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; + if (estyle == ATOM) fsum[0] += efield[0][3]; fsum[1] += fx; fsum[2] += fy; fsum[3] += fz; @@ -611,12 +599,7 @@ void FixEfieldTIP4P::post_force(int vflag) f[i][2] += fz; fsum[3] += fz; - if (estyle == ATOM) { - fsum[0] += efield[0][3]; - } else { - domain->unmap(x[i], image[i], unwrap); - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - } + if (estyle == ATOM) fsum[0] += efield[0][3]; } } } diff --git a/src/EXTRA-FIX/fix_efield_tip4p.h b/src/EXTRA-FIX/fix_efield_tip4p.h index 7970e67b3b..6c3cfa58ab 100644 --- a/src/EXTRA-FIX/fix_efield_tip4p.h +++ b/src/EXTRA-FIX/fix_efield_tip4p.h @@ -34,7 +34,7 @@ class FixEfieldTIP4P : public FixEfield { protected: double alpha; - int typeO, typeH; // atom types for TIP4P molecule + int typeO, typeH; // atom types for TIP4P molecule void find_M(double *, double *, double *, double *); }; } // namespace LAMMPS_NS diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp index f8ff377518..3046f21ef3 100644 --- a/src/fix_efield.cpp +++ b/src/fix_efield.cpp @@ -387,12 +387,7 @@ void FixEfield::post_force(int vflag) } f[i][2] += fz; fsum[3] += fz; - if (estyle == ATOM) { - fsum[0] += efield[0][3]; - } else { - domain->unmap(x[i], image[i], unwrap); - fsum[0] -= fx * unwrap[0] + fy * unwrap[1] + fz * unwrap[2]; - } + if (estyle == ATOM) fsum[0] += efield[0][3]; } } diff --git a/unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml b/unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml index 9d3eb78b8a..e364de7d07 100644 --- a/unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml +++ b/unittest/force-styles/tests/fix-timestep-efield_tip4p_variable.yaml @@ -1,6 +1,6 @@ --- lammps_version: 8 Feb 2023 -date_generated: Sat Mar 11 18:36:57 2023 +date_generated: Sat Mar 11 18:52:03 2023 epsilon: 2e-13 skip_tests: prerequisites: ! | @@ -24,7 +24,7 @@ post_commands: ! | fix test all efield/tip4p v_xforce 0.0 v_zforce input_file: in.fourmol natoms: 29 -global_scalar: -108.06823025980506 +global_scalar: 0 global_vector: ! |- 3 9.596230365887404 0 -4.440892098500626e-16 run_pos: ! |2 From 21293f1c08a3217e8ce29a95e5d4db7de0562152 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Mar 2023 12:10:14 -0400 Subject: [PATCH 081/112] update links and hashes for new plumed2 releases --- cmake/Modules/Packages/PLUMED.cmake | 4 ++-- lib/plumed/Install.py | 8 +++++--- tools/singularity/almalinux9.def | 2 +- tools/singularity/centos7.def | 2 +- tools/singularity/centos8.def | 2 +- tools/singularity/fedora35_mingw.def | 2 +- tools/singularity/fedora36_mingw.def | 2 +- tools/singularity/rocky8.def | 2 +- tools/singularity/ubuntu18.04.def | 2 +- tools/singularity/ubuntu18.04_amd_rocm.def | 2 +- tools/singularity/ubuntu18.04_gpu.def | 2 +- tools/singularity/ubuntu18.04_intel_opencl.def | 2 +- tools/singularity/ubuntu18.04_nvidia.def | 2 +- tools/singularity/ubuntu20.04.def | 2 +- tools/singularity/ubuntu20.04_amd_rocm.def | 2 +- tools/singularity/ubuntu20.04_gpu.def | 2 +- tools/singularity/ubuntu20.04_intel_opencl.def | 2 +- tools/singularity/ubuntu20.04_nvidia.def | 2 +- tools/singularity/ubuntu20.04_oneapi.def | 2 +- tools/singularity/ubuntu22.04.def | 2 +- 20 files changed, 25 insertions(+), 23 deletions(-) diff --git a/cmake/Modules/Packages/PLUMED.cmake b/cmake/Modules/Packages/PLUMED.cmake index f231d148bd..9a4a9556ee 100644 --- a/cmake/Modules/Packages/PLUMED.cmake +++ b/cmake/Modules/Packages/PLUMED.cmake @@ -54,8 +54,8 @@ if(DOWNLOAD_PLUMED) set(PLUMED_BUILD_BYPRODUCTS "/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumedWrapper${CMAKE_STATIC_LIBRARY_PREFIX}") endif() - set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.8.1/plumed-src-2.8.1.tgz" CACHE STRING "URL for PLUMED tarball") - set(PLUMED_MD5 "6bfe72ebdae63dc38a9ca27d9b0e08f8" CACHE STRING "MD5 checksum of PLUMED tarball") + set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.8.2/plumed-src-2.8.2.tgz" CACHE STRING "URL for PLUMED tarball") + set(PLUMED_MD5 "599092b6a0aa6fff992612537ad98994" CACHE STRING "MD5 checksum of PLUMED tarball") mark_as_advanced(PLUMED_URL) mark_as_advanced(PLUMED_MD5) diff --git a/lib/plumed/Install.py b/lib/plumed/Install.py index bb6f27fddb..21e8ac51ff 100644 --- a/lib/plumed/Install.py +++ b/lib/plumed/Install.py @@ -17,17 +17,17 @@ parser = ArgumentParser(prog='Install.py', # settings -version = "2.8.1" +version = "2.8.2" mode = "static" # help message HELP = """ Syntax from src dir: make lib-plumed args="-b" - or: make lib-plumed args="-b -v 2.4.3" + or: make lib-plumed args="-b -v 2.8.2" or: make lib-plumed args="-p /usr/local/plumed2 -m shared" -Syntax from lib dir: python Install.py -b -v 2.4.3 +Syntax from lib dir: python Install.py -b -v 2.8.2 or: python Install.py -b or: python Install.py -p /usr/local/plumed2 -m shared @@ -59,8 +59,10 @@ checksums = { \ '2.7.3' : 'f00cc82edfefe6bb3df934911dbe32fb', \ '2.7.4' : 'f858e0b6aed173748fc85b6bc8a9dcb3', \ '2.7.5' : '2aca1986d6c1ca3ba7e9eb51b1102792', \ + '2.7.6' : 'fb8c0ec10f97a9353eb123a5c4c35aa6', \ '2.8.0' : '489b23daba70da78cf0506cbc31689c6', \ '2.8.1' : '6bfe72ebdae63dc38a9ca27d9b0e08f8', \ + '2.8.2' : '599092b6a0aa6fff992612537ad98994', \ } # parse and process arguments diff --git a/tools/singularity/almalinux9.def b/tools/singularity/almalinux9.def index e16ebbbdb5..eacaf3b565 100644 --- a/tools/singularity/almalinux9.def +++ b/tools/singularity/almalinux9.def @@ -44,7 +44,7 @@ From: library/almalinux:9 # manually install Plumed mkdir plumed cd plumed - version=2.8.1 + version=2.8.2 curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz tar -xzf plumed.tar.gz cd plumed-${version} diff --git a/tools/singularity/centos7.def b/tools/singularity/centos7.def index c0fe278e94..fcdb2ff204 100644 --- a/tools/singularity/centos7.def +++ b/tools/singularity/centos7.def @@ -37,7 +37,7 @@ From: library/centos:7 # manually install Plumed mkdir plumed cd plumed - version=2.8.1 + version=2.8.2 curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz tar -xzf plumed.tar.gz cd plumed-${version} diff --git a/tools/singularity/centos8.def b/tools/singularity/centos8.def index 7cb0c51a9e..97f818f9eb 100644 --- a/tools/singularity/centos8.def +++ b/tools/singularity/centos8.def @@ -42,7 +42,7 @@ From: centos:8 # manually install Plumed mkdir plumed cd plumed - version=2.8.1 + version=2.8.2 curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz tar -xzf plumed.tar.gz cd plumed-${version} diff --git a/tools/singularity/fedora35_mingw.def b/tools/singularity/fedora35_mingw.def index 2661c77db4..693512bb97 100644 --- a/tools/singularity/fedora35_mingw.def +++ b/tools/singularity/fedora35_mingw.def @@ -49,7 +49,7 @@ From: fedora:35 # manually install Plumed mkdir plumed cd plumed - version=2.8.1 + version=2.8.2 curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz tar -xzf plumed.tar.gz cd plumed-${version} diff --git a/tools/singularity/fedora36_mingw.def b/tools/singularity/fedora36_mingw.def index 873b646e84..09c3a71d94 100644 --- a/tools/singularity/fedora36_mingw.def +++ b/tools/singularity/fedora36_mingw.def @@ -49,7 +49,7 @@ From: fedora:36 # manually install Plumed mkdir plumed cd plumed - version=2.8.1 + version=2.8.2 curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz tar -xzf plumed.tar.gz cd plumed-${version} diff --git a/tools/singularity/rocky8.def b/tools/singularity/rocky8.def index 0882bfd72b..bd076b5f6c 100644 --- a/tools/singularity/rocky8.def +++ b/tools/singularity/rocky8.def @@ -43,7 +43,7 @@ From: rockylinux/rockylinux:8 # manually install Plumed mkdir plumed cd plumed - version=2.8.1 + version=2.8.2 curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz tar -xzf plumed.tar.gz cd plumed-${version} diff --git a/tools/singularity/ubuntu18.04.def b/tools/singularity/ubuntu18.04.def index 02351d9ecb..142ef7ffd4 100644 --- a/tools/singularity/ubuntu18.04.def +++ b/tools/singularity/ubuntu18.04.def @@ -107,7 +107,7 @@ From: ubuntu:18.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu18.04_amd_rocm.def b/tools/singularity/ubuntu18.04_amd_rocm.def index 38eaa6e322..4b9c53f00b 100644 --- a/tools/singularity/ubuntu18.04_amd_rocm.def +++ b/tools/singularity/ubuntu18.04_amd_rocm.def @@ -136,7 +136,7 @@ From: ubuntu:18.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu18.04_gpu.def b/tools/singularity/ubuntu18.04_gpu.def index 0bfccf915b..7fa4e8ae4d 100644 --- a/tools/singularity/ubuntu18.04_gpu.def +++ b/tools/singularity/ubuntu18.04_gpu.def @@ -175,7 +175,7 @@ From: ubuntu:18.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu18.04_intel_opencl.def b/tools/singularity/ubuntu18.04_intel_opencl.def index 2d562771bb..d6c9c65690 100644 --- a/tools/singularity/ubuntu18.04_intel_opencl.def +++ b/tools/singularity/ubuntu18.04_intel_opencl.def @@ -108,7 +108,7 @@ From: ubuntu:18.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu18.04_nvidia.def b/tools/singularity/ubuntu18.04_nvidia.def index 2a3a34b1b2..91b0465a6d 100644 --- a/tools/singularity/ubuntu18.04_nvidia.def +++ b/tools/singularity/ubuntu18.04_nvidia.def @@ -107,7 +107,7 @@ From: nvidia/cuda:11.6.2-devel-ubuntu18.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu20.04.def b/tools/singularity/ubuntu20.04.def index 2a2a1dd660..d62b4c9f86 100644 --- a/tools/singularity/ubuntu20.04.def +++ b/tools/singularity/ubuntu20.04.def @@ -103,7 +103,7 @@ From: ubuntu:20.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu20.04_amd_rocm.def b/tools/singularity/ubuntu20.04_amd_rocm.def index f947de9ee9..753f215469 100644 --- a/tools/singularity/ubuntu20.04_amd_rocm.def +++ b/tools/singularity/ubuntu20.04_amd_rocm.def @@ -123,7 +123,7 @@ From: ubuntu:20.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu20.04_gpu.def b/tools/singularity/ubuntu20.04_gpu.def index 05da01ccac..115ca6eee5 100644 --- a/tools/singularity/ubuntu20.04_gpu.def +++ b/tools/singularity/ubuntu20.04_gpu.def @@ -161,7 +161,7 @@ From: ubuntu:20.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu20.04_intel_opencl.def b/tools/singularity/ubuntu20.04_intel_opencl.def index cc547fef29..c8680a16c7 100644 --- a/tools/singularity/ubuntu20.04_intel_opencl.def +++ b/tools/singularity/ubuntu20.04_intel_opencl.def @@ -101,7 +101,7 @@ From: ubuntu:20.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu20.04_nvidia.def b/tools/singularity/ubuntu20.04_nvidia.def index 8ec334ad8b..3affc30b8b 100644 --- a/tools/singularity/ubuntu20.04_nvidia.def +++ b/tools/singularity/ubuntu20.04_nvidia.def @@ -103,7 +103,7 @@ From: nvidia/cuda:11.6.2-devel-ubuntu20.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu20.04_oneapi.def b/tools/singularity/ubuntu20.04_oneapi.def index 25c913f392..70d69c7d80 100644 --- a/tools/singularity/ubuntu20.04_oneapi.def +++ b/tools/singularity/ubuntu20.04_oneapi.def @@ -140,7 +140,7 @@ From: ubuntu:20.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed diff --git a/tools/singularity/ubuntu22.04.def b/tools/singularity/ubuntu22.04.def index 8a4f262f75..ef43347982 100644 --- a/tools/singularity/ubuntu22.04.def +++ b/tools/singularity/ubuntu22.04.def @@ -103,7 +103,7 @@ From: ubuntu:22.04 # Plumed ########################################################################### - export PLUMED_PKG_VERSION=2.8.1 + export PLUMED_PKG_VERSION=2.8.2 mkdir plumed cd plumed From 3815c0ef76b100bdee330a8ed64d2de76e879dae Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Mon, 13 Mar 2023 17:00:54 -0600 Subject: [PATCH 082/112] modify fix STORE/PERATOM and callers to allow ghost comm --- src/AMOEBA/pair_amoeba.cpp | 6 +- src/CORESHELL/compute_temp_cs.cpp | 2 +- src/EXTRA-COMPUTE/compute_hma.cpp | 2 +- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 18 +-- src/EXTRA-MOLECULE/bond_harmonic_restrain.h | 2 +- src/FEP/fix_adapt_fep.cpp | 4 +- src/REPLICA/tad.cpp | 2 +- src/VTK/dump_vtk.cpp | 2 +- src/balance.cpp | 2 +- src/compute_chunk_atom.cpp | 2 +- src/compute_displace_atom.cpp | 2 +- src/compute_msd.cpp | 2 +- src/compute_vacf.cpp | 2 +- src/dump_custom.cpp | 2 +- src/fix_adapt.cpp | 4 +- src/fix_store_peratom.cpp | 145 +++++++++++++----- src/fix_store_peratom.h | 8 +- src/variable.cpp | 2 +- 18 files changed, 140 insertions(+), 69 deletions(-) diff --git a/src/AMOEBA/pair_amoeba.cpp b/src/AMOEBA/pair_amoeba.cpp index 0812fe43f0..319bbd8925 100644 --- a/src/AMOEBA/pair_amoeba.cpp +++ b/src/AMOEBA/pair_amoeba.cpp @@ -861,7 +861,7 @@ void PairAmoeba::init_style() Fix *myfix; if (first_flag) { id_pole = utils::strdup("AMOEBA_pole"); - myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 13",id_pole,group->names[0])); + myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM 13 0 0 1",id_pole,group->names[0])); fixpole = dynamic_cast(myfix); } @@ -873,12 +873,12 @@ void PairAmoeba::init_style() if (first_flag && use_pred) { id_udalt = utils::strdup("AMOEBA_udalt"); - myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 {} 3", + myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM {} 3 0 1", id_udalt, group->names[0], maxualt)); fixudalt = dynamic_cast(myfix); id_upalt = utils::strdup("AMOEBA_upalt"); - myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 {} 3", + myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM {} 3 0 1", id_upalt, group->names[0], maxualt)); fixupalt = dynamic_cast(myfix); } diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp index c28d52e5b2..b0ec39e542 100644 --- a/src/CORESHELL/compute_temp_cs.cpp +++ b/src/CORESHELL/compute_temp_cs.cpp @@ -68,7 +68,7 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 0 1", id_fix, group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 0", id_fix, group->names[igroup]))); // set fix store values = 0 for now // fill them in via setup() once Comm::borders() has been called diff --git a/src/EXTRA-COMPUTE/compute_hma.cpp b/src/EXTRA-COMPUTE/compute_hma.cpp index 0f7279a5f5..806228faef 100644 --- a/src/EXTRA-COMPUTE/compute_hma.cpp +++ b/src/EXTRA-COMPUTE/compute_hma.cpp @@ -91,7 +91,7 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : id_fix = utils::strdup(std::string(id)+"_COMPUTE_STORE"); fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 3", id_fix, group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index a15642f90b..59bab65713 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -17,7 +17,7 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "fix_property_atom.h" +#include "fix_store_peratom.h" #include "force.h" #include "memory.h" #include "modify.h" @@ -59,7 +59,7 @@ void BondHarmonicRestrain::compute(int eflag, int vflag) ev_init(eflag, vflag); double **x = atom->x; - double **x0 = (double **) atom->extract("d2_BOND_RESTRAIN_X0"); + double **x0 = initial->astore; double **f = atom->f; int **bondlist = neighbor->bondlist; int nbondlist = neighbor->nbondlist; @@ -162,12 +162,12 @@ void BondHarmonicRestrain::init_style() if (natoms < 0) { // create internal fix to store initial positions - initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN_X0 all property/atom d2_BOND_RESTRAIN_X0 3 ghost yes")); + initial = dynamic_cast( + modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); natoms = atom->natoms; - double *const *const x0 = (double **) atom->extract("d2_BOND_RESTRAIN_X0"); + double **x0 = initial->astore; const double *const *const x = atom->x; for (int i = 0; i < atom->nlocal; ++i) for (int j = 0; j < 3; ++j) x0[i][j] = x[i][j]; @@ -176,10 +176,10 @@ void BondHarmonicRestrain::init_style() // after a restart, natoms is set but initial is a null pointer. // we add the fix, but do not initialize it. It will pull the data from the restart. - + if (!initial) { - initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN_X0 all property/atom d2_BOND_RESTRAIN_X0 3 ghost yes")); + initial = dynamic_cast( + modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); } } @@ -230,7 +230,7 @@ void BondHarmonicRestrain::write_data(FILE *fp) double BondHarmonicRestrain::single(int type, double rsq, int i, int j, double &fforce) { - double **x0 = (double **) atom->extract("d2_BOND_RESTRAIN_X0"); + double **x0 = initial->astore; double delx = x0[i][0] - x0[j][0]; double dely = x0[i][1] - x0[j][1]; diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.h b/src/EXTRA-MOLECULE/bond_harmonic_restrain.h index e17c21e125..61d01ab9b2 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.h +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.h @@ -41,7 +41,7 @@ class BondHarmonicRestrain : public Bond { protected: double *k; bigint natoms; - class FixPropertyAtom *initial; + class FixStorePeratom *initial; virtual void allocate(); }; diff --git a/src/FEP/fix_adapt_fep.cpp b/src/FEP/fix_adapt_fep.cpp index 2d2409d27f..3f3d26c4d9 100644 --- a/src/FEP/fix_adapt_fep.cpp +++ b/src/FEP/fix_adapt_fep.cpp @@ -212,7 +212,7 @@ void FixAdaptFEP::post_constructor() if (diamflag) { id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM")); fix_diam = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 1", id_fix_diam,group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix_diam,group->names[igroup]))); if (fix_diam->restart_reset) fix_diam->restart_reset = 0; else { double *vec = fix_diam->vstore; @@ -230,7 +230,7 @@ void FixAdaptFEP::post_constructor() if (chgflag) { id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG")); fix_chg = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 1",id_fix_chg,group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1",id_fix_chg,group->names[igroup]))); if (fix_chg->restart_reset) fix_chg->restart_reset = 0; else { double *vec = fix_chg->vstore; diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index d89cbe80ba..e98cd39233 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -135,7 +135,7 @@ void TAD::command(int narg, char **arg) // create FixStorePeratom object to store revert state - fix_revert = dynamic_cast(modify->add_fix("tad_revert all STORE/PERATOM 0 7")); + fix_revert = dynamic_cast(modify->add_fix("tad_revert all STORE/PERATOM 7 0 0 0")); // create Finish for timing output diff --git a/src/VTK/dump_vtk.cpp b/src/VTK/dump_vtk.cpp index a188a1f060..c4dd68bf3c 100644 --- a/src/VTK/dump_vtk.cpp +++ b/src/VTK/dump_vtk.cpp @@ -2365,7 +2365,7 @@ int DumpVTK::modify_param(int narg, char **arg) std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast); thresh_fixID[nthreshlast] = utils::strdup(threshid); - threshid += fmt::format(" {} STORE/PERATOM 1 1", group->names[igroup]); + threshid += fmt::format(" {} STORE/PERATOM 1 0 0 1", group->names[igroup]); thresh_fix[nthreshlast] = dynamic_cast(modify->add_fix(threshid)); thresh_last[nthreshlast] = nthreshlast; diff --git a/src/balance.cpp b/src/balance.cpp index 91b9d70378..8d1ba460db 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -515,7 +515,7 @@ void Balance::weight_storage(char *prefix) fixstore = dynamic_cast(modify->get_fix_by_id(cmd)); if (!fixstore) - fixstore = dynamic_cast(modify->add_fix(cmd + " all STORE/PERATOM 0 1")); + fixstore = dynamic_cast(modify->add_fix(cmd + " all STORE/PERATOM 1 0 0 0")); // do not carry weights with atoms during normal atom migration diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index f9723497b1..b59449989b 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -572,7 +572,7 @@ void ComputeChunkAtom::init() if ((idsflag == ONCE || lockcount) && !fixstore) { id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); fixstore = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 1", id_fix, group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix, group->names[igroup]))); } if ((idsflag != ONCE && !lockcount) && fixstore) { diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index 0b1ffff687..6f352fa111 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -75,7 +75,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : id_fix = utils::strdup(std::string(id) + "_COMPUTE_STORE"); fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 3", id_fix, group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index 8b7043e20d..ecbb540a48 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -64,7 +64,7 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, a id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 3", id_fix, group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index 4e209f8612..9d6018d05b 100644 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -40,7 +40,7 @@ ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) : id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 3", id_fix, group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); // store current velocities in fix store array // skip if reset from restart file diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 8d64e532a4..922fd4f6fc 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -2013,7 +2013,7 @@ int DumpCustom::modify_param(int narg, char **arg) std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast); thresh_fixID[nthreshlast] = utils::strdup(threshid); - threshid += fmt::format(" {} STORE/PERATOM 1 1", group->names[igroup]); + threshid += fmt::format(" {} STORE/PERATOM 1 0 0 1", group->names[igroup]); thresh_fix[nthreshlast] = dynamic_cast(modify->add_fix(threshid)); thresh_last[nthreshlast] = nthreshlast; diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index e0eaeb864e..98cf955485 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -279,7 +279,7 @@ void FixAdapt::post_constructor() if (diamflag && atom->radius_flag) { id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM")); fix_diam = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 1", id_fix_diam,group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix_diam,group->names[igroup]))); if (fix_diam->restart_reset) fix_diam->restart_reset = 0; else { double *vec = fix_diam->vstore; @@ -297,7 +297,7 @@ void FixAdapt::post_constructor() if (chgflag && atom->q_flag) { id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG")); fix_chg = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 1",id_fix_chg,group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1",id_fix_chg,group->names[igroup]))); if (fix_chg->restart_reset) fix_chg->restart_reset = 0; else { double *vec = fix_chg->vstore; diff --git a/src/fix_store_peratom.cpp b/src/fix_store_peratom.cpp index 6f5637e3f6..f9f3b5540f 100644 --- a/src/fix_store_peratom.cpp +++ b/src/fix_store_peratom.cpp @@ -22,50 +22,57 @@ using namespace LAMMPS_NS; using namespace FixConst; +// INTERNAL fix for storing/communicating per-atom values +// syntax: id group style n1 n2 gflag rflag +// N1 = 1, N2 = 0 is per-atom vector, single value per atom +// N1 > 1, N2 = 0 is per-atom array, N1 values per atom +// N1 > 0, N2 > 0 is per-atom tensor, N1xN2 array per atom +// gflag = 0/1, no/yes communicate per-atom values with ghost atoms +// rflag = 0/1, no/yes store per-atom values in restart file + /* ---------------------------------------------------------------------- */ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), vstore(nullptr), astore(nullptr) { - if (narg != 5 && narg != 6) + if (narg != 8) error->all(FLERR, "Illegal fix STORE/PERATOM command: number of args"); - // syntax: id group style 0/1 n1 n2 (n3), last arg optional - // 0/1 flag = not-store or store peratom values in restart file - // N2 = 1 and no n3 is vector, N2 > 1 and no n3 is array, N3 = tensor - // nvalues = # of peratom values, N = 1 is vector, N > 1 is array - disable = 0; - vecflag = arrayflag = tensorflag = 0; - restart_peratom = utils::inumeric(FLERR, arg[3], false, lmp); - n2 = utils::inumeric(FLERR, arg[4], false, lmp); - if (narg == 6) - n3 = utils::inumeric(FLERR, arg[5], false, lmp); - else - n3 = 1; - if (restart_peratom < 0 || restart_peratom > 1) - error->all(FLERR, "Illegal fix STORE/PERATOM restart flag: {}", restart_peratom); - if (n2 <= 0 || n3 <= 0) - error->all(FLERR, "Illegal fix STORE/PERATOM dimension args: must be >0: {} {}", n2, n3); - if (n2 == 1 && narg == 5) - vecflag = 1; - else if (narg == 5) - arrayflag = 1; - else - tensorflag = 1; - nvalues = n2 * n3; + n1 = utils::inumeric(FLERR, arg[4], false, lmp); + n2 = utils::inumeric(FLERR, arg[5], false, lmp); + ghostflag = utils::inumeric(FLERR, arg[6], false, lmp); + restartflag = utils::inumeric(FLERR, arg[7], false, lmp); + + vecflag = arrayflag = tensorflag = 0; + if (n1 == 1 && n2 == 0) vecflag = 1; + else if (n1 > 1 && n2 == 0) arrayflag = 1; + else if (n1 > 0 && n2 > 0) tensorflag = 1; + else error->all(FLERR, "Illegal fix STORE/PERATOM dimension args: {} {}", n1, n2); + + if (restartflag < 0 || restartflag > 1) + error->all(FLERR, "Illegal fix STORE/PERATOM restart flag: {}", restartflag); + if (ghostflag < 0 || ghostflag > 1) + error->all(FLERR, "Illegal fix STORE/PERATOM ghost flag: {}", ghostflag); + + if (vecflag || arrayflag) nvalues = n1; + else nvalues = n1 * n2; nbytes = nvalues * sizeof(double); + if (ghostflag) comm_border = nvalues; + maxexchange = nvalues; + + // allocate data structs and register with Atom class + vstore = nullptr; astore = nullptr; tstore = nullptr; - // allocate data structs and register with Atom class - FixStorePeratom::grow_arrays(atom->nmax); atom->add_callback(Atom::GROW); - if (restart_peratom) atom->add_callback(Atom::RESTART); + if (restartflag) atom->add_callback(Atom::RESTART); + if (ghostflag) atom->add_callback(Atom::BORDER); // zero the storage @@ -74,13 +81,12 @@ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nlocal; i++) vstore[i] = 0.0; } else if (arrayflag) { for (int i = 0; i < nlocal; i++) - for (int j = 0; j < n2; j++) astore[i][j] = 0.0; + for (int j = 0; j < n1; j++) astore[i][j] = 0.0; } else if (tensorflag) { for (int i = 0; i < nlocal; i++) - for (int j = 0; j < n2; j++) - for (int k = 0; k < n3; k++) tstore[i][j][k] = 0.0; + for (int j = 0; j < n1; j++) + for (int k = 0; k < n2; k++) tstore[i][j][k] = 0.0; } - maxexchange = nvalues; } /* ---------------------------------------------------------------------- */ @@ -90,7 +96,8 @@ FixStorePeratom::~FixStorePeratom() // unregister callbacks to this fix from Atom class atom->delete_callback(id, Atom::GROW); - if (restart_peratom) atom->delete_callback(id, Atom::RESTART); + if (restartflag) atom->delete_callback(id, Atom::RESTART); + if (ghostflag) atom->delete_callback(id, Atom::BORDER); memory->destroy(vstore); memory->destroy(astore); @@ -114,9 +121,9 @@ void FixStorePeratom::grow_arrays(int nmax) if (vecflag) memory->grow(vstore, nmax, "store:vstore"); else if (arrayflag) - memory->grow(astore, nmax, n2, "store:astore"); + memory->grow(astore, nmax, n1, "store:astore"); else if (tensorflag) - memory->grow(tstore, nmax, n2, n3, "store:tstore"); + memory->grow(tstore, nmax, n1, n2, "store:tstore"); } /* ---------------------------------------------------------------------- @@ -136,6 +143,62 @@ void FixStorePeratom::copy_arrays(int i, int j, int /*delflag*/) } } +/* ---------------------------------------------------------------------- + pack values for border communication at re-neighboring +------------------------------------------------------------------------- */ + +int FixStorePeratom::pack_border(int n, int *list, double *buf) +{ + int i, j, k, ncol; + + int m = 0; + if (vecflag) { + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = vstore[j]; + } + } else if (arrayflag) { + for (i = 0; i < n; i++) { + j = list[i]; + for (k = 0; k < nvalues; k++) + buf[m++] = astore[j][k]; + } + } else if (tensorflag) { + for (i = 0; i < n; i++) { + j = list[i]; + memcpy(&buf[m], &tstore[j][0][0], nbytes); + m += nvalues; + } + } + + return m; +} + +/* ---------------------------------------------------------------------- + unpack values for border communication at re-neighboring +------------------------------------------------------------------------- */ + +int FixStorePeratom::unpack_border(int n, int first, double *buf) +{ + int i, k, last, ncol; + + int m = 0; + last = first + n; + if (vecflag) { + for (i = first; i < last; i++) + vstore[i] = buf[m++]; + } else if (arrayflag) { + for (i = first; i < last; i++) + for (k = 0; k < nvalues; k++) + astore[i][k] = buf[m++]; + } else if (tensorflag) { + for (i = first; i < last; i++) { + memcpy(&tstore[i][0][0], &buf[m], nbytes); + m += nvalues; + } + } +} + /* ---------------------------------------------------------------------- pack values in local atom-based array for exchange with another proc ------------------------------------------------------------------------- */ @@ -147,7 +210,8 @@ int FixStorePeratom::pack_exchange(int i, double *buf) if (vecflag) { buf[0] = vstore[i]; } else if (arrayflag) { - for (int m = 0; m < nvalues; m++) buf[m] = astore[i][m]; + for (int m = 0; m < nvalues; m++) + buf[m] = astore[i][m]; } else if (tensorflag) { memcpy(buf, &tstore[i][0][0], nbytes); } @@ -166,7 +230,8 @@ int FixStorePeratom::unpack_exchange(int nlocal, double *buf) if (vecflag) { vstore[nlocal] = buf[0]; } else if (arrayflag) { - for (int m = 0; m < nvalues; m++) astore[nlocal][m] = buf[m]; + for (int m = 0; m < nvalues; m++) + astore[nlocal][m] = buf[m]; } else if (tensorflag) { memcpy(&tstore[nlocal][0][0], buf, nbytes); } @@ -191,7 +256,8 @@ int FixStorePeratom::pack_restart(int i, double *buf) if (vecflag) { buf[1] = vstore[i]; } else if (arrayflag) { - for (int m = 0; m < nvalues; m++) buf[m + 1] = astore[i][m]; + for (int m = 0; m < nvalues; m++) + buf[m + 1] = astore[i][m]; } else if (tensorflag) { memcpy(&buf[1], &tstore[i][0][0], nbytes); } @@ -219,7 +285,8 @@ void FixStorePeratom::unpack_restart(int nlocal, int nth) if (vecflag) { vstore[nlocal] = extra[nlocal][m]; } else if (arrayflag) { - for (int i = 0; i < nvalues; i++) astore[nlocal][i] = extra[nlocal][m++]; + for (int i = 0; i < nvalues; i++) + astore[nlocal][i] = extra[nlocal][m++]; } else if (tensorflag) { memcpy(&tstore[nlocal][0][0], &extra[nlocal][m], nbytes); } @@ -251,5 +318,5 @@ int FixStorePeratom::size_restart(int /*nlocal*/) double FixStorePeratom::memory_usage() { - return (double) atom->nmax * n2 * n3 * sizeof(double); + return (double) atom->nmax * nvalues * sizeof(double); } diff --git a/src/fix_store_peratom.h b/src/fix_store_peratom.h index d3efe4142b..dcf28be265 100644 --- a/src/fix_store_peratom.h +++ b/src/fix_store_peratom.h @@ -37,6 +37,8 @@ class FixStorePeratom : public Fix { void grow_arrays(int) override; void copy_arrays(int, int, int) override; + int pack_border(int, int *, double *) override; + int unpack_border(int, int, double *) override; int pack_exchange(int, double *) override; int unpack_exchange(int, double *) override; int pack_restart(int, double *) override; @@ -50,8 +52,10 @@ class FixStorePeratom : public Fix { int vecflag; // 1 if ncol=1 int arrayflag; // 1 if a 2d array (vector per atom) int tensorflag; // 1 if a 3d array (array per atom) - - int n2, n3; // size of 3d dims of per-atom data struct + int ghostflag; // 0/1 to communicate values with ghost atoms + int restartflag; // 0/1 to store values in restart files + + int n1, n2; // size of 3d dims of per-atom data struct int nvalues; // number of per-atom values int nbytes; // number of per-atom bytes }; diff --git a/src/variable.cpp b/src/variable.cpp index 2ac9bd0364..56a0604a7e 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -5028,7 +5028,7 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : id_fix = utils::strdup(std::string(name) + "_VARIABLE_STORE"); fixstore = dynamic_cast( - modify->add_fix(std::string(id_fix) + " all STORE/PERATOM 0 1")); + modify->add_fix(std::string(id_fix) + " all STORE/PERATOM 1 0 0 0")); buffer = new char[CHUNK*MAXLINE]; } } From c369c0252f66a75b4d0036054ce6046515e477b1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Mar 2023 19:43:08 -0400 Subject: [PATCH 083/112] fix issues with changes in fix STORE/PERATOM --- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 2 +- src/fix_store_peratom.cpp | 66 +++++++++---------- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index 59bab65713..b71e60c286 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -179,7 +179,7 @@ void BondHarmonicRestrain::init_style() if (!initial) { initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1")); + modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); } } diff --git a/src/fix_store_peratom.cpp b/src/fix_store_peratom.cpp index f9f3b5540f..2a8429e42f 100644 --- a/src/fix_store_peratom.cpp +++ b/src/fix_store_peratom.cpp @@ -23,7 +23,7 @@ using namespace LAMMPS_NS; using namespace FixConst; // INTERNAL fix for storing/communicating per-atom values -// syntax: id group style n1 n2 gflag rflag +// syntax: id group style n1 n2 gflag rflag // N1 = 1, N2 = 0 is per-atom vector, single value per atom // N1 > 1, N2 = 0 is per-atom array, N1 values per atom // N1 > 0, N2 > 0 is per-atom tensor, N1xN2 array per atom @@ -35,34 +35,36 @@ using namespace FixConst; FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), vstore(nullptr), astore(nullptr) { - if (narg != 8) - error->all(FLERR, "Illegal fix STORE/PERATOM command: number of args"); + if (narg != 7) error->all(FLERR, "Illegal fix STORE/PERATOM command: number of args"); disable = 0; - n1 = utils::inumeric(FLERR, arg[4], false, lmp); - n2 = utils::inumeric(FLERR, arg[5], false, lmp); - ghostflag = utils::inumeric(FLERR, arg[6], false, lmp); - restartflag = utils::inumeric(FLERR, arg[7], false, lmp); + n1 = utils::inumeric(FLERR, arg[3], false, lmp); + n2 = utils::inumeric(FLERR, arg[4], false, lmp); + ghostflag = utils::logical(FLERR, arg[5], false, lmp); + restartflag = utils::logical(FLERR, arg[6], false, lmp); vecflag = arrayflag = tensorflag = 0; - if (n1 == 1 && n2 == 0) vecflag = 1; - else if (n1 > 1 && n2 == 0) arrayflag = 1; - else if (n1 > 0 && n2 > 0) tensorflag = 1; - else error->all(FLERR, "Illegal fix STORE/PERATOM dimension args: {} {}", n1, n2); - - if (restartflag < 0 || restartflag > 1) - error->all(FLERR, "Illegal fix STORE/PERATOM restart flag: {}", restartflag); - if (ghostflag < 0 || ghostflag > 1) - error->all(FLERR, "Illegal fix STORE/PERATOM ghost flag: {}", ghostflag); + if (n1 == 1 && n2 == 0) + vecflag = 1; + else if (n1 > 1 && n2 == 0) + arrayflag = 1; + else if (n1 > 0 && n2 > 0) + tensorflag = 1; + else + error->all(FLERR, "Illegal fix STORE/PERATOM dimension args: {} {}", n1, n2); - if (vecflag || arrayflag) nvalues = n1; - else nvalues = n1 * n2; + if (vecflag || arrayflag) + nvalues = n1; + else + nvalues = n1 * n2; nbytes = nvalues * sizeof(double); if (ghostflag) comm_border = nvalues; maxexchange = nvalues; - + + if (restartflag) restart_peratom = 1; + // allocate data structs and register with Atom class vstore = nullptr; @@ -149,7 +151,7 @@ void FixStorePeratom::copy_arrays(int i, int j, int /*delflag*/) int FixStorePeratom::pack_border(int n, int *list, double *buf) { - int i, j, k, ncol; + int i, j, k; int m = 0; if (vecflag) { @@ -160,8 +162,7 @@ int FixStorePeratom::pack_border(int n, int *list, double *buf) } else if (arrayflag) { for (i = 0; i < n; i++) { j = list[i]; - for (k = 0; k < nvalues; k++) - buf[m++] = astore[j][k]; + for (k = 0; k < nvalues; k++) buf[m++] = astore[j][k]; } } else if (tensorflag) { for (i = 0; i < n; i++) { @@ -180,23 +181,22 @@ int FixStorePeratom::pack_border(int n, int *list, double *buf) int FixStorePeratom::unpack_border(int n, int first, double *buf) { - int i, k, last, ncol; + int i, k, last; int m = 0; last = first + n; if (vecflag) { - for (i = first; i < last; i++) - vstore[i] = buf[m++]; + for (i = first; i < last; i++) vstore[i] = buf[m++]; } else if (arrayflag) { for (i = first; i < last; i++) - for (k = 0; k < nvalues; k++) - astore[i][k] = buf[m++]; + for (k = 0; k < nvalues; k++) astore[i][k] = buf[m++]; } else if (tensorflag) { for (i = first; i < last; i++) { memcpy(&tstore[i][0][0], &buf[m], nbytes); m += nvalues; } } + return m; } /* ---------------------------------------------------------------------- @@ -210,8 +210,7 @@ int FixStorePeratom::pack_exchange(int i, double *buf) if (vecflag) { buf[0] = vstore[i]; } else if (arrayflag) { - for (int m = 0; m < nvalues; m++) - buf[m] = astore[i][m]; + for (int m = 0; m < nvalues; m++) buf[m] = astore[i][m]; } else if (tensorflag) { memcpy(buf, &tstore[i][0][0], nbytes); } @@ -230,8 +229,7 @@ int FixStorePeratom::unpack_exchange(int nlocal, double *buf) if (vecflag) { vstore[nlocal] = buf[0]; } else if (arrayflag) { - for (int m = 0; m < nvalues; m++) - astore[nlocal][m] = buf[m]; + for (int m = 0; m < nvalues; m++) astore[nlocal][m] = buf[m]; } else if (tensorflag) { memcpy(&tstore[nlocal][0][0], buf, nbytes); } @@ -256,8 +254,7 @@ int FixStorePeratom::pack_restart(int i, double *buf) if (vecflag) { buf[1] = vstore[i]; } else if (arrayflag) { - for (int m = 0; m < nvalues; m++) - buf[m + 1] = astore[i][m]; + for (int m = 0; m < nvalues; m++) buf[m + 1] = astore[i][m]; } else if (tensorflag) { memcpy(&buf[1], &tstore[i][0][0], nbytes); } @@ -285,8 +282,7 @@ void FixStorePeratom::unpack_restart(int nlocal, int nth) if (vecflag) { vstore[nlocal] = extra[nlocal][m]; } else if (arrayflag) { - for (int i = 0; i < nvalues; i++) - astore[nlocal][i] = extra[nlocal][m++]; + for (int i = 0; i < nvalues; i++) astore[nlocal][i] = extra[nlocal][m++]; } else if (tensorflag) { memcpy(&tstore[nlocal][0][0], &extra[nlocal][m], nbytes); } From ef67f790a2e17b6c53edc821be0ded31a065cdaa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Mar 2023 19:43:44 -0400 Subject: [PATCH 084/112] whitespace --- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 2 +- src/fix_store_peratom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index b71e60c286..7f3a7519b6 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -176,7 +176,7 @@ void BondHarmonicRestrain::init_style() // after a restart, natoms is set but initial is a null pointer. // we add the fix, but do not initialize it. It will pull the data from the restart. - + if (!initial) { initial = dynamic_cast( modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1")); diff --git a/src/fix_store_peratom.h b/src/fix_store_peratom.h index dcf28be265..9434ffe799 100644 --- a/src/fix_store_peratom.h +++ b/src/fix_store_peratom.h @@ -54,7 +54,7 @@ class FixStorePeratom : public Fix { int tensorflag; // 1 if a 3d array (array per atom) int ghostflag; // 0/1 to communicate values with ghost atoms int restartflag; // 0/1 to store values in restart files - + int n1, n2; // size of 3d dims of per-atom data struct int nvalues; // number of per-atom values int nbytes; // number of per-atom bytes From 1031110d930826e6d752439fa7e428715249cbff Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Mar 2023 19:55:52 -0400 Subject: [PATCH 085/112] update docs --- doc/src/bond_harmonic_restrain.rst | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/doc/src/bond_harmonic_restrain.rst b/doc/src/bond_harmonic_restrain.rst index c48e68917c..c9707f5546 100644 --- a/doc/src/bond_harmonic_restrain.rst +++ b/doc/src/bond_harmonic_restrain.rst @@ -65,18 +65,13 @@ This bond style can only be used if LAMMPS was built with the EXTRA-MOLECULE package. See the :doc:`Build package ` page for more info. -This bond style uses :doc:`fix property/atom ` -internally to be able to determine the original bond lengths. This fix -will write its state to :doc:`data files `, but it is -currently not possible to read that stored data back with -:doc:`read_data ` for such an internally defined fix. You -are thus advised to use the "nofix" argument to the :doc:`write_data -command ` in order to avoid writing that section to the data -file that would cause an error when reading the data file. When -continuing from such a "nofix" data file, the reference bond lengths -will not be the original lengths but those of the current geometry. -Thus restarting is currently *only* possible with :doc:`binary restart -files `. +This bond style maintains internal data to determine the original bond +lengths :math:`r_{t=0}`. This information will be written to +:doc:`binary restart files ` but **not** to :doc:`data +files `. Thus, continuing a simulation is *only* possible +with :doc:`read_restart `. When using the :doc:`read_data +command `, the reference bond lengths :math:`r_{t=0}` will be +re-initialized from the current geometry. This bond style cannot be used with :doc:`fix shake or fix rattle `, with :doc:`fix filter/corotate `, or From 17f39d9d2cf8e5d85ba3a9e3fe9901d0b1bae501 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Mar 2023 22:28:32 -0400 Subject: [PATCH 086/112] rename fix STORE/PERATOM to STORE/ATOM --- doc/src/Developer_notes.rst | 25 ++++++++++++ doc/src/Developer_updating.rst | 29 ++++++++++++++ src/AMOEBA/amoeba_induce.cpp | 2 +- src/AMOEBA/amoeba_utils.cpp | 2 +- src/AMOEBA/pair_amoeba.cpp | 26 ++++++------- src/AMOEBA/pair_amoeba.h | 6 +-- src/CORESHELL/compute_temp_cs.cpp | 6 +-- src/CORESHELL/compute_temp_cs.h | 2 +- src/EXTRA-COMPUTE/compute_hma.cpp | 8 ++-- src/EXTRA-COMPUTE/compute_hma.h | 2 +- src/EXTRA-COMPUTE/compute_msd_nongauss.cpp | 2 +- src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp | 10 ++--- src/EXTRA-MOLECULE/bond_harmonic_restrain.h | 2 +- src/FEP/fix_adapt_fep.cpp | 14 +++---- src/FEP/fix_adapt_fep.h | 2 +- src/GPU/pair_amoeba_gpu.cpp | 2 +- src/GPU/pair_hippo_gpu.cpp | 2 +- src/REPLICA/tad.cpp | 6 +-- src/REPLICA/tad.h | 18 ++++----- src/VTK/dump_vtk.cpp | 10 ++--- src/balance.cpp | 6 +-- src/balance.h | 10 ++--- src/compute_chunk_atom.cpp | 6 +-- src/compute_chunk_atom.h | 2 +- src/compute_displace_atom.cpp | 8 ++-- src/compute_displace_atom.h | 2 +- src/compute_msd.cpp | 8 ++-- src/compute_msd.h | 2 +- src/compute_vacf.cpp | 8 ++-- src/compute_vacf.h | 2 +- src/dump_custom.cpp | 10 ++--- src/dump_custom.h | 26 ++++++------- src/fix_adapt.cpp | 14 +++---- src/fix_adapt.h | 2 +- src/fix_balance.cpp | 2 +- ...x_store_peratom.cpp => fix_store_atom.cpp} | 38 +++++++++---------- src/{fix_store_peratom.h => fix_store_atom.h} | 12 +++--- src/fix_store_global.cpp | 2 +- src/variable.cpp | 6 +-- src/variable.h | 2 +- 40 files changed, 199 insertions(+), 145 deletions(-) rename src/{fix_store_peratom.cpp => fix_store_atom.cpp} (88%) rename src/{fix_store_peratom.h => fix_store_atom.h} (89%) diff --git a/doc/src/Developer_notes.rst b/doc/src/Developer_notes.rst index 92121cca15..07b289b583 100644 --- a/doc/src/Developer_notes.rst +++ b/doc/src/Developer_notes.rst @@ -11,6 +11,7 @@ Available topics are: - `Reading and parsing of text and text files`_ - `Requesting and accessing neighbor lists`_ +- `Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM`_ - `Fix contributions to instantaneous energy, virial, and cumulative energy`_ - `KSpace PPPM FFT grids`_ @@ -216,6 +217,30 @@ command: neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL); +Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +There are multiple ways to manage per-atom data within LAMMPS. Often +the per-atom storage is only used locally and managed by the class that +uses it. If the data has to persist between multiple time steps and +migrate with atoms when they move from sub-domain to sub-domain or +across periodic boundaries, then using a custom atom style, or :doc:`fix +property/atom `, or the internal fix STORE/ATOM are +possible options. + +- Using the atom style is usually the most programming effort and mostly + needed when the per-atom data is an integral part of the model like a + per-atom charge or diameter and thus should be part of the Atoms + section of a :doc:`data file `. + +- Fix property/atom is useful if the data is optional or should be + entered by the user, or accessed as a (named) custom property. In this + case the fix should be entered as part of the input (and not + internally) which allows to enter and store its content with data files. + +- Fix STORE/ATOM should be used when the data should be accessed internally + only and thus the fix can be created internally. + Fix contributions to instantaneous energy, virial, and cumulative energy ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/src/Developer_updating.rst b/doc/src/Developer_updating.rst index 6089969c38..28b3712ae0 100644 --- a/doc/src/Developer_updating.rst +++ b/doc/src/Developer_updating.rst @@ -24,6 +24,7 @@ Available topics in mostly chronological order are: - `Use of "override" instead of "virtual"`_ - `Simplified and more compact neighbor list requests`_ - `Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM`_ +- `Rename of fix STORE/PERATOM to fix STORE/ATOM and change of arguments`_ - `Use Output::get_dump_by_id() instead of Output::find_dump()`_ - `Refactored grid communication using Grid3d/Grid2d classes instead of GridComm`_ @@ -385,6 +386,34 @@ New: This change is **required** or else the code will not compile. +Rename of fix STORE/PERATOM to fix STORE/ATOM and change of arguments +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. versionchanged:: TBD + +The available functionality of the internal fix to store per-atom +properties was expanded to enable storing data with ghost atoms and to +support binary restart files. With those changes, the fix was renamed +to fix STORE/ATOM and the number and order of (required) arguments has +changed. + +Old syntax: ``ID group-ID STORE/PERATOM rflag n1 n2 [n3]`` + +- *rflag* = 0/1, *no*/*yes* store per-atom values in restart file +- :math:`n1 = 1, n2 = 1, \mathrm{no}\;n3 \to` per-atom vector, single value per atom +- :math:`n1 = 1, n2 > 1, \mathrm{no}\;n3 \to` per-atom array, *n2* values per atom +- :math:`n1 = 1, n2 > 0, n3 > 0 \to` per-atom tensor, *n2* x *n3* values per atom + +New syntax: ``ID group-ID STORE/ATOM n1 n2 gflag rflag`` + +- :math:`n1 = 1, n2 = 0 \to` per-atom vector, single value per atom +- :math:`n1 > 1, n2 = 0 \to` per-atom array, *n1* values per atom +- :math:`n1 > 0, n2 > 0 \to` per-atom tensor, *n1* x *n2* values per atom +- *gflag* = 0/1, *no*/*yes* communicate per-atom values with ghost atoms +- *rflag* = 0/1, *no*/*yes* store per-atom values in restart file + +Since this is an internal fix, there is no user visible change. + Use Output::get_dump_by_id() instead of Output::find_dump() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/AMOEBA/amoeba_induce.cpp b/src/AMOEBA/amoeba_induce.cpp index ecc20a198c..6017b775ca 100644 --- a/src/AMOEBA/amoeba_induce.cpp +++ b/src/AMOEBA/amoeba_induce.cpp @@ -19,7 +19,7 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "math_const.h" #include "math_special.h" #include "my_page.h" diff --git a/src/AMOEBA/amoeba_utils.cpp b/src/AMOEBA/amoeba_utils.cpp index 5a4057930c..8fb839b693 100644 --- a/src/AMOEBA/amoeba_utils.cpp +++ b/src/AMOEBA/amoeba_utils.cpp @@ -17,7 +17,7 @@ #include "atom.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "neigh_list.h" #include diff --git a/src/AMOEBA/pair_amoeba.cpp b/src/AMOEBA/pair_amoeba.cpp index 319bbd8925..72efa76523 100644 --- a/src/AMOEBA/pair_amoeba.cpp +++ b/src/AMOEBA/pair_amoeba.cpp @@ -20,7 +20,7 @@ #include "domain.h" #include "error.h" #include "fix.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "group.h" #include "math_special.h" @@ -861,8 +861,8 @@ void PairAmoeba::init_style() Fix *myfix; if (first_flag) { id_pole = utils::strdup("AMOEBA_pole"); - myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM 13 0 0 1",id_pole,group->names[0])); - fixpole = dynamic_cast(myfix); + myfix = modify->add_fix(fmt::format("{} {} STORE/ATOM 13 0 0 1",id_pole,group->names[0])); + fixpole = dynamic_cast(myfix); } // creation of per-atom storage @@ -873,14 +873,14 @@ void PairAmoeba::init_style() if (first_flag && use_pred) { id_udalt = utils::strdup("AMOEBA_udalt"); - myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM {} 3 0 1", + myfix = modify->add_fix(fmt::format("{} {} STORE/ATOM {} 3 0 1", id_udalt, group->names[0], maxualt)); - fixudalt = dynamic_cast(myfix); + fixudalt = dynamic_cast(myfix); id_upalt = utils::strdup("AMOEBA_upalt"); - myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM {} 3 0 1", + myfix = modify->add_fix(fmt::format("{} {} STORE/ATOM {} 3 0 1", id_upalt, group->names[0], maxualt)); - fixupalt = dynamic_cast(myfix); + fixupalt = dynamic_cast(myfix); } // create pages for storing pairwise data: @@ -995,21 +995,21 @@ void PairAmoeba::init_style() if (id_pole) { myfix = modify->get_fix_by_id(id_pole); if (!myfix) - error->all(FLERR,"Could not find internal pair amoeba fix STORE/PERATOM id {}", id_pole); - fixpole = dynamic_cast(myfix); + error->all(FLERR,"Could not find internal pair amoeba fix STORE/ATOM id {}", id_pole); + fixpole = dynamic_cast(myfix); } if (id_udalt) { myfix = modify->get_fix_by_id(id_udalt); if (!myfix) - error->all(FLERR,"Could not find internal pair amoeba fix STORE/PERATOM id {}", id_udalt); - fixudalt = dynamic_cast(myfix); + error->all(FLERR,"Could not find internal pair amoeba fix STORE/ATOM id {}", id_udalt); + fixudalt = dynamic_cast(myfix); myfix = modify->get_fix_by_id(id_upalt); if (!myfix) - error->all(FLERR,"Could not find internal pair amoeba fix STORE/PERATOM id {}", id_upalt); - fixupalt = dynamic_cast(myfix); + error->all(FLERR,"Could not find internal pair amoeba fix STORE/ATOM id {}", id_upalt); + fixupalt = dynamic_cast(myfix); } // assign hydrogen neighbors (redID) to each owned atom diff --git a/src/AMOEBA/pair_amoeba.h b/src/AMOEBA/pair_amoeba.h index cdeee6c95f..1f3a4b799a 100644 --- a/src/AMOEBA/pair_amoeba.h +++ b/src/AMOEBA/pair_amoeba.h @@ -166,9 +166,9 @@ class PairAmoeba : public Pair { int *amgroup; // AMOEBA polarization group, 1 to Ngroup char *id_pole, *id_udalt, *id_upalt; - class FixStorePeratom *fixpole; // stores pole = multipole components - class FixStorePeratom *fixudalt; // stores udalt = induced dipole history - class FixStorePeratom *fixupalt; // stores upalt = induced dipole history + class FixStoreAtom *fixpole; // stores pole = multipole components + class FixStoreAtom *fixudalt; // stores udalt = induced dipole history + class FixStoreAtom *fixupalt; // stores upalt = induced dipole history // static per-type properties defined in force-field file diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp index b0ec39e542..b66db30bc5 100644 --- a/src/CORESHELL/compute_temp_cs.cpp +++ b/src/CORESHELL/compute_temp_cs.cpp @@ -24,7 +24,7 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "group.h" #include "memory.h" @@ -67,8 +67,8 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : // id = compute-ID + COMPUTE_STORE, fix group = compute group id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); - fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 0", id_fix, group->names[igroup]))); + fix = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 0", id_fix, group->names[igroup]))); // set fix store values = 0 for now // fill them in via setup() once Comm::borders() has been called diff --git a/src/CORESHELL/compute_temp_cs.h b/src/CORESHELL/compute_temp_cs.h index 3fdf0f3711..1e7c537a83 100644 --- a/src/CORESHELL/compute_temp_cs.h +++ b/src/CORESHELL/compute_temp_cs.h @@ -54,7 +54,7 @@ class ComputeTempCS : public Compute { double **vint; char *id_fix; - class FixStorePeratom *fix; + class FixStoreAtom *fix; void dof_compute(); void vcm_pairs(); diff --git a/src/EXTRA-COMPUTE/compute_hma.cpp b/src/EXTRA-COMPUTE/compute_hma.cpp index 806228faef..4b949f6592 100644 --- a/src/EXTRA-COMPUTE/compute_hma.cpp +++ b/src/EXTRA-COMPUTE/compute_hma.cpp @@ -54,7 +54,7 @@ https://doi.org/10.1103/PhysRevE.92.043303 #include "domain.h" #include "error.h" #include "fix.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "group.h" #include "improper.h" @@ -90,8 +90,8 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : // our new fix's group = same as compute group id_fix = utils::strdup(std::string(id)+"_COMPUTE_STORE"); - fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); + fix = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file @@ -196,7 +196,7 @@ void ComputeHMA::setup() // set fix which stores original atom coords - fix = dynamic_cast(modify->get_fix_by_id(id_fix)); + fix = dynamic_cast(modify->get_fix_by_id(id_fix)); if (!fix) error->all(FLERR,"Could not find hma per-atom store fix ID {}", id_fix); } diff --git a/src/EXTRA-COMPUTE/compute_hma.h b/src/EXTRA-COMPUTE/compute_hma.h index d8b8e55b96..8b5ea1a8dc 100644 --- a/src/EXTRA-COMPUTE/compute_hma.h +++ b/src/EXTRA-COMPUTE/compute_hma.h @@ -43,7 +43,7 @@ class ComputeHMA : public Compute { char *id_fix; char *id_temp; double finaltemp; - class FixStorePeratom *fix; + class FixStoreAtom *fix; double boltz, nktv2p, inv_volume; double deltaPcap; double virial_compute(int); diff --git a/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp b/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp index f75ab69a01..42af0f0b6e 100644 --- a/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp +++ b/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp @@ -19,7 +19,7 @@ #include "atom.h" #include "domain.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "group.h" #include "update.h" diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp index 7f3a7519b6..87b6e5a80e 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.cpp @@ -17,7 +17,7 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "memory.h" #include "modify.h" @@ -162,8 +162,8 @@ void BondHarmonicRestrain::init_style() if (natoms < 0) { // create internal fix to store initial positions - initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1")); + initial = dynamic_cast( + modify->add_fix("BOND_RESTRAIN_X0 all STORE/ATOM 3 0 1 1")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); natoms = atom->natoms; @@ -178,8 +178,8 @@ void BondHarmonicRestrain::init_style() // we add the fix, but do not initialize it. It will pull the data from the restart. if (!initial) { - initial = dynamic_cast( - modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1")); + initial = dynamic_cast( + modify->add_fix("BOND_RESTRAIN_X0 all STORE/ATOM 3 0 1 1")); if (!initial) error->all(FLERR, "Failure to create internal per-atom storage"); } } diff --git a/src/EXTRA-MOLECULE/bond_harmonic_restrain.h b/src/EXTRA-MOLECULE/bond_harmonic_restrain.h index 61d01ab9b2..66ee1300c1 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_restrain.h +++ b/src/EXTRA-MOLECULE/bond_harmonic_restrain.h @@ -41,7 +41,7 @@ class BondHarmonicRestrain : public Bond { protected: double *k; bigint natoms; - class FixStorePeratom *initial; + class FixStoreAtom *initial; virtual void allocate(); }; diff --git a/src/FEP/fix_adapt_fep.cpp b/src/FEP/fix_adapt_fep.cpp index 3f3d26c4d9..6e38c90ef2 100644 --- a/src/FEP/fix_adapt_fep.cpp +++ b/src/FEP/fix_adapt_fep.cpp @@ -20,7 +20,7 @@ #include "atom.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "group.h" #include "input.h" @@ -211,8 +211,8 @@ void FixAdaptFEP::post_constructor() if (diamflag) { id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM")); - fix_diam = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix_diam,group->names[igroup]))); + fix_diam = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1", id_fix_diam,group->names[igroup]))); if (fix_diam->restart_reset) fix_diam->restart_reset = 0; else { double *vec = fix_diam->vstore; @@ -229,8 +229,8 @@ void FixAdaptFEP::post_constructor() if (chgflag) { id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG")); - fix_chg = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1",id_fix_chg,group->names[igroup]))); + fix_chg = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1",id_fix_chg,group->names[igroup]))); if (fix_chg->restart_reset) fix_chg->restart_reset = 0; else { double *vec = fix_chg->vstore; @@ -333,11 +333,11 @@ void FixAdaptFEP::init() // fixes that store initial per-atom values if (id_fix_diam) { - fix_diam = dynamic_cast(modify->get_fix_by_id(id_fix_diam)); + fix_diam = dynamic_cast(modify->get_fix_by_id(id_fix_diam)); if (!fix_diam) error->all(FLERR,"Could not find fix adapt/fep storage fix ID {}", id_fix_diam); } if (id_fix_chg) { - fix_chg = dynamic_cast(modify->get_fix_by_id(id_fix_chg)); + fix_chg = dynamic_cast(modify->get_fix_by_id(id_fix_chg)); if (!fix_chg) error->all(FLERR,"Could not find fix adapt/fep storage fix ID {}", id_fix_chg); } diff --git a/src/FEP/fix_adapt_fep.h b/src/FEP/fix_adapt_fep.h index a93349a780..370a34a0f3 100644 --- a/src/FEP/fix_adapt_fep.h +++ b/src/FEP/fix_adapt_fep.h @@ -46,7 +46,7 @@ class FixAdaptFEP : public Fix { int anypair; int nlevels_respa; char *id_fix_diam, *id_fix_chg; - class FixStorePeratom *fix_diam, *fix_chg; + class FixStoreAtom *fix_diam, *fix_chg; struct Adapt { int which, ivar; diff --git a/src/GPU/pair_amoeba_gpu.cpp b/src/GPU/pair_amoeba_gpu.cpp index fd423486fd..c513d32081 100644 --- a/src/GPU/pair_amoeba_gpu.cpp +++ b/src/GPU/pair_amoeba_gpu.cpp @@ -23,7 +23,7 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "gpu_extra.h" #include "info.h" diff --git a/src/GPU/pair_hippo_gpu.cpp b/src/GPU/pair_hippo_gpu.cpp index 9d286d5db7..aa10ad6c5f 100644 --- a/src/GPU/pair_hippo_gpu.cpp +++ b/src/GPU/pair_hippo_gpu.cpp @@ -23,7 +23,7 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "gpu_extra.h" #include "info.h" diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index e98cd39233..b9b04a63d5 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -24,7 +24,7 @@ #include "error.h" #include "finish.h" #include "fix_event_tad.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "integrate.h" #include "memory.h" @@ -133,9 +133,9 @@ void TAD::command(int narg, char **arg) fix_event = dynamic_cast(modify->add_fix("tad_event all EVENT/TAD")); - // create FixStorePeratom object to store revert state + // create FixStoreAtom object to store revert state - fix_revert = dynamic_cast(modify->add_fix("tad_revert all STORE/PERATOM 7 0 0 0")); + fix_revert = dynamic_cast(modify->add_fix("tad_revert all STORE/ATOM 7 0 0 0")); // create Finish for timing output diff --git a/src/REPLICA/tad.h b/src/REPLICA/tad.h index 8f51ca8c91..88379794cc 100644 --- a/src/REPLICA/tad.h +++ b/src/REPLICA/tad.h @@ -48,15 +48,15 @@ class TAD : public Command { double time_dynamics, time_quench, time_neb, time_comm, time_output; double time_start; - class NEB *neb; // NEB object - class Fix *fix_neb; // FixNEB object - class Compute *compute_event; // compute to detect event - class FixEventTAD *fix_event; // current event/state - class FixStorePeratom *fix_revert; // revert state - FixEventTAD **fix_event_list; // list of possible events - int n_event_list; // number of events - int nmax_event_list; // allocated events - int nmin_event_list; // minimum allocation + class NEB *neb; // NEB object + class Fix *fix_neb; // FixNEB object + class Compute *compute_event; // compute to detect event + class FixEventTAD *fix_event; // current event/state + class FixStoreAtom *fix_revert; // revert state + FixEventTAD **fix_event_list; // list of possible events + int n_event_list; // number of events + int nmax_event_list; // allocated events + int nmin_event_list; // minimum allocation char *neb_logfilename; // filename for ulogfile_neb FILE *uscreen_neb; // neb universe screen output diff --git a/src/VTK/dump_vtk.cpp b/src/VTK/dump_vtk.cpp index c4dd68bf3c..75033684ae 100644 --- a/src/VTK/dump_vtk.cpp +++ b/src/VTK/dump_vtk.cpp @@ -31,7 +31,7 @@ #include "domain.h" #include "error.h" #include "fix.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "group.h" #include "input.h" @@ -2357,16 +2357,16 @@ int DumpVTK::modify_param(int narg, char **arg) thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp); thresh_last[nthresh] = -1; } else { - thresh_fix = (FixStorePeratom **) - memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStorePeratom *),"dump:thresh_fix"); + thresh_fix = (FixStoreAtom **) + memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStoreAtom *),"dump:thresh_fix"); thresh_fixID = (char **) memory->srealloc(thresh_fixID,(nthreshlast+1)*sizeof(char *),"dump:thresh_fixID"); memory->grow(thresh_first,(nthreshlast+1),"dump:thresh_first"); std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast); thresh_fixID[nthreshlast] = utils::strdup(threshid); - threshid += fmt::format(" {} STORE/PERATOM 1 0 0 1", group->names[igroup]); - thresh_fix[nthreshlast] = dynamic_cast(modify->add_fix(threshid)); + threshid += fmt::format(" {} STORE/ATOM 1 0 0 1", group->names[igroup]); + thresh_fix[nthreshlast] = dynamic_cast(modify->add_fix(threshid)); thresh_last[nthreshlast] = nthreshlast; thresh_first[nthreshlast] = 1; diff --git a/src/balance.cpp b/src/balance.cpp index 8d1ba460db..3bd083e2b9 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -26,7 +26,7 @@ #include "neighbor.h" #include "comm.h" #include "domain.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "imbalance.h" #include "imbalance_group.h" @@ -513,9 +513,9 @@ void Balance::weight_storage(char *prefix) if (prefix) cmd = prefix; cmd += "IMBALANCE_WEIGHTS"; - fixstore = dynamic_cast(modify->get_fix_by_id(cmd)); + fixstore = dynamic_cast(modify->get_fix_by_id(cmd)); if (!fixstore) - fixstore = dynamic_cast(modify->add_fix(cmd + " all STORE/PERATOM 1 0 0 0")); + fixstore = dynamic_cast(modify->add_fix(cmd + " all STORE/ATOM 1 0 0 0")); // do not carry weights with atoms during normal atom migration diff --git a/src/balance.h b/src/balance.h index 3a6e8bf457..669d21e2b5 100644 --- a/src/balance.h +++ b/src/balance.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class Balance : public Command { public: class RCB *rcb; - class FixStorePeratom *fixstore; // per-atom weights stored in FixStorePeratom - int wtflag; // 1 if particle weighting is used - int varflag; // 1 if weight style var(iable) is used - int sortflag; // 1 if sorting of comm messages is done - int outflag; // 1 for output of balance results to file + class FixStoreAtom *fixstore; // per-atom weights stored in FixStorePeratom + int wtflag; // 1 if particle weighting is used + int varflag; // 1 if weight style var(iable) is used + int sortflag; // 1 if sorting of comm messages is done + int outflag; // 1 for output of balance results to file Balance(class LAMMPS *); ~Balance() override; diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index b59449989b..f5c68c8f25 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -21,7 +21,7 @@ #include "domain.h" #include "error.h" #include "fix.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "group.h" #include "input.h" #include "lattice.h" @@ -571,8 +571,8 @@ void ComputeChunkAtom::init() if ((idsflag == ONCE || lockcount) && !fixstore) { id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); - fixstore = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix, group->names[igroup]))); + fixstore = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1", id_fix, group->names[igroup]))); } if ((idsflag != ONCE && !lockcount) && fixstore) { diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index 6850003b3e..943e36c985 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -93,7 +93,7 @@ class ComputeChunkAtom : public Compute { double *varatom; char *id_fix; - class FixStorePeratom *fixstore; + class FixStoreAtom *fixstore; class Fix *lockfix; // ptr to FixAveChunk that is locking out setups // null pointer if no lock currently in place diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index 6f352fa111..9f37ff2a78 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -17,7 +17,7 @@ #include "atom.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "group.h" #include "input.h" #include "memory.h" @@ -74,8 +74,8 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // id = compute-ID + COMPUTE_STORE, fix group = compute group id_fix = utils::strdup(std::string(id) + "_COMPUTE_STORE"); - fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); + fix = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file @@ -120,7 +120,7 @@ void ComputeDisplaceAtom::init() { // set fix which stores original atom coords - fix = dynamic_cast(modify->get_fix_by_id(id_fix)); + fix = dynamic_cast(modify->get_fix_by_id(id_fix)); if (!fix) error->all(FLERR,"Could not find compute displace/atom fix with ID {}", id_fix); if (refreshflag) { diff --git a/src/compute_displace_atom.h b/src/compute_displace_atom.h index dc1be7434f..006928bd42 100644 --- a/src/compute_displace_atom.h +++ b/src/compute_displace_atom.h @@ -38,7 +38,7 @@ class ComputeDisplaceAtom : public Compute { int nmax; double **displace; char *id_fix; - class FixStorePeratom *fix; + class FixStoreAtom *fix; int refreshflag, ivar, nvmax; // refresh option is enabled char *rvar; // for incremental dumps diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index ecbb540a48..e73dbd3d53 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -16,7 +16,7 @@ #include "atom.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "group.h" #include "modify.h" #include "update.h" @@ -63,8 +63,8 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, a // id = compute-ID + COMPUTE_STORE, fix group = compute group id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); - fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); + fix = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file @@ -127,7 +127,7 @@ void ComputeMSD::init() { // set fix which stores reference atom coords - fix = dynamic_cast(modify->get_fix_by_id(id_fix)); + fix = dynamic_cast(modify->get_fix_by_id(id_fix)); if (!fix) error->all(FLERR, "Could not find compute msd fix with ID {}", id_fix); // nmsd = # of atoms in group diff --git a/src/compute_msd.h b/src/compute_msd.h index a273e9cf58..ffb0c18c8c 100644 --- a/src/compute_msd.h +++ b/src/compute_msd.h @@ -39,7 +39,7 @@ class ComputeMSD : public Compute { bigint nmsd; double masstotal; char *id_fix; - class FixStorePeratom *fix; + class FixStoreAtom *fix; }; } // namespace LAMMPS_NS diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index 9d6018d05b..acf1405092 100644 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -18,7 +18,7 @@ #include "update.h" #include "group.h" #include "modify.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "error.h" using namespace LAMMPS_NS; @@ -39,8 +39,8 @@ ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) : // id = compute-ID + COMPUTE_STORE, fix group = compute group id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); - fix = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup]))); + fix = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup]))); // store current velocities in fix store array // skip if reset from restart file @@ -84,7 +84,7 @@ void ComputeVACF::init() { // set fix which stores original atom velocities - fix = dynamic_cast(modify->get_fix_by_id(id_fix)); + fix = dynamic_cast(modify->get_fix_by_id(id_fix)); if (!fix) error->all(FLERR,"Could not find compute vacf fix ID {}", id_fix); // nvacf = # of atoms in group diff --git a/src/compute_vacf.h b/src/compute_vacf.h index 42b3ed4adc..8e5e57ab65 100644 --- a/src/compute_vacf.h +++ b/src/compute_vacf.h @@ -35,7 +35,7 @@ class ComputeVACF : public Compute { protected: bigint nvacf; char *id_fix; - class FixStorePeratom *fix; + class FixStoreAtom *fix; }; } // namespace LAMMPS_NS diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 922fd4f6fc..8667c6af12 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -20,7 +20,7 @@ #include "domain.h" #include "error.h" #include "fix.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "group.h" #include "input.h" #include "memory.h" @@ -2005,16 +2005,16 @@ int DumpCustom::modify_param(int narg, char **arg) thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp); thresh_last[nthresh] = -1; } else { - thresh_fix = (FixStorePeratom **) - memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStorePeratom *),"dump:thresh_fix"); + thresh_fix = (FixStoreAtom **) + memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStoreAtom *),"dump:thresh_fix"); thresh_fixID = (char **) memory->srealloc(thresh_fixID,(nthreshlast+1)*sizeof(char *),"dump:thresh_fixID"); memory->grow(thresh_first,(nthreshlast+1),"dump:thresh_first"); std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast); thresh_fixID[nthreshlast] = utils::strdup(threshid); - threshid += fmt::format(" {} STORE/PERATOM 1 0 0 1", group->names[igroup]); - thresh_fix[nthreshlast] = dynamic_cast(modify->add_fix(threshid)); + threshid += fmt::format(" {} STORE/ATOM 1 0 0 1", group->names[igroup]); + thresh_fix[nthreshlast] = dynamic_cast(modify->add_fix(threshid)); thresh_last[nthreshlast] = nthreshlast; thresh_first[nthreshlast] = 1; diff --git a/src/dump_custom.h b/src/dump_custom.h index da49ffdc22..b600bd60b8 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -37,19 +37,19 @@ class DumpCustom : public Dump { int nevery; // dump frequency for output char *idregion; // region ID, nullptr if no region - int nthresh; // # of defined thresholds - int nthreshlast; // # of defined thresholds with value = LAST - // - int *thresh_array; // array to threshold on for each nthresh - int *thresh_op; // threshold operation for each nthresh - double *thresh_value; // threshold value for each nthresh - int *thresh_last; // for threshold value = LAST, - // index into thresh_fix - // -1 if not LAST, value is numeric - // - class FixStorePeratom **thresh_fix; // stores values for each threshold LAST - char **thresh_fixID; // IDs of thresh_fixes - int *thresh_first; // 1 the first time a FixStore values accessed + int nthresh; // # of defined thresholds + int nthreshlast; // # of defined thresholds with value = LAST + // + int *thresh_array; // array to threshold on for each nthresh + int *thresh_op; // threshold operation for each nthresh + double *thresh_value; // threshold value for each nthresh + int *thresh_last; // for threshold value = LAST, + // index into thresh_fix + // -1 if not LAST, value is numeric + // + class FixStoreAtom **thresh_fix; // stores values for each threshold LAST + char **thresh_fixID; // IDs of thresh_fixes + int *thresh_first; // 1 the first time a FixStore values accessed int expand; // flag for whether field args were expanded char **earg; // field names with wildcard expansion diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index 98cf955485..8dd97250a3 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -19,7 +19,7 @@ #include "bond.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "group.h" #include "input.h" @@ -278,8 +278,8 @@ void FixAdapt::post_constructor() if (diamflag && atom->radius_flag) { id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM")); - fix_diam = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix_diam,group->names[igroup]))); + fix_diam = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1", id_fix_diam,group->names[igroup]))); if (fix_diam->restart_reset) fix_diam->restart_reset = 0; else { double *vec = fix_diam->vstore; @@ -296,8 +296,8 @@ void FixAdapt::post_constructor() if (chgflag && atom->q_flag) { id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG")); - fix_chg = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1",id_fix_chg,group->names[igroup]))); + fix_chg = dynamic_cast( + modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1",id_fix_chg,group->names[igroup]))); if (fix_chg->restart_reset) fix_chg->restart_reset = 0; else { double *vec = fix_chg->vstore; @@ -494,11 +494,11 @@ void FixAdapt::init() // fixes that store initial per-atom values if (id_fix_diam) { - fix_diam = dynamic_cast(modify->get_fix_by_id(id_fix_diam)); + fix_diam = dynamic_cast(modify->get_fix_by_id(id_fix_diam)); if (!fix_diam) error->all(FLERR,"Could not find fix adapt storage fix ID {}", id_fix_diam); } if (id_fix_chg) { - fix_chg = dynamic_cast(modify->get_fix_by_id(id_fix_chg)); + fix_chg = dynamic_cast(modify->get_fix_by_id(id_fix_chg)); if (!fix_chg) error->all(FLERR,"Could not find fix adapt storage fix ID {}", id_fix_chg); } diff --git a/src/fix_adapt.h b/src/fix_adapt.h index 82dc739c67..f8477f7259 100644 --- a/src/fix_adapt.h +++ b/src/fix_adapt.h @@ -48,7 +48,7 @@ class FixAdapt : public Fix { int anypair, anybond, anyangle; int nlevels_respa; char *id_fix_diam, *id_fix_chg; - class FixStorePeratom *fix_diam, *fix_chg; + class FixStoreAtom *fix_diam, *fix_chg; double previous_diam_scale, previous_chg_scale; int discflag; diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index 06274eea03..844ffe474e 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -19,7 +19,7 @@ #include "comm.h" #include "domain.h" #include "error.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "force.h" #include "irregular.h" #include "kspace.h" diff --git a/src/fix_store_peratom.cpp b/src/fix_store_atom.cpp similarity index 88% rename from src/fix_store_peratom.cpp rename to src/fix_store_atom.cpp index 2a8429e42f..461959d264 100644 --- a/src/fix_store_peratom.cpp +++ b/src/fix_store_atom.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "atom.h" #include "error.h" @@ -32,10 +32,10 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) : +FixStoreAtom::FixStoreAtom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), vstore(nullptr), astore(nullptr) { - if (narg != 7) error->all(FLERR, "Illegal fix STORE/PERATOM command: number of args"); + if (narg != 7) error->all(FLERR, "Illegal fix STORE/ATOM command: number of args"); disable = 0; @@ -52,7 +52,7 @@ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) : else if (n1 > 0 && n2 > 0) tensorflag = 1; else - error->all(FLERR, "Illegal fix STORE/PERATOM dimension args: {} {}", n1, n2); + error->all(FLERR, "Illegal fix STORE/ATOM dimension args: {} {}", n1, n2); if (vecflag || arrayflag) nvalues = n1; @@ -71,7 +71,7 @@ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) : astore = nullptr; tstore = nullptr; - FixStorePeratom::grow_arrays(atom->nmax); + FixStoreAtom::grow_arrays(atom->nmax); atom->add_callback(Atom::GROW); if (restartflag) atom->add_callback(Atom::RESTART); if (ghostflag) atom->add_callback(Atom::BORDER); @@ -93,7 +93,7 @@ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixStorePeratom::~FixStorePeratom() +FixStoreAtom::~FixStoreAtom() { // unregister callbacks to this fix from Atom class @@ -108,7 +108,7 @@ FixStorePeratom::~FixStorePeratom() /* ---------------------------------------------------------------------- */ -int FixStorePeratom::setmask() +int FixStoreAtom::setmask() { int mask = 0; return mask; @@ -118,7 +118,7 @@ int FixStorePeratom::setmask() allocate atom-based array ------------------------------------------------------------------------- */ -void FixStorePeratom::grow_arrays(int nmax) +void FixStoreAtom::grow_arrays(int nmax) { if (vecflag) memory->grow(vstore, nmax, "store:vstore"); @@ -132,7 +132,7 @@ void FixStorePeratom::grow_arrays(int nmax) copy values within local atom-based array ------------------------------------------------------------------------- */ -void FixStorePeratom::copy_arrays(int i, int j, int /*delflag*/) +void FixStoreAtom::copy_arrays(int i, int j, int /*delflag*/) { if (disable) return; @@ -149,7 +149,7 @@ void FixStorePeratom::copy_arrays(int i, int j, int /*delflag*/) pack values for border communication at re-neighboring ------------------------------------------------------------------------- */ -int FixStorePeratom::pack_border(int n, int *list, double *buf) +int FixStoreAtom::pack_border(int n, int *list, double *buf) { int i, j, k; @@ -179,7 +179,7 @@ int FixStorePeratom::pack_border(int n, int *list, double *buf) unpack values for border communication at re-neighboring ------------------------------------------------------------------------- */ -int FixStorePeratom::unpack_border(int n, int first, double *buf) +int FixStoreAtom::unpack_border(int n, int first, double *buf) { int i, k, last; @@ -203,7 +203,7 @@ int FixStorePeratom::unpack_border(int n, int first, double *buf) pack values in local atom-based array for exchange with another proc ------------------------------------------------------------------------- */ -int FixStorePeratom::pack_exchange(int i, double *buf) +int FixStoreAtom::pack_exchange(int i, double *buf) { if (disable) return 0; @@ -222,7 +222,7 @@ int FixStorePeratom::pack_exchange(int i, double *buf) unpack values in local atom-based array from exchange with another proc ------------------------------------------------------------------------- */ -int FixStorePeratom::unpack_exchange(int nlocal, double *buf) +int FixStoreAtom::unpack_exchange(int nlocal, double *buf) { if (disable) return 0; @@ -241,7 +241,7 @@ int FixStorePeratom::unpack_exchange(int nlocal, double *buf) pack values in local atom-based arrays for restart file ------------------------------------------------------------------------- */ -int FixStorePeratom::pack_restart(int i, double *buf) +int FixStoreAtom::pack_restart(int i, double *buf) { if (disable) { buf[0] = 0; @@ -266,7 +266,7 @@ int FixStorePeratom::pack_restart(int i, double *buf) unpack values from atom->extra array to restart the fix ------------------------------------------------------------------------- */ -void FixStorePeratom::unpack_restart(int nlocal, int nth) +void FixStoreAtom::unpack_restart(int nlocal, int nth) { if (disable) return; @@ -292,7 +292,7 @@ void FixStorePeratom::unpack_restart(int nlocal, int nth) maxsize of any atom's restart data ------------------------------------------------------------------------- */ -int FixStorePeratom::maxsize_restart() +int FixStoreAtom::maxsize_restart() { if (disable) return 1; return nvalues + 1; @@ -302,17 +302,17 @@ int FixStorePeratom::maxsize_restart() size of atom nlocal's restart data ------------------------------------------------------------------------- */ -int FixStorePeratom::size_restart(int /*nlocal*/) +int FixStoreAtom::size_restart(int /*nlocal*/) { if (disable) return 1; return nvalues + 1; } /* ---------------------------------------------------------------------- - memory usage of global or peratom atom-based array + memory usage of per-atom atom-based array ------------------------------------------------------------------------- */ -double FixStorePeratom::memory_usage() +double FixStoreAtom::memory_usage() { return (double) atom->nmax * nvalues * sizeof(double); } diff --git a/src/fix_store_peratom.h b/src/fix_store_atom.h similarity index 89% rename from src/fix_store_peratom.h rename to src/fix_store_atom.h index 9434ffe799..e13b8aa37d 100644 --- a/src/fix_store_peratom.h +++ b/src/fix_store_atom.h @@ -13,26 +13,26 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(STORE/PERATOM,FixStorePeratom); +FixStyle(STORE/ATOM,FixStoreAtom); // clang-format on #else -#ifndef LMP_FIX_STORE_PERATOM_H -#define LMP_FIX_STORE_PERATOM_H +#ifndef LMP_FIX_STORE_ATOM_H +#define LMP_FIX_STORE_ATOM_H #include "fix.h" namespace LAMMPS_NS { -class FixStorePeratom : public Fix { +class FixStoreAtom : public Fix { public: double *vstore; // vector storage double **astore; // array storage double ***tstore; // tensor (3d array) storage int disable; // 1 if operations (except grow) are currently disabled - FixStorePeratom(class LAMMPS *, int, char **); - ~FixStorePeratom() override; + FixStoreAtom(class LAMMPS *, int, char **); + ~FixStoreAtom() override; int setmask() override; void grow_arrays(int) override; diff --git a/src/fix_store_global.cpp b/src/fix_store_global.cpp index cebf4f7690..028d35810e 100644 --- a/src/fix_store_global.cpp +++ b/src/fix_store_global.cpp @@ -182,7 +182,7 @@ void FixStoreGlobal::restart(char *buf) } /* ---------------------------------------------------------------------- - memory usage of global or peratom atom-based array + memory usage of global data ------------------------------------------------------------------------- */ double FixStoreGlobal::memory_usage() diff --git a/src/variable.cpp b/src/variable.cpp index 56a0604a7e..19aed73734 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -20,7 +20,7 @@ #include "domain.h" #include "error.h" #include "fix.h" -#include "fix_store_peratom.h" +#include "fix_store_atom.h" #include "group.h" #include "info.h" #include "input.h" @@ -5027,8 +5027,8 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : error->all(FLERR,"Cannot use atomfile-style variable unless an atom map exists"); id_fix = utils::strdup(std::string(name) + "_VARIABLE_STORE"); - fixstore = dynamic_cast( - modify->add_fix(std::string(id_fix) + " all STORE/PERATOM 1 0 0 0")); + fixstore = dynamic_cast( + modify->add_fix(std::string(id_fix) + " all STORE/ATOM 1 0 0 0")); buffer = new char[CHUNK*MAXLINE]; } } diff --git a/src/variable.h b/src/variable.h index 6326c5cc78..825a207d78 100644 --- a/src/variable.h +++ b/src/variable.h @@ -152,7 +152,7 @@ class Variable : protected Pointers { class VarReader : protected Pointers { public: - class FixStorePeratom *fixstore; + class FixStoreAtom *fixstore; char *id_fix; VarReader(class LAMMPS *, char *, char *, int); From 03454aeefb8920662c76ffab77f154ee1889b154 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Mar 2023 23:07:11 -0400 Subject: [PATCH 087/112] compile GPU library with thread support when BUILD_OMP is enabled --- cmake/Modules/Packages/GPU.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 90645d699b..a0578394f1 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -176,6 +176,10 @@ if(GPU_API STREQUAL "CUDA") target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini) target_compile_definitions(gpu PRIVATE -DUSE_CUDPP) endif() + if(BUILD_OMP) + find_package(OpenMP COMPONENTS CXX REQUIRED) + target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX) + endif() target_link_libraries(lammps PRIVATE gpu) @@ -251,12 +255,18 @@ elseif(GPU_API STREQUAL "OPENCL") else() target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT) endif() + if(BUILD_OMP) + find_package(OpenMP COMPONENTS CXX REQUIRED) + target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX) + endif() + target_link_libraries(lammps PRIVATE gpu) add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL) target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL) add_dependencies(ocl_get_devices OpenCL::OpenCL) + elseif(GPU_API STREQUAL "HIP") if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) @@ -407,6 +417,10 @@ elseif(GPU_API STREQUAL "HIP") target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DUCL_NO_EXIT) endif() target_link_libraries(gpu PRIVATE hip::host) + if(BUILD_OMP) + find_package(OpenMP COMPONENTS CXX REQUIRED) + target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX) + endif() if(HIP_USE_DEVICE_SORT) if(HIP_PLATFORM STREQUAL "amd") From 14180774b7e94caa3b0a9fdef4e60adc0b1d2ae7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Mar 2023 07:00:34 -0400 Subject: [PATCH 088/112] mention OpenMP support in the GPU library --- doc/src/Build_extras.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 4dd8c10b3f..e6366075ff 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -181,6 +181,9 @@ way no local OpenCL development headers or library needs to be present and only OpenCL compatible drivers need to be installed to use OpenCL. If this is not desired, you can set :code:`USE_STATIC_OPENCL_LOADER` to :code:`no`. +The GPU library has some multi-thread support using OpenMP. If LAMMPS is built +with ``-D BUILD_OMP=on`` this will also be enabled. + If you are compiling with HIP, note that before running CMake you will have to set appropriate environment variables. Some variables such as :code:`HCC_AMDGPU_TARGET` (for ROCm <= 4.0) or :code:`CUDA_PATH` are necessary for :code:`hipcc` @@ -278,6 +281,9 @@ To support the CUDA multiprocessor server you can set the define the CUDA performance primitives and thus set the variable ``CUDPP_OPT`` to empty. +The GPU library has some multi-thread support using OpenMP. You need to add +the compiler flag that enables OpenMP to the ``CUDR_OPTS`` Makefile variable. + If the library build is successful, 3 files should be created: ``lib/gpu/libgpu.a``\ , ``lib/gpu/nvc_get_devices``\ , and ``lib/gpu/Makefile.lammps``\ . The latter has settings that enable LAMMPS From 88c8781396db1ec05f967648102fb4647fdebcd0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Mar 2023 10:17:20 -0400 Subject: [PATCH 089/112] silence compiler warnings --- src/pair_lj_cut_coul_cut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 5438e82377..e62e08ea4b 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -465,7 +465,7 @@ void PairLJCutCoulCut::born_matrix(int i, int j, int itype, int jtype, double rs double factor_coul, double factor_lj, double &dupair, double &du2pair) { - double rinv, r2inv, r3inv, r6inv, du, du2; + double rinv, r2inv, r3inv, r6inv; double du_lj, du2_lj, du_coul, du2_coul; double *q = atom->q; From 32c695a7d40d6ff886a45bab7581d4f035bcf60a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 15 Mar 2023 11:29:52 -0400 Subject: [PATCH 090/112] tag all TIP4P related pair style tests as unstable --- unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml | 1 + unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml | 1 + .../force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml | 1 + unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml | 1 + .../force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml | 1 + unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml | 2 +- unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml | 2 +- unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml | 2 +- unittest/force-styles/tests/mol-pair-tip4p_cut.yaml | 1 + unittest/force-styles/tests/mol-pair-tip4p_long.yaml | 1 + unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml | 1 + unittest/force-styles/tests/mol-pair-tip4p_table.yaml | 1 + 12 files changed, 12 insertions(+), 3 deletions(-) diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml index 141d61f8ae..95080fcdc6 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_cut.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:32 2022 epsilon: 5e-10 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml index 28961cd04e..00ff7f3842 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:32 2022 epsilon: 2e-11 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml index 29cd06c4a9..55331e09e9 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_long_soft.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:32 2022 epsilon: 1.0e-12 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml index 34a48e8f5f..5e6d460b65 100644 --- a/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_cut_tip4p_table.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:32 2022 epsilon: 5e-13 skip_tests: gpu diff --git a/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml index ef1fb4f4cd..80b844e7c5 100644 --- a/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_long_cut_tip4p_long.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:33 2022 epsilon: 2.5e-09 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml index 0a4639b1c9..72fc77efa4 100644 --- a/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_long_tip4p_long.yaml @@ -1,6 +1,6 @@ --- lammps_version: 17 Feb 2022 -tags: slow +tags: slow unstable date_generated: Fri Mar 18 22:17:33 2022 epsilon: 2.5e-09 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml index 817a1fcae8..6a20bf7b73 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_long.yaml @@ -1,6 +1,6 @@ --- lammps_version: 17 Feb 2022 -tags: slow +tags: slow unstable date_generated: Fri Mar 18 22:17:34 2022 epsilon: 2.5e-09 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml index c64b01d34a..02a58d0e95 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_tip4p_table.yaml @@ -1,6 +1,6 @@ --- lammps_version: 17 Feb 2022 -tags: slow +tags: slow unstable date_generated: Fri Mar 18 22:17:35 2022 epsilon: 2.5e-09 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml b/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml index 52fea193d5..09e96c1a7f 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_cut.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:36 2022 epsilon: 5.0e-10 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-tip4p_long.yaml b/unittest/force-styles/tests/mol-pair-tip4p_long.yaml index e79a216951..072642c471 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_long.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_long.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:36 2022 epsilon: 5e-13 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml index cf96b906c2..ec4590c0f8 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_long_soft.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:36 2022 epsilon: 1e-13 skip_tests: diff --git a/unittest/force-styles/tests/mol-pair-tip4p_table.yaml b/unittest/force-styles/tests/mol-pair-tip4p_table.yaml index eeef0d30ad..e76ecdf0f0 100644 --- a/unittest/force-styles/tests/mol-pair-tip4p_table.yaml +++ b/unittest/force-styles/tests/mol-pair-tip4p_table.yaml @@ -1,5 +1,6 @@ --- lammps_version: 17 Feb 2022 +tags: unstable date_generated: Fri Mar 18 22:17:36 2022 epsilon: 2.5e-13 skip_tests: From fa9062a87e74523048b561321c8f3859e774fd30 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 15 Mar 2023 18:39:32 -0400 Subject: [PATCH 091/112] make Force::special_lj and Force::special_coul accessible through the library interface --- python/lammps/core.py | 3 ++- src/library.cpp | 12 +++++++++++ .../c-library/test_library_properties.cpp | 21 +++++++++++++++++++ unittest/python/python-commands.py | 6 ++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index e4f8d807b6..80961186f3 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -814,7 +814,8 @@ class lammps(object): # set length of vector for items that are not a scalar vec_dict = { 'boxlo':3, 'boxhi':3, 'sublo':3, 'subhi':3, - 'sublo_lambda':3, 'subhi_lambda':3, 'periodicity':3 } + 'sublo_lambda':3, 'subhi_lambda':3, 'periodicity':3, + 'special_lj':4, 'special_coul':4 } if name in vec_dict: veclen = vec_dict[name] elif name == 'respa_dt': diff --git a/src/library.cpp b/src/library.cpp index 9f817a1199..cc4e748f57 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1232,6 +1232,8 @@ int lammps_extract_global_datatype(void * /*handle*/, const char *name) if (strcmp(name,"nghost") == 0) return LAMMPS_INT; if (strcmp(name,"nmax") == 0) return LAMMPS_INT; if (strcmp(name,"ntypes") == 0) return LAMMPS_INT; + if (strcmp(name,"special_lj") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"special_coul") == 0) return LAMMPS_DOUBLE; if (strcmp(name,"q_flag") == 0) return LAMMPS_INT; @@ -1470,6 +1472,14 @@ report the "native" data type. The following tables are provided: - int - 1 - maximum of nlocal+nghost across all MPI ranks (for per-atom data array size). + * - special_lj + - double + - 4 + - special :doc:`pair weighting factors ` for LJ interactions (first element is always 1.0) + * - special_coul + - double + - 4 + - special :doc:`pair weighting factors ` for Coulomb interactions (first element is always 1.0) * - q_flag - int - 1 @@ -1625,6 +1635,8 @@ void *lammps_extract_global(void *handle, const char *name) if (strcmp(name,"nlocal") == 0) return (void *) &lmp->atom->nlocal; if (strcmp(name,"nghost") == 0) return (void *) &lmp->atom->nghost; if (strcmp(name,"nmax") == 0) return (void *) &lmp->atom->nmax; + if (strcmp(name,"special_lj") == 0) return (void *) lmp->force->special_lj; + if (strcmp(name,"special_coul") == 0) return (void *) lmp->force->special_coul; if (strcmp(name,"q_flag") == 0) return (void *) &lmp->atom->q_flag; diff --git a/unittest/c-library/test_library_properties.cpp b/unittest/c-library/test_library_properties.cpp index bb0f6e2894..d6dd55f75e 100644 --- a/unittest/c-library/test_library_properties.cpp +++ b/unittest/c-library/test_library_properties.cpp @@ -297,6 +297,7 @@ TEST_F(LibraryProperties, global) std::string input = path_join(INPUT_DIR, "in.fourmol"); if (!verbose) ::testing::internal::CaptureStdout(); + lammps_command(lmp, "special_bonds lj 0.0 0.5 0.8 coul 0.1 0.5 1.0"); lammps_file(lmp, input.c_str()); lammps_command(lmp, "run 2 post no"); if (!verbose) ::testing::internal::GetCapturedStdout(); @@ -321,6 +322,26 @@ TEST_F(LibraryProperties, global) EXPECT_EQ(lammps_extract_global_datatype(lmp, "dt"), LAMMPS_DOUBLE); double *d_ptr = (double *)lammps_extract_global(lmp, "dt"); EXPECT_DOUBLE_EQ((*d_ptr), 0.1); + + EXPECT_EQ(lammps_extract_global_datatype(lmp, "special_lj"), LAMMPS_DOUBLE); + EXPECT_EQ(lammps_extract_global_datatype(lmp, "special_coul"), LAMMPS_DOUBLE); + double *special_lj = (double *)lammps_extract_global(lmp, "special_lj"); + double *special_coul= (double *)lammps_extract_global(lmp, "special_coul"); + EXPECT_DOUBLE_EQ(special_lj[0], 1.0); + EXPECT_DOUBLE_EQ(special_lj[1], 0.0); + EXPECT_DOUBLE_EQ(special_lj[2], 0.5); + EXPECT_DOUBLE_EQ(special_lj[3], 0.8); + EXPECT_DOUBLE_EQ(special_coul[0], 1.0); + EXPECT_DOUBLE_EQ(special_coul[1], 0.1); + EXPECT_DOUBLE_EQ(special_coul[2], 0.5); + EXPECT_DOUBLE_EQ(special_coul[3], 1.0); + lammps_command(lmp, "special_bonds lj/coul 1.0 1.0 1.0"); + EXPECT_DOUBLE_EQ(special_lj[1], 1.0); + EXPECT_DOUBLE_EQ(special_lj[2], 1.0); + EXPECT_DOUBLE_EQ(special_lj[3], 1.0); + EXPECT_DOUBLE_EQ(special_coul[1], 1.0); + EXPECT_DOUBLE_EQ(special_coul[2], 1.0); + EXPECT_DOUBLE_EQ(special_coul[3], 1.0); }; TEST_F(LibraryProperties, neighlist) diff --git a/unittest/python/python-commands.py b/unittest/python/python-commands.py index 13be27f067..33b19ba4f0 100644 --- a/unittest/python/python-commands.py +++ b/unittest/python/python-commands.py @@ -536,6 +536,7 @@ create_atoms 1 single & def test_extract_global(self): self.lmp.command("region box block -1 1 -2 2 -3 3") self.lmp.command("create_box 1 box") + self.lmp.command("special_bonds lj 0.0 0.5 0.8 coul 0.1 0.5 1.0") self.assertEqual(self.lmp.extract_global("units"), "lj") self.assertEqual(self.lmp.extract_global("ntimestep"), 0) self.assertEqual(self.lmp.extract_global("dt"), 0.005) @@ -552,10 +553,15 @@ create_atoms 1 single & self.assertEqual(self.lmp.extract_global("subhi"), [1.0, 2.0, 3.0]) self.assertEqual(self.lmp.extract_global("periodicity"), [1,1,1]) self.assertEqual(self.lmp.extract_global("triclinic"), 0) + self.assertEqual(self.lmp.extract_global("special_lj"), [1.0, 0.0, 0.5, 0.8]) + self.assertEqual(self.lmp.extract_global("special_coul"), [1.0, 0.1, 0.5, 1.0]) self.assertEqual(self.lmp.extract_global("sublo_lambda"), None) self.assertEqual(self.lmp.extract_global("subhi_lambda"), None) self.assertEqual(self.lmp.extract_global("respa_levels"), None) self.assertEqual(self.lmp.extract_global("respa_dt"), None) + self.lmp.command("special_bonds lj/coul 0.0 1.0 1.0") + self.assertEqual(self.lmp.extract_global("special_lj"), [1.0, 0.0, 1.0, 1.0]) + self.assertEqual(self.lmp.extract_global("special_coul"), [1.0, 0.0, 1.0, 1.0]) # set and initialize r-RESPA self.lmp.command("run_style respa 3 5 2 pair 2 kspace 3") From 56f4aaff474f3c02f731781b549f13fe91594a63 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 15 Mar 2023 21:28:05 -0400 Subject: [PATCH 092/112] explicitly specify central atom --- src/EXTRA-MOLECULE/improper_fourier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-MOLECULE/improper_fourier.cpp b/src/EXTRA-MOLECULE/improper_fourier.cpp index 3eef060204..295657b1b6 100644 --- a/src/EXTRA-MOLECULE/improper_fourier.cpp +++ b/src/EXTRA-MOLECULE/improper_fourier.cpp @@ -40,7 +40,7 @@ ImproperFourier::ImproperFourier(LAMMPS *lmp) : Improper(lmp) // the first and fourth atoms in the quadruplet are the atoms of symmetry symmatoms[0] = 1; - symmatoms[3] = 1; + symmatoms[3] = 2; } /* ---------------------------------------------------------------------- */ From 0bf0fd98cc8425fc82e49d2aa9cd7b4727626010 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 15 Mar 2023 21:29:14 -0400 Subject: [PATCH 093/112] explicitly specify central atom --- src/MOLECULE/improper_umbrella.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp index 52bc692670..1558adc337 100644 --- a/src/MOLECULE/improper_umbrella.cpp +++ b/src/MOLECULE/improper_umbrella.cpp @@ -43,7 +43,7 @@ ImproperUmbrella::ImproperUmbrella(LAMMPS *_lmp) : Improper(_lmp) // the first and fourth atoms in the quadruplet are the atoms of symmetry symmatoms[0] = 1; - symmatoms[3] = 1; + symmatoms[3] = 2; } /* ---------------------------------------------------------------------- */ From 4940bda15fce53ab698edeb147b02b79fa1dae2d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 15 Mar 2023 23:08:46 -0400 Subject: [PATCH 094/112] remove references to "make install" for Python package installation --- doc/src/Python_install.rst | 141 +------------------------------------ 1 file changed, 2 insertions(+), 139 deletions(-) diff --git a/doc/src/Python_install.rst b/doc/src/Python_install.rst index bc0406ee92..cc1e2cb5c9 100644 --- a/doc/src/Python_install.rst +++ b/doc/src/Python_install.rst @@ -27,124 +27,19 @@ interpreter can find it and installing the LAMMPS shared library into a folder that the dynamic loader searches or inside of the installed ``lammps`` package folder. There are multiple ways to achieve this. -#. Do a full LAMMPS installation of libraries, executables, selected - headers, documentation (if enabled), and supporting files (only - available via CMake), which can also be either system-wide or into - user specific folders. - #. Install both components into a Python ``site-packages`` folder, either system-wide or in the corresponding user-specific folder. This way no additional environment variables need to be set, but the shared library is otherwise not accessible. -#. Do an installation into a virtual environment. This can either be an - installation of the Python package only or a full installation of LAMMPS. +#. Do an installation into a virtual environment. #. Leave the files where they are in the source/development tree and adjust some environment variables. .. tabs:: - .. tab:: Full install (CMake-only) - - :ref:`Build the LAMMPS executable and library ` with - ``-DBUILD_SHARED_LIBS=on``, ``-DLAMMPS_EXCEPTIONS=on`` and - ``-DPKG_PYTHON=on`` (The first option is required, the other two - are optional by recommended). The exact file name of the shared - library depends on the platform (Unix/Linux, macOS, Windows) and - the build configuration being used. The installation base folder - is already set by default to the ``$HOME/.local`` directory, but - it can be changed to a custom location defined by the - ``CMAKE_INSTALL_PREFIX`` CMake variable. This uses a folder - called ``build`` to store files generated during compilation. - - .. code-block:: bash - - # create build folder - mkdir build - cd build - - # configure LAMMPS compilation - cmake -C ../cmake/presets/basic.cmake -D BUILD_SHARED_LIBS=on \ - -D LAMMPS_EXCEPTIONS=on -D PKG_PYTHON=on ../cmake - - # compile LAMMPS - cmake --build . - - # install LAMMPS into $HOME/.local - cmake --install . - - - This leads to an installation to the following locations: - - +------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+ - | File | Location | Notes | - +========================+=================================================================+=============================================================+ - | LAMMPS Python package | * ``$HOME/.local/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version | - | | * ``$HOME/.local/lib64/pythonX.Y/site-packages/lammps`` (64bit) | | - +------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS shared library | * ``$HOME/.local/lib/`` (32bit) | Set shared loader environment variable to this path | - | | * ``$HOME/.local/lib64/`` (64bit) | (see below for more info on this) | - +------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS executable | * ``$HOME/.local/bin/`` | | - +------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS potential files | * ``$HOME/.local/share/lammps/potentials/`` | Set ``LAMMPS_POTENTIALS`` environment variable to this path | - +------------------------+-----------------------------------------------------------------+-------------------------------------------------------------+ - - For a system-wide installation you need to set - ``CMAKE_INSTALL_PREFIX`` to a system folder like ``/usr`` (or - ``/usr/local``); the default is ``${HOME}/.local``. The - installation step for a system folder installation (**not** the - configuration/compilation) needs to be done with superuser - privilege, e.g. by using ``sudo cmake --install .``. The - installation folders will then be changed to (assuming ``/usr`` as - prefix): - - +------------------------+---------------------------------------------------------+-------------------------------------------------------------+ - | File | Location | Notes | - +========================+=========================================================+=============================================================+ - | LAMMPS Python package | * ``/usr/lib/pythonX.Y/site-packages/lammps`` (32bit) | ``X.Y`` depends on the installed Python version | - | | * ``/usr/lib64/pythonX.Y/site-packages/lammps`` (64bit) | | - +------------------------+---------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS shared library | * ``/usr/lib/`` (32bit) | | - | | * ``/usr/lib64/`` (64bit) | | - +------------------------+---------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS executable | * ``/usr/bin/`` | | - +------------------------+---------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS potential files | * ``/usr/share/lammps/potentials/`` | | - +------------------------+---------------------------------------------------------+-------------------------------------------------------------+ - - To be able to use the "user" installation you have to ensure that - the folder containing the LAMMPS shared library is either included - in a path searched by the shared linker (e.g. like - ``/usr/lib64/``) or part of the ``LD_LIBRARY_PATH`` environment - variable (or ``DYLD_LIBRARY_PATH`` on macOS). Otherwise you will - get an error when trying to create a LAMMPS object through the - Python module. - - .. code-block:: bash - - # Unix/Linux - export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH - - # macOS - export DYLD_LIBRARY_PATH=$HOME/.local/lib:$DYLD_LIBRARY_PATH - - If you plan to use the LAMMPS executable (e.g., ``lmp``), you may - also need to adjust the ``PATH`` environment variable (but many - newer Linux distributions already have ``$HOME/.local/bin`` - included). Example: - - .. code-block:: bash - - export PATH=$HOME/.local/bin:$PATH - - To make those changes permanent, you can add the commands to your - ``$HOME/.bashrc`` file. For a system-wide installation is is not - necessary due to files installed in system folders that are loaded - automatically when a login shell is started. - - .. tab:: Python package only + .. tab:: Python package Compile LAMMPS with either :doc:`CMake ` or the :doc:`traditional make ` procedure in :ref:`shared @@ -272,38 +167,6 @@ folder that the dynamic loader searches or inside of the installed | LAMMPS shared library | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/lammps`` | ``X.Y`` depends on the installed Python version | +------------------------+--------------------------------------------------------+-------------------------------------------------------------+ - If you do a full installation (CMake only) with "install", this - leads to the following installation locations: - - +------------------------+--------------------------------------------------------+-------------------------------------------------------------+ - | File | Location | Notes | - +========================+========================================================+=============================================================+ - | LAMMPS Python Module | * ``$VIRTUAL_ENV/lib/pythonX.Y/site-packages/lammps`` | ``X.Y`` depends on the installed Python version | - +------------------------+--------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS shared library | * ``$VIRTUAL_ENV/lib/`` (32bit) | Set shared loader environment variable to this path | - | | * ``$VIRTUAL_ENV/lib64/`` (64bit) | (see below for more info on this) | - +------------------------+--------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS executable | * ``$VIRTUAL_ENV/bin/`` | | - +------------------------+--------------------------------------------------------+-------------------------------------------------------------+ - | LAMMPS potential files | * ``$VIRTUAL_ENV/share/lammps/potentials/`` | Set ``LAMMPS_POTENTIALS`` environment variable to this path | - +------------------------+--------------------------------------------------------+-------------------------------------------------------------+ - - In that case you need to modify the ``$HOME/myenv/bin/activate`` - script in a similar fashion you need to update your - ``$HOME/.bashrc`` file to include the shared library and - executable locations in ``LD_LIBRARY_PATH`` (or - ``DYLD_LIBRARY_PATH`` on macOS) and ``PATH``, respectively. - - For example with: - - .. code-block:: bash - - # Unix/Linux - echo 'export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH' >> $HOME/myenv/bin/activate - - # macOS - echo 'export DYLD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$DYLD_LIBRARY_PATH' >> $HOME/myenv/bin/activate - .. tab:: In place usage You can also :doc:`compile LAMMPS ` as usual in From a8c27a2275fedb8134119a8ab0c61f81acefb041 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Wed, 15 Mar 2023 23:55:13 -0400 Subject: [PATCH 095/112] clarify symmatoms convention --- src/improper.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/improper.h b/src/improper.h index dfdfabae21..fbe86dfcd1 100644 --- a/src/improper.h +++ b/src/improper.h @@ -27,7 +27,6 @@ class Improper : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file int born_matrix_enable; - int symmatoms[4]; // symmetry atom(s) of improper style double energy; // accumulated energies double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom, **vatom; // accumulated per-atom energy/virial @@ -37,6 +36,11 @@ class Improper : protected Pointers { // CENTROID_SAME = same as two-body stress // CENTROID_AVAIL = different and implemented // CENTROID_NOTAVAIL = different, not yet implemented + + int symmatoms[4]; // symmetry atom(s) of improper style + // value of 0: interchangable atoms + // value of 1: central atom + // values >1: additional atoms of symmetry // KOKKOS host/device flag and data masks From 0e3dc6fefa09314da70a487cb03303973004e883 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 08:01:26 -0400 Subject: [PATCH 096/112] Download the latest MSCG snapshot to address bug in library. --- cmake/Modules/Packages/MSCG.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/Packages/MSCG.cmake b/cmake/Modules/Packages/MSCG.cmake index e4260e059e..2b8e8eda06 100644 --- a/cmake/Modules/Packages/MSCG.cmake +++ b/cmake/Modules/Packages/MSCG.cmake @@ -7,8 +7,8 @@ else() endif() option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT}) if(DOWNLOAD_MSCG) - set(MSCG_URL "https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz" CACHE STRING "URL for MSCG tarball") - set(MSCG_MD5 "8c45e269ee13f60b303edd7823866a91" CACHE STRING "MD5 checksum of MSCG tarball") + set(MSCG_URL "https://github.com/uchicago-voth/MSCG-release/archive/491270a73539e3f6951e76f7dbe84e258b3ebb45.tar.gz" CACHE STRING "URL for MSCG tarball") + set(MSCG_MD5 "7ea50748fba5c3a372e0266bd31d2f11" CACHE STRING "MD5 checksum of MSCG tarball") mark_as_advanced(MSCG_URL) mark_as_advanced(MSCG_MD5) From 5c5e7b7e48afd28c62d07655d547b4e12eaab982 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 08:39:23 -0400 Subject: [PATCH 097/112] update fix mscg example --- examples/mscg/log.16Mar23.g++.1 | 105 +++++++++++++ examples/mscg/log.31Mar17.g++.1 | 145 ------------------ examples/mscg/output_16Mar23/1_1.dat | 71 +++++++++ examples/mscg/output_16Mar23/1_1.table | 104 +++++++++++++ examples/mscg/output_16Mar23/b-spline.out | 2 + .../{output_9Jan17 => output_16Mar23}/rmin.in | 0 .../rmin_b.in | 0 examples/mscg/output_16Mar23/sol_info.out | 17 ++ examples/mscg/output_16Mar23/x.out | 2 + examples/mscg/output_9Jan17/1_1.dat | 77 ---------- examples/mscg/output_9Jan17/1_1.table | 82 ---------- examples/mscg/output_9Jan17/b-spline.out | 2 - examples/mscg/output_9Jan17/sol_info.out | 18 --- examples/mscg/output_9Jan17/x.out | 1 - 14 files changed, 301 insertions(+), 325 deletions(-) create mode 100644 examples/mscg/log.16Mar23.g++.1 delete mode 100644 examples/mscg/log.31Mar17.g++.1 create mode 100644 examples/mscg/output_16Mar23/1_1.dat create mode 100644 examples/mscg/output_16Mar23/1_1.table create mode 100644 examples/mscg/output_16Mar23/b-spline.out rename examples/mscg/{output_9Jan17 => output_16Mar23}/rmin.in (100%) rename examples/mscg/{output_9Jan17 => output_16Mar23}/rmin_b.in (100%) create mode 100644 examples/mscg/output_16Mar23/sol_info.out create mode 100644 examples/mscg/output_16Mar23/x.out delete mode 100644 examples/mscg/output_9Jan17/1_1.dat delete mode 100644 examples/mscg/output_9Jan17/1_1.table delete mode 100644 examples/mscg/output_9Jan17/b-spline.out delete mode 100644 examples/mscg/output_9Jan17/sol_info.out delete mode 100644 examples/mscg/output_9Jan17/x.out diff --git a/examples/mscg/log.16Mar23.g++.1 b/examples/mscg/log.16Mar23.g++.1 new file mode 100644 index 0000000000..8c99fd3e15 --- /dev/null +++ b/examples/mscg/log.16Mar23.g++.1 @@ -0,0 +1,105 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +units real +atom_style full +pair_style zero 10.0 + +read_data data.meoh +Reading data file ... + orthogonal box = (-20.6917 -20.6917 -20.6917) to (20.6917 20.6917 20.6917) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 1000 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.007 seconds +pair_coeff * * + +thermo 1 +thermo_style custom step + +# Test 1a: range finder functionality +fix 1 all mscg 1 range on +rerun dump.meoh first 0 last 4500 every 250 dump x y z fx fy fz +WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.045 | 6.045 | 6.045 Mbytes + Step + 0 + 250 + 500 + 750 + 1000 + 1250 + 1500 + 1750 + 2000 + 2250 + 2500 + 2750 + 3000 + 3250 + 3500 + 3750 + 4000 + 4250 + 4500 +Loop time of 0.245891 on 1 procs for 19 steps with 1000 atoms + +print "TEST_1a mscg range finder" +TEST_1a mscg range finder +unfix 1 + +# Test 1b: force matching functionality +fix 1 all mscg 1 +rerun dump.meoh first 0 last 4500 every 250 dump x y z fx fy fz +WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 6.045 | 6.045 | 6.045 Mbytes + Step + 0 + 250 + 500 + 750 + 1000 + 1250 + 1500 + 1750 + 2000 + 2250 + 2500 + 2750 + 3000 + 3250 + 3500 + 3750 + 4000 + 4250 + 4500 +Loop time of 0.433986 on 1 procs for 19 steps with 1000 atoms + +print "TEST_1b mscg force matching" +TEST_1b mscg force matching + +print TEST_DONE +TEST_DONE +Total wall time: 0:00:00 diff --git a/examples/mscg/log.31Mar17.g++.1 b/examples/mscg/log.31Mar17.g++.1 deleted file mode 100644 index c67bc483db..0000000000 --- a/examples/mscg/log.31Mar17.g++.1 +++ /dev/null @@ -1,145 +0,0 @@ -LAMMPS (13 Apr 2017) -units real -atom_style full -pair_style zero 10.0 - -read_data data.meoh - orthogonal box = (-20.6917 -20.6917 -20.6917) to (20.6917 20.6917 20.6917) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 1000 atoms - 0 = max # of 1-2 neighbors - 0 = max # of 1-3 neighbors - 0 = max # of 1-4 neighbors - 1 = max # of special neighbors -pair_coeff * * - -thermo 1 -thermo_style custom step - -# Test 1a: range finder functionality -fix 1 all mscg 1 range on -rerun dump.meoh first 0 last 4500 every 250 dump x y z fx fy fz -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12 - ghost atom cutoff = 12 - binsize = 6, bins = 7 7 7 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair zero, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.794 | 5.794 | 5.794 Mbytes -Step - 0 - 250 - 500 - 750 - 1000 - 1250 - 1500 - 1750 - 2000 - 2250 - 2500 - 2750 - 3000 - 3250 - 3500 - 3750 - 4000 - 4250 - 4500 -Loop time of 0.581537 on 1 procs for 19 steps with 1000 atoms - -Performance: 2.823 ns/day, 8.502 hours/ns, 32.672 timesteps/s -99.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Bond | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.5815 | | |100.00 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 2934 ave 2934 max 2934 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 50654 ave 50654 max 50654 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 50654 -Ave neighs/atom = 50.654 -Ave special neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds = 0 -print "TEST_1a mscg range finder" -TEST_1a mscg range finder -unfix 1 - -# Test 1b: force matching functionality -fix 1 all mscg 1 -rerun dump.meoh first 0 last 4500 every 250 dump x y z fx fy fz -Per MPI rank memory allocation (min/avg/max) = 5.794 | 5.794 | 5.794 Mbytes -Step - 0 - 250 - 500 - 750 - 1000 - 1250 - 1500 - 1750 - 2000 - 2250 - 2500 - 2750 - 3000 - 3250 - 3500 - 3750 - 4000 - 4250 - 4500 -Loop time of 0.841917 on 1 procs for 19 steps with 1000 atoms - -Performance: 1.950 ns/day, 12.309 hours/ns, 22.568 timesteps/s -99.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Bond | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.8419 | | |100.00 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 2934 ave 2934 max 2934 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 50654 ave 50654 max 50654 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 50654 -Ave neighs/atom = 50.654 -Ave special neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds = 0 -print "TEST_1b mscg force matching" -TEST_1b mscg force matching - -print TEST_DONE -TEST_DONE -Total wall time: 0:00:01 diff --git a/examples/mscg/output_16Mar23/1_1.dat b/examples/mscg/output_16Mar23/1_1.dat new file mode 100644 index 0000000000..d73cd05fe6 --- /dev/null +++ b/examples/mscg/output_16Mar23/1_1.dat @@ -0,0 +1,71 @@ +3.000000 9.109433117503674e+00 +3.100000 6.562933520937051e+00 +3.200000 3.803570347770783e+00 +3.300000 1.524835163098694e+00 +3.400000 3.680752991750511e-02 +3.500000 -6.369395346711866e-01 +3.600000 -6.624341032589213e-01 +3.700000 -2.983998819283989e-01 +3.800000 1.996942072449469e-01 +3.900000 6.507540486137935e-01 +4.000000 9.561503221901252e-01 +4.100000 1.082978861799261e+00 +4.200000 1.046366050930359e+00 +4.300000 8.917742185869113e-01 +4.400000 6.773070351372578e-01 +4.500000 4.561974686292022e-01 +4.600000 2.640422255436971e-01 +4.700000 1.180848207166380e-01 +4.800000 2.124502216672507e-02 +4.900000 -3.366915456585443e-02 +5.000000 -5.974945208074427e-02 +5.100000 -7.177537677873873e-02 +5.200000 -8.204929079011507e-02 +5.300000 -9.745573177789707e-02 +5.400000 -1.196283642109915e-01 +5.500000 -1.463411396781238e-01 +5.600000 -1.729465415853768e-01 +5.700000 -1.938138298537278e-01 +5.800000 -2.037672856165882e-01 +5.900000 -1.995060297815394e-01 +6.000000 -1.805447650094144e-01 +6.100000 -1.489384048916932e-01 +6.200000 -1.085276302304308e-01 +6.300000 -6.416601955090541e-02 +6.400000 -2.094717961426480e-02 +6.500000 1.656812406982645e-02 +6.600000 4.511482523443927e-02 +6.700000 6.322611594801032e-02 +6.800000 7.107524696431811e-02 +6.900000 7.005702917383723e-02 +7.000000 6.235932355899154e-02 +7.100000 5.053453114940768e-02 +7.200000 3.707108297716843e-02 +7.300000 2.397003518601587e-02 +7.400000 1.245439896007831e-02 +7.500000 3.015413982707119e-03 +7.600000 -4.408442264121739e-03 +7.700000 -1.024733994435217e-02 +7.800000 -1.511598231239246e-02 +7.900000 -1.962949115765983e-02 +8.000000 -2.422153184874873e-02 +8.100000 -2.902066868449916e-02 +8.200000 -3.387453677654857e-02 +8.300000 -3.843224513464188e-02 +8.400000 -4.222901944115068e-02 +8.500000 -4.477084482559266e-02 +8.600000 -4.561910863915099e-02 +8.700000 -4.447439067652353e-02 +8.800000 -4.123808661911404e-02 +8.900000 -3.601776131390161e-02 +9.000000 -2.911033476210515e-02 +9.100000 -2.098441550402311e-02 +9.200000 -1.226263400387303e-02 +9.300000 -3.703976034631109e-03 +9.400000 3.815231963949414e-03 +9.500000 9.355387087425532e-03 +9.600000 1.205664749783030e-02 +9.700000 1.131702059340882e-02 +9.800000 6.971799313021964e-03 +9.900000 -5.270015594498346e-04 +10.000000 -9.931209090702869e-03 diff --git a/examples/mscg/output_16Mar23/1_1.table b/examples/mscg/output_16Mar23/1_1.table new file mode 100644 index 0000000000..148d909ad3 --- /dev/null +++ b/examples/mscg/output_16Mar23/1_1.table @@ -0,0 +1,104 @@ +# Header information on force file + +1_1 +N 99 R 0.200000 10.000000 + +1 0.200000 127.263594 80.411422 +2 0.300000 119.349776 77.864922 +3 0.400000 111.690609 75.318423 +4 0.500000 104.286092 72.771923 +5 0.600000 97.136225 70.225423 +6 0.700000 90.241007 67.678924 +7 0.800000 83.600440 65.132424 +8 0.900000 77.214522 62.585925 +9 1.000000 71.083255 60.039425 +10 1.100000 65.206637 57.492925 +11 1.200000 59.584670 54.946426 +12 1.300000 54.217352 52.399926 +13 1.400000 49.104684 49.853427 +14 1.500000 44.246667 47.306927 +15 1.600000 39.643299 44.760427 +16 1.700000 35.294581 42.213928 +17 1.800000 31.200513 39.667428 +18 1.900000 27.361096 37.120929 +19 2.000000 23.776328 34.574429 +20 2.100000 20.446210 32.027929 +21 2.200000 17.370742 29.481430 +22 2.300000 14.549924 26.934930 +23 2.400000 11.983756 24.388431 +24 2.500000 9.672238 21.841931 +25 2.600000 7.615370 19.295432 +26 2.700000 5.813151 16.748932 +27 2.800000 4.265583 14.202432 +28 2.900000 2.972665 11.655933 +29 3.000000 1.934397 9.109433 +30 3.100000 1.150778 6.562934 +31 3.200000 0.632453 3.803570 +32 3.300000 0.366033 1.524835 +33 3.400000 0.287951 0.036808 +34 3.500000 0.317957 -0.636940 +35 3.600000 0.382926 -0.662434 +36 3.700000 0.430968 -0.298400 +37 3.800000 0.435903 0.199694 +38 3.900000 0.393381 0.650754 +39 4.000000 0.313035 0.956150 +40 4.100000 0.211079 1.082979 +41 4.200000 0.104612 1.046366 +42 4.300000 0.007705 0.891774 +43 4.400000 -0.070749 0.677307 +44 4.500000 -0.127425 0.456197 +45 4.600000 -0.163437 0.264042 +46 4.700000 -0.182543 0.118085 +47 4.800000 -0.189509 0.021245 +48 4.900000 -0.188888 -0.033669 +49 5.000000 -0.184217 -0.059749 +50 5.100000 -0.177641 -0.071775 +51 5.200000 -0.169950 -0.082049 +52 5.300000 -0.160975 -0.097456 +53 5.400000 -0.150120 -0.119628 +54 5.500000 -0.136822 -0.146341 +55 5.600000 -0.120858 -0.172947 +56 5.700000 -0.102520 -0.193814 +57 5.800000 -0.082640 -0.203767 +58 5.900000 -0.062477 -0.199506 +59 6.000000 -0.043474 -0.180545 +60 6.100000 -0.027000 -0.148938 +61 6.200000 -0.014127 -0.108528 +62 6.300000 -0.005492 -0.064166 +63 6.400000 -0.001236 -0.020947 +64 6.500000 -0.001018 0.016568 +65 6.600000 -0.004102 0.045115 +66 6.700000 -0.009519 0.063226 +67 6.800000 -0.016234 0.071075 +68 6.900000 -0.023290 0.070057 +69 7.000000 -0.029911 0.062359 +70 7.100000 -0.035556 0.050535 +71 7.200000 -0.039936 0.037071 +72 7.300000 -0.042988 0.023970 +73 7.400000 -0.044809 0.012454 +74 7.500000 -0.045583 0.003015 +75 7.600000 -0.045513 -0.004408 +76 7.700000 -0.044781 -0.010247 +77 7.800000 -0.043512 -0.015116 +78 7.900000 -0.041775 -0.019629 +79 8.000000 -0.039583 -0.024222 +80 8.100000 -0.036920 -0.029021 +81 8.200000 -0.033776 -0.033875 +82 8.300000 -0.030160 -0.038432 +83 8.400000 -0.026127 -0.042229 +84 8.500000 -0.021777 -0.044771 +85 8.600000 -0.017258 -0.045619 +86 8.700000 -0.012753 -0.044474 +87 8.800000 -0.008467 -0.041238 +88 8.900000 -0.004605 -0.036018 +89 9.000000 -0.001348 -0.029110 +90 9.100000 0.001156 -0.020984 +91 9.200000 0.002819 -0.012263 +92 9.300000 0.003617 -0.003704 +93 9.400000 0.003612 0.003815 +94 9.500000 0.002953 0.009355 +95 9.600000 0.001882 0.012057 +96 9.700000 0.000714 0.011317 +97 9.800000 -0.000201 0.006972 +98 9.900000 -0.000523 -0.000527 +99 10.000000 0.000000 -0.009931 diff --git a/examples/mscg/output_16Mar23/b-spline.out b/examples/mscg/output_16Mar23/b-spline.out new file mode 100644 index 0000000000..8571ede9b7 --- /dev/null +++ b/examples/mscg/output_16Mar23/b-spline.out @@ -0,0 +1,2 @@ +n: 1 1 6 11 3.000000000000000e+00 1.000000000000000e+01 +9.109454054135307e+00 6.178334150703818e+00 -6.242976259059743e+00 4.778144787445235e+00 -1.082885612852992e+00 4.521835893850554e-01 -6.477047196208028e-01 2.947887062333265e-01 -4.195609079009661e-02 1.111775827831465e-02 -8.823466147380592e-02 -1.696076806027540e-02 3.192205281984208e-02 3.656991607866288e-03 -9.931306149957592e-03 diff --git a/examples/mscg/output_9Jan17/rmin.in b/examples/mscg/output_16Mar23/rmin.in similarity index 100% rename from examples/mscg/output_9Jan17/rmin.in rename to examples/mscg/output_16Mar23/rmin.in diff --git a/examples/mscg/output_9Jan17/rmin_b.in b/examples/mscg/output_16Mar23/rmin_b.in similarity index 100% rename from examples/mscg/output_9Jan17/rmin_b.in rename to examples/mscg/output_16Mar23/rmin_b.in diff --git a/examples/mscg/output_16Mar23/sol_info.out b/examples/mscg/output_16Mar23/sol_info.out new file mode 100644 index 0000000000..eb4460f9ce --- /dev/null +++ b/examples/mscg/output_16Mar23/sol_info.out @@ -0,0 +1,17 @@ +fm_matrix_rows:3000; fm_matrix_columns:15; +Singular vector: +2.307693e+00 +1.998418e+00 +1.400114e+00 +1.183608e+00 +9.718949e-01 +7.471241e-01 +5.277965e-01 +5.084369e-01 +3.510398e-01 +2.997000e-01 +2.142454e-01 +1.201800e-01 +7.143923e-02 +3.077326e-02 +1.835581e-02 diff --git a/examples/mscg/output_16Mar23/x.out b/examples/mscg/output_16Mar23/x.out new file mode 100644 index 0000000000..d9ae514466 --- /dev/null +++ b/examples/mscg/output_16Mar23/x.out @@ -0,0 +1,2 @@ +ýÙ\ +8"@Ÿ!D:¶@Îv¹ÄÎøÀH…¶üÑ@H3HÝSñ¿Ô– p“ðÜ??ÿ¹ä¿€% sÑÝÒ?:yŸËD{¥¿Œz®AèĆ?#Tgù‹–¶¿l#‰à)^‘¿ÂÊÃYX ?KçpkDõm?ª ÷XÝV„¿ \ No newline at end of file diff --git a/examples/mscg/output_9Jan17/1_1.dat b/examples/mscg/output_9Jan17/1_1.dat deleted file mode 100644 index fcfbe0d7c8..0000000000 --- a/examples/mscg/output_9Jan17/1_1.dat +++ /dev/null @@ -1,77 +0,0 @@ -2.500000 5.670970817963099e+02 -2.600000 2.404059283529051e+02 -2.700000 9.157060823529977e+01 -2.800000 3.428273061369140e+01 -2.900000 1.619868149395266e+01 -3.000000 1.039607214301755e+01 -3.100000 6.830187514267188e+00 -3.200000 3.861970842349535e+00 -3.300000 1.645948643278161e+00 -3.400000 2.395428971623918e-01 -3.500000 -4.276763637833773e-01 -3.600000 -5.132022977965877e-01 -3.700000 -2.208024961234051e-01 -3.800000 2.402697744243800e-01 -3.900000 6.956064296165573e-01 -4.000000 1.034070044257954e+00 -4.100000 1.205997975111669e+00 -4.200000 1.209501102128581e+00 -4.300000 1.076304670380924e+00 -4.400000 8.575891319958883e-01 -4.500000 6.098309880892070e-01 -4.600000 3.807992942746473e-01 -4.700000 1.995994191469442e-01 -4.800000 7.699059877424269e-02 -4.900000 9.750744163981299e-03 -5.000000 -1.480308769532222e-02 -5.100000 -1.429422279228416e-02 -5.200000 -6.765899050869768e-03 -5.300000 -6.214398421078919e-03 -5.400000 -1.951586041390797e-02 -5.500000 -4.689090237947263e-02 -5.600000 -8.376292122940529e-02 -5.700000 -1.226699982917263e-01 -5.800000 -1.551768041657136e-01 -5.900000 -1.737865035767736e-01 -6.000000 -1.738272491408507e-01 -6.100000 -1.546779867768825e-01 -6.200000 -1.193171291488982e-01 -6.300000 -7.321054075616322e-02 -6.400000 -2.317411193286228e-02 -6.500000 2.376366715221714e-02 -6.600000 6.149913249600215e-02 -6.700000 8.597538938112201e-02 -6.800000 9.590170060736655e-02 -6.900000 9.245100462148878e-02 -7.000000 7.855487875847664e-02 -7.100000 5.818301960249692e-02 -7.200000 3.562272334783877e-02 -7.300000 1.475836615985744e-02 -7.400000 -1.639617536128255e-03 -7.500000 -1.237881063914745e-02 -7.600000 -1.768202571195587e-02 -7.700000 -1.877757119362295e-02 -7.800000 -1.748001968416543e-02 -7.900000 -1.577097622918088e-02 -8.000000 -1.537984660448136e-02 -8.100000 -1.737044400054951e-02 -8.200000 -2.187939410237979e-02 -8.300000 -2.823987455760605e-02 -8.400000 -3.525715284001425e-02 -8.500000 -4.148996251287761e-02 -8.600000 -4.553187949229211e-02 -8.700000 -4.629269831051163e-02 -8.800000 -4.327548798226762e-02 -8.900000 -3.674131754868225e-02 -9.000000 -2.758883541814894e-02 -9.100000 -1.712151838480657e-02 -9.200000 -6.810600249997737e-03 -9.300000 1.941999556272785e-03 -9.400000 8.040747353879739e-03 -9.500000 1.092691524686838e-02 -9.600000 1.063606620723048e-02 -9.700000 7.416550438142138e-03 -9.800000 1.175066786686231e-03 -9.900000 -9.084427187675534e-03 -10.000000 -2.582180514463068e-02 -10.100000 -5.352186189454393e-02 diff --git a/examples/mscg/output_9Jan17/1_1.table b/examples/mscg/output_9Jan17/1_1.table deleted file mode 100644 index 9d78fabc77..0000000000 --- a/examples/mscg/output_9Jan17/1_1.table +++ /dev/null @@ -1,82 +0,0 @@ -# Header information on force file - -1_1 -N 77 R 2.500000 10.100000 - -1 2.500000 69.428523 567.097082 -2 2.600000 29.053372 240.405928 -3 2.700000 12.454545 91.570608 -4 2.800000 6.161878 34.282731 -5 2.900000 3.637808 16.198681 -6 3.000000 2.308070 10.396072 -7 3.100000 1.446757 6.830188 -8 3.200000 0.912149 3.861971 -9 3.300000 0.636753 1.645949 -10 3.400000 0.542478 0.239543 -11 3.500000 0.551885 -0.427676 -12 3.600000 0.598929 -0.513202 -13 3.700000 0.635629 -0.220802 -14 3.800000 0.634656 0.240270 -15 3.900000 0.587862 0.695606 -16 4.000000 0.501378 1.034070 -17 4.100000 0.389375 1.205998 -18 4.200000 0.268600 1.209501 -19 4.300000 0.154310 1.076305 -20 4.400000 0.057615 0.857589 -21 4.500000 -0.015756 0.609831 -22 4.600000 -0.065288 0.380799 -23 4.700000 -0.094307 0.199599 -24 4.800000 -0.108137 0.076991 -25 4.900000 -0.112474 0.009751 -26 5.000000 -0.112221 -0.014803 -27 5.100000 -0.110767 -0.014294 -28 5.200000 -0.109714 -0.006766 -29 5.300000 -0.109065 -0.006214 -30 5.400000 -0.107778 -0.019516 -31 5.500000 -0.104458 -0.046891 -32 5.600000 -0.097925 -0.083763 -33 5.700000 -0.087603 -0.122670 -34 5.800000 -0.073711 -0.155177 -35 5.900000 -0.057263 -0.173787 -36 6.000000 -0.039882 -0.173827 -37 6.100000 -0.023457 -0.154678 -38 6.200000 -0.009757 -0.119317 -39 6.300000 -0.000131 -0.073211 -40 6.400000 0.004688 -0.023174 -41 6.500000 0.004659 0.023764 -42 6.600000 0.000396 0.061499 -43 6.700000 -0.006978 0.085975 -44 6.800000 -0.016072 0.095902 -45 6.900000 -0.025489 0.092451 -46 7.000000 -0.034040 0.078555 -47 7.100000 -0.040877 0.058183 -48 7.200000 -0.045567 0.035623 -49 7.300000 -0.048086 0.014758 -50 7.400000 -0.048742 -0.001640 -51 7.500000 -0.048041 -0.012379 -52 7.600000 -0.046538 -0.017682 -53 7.700000 -0.044715 -0.018778 -54 7.800000 -0.042902 -0.017480 -55 7.900000 -0.041239 -0.015771 -56 8.000000 -0.039682 -0.015380 -57 8.100000 -0.038044 -0.017370 -58 8.200000 -0.036082 -0.021879 -59 8.300000 -0.033576 -0.028240 -60 8.400000 -0.030401 -0.035257 -61 8.500000 -0.026564 -0.041490 -62 8.600000 -0.022213 -0.045532 -63 8.700000 -0.017621 -0.046293 -64 8.800000 -0.013143 -0.043275 -65 8.900000 -0.009142 -0.036741 -66 9.000000 -0.005926 -0.027589 -67 9.100000 -0.003690 -0.017122 -68 9.200000 -0.002494 -0.006811 -69 9.300000 -0.002250 0.001942 -70 9.400000 -0.002749 0.008041 -71 9.500000 -0.003698 0.010927 -72 9.600000 -0.004776 0.010636 -73 9.700000 -0.005678 0.007417 -74 9.800000 -0.006108 0.001175 -75 9.900000 -0.005712 -0.009084 -76 10.000000 -0.003967 -0.025822 -77 10.100000 0.000000 -0.053522 diff --git a/examples/mscg/output_9Jan17/b-spline.out b/examples/mscg/output_9Jan17/b-spline.out deleted file mode 100644 index c1dcd731ca..0000000000 --- a/examples/mscg/output_9Jan17/b-spline.out +++ /dev/null @@ -1,2 +0,0 @@ -n: 1 1 6 12 2.400000000000002e+00 1.010000000000000e+01 -1.200460787805587e+03 2.169623423326193e+01 2.388396964379328e+01 -1.197754948555067e+01 6.472482422420378e+00 -1.483711824891365e+00 7.768139601662113e-01 -7.869494711740244e-01 4.830820182054661e-01 -1.892989444995645e-01 1.021275453070386e-01 -1.637649039972671e-01 5.570978712841167e-02 7.637188693695119e-03 -4.109175461195019e-03 -5.352186189455146e-02 diff --git a/examples/mscg/output_9Jan17/sol_info.out b/examples/mscg/output_9Jan17/sol_info.out deleted file mode 100644 index 5f02270f51..0000000000 --- a/examples/mscg/output_9Jan17/sol_info.out +++ /dev/null @@ -1,18 +0,0 @@ -fm_matrix_rows:3000; fm_matrix_columns:16; -Singular vector: -2.442317e+00 -2.105009e+00 -1.433251e+00 -1.184602e+00 -9.739627e-01 -6.944898e-01 -5.376709e-01 -4.616070e-01 -3.257062e-01 -2.683729e-01 -1.530153e-01 -9.336288e-02 -5.042150e-02 -2.126912e-02 -1.446682e-02 -4.167763e-05 diff --git a/examples/mscg/output_9Jan17/x.out b/examples/mscg/output_9Jan17/x.out deleted file mode 100644 index 124cf8bf41..0000000000 --- a/examples/mscg/output_9Jan17/x.out +++ /dev/null @@ -1 +0,0 @@ -‘-ÂØ×Á’@47h<²5@¸¿¦ÕKâ7@ÑR½]ô'Àéë nÒã@ÝŒIœH½÷¿¯?ó¨Ûè?r€I¨°.鿚^×ÐêÞ?Wå£ò:È¿(Oã%º?ËNs•?öÄ¿:‘Cþ…¬?ËÃ:,H?à}‚cÈÔp¿£ê¬7g«¿ \ No newline at end of file From f63befc80f33819fc2ce4395e2c1d2a658396867 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 10:29:00 -0400 Subject: [PATCH 098/112] consolidate replicated commands to single location --- cmake/Modules/Packages/GPU.cmake | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index a0578394f1..034c4b3a9f 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -176,12 +176,6 @@ if(GPU_API STREQUAL "CUDA") target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini) target_compile_definitions(gpu PRIVATE -DUSE_CUDPP) endif() - if(BUILD_OMP) - find_package(OpenMP COMPONENTS CXX REQUIRED) - target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX) - endif() - - target_link_libraries(lammps PRIVATE gpu) add_executable(nvc_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR) @@ -255,12 +249,6 @@ elseif(GPU_API STREQUAL "OPENCL") else() target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT) endif() - if(BUILD_OMP) - find_package(OpenMP COMPONENTS CXX REQUIRED) - target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX) - endif() - - target_link_libraries(lammps PRIVATE gpu) add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL) @@ -417,10 +405,6 @@ elseif(GPU_API STREQUAL "HIP") target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DUCL_NO_EXIT) endif() target_link_libraries(gpu PRIVATE hip::host) - if(BUILD_OMP) - find_package(OpenMP COMPONENTS CXX REQUIRED) - target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX) - endif() if(HIP_USE_DEVICE_SORT) if(HIP_PLATFORM STREQUAL "amd") @@ -489,10 +473,14 @@ elseif(GPU_API STREQUAL "HIP") target_include_directories(hip_get_devices PRIVATE ${CUDA_INCLUDE_DIRS}) target_link_libraries(hip_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) endif() - - target_link_libraries(lammps PRIVATE gpu) endif() +if(BUILD_OMP) + find_package(OpenMP COMPONENTS CXX REQUIRED) + target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX) +endif() +target_link_libraries(lammps PRIVATE gpu) + set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}") # detect styles which have a GPU version RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) From d71a78449a0b66b6fa1252aea2ea73e273a15426 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 12:29:51 -0400 Subject: [PATCH 099/112] fix two bugs in the ndx2group command --- src/COLVARS/ndx_group.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/COLVARS/ndx_group.cpp b/src/COLVARS/ndx_group.cpp index 4f8a682a2a..1d24db3900 100644 --- a/src/COLVARS/ndx_group.cpp +++ b/src/COLVARS/ndx_group.cpp @@ -81,6 +81,8 @@ void Ndx2Group::command(int narg, char **arg) if (narg < 1) error->all(FLERR,"Illegal ndx2group command"); if (atom->tag_enable == 0) error->all(FLERR,"Must have atom IDs for ndx2group command"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR,"Must have an atom map for ndx2group command"); if (comm->me == 0) { fp = fopen(arg[0], "r"); if (fp == nullptr) @@ -153,11 +155,12 @@ void Ndx2Group::command(int narg, char **arg) MPI_Bcast((void *)name.c_str(),len,MPI_CHAR,0,world); // read tags for atoms in group and broadcast - std::vector tags = read_section(fp,name); + std::vector tags = read_section(fp,next); num = tags.size(); MPI_Bcast(&num,1,MPI_LMP_BIGINT,0,world); MPI_Bcast((void *)tags.data(),num,MPI_LMP_TAGINT,0,world); create(name,tags); + name = next; } } else { MPI_Bcast(&len,1,MPI_INT,0,world); From feb1b9e029a170a7fe4b7f7edb1b95fd1ad5e0aa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 12:55:30 -0400 Subject: [PATCH 100/112] fix whitespace --- src/improper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/improper.h b/src/improper.h index fbe86dfcd1..22a5d09926 100644 --- a/src/improper.h +++ b/src/improper.h @@ -36,11 +36,11 @@ class Improper : protected Pointers { // CENTROID_SAME = same as two-body stress // CENTROID_AVAIL = different and implemented // CENTROID_NOTAVAIL = different, not yet implemented - + int symmatoms[4]; // symmetry atom(s) of improper style // value of 0: interchangable atoms // value of 1: central atom - // values >1: additional atoms of symmetry + // values >1: additional atoms of symmetry // KOKKOS host/device flag and data masks From 4a66389bf1110e5687631121877d867a9e458dd7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 16:29:42 -0400 Subject: [PATCH 101/112] purge build folder from within install.py script --- cmake/CMakeLists.txt | 3 +-- python/install.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5a30cd5aa5..14961209c8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -841,8 +841,7 @@ if(BUILD_SHARED_LIBS) set(LIBLAMMPS_SHARED_BINARY ${MY_BUILD_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}) if(Python_EXECUTABLE) add_custom_target( - install-python ${CMAKE_COMMAND} -E remove_directory build - COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps + install-python ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps -l ${LIBLAMMPS_SHARED_BINARY} -w ${MY_BUILD_DIR} COMMENT "Installing LAMMPS Python module") else() diff --git a/python/install.py b/python/install.py index 591e8525dc..561e93caa9 100644 --- a/python/install.py +++ b/python/install.py @@ -59,6 +59,10 @@ olddir = os.path.abspath('.') os.chdir(os.path.dirname(args.package)) # remove any wheel files left over from previous calls +if os.path.isdir(os.path.join(olddir,"build")): + print("Cleaning old build directory") + shutil.rmtree(os.path.join(olddir,"build")) + print("Purging existing wheels...") for wheel in glob.glob('lammps-*.whl'): print("deleting " + wheel) From d3a23817f14e5b83741332f983df3c792495f894 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 17:25:11 -0400 Subject: [PATCH 102/112] disable purging old wheel files --- python/install.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/install.py b/python/install.py index 561e93caa9..6c27ebd0bd 100644 --- a/python/install.py +++ b/python/install.py @@ -63,10 +63,10 @@ if os.path.isdir(os.path.join(olddir,"build")): print("Cleaning old build directory") shutil.rmtree(os.path.join(olddir,"build")) -print("Purging existing wheels...") -for wheel in glob.glob('lammps-*.whl'): - print("deleting " + wheel) - os.remove(wheel) +#print("Purging existing wheels...") +#for wheel in glob.glob('lammps-*.whl'): +# print("deleting " + wheel) +# os.remove(wheel) # copy shared object to the current folder so that # it will show up in the installation at the expected location From f1539d0ef52f9f0644a8b8258135f5980adeb821 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 17:53:58 -0400 Subject: [PATCH 103/112] silence compiler warnings --- src/GRANULAR/fix_heat_flow.cpp | 16 +++++----------- src/GRANULAR/fix_wall_gran.cpp | 2 +- src/GRANULAR/fix_wall_gran_region.cpp | 2 +- src/GRANULAR/gran_sub_mod_tangential.cpp | 3 +-- src/GRANULAR/pair_granular.cpp | 4 +--- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/GRANULAR/fix_heat_flow.cpp b/src/GRANULAR/fix_heat_flow.cpp index f9ad309f98..a9c110a2e7 100644 --- a/src/GRANULAR/fix_heat_flow.cpp +++ b/src/GRANULAR/fix_heat_flow.cpp @@ -156,7 +156,7 @@ void FixHeatFlow::final_integrate() /* ---------------------------------------------------------------------- */ -void FixHeatFlow::final_integrate_respa(int ilevel, int /*iloop*/) +void FixHeatFlow::final_integrate_respa(int /*ilevel*/, int /*iloop*/) { dt = update->dt; final_integrate(); @@ -215,13 +215,11 @@ void FixHeatFlow::unpack_forward_comm(int n, int first, double *buf) int FixHeatFlow::pack_reverse_comm(int n, int first, double *buf) { - int i,k,last; - int m = 0; - last = first + n; + int last = first + n; double *heatflow = atom->heatflow; - for (i = first; i < last; i++) { + for (int i = first; i < last; i++) { buf[m++] = heatflow[i]; } @@ -232,13 +230,9 @@ int FixHeatFlow::pack_reverse_comm(int n, int first, double *buf) void FixHeatFlow::unpack_reverse_comm(int n, int *list, double *buf) { - int i,j,k,kk,ncount; - int m = 0; double *heatflow = atom->heatflow; - for (i = 0; i < n; i++) { - j = list[i]; - heatflow[j] += buf[m++]; - } + for (int i = 0; i < n; i++) + heatflow[list[i]] += buf[m++]; } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 7029074fe8..8ebe2d5a4c 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -452,7 +452,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; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 57f84e26cb..02cbd94510 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -195,7 +195,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], model->pulloff_distance(radius[i], 0.0)); diff --git a/src/GRANULAR/gran_sub_mod_tangential.cpp b/src/GRANULAR/gran_sub_mod_tangential.cpp index 677ba4d363..ed7704349d 100644 --- a/src/GRANULAR/gran_sub_mod_tangential.cpp +++ b/src/GRANULAR/gran_sub_mod_tangential.cpp @@ -174,9 +174,8 @@ GranSubModTangentialLinearHistoryClassic::GranSubModTangentialLinearHistoryClass void GranSubModTangentialLinearHistoryClassic::calculate_forces() { - double magfs, magfs_inv, rsht, shrmag, prjmag, temp_dbl; + double magfs, magfs_inv, rsht, shrmag; double temp_array[3]; - int frame_update = 0; damp = xt * gm->damping_model->damp_prefactor; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index c4711d6f59..85cee11564 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -685,7 +685,7 @@ void PairGranular::reset_dt() /* ---------------------------------------------------------------------- */ double PairGranular::single(int i, int j, int itype, int jtype, - double rsq, double /* factor_coul */, + double /*rsq*/, double /* factor_coul */, double factor_lj, double &fforce) { if (factor_lj == 0) { @@ -764,8 +764,6 @@ double PairGranular::single(int i, int j, int itype, int jtype, model->calculate_forces(); double *forces = model->forces; - double *torquesi = model->torquesi; - double *torquesj = model->torquesj; // apply forces & torques fforce = MathExtra::len3(forces); From bf944488436c48fc6c7e8d256665bed1cd7f798d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 18:32:54 -0400 Subject: [PATCH 104/112] simplify and avoid segfault without pair style --- src/EXTRA-FIX/fix_efield_tip4p.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/EXTRA-FIX/fix_efield_tip4p.cpp b/src/EXTRA-FIX/fix_efield_tip4p.cpp index a204fe6f7d..3d6a2f66b7 100644 --- a/src/EXTRA-FIX/fix_efield_tip4p.cpp +++ b/src/EXTRA-FIX/fix_efield_tip4p.cpp @@ -46,6 +46,7 @@ void FixEfieldTIP4P::init() if (atom->tag_enable == 0) error->all(FLERR, "Fix efield/tip4p requires atom IDs"); if (!atom->q_flag) error->all(FLERR, "Fix efield/tip4p requires atom attribute q"); + if (!force->pair) error->all(FLERR, "A TIP4P pair style must be defined fix efield/tip4p"); int itmp; double *p_qdist = (double *) force->pair->extract("qdist", itmp); @@ -60,13 +61,12 @@ void FixEfieldTIP4P::init() int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == nullptr || force->bond == nullptr || force->angle->setflag == nullptr || - force->bond->setflag == nullptr) - error->all(FLERR, "Bond and angle potentials must be defined for compute {}", style); + if (!force->angle || !force->bond || !force->angle->setflag || !force->bond->setflag) + error->all(FLERR, "Bond and angle potentials must be defined for fix efield/tip4p"); if ((typeA < 1) || (typeA > atom->nangletypes) || (force->angle->setflag[typeA] == 0)) - error->all(FLERR, "Bad TIP4P angle type for compute {}", style); + error->all(FLERR, "Bad TIP4P angle type for fix efield/tip4p"); if ((typeB < 1) || (typeB > atom->nbondtypes) || (force->bond->setflag[typeB] == 0)) - error->all(FLERR, "Bad TIP4P bond type for PPPM/TIP4P"); + error->all(FLERR, "Bad TIP4P bond type for fix efield/tip4p"); // determine alpha parameter From ea20c934ea5f10d06d09035093c178e14cbb2796 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 18:33:23 -0400 Subject: [PATCH 105/112] print warning when using fix efield with a TIP4P pair style --- src/fix_efield.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp index 3046f21ef3..d1765ed536 100644 --- a/src/fix_efield.cpp +++ b/src/fix_efield.cpp @@ -26,6 +26,7 @@ #include "input.h" #include "memory.h" #include "modify.h" +#include "pair.h" #include "region.h" #include "respa.h" #include "update.h" @@ -145,6 +146,13 @@ void FixEfield::init() if (atom->mu_flag && atom->torque_flag) muflag = 1; if (!qflag && !muflag) error->all(FLERR, "Fix {} requires atom attribute q or mu", style); + // warn if TIP4P pair style is used with plain fix efield + if ((strcmp(style, "efield") == 0) && (comm->me == 0)) { + int itmp; + if (force->pair && force->pair->extract("qdist", itmp)) + error->warning(FLERR, "Fix efield produces incorrect forces when applied to TIP4P atoms"); + } + // check variables if (xstr) { From 08153b7b4dbe4c0b430c89da68ea796f5c1d670c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 21:01:32 -0400 Subject: [PATCH 106/112] trim list of known plumed source packages. --- lib/plumed/Install.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lib/plumed/Install.py b/lib/plumed/Install.py index 21e8ac51ff..9c42da4089 100644 --- a/lib/plumed/Install.py +++ b/lib/plumed/Install.py @@ -37,30 +37,12 @@ make lib-plumed args="-b" # download/build in lib/plumed/plumed2 make lib-plumed args="-p $HOME/plumed2 -m shared" # use existing Plumed2 installation in $HOME/plumed2 """ -# known checksums for different PLUMED versions. used to validate the download. +# known checksums for different PLUMED versions. used to validate downloads. checksums = { \ - '2.4.2' : '88188743a6e03ef076e5377d03ebb0e7', \ - '2.4.3' : 'b1be7c48971627febc11c61b70767fc5', \ '2.4.4' : '71ed465bdc7c2059e282dbda8d564e71', \ - '2.5.0' : '6224cd089493661e19ceacccd35cf911', \ - '2.5.1' : 'c2a7b519e32197a120cdf47e0f194f81', \ - '2.5.2' : 'bd2f18346c788eb54e1e52f4f6acf41a', \ - '2.5.3' : 'de30d6e7c2dcc0973298e24a6da24286', \ - '2.5.4' : 'f31b7d16a4be2e30aa7d5c19c3d37853', \ '2.5.7' : '1ca36226fdb8110b1009aa61d615d4e5', \ - '2.6.0' : '204d2edae58d9b10ba3ad460cad64191', \ - '2.6.1' : '89a9a450fc6025299fe16af235957163', \ - '2.6.3' : 'a9f8028fd74528c2024781ea1fdefeee', \ - '2.6.5' : 'b67356f027e5c2747823b0422c3b0ec2', \ '2.6.6' : '6b470dcdce04c221ea42d8500b03c49b', \ - '2.7.0' : '95f29dd0c067577f11972ff90dfc7d12', \ - '2.7.1' : '4eac6a462ec84dfe0cec96c82421b8e8', \ - '2.7.2' : 'cfa0b4dd90a81c25d3302e8d97bfeaea', \ - '2.7.3' : 'f00cc82edfefe6bb3df934911dbe32fb', \ - '2.7.4' : 'f858e0b6aed173748fc85b6bc8a9dcb3', \ - '2.7.5' : '2aca1986d6c1ca3ba7e9eb51b1102792', \ '2.7.6' : 'fb8c0ec10f97a9353eb123a5c4c35aa6', \ - '2.8.0' : '489b23daba70da78cf0506cbc31689c6', \ '2.8.1' : '6bfe72ebdae63dc38a9ca27d9b0e08f8', \ '2.8.2' : '599092b6a0aa6fff992612537ad98994', \ } From e7b7d5804e46faee3f192806d788eec970013335 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 21:23:02 -0400 Subject: [PATCH 107/112] Update URL for EPEL --- doc/src/Install_linux.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Install_linux.rst b/doc/src/Install_linux.rst index 91e7529879..53f4965e08 100644 --- a/doc/src/Install_linux.rst +++ b/doc/src/Install_linux.rst @@ -172,7 +172,7 @@ Pre-built EPEL Linux executable ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pre-built LAMMPS (and KIM) packages for stable releases are available -in the `Extra Packages for Enterprise Linux (EPEL) repository `_ +in the `Extra Packages for Enterprise Linux (EPEL) repository `_ for use with Red Hat Enterprise Linux (RHEL) or CentOS version 7.x and compatible Linux distributions. Names of packages, executable, and content are the same as described above for Fedora Linux. From c9b383d3f0ca367f02d2996f8b712900066afafb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 22:18:35 -0400 Subject: [PATCH 108/112] grammar --- src/GRANULAR/fix_pour.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 477fc4720b..f92bca5073 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -678,7 +678,7 @@ void FixPour::pre_exchange() int ninserted_atoms = nnear - nprevious; int ninserted_mols = ninserted_atoms / natom; ninserted += ninserted_mols; - if (ninserted_mols < nnew && me == 0) error->warning(FLERR, "Less insertions than requested"); + if (ninserted_mols < nnew && me == 0) error->warning(FLERR, "Fewer insertions than requested"); // reset global natoms,nbonds,etc // increment maxtag_all and maxmol_all if necessary From 073f21c0d9eb653020716d488df5d4f5d86ef281 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 22:35:25 -0400 Subject: [PATCH 109/112] spelling --- doc/src/Modify_gran_sub_mod.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/src/Modify_gran_sub_mod.rst b/doc/src/Modify_gran_sub_mod.rst index fe8b0da275..e1d559e6bf 100644 --- a/doc/src/Modify_gran_sub_mod.rst +++ b/doc/src/Modify_gran_sub_mod.rst @@ -20,16 +20,16 @@ parent GranSubMod class, several types of sub-model classes are derived: * GranSubModTwisting: twisting friction sub-model * GranSubModHeat: heat conduction sub-model -For each type of sub-model, more classes are further derived, each describing -a specific implementation. For instance, from the GranSubModNormal class the +For each type of sub-model, more classes are further derived, each describing a +specific implementation. For instance, from the GranSubModNormal class the GranSubModNormalHooke, GranSubModNormalHertz, and GranSubModNormalJKR classes -are derived which calculate Hookean, Hertzian, or JKR normal forces, respectively. -This modular structure simplifies the addition of new granular contact models as -as one onlyneeds to create a new GranSubMod class without having to modify the more -complex PairGranular, FixGranWall, and GranularModel classes. Most GranSubMod methods -are also already defined by the parent classes so new contact models typically only -require edits to a few relevant methods (e.g. methods that define coefficients and -calculate forces). +are derived which calculate Hookean, Hertzian, or JKR normal forces, +respectively. This modular structure simplifies the addition of new granular +contact models as as one only needs to create a new GranSubMod class without +having to modify the more complex PairGranular, FixGranWall, and GranularModel +classes. Most GranSubMod methods are also already defined by the parent classes +so new contact models typically only require edits to a few relevant methods +(e.g. methods that define coefficients and calculate forces). Each GranSubMod class has a pointer to both the LAMMPS class and the GranularModel class which owns it, ``lmp`` and ``gm``, respectively. The GranularModel class From a232915e716126f317dcd332e9fcc1b8448214bd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 22:37:58 -0400 Subject: [PATCH 110/112] update example logs for changed granular pair style --- .../log.15Sep22.granregion.box.g++.1 | 493 -------------- .../log.15Sep22.granregion.box.g++.4 | 493 -------------- .../log.15Sep22.granregion.funnel.g++.1 | 633 ----------------- .../log.15Sep22.granregion.funnel.g++.4 | 633 ----------------- .../log.15Sep22.granregion.mixer.g++.1 | 632 ----------------- .../log.15Sep22.granregion.mixer.g++.4 | 632 ----------------- .../log.16Mar23.granregion.box.g++.1 | 484 +++++++++++++ .../log.16Mar23.granregion.box.g++.4 | 484 +++++++++++++ .../log.16Mar23.granregion.funnel.g++.1 | 635 ++++++++++++++++++ .../log.16Mar23.granregion.funnel.g++.4 | 635 ++++++++++++++++++ .../log.16Mar23.granregion.mixer.g++.1 | 634 +++++++++++++++++ .../log.16Mar23.granregion.mixer.g++.4 | 634 +++++++++++++++++ examples/pour/log.16Mar23.pour.2d.g++.1 | 125 ++++ examples/pour/log.16Mar23.pour.2d.g++.4 | 125 ++++ .../pour/log.16Mar23.pour.2d.molecule.g++.1 | 148 ++++ .../pour/log.16Mar23.pour.2d.molecule.g++.4 | 148 ++++ examples/pour/log.16Mar23.pour.g++.1 | 178 +++++ examples/pour/log.16Mar23.pour.g++.4 | 178 +++++ examples/pour/log.27Nov18.pour.2d.g++.1 | 121 ---- examples/pour/log.27Nov18.pour.2d.g++.4 | 121 ---- .../pour/log.27Nov18.pour.2d.molecule.g++.1 | 142 ---- .../pour/log.27Nov18.pour.2d.molecule.g++.4 | 142 ---- examples/pour/log.27Nov18.pour.g++.1 | 175 ----- examples/pour/log.27Nov18.pour.g++.4 | 175 ----- 24 files changed, 4408 insertions(+), 4392 deletions(-) delete mode 100644 examples/granregion/log.15Sep22.granregion.box.g++.1 delete mode 100644 examples/granregion/log.15Sep22.granregion.box.g++.4 delete mode 100644 examples/granregion/log.15Sep22.granregion.funnel.g++.1 delete mode 100644 examples/granregion/log.15Sep22.granregion.funnel.g++.4 delete mode 100644 examples/granregion/log.15Sep22.granregion.mixer.g++.1 delete mode 100644 examples/granregion/log.15Sep22.granregion.mixer.g++.4 create mode 100644 examples/granregion/log.16Mar23.granregion.box.g++.1 create mode 100644 examples/granregion/log.16Mar23.granregion.box.g++.4 create mode 100644 examples/granregion/log.16Mar23.granregion.funnel.g++.1 create mode 100644 examples/granregion/log.16Mar23.granregion.funnel.g++.4 create mode 100644 examples/granregion/log.16Mar23.granregion.mixer.g++.1 create mode 100644 examples/granregion/log.16Mar23.granregion.mixer.g++.4 create mode 100644 examples/pour/log.16Mar23.pour.2d.g++.1 create mode 100644 examples/pour/log.16Mar23.pour.2d.g++.4 create mode 100644 examples/pour/log.16Mar23.pour.2d.molecule.g++.1 create mode 100644 examples/pour/log.16Mar23.pour.2d.molecule.g++.4 create mode 100644 examples/pour/log.16Mar23.pour.g++.1 create mode 100644 examples/pour/log.16Mar23.pour.g++.4 delete mode 100644 examples/pour/log.27Nov18.pour.2d.g++.1 delete mode 100644 examples/pour/log.27Nov18.pour.2d.g++.4 delete mode 100644 examples/pour/log.27Nov18.pour.2d.molecule.g++.1 delete mode 100644 examples/pour/log.27Nov18.pour.2d.molecule.g++.4 delete mode 100644 examples/pour/log.27Nov18.pour.g++.1 delete mode 100644 examples/pour/log.27Nov18.pour.g++.4 diff --git a/examples/granregion/log.15Sep22.granregion.box.g++.1 b/examples/granregion/log.15Sep22.granregion.box.g++.1 deleted file mode 100644 index 0df89d49ee..0000000000 --- a/examples/granregion/log.15Sep22.granregion.box.g++.1 +++ /dev/null @@ -1,493 +0,0 @@ -LAMMPS (15 Sep 2022) -# pouring spheres into container box - -units lj -atom_style sphere -boundary f f f -dimension 3 -comm_modify vel yes - -region box block -10 10 -10 10 -10 10 units box -create_box 2 box -Created orthogonal box = (-10 -10 -10) to (10 10 10) - 1 by 1 by 1 MPI processor grid - -pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 -pair_coeff * * gran/hooke - -region container block -6 6 -6 6 -6 6 units box -fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 2 all nve/sphere -fix 3 all gravity 1.0 vector 0 0 -1 - -region slab block -2 2 -2 2 -2 2 units box -fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore -Particle insertion: 48 every 566 steps, 100 by step 1133 - -timestep 0.005 - -compute 1 all temp -compute_modify 1 dynamic/dof yes - -compute 2 all temp/sphere -compute_modify 2 dynamic/dof yes - -thermo 100 -thermo_style custom step atoms temp c_1 c_2 press -thermo_modify lost ignore -compute_modify thermo_temp dynamic/dof yes - -#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 -#dump_modify 2 pad 5 - -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 31 31 31 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke, perpetual - attributes: half, newton on, size - pair build: half/size/bin/newton - stencil: half/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 0.5861 | 0.5861 | 0.5861 Mbytes - Step Atoms Temp c_1 c_2 Press - 0 0 0 0 0 0 -WARNING: Less insertions than requested (../fix_pour.cpp:681) - 100 30 0.803783 0.803783 0.39507978 0.0029137134 - 200 30 1.1967995 1.1967995 0.5882574 0.0043383984 - 300 30 1.2814686 1.2814686 0.62987441 0.0046453238 - 400 30 0.82331082 0.82331082 0.41173176 0.0029845017 - 500 30 0.7708462 0.7708462 0.38777784 0.0043831147 -WARNING: Less insertions than requested (../fix_pour.cpp:681) - 600 64 0.51564897 0.51564897 0.26631577 0.0040059368 - 700 64 0.57239348 0.57239348 0.29566901 0.0045075987 - 800 64 0.61837087 0.61837087 0.32195387 0.0048123564 - 900 64 0.53061888 0.53061888 0.28564763 0.0055906552 - 1000 64 0.496299 0.496299 0.26801572 0.0061169128 - 1100 64 0.46068308 0.46068308 0.24699057 0.0055717699 -WARNING: Less insertions than requested (../fix_pour.cpp:681) - 1200 99 0.39206225 0.39206225 0.21356546 0.0066294211 - 1300 99 0.38624966 0.38624966 0.21345854 0.0049051051 - 1400 99 0.35615284 0.35615284 0.19785725 0.0046170772 - 1500 99 0.31486693 0.31486693 0.17429055 0.0064903432 - 1600 99 0.26369001 0.26369001 0.15095266 0.0045226847 - 1700 100 0.1925923 0.1925923 0.11308104 0.007362313 - 1800 100 0.13724978 0.13724978 0.083276845 0.0058136373 - 1900 100 0.077212636 0.077212636 0.053159386 0.0016509598 - 2000 100 0.065294031 0.065294031 0.04372752 0.0020346467 - 2100 100 0.057431398 0.057431398 0.037977068 0.0012681098 - 2200 100 0.059093045 0.059093045 0.037435193 0.00096610799 - 2300 100 0.03422338 0.03422338 0.025491304 0.00069886052 - 2400 100 0.020558284 0.020558284 0.016163009 0.0017260663 - 2500 100 0.015339709 0.015339709 0.012329236 0.00041308031 - 2600 100 0.012891354 0.012891354 0.009766054 0.00030356722 - 2700 100 0.0092634449 0.0092634449 0.0073580108 0.00077723051 - 2800 100 0.0073925841 0.0073925841 0.0059932218 0.00016466767 - 2900 100 0.0081228267 0.0081228267 0.006281761 0.00013828388 - 3000 100 0.0041833223 0.0041833223 0.0035147096 0.00013160599 - 3100 100 0.0035930775 0.0035930775 0.0030039922 0.00060639771 - 3200 100 0.0030824465 0.0030824465 0.0026541293 0.00047391014 - 3300 100 0.0035087522 0.0035087522 0.0027664508 0.00014080317 - 3400 100 0.0018537868 0.0018537868 0.0017099705 6.3326674e-05 - 3500 100 0.0015371228 0.0015371228 0.0014155433 0.00021612522 - 3600 100 0.001708556 0.001708556 0.0014369892 8.1034202e-05 - 3700 100 0.00095948652 0.00095948652 0.0009788528 3.4694023e-05 - 3800 100 0.00091875668 0.00091875668 0.00086805146 3.9373686e-05 - 3900 100 0.001557068 0.001557068 0.001159526 2.5178607e-05 - 4000 100 0.00062012451 0.00062012451 0.00066806922 5.6680551e-06 - 4100 100 0.00060940771 0.00060940771 0.00065614741 1.0137901e-05 - 4200 100 0.00059538437 0.00059538437 0.00064501521 7.3679744e-06 - 4300 100 0.00052946048 0.00052946048 0.00059353641 5.9225081e-06 - 4400 100 0.00051202281 0.00051202281 0.00057524772 3.6198435e-05 - 4500 100 0.00049986632 0.00049986632 0.00055754521 2.2275519e-05 - 4600 100 0.00048187334 0.00048187334 0.00053988815 2.2015243e-05 - 4700 100 0.00045261491 0.00045261491 0.00050298355 8.9681339e-05 - 4800 100 0.00034965427 0.00034965427 0.0004278781 1.0983535e-05 - 4900 100 0.00033555621 0.00033555621 0.00041435167 2.9266598e-05 - 5000 100 0.00031387148 0.00031387148 0.00039605781 2.5628425e-05 -Loop time of 0.078687 on 1 procs for 5000 steps with 100 atoms - -Performance: 27450544.413 tau/day, 63542.927 timesteps/s, 6.354 Matom-step/s -80.5% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0084151 | 0.0084151 | 0.0084151 | 0.0 | 10.69 -Neigh | 0.012728 | 0.012728 | 0.012728 | 0.0 | 16.18 -Comm | 0.0056143 | 0.0056143 | 0.0056143 | 0.0 | 7.14 -Output | 0.00051411 | 0.00051411 | 0.00051411 | 0.0 | 0.65 -Modify | 0.041412 | 0.041412 | 0.041412 | 0.0 | 52.63 -Other | | 0.01 | | | 12.71 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 164 ave 164 max 164 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 164 -Ave neighs/atom = 1.64 -Neighbor list builds = 281 -Dangerous builds = 0 - -region container delete -variable theta equal (step-5000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 31 31 31 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke, perpetual - attributes: half, newton on, size - pair build: half/size/bin/newton - stencil: half/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes - Step Atoms Temp c_1 c_2 Press - 5000 100 0.00031387148 0.00031387148 0.00039605781 2.6174978e-05 - 5100 100 0.54537023 0.54537023 0.30042175 0.0087427352 - 5200 100 0.57210852 0.57210852 0.3192468 0.0098134067 - 5300 100 0.7168108 0.7168108 0.38577893 0.011004584 - 5400 100 0.78895524 0.78895524 0.41889428 0.013555713 - 5500 100 0.87797874 0.87797874 0.45689223 0.01565356 - 5600 100 0.95424379 0.95424379 0.48830429 0.014707858 - 5700 100 1.0046012 1.0046012 0.51054927 0.01469179 - 5800 100 1.0371453 1.0371453 0.5262568 0.015576788 - 5900 100 1.0545743 1.0545743 0.5361173 0.01589889 - 6000 100 1.0932949 1.0932949 0.55402214 0.017484573 - 6100 100 1.1148364 1.1148364 0.56241126 0.01721788 - 6200 100 1.1315267 1.1315267 0.57050887 0.017961246 - 6300 100 1.1506124 1.1506124 0.58009471 0.017159062 - 6400 100 1.1663328 1.1663328 0.5876586 0.017935311 - 6500 100 1.1821086 1.1821086 0.59595162 0.018005316 - 6600 100 1.2039397 1.2039397 0.60567524 0.021604669 - 6700 100 1.2269911 1.2269911 0.61770224 0.018907995 - 6800 100 1.2447035 1.2447035 0.6257652 0.02053766 - 6900 100 1.2625323 1.2625323 0.63486698 0.020106134 - 7000 100 1.2617127 1.2617127 0.63318163 0.019670429 - 7100 100 1.260715 1.260715 0.63311254 0.019810631 - 7200 100 1.2790404 1.2790404 0.64079001 0.020218903 - 7300 100 1.2760228 1.2760228 0.6395331 0.021749906 - 7400 100 1.2799658 1.2799658 0.64139084 0.020472922 - 7500 100 1.2846473 1.2846473 0.64343085 0.020610025 - 7600 100 1.2883965 1.2883965 0.64491873 0.02074884 - 7700 100 1.2926891 1.2926891 0.64684545 0.020599654 - 7800 100 1.3032201 1.3032201 0.65119455 0.02183405 - 7900 100 1.3025628 1.3025628 0.65068661 0.021248589 - 8000 100 1.3052302 1.3052302 0.65208602 0.021399549 - 8100 100 1.3069867 1.3069867 0.65304849 0.021254794 - 8200 100 1.3092024 1.3092024 0.6543837 0.021220909 - 8300 100 1.3101468 1.3101468 0.65519741 0.021328361 - 8400 100 1.3116005 1.3116005 0.65545253 0.021493555 - 8500 100 1.3153616 1.3153616 0.65731542 0.021433279 - 8600 100 1.3164556 1.3164556 0.65791227 0.021531213 - 8700 100 1.3187245 1.3187245 0.65915974 0.02170181 - 8800 100 1.3215981 1.3215981 0.66036644 0.022358849 - 8900 100 1.3206845 1.3206845 0.65984651 0.021901337 - 9000 100 1.3213046 1.3213046 0.66020378 0.021876353 - 9100 100 1.3225084 1.3225084 0.66088847 0.021811098 - 9200 100 1.3240309 1.3240309 0.66180646 0.021768929 - 9300 100 1.325458 1.325458 0.66280401 0.02165852 - 9400 100 1.3322968 1.3322968 0.66615126 0.022139018 - 9500 100 1.3416035 1.3416035 0.67030794 0.022243129 - 9600 100 1.3353326 1.3353326 0.66692811 0.022622122 - 9700 100 1.336265 1.336265 0.66727395 0.022171165 - 9800 100 1.3344531 1.3344531 0.66634538 0.022025131 - 9900 100 1.3337098 1.3337098 0.66601721 0.022111706 - 10000 100 1.3335539 1.3335539 0.66597627 0.022133817 -Loop time of 0.235008 on 1 procs for 5000 steps with 100 atoms - -Performance: 9191156.994 tau/day, 21275.826 timesteps/s, 2.128 Matom-step/s -94.1% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.029846 | 0.029846 | 0.029846 | 0.0 | 12.70 -Neigh | 0.030211 | 0.030211 | 0.030211 | 0.0 | 12.86 -Comm | 0.005731 | 0.005731 | 0.005731 | 0.0 | 2.44 -Output | 0.00051873 | 0.00051873 | 0.00051873 | 0.0 | 0.22 -Modify | 0.1583 | 0.1583 | 0.1583 | 0.0 | 67.36 -Other | | 0.01041 | | | 4.43 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 186 ave 186 max 186 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 186 -Ave neighs/atom = 1.86 -Neighbor list builds = 626 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes - Step Atoms Temp c_1 c_2 Press - 10000 100 1.3335539 1.3335539 0.66597627 0.022207076 - 10100 100 0.29976134 0.29976134 0.1752962 0.0091355801 - 10200 100 0.1548002 0.1548002 0.1005356 0.0062509071 - 10300 100 0.082468613 0.082468613 0.066729575 0.0017315098 - 10400 100 0.06731284 0.06731284 0.056685383 0.0011965765 - 10500 100 0.050167538 0.050167538 0.042388389 0.0010830279 - 10600 100 0.041091371 0.041091371 0.034743534 0.00092984522 - 10700 100 0.033199041 0.033199041 0.027954031 0.0018451338 - 10800 100 0.027880411 0.027880411 0.024437224 0.0013039536 - 10900 100 0.024634597 0.024634597 0.021815184 0.00030935286 - 11000 100 0.020741105 0.020741105 0.018754221 0.0006306901 - 11100 100 0.017210914 0.017210914 0.015842306 0.00075930229 - 11200 100 0.01254319 0.01254319 0.012145795 0.00047388541 - 11300 100 0.010032468 0.010032468 0.0095918697 0.0014677116 - 11400 100 0.0081538458 0.0081538458 0.0080985914 0.00032485316 - 11500 100 0.0072918155 0.0072918155 0.0070156789 0.00023642827 - 11600 100 0.0070136586 0.0070136586 0.0067263114 7.8490444e-05 - 11700 100 0.0061722946 0.0061722946 0.0058832419 0.00013450793 - 11800 100 0.0052444487 0.0052444487 0.0049294304 8.6973121e-05 - 11900 100 0.0048212279 0.0048212279 0.0045261412 0.00010458031 - 12000 100 0.0046782797 0.0046782797 0.0044011937 0.00018881094 - 12100 100 0.0042066617 0.0042066617 0.0040330976 0.00015507521 - 12200 100 0.0038529032 0.0038529032 0.003664712 1.1476621e-05 - 12300 100 0.0033203238 0.0033203238 0.0032404054 0.00027622191 - 12400 100 0.003113731 0.003113731 0.0030491123 3.8532421e-05 - 12500 100 0.0029925149 0.0029925149 0.0029415075 4.2673261e-05 - 12600 100 0.0028383323 0.0028383323 0.0027902992 9.328552e-05 - 12700 100 0.0026386104 0.0026386104 0.0026095714 7.7740986e-05 - 12800 100 0.0023509873 0.0023509873 0.0023518594 3.1944764e-05 - 12900 100 0.0022296104 0.0022296104 0.0022030693 4.5393502e-05 - 13000 100 0.0021991358 0.0021991358 0.0021560478 0.0001221212 - 13100 100 0.0021011001 0.0021011001 0.0020752855 2.4605107e-05 - 13200 100 0.002004495 0.002004495 0.0020040212 2.4805625e-05 - 13300 100 0.0018394135 0.0018394135 0.0018288384 6.2227066e-05 - 13400 100 0.0016314086 0.0016314086 0.0016058102 0.00010372886 - 13500 100 0.0015042857 0.0015042857 0.0014660263 0.00020805178 - 13600 100 0.0013584764 0.0013584764 0.0013177418 5.1603333e-05 - 13700 100 0.0012407449 0.0012407449 0.0011902637 8.87401e-05 - 13800 100 0.0011673364 0.0011673364 0.0011324247 2.3668551e-05 - 13900 100 0.0011429204 0.0011429204 0.0011072347 1.414364e-05 - 14000 100 0.001087543 0.001087543 0.0010616439 3.0874865e-05 - 14100 100 0.00098839393 0.00098839393 0.00096445684 6.5331515e-05 - 14200 100 0.00095139076 0.00095139076 0.00093658993 2.5649208e-05 - 14300 100 0.00089532494 0.00089532494 0.00082626435 2.6200482e-05 - 14400 100 0.00077973015 0.00077973015 0.00070733785 2.29298e-05 - 14500 100 0.00068559117 0.00068559117 0.00062297009 8.4841907e-06 - 14600 100 0.00059199698 0.00059199698 0.00052453148 1.2737231e-05 - 14700 100 0.00055052378 0.00055052378 0.00048459372 1.3028328e-05 - 14800 100 0.00049397913 0.00049397913 0.00044094284 6.1129918e-06 - 14900 100 0.00048082746 0.00048082746 0.00043128724 3.7301936e-06 - 15000 100 0.00046847825 0.00046847825 0.00041484245 5.7974184e-06 -Loop time of 0.0802044 on 1 procs for 5000 steps with 100 atoms - -Performance: 26931180.398 tau/day, 62340.695 timesteps/s, 6.234 Matom-step/s -82.1% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0080809 | 0.0080809 | 0.0080809 | 0.0 | 10.08 -Neigh | 0.0048815 | 0.0048815 | 0.0048815 | 0.0 | 6.09 -Comm | 0.0055605 | 0.0055605 | 0.0055605 | 0.0 | 6.93 -Output | 0.00050386 | 0.00050386 | 0.00050386 | 0.0 | 0.63 -Modify | 0.051104 | 0.051104 | 0.051104 | 0.0 | 63.72 -Other | | 0.01007 | | | 12.56 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 157 ave 157 max 157 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 157 -Ave neighs/atom = 1.57 -Neighbor list builds = 100 -Dangerous builds = 0 - -region container delete -variable theta equal (step-15000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes - Step Atoms Temp c_1 c_2 Press - 15000 100 0.00046847825 0.00046847825 0.00041484245 5.7974184e-06 - 15100 100 0.96677694 0.96677694 0.64420785 0.01431184 - 15200 100 1.0659255 1.0659255 0.69293741 0.013240486 - 15300 100 1.1647631 1.1647631 0.75191941 0.014622673 - 15400 100 1.3411593 1.3411593 0.85696383 0.02561549 - 15500 100 1.6033758 1.6033758 0.99094919 0.026221789 - 15600 100 1.7889645 1.7889645 1.075315 0.024116301 - 15700 100 1.8077023 1.8077023 1.0842652 0.031781756 - 15800 100 2.0252655 2.0252655 1.1517407 0.037201818 - 15900 100 2.1479427 2.1479427 1.2061238 0.027668435 - 16000 100 2.1788838 2.1788838 1.2205599 0.029114273 - 16100 100 2.3257431 2.3257431 1.2921157 0.035663063 - 16200 100 2.3885449 2.3885449 1.3282237 0.032255517 - 16300 100 2.3670966 2.3670966 1.3091694 0.029579008 - 16400 100 2.5097781 2.5097781 1.3712036 0.034579196 - 16500 100 2.6440883 2.6440883 1.4440043 0.03347813 - 16600 100 2.7230084 2.7230084 1.481565 0.036660339 - 16700 100 2.8246108 2.8246108 1.5298387 0.035623641 - 16800 100 3.0338694 3.0338694 1.6333504 0.038818594 - 16900 100 3.1219584 3.1219584 1.6790766 0.043444123 - 17000 100 3.4103817 3.4103817 1.8222668 0.044524654 - 17100 100 3.3869069 3.3869069 1.8170743 0.050670801 - 17200 100 3.4220314 3.4220314 1.8312364 0.045956123 - 17300 100 3.396894 3.396894 1.8158291 0.050420297 - 17400 100 3.4508224 3.4508224 1.8429996 0.049923733 - 17500 100 3.5039601 3.5039601 1.8822352 0.051047713 - 17600 100 3.3743905 3.3743905 1.8380347 0.047922214 - 17700 100 3.3729709 3.3729709 1.8224123 0.04758126 - 17800 100 3.3237798 3.3237798 1.7962316 0.045427975 - 17900 100 3.2441052 3.2441052 1.7782748 0.044651231 - 18000 100 3.1169205 3.1169205 1.704639 0.047440495 - 18100 100 3.1704608 3.1704608 1.7326375 0.045656546 - 18200 100 3.1113438 3.1113438 1.7002232 0.041619255 - 18300 100 3.2506111 3.2506111 1.7693075 0.048028527 - 18400 100 3.3840681 3.3840681 1.8370672 0.04443243 - 18500 100 3.4822823 3.4822823 1.9125273 0.043687118 - 18600 100 3.5214372 3.5214372 1.9364829 0.049798605 - 18700 100 3.5439229 3.5439229 1.9441301 0.046240266 - 18800 100 3.6046761 3.6046761 1.9791448 0.054369382 - 18900 100 3.8598403 3.8598403 2.0999449 0.049863074 - 19000 100 3.8606461 3.8606461 2.0885493 0.050269245 - 19100 100 4.076627 4.076627 2.2025766 0.058050893 - 19200 100 3.8280814 3.8280814 2.0749884 0.05730905 - 19300 100 3.8211633 3.8211633 2.0759453 0.05145071 - 19400 100 3.7726284 3.7726284 2.0466555 0.053566404 - 19500 100 3.7468403 3.7468403 2.03218 0.048422025 - 19600 100 3.6408955 3.6408955 1.9873843 0.046565134 - 19700 100 3.6454187 3.6454187 2.0042204 0.049299897 - 19800 100 3.5165071 3.5165071 1.937379 0.046319859 - 19900 100 3.4670702 3.4670702 1.9140316 0.045650114 - 20000 100 3.6114294 3.6114294 1.9798674 0.05431148 -Loop time of 0.203164 on 1 procs for 5000 steps with 100 atoms - -Performance: 10631806.993 tau/day, 24610.664 timesteps/s, 2.461 Matom-step/s -92.3% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.01242 | 0.01242 | 0.01242 | 0.0 | 6.11 -Neigh | 0.044478 | 0.044478 | 0.044478 | 0.0 | 21.89 -Comm | 0.0057766 | 0.0057766 | 0.0057766 | 0.0 | 2.84 -Output | 0.00051702 | 0.00051702 | 0.00051702 | 0.0 | 0.25 -Modify | 0.12923 | 0.12923 | 0.12923 | 0.0 | 63.61 -Other | | 0.01074 | | | 5.29 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 142 ave 142 max 142 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 142 -Ave neighs/atom = 1.42 -Neighbor list builds = 909 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes - Step Atoms Temp c_1 c_2 Press - 20000 100 3.6114294 3.6114294 1.9798674 0.053887263 - 20100 100 1.0907336 1.0907336 0.69799767 0.013925984 - 20200 100 0.92304387 0.92304387 0.59520318 0.012377709 - 20300 100 0.84004201 0.84004201 0.55081472 0.012108246 - 20400 100 0.89491209 0.89491209 0.56269969 0.01221427 - 20500 100 0.92011482 0.92011482 0.56971815 0.011353588 - 20600 100 0.95722998 0.95722998 0.58038747 0.01185569 - 20700 100 0.92635786 0.92635786 0.55373959 0.011953734 - 20800 100 0.93088162 0.93088162 0.55094813 0.012887472 - 20900 100 0.97288373 0.97288373 0.56309599 0.013731021 - 21000 100 0.63378762 0.63378762 0.3779177 0.010114787 - 21100 100 0.34618473 0.34618473 0.21652381 0.0070717708 - 21200 100 0.18660008 0.18660008 0.1302051 0.006504227 - 21300 100 0.13917709 0.13917709 0.09667499 0.0032593765 - 21400 100 0.11627047 0.11627047 0.080272858 0.0028891045 - 21500 100 0.086269781 0.086269781 0.064184981 0.0019374959 - 21600 100 0.08052393 0.08052393 0.059561101 0.001214522 - 21700 100 0.036026032 0.036026032 0.030243348 0.001199233 - 21800 100 0.02392645 0.02392645 0.022284244 0.00060060634 - 21900 100 0.016991266 0.016991266 0.017366625 0.00065672411 - 22000 100 0.016974877 0.016974877 0.016399245 0.0005903103 - 22100 100 0.015491818 0.015491818 0.014806105 0.00051181051 - 22200 100 0.011908698 0.011908698 0.011206673 0.00099478656 - 22300 100 0.010002714 0.010002714 0.0093749794 0.00028214624 - 22400 100 0.0081652616 0.0081652616 0.0079594664 0.00026841276 - 22500 100 0.0067602843 0.0067602843 0.0067498831 0.00019472612 - 22600 100 0.0061024058 0.0061024058 0.0062958451 0.00016615781 - 22700 100 0.005331422 0.005331422 0.0056152366 0.00021543475 - 22800 100 0.0040796708 0.0040796708 0.004140932 0.00024397062 - 22900 100 0.0042042089 0.0042042089 0.0040406804 0.00015880055 - 23000 100 0.0056083872 0.0056083872 0.0046056699 0.00029203396 - 23100 100 0.0035006398 0.0035006398 0.003343101 0.00010571574 - 23200 100 0.0032402473 0.0032402473 0.003122476 0.00012784403 - 23300 100 0.0030100724 0.0030100724 0.0029649423 8.5613724e-05 - 23400 100 0.002746305 0.002746305 0.0027519317 9.6521844e-05 - 23500 100 0.0028543876 0.0028543876 0.002842845 0.00012566665 - 23600 100 0.0036979234 0.0036979234 0.0032448309 8.6321879e-05 - 23700 100 0.0030503565 0.0030503565 0.0027392305 5.9716835e-05 - 23800 100 0.0021564041 0.0021564041 0.0022097768 0.00028317769 - 23900 100 0.0018905956 0.0018905956 0.0020002233 4.5205733e-05 - 24000 100 0.0015705513 0.0015705513 0.0017262538 0.00026550225 - 24100 100 0.0013341334 0.0013341334 0.0015663921 4.8307183e-05 - 24200 100 0.0012426828 0.0012426828 0.0014960127 5.5195907e-05 - 24300 100 0.0011933799 0.0011933799 0.0014508697 5.2781568e-05 - 24400 100 0.0010126015 0.0010126015 0.0012821281 0.00011096457 - 24500 100 0.00094102576 0.00094102576 0.0012265703 3.3454252e-05 - 24600 100 0.00092243997 0.00092243997 0.0011970533 3.7288789e-05 - 24700 100 0.00080565605 0.00080565605 0.0010864406 0.00015797228 - 24800 100 0.00075303124 0.00075303124 0.0010103671 5.4727635e-05 - 24900 100 0.00074808599 0.00074808599 0.0010053951 8.6607732e-05 - 25000 100 0.00071720457 0.00071720457 0.00096622937 0.00015861964 -Loop time of 0.0845534 on 1 procs for 5000 steps with 100 atoms - -Performance: 25545994.179 tau/day, 59134.246 timesteps/s, 5.913 Matom-step/s -90.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0091411 | 0.0091411 | 0.0091411 | 0.0 | 10.81 -Neigh | 0.013557 | 0.013557 | 0.013557 | 0.0 | 16.03 -Comm | 0.0056205 | 0.0056205 | 0.0056205 | 0.0 | 6.65 -Output | 0.0005087 | 0.0005087 | 0.0005087 | 0.0 | 0.60 -Modify | 0.045578 | 0.045578 | 0.045578 | 0.0 | 53.90 -Other | | 0.01015 | | | 12.00 - -Nlocal: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 151 ave 151 max 151 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 151 -Ave neighs/atom = 1.51 -Neighbor list builds = 286 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/granregion/log.15Sep22.granregion.box.g++.4 b/examples/granregion/log.15Sep22.granregion.box.g++.4 deleted file mode 100644 index 3e83d3bb04..0000000000 --- a/examples/granregion/log.15Sep22.granregion.box.g++.4 +++ /dev/null @@ -1,493 +0,0 @@ -LAMMPS (15 Sep 2022) -# pouring spheres into container box - -units lj -atom_style sphere -boundary f f f -dimension 3 -comm_modify vel yes - -region box block -10 10 -10 10 -10 10 units box -create_box 2 box -Created orthogonal box = (-10 -10 -10) to (10 10 10) - 1 by 2 by 2 MPI processor grid - -pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 -pair_coeff * * gran/hooke - -region container block -6 6 -6 6 -6 6 units box -fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 2 all nve/sphere -fix 3 all gravity 1.0 vector 0 0 -1 - -region slab block -2 2 -2 2 -2 2 units box -fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore -Particle insertion: 48 every 566 steps, 100 by step 1133 - -timestep 0.005 - -compute 1 all temp -compute_modify 1 dynamic/dof yes - -compute 2 all temp/sphere -compute_modify 2 dynamic/dof yes - -thermo 100 -thermo_style custom step atoms temp c_1 c_2 press -thermo_modify lost ignore -compute_modify thermo_temp dynamic/dof yes - -#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 -#dump_modify 2 pad 5 - -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 31 31 31 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke, perpetual - attributes: half, newton on, size - pair build: half/size/bin/newton - stencil: half/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 0.4843 | 0.4843 | 0.4843 Mbytes - Step Atoms Temp c_1 c_2 Press - 0 0 0 0 0 0 -WARNING: Less insertions than requested (../fix_pour.cpp:681) - 100 30 0.803783 0.803783 0.39507978 0.0029137134 - 200 30 1.1967995 1.1967995 0.5882574 0.0043383984 - 300 30 1.2814686 1.2814686 0.62987441 0.0046453238 - 400 30 0.82331082 0.82331082 0.41173176 0.0029845017 - 500 30 0.7708462 0.7708462 0.38777784 0.0043831147 -WARNING: Less insertions than requested (../fix_pour.cpp:681) - 600 64 0.51564897 0.51564897 0.26631577 0.0040059368 - 700 64 0.57239348 0.57239348 0.29566901 0.0045075987 - 800 64 0.61837087 0.61837087 0.32195387 0.0048123564 - 900 64 0.53061888 0.53061888 0.28564763 0.0055906552 - 1000 64 0.496299 0.496299 0.26801572 0.0061169128 - 1100 64 0.46068308 0.46068308 0.24699057 0.0055717699 -WARNING: Less insertions than requested (../fix_pour.cpp:681) - 1200 99 0.39206225 0.39206225 0.21356546 0.0066294211 - 1300 99 0.38624966 0.38624966 0.21345854 0.0049051051 - 1400 99 0.35615284 0.35615284 0.19785725 0.0046170774 - 1500 99 0.31486691 0.31486691 0.17429054 0.0064903404 - 1600 99 0.26369 0.26369 0.15095263 0.0045226821 - 1700 100 0.19259352 0.19259352 0.11308184 0.0073603886 - 1800 100 0.1372448 0.1372448 0.083273652 0.0058163062 - 1900 100 0.077253038 0.077253038 0.053166156 0.0017440856 - 2000 100 0.065472093 0.065472093 0.04375349 0.0018416047 - 2100 100 0.057213469 0.057213469 0.037773954 0.001226231 - 2200 100 0.058857437 0.058857437 0.0372655 0.00090812381 - 2300 100 0.035066108 0.035066108 0.025934054 0.00072114554 - 2400 100 0.021272125 0.021272125 0.016635107 0.0018506654 - 2500 100 0.015530432 0.015530432 0.012533546 0.0013883971 - 2600 100 0.012603946 0.012603946 0.0096981459 0.00038648118 - 2700 100 0.0097347475 0.0097347475 0.0076016624 0.00057313888 - 2800 100 0.0067081771 0.0067081771 0.0056944431 0.00085080075 - 2900 100 0.0089177981 0.0089177981 0.0065036822 0.00028986539 - 3000 100 0.0057840287 0.0057840287 0.0044989265 0.00016111737 - 3100 100 0.0038909621 0.0038909621 0.0031511938 0.0001708892 - 3200 100 0.0029043214 0.0029043214 0.0025807767 9.2473673e-05 - 3300 100 0.0022769336 0.0022769336 0.0021487157 0.00022312666 - 3400 100 0.0015571397 0.0015571397 0.0016669068 0.0003381372 - 3500 100 0.0015978184 0.0015978184 0.001707772 4.9930818e-05 - 3600 100 0.0023358916 0.0023358916 0.0020709426 9.7687609e-05 - 3700 100 0.0011186736 0.0011186736 0.0012146914 9.3338234e-05 - 3800 100 0.0011657036 0.0011657036 0.0012313764 3.1931251e-05 - 3900 100 0.0014998387 0.0014998387 0.0014015491 2.4226798e-05 - 4000 100 0.0010858335 0.0010858335 0.0010623286 1.6359241e-05 - 4100 100 0.0010464314 0.0010464314 0.0010123557 1.2949588e-05 - 4200 100 0.0010022428 0.0010022428 0.00097338971 1.2402332e-05 - 4300 100 0.00080622372 0.00080622372 0.00084329652 0.00033857037 - 4400 100 0.00073613921 0.00073613921 0.00078373608 1.0103949e-05 - 4500 100 0.00071402196 0.00071402196 0.00076658004 8.8360218e-06 - 4600 100 0.00064851765 0.00064851765 0.00071533461 1.0736438e-05 - 4700 100 0.00061146699 0.00061146699 0.00068274687 4.1341755e-06 - 4800 100 0.00059511472 0.00059511472 0.0006625527 7.3645447e-06 - 4900 100 0.00057700347 0.00057700347 0.0006468562 1.5411897e-05 - 5000 100 0.00056205001 0.00056205001 0.00063592505 7.8813845e-06 -Loop time of 0.0856033 on 4 procs for 5000 steps with 100 atoms - -Performance: 25232672.400 tau/day, 58408.964 timesteps/s, 5.841 Matom-step/s -88.4% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0034695 | 0.0050634 | 0.0068805 | 2.2 | 5.91 -Neigh | 0.0016916 | 0.0024175 | 0.0032212 | 1.5 | 2.82 -Comm | 0.020003 | 0.026482 | 0.033796 | 3.5 | 30.94 -Output | 0.0010864 | 0.001327 | 0.0014374 | 0.4 | 1.55 -Modify | 0.0067352 | 0.015857 | 0.025751 | 7.2 | 18.52 -Other | | 0.03446 | | | 40.25 - -Nlocal: 25 ave 53 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Nghost: 4 ave 8 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 40.5 ave 92 max 0 min -Histogram: 2 0 0 0 0 0 0 1 0 1 - -Total # of neighbors = 162 -Ave neighs/atom = 1.62 -Neighbor list builds = 288 -Dangerous builds = 0 - -region container delete -variable theta equal (step-5000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 31 31 31 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke, perpetual - attributes: half, newton on, size - pair build: half/size/bin/newton - stencil: half/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.734 Mbytes - Step Atoms Temp c_1 c_2 Press - 5000 100 0.00056205001 0.00056205001 0.00063592505 7.871665e-06 - 5100 100 0.59585977 0.59585977 0.32464933 0.0141718 - 5200 100 0.67306764 0.67306764 0.35872096 0.013373672 - 5300 100 0.76065187 0.76065187 0.39925025 0.011460301 - 5400 100 0.87984446 0.87984446 0.45261417 0.013937042 - 5500 100 0.95548319 0.95548319 0.48706892 0.013601658 - 5600 100 0.9993278 0.9993278 0.50830306 0.015663766 - 5700 100 1.0449415 1.0449415 0.52967249 0.016797841 - 5800 100 1.0767598 1.0767598 0.54508699 0.016128855 - 5900 100 1.118688 1.118688 0.56530849 0.016830117 - 6000 100 1.1535698 1.1535698 0.58290663 0.01715335 - 6100 100 1.1753828 1.1753828 0.59419088 0.019273207 - 6200 100 1.1994171 1.1994171 0.60433264 0.018391566 - 6300 100 1.2244707 1.2244707 0.61626199 0.018842556 - 6400 100 1.2507994 1.2507994 0.62829386 0.019538413 - 6500 100 1.2684644 1.2684644 0.63747702 0.020794729 - 6600 100 1.2704726 1.2704726 0.63929889 0.020253985 - 6700 100 1.2737302 1.2737302 0.63970688 0.020858602 - 6800 100 1.287922 1.287922 0.64460894 0.021589773 - 6900 100 1.3028782 1.3028782 0.65197802 0.02135295 - 7000 100 1.306633 1.306633 0.65371741 0.021291182 - 7100 100 1.3161393 1.3161393 0.65785404 0.022554896 - 7200 100 1.3228158 1.3228158 0.6609031 0.021811977 - 7300 100 1.3245632 1.3245632 0.66161966 0.02206776 - 7400 100 1.3266822 1.3266822 0.662738 0.022070761 - 7500 100 1.3265138 1.3265138 0.6624472 0.021944768 - 7600 100 1.3286802 1.3286802 0.66338775 0.0219393 - 7700 100 1.332829 1.332829 0.66547051 0.022142398 - 7800 100 1.3323535 1.3323535 0.66534513 0.022787777 - 7900 100 1.3372424 1.3372424 0.66777556 0.02192759 - 8000 100 1.3396201 1.3396201 0.66910123 0.022439596 - 8100 100 1.3422271 1.3422271 0.67060566 0.023784952 - 8200 100 1.3468062 1.3468062 0.6728991 0.02243345 - 8300 100 1.3439408 1.3439408 0.6717529 0.022312339 - 8400 100 1.3484134 1.3484134 0.67346027 0.022770922 - 8500 100 1.3490032 1.3490032 0.67378177 0.022427863 - 8600 100 1.349789 1.349789 0.67398897 0.022494049 - 8700 100 1.3513512 1.3513512 0.67475613 0.022413559 - 8800 100 1.3535168 1.3535168 0.67589784 0.022356566 - 8900 100 1.3505765 1.3505765 0.67442168 0.022240615 - 9000 100 1.3499918 1.3499918 0.67419831 0.02226049 - 9100 100 1.3518103 1.3518103 0.67489482 0.022399038 - 9200 100 1.3526275 1.3526275 0.67529852 0.022395079 - 9300 100 1.353741 1.353741 0.67585205 0.022471008 - 9400 100 1.3538758 1.3538758 0.67589523 0.022461734 - 9500 100 1.3537199 1.3537199 0.67586527 0.022370169 - 9600 100 1.3539788 1.3539788 0.67602899 0.022400771 - 9700 100 1.3544874 1.3544874 0.67619552 0.022648464 - 9800 100 1.3555422 1.3555422 0.67666186 0.022367319 - 9900 100 1.3560106 1.3560106 0.6768751 0.02236585 - 10000 100 1.3563578 1.3563578 0.6770434 0.022359307 -Loop time of 0.139615 on 4 procs for 5000 steps with 100 atoms - -Performance: 15471121.710 tau/day, 35812.782 timesteps/s, 3.581 Matom-step/s -89.9% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0034672 | 0.011349 | 0.019511 | 7.2 | 8.13 -Neigh | 0.0032972 | 0.0053674 | 0.0074946 | 2.8 | 3.84 -Comm | 0.011049 | 0.018572 | 0.027876 | 5.6 | 13.30 -Output | 0.0010807 | 0.0015593 | 0.0018738 | 0.8 | 1.12 -Modify | 0.013556 | 0.040435 | 0.066715 | 13.0 | 28.96 -Other | | 0.06233 | | | 44.65 - -Nlocal: 25 ave 52 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 3 ave 6 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 48.25 ave 109 max 0 min -Histogram: 2 0 0 0 0 0 0 1 0 1 - -Total # of neighbors = 193 -Ave neighs/atom = 1.93 -Neighbor list builds = 626 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.735 Mbytes - Step Atoms Temp c_1 c_2 Press - 10000 100 1.3563578 1.3563578 0.6770434 0.022433108 - 10100 100 0.32881547 0.32881547 0.18968913 0.0063460187 - 10200 100 0.19880113 0.19880113 0.12812646 0.0074601538 - 10300 100 0.12614062 0.12614062 0.090121373 0.0028337336 - 10400 100 0.088358363 0.088358363 0.067236815 0.0020269846 - 10500 100 0.071199344 0.071199344 0.055567135 0.0016191769 - 10600 100 0.053909616 0.053909616 0.042301996 0.00098643468 - 10700 100 0.039560745 0.039560745 0.032482256 0.00089240864 - 10800 100 0.032130432 0.032130432 0.02705329 0.00058669881 - 10900 100 0.02462494 0.02462494 0.021121496 0.0017376127 - 11000 100 0.020941068 0.020941068 0.017866781 0.00031112553 - 11100 100 0.016775675 0.016775675 0.014620214 0.00026856842 - 11200 100 0.015005732 0.015005732 0.012803923 0.00067036626 - 11300 100 0.012099209 0.012099209 0.010308221 0.00032666902 - 11400 100 0.010559421 0.010559421 0.0090243729 0.00013645685 - 11500 100 0.0093738615 0.0093738615 0.0080176514 0.00098541099 - 11600 100 0.0081900702 0.0081900702 0.0070256953 0.00025935992 - 11700 100 0.0068100165 0.0068100165 0.0058703223 0.00014866816 - 11800 100 0.0060475708 0.0060475708 0.0052518105 0.00017895168 - 11900 100 0.0055607485 0.0055607485 0.0047184164 0.00011358846 - 12000 100 0.0053149064 0.0053149064 0.0045168418 0.00015222428 - 12100 100 0.0050909525 0.0050909525 0.0043196952 6.3000537e-05 - 12200 100 0.0041810842 0.0041810842 0.0036835522 4.6423956e-05 - 12300 100 0.0034305227 0.0034305227 0.0031222649 0.00020251115 - 12400 100 0.0031763077 0.0031763077 0.0028956456 0.00030307787 - 12500 100 0.0027440829 0.0027440829 0.0025087304 0.00010418607 - 12600 100 0.0024581964 0.0024581964 0.0022200229 3.042018e-05 - 12700 100 0.002259527 0.002259527 0.0020708869 4.192368e-05 - 12800 100 0.0019143448 0.0019143448 0.0018088032 4.6200439e-05 - 12900 100 0.0017935964 0.0017935964 0.0017028317 2.2195756e-05 - 13000 100 0.0017286429 0.0017286429 0.0016396753 2.3108871e-05 - 13100 100 0.0017055291 0.0017055291 0.0016122058 2.2444611e-05 - 13200 100 0.0016539275 0.0016539275 0.0015570166 2.0467353e-05 - 13300 100 0.0015777788 0.0015777788 0.0014852505 1.9525012e-05 - 13400 100 0.0015372199 0.0015372199 0.0014497102 2.3203566e-05 - 13500 100 0.0015066638 0.0015066638 0.0014097203 1.8644964e-05 - 13600 100 0.0012290618 0.0012290618 0.0012056216 1.3235643e-05 - 13700 100 0.0011781948 0.0011781948 0.0011685226 3.4312262e-05 - 13800 100 0.0011530136 0.0011530136 0.0011433171 2.8832126e-05 - 13900 100 0.0011085224 0.0011085224 0.0011052764 1.444139e-05 - 14000 100 0.0010656788 0.0010656788 0.0010702461 1.3187775e-05 - 14100 100 0.001029277 0.001029277 0.0010469537 1.2837267e-05 - 14200 100 0.0009750904 0.0009750904 0.0009915384 1.209089e-05 - 14300 100 0.00094893337 0.00094893337 0.00096909301 1.1743051e-05 - 14400 100 0.00087708427 0.00087708427 0.00087575318 1.9027338e-05 - 14500 100 0.00086229913 0.00086229913 0.0008643568 1.0670952e-05 - 14600 100 0.00084206808 0.00084206808 0.0008268172 3.2391722e-05 - 14700 100 0.00077682873 0.00077682873 0.00077186085 9.6132555e-06 - 14800 100 0.00074736908 0.00074736908 0.00074958372 9.2486924e-06 - 14900 100 0.00074456847 0.00074456847 0.00074779946 9.2140349e-06 - 15000 100 0.00073830282 0.00073830282 0.0007426924 9.1364974e-06 -Loop time of 0.0808149 on 4 procs for 5000 steps with 100 atoms - -Performance: 26727738.394 tau/day, 61869.765 timesteps/s, 6.187 Matom-step/s -86.6% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0034354 | 0.0050332 | 0.0069329 | 2.2 | 6.23 -Neigh | 0.00051999 | 0.00084906 | 0.0012075 | 0.0 | 1.05 -Comm | 0.0063631 | 0.014527 | 0.023754 | 6.8 | 17.98 -Output | 0.0010373 | 0.001342 | 0.001464 | 0.5 | 1.66 -Modify | 0.0051837 | 0.017338 | 0.031605 | 9.3 | 21.45 -Other | | 0.04173 | | | 51.63 - -Nlocal: 25 ave 53 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Nghost: 3.75 ave 8 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Neighs: 39.25 ave 82 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 2 - -Total # of neighbors = 157 -Ave neighs/atom = 1.57 -Neighbor list builds = 100 -Dangerous builds = 0 - -region container delete -variable theta equal (step-15000)*(4.0*PI/5000) -region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.735 Mbytes - Step Atoms Temp c_1 c_2 Press - 15000 100 0.00073830282 0.00073830282 0.0007426924 9.1364974e-06 - 15100 100 1.1048281 1.1048281 0.7023727 0.018379275 - 15200 100 1.2022249 1.2022249 0.77748962 0.015662439 - 15300 100 1.2561351 1.2561351 0.82563065 0.01835048 - 15400 100 1.4372446 1.4372446 0.92907923 0.02087065 - 15500 100 1.6414713 1.6414713 1.0284489 0.025654324 - 15600 100 1.7844655 1.7844655 1.0861866 0.025170346 - 15700 100 2.034248 2.034248 1.2017171 0.040341642 - 15800 100 2.1253699 2.1253699 1.2228657 0.029297194 - 15900 100 2.1940232 2.1940232 1.2470589 0.033866758 - 16000 100 2.2624419 2.2624419 1.2828225 0.030063645 - 16100 100 2.3208536 2.3208536 1.3118956 0.0323489 - 16200 100 2.3564971 2.3564971 1.3261173 0.032882494 - 16300 100 2.3956066 2.3956066 1.3260307 0.03292972 - 16400 100 2.5025831 2.5025831 1.3817693 0.031132988 - 16500 100 2.5947914 2.5947914 1.4152657 0.036126782 - 16600 100 2.7688769 2.7688769 1.4975686 0.037497127 - 16700 100 2.812503 2.812503 1.5216659 0.039316167 - 16800 100 2.8977424 2.8977424 1.5599254 0.039996029 - 16900 100 3.045802 3.045802 1.6332888 0.041406156 - 17000 100 3.2195366 3.2195366 1.7247171 0.040023634 - 17100 100 3.2597294 3.2597294 1.7527958 0.04828292 - 17200 100 3.293587 3.293587 1.7693254 0.044001441 - 17300 100 3.1861836 3.1861836 1.7142076 0.049158822 - 17400 100 3.4593561 3.4593561 1.8426619 0.053469673 - 17500 100 3.3813767 3.3813767 1.8079958 0.058776299 - 17600 100 3.5834203 3.5834203 1.9094759 0.053256842 - 17700 100 3.2243306 3.2243306 1.7425111 0.064354789 - 17800 100 3.358228 3.358228 1.8202932 0.046798524 - 17900 100 3.2257908 3.2257908 1.7678964 0.043655204 - 18000 100 3.237732 3.237732 1.7598181 0.050850672 - 18100 100 3.2042441 3.2042441 1.751979 0.045582006 - 18200 100 3.1562775 3.1562775 1.7336068 0.042210739 - 18300 100 3.2630507 3.2630507 1.7925333 0.046412778 - 18400 100 3.4150588 3.4150588 1.8668408 0.044386435 - 18500 100 3.4913198 3.4913198 1.9125495 0.043329829 - 18600 100 3.5290036 3.5290036 1.9184098 0.048302721 - 18700 100 3.4852698 3.4852698 1.8865833 0.059566124 - 18800 100 3.7157551 3.7157551 2.0082235 0.051356305 - 18900 100 3.9504619 3.9504619 2.1377018 0.051553987 - 19000 100 3.9711274 3.9711274 2.1549121 0.051555312 - 19100 100 3.90954 3.90954 2.1135174 0.0548311 - 19200 100 4.0672819 4.0672819 2.1837089 0.064431553 - 19300 100 3.998355 3.998355 2.1572884 0.056830399 - 19400 100 3.9172127 3.9172127 2.1130164 0.051264041 - 19500 100 3.9120291 3.9120291 2.1088399 0.052545115 - 19600 100 3.8613614 3.8613614 2.0752883 0.055466569 - 19700 100 3.8428824 3.8428824 2.0787804 0.05129261 - 19800 100 3.5686751 3.5686751 1.9356553 0.059177256 - 19900 100 3.5573788 3.5573788 1.9430183 0.054618794 - 20000 100 3.5453022 3.5453022 1.9413343 0.047640543 -Loop time of 0.13841 on 4 procs for 5000 steps with 100 atoms - -Performance: 15605800.739 tau/day, 36124.539 timesteps/s, 3.612 Matom-step/s -89.0% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0047469 | 0.0062771 | 0.0080644 | 1.5 | 4.54 -Neigh | 0.0062517 | 0.0079248 | 0.0094271 | 1.3 | 5.73 -Comm | 0.047109 | 0.048595 | 0.050543 | 0.6 | 35.11 -Output | 0.0011807 | 0.0013428 | 0.0015517 | 0.4 | 0.97 -Modify | 0.022766 | 0.033256 | 0.039993 | 3.5 | 24.03 -Other | | 0.04101 | | | 29.63 - -Nlocal: 25 ave 36 max 13 min -Histogram: 1 0 0 0 1 0 1 0 0 1 -Nghost: 5 ave 9 max 2 min -Histogram: 1 0 1 0 1 0 0 0 0 1 -Neighs: 37.5 ave 53 max 15 min -Histogram: 1 0 0 0 0 1 0 1 0 1 - -Total # of neighbors = 150 -Ave neighs/atom = 1.5 -Neighbor list builds = 913 -Dangerous builds = 0 - -region container delete -region container block -6 6 -6 6 -6 6 units box -run 5000 -Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.734 | 5.735 | 5.735 Mbytes - Step Atoms Temp c_1 c_2 Press - 20000 100 3.5453022 3.5453022 1.9413343 0.047178052 - 20100 100 1.0878587 1.0878587 0.68666704 0.016139979 - 20200 100 1.0230655 1.0230655 0.63593494 0.014642345 - 20300 100 0.94958824 0.94958824 0.59306601 0.011745659 - 20400 100 0.93038108 0.93038108 0.57232527 0.01154829 - 20500 100 0.92183816 0.92183816 0.55466942 0.01212559 - 20600 100 1.0175846 1.0175846 0.59940035 0.013815361 - 20700 100 1.0564615 1.0564615 0.60726745 0.013073711 - 20800 100 0.99967869 0.99967869 0.57665019 0.012450813 - 20900 100 0.97051084 0.97051084 0.5574217 0.015686955 - 21000 100 0.639185 0.639185 0.37441942 0.017594616 - 21100 100 0.24979014 0.24979014 0.17121567 0.0084027295 - 21200 100 0.15147941 0.15147941 0.11124349 0.0030435746 - 21300 100 0.13117502 0.13117502 0.091432638 0.0029110318 - 21400 100 0.11158272 0.11158272 0.076264692 0.0021951204 - 21500 100 0.056660993 0.056660993 0.043503807 0.0010993096 - 21600 100 0.028640836 0.028640836 0.026000267 0.0010440792 - 21700 100 0.025816483 0.025816483 0.021922896 0.00081674646 - 21800 100 0.023929555 0.023929555 0.019936972 0.0010383614 - 21900 100 0.022271339 0.022271339 0.017947505 0.0014630387 - 22000 100 0.019277834 0.019277834 0.015483116 0.00058751407 - 22100 100 0.019997809 0.019997809 0.015919504 0.00064176101 - 22200 100 0.015870543 0.015870543 0.01244838 0.0004205505 - 22300 100 0.011797587 0.011797587 0.0096491363 0.00034907063 - 22400 100 0.010745212 0.010745212 0.008874218 0.00035427537 - 22500 100 0.0082372399 0.0082372399 0.0071217811 0.00028179943 - 22600 100 0.007942576 0.007942576 0.0067248822 0.001507115 - 22700 100 0.0061733667 0.0061733667 0.0053092324 0.00056018554 - 22800 100 0.0058287651 0.0058287651 0.004972189 0.00023807695 - 22900 100 0.0051352339 0.0051352339 0.004324157 0.00020849263 - 23000 100 0.0040107769 0.0040107769 0.0035769703 0.00022626101 - 23100 100 0.0040288854 0.0040288854 0.0034355474 0.00019107621 - 23200 100 0.003277858 0.003277858 0.0030013165 0.00016119888 - 23300 100 0.0033633749 0.0033633749 0.0030188927 0.00014459404 - 23400 100 0.003468042 0.003468042 0.0030079205 0.00013778427 - 23500 100 0.0027616702 0.0027616702 0.0024994596 0.00011834915 - 23600 100 0.0022531303 0.0022531303 0.0021182802 0.0002279623 - 23700 100 0.002067768 0.002067768 0.0019631752 0.00014341503 - 23800 100 0.0020069255 0.0020069255 0.0019209587 0.00010673435 - 23900 100 0.0019630617 0.0019630617 0.0018748221 0.00011856923 - 24000 100 0.0018800646 0.0018800646 0.0018190347 0.00010707562 - 24100 100 0.0018028137 0.0018028137 0.0017067233 0.00010884117 - 24200 100 0.0017278932 0.0017278932 0.0016251004 0.00013664683 - 24300 100 0.0016373288 0.0016373288 0.0015529481 0.00010025414 - 24400 100 0.0019876848 0.0019876848 0.0016912033 0.00011235942 - 24500 100 0.0013677345 0.0013677345 0.0012839488 7.8669645e-05 - 24600 100 0.0012852614 0.0012852614 0.0012065052 0.00010172361 - 24700 100 0.0011145002 0.0011145002 0.0010748344 7.5021689e-05 - 24800 100 0.0012860792 0.0012860792 0.0011429675 5.7939624e-05 - 24900 100 0.00097198499 0.00097198499 0.00096175911 5.443837e-05 - 25000 100 0.00096224466 0.00096224466 0.00095159089 5.4245409e-05 -Loop time of 0.0846408 on 4 procs for 5000 steps with 100 atoms - -Performance: 25519602.289 tau/day, 59073.153 timesteps/s, 5.907 Matom-step/s -82.3% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0035473 | 0.0055294 | 0.0082454 | 2.7 | 6.53 -Neigh | 0.0016391 | 0.0022521 | 0.0028115 | 1.1 | 2.66 -Comm | 0.014697 | 0.021565 | 0.029045 | 4.1 | 25.48 -Output | 0.0010785 | 0.00132 | 0.0014171 | 0.4 | 1.56 -Modify | 0.0059648 | 0.01618 | 0.027615 | 7.9 | 19.12 -Other | | 0.03779 | | | 44.65 - -Nlocal: 25 ave 56 max 0 min -Histogram: 2 0 0 0 0 0 0 1 0 1 -Nghost: 5.5 ave 12 max 0 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Neighs: 40 ave 101 max 0 min -Histogram: 2 0 0 0 0 1 0 0 0 1 - -Total # of neighbors = 160 -Ave neighs/atom = 1.6 -Neighbor list builds = 275 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/granregion/log.15Sep22.granregion.funnel.g++.1 b/examples/granregion/log.15Sep22.granregion.funnel.g++.1 deleted file mode 100644 index fc60ca4928..0000000000 --- a/examples/granregion/log.15Sep22.granregion.funnel.g++.1 +++ /dev/null @@ -1,633 +0,0 @@ -LAMMPS (15 Sep 2022) -# pour particles into cone-shaped funnel, settle them, let them run out bottom - -variable name string funnel_pour - -thermo_modify flush yes -units si -variable PI equal 3.141592653589 -variable seed equal 14314 - -############################################### -# Geometry-related parameters -############################################### - -variable xlo equal 10 -variable xhi equal 40 -variable ylo equal 10 -variable yhi equal 40 -variable zlo equal -20 -variable zhi equal 50 - -variable xc equal 25 -variable yc equal 25 - -variable zconehi equal 50 -variable zconelo equal 10 -variable zcyllo equal 0 -variable radconelo equal 2 -variable radconehi equal 20 - -################################################ -# Particle sizes -################################################ - -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable skin equal ${rhi} -variable skin equal 0.5 - -############################################### -# Granular contact parameters -############################################### - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable density equal 1.0 -variable EYoung equal 10^5 -variable Poisson equal 2.0/7.0 -variable GShear equal ${EYoung}/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+0.285714285714286)) - -variable gravity equal 1.0 - -variable reff equal 0.5*(${rhi}+${rlo}) -variable reff equal 0.5*(0.5+${rlo}) -variable reff equal 0.5*(0.5+0.25) -variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 -variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 -variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 - -## Typical way to set kn, kt, etc.: -variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) -variable kt equal 4.0*${GShear}/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) - -variable a equal (-2.0*log(${coeffRes})/${PI})^2 -variable a equal (-2.0*log(0.1)/${PI})^2 -variable a equal (-2.0*log(0.1)/3.141592653589)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 903.503751814138*0.5 - -variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) - -variable dt equal ${tcol}*0.05 -variable dt equal 0.00210943016014969*0.05 -timestep ${dt} -timestep 0.000105471508007485 - -############################################### -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton off -atom_style sphere - -boundary p p f - -region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 40 ${zlo} ${zhi} -region boxreg block 10 40 10 40 -20 ${zhi} -region boxreg block 10 40 10 40 -20 50 -create_box 1 boxreg -Created orthogonal box = (10 10 -20) to (40 40 50) - 1 by 1 by 1 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 -pair_coeff * * - -neighbor ${skin} multi -neighbor 0.5 multi -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Balancing ... -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 30, bins = 1 1 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/multi/newtoff - stencil: full/multi/3d - bin: multi -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -# insertion region for fix/pour - -region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box -region insreg cylinder z 25 ${yc} 10 30 50 side in units box -region insreg cylinder z 25 25 10 30 50 side in units box - -# define cone and cylinder regions - see lammps doc on region command -# note new open options - -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 2 - -region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open -region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 - -region hopreg union 2 conereg cylreg - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - - -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 3000 every 59965 steps, 2000 by step 1 - -#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke -WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) -thermo_modify flush yes lost warn - -# Initial run to fill up the cone - -run 20000 - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Your simulation uses code contributions which should be cited: - -- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 - -@Article{Intveld08, - author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, - title = {Accurate and Efficient Methods for Modeling Colloidal - Mixtures in an Explicit Solvent using Molecular Dynamics}, - journal = {Comput.\ Phys.\ Commut.}, - year = 2008, - volume = 179, - pages = {320--329} -} - -@article{Shire2020, - author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, - title = {{DEM} Simulations of Polydisperse Media: Efficient Contact - Detection Applied to Investigate the Quasi-Static Limit}, - journal = {Computational Particle Mechanics}, - year = {2020} -} - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 6.648 | 6.648 | 6.648 Mbytes - Step CPU Atoms KinEng - 0 0 0 -0 - 1000 0.39961733 2000 -0 - 2000 0.61811961 2000 -0 - 3000 0.83512725 2000 -0 - 4000 1.0492881 2000 -0 - 5000 1.2650657 2000 -0 - 6000 1.479921 2000 -0 - 7000 1.6970993 2000 -0 - 8000 1.9107924 2000 -0 - 9000 2.1251713 2000 -0 - 10000 2.3403682 2000 -0 - 11000 2.549912 2000 -0 - 12000 2.7584788 2000 -0 - 13000 2.9712482 2000 -0 - 14000 3.1877015 2000 -0 - 15000 3.4017175 2000 -0 - 16000 3.6127477 2000 -0 - 17000 3.8250134 2000 -0 - 18000 4.0320643 2000 -0 - 19000 4.2371057 2000 -0 - 20000 4.4450882 2000 -0 -Loop time of 4.44512 on 1 procs for 20000 steps with 2000 atoms - -98.7% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.40438 | 0.40438 | 0.40438 | 0.0 | 9.10 -Neigh | 0.078634 | 0.078634 | 0.078634 | 0.0 | 1.77 -Comm | 0.01999 | 0.01999 | 0.01999 | 0.0 | 0.45 -Output | 0.00069031 | 0.00069031 | 0.00069031 | 0.0 | 0.02 -Modify | 3.795 | 3.795 | 3.795 | 0.0 | 85.38 -Other | | 0.1464 | | | 3.29 - -Nlocal: 2000 ave 2000 max 2000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1607 ave 1607 max 1607 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1607 -Ave neighs/atom = 0.8035 -Neighbor list builds = 71 -Dangerous builds = 0 -unfix ins -run 150000 -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 12.69 | 12.69 | 12.69 Mbytes - Step CPU Atoms KinEng - 20000 0 2000 6652.2957 - 21000 0.2135317 2000 6807.2201 - 22000 0.4235523 2000 6973.9359 - 23000 0.63502794 2000 7142.3648 - 24000 0.84593615 2000 7276.9717 - 25000 1.0580291 2000 7369.4191 - 26000 1.2719892 2000 7497.6526 - 27000 1.4843056 2000 7638.946 - 28000 1.9685336 2000 7780.0339 - 29000 2.1850097 2000 7881.8177 - 30000 2.4033006 2000 7967.2641 - 31000 2.6219694 2000 7994.9273 - 32000 2.8455468 2000 7937.0671 - 33000 3.0720066 2000 7774.0508 - 34000 3.3070513 2000 7591.1491 - 35000 3.5468777 2000 7357.5176 - 36000 3.7908265 2000 7147.2024 - 37000 4.0388657 2000 6979.1604 - 38000 4.2873223 2000 6813.2152 - 39000 4.5424244 2000 6660.2701 - 40000 4.8055367 2000 6502.8957 - 41000 5.0754561 2000 6324.3951 - 42000 5.3564118 2000 6132.7516 - 43000 5.6357256 2000 5913.1841 - 44000 5.9130645 2000 5732.2095 - 45000 6.1943539 2000 5508.8322 - 46000 6.4862302 2000 5306.8932 - 47000 6.7796417 2000 5152.0521 - 48000 7.0750069 2000 5028.2274 - 49000 7.3705252 2000 4896.102 - 50000 7.6693894 2000 4723.5189 - 51000 7.9685182 2000 4583.7526 - 52000 8.2774033 2000 4447.0187 - 53000 8.591482 2000 4303.2307 - 54000 8.9156439 2000 4168.5251 - 55000 9.2437364 2000 4036.9704 - 56000 9.5745684 2000 3901.1183 - 57000 9.9173689 2000 3716.7071 - 58000 10.270229 2000 3473.5422 - 59000 10.629101 2000 3245.1223 - 60000 10.989479 2000 3039.7845 - 61000 11.349843 2000 2780.0187 - 62000 11.716916 2000 2577.3345 - 63000 12.093666 2000 2346.2488 - 64000 12.474788 2000 2116.7298 - 65000 12.861438 2000 1903.7828 - 66000 13.25464 2000 1631.1676 - 67000 13.658382 2000 1431.0198 - 68000 14.067584 2000 1212.875 - 69000 14.480877 2000 995.45046 - 70000 14.894765 2000 811.54766 - 71000 15.309158 2000 624.08622 - 72000 15.732937 2000 471.00862 - 73000 16.158388 2000 358.33486 - 74000 16.583847 2000 284.39416 - 75000 17.008335 2000 234.26671 - 76000 17.429582 2000 185.61836 - 77000 17.852799 2000 152.95918 - 78000 18.276783 2000 122.49023 - 79000 18.697016 2000 102.29396 - 80000 19.12318 2000 86.284684 - 81000 19.54992 2000 73.984781 - 82000 19.986149 2000 63.042918 - 83000 20.430305 2000 53.338428 - 84000 20.876061 2000 45.89585 - 85000 21.32714 2000 40.412826 - 86000 21.781352 2000 34.183381 - 87000 22.238656 2000 29.671524 - 88000 22.698093 2000 26.90414 - 89000 23.160614 2000 24.362631 - 90000 23.630639 2000 21.887341 - 91000 24.095463 2000 19.985662 - 92000 24.570659 2000 18.728162 - 93000 25.047431 2000 16.99941 - 94000 25.549041 2000 15.71941 - 95000 26.03281 2000 14.744057 - 96000 26.513659 2000 14.214918 - 97000 26.998918 2000 13.450182 - 98000 27.486584 2000 12.79222 - 99000 27.986785 2000 12.10595 - 100000 28.48799 2000 11.281863 - 101000 28.986622 2000 10.025419 - 102000 29.491312 2000 9.9574468 - 103000 29.999421 2000 9.4078117 - 104000 30.507211 2000 8.9079161 - 105000 31.016484 2000 8.6269302 - 106000 31.527511 2000 8.5512649 - 107000 32.042612 2000 8.4703948 - 108000 32.555041 2000 8.2747542 - 109000 33.07064 2000 8.2895118 - 110000 33.593773 2000 8.1785613 - 111000 34.107129 2000 7.8443234 - 112000 34.619185 2000 7.7436124 - 113000 35.13418 2000 7.8118604 - 114000 35.653352 2000 7.3806177 - 115000 36.179577 2000 7.0857235 - 116000 36.69882 2000 7.1346752 - 117000 37.224612 2000 7.0653751 - 118000 37.756738 2000 6.6314104 - 119000 38.283151 2000 6.2169614 - 120000 38.808288 2000 5.8988829 - 121000 39.334913 2000 5.4197277 - 122000 39.862081 2000 4.6381303 - 123000 40.390252 2000 4.4949206 - 124000 40.920744 2000 4.4261118 - 125000 41.4469 2000 4.4223703 - 126000 41.977937 2000 4.4858898 - 127000 42.51483 2000 4.3312536 - 128000 43.046324 2000 3.7124973 - 129000 43.573687 2000 3.5467396 - 130000 44.103102 2000 3.5104139 - 131000 44.629869 2000 3.5725612 - 132000 45.156621 2000 3.669455 - 133000 45.69364 2000 3.6168912 - 134000 46.23133 2000 3.3598517 - 135000 46.765487 2000 3.3743407 - 136000 47.323693 2000 3.1109764 - 137000 47.881617 2000 3.0720146 - 138000 48.439179 2000 3.1303776 - 139000 49.001417 2000 3.2052806 - 140000 49.558061 2000 2.8958882 - 141000 50.097789 2000 2.9931572 - 142000 50.636089 2000 3.0967832 - 143000 51.175873 2000 3.0576365 - 144000 51.706799 2000 3.2016943 - 145000 52.239356 2000 3.3817709 - 146000 52.769944 2000 3.4527239 - 147000 53.30872 2000 3.5928733 - 148000 53.847762 2000 3.7784682 - 149000 54.387455 2000 3.6587944 - 150000 54.931594 2000 3.7945669 - 151000 55.470076 2000 3.5551557 - 152000 56.01448 2000 3.6248848 - 153000 56.552259 2000 3.7361463 - 154000 57.092655 2000 3.8534319 - 155000 57.635767 2000 4.0101408 - 156000 58.180249 2000 3.7670652 - 157000 58.724032 2000 3.1487676 - 158000 59.262015 2000 2.980076 - 159000 59.794312 2000 3.0350592 - 160000 60.331617 2000 3.125389 - 161000 60.861827 2000 2.7516115 - 162000 61.396691 2000 2.413911 - 163000 61.930145 2000 2.297713 - 164000 62.466983 2000 2.3190806 - 165000 63.00535 2000 2.2868879 - 166000 63.546881 2000 2.1658547 - 167000 64.091461 2000 1.7511071 - 168000 64.63141 2000 1.4112478 - 169000 65.17459 2000 1.3623558 - 170000 65.719571 2000 1.3701579 -Loop time of 65.7196 on 1 procs for 150000 steps with 2000 atoms - -98.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 32.424 | 32.424 | 32.424 | 0.0 | 49.34 -Neigh | 0.65326 | 0.65326 | 0.65326 | 0.0 | 0.99 -Comm | 0.14207 | 0.14207 | 0.14207 | 0.0 | 0.22 -Output | 0.26326 | 0.26326 | 0.26326 | 0.0 | 0.40 -Modify | 31.109 | 31.109 | 31.109 | 0.0 | 47.34 -Other | | 1.128 | | | 1.72 - -Nlocal: 2000 ave 2000 max 2000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 15308 ave 15308 max 15308 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 15308 -Ave neighs/atom = 7.654 -Neighbor list builds = 367 -Dangerous builds = 0 - -# remove "plug" - need to redefine cylinder region & union - -region cylreg delete -region hopreg delete -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 - -region hopreg union 2 cylreg conereg - -unfix hopper3 -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -run 100000 -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 12.69 | 12.69 | 12.69 Mbytes - Step CPU Atoms KinEng - 170000 0 2000 1.3701579 - 171000 0.54961146 2000 2.3724823 - 172000 1.0905775 2000 3.5881441 - 173000 1.6190656 2000 5.3771633 - 174000 2.1428619 2000 7.5896471 - 175000 2.6623327 2000 10.77251 - 176000 3.1738773 2000 14.806868 - 177000 3.6751053 2000 19.607624 - 178000 4.17465 2000 25.426227 - 179000 4.6736143 2000 32.23584 - 180000 5.1769137 2000 39.930468 - 181000 5.6766809 2000 47.686304 - 182000 6.1722504 2000 56.506806 - 183000 6.6603586 2000 66.514326 - 184000 7.1473381 2000 77.554644 - 185000 7.6343824 2000 89.224002 - 186000 8.1170225 2000 102.07846 - 187000 8.598305 2000 116.08141 - 188000 9.0708108 2000 130.97964 - 189000 9.5435695 2000 146.77806 - 190000 10.015069 2000 162.79858 - 191000 10.480992 2000 179.02052 - 192000 10.941896 2000 196.26683 - 193000 11.398748 2000 214.38928 - 194000 11.856098 2000 232.32068 - 195000 12.314324 2000 251.74644 - 196000 12.765746 2000 272.25231 - 197000 13.216453 2000 294.64075 - 198000 13.663698 2000 318.32895 - 199000 14.109901 2000 342.44005 - 200000 14.560399 2000 368.35469 - 201000 15.008158 2000 395.2465 - 202000 15.460487 2000 422.63599 - 203000 15.913115 2000 450.45248 - 204000 16.363656 2000 479.60812 - 205000 16.816929 2000 510.44155 - 206000 17.265488 2000 543.25751 - 207000 17.707782 2000 577.35928 - 208000 18.151051 2000 612.29718 - 209000 18.588363 2000 647.8951 - 210000 19.027167 2000 683.79409 - 211000 19.463213 2000 720.36556 - 212000 19.901783 2000 759.27331 - 213000 20.340436 2000 798.27302 - 214000 20.775782 2000 837.93849 - 215000 21.207465 2000 877.92945 - 216000 21.641572 2000 919.62532 - 217000 22.077351 2000 962.83509 - 218000 22.517089 2000 1008.5243 - 219000 22.948683 2000 1054.5769 - 220000 23.381029 2000 1103.1843 - 221000 23.809214 2000 1153.0349 - 222000 24.246127 2000 1204.5599 - 223000 24.677676 2000 1257.1367 - 224000 25.113989 2000 1308.6735 -WARNING: Lost atoms: original 2000 current 1999 (../thermo.cpp:486) - 225000 25.549621 1999 1360.1205 - 226000 25.977155 1998 1404.8405 - 227000 26.406475 1996 1448.4869 - 228000 26.832152 1992 1491.8112 - 229000 27.25327 1985 1518.7013 - 230000 27.672907 1971 1507.6699 - 231000 28.086761 1965 1533.5096 - 232000 28.500134 1948 1489.4128 - 233000 28.912212 1933 1477.4536 - 234000 29.320197 1915 1425.8398 - 235000 29.723669 1904 1410.1451 - 236000 30.124339 1892 1401.7595 - 237000 30.523539 1880 1368.893 - 238000 30.919483 1868 1341.8885 - 239000 31.313194 1850 1286.7968 - 240000 31.711659 1833 1219.5123 - 241000 32.106468 1820 1173.3608 - 242000 32.505486 1806 1106.0727 - 243000 32.905579 1788 1035.912 - 244000 33.303155 1779 1021.6147 - 245000 33.696614 1767 969.40032 - 246000 34.083545 1757 939.12022 - 247000 34.472486 1739 840.9396 - 248000 34.858907 1730 822.06575 - 249000 35.248061 1719 762.11057 - 250000 35.639608 1707 708.50308 - 251000 36.029812 1700 692.12647 - 252000 36.428881 1697 694.5812 - 253000 36.821304 1686 652.36951 - 254000 37.203008 1682 662.95256 - 255000 37.576678 1677 637.34619 - 256000 37.952398 1672 630.71277 - 257000 38.336834 1669 641.87365 - 258000 38.719421 1665 635.862 - 259000 39.104236 1664 658.5339 - 260000 39.484223 1662 669.95468 - 261000 39.861203 1660 676.93495 - 262000 40.240183 1657 681.72646 - 263000 40.614974 1655 687.4078 - 264000 40.99447 1651 681.61352 - 265000 41.368018 1647 673.20622 - 266000 41.740288 1644 677.30073 - 267000 42.111704 1641 671.05897 - 268000 42.479868 1639 689.55776 - 269000 42.851008 1637 711.98809 - 270000 43.22438 1633 705.29974 -Loop time of 43.2244 on 1 procs for 100000 steps with 1633 atoms - -99.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 22.312 | 22.312 | 22.312 | 0.0 | 51.62 -Neigh | 0.47451 | 0.47451 | 0.47451 | 0.0 | 1.10 -Comm | 0.093822 | 0.093822 | 0.093822 | 0.0 | 0.22 -Output | 0.0028326 | 0.0028326 | 0.0028326 | 0.0 | 0.01 -Modify | 19.626 | 19.626 | 19.626 | 0.0 | 45.40 -Other | | 0.7152 | | | 1.65 - -Nlocal: 1633 ave 1633 max 1633 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 11358 ave 11358 max 11358 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 11358 -Ave neighs/atom = 6.955297 -Neighbor list builds = 244 -Dangerous builds = 0 -Total wall time: 0:01:53 diff --git a/examples/granregion/log.15Sep22.granregion.funnel.g++.4 b/examples/granregion/log.15Sep22.granregion.funnel.g++.4 deleted file mode 100644 index 3c18217deb..0000000000 --- a/examples/granregion/log.15Sep22.granregion.funnel.g++.4 +++ /dev/null @@ -1,633 +0,0 @@ -LAMMPS (15 Sep 2022) -# pour particles into cone-shaped funnel, settle them, let them run out bottom - -variable name string funnel_pour - -thermo_modify flush yes -units si -variable PI equal 3.141592653589 -variable seed equal 14314 - -############################################### -# Geometry-related parameters -############################################### - -variable xlo equal 10 -variable xhi equal 40 -variable ylo equal 10 -variable yhi equal 40 -variable zlo equal -20 -variable zhi equal 50 - -variable xc equal 25 -variable yc equal 25 - -variable zconehi equal 50 -variable zconelo equal 10 -variable zcyllo equal 0 -variable radconelo equal 2 -variable radconehi equal 20 - -################################################ -# Particle sizes -################################################ - -variable rlo equal 0.25 -variable rhi equal 0.5 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.25 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.5 - -variable skin equal ${rhi} -variable skin equal 0.5 - -############################################### -# Granular contact parameters -############################################### - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable density equal 1.0 -variable EYoung equal 10^5 -variable Poisson equal 2.0/7.0 -variable GShear equal ${EYoung}/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+${Poisson})) -variable GShear equal 100000/(2*(1+0.285714285714286)) - -variable gravity equal 1.0 - -variable reff equal 0.5*(${rhi}+${rlo}) -variable reff equal 0.5*(0.5+${rlo}) -variable reff equal 0.5*(0.5+0.25) -variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*${PI}*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 -variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 -variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} -variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 -variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} -variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 - -## Typical way to set kn, kt, etc.: -variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) -variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) -variable kt equal 4.0*${GShear}/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-${Poisson}) -variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) - -variable a equal (-2.0*log(${coeffRes})/${PI})^2 -variable a equal (-2.0*log(0.1)/${PI})^2 -variable a equal (-2.0*log(0.1)/3.141592653589)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 903.503751814138*0.5 - -variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) -variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) - -variable dt equal ${tcol}*0.05 -variable dt equal 0.00210943016014969*0.05 -timestep ${dt} -timestep 0.000105471508007485 - -############################################### -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton off -atom_style sphere - -boundary p p f - -region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} -region boxreg block 10 40 10 40 ${zlo} ${zhi} -region boxreg block 10 40 10 40 -20 ${zhi} -region boxreg block 10 40 10 40 -20 50 -create_box 1 boxreg -Created orthogonal box = (10 10 -20) to (40 40 50) - 1 by 1 by 4 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 -pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 -pair_coeff * * - -neighbor ${skin} multi -neighbor 0.5 multi -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Balancing ... -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 30, bins = 1 1 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/multi/newtoff - stencil: full/multi/3d - bin: multi -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -# insertion region for fix/pour - -region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box -region insreg cylinder z 25 ${yc} 10 30 50 side in units box -region insreg cylinder z 25 25 10 30 50 side in units box - -# define cone and cylinder regions - see lammps doc on region command -# note new open options - -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 2 - -region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open -region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 -region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 - -region hopreg union 2 conereg cylreg - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - - -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} -fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 -Particle insertion: 3000 every 59965 steps, 2000 by step 1 - -#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke -WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) -thermo_modify flush yes lost warn - -# Initial run to fill up the cone - -run 20000 - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Your simulation uses code contributions which should be cited: - -- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 - -@Article{Intveld08, - author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, - title = {Accurate and Efficient Methods for Modeling Colloidal - Mixtures in an Explicit Solvent using Molecular Dynamics}, - journal = {Comput.\ Phys.\ Commut.}, - year = 2008, - volume = 179, - pages = {320--329} -} - -@article{Shire2020, - author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, - title = {{DEM} Simulations of Polydisperse Media: Efficient Contact - Detection Applied to Investigate the Quasi-Static Limit}, - journal = {Computational Particle Mechanics}, - year = {2020} -} - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 6.049 | 6.049 | 6.049 Mbytes - Step CPU Atoms KinEng - 0 0 0 -0 - 1000 0.4194951 2000 -0 - 2000 0.61516729 2000 -0 - 3000 0.80702516 2000 -0 - 4000 0.99253349 2000 -0 - 5000 1.172741 2000 -0 - 6000 1.3484682 2000 -0 - 7000 1.5206253 2000 -0 - 8000 1.6875025 2000 -0 - 9000 1.8503087 2000 -0 - 10000 2.0125622 2000 -0 - 11000 2.0890872 2000 -0 - 12000 2.1663582 2000 -0 - 13000 2.2430386 2000 -0 - 14000 2.320045 2000 -0 - 15000 2.3989769 2000 -0 - 16000 2.4824747 2000 -0 - 17000 2.5693391 2000 -0 - 18000 2.6595183 2000 -0 - 19000 2.752627 2000 -0 - 20000 2.8503071 2000 -0 -Loop time of 2.85034 on 4 procs for 20000 steps with 2000 atoms - -98.0% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.04057 | 0.088166 | 0.18377 | 18.9 | 3.09 -Neigh | 0.0072649 | 0.014273 | 0.025073 | 5.5 | 0.50 -Comm | 0.097843 | 0.19506 | 0.29871 | 19.9 | 6.84 -Output | 0.00099986 | 0.0018246 | 0.0023299 | 1.2 | 0.06 -Modify | 0.68567 | 1.1174 | 1.9527 | 46.8 | 39.20 -Other | | 1.434 | | | 50.30 - -Nlocal: 500 ave 510 max 493 min -Histogram: 1 1 0 0 0 1 0 0 0 1 -Nghost: 154 ave 227 max 79 min -Histogram: 1 0 0 0 1 0 1 0 0 1 -Neighs: 415.5 ave 610 max 258 min -Histogram: 1 1 0 0 0 0 1 0 0 1 - -Total # of neighbors = 1662 -Ave neighs/atom = 0.831 -Neighbor list builds = 71 -Dangerous builds = 0 -unfix ins -run 150000 -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 12.33 | 12.5 | 12.68 Mbytes - Step CPU Atoms KinEng - 20000 0 2000 6652.2957 - 21000 0.069761009 2000 6807.2201 - 22000 0.14277925 2000 6973.9359 - 23000 0.21755553 2000 7142.3648 - 24000 0.29656838 2000 7276.9717 - 25000 0.3791331 2000 7369.4191 - 26000 0.46663378 2000 7497.6526 - 27000 0.55670237 2000 7638.946 - 28000 0.65212555 2000 7780.0339 - 29000 0.75032507 2000 7881.8177 - 30000 0.85580942 2000 7967.2641 - 31000 0.93204785 2000 7994.9273 - 32000 1.0168325 2000 7937.0672 - 33000 1.1081585 2000 7774.0508 - 34000 1.2084122 2000 7591.1511 - 35000 1.3164174 2000 7357.5032 - 36000 1.4326847 2000 7147.3776 - 37000 1.5548919 2000 6980.0719 - 38000 1.6806183 2000 6813.0872 - 39000 1.8171138 2000 6657.0693 - 40000 1.9655069 2000 6505.1155 - 41000 2.0788398 2000 6330.2864 - 42000 2.1972941 2000 6147.8022 - 43000 2.3180177 2000 5932.9244 - 44000 2.4424194 2000 5755.296 - 45000 2.5679759 2000 5511.622 - 46000 2.7042099 2000 5332.3171 - 47000 2.8436403 2000 5162.4926 - 48000 2.983017 2000 5044.5764 - 49000 3.1228322 2000 4901.1141 - 50000 3.2614172 2000 4731.1949 - 51000 3.3835559 2000 4575.418 - 52000 3.5097034 2000 4428.9425 - 53000 3.6438561 2000 4291.7282 - 54000 3.7823058 2000 4154.1885 - 55000 3.9269393 2000 3994.9402 - 56000 4.0761939 2000 3855.5977 - 57000 4.2262191 2000 3672.9504 - 58000 4.3809045 2000 3435.3395 - 59000 4.5439971 2000 3200.7379 - 60000 4.7111867 2000 2986.5411 - 61000 4.8700167 2000 2747.3628 - 62000 5.030656 2000 2542.0805 - 63000 5.1932098 2000 2336.7687 - 64000 5.3585095 2000 2151.6388 - 65000 5.5278279 2000 1933.6773 - 66000 5.7032072 2000 1699.0747 - 67000 5.8804545 2000 1467.7209 - 68000 6.0598984 2000 1227.3577 - 69000 6.2471961 2000 1016.2766 - 70000 6.4413532 2000 812.90843 - 71000 6.615215 2000 632.88108 - 72000 6.7897335 2000 470.67731 - 73000 6.964705 2000 360.47748 - 74000 7.1361808 2000 286.10584 - 75000 7.3068097 2000 229.70386 - 76000 7.4771974 2000 179.62654 - 77000 7.6485358 2000 142.40417 - 78000 7.8200771 2000 113.55745 - 79000 7.9923688 2000 93.787669 - 80000 8.164219 2000 80.646319 - 81000 8.3372059 2000 70.944319 - 82000 8.5130035 2000 59.2275 - 83000 8.6877383 2000 49.633808 - 84000 8.8675712 2000 42.882698 - 85000 9.0509682 2000 36.841824 - 86000 9.2393665 2000 31.776681 - 87000 9.4296116 2000 28.25076 - 88000 9.622196 2000 25.228966 - 89000 9.8176023 2000 22.593627 - 90000 10.01325 2000 21.15796 - 91000 10.204474 2000 19.941629 - 92000 10.399553 2000 18.375654 - 93000 10.596683 2000 17.056701 - 94000 10.796988 2000 16.192511 - 95000 10.998545 2000 15.572922 - 96000 11.200614 2000 14.827788 - 97000 11.402484 2000 13.919613 - 98000 11.606219 2000 13.19525 - 99000 11.81042 2000 11.993376 - 100000 12.018294 2000 11.258787 - 101000 12.223702 2000 10.641688 - 102000 12.432026 2000 10.430435 - 103000 12.640962 2000 9.518069 - 104000 12.849109 2000 9.1332086 - 105000 13.05872 2000 9.2151611 - 106000 13.269956 2000 9.0035132 - 107000 13.481882 2000 8.7835861 - 108000 13.693895 2000 8.5124479 - 109000 13.906381 2000 8.2975453 - 110000 14.120217 2000 8.3483043 - 111000 14.332078 2000 8.4658572 - 112000 14.54349 2000 8.4771784 - 113000 14.755719 2000 7.8937975 - 114000 14.968619 2000 7.2472953 - 115000 15.180485 2000 6.5812074 - 116000 15.394405 2000 5.5651566 - 117000 15.607523 2000 5.3015807 - 118000 15.821873 2000 5.0133941 - 119000 16.035675 2000 4.8746036 - 120000 16.24964 2000 4.9133073 - 121000 16.462102 2000 4.3337392 - 122000 16.676371 2000 4.3374836 - 123000 16.890252 2000 4.3721818 - 124000 17.106594 2000 4.3894508 - 125000 17.321433 2000 4.1811774 - 126000 17.536692 2000 4.3011002 - 127000 17.748238 2000 4.442228 - 128000 17.962609 2000 4.6170394 - 129000 18.175315 2000 4.8184318 - 130000 18.389056 2000 4.8442096 - 131000 18.600872 2000 4.9668117 - 132000 18.81412 2000 4.8364562 - 133000 19.027514 2000 4.6658645 - 134000 19.23975 2000 4.5758487 - 135000 19.451085 2000 4.7251949 - 136000 19.663874 2000 4.5846492 - 137000 19.87624 2000 4.7565986 - 138000 20.088654 2000 4.8186623 - 139000 20.29935 2000 4.6571647 - 140000 20.510911 2000 4.0730143 - 141000 20.722072 2000 4.0605542 - 142000 20.933113 2000 4.1457179 - 143000 21.143916 2000 4.3418042 - 144000 21.353873 2000 4.0323813 - 145000 21.567015 2000 3.8064958 - 146000 21.781334 2000 3.1802044 - 147000 21.996799 2000 2.7947641 - 148000 22.209808 2000 2.7384164 - 149000 22.423177 2000 2.7428829 - 150000 22.638044 2000 2.7802186 - 151000 22.851676 2000 2.6703451 - 152000 23.065354 2000 2.3357647 - 153000 23.278882 2000 1.9855305 - 154000 23.494254 2000 1.9442713 - 155000 23.708192 2000 1.7348027 - 156000 23.923005 2000 1.5699942 - 157000 24.13827 2000 1.5224944 - 158000 24.352068 2000 1.4850914 - 159000 24.565616 2000 1.4461048 - 160000 24.779118 2000 1.3759525 - 161000 24.99111 2000 0.83754463 - 162000 25.205935 2000 0.7952922 - 163000 25.420817 2000 0.69670143 - 164000 25.632672 2000 0.66253723 - 165000 25.846901 2000 0.64602969 - 166000 26.060074 2000 0.60229858 - 167000 26.273714 2000 0.5757589 - 168000 26.484855 2000 0.5996023 - 169000 26.698151 2000 0.62130448 - 170000 26.911208 2000 0.63888277 -Loop time of 26.9112 on 4 procs for 150000 steps with 2000 atoms - -95.1% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 4.5517 | 8.6135 | 10.872 | 82.7 | 32.01 -Neigh | 0.092491 | 0.15402 | 0.19598 | 9.7 | 0.57 -Comm | 2.0054 | 3.8686 | 4.6494 | 55.0 | 14.38 -Output | 0.0047033 | 0.0096766 | 0.016452 | 4.6 | 0.04 -Modify | 5.6498 | 7.9588 | 9.4012 | 49.7 | 29.57 -Other | | 6.307 | | | 23.43 - -Nlocal: 500 ave 538 max 419 min -Histogram: 1 0 0 0 0 0 0 1 0 2 -Nghost: 445.5 ave 688 max 200 min -Histogram: 1 0 0 0 1 0 1 0 0 1 -Neighs: 4500.25 ave 5610 max 3443 min -Histogram: 1 0 1 0 0 0 1 0 0 1 - -Total # of neighbors = 18001 -Ave neighs/atom = 9.0005 -Neighbor list builds = 362 -Dangerous builds = 0 - -# remove "plug" - need to redefine cylinder region & union - -region cylreg delete -region hopreg delete -region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open -region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 -region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 - -region hopreg union 2 cylreg conereg - -unfix hopper3 -fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg -fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg - -run 100000 -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 12.34 | 12.53 | 12.68 Mbytes - Step CPU Atoms KinEng - 170000 0 2000 0.63888277 - 171000 0.21419748 2000 1.4139245 - 172000 0.42844271 2000 2.2400138 - 173000 0.64333145 2000 3.8034979 - 174000 0.85456696 2000 6.116727 - 175000 1.0672981 2000 8.9536458 - 176000 1.2790911 2000 12.74348 - 177000 1.491721 2000 17.410816 - 178000 1.7033452 2000 22.879174 - 179000 1.9168047 2000 28.966022 - 180000 2.1329071 2000 35.449239 - 181000 2.3490841 2000 42.694882 - 182000 2.565508 2000 50.913279 - 183000 2.780369 2000 60.098465 - 184000 2.9967771 2000 70.133474 - 185000 3.2116891 2000 80.950013 - 186000 3.4248923 2000 92.495525 - 187000 3.6394206 2000 104.83034 - 188000 3.8527533 2000 118.04659 - 189000 4.0650838 2000 132.7403 - 190000 4.2781031 2000 148.31955 - 191000 4.476226 2000 164.26321 - 192000 4.6750263 2000 180.6933 - 193000 4.8710737 2000 197.72012 - 194000 5.0677642 2000 215.43637 - 195000 5.2639974 2000 234.29738 - 196000 5.4599746 2000 254.03407 - 197000 5.6534894 2000 274.58626 - 198000 5.8462402 2000 296.88915 - 199000 6.0400194 2000 320.45001 - 200000 6.2329415 2000 344.75891 - 201000 6.4235068 2000 370.14016 - 202000 6.6142055 2000 395.72827 - 203000 6.8048206 2000 420.42026 - 204000 6.9987454 2000 446.08079 - 205000 7.1925778 2000 473.62963 - 206000 7.3846227 2000 501.05693 - 207000 7.5775122 2000 530.40427 - 208000 7.77052 2000 560.62015 - 209000 7.964984 2000 593.00113 - 210000 8.1601405 2000 626.36661 - 211000 8.3504978 2000 661.34861 - 212000 8.5425141 2000 697.41001 - 213000 8.736112 2000 735.12299 - 214000 8.9267615 2000 773.89126 - 215000 9.1154738 2000 813.83268 - 216000 9.3019826 2000 854.63669 - 217000 9.4878433 2000 896.59089 - 218000 9.6739682 2000 938.70251 - 219000 9.8566518 2000 982.10773 - 220000 10.042289 2000 1025.2953 - 221000 10.227275 2000 1069.8382 - 222000 10.412363 2000 1115.4449 - 223000 10.602757 2000 1161.6742 - 224000 10.789101 2000 1211.289 - 225000 10.974854 2000 1262.8074 - 226000 11.157089 2000 1316.6353 - 227000 11.337044 2000 1370.7434 -WARNING: Lost atoms: original 2000 current 1991 (../thermo.cpp:486) - 228000 11.518718 1991 1382.0924 - 229000 11.700488 1986 1407.1543 - 230000 11.883057 1975 1415.708 - 231000 12.063962 1968 1430.6498 - 232000 12.246917 1957 1421.0352 - 233000 12.429345 1939 1376.0322 - 234000 12.6113 1925 1350.1292 - 235000 12.791233 1912 1337.0529 - 236000 12.968444 1893 1273.2219 - 237000 13.146668 1879 1207.0473 - 238000 13.327542 1861 1132.0109 - 239000 13.50936 1846 1083.1042 - 240000 13.693504 1826 1004.3265 - 241000 13.863443 1819 989.36186 - 242000 14.03294 1812 983.26132 - 243000 14.20032 1805 985.79932 - 244000 14.366236 1794 936.34844 - 245000 14.532759 1784 889.17423 - 246000 14.703029 1770 846.65018 - 247000 14.873941 1753 751.16306 - 248000 15.045272 1740 709.23095 - 249000 15.217896 1732 687.61586 - 250000 15.388727 1721 638.82967 - 251000 15.558032 1714 618.71543 - 252000 15.725309 1709 611.25444 - 253000 15.888727 1705 606.6846 - 254000 16.050605 1702 601.7236 - 255000 16.212982 1697 575.97244 - 256000 16.378352 1695 577.1712 - 257000 16.547488 1691 576.93668 - 258000 16.718964 1688 586.63687 - 259000 16.892601 1686 581.52487 - 260000 17.066036 1682 566.49544 - 261000 17.22488 1681 586.18628 - 262000 17.379249 1678 582.11927 - 263000 17.534079 1675 589.96041 - 264000 17.690288 1672 577.55581 - 265000 17.847805 1669 570.45998 - 266000 18.006261 1666 574.0576 - 267000 18.1674 1662 578.07385 - 268000 18.326753 1660 587.65705 - 269000 18.488052 1657 584.43358 - 270000 18.647474 1654 591.22601 -Loop time of 18.6475 on 4 procs for 100000 steps with 1654 atoms - -94.4% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 2.7714 | 6.1879 | 8.8765 | 88.8 | 33.18 -Neigh | 0.094692 | 0.11244 | 0.13298 | 4.6 | 0.60 -Comm | 1.2471 | 2.918 | 3.5873 | 57.0 | 15.65 -Output | 0.0013438 | 0.0067176 | 0.014709 | 6.0 | 0.04 -Modify | 4.4355 | 5.0416 | 5.5692 | 21.9 | 27.04 -Other | | 4.381 | | | 23.49 - -Nlocal: 413.5 ave 429 max 408 min -Histogram: 3 0 0 0 0 0 0 0 0 1 -Nghost: 408.25 ave 653 max 182 min -Histogram: 1 0 0 1 0 1 0 0 0 1 -Neighs: 3486.25 ave 4367 max 2213 min -Histogram: 1 0 0 0 0 1 0 0 1 1 - -Total # of neighbors = 13945 -Ave neighs/atom = 8.4310762 -Neighbor list builds = 227 -Dangerous builds = 0 -Total wall time: 0:00:48 diff --git a/examples/granregion/log.15Sep22.granregion.mixer.g++.1 b/examples/granregion/log.15Sep22.granregion.mixer.g++.1 deleted file mode 100644 index 2a3402c642..0000000000 --- a/examples/granregion/log.15Sep22.granregion.mixer.g++.1 +++ /dev/null @@ -1,632 +0,0 @@ -LAMMPS (15 Sep 2022) -variable name string mixer - -thermo_modify flush yes -variable seed equal 14314 - -############################################### -# Particle parameters -################################################ - -variable rlo equal 0.3 -variable rhi equal 0.6 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.3 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.6 -variable skin equal ${rhi} -variable skin equal 0.6 - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable kn equal 10^5 -variable kt equal 0.2*${kn} -variable kt equal 0.2*100000 - -variable gravity equal 1.0 -variable density equal 1.0 - -variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 -variable a equal (-2.0*log(${coeffRes})/PI)^2 -variable a equal (-2.0*log(0.1)/PI)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 806.699778405191*0.5 - -variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) - -variable dt equal ${tcol}*0.02 -variable dt equal 0.00236257621510454*0.02 -timestep ${dt} -timestep 4.72515243020908e-05 - -############################################### - -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton on -atom_style sphere - -boundary p p f - -region boxreg block 0 20 0 20 0 20 -create_box 1 boxreg -Created orthogonal box = (0 0 0) to (20 20 20) - 1 by 1 by 1 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 -pair_coeff * * - -neighbor ${skin} multi -neighbor 0.6 multi -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Balancing ... -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 20, bins = 1 1 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton on, size, history - pair build: half/size/multi/newton - stencil: half/multi/3d - bin: multi -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -region insreg cylinder z 10 10 8 10 18 side in units box -region cylreg cylinder z 10 10 10 0 20 side in units box - -variable theta equal (step/400000)*2*PI - -region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box -region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box - -region mixer intersect 3 cylreg b1 b2 side in - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - -fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer - -fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 -Particle insertion: 444 every 84653 steps, 1000 by step 169307 - -#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke v_theta -WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) -thermo_modify flush yes lost warn - -run 200000 - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Your simulation uses code contributions which should be cited: - -- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 - -@Article{Intveld08, - author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, - title = {Accurate and Efficient Methods for Modeling Colloidal - Mixtures in an Explicit Solvent using Molecular Dynamics}, - journal = {Comput.\ Phys.\ Commut.}, - year = 2008, - volume = 179, - pages = {320--329} -} - -@article{Shire2020, - author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, - title = {{DEM} Simulations of Polydisperse Media: Efficient Contact - Detection Applied to Investigate the Quasi-Static Limit}, - journal = {Computational Particle Mechanics}, - year = {2020} -} - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.861 | 5.861 | 5.861 Mbytes - Step CPU Atoms KinEng v_theta - 0 0 0 -0 0 - 1000 0.10672296 444 -0 0.015707963 - 2000 0.2090638 444 -0 0.031415927 - 3000 0.31029663 444 -0 0.04712389 - 4000 0.41047624 444 -0 0.062831853 - 5000 0.51132361 444 -0 0.078539816 - 6000 0.61279172 444 -0 0.09424778 - 7000 0.71396622 444 -0 0.10995574 - 8000 0.81644319 444 -0 0.12566371 - 9000 0.91730959 444 -0 0.14137167 - 10000 1.0181635 444 -0 0.15707963 - 11000 1.1182214 444 -0 0.1727876 - 12000 1.2190013 444 -0 0.18849556 - 13000 1.3196138 444 -0 0.20420352 - 14000 1.4183593 444 -0 0.21991149 - 15000 1.5178458 444 -0 0.23561945 - 16000 1.6169535 444 -0 0.25132741 - 17000 1.7219188 444 -0 0.26703538 - 18000 1.8266303 444 -0 0.28274334 - 19000 1.9331589 444 -0 0.2984513 - 20000 2.0392693 444 -0 0.31415927 - 21000 2.1457521 444 -0 0.32986723 - 22000 2.2507526 444 -0 0.34557519 - 23000 2.3548243 444 -0 0.36128316 - 24000 2.4606335 444 -0 0.37699112 - 25000 2.5657643 444 -0 0.39269908 - 26000 2.6698254 444 -0 0.40840704 - 27000 2.7732221 444 -0 0.42411501 - 28000 2.8766441 444 -0 0.43982297 - 29000 2.9801547 444 -0 0.45553093 - 30000 3.0839748 444 -0 0.4712389 - 31000 3.1880063 444 -0 0.48694686 - 32000 3.2923439 444 -0 0.50265482 - 33000 3.3969501 444 -0 0.51836279 - 34000 3.5012646 444 -0 0.53407075 - 35000 3.6057831 444 -0 0.54977871 - 36000 3.7098273 444 -0 0.56548668 - 37000 3.8146061 444 -0 0.58119464 - 38000 3.9215588 444 -0 0.5969026 - 39000 4.0474026 444 -0 0.61261057 - 40000 4.1544945 444 -0 0.62831853 - 41000 4.2605761 444 -0 0.64402649 - 42000 4.3665287 444 -0 0.65973446 - 43000 4.4728216 444 -0 0.67544242 - 44000 4.5782483 444 -0 0.69115038 - 45000 4.6833043 444 -0 0.70685835 - 46000 4.7902207 444 -0 0.72256631 - 47000 4.8968527 444 -0 0.73827427 - 48000 5.0035027 444 -0 0.75398224 - 49000 5.1117191 444 -0 0.7696902 - 50000 5.2186233 444 -0 0.78539816 - 51000 5.3244005 444 -0 0.80110613 - 52000 5.4316153 444 -0 0.81681409 - 53000 5.5381785 444 -0 0.83252205 - 54000 5.6458179 444 -0 0.84823002 - 55000 5.759203 444 -0 0.86393798 - 56000 5.8779849 444 -0 0.87964594 - 57000 5.9953108 444 -0 0.89535391 - 58000 6.1115532 444 -0 0.91106187 - 59000 6.2298342 444 -0 0.92676983 - 60000 6.3474382 444 -0 0.9424778 - 61000 6.4642217 444 -0 0.95818576 - 62000 6.5815141 444 -0 0.97389372 - 63000 6.6999766 444 -0 0.98960169 - 64000 6.8181369 444 -0 1.0053096 - 65000 6.9368124 444 -0 1.0210176 - 66000 7.0560733 444 -0 1.0367256 - 67000 7.1761749 444 -0 1.0524335 - 68000 7.2942246 444 -0 1.0681415 - 69000 7.4146786 444 -0 1.0838495 - 70000 7.5364025 444 -0 1.0995574 - 71000 7.6565177 444 -0 1.1152654 - 72000 7.7776652 444 -0 1.1309734 - 73000 7.8972494 444 -0 1.1466813 - 74000 8.0183599 444 -0 1.1623893 - 75000 8.1423045 444 -0 1.1780972 - 76000 8.2667013 444 -0 1.1938052 - 77000 8.3876604 444 -0 1.2095132 - 78000 8.5095993 444 -0 1.2252211 - 79000 8.6317663 444 -0 1.2409291 - 80000 8.7562108 444 -0 1.2566371 - 81000 8.8812625 444 -0 1.272345 - 82000 9.006825 444 -0 1.288053 - 83000 9.1310939 444 -0 1.303761 - 84000 9.2540049 444 -0 1.3194689 - 85000 9.4210019 888 -0 1.3351769 - 86000 9.6509014 888 -0 1.3508848 - 87000 9.8827304 888 -0 1.3665928 - 88000 10.113857 888 -0 1.3823008 - 89000 10.34324 888 -0 1.3980087 - 90000 10.574203 888 -0 1.4137167 - 91000 10.806069 888 -0 1.4294247 - 92000 11.037044 888 -0 1.4451326 - 93000 11.262596 888 -0 1.4608406 - 94000 11.490532 888 -0 1.4765485 - 95000 11.716452 888 -0 1.4922565 - 96000 11.943883 888 -0 1.5079645 - 97000 12.171353 888 -0 1.5236724 - 98000 12.396787 888 -0 1.5393804 - 99000 12.623788 888 -0 1.5550884 - 100000 12.849633 888 -0 1.5707963 - 101000 13.082904 888 -0 1.5865043 - 102000 13.316986 888 -0 1.6022123 - 103000 13.54777 888 -0 1.6179202 - 104000 13.77928 888 -0 1.6336282 - 105000 14.014818 888 -0 1.6493361 - 106000 14.250986 888 -0 1.6650441 - 107000 14.485754 888 -0 1.6807521 - 108000 14.720106 888 -0 1.69646 - 109000 14.970869 888 -0 1.712168 - 110000 15.219203 888 -0 1.727876 - 111000 15.469876 888 -0 1.7435839 - 112000 15.721351 888 -0 1.7592919 - 113000 15.972099 888 -0 1.7749998 - 114000 16.222357 888 -0 1.7907078 - 115000 16.474863 888 -0 1.8064158 - 116000 16.725352 888 -0 1.8221237 - 117000 16.979634 888 -0 1.8378317 - 118000 17.231379 888 -0 1.8535397 - 119000 17.483691 888 -0 1.8692476 - 120000 17.737897 888 -0 1.8849556 - 121000 17.991241 888 -0 1.9006636 - 122000 18.245626 888 -0 1.9163715 - 123000 18.499984 888 -0 1.9320795 - 124000 18.754367 888 -0 1.9477874 - 125000 19.006448 888 -0 1.9634954 - 126000 19.260545 888 -0 1.9792034 - 127000 19.513633 888 -0 1.9949113 - 128000 19.769389 888 -0 2.0106193 - 129000 20.025088 888 -0 2.0263273 - 130000 20.277534 888 -0 2.0420352 - 131000 20.529284 888 -0 2.0577432 - 132000 20.785132 888 -0 2.0734512 - 133000 21.038442 888 -0 2.0891591 - 134000 21.293932 888 -0 2.1048671 - 135000 21.545354 888 -0 2.120575 - 136000 21.799547 888 -0 2.136283 - 137000 22.053639 888 -0 2.151991 - 138000 22.310106 888 -0 2.1676989 - 139000 22.569362 888 -0 2.1834069 - 140000 22.829416 888 -0 2.1991149 - 141000 23.089132 888 -0 2.2148228 - 142000 23.345737 888 -0 2.2305308 - 143000 23.60621 888 -0 2.2462387 - 144000 23.867414 888 -0 2.2619467 - 145000 24.132954 888 -0 2.2776547 - 146000 24.39395 888 -0 2.2933626 - 147000 24.657881 888 -0 2.3090706 - 148000 24.918563 888 -0 2.3247786 - 149000 25.177446 888 -0 2.3404865 - 150000 25.446598 888 -0 2.3561945 - 151000 25.715494 888 -0 2.3719025 - 152000 25.985991 888 -0 2.3876104 - 153000 26.256676 888 -0 2.4033184 - 154000 26.525639 888 -0 2.4190263 - 155000 26.82656 888 -0 2.4347343 - 156000 27.157272 888 -0 2.4504423 - 157000 27.481755 888 -0 2.4661502 - 158000 27.80198 888 -0 2.4818582 - 159000 28.123258 888 -0 2.4975662 - 160000 28.437502 888 -0 2.5132741 - 161000 28.756496 888 -0 2.5289821 - 162000 29.080609 888 -0 2.54469 - 163000 29.399252 888 -0 2.560398 - 164000 29.718986 888 -0 2.576106 - 165000 30.045206 888 -0 2.5918139 - 166000 30.365168 888 -0 2.6075219 - 167000 30.684007 888 -0 2.6232299 - 168000 31.006154 888 -0 2.6389378 - 169000 31.330336 888 -0 2.6546458 - 170000 31.681761 1000 -0 2.6703538 - 171000 32.049778 1000 -0 2.6860617 - 172000 32.421067 1000 -0 2.7017697 - 173000 32.79935 1000 -0 2.7174776 - 174000 33.178002 1000 -0 2.7331856 - 175000 33.54236 1000 -0 2.7488936 - 176000 33.904734 1000 -0 2.7646015 - 177000 34.269671 1000 -0 2.7803095 - 178000 34.633106 1000 -0 2.7960175 - 179000 35.001441 1000 -0 2.8117254 - 180000 35.374769 1000 -0 2.8274334 - 181000 35.742362 1000 -0 2.8431414 - 182000 36.115908 1000 -0 2.8588493 - 183000 36.490149 1000 -0 2.8745573 - 184000 36.866289 1000 -0 2.8902652 - 185000 37.252911 1000 -0 2.9059732 - 186000 37.644586 1000 -0 2.9216812 - 187000 38.028002 1000 -0 2.9373891 - 188000 38.40724 1000 -0 2.9530971 - 189000 38.77431 1000 -0 2.9688051 - 190000 39.14138 1000 -0 2.984513 - 191000 39.519083 1000 -0 3.000221 - 192000 39.895243 1000 -0 3.0159289 - 193000 40.237532 1000 -0 3.0316369 - 194000 40.587663 1000 -0 3.0473449 - 195000 40.939032 1000 -0 3.0630528 - 196000 41.290257 1000 -0 3.0787608 - 197000 41.643778 1000 -0 3.0944688 - 198000 41.992818 1000 -0 3.1101767 - 199000 42.335934 1000 -0 3.1258847 - 200000 42.681071 1000 -0 3.1415927 -Loop time of 42.6811 on 1 procs for 200000 steps with 1000 atoms - -Performance: 19130.397 tau/day, 4685.915 timesteps/s, 4.686 Matom-step/s -98.5% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 2.6365 | 2.6365 | 2.6365 | 0.0 | 6.18 -Neigh | 0.051681 | 0.051681 | 0.051681 | 0.0 | 0.12 -Comm | 0.52007 | 0.52007 | 0.52007 | 0.0 | 1.22 -Output | 0.02209 | 0.02209 | 0.02209 | 0.0 | 0.05 -Modify | 38.71 | 38.71 | 38.71 | 0.0 | 90.70 -Other | | 0.7407 | | | 1.74 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 183 ave 183 max 183 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 3757 ave 3757 max 3757 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 3757 -Ave neighs/atom = 3.757 -Neighbor list builds = 200 -Dangerous builds = 0 -unfix ins -run 200000 -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 11.89 | 11.89 | 11.89 Mbytes - Step CPU Atoms KinEng v_theta - 200000 0 1000 1.0515941 3.1415927 - 201000 0.35477257 1000 1.0348185 3.1573006 - 202000 0.71436123 1000 1.0220859 3.1730086 - 203000 1.0642832 1000 1.0225785 3.1887165 - 204000 1.4165213 1000 1.0206121 3.2044245 - 205000 1.7728133 1000 1.009961 3.2201325 - 206000 2.1279101 1000 0.9993323 3.2358404 - 207000 2.480623 1000 0.99602628 3.2515484 - 208000 2.8321106 1000 0.98341818 3.2672564 - 209000 3.2138945 1000 0.96700718 3.2829643 - 210000 3.5921146 1000 0.95226699 3.2986723 - 211000 3.9643569 1000 0.93911691 3.3143802 - 212000 4.3368151 1000 0.92920029 3.3300882 - 213000 4.7130192 1000 0.91893472 3.3457962 - 214000 5.0881313 1000 0.90873324 3.3615041 - 215000 5.4660106 1000 0.88925817 3.3772121 - 216000 5.8455926 1000 0.89108236 3.3929201 - 217000 6.2204827 1000 0.90176711 3.408628 - 218000 6.6046736 1000 0.90149435 3.424336 - 219000 6.9931145 1000 0.89629307 3.440044 - 220000 7.3771565 1000 0.90390589 3.4557519 - 221000 7.7635603 1000 0.87858148 3.4714599 - 222000 8.1502771 1000 0.88862314 3.4871678 - 223000 8.5393557 1000 0.90394098 3.5028758 - 224000 8.9327212 1000 0.91005462 3.5185838 - 225000 9.315331 1000 0.91753865 3.5342917 - 226000 9.6930994 1000 0.91741233 3.5499997 - 227000 10.077148 1000 0.9041879 3.5657077 - 228000 10.463223 1000 0.9085712 3.5814156 - 229000 10.850271 1000 0.8937854 3.5971236 - 230000 11.230235 1000 0.88740571 3.6128316 - 231000 11.61003 1000 0.88350028 3.6285395 - 232000 11.988134 1000 0.88344474 3.6442475 - 233000 12.365856 1000 0.88003311 3.6599554 - 234000 12.745397 1000 0.87416727 3.6756634 - 235000 13.120344 1000 0.86154585 3.6913714 - 236000 13.489521 1000 0.85705071 3.7070793 - 237000 13.858736 1000 0.85297378 3.7227873 - 238000 14.230242 1000 0.84879486 3.7384953 - 239000 14.609692 1000 0.86978407 3.7542032 - 240000 14.998899 1000 0.86758733 3.7699112 - 241000 15.40773 1000 0.86123097 3.7856191 - 242000 15.81537 1000 0.86088136 3.8013271 - 243000 16.221448 1000 0.85270311 3.8170351 - 244000 16.619008 1000 0.8524395 3.832743 - 245000 17.003986 1000 0.84054009 3.848451 - 246000 17.380362 1000 0.82623612 3.864159 - 247000 17.756477 1000 0.82787746 3.8798669 - 248000 18.136456 1000 0.83027177 3.8955749 - 249000 18.521277 1000 0.83307565 3.9112829 - 250000 18.906407 1000 0.82612362 3.9269908 - 251000 19.28348 1000 0.8404639 3.9426988 - 252000 19.66549 1000 0.83550946 3.9584067 - 253000 20.053842 1000 0.81516472 3.9741147 - 254000 20.451357 1000 0.79127421 3.9898227 - 255000 20.844416 1000 0.78373024 4.0055306 - 256000 21.228637 1000 0.79885661 4.0212386 - 257000 21.613641 1000 0.80322118 4.0369466 - 258000 21.99162 1000 0.79861523 4.0526545 - 259000 22.367158 1000 0.79216962 4.0683625 - 260000 22.746158 1000 0.79543097 4.0840704 - 261000 23.125626 1000 0.79394211 4.0997784 - 262000 23.504282 1000 0.79269346 4.1154864 - 263000 23.883609 1000 0.80022854 4.1311943 - 264000 24.261864 1000 0.79885184 4.1469023 - 265000 24.639269 1000 0.79595018 4.1626103 - 266000 25.016335 1000 0.78191184 4.1783182 - 267000 25.389754 1000 0.76329279 4.1940262 - 268000 25.762053 1000 0.7342663 4.2097342 - 269000 26.133966 1000 0.72303366 4.2254421 - 270000 26.511157 1000 0.70016481 4.2411501 - 271000 26.888842 1000 0.68891731 4.256858 - 272000 27.26804 1000 0.68545775 4.272566 - 273000 27.644067 1000 0.68712156 4.288274 - 274000 28.024704 1000 0.69249813 4.3039819 - 275000 28.404842 1000 0.70187847 4.3196899 - 276000 28.785799 1000 0.70679419 4.3353979 - 277000 29.165857 1000 0.70955357 4.3511058 - 278000 29.545291 1000 0.70183408 4.3668138 - 279000 29.926113 1000 0.69979273 4.3825218 - 280000 30.302095 1000 0.70822139 4.3982297 - 281000 30.684406 1000 0.71629209 4.4139377 - 282000 31.065873 1000 0.73094905 4.4296456 - 283000 31.445972 1000 0.74554115 4.4453536 - 284000 31.828184 1000 0.74390104 4.4610616 - 285000 32.207807 1000 0.74675359 4.4767695 - 286000 32.58802 1000 0.75330713 4.4924775 - 287000 32.964457 1000 0.75525926 4.5081855 - 288000 33.343222 1000 0.75174884 4.5238934 - 289000 33.717663 1000 0.74062375 4.5396014 - 290000 34.094722 1000 0.72784613 4.5553093 - 291000 34.46982 1000 0.72151574 4.5710173 - 292000 34.843777 1000 0.71712409 4.5867253 - 293000 35.208307 1000 0.71803758 4.6024332 - 294000 35.576207 1000 0.71002715 4.6181412 - 295000 35.942972 1000 0.7070911 4.6338492 - 296000 36.3107 1000 0.71082175 4.6495571 - 297000 36.682044 1000 0.70438977 4.6652651 - 298000 37.054664 1000 0.70240345 4.6809731 - 299000 37.424717 1000 0.70525357 4.696681 - 300000 37.796148 1000 0.70636846 4.712389 - 301000 38.166828 1000 0.70443346 4.7280969 - 302000 38.538428 1000 0.71187973 4.7438049 - 303000 38.907221 1000 0.71047139 4.7595129 - 304000 39.280263 1000 0.71405925 4.7752208 - 305000 39.652902 1000 0.71277063 4.7909288 - 306000 40.02752 1000 0.72005331 4.8066368 - 307000 40.402955 1000 0.72466112 4.8223447 - 308000 40.784177 1000 0.72001329 4.8380527 - 309000 41.173226 1000 0.70611982 4.8537606 - 310000 41.559195 1000 0.70810918 4.8694686 - 311000 41.946697 1000 0.70377166 4.8851766 - 312000 42.337059 1000 0.70434458 4.9008845 - 313000 42.728304 1000 0.70707385 4.9165925 - 314000 43.120803 1000 0.71412995 4.9323005 - 315000 43.510705 1000 0.72228946 4.9480084 - 316000 43.901867 1000 0.72715835 4.9637164 - 317000 44.295667 1000 0.73833476 4.9794244 - 318000 44.687503 1000 0.75953014 4.9951323 - 319000 45.077121 1000 0.76413836 5.0108403 - 320000 45.465317 1000 0.76745045 5.0265482 - 321000 45.86931 1000 0.75813288 5.0422562 - 322000 46.277029 1000 0.75324661 5.0579642 - 323000 46.680799 1000 0.75004276 5.0736721 - 324000 47.082361 1000 0.74316264 5.0893801 - 325000 47.481252 1000 0.74087383 5.1050881 - 326000 47.87511 1000 0.73244882 5.120796 - 327000 48.274582 1000 0.73096631 5.136504 - 328000 48.671718 1000 0.72955403 5.152212 - 329000 49.066335 1000 0.73464916 5.1679199 - 330000 49.459765 1000 0.73130257 5.1836279 - 331000 49.850698 1000 0.73008711 5.1993358 - 332000 50.241012 1000 0.72561074 5.2150438 - 333000 50.643245 1000 0.7214495 5.2307518 - 334000 51.039153 1000 0.71274232 5.2464597 - 335000 51.430328 1000 0.71335777 5.2621677 - 336000 51.819148 1000 0.71317423 5.2778757 - 337000 52.202763 1000 0.70965743 5.2935836 - 338000 52.585061 1000 0.69648518 5.3092916 - 339000 52.967678 1000 0.68985842 5.3249995 - 340000 53.351472 1000 0.6846783 5.3407075 - 341000 53.737731 1000 0.69031602 5.3564155 - 342000 54.131413 1000 0.69035259 5.3721234 - 343000 54.526384 1000 0.69843983 5.3878314 - 344000 54.921609 1000 0.69566088 5.4035394 - 345000 55.314258 1000 0.68309182 5.4192473 - 346000 55.701119 1000 0.68360919 5.4349553 - 347000 56.088194 1000 0.68034628 5.4506633 - 348000 56.467878 1000 0.67155093 5.4663712 - 349000 56.857709 1000 0.66504603 5.4820792 - 350000 57.250758 1000 0.66533658 5.4977871 - 351000 57.643438 1000 0.67726804 5.5134951 - 352000 58.04256 1000 0.68880987 5.5292031 - 353000 58.437369 1000 0.71377276 5.544911 - 354000 58.832421 1000 0.71715625 5.560619 - 355000 59.222221 1000 0.71729576 5.576327 - 356000 59.621431 1000 0.71088872 5.5920349 - 357000 60.013262 1000 0.70564615 5.6077429 - 358000 60.406494 1000 0.69291739 5.6234508 - 359000 60.800632 1000 0.68237469 5.6391588 - 360000 61.195364 1000 0.69105856 5.6548668 - 361000 61.588291 1000 0.69563351 5.6705747 - 362000 61.984821 1000 0.69762747 5.6862827 - 363000 62.377158 1000 0.69717346 5.7019907 - 364000 62.77604 1000 0.69413964 5.7176986 - 365000 63.165863 1000 0.68584257 5.7334066 - 366000 63.5503 1000 0.67653762 5.7491146 - 367000 63.930717 1000 0.66880284 5.7648225 - 368000 64.313698 1000 0.66024732 5.7805305 - 369000 64.708193 1000 0.65451701 5.7962384 - 370000 65.10142 1000 0.64352268 5.8119464 - 371000 65.49169 1000 0.63715296 5.8276544 - 372000 65.879115 1000 0.63840106 5.8433623 - 373000 66.268258 1000 0.64537192 5.8590703 - 374000 66.661807 1000 0.64498753 5.8747783 - 375000 67.052521 1000 0.64666103 5.8904862 - 376000 67.443168 1000 0.65957055 5.9061942 - 377000 67.835892 1000 0.65964257 5.9219022 - 378000 68.229282 1000 0.65720396 5.9376101 - 379000 68.623557 1000 0.66304265 5.9533181 - 380000 69.015967 1000 0.67465814 5.969026 - 381000 69.408981 1000 0.68582945 5.984734 - 382000 69.796561 1000 0.69516677 6.000442 - 383000 70.186403 1000 0.69835516 6.0161499 - 384000 70.5765 1000 0.70403284 6.0318579 - 385000 70.966205 1000 0.6955862 6.0475659 - 386000 71.360054 1000 0.704932 6.0632738 - 387000 71.757912 1000 0.71954173 6.0789818 - 388000 72.147544 1000 0.72347529 6.0946897 - 389000 72.535029 1000 0.72738907 6.1103977 - 390000 72.925842 1000 0.74783091 6.1261057 - 391000 73.306871 1000 0.76739039 6.1418136 - 392000 73.692746 1000 0.77184224 6.1575216 - 393000 74.053385 1000 0.76813357 6.1732296 - 394000 74.416323 1000 0.75994091 6.1889375 - 395000 74.777021 1000 0.74970188 6.2046455 - 396000 75.139847 1000 0.7523174 6.2203535 - 397000 75.502888 1000 0.74652931 6.2360614 - 398000 75.865442 1000 0.74418096 6.2517694 - 399000 76.225245 1000 0.75110038 6.2674773 - 400000 76.590032 1000 0.7609274 6.2831853 -Loop time of 76.5901 on 1 procs for 200000 steps with 1000 atoms - -Performance: 10660.735 tau/day, 2611.305 timesteps/s, 2.611 Matom-step/s -99.0% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 8.693 | 8.693 | 8.693 | 0.0 | 11.35 -Neigh | 0.082655 | 0.082655 | 0.082655 | 0.0 | 0.11 -Comm | 1.1618 | 1.1618 | 1.1618 | 0.0 | 1.52 -Output | 0.0052644 | 0.0052644 | 0.0052644 | 0.0 | 0.01 -Modify | 65.713 | 65.713 | 65.713 | 0.0 | 85.80 -Other | | 0.934 | | | 1.22 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 268 ave 268 max 268 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 5015 ave 5015 max 5015 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 5015 -Ave neighs/atom = 5.015 -Neighbor list builds = 163 -Dangerous builds = 0 -Total wall time: 0:01:59 diff --git a/examples/granregion/log.15Sep22.granregion.mixer.g++.4 b/examples/granregion/log.15Sep22.granregion.mixer.g++.4 deleted file mode 100644 index 57c517a063..0000000000 --- a/examples/granregion/log.15Sep22.granregion.mixer.g++.4 +++ /dev/null @@ -1,632 +0,0 @@ -LAMMPS (15 Sep 2022) -variable name string mixer - -thermo_modify flush yes -variable seed equal 14314 - -############################################### -# Particle parameters -################################################ - -variable rlo equal 0.3 -variable rhi equal 0.6 -variable dlo equal 2.0*${rlo} -variable dlo equal 2.0*0.3 -variable dhi equal 2.0*${rhi} -variable dhi equal 2.0*0.6 -variable skin equal ${rhi} -variable skin equal 0.6 - -variable coeffRes equal 0.1 -variable coeffFric equal 0.5 - -variable kn equal 10^5 -variable kt equal 0.2*${kn} -variable kt equal 0.2*100000 - -variable gravity equal 1.0 -variable density equal 1.0 - -variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} -variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 -variable a equal (-2.0*log(${coeffRes})/PI)^2 -variable a equal (-2.0*log(0.1)/PI)^2 -variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) -variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) -variable gamma_t equal ${gamma_n}*0.5 -variable gamma_t equal 806.699778405191*0.5 - -variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) -variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) - -variable dt equal ${tcol}*0.02 -variable dt equal 0.00236257621510454*0.02 -timestep ${dt} -timestep 4.72515243020908e-05 - -############################################### - -variable dumpfreq equal 1000 -variable logfreq equal 1000 - -newton on -atom_style sphere - -boundary p p f - -region boxreg block 0 20 0 20 0 20 -create_box 1 boxreg -Created orthogonal box = (0 0 0) to (20 20 20) - 1 by 2 by 2 MPI processor grid - -pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 -pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 -pair_coeff * * - -neighbor ${skin} multi -neighbor 0.6 multi -thermo ${logfreq} -thermo 1000 - -comm_style brick -comm_modify mode multi group all vel yes -balance 1.1 shift xyz 20 1.1 -Balancing ... -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 20, bins = 1 1 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton on, size, history - pair build: half/size/multi/newton - stencil: half/multi/3d - bin: multi -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:210) -fix bal all balance 10000 1.1 shift xyz 20 1.01 - -####################### Options specific to pouring ######################### - -region insreg cylinder z 10 10 8 10 18 side in units box -region cylreg cylinder z 10 10 10 0 20 side in units box - -variable theta equal (step/400000)*2*PI - -region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box -region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box - -region mixer intersect 3 cylreg b1 b2 side in - -fix grav all gravity ${gravity} vector 0 0 -1 -fix grav all gravity 1 vector 0 0 -1 -fix 1 all nve/sphere - -fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer -fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer - -fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} -fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 -Particle insertion: 444 every 84653 steps, 1000 by step 169307 - -#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z - -#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 -#dump_modify 2 pad 6 - -thermo_style custom step cpu atoms ke v_theta -WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:896) -thermo_modify flush yes lost warn - -run 200000 - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Your simulation uses code contributions which should be cited: - -- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 - -@Article{Intveld08, - author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, - title = {Accurate and Efficient Methods for Modeling Colloidal - Mixtures in an Explicit Solvent using Molecular Dynamics}, - journal = {Comput.\ Phys.\ Commut.}, - year = 2008, - volume = 179, - pages = {320--329} -} - -@article{Shire2020, - author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, - title = {{DEM} Simulations of Polydisperse Media: Efficient Contact - Detection Applied to Investigate the Quasi-Static Limit}, - journal = {Computational Particle Mechanics}, - year = {2020} -} - -CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE - -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 5.816 | 5.816 | 5.816 Mbytes - Step CPU Atoms KinEng v_theta - 0 0 0 -0 0 - 1000 0.089993907 444 -0 0.015707963 - 2000 0.14885989 444 -0 0.031415927 - 3000 0.20954563 444 -0 0.04712389 - 4000 0.27002257 444 -0 0.062831853 - 5000 0.33034347 444 -0 0.078539816 - 6000 0.39049526 444 -0 0.09424778 - 7000 0.45002664 444 -0 0.10995574 - 8000 0.50911338 444 -0 0.12566371 - 9000 0.56771745 444 -0 0.14137167 - 10000 0.62699472 444 -0 0.15707963 - 11000 0.67300351 444 -0 0.1727876 - 12000 0.71981356 444 -0 0.18849556 - 13000 0.76697682 444 -0 0.20420352 - 14000 0.81412229 444 -0 0.21991149 - 15000 0.86284749 444 -0 0.23561945 - 16000 0.91199522 444 -0 0.25132741 - 17000 0.96230663 444 -0 0.26703538 - 18000 1.0118327 444 -0 0.28274334 - 19000 1.0617397 444 -0 0.2984513 - 20000 1.111586 444 -0 0.31415927 - 21000 1.1556637 444 -0 0.32986723 - 22000 1.2005913 444 -0 0.34557519 - 23000 1.2455061 444 -0 0.36128316 - 24000 1.2910181 444 -0 0.37699112 - 25000 1.3370577 444 -0 0.39269908 - 26000 1.383595 444 -0 0.40840704 - 27000 1.430922 444 -0 0.42411501 - 28000 1.478627 444 -0 0.43982297 - 29000 1.5278607 444 -0 0.45553093 - 30000 1.576597 444 -0 0.4712389 - 31000 1.6202694 444 -0 0.48694686 - 32000 1.6646667 444 -0 0.50265482 - 33000 1.7092726 444 -0 0.51836279 - 34000 1.7535573 444 -0 0.53407075 - 35000 1.7985995 444 -0 0.54977871 - 36000 1.8440346 444 -0 0.56548668 - 37000 1.8900841 444 -0 0.58119464 - 38000 1.9368772 444 -0 0.5969026 - 39000 1.9842867 444 -0 0.61261057 - 40000 2.0318482 444 -0 0.62831853 - 41000 2.0753049 444 -0 0.64402649 - 42000 2.1196274 444 -0 0.65973446 - 43000 2.1647071 444 -0 0.67544242 - 44000 2.2101195 444 -0 0.69115038 - 45000 2.2564642 444 -0 0.70685835 - 46000 2.3033573 444 -0 0.72256631 - 47000 2.3500515 444 -0 0.73827427 - 48000 2.3972268 444 -0 0.75398224 - 49000 2.4444727 444 -0 0.7696902 - 50000 2.4921003 444 -0 0.78539816 - 51000 2.535088 444 -0 0.80110613 - 52000 2.5785564 444 -0 0.81681409 - 53000 2.6221392 444 -0 0.83252205 - 54000 2.6664169 444 -0 0.84823002 - 55000 2.7108951 444 -0 0.86393798 - 56000 2.7560522 444 -0 0.87964594 - 57000 2.8010254 444 -0 0.89535391 - 58000 2.8484456 444 -0 0.91106187 - 59000 2.8951674 444 -0 0.92676983 - 60000 2.9424205 444 -0 0.9424778 - 61000 2.9885999 444 -0 0.95818576 - 62000 3.0338676 444 -0 0.97389372 - 63000 3.0793674 444 -0 0.98960169 - 64000 3.1253557 444 -0 1.0053096 - 65000 3.1723823 444 -0 1.0210176 - 66000 3.2203846 444 -0 1.0367256 - 67000 3.2690443 444 -0 1.0524335 - 68000 3.317707 444 -0 1.0681415 - 69000 3.3670196 444 -0 1.0838495 - 70000 3.4160505 444 -0 1.0995574 - 71000 3.4621197 444 -0 1.1152654 - 72000 3.5086434 444 -0 1.1309734 - 73000 3.555691 444 -0 1.1466813 - 74000 3.6032072 444 -0 1.1623893 - 75000 3.6514849 444 -0 1.1780972 - 76000 3.7002713 444 -0 1.1938052 - 77000 3.7497321 444 -0 1.2095132 - 78000 3.7997711 444 -0 1.2252211 - 79000 3.8504338 444 -0 1.2409291 - 80000 3.9020416 444 -0 1.2566371 - 81000 3.9496762 444 -0 1.272345 - 82000 3.9968215 444 -0 1.288053 - 83000 4.04496 444 -0 1.303761 - 84000 4.0936477 444 -0 1.3194689 - 85000 4.1618384 888 -0 1.3351769 - 86000 4.2472086 888 -0 1.3508848 - 87000 4.3322855 888 -0 1.3665928 - 88000 4.4169835 888 -0 1.3823008 - 89000 4.5014588 888 -0 1.3980087 - 90000 4.5861842 888 -0 1.4137167 - 91000 4.653654 888 -0 1.4294247 - 92000 4.7217642 888 -0 1.4451326 - 93000 4.791842 888 -0 1.4608406 - 94000 4.8601789 888 -0 1.4765485 - 95000 4.92849 888 -0 1.4922565 - 96000 4.9976811 888 -0 1.5079645 - 97000 5.0687073 888 -0 1.5236724 - 98000 5.1387234 888 -0 1.5393804 - 99000 5.2086037 888 -0 1.5550884 - 100000 5.2786924 888 -0 1.5707963 - 101000 5.3466895 888 -0 1.5865043 - 102000 5.417132 888 -0 1.6022123 - 103000 5.4865633 888 -0 1.6179202 - 104000 5.5565911 888 -0 1.6336282 - 105000 5.6266394 888 -0 1.6493361 - 106000 5.6975394 888 -0 1.6650441 - 107000 5.7687753 888 -0 1.6807521 - 108000 5.8408498 888 -0 1.69646 - 109000 5.9132618 888 -0 1.712168 - 110000 5.9872629 888 -0 1.727876 - 111000 6.0588115 888 -0 1.7435839 - 112000 6.1308729 888 -0 1.7592919 - 113000 6.2047311 888 -0 1.7749998 - 114000 6.2780757 888 -0 1.7907078 - 115000 6.3528542 888 -0 1.8064158 - 116000 6.4277704 888 -0 1.8221237 - 117000 6.5034683 888 -0 1.8378317 - 118000 6.5795779 888 -0 1.8535397 - 119000 6.655928 888 -0 1.8692476 - 120000 6.7335119 888 -0 1.8849556 - 121000 6.806827 888 -0 1.9006636 - 122000 6.881052 888 -0 1.9163715 - 123000 6.9559647 888 -0 1.9320795 - 124000 7.0300829 888 -0 1.9477874 - 125000 7.1047925 888 -0 1.9634954 - 126000 7.1797025 888 -0 1.9792034 - 127000 7.2556934 888 -0 1.9949113 - 128000 7.3317803 888 -0 2.0106193 - 129000 7.4088096 888 -0 2.0263273 - 130000 7.4862461 888 -0 2.0420352 - 131000 7.5633585 888 -0 2.0577432 - 132000 7.641939 888 -0 2.0734512 - 133000 7.7192741 888 -0 2.0891591 - 134000 7.7970156 888 -0 2.1048671 - 135000 7.8760712 888 -0 2.120575 - 136000 7.9563099 888 -0 2.136283 - 137000 8.0381808 888 -0 2.151991 - 138000 8.1210957 888 -0 2.1676989 - 139000 8.20401 888 -0 2.1834069 - 140000 8.2871705 888 -0 2.1991149 - 141000 8.364321 888 -0 2.2148228 - 142000 8.4426744 888 -0 2.2305308 - 143000 8.5238377 888 -0 2.2462387 - 144000 8.6050517 888 -0 2.2619467 - 145000 8.6865872 888 -0 2.2776547 - 146000 8.767621 888 -0 2.2933626 - 147000 8.8496616 888 -0 2.3090706 - 148000 8.9329599 888 -0 2.3247786 - 149000 9.0165929 888 -0 2.3404865 - 150000 9.1015214 888 -0 2.3561945 - 151000 9.1847289 888 -0 2.3719025 - 152000 9.2689185 888 -0 2.3876104 - 153000 9.3518862 888 -0 2.4033184 - 154000 9.4367057 888 -0 2.4190263 - 155000 9.5227466 888 -0 2.4347343 - 156000 9.6087196 888 -0 2.4504423 - 157000 9.6955661 888 -0 2.4661502 - 158000 9.7838227 888 -0 2.4818582 - 159000 9.8731804 888 -0 2.4975662 - 160000 9.9626648 888 -0 2.5132741 - 161000 10.050473 888 -0 2.5289821 - 162000 10.137725 888 -0 2.54469 - 163000 10.227259 888 -0 2.560398 - 164000 10.318501 888 -0 2.576106 - 165000 10.409218 888 -0 2.5918139 - 166000 10.502055 888 -0 2.6075219 - 167000 10.593786 888 -0 2.6232299 - 168000 10.688536 888 -0 2.6389378 - 169000 10.786033 888 -0 2.6546458 - 170000 10.886377 1000 -0 2.6703538 - 171000 10.987493 1000 -0 2.6860617 - 172000 11.084584 1000 -0 2.7017697 - 173000 11.181502 1000 -0 2.7174776 - 174000 11.28434 1000 -0 2.7331856 - 175000 11.387838 1000 -0 2.7488936 - 176000 11.490915 1000 -0 2.7646015 - 177000 11.595473 1000 -0 2.7803095 - 178000 11.699823 1000 -0 2.7960175 - 179000 11.803927 1000 -0 2.8117254 - 180000 11.90548 1000 -0 2.8274334 - 181000 12.00857 1000 -0 2.8431414 - 182000 12.112787 1000 -0 2.8588493 - 183000 12.217943 1000 -0 2.8745573 - 184000 12.322668 1000 -0 2.8902652 - 185000 12.428332 1000 -0 2.9059732 - 186000 12.535414 1000 -0 2.9216812 - 187000 12.642404 1000 -0 2.9373891 - 188000 12.749332 1000 -0 2.9530971 - 189000 12.856872 1000 -0 2.9688051 - 190000 12.965335 1000 -0 2.984513 - 191000 13.073275 1000 -0 3.000221 - 192000 13.180122 1000 -0 3.0159289 - 193000 13.288112 1000 -0 3.0316369 - 194000 13.394688 1000 -0 3.0473449 - 195000 13.501251 1000 -0 3.0630528 - 196000 13.607472 1000 -0 3.0787608 - 197000 13.71396 1000 -0 3.0944688 - 198000 13.821133 1000 -0 3.1101767 - 199000 13.929192 1000 -0 3.1258847 - 200000 14.036724 1000 -0 3.1415927 -Loop time of 14.0368 on 4 procs for 200000 steps with 1000 atoms - -Performance: 58169.166 tau/day, 14248.307 timesteps/s, 14.248 Matom-step/s -95.5% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.47004 | 0.75698 | 1.1 | 33.1 | 5.39 -Neigh | 0.0078501 | 0.010659 | 0.013902 | 2.7 | 0.08 -Comm | 3.9589 | 4.4102 | 4.9322 | 21.6 | 31.42 -Output | 0.0031054 | 0.0046208 | 0.0069341 | 2.1 | 0.03 -Modify | 6.1829 | 6.8363 | 7.6135 | 24.8 | 48.70 -Other | | 2.018 | | | 14.38 - -Nlocal: 250 ave 260 max 242 min -Histogram: 1 0 1 0 0 1 0 0 0 1 -Nghost: 279.25 ave 325 max 232 min -Histogram: 1 1 0 0 0 0 0 0 1 1 -Neighs: 939.75 ave 1397 max 509 min -Histogram: 2 0 0 0 0 0 0 0 0 2 - -Total # of neighbors = 3759 -Ave neighs/atom = 3.759 -Neighbor list builds = 201 -Dangerous builds = 0 -unfix ins -run 200000 -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Per MPI rank memory allocation (min/avg/max) = 11.87 | 11.88 | 11.89 Mbytes - Step CPU Atoms KinEng v_theta - 200000 0 1000 1.0071568 3.1415927 - 201000 0.099357585 1000 1.0036239 3.1573006 - 202000 0.19922889 1000 0.99846844 3.1730086 - 203000 0.29896537 1000 0.98236169 3.1887165 - 204000 0.39875771 1000 0.98625572 3.2044245 - 205000 0.49759454 1000 0.9893407 3.2201325 - 206000 0.59609243 1000 1.0012123 3.2358404 - 207000 0.69408206 1000 1.0231892 3.2515484 - 208000 0.79216806 1000 1.0265912 3.2672564 - 209000 0.8902274 1000 1.0190202 3.2829643 - 210000 0.98909509 1000 1.0267754 3.2986723 - 211000 1.0882901 1000 1.0186847 3.3143802 - 212000 1.1895753 1000 1.0159848 3.3300882 - 213000 1.2891277 1000 0.99326329 3.3457962 - 214000 1.387486 1000 0.97263135 3.3615041 - 215000 1.4850078 1000 0.97246409 3.3772121 - 216000 1.58405 1000 0.96000626 3.3929201 - 217000 1.6853829 1000 0.95730432 3.408628 - 218000 1.7911163 1000 0.95605591 3.424336 - 219000 1.8974141 1000 0.94983 3.440044 - 220000 2.0029829 1000 0.95291888 3.4557519 - 221000 2.108723 1000 0.93612997 3.4714599 - 222000 2.2151561 1000 0.93414081 3.4871678 - 223000 2.3220866 1000 0.93321246 3.5028758 - 224000 2.4285504 1000 0.93026943 3.5185838 - 225000 2.5356173 1000 0.930478 3.5342917 - 226000 2.6415516 1000 0.92909096 3.5499997 - 227000 2.747634 1000 0.92308495 3.5657077 - 228000 2.8524082 1000 0.91075986 3.5814156 - 229000 2.9570172 1000 0.9006662 3.5971236 - 230000 3.0627535 1000 0.88869212 3.6128316 - 231000 3.1683919 1000 0.8877611 3.6285395 - 232000 3.2749534 1000 0.89409636 3.6442475 - 233000 3.3824185 1000 0.90866091 3.6599554 - 234000 3.4917899 1000 0.90454601 3.6756634 - 235000 3.6009156 1000 0.89408327 3.6913714 - 236000 3.7111309 1000 0.8881044 3.7070793 - 237000 3.8197619 1000 0.89322168 3.7227873 - 238000 3.9302291 1000 0.89018045 3.7384953 - 239000 4.0407242 1000 0.88771268 3.7542032 - 240000 4.1521989 1000 0.88957717 3.7699112 - 241000 4.2639861 1000 0.89362036 3.7856191 - 242000 4.3782856 1000 0.90967472 3.8013271 - 243000 4.4925107 1000 0.91366381 3.8170351 - 244000 4.6057342 1000 0.9150959 3.832743 - 245000 4.7199383 1000 0.92725789 3.848451 - 246000 4.8346784 1000 0.93024722 3.864159 - 247000 4.9515438 1000 0.93297974 3.8798669 - 248000 5.0696512 1000 0.94755869 3.8955749 - 249000 5.1838845 1000 0.94761679 3.9112829 - 250000 5.297991 1000 0.92701064 3.9269908 - 251000 5.412562 1000 0.91365252 3.9426988 - 252000 5.5274859 1000 0.90918381 3.9584067 - 253000 5.6418647 1000 0.90612685 3.9741147 - 254000 5.7593721 1000 0.90352142 3.9898227 - 255000 5.8759086 1000 0.90421567 4.0055306 - 256000 5.993588 1000 0.90024688 4.0212386 - 257000 6.1142027 1000 0.88540341 4.0369466 - 258000 6.2318882 1000 0.87890423 4.0526545 - 259000 6.3502765 1000 0.86833748 4.0683625 - 260000 6.4677878 1000 0.85465694 4.0840704 - 261000 6.5875341 1000 0.83941242 4.0997784 - 262000 6.7063481 1000 0.81790404 4.1154864 - 263000 6.8249742 1000 0.82284562 4.1311943 - 264000 6.9421188 1000 0.80961447 4.1469023 - 265000 7.0588866 1000 0.80567073 4.1626103 - 266000 7.1763855 1000 0.79577448 4.1783182 - 267000 7.295632 1000 0.78489106 4.1940262 - 268000 7.4144463 1000 0.77348757 4.2097342 - 269000 7.5333839 1000 0.76606696 4.2254421 - 270000 7.6527119 1000 0.7649744 4.2411501 - 271000 7.7704222 1000 0.76050309 4.256858 - 272000 7.8903012 1000 0.75378759 4.272566 - 273000 8.0106197 1000 0.75633811 4.288274 - 274000 8.1309707 1000 0.75703106 4.3039819 - 275000 8.2522837 1000 0.75227453 4.3196899 - 276000 8.3730898 1000 0.76003902 4.3353979 - 277000 8.4955037 1000 0.76274661 4.3511058 - 278000 8.6153206 1000 0.75888482 4.3668138 - 279000 8.7339569 1000 0.75071875 4.3825218 - 280000 8.8515447 1000 0.75454927 4.3982297 - 281000 8.9685253 1000 0.75617824 4.4139377 - 282000 9.0856168 1000 0.75230835 4.4296456 - 283000 9.2018894 1000 0.75417571 4.4453536 - 284000 9.3179777 1000 0.74559345 4.4610616 - 285000 9.4341721 1000 0.73274661 4.4767695 - 286000 9.5498722 1000 0.72385193 4.4924775 - 287000 9.6651326 1000 0.72398899 4.5081855 - 288000 9.7810274 1000 0.72009027 4.5238934 - 289000 9.8959471 1000 0.72026686 4.5396014 - 290000 10.010007 1000 0.72330145 4.5553093 - 291000 10.123304 1000 0.71630656 4.5710173 - 292000 10.238277 1000 0.71089192 4.5867253 - 293000 10.351465 1000 0.70584923 4.6024332 - 294000 10.464794 1000 0.71350398 4.6181412 - 295000 10.57818 1000 0.72781836 4.6338492 - 296000 10.692249 1000 0.72285512 4.6495571 - 297000 10.80741 1000 0.71649517 4.6652651 - 298000 10.923694 1000 0.71132209 4.6809731 - 299000 11.039173 1000 0.73602072 4.696681 - 300000 11.157002 1000 0.74400837 4.712389 - 301000 11.272462 1000 0.76618562 4.7280969 - 302000 11.386581 1000 0.77476041 4.7438049 - 303000 11.499191 1000 0.77124283 4.7595129 - 304000 11.611585 1000 0.7625748 4.7752208 - 305000 11.725012 1000 0.74979361 4.7909288 - 306000 11.838032 1000 0.74515733 4.8066368 - 307000 11.949194 1000 0.74302741 4.8223447 - 308000 12.060586 1000 0.73732959 4.8380527 - 309000 12.171445 1000 0.73368237 4.8537606 - 310000 12.283518 1000 0.72374292 4.8694686 - 311000 12.393447 1000 0.72107784 4.8851766 - 312000 12.505136 1000 0.72944426 4.9008845 - 313000 12.616959 1000 0.73958637 4.9165925 - 314000 12.730312 1000 0.75160847 4.9323005 - 315000 12.846163 1000 0.74419683 4.9480084 - 316000 12.960328 1000 0.74652593 4.9637164 - 317000 13.073994 1000 0.74933482 4.9794244 - 318000 13.186549 1000 0.74200509 4.9951323 - 319000 13.296925 1000 0.7346024 5.0108403 - 320000 13.406825 1000 0.72806145 5.0265482 - 321000 13.51703 1000 0.72147888 5.0422562 - 322000 13.628261 1000 0.71460041 5.0579642 - 323000 13.74063 1000 0.70255075 5.0736721 - 324000 13.853826 1000 0.70640327 5.0893801 - 325000 13.968533 1000 0.70643428 5.1050881 - 326000 14.081456 1000 0.69751794 5.120796 - 327000 14.195505 1000 0.69035108 5.136504 - 328000 14.310048 1000 0.68068243 5.152212 - 329000 14.426048 1000 0.69123492 5.1679199 - 330000 14.543349 1000 0.70326515 5.1836279 - 331000 14.662021 1000 0.70551726 5.1993358 - 332000 14.782194 1000 0.70514444 5.2150438 - 333000 14.901573 1000 0.71102045 5.2307518 - 334000 15.020642 1000 0.71336747 5.2464597 - 335000 15.136739 1000 0.70816388 5.2621677 - 336000 15.252554 1000 0.69502472 5.2778757 - 337000 15.368496 1000 0.69314289 5.2935836 - 338000 15.483744 1000 0.68565794 5.3092916 - 339000 15.599584 1000 0.67268053 5.3249995 - 340000 15.717342 1000 0.68313196 5.3407075 - 341000 15.835594 1000 0.68782815 5.3564155 - 342000 15.954546 1000 0.6989326 5.3721234 - 343000 16.074184 1000 0.694926 5.3878314 - 344000 16.193902 1000 0.7006474 5.4035394 - 345000 16.314878 1000 0.70783177 5.4192473 - 346000 16.434704 1000 0.71334276 5.4349553 - 347000 16.554708 1000 0.72917419 5.4506633 - 348000 16.673034 1000 0.74315705 5.4663712 - 349000 16.791269 1000 0.76731311 5.4820792 - 350000 16.912554 1000 0.79761434 5.4977871 - 351000 17.03323 1000 0.80447724 5.5134951 - 352000 17.155644 1000 0.80118728 5.5292031 - 353000 17.281134 1000 0.77990459 5.544911 - 354000 17.406672 1000 0.76453299 5.560619 - 355000 17.532346 1000 0.76538392 5.576327 - 356000 17.657256 1000 0.76310698 5.5920349 - 357000 17.782477 1000 0.75897095 5.6077429 - 358000 17.909642 1000 0.75071115 5.6234508 - 359000 18.035032 1000 0.74034801 5.6391588 - 360000 18.160696 1000 0.72671924 5.6548668 - 361000 18.285089 1000 0.72111017 5.6705747 - 362000 18.408849 1000 0.71875181 5.6862827 - 363000 18.533901 1000 0.71469706 5.7019907 - 364000 18.659326 1000 0.70470493 5.7176986 - 365000 18.784109 1000 0.70863047 5.7334066 - 366000 18.911344 1000 0.70850561 5.7491146 - 367000 19.039756 1000 0.71413452 5.7648225 - 368000 19.169907 1000 0.71314184 5.7805305 - 369000 19.299066 1000 0.71309549 5.7962384 - 370000 19.428116 1000 0.71132937 5.8119464 - 371000 19.553027 1000 0.70788039 5.8276544 - 372000 19.678121 1000 0.71780071 5.8433623 - 373000 19.804465 1000 0.72352571 5.8590703 - 374000 19.92949 1000 0.71723739 5.8747783 - 375000 20.053554 1000 0.71556941 5.8904862 - 376000 20.177991 1000 0.70935312 5.9061942 - 377000 20.301972 1000 0.71551157 5.9219022 - 378000 20.427612 1000 0.7235163 5.9376101 - 379000 20.554742 1000 0.73896421 5.9533181 - 380000 20.680899 1000 0.74906169 5.969026 - 381000 20.805515 1000 0.75303336 5.984734 - 382000 20.931483 1000 0.75359492 6.000442 - 383000 21.05731 1000 0.75579354 6.0161499 - 384000 21.184712 1000 0.75178368 6.0318579 - 385000 21.310667 1000 0.74412159 6.0475659 - 386000 21.433509 1000 0.7360955 6.0632738 - 387000 21.554251 1000 0.73461103 6.0789818 - 388000 21.674477 1000 0.72496617 6.0946897 - 389000 21.794698 1000 0.7219047 6.1103977 - 390000 21.914083 1000 0.71837013 6.1261057 - 391000 22.033188 1000 0.71495923 6.1418136 - 392000 22.152689 1000 0.71436707 6.1575216 - 393000 22.271183 1000 0.71447834 6.1732296 - 394000 22.389775 1000 0.71334298 6.1889375 - 395000 22.509106 1000 0.71510229 6.2046455 - 396000 22.628068 1000 0.7121714 6.2203535 - 397000 22.746926 1000 0.70818894 6.2360614 - 398000 22.865086 1000 0.70059455 6.2517694 - 399000 22.982394 1000 0.69960089 6.2674773 - 400000 23.100381 1000 0.70261998 6.2831853 -Loop time of 23.1004 on 4 procs for 200000 steps with 1000 atoms - -Performance: 35345.963 tau/day, 8657.854 timesteps/s, 8.658 Matom-step/s -92.9% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.263 | 2.1388 | 3.0295 | 58.6 | 9.26 -Neigh | 0.012633 | 0.017793 | 0.023147 | 3.7 | 0.08 -Comm | 7.8521 | 9.0474 | 10.284 | 39.6 | 39.17 -Output | 0.0029549 | 0.004916 | 0.0068506 | 2.0 | 0.02 -Modify | 8.3635 | 9.8066 | 11.142 | 41.0 | 42.45 -Other | | 2.085 | | | 9.03 - -Nlocal: 250 ave 258 max 241 min -Histogram: 1 0 0 0 1 0 0 1 0 1 -Nghost: 412 ave 492 max 332 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 1258.5 ave 1588 max 953 min -Histogram: 2 0 0 0 0 0 0 0 1 1 - -Total # of neighbors = 5034 -Ave neighs/atom = 5.034 -Neighbor list builds = 159 -Dangerous builds = 0 -Total wall time: 0:00:37 diff --git a/examples/granregion/log.16Mar23.granregion.box.g++.1 b/examples/granregion/log.16Mar23.granregion.box.g++.1 new file mode 100644 index 0000000000..b7bdeda1d4 --- /dev/null +++ b/examples/granregion/log.16Mar23.granregion.box.g++.1 @@ -0,0 +1,484 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# pouring spheres into container box + +units lj +atom_style sphere +boundary f f f +dimension 3 +comm_modify vel yes + +region box block -10 10 -10 10 -10 10 units box +create_box 2 box +Created orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 1 by 1 MPI processor grid + +pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 +pair_coeff * * gran/hooke + +region container block -6 6 -6 6 -6 6 units box +fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 2 all nve/sphere +fix 3 all gravity 1.0 vector 0 0 -1 + +region slab block -2 2 -2 2 -2 2 units box +fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore +Particle insertion: 48 every 566 steps, 100 by step 1133 + +timestep 0.005 + +compute 1 all temp +compute_modify 1 dynamic/dof yes + +compute 2 all temp/sphere +compute_modify 2 dynamic/dof yes + +thermo 100 +thermo_style custom step atoms temp c_1 c_2 press +thermo_modify lost ignore +compute_modify thermo_temp dynamic/dof yes + +#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 +#dump_modify 2 pad 5 + +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 1.3 + binsize = 0.65, bins = 31 31 31 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke, perpetual + attributes: half, newton on, size + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.5861 | 0.5861 | 0.5861 Mbytes + Step Atoms Temp c_1 c_2 Press + 0 0 0 0 0 0 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 100 30 0.803783 0.803783 0.39507978 0.0029137134 + 200 30 1.1967995 1.1967995 0.5882574 0.0043383984 + 300 30 1.2814686 1.2814686 0.62987441 0.0046453238 + 400 30 0.82331082 0.82331082 0.41173176 0.0029845017 + 500 30 0.7708462 0.7708462 0.38777784 0.0043831147 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 600 64 0.51564897 0.51564897 0.26631577 0.0040059368 + 700 64 0.57239348 0.57239348 0.29566901 0.0045075987 + 800 64 0.61837087 0.61837087 0.32195387 0.0048123564 + 900 64 0.53061888 0.53061888 0.28564763 0.0055906552 + 1000 64 0.496299 0.496299 0.26801572 0.0061169128 + 1100 64 0.46068308 0.46068308 0.24699057 0.0055717699 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 1200 99 0.39206225 0.39206225 0.21356546 0.0066294211 + 1300 99 0.38624966 0.38624966 0.21345854 0.0049051051 + 1400 99 0.35615284 0.35615284 0.19785725 0.0046170772 + 1500 99 0.31486693 0.31486693 0.17429055 0.0064903432 + 1600 99 0.26369001 0.26369001 0.15095266 0.0045226847 + 1700 100 0.1925923 0.1925923 0.11308104 0.007362313 + 1800 100 0.13724978 0.13724978 0.083276845 0.0058136373 + 1900 100 0.077212636 0.077212636 0.053159386 0.0016509598 + 2000 100 0.065294031 0.065294031 0.04372752 0.0020346467 + 2100 100 0.057431398 0.057431398 0.037977068 0.0012681098 + 2200 100 0.059093045 0.059093045 0.037435193 0.00096610799 + 2300 100 0.03422338 0.03422338 0.025491304 0.00069886052 + 2400 100 0.020558284 0.020558284 0.016163009 0.0017260663 + 2500 100 0.015339709 0.015339709 0.012329236 0.00041308031 + 2600 100 0.012891354 0.012891354 0.009766054 0.00030356722 + 2700 100 0.0092634449 0.0092634449 0.0073580108 0.00077723051 + 2800 100 0.0073925841 0.0073925841 0.0059932218 0.00016466767 + 2900 100 0.0081228267 0.0081228267 0.006281761 0.00013828388 + 3000 100 0.0041833223 0.0041833223 0.0035147096 0.00013160599 + 3100 100 0.0035930775 0.0035930775 0.0030039922 0.00060639771 + 3200 100 0.0030824465 0.0030824465 0.0026541293 0.00047391014 + 3300 100 0.0035087522 0.0035087522 0.0027664508 0.00014080317 + 3400 100 0.0018537868 0.0018537868 0.0017099705 6.3326674e-05 + 3500 100 0.0015371228 0.0015371228 0.0014155433 0.00021612522 + 3600 100 0.001708556 0.001708556 0.0014369892 8.1034202e-05 + 3700 100 0.00095948652 0.00095948652 0.0009788528 3.4694023e-05 + 3800 100 0.00091875668 0.00091875668 0.00086805146 3.9373686e-05 + 3900 100 0.001557068 0.001557068 0.001159526 2.5178607e-05 + 4000 100 0.00062012451 0.00062012451 0.00066806922 5.6680551e-06 + 4100 100 0.00060940771 0.00060940771 0.00065614741 1.0137901e-05 + 4200 100 0.00059538437 0.00059538437 0.00064501521 7.3679744e-06 + 4300 100 0.00052946048 0.00052946048 0.00059353641 5.9225081e-06 + 4400 100 0.00051202281 0.00051202281 0.00057524772 3.6198435e-05 + 4500 100 0.00049986632 0.00049986632 0.00055754521 2.2275519e-05 + 4600 100 0.00048187334 0.00048187334 0.00053988815 2.2015243e-05 + 4700 100 0.00045261491 0.00045261491 0.00050298355 8.9681339e-05 + 4800 100 0.00034965427 0.00034965427 0.0004278781 1.0983535e-05 + 4900 100 0.00033555621 0.00033555621 0.00041435167 2.9266598e-05 + 5000 100 0.00031387148 0.00031387148 0.00039605781 2.5628425e-05 +Loop time of 0.073938 on 1 procs for 5000 steps with 100 atoms + +Performance: 29213677.752 tau/day, 67624.254 timesteps/s, 6.762 Matom-step/s +98.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0084547 | 0.0084547 | 0.0084547 | 0.0 | 11.43 +Neigh | 0.011399 | 0.011399 | 0.011399 | 0.0 | 15.42 +Comm | 0.00077205 | 0.00077205 | 0.00077205 | 0.0 | 1.04 +Output | 0.00042663 | 0.00042663 | 0.00042663 | 0.0 | 0.58 +Modify | 0.049692 | 0.049692 | 0.049692 | 0.0 | 67.21 +Other | | 0.003194 | | | 4.32 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 164 ave 164 max 164 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 164 +Ave neighs/atom = 1.64 +Neighbor list builds = 281 +Dangerous builds = 0 + +region container delete +variable theta equal (step-5000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +WARNING: Region properties for region container changed between runs, resetting its motion (src/GRANULAR/fix_wall_gran_region.cpp:101) +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 5000 100 0.00031387148 0.00031387148 0.00039605781 2.6174978e-05 + 5100 100 0.54537023 0.54537023 0.30042175 0.0087427352 + 5200 100 0.57210852 0.57210852 0.3192468 0.0098134067 + 5300 100 0.7168108 0.7168108 0.38577893 0.011004584 + 5400 100 0.78895524 0.78895524 0.41889428 0.013555713 + 5500 100 0.87797874 0.87797874 0.45689223 0.01565356 + 5600 100 0.95424379 0.95424379 0.48830429 0.014707858 + 5700 100 1.0046012 1.0046012 0.51054927 0.01469179 + 5800 100 1.0371453 1.0371453 0.5262568 0.015576788 + 5900 100 1.0545743 1.0545743 0.5361173 0.01589889 + 6000 100 1.0932949 1.0932949 0.55402214 0.017484573 + 6100 100 1.1148364 1.1148364 0.56241126 0.01721788 + 6200 100 1.1315267 1.1315267 0.57050887 0.017961246 + 6300 100 1.1506124 1.1506124 0.58009471 0.017159062 + 6400 100 1.1663328 1.1663328 0.5876586 0.017935311 + 6500 100 1.1821086 1.1821086 0.59595161 0.018005316 + 6600 100 1.2039397 1.2039397 0.60567523 0.021604661 + 6700 100 1.2269912 1.2269912 0.61770225 0.018907995 + 6800 100 1.2447034 1.2447034 0.62576519 0.020537655 + 6900 100 1.2625323 1.2625323 0.63486698 0.02010613 + 7000 100 1.2617127 1.2617127 0.63318163 0.019670429 + 7100 100 1.260715 1.260715 0.63311254 0.01981063 + 7200 100 1.2790404 1.2790404 0.64079 0.020218912 + 7300 100 1.2760228 1.2760228 0.6395331 0.021749952 + 7400 100 1.2799657 1.2799657 0.64139078 0.020472917 + 7500 100 1.2846472 1.2846472 0.64343076 0.020610029 + 7600 100 1.2883963 1.2883963 0.6449186 0.020748906 + 7700 100 1.2926891 1.2926891 0.64684538 0.020599574 + 7800 100 1.3033565 1.3033565 0.65126214 0.021822145 + 7900 100 1.3025797 1.3025797 0.65069472 0.02121384 + 8000 100 1.3052551 1.3052551 0.65209898 0.021398725 + 8100 100 1.3069868 1.3069868 0.65304899 0.021246465 + 8200 100 1.3091964 1.3091964 0.65438143 0.021222398 + 8300 100 1.3101277 1.3101277 0.65518554 0.021329556 + 8400 100 1.3117162 1.3117162 0.65551056 0.021468306 + 8500 100 1.3143892 1.3143892 0.65683087 0.021610874 + 8600 100 1.3164123 1.3164123 0.65789423 0.021564818 + 8700 100 1.3186854 1.3186854 0.65914031 0.021745193 + 8800 100 1.3216944 1.3216944 0.66041385 0.022178553 + 8900 100 1.3207558 1.3207558 0.65988071 0.021810027 + 9000 100 1.3213131 1.3213131 0.66020938 0.021890893 + 9100 100 1.3224905 1.3224905 0.66088289 0.021824994 + 9200 100 1.3240681 1.3240681 0.66183168 0.021784616 + 9300 100 1.3254174 1.3254174 0.66279883 0.021664485 + 9400 100 1.3326916 1.3326916 0.66633358 0.021979709 + 9500 100 1.3405062 1.3405062 0.66975745 0.022238702 + 9600 100 1.3363695 1.3363695 0.66742377 0.022104646 + 9700 100 1.3363391 1.3363391 0.6673032 0.022066628 + 9800 100 1.334875 1.334875 0.6665532 0.021902669 + 9900 100 1.3339805 1.3339805 0.66614358 0.022018971 + 10000 100 1.3337897 1.3337897 0.66609803 0.022184385 +Loop time of 0.213875 on 1 procs for 5000 steps with 100 atoms + +Performance: 10099379.673 tau/day, 23378.194 timesteps/s, 2.338 Matom-step/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.031863 | 0.031863 | 0.031863 | 0.0 | 14.90 +Neigh | 0.026844 | 0.026844 | 0.026844 | 0.0 | 12.55 +Comm | 0.0011059 | 0.0011059 | 0.0011059 | 0.0 | 0.52 +Output | 0.00072907 | 0.00072907 | 0.00072907 | 0.0 | 0.34 +Modify | 0.14874 | 0.14874 | 0.14874 | 0.0 | 69.54 +Other | | 0.004595 | | | 2.15 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 186 ave 186 max 186 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 186 +Ave neighs/atom = 1.86 +Neighbor list builds = 626 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 10000 100 1.3337897 1.3337897 0.66609803 0.022303323 + 10100 100 0.29960521 0.29960521 0.17535846 0.0099382421 + 10200 100 0.15737069 0.15737069 0.1024212 0.0045555648 + 10300 100 0.087501771 0.087501771 0.070895975 0.00093482858 + 10400 100 0.069967301 0.069967301 0.059253397 0.0008760803 + 10500 100 0.056137153 0.056137153 0.047810947 0.0009202993 + 10600 100 0.046835352 0.046835352 0.039400006 0.0011343063 + 10700 100 0.035422167 0.035422167 0.030746587 0.00081816474 + 10800 100 0.029180739 0.029180739 0.02627693 0.00039292712 + 10900 100 0.025094915 0.025094915 0.023244435 0.00044742245 + 11000 100 0.018014893 0.018014893 0.016862375 0.00017018411 + 11100 100 0.014549072 0.014549072 0.014551468 0.00020988549 + 11200 100 0.012586232 0.012586232 0.012569333 0.00019035396 + 11300 100 0.01003586 0.01003586 0.010253286 0.0004598214 + 11400 100 0.0067515743 0.0067515743 0.0069569741 0.00040592883 + 11500 100 0.0057834612 0.0057834612 0.0060790719 0.00013993531 + 11600 100 0.005496335 0.005496335 0.0056855922 0.00013419698 + 11700 100 0.0051524178 0.0051524178 0.0053354591 7.4388594e-05 + 11800 100 0.004911096 0.004911096 0.0051415984 0.00010665621 + 11900 100 0.004687138 0.004687138 0.0049520306 6.7492552e-05 + 12000 100 0.0041516495 0.0041516495 0.0044351666 4.3841199e-05 + 12100 100 0.0033948026 0.0033948026 0.0036851466 4.2010682e-05 + 12200 100 0.0029584231 0.0029584231 0.0031151054 5.1583068e-05 + 12300 100 0.0028401114 0.0028401114 0.0030094644 4.5499489e-05 + 12400 100 0.002650861 0.002650861 0.0027699066 0.00015370263 + 12500 100 0.0026018053 0.0026018053 0.0027178583 3.219734e-05 + 12600 100 0.0025788693 0.0025788693 0.0026939358 3.6615314e-05 + 12700 100 0.0024798907 0.0024798907 0.0026181033 3.0688648e-05 + 12800 100 0.0023930719 0.0023930719 0.0025491721 7.5200629e-05 + 12900 100 0.0022100795 0.0022100795 0.0024231125 2.3210159e-05 + 13000 100 0.0021267492 0.0021267492 0.0023312893 2.463758e-05 + 13100 100 0.0020732193 0.0020732193 0.0022673707 2.5656089e-05 + 13200 100 0.0020010659 0.0020010659 0.0021834293 2.4913608e-05 + 13300 100 0.0019645929 0.0019645929 0.0021311636 6.8209063e-05 + 13400 100 0.0019236711 0.0019236711 0.0020928899 2.3805429e-05 + 13500 100 0.001857137 0.001857137 0.0020387354 3.1316165e-05 + 13600 100 0.0018399111 0.0018399111 0.0020204586 2.27689e-05 + 13700 100 0.0016240252 0.0016240252 0.0017492695 0.00023180963 + 13800 100 0.0015856393 0.0015856393 0.0017164012 4.2480373e-05 + 13900 100 0.0014770352 0.0014770352 0.001571278 2.3192512e-05 + 14000 100 0.0013712974 0.0013712974 0.0014839763 4.7410142e-05 + 14100 100 0.0012396318 0.0012396318 0.0013778109 1.3867692e-05 + 14200 100 0.0011502319 0.0011502319 0.0012780584 0.00018410725 + 14300 100 0.0011020896 0.0011020896 0.0012348357 7.8122446e-05 + 14400 100 0.0010486644 0.0010486644 0.0011483239 0.00015074963 + 14500 100 0.00094167471 0.00094167471 0.0010033809 1.9550083e-05 + 14600 100 0.00080775791 0.00080775791 0.00087434944 4.6043659e-05 + 14700 100 0.00076176039 0.00076176039 0.00083462461 8.1916038e-05 + 14800 100 0.00073637901 0.00073637901 0.00081306941 9.1126903e-06 + 14900 100 0.00072682383 0.00072682383 0.00079396231 8.9944449e-06 + 15000 100 0.00070207518 0.00070207518 0.00077168127 2.2155171e-05 +Loop time of 0.0756704 on 1 procs for 5000 steps with 100 atoms + +Performance: 28544845.995 tau/day, 66076.032 timesteps/s, 6.608 Matom-step/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0079484 | 0.0079484 | 0.0079484 | 0.0 | 10.50 +Neigh | 0.0043035 | 0.0043035 | 0.0043035 | 0.0 | 5.69 +Comm | 0.00064796 | 0.00064796 | 0.00064796 | 0.0 | 0.86 +Output | 0.00044137 | 0.00044137 | 0.00044137 | 0.0 | 0.58 +Modify | 0.059329 | 0.059329 | 0.059329 | 0.0 | 78.40 +Other | | 0.003 | | | 3.97 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 165 ave 165 max 165 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 165 +Ave neighs/atom = 1.65 +Neighbor list builds = 101 +Dangerous builds = 0 + +region container delete +variable theta equal (step-15000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 15000 100 0.00070207518 0.00070207518 0.00077168127 2.0192237e-05 + 15100 100 1.1160127 1.1160127 0.69939857 0.01822663 + 15200 100 1.2546016 1.2546016 0.78819474 0.017013321 + 15300 100 1.1930613 1.1930613 0.77429911 0.015607175 + 15400 100 1.3791371 1.3791371 0.87875984 0.018478669 + 15500 100 1.6063158 1.6063158 0.98587325 0.027330546 + 15600 100 1.7719925 1.7719925 1.0773314 0.025651867 + 15700 100 1.8053439 1.8053439 1.0934572 0.033790716 + 15800 100 1.959016 1.959016 1.1465659 0.033715025 + 15900 100 2.1365654 2.1365654 1.2217718 0.03009529 + 16000 100 2.2883378 2.2883378 1.2768504 0.030582689 + 16100 100 2.4384012 2.4384012 1.3513708 0.031435936 + 16200 100 2.3571308 2.3571308 1.29989 0.034824253 + 16300 100 2.4671092 2.4671092 1.3516798 0.032364282 + 16400 100 2.4411936 2.4411936 1.3385743 0.031890134 + 16500 100 2.4930545 2.4930545 1.3635435 0.032601452 + 16600 100 2.5771906 2.5771906 1.4113993 0.034547128 + 16700 100 2.723199 2.723199 1.4769168 0.036582811 + 16800 100 2.8616886 2.8616886 1.5379462 0.036224198 + 16900 100 2.9517942 2.9517942 1.5872824 0.038757052 + 17000 100 3.0150335 3.0150335 1.6337001 0.044031411 + 17100 100 3.2211536 3.2211536 1.7374532 0.041483093 + 17200 100 3.2509982 3.2509982 1.7512835 0.042718835 + 17300 100 3.262348 3.262348 1.7648674 0.049291835 + 17400 100 3.4050702 3.4050702 1.8352043 0.04435958 + 17500 100 3.5236051 3.5236051 1.9003369 0.045640904 + 17600 100 3.4005287 3.4005287 1.8404347 0.044832295 + 17700 100 3.3190992 3.3190992 1.8154147 0.046365998 + 17800 100 3.2981138 3.2981138 1.811389 0.04607132 + 17900 100 3.2839466 3.2839466 1.7863773 0.045628167 + 18000 100 3.1519747 3.1519747 1.7382103 0.041739193 + 18100 100 3.1205305 3.1205305 1.7101547 0.043511342 + 18200 100 3.2014874 3.2014874 1.746745 0.04452173 + 18300 100 3.2739622 3.2739622 1.7796276 0.041345823 + 18400 100 3.3157359 3.3157359 1.8158932 0.047414 + 18500 100 3.5592096 3.5592096 1.9307695 0.046458132 + 18600 100 3.6594352 3.6594352 1.9851626 0.046396953 + 18700 100 3.6392917 3.6392917 1.9701361 0.047272883 + 18800 100 3.8490892 3.8490892 2.0832481 0.052344106 + 18900 100 3.8465732 3.8465732 2.0790411 0.054203126 + 19000 100 4.010008 4.010008 2.1620722 0.054242542 + 19100 100 4.0417392 4.0417392 2.168506 0.066484948 + 19200 100 3.8791541 3.8791541 2.0791914 0.060788142 + 19300 100 4.1023603 4.1023603 2.1944127 0.056461298 + 19400 100 4.1294375 4.1294375 2.2009649 0.061099665 + 19500 100 3.9274112 3.9274112 2.0877398 0.066068401 + 19600 100 4.066229 4.066229 2.1678487 0.055961003 + 19700 100 3.9829257 3.9829257 2.1184329 0.061961838 + 19800 100 4.0303258 4.0303258 2.14544 0.053667616 + 19900 100 3.9385166 3.9385166 2.1074364 0.060804382 + 20000 100 3.8534401 3.8534401 2.0796496 0.057588336 +Loop time of 0.167801 on 1 procs for 5000 steps with 100 atoms + +Performance: 12872385.064 tau/day, 29797.188 timesteps/s, 2.980 Matom-step/s +99.1% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.013849 | 0.013849 | 0.013849 | 0.0 | 8.25 +Neigh | 0.038108 | 0.038108 | 0.038108 | 0.0 | 22.71 +Comm | 0.0011352 | 0.0011352 | 0.0011352 | 0.0 | 0.68 +Output | 0.00073125 | 0.00073125 | 0.00073125 | 0.0 | 0.44 +Modify | 0.10927 | 0.10927 | 0.10927 | 0.0 | 65.12 +Other | | 0.004703 | | | 2.80 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 157 ave 157 max 157 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 157 +Ave neighs/atom = 1.57 +Neighbor list builds = 914 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.837 | 5.837 | 5.837 Mbytes + Step Atoms Temp c_1 c_2 Press + 20000 100 3.8534401 3.8534401 2.0796496 0.057176513 + 20100 100 1.2993548 1.2993548 0.81360425 0.016153186 + 20200 100 1.0761427 1.0761427 0.68479926 0.014383682 + 20300 100 0.95889127 0.95889127 0.61193887 0.01314653 + 20400 100 0.89684043 0.89684043 0.57475851 0.011106613 + 20500 100 0.85901565 0.85901565 0.54372093 0.015717834 + 20600 100 0.98438384 0.98438384 0.6079212 0.013965815 + 20700 100 1.1061789 1.1061789 0.66511277 0.013698526 + 20800 100 1.0615292 1.0615292 0.6269413 0.014496973 + 20900 100 0.92980037 0.92980037 0.54727184 0.014568574 + 21000 100 0.71248123 0.71248123 0.41945517 0.01199152 + 21100 100 0.34785801 0.34785801 0.21699877 0.0062324631 + 21200 100 0.2452514 0.2452514 0.15265503 0.0041094159 + 21300 100 0.22937209 0.22937209 0.13988978 0.0034016589 + 21400 100 0.17765021 0.17765021 0.11334596 0.0024169343 + 21500 100 0.11484505 0.11484505 0.078119393 0.0020987046 + 21600 100 0.077564645 0.077564645 0.056175123 0.002107237 + 21700 100 0.049571519 0.049571519 0.039920177 0.00099127481 + 21800 100 0.0403125 0.0403125 0.032827882 0.00074671903 + 21900 100 0.02735168 0.02735168 0.023877339 0.0018186225 + 22000 100 0.02218474 0.02218474 0.01893178 0.00061438633 + 22100 100 0.021701103 0.021701103 0.0179008 0.00068071664 + 22200 100 0.01777321 0.01777321 0.014521817 0.00045296506 + 22300 100 0.016056338 0.016056338 0.01280709 0.00038192299 + 22400 100 0.013344054 0.013344054 0.010788852 0.0002617289 + 22500 100 0.011625836 0.011625836 0.0094362641 0.00045947089 + 22600 100 0.0068875777 0.0068875777 0.0058858647 0.00028566999 + 22700 100 0.0054081662 0.0054081662 0.0049545239 0.00029291503 + 22800 100 0.0045080107 0.0045080107 0.0042362636 0.00015217816 + 22900 100 0.0038090552 0.0038090552 0.0036905284 0.00049430003 + 23000 100 0.003551951 0.003551951 0.0033639677 0.00022478393 + 23100 100 0.0033854012 0.0033854012 0.00317485 0.00015179604 + 23200 100 0.0032951003 0.0032951003 0.0029760374 0.00015363208 + 23300 100 0.0022995179 0.0022995179 0.0023224311 0.00018791799 + 23400 100 0.0020834178 0.0020834178 0.0021434342 0.00020683744 + 23500 100 0.0019221303 0.0019221303 0.0020227484 0.00018960984 + 23600 100 0.0018393381 0.0018393381 0.0019560681 0.00021375486 + 23700 100 0.0019027035 0.0019027035 0.0020047598 0.00010932204 + 23800 100 0.0023612063 0.0023612063 0.0021895633 6.7671176e-05 + 23900 100 0.0019570853 0.0019570853 0.0018847178 5.6761457e-05 + 24000 100 0.0013011744 0.0013011744 0.0013899106 3.8847148e-05 + 24100 100 0.001281115 0.001281115 0.0013737259 3.7559904e-05 + 24200 100 0.0012136262 0.0012136262 0.0013002937 6.8727546e-05 + 24300 100 0.0011789934 0.0011789934 0.0012399341 3.7633632e-05 + 24400 100 0.0011601514 0.0011601514 0.0012186534 4.0077907e-05 + 24500 100 0.0010660295 0.0010660295 0.0011419405 0.00015757237 + 24600 100 0.00098862453 0.00098862453 0.0010869455 4.5714503e-05 + 24700 100 0.00087647136 0.00087647136 0.00091405278 3.3129869e-05 + 24800 100 0.00063913046 0.00063913046 0.00072298864 3.5424308e-05 + 24900 100 0.00062195456 0.00062195456 0.00070527087 2.6201396e-05 + 25000 100 0.00057599538 0.00057599538 0.00065623226 2.0096103e-05 +Loop time of 0.0771328 on 1 procs for 5000 steps with 100 atoms + +Performance: 28003659.560 tau/day, 64823.286 timesteps/s, 6.482 Matom-step/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0090635 | 0.0090635 | 0.0090635 | 0.0 | 11.75 +Neigh | 0.012028 | 0.012028 | 0.012028 | 0.0 | 15.59 +Comm | 0.0008345 | 0.0008345 | 0.0008345 | 0.0 | 1.08 +Output | 0.00038777 | 0.00038777 | 0.00038777 | 0.0 | 0.50 +Modify | 0.051619 | 0.051619 | 0.051619 | 0.0 | 66.92 +Other | | 0.0032 | | | 4.15 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 158 ave 158 max 158 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 158 +Ave neighs/atom = 1.58 +Neighbor list builds = 310 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/granregion/log.16Mar23.granregion.box.g++.4 b/examples/granregion/log.16Mar23.granregion.box.g++.4 new file mode 100644 index 0000000000..0874981da4 --- /dev/null +++ b/examples/granregion/log.16Mar23.granregion.box.g++.4 @@ -0,0 +1,484 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# pouring spheres into container box + +units lj +atom_style sphere +boundary f f f +dimension 3 +comm_modify vel yes + +region box block -10 10 -10 10 -10 10 units box +create_box 2 box +Created orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 2 by 2 MPI processor grid + +pair_style hybrid gran/hooke 4000.0 NULL 100.0 NULL 0.5 1 +pair_coeff * * gran/hooke + +region container block -6 6 -6 6 -6 6 units box +fix container all wall/gran/region hooke/history 4000.0 NULL 100.0 NULL 0.5 1 region container + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 2 all nve/sphere +fix 3 all gravity 1.0 vector 0 0 -1 + +region slab block -2 2 -2 2 -2 2 units box +fix ins all pour 100 2 4767548 vol 0.4 10 diam one 1.0 region slab ignore +Particle insertion: 48 every 566 steps, 100 by step 1133 + +timestep 0.005 + +compute 1 all temp +compute_modify 1 dynamic/dof yes + +compute 2 all temp/sphere +compute_modify 2 dynamic/dof yes + +thermo 100 +thermo_style custom step atoms temp c_1 c_2 press +thermo_modify lost ignore +compute_modify thermo_temp dynamic/dof yes + +#dump 2 all image 100 image.*.jpg type type # zoom 1.4 adiam 1.0 box no 0.0 axes yes 0.9 0.03 +#dump_modify 2 pad 5 + +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 1.3 + binsize = 0.65, bins = 31 31 31 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke, perpetual + attributes: half, newton on, size + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.4843 | 0.4843 | 0.4843 Mbytes + Step Atoms Temp c_1 c_2 Press + 0 0 0 0 0 0 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 100 30 0.803783 0.803783 0.39507978 0.0029137134 + 200 30 1.1967995 1.1967995 0.5882574 0.0043383984 + 300 30 1.2814686 1.2814686 0.62987441 0.0046453238 + 400 30 0.82331082 0.82331082 0.41173176 0.0029845017 + 500 30 0.7708462 0.7708462 0.38777784 0.0043831147 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 600 64 0.51564897 0.51564897 0.26631577 0.0040059368 + 700 64 0.57239348 0.57239348 0.29566901 0.0045075987 + 800 64 0.61837087 0.61837087 0.32195387 0.0048123564 + 900 64 0.53061888 0.53061888 0.28564763 0.0055906552 + 1000 64 0.496299 0.496299 0.26801572 0.0061169128 + 1100 64 0.46068308 0.46068308 0.24699057 0.0055717699 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 1200 99 0.39206225 0.39206225 0.21356546 0.0066294211 + 1300 99 0.38624966 0.38624966 0.21345854 0.0049051051 + 1400 99 0.35615284 0.35615284 0.19785725 0.0046170772 + 1500 99 0.31486693 0.31486693 0.17429055 0.0064903432 + 1600 99 0.26369001 0.26369001 0.15095266 0.0045226847 + 1700 100 0.1925923 0.1925923 0.11308104 0.007362313 + 1800 100 0.13724978 0.13724978 0.083276845 0.0058136373 + 1900 100 0.077212636 0.077212636 0.053159386 0.0016509598 + 2000 100 0.065294031 0.065294031 0.04372752 0.0020346467 + 2100 100 0.057431398 0.057431398 0.037977068 0.0012681098 + 2200 100 0.059093046 0.059093046 0.037435194 0.00096610935 + 2300 100 0.034223376 0.034223376 0.025491303 0.00069886041 + 2400 100 0.020558283 0.020558283 0.016163008 0.0017260646 + 2500 100 0.015339698 0.015339698 0.012329233 0.00041312351 + 2600 100 0.012891357 0.012891357 0.0097660566 0.00030356702 + 2700 100 0.0092631621 0.0092631621 0.0073576327 0.00077729311 + 2800 100 0.0073866488 0.0073866488 0.0060126175 0.00018677664 + 2900 100 0.0081122362 0.0081122362 0.0062557089 0.00013749542 + 3000 100 0.0042333757 0.0042333757 0.0035407672 0.00016515787 + 3100 100 0.0035433278 0.0035433278 0.0029683167 0.00033693479 + 3200 100 0.0030692964 0.0030692964 0.0026495167 0.00043739373 + 3300 100 0.0033703684 0.0033703684 0.0026931948 0.00014857157 + 3400 100 0.0018405709 0.0018405709 0.0016990035 6.0202278e-05 + 3500 100 0.0014788087 0.0014788087 0.0013889916 0.00016730937 + 3600 100 0.0015932961 0.0015932961 0.0013807898 0.0001418157 + 3700 100 0.00096238915 0.00096238915 0.00097931829 6.7974535e-05 + 3800 100 0.00093087985 0.00093087985 0.00087659377 0.0001504142 + 3900 100 0.0015825065 0.0015825065 0.0011708936 1.9583518e-05 + 4000 100 0.00062295367 0.00062295367 0.00067129665 3.9455653e-05 + 4100 100 0.00061259406 0.00061259406 0.00065710963 1.8540759e-05 + 4200 100 0.00059619666 0.00059619666 0.00064365219 7.3779336e-06 + 4300 100 0.00051191641 0.00051191641 0.00057870947 6.3349656e-06 + 4400 100 0.00050668587 0.00050668587 0.00057057233 6.2702376e-06 + 4500 100 0.00049474942 0.00049474942 0.00055151343 1.5746831e-05 + 4600 100 0.00049309932 0.00049309932 0.00054086323 6.1021041e-06 + 4700 100 0.00049263883 0.00049263883 0.00052677244 6.0964056e-06 + 4800 100 0.00041885021 0.00041885021 0.00047389202 9.5350789e-05 + 4900 100 0.00035596444 0.00035596444 0.00042522549 5.8036712e-05 + 5000 100 0.00032946897 0.00032946897 0.00040320773 6.5350005e-06 +Loop time of 0.0763179 on 4 procs for 5000 steps with 100 atoms + +Performance: 28302682.620 tau/day, 65515.469 timesteps/s, 6.552 Matom-step/s +96.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0010572 | 0.0039588 | 0.0074661 | 4.6 | 5.19 +Neigh | 0.0025868 | 0.0049885 | 0.0075283 | 3.4 | 6.54 +Comm | 0.011862 | 0.014631 | 0.018383 | 2.0 | 19.17 +Output | 0.0009702 | 0.0012326 | 0.0014234 | 0.5 | 1.62 +Modify | 0.0019843 | 0.018558 | 0.036592 | 12.2 | 24.32 +Other | | 0.03295 | | | 43.17 + +Nlocal: 25 ave 54 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Nghost: 4.5 ave 10 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Neighs: 40.5 ave 94 max 0 min +Histogram: 2 0 0 0 0 0 0 1 0 1 + +Total # of neighbors = 162 +Ave neighs/atom = 1.62 +Neighbor list builds = 281 +Dangerous builds = 0 + +region container delete +variable theta equal (step-5000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 0 0 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +WARNING: Region properties for region container changed between runs, resetting its motion (src/GRANULAR/fix_wall_gran_region.cpp:101) +Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.735 Mbytes + Step Atoms Temp c_1 c_2 Press + 5000 100 0.00032946897 0.00032946897 0.00040320773 6.050219e-06 + 5100 100 0.54371575 0.54371575 0.29836301 0.008148168 + 5200 100 0.60281896 0.60281896 0.33161676 0.0083772071 + 5300 100 0.70823011 0.70823011 0.38289657 0.0099694209 + 5400 100 0.78467127 0.78467127 0.4133495 0.010119104 + 5500 100 0.85741178 0.85741178 0.44761254 0.013013239 + 5600 100 0.93241573 0.93241573 0.47879351 0.017769592 + 5700 100 1.019104 1.019104 0.51644461 0.015312937 + 5800 100 1.0550014 1.0550014 0.53450507 0.017227797 + 5900 100 1.0910946 1.0910946 0.55272891 0.017469625 + 6000 100 1.1275288 1.1275288 0.56906788 0.018958103 + 6100 100 1.1545017 1.1545017 0.58324166 0.019220208 + 6200 100 1.1815817 1.1815817 0.59552677 0.019397271 + 6300 100 1.1963931 1.1963931 0.60251664 0.018382058 + 6400 100 1.2084652 1.2084652 0.60776713 0.020027986 + 6500 100 1.2217215 1.2217215 0.61406339 0.021750945 + 6600 100 1.2364016 1.2364016 0.62124174 0.021701243 + 6700 100 1.2739954 1.2739954 0.63930766 0.02025277 + 6800 100 1.3032733 1.3032733 0.65268105 0.021684843 + 6900 100 1.3226653 1.3226653 0.66168772 0.021187963 + 7000 100 1.3464995 1.3464995 0.67431153 0.022066117 + 7100 100 1.3250485 1.3250485 0.66342366 0.02109487 + 7200 100 1.3384316 1.3384316 0.67035095 0.021554113 + 7300 100 1.3280234 1.3280234 0.66553439 0.020829435 + 7400 100 1.3218971 1.3218971 0.66186263 0.020882591 + 7500 100 1.3293858 1.3293858 0.66506462 0.020897778 + 7600 100 1.3386019 1.3386019 0.66909392 0.020754479 + 7700 100 1.3465327 1.3465327 0.67316081 0.021231547 + 7800 100 1.3510586 1.3510586 0.67531764 0.021053475 + 7900 100 1.3508987 1.3508987 0.67535907 0.020769633 + 8000 100 1.3575635 1.3575635 0.67875993 0.022020776 + 8100 100 1.3655144 1.3655144 0.68258066 0.021016999 + 8200 100 1.375187 1.375187 0.68732222 0.021385146 + 8300 100 1.3799568 1.3799568 0.69000134 0.02114428 + 8400 100 1.3755871 1.3755871 0.68757909 0.022395102 + 8500 100 1.3708345 1.3708345 0.68509834 0.021603853 + 8600 100 1.3689806 1.3689806 0.68388935 0.022127839 + 8700 100 1.3697516 1.3697516 0.68411868 0.02165119 + 8800 100 1.3700522 1.3700522 0.68423671 0.021554001 + 8900 100 1.3705045 1.3705045 0.68451935 0.021470392 + 9000 100 1.3715107 1.3715107 0.68506443 0.021789844 + 9100 100 1.3707806 1.3707806 0.68467539 0.021451331 + 9200 100 1.371112 1.371112 0.68485975 0.021479203 + 9300 100 1.3716851 1.3716851 0.68516034 0.021515076 + 9400 100 1.3719031 1.3719031 0.68529221 0.021502802 + 9500 100 1.3726759 1.3726759 0.68544012 0.021585119 + 9600 100 1.3746583 1.3746583 0.68636924 0.02206073 + 9700 100 1.3761662 1.3761662 0.68716579 0.021533719 + 9800 100 1.3760157 1.3760157 0.687092 0.02163129 + 9900 100 1.3762626 1.3762626 0.68726404 0.021707045 + 10000 100 1.376303 1.376303 0.68735031 0.022306557 +Loop time of 0.128472 on 4 procs for 5000 steps with 100 atoms + +Performance: 16812995.511 tau/day, 38918.971 timesteps/s, 3.892 Matom-step/s +98.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0012241 | 0.0085024 | 0.016023 | 7.8 | 6.62 +Neigh | 0.0051137 | 0.0079745 | 0.011012 | 3.2 | 6.21 +Comm | 0.0050448 | 0.009504 | 0.015048 | 4.6 | 7.40 +Output | 0.00090309 | 0.0014765 | 0.0019648 | 1.2 | 1.15 +Modify | 0.0072253 | 0.041211 | 0.076226 | 16.7 | 32.08 +Other | | 0.0598 | | | 46.55 + +Nlocal: 25 ave 51 max 0 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 3.25 ave 7 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Neighs: 46 ave 101 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 + +Total # of neighbors = 184 +Ave neighs/atom = 1.84 +Neighbor list builds = 628 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.735 Mbytes + Step Atoms Temp c_1 c_2 Press + 10000 100 1.376303 1.376303 0.68735031 0.022411506 + 10100 100 0.28192752 0.28192752 0.16298909 0.0041760951 + 10200 100 0.14576408 0.14576408 0.10117889 0.0058653094 + 10300 100 0.10070361 0.10070361 0.078060938 0.0041432979 + 10400 100 0.07455595 0.07455595 0.061163197 0.0029733745 + 10500 100 0.063531027 0.063531027 0.052515707 0.0015731241 + 10600 100 0.049259626 0.049259626 0.041321284 0.00073083104 + 10700 100 0.037377957 0.037377957 0.032017729 0.0022631642 + 10800 100 0.031849901 0.031849901 0.027079116 0.0014148618 + 10900 100 0.02795233 0.02795233 0.02461403 0.00037567522 + 11000 100 0.02597858 0.02597858 0.022516094 0.00054992645 + 11100 100 0.021812043 0.021812043 0.019276946 0.00043233309 + 11200 100 0.019318956 0.019318956 0.017224213 0.00035792964 + 11300 100 0.017760494 0.017760494 0.01578407 0.00056959435 + 11400 100 0.015485043 0.015485043 0.013703 0.00061308169 + 11500 100 0.015051781 0.015051781 0.012994991 0.00040607387 + 11600 100 0.012204953 0.012204953 0.01079191 0.00059482171 + 11700 100 0.011242847 0.011242847 0.0096811013 0.00018299476 + 11800 100 0.0089605707 0.0089605707 0.0075086629 0.0012779422 + 11900 100 0.0065544011 0.0065544011 0.0056480432 0.00039599272 + 12000 100 0.0048068901 0.0048068901 0.004185961 0.00022434097 + 12100 100 0.0045272524 0.0045272524 0.0039084556 7.8443821e-05 + 12200 100 0.0038926209 0.0038926209 0.0033949999 0.00011203445 + 12300 100 0.0034653 0.0034653 0.0030246557 0.00014999893 + 12400 100 0.0034031041 0.0034031041 0.0029879474 7.9628343e-05 + 12500 100 0.0032219984 0.0032219984 0.0028369239 6.1651251e-05 + 12600 100 0.0031148659 0.0031148659 0.0027543848 5.7332789e-05 + 12700 100 0.0027407824 0.0027407824 0.0024822578 5.150993e-05 + 12800 100 0.0026205294 0.0026205294 0.0023576698 8.896122e-05 + 12900 100 0.0025633289 0.0025633289 0.0023134486 7.0525939e-05 + 13000 100 0.0025434711 0.0025434711 0.0022833007 5.5638668e-05 + 13100 100 0.0025046562 0.0025046562 0.002227265 5.2772716e-05 + 13200 100 0.0023544645 0.0023544645 0.0021086805 0.00030775943 + 13300 100 0.0022163971 0.0022163971 0.0020107508 4.9204292e-05 + 13400 100 0.0021307794 0.0021307794 0.0019334987 4.8144132e-05 + 13500 100 0.0019891796 0.0019891796 0.0018128084 4.8532374e-05 + 13600 100 0.0018591538 0.0018591538 0.0016721703 4.4781385e-05 + 13700 100 0.001768055 0.001768055 0.001597222 1.6800418e-05 + 13800 100 0.001569014 0.001569014 0.0014331265 4.2982654e-05 + 13900 100 0.0013700893 0.0013700893 0.0012782771 4.8209662e-05 + 14000 100 0.0012398662 0.0012398662 0.0011606486 5.5766702e-05 + 14100 100 0.0011707267 0.0011707267 0.0010811523 3.4913501e-05 + 14200 100 0.0010483984 0.0010483984 0.0009831881 3.4742894e-05 + 14300 100 0.0010043196 0.0010043196 0.00092474592 3.4196115e-05 + 14400 100 0.00094238924 0.00094238924 0.00087181843 8.1414071e-05 + 14500 100 0.00093341457 0.00093341457 0.00086429224 3.3276909e-05 + 14600 100 0.00086042474 0.00086042474 0.00079524877 3.2260019e-05 + 14700 100 0.00080525469 0.00080525469 0.00075380989 2.8374703e-05 + 14800 100 0.00070848512 0.00070848512 0.0006762901 2.9937591e-05 + 14900 100 0.00060414588 0.00060414588 0.00058494979 2.5684401e-05 + 15000 100 0.00054251571 0.00054251571 0.00053643753 4.5496354e-05 +Loop time of 0.0553238 on 4 procs for 5000 steps with 100 atoms + +Performance: 39042861.362 tau/day, 90376.994 timesteps/s, 9.038 Matom-step/s +98.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.00085556 | 0.0028667 | 0.0052429 | 3.6 | 5.18 +Neigh | 0.00076731 | 0.0012173 | 0.0016987 | 1.3 | 2.20 +Comm | 0.0016497 | 0.0060965 | 0.010792 | 5.7 | 11.02 +Output | 0.00072675 | 0.00099509 | 0.0011615 | 0.0 | 1.80 +Modify | 0.00064371 | 0.014719 | 0.030427 | 11.6 | 26.61 +Other | | 0.02943 | | | 53.19 + +Nlocal: 25 ave 54 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Nghost: 5 ave 11 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Neighs: 40 ave 88 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 + +Total # of neighbors = 160 +Ave neighs/atom = 1.6 +Neighbor list builds = 97 +Dangerous builds = 0 + +region container delete +variable theta equal (step-15000)*(4.0*PI/5000) +region container block -6 6 -6 6 -6 6 units box rotate v_theta 0 0 0 1 1 1 +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.609 | 5.672 | 5.735 Mbytes + Step Atoms Temp c_1 c_2 Press + 15000 100 0.00054251571 0.00054251571 0.00053643753 4.3506263e-05 + 15100 100 1.1164435 1.1164435 0.7163854 0.017358175 + 15200 100 1.0384203 1.0384203 0.66790042 0.016095459 + 15300 100 1.0829984 1.0829984 0.712381 0.015915015 + 15400 100 1.4187366 1.4187366 0.89537718 0.023771032 + 15500 100 1.5397547 1.5397547 0.97895571 0.025145916 + 15600 100 1.7993339 1.7993339 1.1003794 0.026783317 + 15700 100 1.8858073 1.8858073 1.1481696 0.030802833 + 15800 100 1.9368129 1.9368129 1.1450129 0.032144729 + 15900 100 2.0379823 2.0379823 1.1738926 0.031969116 + 16000 100 2.0655671 2.0655671 1.187038 0.032395513 + 16100 100 2.1199141 2.1199141 1.2102937 0.028830059 + 16200 100 2.1819656 2.1819656 1.245147 0.029493813 + 16300 100 2.2451204 2.2451204 1.2726968 0.029915554 + 16400 100 2.1697892 2.1697892 1.2342734 0.027495983 + 16500 100 2.2689358 2.2689358 1.2710223 0.029516621 + 16600 100 2.3901976 2.3901976 1.3328992 0.030049751 + 16700 100 2.4731258 2.4731258 1.3763126 0.032663365 + 16800 100 2.5708338 2.5708338 1.4255635 0.032731991 + 16900 100 2.7232422 2.7232422 1.5006931 0.036649645 + 17000 100 2.901986 2.901986 1.5886643 0.037333791 + 17100 100 2.8787369 2.8787369 1.5752504 0.03582313 + 17200 100 3.1137189 3.1137189 1.6974538 0.041245422 + 17300 100 3.1805823 3.1805823 1.7370013 0.040766564 + 17400 100 3.3215703 3.3215703 1.8109954 0.044269306 + 17500 100 3.3767256 3.3767256 1.813696 0.048012575 + 17600 100 3.3618731 3.3618731 1.8004834 0.06103562 + 17700 100 3.2288285 3.2288285 1.7447885 0.042875761 + 17800 100 3.2545435 3.2545435 1.7617642 0.04661949 + 17900 100 3.1162969 3.1162969 1.6850561 0.040086156 + 18000 100 3.2053719 3.2053719 1.7132296 0.040657811 + 18100 100 3.2924625 3.2924625 1.7709303 0.048407939 + 18200 100 3.1682076 3.1682076 1.7136129 0.040996326 + 18300 100 3.2244534 3.2244534 1.7401102 0.043957312 + 18400 100 3.1470903 3.1470903 1.7171698 0.043123438 + 18500 100 3.2690021 3.2690021 1.7803818 0.042693323 + 18600 100 3.2566233 3.2566233 1.7670476 0.04776305 + 18700 100 3.384347 3.384347 1.8334885 0.04441225 + 18800 100 3.6479797 3.6479797 1.9565845 0.047454733 + 18900 100 3.6894531 3.6894531 1.9767079 0.053222159 + 19000 100 3.7867788 3.7867788 2.0265223 0.055923793 + 19100 100 3.9120999 3.9120999 2.0850815 0.053591707 + 19200 100 3.8255419 3.8255419 2.0517931 0.061034295 + 19300 100 3.764721 3.764721 2.0089969 0.068118255 + 19400 100 3.8604884 3.8604884 2.0640292 0.052825172 + 19500 100 3.7763823 3.7763823 2.0223758 0.054529616 + 19600 100 3.9158781 3.9158781 2.0873723 0.053130512 + 19700 100 3.6394071 3.6394071 1.9735106 0.047466529 + 19800 100 3.5409741 3.5409741 1.9335311 0.047317029 + 19900 100 3.5961407 3.5961407 1.954696 0.048093129 + 20000 100 3.4355899 3.4355899 1.8679902 0.0486077 +Loop time of 0.107854 on 4 procs for 5000 steps with 100 atoms + +Performance: 20026986.271 tau/day, 46358.765 timesteps/s, 4.636 Matom-step/s +98.9% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0025992 | 0.0042158 | 0.0061269 | 1.9 | 3.91 +Neigh | 0.0089595 | 0.011254 | 0.012853 | 1.3 | 10.43 +Comm | 0.020408 | 0.022579 | 0.024669 | 1.4 | 20.94 +Output | 0.0010271 | 0.0011457 | 0.0012268 | 0.2 | 1.06 +Modify | 0.019454 | 0.032696 | 0.040003 | 4.4 | 30.31 +Other | | 0.03596 | | | 33.34 + +Nlocal: 25 ave 36 max 16 min +Histogram: 1 0 1 0 0 0 1 0 0 1 +Nghost: 5.5 ave 8 max 2 min +Histogram: 1 0 0 0 0 1 0 0 1 1 +Neighs: 34.25 ave 48 max 19 min +Histogram: 1 1 0 0 0 0 0 0 0 2 + +Total # of neighbors = 137 +Ave neighs/atom = 1.37 +Neighbor list builds = 908 +Dangerous builds = 0 + +region container delete +region container block -6 6 -6 6 -6 6 units box +run 5000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.734 | 5.735 | 5.735 Mbytes + Step Atoms Temp c_1 c_2 Press + 20000 100 3.4355899 3.4355899 1.8679902 0.047866781 + 20100 100 1.1677914 1.1677914 0.70763342 0.015645481 + 20200 100 0.99137326 0.99137326 0.61064707 0.012080974 + 20300 100 0.84603548 0.84603548 0.52093267 0.012501649 + 20400 100 0.82813609 0.82813609 0.50585936 0.010248184 + 20500 100 0.86524293 0.86524293 0.5210492 0.011145216 + 20600 100 0.92229302 0.92229302 0.54567614 0.012838894 + 20700 100 0.93499886 0.93499886 0.55161401 0.011618713 + 20800 100 0.95831407 0.95831407 0.56173113 0.014502297 + 20900 100 0.88486451 0.88486451 0.51926962 0.013847246 + 21000 100 0.66876325 0.66876325 0.39313901 0.010224296 + 21100 100 0.46578708 0.46578708 0.28086455 0.0089121873 + 21200 100 0.21445902 0.21445902 0.14749113 0.0033665892 + 21300 100 0.12935011 0.12935011 0.09319765 0.002811107 + 21400 100 0.10572326 0.10572326 0.075154962 0.0034728629 + 21500 100 0.10952604 0.10952604 0.073864376 0.0017411404 + 21600 100 0.074321422 0.074321422 0.051368858 0.0037915268 + 21700 100 0.043324694 0.043324694 0.032954769 0.00092476658 + 21800 100 0.034911155 0.034911155 0.026843877 0.00061350592 + 21900 100 0.02261818 0.02261818 0.018357224 0.00049800957 + 22000 100 0.015096211 0.015096211 0.01390442 0.00059260194 + 22100 100 0.016119209 0.016119209 0.013990821 0.00038431756 + 22200 100 0.012184692 0.012184692 0.011062653 0.00030466184 + 22300 100 0.0090526001 0.0090526001 0.0080893293 0.00082507232 + 22400 100 0.007155528 0.007155528 0.0067365227 0.00094740021 + 22500 100 0.0057433117 0.0057433117 0.0057438575 0.00016706605 + 22600 100 0.0053029734 0.0053029734 0.0050429137 0.00018457156 + 22700 100 0.0041888319 0.0041888319 0.0039979907 0.00029467329 + 22800 100 0.0046486843 0.0046486843 0.0042259456 0.00019395675 + 22900 100 0.0046414295 0.0046414295 0.0040659744 0.00016025205 + 23000 100 0.0033983576 0.0033983576 0.0033431909 0.00039998961 + 23100 100 0.0031212625 0.0031212625 0.0031113361 0.00024783655 + 23200 100 0.0026724347 0.0026724347 0.0026905233 0.00026001445 + 23300 100 0.0029222876 0.0029222876 0.002946198 0.00012385327 + 23400 100 0.0023944825 0.0023944825 0.0021829995 0.00016185776 + 23500 100 0.0020384082 0.0020384082 0.0019106613 9.2139544e-05 + 23600 100 0.0019773679 0.0019773679 0.0018577006 8.9169073e-05 + 23700 100 0.0018850072 0.0018850072 0.0017715658 9.1301463e-05 + 23800 100 0.0020857322 0.0020857322 0.001864009 7.4633597e-05 + 23900 100 0.0017616498 0.0017616498 0.001680563 4.8547939e-05 + 24000 100 0.0017183254 0.0017183254 0.0016568629 6.56741e-05 + 24100 100 0.0014311732 0.0014311732 0.0013829993 6.0743962e-05 + 24200 100 0.0013434756 0.0013434756 0.001315682 0.00025727478 + 24300 100 0.0012855885 0.0012855885 0.0012558467 9.0130585e-05 + 24400 100 0.0012731213 0.0012731213 0.0012408428 8.2008231e-05 + 24500 100 0.0011333063 0.0011333063 0.001045815 8.8391061e-05 + 24600 100 0.0010560932 0.0010560932 0.00098304208 5.6725938e-05 + 24700 100 0.00097698038 0.00097698038 0.00092381967 7.1771848e-05 + 24800 100 0.00094316799 0.00094316799 0.00089343119 5.5558578e-05 + 24900 100 0.00082812377 0.00082812377 0.00076615512 5.8668812e-05 + 25000 100 0.00076097781 0.00076097781 0.00069462801 6.5742694e-05 +Loop time of 0.0523621 on 4 procs for 5000 steps with 100 atoms + +Performance: 41251226.669 tau/day, 95488.951 timesteps/s, 9.549 Matom-step/s +98.6% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0011166 | 0.0029573 | 0.0049613 | 3.3 | 5.65 +Neigh | 0.0026276 | 0.0033989 | 0.0041666 | 1.1 | 6.49 +Comm | 0.0054479 | 0.0084136 | 0.01182 | 2.9 | 16.07 +Output | 0.00070658 | 0.00092447 | 0.0010421 | 0.0 | 1.77 +Modify | 0.0015069 | 0.012796 | 0.025273 | 9.9 | 24.44 +Other | | 0.02387 | | | 45.59 + +Nlocal: 25 ave 55 max 0 min +Histogram: 2 0 0 0 0 0 0 0 1 1 +Nghost: 6 ave 14 max 0 min +Histogram: 2 0 0 0 0 0 0 1 0 1 +Neighs: 39.25 ave 88 max 0 min +Histogram: 2 0 0 0 0 0 0 1 0 1 + +Total # of neighbors = 157 +Ave neighs/atom = 1.57 +Neighbor list builds = 280 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/granregion/log.16Mar23.granregion.funnel.g++.1 b/examples/granregion/log.16Mar23.granregion.funnel.g++.1 new file mode 100644 index 0000000000..0ead1ddd41 --- /dev/null +++ b/examples/granregion/log.16Mar23.granregion.funnel.g++.1 @@ -0,0 +1,635 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# pour particles into cone-shaped funnel, settle them, let them run out bottom + +variable name string funnel_pour + +thermo_modify flush yes +units si +variable PI equal 3.141592653589 +variable seed equal 14314 + +############################################### +# Geometry-related parameters +############################################### + +variable xlo equal 10 +variable xhi equal 40 +variable ylo equal 10 +variable yhi equal 40 +variable zlo equal -20 +variable zhi equal 50 + +variable xc equal 25 +variable yc equal 25 + +variable zconehi equal 50 +variable zconelo equal 10 +variable zcyllo equal 0 +variable radconelo equal 2 +variable radconehi equal 20 + +################################################ +# Particle sizes +################################################ + +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable skin equal ${rhi} +variable skin equal 0.5 + +############################################### +# Granular contact parameters +############################################### + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable density equal 1.0 +variable EYoung equal 10^5 +variable Poisson equal 2.0/7.0 +variable GShear equal ${EYoung}/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+0.285714285714286)) + +variable gravity equal 1.0 + +variable reff equal 0.5*(${rhi}+${rlo}) +variable reff equal 0.5*(0.5+${rlo}) +variable reff equal 0.5*(0.5+0.25) +variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 +variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 +variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 + +## Typical way to set kn, kt, etc.: +variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) +variable kt equal 4.0*${GShear}/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) + +variable a equal (-2.0*log(${coeffRes})/${PI})^2 +variable a equal (-2.0*log(0.1)/${PI})^2 +variable a equal (-2.0*log(0.1)/3.141592653589)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 903.503751814138*0.5 + +variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) + +variable dt equal ${tcol}*0.05 +variable dt equal 0.00210943016014969*0.05 +timestep ${dt} +timestep 0.000105471508007485 + +############################################### +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton off +atom_style sphere + +boundary p p f + +region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 40 ${zlo} ${zhi} +region boxreg block 10 40 10 40 -20 ${zhi} +region boxreg block 10 40 10 40 -20 50 +create_box 1 boxreg +Created orthogonal box = (10 10 -20) to (40 40 50) + 1 by 1 by 1 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.5 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 30, bins = 1 1 3 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/multi/newtoff + stencil: full/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +# insertion region for fix/pour + +region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box +region insreg cylinder z 25 ${yc} 10 30 50 side in units box +region insreg cylinder z 25 25 10 30 50 side in units box + +# define cone and cylinder regions - see lammps doc on region command +# note new open options + +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 2 + +region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open +region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 + +region hopreg union 2 conereg cylreg + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + + +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 3000 every 59965 steps, 2000 by step 1 + +#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke +WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:895) +thermo_modify flush yes lost warn + +# Initial run to fill up the cone + +run 20000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 6.648 | 6.648 | 6.648 Mbytes + Step CPU Atoms KinEng + 0 0 0 -0 + 1000 0.52844331 2000 -0 + 2000 0.76085445 2000 -0 + 3000 0.99183068 2000 -0 + 4000 1.2193085 2000 -0 + 5000 1.4439617 2000 -0 + 6000 1.6703511 2000 -0 + 7000 1.9053408 2000 -0 + 8000 2.1323525 2000 -0 + 9000 2.3566342 2000 -0 + 10000 2.5829638 2000 -0 + 11000 2.8106202 2000 -0 + 12000 3.0371473 2000 -0 + 13000 3.2621782 2000 -0 + 14000 3.4860689 2000 -0 + 15000 3.7138322 2000 -0 + 16000 3.9424002 2000 -0 + 17000 4.1703584 2000 -0 + 18000 4.3973348 2000 -0 + 19000 4.6213358 2000 -0 + 20000 4.8547603 2000 -0 +Loop time of 4.85478 on 1 procs for 20000 steps with 2000 atoms + +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.52375 | 0.52375 | 0.52375 | 0.0 | 10.79 +Neigh | 0.070018 | 0.070018 | 0.070018 | 0.0 | 1.44 +Comm | 0.011077 | 0.011077 | 0.011077 | 0.0 | 0.23 +Output | 0.00071321 | 0.00071321 | 0.00071321 | 0.0 | 0.01 +Modify | 4.1233 | 4.1233 | 4.1233 | 0.0 | 84.93 +Other | | 0.126 | | | 2.59 + +Nlocal: 2000 ave 2000 max 2000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1607 ave 1607 max 1607 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1607 +Ave neighs/atom = 0.8035 +Neighbor list builds = 71 +Dangerous builds = 0 +unfix ins +run 150000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.69 | 12.69 | 12.69 Mbytes + Step CPU Atoms KinEng + 20000 0 2000 6652.2957 + 21000 0.22761741 2000 6807.2201 + 22000 0.45508977 2000 6973.9359 + 23000 0.68132308 2000 7142.3648 + 24000 0.91084802 2000 7276.9717 + 25000 1.1397154 2000 7369.4191 + 26000 1.3724974 2000 7497.6526 + 27000 1.6037436 2000 7638.946 + 28000 1.8381254 2000 7780.0339 + 29000 2.0763695 2000 7881.8177 + 30000 2.3169444 2000 7967.2641 + 31000 2.5544704 2000 7994.9273 + 32000 2.7981688 2000 7937.0671 + 33000 3.0486439 2000 7774.0508 + 34000 3.3065315 2000 7591.1491 + 35000 3.5712927 2000 7357.5176 + 36000 3.8415508 2000 7147.2024 + 37000 4.1137466 2000 6979.1604 + 38000 4.3946186 2000 6813.2152 + 39000 4.6737386 2000 6660.2701 + 40000 4.9654287 2000 6502.8957 + 41000 5.2606376 2000 6324.3951 + 42000 5.5633065 2000 6132.7516 + 43000 5.8692745 2000 5913.1841 + 44000 6.1757115 2000 5732.2095 + 45000 6.4896845 2000 5508.8322 + 46000 6.8170163 2000 5306.8932 + 47000 7.1514543 2000 5152.0521 + 48000 7.4863157 2000 5028.2274 + 49000 7.8214974 2000 4896.102 + 50000 8.1600826 2000 4723.5189 + 51000 8.4984004 2000 4583.7526 + 52000 8.8500924 2000 4447.0187 + 53000 9.2046999 2000 4303.2307 + 54000 9.5724785 2000 4168.5251 + 55000 9.9479954 2000 4036.9704 + 56000 10.324666 2000 3901.1183 + 57000 10.708944 2000 3716.7071 + 58000 11.108887 2000 3473.5422 + 59000 11.515057 2000 3245.1223 + 60000 11.922119 2000 3039.7845 + 61000 12.331146 2000 2780.0187 + 62000 12.745147 2000 2577.3345 + 63000 13.169644 2000 2346.2488 + 64000 13.602869 2000 2116.7298 + 65000 14.044828 2000 1903.7828 + 66000 14.49159 2000 1631.1676 + 67000 14.953127 2000 1431.0198 + 68000 15.428874 2000 1212.875 + 69000 15.981012 2000 995.45046 + 70000 16.458356 2000 811.54766 + 71000 16.936094 2000 624.08622 + 72000 17.432306 2000 471.00862 + 73000 17.949423 2000 358.33486 + 74000 18.467878 2000 284.39416 + 75000 18.970599 2000 234.26671 + 76000 19.45957 2000 185.61836 + 77000 19.959792 2000 152.95918 + 78000 20.455734 2000 122.49023 + 79000 20.93849 2000 102.29396 + 80000 21.430632 2000 86.284684 + 81000 21.925932 2000 73.984781 + 82000 22.428573 2000 63.042918 + 83000 22.945552 2000 53.338428 + 84000 23.467102 2000 45.89585 + 85000 23.992243 2000 40.412826 + 86000 24.512956 2000 34.183381 + 87000 25.037944 2000 29.671524 + 88000 25.56622 2000 26.90414 + 89000 26.102251 2000 24.362631 + 90000 26.638165 2000 21.887341 + 91000 27.17863 2000 19.985662 + 92000 27.72662 2000 18.728162 + 93000 28.276842 2000 16.99941 + 94000 28.830281 2000 15.71941 + 95000 29.389744 2000 14.744057 + 96000 29.972451 2000 14.214918 + 97000 30.575245 2000 13.450182 + 98000 31.141552 2000 12.79222 + 99000 31.711177 2000 12.10595 + 100000 32.286609 2000 11.281863 + 101000 32.879692 2000 10.025419 + 102000 33.460265 2000 9.9574468 + 103000 34.040002 2000 9.4078117 + 104000 34.619096 2000 8.9079161 + 105000 35.199384 2000 8.6269302 + 106000 35.784782 2000 8.5512649 + 107000 36.37489 2000 8.4703948 + 108000 36.963891 2000 8.2747542 + 109000 37.551549 2000 8.2895118 + 110000 38.154561 2000 8.1785613 + 111000 38.749306 2000 7.8443234 + 112000 39.344241 2000 7.7436124 + 113000 39.938878 2000 7.8118604 + 114000 40.531935 2000 7.3806177 + 115000 41.130022 2000 7.0857235 + 116000 41.726772 2000 7.1346752 + 117000 42.322611 2000 7.0653751 + 118000 42.927287 2000 6.6314104 + 119000 43.524125 2000 6.2169614 + 120000 44.127912 2000 5.8988829 + 121000 44.724988 2000 5.4197277 + 122000 45.328051 2000 4.6381303 + 123000 45.93285 2000 4.4949206 + 124000 46.54149 2000 4.4261118 + 125000 47.301723 2000 4.4223703 + 126000 48.071689 2000 4.4858898 + 127000 48.834286 2000 4.3312536 + 128000 49.448737 2000 3.7124973 + 129000 50.169622 2000 3.5467396 + 130000 50.867494 2000 3.5104139 + 131000 51.585563 2000 3.5725612 + 132000 52.240372 2000 3.669455 + 133000 52.892134 2000 3.6168912 + 134000 53.50594 2000 3.3598517 + 135000 54.114565 2000 3.3743407 + 136000 54.725082 2000 3.1109764 + 137000 55.358218 2000 3.0720146 + 138000 55.977314 2000 3.1303776 + 139000 56.589791 2000 3.2052806 + 140000 57.212518 2000 2.8958882 + 141000 57.867102 2000 2.9931572 + 142000 58.690342 2000 3.0967832 + 143000 59.418639 2000 3.0576365 + 144000 60.035852 2000 3.2016943 + 145000 60.666569 2000 3.3817709 + 146000 61.368878 2000 3.4527239 + 147000 62.159309 2000 3.5928733 + 148000 62.879677 2000 3.7784682 + 149000 63.50784 2000 3.6587944 + 150000 64.129366 2000 3.7945669 + 151000 64.74324 2000 3.5551557 + 152000 65.360802 2000 3.6248848 + 153000 65.979475 2000 3.7361463 + 154000 66.593554 2000 3.8534319 + 155000 67.30899 2000 4.0101408 + 156000 68.295637 2000 3.7670652 + 157000 69.257704 2000 3.1487676 + 158000 70.085566 2000 2.980076 + 159000 70.914218 2000 3.0350592 + 160000 71.734553 2000 3.125389 + 161000 72.423913 2000 2.7516115 + 162000 73.264994 2000 2.413911 + 163000 74.126424 2000 2.297713 + 164000 75.050891 2000 2.3190806 + 165000 75.917063 2000 2.2868879 + 166000 76.783267 2000 2.1658547 + 167000 77.516683 2000 1.7511071 + 168000 78.319102 2000 1.4112478 + 169000 78.961239 2000 1.3623558 + 170000 79.578448 2000 1.3701579 +Loop time of 79.5785 on 1 procs for 150000 steps with 2000 atoms + +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 40.78 | 40.78 | 40.78 | 0.0 | 51.25 +Neigh | 0.6504 | 0.6504 | 0.6504 | 0.0 | 0.82 +Comm | 0.090848 | 0.090848 | 0.090848 | 0.0 | 0.11 +Output | 0.0059597 | 0.0059597 | 0.0059597 | 0.0 | 0.01 +Modify | 36.939 | 36.939 | 36.939 | 0.0 | 46.42 +Other | | 1.112 | | | 1.40 + +Nlocal: 2000 ave 2000 max 2000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 15308 ave 15308 max 15308 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 15308 +Ave neighs/atom = 7.654 +Neighbor list builds = 367 +Dangerous builds = 0 + +# remove "plug" - need to redefine cylinder region & union + +region cylreg delete +region hopreg delete +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 + +region hopreg union 2 cylreg conereg + +unfix hopper3 +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +run 100000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.69 | 12.69 | 12.69 Mbytes + Step CPU Atoms KinEng + 170000 0 2000 1.3701579 + 171000 0.71457906 2000 2.3724823 + 172000 1.4067557 2000 3.5881441 + 173000 2.0500352 2000 5.3771633 + 174000 2.8020081 2000 7.5896471 + 175000 3.467807 2000 10.77251 + 176000 4.064748 2000 14.806868 + 177000 4.6769962 2000 19.607624 + 178000 5.26259 2000 25.426227 + 179000 5.8424937 2000 32.23584 + 180000 6.4222206 2000 39.930468 + 181000 6.9910375 2000 47.686304 + 182000 7.5601562 2000 56.506806 + 183000 8.1243537 2000 66.514326 + 184000 8.6871123 2000 77.554644 + 185000 9.3749051 2000 89.224002 + 186000 10.008412 2000 102.07846 + 187000 10.668269 2000 116.08141 + 188000 11.26663 2000 130.97964 + 189000 11.874542 2000 146.77806 + 190000 12.436262 2000 162.79858 + 191000 12.973297 2000 179.02052 + 192000 13.532286 2000 196.26683 + 193000 14.056018 2000 214.38928 + 194000 14.593726 2000 232.32068 + 195000 15.115478 2000 251.74644 + 196000 15.637308 2000 272.25231 + 197000 16.159144 2000 294.64075 + 198000 16.676958 2000 318.32895 + 199000 17.186114 2000 342.44005 + 200000 17.706244 2000 368.35469 + 201000 18.221731 2000 395.2465 + 202000 18.739505 2000 422.63599 + 203000 19.259645 2000 450.45248 + 204000 19.769875 2000 479.60812 + 205000 20.293972 2000 510.44155 + 206000 20.806658 2000 543.25751 + 207000 21.348998 2000 577.35928 + 208000 21.888691 2000 612.29718 + 209000 22.421596 2000 647.8951 + 210000 22.922782 2000 683.79409 + 211000 23.473165 2000 720.36556 + 212000 24.008952 2000 759.27331 + 213000 24.56155 2000 798.27302 + 214000 25.062386 2000 837.93849 + 215000 25.563743 2000 877.92945 + 216000 26.066188 2000 919.62532 + 217000 26.584605 2000 962.83509 + 218000 27.15076 2000 1008.5243 + 219000 27.651387 2000 1054.5769 + 220000 28.146147 2000 1103.1843 + 221000 28.644239 2000 1153.0349 + 222000 29.141899 2000 1204.5599 + 223000 29.636644 2000 1257.1367 + 224000 30.13786 2000 1308.6735 +WARNING: Lost atoms: original 2000 current 1999 (src/thermo.cpp:487) + 225000 30.638093 1999 1360.1205 + 226000 31.127956 1998 1404.8405 + 227000 31.620394 1996 1448.4869 + 228000 32.108597 1992 1491.8112 + 229000 32.592048 1985 1518.7013 + 230000 33.067462 1971 1507.6699 + 231000 33.552874 1965 1533.5096 + 232000 34.037763 1948 1489.4128 + 233000 34.531058 1933 1477.4536 + 234000 35.01451 1915 1425.8398 + 235000 35.495081 1904 1410.1451 + 236000 35.963357 1892 1401.7595 + 237000 36.428382 1880 1368.893 + 238000 36.890459 1868 1341.8885 + 239000 37.358838 1850 1286.7968 + 240000 37.828549 1833 1219.5123 + 241000 38.29428 1820 1173.3608 + 242000 38.750021 1806 1106.0727 + 243000 39.206425 1788 1035.912 + 244000 39.690492 1779 1021.6147 + 245000 40.138287 1767 969.40032 + 246000 40.582591 1757 939.12022 + 247000 41.02378 1739 840.9396 + 248000 41.472154 1730 822.06575 + 249000 41.916625 1719 762.11057 + 250000 42.365019 1707 708.50308 + 251000 42.804617 1700 692.12647 + 252000 43.257666 1697 694.5812 + 253000 43.777656 1686 652.36951 + 254000 44.244131 1682 662.95256 + 255000 44.667759 1677 637.34619 + 256000 45.111967 1672 630.71277 + 257000 45.550194 1669 641.87365 + 258000 45.985106 1665 635.862 + 259000 46.42582 1664 658.5339 + 260000 46.860965 1662 669.95468 + 261000 47.298309 1660 676.93495 + 262000 47.748236 1657 681.72646 + 263000 48.215018 1655 687.4078 + 264000 48.657973 1651 681.61352 + 265000 49.076584 1647 673.20622 + 266000 49.497823 1644 677.30073 + 267000 49.917789 1641 671.05897 + 268000 50.347112 1639 689.55776 + 269000 50.778062 1637 711.98809 + 270000 51.226034 1633 705.29974 +Loop time of 51.2261 on 1 procs for 100000 steps with 1633 atoms + +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 27.462 | 27.462 | 27.462 | 0.0 | 53.61 +Neigh | 0.47887 | 0.47887 | 0.47887 | 0.0 | 0.93 +Comm | 0.058496 | 0.058496 | 0.058496 | 0.0 | 0.11 +Output | 0.0039167 | 0.0039167 | 0.0039167 | 0.0 | 0.01 +Modify | 22.566 | 22.566 | 22.566 | 0.0 | 44.05 +Other | | 0.6567 | | | 1.28 + +Nlocal: 1633 ave 1633 max 1633 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 11358 ave 11358 max 11358 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 11358 +Ave neighs/atom = 6.955297 +Neighbor list builds = 244 +Dangerous builds = 0 +Total wall time: 0:02:15 diff --git a/examples/granregion/log.16Mar23.granregion.funnel.g++.4 b/examples/granregion/log.16Mar23.granregion.funnel.g++.4 new file mode 100644 index 0000000000..451e508fe3 --- /dev/null +++ b/examples/granregion/log.16Mar23.granregion.funnel.g++.4 @@ -0,0 +1,635 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# pour particles into cone-shaped funnel, settle them, let them run out bottom + +variable name string funnel_pour + +thermo_modify flush yes +units si +variable PI equal 3.141592653589 +variable seed equal 14314 + +############################################### +# Geometry-related parameters +############################################### + +variable xlo equal 10 +variable xhi equal 40 +variable ylo equal 10 +variable yhi equal 40 +variable zlo equal -20 +variable zhi equal 50 + +variable xc equal 25 +variable yc equal 25 + +variable zconehi equal 50 +variable zconelo equal 10 +variable zcyllo equal 0 +variable radconelo equal 2 +variable radconehi equal 20 + +################################################ +# Particle sizes +################################################ + +variable rlo equal 0.25 +variable rhi equal 0.5 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.25 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.5 + +variable skin equal ${rhi} +variable skin equal 0.5 + +############################################### +# Granular contact parameters +############################################### + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable density equal 1.0 +variable EYoung equal 10^5 +variable Poisson equal 2.0/7.0 +variable GShear equal ${EYoung}/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+${Poisson})) +variable GShear equal 100000/(2*(1+0.285714285714286)) + +variable gravity equal 1.0 + +variable reff equal 0.5*(${rhi}+${rlo}) +variable reff equal 0.5*(0.5+${rlo}) +variable reff equal 0.5*(0.5+0.25) +variable meff equal ${density}*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*${PI}*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*${reff}^3 +variable meff equal 1*4.0/3.0*3.141592653589*0.375^3 +variable min_mass equal ${density}*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*${PI}*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*${rlo} +variable min_mass equal 1*4.0/3.0*3.141592653589*0.25*0.25*0.25 +variable max_mass equal ${density}*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*${PI}*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*${rhi}*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*${rhi}*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*${rhi} +variable max_mass equal 1*4.0/3.0*3.141592653589*0.5*0.5*0.5 + +## Typical way to set kn, kt, etc.: +variable kn equal 4.0*${GShear}/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-${Poisson})) +variable kn equal 4.0*38888.8888888889/(3*(1-0.285714285714286)) +variable kt equal 4.0*${GShear}/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-${Poisson}) +variable kt equal 4.0*38888.8888888889/(2-0.285714285714286) + +variable a equal (-2.0*log(${coeffRes})/${PI})^2 +variable a equal (-2.0*log(0.1)/${PI})^2 +variable a equal (-2.0*log(0.1)/3.141592653589)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569556*2*72592.5925925926/0.0654498469497708/(1+0.25*0.405284734569556)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 903.503751814138*0.5 + +variable tcol equal ${PI}/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/${min_mass}-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-${gamma_n}/4.0) +variable tcol equal 3.141592653589/sqrt(2*72592.5925925926/0.0654498469497708-903.503751814138/4.0) + +variable dt equal ${tcol}*0.05 +variable dt equal 0.00210943016014969*0.05 +timestep ${dt} +timestep 0.000105471508007485 + +############################################### +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton off +atom_style sphere + +boundary p p f + +region boxreg block ${xlo} ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 ${xhi} ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 ${ylo} ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 ${yhi} ${zlo} ${zhi} +region boxreg block 10 40 10 40 ${zlo} ${zhi} +region boxreg block 10 40 10 40 -20 ${zhi} +region boxreg block 10 40 10 40 -20 50 +create_box 1 boxreg +Created orthogonal box = (10 10 -20) to (40 40 50) + 1 by 1 by 4 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 +pair_style gran/hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.5 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 30, bins = 1 1 3 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/multi/newtoff + stencil: full/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +# insertion region for fix/pour + +region insreg cylinder z ${xc} ${yc} 10 30 50 side in units box +region insreg cylinder z 25 ${yc} 10 30 50 side in units box +region insreg cylinder z 25 25 10 30 50 side in units box + +# define cone and cylinder regions - see lammps doc on region command +# note new open options + +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 #Top is open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 2 + +region conereg cone z ${xc} ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 #Bottom and top are open +region conereg cone z 25 ${yc} ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 ${radconelo} ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 ${radconehi} ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 ${zconelo} ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 ${zconehi} side in units box open 1 open 2 +region conereg cone z 25 25 2 20 10 50 side in units box open 1 open 2 + +region hopreg union 2 conereg cylreg + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + + +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +fix ins all pour 2000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 ${dhi} dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens ${density} ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 ${density} +fix ins all pour 2000 1 42424 region insreg diam range 0.5 1 dens 1 1 +Particle insertion: 3000 every 59965 steps, 2000 by step 1 + +#dump 1 all custom ${dumpfreq} ${name}.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 3.0 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke +WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:895) +thermo_modify flush yes lost warn + +# Initial run to fill up the cone + +run 20000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 6.049 | 6.049 | 6.049 Mbytes + Step CPU Atoms KinEng + 0 0 0 -0 + 1000 0.55467905 2000 -0 + 2000 0.77825615 2000 -0 + 3000 0.99338813 2000 -0 + 4000 1.2048904 2000 -0 + 5000 1.4073987 2000 -0 + 6000 1.6070452 2000 -0 + 7000 1.8056594 2000 -0 + 8000 1.9907326 2000 -0 + 9000 2.1732359 2000 -0 + 10000 2.3525506 2000 -0 + 11000 2.4202338 2000 -0 + 12000 2.4883928 2000 -0 + 13000 2.5587335 2000 -0 + 14000 2.6327822 2000 -0 + 15000 2.7095893 2000 -0 + 16000 2.7909032 2000 -0 + 17000 2.8763781 2000 -0 + 18000 2.9671807 2000 -0 + 19000 3.05783 2000 -0 + 20000 3.1546642 2000 -0 +Loop time of 3.1547 on 4 procs for 20000 steps with 2000 atoms + +98.6% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.045592 | 0.12271 | 0.29398 | 28.5 | 3.89 +Neigh | 0.011353 | 0.019401 | 0.032667 | 5.7 | 0.61 +Comm | 0.043342 | 0.09899 | 0.1539 | 14.6 | 3.14 +Output | 0.00097884 | 0.0019761 | 0.0024333 | 1.3 | 0.06 +Modify | 0.8096 | 1.2822 | 2.26 | 50.7 | 40.65 +Other | | 1.629 | | | 51.65 + +Nlocal: 500 ave 510 max 493 min +Histogram: 1 1 0 0 0 1 0 0 0 1 +Nghost: 154 ave 227 max 79 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Neighs: 415.5 ave 610 max 258 min +Histogram: 1 1 0 0 0 0 1 0 0 1 + +Total # of neighbors = 1662 +Ave neighs/atom = 0.831 +Neighbor list builds = 71 +Dangerous builds = 0 +unfix ins +run 150000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.33 | 12.5 | 12.68 Mbytes + Step CPU Atoms KinEng + 20000 0 2000 6652.2957 + 21000 0.068149031 2000 6807.2201 + 22000 0.13906682 2000 6973.9359 + 23000 0.21167896 2000 7142.3648 + 24000 0.28828482 2000 7276.9717 + 25000 0.36895294 2000 7369.4191 + 26000 0.45705665 2000 7497.6526 + 27000 0.55283141 2000 7638.946 + 28000 0.65163553 2000 7780.0339 + 29000 0.75208427 2000 7881.8177 + 30000 0.85956458 2000 7967.2641 + 31000 0.94177635 2000 7994.9273 + 32000 1.0345834 2000 7937.0672 + 33000 1.1315152 2000 7774.0508 + 34000 1.2426423 2000 7591.1511 + 35000 1.3578344 2000 7357.5032 + 36000 1.4893311 2000 7147.3776 + 37000 1.6240315 2000 6980.0719 + 38000 1.7664339 2000 6813.0872 + 39000 1.91857 2000 6657.0694 + 40000 2.0835393 2000 6505.1356 + 41000 2.2038908 2000 6330.3106 + 42000 2.330345 2000 6148.0635 + 43000 2.4596185 2000 5933.4808 + 44000 2.5912876 2000 5759.5507 + 45000 2.7316375 2000 5510.4729 + 46000 2.8777238 2000 5332.8673 + 47000 3.0357893 2000 5164.4197 + 48000 3.1931582 2000 5027.4099 + 49000 3.341993 2000 4904.6999 + 50000 3.4914327 2000 4712.0967 + 51000 3.6880787 2000 4575.8693 + 52000 3.8868278 2000 4443.4894 + 53000 4.0538325 2000 4272.1666 + 54000 4.2275386 2000 4113.2811 + 55000 4.3935565 2000 3974.5981 + 56000 4.6008319 2000 3863.5272 + 57000 4.8305792 2000 3676.8918 + 58000 5.1085757 2000 3446.5177 + 59000 5.3025239 2000 3227.8857 + 60000 5.5061134 2000 2997.8151 + 61000 5.6771065 2000 2745.5998 + 62000 5.8533046 2000 2530.2536 + 63000 6.0266287 2000 2352.9283 + 64000 6.1975348 2000 2102.4916 + 65000 6.375875 2000 1906.3034 + 66000 6.6008814 2000 1683.179 + 67000 6.8728018 2000 1440.0663 + 68000 7.1104699 2000 1220.2743 + 69000 7.3660591 2000 1012.4596 + 70000 7.6208232 2000 796.99913 + 71000 7.8459169 2000 631.28788 + 72000 8.0433916 2000 459.93641 + 73000 8.2225178 2000 359.28959 + 74000 8.3982201 2000 286.19292 + 75000 8.5769976 2000 235.53259 + 76000 8.7541865 2000 187.55737 + 77000 9.0010462 2000 144.42323 + 78000 9.2721615 2000 116.12613 + 79000 9.4992863 2000 95.625301 + 80000 9.7368141 2000 82.645629 + 81000 9.9462546 2000 72.124657 + 82000 10.15281 2000 64.266704 + 83000 10.365519 2000 56.7285 + 84000 10.55069 2000 49.44393 + 85000 10.764107 2000 42.434733 + 86000 10.993211 2000 37.816266 + 87000 11.243268 2000 33.892006 + 88000 11.487204 2000 29.898596 + 89000 11.684173 2000 26.4401 + 90000 11.880908 2000 23.329056 + 91000 12.078366 2000 21.291141 + 92000 12.347446 2000 19.494401 + 93000 12.582632 2000 18.157646 + 94000 12.833491 2000 17.176709 + 95000 13.109452 2000 16.059418 + 96000 13.34541 2000 15.524934 + 97000 13.604566 2000 13.887097 + 98000 13.816696 2000 12.98846 + 99000 14.043128 2000 12.325347 + 100000 14.35998 2000 11.567779 + 101000 14.584033 2000 11.097346 + 102000 14.793606 2000 10.981696 + 103000 15.011832 2000 10.914661 + 104000 15.223053 2000 10.183009 + 105000 15.435892 2000 9.9825606 + 106000 15.651946 2000 9.5164341 + 107000 15.870696 2000 9.4270389 + 108000 16.237826 2000 9.2752131 + 109000 16.525601 2000 8.580319 + 110000 16.74452 2000 8.3138082 + 111000 16.991527 2000 7.826454 + 112000 17.322972 2000 7.5958866 + 113000 17.649386 2000 7.2760339 + 114000 17.967676 2000 7.2879075 + 115000 18.27941 2000 6.8298855 + 116000 18.619507 2000 6.6964815 + 117000 18.979092 2000 6.490952 + 118000 19.303215 2000 6.0204595 + 119000 19.683409 2000 5.9293145 + 120000 20.034873 2000 5.7244854 + 121000 20.329374 2000 5.4221021 + 122000 20.670529 2000 4.8227757 + 123000 20.970073 2000 4.7914829 + 124000 21.297132 2000 4.6895984 + 125000 21.524346 2000 4.4951309 + 126000 21.742931 2000 4.5186107 + 127000 21.983039 2000 4.5989696 + 128000 22.203881 2000 4.5578225 + 129000 22.428553 2000 4.2667783 + 130000 22.662049 2000 4.0855202 + 131000 22.893977 2000 4.129346 + 132000 23.134398 2000 4.1720282 + 133000 23.367561 2000 4.3178701 + 134000 23.614361 2000 4.1047803 + 135000 23.840139 2000 3.856834 + 136000 24.095293 2000 4.0099605 + 137000 24.320746 2000 4.1104868 + 138000 24.555868 2000 4.1538456 + 139000 24.798604 2000 4.3079797 + 140000 25.125474 2000 4.0655486 + 141000 25.360498 2000 4.1257388 + 142000 25.597535 2000 4.1180413 + 143000 25.824173 2000 4.2764691 + 144000 26.082826 2000 4.3992832 + 145000 26.307002 2000 4.0978942 + 146000 26.532413 2000 4.1776805 + 147000 26.759469 2000 4.2261665 + 148000 26.989405 2000 4.4049886 + 149000 27.215826 2000 4.5559941 + 150000 27.443235 2000 4.7449947 + 151000 27.670397 2000 4.962558 + 152000 27.901368 2000 4.8517188 + 153000 28.148201 2000 4.9263912 + 154000 28.379071 2000 4.6200149 + 155000 28.621063 2000 4.8289752 + 156000 28.870192 2000 5.043235 + 157000 29.105614 2000 5.2399981 + 158000 29.330537 2000 5.494424 + 159000 29.558095 2000 4.9215021 + 160000 29.785841 2000 4.8938104 + 161000 30.011182 2000 5.0832139 + 162000 30.23825 2000 5.2281894 + 163000 30.464829 2000 5.4710487 + 164000 30.719854 2000 5.7311326 + 165000 31.038065 2000 5.9048483 + 166000 31.340672 2000 6.1177544 + 167000 31.649901 2000 4.0749212 + 168000 31.928746 2000 4.0087545 + 169000 32.153717 2000 2.8333927 + 170000 32.380796 2000 2.6131424 +Loop time of 32.3808 on 4 procs for 150000 steps with 2000 atoms + +98.9% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 6.997 | 12.251 | 14.992 | 89.3 | 37.83 +Neigh | 0.1358 | 0.20191 | 0.24331 | 9.0 | 0.62 +Comm | 1.2102 | 2.0432 | 2.4992 | 36.1 | 6.31 +Output | 0.0079578 | 0.012222 | 0.020149 | 4.4 | 0.04 +Modify | 7.1333 | 9.974 | 12.03 | 56.2 | 30.80 +Other | | 7.899 | | | 24.39 + +Nlocal: 500 ave 547 max 414 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 447.5 ave 678 max 201 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Neighs: 4478.75 ave 5715 max 3358 min +Histogram: 1 0 0 1 0 0 1 0 0 1 + +Total # of neighbors = 17915 +Ave neighs/atom = 8.9575 +Neighbor list builds = 375 +Dangerous builds = 0 + +# remove "plug" - need to redefine cylinder region & union + +region cylreg delete +region hopreg delete +region cylreg cylinder z ${xc} ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 #Bottom & top are open +region cylreg cylinder z 25 ${yc} ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 ${radconelo} ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 ${zcyllo} ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 ${zconelo} side in units box open 1 open 2 +region cylreg cylinder z 25 25 2 0 10 side in units box open 1 open 2 + +region hopreg union 2 cylreg conereg + +unfix hopper3 +fix hopper3 all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 ${gamma_n} ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 ${gamma_t} ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 ${coeffFric} 1 region hopreg +fix hopper3 all wall/gran/region hertz/history 72592.5925925926 90740.7407407408 903.503751814138 451.751875907069 0.5 1 region hopreg + +run 100000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 12.34 | 12.53 | 12.68 Mbytes + Step CPU Atoms KinEng + 170000 0 2000 2.6131424 + 171000 0.22601136 2000 3.529459 + 172000 0.45221016 2000 4.7071494 + 173000 0.68427839 2000 6.3480095 + 174000 0.91114205 2000 8.8055429 + 175000 1.1431874 2000 12.020148 + 176000 1.3732197 2000 16.079961 + 177000 1.6051751 2000 20.911155 + 178000 1.8346523 2000 26.447901 + 179000 2.0762403 2000 32.277607 + 180000 2.3420473 2000 39.374754 + 181000 2.6328957 2000 46.824434 + 182000 2.8669203 2000 54.755937 + 183000 3.1047916 2000 63.957816 + 184000 3.3310346 2000 74.217343 + 185000 3.5685015 2000 85.472859 + 186000 3.7955114 2000 97.586962 + 187000 4.0326183 2000 110.39658 + 188000 4.267244 2000 123.54524 + 189000 4.4987867 2000 137.45798 + 190000 4.7358838 2000 151.81094 + 191000 4.9494874 2000 166.91945 + 192000 5.1552044 2000 182.93379 + 193000 5.3547002 2000 200.32195 + 194000 5.5590208 2000 218.31863 + 195000 5.7575332 2000 237.22122 + 196000 5.9520759 2000 255.12936 + 197000 6.1457469 2000 273.87347 + 198000 6.341216 2000 293.82126 + 199000 6.5397944 2000 315.13067 + 200000 6.7418645 2000 337.18517 + 201000 6.9368245 2000 359.48438 + 202000 7.1538903 2000 382.76229 + 203000 7.3864641 2000 408.60338 + 204000 7.6731476 2000 435.15421 + 205000 7.9053649 2000 462.53542 + 206000 8.1480905 2000 490.85791 + 207000 8.3856692 2000 519.80878 + 208000 8.6034715 2000 550.44978 + 209000 8.8046602 2000 581.78594 + 210000 9.0044136 2000 615.02491 + 211000 9.2216638 2000 649.34564 + 212000 9.4269046 2000 684.24357 + 213000 9.6587854 2000 720.72627 + 214000 9.8596293 2000 757.96901 + 215000 10.05877 2000 796.8493 + 216000 10.256066 2000 836.58839 + 217000 10.48718 2000 877.81823 + 218000 10.694787 2000 920.81077 + 219000 10.891455 2000 963.77552 + 220000 11.147269 2000 1007.6868 + 221000 11.400829 2000 1054.0654 + 222000 11.65238 2000 1102.4934 + 223000 11.846807 2000 1151.1348 + 224000 12.040148 2000 1200.6622 + 225000 12.229259 2000 1251.5126 +WARNING: Lost atoms: original 2000 current 1999 (src/thermo.cpp:487) + 226000 12.420863 1999 1299.6349 + 227000 12.635492 1997 1338.1126 + 228000 12.827738 1987 1354.6661 + 229000 13.016127 1980 1369.1412 + 230000 13.211511 1970 1369.1776 + 231000 13.404909 1963 1377.7863 + 232000 13.602332 1950 1362.1028 + 233000 13.796103 1938 1344.4535 + 234000 13.988442 1924 1318.1397 + 235000 14.185813 1907 1269.3181 + 236000 14.378388 1895 1242.269 + 237000 14.568867 1881 1188.0729 + 238000 14.75676 1868 1162.8778 + 239000 14.947894 1854 1111.9974 + 240000 15.160004 1840 1050.2813 + 241000 15.340495 1831 1024.5782 + 242000 15.523597 1816 980.07203 + 243000 15.725193 1807 973.84606 + 244000 15.902549 1796 936.95947 + 245000 16.081382 1790 916.53685 + 246000 16.261081 1780 893.82891 + 247000 16.451727 1770 853.09944 + 248000 16.628641 1755 804.73429 + 249000 16.804105 1749 773.19378 + 250000 16.978354 1738 734.78084 + 251000 17.152527 1725 668.92528 + 252000 17.328291 1717 651.36038 + 253000 17.512786 1706 595.48412 + 254000 17.695931 1699 564.79829 + 255000 17.874221 1695 558.19897 + 256000 18.050516 1693 568.02459 + 257000 18.228697 1692 584.97166 + 258000 18.400925 1689 574.19701 + 259000 18.576449 1687 583.36332 + 260000 18.754006 1684 577.56927 + 261000 18.946091 1681 582.0375 + 262000 19.182957 1679 583.29644 + 263000 19.394795 1676 575.09831 + 264000 19.604668 1673 575.78272 + 265000 19.81517 1672 595.66572 + 266000 20.046658 1670 610.84262 + 267000 20.332684 1665 588.36505 + 268000 20.573691 1662 593.44831 + 269000 20.800574 1660 600.31964 + 270000 21.058624 1656 588.46212 +Loop time of 21.0587 on 4 procs for 100000 steps with 1656 atoms + +99.0% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.8632 | 8.4037 | 11.541 | 97.3 | 39.91 +Neigh | 0.13431 | 0.15665 | 0.17248 | 3.8 | 0.74 +Comm | 0.70516 | 1.4552 | 1.9637 | 40.7 | 6.91 +Output | 0.0030904 | 0.0079543 | 0.016722 | 5.9 | 0.04 +Modify | 5.3661 | 6.1781 | 6.8249 | 22.0 | 29.34 +Other | | 4.857 | | | 23.06 + +Nlocal: 414 ave 426 max 385 min +Histogram: 1 0 0 0 0 0 0 0 0 3 +Nghost: 408 ave 634 max 183 min +Histogram: 1 0 0 1 0 0 1 0 0 1 +Neighs: 3463 ave 4360 max 2354 min +Histogram: 1 0 0 1 0 0 0 0 1 1 + +Total # of neighbors = 13852 +Ave neighs/atom = 8.3647343 +Neighbor list builds = 255 +Dangerous builds = 0 +Total wall time: 0:00:56 diff --git a/examples/granregion/log.16Mar23.granregion.mixer.g++.1 b/examples/granregion/log.16Mar23.granregion.mixer.g++.1 new file mode 100644 index 0000000000..3fc012d20c --- /dev/null +++ b/examples/granregion/log.16Mar23.granregion.mixer.g++.1 @@ -0,0 +1,634 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +variable name string mixer + +thermo_modify flush yes +variable seed equal 14314 + +############################################### +# Particle parameters +################################################ + +variable rlo equal 0.3 +variable rhi equal 0.6 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.3 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.6 +variable skin equal ${rhi} +variable skin equal 0.6 + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable kn equal 10^5 +variable kt equal 0.2*${kn} +variable kt equal 0.2*100000 + +variable gravity equal 1.0 +variable density equal 1.0 + +variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 +variable a equal (-2.0*log(${coeffRes})/PI)^2 +variable a equal (-2.0*log(0.1)/PI)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 806.699778405191*0.5 + +variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) + +variable dt equal ${tcol}*0.02 +variable dt equal 0.00236257621510454*0.02 +timestep ${dt} +timestep 4.72515243020908e-05 + +############################################### + +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton on +atom_style sphere + +boundary p p f + +region boxreg block 0 20 0 20 0 20 +create_box 1 boxreg +Created orthogonal box = (0 0 0) to (20 20 20) + 1 by 1 by 1 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.6 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 20, bins = 1 1 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton on, size, history + pair build: half/size/multi/newton + stencil: half/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +region insreg cylinder z 10 10 8 10 18 side in units box +region cylreg cylinder z 10 10 10 0 20 side in units box + +variable theta equal (step/400000)*2*PI + +region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box +region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box + +region mixer intersect 3 cylreg b1 b2 side in + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + +fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer + +fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 +Particle insertion: 444 every 84653 steps, 1000 by step 169307 + +#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke v_theta +WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:895) +thermo_modify flush yes lost warn + +run 200000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.861 | 5.861 | 5.861 Mbytes + Step CPU Atoms KinEng v_theta + 0 0 0 -0 0 + 1000 0.11477344 444 -0 0.015707963 + 2000 0.21604269 444 -0 0.031415927 + 3000 0.31421365 444 -0 0.04712389 + 4000 0.41095902 444 -0 0.062831853 + 5000 0.50703042 444 -0 0.078539816 + 6000 0.60585007 444 -0 0.09424778 + 7000 0.70232419 444 -0 0.10995574 + 8000 0.80002622 444 -0 0.12566371 + 9000 0.89464008 444 -0 0.14137167 + 10000 0.99260726 444 -0 0.15707963 + 11000 1.090675 444 -0 0.1727876 + 12000 1.1878107 444 -0 0.18849556 + 13000 1.2860401 444 -0 0.20420352 + 14000 1.3830433 444 -0 0.21991149 + 15000 1.4834023 444 -0 0.23561945 + 16000 1.5799984 444 -0 0.25132741 + 17000 1.6758091 444 -0 0.26703538 + 18000 1.7713554 444 -0 0.28274334 + 19000 1.8684734 444 -0 0.2984513 + 20000 1.9661563 444 -0 0.31415927 + 21000 2.0629748 444 -0 0.32986723 + 22000 2.1575594 444 -0 0.34557519 + 23000 2.2530422 444 -0 0.36128316 + 24000 2.3525179 444 -0 0.37699112 + 25000 2.4494323 444 -0 0.39269908 + 26000 2.5454666 444 -0 0.40840704 + 27000 2.6402269 444 -0 0.42411501 + 28000 2.7364338 444 -0 0.43982297 + 29000 2.8349 444 -0 0.45553093 + 30000 2.9327959 444 -0 0.4712389 + 31000 3.0304534 444 -0 0.48694686 + 32000 3.1315005 444 -0 0.50265482 + 33000 3.2290307 444 -0 0.51836279 + 34000 3.3243787 444 -0 0.53407075 + 35000 3.4232964 444 -0 0.54977871 + 36000 3.5235978 444 -0 0.56548668 + 37000 3.6214101 444 -0 0.58119464 + 38000 3.7179412 444 -0 0.5969026 + 39000 3.8159856 444 -0 0.61261057 + 40000 3.9121916 444 -0 0.62831853 + 41000 4.0080794 444 -0 0.64402649 + 42000 4.1087349 444 -0 0.65973446 + 43000 4.2059697 444 -0 0.67544242 + 44000 4.3043867 444 -0 0.69115038 + 45000 4.4014253 444 -0 0.70685835 + 46000 4.5000241 444 -0 0.72256631 + 47000 4.5970258 444 -0 0.73827427 + 48000 4.6929243 444 -0 0.75398224 + 49000 4.7894702 444 -0 0.7696902 + 50000 4.8858098 444 -0 0.78539816 + 51000 4.985063 444 -0 0.80110613 + 52000 5.0863877 444 -0 0.81681409 + 53000 5.181301 444 -0 0.83252205 + 54000 5.2819523 444 -0 0.84823002 + 55000 5.3895357 444 -0 0.86393798 + 56000 5.5225568 444 -0 0.87964594 + 57000 5.6473901 444 -0 0.89535391 + 58000 5.7786123 444 -0 0.91106187 + 59000 5.8932617 444 -0 0.92676983 + 60000 6.004952 444 -0 0.9424778 + 61000 6.1168028 444 -0 0.95818576 + 62000 6.2274784 444 -0 0.97389372 + 63000 6.341172 444 -0 0.98960169 + 64000 6.4565154 444 -0 1.0053096 + 65000 6.5684785 444 -0 1.0210176 + 66000 6.6836542 444 -0 1.0367256 + 67000 6.797745 444 -0 1.0524335 + 68000 6.9091592 444 -0 1.0681415 + 69000 7.0230958 444 -0 1.0838495 + 70000 7.140508 444 -0 1.0995574 + 71000 7.2547153 444 -0 1.1152654 + 72000 7.3698096 444 -0 1.1309734 + 73000 7.4846587 444 -0 1.1466813 + 74000 7.6005538 444 -0 1.1623893 + 75000 7.715498 444 -0 1.1780972 + 76000 7.8306339 444 -0 1.1938052 + 77000 7.9458861 444 -0 1.2095132 + 78000 8.0608796 444 -0 1.2252211 + 79000 8.1819612 444 -0 1.2409291 + 80000 8.3017939 444 -0 1.2566371 + 81000 8.4206794 444 -0 1.272345 + 82000 8.5396045 444 -0 1.288053 + 83000 8.6588178 444 -0 1.303761 + 84000 8.7939815 444 -0 1.3194689 + 85000 8.9999511 888 -0 1.3351769 + 86000 9.2762515 888 -0 1.3508848 + 87000 9.5497189 888 -0 1.3665928 + 88000 9.8025426 888 -0 1.3823008 + 89000 10.063005 888 -0 1.3980087 + 90000 10.343956 888 -0 1.4137167 + 91000 10.630004 888 -0 1.4294247 + 92000 10.865437 888 -0 1.4451326 + 93000 11.090302 888 -0 1.4608406 + 94000 11.306921 888 -0 1.4765485 + 95000 11.525442 888 -0 1.4922565 + 96000 11.786482 888 -0 1.5079645 + 97000 12.033336 888 -0 1.5236724 + 98000 12.258224 888 -0 1.5393804 + 99000 12.486583 888 -0 1.5550884 + 100000 12.70566 888 -0 1.5707963 + 101000 12.934051 888 -0 1.5865043 + 102000 13.194977 888 -0 1.6022123 + 103000 13.503561 888 -0 1.6179202 + 104000 13.737785 888 -0 1.6336282 + 105000 13.96388 888 -0 1.6493361 + 106000 14.190156 888 -0 1.6650441 + 107000 14.416346 888 -0 1.6807521 + 108000 14.642321 888 -0 1.69646 + 109000 14.877668 888 -0 1.712168 + 110000 15.114644 888 -0 1.727876 + 111000 15.354762 888 -0 1.7435839 + 112000 15.615795 888 -0 1.7592919 + 113000 15.854301 888 -0 1.7749998 + 114000 16.099855 888 -0 1.7907078 + 115000 16.344044 888 -0 1.8064158 + 116000 16.60829 888 -0 1.8221237 + 117000 16.847146 888 -0 1.8378317 + 118000 17.086787 888 -0 1.8535397 + 119000 17.324264 888 -0 1.8692476 + 120000 17.563913 888 -0 1.8849556 + 121000 17.798333 888 -0 1.9006636 + 122000 18.033339 888 -0 1.9163715 + 123000 18.275883 888 -0 1.9320795 + 124000 18.542879 888 -0 1.9477874 + 125000 18.790098 888 -0 1.9634954 + 126000 19.034113 888 -0 1.9792034 + 127000 19.286183 888 -0 1.9949113 + 128000 19.574764 888 -0 2.0106193 + 129000 19.832536 888 -0 2.0263273 + 130000 20.085705 888 -0 2.0420352 + 131000 20.327805 888 -0 2.0577432 + 132000 20.576476 888 -0 2.0734512 + 133000 20.82021 888 -0 2.0891591 + 134000 21.063425 888 -0 2.1048671 + 135000 21.304848 888 -0 2.120575 + 136000 21.554936 888 -0 2.136283 + 137000 21.797949 888 -0 2.151991 + 138000 22.041181 888 -0 2.1676989 + 139000 22.288509 888 -0 2.1834069 + 140000 22.539512 888 -0 2.1991149 + 141000 22.786046 888 -0 2.2148228 + 142000 23.052553 888 -0 2.2305308 + 143000 23.321282 888 -0 2.2462387 + 144000 23.619171 888 -0 2.2619467 + 145000 23.918581 888 -0 2.2776547 + 146000 24.200849 888 -0 2.2933626 + 147000 24.500127 888 -0 2.3090706 + 148000 24.756357 888 -0 2.3247786 + 149000 25.015262 888 -0 2.3404865 + 150000 25.271136 888 -0 2.3561945 + 151000 25.519846 888 -0 2.3719025 + 152000 25.780481 888 -0 2.3876104 + 153000 26.027917 888 -0 2.4033184 + 154000 26.277021 888 -0 2.4190263 + 155000 26.54158 888 -0 2.4347343 + 156000 26.828357 888 -0 2.4504423 + 157000 27.172993 888 -0 2.4661502 + 158000 27.454171 888 -0 2.4818582 + 159000 27.72964 888 -0 2.4975662 + 160000 28.007464 888 -0 2.5132741 + 161000 28.28268 888 -0 2.5289821 + 162000 28.561094 888 -0 2.54469 + 163000 28.839295 888 -0 2.560398 + 164000 29.117588 888 -0 2.576106 + 165000 29.394126 888 -0 2.5918139 + 166000 29.675102 888 -0 2.6075219 + 167000 29.951524 888 -0 2.6232299 + 168000 30.233181 888 -0 2.6389378 + 169000 30.516798 888 -0 2.6546458 + 170000 30.818897 1000 -0 2.6703538 + 171000 31.215403 1000 -0 2.6860617 + 172000 31.528362 1000 -0 2.7017697 + 173000 31.844759 1000 -0 2.7174776 + 174000 32.159787 1000 -0 2.7331856 + 175000 32.482605 1000 -0 2.7488936 + 176000 32.798004 1000 -0 2.7646015 + 177000 33.112668 1000 -0 2.7803095 + 178000 33.429501 1000 -0 2.7960175 + 179000 33.74646 1000 -0 2.8117254 + 180000 34.059172 1000 -0 2.8274334 + 181000 34.381226 1000 -0 2.8431414 + 182000 34.697465 1000 -0 2.8588493 + 183000 35.008892 1000 -0 2.8745573 + 184000 35.332856 1000 -0 2.8902652 + 185000 35.650733 1000 -0 2.9059732 + 186000 35.971328 1000 -0 2.9216812 + 187000 36.298046 1000 -0 2.9373891 + 188000 36.622634 1000 -0 2.9530971 + 189000 36.945728 1000 -0 2.9688051 + 190000 37.268801 1000 -0 2.984513 + 191000 37.592615 1000 -0 3.000221 + 192000 37.915197 1000 -0 3.0159289 + 193000 38.226138 1000 -0 3.0316369 + 194000 38.534735 1000 -0 3.0473449 + 195000 38.844711 1000 -0 3.0630528 + 196000 39.159518 1000 -0 3.0787608 + 197000 39.474235 1000 -0 3.0944688 + 198000 39.786609 1000 -0 3.1101767 + 199000 40.10213 1000 -0 3.1258847 + 200000 40.421226 1000 -0 3.1415927 +Loop time of 40.4213 on 1 procs for 200000 steps with 1000 atoms + +Performance: 20199.903 tau/day, 4947.886 timesteps/s, 4.948 Matom-step/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.6681 | 3.6681 | 3.6681 | 0.0 | 9.07 +Neigh | 0.050194 | 0.050194 | 0.050194 | 0.0 | 0.12 +Comm | 0.53308 | 0.53308 | 0.53308 | 0.0 | 1.32 +Output | 0.0071363 | 0.0071363 | 0.0071363 | 0.0 | 0.02 +Modify | 35.563 | 35.563 | 35.563 | 0.0 | 87.98 +Other | | 0.5999 | | | 1.48 + +Nlocal: 1000 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 197 ave 197 max 197 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 3812 ave 3812 max 3812 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 3812 +Ave neighs/atom = 3.812 +Neighbor list builds = 205 +Dangerous builds = 0 +unfix ins +run 200000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 11.89 | 11.89 | 11.89 Mbytes + Step CPU Atoms KinEng v_theta + 200000 0 1000 1.0188213 3.1415927 + 201000 0.31745969 1000 1.0237918 3.1573006 + 202000 0.6315036 1000 1.0177231 3.1730086 + 203000 0.9480314 1000 1.0127096 3.1887165 + 204000 1.2572431 1000 1.0084386 3.2044245 + 205000 1.5683429 1000 0.9957528 3.2201325 + 206000 1.8801922 1000 1.0003921 3.2358404 + 207000 2.1905883 1000 0.99358387 3.2515484 + 208000 2.4948426 1000 0.99103748 3.2672564 + 209000 2.8195665 1000 0.98488628 3.2829643 + 210000 3.1420952 1000 0.98305824 3.2986723 + 211000 3.4618849 1000 0.97185818 3.3143802 + 212000 3.7910078 1000 0.96191966 3.3300882 + 213000 4.1184009 1000 0.95953159 3.3457962 + 214000 4.4491355 1000 0.95307268 3.3615041 + 215000 4.7782398 1000 0.95612155 3.3772121 + 216000 5.1088177 1000 0.96582166 3.3929201 + 217000 5.4376503 1000 0.96124408 3.408628 + 218000 5.7707229 1000 0.95705813 3.424336 + 219000 6.1055922 1000 0.9660222 3.440044 + 220000 6.4418056 1000 0.97539486 3.4557519 + 221000 6.7755181 1000 0.97919396 3.4714599 + 222000 7.104521 1000 0.97448171 3.4871678 + 223000 7.4368025 1000 0.95742917 3.5028758 + 224000 7.7623405 1000 0.94218245 3.5185838 + 225000 8.0932682 1000 0.93056484 3.5342917 + 226000 8.4217598 1000 0.92009109 3.5499997 + 227000 8.747426 1000 0.90684871 3.5657077 + 228000 9.0818038 1000 0.91719046 3.5814156 + 229000 9.4125504 1000 0.92681746 3.5971236 + 230000 9.7439963 1000 0.9195493 3.6128316 + 231000 10.075499 1000 0.93275667 3.6285395 + 232000 10.404017 1000 0.9494565 3.6442475 + 233000 10.774786 1000 0.95036607 3.6599554 + 234000 11.158713 1000 0.9596283 3.6756634 + 235000 11.566878 1000 0.98314341 3.6913714 + 236000 11.977294 1000 0.98115865 3.7070793 + 237000 12.347191 1000 0.9723466 3.7227873 + 238000 12.686388 1000 0.95267817 3.7384953 + 239000 13.031631 1000 0.92661956 3.7542032 + 240000 13.451121 1000 0.92237207 3.7699112 + 241000 13.855031 1000 0.91301732 3.7856191 + 242000 14.272001 1000 0.90488754 3.8013271 + 243000 14.632631 1000 0.90430417 3.8170351 + 244000 14.97608 1000 0.90179051 3.832743 + 245000 15.419173 1000 0.89658897 3.848451 + 246000 15.903699 1000 0.89583335 3.864159 + 247000 16.312374 1000 0.89409138 3.8798669 + 248000 16.660472 1000 0.89948364 3.8955749 + 249000 17.063147 1000 0.90196936 3.9112829 + 250000 17.423622 1000 0.89616943 3.9269908 + 251000 17.76439 1000 0.87816303 3.9426988 + 252000 18.103828 1000 0.86705341 3.9584067 + 253000 18.454644 1000 0.84494344 3.9741147 + 254000 18.876297 1000 0.81541663 3.9898227 + 255000 19.264851 1000 0.80071805 4.0055306 + 256000 19.669757 1000 0.80290754 4.0212386 + 257000 20.066097 1000 0.80000385 4.0369466 + 258000 20.481516 1000 0.80379277 4.0526545 + 259000 20.851537 1000 0.81091684 4.0683625 + 260000 21.246226 1000 0.80124855 4.0840704 + 261000 21.586832 1000 0.79581606 4.0997784 + 262000 21.968726 1000 0.78415946 4.1154864 + 263000 22.388474 1000 0.78837276 4.1311943 + 264000 22.76238 1000 0.78962435 4.1469023 + 265000 23.13787 1000 0.79388706 4.1626103 + 266000 23.470742 1000 0.80484385 4.1783182 + 267000 23.801402 1000 0.79505699 4.1940262 + 268000 24.14266 1000 0.78663829 4.2097342 + 269000 24.545281 1000 0.77557297 4.2254421 + 270000 24.886776 1000 0.76992342 4.2411501 + 271000 25.218744 1000 0.75955867 4.256858 + 272000 25.549898 1000 0.76207709 4.272566 + 273000 25.882738 1000 0.76891185 4.288274 + 274000 26.212384 1000 0.77380617 4.3039819 + 275000 26.540612 1000 0.77349795 4.3196899 + 276000 26.869636 1000 0.77559636 4.3353979 + 277000 27.200449 1000 0.76806972 4.3511058 + 278000 27.548549 1000 0.76223861 4.3668138 + 279000 27.883681 1000 0.76306533 4.3825218 + 280000 28.221552 1000 0.76369569 4.3982297 + 281000 28.558479 1000 0.75945303 4.4139377 + 282000 28.892758 1000 0.75872312 4.4296456 + 283000 29.224927 1000 0.75354345 4.4453536 + 284000 29.565477 1000 0.74433058 4.4610616 + 285000 29.914679 1000 0.7349005 4.4767695 + 286000 30.265305 1000 0.73182808 4.4924775 + 287000 30.607982 1000 0.73334122 4.5081855 + 288000 30.94168 1000 0.73308623 4.5238934 + 289000 31.276062 1000 0.73620818 4.5396014 + 290000 31.614934 1000 0.73906492 4.5553093 + 291000 31.959782 1000 0.73921306 4.5710173 + 292000 32.296279 1000 0.73919766 4.5867253 + 293000 32.615262 1000 0.75148875 4.6024332 + 294000 32.93925 1000 0.76390126 4.6181412 + 295000 33.266316 1000 0.76421084 4.6338492 + 296000 33.591115 1000 0.78124272 4.6495571 + 297000 33.924279 1000 0.78526224 4.6652651 + 298000 34.256265 1000 0.78279226 4.6809731 + 299000 34.584382 1000 0.78390001 4.696681 + 300000 34.910629 1000 0.78017239 4.712389 + 301000 35.233205 1000 0.77432653 4.7280969 + 302000 35.55956 1000 0.7627792 4.7438049 + 303000 35.885484 1000 0.75222273 4.7595129 + 304000 36.205453 1000 0.73765921 4.7752208 + 305000 36.525101 1000 0.72338298 4.7909288 + 306000 36.845236 1000 0.71944975 4.8066368 + 307000 37.168044 1000 0.71547274 4.8223447 + 308000 37.491196 1000 0.71267737 4.8380527 + 309000 37.827079 1000 0.70506173 4.8537606 + 310000 38.168049 1000 0.70685173 4.8694686 + 311000 38.504282 1000 0.70327488 4.8851766 + 312000 38.846152 1000 0.69732519 4.9008845 + 313000 39.191958 1000 0.70137823 4.9165925 + 314000 39.532177 1000 0.70613806 4.9323005 + 315000 39.876728 1000 0.70981591 4.9480084 + 316000 40.225244 1000 0.72246602 4.9637164 + 317000 40.573681 1000 0.71946499 4.9794244 + 318000 40.918134 1000 0.73275857 4.9951323 + 319000 41.261914 1000 0.74357547 5.0108403 + 320000 41.607984 1000 0.74138038 5.0265482 + 321000 41.957822 1000 0.73285846 5.0422562 + 322000 42.30176 1000 0.72990718 5.0579642 + 323000 42.644077 1000 0.72024459 5.0736721 + 324000 42.985509 1000 0.71052943 5.0893801 + 325000 43.323921 1000 0.69560261 5.1050881 + 326000 43.664945 1000 0.69939398 5.120796 + 327000 44.004741 1000 0.71331291 5.136504 + 328000 44.347204 1000 0.72181082 5.152212 + 329000 44.689866 1000 0.72534262 5.1679199 + 330000 45.055673 1000 0.73874292 5.1836279 + 331000 45.400501 1000 0.74135464 5.1993358 + 332000 45.743289 1000 0.73578005 5.2150438 + 333000 46.087061 1000 0.72662516 5.2307518 + 334000 46.427231 1000 0.72030125 5.2464597 + 335000 46.767813 1000 0.72801784 5.2621677 + 336000 47.108619 1000 0.73020974 5.2778757 + 337000 47.44666 1000 0.7344527 5.2935836 + 338000 47.784653 1000 0.73826638 5.3092916 + 339000 48.124114 1000 0.74079395 5.3249995 + 340000 48.463953 1000 0.74030413 5.3407075 + 341000 48.804616 1000 0.74815855 5.3564155 + 342000 49.143226 1000 0.75762011 5.3721234 + 343000 49.482788 1000 0.76311094 5.3878314 + 344000 49.822597 1000 0.76394459 5.4035394 + 345000 50.162186 1000 0.75550163 5.4192473 + 346000 50.496689 1000 0.7594991 5.4349553 + 347000 50.831695 1000 0.76650932 5.4506633 + 348000 51.167201 1000 0.76750437 5.4663712 + 349000 51.501847 1000 0.77084248 5.4820792 + 350000 51.841805 1000 0.76487701 5.4977871 + 351000 52.179907 1000 0.76870148 5.5134951 + 352000 52.517605 1000 0.77597853 5.5292031 + 353000 52.850047 1000 0.77929348 5.544911 + 354000 53.182408 1000 0.7744937 5.560619 + 355000 53.512931 1000 0.76114616 5.576327 + 356000 53.845782 1000 0.75392687 5.5920349 + 357000 54.178336 1000 0.74858889 5.6077429 + 358000 54.514517 1000 0.75630978 5.6234508 + 359000 54.850783 1000 0.75781107 5.6391588 + 360000 55.183323 1000 0.75613713 5.6548668 + 361000 55.518704 1000 0.75250391 5.6705747 + 362000 55.851425 1000 0.75790051 5.6862827 + 363000 56.212376 1000 0.75283475 5.7019907 + 364000 56.542027 1000 0.7431151 5.7176986 + 365000 56.874325 1000 0.73274509 5.7334066 + 366000 57.208926 1000 0.72261631 5.7491146 + 367000 57.596495 1000 0.71279773 5.7648225 + 368000 58.007863 1000 0.70452113 5.7805305 + 369000 58.346944 1000 0.69777381 5.7962384 + 370000 58.686215 1000 0.69698007 5.8119464 + 371000 59.030366 1000 0.69322062 5.8276544 + 372000 59.368607 1000 0.67728454 5.8433623 + 373000 59.704376 1000 0.67335006 5.8590703 + 374000 60.044772 1000 0.66920493 5.8747783 + 375000 60.382875 1000 0.65614401 5.8904862 + 376000 60.72002 1000 0.65874131 5.9061942 + 377000 61.058554 1000 0.67072465 5.9219022 + 378000 61.400078 1000 0.68118419 5.9376101 + 379000 61.748931 1000 0.68481865 5.9533181 + 380000 62.098203 1000 0.68840839 5.969026 + 381000 62.444961 1000 0.69447162 5.984734 + 382000 62.797286 1000 0.69881397 6.000442 + 383000 63.154921 1000 0.69610171 6.0161499 + 384000 63.508448 1000 0.70059329 6.0318579 + 385000 63.857115 1000 0.71085103 6.0475659 + 386000 64.207915 1000 0.71532684 6.0632738 + 387000 64.561127 1000 0.72968624 6.0789818 + 388000 64.939826 1000 0.74729894 6.0946897 + 389000 65.284635 1000 0.76268063 6.1103977 + 390000 65.631752 1000 0.77170089 6.1261057 + 391000 65.981566 1000 0.77212462 6.1418136 + 392000 66.328406 1000 0.773784 6.1575216 + 393000 66.655905 1000 0.7731096 6.1732296 + 394000 66.993751 1000 0.77245259 6.1889375 + 395000 67.322842 1000 0.76912533 6.2046455 + 396000 67.647532 1000 0.76397972 6.2203535 + 397000 67.977448 1000 0.75736166 6.2360614 + 398000 68.310064 1000 0.75287599 6.2517694 + 399000 68.635966 1000 0.75354368 6.2674773 + 400000 68.963492 1000 0.75582397 6.2831853 +Loop time of 68.9635 on 1 procs for 200000 steps with 1000 atoms + +Performance: 11839.683 tau/day, 2900.084 timesteps/s, 2.900 Matom-step/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 11.238 | 11.238 | 11.238 | 0.0 | 16.30 +Neigh | 0.077817 | 0.077817 | 0.077817 | 0.0 | 0.11 +Comm | 1.5441 | 1.5441 | 1.5441 | 0.0 | 2.24 +Output | 0.0082341 | 0.0082341 | 0.0082341 | 0.0 | 0.01 +Modify | 55.304 | 55.304 | 55.304 | 0.0 | 80.19 +Other | | 0.7909 | | | 1.15 + +Nlocal: 1000 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 278 ave 278 max 278 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 5072 ave 5072 max 5072 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 5072 +Ave neighs/atom = 5.072 +Neighbor list builds = 166 +Dangerous builds = 0 +Total wall time: 0:01:49 diff --git a/examples/granregion/log.16Mar23.granregion.mixer.g++.4 b/examples/granregion/log.16Mar23.granregion.mixer.g++.4 new file mode 100644 index 0000000000..b601f3f13a --- /dev/null +++ b/examples/granregion/log.16Mar23.granregion.mixer.g++.4 @@ -0,0 +1,634 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +variable name string mixer + +thermo_modify flush yes +variable seed equal 14314 + +############################################### +# Particle parameters +################################################ + +variable rlo equal 0.3 +variable rhi equal 0.6 +variable dlo equal 2.0*${rlo} +variable dlo equal 2.0*0.3 +variable dhi equal 2.0*${rhi} +variable dhi equal 2.0*0.6 +variable skin equal ${rhi} +variable skin equal 0.6 + +variable coeffRes equal 0.1 +variable coeffFric equal 0.5 + +variable kn equal 10^5 +variable kt equal 0.2*${kn} +variable kt equal 0.2*100000 + +variable gravity equal 1.0 +variable density equal 1.0 + +variable min_mass equal ${density}*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*${rlo}*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*${rlo}*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*${rlo} +variable min_mass equal 1*4.0/3.0*PI*0.3*0.3*0.3 +variable a equal (-2.0*log(${coeffRes})/PI)^2 +variable a equal (-2.0*log(0.1)/PI)^2 +variable gamma_n equal sqrt($a*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*${kn}/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/${min_mass}/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*$a)) +variable gamma_n equal sqrt(0.405284734569351*2*100000/0.113097335529233/(1+0.25*0.405284734569351)) +variable gamma_t equal ${gamma_n}*0.5 +variable gamma_t equal 806.699778405191*0.5 + +variable tcol equal PI/sqrt(2*${kn}/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/${min_mass}-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-${gamma_n}/4.0) +variable tcol equal PI/sqrt(2*100000/0.113097335529233-806.699778405191/4.0) + +variable dt equal ${tcol}*0.02 +variable dt equal 0.00236257621510454*0.02 +timestep ${dt} +timestep 4.72515243020908e-05 + +############################################### + +variable dumpfreq equal 1000 +variable logfreq equal 1000 + +newton on +atom_style sphere + +boundary p p f + +region boxreg block 0 20 0 20 0 20 +create_box 1 boxreg +Created orthogonal box = (0 0 0) to (20 20 20) + 1 by 2 by 2 MPI processor grid + +pair_style gran/hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 +pair_style gran/hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 +pair_coeff * * + +neighbor ${skin} multi +neighbor 0.6 multi +thermo ${logfreq} +thermo 1000 + +comm_style brick +comm_modify mode multi group all vel yes +balance 1.1 shift xyz 20 1.1 +Balancing ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0 + ghost atom cutoff = 0 + binsize = 20, bins = 1 1 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton on, size, history + pair build: half/size/multi/newton + stencil: half/multi/3d + bin: multi +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:210) +fix bal all balance 10000 1.1 shift xyz 20 1.01 + +####################### Options specific to pouring ######################### + +region insreg cylinder z 10 10 8 10 18 side in units box +region cylreg cylinder z 10 10 10 0 20 side in units box + +variable theta equal (step/400000)*2*PI + +region b1 block 2 18 9 11 0 4 side out rotate v_theta 10 10 0 0 0 1 units box +region b2 block 9 11 2 18 0 3.99999 side out rotate v_theta 10 10 0 0 0 1 units box + +region mixer intersect 3 cylreg b1 b2 side in + +fix grav all gravity ${gravity} vector 0 0 -1 +fix grav all gravity 1 vector 0 0 -1 +fix 1 all nve/sphere + +fix mixwall all wall/gran/region hertz/history ${kn} ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 ${kt} ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 ${gamma_n} ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 ${gamma_t} ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 ${coeffFric} 1 region mixer +fix mixwall all wall/gran/region hertz/history 100000 20000 806.699778405191 403.349889202595 0.5 1 region mixer + +fix ins all pour 1000 1 42424 region insreg diam range ${dlo} ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 ${dhi} dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens ${density} ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 ${density} +fix ins all pour 1000 1 42424 region insreg diam range 0.6 1.2 dens 1 1 +Particle insertion: 444 every 84653 steps, 1000 by step 169307 + +#dump 1 all custom ${dumpfreq} ${name}_pour.dump # id type mass diameter x y z + +#dump 2 all image 4000 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 zoom 1.5 # box no 0.0 axes no 0.0 0.0 +#dump_modify 2 pad 6 + +thermo_style custom step cpu atoms ke v_theta +WARNING: New thermo_style command, previous thermo_modify settings will be lost (src/output.cpp:895) +thermo_modify flush yes lost warn + +run 200000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2 + +@Article{Intveld08, + author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest}, + title = {Accurate and Efficient Methods for Modeling Colloidal + Mixtures in an Explicit Solvent using Molecular Dynamics}, + journal = {Comput.\ Phys.\ Commut.}, + year = 2008, + volume = 179, + pages = {320--329} +} + +@article{Shire2020, + author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin}, + title = {{DEM} Simulations of Polydisperse Media: Efficient Contact + Detection Applied to Investigate the Quasi-Static Limit}, + journal = {Computational Particle Mechanics}, + year = {2020} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 5.816 | 5.816 | 5.816 Mbytes + Step CPU Atoms KinEng v_theta + 0 0 0 -0 0 + 1000 0.069039547 444 -0 0.015707963 + 2000 0.12867095 444 -0 0.031415927 + 3000 0.18791426 444 -0 0.04712389 + 4000 0.24614388 444 -0 0.062831853 + 5000 0.30404486 444 -0 0.078539816 + 6000 0.36105446 444 -0 0.09424778 + 7000 0.41713358 444 -0 0.10995574 + 8000 0.47282802 444 -0 0.12566371 + 9000 0.52742586 444 -0 0.14137167 + 10000 0.58233488 444 -0 0.15707963 + 11000 0.62155506 444 -0 0.1727876 + 12000 0.6605457 444 -0 0.18849556 + 13000 0.69971591 444 -0 0.20420352 + 14000 0.73821845 444 -0 0.21991149 + 15000 0.77860211 444 -0 0.23561945 + 16000 0.8188072 444 -0 0.25132741 + 17000 0.85992964 444 -0 0.26703538 + 18000 0.9008443 444 -0 0.28274334 + 19000 0.94216466 444 -0 0.2984513 + 20000 0.98508697 444 -0 0.31415927 + 21000 1.0241468 444 -0 0.32986723 + 22000 1.0606191 444 -0 0.34557519 + 23000 1.0972735 444 -0 0.36128316 + 24000 1.134726 444 -0 0.37699112 + 25000 1.1723693 444 -0 0.39269908 + 26000 1.211349 444 -0 0.40840704 + 27000 1.250291 444 -0 0.42411501 + 28000 1.2906408 444 -0 0.43982297 + 29000 1.3307315 444 -0 0.45553093 + 30000 1.3704867 444 -0 0.4712389 + 31000 1.4064392 444 -0 0.48694686 + 32000 1.4426955 444 -0 0.50265482 + 33000 1.4789666 444 -0 0.51836279 + 34000 1.5163037 444 -0 0.53407075 + 35000 1.5534135 444 -0 0.54977871 + 36000 1.5907054 444 -0 0.56548668 + 37000 1.6296055 444 -0 0.58119464 + 38000 1.6690167 444 -0 0.5969026 + 39000 1.7082024 444 -0 0.61261057 + 40000 1.7476796 444 -0 0.62831853 + 41000 1.7847465 444 -0 0.64402649 + 42000 1.8216975 444 -0 0.65973446 + 43000 1.8594424 444 -0 0.67544242 + 44000 1.8975401 444 -0 0.69115038 + 45000 1.9361216 444 -0 0.70685835 + 46000 1.9764821 444 -0 0.72256631 + 47000 2.0221252 444 -0 0.73827427 + 48000 2.0635337 444 -0 0.75398224 + 49000 2.104472 444 -0 0.7696902 + 50000 2.1447842 444 -0 0.78539816 + 51000 2.1808558 444 -0 0.80110613 + 52000 2.2180542 444 -0 0.81681409 + 53000 2.2547243 444 -0 0.83252205 + 54000 2.2934546 444 -0 0.84823002 + 55000 2.3321909 444 -0 0.86393798 + 56000 2.3732179 444 -0 0.87964594 + 57000 2.4141133 444 -0 0.89535391 + 58000 2.455667 444 -0 0.91106187 + 59000 2.4983196 444 -0 0.92676983 + 60000 2.5415086 444 -0 0.9424778 + 61000 2.581342 444 -0 0.95818576 + 62000 2.6215029 444 -0 0.97389372 + 63000 2.6633884 444 -0 0.98960169 + 64000 2.7048848 444 -0 1.0053096 + 65000 2.7497607 444 -0 1.0210176 + 66000 2.7952373 444 -0 1.0367256 + 67000 2.8399748 444 -0 1.0524335 + 68000 2.8851806 444 -0 1.0681415 + 69000 2.9303317 444 -0 1.0838495 + 70000 2.9815632 444 -0 1.0995574 + 71000 3.0257986 444 -0 1.1152654 + 72000 3.068788 444 -0 1.1309734 + 73000 3.1130125 444 -0 1.1466813 + 74000 3.1558178 444 -0 1.1623893 + 75000 3.1993327 444 -0 1.1780972 + 76000 3.2444469 444 -0 1.1938052 + 77000 3.2901781 444 -0 1.2095132 + 78000 3.3356302 444 -0 1.2252211 + 79000 3.3814834 444 -0 1.2409291 + 80000 3.4290631 444 -0 1.2566371 + 81000 3.4715671 444 -0 1.272345 + 82000 3.5136342 444 -0 1.288053 + 83000 3.5566281 444 -0 1.303761 + 84000 3.6001405 444 -0 1.3194689 + 85000 3.6709788 888 -0 1.3351769 + 86000 3.7652387 888 -0 1.3508848 + 87000 3.8618109 888 -0 1.3665928 + 88000 3.9546406 888 -0 1.3823008 + 89000 4.0475587 888 -0 1.3980087 + 90000 4.1424919 888 -0 1.4137167 + 91000 4.2114594 888 -0 1.4294247 + 92000 4.2842588 888 -0 1.4451326 + 93000 4.3524161 888 -0 1.4608406 + 94000 4.4204131 888 -0 1.4765485 + 95000 4.4886628 888 -0 1.4922565 + 96000 4.5588224 888 -0 1.5079645 + 97000 4.6304943 888 -0 1.5236724 + 98000 4.7018695 888 -0 1.5393804 + 99000 4.774147 888 -0 1.5550884 + 100000 4.847776 888 -0 1.5707963 + 101000 4.9173562 888 -0 1.5865043 + 102000 4.9886499 888 -0 1.6022123 + 103000 5.0618801 888 -0 1.6179202 + 104000 5.1331411 888 -0 1.6336282 + 105000 5.205209 888 -0 1.6493361 + 106000 5.2795148 888 -0 1.6650441 + 107000 5.3523346 888 -0 1.6807521 + 108000 5.4263886 888 -0 1.69646 + 109000 5.5029416 888 -0 1.712168 + 110000 5.5807033 888 -0 1.727876 + 111000 5.6574852 888 -0 1.7435839 + 112000 5.7320356 888 -0 1.7592919 + 113000 5.8097178 888 -0 1.7749998 + 114000 5.8858974 888 -0 1.7907078 + 115000 5.9636528 888 -0 1.8064158 + 116000 6.0421783 888 -0 1.8221237 + 117000 6.12052 888 -0 1.8378317 + 118000 6.2016349 888 -0 1.8535397 + 119000 6.2834058 888 -0 1.8692476 + 120000 6.3644485 888 -0 1.8849556 + 121000 6.4398727 888 -0 1.9006636 + 122000 6.5152081 888 -0 1.9163715 + 123000 6.5916482 888 -0 1.9320795 + 124000 6.6694407 888 -0 1.9477874 + 125000 6.7474201 888 -0 1.9634954 + 126000 6.8270768 888 -0 1.9792034 + 127000 6.9060885 888 -0 1.9949113 + 128000 6.9847809 888 -0 2.0106193 + 129000 7.0660497 888 -0 2.0263273 + 130000 7.1468939 888 -0 2.0420352 + 131000 7.2275386 888 -0 2.0577432 + 132000 7.3103515 888 -0 2.0734512 + 133000 7.3904073 888 -0 2.0891591 + 134000 7.4711333 888 -0 2.1048671 + 135000 7.5529594 888 -0 2.120575 + 136000 7.6399017 888 -0 2.136283 + 137000 7.7263891 888 -0 2.151991 + 138000 7.815523 888 -0 2.1676989 + 139000 7.9041642 888 -0 2.1834069 + 140000 7.9950145 888 -0 2.1991149 + 141000 8.0776291 888 -0 2.2148228 + 142000 8.1584715 888 -0 2.2305308 + 143000 8.2409653 888 -0 2.2462387 + 144000 8.326064 888 -0 2.2619467 + 145000 8.4107211 888 -0 2.2776547 + 146000 8.4946153 888 -0 2.2933626 + 147000 8.5784663 888 -0 2.3090706 + 148000 8.6648861 888 -0 2.3247786 + 149000 8.7503472 888 -0 2.3404865 + 150000 8.8378801 888 -0 2.3561945 + 151000 8.9221381 888 -0 2.3719025 + 152000 9.0101516 888 -0 2.3876104 + 153000 9.0982387 888 -0 2.4033184 + 154000 9.1851912 888 -0 2.4190263 + 155000 9.2744741 888 -0 2.4347343 + 156000 9.3697509 888 -0 2.4504423 + 157000 9.4640354 888 -0 2.4661502 + 158000 9.5594845 888 -0 2.4818582 + 159000 9.6572972 888 -0 2.4975662 + 160000 9.7543656 888 -0 2.5132741 + 161000 9.8485073 888 -0 2.5289821 + 162000 9.9446493 888 -0 2.54469 + 163000 10.040013 888 -0 2.560398 + 164000 10.137116 888 -0 2.576106 + 165000 10.23506 888 -0 2.5918139 + 166000 10.335537 888 -0 2.6075219 + 167000 10.436607 888 -0 2.6232299 + 168000 10.537429 888 -0 2.6389378 + 169000 10.642458 888 -0 2.6546458 + 170000 10.74705 1000 -0 2.6703538 + 171000 10.857156 1000 -0 2.6860617 + 172000 10.965939 1000 -0 2.7017697 + 173000 11.076233 1000 -0 2.7174776 + 174000 11.184172 1000 -0 2.7331856 + 175000 11.293846 1000 -0 2.7488936 + 176000 11.402493 1000 -0 2.7646015 + 177000 11.513895 1000 -0 2.7803095 + 178000 11.625438 1000 -0 2.7960175 + 179000 11.738308 1000 -0 2.8117254 + 180000 11.854793 1000 -0 2.8274334 + 181000 11.968344 1000 -0 2.8431414 + 182000 12.082268 1000 -0 2.8588493 + 183000 12.196356 1000 -0 2.8745573 + 184000 12.313359 1000 -0 2.8902652 + 185000 12.429559 1000 -0 2.9059732 + 186000 12.545853 1000 -0 2.9216812 + 187000 12.661447 1000 -0 2.9373891 + 188000 12.777355 1000 -0 2.9530971 + 189000 12.894856 1000 -0 2.9688051 + 190000 13.0103 1000 -0 2.984513 + 191000 13.126221 1000 -0 3.000221 + 192000 13.241507 1000 -0 3.0159289 + 193000 13.356198 1000 -0 3.0316369 + 194000 13.468168 1000 -0 3.0473449 + 195000 13.582232 1000 -0 3.0630528 + 196000 13.700446 1000 -0 3.0787608 + 197000 13.816948 1000 -0 3.0944688 + 198000 13.934106 1000 -0 3.1101767 + 199000 14.053497 1000 -0 3.1258847 + 200000 14.171799 1000 -0 3.1415927 +Loop time of 14.1719 on 4 procs for 200000 steps with 1000 atoms + +Performance: 57614.644 tau/day, 14112.479 timesteps/s, 14.112 Matom-step/s +99.1% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.46468 | 0.82686 | 1.2428 | 39.9 | 5.83 +Neigh | 0.010644 | 0.013047 | 0.015567 | 2.0 | 0.09 +Comm | 2.2447 | 2.716 | 3.2525 | 28.2 | 19.16 +Output | 0.0040193 | 0.0057101 | 0.0084742 | 2.2 | 0.04 +Modify | 7.9913 | 8.6193 | 9.394 | 20.9 | 60.82 +Other | | 1.991 | | | 14.05 + +Nlocal: 250 ave 266 max 237 min +Histogram: 1 0 0 1 1 0 0 0 0 1 +Nghost: 294 ave 335 max 253 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 960.25 ave 1454 max 492 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 3841 +Ave neighs/atom = 3.841 +Neighbor list builds = 201 +Dangerous builds = 0 +unfix ins +run 200000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 11.87 | 11.89 | 11.9 Mbytes + Step CPU Atoms KinEng v_theta + 200000 0 1000 1.0060272 3.1415927 + 201000 0.11023112 1000 1.0117513 3.1573006 + 202000 0.22297119 1000 1.0121624 3.1730086 + 203000 0.33090251 1000 1.0099707 3.1887165 + 204000 0.43921623 1000 1.0099624 3.2044245 + 205000 0.54813391 1000 1.009398 3.2201325 + 206000 0.6597641 1000 0.99686298 3.2358404 + 207000 0.76806828 1000 0.96520673 3.2515484 + 208000 0.88217705 1000 0.96521294 3.2672564 + 209000 0.99810181 1000 0.96501099 3.2829643 + 210000 1.1113988 1000 0.96426624 3.2986723 + 211000 1.2252752 1000 0.9564358 3.3143802 + 212000 1.3381064 1000 0.95482019 3.3300882 + 213000 1.4513852 1000 0.9446233 3.3457962 + 214000 1.5630713 1000 0.92461651 3.3615041 + 215000 1.6785702 1000 0.92106646 3.3772121 + 216000 1.7937182 1000 0.92058667 3.3929201 + 217000 1.9092992 1000 0.91797493 3.408628 + 218000 2.0251567 1000 0.91351081 3.424336 + 219000 2.1419482 1000 0.91991749 3.440044 + 220000 2.258391 1000 0.92943198 3.4557519 + 221000 2.3747328 1000 0.93176684 3.4714599 + 222000 2.4930355 1000 0.92625008 3.4871678 + 223000 2.6111794 1000 0.9216243 3.5028758 + 224000 2.729971 1000 0.92332955 3.5185838 + 225000 2.8489286 1000 0.91963985 3.5342917 + 226000 2.97003 1000 0.91913679 3.5499997 + 227000 3.0874646 1000 0.92381436 3.5657077 + 228000 3.2089543 1000 0.93085242 3.5814156 + 229000 3.3281962 1000 0.92872221 3.5971236 + 230000 3.4476271 1000 0.92536664 3.6128316 + 231000 3.5681706 1000 0.92953138 3.6285395 + 232000 3.6911427 1000 0.93937257 3.6442475 + 233000 3.8115833 1000 0.95916002 3.6599554 + 234000 3.9301977 1000 0.96652709 3.6756634 + 235000 4.0481963 1000 0.96753364 3.6913714 + 236000 4.1684171 1000 0.96096249 3.7070793 + 237000 4.2874672 1000 0.97028893 3.7227873 + 238000 4.4072896 1000 0.95323014 3.7384953 + 239000 4.5292898 1000 0.94143454 3.7542032 + 240000 4.6529563 1000 0.9334569 3.7699112 + 241000 4.7701737 1000 0.93340822 3.7856191 + 242000 4.8891772 1000 0.93517762 3.8013271 + 243000 5.0078759 1000 0.92632745 3.8170351 + 244000 5.1260291 1000 0.91858996 3.832743 + 245000 5.2472736 1000 0.90006015 3.848451 + 246000 5.363907 1000 0.8850116 3.864159 + 247000 5.4838317 1000 0.87807775 3.8798669 + 248000 5.6039445 1000 0.85981326 3.8955749 + 249000 5.7262584 1000 0.85764597 3.9112829 + 250000 5.8488174 1000 0.86748856 3.9269908 + 251000 5.9665578 1000 0.85889952 3.9426988 + 252000 6.084021 1000 0.84476495 3.9584067 + 253000 6.203987 1000 0.84094974 3.9741147 + 254000 6.3221073 1000 0.82638568 3.9898227 + 255000 6.441682 1000 0.81449512 4.0055306 + 256000 6.5625653 1000 0.80130582 4.0212386 + 257000 6.6860772 1000 0.79100139 4.0369466 + 258000 6.8117355 1000 0.78531082 4.0526545 + 259000 6.9379959 1000 0.7678277 4.0683625 + 260000 7.0606907 1000 0.74798797 4.0840704 + 261000 7.1846943 1000 0.73902576 4.0997784 + 262000 7.3084818 1000 0.73326104 4.1154864 + 263000 7.4304296 1000 0.7370234 4.1311943 + 264000 7.5536012 1000 0.73817854 4.1469023 + 265000 7.6792395 1000 0.74675482 4.1626103 + 266000 7.8061753 1000 0.7480056 4.1783182 + 267000 7.9331093 1000 0.748671 4.1940262 + 268000 8.0593048 1000 0.74430146 4.2097342 + 269000 8.1888555 1000 0.73246199 4.2254421 + 270000 8.3184687 1000 0.71666285 4.2411501 + 271000 8.4489277 1000 0.69699332 4.256858 + 272000 8.5822473 1000 0.69724726 4.272566 + 273000 8.7148666 1000 0.69752702 4.288274 + 274000 8.8426159 1000 0.69393439 4.3039819 + 275000 8.9746848 1000 0.67961922 4.3196899 + 276000 9.1020134 1000 0.67808365 4.3353979 + 277000 9.232486 1000 0.66241302 4.3511058 + 278000 9.3607588 1000 0.65559661 4.3668138 + 279000 9.4879578 1000 0.64949975 4.3825218 + 280000 9.6142148 1000 0.65351945 4.3982297 + 281000 9.7437802 1000 0.66566267 4.4139377 + 282000 9.87097 1000 0.68284419 4.4296456 + 283000 9.9975944 1000 0.68906456 4.4453536 + 284000 10.124724 1000 0.69474503 4.4610616 + 285000 10.25369 1000 0.71686298 4.4767695 + 286000 10.38212 1000 0.70966561 4.4924775 + 287000 10.513274 1000 0.70173402 4.5081855 + 288000 10.641359 1000 0.69841037 4.5238934 + 289000 10.765608 1000 0.68947449 4.5396014 + 290000 10.893738 1000 0.68391661 4.5553093 + 291000 11.018982 1000 0.69112115 4.5710173 + 292000 11.146639 1000 0.70208247 4.5867253 + 293000 11.269392 1000 0.70044553 4.6024332 + 294000 11.39243 1000 0.69973655 4.6181412 + 295000 11.517741 1000 0.70719661 4.6338492 + 296000 11.643013 1000 0.69961909 4.6495571 + 297000 11.771064 1000 0.7038606 4.6652651 + 298000 11.899855 1000 0.70651383 4.6809731 + 299000 12.024499 1000 0.72028817 4.696681 + 300000 12.151124 1000 0.72141372 4.712389 + 301000 12.278902 1000 0.73011344 4.7280969 + 302000 12.402615 1000 0.74750506 4.7438049 + 303000 12.524021 1000 0.74362139 4.7595129 + 304000 12.645914 1000 0.73643471 4.7752208 + 305000 12.766721 1000 0.73250587 4.7909288 + 306000 12.945373 1000 0.72450933 4.8066368 + 307000 13.084062 1000 0.71650682 4.8223447 + 308000 13.210593 1000 0.71012044 4.8380527 + 309000 13.339536 1000 0.7045498 4.8537606 + 310000 13.477512 1000 0.69904261 4.8694686 + 311000 13.617832 1000 0.69370407 4.8851766 + 312000 13.802532 1000 0.70012261 4.9008845 + 313000 13.9682 1000 0.69796658 4.9165925 + 314000 14.139079 1000 0.70673901 4.9323005 + 315000 14.290205 1000 0.70285296 4.9480084 + 316000 14.414474 1000 0.69917788 4.9637164 + 317000 14.541743 1000 0.69153454 4.9794244 + 318000 14.672817 1000 0.69630312 4.9951323 + 319000 14.800594 1000 0.70732059 5.0108403 + 320000 14.982014 1000 0.71069744 5.0265482 + 321000 15.126459 1000 0.70982909 5.0422562 + 322000 15.264165 1000 0.70514067 5.0579642 + 323000 15.391036 1000 0.70591206 5.0736721 + 324000 15.518096 1000 0.70992653 5.0893801 + 325000 15.644416 1000 0.70605327 5.1050881 + 326000 15.772686 1000 0.70492617 5.120796 + 327000 15.899812 1000 0.69711977 5.136504 + 328000 16.050906 1000 0.68791974 5.152212 + 329000 16.197987 1000 0.68350425 5.1679199 + 330000 16.346901 1000 0.67886559 5.1836279 + 331000 16.511885 1000 0.6838106 5.1993358 + 332000 16.666556 1000 0.68570448 5.2150438 + 333000 16.820557 1000 0.68347768 5.2307518 + 334000 16.972048 1000 0.67352858 5.2464597 + 335000 17.171176 1000 0.67154375 5.2621677 + 336000 17.380218 1000 0.67050288 5.2778757 + 337000 17.561848 1000 0.66093797 5.2935836 + 338000 17.746525 1000 0.65261747 5.3092916 + 339000 17.926411 1000 0.65084314 5.3249995 + 340000 18.105197 1000 0.65003008 5.3407075 + 341000 18.235972 1000 0.65397536 5.3564155 + 342000 18.389741 1000 0.67129271 5.3721234 + 343000 18.604032 1000 0.68934086 5.3878314 + 344000 18.788879 1000 0.71225704 5.4035394 + 345000 18.935273 1000 0.72645711 5.4192473 + 346000 19.136926 1000 0.73153889 5.4349553 + 347000 19.310095 1000 0.74047453 5.4506633 + 348000 19.476545 1000 0.74508084 5.4663712 + 349000 19.599138 1000 0.74030176 5.4820792 + 350000 19.753114 1000 0.72037009 5.4977871 + 351000 19.893497 1000 0.71009934 5.5134951 + 352000 20.020982 1000 0.69475509 5.5292031 + 353000 20.149857 1000 0.68883962 5.544911 + 354000 20.278476 1000 0.68764856 5.560619 + 355000 20.407747 1000 0.6853423 5.576327 + 356000 20.53591 1000 0.69528948 5.5920349 + 357000 20.668654 1000 0.70787069 5.6077429 + 358000 20.802835 1000 0.70110924 5.6234508 + 359000 20.950394 1000 0.69356484 5.6391588 + 360000 21.076061 1000 0.69727901 5.6548668 + 361000 21.224785 1000 0.69878093 5.6705747 + 362000 21.416947 1000 0.70063124 5.6862827 + 363000 21.632619 1000 0.68842038 5.7019907 + 364000 21.836231 1000 0.68478573 5.7176986 + 365000 21.963636 1000 0.68232032 5.7334066 + 366000 22.092926 1000 0.66971225 5.7491146 + 367000 22.219251 1000 0.67006227 5.7648225 + 368000 22.344723 1000 0.6694355 5.7805305 + 369000 22.470654 1000 0.66622377 5.7962384 + 370000 22.59941 1000 0.66501888 5.8119464 + 371000 22.732869 1000 0.66108622 5.8276544 + 372000 22.859824 1000 0.65989005 5.8433623 + 373000 22.989282 1000 0.65277032 5.8590703 + 374000 23.116089 1000 0.64599939 5.8747783 + 375000 23.243733 1000 0.64279675 5.8904862 + 376000 23.371971 1000 0.64321129 5.9061942 + 377000 23.505382 1000 0.65596736 5.9219022 + 378000 23.638755 1000 0.68055295 5.9376101 + 379000 23.770714 1000 0.71147476 5.9533181 + 380000 23.906376 1000 0.7478441 5.969026 + 381000 24.040685 1000 0.76216879 5.984734 + 382000 24.173446 1000 0.78574658 6.000442 + 383000 24.30114 1000 0.80947952 6.0161499 + 384000 24.426872 1000 0.81514681 6.0318579 + 385000 24.555905 1000 0.81469775 6.0475659 + 386000 24.684891 1000 0.80579609 6.0632738 + 387000 24.811946 1000 0.79952446 6.0789818 + 388000 24.940028 1000 0.78668384 6.0946897 + 389000 25.061479 1000 0.78375511 6.1103977 + 390000 25.18315 1000 0.78124583 6.1261057 + 391000 25.303012 1000 0.77072038 6.1418136 + 392000 25.423275 1000 0.75748297 6.1575216 + 393000 25.542996 1000 0.74703682 6.1732296 + 394000 25.661826 1000 0.74135384 6.1889375 + 395000 25.782254 1000 0.73344196 6.2046455 + 396000 25.903156 1000 0.72305463 6.2203535 + 397000 26.026207 1000 0.71221263 6.2360614 + 398000 26.145498 1000 0.70602241 6.2517694 + 399000 26.266146 1000 0.69822375 6.2674773 + 400000 26.387762 1000 0.69567985 6.2831853 +Loop time of 26.3878 on 4 procs for 200000 steps with 1000 atoms + +Performance: 30942.580 tau/day, 7579.263 timesteps/s, 7.579 Matom-step/s +99.1% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.6871 | 2.8172 | 3.925 | 64.8 | 10.68 +Neigh | 0.017325 | 0.021917 | 0.026669 | 3.1 | 0.08 +Comm | 4.7404 | 6.0917 | 7.4409 | 54.5 | 23.09 +Output | 0.0043138 | 0.0065642 | 0.0087622 | 1.9 | 0.02 +Modify | 13.258 | 14.716 | 16.132 | 35.6 | 55.77 +Other | | 2.735 | | | 10.36 + +Nlocal: 250 ave 257 max 241 min +Histogram: 1 0 0 0 0 1 0 1 0 1 +Nghost: 387.5 ave 477 max 299 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 1233.5 ave 1523 max 917 min +Histogram: 1 1 0 0 0 0 0 0 0 2 + +Total # of neighbors = 4934 +Ave neighs/atom = 4.934 +Neighbor list builds = 168 +Dangerous builds = 0 +Total wall time: 0:00:40 diff --git a/examples/pour/log.16Mar23.pour.2d.g++.1 b/examples/pour/log.16Mar23.pour.2d.g++.1 new file mode 100644 index 0000000000..76533e5cbf --- /dev/null +++ b/examples/pour/log.16Mar23.pour.2d.g++.1 @@ -0,0 +1,125 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Pour 2d granular particles into container + +dimension 2 +atom_style sphere +boundary f fm p +newton off +comm_modify vel yes + +region reg block 0 100 0 50 -0.5 0.5 units box +create_box 1 reg +Created orthogonal box = (0 0 -0.5) to (100 50 0.5) + 1 by 1 by 1 MPI processor grid + +neighbor 0.2 bin +neigh_modify delay 0 + +# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) +# are used in this example file to produce a quick simulation and movie. +# More appropriate values for realistic simulations would be +# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). + +pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 +pair_coeff * * + +timestep 0.001 + +fix 1 all nve/sphere +fix 2 all gravity 1.0 spherical 0.0 -180.0 +fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 +fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL + +region slab block 1.0 99.0 30 34.5 -0.5 0.5 units box +fix ins all pour 1000 1 4767548 vol 0.4 10 diam range 0.5 1.0 region slab +Particle insertion: 224 every 3000 steps, 1000 by step 12001 + +fix 3 all enforce2d + +compute 1 all erotate/sphere +thermo_style custom step atoms ke c_1 vol +thermo 1000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic/dof yes + +#dump id all atom 250 dump.pour + +#dump 2 all image 500 image.*.jpg type type # zoom 1.6 adiam 1.5 +#dump_modify 2 pad 5 + +#dump 3 all movie 500 movie.mpg type type # zoom 1.6 adiam 1.5 +#dump_modify 3 pad 5 + +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 167 84 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/bin/newtoff + stencil: full/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.805 | 5.805 | 5.805 Mbytes + Step Atoms KinEng c_1 Volume + 0 0 -0 0 5000 + 1000 224 202.80417 0 5000 + 2000 224 373.00249 0 5000 + 3000 224 599.26757 0 5000 + 4000 448 1078.4787 0 5000 + 5000 448 1589.4845 0 5000 + 6000 448 1743.8281 26.918824 5000 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 7000 669 1818.5075 88.370238 5000 + 8000 669 1850.1368 105.77613 5000 + 9000 669 1757.9791 107.52328 5000 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 10000 886 1792.8816 79.515458 5000 + 11000 886 1639.0751 64.104708 5000 + 12000 886 1541.1208 55.91813 5000 + 13000 1000 1462.8753 69.093182 5000 + 14000 1000 1277.8754 48.097953 5000 + 15000 1000 1144.6235 50.637004 5000 + 16000 1000 847.34312 43.242219 5000 + 17000 1000 574.34264 41.336666 5000 + 18000 1000 383.60272 32.744393 5000 + 19000 1000 174.44969 31.691706 5000 + 20000 1000 44.566368 14.781893 5000 + 21000 1000 22.655785 9.8501131 5000 + 22000 1000 17.403069 6.4074514 5000 + 23000 1000 13.892292 4.8987582 5000 + 24000 1000 11.699592 4.0659436 5000 + 25000 1000 9.6606627 3.6642658 5000 +Loop time of 2.84114 on 1 procs for 25000 steps with 1000 atoms + +Performance: 760257.044 tau/day, 8799.271 timesteps/s, 8.799 Matom-step/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.092 | 1.092 | 1.092 | 0.0 | 38.44 +Neigh | 0.30793 | 0.30793 | 0.30793 | 0.0 | 10.84 +Comm | 0.012168 | 0.012168 | 0.012168 | 0.0 | 0.43 +Output | 0.00076223 | 0.00076223 | 0.00076223 | 0.0 | 0.03 +Modify | 1.3179 | 1.3179 | 1.3179 | 0.0 | 46.38 +Other | | 0.1104 | | | 3.89 + +Nlocal: 1000 ave 1000 max 1000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2344 ave 2344 max 2344 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2344 +Ave neighs/atom = 2.344 +Neighbor list builds = 2097 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/pour/log.16Mar23.pour.2d.g++.4 b/examples/pour/log.16Mar23.pour.2d.g++.4 new file mode 100644 index 0000000000..9ced9784dc --- /dev/null +++ b/examples/pour/log.16Mar23.pour.2d.g++.4 @@ -0,0 +1,125 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Pour 2d granular particles into container + +dimension 2 +atom_style sphere +boundary f fm p +newton off +comm_modify vel yes + +region reg block 0 100 0 50 -0.5 0.5 units box +create_box 1 reg +Created orthogonal box = (0 0 -0.5) to (100 50 0.5) + 4 by 1 by 1 MPI processor grid + +neighbor 0.2 bin +neigh_modify delay 0 + +# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) +# are used in this example file to produce a quick simulation and movie. +# More appropriate values for realistic simulations would be +# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). + +pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 +pair_coeff * * + +timestep 0.001 + +fix 1 all nve/sphere +fix 2 all gravity 1.0 spherical 0.0 -180.0 +fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 +fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL + +region slab block 1.0 99.0 30 34.5 -0.5 0.5 units box +fix ins all pour 1000 1 4767548 vol 0.4 10 diam range 0.5 1.0 region slab +Particle insertion: 224 every 3000 steps, 1000 by step 12001 + +fix 3 all enforce2d + +compute 1 all erotate/sphere +thermo_style custom step atoms ke c_1 vol +thermo 1000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic/dof yes + +#dump id all atom 250 dump.pour + +#dump 2 all image 500 image.*.jpg type type # zoom 1.6 adiam 1.5 +#dump_modify 2 pad 5 + +#dump 3 all movie 500 movie.mpg type type # zoom 1.6 adiam 1.5 +#dump_modify 3 pad 5 + +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 167 84 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/bin/newtoff + stencil: full/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.77 | 5.77 | 5.77 Mbytes + Step Atoms KinEng c_1 Volume + 0 0 -0 0 5000 + 1000 224 202.80417 0 5000 + 2000 224 373.00249 0 5000 + 3000 224 599.26757 0 5000 + 4000 448 1078.4787 0 5000 + 5000 448 1589.4845 0 5000 + 6000 448 1743.8281 26.918824 5000 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 7000 669 1818.5075 88.370238 5000 + 8000 669 1850.1368 105.77613 5000 + 9000 669 1757.9791 107.52328 5000 +WARNING: Fewer insertions than requested (src/GRANULAR/fix_pour.cpp:681) + 10000 886 1792.8816 79.515458 5000 + 11000 886 1639.0751 64.104716 5000 + 12000 886 1541.1046 55.902437 5000 + 13000 1000 1461.0291 68.011357 5000 + 14000 1000 1286.1144 48.551003 5000 + 15000 1000 1155.6137 55.503871 5000 + 16000 1000 833.49034 46.163926 5000 + 17000 1000 581.69308 43.140124 5000 + 18000 1000 369.375 37.675729 5000 + 19000 1000 188.74424 31.66369 5000 + 20000 1000 48.73107 23.067611 5000 + 21000 1000 27.652985 14.176945 5000 + 22000 1000 22.545416 9.6960211 5000 + 23000 1000 17.575825 6.6345699 5000 + 24000 1000 12.464163 4.9073459 5000 + 25000 1000 9.9507487 3.1967219 5000 +Loop time of 0.793403 on 4 procs for 25000 steps with 1000 atoms + +Performance: 2722450.224 tau/day, 31509.841 timesteps/s, 31.510 Matom-step/s +99.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.2392 | 0.24458 | 0.25441 | 1.2 | 30.83 +Neigh | 0.075663 | 0.07738 | 0.078869 | 0.4 | 9.75 +Comm | 0.037752 | 0.045698 | 0.049012 | 2.2 | 5.76 +Output | 0.00063359 | 0.0006788 | 0.00078796 | 0.0 | 0.09 +Modify | 0.30883 | 0.3111 | 0.31377 | 0.3 | 39.21 +Other | | 0.114 | | | 14.36 + +Nlocal: 250 ave 254 max 244 min +Histogram: 1 0 0 0 0 0 0 2 0 1 +Nghost: 19.75 ave 28 max 11 min +Histogram: 1 0 1 0 0 0 0 0 1 1 +Neighs: 600 ave 624 max 569 min +Histogram: 1 0 0 1 0 0 0 0 1 1 + +Total # of neighbors = 2400 +Ave neighs/atom = 2.4 +Neighbor list builds = 2138 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/pour/log.16Mar23.pour.2d.molecule.g++.1 b/examples/pour/log.16Mar23.pour.2d.molecule.g++.1 new file mode 100644 index 0000000000..0c5cbd9dc3 --- /dev/null +++ b/examples/pour/log.16Mar23.pour.2d.molecule.g++.1 @@ -0,0 +1,148 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Pour 2d granular particles into container + +dimension 2 +atom_style sphere +atom_modify map array +boundary f fm p +newton off +comm_modify vel yes cutoff 2.5 + +fix prop all property/atom mol ghost yes + +region reg block 0 100 0 50 -0.5 0.5 units box +create_box 1 reg +Created orthogonal box = (0 0 -0.5) to (100 50 0.5) + 1 by 1 by 1 MPI processor grid + +neighbor 0.2 bin +neigh_modify delay 0 + +# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) +# are used in this example file to produce a quick simulation and movie. +# More appropriate values for realistic simulations would be +# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). + +pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 +pair_coeff * * + +timestep 0.001 + +fix 2 all gravity 1.0 spherical 0.0 -180.0 +fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 +fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL + +molecule object molecule.vshape +Read molecule template object: + 1 molecules + 0 fragments + 5 atoms with max type 1 + 0 bonds with max type 0 + 0 angles with max type 0 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +fix 3 all rigid/small molecule mol object + create bodies CPU = 0.000 seconds + 0 rigid bodies with 0 atoms + 2.236068 = max distance from body owner to body atom + +# ensure region size + molecule size does not overlap wall + +region slab block 3.0 97.0 30 34.5 -0.5 0.5 units box +fix ins all pour 500 0 4767548 vol 0.8 10 region slab mol object rigid 3 +Particle insertion: 26 every 3000 steps, 500 by step 57001 + +fix 4 all enforce2d + +compute 1 all erotate/sphere +compute Tsphere all temp/sphere +thermo_style custom step atoms ke c_1 vol +thermo_modify lost ignore norm no temp Tsphere +compute_modify Tsphere dynamic/dof yes + +thermo 1000 + +#dump id all atom 100 tmp.dump + +#variable colors string # "red green blue yellow white # purple pink orange lime gray" +#variable mol2 atom mol%10 +#dump 2 all image 250 image.*.jpg v_mol2 type # zoom 1.6 adiam 1.5 +#dump_modify 2 pad 5 amap 0 10 sa 1 10 ${colors} + +#variable colors string # "red green blue yellow white # purple pink orange lime gray" +#variable mol3 atom mol%10 +#dump 3 all movie 250 movie.mpg v_mol3 type # zoom 1.6 adiam 1.5 +#dump_modify 3 pad 5 amap 0 10 sa 1 10 ${colors} + +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +WARNING: Gravity may not be correctly applied to rigid bodies if they consist of overlapped particles (src/RIGID/fix_rigid_small.cpp:554) +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 2.5 + binsize = 0.6, bins = 167 84 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/bin/newtoff + stencil: full/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.811 | 5.811 | 5.811 Mbytes + Step Atoms KinEng c_1 Volume + 0 0 -0 0 5000 + 1000 130 248.65568 0.002050506 5000 + 2000 130 452.01354 0.0020557556 5000 + 3000 130 720.36849 0.0021462148 5000 + 4000 260 1281.7126 0.0021462148 5000 + 5000 260 1875.9602 0.0021462148 5000 + 6000 260 1742.7747 2.0692779 5000 + 7000 390 1860.2142 1.7515066 5000 + 8000 390 1853.6219 2.3354959 5000 + 9000 390 1749.6466 5.1516327 5000 + 10000 520 1860.4314 4.2186838 5000 + 11000 520 1636.9411 4.006706 5000 + 12000 520 1454.1835 4.3341069 5000 + 13000 650 1881.6358 3.9606372 5000 + 14000 650 1648.6494 3.8239413 5000 + 15000 650 1463.0973 2.9363979 5000 + 16000 780 1571.0119 3.9061213 5000 + 17000 780 1472.941 2.0289533 5000 + 18000 780 1370.5265 3.1038747 5000 + 19000 910 1433.6728 2.7600498 5000 + 20000 910 1375.3634 2.964893 5000 + 21000 910 1184.8059 2.5050961 5000 + 22000 1040 1312.0948 1.844008 5000 + 23000 1040 1181.4208 1.7766375 5000 + 24000 1040 1263.1226 2.1430511 5000 + 25000 1170 1152.9064 2.4175531 5000 +Loop time of 3.37143 on 1 procs for 25000 steps with 1170 atoms + +Performance: 640677.536 tau/day, 7415.249 timesteps/s, 8.676 Matom-step/s +99.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.91106 | 0.91106 | 0.91106 | 0.0 | 27.02 +Neigh | 0.19015 | 0.19015 | 0.19015 | 0.0 | 5.64 +Comm | 0.016916 | 0.016916 | 0.016916 | 0.0 | 0.50 +Output | 0.0011065 | 0.0011065 | 0.0011065 | 0.0 | 0.03 +Modify | 2.1372 | 2.1372 | 2.1372 | 0.0 | 63.39 +Other | | 0.115 | | | 3.41 + +Nlocal: 1170 ave 1170 max 1170 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1685 ave 1685 max 1685 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1685 +Ave neighs/atom = 1.4401709 +Neighbor list builds = 1707 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/pour/log.16Mar23.pour.2d.molecule.g++.4 b/examples/pour/log.16Mar23.pour.2d.molecule.g++.4 new file mode 100644 index 0000000000..f0d3cd2db1 --- /dev/null +++ b/examples/pour/log.16Mar23.pour.2d.molecule.g++.4 @@ -0,0 +1,148 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Pour 2d granular particles into container + +dimension 2 +atom_style sphere +atom_modify map array +boundary f fm p +newton off +comm_modify vel yes cutoff 2.5 + +fix prop all property/atom mol ghost yes + +region reg block 0 100 0 50 -0.5 0.5 units box +create_box 1 reg +Created orthogonal box = (0 0 -0.5) to (100 50 0.5) + 4 by 1 by 1 MPI processor grid + +neighbor 0.2 bin +neigh_modify delay 0 + +# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) +# are used in this example file to produce a quick simulation and movie. +# More appropriate values for realistic simulations would be +# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). + +pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 +pair_coeff * * + +timestep 0.001 + +fix 2 all gravity 1.0 spherical 0.0 -180.0 +fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 +fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL + +molecule object molecule.vshape +Read molecule template object: + 1 molecules + 0 fragments + 5 atoms with max type 1 + 0 bonds with max type 0 + 0 angles with max type 0 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +fix 3 all rigid/small molecule mol object + create bodies CPU = 0.000 seconds + 0 rigid bodies with 0 atoms + 2.236068 = max distance from body owner to body atom + +# ensure region size + molecule size does not overlap wall + +region slab block 3.0 97.0 30 34.5 -0.5 0.5 units box +fix ins all pour 500 0 4767548 vol 0.8 10 region slab mol object rigid 3 +Particle insertion: 26 every 3000 steps, 500 by step 57001 + +fix 4 all enforce2d + +compute 1 all erotate/sphere +compute Tsphere all temp/sphere +thermo_style custom step atoms ke c_1 vol +thermo_modify lost ignore norm no temp Tsphere +compute_modify Tsphere dynamic/dof yes + +thermo 1000 + +#dump id all atom 100 tmp.dump + +#variable colors string # "red green blue yellow white # purple pink orange lime gray" +#variable mol2 atom mol%10 +#dump 2 all image 250 image.*.jpg v_mol2 type # zoom 1.6 adiam 1.5 +#dump_modify 2 pad 5 amap 0 10 sa 1 10 ${colors} + +#variable colors string # "red green blue yellow white # purple pink orange lime gray" +#variable mol3 atom mol%10 +#dump 3 all movie 250 movie.mpg v_mol3 type # zoom 1.6 adiam 1.5 +#dump_modify 3 pad 5 amap 0 10 sa 1 10 ${colors} + +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +WARNING: Gravity may not be correctly applied to rigid bodies if they consist of overlapped particles (src/RIGID/fix_rigid_small.cpp:554) +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 2.5 + binsize = 0.6, bins = 167 84 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/bin/newtoff + stencil: full/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.773 | 5.773 | 5.773 Mbytes + Step Atoms KinEng c_1 Volume + 0 0 -0 0 5000 + 1000 130 248.65568 0.002050506 5000 + 2000 130 452.01354 0.0020557556 5000 + 3000 130 720.36849 0.0021462148 5000 + 4000 260 1281.7126 0.0021462148 5000 + 5000 260 1875.9602 0.0021462148 5000 + 6000 260 1742.7747 2.0692779 5000 + 7000 390 1860.2142 1.7515066 5000 + 8000 390 1853.6219 2.3354959 5000 + 9000 390 1749.6466 5.1516327 5000 + 10000 520 1860.4314 4.2186838 5000 + 11000 520 1636.9411 4.006706 5000 + 12000 520 1454.1835 4.3341069 5000 + 13000 650 1881.6358 3.9606372 5000 + 14000 650 1648.6494 3.8239413 5000 + 15000 650 1463.0973 2.9363979 5000 + 16000 780 1571.0119 3.9061213 5000 + 17000 780 1472.941 2.0289532 5000 + 18000 780 1370.5265 3.1038747 5000 + 19000 910 1433.6728 2.7600454 5000 + 20000 910 1375.3629 2.9649297 5000 + 21000 910 1184.8017 2.5049255 5000 + 22000 1040 1312.0653 1.8441521 5000 + 23000 1040 1181.5473 1.7693597 5000 + 24000 1040 1263.4442 2.1476891 5000 + 25000 1170 1152.2404 2.4292153 5000 +Loop time of 1.59966 on 4 procs for 25000 steps with 1170 atoms + +Performance: 1350285.365 tau/day, 15628.303 timesteps/s, 18.285 Matom-step/s +98.5% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.23769 | 0.30075 | 0.35002 | 7.5 | 18.80 +Neigh | 0.048877 | 0.062647 | 0.073072 | 3.7 | 3.92 +Comm | 0.075225 | 0.087826 | 0.096819 | 2.9 | 5.49 +Output | 0.0010015 | 0.0011427 | 0.0015053 | 0.6 | 0.07 +Modify | 0.97758 | 0.99506 | 1.0071 | 1.1 | 62.20 +Other | | 0.1522 | | | 9.52 + +Nlocal: 292.5 ave 314 max 274 min +Histogram: 1 0 0 1 0 1 0 0 0 1 +Nghost: 44.5 ave 67 max 23 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 430 ave 452 max 393 min +Histogram: 1 0 0 0 0 0 0 2 0 1 + +Total # of neighbors = 1720 +Ave neighs/atom = 1.4700855 +Neighbor list builds = 1707 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/pour/log.16Mar23.pour.g++.1 b/examples/pour/log.16Mar23.pour.g++.1 new file mode 100644 index 0000000000..4896a1e4e4 --- /dev/null +++ b/examples/pour/log.16Mar23.pour.g++.1 @@ -0,0 +1,178 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Pour granular particles into chute container, then induce flow + +atom_style sphere +boundary p p fm +newton off +comm_modify vel yes + +region reg block -10 10 -10 10 -0.5 16 units box +create_box 1 reg +Created orthogonal box = (-10 -10 -0.5) to (10 10 16) + 1 by 1 by 1 MPI processor grid + +neighbor 0.2 bin +neigh_modify delay 0 + +# IMPORTANT NOTE: these values of stiffness (2000) and timestep (0.001) +# are used in this example file to produce a quick simulation and movie. +# More appropriate values for realistic simulations would be +# k = 2.0e5 and dt = 0.0001, as in bench/in.chute. + +pair_style gran/hooke/history 2000.0 NULL 50.0 NULL 0.5 0 +pair_coeff * * + +timestep 0.001 + +fix 1 all nve/sphere +fix 2 all gravity 1.0 spherical 0.0 -180.0 +fix zlower all wall/gran hooke/history 2000.0 NULL 50.0 NULL 0.5 0 zplane 0.0 2000.0 + +region slab block -9.0 9.0 -9.0 9.0 10.0 15.0 units box +fix ins all pour 3000 1 300719 vol 0.13 50 region slab +Particle insertion: 402 every 3162 steps, 3000 by step 22135 + +compute 1 all erotate/sphere +thermo_style custom step atoms ke c_1 vol +thermo 1000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic/dof yes + +#dump id all atom 1000 dump.pour + +#dump 2 all image 1000 image.*.jpg type type # axes yes 0.8 0.02 view 80 -30 +#dump_modify 2 pad 5 + +#dump 3 all movie 1000 movie.mpg type type # axes yes 0.8 0.02 view 80 -30 +#dump_modify 3 pad 5 + +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 34 34 28 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/bin/newtoff + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.956 | 5.956 | 5.956 Mbytes + Step Atoms KinEng c_1 Volume + 0 0 -0 0 6600 + 1000 402 753.1301 0 6600 + 2000 402 1389.6785 0 6600 + 3000 402 1439.3007 16.360577 6600 + 4000 804 1694.9311 52.966189 6600 + 5000 804 1564.7533 67.202593 6600 + 6000 804 1303.6937 65.31424 6600 + 7000 1206 1590.3342 63.948699 6600 + 8000 1206 1489.2483 54.736993 6600 + 9000 1206 1234.442 56.141183 6600 + 10000 1608 1314.3588 49.189129 6600 + 11000 1608 1238.0609 42.558653 6600 + 12000 1608 1143.6455 41.554747 6600 + 13000 2010 1229.989 49.661038 6600 + 14000 2010 1176.3015 40.982761 6600 + 15000 2010 1011.4718 45.872673 6600 + 16000 2412 1128.8326 47.405058 6600 + 17000 2412 1035.4314 40.22595 6600 + 18000 2412 873.87039 40.07875 6600 + 19000 2814 967.91799 41.49685 6600 + 20000 2814 928.0341 39.924344 6600 + 21000 2814 820.35467 37.621246 6600 + 22000 2814 549.00702 41.541324 6600 + 23000 3000 441.94025 41.467527 6600 + 24000 3000 339.91044 25.849093 6600 + 25000 3000 243.91083 20.921917 6600 +Loop time of 8.07068 on 1 procs for 25000 steps with 3000 atoms + +Performance: 267635.587 tau/day, 3097.634 timesteps/s, 9.293 Matom-step/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 4.6682 | 4.6682 | 4.6682 | 0.0 | 57.84 +Neigh | 1.0497 | 1.0497 | 1.0497 | 0.0 | 13.01 +Comm | 0.16028 | 0.16028 | 0.16028 | 0.0 | 1.99 +Output | 0.00076244 | 0.00076244 | 0.00076244 | 0.0 | 0.01 +Modify | 2.0196 | 2.0196 | 2.0196 | 0.0 | 25.02 +Other | | 0.172 | | | 2.13 + +Nlocal: 3000 ave 3000 max 3000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 667 ave 667 max 667 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 13503 ave 13503 max 13503 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 13503 +Ave neighs/atom = 4.501 +Neighbor list builds = 1150 +Dangerous builds = 0 + +unfix ins +fix 2 all gravity 1.0 chute 26.0 +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 10.64 | 10.64 | 10.64 Mbytes + Step Atoms KinEng c_1 Volume + 25000 3000 243.91083 20.921917 6600 + 26000 3000 111.73212 19.181089 6600 + 27000 3000 175.53659 12.143401 6600 + 28000 3000 315.95861 12.721047 6600 + 29000 3000 516.24386 15.103525 6600 + 30000 3000 779.3423 19.057186 6600 + 31000 3000 1118.6219 21.320808 6600 + 32000 3000 1512.8878 25.012099 6600 + 33000 3000 1969.247 30.402739 6600 + 34000 3000 2499.318 37.297539 6600 + 35000 3000 3074.9401 45.925996 6600 + 36000 3000 3768.2108 39.734162 6600 + 37000 3000 4400.6971 44.337674 6600 + 38000 3000 5178.4457 63.168989 6600 + 39000 3000 6028.928 56.570416 6600 + 40000 3000 6947.424 67.360376 6600 + 41000 3000 7896.0016 69.368604 6600 + 42000 3000 8977.9347 66.242546 6600 + 43000 3000 10026.618 55.776273 6600 + 44000 3000 11106.873 69.943396 6600 + 45000 3000 12264.363 79.440158 6600 + 46000 3000 13562.635 67.026549 6600 + 47000 3000 14796.806 70.121289 6600 + 48000 3000 16254.182 70.690438 6600 + 49000 3000 17711.386 63.668043 6600 + 50000 3000 19144.269 66.708659 6600 +Loop time of 17.582 on 1 procs for 25000 steps with 3000 atoms + +Performance: 122853.050 tau/day, 1421.910 timesteps/s, 4.266 Matom-step/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 11.641 | 11.641 | 11.641 | 0.0 | 66.21 +Neigh | 1.7715 | 1.7715 | 1.7715 | 0.0 | 10.08 +Comm | 0.38219 | 0.38219 | 0.38219 | 0.0 | 2.17 +Output | 0.0010728 | 0.0010728 | 0.0010728 | 0.0 | 0.01 +Modify | 3.4549 | 3.4549 | 3.4549 | 0.0 | 19.65 +Other | | 0.3309 | | | 1.88 + +Nlocal: 3000 ave 3000 max 3000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 748 ave 748 max 748 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 14117 ave 14117 max 14117 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 14117 +Ave neighs/atom = 4.7056667 +Neighbor list builds = 848 +Dangerous builds = 0 +Total wall time: 0:00:25 diff --git a/examples/pour/log.16Mar23.pour.g++.4 b/examples/pour/log.16Mar23.pour.g++.4 new file mode 100644 index 0000000000..f0ffbd8001 --- /dev/null +++ b/examples/pour/log.16Mar23.pour.g++.4 @@ -0,0 +1,178 @@ +LAMMPS (8 Feb 2023) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Pour granular particles into chute container, then induce flow + +atom_style sphere +boundary p p fm +newton off +comm_modify vel yes + +region reg block -10 10 -10 10 -0.5 16 units box +create_box 1 reg +Created orthogonal box = (-10 -10 -0.5) to (10 10 16) + 2 by 2 by 1 MPI processor grid + +neighbor 0.2 bin +neigh_modify delay 0 + +# IMPORTANT NOTE: these values of stiffness (2000) and timestep (0.001) +# are used in this example file to produce a quick simulation and movie. +# More appropriate values for realistic simulations would be +# k = 2.0e5 and dt = 0.0001, as in bench/in.chute. + +pair_style gran/hooke/history 2000.0 NULL 50.0 NULL 0.5 0 +pair_coeff * * + +timestep 0.001 + +fix 1 all nve/sphere +fix 2 all gravity 1.0 spherical 0.0 -180.0 +fix zlower all wall/gran hooke/history 2000.0 NULL 50.0 NULL 0.5 0 zplane 0.0 2000.0 + +region slab block -9.0 9.0 -9.0 9.0 10.0 15.0 units box +fix ins all pour 3000 1 300719 vol 0.13 50 region slab +Particle insertion: 402 every 3162 steps, 3000 by step 22135 + +compute 1 all erotate/sphere +thermo_style custom step atoms ke c_1 vol +thermo 1000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic/dof yes + +#dump id all atom 1000 dump.pour + +#dump 2 all image 1000 image.*.jpg type type # axes yes 0.8 0.02 view 80 -30 +#dump_modify 2 pad 5 + +#dump 3 all movie 1000 movie.mpg type type # axes yes 0.8 0.02 view 80 -30 +#dump_modify 3 pad 5 + +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.2 + ghost atom cutoff = 1.2 + binsize = 0.6, bins = 34 34 28 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke/history, perpetual + attributes: half, newton off, size, history + pair build: half/size/bin/newtoff + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.831 | 5.831 | 5.831 Mbytes + Step Atoms KinEng c_1 Volume + 0 0 -0 0 6600 + 1000 402 753.1301 0 6600 + 2000 402 1389.6785 0 6600 + 3000 402 1439.3007 16.360577 6600 + 4000 804 1694.9311 52.966189 6600 + 5000 804 1564.7533 67.202593 6600 + 6000 804 1303.6937 65.31424 6600 + 7000 1206 1590.3342 63.948699 6600 + 8000 1206 1489.2483 54.736993 6600 + 9000 1206 1234.442 56.141183 6600 + 10000 1608 1314.3588 49.189127 6600 + 11000 1608 1237.9823 42.555046 6600 + 12000 1608 1142.8729 41.96142 6600 + 13000 2010 1230.1948 49.194135 6600 + 14000 2010 1178.1648 39.43872 6600 + 15000 2010 1031.6441 46.416609 6600 + 16000 2412 1109.7641 45.866965 6600 + 17000 2412 1047.232 38.618366 6600 + 18000 2412 888.02373 41.307438 6600 + 19000 2814 965.06339 40.889834 6600 + 20000 2814 922.71203 40.04001 6600 + 21000 2814 815.9575 38.366756 6600 + 22000 2814 570.89153 37.83039 6600 + 23000 3000 428.71007 37.62527 6600 + 24000 3000 341.87262 24.030639 6600 + 25000 3000 243.78921 22.003596 6600 +Loop time of 2.70972 on 4 procs for 25000 steps with 3000 atoms + +Performance: 797131.262 tau/day, 9226.056 timesteps/s, 27.678 Matom-step/s +99.2% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2559 | 1.2759 | 1.2886 | 1.2 | 47.09 +Neigh | 0.29364 | 0.29822 | 0.30487 | 0.8 | 11.01 +Comm | 0.24161 | 0.25182 | 0.26235 | 1.5 | 9.29 +Output | 0.00076819 | 0.00084565 | 0.00098501 | 0.0 | 0.03 +Modify | 0.59267 | 0.61574 | 0.63388 | 2.3 | 22.72 +Other | | 0.2672 | | | 9.86 + +Nlocal: 750 ave 759 max 734 min +Histogram: 1 0 0 0 0 0 0 1 1 1 +Nghost: 381.75 ave 392 max 367 min +Histogram: 1 0 0 0 0 0 1 1 0 1 +Neighs: 3569.75 ave 3651 max 3448 min +Histogram: 1 0 0 0 0 0 1 1 0 1 + +Total # of neighbors = 14279 +Ave neighs/atom = 4.7596667 +Neighbor list builds = 1151 +Dangerous builds = 0 + +unfix ins +fix 2 all gravity 1.0 chute 26.0 +run 25000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 10.43 | 10.43 | 10.43 Mbytes + Step Atoms KinEng c_1 Volume + 25000 3000 243.78921 22.003596 6600 + 26000 3000 119.4338 18.414134 6600 + 27000 3000 172.50337 12.019175 6600 + 28000 3000 316.78411 12.871972 6600 + 29000 3000 524.47221 16.004598 6600 + 30000 3000 812.57656 20.096736 6600 + 31000 3000 1181.7814 28.226314 6600 + 32000 3000 1612.855 28.279192 6600 + 33000 3000 2075.6364 29.358829 6600 + 34000 3000 2634.5344 36.312508 6600 + 35000 3000 3213.2814 43.992962 6600 + 36000 3000 3900.499 38.674908 6600 + 37000 3000 4594.329 46.025242 6600 + 38000 3000 5367.8353 46.404081 6600 + 39000 3000 6180.9788 56.484589 6600 + 40000 3000 7111.5267 51.165038 6600 + 41000 3000 7998.6331 65.039037 6600 + 42000 3000 9037.3716 69.653749 6600 + 43000 3000 10148.985 65.082635 6600 + 44000 3000 11242.901 62.787818 6600 + 45000 3000 12445.247 64.68269 6600 + 46000 3000 13773.582 59.313484 6600 + 47000 3000 15000.566 54.417728 6600 + 48000 3000 16312.814 60.23943 6600 + 49000 3000 17730.721 60.028021 6600 + 50000 3000 19221.273 62.659312 6600 +Loop time of 5.52345 on 4 procs for 25000 steps with 3000 atoms + +Performance: 391059.670 tau/day, 4526.154 timesteps/s, 13.578 Matom-step/s +99.3% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.1235 | 3.1506 | 3.1758 | 1.1 | 57.04 +Neigh | 0.47171 | 0.47561 | 0.48174 | 0.5 | 8.61 +Comm | 0.39363 | 0.39957 | 0.4049 | 0.6 | 7.23 +Output | 0.0010759 | 0.0011654 | 0.0012802 | 0.2 | 0.02 +Modify | 0.93409 | 0.95091 | 0.96521 | 1.2 | 17.22 +Other | | 0.5456 | | | 9.88 + +Nlocal: 750 ave 759 max 744 min +Histogram: 1 0 1 1 0 0 0 0 0 1 +Nghost: 404.75 ave 411 max 402 min +Histogram: 1 2 0 0 0 0 0 0 0 1 +Neighs: 3694.75 ave 3722 max 3672 min +Histogram: 1 0 0 1 1 0 0 0 0 1 + +Total # of neighbors = 14779 +Ave neighs/atom = 4.9263333 +Neighbor list builds = 856 +Dangerous builds = 0 +Total wall time: 0:00:08 diff --git a/examples/pour/log.27Nov18.pour.2d.g++.1 b/examples/pour/log.27Nov18.pour.2d.g++.1 deleted file mode 100644 index d8b615816f..0000000000 --- a/examples/pour/log.27Nov18.pour.2d.g++.1 +++ /dev/null @@ -1,121 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Pour 2d granular particles into container - -dimension 2 -atom_style sphere -boundary f fm p -newton off -comm_modify vel yes - -region reg block 0 100 0 50 -0.5 0.5 units box -create_box 1 reg -Created orthogonal box = (0 0 -0.5) to (100 50 0.5) - 1 by 1 by 1 MPI processor grid - -neighbor 0.2 bin -neigh_modify delay 0 - -# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) -# are used in this example file to produce a quick simulation and movie. -# More appropriate values for realistic simulations would be -# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). - -pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 -pair_coeff * * - -timestep 0.001 - -fix 1 all nve/sphere -fix 2 all gravity 1.0 spherical 0.0 -180.0 -fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 -fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL - -region slab block 1.0 99.0 30 34.5 -0.5 0.5 units box -fix ins all pour 1000 1 4767548 vol 0.4 10 diam range 0.5 1.0 region slab -Particle insertion: 224 every 3000 steps, 1000 by step 12001 - -fix 3 all enforce2d - -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol -thermo 1000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic/dof yes - -#dump id all atom 250 dump.pour - -#dump 2 all image 500 image.*.jpg type type # zoom 1.6 adiam 1.5 -#dump_modify 2 pad 5 - -#dump 3 all movie 500 movie.mpg type type # zoom 1.6 adiam 1.5 -#dump_modify 3 pad 5 - -run 25000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 1.2 - binsize = 0.6, bins = 167 84 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/2d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.804 | 5.804 | 5.804 Mbytes -Step Atoms KinEng c_1 Volume - 0 0 -0 0 5000 - 1000 224 201.77464 0 5000 - 2000 224 372.42868 0 5000 - 3000 224 599.60221 0 5000 - 4000 448 1084.3752 0 5000 - 5000 448 1592.4543 0 5000 - 6000 448 1763.3153 37.274939 5000 - 7000 672 1805.206 89.331853 5000 - 8000 672 1778.0015 111.58381 5000 - 9000 672 1592.6805 97.550311 5000 - 10000 896 1631.962 76.905078 5000 - 11000 896 1590.1527 68.644552 5000 - 12000 896 1564.4707 60.119562 5000 - 13000 1000 1490.072 56.982972 5000 - 14000 1000 1266.4669 57.579371 5000 - 15000 1000 1034.1055 46.079374 5000 - 16000 1000 748.70283 43.933154 5000 - 17000 1000 462.65166 37.522016 5000 - 18000 1000 327.40481 29.450285 5000 - 19000 1000 223.24319 31.981144 5000 - 20000 1000 54.792042 23.449101 5000 - 21000 1000 25.805484 16.352528 5000 - 22000 1000 20.617765 11.756965 5000 - 23000 1000 16.115382 7.9435503 5000 - 24000 1000 11.971003 5.9411126 5000 - 25000 1000 10.404117 4.3811155 5000 -Loop time of 2.72875 on 1 procs for 25000 steps with 1000 atoms - -Performance: 791570.958 tau/day, 9161.701 timesteps/s -98.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.95597 | 0.95597 | 0.95597 | 0.0 | 35.03 -Neigh | 0.38475 | 0.38475 | 0.38475 | 0.0 | 14.10 -Comm | 0.010862 | 0.010862 | 0.010862 | 0.0 | 0.40 -Output | 0.00054383 | 0.00054383 | 0.00054383 | 0.0 | 0.02 -Modify | 1.2364 | 1.2364 | 1.2364 | 0.0 | 45.31 -Other | | 0.1402 | | | 5.14 - -Nlocal: 1000 ave 1000 max 1000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2374 ave 2374 max 2374 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2374 -Ave neighs/atom = 2.374 -Neighbor list builds = 2089 -Dangerous builds = 0 -Total wall time: 0:00:02 diff --git a/examples/pour/log.27Nov18.pour.2d.g++.4 b/examples/pour/log.27Nov18.pour.2d.g++.4 deleted file mode 100644 index a491cf4866..0000000000 --- a/examples/pour/log.27Nov18.pour.2d.g++.4 +++ /dev/null @@ -1,121 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Pour 2d granular particles into container - -dimension 2 -atom_style sphere -boundary f fm p -newton off -comm_modify vel yes - -region reg block 0 100 0 50 -0.5 0.5 units box -create_box 1 reg -Created orthogonal box = (0 0 -0.5) to (100 50 0.5) - 4 by 1 by 1 MPI processor grid - -neighbor 0.2 bin -neigh_modify delay 0 - -# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) -# are used in this example file to produce a quick simulation and movie. -# More appropriate values for realistic simulations would be -# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). - -pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 -pair_coeff * * - -timestep 0.001 - -fix 1 all nve/sphere -fix 2 all gravity 1.0 spherical 0.0 -180.0 -fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 -fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL - -region slab block 1.0 99.0 30 34.5 -0.5 0.5 units box -fix ins all pour 1000 1 4767548 vol 0.4 10 diam range 0.5 1.0 region slab -Particle insertion: 224 every 3000 steps, 1000 by step 12001 - -fix 3 all enforce2d - -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol -thermo 1000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic/dof yes - -#dump id all atom 250 dump.pour - -#dump 2 all image 500 image.*.jpg type type # zoom 1.6 adiam 1.5 -#dump_modify 2 pad 5 - -#dump 3 all movie 500 movie.mpg type type # zoom 1.6 adiam 1.5 -#dump_modify 3 pad 5 - -run 25000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 1.2 - binsize = 0.6, bins = 167 84 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/2d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.77 | 5.77 | 5.77 Mbytes -Step Atoms KinEng c_1 Volume - 0 0 -0 0 5000 - 1000 224 201.77464 0 5000 - 2000 224 372.42868 0 5000 - 3000 224 599.60221 0 5000 - 4000 448 1084.3752 0 5000 - 5000 448 1592.4543 0 5000 - 6000 448 1763.3153 37.274939 5000 - 7000 672 1805.206 89.331853 5000 - 8000 672 1778.0015 111.58381 5000 - 9000 672 1592.6805 97.550311 5000 - 10000 896 1630.8521 79.742572 5000 - 11000 896 1593.1588 67.633788 5000 - 12000 896 1562.2084 65.097236 5000 - 13000 1000 1504.1203 63.468934 5000 - 14000 1000 1266.5724 55.837334 5000 - 15000 1000 1041.8665 48.938774 5000 - 16000 1000 766.27305 43.846151 5000 - 17000 1000 466.30103 43.206188 5000 - 18000 1000 320.50154 26.84775 5000 - 19000 1000 207.91453 29.183522 5000 - 20000 1000 52.447982 19.30378 5000 - 21000 1000 22.027641 10.395933 5000 - 22000 1000 15.395099 6.7003289 5000 - 23000 1000 11.97674 5.2548063 5000 - 24000 1000 7.8974699 3.7396899 5000 - 25000 1000 6.1288038 2.2056805 5000 -Loop time of 0.901039 on 4 procs for 25000 steps with 1000 atoms - -Performance: 2397232.992 tau/day, 27745.752 timesteps/s -96.8% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.21557 | 0.22754 | 0.23651 | 1.9 | 25.25 -Neigh | 0.098304 | 0.10178 | 0.10595 | 1.0 | 11.30 -Comm | 0.051792 | 0.066485 | 0.079589 | 3.8 | 7.38 -Output | 0.00052619 | 0.00061941 | 0.00082016 | 0.0 | 0.07 -Modify | 0.31782 | 0.32767 | 0.33815 | 1.5 | 36.37 -Other | | 0.1769 | | | 19.64 - -Nlocal: 250 ave 267 max 232 min -Histogram: 1 0 0 0 1 1 0 0 0 1 -Nghost: 18 ave 23 max 14 min -Histogram: 2 0 0 0 0 0 0 1 0 1 -Neighs: 606 ave 664 max 559 min -Histogram: 1 0 1 0 0 1 0 0 0 1 - -Total # of neighbors = 2424 -Ave neighs/atom = 2.424 -Neighbor list builds = 2060 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/pour/log.27Nov18.pour.2d.molecule.g++.1 b/examples/pour/log.27Nov18.pour.2d.molecule.g++.1 deleted file mode 100644 index 38d3778b01..0000000000 --- a/examples/pour/log.27Nov18.pour.2d.molecule.g++.1 +++ /dev/null @@ -1,142 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Pour 2d granular particles into container - -dimension 2 -atom_style sphere -atom_modify map array -boundary f fm p -newton off -comm_modify vel yes cutoff 2.5 - -fix prop all property/atom mol ghost yes - -region reg block 0 100 0 50 -0.5 0.5 units box -create_box 1 reg -Created orthogonal box = (0 0 -0.5) to (100 50 0.5) - 1 by 1 by 1 MPI processor grid - -neighbor 0.2 bin -neigh_modify delay 0 - -# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) -# are used in this example file to produce a quick simulation and movie. -# More appropriate values for realistic simulations would be -# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). - -pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 -pair_coeff * * - -timestep 0.001 - -fix 2 all gravity 1.0 spherical 0.0 -180.0 -fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 -fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL - -molecule object molecule.vshape -Read molecule object: - 5 atoms with max type 1 - 0 bonds with max type 0 - 0 angles with max type 0 - 0 dihedrals with max type 0 - 0 impropers with max type 0 -fix 3 all rigid/small molecule mol object -0 rigid bodies with 0 atoms - 2.23607 = max distance from body owner to body atom - -# ensure region size + molecule size does not overlap wall - -region slab block 3.0 97.0 30 34.5 -0.5 0.5 units box -fix ins all pour 500 0 4767548 vol 0.8 10 region slab mol object rigid 3 -Particle insertion: 26 every 3000 steps, 500 by step 57001 - -fix 4 all enforce2d - -compute 1 all erotate/sphere -compute Tsphere all temp/sphere -thermo_style custom step atoms ke c_1 vol -thermo_modify lost ignore norm no temp Tsphere -compute_modify Tsphere dynamic/dof yes - -thermo 1000 - -#dump id all atom 100 tmp.dump - -#variable colors string # "red green blue yellow white # purple pink orange lime gray" -#variable mol2 atom mol%10 -#dump 2 all image 250 image.*.jpg v_mol2 type # zoom 1.6 adiam 1.5 -#dump_modify 2 pad 5 amap 0 10 sa 1 10 ${colors} - -#variable colors string # "red green blue yellow white # purple pink orange lime gray" -#variable mol3 atom mol%10 -#dump 3 all movie 250 movie.mpg v_mol3 type # zoom 1.6 adiam 1.5 -#dump_modify 3 pad 5 amap 0 10 sa 1 10 ${colors} - -run 25000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 2.5 - binsize = 0.6, bins = 167 84 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/2d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.81 | 5.81 | 5.81 Mbytes -Step Atoms KinEng c_1 Volume - 0 0 -0 0 5000 - 1000 130 259.24123 2.3772821e-30 5000 - 2000 130 465.39775 9.5010246e-30 5000 - 3000 130 736.55426 2.1365791e-29 5000 - 4000 260 1274.295 6.045774e-05 5000 - 5000 260 1855.4991 0.0021687846 5000 - 6000 260 1743.415 1.9678991 5000 - 7000 390 1675.8228 2.0085353 5000 - 8000 390 1845.2936 2.678293 5000 - 9000 390 1747.0301 2.5461774 5000 - 10000 520 2204.3744 1.3847146 5000 - 11000 520 1872.5943 6.5018283 5000 - 12000 520 1448.8705 3.2789997 5000 - 13000 650 1687.7845 2.4723994 5000 - 14000 650 1534.5832 1.7381523 5000 - 15000 650 1517.5812 2.4425352 5000 - 16000 780 1681.4276 3.5245463 5000 - 17000 780 1660.4845 3.5652485 5000 - 18000 780 1400.1788 4.1717202 5000 - 19000 910 1525.4386 3.2537276 5000 - 20000 910 1326.4257 3.5226044 5000 - 21000 910 1125.4321 3.1564949 5000 - 22000 1040 1262.0253 1.6097601 5000 - 23000 1040 1042.7 3.1078701 5000 - 24000 1040 1167.4717 1.4954047 5000 - 25000 1170 1214.9087 2.4525535 5000 -Loop time of 3.36515 on 1 procs for 25000 steps with 1170 atoms - -Performance: 641872.369 tau/day, 7429.078 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.73922 | 0.73922 | 0.73922 | 0.0 | 21.97 -Neigh | 0.22808 | 0.22808 | 0.22808 | 0.0 | 6.78 -Comm | 0.013331 | 0.013331 | 0.013331 | 0.0 | 0.40 -Output | 0.00082207 | 0.00082207 | 0.00082207 | 0.0 | 0.02 -Modify | 2.2694 | 2.2694 | 2.2694 | 0.0 | 67.44 -Other | | 0.1143 | | | 3.40 - -Nlocal: 1170 ave 1170 max 1170 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1699 ave 1699 max 1699 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1699 -Ave neighs/atom = 1.45214 -Neighbor list builds = 1715 -Dangerous builds = 0 -Total wall time: 0:00:03 diff --git a/examples/pour/log.27Nov18.pour.2d.molecule.g++.4 b/examples/pour/log.27Nov18.pour.2d.molecule.g++.4 deleted file mode 100644 index 397149fb6a..0000000000 --- a/examples/pour/log.27Nov18.pour.2d.molecule.g++.4 +++ /dev/null @@ -1,142 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Pour 2d granular particles into container - -dimension 2 -atom_style sphere -atom_modify map array -boundary f fm p -newton off -comm_modify vel yes cutoff 2.5 - -fix prop all property/atom mol ghost yes - -region reg block 0 100 0 50 -0.5 0.5 units box -create_box 1 reg -Created orthogonal box = (0 0 -0.5) to (100 50 0.5) - 4 by 1 by 1 MPI processor grid - -neighbor 0.2 bin -neigh_modify delay 0 - -# IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001) -# are used in this example file to produce a quick simulation and movie. -# More appropriate values for realistic simulations would be -# k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian). - -pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0 -pair_coeff * * - -timestep 0.001 - -fix 2 all gravity 1.0 spherical 0.0 -180.0 -fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 xplane 0 100 -fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 yplane 0 NULL - -molecule object molecule.vshape -Read molecule object: - 5 atoms with max type 1 - 0 bonds with max type 0 - 0 angles with max type 0 - 0 dihedrals with max type 0 - 0 impropers with max type 0 -fix 3 all rigid/small molecule mol object -0 rigid bodies with 0 atoms - 2.23607 = max distance from body owner to body atom - -# ensure region size + molecule size does not overlap wall - -region slab block 3.0 97.0 30 34.5 -0.5 0.5 units box -fix ins all pour 500 0 4767548 vol 0.8 10 region slab mol object rigid 3 -Particle insertion: 26 every 3000 steps, 500 by step 57001 - -fix 4 all enforce2d - -compute 1 all erotate/sphere -compute Tsphere all temp/sphere -thermo_style custom step atoms ke c_1 vol -thermo_modify lost ignore norm no temp Tsphere -compute_modify Tsphere dynamic/dof yes - -thermo 1000 - -#dump id all atom 100 tmp.dump - -#variable colors string # "red green blue yellow white # purple pink orange lime gray" -#variable mol2 atom mol%10 -#dump 2 all image 250 image.*.jpg v_mol2 type # zoom 1.6 adiam 1.5 -#dump_modify 2 pad 5 amap 0 10 sa 1 10 ${colors} - -#variable colors string # "red green blue yellow white # purple pink orange lime gray" -#variable mol3 atom mol%10 -#dump 3 all movie 250 movie.mpg v_mol3 type # zoom 1.6 adiam 1.5 -#dump_modify 3 pad 5 amap 0 10 sa 1 10 ${colors} - -run 25000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 2.5 - binsize = 0.6, bins = 167 84 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hertz/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/2d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.773 | 5.773 | 5.773 Mbytes -Step Atoms KinEng c_1 Volume - 0 0 -0 0 5000 - 1000 130 259.24123 2.3773387e-30 5000 - 2000 130 465.39775 9.5010816e-30 5000 - 3000 130 736.55426 2.1365846e-29 5000 - 4000 260 1274.295 6.045774e-05 5000 - 5000 260 1855.4991 0.0021687846 5000 - 6000 260 1743.415 1.9678991 5000 - 7000 390 1675.8228 2.0085353 5000 - 8000 390 1845.2936 2.678293 5000 - 9000 390 1747.0301 2.5461774 5000 - 10000 520 2204.3744 1.3847146 5000 - 11000 520 1872.5943 6.5018283 5000 - 12000 520 1448.8705 3.2789997 5000 - 13000 650 1687.7845 2.4723994 5000 - 14000 650 1534.5832 1.7381523 5000 - 15000 650 1517.5812 2.4425352 5000 - 16000 780 1680.8761 3.5506853 5000 - 17000 780 1661.6046 3.6673972 5000 - 18000 780 1391.3201 4.1075002 5000 - 19000 910 1526.6687 3.410537 5000 - 20000 910 1387.6908 2.7370047 5000 - 21000 910 1056.6723 2.5690119 5000 - 22000 1040 1226.7461 1.2299974 5000 - 23000 1040 1106.7165 3.1057108 5000 - 24000 1040 1161.9203 2.0994962 5000 - 25000 1170 1187.5093 2.9596172 5000 -Loop time of 1.4211 on 4 procs for 25000 steps with 1170 atoms - -Performance: 1519946.444 tau/day, 17591.973 timesteps/s -94.0% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.19053 | 0.21869 | 0.23582 | 3.7 | 15.39 -Neigh | 0.06394 | 0.066575 | 0.070017 | 0.9 | 4.68 -Comm | 0.055579 | 0.070079 | 0.080658 | 3.4 | 4.93 -Output | 0.0012593 | 0.0031545 | 0.0088205 | 5.8 | 0.22 -Modify | 0.89034 | 0.9006 | 0.91315 | 0.9 | 63.37 -Other | | 0.162 | | | 11.40 - -Nlocal: 292.5 ave 296 max 285 min -Histogram: 1 0 0 0 0 0 0 0 1 2 -Nghost: 44 ave 60 max 21 min -Histogram: 1 0 0 1 0 0 0 0 0 2 -Neighs: 433.25 ave 449 max 418 min -Histogram: 1 0 1 0 0 0 1 0 0 1 - -Total # of neighbors = 1733 -Ave neighs/atom = 1.4812 -Neighbor list builds = 1708 -Dangerous builds = 0 -Total wall time: 0:00:01 diff --git a/examples/pour/log.27Nov18.pour.g++.1 b/examples/pour/log.27Nov18.pour.g++.1 deleted file mode 100644 index a1ebc335cd..0000000000 --- a/examples/pour/log.27Nov18.pour.g++.1 +++ /dev/null @@ -1,175 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Pour granular particles into chute container, then induce flow - -atom_style sphere -boundary p p fm -newton off -comm_modify vel yes - -region reg block -10 10 -10 10 -0.5 16 units box -create_box 1 reg -Created orthogonal box = (-10 -10 -0.5) to (10 10 16) - 1 by 1 by 1 MPI processor grid - -neighbor 0.2 bin -neigh_modify delay 0 - -# IMPORTANT NOTE: these values of stiffness (2000) and timestep (0.001) -# are used in this example file to produce a quick simulation and movie. -# More appropriate values for realistic simulations would be -# k = 2.0e5 and dt = 0.0001, as in bench/in.chute. - -pair_style gran/hooke/history 2000.0 NULL 50.0 NULL 0.5 0 -pair_coeff * * - -timestep 0.001 - -fix 1 all nve/sphere -fix 2 all gravity 1.0 spherical 0.0 -180.0 -fix zlower all wall/gran hooke/history 2000.0 NULL 50.0 NULL 0.5 0 zplane 0.0 2000.0 - -region slab block -9.0 9.0 -9.0 9.0 10.0 15.0 units box -fix ins all pour 3000 1 300719 vol 0.13 50 region slab -Particle insertion: 402 every 3162 steps, 3000 by step 22135 - -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol -thermo 1000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic/dof yes - -#dump id all atom 1000 dump.pour - -#dump 2 all image 1000 image.*.jpg type type # axes yes 0.8 0.02 view 80 -30 -#dump_modify 2 pad 5 - -#dump 3 all movie 1000 movie.mpg type type # axes yes 0.8 0.02 view 80 -30 -#dump_modify 3 pad 5 - -run 25000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 1.2 - binsize = 0.6, bins = 34 34 28 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.955 | 5.955 | 5.955 Mbytes -Step Atoms KinEng c_1 Volume - 0 0 -0 0 6600 - 1000 402 768.04606 0 6600 - 2000 402 1407.1714 0 6600 - 3000 402 1373.819 15.59952 6600 - 4000 804 1737.1399 39.311164 6600 - 5000 804 1571.3184 67.501382 6600 - 6000 804 1318.6439 77.636174 6600 - 7000 1206 1522.1986 68.863683 6600 - 8000 1206 1387.2223 64.067846 6600 - 9000 1206 1265.9044 51.726525 6600 - 10000 1608 1460.3212 48.844763 6600 - 11000 1608 1310.2001 53.532609 6600 - 12000 1608 1134.4592 48.567743 6600 - 13000 2010 1182.5037 45.620614 6600 - 14000 2010 1192.4303 39.066935 6600 - 15000 2010 967.05968 42.363789 6600 - 16000 2412 1119.8304 39.217157 6600 - 17000 2412 1063.7921 45.71714 6600 - 18000 2412 855.28326 42.745948 6600 - 19000 2814 970.7019 40.155896 6600 - 20000 2814 923.94347 34.590568 6600 - 21000 2814 793.75092 36.707509 6600 - 22000 2814 543.4546 37.669131 6600 - 23000 3000 446.47658 39.719019 6600 - 24000 3000 331.57201 24.034747 6600 - 25000 3000 239.90493 18.457205 6600 -Loop time of 8.66761 on 1 procs for 25000 steps with 3000 atoms - -Performance: 249203.592 tau/day, 2884.301 timesteps/s -99.7% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 4.5311 | 4.5311 | 4.5311 | 0.0 | 52.28 -Neigh | 1.4556 | 1.4556 | 1.4556 | 0.0 | 16.79 -Comm | 0.2322 | 0.2322 | 0.2322 | 0.0 | 2.68 -Output | 0.00084257 | 0.00084257 | 0.00084257 | 0.0 | 0.01 -Modify | 2.1642 | 2.1642 | 2.1642 | 0.0 | 24.97 -Other | | 0.2837 | | | 3.27 - -Nlocal: 3000 ave 3000 max 3000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 658 ave 658 max 658 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 13479 ave 13479 max 13479 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 13479 -Ave neighs/atom = 4.493 -Neighbor list builds = 1149 -Dangerous builds = 0 - -unfix ins -fix 2 all gravity 1.0 chute 26.0 -run 25000 -Per MPI rank memory allocation (min/avg/max) = 13.24 | 13.24 | 13.24 Mbytes -Step Atoms KinEng c_1 Volume - 25000 3000 239.90493 18.457205 6600 - 26000 3000 86.453151 19.990229 6600 - 27000 3000 104.03763 12.243926 6600 - 28000 3000 187.74939 11.703132 6600 - 29000 3000 316.59921 14.610301 6600 - 30000 3000 520.76149 18.82089 6600 - 31000 3000 821.71283 25.266473 6600 - 32000 3000 1153.8578 30.714985 6600 - 33000 3000 1520.1476 38.247011 6600 - 34000 3000 2006.3144 44.480026 6600 - 35000 3000 2556.4751 55.768118 6600 - 36000 3000 3160.9914 63.728696 6600 - 37000 3000 3877.5537 71.484742 6600 - 38000 3000 4675.4987 79.37485 6600 - 39000 3000 5479.8489 94.281786 6600 - 40000 3000 6350.6439 106.39353 6600 - 41000 3000 7245.0837 113.40306 6600 - 42000 3000 8227.1726 129.62268 6600 - 43000 3000 9422.0189 144.63991 6600 - 44000 3000 10616.036 149.84326 6600 - 45000 3000 11908.182 169.96204 6600 - 46000 3000 13257.313 184.73533 6600 - 47000 3000 14765.4 201.20237 6600 - 48000 3000 16184.643 202.00907 6600 - 49000 3000 17573.204 215.30429 6600 - 50000 3000 19117.749 232.28939 6600 -Loop time of 16.4345 on 1 procs for 25000 steps with 3000 atoms - -Performance: 131430.508 tau/day, 1521.186 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 9.893 | 9.893 | 9.893 | 0.0 | 60.20 -Neigh | 2.1448 | 2.1448 | 2.1448 | 0.0 | 13.05 -Comm | 0.47991 | 0.47991 | 0.47991 | 0.0 | 2.92 -Output | 0.0011523 | 0.0011523 | 0.0011523 | 0.0 | 0.01 -Modify | 3.4635 | 3.4635 | 3.4635 | 0.0 | 21.07 -Other | | 0.4522 | | | 2.75 - -Nlocal: 3000 ave 3000 max 3000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 742 ave 742 max 742 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 13997 ave 13997 max 13997 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 13997 -Ave neighs/atom = 4.66567 -Neighbor list builds = 836 -Dangerous builds = 0 -Total wall time: 0:00:25 diff --git a/examples/pour/log.27Nov18.pour.g++.4 b/examples/pour/log.27Nov18.pour.g++.4 deleted file mode 100644 index 004bf92608..0000000000 --- a/examples/pour/log.27Nov18.pour.g++.4 +++ /dev/null @@ -1,175 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Pour granular particles into chute container, then induce flow - -atom_style sphere -boundary p p fm -newton off -comm_modify vel yes - -region reg block -10 10 -10 10 -0.5 16 units box -create_box 1 reg -Created orthogonal box = (-10 -10 -0.5) to (10 10 16) - 2 by 2 by 1 MPI processor grid - -neighbor 0.2 bin -neigh_modify delay 0 - -# IMPORTANT NOTE: these values of stiffness (2000) and timestep (0.001) -# are used in this example file to produce a quick simulation and movie. -# More appropriate values for realistic simulations would be -# k = 2.0e5 and dt = 0.0001, as in bench/in.chute. - -pair_style gran/hooke/history 2000.0 NULL 50.0 NULL 0.5 0 -pair_coeff * * - -timestep 0.001 - -fix 1 all nve/sphere -fix 2 all gravity 1.0 spherical 0.0 -180.0 -fix zlower all wall/gran hooke/history 2000.0 NULL 50.0 NULL 0.5 0 zplane 0.0 2000.0 - -region slab block -9.0 9.0 -9.0 9.0 10.0 15.0 units box -fix ins all pour 3000 1 300719 vol 0.13 50 region slab -Particle insertion: 402 every 3162 steps, 3000 by step 22135 - -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol -thermo 1000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic/dof yes - -#dump id all atom 1000 dump.pour - -#dump 2 all image 1000 image.*.jpg type type # axes yes 0.8 0.02 view 80 -30 -#dump_modify 2 pad 5 - -#dump 3 all movie 1000 movie.mpg type type # axes yes 0.8 0.02 view 80 -30 -#dump_modify 3 pad 5 - -run 25000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.2 - ghost atom cutoff = 1.2 - binsize = 0.6, bins = 34 34 28 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair gran/hooke/history, perpetual - attributes: half, newton off, size, history - pair build: half/size/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.83 | 5.83 | 5.83 Mbytes -Step Atoms KinEng c_1 Volume - 0 0 -0 0 6600 - 1000 402 768.04606 0 6600 - 2000 402 1407.1714 0 6600 - 3000 402 1373.819 15.59952 6600 - 4000 804 1737.1399 39.311164 6600 - 5000 804 1571.3184 67.501382 6600 - 6000 804 1318.6439 77.636174 6600 - 7000 1206 1521.8348 69.010381 6600 - 8000 1206 1391.0761 64.407583 6600 - 9000 1206 1264.98 50.32567 6600 - 10000 1608 1462.7175 49.903609 6600 - 11000 1608 1317.5878 52.401196 6600 - 12000 1608 1120.9416 46.067058 6600 - 13000 2010 1200.1517 49.662302 6600 - 14000 2010 1180.2805 38.850379 6600 - 15000 2010 970.23519 39.121533 6600 - 16000 2412 1101.3888 44.051087 6600 - 17000 2412 1054.4967 43.489619 6600 - 18000 2412 850.25959 42.296696 6600 - 19000 2814 959.68841 42.757546 6600 - 20000 2814 933.72206 42.668586 6600 - 21000 2814 779.2842 42.116934 6600 - 22000 2814 537.68477 35.113909 6600 - 23000 3000 456.26221 36.394458 6600 - 24000 3000 334.38331 26.256087 6600 - 25000 3000 233.7217 18.768345 6600 -Loop time of 2.79912 on 4 procs for 25000 steps with 3000 atoms - -Performance: 771671.423 tau/day, 8931.382 timesteps/s -97.1% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.0916 | 1.1431 | 1.1982 | 4.0 | 40.84 -Neigh | 0.37439 | 0.39186 | 0.41149 | 2.6 | 14.00 -Comm | 0.32241 | 0.32795 | 0.33831 | 1.1 | 11.72 -Output | 0.00068283 | 0.0029467 | 0.0094671 | 6.9 | 0.11 -Modify | 0.5813 | 0.5952 | 0.60947 | 1.5 | 21.26 -Other | | 0.3381 | | | 12.08 - -Nlocal: 750 ave 765 max 730 min -Histogram: 1 0 0 0 1 0 0 0 1 1 -Nghost: 390.75 ave 393 max 385 min -Histogram: 1 0 0 0 0 0 0 0 1 2 -Neighs: 3548 ave 3643 max 3454 min -Histogram: 1 0 1 0 0 0 0 1 0 1 - -Total # of neighbors = 14192 -Ave neighs/atom = 4.73067 -Neighbor list builds = 1152 -Dangerous builds = 0 - -unfix ins -fix 2 all gravity 1.0 chute 26.0 -run 25000 -Per MPI rank memory allocation (min/avg/max) = 12.16 | 12.39 | 13.06 Mbytes -Step Atoms KinEng c_1 Volume - 25000 3000 233.7217 18.768345 6600 - 26000 3000 80.58756 21.114703 6600 - 27000 3000 112.90794 11.760837 6600 - 28000 3000 211.68857 11.667711 6600 - 29000 3000 368.27114 15.483397 6600 - 30000 3000 611.33941 21.023859 6600 - 31000 3000 902.04662 29.663904 6600 - 32000 3000 1188.6213 31.996848 6600 - 33000 3000 1626.3144 38.244424 6600 - 34000 3000 2068.1939 45.793779 6600 - 35000 3000 2654.4292 55.900641 6600 - 36000 3000 3212.0662 64.492942 6600 - 37000 3000 3942.9079 73.557353 6600 - 38000 3000 4710.2169 84.24051 6600 - 39000 3000 5513.597 93.737814 6600 - 40000 3000 6367.338 112.43633 6600 - 41000 3000 7417.7889 130.70338 6600 - 42000 3000 8428.2678 124.66302 6600 - 43000 3000 9498.0121 136.37107 6600 - 44000 3000 10680.269 149.21074 6600 - 45000 3000 11852.03 154.67802 6600 - 46000 3000 12896.699 167.10324 6600 - 47000 3000 14218.465 196.70386 6600 - 48000 3000 15555.796 204.40316 6600 - 49000 3000 16694.338 208.98934 6600 - 50000 3000 17936.665 192.19442 6600 -Loop time of 5.65089 on 4 procs for 25000 steps with 3000 atoms - -Performance: 382240.368 tau/day, 4424.078 timesteps/s -94.3% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 2.5656 | 2.5853 | 2.6068 | 0.9 | 45.75 -Neigh | 0.57736 | 0.59939 | 0.61824 | 1.9 | 10.61 -Comm | 0.58146 | 0.63908 | 0.70461 | 5.5 | 11.31 -Output | 0.00081015 | 0.002184 | 0.0061922 | 5.0 | 0.04 -Modify | 0.91975 | 0.93371 | 0.95875 | 1.5 | 16.52 -Other | | 0.8912 | | | 15.77 - -Nlocal: 750 ave 758 max 741 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Nghost: 404 ave 417 max 395 min -Histogram: 1 0 1 0 1 0 0 0 0 1 -Neighs: 3603.75 ave 3695 max 3528 min -Histogram: 1 0 0 1 1 0 0 0 0 1 - -Total # of neighbors = 14415 -Ave neighs/atom = 4.805 -Neighbor list builds = 827 -Dangerous builds = 0 -Total wall time: 0:00:08 From 4a7ab34568a4413cafe888b84c4ff4e690e2c207 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 22:57:56 -0400 Subject: [PATCH 111/112] lift restriction to Sphinx version < 6.0, enable jquery extension --- doc/utils/requirements.txt | 3 ++- doc/utils/sphinx-config/conf.py.in | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/utils/requirements.txt b/doc/utils/requirements.txt index 8bec6d4148..a7a03e6e41 100644 --- a/doc/utils/requirements.txt +++ b/doc/utils/requirements.txt @@ -1,5 +1,6 @@ -Sphinx<6.0.0 +Sphinx < 7.0.0 sphinxcontrib-spelling +sphinxcontrib-jquery >=3.0.0 git+https://github.com/akohlmey/sphinx-fortran@parallel-read sphinx_tabs breathe diff --git a/doc/utils/sphinx-config/conf.py.in b/doc/utils/sphinx-config/conf.py.in index e8a67cc4f6..0da553d755 100644 --- a/doc/utils/sphinx-config/conf.py.in +++ b/doc/utils/sphinx-config/conf.py.in @@ -47,6 +47,7 @@ extensions = [ 'sphinx.ext.mathjax', 'sphinx.ext.imgmath', 'sphinx.ext.autodoc', + 'sphinxcontrib.jquery', 'sphinxfortran.fortran_domain', 'sphinx_tabs.tabs', 'table_from_list', From 21c71bf35d72875202e2d2b615db84eec7437fb2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Mar 2023 23:36:13 -0400 Subject: [PATCH 112/112] mention project boards. remove reference to milestones. --- doc/github-development-workflow.md | 32 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/doc/github-development-workflow.md b/doc/github-development-workflow.md index 830ce85f48..fccd75d29a 100644 --- a/doc/github-development-workflow.md +++ b/doc/github-development-workflow.md @@ -123,7 +123,7 @@ request is merged. The template for pull requests includes a header where connections between pull requests and issues can be listed, and thus where this comment should be placed. -## Milestones and Release Planning +## Release Planning LAMMPS uses a continuous release development model with incremental changes, i.e. significant effort is made -- including automated pre-merge @@ -132,24 +132,28 @@ broken. These tests are run after every update to a pull request. More extensive and time-consuming tests (including regression testing) are performed after code is merged to the "develop" branch. There are feature releases of LAMMPS made about every 4-6 weeks at a point, when the LAMMPS -developers feel, that a sufficient number of changes has been included +developers feel, that a sufficient number of changes have been included and all post-merge testing has been successful. These feature releases are marked with a `patch_` tag and the "release" branch follows only these versions with fast-forward merges. While "develop" may be temporarily broken through issues only detected by the post-merge tests, The "release" branch is always supposed to be of production quality. -About once each year, there is a "stable" release of LAMMPS. -These have seen additional, manual testing and review of -results from testing with instrumented code and static code analysis. -Also, the last few feature releases before a stable release are "release -candidate" versions which only contain bug fixes, feature additions to -peripheral functionality, and documentation updates. In between stable -releases, bug fixes and infrastructure updates are back-ported from the -"develop" branch to the "maintenance" branch and occasionally merged -into "stable" and published as update releases. +About once each year, there is a "stable" release of LAMMPS. These have +seen additional, manual testing and review of results from testing with +instrumented code and static code analysis. Also, the last few feature +releases before a stable release are "release candidate" versions which +only contain bug fixes, feature additions to peripheral functionality, +and documentation updates. In between stable releases, bug fixes and +infrastructure updates are back-ported from the "develop" branch to the +"maintenance" branch and occasionally merged into "stable" and published +as update releases. + +## Project Management For release planning and the information of code contributors, issues -and pull requests being actively worked on are assigned a "milestone", -which corresponds to the next stable release or the stable release after -that, with a tentative release date. +and pull requests are being managed with GitHub Project Boards. There +are currently three boards: LAMMPS Feature Requests, LAMMPS Bug Reports, +and LAMMPS Pull Requests. Each board is organized in columns where +submissions are categorized. Within each column the entries are +(manually) sorted according their priority.