From ffeb74c05f57e0e670c28f1d00d1366995f23a21 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 14 Aug 2024 10:41:08 -0600 Subject: [PATCH] Adding py links to python scatter --- doc/src/Python_scatter.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/src/Python_scatter.rst b/doc/src/Python_scatter.rst index 5db4b5329c..da045d7b6b 100644 --- a/doc/src/Python_scatter.rst +++ b/doc/src/Python_scatter.rst @@ -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") `, is +different from the data structure returned by +:py:meth:`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 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") ` method. For the scatter methods, the array of coordinates passed to must be a ctypes vector of ints or doubles, allocated and initialized something