Detect correct integer type in lammps python interface

This commit is contained in:
Richard Berger
2017-07-15 14:52:08 -05:00
parent b9fd1156b2
commit 93be2d264e
2 changed files with 40 additions and 17 deletions

View File

@ -4,9 +4,14 @@ import ctypes
import traceback
import numpy as np
class LAMMPSIntegrator(object):
def __init__(self, ptr):
class LAMMPSFix(object):
def __init__(self, ptr, group_name="all"):
self.lmp = lammps.lammps(ptr=ptr)
self.group_name = group_name
class LAMMPSIntegrator(LAMMPSFix):
def __init__(self, ptr, group_name="all"):
super(LAMMPSIntegrator, self).__init__(ptr, group_name)
def init(self):
pass
@ -29,8 +34,9 @@ class LAMMPSIntegrator(object):
class NVE(LAMMPSIntegrator):
""" Python implementation of fix/nve """
def __init__(self, ptr):
def __init__(self, ptr, group_name="all"):
super(NVE, self).__init__(ptr)
assert(self.group_name == "all")
def init(self):
dt = self.lmp.extract_global("dt", 1)
@ -66,8 +72,9 @@ class NVE(LAMMPSIntegrator):
class NVE_Opt(LAMMPSIntegrator):
""" Tuned Python implementation of fix/nve """
def __init__(self, ptr):
def __init__(self, ptr, group_name="all"):
super(NVE_Opt, self).__init__(ptr)
assert(self.group_name == "all")
def init(self):
dt = self.lmp.extract_global("dt", 1)