In [1]:
#md.py
def class md(object):
__init__(self):
pass
In [2]:
#particle_interaction.py
from abc import ABCMeta, abstractmethod, abstractproperty
def class particle_interaction(md):
__metaclass__ =ABCMeta
#The parameter input is missing
@abstractmethod
def compute_potential(self):
pass
@abstractmethod
def compute_forces(self):
pass
#if we have some class properties, we can implement it like below
#@abstractproperty
#def get_anything(self):
@classmethod
def compute_total_forces(self):
coloumbforce=coloumb.compute_forces()
ljforce=lennard_jones.compute_forces()
return coloumbforce+ljforce
def class coloumb(particle_interaction):
def __init__(self):
md.__init__(self)
return
def compute_potential(self):
#do anything
return None
def __short_range_potential(self):
#do anything
#use from super the result of neighbourlist
return None
def __long_range_potential(self):
#do anything
return None
def compute_forces(self):
#compute forces
return None
def __short_range_forces(self):
#do anything
#use from super the result of neighbourlist
return None
def __long_range_forces(self):
#do anything
return None
def class lennard_jones(particle_interaction):
def __init__(self):
md.__init__(self)
return
def compute_potential(self):
#do anything
#use from super the result of neighbourlist
return None
def compute_forces(self):
#compute forces
#use from super the result of neighbourlist
return None
In [3]:
#neighbour_list.py
def class neighbourlist(md):
def __init__(self):
md.__init__(self)
return
def compute_neighbourlist(self):
#computeneighbourlist
return None
In [4]:
#dynamics.py
def class dynamics(md):
def __init__(self):
md.__init__(self)
return
def __velocity_verlet_integrator(self):
#do the integration
return None
def __Andersen_Thermostat(self):
#do the thermostat stuff
return None
def compute_dynamics(self):
#compute_total_forces
#__velocity_verlet_integrator
#__Andersen_Thermostat
return None
In [5]:
#distribution.py
from abc import ABCMeta, abstractmethod, abstractproperty
def class distribution(md):
__metaclass__ =ABCMeta
@abstractmethod
def sample_distribution(self):
pass
def class maxwellboltzmann(distribution):
def __init__(self):
md.__init__(self)
return
def generate_distribution(self):
#do anything
return None
def sample_distribution(self):
#do anything
return None
In [ ]: