Commit 44841f68 authored by Steve Plimpton's avatar Steve Plimpton
Browse files

fix ave/chunk fixes, 2d disc option, fix_modify dynamic/dof

parent dcede304
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -1974,9 +1974,12 @@ The extract functions return a pointer to various global or per-atom
quantities stored in LAMMPS or to values calculated by a compute, fix,
or variable.  The pointer returned by the extract_global() function
can be used as a permanent reference to a value which may change.  For
the other extract functions, the underlying storage may be reallocated
as LAMMPS runs, so you need to re-call the function to assure a
current pointer or returned value(s).
the extract_atom() method, see the extract() method in the
src/atom.cpp file for a list of valid per-atom properties.  New names
could easily be added if the property you want is not listed.  For the
other extract functions, the underlying storage may be reallocated as
LAMMPS runs, so you need to re-call the function to assure a current
pointer or returned value(s).

The lammps_reset_box() function resets the size and shape of the
simulation box, e.g. as part of restoring a previously extracted and
@@ -1992,11 +1995,15 @@ keyword as a double precision value.
The lammps_get_natoms() function returns the total number of atoms in
the system and can be used by the caller to allocate space for the
lammps_gather_atoms() and lammps_scatter_atoms() functions.  The
gather function collects atom info of the requested type (atom coords,
types, forces, etc) from all processors, orders them by atom ID, and
returns a full list to each calling processor.  The scatter function
does the inverse.  It distributes the same kinds of values, 
gather function collects peratom info of the requested type (atom
coords, types, forces, etc) from all processors, orders them by atom
ID, and returns a full list to each calling processor.  The scatter
function does the inverse.  It distributes the same peratom values,
passed by the caller, to each atom owned by individual processors.
Both methods are thus a means to extract or assign (overwrite) any
peratom quantities within LAMMPS.  See the extract() method in the
src/atom.cpp file for a list of valid per-atom properties.  New names
could easily be added if the property you want is not listed.

The lammps_create_atoms() function takes a list of N atoms as input
with atom types and coords (required), an optionally atom IDs and
+29 −21
Original line number Diff line number Diff line
@@ -594,10 +594,10 @@ flag = lmp.set_variable(name,value) # set existing named string-style vari
value = lmp.get_thermo(name)              # return current value of a thermo keyword

natoms = lmp.get_natoms()                 # total # of atoms as int
data = lmp.gather_atoms(name,type,count)  # return atom attribute of all atoms gathered into data, ordered by atom ID
data = lmp.gather_atoms(name,type,count)  # return per-atom property of all atoms gathered into data, ordered by atom ID
                                          # name = "x", "charge", "type", etc
                                          # count = # of per-atom values, 1 or 3, etc
lmp.scatter_atoms(name,type,count,data)   # scatter atom attribute of all atoms from data, ordered by atom ID
lmp.scatter_atoms(name,type,count,data)   # scatter per-atom property to all atoms from data, ordered by atom ID
                                          # name = "x", "charge", "type", etc
                                          # count = # of per-atom values, 1 or 3, etc :pre

@@ -656,10 +656,10 @@ argument.
For extract_atom(), a pointer to internal LAMMPS atom-based data is
returned, which you can use via normal Python subscripting.  See the
extract() method in the src/atom.cpp file for a list of valid names.
Again, new names could easily be added.  A pointer to a vector of
doubles or integers, or a pointer to an array of doubles (double **)
or integers (int **) is returned.  You need to specify the appropriate
data type via the type argument.
Again, new names could easily be added if the property you want is not
listed.  A pointer to a vector of doubles or integers, or a pointer to
an array of doubles (double **) or integers (int **) is returned.  You
need to specify the appropriate data type via the type argument.

For extract_compute() and extract_fix(), the global, per-atom, or
local data calculated by the compute or fix can be accessed.  What is
@@ -689,12 +689,16 @@ specified group.
The get_natoms() method returns the total number of atoms in the
simulation, as an int.

