implement numpy wrapper for setting per-atom energy. virial not yet implemented

This commit is contained in:
Axel Kohlmeyer
2021-07-22 16:59:04 -04:00
parent 324ae3181b
commit bf8bde5b03
4 changed files with 60 additions and 10 deletions

View File

@ -32,6 +32,13 @@ def callback_one(lmp, ntimestep, nlocal, tag, x, f):
lmp.fix_external_set_energy_peratom("ext",eatom)
lmp.fix_external_set_virial_peratom("ext",vatom)
#import numpy as np
#eng = np.array(eatom)
#vir = np.array(vatom)
#lmp.numpy.fix_external_set_energy_peratom("ext",eng)
#lmp.numpy.fix_external_set_virial_peratom("ext",vir) # not yet implemented
class PythonExternal(unittest.TestCase):
def testExternalCallback(self):
"""Test fix external from Python with pf/callback"""