diff -Naur lammps-12May09/doc/fix_rigid.html lammps-18May09/doc/fix_rigid.html --- lammps-12May09/doc/fix_rigid.html 2009-03-19 08:34:23.000000000 -0600 +++ lammps-18May09/doc/fix_rigid.html 2009-05-19 08:43:06.000000000 -0600 @@ -211,7 +211,7 @@

Default:

-

The option defaults are force * 1 1 1 and torque * 1 1 1, meaning +

The option defaults are force * on on on and torque * on on on meaning all rigid bodies are acted on by center-of-mass force and torque.

diff -Naur lammps-12May09/doc/fix_rigid.txt lammps-18May09/doc/fix_rigid.txt --- lammps-12May09/doc/fix_rigid.txt 2009-03-19 08:34:23.000000000 -0600 +++ lammps-18May09/doc/fix_rigid.txt 2009-05-19 08:43:06.000000000 -0600 @@ -202,6 +202,6 @@ [Default:] -The option defaults are force * 1 1 1 and torque * 1 1 1, meaning +The option defaults are force * on on on and torque * on on on meaning all rigid bodies are acted on by center-of-mass force and torque. diff -Naur lammps-12May09/doc/fix_write_reax_bonds.txt lammps-18May09/doc/fix_write_reax_bonds.txt --- lammps-12May09/doc/fix_write_reax_bonds.txt 2009-04-30 15:46:49.000000000 -0600 +++ lammps-18May09/doc/fix_write_reax_bonds.txt 1969-12-31 17:00:00.000000000 -0700 @@ -1,56 +0,0 @@ -"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c - -:link(lws,http://lammps.sandia.gov) -:link(ld,Manual.html) -:link(lc,Section_commands.html#comm) - -:line - -fix write/reax/bonds command :h3 - -[Syntax:] - -fix ID group-ID write/reax/bonds Nevery filename :pre - -ID, group-ID are documented in "fix"_fix.html command :ulb,l -write/reax/bonds = style name of this fix command :l -Nevery = output interval in timesteps :l -filename = naem of output file - -[Examples:] - -fix 1 all write/reax/bonds 100 bonds.tatb - -[Description:] - -Write out the bond information computed by the -ReaxFF potential ("pair_style reax"_pair_reax.html). -During dynamics runs, the bond information is written -to {filename} on timesteps that are multiples of -{Nevery}, including timestep 0. No output is generated -during minimization runs. - -:line - -[Restart, fix_modify, output, run start/stop, minimize info:] - -No information about this fix is written to "binary restart -files"_restart.html. None of the "fix_modify"_fix_modify.html options -are relevant to this fix. This fix does not provide any compute -quantities. - -[Restrictions:] - -This fix requires that the "pair_style reax"_pair_reax.html be invoked. -This fix is part of the "reax" package. It is only enabled if -LAMMPS was built with that package, which also requires the REAX -library be built and linked with LAMMPS. See the "Making -LAMMPS"_Section_start.html#2_3 section for more info. - -[Related commands:] - -"pair_style reax"_pair_reax.html - -[Default:] - -none diff -Naur lammps-12May09/doc/mass.html lammps-18May09/doc/mass.html --- lammps-12May09/doc/mass.html 2009-01-19 10:17:01.000000000 -0700 +++ lammps-18May09/doc/mass.html 2009-05-19 08:57:46.000000000 -0600 @@ -26,10 +26,10 @@

Description:

-

Set the mass for all atoms of one or more atom types. Mass values can -also be set in the read_data data file using the -"Masses" keyword. See the units command for what mass -units to use. +

Set the mass for all atoms of one or more atom types. Per-type mass +values can also be set in the read_data data file +using the "Masses" keyword. See the units command for +what mass units to use.

The I index can be specified in one of two ways. An explicit numeric value can be used, as in the 1st example above. Or a wild-card @@ -50,13 +50,14 @@

1 1.0 
 

Note that the mass command can only be used if the atom -style requires per-type atom mass to be set, which -most do. Exceptions are atom_style granular or -atom_style peri, which require mass to be set for -individual particles, not types. Per-atom masses are defined in the -data file read by the read_data command, or set to -default values by the create_atoms command, or set -to new values by the set density command. +style requires per-type atom mass to be set. +Currently, all but the granular and peri styles do. They require +mass to be set for individual particles, not types. Per-atom masses +are defined in the data file read by the read_data +command, or set to default values by the +create_atoms command. Per-atom masses can also be +set to new values by the set diameter or set +density command.

Also note that pair_style eam defines the masses of atom types in the EAM potential file, in which case the mass command @@ -64,9 +65,9 @@

If you define a hybrid atom style which includes one (or more) sub-styles which require per-type mass and one (or more) -sub-styles which require per-atom mass, then you must define both. -However, the per-type mass is ignored in this case; only the per-atom -mass is used. +sub-styles which require per-atom mass, then you must define both. In +this case the per-type mass will be ignored; only the per-atom mass is +used by LAMMPS.

Restrictions:

diff -Naur lammps-12May09/doc/mass.txt lammps-18May09/doc/mass.txt --- lammps-12May09/doc/mass.txt 2009-01-19 10:17:01.000000000 -0700 +++ lammps-18May09/doc/mass.txt 2009-05-19 08:57:46.000000000 -0600 @@ -23,10 +23,10 @@ [Description:] -Set the mass for all atoms of one or more atom types. Mass values can -also be set in the "read_data"_read_data.html data file using the -"Masses" keyword. See the "units"_units.html command for what mass -units to use. +Set the mass for all atoms of one or more atom types. Per-type mass +values can also be set in the "read_data"_read_data.html data file +using the "Masses" keyword. See the "units"_units.html command for +what mass units to use. The I index can be specified in one of two ways. An explicit numeric value can be used, as in the 1st example above. Or a wild-card @@ -47,13 +47,14 @@ 1 1.0 :pre Note that the mass command can only be used if the "atom -style"_atom_style.html requires per-type atom mass to be set, which -most do. Exceptions are "atom_style granular"_atom_style.html or -"atom_style peri"_atom_style.html, which require mass to be set for -individual particles, not types. Per-atom masses are defined in the -data file read by the "read_data"_read_data.html command, or set to -default values by the "create_atoms"_create_atoms.html command, or set -to new values by the "set density"_set.html command. +style"_atom_style.html requires per-type atom mass to be set. +Currently, all but the {granular} and {peri} styles do. They require +mass to be set for individual particles, not types. Per-atom masses +are defined in the data file read by the "read_data"_read_data.html +command, or set to default values by the +"create_atoms"_create_atoms.html command. Per-atom masses can also be +set to new values by the "set diameter"_set.html or "set +density"_set.html command. Also note that "pair_style eam"_pair_eam.html defines the masses of atom types in the EAM potential file, in which case the mass command @@ -61,9 +62,9 @@ If you define a "hybrid atom style"_atom_style.html which includes one (or more) sub-styles which require per-type mass and one (or more) -sub-styles which require per-atom mass, then you must define both. -However, the per-type mass is ignored in this case; only the per-atom -mass is used. +sub-styles which require per-atom mass, then you must define both. In +this case the per-type mass will be ignored; only the per-atom mass is +used by LAMMPS. [Restrictions:] diff -Naur lammps-12May09/doc/pair_gayberne.html lammps-18May09/doc/pair_gayberne.html --- lammps-12May09/doc/pair_gayberne.html 2008-05-17 16:33:11.000000000 -0600 +++ lammps-18May09/doc/pair_gayberne.html 2009-05-19 08:43:06.000000000 -0600 @@ -51,17 +51,20 @@

The variable names utilized as potential parameters are for the most part taken from (Everaers) in order to be consistent with its RE-squared potential fix. Details on the upsilon and mu -parameters are given here. Use of this pair style requires -the NVE, NVT, or NPT fixes with the asphere extension (e.g. fix -nve/asphere) in order to integrate particle -rotation. Additionally, atom_style ellipsoid should -be used since it defines the rotational state of the ellipsoidal -particles. +parameters are given here.

More details of the Gay-Berne formulation are given in the references listed below and in this supplementary document.

+

Use of this pair style requires the NVE, NVT, or NPT fixes with the +asphere extension (e.g. fix nve/asphere) in +order to integrate particle rotation. Additionally, atom_style +ellipsoid should be used since it defines the +rotational state of the ellipsoidal particles. The size and shape of +the ellipsoidal particles are defined by the shape +command. +

The following coefficients must be defined for each pair of atoms types via the pair_coeff command as in the examples above, or in the data file or restart files read by the @@ -81,6 +84,11 @@

The last coefficient is optional. If not specified, the global cutoff specified in the pair_style command is used.

+

It is typical for the Gay-Berne potential to define sigma as the +minimum of the 3 "shape" diameters for a I,I interaction, though this +is not required. Note that this is a different meaning for sigma +than the pair_style resquared potential uses. +

The epsilon_i and epsilon_j coefficients are actually defined for atom types, not for pairs of atom types. Thus, in a series of pair_coeff commands, they only need to be specified once for each atom type. @@ -149,7 +157,10 @@

This style is part of the "asphere" package. It is only enabled if LAMMPS was built with that package. See the Making -LAMMPS section for more info. +LAMMPS section for more info. You must also +define a size and shape for each particle type via the +shape command which requires atom_style +ellipsoid.

The Gay-Berne potential does not become isotropic as r increases (Everaers). The distance-of-closest-approach diff -Naur lammps-12May09/doc/pair_gayberne.txt lammps-18May09/doc/pair_gayberne.txt --- lammps-12May09/doc/pair_gayberne.txt 2008-05-17 16:33:11.000000000 -0600 +++ lammps-18May09/doc/pair_gayberne.txt 2009-05-19 08:43:06.000000000 -0600 @@ -48,17 +48,20 @@ The variable names utilized as potential parameters are for the most part taken from "(Everaers)"_#Everaers in order to be consistent with its RE-squared potential fix. Details on the upsilon and mu -parameters are given "here"_gbdoc. Use of this pair style requires -the NVE, NVT, or NPT fixes with the {asphere} extension (e.g. "fix -nve/asphere"_fix_nve_asphere.html) in order to integrate particle -rotation. Additionally, "atom_style ellipsoid"_atom_style.html should -be used since it defines the rotational state of the ellipsoidal -particles. +parameters are given "here"_gbdoc. More details of the Gay-Berne formulation are given in the references listed below and in "this supplementary document"_PDF/pair_gayberne_extra.pdf. +Use of this pair style requires the NVE, NVT, or NPT fixes with the +{asphere} extension (e.g. "fix nve/asphere"_fix_nve_asphere.html) in +order to integrate particle rotation. Additionally, "atom_style +ellipsoid"_atom_style.html should be used since it defines the +rotational state of the ellipsoidal particles. The size and shape of +the ellipsoidal particles are defined by the "shape"_shape.html +command. + The following coefficients must be defined for each pair of atoms types via the "pair_coeff"_pair_coeff.html command as in the examples above, or in the data file or restart files read by the @@ -78,6 +81,11 @@ The last coefficient is optional. If not specified, the global cutoff specified in the pair_style command is used. +It is typical for the Gay-Berne potential to define {sigma} as the +minimum of the 3 "shape" diameters for a I,I interaction, though this +is not required. Note that this is a different meaning for {sigma} +than the "pair_style resquared"_pair_resquared.html potential uses. + The epsilon_i and epsilon_j coefficients are actually defined for atom types, not for pairs of atom types. Thus, in a series of pair_coeff commands, they only need to be specified once for each atom type. @@ -146,7 +154,10 @@ This style is part of the "asphere" package. It is only enabled if LAMMPS was built with that package. See the "Making -LAMMPS"_Section_start.html#2_3 section for more info. +LAMMPS"_Section_start.html#2_3 section for more info. You must also +define a size and shape for each particle type via the +"shape"_shape.html command which requires "atom_style +ellipsoid"_atom_style.html. The Gay-Berne potential does not become isotropic as r increases "(Everaers)"_#Everaers. The distance-of-closest-approach diff -Naur lammps-12May09/doc/pair_resquared.html lammps-18May09/doc/pair_resquared.html --- lammps-12May09/doc/pair_resquared.html 2009-01-27 08:32:45.000000000 -0700 +++ lammps-18May09/doc/pair_resquared.html 2009-05-19 08:43:06.000000000 -0600 @@ -28,7 +28,7 @@ (Everaers), (Babadi) between pairs of ellipsoidal and/or spherical Lennard-Jones particles. For ellipsoidal interactions, the potential considers the ellipsoid as being comprised -of small spheres of size sigma. LJ particles are a single sphere of +of small spheres of size sigma. LJ particles are a single sphere of size sigma. The distinction is made to allow the pair style to make efficient calculations of ellipsoid/solvent interactions.

