GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.lammps.org — 2.3.7. Per-atom properties — LAMMPS documentation 2.3.7. Per-atom propertiesSimilar to what is described in Per-atom properties, the instances of
In some cases the data returned is a direct reference to the original data
inside LAMMPS cast to Warning When accessing per-atom data, please note that this data is the per-processor local data and indexed accordingly. These arrays can change sizes and order at every neighbor list rebuild and atom sort event as atoms are migrating between subdomains. from lammps import lammps lmp = lammps() lmp.file("in.sysinit") # Read/Write access via ctypes nlocal = lmp.extract_global("nlocal") x = lmp.extract_atom("x") for i in range(nlocal): print("(x,y,z) = (", x[i][0], x[i][1], x[i][2], ")") # Read/Write access via NumPy arrays atom_id = L.numpy.extract_atom("id") atom_type = L.numpy.extract_atom("type") x = L.numpy.extract_atom("x") v = L.numpy.extract_atom("v") f = L.numpy.extract_atom("f") # set position in 2D simulation x[0] = (1.0, 0.0) # set position in 3D simulation x[0] = (1.0, 0.0, 1.) lmp.close() Methods:
Numpy Methods:
|
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |