Permalink
Browse files

Merge branch 'python' into observable

  • Loading branch information...
fweik committed Nov 14, 2017
2 parents 3f47046 + b6fa6a9 commit c28e9ca94dec9c8434741101b5e735f03f0b599d
View
@@ -1,20 +1,12 @@
#cmakedefine ARPACK
// This file must not contain a "#pragma once" or header guards because src/core/config-features.hpp
// (generated by ../src/core/gen_featureconfig.py) includes it multiple times.
#cmakedefine CUDA
#cmakedefine FFTW
#cmakedefine H5MD
#cmakedefine TCL
#cmakedefine TK
#cmakedefine HAVE_CXX11
#cmakedefine HAVE_MPI
#cmakedefine SCAFACOS
#cmakedefine VALGRIND_INSTRUMENTATION
View
@@ -29,13 +29,6 @@
the documentation of the features.
*/
#ifdef HAVE_CONFIG_H
/* Include the defines created by configure. */
#include <acconfig.hpp>
#else
#include <cmake_config.hpp>
#endif
/* Prevent C++ bindings in MPI (there is a DataType called LB in there) */
#define OMPI_SKIP_MPICXX
#define MPICH_SKIP_MPICXX
@@ -50,10 +50,34 @@
#ifndef _FEATURECONFIG_HPP
#define _FEATURECONFIG_HPP
#include <cmake_config.hpp>
#include "myconfig-final.hpp"
#undef CUDA
#undef FFTW
#undef H5MD
#undef SCAFACOS
// these undefs need to match the externals in ../features.def
""" % (sys.argv[0], time.asctime()))
# guards for externals
hfile.write('/* Guards for externals */')
external_template = string.Template("""
// $feature is external
#if defined($feature)
#error $feature is external and can not be user-defined
#endif
""")
for feature in defs.externals:
hfile.write(external_template.substitute(feature=feature))
# Include definitions from CMake
hfile.write("""
/* Definitions from CMake */
#include <cmake_config.hpp>
""")
# handle implications
hfile.write('/* Handle implications */')
implication_template = string.Template("""
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:
@@ -1888,7 +1888,7 @@ cdef class ParticleList(object):
for p in self:
for t in types:
if (p.type == t or t == "all"):
vtk.write("{} {} {}\n".format(*(p.pos % box_l)))
vtk.write("{} {} {}\n".format(*(p.pos_folded)))
vtk.write("POINT_DATA {}\n".format(n))
vtk.write("SCALARS velocity float 3\n")
@@ -551,6 +551,10 @@ cdef class reaction_ensemble(object):
#//////////////////////////constant pH ensemble
property constant_pH:
"""
Sets the input pH for the constant pH ensemble method.
"""
def __set__(self, double pH):
"""
Sets the pH that the method assumes for the implicit pH bath.
View
@@ -94,6 +94,10 @@ python_test(FILE auto_exclusions.py MAX_NUM_PROC 1)
python_test(FILE subt_lj.py MAX_NUM_PROC 2)
python_test(FILE observable_cylindricalfluxdensity.py MAX_NUM_PROC 4)
python_test(FILE unravel_index.py MAX_NUM_PROC 4)
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)
if(PY_H5PY)
python_test(FILE h5md.py MAX_NUM_PROC 2)
@@ -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
Oops, something went wrong.

0 comments on commit c28e9ca

Please sign in to comment.