Adding py links to python scatter

This commit is contained in:
jtclemm
2024-08-14 10:41:08 -06:00
parent 3c0397f8b9
commit ffeb74c05f

View File

@ -23,11 +23,13 @@ passed by all calling processors, to individual atoms, which may be
owned by different processors.
Note that the data returned by the gather methods,
e.g. :code:`gather_atoms("x")`, is different from the data structure returned
by :code:`extract_atom("x")` in four ways. (1) :code:`gather_atoms()` returns a
vector which you index as x[i]; :code:`extract_atom()` returns an array
which you index as x[i][j]. (2) :code:`gather_atoms()` orders the atoms
by atom ID while :code:`extract_atom()` does not. (3) :code:`gather_atoms()` returns
e.g. :py:meth:`gather_atoms("x") <lammps.lammps.gather_atoms()>`, is
different from the data structure returned by
:py:meth:`extract_atom("x") <lammps.lammps.extract_atom()>` in four ways.
(1) :code:`gather_atoms()` returns a vector which you index as x[i];
:code:`extract_atom()` returns an array which you index as x[i][j].
(2) :code:`gather_atoms()` orders the atoms by atom ID while
:code:`extract_atom()` does not. (3) :code:`gather_atoms()` returns
a list of all atoms in the simulation; :code:`extract_atoms()` returns just
the atoms local to each processor. (4) Finally, the :code:`gather_atoms()`
data structure is a copy of the atom coords stored internally in
@ -35,8 +37,8 @@ LAMMPS, whereas :code:`extract_atom()` returns an array that effectively
points directly to the internal data. This means you can change
values inside LAMMPS from Python by assigning a new values to the
:code:`extract_atom()` array. To do this with the :code:`gather_atoms()` vector, you
need to change values in the vector, then invoke the :code:`scatter_atoms()`
method.
need to change values in the vector, then invoke the
:py:meth:`scatter_atoms("x") <lammps.lammps.scatter_atoms()>` method.
For the scatter methods, the array of coordinates passed to must be a
ctypes vector of ints or doubles, allocated and initialized something