Merge pull request #2412 from lammps/progguide-updates
Updates to the Programmer Guide part of the Manual
This commit is contained in:
@ -32,8 +32,9 @@ def post_force_callback(lmp, v):
|
||||
t = L.extract_global("ntimestep", 0)
|
||||
print(pid_prefix, "### POST_FORCE ###", t)
|
||||
|
||||
#mylist = L.get_neighlist(0)
|
||||
mylist = L.find_pair_neighlist("lj/cut", request=0)
|
||||
#mylist = L.numpy.get_neighlist(0)
|
||||
idx = L.find_pair_neighlist("lj/cut", request=0)
|
||||
mylist = L.numpy.get_neighlist(idx)
|
||||
print(pid_prefix, mylist)
|
||||
nlocal = L.extract_global("nlocal")
|
||||
nghost = L.extract_global("nghost")
|
||||
@ -43,8 +44,8 @@ def post_force_callback(lmp, v):
|
||||
v = L.numpy.extract_atom("v", nelem=nlocal+nghost, dim=3)
|
||||
f = L.numpy.extract_atom("f", nelem=nlocal+nghost, dim=3)
|
||||
|
||||
for iatom, numneigh, neighs in mylist:
|
||||
print(pid_prefix, "- {}".format(iatom), x[iatom], v[iatom], f[iatom], " : ", numneigh, "Neighbors")
|
||||
for iatom, neighs in mylist:
|
||||
print(pid_prefix, "- {}".format(iatom), x[iatom], v[iatom], f[iatom], " : ", len(neighs), "Neighbors")
|
||||
for jatom in neighs:
|
||||
if jatom < nlocal:
|
||||
print(pid_prefix, " * ", jatom, x[jatom], v[jatom], f[jatom])
|
||||
|
||||
Reference in New Issue
Block a user