diff --git a/doc/src/atom_style.rst b/doc/src/atom_style.rst index 629c02e1b4..91aa95d7cd 100644 --- a/doc/src/atom_style.rst +++ b/doc/src/atom_style.rst @@ -10,7 +10,7 @@ Syntax atom_style style args -* style = *angle* or *atomic* or *body* or *bond* or *charge* or *dipole* or *dpd* or *edpd* or *electron* or *ellipsoid* or *full* or *line* or *mdpd* or *meso* or *molecular* or *peri* or *smd* or *sphere* or *spin* or *tdpd* or *tri* or *template* or *hybrid* +* style = *angle* or *atomic* or *body* or *bond* or *charge* or *dipole* or *dpd* or *edpd* or *electron* or *ellipsoid* or *full* or *line* or *mdpd* or *molecular* or *peri* or *smd* or *sph* or *sphere* or *spin* or *tdpd* or *tri* or *template* or *hybrid* .. parsed-literal:: @@ -103,14 +103,14 @@ quantities. +--------------+-----------------------------------------------------+--------------------------------------+ | *mdpd* | density | mDPD particles | +--------------+-----------------------------------------------------+--------------------------------------+ -| *meso* | rho, e, cv | SPH particles | -+--------------+-----------------------------------------------------+--------------------------------------+ | *molecular* | bonds, angles, dihedrals, impropers | uncharged molecules | +--------------+-----------------------------------------------------+--------------------------------------+ | *peri* | mass, volume | mesoscopic Peridynamic models | +--------------+-----------------------------------------------------+--------------------------------------+ | *smd* | volume, kernel diameter, contact radius, mass | solid and fluid SPH particles | +--------------+-----------------------------------------------------+--------------------------------------+ +| *sph* | rho, esph, cv | SPH particles | ++--------------+-----------------------------------------------------+--------------------------------------+ | *sphere* | diameter, mass, angular velocity | granular models | +--------------+-----------------------------------------------------+--------------------------------------+ | *spin* | magnetic moment | system with magnetic particles | @@ -198,8 +198,8 @@ particles which store a set of chemical concentration. An integer "cc_species" is required to specify the number of chemical species involved in a tDPD system. -The *meso* style is for smoothed particle hydrodynamics (SPH) -particles which store a density (rho), energy (e), and heat capacity +The *sph* style is for smoothed particle hydrodynamics (SPH) +particles which store a density (rho), energy (esph), and heat capacity (cv). The *smd* style is for a general formulation of Smooth Particle @@ -344,7 +344,7 @@ for energy-conserving dissipative particle dynamics (eDPD), many-body dissipative particle dynamics (mDPD), and transport dissipative particle dynamics (tDPD), respectively. -The *meso* style is part of the USER-SPH package for smoothed particle +The *sph* style is part of the USER-SPH package for smoothed particle hydrodynamics (SPH). See `this PDF guide `_ to using SPH in LAMMPS. The *spin* style is part of the SPIN package. diff --git a/doc/src/compute.rst b/doc/src/compute.rst index 0726a502bc..418a0f0e1d 100644 --- a/doc/src/compute.rst +++ b/doc/src/compute.rst @@ -225,9 +225,6 @@ The individual style names on the :doc:`Commands compute ` doc * :doc:`ke/atom/eff ` - per-atom translational and radial kinetic energy in the electron force field model * :doc:`ke/eff ` - kinetic energy of a group of nuclei and electrons in the electron force field model * :doc:`ke/rigid ` - translational kinetic energy of rigid bodies -* :doc:`meso/e/atom ` - per-atom internal energy of Smooth-Particle Hydrodynamics atoms -* :doc:`meso/rho/atom ` - per-atom mesoscopic density of Smooth-Particle Hydrodynamics atoms -* :doc:`meso/t/atom ` - per-atom internal temperature of Smooth-Particle Hydrodynamics atoms * :doc:`momentum ` - translational momentum * :doc:`msd ` - mean-squared displacement of group of atoms * :doc:`msd/chunk ` - mean-squared displacement for each chunk @@ -279,6 +276,9 @@ The individual style names on the :doc:`Commands compute ` doc * :doc:`sna/atom ` - bispectrum components for each atom * :doc:`snad/atom ` - derivative of bispectrum components for each atom * :doc:`snav/atom ` - virial contribution from bispectrum components for each atom +* :doc:`sph/e/atom ` - per-atom internal energy of Smooth-Particle Hydrodynamics atoms +* :doc:`sph/rho/atom ` - per-atom density of Smooth-Particle Hydrodynamics atoms +* :doc:`sph/t/atom ` - per-atom internal temperature of Smooth-Particle Hydrodynamics atoms * :doc:`spin ` - magnetic quantities for a system of atoms having spins * :doc:`stress/atom ` - stress tensor for each atom * :doc:`stress/mop ` - normal components of the local stress tensor using the method of planes diff --git a/doc/src/compute_meso_e_atom.rst b/doc/src/compute_sph_e_atom.rst similarity index 81% rename from doc/src/compute_meso_e_atom.rst rename to doc/src/compute_sph_e_atom.rst index ad8e46cafb..f35976ed10 100644 --- a/doc/src/compute_meso_e_atom.rst +++ b/doc/src/compute_sph_e_atom.rst @@ -1,6 +1,6 @@ -.. index:: compute meso/e/atom +.. index:: compute sph/e/atom -compute meso/e/atom command +compute sph/e/atom command =========================== Syntax @@ -8,17 +8,17 @@ Syntax .. parsed-literal:: - compute ID group-ID meso/e/atom + compute ID group-ID sph/e/atom * ID, group-ID are documented in :doc:`compute ` command -* meso/e/atom = style name of this compute command +* sph/e/atom = style name of this compute command Examples """""""" .. code-block:: LAMMPS - compute 1 all meso/e/atom + compute 1 all sph/e/atom Description """"""""""" @@ -27,8 +27,8 @@ Define a computation that calculates the per-atom internal energy for each atom in a group. The internal energy is the energy associated with the internal degrees -of freedom of a mesoscopic particles, e.g. a Smooth-Particle -Hydrodynamics particle. +of freedom of an SPH particle, i.e. a Smooth-Particle Hydrodynamics +particle. See `this PDF guide `_ to using SPH in LAMMPS. diff --git a/doc/src/compute_meso_rho_atom.rst b/doc/src/compute_sph_rho_atom.rst similarity index 64% rename from doc/src/compute_meso_rho_atom.rst rename to doc/src/compute_sph_rho_atom.rst index d4611c5cb7..4237bf0bf5 100644 --- a/doc/src/compute_meso_rho_atom.rst +++ b/doc/src/compute_sph_rho_atom.rst @@ -1,6 +1,6 @@ -.. index:: compute meso/rho/atom +.. index:: compute sph/rho/atom -compute meso/rho/atom command +compute sph/rho/atom command ============================= Syntax @@ -8,32 +8,31 @@ Syntax .. parsed-literal:: - compute ID group-ID meso/rho/atom + compute ID group-ID sph/rho/atom * ID, group-ID are documented in :doc:`compute ` command -* meso/rho/atom = style name of this compute command +* sph/rho/atom = style name of this compute command Examples """""""" .. code-block:: LAMMPS - compute 1 all meso/rho/atom + compute 1 all sph/rho/atom Description """"""""""" -Define a computation that calculates the per-atom mesoscopic density -for each atom in a group. +Define a computation that calculates the per-atom SPH density for each +atom in a group, i.e. a Smooth-Particle Hydrodynamics density. -The mesoscopic density is the mass density of a mesoscopic particle, -calculated by kernel function interpolation using "pair style -sph/rhosum". +The SPH density is the mass density of an SPH particle, calculated by +kernel function interpolation using "pair style sph/rhosum". See `this PDF guide `_ to using SPH in LAMMPS. -The value of the mesoscopic density will be 0.0 for atoms not in the +The value of the SPH density will be 0.0 for atoms not in the specified compute group. **Output info:** diff --git a/doc/src/compute_meso_t_atom.rst b/doc/src/compute_sph_t_atom.rst similarity index 79% rename from doc/src/compute_meso_t_atom.rst rename to doc/src/compute_sph_t_atom.rst index e44425a65c..1766e1d712 100644 --- a/doc/src/compute_meso_t_atom.rst +++ b/doc/src/compute_sph_t_atom.rst @@ -1,6 +1,6 @@ -.. index:: compute meso/t/atom +.. index:: compute sph/t/atom -compute meso/t/atom command +compute sph/t/atom command =========================== Syntax @@ -8,17 +8,17 @@ Syntax .. parsed-literal:: - compute ID group-ID meso/t/atom + compute ID group-ID sph/t/atom * ID, group-ID are documented in :doc:`compute ` command -* meso/t/atom = style name of this compute command +* sph/t/atom = style name of this compute command Examples """""""" .. code-block:: LAMMPS - compute 1 all meso/t/atom + compute 1 all sph/t/atom Description """"""""""" @@ -27,8 +27,8 @@ Define a computation that calculates the per-atom internal temperature for each atom in a group. The internal temperature is the ratio of internal energy over the heat -capacity associated with the internal degrees of freedom of a mesoscopic -particles, e.g. a Smooth-Particle Hydrodynamics particle. +capacity associated with the internal degrees of freedom of an SPH +particles, i.e. a Smooth-Particle Hydrodynamics particle. .. math:: diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 2b5ed48ac9..61f69ed22d 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -237,9 +237,7 @@ accelerated styles exist. * :doc:`lb/viscous ` - * :doc:`lineforce ` - constrain atoms to move in a line * :doc:`manifoldforce ` - restrain atoms to a manifold during minimization -* :doc:`meso ` - time integration for SPH/DPDE particles * :doc:`meso/move ` - move mesoscopic SPH/SDPD particles in a prescribed fashion -* :doc:`meso/stationary ` - * :doc:`momentum ` - zero the linear and/or angular momentum of a group of atoms * :doc:`move ` - move atoms in a prescribed fashion * :doc:`mscg ` - apply MSCG method for force-matching to generate coarse grain models @@ -344,6 +342,8 @@ accelerated styles exist. * :doc:`smd/move_tri_surf ` - * :doc:`smd/setvel ` - * :doc:`smd/wall_surface ` - +* :doc:`sph ` - time integration for SPH/DPDE particles +* :doc:`sph/stationary ` - * :doc:`spring ` - apply harmonic spring force to group of atoms * :doc:`spring/chunk ` - apply harmonic spring force to each chunk of atoms * :doc:`spring/rg ` - spring on radius of gyration of group of atoms diff --git a/doc/src/fix_meso.rst b/doc/src/fix_sph.rst similarity index 79% rename from doc/src/fix_meso.rst rename to doc/src/fix_sph.rst index dc9f1cb991..d514285886 100644 --- a/doc/src/fix_meso.rst +++ b/doc/src/fix_sph.rst @@ -1,6 +1,6 @@ -.. index:: fix meso +.. index:: fix sph -fix meso command +fix sph command ================ Syntax @@ -8,25 +8,25 @@ Syntax .. parsed-literal:: - fix ID group-ID meso + fix ID group-ID sph * ID, group-ID are documented in :doc:`fix ` command -* meso = style name of this fix command +* sph = style name of this fix command Examples """""""" .. code-block:: LAMMPS - fix 1 all meso + fix 1 all sph Description """"""""""" Perform time integration to update position, velocity, internal energy and local density for atoms in the group each timestep. This fix is -needed to time-integrate mesoscopic systems where particles carry -internal variables such as SPH or DPDE. +needed to time-integrate SPH systems where particles carry internal +variables such as internal energy. SPH is Smoothed Particle Dynamics. See `this PDF guide `_ to using SPH in LAMMPS. @@ -48,6 +48,6 @@ LAMMPS was built with that package. See the :doc:`Build package Related commands """""""""""""""" -"fix meso/stationary" +:doc:`fix sph/stationary ` **Default:** none diff --git a/doc/src/fix_meso_stationary.rst b/doc/src/fix_sph_stationary.rst similarity index 84% rename from doc/src/fix_meso_stationary.rst rename to doc/src/fix_sph_stationary.rst index 89c30ece14..cd0d3e4d73 100644 --- a/doc/src/fix_meso_stationary.rst +++ b/doc/src/fix_sph_stationary.rst @@ -1,6 +1,6 @@ -.. index:: fix meso/stationary +.. index:: fix sph/stationary -fix meso/stationary command +fix sph/stationary command =========================== Syntax @@ -8,17 +8,17 @@ Syntax .. parsed-literal:: - fix ID group-ID meso/stationary + fix ID group-ID sph/stationary * ID, group-ID are documented in :doc:`fix ` command -* meso = style name of this fix command +* sph = style name of this fix command Examples """""""" .. code-block:: LAMMPS - fix 1 boundary meso/stationary + fix 1 boundary sph/stationary Description """"""""""" @@ -27,7 +27,7 @@ Perform time integration to update internal energy and local density, but not position or velocity for atoms in the group each timestep. This fix is needed for SPH simulations to correctly time-integrate fixed boundary particles which constrain a fluid to a given region in -space. +space. SPH stands for Smoothed Particle Hydrodynamics. See `this PDF guide `_ to using SPH in LAMMPS. @@ -49,6 +49,6 @@ LAMMPS was built with that package. See the :doc:`Build package Related commands """""""""""""""" -"fix meso" +:doc:`fix sph ` **Default:** none diff --git a/doc/src/set.rst b/doc/src/set.rst index 84792d1a58..b986e4b26f 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -13,7 +13,7 @@ Syntax * style = *atom* or *type* or *mol* or *group* or *region* * ID = atom ID range or type range or mol ID range or group ID or region ID * one or more keyword/value pairs may be appended -* keyword = *type* or *type/fraction* or *type/ratio* or *type/subset* or *mol* or *x* or *y* or *z* or *charge* or *dipole* or *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 *volume* or *image* or *bond* or *angle* or *dihedral* or *improper* or *meso/e* or *meso/cv* or *meso/rho* or *smd/contact/radius* or *smd/mass/density* or *dpd/theta* or *edpd/temp* or *edpd/cv* or *cc* or *i_name* or *d_name* +* keyword = *type* or *type/fraction* or *type/ratio* or *type/subset* or *mol* or *x* or *y* or *z* or *charge* or *dipole* or *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 *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 *edpd/temp* or *edpd/cv* or *cc* or *i_name* or *d_name* .. parsed-literal:: @@ -94,11 +94,11 @@ Syntax *angle* value = angle type for all angles between selected atoms *dihedral* value = dihedral type for all dihedrals between selected atoms *improper* value = improper type for all impropers between selected atoms - *meso/e* value = energy of SPH particles (need units) + *sph/e* value = energy of SPH particles (need units) value can be an atom-style variable (see below) - *meso/cv* value = heat capacity of SPH particles (need units) + *sph/cv* value = heat capacity of SPH particles (need units) value can be an atom-style variable (see below) - *meso/rho* value = density of SPH particles (need units) + *sph/rho* value = density of SPH particles (need units) value can be an atom-style variable (see below) *smd/contact/radius* = radius for short range interactions, i.e. contact and friction value can be an atom-style variable (see below) @@ -299,29 +299,31 @@ for each particle set by this command. This keyword does not allow use of an atom-style variable. Keyword *diameter* sets the size of the selected atoms. The particles -must be finite-size spheres as defined by the :doc:`atom_style sphere ` command. The diameter of a particle can be -set to 0.0, which means they will be treated as point particles. Note -that this command does not adjust the particle mass, even if it was -defined with a density, e.g. via the :doc:`read_data ` -command. +must be finite-size spheres as defined by the :doc:`atom_style sphere +` command. The diameter of a particle can be set to 0.0, +which means they will be treated as point particles. Note that this +command does not adjust the particle mass, even if it was defined with +a density, e.g. via the :doc:`read_data ` command. Keyword *shape* sets the size and shape of the selected atoms. The -particles must be ellipsoids as defined by the :doc:`atom_style ellipsoid ` command. The *Sx*\ , *Sy*\ , *Sz* settings are -the 3 diameters of the ellipsoid in each direction. All 3 can be set -to the same value, which means the ellipsoid is effectively a sphere. -They can also all be set to 0.0 which means the particle will be -treated as a point particle. Note that this command does not adjust -the particle mass, even if it was defined with a density, e.g. via the -:doc:`read_data ` command. +particles must be ellipsoids as defined by the :doc:`atom_style +ellipsoid ` command. The *Sx*\ , *Sy*\ , *Sz* settings +are the 3 diameters of the ellipsoid in each direction. All 3 can be +set to the same value, which means the ellipsoid is effectively a +sphere. They can also all be set to 0.0 which means the particle will +be treated as a point particle. Note that this command does not +adjust the particle mass, even if it was defined with a density, +e.g. via the :doc:`read_data ` command. Keyword *length* sets the length of selected atoms. The particles -must be line segments as defined by the :doc:`atom_style line ` command. If the specified value is non-zero the -line segment is (re)set to a length = the specified value, centered -around the particle position, with an orientation along the x-axis. -If the specified value is 0.0, the particle will become a point -particle. Note that this command does not adjust the particle mass, -even if it was defined with a density, e.g. via the -:doc:`read_data ` command. +must be line segments as defined by the :doc:`atom_style line +` command. If the specified value is non-zero the line +segment is (re)set to a length = the specified value, centered around +the particle position, with an orientation along the x-axis. If the +specified value is 0.0, the particle will become a point particle. +Note that this command does not adjust the particle mass, even if it +was defined with a density, e.g. via the :doc:`read_data ` +command. Keyword *tri* sets the size of selected atoms. The particles must be triangles as defined by the :doc:`atom_style tri ` command. @@ -335,7 +337,8 @@ does not adjust the particle mass, even if it was defined with a density, e.g. via the :doc:`read_data ` command. Keyword *theta* sets the orientation of selected atoms. The particles -must be line segments as defined by the :doc:`atom_style line ` command. The specified value is used to set the +must be line segments as defined by the :doc:`atom_style line +` command. The specified value is used to set the orientation angle of the line segments with respect to the x axis. Keyword *theta/random* randomizes the orientation of theta for the @@ -346,44 +349,47 @@ regardless of how many processors are being used. This keyword does not allow use of an atom-style variable. Keyword *angmom* sets the angular momentum of selected atoms. The -particles must be ellipsoids as defined by the :doc:`atom_style ellipsoid ` command or triangles as defined by the -:doc:`atom_style tri ` command. The angular momentum vector -of the particles is set to the 3 specified components. +particles must be ellipsoids as defined by the :doc:`atom_style +ellipsoid ` command or triangles as defined by the +:doc:`atom_style tri ` command. The angular momentum +vector of the particles is set to the 3 specified components. Keyword *omega* sets the angular velocity of selected atoms. The -particles must be spheres as defined by the -:doc:`atom_style sphere ` command. The angular velocity -vector of the particles is set to the 3 specified components. +particles must be spheres as defined by the :doc:`atom_style sphere +` command. The angular velocity vector of the particles +is set to the 3 specified components. Keyword *mass* sets the mass of all selected particles. The particles must have a per-atom mass attribute, as defined by the -:doc:`atom_style ` command. See the "mass" command for how -to set mass values on a per-type basis. +:doc:`atom_style ` command. See the "mass" command for +how to set mass values on a per-type basis. Keyword *density* or *density/disc* also sets the mass of all selected particles, but in a different way. The particles must have a per-atom mass attribute, as defined by the :doc:`atom_style ` -command. If the atom has a radius attribute (see :doc:`atom_style sphere `) and its radius is non-zero, its mass is set -from the density and particle volume for 3d systems (the input density -is assumed to be in mass/distance\^3 units). For 2d, the default is -for LAMMPS to model particles with a radius attribute as spheres. +command. If the atom has a radius attribute (see :doc:`atom_style +sphere `) and its radius is non-zero, its mass is set from +the density and particle volume for 3d systems (the input density is +assumed to be in mass/distance\^3 units). For 2d, the default is for +LAMMPS to model particles with a radius attribute as spheres. However, if the *density/disc* keyword is used, then they can be modeled as 2d discs (circles). Their mass is set from the density and particle area (the input density is assumed to be in mass/distance\^2 units). -If the atom has a shape attribute (see :doc:`atom_style ellipsoid `) and its 3 shape parameters are non-zero, -then its mass is set from the density and particle volume (the input -density is assumed to be in mass/distance\^3 units). The -*density/disc* keyword has no effect; it does not (yet) treat 3d -ellipsoids as 2d ellipses. +If the atom has a shape attribute (see :doc:`atom_style ellipsoid +`) and its 3 shape parameters are non-zero, then its mass +is set from the density and particle volume (the input density is +assumed to be in mass/distance\^3 units). The *density/disc* keyword +has no effect; it does not (yet) treat 3d ellipsoids as 2d ellipses. -If the atom has a length attribute (see :doc:`atom_style line `) and its length is non-zero, then its mass is -set from the density and line segment length (the input density is -assumed to be in mass/distance units). If the atom has an area -attribute (see :doc:`atom_style tri `) and its area is -non-zero, then its mass is set from the density and triangle area (the -input density is assumed to be in mass/distance\^2 units). +If the atom has a length attribute (see :doc:`atom_style line +`) and its length is non-zero, then its mass is set from +the density and line segment length (the input density is assumed to +be in mass/distance units). If the atom has an area attribute (see +:doc:`atom_style tri `) and its area is non-zero, then its +mass is set from the density and triangle area (the input density is +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). @@ -399,14 +405,15 @@ defined. A value of 2 means add 2 box lengths to get the true value. A value of -1 means subtract 1 box length to get the true value. LAMMPS updates these flags as atoms cross periodic boundaries during the simulation. The flags can be output with atom snapshots via the -:doc:`dump ` command. If a value of NULL is specified for any of -nx,ny,nz, then the current image value for that dimension is unchanged. -For non-periodic dimensions only a value of 0 can be specified. -This command can be useful after a system has been equilibrated and -atoms have diffused one or more box lengths in various directions. -This command can then reset the image values for atoms so that they -are effectively inside the simulation box, e.g if a diffusion -coefficient is about to be measured via the :doc:`compute msd ` command. Care should be taken not to reset the +:doc:`dump ` command. If a value of NULL is specified for any +of nx,ny,nz, then the current image value for that dimension is +unchanged. For non-periodic dimensions only a value of 0 can be +specified. This command can be useful after a system has been +equilibrated and atoms have diffused one or more box lengths in +various directions. This command can then reset the image values for +atoms so that they are effectively inside the simulation box, e.g if a +diffusion coefficient is about to be measured via the :doc:`compute +msd ` command. Care should be taken not to reset the image flags of two atoms in a bond to the same value if the bond straddles a periodic boundary (rather they should be different by +/- 1). This will not affect the dynamics of a simulation, but may mess @@ -423,10 +430,10 @@ etc) was set by the *bond types* (\ *angle types*\ , etc) field in the header of the data file read by the :doc:`read_data ` command. These keywords do not allow use of an atom-style variable. -Keywords *meso/e*\ , *meso/cv*\ , and *meso/rho* set the energy, heat +Keywords *sph/e*\ , *sph/cv*\ , and *sph/rho* set the energy, heat capacity, and density of smoothed particle hydrodynamics (SPH) -particles. See `this PDF guide `_ to -using SPH in LAMMPS. +particles. See `this PDF guide `_ +to using SPH in LAMMPS. Keyword *smd/mass/density* sets the mass of all selected particles, but it is only applicable to the Smooth Mach Dynamics package diff --git a/src/USER-SPH/atom_vec_meso.cpp b/src/USER-SPH/atom_vec_sph.cpp similarity index 76% rename from src/USER-SPH/atom_vec_meso.cpp rename to src/USER-SPH/atom_vec_sph.cpp index fdddd15f27..84a60e44f7 100644 --- a/src/USER-SPH/atom_vec_meso.cpp +++ b/src/USER-SPH/atom_vec_sph.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "atom_vec_meso.h" +#include "atom_vec_sph.h" #include #include "atom.h" #include "error.h" @@ -20,13 +20,13 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -AtomVecMeso::AtomVecMeso(LAMMPS *lmp) : AtomVec(lmp) +AtomVecSPH::AtomVecSPH(LAMMPS *lmp) : AtomVec(lmp) { molecular = 0; mass_type = 1; forceclearflag = 1; - atom->e_flag = 1; + atom->esph_flag = 1; atom->rho_flag = 1; atom->cv_flag = 1; atom->vest_flag = 1; @@ -36,17 +36,17 @@ AtomVecMeso::AtomVecMeso(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = (char *) "rho drho e de cv vest"; - fields_copy = (char *) "rho drho e de cv vest"; - fields_comm = (char *) "rho e vest"; - fields_comm_vel = (char *) "rho e vest"; - fields_reverse = (char *) "drho de"; - fields_border = (char *) "rho e cv vest"; - fields_border_vel = (char *) "rho e cv vest"; - fields_exchange = (char *) "rho e cv vest"; - fields_restart = (char * ) "rho e cv vest"; - fields_create = (char *) "rho e cv vest de drho"; - fields_data_atom = (char *) "id type rho e cv x"; + fields_grow = (char *) "rho drho esph desph cv vest"; + fields_copy = (char *) "rho drho esph desph cv vest"; + fields_comm = (char *) "rho esph vest"; + fields_comm_vel = (char *) "rho esph vest"; + fields_reverse = (char *) "drho desph"; + fields_border = (char *) "rho esph cv vest"; + fields_border_vel = (char *) "rho esph cv vest"; + fields_exchange = (char *) "rho esph cv vest"; + fields_restart = (char * ) "rho esph cv vest"; + fields_create = (char *) "rho esph cv vest de drho"; + fields_data_atom = (char *) "id type rho esph cv x"; fields_data_vel = (char *) "id v"; setup_fields(); @@ -57,12 +57,12 @@ AtomVecMeso::AtomVecMeso(LAMMPS *lmp) : AtomVec(lmp) needed in replicate when 2 atom classes exist and it calls pack_restart() ------------------------------------------------------------------------- */ -void AtomVecMeso::grow_pointers() +void AtomVecSPH::grow_pointers() { rho = atom->rho; drho = atom->drho; - e = atom->e; - de = atom->de; + esph = atom->esph; + desph = atom->desph; cv = atom->cv; vest = atom->vest; } @@ -72,9 +72,9 @@ void AtomVecMeso::grow_pointers() nbytes = # of bytes to clear for a per-atom vector ------------------------------------------------------------------------- */ -void AtomVecMeso::force_clear(int n, size_t nbytes) +void AtomVecSPH::force_clear(int n, size_t nbytes) { - memset(&de[n],0,nbytes); + memset(&desph[n],0,nbytes); memset(&drho[n],0,nbytes); } @@ -82,7 +82,7 @@ void AtomVecMeso::force_clear(int n, size_t nbytes) initialize non-zero atom quantities ------------------------------------------------------------------------- */ -void AtomVecMeso::create_atom_post(int ilocal) +void AtomVecSPH::create_atom_post(int ilocal) { cv[ilocal] = 1.0; } @@ -92,12 +92,12 @@ void AtomVecMeso::create_atom_post(int ilocal) or initialize other atom quantities ------------------------------------------------------------------------- */ -void AtomVecMeso::data_atom_post(int ilocal) +void AtomVecSPH::data_atom_post(int ilocal) { vest[ilocal][0] = 0.0; vest[ilocal][1] = 0.0; vest[ilocal][2] = 0.0; - de[ilocal] = 0.0; + desph[ilocal] = 0.0; drho[ilocal] = 0.0; } @@ -106,12 +106,12 @@ void AtomVecMeso::data_atom_post(int ilocal) return -1 if name is unknown to this atom style ------------------------------------------------------------------------- */ -int AtomVecMeso::property_atom(char *name) +int AtomVecSPH::property_atom(char *name) { if (strcmp(name,"rho") == 0) return 0; if (strcmp(name,"drho") == 0) return 1; - if (strcmp(name,"e") == 0) return 2; - if (strcmp(name,"de") == 0) return 3; + if (strcmp(name,"esph") == 0) return 2; + if (strcmp(name,"desph") == 0) return 3; if (strcmp(name,"cv") == 0) return 4; return -1; } @@ -121,7 +121,7 @@ int AtomVecMeso::property_atom(char *name) index maps to data specific to this atom style ------------------------------------------------------------------------- */ -void AtomVecMeso::pack_property_atom(int index, double *buf, +void AtomVecSPH::pack_property_atom(int index, double *buf, int nvalues, int groupbit) { int *mask = atom->mask; @@ -142,13 +142,13 @@ void AtomVecMeso::pack_property_atom(int index, double *buf, } } else if (index == 2) { for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = e[i]; + if (mask[i] & groupbit) buf[n] = esph[i]; else buf[n] = 0.0; n += nvalues; } } else if (index == 3) { for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = de[i]; + if (mask[i] & groupbit) buf[n] = desph[i]; else buf[n] = 0.0; n += nvalues; } diff --git a/src/USER-SPH/atom_vec_meso.h b/src/USER-SPH/atom_vec_sph.h similarity index 83% rename from src/USER-SPH/atom_vec_meso.h rename to src/USER-SPH/atom_vec_sph.h index bd84c34fbc..634c3c72f5 100644 --- a/src/USER-SPH/atom_vec_meso.h +++ b/src/USER-SPH/atom_vec_sph.h @@ -13,20 +13,20 @@ #ifdef ATOM_CLASS -AtomStyle(meso,AtomVecMeso) +AtomStyle(sph,AtomVecSPH) #else -#ifndef LMP_ATOM_VEC_MESO_H -#define LMP_ATOM_VEC_MESO_H +#ifndef LMP_ATOM_VEC_SPH_H +#define LMP_ATOM_VEC_SPH_H #include "atom_vec.h" namespace LAMMPS_NS { -class AtomVecMeso : public AtomVec { +class AtomVecSPH : public AtomVec { public: - AtomVecMeso(class LAMMPS *); + AtomVecSPH(class LAMMPS *); void grow_pointers(); void force_clear(int, size_t); @@ -36,7 +36,7 @@ class AtomVecMeso : public AtomVec { void pack_property_atom(int, double *, int, int); private: - double *rho,*drho,*e,*de,*cv; + double *rho,*drho,*esph,*desph,*cv; double **vest; }; diff --git a/src/USER-SPH/compute_meso_e_atom.cpp b/src/USER-SPH/compute_sph_e_atom.cpp similarity index 80% rename from src/USER-SPH/compute_meso_e_atom.cpp rename to src/USER-SPH/compute_sph_e_atom.cpp index c56243e5ed..8869dae5f7 100644 --- a/src/USER-SPH/compute_meso_e_atom.cpp +++ b/src/USER-SPH/compute_sph_e_atom.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "compute_meso_e_atom.h" +#include "compute_sph_e_atom.h" #include #include "atom.h" #include "update.h" @@ -24,11 +24,13 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ComputeMesoEAtom::ComputeMesoEAtom(LAMMPS *lmp, int narg, char **arg) : +ComputeSPHEAtom::ComputeSPHEAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg != 3) error->all(FLERR,"Number of arguments for compute meso/e/atom command != 3"); - if (atom->e_flag != 1) error->all(FLERR,"compute meso/e/atom command requires atom_style with energy (e.g. meso)"); + if (narg != 3) + error->all(FLERR,"Number of arguments for compute sph/e/atom command != 3"); + if (atom->esph_flag != 1) + error->all(FLERR,"Compute sph/e/atom command requires atom_style sph)"); peratom_flag = 1; size_peratom_cols = 0; @@ -39,14 +41,14 @@ ComputeMesoEAtom::ComputeMesoEAtom(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -ComputeMesoEAtom::~ComputeMesoEAtom() +ComputeSPHEAtom::~ComputeSPHEAtom() { memory->sfree(evector); } /* ---------------------------------------------------------------------- */ -void ComputeMesoEAtom::init() +void ComputeSPHEAtom::init() { int count = 0; @@ -58,7 +60,7 @@ void ComputeMesoEAtom::init() /* ---------------------------------------------------------------------- */ -void ComputeMesoEAtom::compute_peratom() +void ComputeSPHEAtom::compute_peratom() { invoked_peratom = update->ntimestep; @@ -71,13 +73,13 @@ void ComputeMesoEAtom::compute_peratom() vector_atom = evector; } - double *e = atom->e; + double *esph = atom->esph; int *mask = atom->mask; int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - evector[i] = e[i]; + evector[i] = esph[i]; } else { evector[i] = 0.0; @@ -89,7 +91,7 @@ void ComputeMesoEAtom::compute_peratom() memory usage of local atom-based array ------------------------------------------------------------------------- */ -double ComputeMesoEAtom::memory_usage() +double ComputeSPHEAtom::memory_usage() { double bytes = nmax * sizeof(double); return bytes; diff --git a/src/USER-SPH/compute_meso_e_atom.h b/src/USER-SPH/compute_sph_e_atom.h similarity index 78% rename from src/USER-SPH/compute_meso_e_atom.h rename to src/USER-SPH/compute_sph_e_atom.h index 3cdbfa7aa8..370fab148b 100644 --- a/src/USER-SPH/compute_meso_e_atom.h +++ b/src/USER-SPH/compute_sph_e_atom.h @@ -13,21 +13,21 @@ #ifdef COMPUTE_CLASS -ComputeStyle(meso/e/atom,ComputeMesoEAtom) +ComputeStyle(sph/e/atom,ComputeSPHEAtom) #else -#ifndef LMP_COMPUTE_MESO_E_ATOM_H -#define LMP_COMPUTE_MESO_E_ATOM_H +#ifndef LMP_COMPUTE_SPH_E_ATOM_H +#define LMP_COMPUTE_SPH_E_ATOM_H #include "compute.h" namespace LAMMPS_NS { -class ComputeMesoEAtom : public Compute { +class ComputeSPHEAtom : public Compute { public: - ComputeMesoEAtom(class LAMMPS *, int, char **); - ~ComputeMesoEAtom(); + ComputeSPHEAtom(class LAMMPS *, int, char **); + ~ComputeSPHEAtom(); void init(); void compute_peratom(); double memory_usage(); diff --git a/src/USER-SPH/compute_meso_rho_atom.cpp b/src/USER-SPH/compute_sph_rho_atom.cpp similarity index 83% rename from src/USER-SPH/compute_meso_rho_atom.cpp rename to src/USER-SPH/compute_sph_rho_atom.cpp index b2fbd2d70a..1d6d03811c 100644 --- a/src/USER-SPH/compute_meso_rho_atom.cpp +++ b/src/USER-SPH/compute_sph_rho_atom.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "compute_meso_rho_atom.h" +#include "compute_sph_rho_atom.h" #include #include "atom.h" #include "update.h" @@ -24,11 +24,12 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ComputeMesoRhoAtom::ComputeMesoRhoAtom(LAMMPS *lmp, int narg, char **arg) : +ComputeSPHRhoAtom::ComputeSPHRhoAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg != 3) error->all(FLERR,"Illegal compute meso/rho/atom command"); - if (atom->rho_flag != 1) error->all(FLERR,"compute meso/rho/atom command requires atom_style with density (e.g. meso)"); + if (narg != 3) error->all(FLERR,"Illegal compute sph/rho/atom command"); + if (atom->rho_flag != 1) + error->all(FLERR,"Compute sph/rho/atom command requires atom_style sph"); peratom_flag = 1; size_peratom_cols = 0; @@ -39,14 +40,14 @@ ComputeMesoRhoAtom::ComputeMesoRhoAtom(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -ComputeMesoRhoAtom::~ComputeMesoRhoAtom() +ComputeSPHRhoAtom::~ComputeSPHRhoAtom() { memory->sfree(rhoVector); } /* ---------------------------------------------------------------------- */ -void ComputeMesoRhoAtom::init() +void ComputeSPHRhoAtom::init() { int count = 0; @@ -58,7 +59,7 @@ void ComputeMesoRhoAtom::init() /* ---------------------------------------------------------------------- */ -void ComputeMesoRhoAtom::compute_peratom() +void ComputeSPHRhoAtom::compute_peratom() { invoked_peratom = update->ntimestep; @@ -91,7 +92,7 @@ void ComputeMesoRhoAtom::compute_peratom() memory usage of local atom-based array ------------------------------------------------------------------------- */ -double ComputeMesoRhoAtom::memory_usage() +double ComputeSPHRhoAtom::memory_usage() { double bytes = nmax * sizeof(double); return bytes; diff --git a/src/USER-SPH/compute_meso_rho_atom.h b/src/USER-SPH/compute_sph_rho_atom.h similarity index 77% rename from src/USER-SPH/compute_meso_rho_atom.h rename to src/USER-SPH/compute_sph_rho_atom.h index ec4942ef92..bd38f41199 100644 --- a/src/USER-SPH/compute_meso_rho_atom.h +++ b/src/USER-SPH/compute_sph_rho_atom.h @@ -13,21 +13,21 @@ #ifdef COMPUTE_CLASS -ComputeStyle(meso/rho/atom,ComputeMesoRhoAtom) +ComputeStyle(sph/rho/atom,ComputeSPHRhoAtom) #else -#ifndef LMP_COMPUTE_MESO_RHO_ATOM_H -#define LMP_COMPUTE_MESO_RHO_ATOM_H +#ifndef LMP_COMPUTE_MESO_SPH_ATOM_H +#define LMP_COMPUTE_MESO_SPH_ATOM_H #include "compute.h" namespace LAMMPS_NS { -class ComputeMesoRhoAtom : public Compute { +class ComputeSPHRhoAtom : public Compute { public: - ComputeMesoRhoAtom(class LAMMPS *, int, char **); - ~ComputeMesoRhoAtom(); + ComputeSPHRhoAtom(class LAMMPS *, int, char **); + ~ComputeSPHRhoAtom(); void init(); void compute_peratom(); double memory_usage(); diff --git a/src/USER-SPH/compute_meso_t_atom.cpp b/src/USER-SPH/compute_sph_t_atom.cpp similarity index 79% rename from src/USER-SPH/compute_meso_t_atom.cpp rename to src/USER-SPH/compute_sph_t_atom.cpp index bab96468dd..063af70026 100644 --- a/src/USER-SPH/compute_meso_t_atom.cpp +++ b/src/USER-SPH/compute_sph_t_atom.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "compute_meso_t_atom.h" +#include "compute_sph_t_atom.h" #include #include "atom.h" #include "update.h" @@ -24,12 +24,13 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ComputeMesoTAtom::ComputeMesoTAtom(LAMMPS *lmp, int narg, char **arg) : +ComputeSPHTAtom::ComputeSPHTAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg != 3) error->all(FLERR,"Number of arguments for compute meso/t/atom command != 3"); - if ((atom->e_flag != 1) || (atom->cv_flag != 1)) - error->all(FLERR,"Compute meso/t/atom command requires atom_style with both energy and heat capacity (e.g. meso)"); + if (narg != 3) + error->all(FLERR,"Number of arguments for compute sph/t/atom command != 3"); + if ((atom->esph_flag != 1) || (atom->cv_flag != 1)) + error->all(FLERR,"Compute sph/t/atom command requires atom_style sph"); peratom_flag = 1; size_peratom_cols = 0; @@ -40,14 +41,14 @@ ComputeMesoTAtom::ComputeMesoTAtom(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -ComputeMesoTAtom::~ComputeMesoTAtom() +ComputeSPHTAtom::~ComputeSPHTAtom() { memory->sfree(tvector); } /* ---------------------------------------------------------------------- */ -void ComputeMesoTAtom::init() +void ComputeSPHTAtom::init() { int count = 0; @@ -59,7 +60,7 @@ void ComputeMesoTAtom::init() /* ---------------------------------------------------------------------- */ -void ComputeMesoTAtom::compute_peratom() +void ComputeSPHTAtom::compute_peratom() { invoked_peratom = update->ntimestep; @@ -72,7 +73,7 @@ void ComputeMesoTAtom::compute_peratom() vector_atom = tvector; } - double *e = atom->e; + double *esph = atom->esph; double *cv = atom->cv; int *mask = atom->mask; int nlocal = atom->nlocal; @@ -80,7 +81,7 @@ void ComputeMesoTAtom::compute_peratom() for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (cv[i] > 0.0) { - tvector[i] = e[i] / cv[i]; + tvector[i] = esph[i] / cv[i]; } } else { @@ -93,7 +94,7 @@ void ComputeMesoTAtom::compute_peratom() memory usage of local atom-based array ------------------------------------------------------------------------- */ -double ComputeMesoTAtom::memory_usage() +double ComputeSPHTAtom::memory_usage() { double bytes = nmax * sizeof(double); return bytes; diff --git a/src/USER-SPH/compute_meso_t_atom.h b/src/USER-SPH/compute_sph_t_atom.h similarity index 78% rename from src/USER-SPH/compute_meso_t_atom.h rename to src/USER-SPH/compute_sph_t_atom.h index 9e4b253712..b3bf93a0eb 100644 --- a/src/USER-SPH/compute_meso_t_atom.h +++ b/src/USER-SPH/compute_sph_t_atom.h @@ -13,21 +13,21 @@ #ifdef COMPUTE_CLASS -ComputeStyle(meso/t/atom,ComputeMesoTAtom) +ComputeStyle(sph/t/atom,ComputeSPHTAtom) #else -#ifndef LMP_COMPUTE_MESO_T_ATOM_H -#define LMP_COMPUTE_MESO_T_ATOM_H +#ifndef LMP_COMPUTE_SPH_T_ATOM_H +#define LMP_COMPUTE_SPH_T_ATOM_H #include "compute.h" namespace LAMMPS_NS { -class ComputeMesoTAtom : public Compute { +class ComputeSPHTAtom : public Compute { public: - ComputeMesoTAtom(class LAMMPS *, int, char **); - ~ComputeMesoTAtom(); + ComputeSPHTAtom(class LAMMPS *, int, char **); + ~ComputeSPHTAtom(); void init(); void compute_peratom(); double memory_usage(); diff --git a/src/USER-SPH/fix_meso.cpp b/src/USER-SPH/fix_sph.cpp similarity index 84% rename from src/USER-SPH/fix_meso.cpp rename to src/USER-SPH/fix_sph.cpp index 4f4e532291..843edc8e92 100644 --- a/src/USER-SPH/fix_meso.cpp +++ b/src/USER-SPH/fix_sph.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "fix_meso.h" +#include "fix_sph.h" #include "atom.h" #include "force.h" #include "update.h" @@ -22,22 +22,22 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMeso::FixMeso(LAMMPS *lmp, int narg, char **arg) : +FixSPH::FixSPH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if ((atom->e_flag != 1) || (atom->rho_flag != 1)) + if ((atom->esph_flag != 1) || (atom->rho_flag != 1)) error->all(FLERR, - "fix meso command requires atom_style with both energy and density"); + "Fix sph command requires atom_style with both energy and density"); if (narg != 3) - error->all(FLERR,"Illegal number of arguments for fix meso command"); + error->all(FLERR,"Illegal number of arguments for fix sph command"); time_integrate = 1; } /* ---------------------------------------------------------------------- */ -int FixMeso::setmask() { +int FixSPH::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; @@ -47,12 +47,12 @@ int FixMeso::setmask() { /* ---------------------------------------------------------------------- */ -void FixMeso::init() { +void FixSPH::init() { dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; } -void FixMeso::setup_pre_force(int /*vflag*/) +void FixSPH::setup_pre_force(int /*vflag*/) { // set vest equal to v double **v = atom->v; @@ -75,7 +75,7 @@ void FixMeso::setup_pre_force(int /*vflag*/) allow for both per-type and per-atom mass ------------------------------------------------------------------------- */ -void FixMeso::initial_integrate(int /*vflag*/) { +void FixSPH::initial_integrate(int /*vflag*/) { // update v and x and rho and e of atoms in group double **x = atom->x; @@ -84,8 +84,8 @@ void FixMeso::initial_integrate(int /*vflag*/) { double **vest = atom->vest; double *rho = atom->rho; double *drho = atom->drho; - double *e = atom->e; - double *de = atom->de; + double *esph = atom->esph; + double *desph = atom->desph; double *mass = atom->mass; double *rmass = atom->rmass; int rmass_flag = atom->rmass_flag; @@ -107,7 +107,7 @@ void FixMeso::initial_integrate(int /*vflag*/) { dtfm = dtf / mass[type[i]]; } - e[i] += dtf * de[i]; // half-step update of particle internal energy + esph[i] += dtf * desph[i]; // half-step update of particle internal energy rho[i] += dtf * drho[i]; // ... and density // extrapolate velocity for use with velocity-dependent potentials, e.g. SPH @@ -128,14 +128,14 @@ void FixMeso::initial_integrate(int /*vflag*/) { /* ---------------------------------------------------------------------- */ -void FixMeso::final_integrate() { +void FixSPH::final_integrate() { // update v, rho, and e of atoms in group double **v = atom->v; double **f = atom->f; - double *e = atom->e; - double *de = atom->de; + double *esph = atom->esph; + double *desph = atom->desph; double *rho = atom->rho; double *drho = atom->drho; int *type = atom->type; @@ -160,7 +160,7 @@ void FixMeso::final_integrate() { v[i][1] += dtfm * f[i][1]; v[i][2] += dtfm * f[i][2]; - e[i] += dtf * de[i]; + esph[i] += dtf * desph[i]; rho[i] += dtf * drho[i]; } } @@ -168,7 +168,7 @@ void FixMeso::final_integrate() { /* ---------------------------------------------------------------------- */ -void FixMeso::reset_dt() { +void FixSPH::reset_dt() { dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; } diff --git a/src/USER-SPH/fix_meso.h b/src/USER-SPH/fix_sph.h similarity index 88% rename from src/USER-SPH/fix_meso.h rename to src/USER-SPH/fix_sph.h index 3eebb0f774..0a43997508 100644 --- a/src/USER-SPH/fix_meso.h +++ b/src/USER-SPH/fix_sph.h @@ -13,20 +13,20 @@ #ifdef FIX_CLASS -FixStyle(meso,FixMeso) +FixStyle(sph,FixSPH) #else -#ifndef LMP_FIX_MESO_H -#define LMP_FIX_MESO_H +#ifndef LMP_FIX_SPH_H +#define LMP_FIX_SPH_H #include "fix.h" namespace LAMMPS_NS { -class FixMeso : public Fix { +class FixSPH : public Fix { public: - FixMeso(class LAMMPS *, int, char **); + FixSPH(class LAMMPS *, int, char **); int setmask(); virtual void init(); virtual void setup_pre_force(int); diff --git a/src/USER-SPH/fix_meso_stationary.cpp b/src/USER-SPH/fix_sph_stationary.cpp similarity index 74% rename from src/USER-SPH/fix_meso_stationary.cpp rename to src/USER-SPH/fix_sph_stationary.cpp index b7f0675ef8..56ac71f2c5 100644 --- a/src/USER-SPH/fix_meso_stationary.cpp +++ b/src/USER-SPH/fix_sph_stationary.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "fix_meso_stationary.h" +#include "fix_sph_stationary.h" #include "atom.h" #include "force.h" #include "update.h" @@ -22,22 +22,22 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMesoStationary::FixMesoStationary(LAMMPS *lmp, int narg, char **arg) : +FixSPHStationary::FixSPHStationary(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if ((atom->e_flag != 1) || (atom->rho_flag != 1)) + if ((atom->esph_flag != 1) || (atom->rho_flag != 1)) error->all(FLERR, - "fix meso/stationary command requires atom_style with both energy and density, e.g. meso"); + "Fix sph/stationary command requires atom_style with both energy and density, e.g. meso"); if (narg != 3) - error->all(FLERR,"Illegal number of arguments for fix meso/stationary command"); + error->all(FLERR,"Illegal number of arguments for fix sph/stationary command"); time_integrate = 0; } /* ---------------------------------------------------------------------- */ -int FixMesoStationary::setmask() { +int FixSPHStationary::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; @@ -46,7 +46,7 @@ int FixMesoStationary::setmask() { /* ---------------------------------------------------------------------- */ -void FixMesoStationary::init() { +void FixSPHStationary::init() { dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; } @@ -55,12 +55,12 @@ void FixMesoStationary::init() { allow for both per-type and per-atom mass ------------------------------------------------------------------------- */ -void FixMesoStationary::initial_integrate(int /*vflag*/) { +void FixSPHStationary::initial_integrate(int /*vflag*/) { double *rho = atom->rho; double *drho = atom->drho; - double *e = atom->e; - double *de = atom->de; + double *esph = atom->esph; + double *desph = atom->desph; int *mask = atom->mask; int nlocal = atom->nlocal; @@ -71,7 +71,7 @@ void FixMesoStationary::initial_integrate(int /*vflag*/) { for (i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - e[i] += dtf * de[i]; // half-step update of particle internal energy + esph[i] += dtf * desph[i]; // half-step update of particle internal energy rho[i] += dtf * drho[i]; // ... and density } } @@ -79,10 +79,10 @@ void FixMesoStationary::initial_integrate(int /*vflag*/) { /* ---------------------------------------------------------------------- */ -void FixMesoStationary::final_integrate() { +void FixSPHStationary::final_integrate() { - double *e = atom->e; - double *de = atom->de; + double *esph = atom->esph; + double *desph = atom->desph; double *rho = atom->rho; double *drho = atom->drho; int *mask = atom->mask; @@ -92,7 +92,7 @@ void FixMesoStationary::final_integrate() { for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - e[i] += dtf * de[i]; + esph[i] += dtf * desph[i]; rho[i] += dtf * drho[i]; } } @@ -100,7 +100,7 @@ void FixMesoStationary::final_integrate() { /* ---------------------------------------------------------------------- */ -void FixMesoStationary::reset_dt() { +void FixSPHStationary::reset_dt() { dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; } diff --git a/src/USER-SPH/fix_meso_stationary.h b/src/USER-SPH/fix_sph_stationary.h similarity index 83% rename from src/USER-SPH/fix_meso_stationary.h rename to src/USER-SPH/fix_sph_stationary.h index 326c13dcd3..f2bb6c39f2 100644 --- a/src/USER-SPH/fix_meso_stationary.h +++ b/src/USER-SPH/fix_sph_stationary.h @@ -13,20 +13,20 @@ #ifdef FIX_CLASS -FixStyle(meso/stationary,FixMesoStationary) +FixStyle(sph/stationary,FixSPHStationary) #else -#ifndef LMP_FIX_MESO_STATIONARY_H -#define LMP_FIX_MESO_STATIONARY_H +#ifndef LMP_FIX_SPH_STATIONARY_H +#define LMP_FIX_SPH_STATIONARY_H #include "fix.h" namespace LAMMPS_NS { -class FixMesoStationary : public Fix { +class FixSPHStationary : public Fix { public: - FixMesoStationary(class LAMMPS *, int, char **); + FixSPHStationary(class LAMMPS *, int, char **); int setmask(); virtual void init(); virtual void initial_integrate(int); diff --git a/src/USER-SPH/pair_sph_heatconduction.cpp b/src/USER-SPH/pair_sph_heatconduction.cpp index cff9009015..ebd2cef684 100644 --- a/src/USER-SPH/pair_sph_heatconduction.cpp +++ b/src/USER-SPH/pair_sph_heatconduction.cpp @@ -53,8 +53,8 @@ void PairSPHHeatConduction::compute(int eflag, int vflag) { ev_init(eflag, vflag); double **x = atom->x; - double *e = atom->e; - double *de = atom->de; + double *esph = atom->esph; + double *desph = atom->desph; double *mass = atom->mass; double *rho = atom->rho; int *type = atom->type; @@ -116,11 +116,11 @@ void PairSPHHeatConduction::compute(int eflag, int vflag) { deltaE = 2.0 * imass * jmass / (imass+jmass); deltaE *= (rho[i] + rho[j]) / (rho[i] * rho[j]); - deltaE *= D * (e[i] - e[j]) * wfd; + deltaE *= D * (esph[i] - esph[j]) * wfd; - de[i] += deltaE; + desph[i] += deltaE; if (newton_pair || j < nlocal) { - de[j] -= deltaE; + desph[j] -= deltaE; } } diff --git a/src/USER-SPH/pair_sph_idealgas.cpp b/src/USER-SPH/pair_sph_idealgas.cpp index f206bf68f5..1f6b63e199 100644 --- a/src/USER-SPH/pair_sph_idealgas.cpp +++ b/src/USER-SPH/pair_sph_idealgas.cpp @@ -58,8 +58,8 @@ void PairSPHIdealGas::compute(int eflag, int vflag) { double **f = atom->f; double *rho = atom->rho; double *mass = atom->mass; - double *de = atom->de; - double *e = atom->e; + double *desph = atom->desph; + double *esph = atom->esph; double *drho = atom->drho; int *type = atom->type; int nlocal = atom->nlocal; @@ -86,8 +86,8 @@ void PairSPHIdealGas::compute(int eflag, int vflag) { imass = mass[itype]; - fi = 0.4 * e[i] / imass / rho[i]; // ideal gas EOS; this expression is fi = pressure / rho^2 - ci = sqrt(0.4*e[i]/imass); // speed of sound with heat capacity ratio gamma=1.4 + fi = 0.4 * esph[i] / imass / rho[i]; // ideal gas EOS; this expression is fi = pressure / rho^2 + ci = sqrt(0.4*esph[i]/imass); // speed of sound with heat capacity ratio gamma=1.4 for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; @@ -119,7 +119,7 @@ void PairSPHIdealGas::compute(int eflag, int vflag) { wfd = -19.098593171027440292e0 * wfd * wfd * ihsq * ihsq * ihsq; } - fj = 0.4 * e[j] / jmass / rho[j]; + fj = 0.4 * esph[j] / jmass / rho[j]; // dot product of velocity delta and distance vector delVdotDelR = delx * (vxtmp - v[j][0]) + dely * (vytmp - v[j][1]) @@ -127,7 +127,7 @@ void PairSPHIdealGas::compute(int eflag, int vflag) { // artificial viscosity (Monaghan 1992) if (delVdotDelR < 0.) { - cj = sqrt(0.4*e[j]/jmass); + cj = sqrt(0.4*esph[j]/jmass); mu = h * delVdotDelR / (rsq + 0.01 * h * h); fvisc = -viscosity[itype][jtype] * (ci + cj) * mu / (rho[i] + rho[j]); } else { @@ -146,13 +146,13 @@ void PairSPHIdealGas::compute(int eflag, int vflag) { drho[i] += jmass * delVdotDelR * wfd; // change in thermal energy - de[i] += deltaE; + desph[i] += deltaE; if (newton_pair || j < nlocal) { f[j][0] -= delx * fpair; f[j][1] -= dely * fpair; f[j][2] -= delz * fpair; - de[j] += deltaE; + desph[j] += deltaE; drho[j] += imass * delVdotDelR * wfd; } diff --git a/src/USER-SPH/pair_sph_lj.cpp b/src/USER-SPH/pair_sph_lj.cpp index 3173e2a47d..ae42c413e7 100644 --- a/src/USER-SPH/pair_sph_lj.cpp +++ b/src/USER-SPH/pair_sph_lj.cpp @@ -58,8 +58,8 @@ void PairSPHLJ::compute(int eflag, int vflag) { double **f = atom->f; double *rho = atom->rho; double *mass = atom->mass; - double *de = atom->de; - double *e = atom->e; + double *desph = atom->desph; + double *esph = atom->esph; double *cv = atom->cv; double *drho = atom->drho; int *type = atom->type; @@ -88,7 +88,7 @@ void PairSPHLJ::compute(int eflag, int vflag) { imass = mass[itype]; // compute pressure of particle i with LJ EOS - LJEOS2(rho[i], e[i], cv[i], &fi, &ci); + LJEOS2(rho[i], esph[i], cv[i], &fi, &ci); fi /= (rho[i] * rho[i]); //printf("fi = %f\n", fi); @@ -124,7 +124,7 @@ void PairSPHLJ::compute(int eflag, int vflag) { } // function call to LJ EOS - LJEOS2(rho[j], e[j], cv[j], &fj, &cj); + LJEOS2(rho[j], esph[j], cv[j], &fj, &cj); fj /= (rho[j] * rho[j]); // apply long-range correction to model a LJ fluid with cutoff @@ -157,13 +157,13 @@ void PairSPHLJ::compute(int eflag, int vflag) { drho[i] += jmass * delVdotDelR * wfd; // change in thermal energy - de[i] += deltaE; + desph[i] += deltaE; if (newton_pair || j < nlocal) { f[j][0] -= delx * fpair; f[j][1] -= dely * fpair; f[j][2] -= delz * fpair; - de[j] += deltaE; + desph[j] += deltaE; drho[j] += imass * delVdotDelR * wfd; } diff --git a/src/USER-SPH/pair_sph_taitwater.cpp b/src/USER-SPH/pair_sph_taitwater.cpp index f2a34d4edd..79d9ac7742 100644 --- a/src/USER-SPH/pair_sph_taitwater.cpp +++ b/src/USER-SPH/pair_sph_taitwater.cpp @@ -64,7 +64,7 @@ void PairSPHTaitwater::compute(int eflag, int vflag) { double **f = atom->f; double *rho = atom->rho; double *mass = atom->mass; - double *de = atom->de; + double *desph = atom->desph; double *drho = atom->drho; int *type = atom->type; int nlocal = atom->nlocal; @@ -176,13 +176,13 @@ void PairSPHTaitwater::compute(int eflag, int vflag) { drho[i] += jmass * delVdotDelR * wfd; // change in thermal energy - de[i] += deltaE; + desph[i] += deltaE; if (newton_pair || j < nlocal) { f[j][0] -= delx * fpair; f[j][1] -= dely * fpair; f[j][2] -= delz * fpair; - de[j] += deltaE; + desph[j] += deltaE; drho[j] += imass * delVdotDelR * wfd; } diff --git a/src/USER-SPH/pair_sph_taitwater_morris.cpp b/src/USER-SPH/pair_sph_taitwater_morris.cpp index 9ca03e3476..862d2a8053 100644 --- a/src/USER-SPH/pair_sph_taitwater_morris.cpp +++ b/src/USER-SPH/pair_sph_taitwater_morris.cpp @@ -64,7 +64,7 @@ void PairSPHTaitwaterMorris::compute(int eflag, int vflag) { double **f = atom->f; double *rho = atom->rho; double *mass = atom->mass; - double *de = atom->de; + double *desph = atom->desph; double *drho = atom->drho; int *type = atom->type; int nlocal = atom->nlocal; @@ -177,13 +177,13 @@ void PairSPHTaitwaterMorris::compute(int eflag, int vflag) { drho[i] += jmass * delVdotDelR * wfd; // change in thermal energy - de[i] += deltaE; + desph[i] += deltaE; if (newton_pair || j < nlocal) { f[j][0] -= delx * fpair + velx * fvisc; f[j][1] -= dely * fpair + vely * fvisc; f[j][2] -= delz * fpair + velz * fvisc; - de[j] += deltaE; + desph[j] += deltaE; drho[j] += imass * delVdotDelR * wfd; } diff --git a/src/atom.cpp b/src/atom.cpp index 5324eea1fc..1e86a778a4 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -73,8 +73,8 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) nperatom = maxperatom = 0; peratom = NULL; - // initialize atom arrays - // customize by adding new array + // -------------------------------------------------------------------- + // 1st customization section: customize by adding new per-atom variables tag = NULL; type = mask = NULL; @@ -159,9 +159,12 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // USER-SPH package - rho = drho = e = de = cv = NULL; + rho = drho = esph = desph = cv = NULL; vest = NULL; + // end of customization section + // -------------------------------------------------------------------- + // user-defined molecules nmolecule = 0; @@ -240,8 +243,9 @@ Atom::~Atom() delete [] peratom[i].name; memory->sfree(peratom); + // -------------------------------------------------------------------- + // 2nd customization section: customize by adding new per-atom variables // delete atom arrays - // customize by adding new array memory->destroy(tag); memory->destroy(type); @@ -287,8 +291,8 @@ Atom::~Atom() memory->destroy(rho); memory->destroy(drho); - memory->destroy(e); - memory->destroy(de); + memory->destroy(esph); + memory->destroy(desph); memory->destroy(cv); memory->destroy(vest); @@ -340,6 +344,9 @@ Atom::~Atom() memory->destroy(improper_atom3); memory->destroy(improper_atom4); + // end of customization section + // -------------------------------------------------------------------- + // delete custom atom arrays for (int i = 0; i < nivector; i++) { @@ -411,7 +418,8 @@ void Atom::peratom_create() peratom = NULL; nperatom = maxperatom = 0; - // customize: add new peratom variables here, order does not matter + // -------------------------------------------------------------------- + // 3rd customization section: add peratom variables here, order does not matter // register tagint & imageint variables as INT or BIGINT int tagintsize = INT; @@ -541,8 +549,8 @@ void Atom::peratom_create() add_peratom("rho",&rho,DOUBLE,0); add_peratom("drho",&drho,DOUBLE,0,1); // set per-thread flag - add_peratom("e",&e,DOUBLE,0); - add_peratom("de",&de,DOUBLE,0,1); // set per-thread flag + add_peratom("esph",&esph,DOUBLE,0); + add_peratom("desph",&desph,DOUBLE,0,1); // set per-thread flag add_peratom("vest",&vest,DOUBLE,3); add_peratom("cv",&cv,DOUBLE,0); @@ -554,6 +562,9 @@ void Atom::peratom_create() add_peratom("eff_plastic_strain",&eff_plastic_strain,DOUBLE,0); add_peratom("eff_plastic_strain_rate",&eff_plastic_strain_rate,DOUBLE,0); add_peratom("damage",&damage,DOUBLE,0); + + // end of customization section + // -------------------------------------------------------------------- } /* ---------------------------------------------------------------------- @@ -636,11 +647,14 @@ void Atom::add_peratom_vary(const char *name, void *address, /* ---------------------------------------------------------------------- add info for a single per-atom array to PerAtom data struct - customize by adding new flag, identical list as atom.h 2nd customization ------------------------------------------------------------------------- */ void Atom::set_atomflag_defaults() { + // -------------------------------------------------------------------- + // 4th customization section: customize by adding new flag + // identical list as 2nd customization in atom.h + sphere_flag = ellipsoid_flag = line_flag = tri_flag = body_flag = 0; peri_flag = electron_flag = 0; wavepacket_flag = sph_flag = 0; @@ -649,7 +663,7 @@ void Atom::set_atomflag_defaults() rmass_flag = radius_flag = omega_flag = torque_flag = angmom_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 = e_flag = cv_flag = vest_flag = 0; + rho_flag = esph_flag = cv_flag = vest_flag = 0; dpd_flag = edpd_flag = tdpd_flag = 0; sp_flag = 0; x0_flag = 0; @@ -2472,11 +2486,13 @@ void Atom::remove_custom(int flag, int index) /* ---------------------------------------------------------------------- return a pointer to a named internal variable if don't recognize name, return NULL - customize by adding names ------------------------------------------------------------------------- */ void *Atom::extract(char *name) { + // -------------------------------------------------------------------- + // 5th customization section: customize by adding new variable name + if (strcmp(name,"mass") == 0) return (void *) mass; if (strcmp(name,"id") == 0) return (void *) tag; @@ -2514,8 +2530,8 @@ void *Atom::extract(char *name) if (strcmp(name,"rho") == 0) return (void *) rho; if (strcmp(name,"drho") == 0) return (void *) drho; - if (strcmp(name,"e") == 0) return (void *) e; - if (strcmp(name,"de") == 0) return (void *) de; + if (strcmp(name,"esph") == 0) return (void *) esph; + if (strcmp(name,"desph") == 0) return (void *) desph; if (strcmp(name,"cv") == 0) return (void *) cv; if (strcmp(name,"vest") == 0) return (void *) vest; @@ -2531,6 +2547,9 @@ void *Atom::extract(char *name) if (strcmp(name,"dpdTheta") == 0) return (void *) dpdTheta; if (strcmp(name,"edpd_temp") == 0) return (void *) edpd_temp; + // end of customization section + // -------------------------------------------------------------------- + return NULL; } diff --git a/src/atom.h b/src/atom.h index 7ba6536399..3a7335b796 100644 --- a/src/atom.h +++ b/src/atom.h @@ -139,9 +139,12 @@ class Atom : protected Pointers { // USER-SPH package - double *rho,*drho,*e,*de,*cv; + double *rho,*drho,*esph,*desph,*cv; double **vest; + // end of customization section + // -------------------------------------------------------------------- + // -------------------------------------------------------------------- // 2nd customization section: customize by adding new flags // identical list as Atom::set_atomflag_defaults() @@ -157,7 +160,7 @@ class Atom : protected Pointers { int rmass_flag,radius_flag,omega_flag,torque_flag,angmom_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,e_flag,cv_flag,vest_flag; + int rho_flag,esph_flag,cv_flag,vest_flag; int dpd_flag,edpd_flag,tdpd_flag; // SPIN package @@ -175,7 +178,7 @@ class Atom : protected Pointers { double pdscale; - // end of 2 customization sections + // end of customization section // -------------------------------------------------------------------- // per-atom data struct describing all per-atom vectors/arrays diff --git a/src/set.cpp b/src/set.cpp index e3b1962d5d..80636a3ae2 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -47,7 +47,7 @@ enum{TYPE,TYPE_FRACTION,TYPE_RATIO,TYPE_SUBSET, DIPOLE,DIPOLE_RANDOM,SPIN,SPIN_RANDOM,QUAT,QUAT_RANDOM, THETA,THETA_RANDOM,ANGMOM,OMEGA, DIAMETER,DENSITY,VOLUME,IMAGE,BOND,ANGLE,DIHEDRAL,IMPROPER, - MESO_E,MESO_CV,MESO_RHO,EDPD_TEMP,EDPD_CV,CC,SMD_MASS_DENSITY, + SPH_E,SPH_CV,SPH_RHO,EDPD_TEMP,EDPD_CV,CC,SMD_MASS_DENSITY, SMD_CONTACT_RADIUS,DPDTHETA,INAME,DNAME,VX,VY,VZ}; #define BIG INT_MAX @@ -472,31 +472,31 @@ void Set::command(int narg, char **arg) topology(IMPROPER); iarg += 2; - } else if (strcmp(arg[iarg],"meso/e") == 0) { + } else if (strcmp(arg[iarg],"sph/e") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else dvalue = force->numeric(FLERR,arg[iarg+1]); - if (!atom->e_flag) + if (!atom->esph_flag) error->all(FLERR,"Cannot set meso/e for this atom style"); - set(MESO_E); + set(SPH_E); iarg += 2; - } else if (strcmp(arg[iarg],"meso/cv") == 0) { + } else if (strcmp(arg[iarg],"sph/cv") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else dvalue = force->numeric(FLERR,arg[iarg+1]); if (!atom->cv_flag) error->all(FLERR,"Cannot set meso/cv for this atom style"); - set(MESO_CV); + set(SPH_CV); iarg += 2; - } else if (strcmp(arg[iarg],"meso/rho") == 0) { + } else if (strcmp(arg[iarg],"sph/rho") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else dvalue = force->numeric(FLERR,arg[iarg+1]); if (!atom->rho_flag) error->all(FLERR,"Cannot set meso/rho for this atom style"); - set(MESO_RHO); + set(SPH_RHO); iarg += 2; } else if (strcmp(arg[iarg],"edpd/temp") == 0) { @@ -797,9 +797,9 @@ void Set::set(int keyword) if (dvalue <= 0.0) error->one(FLERR,"Invalid volume in set command"); atom->vfrac[i] = dvalue; } - else if (keyword == MESO_E) atom->e[i] = dvalue; - else if (keyword == MESO_CV) atom->cv[i] = dvalue; - else if (keyword == MESO_RHO) atom->rho[i] = dvalue; + else if (keyword == SPH_E) atom->esph[i] = dvalue; + else if (keyword == SPH_CV) atom->cv[i] = dvalue; + else if (keyword == SPH_RHO) atom->rho[i] = dvalue; else if (keyword == EDPD_TEMP) atom->edpd_temp[i] = dvalue; else if (keyword == EDPD_CV) atom->edpd_cv[i] = dvalue;