The gather_atoms() method returns a ctypes vector of ints or doubles
as specified by type, of length count*natoms, for the property of all
the atoms in the simulation specified by name, ordered by count and
then by atom ID.  The vector can be used via normal Python
subscripting.  If atom IDs are not consecutively ordered within
LAMMPS, a None is returned as indication of an error.
The gather_atoms() method allows any per-atom property (coordinates,
velocities, etc) to be extracted from LAMMPS.  It returns a ctypes
vector of ints or doubles as specified by type, of length
count*natoms, for the named property for all atoms in the simulation.
The data is ordered by count and then by atom ID.  See the extract()
method in the src/atom.cpp file for a list of valid names.  Again, new
names could easily be added if the property you want is missing.  The
vector can be used via normal Python subscripting.  If atom IDs are
not consecutively ordered within LAMMPS, a None is returned as
indication of an error.

Note that the data structure gather_atoms("x") returns is different
from the data structure returned by extract_atom("x") in four ways.
@@ -711,14 +715,18 @@ assigning a new values to the extract_atom() array. To do this with
the gather_atoms() vector, you need to change values in the vector,
then invoke the scatter_atoms() method.

The scatter_atoms() method takes a vector of ints or doubles as
specified by type, of length count*natoms, for the property of all the
atoms in the simulation specified by name, ordered by bount and then
by atom ID.  It uses the vector of data to overwrite the corresponding
properties for each atom inside LAMMPS.  This requires LAMMPS to have
its "map" option enabled; see the "atom_modify"_atom_modify.html
command for details.  If it is not, or if atom IDs are not
consecutively ordered, no coordinates are reset.
The scatter_atoms() method allows any per-atom property (coordinates,
velocities, etc) to be inserted into LAMMPS, overwriting the current
property.  It takes a vector of ints or doubles as specified by type,
of length count*natoms, for the named property for all atoms in the
simulation.  The data should be ordered by count and then by atom ID.
See the extract() method in the src/atom.cpp file for a list of valid
names.  Again, new names could easily be added if the property you
want is missing.  It uses the vector of data to overwrite the
corresponding properties for each atom inside LAMMPS.  This requires
LAMMPS to have its "map" option enabled; see the
"atom_modify"_atom_modify.html command for details.  If it is not, or
if atom IDs are not consecutively ordered, no coordinates are reset.

The array of coordinates passed to scatter_atoms() must be a ctypes
vector of ints or doubles, allocated and initialized something like
@@ -734,7 +742,7 @@ x\[2\] = z coord of atom with ID 1
x\[3\] = x coord of atom with ID 2
...
x\[n3-1\] = z coord of atom with ID natoms
lmp.scatter_coords("x",1,3,x) :pre
lmp.scatter_atoms("x",1,3,x) :pre

Alternatively, you can just change values in the vector returned by
gather_atoms("x",1,3), since it is a ctypes vector of doubles.
+26 −20
Original line number Diff line number Diff line
@@ -14,27 +14,29 @@ compute_modify compute-ID keyword value ... :pre

compute-ID = ID of the compute to modify :ulb,l
one or more keyword/value pairs may be listed :l
keyword = {extra} or {dynamic} :l
  {extra} value = N
keyword = {extra/dof} or {extra} or {dynamic/dof} or {dynamic} :l
  {extra/dof} value = N
    N = # of extra degrees of freedom to subtract
  {dynamic} value = {yes} or {no}
    yes/no = do or do not recompute the number of atoms contributing to the temperature :pre
  {extra} syntax is identical to {extra/dof}, will be disabled at some point
  {dynamic/dof} value = {yes} or {no}
    yes/no = do or do not recompute the number of atoms contributing to the temperature
  {dynamic} syntax is identical to {dynamic/dof}, will be disabled at some point :pre
:ule

[Examples:]

compute_modify myTemp extra 0
compute_modify newtemp dynamic yes extra 600 :pre
compute_modify myTemp extra/dof 0
compute_modify newtemp dynamic/dof yes extra/dof 600 :pre

[Description:]

Modify one or more parameters of a previously defined compute.  Not
all compute styles support all parameters.

The {extra} keyword refers to how many degrees-of-freedom are
subtracted (typically from 3N) as a normalizing factor in a
temperature computation.  Only computes that compute a temperature use
this option.  The default is 2 or 3 for "2d or 3d
The {extra/dof} or {extra} keyword refers to how many
degrees-of-freedom are subtracted (typically from 3N) as a normalizing
factor in a temperature computation.  Only computes that compute a
temperature use this option.  The default is 2 or 3 for "2d or 3d
systems"_dimension.html which is a correction factor for an ensemble
of velocities with zero total linear momentum. For compute
temp/partial, if one or more velocity components are excluded, the
@@ -43,14 +45,18 @@ number for the {extra} parameter if you need to add
degrees-of-freedom.  See the "compute
temp/asphere"_compute_temp_asphere.html command for an example.