@@ -39,9 +39,9 @@ asphere extension (e.g. fix nve/asphere) in order to integrate particle rotation. Additionally, atom_style ellipsoid should be used since it defines the -rotational state of the ellipsoidal particles and the -shape command should be used to specify ellipsoid -diameters. +rotational state of the ellipsoidal particles. The size and shape of +the ellipsoidal particles are defined by the shape +command.

The following coefficients must be defined for each pair of atoms types via the pair_coeff command as in the examples @@ -59,6 +59,14 @@

  • epsilon_j_c = relative well depth of type J for end-to-end interactions
  • cutoff (distance units) +

    The last coefficient is optional. If not specified, the global +cutoff specified in the pair_style command is used. +

    +

    As described above, sigma is the size of the small spheres which are +integrated over to create the potential. Note that this is a +different meaning for sigma than the pair_style +gayberne potential uses. +

    The parameters used depend on the type of the interacting particles, i.e. ellipsoid or LJ sphere. The type of particle is determined by the diameters specified with the shape command. LJ @@ -173,7 +181,10 @@

    This style is part of the "asphere" package. It is only enabled if LAMMPS was built with that package. See the Making -LAMMPS section for more info. +LAMMPS section for more info. You must also +define a size and shape for each particle type via the +shape command which requires atom_style +ellipsoid.

    The distance-of-closest-approach approximation used by LAMMPS becomes less accurate when high-aspect ratio ellipsoids are used. diff -Naur lammps-12May09/doc/pair_resquared.txt lammps-18May09/doc/pair_resquared.txt --- lammps-12May09/doc/pair_resquared.txt 2009-01-27 08:32:45.000000000 -0700 +++ lammps-18May09/doc/pair_resquared.txt 2009-05-19 08:43:06.000000000 -0600 @@ -25,7 +25,7 @@ "(Everaers)"_#Everaers, "(Babadi)"_#Babadi between pairs of ellipsoidal and/or spherical Lennard-Jones particles. For ellipsoidal interactions, the potential considers the ellipsoid as being comprised -of small spheres of size sigma. LJ particles are a single sphere of +of small spheres of size sigma. LJ particles are a single sphere of size sigma. The distinction is made to allow the pair style to make efficient calculations of ellipsoid/solvent interactions. @@ -36,9 +36,9 @@ {asphere} extension (e.g. "fix nve/asphere"_fix_nve_asphere.html) in order to integrate particle rotation. Additionally, "atom_style ellipsoid"_atom_style.html should be used since it defines the -rotational state of the ellipsoidal particles and the -"shape"_shape.html command should be used to specify ellipsoid -diameters. +rotational state of the ellipsoidal particles. The size and shape of +the ellipsoidal particles are defined by the "shape"_shape.html +command. The following coefficients must be defined for each pair of atoms types via the "pair_coeff"_pair_coeff.html command as in the examples @@ -56,6 +56,14 @@ epsilon_j_c = relative well depth of type J for end-to-end interactions cutoff (distance units) :ul +The last coefficient is optional. If not specified, the global +cutoff specified in the pair_style command is used. + +As described above, {sigma} is the size of the small spheres which are +integrated over to create the potential. Note that this is a +different meaning for {sigma} than the "pair_style +gayberne"_pair_gayberne.html potential uses. + The parameters used depend on the type of the interacting particles, i.e. ellipsoid or LJ sphere. The type of particle is determined by the diameters specified with the "shape"_shape.html command. LJ @@ -170,7 +178,10 @@ This style is part of the "asphere" package. It is only enabled if LAMMPS was built with that package. See the "Making -LAMMPS"_Section_start.html#2_3 section for more info. +LAMMPS"_Section_start.html#2_3 section for more info. You must also +define a size and shape for each particle type via the +"shape"_shape.html command which requires "atom_style +ellipsoid"_atom_style.html. The distance-of-closest-approach approximation used by LAMMPS becomes less accurate when high-aspect ratio ellipsoids are used. diff -Naur lammps-12May09/doc/set.html lammps-18May09/doc/set.html --- lammps-12May09/doc/set.html 2008-08-20 08:56:12.000000000 -0600 +++ lammps-18May09/doc/set.html 2009-05-19 08:57:46.000000000 -0600 @@ -145,12 +145,17 @@

    For the dipole and quat keywords, the atom style being used must support the use of dipoles or quaternions.

    -

    Keyword diameter sets the size of all selected particles. +

    Keyword diameter sets the size of all selected particles. If the +particles have a per-atom mass and density, then it also sets their +mass. +

    +

    Keyword density sets the density of all selected particles. If the +particles have a per-atom mass and diameter, then it also sets their +mass. If the particles have a per-atom mass and volume (as defined by +PeriDynamics), then it also sets their mass.

    -

    Keyword density sets the density of all selected particles, which -combined with its density determines their mass. -

    -

    Keyword volume sets the effective size of all selected particles. +

    Keyword volume sets the volume of all selected particles, as defined +by PeriDynamics.

    Keyword image sets which image of the simulation box the atom is considered to be in. It is only applied to periodic dimensions. An diff -Naur lammps-12May09/doc/set.txt lammps-18May09/doc/set.txt --- lammps-12May09/doc/set.txt 2008-08-20 08:56:12.000000000 -0600 +++ lammps-18May09/doc/set.txt 2009-05-19 08:57:46.000000000 -0600 @@ -140,12 +140,17 @@ For the {dipole} and {quat} keywords, the "atom style"_atom_style.html being used must support the use of dipoles or quaternions. -Keyword {diameter} sets the size of all selected particles. +Keyword {diameter} sets the size of all selected particles. If the +particles have a per-atom mass and density, then it also sets their +mass. + +Keyword {density} sets the density of all selected particles. If the +particles have a per-atom mass and diameter, then it also sets their +mass. If the particles have a per-atom mass and volume (as defined by +PeriDynamics), then it also sets their mass. -Keyword {density} sets the density of all selected particles, which -combined with its density determines their mass. - -Keyword {volume} sets the effective size of all selected particles. +Keyword {volume} sets the volume of all selected particles, as defined +by PeriDynamics. Keyword {image} sets which image of the simulation box the atom is considered to be in. It is only applied to periodic dimensions. An diff -Naur lammps-12May09/examples/peri/in.peri lammps-18May09/examples/peri/in.peri --- lammps-12May09/examples/peri/in.peri 2009-01-09 15:18:56.000000000 -0700 +++ lammps-18May09/examples/peri/in.peri 2009-05-19 08:58:16.000000000 -0600 @@ -1,6 +1,6 @@ # small Peridynamic cylinder hit by projectile -units si +units si boundary s s s atom_style peri atom_modify map array @@ -15,8 +15,8 @@ pair_style peri/pmb pair_coeff * * 1.6863e22 0.0015001 0.0005 0.25 -set group all density 2200 +set group all density 2200 set group all volume 1.25e-10 velocity all set 0.0 0.0 0.0 sum no units box fix 1 all nve diff -Naur lammps-12May09/src/PERI/atom_vec_peri.cpp lammps-18May09/src/PERI/atom_vec_peri.cpp --- lammps-12May09/src/PERI/atom_vec_peri.cpp 2009-02-12 14:36:52.000000000 -0700 +++ lammps-18May09/src/PERI/atom_vec_peri.cpp 2009-05-19 09:02:32.000000000 -0600 @@ -540,6 +540,7 @@ vfrac[nlocal] = atof(values[2]); density[nlocal] = atof(values[3]); rmass[nlocal] = density[nlocal]; + if (rmass[nlocal] <= 0.0) error->one("Invalid mass value"); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; @@ -571,6 +572,7 @@ vfrac[nlocal] = atof(values[0]); density[nlocal] = atof(values[1]); rmass[nlocal] = density[nlocal]; + if (rmass[nlocal] <= 0.0) error->one("Invalid mass value"); v[nlocal][0] = 0.0; v[nlocal][1] = 0.0; diff -Naur lammps-12May09/src/atom.cpp lammps-18May09/src/atom.cpp --- lammps-12May09/src/atom.cpp 2009-01-05 15:26:08.000000000 -0700 +++ lammps-18May09/src/atom.cpp 2009-05-19 09:01:02.000000000 -0600 @@ -1126,6 +1126,15 @@ if (shape[itype][0] < 0.0 || shape[itype][1] < 0.0 || shape[itype][2] < 0.0) error->all("Invalid shape value"); + if (shape[itype][0] == 0.0 && + (shape[itype][1] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][1] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][2] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][1] != 0.0)) + error->all("Invalid shape value"); } /* ---------------------------------------------------------------------- @@ -1153,6 +1162,15 @@ if (shape[itype][0] < 0.0 || shape[itype][1] < 0.0 || shape[itype][2] < 0.0) error->all("Invalid shape value"); + if (shape[itype][0] == 0.0 && + (shape[itype][1] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][1] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][2] != 0.0)) + error->all("Invalid shape value"); + if (shape[itype][2] == 0.0 && + (shape[itype][0] != 0.0 || shape[itype][1] != 0.0)) + error->all("Invalid shape value"); } } diff -Naur lammps-12May09/src/fix_ave_spatial.cpp lammps-18May09/src/fix_ave_spatial.cpp --- lammps-12May09/src/fix_ave_spatial.cpp 2009-02-12 14:36:52.000000000 -0700 +++ lammps-18May09/src/fix_ave_spatial.cpp 2009-05-19 09:03:50.000000000 -0600 @@ -203,7 +203,6 @@ error->all("Illegal fix ave/spatial command"); if (delta <= 0.0) error->all("Illegal fix ave/spatial command"); - invdelta = 1.0/delta; for (int i = 0; i < nvalues; i++) { if (which[i] == COMPUTE) { @@ -287,6 +286,8 @@ delta *= scale; if (originflag == COORD) origin *= scale; + invdelta = 1.0/delta; + // initializations irepeat = 0; diff -Naur lammps-12May09/src/fix_deform.cpp lammps-18May09/src/fix_deform.cpp --- lammps-12May09/src/fix_deform.cpp 2009-03-17 18:09:34.000000000 -0600 +++ lammps-18May09/src/fix_deform.cpp 2009-05-19 08:59:04.000000000 -0600 @@ -306,6 +306,15 @@ { delete [] set; delete [] rfix; + + // reset domain's h_rate = 0.0, since this fix may have made it non-zero + + double *h_rate = domain->h_rate; + double *h_ratelo = domain->h_ratelo; + + h_rate[0] = h_rate[1] = h_rate[2] = + h_rate[3] = h_rate[4] = h_rate[5] = 0.0; + h_ratelo[0] = h_ratelo[1] = h_ratelo[2] = 0.0; } /* ---------------------------------------------------------------------- */ diff -Naur lammps-12May09/src/set.cpp lammps-18May09/src/set.cpp --- lammps-12May09/src/set.cpp 2008-10-07 09:06:17.000000000 -0600 +++ lammps-18May09/src/set.cpp 2009-05-19 09:00:00.000000000 -0600 @@ -317,13 +317,6 @@ void Set::set(int keyword) { - // set granular and peridynamic flags - - int granflag = 0; - int periflag = 0; - if (atom->style_match("granular")) granflag = 1; - if (atom->style_match("peri")) periflag = 1; - if (keyword == DIPOLE) atom->check_dipole(); selection(atom->nlocal); @@ -341,24 +334,27 @@ else if (keyword == VZ) atom->v[i][2] = dvalue; else if (keyword == CHARGE) atom->q[i] = dvalue; - // diameter setting triggers setting of rmass + // set radius from diameter + // set rmass if both rmass and density are defined else if (keyword == DIAMETER) { atom->radius[i] = 0.5 * dvalue; - atom->rmass[i] = 4.0*PI/3.0 * - atom->radius[i]*atom->radius[i]*atom->radius[i] * atom->density[i]; + if (atom->rmass_flag && atom->density_flag) + atom->rmass[i] = 4.0*PI/3.0 * + atom->radius[i]*atom->radius[i]*atom->radius[i] * atom->density[i]; - // density setting triggers setting of rmass - // for granular, rmass is function of diameter and density - // for peri, rmass stores density directly + // set density + // set rmass (granular) if both rmass and radius are defined + // set rmass (peri) if both rmass and vfrac are defined } else if (keyword == DENSITY) { atom->density[i] = dvalue; - if (granflag) + if (atom->rmass_flag && atom->radius_flag) atom->rmass[i] = 4.0*PI/3.0 * atom->radius[i]*atom->radius[i]*atom->radius[i] * atom->density[i]; - if (periflag) atom->rmass[i] = dvalue; + else if (atom->rmass_flag && atom->vfrac_flag) + atom->rmass[i] = dvalue; } else if (keyword == VOLUME) atom->vfrac[i] = dvalue;