Permalink
Browse files

Merged branch espressomd/python into npt_test.

  • Loading branch information...
KaiSzuttor committed Nov 14, 2017
2 parents 766be83 + b6fa6a9 commit 4f34e1dd786dae188dba95213536e462cfb7de44
View
@@ -118,12 +118,6 @@ void pressure_calc(double *result, double *result_t, double *result_nb, double *
});
/* rescale kinetic energy (=ideal contribution) */
#ifdef ROTATION_PER_PARTICLE
fprintf(stderr, "Switching rotation per particle (#define "
"ROTATION_PER_PARTICLE) and pressure calculation are "
"incompatible.\n");
#endif
virials.data.e[0] /= (3.0*volume*time_step*time_step);
calc_long_range_virials();
@@ -124,10 +124,10 @@ class Analysis(object):
"""
if id == None and pos == None:
if id is None and pos is None:
raise Exception("Either id or pos have to be specified\n" + __doc__)
if id != None and pos != None:
if (id is not None) and (pos is not None):
raise Exception("Only one of id or pos may be specified\n" + __doc__)
cdef double cpos[3]
@@ -136,7 +136,7 @@ class Analysis(object):
# Get position
# If particle id specified
if id != None:
if id is not None:
if not isinstance(id, int):
raise ValueError("Id has to be an integer")
if not id in self._system.part[:].id:
View
@@ -92,6 +92,10 @@ python_test(FILE lj.py MAX_NUM_PROC 4)
python_test(FILE pairs.py MAX_NUM_PROC 4)
python_test(FILE auto_exclusions.py MAX_NUM_PROC 1)
python_test(FILE subt_lj.py MAX_NUM_PROC 2)
python_test(FILE analyze_chains.py MAX_NUM_PROC 1)
python_test(FILE analyze_distance.py MAX_NUM_PROC 1)
python_test(FILE comfixed.py MAX_NUM_PROC 2)
python_test(FILE rescale.py MAX_NUM_PROC 2)
python_test(FILE npt.py MAX_NUM_PROC 4)
if(PY_H5PY)
@@ -85,7 +85,7 @@ def calc_chain_rdf(self,bins):
data_cm=[]
data_min=[]
data_mono=[]
i=np.arange(self.num_mono*self.num_mono)/self.num_mono
i=np.arange(self.num_mono*self.num_mono)//self.num_mono
j=np.arange(self.num_mono*self.num_mono)%self.num_mono
for p1 in range(self.num_poly):
for p2 in range(p1):
@@ -23,16 +23,16 @@ def setUpClass(self):
self.system.thermostat.set_langevin(kT=1., gamma=1.)
for i in range(100):
self.system.part.add(id=i, pos=np.random.random(3) * box_l)
self.system.non_bonded_inter.set_force_cap(10)
self.system.force_cap = 10
i = 0
min_dist = self.system.analysis.mindist()
while (i < 50 and min_dist < 0.9):
system.integrator.run(100)
min_dist = self.system.analysis.mindist()
i += 1
lj_cap = lj_cap + 10
self.system.non_bonded_inter.set_force_cap(lj_cap)
self.system.non_bonded_inter.set_force_cap(0)
self.system.force_cap = lj_cap
self.system.force_cap = 0
self.system.integrator.run(1000)
# python version of the espresso core function

0 comments on commit 4f34e1d

Please sign in to comment.