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. owned by different processors.
Note that the data returned by the gather methods, Note that the data returned by the gather methods,
e.g. :code:`gather_atoms("x")`, is different from the data structure returned e.g. :py:meth:`gather_atoms("x") <lammps.lammps.gather_atoms()>`, is
by :code:`extract_atom("x")` in four ways. (1) :code:`gather_atoms()` returns a different from the data structure returned by
vector which you index as x[i]; :code:`extract_atom()` returns an array :py:meth:`extract_atom("x") <lammps.lammps.extract_atom()>` in four ways.
which you index as x[i][j]. (2) :code:`gather_atoms()` orders the atoms (1) :code:`gather_atoms()` returns a vector which you index as x[i];
by atom ID while :code:`extract_atom()` does not. (3) :code:`gather_atoms()` returns :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 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()` the atoms local to each processor. (4) Finally, the :code:`gather_atoms()`
data structure is a copy of the atom coords stored internally in 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 points directly to the internal data. This means you can change
values inside LAMMPS from Python by assigning a new values to the 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 :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()` need to change values in the vector, then invoke the
method. :py:meth:`scatter_atoms("x") <lammps.lammps.scatter_atoms()>` method.
For the scatter methods, the array of coordinates passed to must be a For the scatter methods, the array of coordinates passed to must be a
ctypes vector of ints or doubles, allocated and initialized something ctypes vector of ints or doubles, allocated and initialized something