From fcecb08e5d5f4e6ffe7d2bb698c9e437ca3517cf Mon Sep 17 00:00:00 2001 From: arm61 Date: Thu, 7 Jun 2018 09:31:45 +0100 Subject: [PATCH] removal of 'xforce' and 'yforce' components of the numpy data type --- pylj/util.py | 3 +- src/_ccomp.cpp | 906 ++++++++++++++++++------------------------------- src/_ccomp.pyx | 10 +- src/comp.cpp | 7 +- src/comp.h | 2 +- 5 files changed, 344 insertions(+), 584 deletions(-) diff --git a/pylj/util.py b/pylj/util.py index 73afb32..e1f1dab 100644 --- a/pylj/util.py +++ b/pylj/util.py @@ -165,5 +165,4 @@ def particle_dt(): """ return np.dtype([('xposition', np.float64), ('yposition', np.float64), ('xvelocity', np.float64), ('yvelocity', np.float64), ('xacceleration', np.float64), ('yacceleration', np.float64), - ('xprevious_position', np.float64), ('yprevious_position', np.float64), ('xforce', np.float64), - ('yforce', np.float64), ('energy', np.float64)]) + ('xprevious_position', np.float64), ('yprevious_position', np.float64), ('energy', np.float64)]) diff --git a/src/_ccomp.cpp b/src/_ccomp.cpp index cec9fbf..9aea7de 100644 --- a/src/_ccomp.cpp +++ b/src/_ccomp.cpp @@ -1035,7 +1035,7 @@ typedef npy_double __pyx_t_5numpy_double_t; */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -/* "src/_ccomp.pyx":16 +/* "src/_ccomp.pyx":15 * * DTYPE = np.float64 * ctypedef np.float64_t DTYPE_t # <<<<<<<<<<<<<< @@ -1633,8 +1633,6 @@ static const char __pyx_k_range[] = "range"; static const char __pyx_k_zeros[] = "zeros"; static const char __pyx_k_forces[] = "forces"; static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_xforce[] = "xforce"; -static const char __pyx_k_yforce[] = "yforce"; static const char __pyx_k_average[] = "average"; static const char __pyx_k_float64[] = "float64"; static const char __pyx_k_pressure[] = "pressure"; @@ -1717,14 +1715,12 @@ static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_xacc; static PyObject *__pyx_n_s_xacceleration; -static PyObject *__pyx_n_s_xforce; static PyObject *__pyx_n_s_xpos; static PyObject *__pyx_n_s_xposition; static PyObject *__pyx_n_s_xvel; static PyObject *__pyx_n_s_xvelocity; static PyObject *__pyx_n_s_yacc; static PyObject *__pyx_n_s_yacceleration; -static PyObject *__pyx_n_s_yforce; static PyObject *__pyx_n_s_ypos; static PyObject *__pyx_n_s_yposition; static PyObject *__pyx_n_s_yvel; @@ -1752,7 +1748,7 @@ static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__15; /* Late includes */ -/* "src/_ccomp.pyx":18 +/* "src/_ccomp.pyx":17 * ctypedef np.float64_t DTYPE_t * * def compute_forces(particles, distances, forces, box_length): # <<<<<<<<<<<<<< @@ -1799,23 +1795,23 @@ static PyObject *__pyx_pw_4pylj_4comp_1compute_forces(PyObject *__pyx_self, PyOb case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_distances)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, 1); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, 1); __PYX_ERR(0, 17, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_forces)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, 2); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, 2); __PYX_ERR(0, 17, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box_length)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, 3); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, 3); __PYX_ERR(0, 17, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_forces") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_forces") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -1832,7 +1828,7 @@ static PyObject *__pyx_pw_4pylj_4comp_1compute_forces(PyObject *__pyx_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_forces", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pylj.comp.compute_forces", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1854,8 +1850,6 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p PyArrayObject *__pyx_v_yacc = 0; PyArrayObject *__pyx_v_distances_arr = 0; PyArrayObject *__pyx_v_force_arr = 0; - PyArrayObject *__pyx_v_xforce = 0; - PyArrayObject *__pyx_v_yforce = 0; long __pyx_v_i; __Pyx_LocalBuf_ND __pyx_pybuffernd_distances_arr; __Pyx_Buffer __pyx_pybuffer_distances_arr; @@ -1863,14 +1857,10 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __Pyx_Buffer __pyx_pybuffer_force_arr; __Pyx_LocalBuf_ND __pyx_pybuffernd_xacc; __Pyx_Buffer __pyx_pybuffer_xacc; - __Pyx_LocalBuf_ND __pyx_pybuffernd_xforce; - __Pyx_Buffer __pyx_pybuffer_xforce; __Pyx_LocalBuf_ND __pyx_pybuffernd_xpos; __Pyx_Buffer __pyx_pybuffer_xpos; __Pyx_LocalBuf_ND __pyx_pybuffernd_yacc; __Pyx_Buffer __pyx_pybuffer_yacc; - __Pyx_LocalBuf_ND __pyx_pybuffernd_yforce; - __Pyx_Buffer __pyx_pybuffer_yforce; __Pyx_LocalBuf_ND __pyx_pybuffernd_ypos; __Pyx_Buffer __pyx_pybuffer_ypos; PyObject *__pyx_r = NULL; @@ -1889,20 +1879,16 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p Py_ssize_t __pyx_t_12; PyArrayObject *__pyx_t_13 = NULL; PyArrayObject *__pyx_t_14 = NULL; - PyArrayObject *__pyx_t_15 = NULL; - PyArrayObject *__pyx_t_16 = NULL; - int __pyx_t_17; - long __pyx_t_18; - __pyx_t_4pylj_4comp_DTYPE_t __pyx_t_19; + int __pyx_t_15; + long __pyx_t_16; + __pyx_t_4pylj_4comp_DTYPE_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; Py_ssize_t __pyx_t_20; - int __pyx_t_21; + Py_ssize_t __pyx_t_21; Py_ssize_t __pyx_t_22; Py_ssize_t __pyx_t_23; Py_ssize_t __pyx_t_24; - Py_ssize_t __pyx_t_25; - Py_ssize_t __pyx_t_26; - Py_ssize_t __pyx_t_27; - Py_ssize_t __pyx_t_28; __Pyx_RefNannySetupContext("compute_forces", 0); __Pyx_INCREF(__pyx_v_distances); __Pyx_INCREF(__pyx_v_forces); @@ -1930,54 +1916,46 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_pybuffer_force_arr.refcount = 0; __pyx_pybuffernd_force_arr.data = NULL; __pyx_pybuffernd_force_arr.rcbuffer = &__pyx_pybuffer_force_arr; - __pyx_pybuffer_xforce.pybuffer.buf = NULL; - __pyx_pybuffer_xforce.refcount = 0; - __pyx_pybuffernd_xforce.data = NULL; - __pyx_pybuffernd_xforce.rcbuffer = &__pyx_pybuffer_xforce; - __pyx_pybuffer_yforce.pybuffer.buf = NULL; - __pyx_pybuffer_yforce.refcount = 0; - __pyx_pybuffernd_yforce.data = NULL; - __pyx_pybuffernd_yforce.rcbuffer = &__pyx_pybuffer_yforce; - /* "src/_ccomp.pyx":45 + /* "src/_ccomp.pyx":44 * Current forces between pairs of particles in the simulation. * """ * cdef int len_particles = particles['xposition'].size # <<<<<<<<<<<<<< * cdef double box_l = box_length * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(len_particles) */ - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_len_particles = __pyx_t_3; - /* "src/_ccomp.pyx":46 + /* "src/_ccomp.pyx":45 * """ * cdef int len_particles = particles['xposition'].size * cdef double box_l = box_length # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(len_particles) */ - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_box_length); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_box_length); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __pyx_v_box_l = __pyx_t_4; - /* "src/_ccomp.pyx":47 + /* "src/_ccomp.pyx":46 * cdef int len_particles = particles['xposition'].size * cdef double box_l = box_length * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(len_particles) # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] xacc = np.zeros(len_particles) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -1990,14 +1968,14 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p } } if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2006,32 +1984,32 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 47, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xpos.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_xpos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xpos.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 47, __pyx_L1_error) + __PYX_ERR(0, 46, __pyx_L1_error) } else {__pyx_pybuffernd_xpos.diminfo[0].strides = __pyx_pybuffernd_xpos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xpos.diminfo[0].shape = __pyx_pybuffernd_xpos.rcbuffer->pybuffer.shape[0]; } } @@ -2039,19 +2017,19 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_v_xpos = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":48 + /* "src/_ccomp.pyx":47 * cdef double box_l = box_length * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(len_particles) # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] xacc = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] yacc = np.zeros(len_particles) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { @@ -2064,14 +2042,14 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p } } if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -2080,32 +2058,32 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 48, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_t_9 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ypos.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ypos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ypos.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 48, __pyx_L1_error) + __PYX_ERR(0, 47, __pyx_L1_error) } else {__pyx_pybuffernd_ypos.diminfo[0].strides = __pyx_pybuffernd_ypos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ypos.diminfo[0].shape = __pyx_pybuffernd_ypos.rcbuffer->pybuffer.shape[0]; } } @@ -2113,19 +2091,19 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_v_ypos = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":49 + /* "src/_ccomp.pyx":48 * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] xacc = np.zeros(len_particles) # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] yacc = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] distances_arr = np.zeros(len(distances)) */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -2138,14 +2116,14 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -2154,32 +2132,32 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 49, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 48, __pyx_L1_error) __pyx_t_10 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xacc.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_xacc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xacc.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 49, __pyx_L1_error) + __PYX_ERR(0, 48, __pyx_L1_error) } else {__pyx_pybuffernd_xacc.diminfo[0].strides = __pyx_pybuffernd_xacc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xacc.diminfo[0].shape = __pyx_pybuffernd_xacc.rcbuffer->pybuffer.shape[0]; } } @@ -2187,19 +2165,19 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_v_xacc = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":50 + /* "src/_ccomp.pyx":49 * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] xacc = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] yacc = np.zeros(len_particles) # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] distances_arr = np.zeros(len(distances)) * cdef np.ndarray[DTYPE_t, ndim=1] force_arr = np.zeros(len(distances)) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -2212,14 +2190,14 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p } } if (!__pyx_t_7) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -2228,32 +2206,32 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 50, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 49, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yacc.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_yacc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_yacc.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 50, __pyx_L1_error) + __PYX_ERR(0, 49, __pyx_L1_error) } else {__pyx_pybuffernd_yacc.diminfo[0].strides = __pyx_pybuffernd_yacc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yacc.diminfo[0].shape = __pyx_pybuffernd_yacc.rcbuffer->pybuffer.shape[0]; } } @@ -2261,20 +2239,20 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_v_yacc = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":51 + /* "src/_ccomp.pyx":50 * cdef np.ndarray[DTYPE_t, ndim=1] xacc = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] yacc = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] distances_arr = np.zeros(len(distances)) # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] force_arr = np.zeros(len(distances)) - * cdef np.ndarray[DTYPE_t, ndim=1] xforce = np.zeros(len_particles) + * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = PyObject_Length(__pyx_v_distances); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 51, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_distances); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -2287,14 +2265,14 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p } } if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2303,32 +2281,32 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 51, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 50, __pyx_L1_error) __pyx_t_13 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_distances_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_distances_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_distances_arr.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 51, __pyx_L1_error) + __PYX_ERR(0, 50, __pyx_L1_error) } else {__pyx_pybuffernd_distances_arr.diminfo[0].strides = __pyx_pybuffernd_distances_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_distances_arr.diminfo[0].shape = __pyx_pybuffernd_distances_arr.rcbuffer->pybuffer.shape[0]; } } @@ -2336,20 +2314,20 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_v_distances_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":52 + /* "src/_ccomp.pyx":51 * cdef np.ndarray[DTYPE_t, ndim=1] yacc = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] distances_arr = np.zeros(len(distances)) * cdef np.ndarray[DTYPE_t, ndim=1] force_arr = np.zeros(len(distances)) # <<<<<<<<<<<<<< - * cdef np.ndarray[DTYPE_t, ndim=1] xforce = np.zeros(len_particles) - * cdef np.ndarray[DTYPE_t, ndim=1] yforce = np.zeros(len_particles) + * + * for i in range(0, len_particles): */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_12 = PyObject_Length(__pyx_v_distances); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 52, __pyx_L1_error) - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_distances); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { @@ -2362,14 +2340,14 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p } } if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -2378,32 +2356,32 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 52, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_t_14 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_force_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_force_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_force_arr.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 52, __pyx_L1_error) + __PYX_ERR(0, 51, __pyx_L1_error) } else {__pyx_pybuffernd_force_arr.diminfo[0].strides = __pyx_pybuffernd_force_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_force_arr.diminfo[0].shape = __pyx_pybuffernd_force_arr.rcbuffer->pybuffer.shape[0]; } } @@ -2412,380 +2390,182 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_t_2 = 0; /* "src/_ccomp.pyx":53 - * cdef np.ndarray[DTYPE_t, ndim=1] distances_arr = np.zeros(len(distances)) * cdef np.ndarray[DTYPE_t, ndim=1] force_arr = np.zeros(len(distances)) - * cdef np.ndarray[DTYPE_t, ndim=1] xforce = np.zeros(len_particles) # <<<<<<<<<<<<<< - * cdef np.ndarray[DTYPE_t, ndim=1] yforce = np.zeros(len_particles) - * - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { - PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } else - #endif - { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 53, __pyx_L1_error) - __pyx_t_15 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xforce.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_xforce = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xforce.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 53, __pyx_L1_error) - } else {__pyx_pybuffernd_xforce.diminfo[0].strides = __pyx_pybuffernd_xforce.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xforce.diminfo[0].shape = __pyx_pybuffernd_xforce.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_15 = 0; - __pyx_v_xforce = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "src/_ccomp.pyx":54 - * cdef np.ndarray[DTYPE_t, ndim=1] force_arr = np.zeros(len(distances)) - * cdef np.ndarray[DTYPE_t, ndim=1] xforce = np.zeros(len_particles) - * cdef np.ndarray[DTYPE_t, ndim=1] yforce = np.zeros(len_particles) # <<<<<<<<<<<<<< - * - * for i in range(0, len_particles): - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_7) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_t_16 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yforce.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { - __pyx_v_yforce = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_yforce.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 54, __pyx_L1_error) - } else {__pyx_pybuffernd_yforce.diminfo[0].strides = __pyx_pybuffernd_yforce.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yforce.diminfo[0].shape = __pyx_pybuffernd_yforce.rcbuffer->pybuffer.shape[0]; - } - } - __pyx_t_16 = 0; - __pyx_v_yforce = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "src/_ccomp.pyx":56 - * cdef np.ndarray[DTYPE_t, ndim=1] yforce = np.zeros(len_particles) * * for i in range(0, len_particles): # <<<<<<<<<<<<<< * xpos[i] = particles['xposition'][i] * ypos[i] = particles['yposition'][i] */ __pyx_t_3 = __pyx_v_len_particles; - __pyx_t_17 = __pyx_t_3; - for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { - __pyx_v_i = __pyx_t_18; + __pyx_t_15 = __pyx_t_3; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; - /* "src/_ccomp.pyx":57 + /* "src/_ccomp.pyx":54 * * for i in range(0, len_particles): * xpos[i] = particles['xposition'][i] # <<<<<<<<<<<<<< * ypos[i] = particles['yposition'][i] * xacc[i] = 0 */ - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_20 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_20 < 0) { - __pyx_t_20 += __pyx_pybuffernd_xpos.diminfo[0].shape; - if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_xpos.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_17 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_pybuffernd_xpos.diminfo[0].shape; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_xpos.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + __PYX_ERR(0, 54, __pyx_L1_error) } - *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xpos.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_xpos.diminfo[0].strides) = __pyx_t_19; + *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xpos.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_xpos.diminfo[0].strides) = __pyx_t_17; - /* "src/_ccomp.pyx":58 + /* "src/_ccomp.pyx":55 * for i in range(0, len_particles): * xpos[i] = particles['xposition'][i] * ypos[i] = particles['yposition'][i] # <<<<<<<<<<<<<< * xacc[i] = 0 * yacc[i] = 0 */ - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yposition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yposition); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_17 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_22 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_22 < 0) { - __pyx_t_22 += __pyx_pybuffernd_ypos.diminfo[0].shape; - if (unlikely(__pyx_t_22 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ypos.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_20 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_pybuffernd_ypos.diminfo[0].shape; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ypos.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + __PYX_ERR(0, 55, __pyx_L1_error) } - *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_ypos.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ypos.diminfo[0].strides) = __pyx_t_19; + *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_ypos.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ypos.diminfo[0].strides) = __pyx_t_17; - /* "src/_ccomp.pyx":59 + /* "src/_ccomp.pyx":56 * xpos[i] = particles['xposition'][i] * ypos[i] = particles['yposition'][i] * xacc[i] = 0 # <<<<<<<<<<<<<< * yacc[i] = 0 * */ - __pyx_t_23 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_23 < 0) { - __pyx_t_23 += __pyx_pybuffernd_xacc.diminfo[0].shape; - if (unlikely(__pyx_t_23 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_xacc.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_21 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_21 < 0) { + __pyx_t_21 += __pyx_pybuffernd_xacc.diminfo[0].shape; + if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_xacc.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + __PYX_ERR(0, 56, __pyx_L1_error) } - *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xacc.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_xacc.diminfo[0].strides) = 0.0; + *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xacc.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_xacc.diminfo[0].strides) = 0.0; - /* "src/_ccomp.pyx":60 + /* "src/_ccomp.pyx":57 * ypos[i] = particles['yposition'][i] * xacc[i] = 0 * yacc[i] = 0 # <<<<<<<<<<<<<< * * compute_accelerations(len_particles, xpos.data, ypos.data, xacc.data, */ - __pyx_t_24 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_pybuffernd_yacc.diminfo[0].shape; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_yacc.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_22 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_yacc.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_yacc.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + __PYX_ERR(0, 57, __pyx_L1_error) } - *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yacc.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_yacc.diminfo[0].strides) = 0.0; + *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yacc.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_yacc.diminfo[0].strides) = 0.0; } - /* "src/_ccomp.pyx":62 + /* "src/_ccomp.pyx":59 * yacc[i] = 0 * * compute_accelerations(len_particles, xpos.data, ypos.data, xacc.data, # <<<<<<<<<<<<<< - * yacc.data, distances_arr.data, xforce.data, yforce.data, - * box_l, force_arr.data) + * yacc.data, distances_arr.data, box_l, force_arr.data) + * */ - compute_accelerations(__pyx_v_len_particles, ((double const *)__pyx_v_xpos->data), ((double const *)__pyx_v_ypos->data), ((double *)__pyx_v_xacc->data), ((double *)__pyx_v_yacc->data), ((double *)__pyx_v_distances_arr->data), ((double *)__pyx_v_xforce->data), ((double *)__pyx_v_yforce->data), __pyx_v_box_l, ((double *)__pyx_v_force_arr->data)); + compute_accelerations(__pyx_v_len_particles, ((double const *)__pyx_v_xpos->data), ((double const *)__pyx_v_ypos->data), ((double *)__pyx_v_xacc->data), ((double *)__pyx_v_yacc->data), ((double *)__pyx_v_distances_arr->data), __pyx_v_box_l, ((double *)__pyx_v_force_arr->data)); - /* "src/_ccomp.pyx":66 - * box_l, force_arr.data) + /* "src/_ccomp.pyx":62 + * yacc.data, distances_arr.data, box_l, force_arr.data) * * for i in range(0, len_particles): # <<<<<<<<<<<<<< * particles['xacceleration'][i] = xacc[i] * particles['yacceleration'][i] = yacc[i] */ __pyx_t_3 = __pyx_v_len_particles; - __pyx_t_17 = __pyx_t_3; - for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { - __pyx_v_i = __pyx_t_18; + __pyx_t_15 = __pyx_t_3; + for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + __pyx_v_i = __pyx_t_16; - /* "src/_ccomp.pyx":67 + /* "src/_ccomp.pyx":63 * * for i in range(0, len_particles): * particles['xacceleration'][i] = xacc[i] # <<<<<<<<<<<<<< * particles['yacceleration'][i] = yacc[i] - * particles['xforce'][i] = xforce[i] - */ - __pyx_t_25 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_pybuffernd_xacc.diminfo[0].shape; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_xacc.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 67, __pyx_L1_error) - } - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xacc.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_xacc.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xacceleration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 67, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "src/_ccomp.pyx":68 - * for i in range(0, len_particles): - * particles['xacceleration'][i] = xacc[i] - * particles['yacceleration'][i] = yacc[i] # <<<<<<<<<<<<<< - * particles['xforce'][i] = xforce[i] - * particles['yforce'][i] = yforce[i] - */ - __pyx_t_26 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_pybuffernd_yacc.diminfo[0].shape; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_yacc.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 68, __pyx_L1_error) - } - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yacc.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_yacc.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yacceleration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "src/_ccomp.pyx":69 - * particles['xacceleration'][i] = xacc[i] - * particles['yacceleration'][i] = yacc[i] - * particles['xforce'][i] = xforce[i] # <<<<<<<<<<<<<< - * particles['yforce'][i] = yforce[i] * */ - __pyx_t_27 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_27 < 0) { - __pyx_t_27 += __pyx_pybuffernd_xforce.diminfo[0].shape; - if (unlikely(__pyx_t_27 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_xforce.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_23 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_xacc.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_xacc.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + __PYX_ERR(0, 63, __pyx_L1_error) } - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xforce.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_xforce.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xacc.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_xacc.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xforce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xacceleration); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":70 - * particles['yacceleration'][i] = yacc[i] - * particles['xforce'][i] = xforce[i] - * particles['yforce'][i] = yforce[i] # <<<<<<<<<<<<<< + /* "src/_ccomp.pyx":64 + * for i in range(0, len_particles): + * particles['xacceleration'][i] = xacc[i] + * particles['yacceleration'][i] = yacc[i] # <<<<<<<<<<<<<< * * distances = distances_arr */ - __pyx_t_28 = __pyx_v_i; - __pyx_t_21 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_pybuffernd_yforce.diminfo[0].shape; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_yforce.diminfo[0].shape)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - __PYX_ERR(0, 70, __pyx_L1_error) - } - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yforce.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_yforce.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_24 = __pyx_v_i; + __pyx_t_19 = -1; + if (__pyx_t_24 < 0) { + __pyx_t_24 += __pyx_pybuffernd_yacc.diminfo[0].shape; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_yacc.diminfo[0].shape)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + __PYX_ERR(0, 64, __pyx_L1_error) + } + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yacc.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_yacc.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yforce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yacceleration); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "src/_ccomp.pyx":72 - * particles['yforce'][i] = yforce[i] + /* "src/_ccomp.pyx":66 + * particles['yacceleration'][i] = yacc[i] * * distances = distances_arr # <<<<<<<<<<<<<< * forces = force_arr @@ -2794,7 +2574,7 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(((PyObject *)__pyx_v_distances_arr)); __Pyx_DECREF_SET(__pyx_v_distances, ((PyObject *)__pyx_v_distances_arr)); - /* "src/_ccomp.pyx":73 + /* "src/_ccomp.pyx":67 * * distances = distances_arr * forces = force_arr # <<<<<<<<<<<<<< @@ -2804,7 +2584,7 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(((PyObject *)__pyx_v_force_arr)); __Pyx_DECREF_SET(__pyx_v_forces, ((PyObject *)__pyx_v_force_arr)); - /* "src/_ccomp.pyx":75 + /* "src/_ccomp.pyx":69 * forces = force_arr * * return particles, distances, forces # <<<<<<<<<<<<<< @@ -2812,7 +2592,7 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p * def calculate_pressure(particles, box_length, temperature): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_particles); __Pyx_GIVEREF(__pyx_v_particles); @@ -2827,7 +2607,7 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __pyx_t_2 = 0; goto __pyx_L0; - /* "src/_ccomp.pyx":18 + /* "src/_ccomp.pyx":17 * ctypedef np.float64_t DTYPE_t * * def compute_forces(particles, distances, forces, box_length): # <<<<<<<<<<<<<< @@ -2849,10 +2629,8 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_distances_arr.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_force_arr.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xacc.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xforce.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xpos.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yacc.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yforce.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ypos.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback("pylj.comp.compute_forces", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -2862,10 +2640,8 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_distances_arr.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_force_arr.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xacc.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xforce.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xpos.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yacc.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yforce.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ypos.rcbuffer->pybuffer); __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_xpos); @@ -2874,8 +2650,6 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF((PyObject *)__pyx_v_yacc); __Pyx_XDECREF((PyObject *)__pyx_v_distances_arr); __Pyx_XDECREF((PyObject *)__pyx_v_force_arr); - __Pyx_XDECREF((PyObject *)__pyx_v_xforce); - __Pyx_XDECREF((PyObject *)__pyx_v_yforce); __Pyx_XDECREF(__pyx_v_distances); __Pyx_XDECREF(__pyx_v_forces); __Pyx_XGIVEREF(__pyx_r); @@ -2883,7 +2657,7 @@ static PyObject *__pyx_pf_4pylj_4comp_compute_forces(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "src/_ccomp.pyx":77 +/* "src/_ccomp.pyx":71 * return particles, distances, forces * * def calculate_pressure(particles, box_length, temperature): # <<<<<<<<<<<<<< @@ -2927,17 +2701,17 @@ static PyObject *__pyx_pw_4pylj_4comp_3calculate_pressure(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box_length)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_pressure", 1, 3, 3, 1); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_pressure", 1, 3, 3, 1); __PYX_ERR(0, 71, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_temperature)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calculate_pressure", 1, 3, 3, 2); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_pressure", 1, 3, 3, 2); __PYX_ERR(0, 71, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_pressure") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_pressure") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -2952,7 +2726,7 @@ static PyObject *__pyx_pw_4pylj_4comp_3calculate_pressure(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_pressure", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_pressure", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 71, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pylj.comp.calculate_pressure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3004,35 +2778,35 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject __pyx_pybuffernd_ypos.data = NULL; __pyx_pybuffernd_ypos.rcbuffer = &__pyx_pybuffer_ypos; - /* "src/_ccomp.pyx":97 + /* "src/_ccomp.pyx":91 * Instantaneous pressure of the simulation. * """ * cdef int number_of_particles = particles['xposition'].size # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(number_of_particles) * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(number_of_particles) */ - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_number_of_particles = __pyx_t_3; - /* "src/_ccomp.pyx":98 + /* "src/_ccomp.pyx":92 * """ * cdef int number_of_particles = particles['xposition'].size * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(number_of_particles) # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(number_of_particles) * cdef double box_l = box_length */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_number_of_particles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_number_of_particles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -3045,14 +2819,14 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3061,32 +2835,32 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xpos.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_xpos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xpos.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 98, __pyx_L1_error) + __PYX_ERR(0, 92, __pyx_L1_error) } else {__pyx_pybuffernd_xpos.diminfo[0].strides = __pyx_pybuffernd_xpos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xpos.diminfo[0].shape = __pyx_pybuffernd_xpos.rcbuffer->pybuffer.shape[0]; } } @@ -3094,19 +2868,19 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject __pyx_v_xpos = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":99 + /* "src/_ccomp.pyx":93 * cdef int number_of_particles = particles['xposition'].size * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(number_of_particles) * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(number_of_particles) # <<<<<<<<<<<<<< * cdef double box_l = box_length * cdef double pressure = 0. */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_number_of_particles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_number_of_particles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -3119,14 +2893,14 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject } } if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3135,32 +2909,32 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 99, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 93, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ypos.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ypos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ypos.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 93, __pyx_L1_error) } else {__pyx_pybuffernd_ypos.diminfo[0].strides = __pyx_pybuffernd_ypos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ypos.diminfo[0].shape = __pyx_pybuffernd_ypos.rcbuffer->pybuffer.shape[0]; } } @@ -3168,17 +2942,17 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject __pyx_v_ypos = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":100 + /* "src/_ccomp.pyx":94 * cdef np.ndarray[DTYPE_t, ndim=1] xpos = np.zeros(number_of_particles) * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(number_of_particles) * cdef double box_l = box_length # <<<<<<<<<<<<<< * cdef double pressure = 0. * cdef double temp = temperature */ - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_box_length); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_box_length); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_v_box_l = __pyx_t_9; - /* "src/_ccomp.pyx":101 + /* "src/_ccomp.pyx":95 * cdef np.ndarray[DTYPE_t, ndim=1] ypos = np.zeros(number_of_particles) * cdef double box_l = box_length * cdef double pressure = 0. # <<<<<<<<<<<<<< @@ -3187,17 +2961,17 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject */ __pyx_v_pressure = 0.; - /* "src/_ccomp.pyx":102 + /* "src/_ccomp.pyx":96 * cdef double box_l = box_length * cdef double pressure = 0. * cdef double temp = temperature # <<<<<<<<<<<<<< * * for i in range(0, number_of_particles): */ - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_temperature); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_temperature); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_v_temp = __pyx_t_9; - /* "src/_ccomp.pyx":104 + /* "src/_ccomp.pyx":98 * cdef double temp = temperature * * for i in range(0, number_of_particles): # <<<<<<<<<<<<<< @@ -3209,19 +2983,19 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "src/_ccomp.pyx":105 + /* "src/_ccomp.pyx":99 * * for i in range(0, number_of_particles): * xpos[i] = particles['xposition'][i] # <<<<<<<<<<<<<< * ypos[i] = particles['yposition'][i] * */ - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __pyx_v_i; __pyx_t_14 = -1; @@ -3231,23 +3005,23 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_xpos.diminfo[0].shape)) __pyx_t_14 = 0; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_14); - __PYX_ERR(0, 105, __pyx_L1_error) + __PYX_ERR(0, 99, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xpos.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xpos.diminfo[0].strides) = __pyx_t_12; - /* "src/_ccomp.pyx":106 + /* "src/_ccomp.pyx":100 * for i in range(0, number_of_particles): * xpos[i] = particles['xposition'][i] * ypos[i] = particles['yposition'][i] # <<<<<<<<<<<<<< * * pressure = compute_pressure(number_of_particles, xpos.data, ypos.data, box_l, */ - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yposition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yposition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_15 = __pyx_v_i; __pyx_t_14 = -1; @@ -3257,21 +3031,21 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_ypos.diminfo[0].shape)) __pyx_t_14 = 0; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_14); - __PYX_ERR(0, 106, __pyx_L1_error) + __PYX_ERR(0, 100, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_ypos.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_ypos.diminfo[0].strides) = __pyx_t_12; } - /* "src/_ccomp.pyx":109 + /* "src/_ccomp.pyx":103 * * pressure = compute_pressure(number_of_particles, xpos.data, ypos.data, box_l, * temperature) # <<<<<<<<<<<<<< * * return pressure */ - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_temperature); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_temperature); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) - /* "src/_ccomp.pyx":108 + /* "src/_ccomp.pyx":102 * ypos[i] = particles['yposition'][i] * * pressure = compute_pressure(number_of_particles, xpos.data, ypos.data, box_l, # <<<<<<<<<<<<<< @@ -3280,7 +3054,7 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject */ __pyx_v_pressure = compute_pressure(__pyx_v_number_of_particles, ((double const *)__pyx_v_xpos->data), ((double const *)__pyx_v_ypos->data), __pyx_v_box_l, __pyx_t_9); - /* "src/_ccomp.pyx":111 + /* "src/_ccomp.pyx":105 * temperature) * * return pressure # <<<<<<<<<<<<<< @@ -3288,13 +3062,13 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject * def heat_bath(particles, temperature_sample, bath_temp): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pressure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pressure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/_ccomp.pyx":77 + /* "src/_ccomp.pyx":71 * return particles, distances, forces * * def calculate_pressure(particles, box_length, temperature): # <<<<<<<<<<<<<< @@ -3330,7 +3104,7 @@ static PyObject *__pyx_pf_4pylj_4comp_2calculate_pressure(CYTHON_UNUSED PyObject return __pyx_r; } -/* "src/_ccomp.pyx":113 +/* "src/_ccomp.pyx":107 * return pressure * * def heat_bath(particles, temperature_sample, bath_temp): # <<<<<<<<<<<<<< @@ -3374,17 +3148,17 @@ static PyObject *__pyx_pw_4pylj_4comp_5heat_bath(PyObject *__pyx_self, PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_temperature_sample)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("heat_bath", 1, 3, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("heat_bath", 1, 3, 3, 1); __PYX_ERR(0, 107, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bath_temp)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("heat_bath", 1, 3, 3, 2); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("heat_bath", 1, 3, 3, 2); __PYX_ERR(0, 107, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "heat_bath") < 0)) __PYX_ERR(0, 113, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "heat_bath") < 0)) __PYX_ERR(0, 107, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -3399,7 +3173,7 @@ static PyObject *__pyx_pw_4pylj_4comp_5heat_bath(PyObject *__pyx_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("heat_bath", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("heat_bath", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 107, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pylj.comp.heat_bath", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3452,35 +3226,35 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s __pyx_pybuffernd_yvel.data = NULL; __pyx_pybuffernd_yvel.rcbuffer = &__pyx_pybuffer_yvel; - /* "src/_ccomp.pyx":134 + /* "src/_ccomp.pyx":128 * Information about the particles with new, rescaled velocities. * """ * cdef int len_particles = particles['xposition'].size # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] xvel = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] yvel = np.zeros(len_particles) */ - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xposition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_len_particles = __pyx_t_3; - /* "src/_ccomp.pyx":135 + /* "src/_ccomp.pyx":129 * """ * cdef int len_particles = particles['xposition'].size * cdef np.ndarray[DTYPE_t, ndim=1] xvel = np.zeros(len_particles) # <<<<<<<<<<<<<< * cdef np.ndarray[DTYPE_t, ndim=1] yvel = np.zeros(len_particles) * cdef double average_temp = np.average(temperature_sample) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -3493,14 +3267,14 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3509,32 +3283,32 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 135, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xvel.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_xvel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xvel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 135, __pyx_L1_error) + __PYX_ERR(0, 129, __pyx_L1_error) } else {__pyx_pybuffernd_xvel.diminfo[0].strides = __pyx_pybuffernd_xvel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xvel.diminfo[0].shape = __pyx_pybuffernd_xvel.rcbuffer->pybuffer.shape[0]; } } @@ -3542,19 +3316,19 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_xvel = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":136 + /* "src/_ccomp.pyx":130 * cdef int len_particles = particles['xposition'].size * cdef np.ndarray[DTYPE_t, ndim=1] xvel = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] yvel = np.zeros(len_particles) # <<<<<<<<<<<<<< * cdef double average_temp = np.average(temperature_sample) * cdef double temperature = bath_temp */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_len_particles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -3567,14 +3341,14 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s } } if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3583,32 +3357,32 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 136, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yvel.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_4pylj_4comp_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_yvel = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_yvel.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 136, __pyx_L1_error) + __PYX_ERR(0, 130, __pyx_L1_error) } else {__pyx_pybuffernd_yvel.diminfo[0].strides = __pyx_pybuffernd_yvel.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yvel.diminfo[0].shape = __pyx_pybuffernd_yvel.rcbuffer->pybuffer.shape[0]; } } @@ -3616,16 +3390,16 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s __pyx_v_yvel = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":137 + /* "src/_ccomp.pyx":131 * cdef np.ndarray[DTYPE_t, ndim=1] xvel = np.zeros(len_particles) * cdef np.ndarray[DTYPE_t, ndim=1] yvel = np.zeros(len_particles) * cdef double average_temp = np.average(temperature_sample) # <<<<<<<<<<<<<< * cdef double temperature = bath_temp * */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_average); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_average); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -3639,13 +3413,13 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s } } if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_temperature_sample); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_temperature_sample); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_temperature_sample}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -3653,39 +3427,39 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_temperature_sample}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_temperature_sample); __Pyx_GIVEREF(__pyx_v_temperature_sample); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_temperature_sample); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_average_temp = __pyx_t_9; - /* "src/_ccomp.pyx":138 + /* "src/_ccomp.pyx":132 * cdef np.ndarray[DTYPE_t, ndim=1] yvel = np.zeros(len_particles) * cdef double average_temp = np.average(temperature_sample) * cdef double temperature = bath_temp # <<<<<<<<<<<<<< * * for i in range(0, len_particles): */ - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_bath_temp); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_bath_temp); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_v_temperature = __pyx_t_9; - /* "src/_ccomp.pyx":140 + /* "src/_ccomp.pyx":134 * cdef double temperature = bath_temp * * for i in range(0, len_particles): # <<<<<<<<<<<<<< @@ -3697,19 +3471,19 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "src/_ccomp.pyx":141 + /* "src/_ccomp.pyx":135 * * for i in range(0, len_particles): * xvel[i] = particles['xvelocity'][i] # <<<<<<<<<<<<<< * yvel[i] = particles['yvelocity'][i] * */ - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xvelocity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xvelocity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = __pyx_v_i; __pyx_t_14 = -1; @@ -3719,23 +3493,23 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_xvel.diminfo[0].shape)) __pyx_t_14 = 0; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_14); - __PYX_ERR(0, 141, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xvel.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xvel.diminfo[0].strides) = __pyx_t_12; - /* "src/_ccomp.pyx":142 + /* "src/_ccomp.pyx":136 * for i in range(0, len_particles): * xvel[i] = particles['xvelocity'][i] * yvel[i] = particles['yvelocity'][i] # <<<<<<<<<<<<<< * * scale_velocities(len_particles, xvel.data, yvel.data, average_temp, temperature) */ - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yvelocity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yvelocity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_15 = __pyx_v_i; __pyx_t_14 = -1; @@ -3745,12 +3519,12 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_yvel.diminfo[0].shape)) __pyx_t_14 = 0; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_14); - __PYX_ERR(0, 142, __pyx_L1_error) + __PYX_ERR(0, 136, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yvel.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yvel.diminfo[0].strides) = __pyx_t_12; } - /* "src/_ccomp.pyx":144 + /* "src/_ccomp.pyx":138 * yvel[i] = particles['yvelocity'][i] * * scale_velocities(len_particles, xvel.data, yvel.data, average_temp, temperature) # <<<<<<<<<<<<<< @@ -3759,7 +3533,7 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s */ scale_velocities(__pyx_v_len_particles, ((double *)__pyx_v_xvel->data), ((double *)__pyx_v_yvel->data), __pyx_v_average_temp, __pyx_v_temperature); - /* "src/_ccomp.pyx":146 + /* "src/_ccomp.pyx":140 * scale_velocities(len_particles, xvel.data, yvel.data, average_temp, temperature) * * for i in range(0, len_particles): # <<<<<<<<<<<<<< @@ -3771,7 +3545,7 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "src/_ccomp.pyx":147 + /* "src/_ccomp.pyx":141 * * for i in range(0, len_particles): * particles['xvelocity'][i] = xvel[i] # <<<<<<<<<<<<<< @@ -3786,17 +3560,17 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_xvel.diminfo[0].shape)) __pyx_t_14 = 0; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_14); - __PYX_ERR(0, 147, __pyx_L1_error) + __PYX_ERR(0, 141, __pyx_L1_error) } - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xvel.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_xvel.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_xvel.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_xvel.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xvelocity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_xvelocity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":148 + /* "src/_ccomp.pyx":142 * for i in range(0, len_particles): * particles['xvelocity'][i] = xvel[i] * particles['yvelocity'][i] = yvel[i] # <<<<<<<<<<<<<< @@ -3811,18 +3585,18 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_yvel.diminfo[0].shape)) __pyx_t_14 = 0; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_14); - __PYX_ERR(0, 148, __pyx_L1_error) + __PYX_ERR(0, 142, __pyx_L1_error) } - __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yvel.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_yvel.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4pylj_4comp_DTYPE_t *, __pyx_pybuffernd_yvel.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_yvel.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yvelocity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_particles, __pyx_n_s_yvelocity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 148, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_i, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "src/_ccomp.pyx":150 + /* "src/_ccomp.pyx":144 * particles['yvelocity'][i] = yvel[i] * * return particles # <<<<<<<<<<<<<< @@ -3832,7 +3606,7 @@ static PyObject *__pyx_pf_4pylj_4comp_4heat_bath(CYTHON_UNUSED PyObject *__pyx_s __pyx_r = __pyx_v_particles; goto __pyx_L0; - /* "src/_ccomp.pyx":113 + /* "src/_ccomp.pyx":107 * return pressure * * def heat_bath(particles, temperature_sample, bath_temp): # <<<<<<<<<<<<<< @@ -6412,14 +6186,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, {&__pyx_n_s_xacc, __pyx_k_xacc, sizeof(__pyx_k_xacc), 0, 0, 1, 1}, {&__pyx_n_s_xacceleration, __pyx_k_xacceleration, sizeof(__pyx_k_xacceleration), 0, 0, 1, 1}, - {&__pyx_n_s_xforce, __pyx_k_xforce, sizeof(__pyx_k_xforce), 0, 0, 1, 1}, {&__pyx_n_s_xpos, __pyx_k_xpos, sizeof(__pyx_k_xpos), 0, 0, 1, 1}, {&__pyx_n_s_xposition, __pyx_k_xposition, sizeof(__pyx_k_xposition), 0, 0, 1, 1}, {&__pyx_n_s_xvel, __pyx_k_xvel, sizeof(__pyx_k_xvel), 0, 0, 1, 1}, {&__pyx_n_s_xvelocity, __pyx_k_xvelocity, sizeof(__pyx_k_xvelocity), 0, 0, 1, 1}, {&__pyx_n_s_yacc, __pyx_k_yacc, sizeof(__pyx_k_yacc), 0, 0, 1, 1}, {&__pyx_n_s_yacceleration, __pyx_k_yacceleration, sizeof(__pyx_k_yacceleration), 0, 0, 1, 1}, - {&__pyx_n_s_yforce, __pyx_k_yforce, sizeof(__pyx_k_yforce), 0, 0, 1, 1}, {&__pyx_n_s_ypos, __pyx_k_ypos, sizeof(__pyx_k_ypos), 0, 0, 1, 1}, {&__pyx_n_s_yposition, __pyx_k_yposition, sizeof(__pyx_k_yposition), 0, 0, 1, 1}, {&__pyx_n_s_yvel, __pyx_k_yvel, sizeof(__pyx_k_yvel), 0, 0, 1, 1}, @@ -6428,7 +6200,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 229, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error) @@ -6538,41 +6310,41 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "src/_ccomp.pyx":18 + /* "src/_ccomp.pyx":17 * ctypedef np.float64_t DTYPE_t * * def compute_forces(particles, distances, forces, box_length): # <<<<<<<<<<<<<< * """Calculates the forces and therefore the accelerations on each of the particles in the simulation. This uses a * 12-6 Lennard-Jones potential model for Argon with values: */ - __pyx_tuple__10 = PyTuple_Pack(15, __pyx_n_s_particles, __pyx_n_s_distances, __pyx_n_s_forces, __pyx_n_s_box_length, __pyx_n_s_len_particles, __pyx_n_s_box_l, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_xacc, __pyx_n_s_yacc, __pyx_n_s_distances_arr, __pyx_n_s_force_arr, __pyx_n_s_xforce, __pyx_n_s_yforce, __pyx_n_s_i); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(13, __pyx_n_s_particles, __pyx_n_s_distances, __pyx_n_s_forces, __pyx_n_s_box_length, __pyx_n_s_len_particles, __pyx_n_s_box_l, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_xacc, __pyx_n_s_yacc, __pyx_n_s_distances_arr, __pyx_n_s_force_arr, __pyx_n_s_i); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__ccomp_pyx, __pyx_n_s_compute_forces, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__ccomp_pyx, __pyx_n_s_compute_forces, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 17, __pyx_L1_error) - /* "src/_ccomp.pyx":77 + /* "src/_ccomp.pyx":71 * return particles, distances, forces * * def calculate_pressure(particles, box_length, temperature): # <<<<<<<<<<<<<< * r"""Calculates the instantaneous pressure of the simulation cell, found with the following relationship: * */ - __pyx_tuple__12 = PyTuple_Pack(10, __pyx_n_s_particles, __pyx_n_s_box_length, __pyx_n_s_temperature, __pyx_n_s_number_of_particles, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_box_l, __pyx_n_s_pressure, __pyx_n_s_temp, __pyx_n_s_i); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(10, __pyx_n_s_particles, __pyx_n_s_box_length, __pyx_n_s_temperature, __pyx_n_s_number_of_particles, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_box_l, __pyx_n_s_pressure, __pyx_n_s_temp, __pyx_n_s_i); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__ccomp_pyx, __pyx_n_s_calculate_pressure, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__ccomp_pyx, __pyx_n_s_calculate_pressure, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 71, __pyx_L1_error) - /* "src/_ccomp.pyx":113 + /* "src/_ccomp.pyx":107 * return pressure * * def heat_bath(particles, temperature_sample, bath_temp): # <<<<<<<<<<<<<< * r"""Rescales the velocities of the particles in the system to control the temperature of the simulation. Thereby * allowing for an NVT ensemble. The velocities are rescaled according the following relationship, */ - __pyx_tuple__14 = PyTuple_Pack(9, __pyx_n_s_particles, __pyx_n_s_temperature_sample, __pyx_n_s_bath_temp, __pyx_n_s_len_particles, __pyx_n_s_xvel, __pyx_n_s_yvel, __pyx_n_s_average_temp, __pyx_n_s_temperature, __pyx_n_s_i); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(9, __pyx_n_s_particles, __pyx_n_s_temperature_sample, __pyx_n_s_bath_temp, __pyx_n_s_len_particles, __pyx_n_s_xvel, __pyx_n_s_yvel, __pyx_n_s_average_temp, __pyx_n_s_temperature, __pyx_n_s_i); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__ccomp_pyx, __pyx_n_s_heat_bath, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__ccomp_pyx, __pyx_n_s_heat_bath, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6851,55 +6623,55 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "src/_ccomp.pyx":15 + /* "src/_ccomp.pyx":14 * * * DTYPE = np.float64 # <<<<<<<<<<<<<< * ctypedef np.float64_t DTYPE_t * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":18 + /* "src/_ccomp.pyx":17 * ctypedef np.float64_t DTYPE_t * * def compute_forces(particles, distances, forces, box_length): # <<<<<<<<<<<<<< * """Calculates the forces and therefore the accelerations on each of the particles in the simulation. This uses a * 12-6 Lennard-Jones potential model for Argon with values: */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4pylj_4comp_1compute_forces, NULL, __pyx_n_s_pylj_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4pylj_4comp_1compute_forces, NULL, __pyx_n_s_pylj_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_forces, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_forces, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":77 + /* "src/_ccomp.pyx":71 * return particles, distances, forces * * def calculate_pressure(particles, box_length, temperature): # <<<<<<<<<<<<<< * r"""Calculates the instantaneous pressure of the simulation cell, found with the following relationship: * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4pylj_4comp_3calculate_pressure, NULL, __pyx_n_s_pylj_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4pylj_4comp_3calculate_pressure, NULL, __pyx_n_s_pylj_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_pressure, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_pressure, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/_ccomp.pyx":113 + /* "src/_ccomp.pyx":107 * return pressure * * def heat_bath(particles, temperature_sample, bath_temp): # <<<<<<<<<<<<<< * r"""Rescales the velocities of the particles in the system to control the temperature of the simulation. Thereby * allowing for an NVT ensemble. The velocities are rescaled according the following relationship, */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4pylj_4comp_5heat_bath, NULL, __pyx_n_s_pylj_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4pylj_4comp_5heat_bath, NULL, __pyx_n_s_pylj_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_heat_bath, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heat_bath, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "src/_ccomp.pyx":1 diff --git a/src/_ccomp.pyx b/src/_ccomp.pyx index 79ff9f3..57ed510 100644 --- a/src/_ccomp.pyx +++ b/src/_ccomp.pyx @@ -5,8 +5,7 @@ cimport numpy as np cdef extern from "comp.h": void compute_accelerations(int len_particles, const double *xpos, const double *ypos, double *xacc, double *yacc, - double *distances_arr, double *xforce, double *yforce, double box_l, - double *force_arr) + double *distances_arr, double box_l, double *force_arr) double compute_pressure(int number_of_particles, const double *xvel, const double *yvel, double box_length, double temperature) void scale_velocities(int len_particles, double *xvel, double *yvel, double average_temp, double tempature) @@ -50,8 +49,6 @@ def compute_forces(particles, distances, forces, box_length): cdef np.ndarray[DTYPE_t, ndim=1] yacc = np.zeros(len_particles) cdef np.ndarray[DTYPE_t, ndim=1] distances_arr = np.zeros(len(distances)) cdef np.ndarray[DTYPE_t, ndim=1] force_arr = np.zeros(len(distances)) - cdef np.ndarray[DTYPE_t, ndim=1] xforce = np.zeros(len_particles) - cdef np.ndarray[DTYPE_t, ndim=1] yforce = np.zeros(len_particles) for i in range(0, len_particles): xpos[i] = particles['xposition'][i] @@ -60,14 +57,11 @@ def compute_forces(particles, distances, forces, box_length): yacc[i] = 0 compute_accelerations(len_particles, xpos.data, ypos.data, xacc.data, - yacc.data, distances_arr.data, xforce.data, yforce.data, - box_l, force_arr.data) + yacc.data, distances_arr.data, box_l, force_arr.data) for i in range(0, len_particles): particles['xacceleration'][i] = xacc[i] particles['yacceleration'][i] = yacc[i] - particles['xforce'][i] = xforce[i] - particles['yforce'][i] = yforce[i] distances = distances_arr forces = force_arr diff --git a/src/comp.cpp b/src/comp.cpp index d16dc72..a744fc0 100644 --- a/src/comp.cpp +++ b/src/comp.cpp @@ -4,8 +4,7 @@ #include void compute_accelerations(int len_particles, const double *xpos, const double *ypos, double *xacc, - double *yacc, double *distances_arr, double *xforce, double *yforce, double box_l, - double *force_arr) + double *yacc, double *distances_arr, double box_l, double *force_arr) { int ii = 0; double dx, dy, dr, f; @@ -36,10 +35,6 @@ void compute_accelerations(int len_particles, const double *xpos, const double * distances_arr[k] = dr; f = (1.635e-133 * pow(dr, -13.) - 5.834e-77 * pow(dr, -7.)); force_arr[k] = f; - xforce[i] += f * dx / dr; - yforce[i] += f * dy / dr; - xforce[j] -= f * dx / dr; - yforce[j] -= f * dy / dr; k++; xacc[i] += (f * dx / dr) / 66.234e-27; yacc[i] += (f * dy / dr) / 66.234e-27; diff --git a/src/comp.h b/src/comp.h index 849d3f6..793d718 100644 --- a/src/comp.h +++ b/src/comp.h @@ -1,5 +1,5 @@ void compute_accelerations(int len_particles, const double *xpos, const double *ypos, double *xacc, double *yacc, - double *distances_arr, double *xforces, double *yforce, double box_l, double *force_arr); + double *distances_arr, double box_l, double *force_arr); double compute_pressure(int number_of_particles, const double *xpos, const double *ypos, double box_length, double temperature);