The {dynamic} keyword determines whether the number of atoms N in the
compute group is re-computed each time a temperature is computed.
Only compute styles that calculate a temperature use this option.  By
default, N is assumed to be constant.  If you are adding atoms to the
system (see the "fix pour"_fix_pour.html or "fix
deposit"_fix_deposit.html commands) or expect atoms to be lost
(e.g. due to evaporation), then this option should be used to insure
the temperature is correctly normalized.
The {dynamic/dof} or {dynamic} keyword determines whether the number
of atoms N in the compute group is re-computed each time a temperature
is computed.  Only compute styles that calculate a temperature use
this option.  By default, N is assumed to be constant.  If you are
adding atoms to the system (see the "fix pour"_fix_pour.html, "fix
deposit"_fix_deposit.html and "fix gcmc"_fix_gcmc.html commands) or
expect atoms to be lost (e.g. due to evaporation), then this option
should be used to insure the temperature is correctly normalized.

NOTE: The {extra} and {dynamic} keywords should not be used as they
are deprecated (March 2017) and will eventually be disabled.  Instead,
use the equivalent {extra/dof} and {dynamic/dof} keywords.

[Restrictions:] none

@@ -60,5 +66,5 @@ the temperature is correctly normalized.

[Default:]

The option defaults are extra = 2 or 3 for 2d or 3d systems and
dynamic = no.
The option defaults are extra/dof = 2 or 3 for 2d or 3d systems and
dynamic/dof = no.
+12 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ twojmax = band limit for bispectrum components (non-negative integer) :l
R_1, R_2,... = list of cutoff radii, one for each type (distance units) :l
w_1, w_2,... = list of neighbor weights, one for each type  :l
zero or more keyword/value pairs may be appended :l
keyword = {diagonal} or {rmin0} or {switchflag} :l
keyword = {diagonal} or {rmin0} or {switchflag} or {bzeroflag} :l
  {diagonal} value = {0} or {1} or {2} or {3}
     {0} = all j1, j2, j <= twojmax, j2 <= j1
     {1} = subset satisfying j1 == j2
@@ -33,7 +33,10 @@ keyword = {diagonal} or {rmin0} or {switchflag} :l
  {rmin0} value = parameter in distance to angle conversion (distance units)
  {switchflag} value = {0} or {1}
     {0} = do not use switching function
     {1} = use switching function :pre
     {1} = use switching function
  {bzeroflag} value = {0} or {1}
     {0} = do not subtract B0
     {1} = subtract B0 :pre
:ule

[Examples:]
@@ -153,6 +156,12 @@ ordered in which they are listed
The keyword {switchflag} can be used to turn off the switching
function.

The keyword {bzeroflag} determines whether or not {B0}, the bispectrum
components of an atom with no neighbors, are subtracted from
the calculated bispectrum components. This optional keyword is only
available for compute {sna/atom}, as {snad/atom} and {snav/atom}
are unaffected by the removal of constant terms.

NOTE: If you have a bonded system, then the settings of
"special_bonds"_special_bonds.html command can remove pairwise
interactions between atoms in the same bond, angle, or dihedral.  This
@@ -222,7 +231,7 @@ LAMMPS"_Section_start.html#start_3 section for more info.
[Default:]

The optional keyword defaults are {diagonal} = 0, {rmin0} = 0,
{switchflag} = 1.
{switchflag} = 1, {bzeroflag} = 0.

:line

+6 −0
Original line number Diff line number Diff line
@@ -150,6 +150,12 @@ treated as rigid bodies, use the {rigid} keyword, specifying as its
value the ID of a separate "fix rigid/small"_fix_rigid.html
command which also appears in your input script.

NOTE: If you wish the new rigid molecules (and other rigid molecules)
to be thermostatted correctly via "fix rigid/small/nvt"_fix_rigid.html
or "fix rigid/small/npt"_fix_rigid.html, then you need to use the
"fix_modify dynamic/dof yes" command for the rigid fix.  This is to
inform that fix that the molecule count will vary dynamically.

If you wish to insert molecules via the {mol} keyword, that will have
their bonds or angles constrained via SHAKE, use the {shake} keyword,
specifying as its value the ID of a separate "fix
Loading