From d3dab39e7a31d4e98ae1ad60dc1ff1a79e656c43 Mon Sep 17 00:00:00 2001 From: Rajesh Singh Date: Tue, 26 Mar 2024 19:12:24 +0530 Subject: [PATCH] update flow code --- examples/others/abp-rtp/RTP_2D.ipynb | 202 + .../{abp => abp-rtp}/active_brownian_2D.ipynb | 2 +- pystokes/__init__.py | 4 +- pystokes/power/unbounded.html | 4126 ------------- pystokes/power/wallBounded.html | 5212 ----------------- pystokes/unbounded.pxd | 14 +- pystokes/unbounded.pyx | 181 +- pystokes/utils.pyx | 1472 ++--- 8 files changed, 1053 insertions(+), 10160 deletions(-) create mode 100644 examples/others/abp-rtp/RTP_2D.ipynb rename examples/others/{abp => abp-rtp}/active_brownian_2D.ipynb (99%) delete mode 100644 pystokes/power/unbounded.html delete mode 100644 pystokes/power/wallBounded.html diff --git a/examples/others/abp-rtp/RTP_2D.ipynb b/examples/others/abp-rtp/RTP_2D.ipynb new file mode 100644 index 0000000..b96eb9f --- /dev/null +++ b/examples/others/abp-rtp/RTP_2D.ipynb @@ -0,0 +1,202 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "VIOyaqEff3TE" + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "import time, pystokes\n", + "plt.rc('font', size=24)\n", + "randn = np.random.randn\n", + "rand=np.random.random\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "id": "upKTeyyZdPK8" + }, + "outputs": [], + "source": [ + "dt = 0.01 # time-step-size\n", + "D = 0.2 # Diffusion coeffiecient\n", + " \n", + "tau=0.5\n", + "tumblerate=dt/tau\n", + "\n", + "tauR = tau" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "ymUUFxvlfb_0" + }, + "outputs": [], + "source": [ + "Nt =int(1e6) # 10^6 \n", + "Nm = int(0.01*Nt); \n", + "\n", + "x, y = np.zeros(Nt), np.zeros(Nt)\n", + "theta = np.zeros(Nt)\n", + "sqdt = np.sqrt(2*D*dt) \n", + "# rsqdt = np.sqrt(2*Dr*dt) \n", + "\n", + "def rhs(vs):\n", + " \"\"\"Simulate using RTP ago\"\"\"\n", + " for i in range(Nt-1):\n", + " \n", + " if rand()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig = plt.figure(num=None, figsize=(32, 10), dpi=128); \n", + "\n", + "plt.subplot(121)\n", + "rhs(3); plt.plot(x,y, 'orange', label=\"3 $\\mu$m/s\")\n", + "rhs(2); plt.plot(x,y,'dodgerblue',label=\"2 $\\mu$m/s\")\n", + "rhs(1); plt.plot(x,y,'green', label=\"1 $\\mu$m/s\")\n", + "rhs(0); plt.plot(x,y,'black', label=\"0 $\\mu$m/s\")\n", + "\n", + "plt.xlabel(\"x coordinate ($\\mu$m)\"); plt.ylabel(\"y coordinate ($\\mu$m)\")\n", + "plt.legend(); plt.grid()\n", + "\n", + "\n", + "\n", + "########----------------\n", + "plt.subplot(122)\n", + "########----------------\n", + "plt.loglog(tm,dr3,mec='orange',linestyle = 'None',marker='^',markevery=0.05,markersize='10',mfc='None', label='3 \\u03BCm/s')\n", + "plt.loglog(tm,dr2,mec='dodgerblue',linestyle='None',marker='s',markevery=0.05,markersize='10',mfc='None', label='2 \\u03BCm/s')\n", + "plt.loglog(tm,dr1,mec='g',linestyle='None',marker='v',markevery=0.05,markersize='10',mfc='None',label='1 \\u03BCm/s')\n", + "plt.loglog(tm,dr0,mec='k',linestyle='None',marker='o',markevery=0.05,markersize='10',mfc='None', label='0 \\u03BCm/s') \n", + "\n", + "plt.xlabel(\"\\u03C4 (sec)\"); plt.ylabel(\"MSD ($\\mu m^2$)\")#label='3 \\u03BCm/s'\n", + "plt.legend(); plt.grid()" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.13" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/others/abp/active_brownian_2D.ipynb b/examples/others/abp-rtp/active_brownian_2D.ipynb similarity index 99% rename from examples/others/abp/active_brownian_2D.ipynb rename to examples/others/abp-rtp/active_brownian_2D.ipynb index 8715b70..8f9451e 100644 --- a/examples/others/abp/active_brownian_2D.ipynb +++ b/examples/others/abp-rtp/active_brownian_2D.ipynb @@ -197,7 +197,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/pystokes/__init__.py b/pystokes/__init__.py index 7ca0cb6..a948eba 100644 --- a/pystokes/__init__.py +++ b/pystokes/__init__.py @@ -7,10 +7,8 @@ import pystokes.forceFields import pystokes.phoretic.unbounded import pystokes.phoretic.wallBounded -import pystokes.power.unbounded -import pystokes.power.wallBounded ## latest version of PyStokes -__version__="2.2.6" +__version__="2.3.0" diff --git a/pystokes/power/unbounded.html b/pystokes/power/unbounded.html deleted file mode 100644 index 1077046..0000000 --- a/pystokes/power/unbounded.html +++ /dev/null @@ -1,4126 +0,0 @@ - - - - - - Cython: unbounded.pyx - - - -

Generated by Cython 3.0.5

-

- Yellow lines hint at Python interaction.
- Click on a line that starts with a "+" to see the C code that Cython generated for it. -

-

Raw output: unbounded.c

-
+001: cimport cython
-
  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
-  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
 002: from libc.math cimport sqrt
-
 003: from cython.parallel import prange
-
+004: cdef double PI = 3.14159265359
-
  __Pyx_TraceLine(4,0,__PYX_ERR(0, 4, __pyx_L1_error))
-  __pyx_v_8pystokes_5power_9unbounded_PI = 3.14159265359;
-
+005: import numpy as np
-
  __Pyx_TraceLine(5,0,__PYX_ERR(0, 5, __pyx_L1_error))
-  __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
 006: cimport numpy as np
-
 007: 
-
 008: 
-
 009: @cython.wraparound(False)
-
 010: @cython.boundscheck(False)
-
 011: @cython.cdivision(True)
-
 012: @cython.nonecheck(False)
-
+013: cdef class PD:
-
struct __pyx_vtabstruct_8pystokes_5power_9unbounded_PD {
-  PyObject *(*frictionTT)(struct __pyx_obj_8pystokes_5power_9unbounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionTR)(struct __pyx_obj_8pystokes_5power_9unbounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionT2s)(struct __pyx_obj_8pystokes_5power_9unbounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionT3t)(struct __pyx_obj_8pystokes_5power_9unbounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionRT)(struct __pyx_obj_8pystokes_5power_9unbounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionRR)(struct __pyx_obj_8pystokes_5power_9unbounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-};
-static struct __pyx_vtabstruct_8pystokes_5power_9unbounded_PD *__pyx_vtabptr_8pystokes_5power_9unbounded_PD;
-
-
 014:     """
-
 015:     Power Dissipation(PD)
-
 016:     
-
 017:     Methods in this class calculate the power dissipation
-
 018:     using the inputs of -  power dissipation, arrays of positions, velocity or angular velocity, 
-
 019:     along with an array of forces or torques or a slip mode
-
 020: 
-
 021:     The power dissipation is then update by each method. 
-
 022:     
-
 023:     ...
-
 024: 
-
 025:     ----------
-
 026:     radius: float
-
 027:         Radius of the particles (a).    
-
 028:     particles: int
-
 029:         Number of particles (N)
-
 030:     viscosity: float 
-
 031:         Viscosity of the fluid (eta)
-
 032: 
-
 033:    """
-
 034: 
-
+035:     def __init__(self, radius=1, particles=1, viscosity=1.0):
-
/* Python wrapper */
-static int __pyx_pw_8pystokes_5power_9unbounded_2PD_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_8pystokes_5power_9unbounded_2PD_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_radius = 0;
-  PyObject *__pyx_v_particles = 0;
-  PyObject *__pyx_v_viscosity = 0;
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,&__pyx_n_s_particles,&__pyx_n_s_viscosity,0};
-  PyObject* values[3] = {0,0,0};
-    values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1));
-    values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1));
-    values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_float_1_0));
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius);
-          if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
-          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_particles);
-          if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
-          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viscosity);
-          if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
-          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
-      }
-    } else {
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_radius = values[0];
-    __pyx_v_particles = values[1];
-    __pyx_v_viscosity = values[2];
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 35, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
-    }
-  }
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_9unbounded_2PD___init__(((struct __pyx_obj_8pystokes_5power_9unbounded_PD *)__pyx_v_self), __pyx_v_radius, __pyx_v_particles, __pyx_v_viscosity);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_8pystokes_5power_9unbounded_2PD___init__(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, PyObject *__pyx_v_radius, PyObject *__pyx_v_particles, PyObject *__pyx_v_viscosity) {
-  int __pyx_r;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceCall("__init__", __pyx_f[0], 35, 0, __PYX_ERR(0, 35, __pyx_L1_error));
-/* … */
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
+036:         self.a   = radius
-
  __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error))
-  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_radius); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
-  __pyx_v_self->a = __pyx_t_1;
-
+037:         self.N  = particles
-
  __Pyx_TraceLine(37,0,__PYX_ERR(0, 37, __pyx_L1_error))
-  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_particles); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error)
-  __pyx_v_self->N = __pyx_t_2;
-
+038:         self.eta = viscosity
-
  __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error))
-  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_viscosity); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error)
-  __pyx_v_self->eta = __pyx_t_1;
-
+039:         self.gammaT = 6*PI*self.eta*self.a
-
  __Pyx_TraceLine(39,0,__PYX_ERR(0, 39, __pyx_L1_error))
-  __pyx_v_self->gammaT = (((6.0 * __pyx_v_8pystokes_5power_9unbounded_PI) * __pyx_v_self->eta) * __pyx_v_self->a);
-
+040:         self.gammaR = 8*PI*self.eta*self.a**3
-
  __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error))
-  __pyx_v_self->gammaR = (((8.0 * __pyx_v_8pystokes_5power_9unbounded_PI) * __pyx_v_self->eta) * pow(__pyx_v_self->a, 3.0));
-
+041:         self.mu  = 1.0/self.gammaT
-
  __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error))
-  __pyx_v_self->mu = (1.0 / __pyx_v_self->gammaT);
-
+042:         self.muv = 1.0/(8*PI*self.eta)
-
  __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error))
-  __pyx_v_self->muv = (1.0 / ((8.0 * __pyx_v_8pystokes_5power_9unbounded_PI) * __pyx_v_self->eta));
-
+043:         self.mur = 1.0/(self.gammaR)
-
  __Pyx_TraceLine(43,0,__PYX_ERR(0, 43, __pyx_L1_error))
-  __pyx_v_self->mur = (1.0 / __pyx_v_self->gammaR);
-
 044: 
-
+045:         self.Mobility = np.zeros( (3*self.N, 3*self.N), dtype=np.float64)
-
  __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error))
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyInt_From_long((3 * __pyx_v_self->N)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = __Pyx_PyInt_From_long((3 * __pyx_v_self->N)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_3);
-  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error);
-  __Pyx_GIVEREF(__pyx_t_5);
-  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error);
-  __pyx_t_3 = 0;
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_6);
-  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error);
-  __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 45, __pyx_L1_error)
-  __Pyx_GIVEREF(__pyx_t_7);
-  __Pyx_GOTREF((PyObject *)__pyx_v_self->Mobility);
-  __Pyx_DECREF((PyObject *)__pyx_v_self->Mobility);
-  __pyx_v_self->Mobility = ((PyArrayObject *)__pyx_t_7);
-  __pyx_t_7 = 0;
-
 046: 
-
 047: 
-
+048:     cpdef frictionTT(self, double depsilon, double [:] v, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_3frictionTT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_9unbounded_2PD_frictionTT(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr2;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  double __pyx_v_vv1;
-  double __pyx_v_vv2;
-  double __pyx_v_aa;
-  double __pyx_v_gT;
-  double __pyx_v_gg;
-  double __pyx_v_muv;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__11)
-  __Pyx_TraceCall("frictionTT", __pyx_f[0], 48, 0, __PYX_ERR(0, 48, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionTT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_9unbounded_2PD_3frictionTT)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 48, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_v, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 48, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
-        __pyx_t_8 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_6))) {
-          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
-          if (likely(__pyx_t_7)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-            __Pyx_INCREF(__pyx_t_7);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_6, function);
-            __pyx_t_8 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8);
-          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionTT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_3frictionTT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_9unbounded_2PD_2frictionTT, "\n        Compute power dissipation due to translation using :math:`\\dot{\\epsilon}=V\\cdot\\gamma^{TT}\\cdot V`\n        ...\n        Parameters\n        ----------\n        depsilon: energy dissipation,\n        v: np.array\n            An array of velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_9unbounded_2PD_3frictionTT = {"frictionTT", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_9unbounded_2PD_3frictionTT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_9unbounded_2PD_2frictionTT};
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_3frictionTT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_v = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionTT (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_v,&__pyx_n_s_r,0};
-  PyObject* values[3] = {0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTT", 1, 3, 3, 1); __PYX_ERR(0, 48, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTT", 1, 3, 3, 2); __PYX_ERR(0, 48, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionTT") < 0)) __PYX_ERR(0, 48, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 3)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error)
-    __pyx_v_v = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_v.memview)) __PYX_ERR(0, 48, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 48, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionTT", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 48, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionTT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_9unbounded_2PD_2frictionTT(((struct __pyx_obj_8pystokes_5power_9unbounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_v, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_9unbounded_2PD_2frictionTT(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__11)
-  __Pyx_TraceCall("frictionTT (wrapper)", __pyx_f[0], 48, 0, __PYX_ERR(0, 48, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 48, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 48, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_9unbounded_2PD_frictionTT(__pyx_v_self, __pyx_v_depsilon, __pyx_v_v, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionTT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error))
-/* … */
-  __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_v, __pyx_n_s_r); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_9unbounded_2PD_3frictionTT, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionTT, NULL, __pyx_n_s_pystokes_power_unbounded, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_9unbounded_PD, __pyx_n_s_frictionTT, __pyx_t_7) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_9unbounded_PD);
-  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_unbounded_pyx, __pyx_n_s_frictionTT, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 48, __pyx_L1_error)
-
 049:         """
-
 050:         Compute power dissipation due to translation using :math:`\dot{\epsilon}=V\cdot\gamma^{TT}\cdot V`
-
 051:         ...
-
 052:         Parameters
-
 053:         ----------
-
 054:         depsilon: energy dissipation,
-
 055:         v: np.array
-
 056:             An array of velocities
-
 057:             An array of size 3*N,
-
 058:         r: np.array
-
 059:             An array of positions
-
 060:             An array of size 3*N,
-
 061:         ----------
-
 062:         """
-
 063: 
-
 064: 
-
+065:         cdef int N  = self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(65,0,__PYX_ERR(0, 65, __pyx_L1_error))
-  __pyx_t_8 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_8;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
+066:         cdef double dx, dy, dz, idr, idr2, vx, vy, vz, vv1, vv2, aa = (2.0*self.a*self.a)/3.0
-
  __Pyx_TraceLine(66,0,__PYX_ERR(0, 66, __pyx_L1_error))
-  __pyx_v_aa = (((2.0 * __pyx_v_self->a) * __pyx_v_self->a) / 3.0);
-
+067:         cdef double gT=self.gammaT, gg = -gT*gT, muv=self.muv
-
  __Pyx_TraceLine(67,0,__PYX_ERR(0, 67, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->gammaT;
-  __pyx_v_gT = __pyx_t_9;
-  __pyx_v_gg = ((-__pyx_v_gT) * __pyx_v_gT);
-  __pyx_t_9 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_9;
-
 068: 
-
+069:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(69,0,__PYX_ERR(0, 69, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_8 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_11 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_11 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr2) lastprivate(__pyx_v_j) lastprivate(__pyx_v_vv1) lastprivate(__pyx_v_vv2) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_10);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr2 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_vv1 = ((double)__PYX_NAN());
-                            __pyx_v_vv2 = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(69,1,__PYX_ERR(0, 69, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+070:             vx=0; vy=0;   vz=0;
-
                            __Pyx_TraceLine(70,1,__PYX_ERR(0, 70, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+071:             for j in range(N):
-
                            __Pyx_TraceLine(71,1,__PYX_ERR(0, 71, __pyx_L8_error))
-                            __pyx_t_12 = __pyx_v_N;
-                            __pyx_t_13 = __pyx_t_12;
-                            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-                              __pyx_v_j = __pyx_t_14;
-
+072:                 if i != j:
-
                              __Pyx_TraceLine(72,1,__PYX_ERR(0, 72, __pyx_L8_error))
-                              __pyx_t_15 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_15) {
-/* … */
-                              }
-                            }
-
+073:                     dx = r[i]    - r[j]
-
                                __Pyx_TraceLine(73,1,__PYX_ERR(0, 73, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_i;
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+074:                     dy = r[i+N] - r[j+N]
-
                                __Pyx_TraceLine(74,1,__PYX_ERR(0, 74, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+075:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(75,1,__PYX_ERR(0, 75, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+076:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(76,1,__PYX_ERR(0, 76, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+077:                     idr2 = idr*idr
-
                                __Pyx_TraceLine(77,1,__PYX_ERR(0, 77, __pyx_L8_error))
-                                __pyx_v_idr2 = (__pyx_v_idr * __pyx_v_idr);
-
 078: 
-
+079:                     vv1 = (1+aa*idr2)*idr
-
                                __Pyx_TraceLine(79,1,__PYX_ERR(0, 79, __pyx_L8_error))
-                                __pyx_v_vv1 = ((1.0 + (__pyx_v_aa * __pyx_v_idr2)) * __pyx_v_idr);
-
+080:                     vv2 = (1-3*aa*idr2)*( v[j]*dx + v[j+N]*dy + v[j+xx]*dz )*idr2*idr
-
                                __Pyx_TraceLine(80,1,__PYX_ERR(0, 80, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vv2 = ((((1.0 - ((3.0 * __pyx_v_aa) * __pyx_v_idr2)) * ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz))) * __pyx_v_idr2) * __pyx_v_idr);
-
+081:                     vx += vv1*v[j]    + vv2*dx
-
                                __Pyx_TraceLine(81,1,__PYX_ERR(0, 81, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + ((__pyx_v_vv1 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) )))) + (__pyx_v_vv2 * __pyx_v_dx)));
-
+082:                     vy += vv1*v[j+N] + vv2*dy
-
                                __Pyx_TraceLine(82,1,__PYX_ERR(0, 82, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + ((__pyx_v_vv1 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) )))) + (__pyx_v_vv2 * __pyx_v_dy)));
-
+083:                     vz += vv1*v[j+xx] + vv2*dz
-
                                __Pyx_TraceLine(83,1,__PYX_ERR(0, 83, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vz = (__pyx_v_vz + ((__pyx_v_vv1 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) )))) + (__pyx_v_vv2 * __pyx_v_dz)));
-
 084: 
-
+085:             depsilon += v[i] * (gT*v[i] + gg*muv*vx)
-
                            __Pyx_TraceLine(85,1,__PYX_ERR(0, 85, __pyx_L8_error))
-                            __pyx_t_18 = __pyx_v_i;
-                            __pyx_t_16 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * ((__pyx_v_gT * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) + ((__pyx_v_gg * __pyx_v_muv) * __pyx_v_vx))));
-
+086:             depsilon += v[i + N] * (gT*v[i+N] + gg*muv*vy)
-
                            __Pyx_TraceLine(86,1,__PYX_ERR(0, 86, __pyx_L8_error))
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * ((__pyx_v_gT * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) )))) + ((__pyx_v_gg * __pyx_v_muv) * __pyx_v_vy))));
-
+087:             depsilon += v[i+xx] * (gT*v[i+xx] + gg*muv*vz)
-
                            __Pyx_TraceLine(87,1,__PYX_ERR(0, 87, __pyx_L8_error))
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * ((__pyx_v_gT * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) + ((__pyx_v_gg * __pyx_v_muv) * __pyx_v_vz))));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates0)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_depsilon;
-                                __pyx_parallel_temp1 = __pyx_v_dx;
-                                __pyx_parallel_temp2 = __pyx_v_dy;
-                                __pyx_parallel_temp3 = __pyx_v_dz;
-                                __pyx_parallel_temp4 = __pyx_v_i;
-                                __pyx_parallel_temp5 = __pyx_v_idr;
-                                __pyx_parallel_temp6 = __pyx_v_idr2;
-                                __pyx_parallel_temp7 = __pyx_v_j;
-                                __pyx_parallel_temp8 = __pyx_v_vv1;
-                                __pyx_parallel_temp9 = __pyx_v_vv2;
-                                __pyx_parallel_temp10 = __pyx_v_vx;
-                                __pyx_parallel_temp11 = __pyx_v_vy;
-                                __pyx_parallel_temp12 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_depsilon = __pyx_parallel_temp0;
-              __pyx_v_dx = __pyx_parallel_temp1;
-              __pyx_v_dy = __pyx_parallel_temp2;
-              __pyx_v_dz = __pyx_parallel_temp3;
-              __pyx_v_i = __pyx_parallel_temp4;
-              __pyx_v_idr = __pyx_parallel_temp5;
-              __pyx_v_idr2 = __pyx_parallel_temp6;
-              __pyx_v_j = __pyx_parallel_temp7;
-              __pyx_v_vv1 = __pyx_parallel_temp8;
-              __pyx_v_vv2 = __pyx_parallel_temp9;
-              __pyx_v_vx = __pyx_parallel_temp10;
-              __pyx_v_vy = __pyx_parallel_temp11;
-              __pyx_v_vz = __pyx_parallel_temp12;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+088:         return depsilon
-
  __Pyx_TraceLine(88,0,__PYX_ERR(0, 88, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 089: 
-
 090: 
-
+091:     cpdef frictionTR(self, double depsilon, double [:] v, double [:] o, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_5frictionTR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_9unbounded_2PD_frictionTR(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  double __pyx_v_muv;
-  double __pyx_v_gg;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__12)
-  __Pyx_TraceCall("frictionTR", __pyx_f[0], 91, 0, __PYX_ERR(0, 91, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionTR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_9unbounded_2PD_5frictionTR)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 91, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_v, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 91, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_o, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 91, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_5frictionTR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_9unbounded_2PD_4frictionTR, "\n        Compute energy dissipation due to rotation using :math:`\\dot{\\epsilon}=V\\cdot\\gamma^{TR}\\cdot \\Omega`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation,\n        v: np.array\n            An array of velocities\n            An array of size 3*N,\n        o: np.array\n            An array of angular velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_9unbounded_2PD_5frictionTR = {"frictionTR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_9unbounded_2PD_5frictionTR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_9unbounded_2PD_4frictionTR};
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_5frictionTR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_v = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_o = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionTR (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_v,&__pyx_n_s_o,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, 1); __PYX_ERR(0, 91, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_o)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, 2); __PYX_ERR(0, 91, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, 3); __PYX_ERR(0, 91, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionTR") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
-    __pyx_v_v = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_v.memview)) __PYX_ERR(0, 91, __pyx_L3_error)
-    __pyx_v_o = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_o.memview)) __PYX_ERR(0, 91, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 91, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 91, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_9unbounded_2PD_4frictionTR(((struct __pyx_obj_8pystokes_5power_9unbounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_9unbounded_2PD_4frictionTR(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__12)
-  __Pyx_TraceCall("frictionTR (wrapper)", __pyx_f[0], 91, 0, __PYX_ERR(0, 91, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 91, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 91, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 91, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_9unbounded_2PD_frictionTR(__pyx_v_self, __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(91,0,__PYX_ERR(0, 91, __pyx_L1_error))
-/* … */
-  __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_v, __pyx_n_s_o, __pyx_n_s_r); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 91, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_9unbounded_2PD_5frictionTR, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionTR, NULL, __pyx_n_s_pystokes_power_unbounded, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_9unbounded_PD, __pyx_n_s_frictionTR, __pyx_t_7) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_9unbounded_PD);
-  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_unbounded_pyx, __pyx_n_s_frictionTR, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 91, __pyx_L1_error)
-
 092:         """
-
 093:         Compute energy dissipation due to rotation using :math:`\dot{\epsilon}=V\cdot\gamma^{TR}\cdot \Omega`
-
 094:         ...
-
 095:         Parameters
-
 096:         ----------
-
 097:         depsilon: power dissipation,
-
 098:         v: np.array
-
 099:             An array of velocities
-
 100:             An array of size 3*N,
-
 101:         o: np.array
-
 102:             An array of angular velocities
-
 103:             An array of size 3*N,
-
 104:         r: np.array
-
 105:             An array of positions
-
 106:             An array of size 3*N,
-
 107:         ----------
-
 108:         """
-
 109: 
-
 110: 
-
+111:         cdef int N = self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(111,0,__PYX_ERR(0, 111, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
 112:         cdef double dx, dy, dz, idr, idr3, vx, vy, vz
-
+113:         cdef double muv=self.muv, gg=-self.gammaT*self.gammaR
-
  __Pyx_TraceLine(113,0,__PYX_ERR(0, 113, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_10;
-  __pyx_v_gg = ((-__pyx_v_self->gammaT) * __pyx_v_self->gammaR);
-
 114: 
-
+115:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(115,0,__PYX_ERR(0, 115, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_j) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-/* … */
-      __Pyx_TraceLine(115,1,__PYX_ERR(0, 115, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+116:             vx=0; vy=0;   vz=0;
-
                            __Pyx_TraceLine(116,1,__PYX_ERR(0, 116, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+117:             for j in range(N):
-
                            __Pyx_TraceLine(117,1,__PYX_ERR(0, 117, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+118:                 if i != j:
-
                              __Pyx_TraceLine(118,1,__PYX_ERR(0, 118, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_16) {
-/* … */
-                              }
-                            }
-
+119:                     dx = r[i]    - r[j]
-
                                __Pyx_TraceLine(119,1,__PYX_ERR(0, 119, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_i;
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+120:                     dy = r[i+N] - r[j+N]
-
                                __Pyx_TraceLine(120,1,__PYX_ERR(0, 120, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+121:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(121,1,__PYX_ERR(0, 121, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+122:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(122,1,__PYX_ERR(0, 122, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+123:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(123,1,__PYX_ERR(0, 123, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+124:                     vx += -(dy*o[j+xx] -o[j+N]*dz )*idr3
-
                                __Pyx_TraceLine(124,1,__PYX_ERR(0, 124, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vx = (__pyx_v_vx + ((-((__pyx_v_dy * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz))) * __pyx_v_idr3));
-
+125:                     vy += -(dz*o[j]    -o[j+xx]*dx )*idr3
-
                                __Pyx_TraceLine(125,1,__PYX_ERR(0, 125, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vy = (__pyx_v_vy + ((-((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) )))) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx))) * __pyx_v_idr3));
-
+126:                     vz += -(dx*o[j+N]  -o[j]   *dy )*idr3
-
                                __Pyx_TraceLine(126,1,__PYX_ERR(0, 126, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_vz = (__pyx_v_vz + ((-((__pyx_v_dx * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy))) * __pyx_v_idr3));
-
 127: 
-
+128:             depsilon += v[i] * gg * muv*vx
-
                            __Pyx_TraceLine(128,1,__PYX_ERR(0, 128, __pyx_L8_error))
-                            __pyx_t_17 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_vx));
-
+129:             depsilon += v[i+N] * gg * muv*vy
-
                            __Pyx_TraceLine(129,1,__PYX_ERR(0, 129, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_vy));
-
+130:             depsilon += v[i+xx] * gg *muv*vz
-
                            __Pyx_TraceLine(130,1,__PYX_ERR(0, 130, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_vz));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates1)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_depsilon;
-                                __pyx_parallel_temp1 = __pyx_v_dx;
-                                __pyx_parallel_temp2 = __pyx_v_dy;
-                                __pyx_parallel_temp3 = __pyx_v_dz;
-                                __pyx_parallel_temp4 = __pyx_v_i;
-                                __pyx_parallel_temp5 = __pyx_v_idr;
-                                __pyx_parallel_temp6 = __pyx_v_idr3;
-                                __pyx_parallel_temp7 = __pyx_v_j;
-                                __pyx_parallel_temp8 = __pyx_v_vx;
-                                __pyx_parallel_temp9 = __pyx_v_vy;
-                                __pyx_parallel_temp10 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_depsilon = __pyx_parallel_temp0;
-              __pyx_v_dx = __pyx_parallel_temp1;
-              __pyx_v_dy = __pyx_parallel_temp2;
-              __pyx_v_dz = __pyx_parallel_temp3;
-              __pyx_v_i = __pyx_parallel_temp4;
-              __pyx_v_idr = __pyx_parallel_temp5;
-              __pyx_v_idr3 = __pyx_parallel_temp6;
-              __pyx_v_j = __pyx_parallel_temp7;
-              __pyx_v_vx = __pyx_parallel_temp8;
-              __pyx_v_vy = __pyx_parallel_temp9;
-              __pyx_v_vz = __pyx_parallel_temp10;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+131:         return depsilon
-
  __Pyx_TraceLine(131,0,__PYX_ERR(0, 131, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 132: 
-
 133: 
-
+134:     cpdef frictionT2s(self, double depsilon, double [:] V1s, double [:] S, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_7frictionT2s(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_9unbounded_2PD_frictionT2s(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_S, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  int __pyx_v_xx1;
-  int __pyx_v_xx2;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_aa;
-  double __pyx_v_vv1;
-  double __pyx_v_vv2;
-  double __pyx_v_aidr2;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  double __pyx_v_sxx;
-  double __pyx_v_sxy;
-  double __pyx_v_sxz;
-  double __pyx_v_syz;
-  double __pyx_v_syy;
-  double __pyx_v_srr;
-  double __pyx_v_srx;
-  double __pyx_v_sry;
-  double __pyx_v_srz;
-  double __pyx_v_mus;
-  double __pyx_v_gT;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__13)
-  __Pyx_TraceCall("frictionT2s", __pyx_f[0], 134, 0, __PYX_ERR(0, 134, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionT2s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_9unbounded_2PD_7frictionT2s)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 134, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_V1s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_S.memview)) { __Pyx_RaiseUnboundLocalError("S"); __PYX_ERR(0, 134, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_S, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 134, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionT2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_7frictionT2s(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_9unbounded_2PD_6frictionT2s, "\n        Compute energy dissipation due to 2s mode of the slip :math:`\\dot{\\epsilon}=V^{1s}\\cdot\\gamma^{T,2s}\\cdot V^{2s}`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation\n        V1s: np.array\n            An array of 1s mode of velocities\n            An array of size 3*N,\n        S: np.array\n            An array of 2s mode of the slip\n            An array of size 5*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_9unbounded_2PD_7frictionT2s = {"frictionT2s", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_9unbounded_2PD_7frictionT2s, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_9unbounded_2PD_6frictionT2s};
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_7frictionT2s(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_V1s = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_S = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionT2s (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_V1s,&__pyx_n_s_S,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V1s)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, 1); __PYX_ERR(0, 134, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_S)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, 2); __PYX_ERR(0, 134, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, 3); __PYX_ERR(0, 134, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionT2s") < 0)) __PYX_ERR(0, 134, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error)
-    __pyx_v_V1s = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V1s.memview)) __PYX_ERR(0, 134, __pyx_L3_error)
-    __pyx_v_S = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_S.memview)) __PYX_ERR(0, 134, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 134, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_S, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionT2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_9unbounded_2PD_6frictionT2s(((struct __pyx_obj_8pystokes_5power_9unbounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_S, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_S, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_9unbounded_2PD_6frictionT2s(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_S, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__13)
-  __Pyx_TraceCall("frictionT2s (wrapper)", __pyx_f[0], 134, 0, __PYX_ERR(0, 134, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 134, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_S.memview)) { __Pyx_RaiseUnboundLocalError("S"); __PYX_ERR(0, 134, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 134, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_9unbounded_2PD_frictionT2s(__pyx_v_self, __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_S, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionT2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error))
-/* … */
-  __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_V1s, __pyx_n_s_S, __pyx_n_s_r); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_9unbounded_2PD_7frictionT2s, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionT2s, NULL, __pyx_n_s_pystokes_power_unbounded, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_9unbounded_PD, __pyx_n_s_frictionT2s, __pyx_t_7) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_9unbounded_PD);
-  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_unbounded_pyx, __pyx_n_s_frictionT2s, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 134, __pyx_L1_error)
-
 135:         """
-
 136:         Compute energy dissipation due to 2s mode of the slip :math:`\dot{\epsilon}=V^{1s}\cdot\gamma^{T,2s}\cdot V^{2s}`
-
 137:         ...
-
 138:         Parameters
-
 139:         ----------
-
 140:         depsilon: power dissipation
-
 141:         V1s: np.array
-
 142:             An array of 1s mode of velocities
-
 143:             An array of size 3*N,
-
 144:         S: np.array
-
 145:             An array of 2s mode of the slip
-
 146:             An array of size 5*N,
-
 147:         r: np.array
-
 148:             An array of positions
-
 149:             An array of size 3*N,
-
 150:         ----------
-
 151:         """
-
 152: 
-
+153:         cdef int N = self.N, i, j, xx=2*N, xx1=3*N, xx2=4*N
-
  __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-  __pyx_v_xx1 = (3 * __pyx_v_N);
-  __pyx_v_xx2 = (4 * __pyx_v_N);
-
 154:         cdef double dx, dy, dz, dr, idr,  idr3
-
+155:         cdef double aa=(self.a*self.a*8.0)/3.0, vv1, vv2, aidr2
-
  __Pyx_TraceLine(155,0,__PYX_ERR(0, 155, __pyx_L1_error))
-  __pyx_v_aa = (((__pyx_v_self->a * __pyx_v_self->a) * 8.0) / 3.0);
-
 156:         cdef double vx, vy, vz,
-
+157:         cdef double sxx, sxy, sxz, syz, syy, srr, srx, sry, srz, mus = (28.0*self.a**3)/24
-
  __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
-  __pyx_v_mus = ((28.0 * pow(__pyx_v_self->a, 3.0)) / 24.0);
-
+158:         cdef double gT = self.gammaT
-
  __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->gammaT;
-  __pyx_v_gT = __pyx_t_10;
-
 159: 
-
+160:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_aidr2) reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_j) lastprivate(__pyx_v_srr) lastprivate(__pyx_v_srx) lastprivate(__pyx_v_sry) lastprivate(__pyx_v_srz) lastprivate(__pyx_v_sxx) lastprivate(__pyx_v_sxy) lastprivate(__pyx_v_sxz) lastprivate(__pyx_v_syy) lastprivate(__pyx_v_syz) lastprivate(__pyx_v_vv1) lastprivate(__pyx_v_vv2) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_aidr2 = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_srr = ((double)__PYX_NAN());
-                            __pyx_v_srx = ((double)__PYX_NAN());
-                            __pyx_v_sry = ((double)__PYX_NAN());
-                            __pyx_v_srz = ((double)__PYX_NAN());
-                            __pyx_v_sxx = ((double)__PYX_NAN());
-                            __pyx_v_sxy = ((double)__PYX_NAN());
-                            __pyx_v_sxz = ((double)__PYX_NAN());
-                            __pyx_v_syy = ((double)__PYX_NAN());
-                            __pyx_v_syz = ((double)__PYX_NAN());
-                            __pyx_v_vv1 = ((double)__PYX_NAN());
-                            __pyx_v_vv2 = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(160,1,__PYX_ERR(0, 160, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+161:             vx=0; vy=0;   vz=0;
-
                            __Pyx_TraceLine(161,1,__PYX_ERR(0, 161, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+162:             for j in range(N):
-
                            __Pyx_TraceLine(162,1,__PYX_ERR(0, 162, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+163:                 if i != j:
-
                              __Pyx_TraceLine(163,1,__PYX_ERR(0, 163, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_16) {
-/* … */
-                              }
-                            }
-
+164:                     sxx = S[j]
-
                                __Pyx_TraceLine(164,1,__PYX_ERR(0, 164, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_sxx = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-
+165:                     syy = S[j+N]
-
                                __Pyx_TraceLine(165,1,__PYX_ERR(0, 165, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_syy = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-
+166:                     sxy = S[j+xx]
-
                                __Pyx_TraceLine(166,1,__PYX_ERR(0, 166, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_sxy = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-
+167:                     sxz = S[j+xx1]
-
                                __Pyx_TraceLine(167,1,__PYX_ERR(0, 167, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx1);
-                                __pyx_v_sxz = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-
+168:                     syz = S[j+xx2]
-
                                __Pyx_TraceLine(168,1,__PYX_ERR(0, 168, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx2);
-                                __pyx_v_syz = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-
+169:                     dx = r[i]    - r[j]
-
                                __Pyx_TraceLine(169,1,__PYX_ERR(0, 169, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_i;
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+170:                     dy = r[i+N] - r[j+N]
-
                                __Pyx_TraceLine(170,1,__PYX_ERR(0, 170, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+171:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(171,1,__PYX_ERR(0, 171, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+172:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(172,1,__PYX_ERR(0, 172, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+173:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(173,1,__PYX_ERR(0, 173, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+174:                     aidr2  = aa*idr*idr
-
                                __Pyx_TraceLine(174,1,__PYX_ERR(0, 174, __pyx_L8_error))
-                                __pyx_v_aidr2 = ((__pyx_v_aa * __pyx_v_idr) * __pyx_v_idr);
-
 175: 
-
+176:                     srr = (sxx*(dx*dx-dz*dz) + syy*(dy*dy-dz*dz) +  2*sxy*dx*dy + 2*sxz*dx*dz  +  2*syz*dy*dz)*idr*idr
-
                                __Pyx_TraceLine(176,1,__PYX_ERR(0, 176, __pyx_L8_error))
-                                __pyx_v_srr = (((((((__pyx_v_sxx * ((__pyx_v_dx * __pyx_v_dx) - (__pyx_v_dz * __pyx_v_dz))) + (__pyx_v_syy * ((__pyx_v_dy * __pyx_v_dy) - (__pyx_v_dz * __pyx_v_dz)))) + (((2.0 * __pyx_v_sxy) * __pyx_v_dx) * __pyx_v_dy)) + (((2.0 * __pyx_v_sxz) * __pyx_v_dx) * __pyx_v_dz)) + (((2.0 * __pyx_v_syz) * __pyx_v_dy) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
+177:                     srx = sxx*dx +  sxy*dy + sxz*dz
-
                                __Pyx_TraceLine(177,1,__PYX_ERR(0, 177, __pyx_L8_error))
-                                __pyx_v_srx = (((__pyx_v_sxx * __pyx_v_dx) + (__pyx_v_sxy * __pyx_v_dy)) + (__pyx_v_sxz * __pyx_v_dz));
-
+178:                     sry = sxy*dx +  syy*dy + syz*dz
-
                                __Pyx_TraceLine(178,1,__PYX_ERR(0, 178, __pyx_L8_error))
-                                __pyx_v_sry = (((__pyx_v_sxy * __pyx_v_dx) + (__pyx_v_syy * __pyx_v_dy)) + (__pyx_v_syz * __pyx_v_dz));
-
+179:                     srz = sxz*dx +  syz*dy - (sxx+syy)*dz
-
                                __Pyx_TraceLine(179,1,__PYX_ERR(0, 179, __pyx_L8_error))
-                                __pyx_v_srz = (((__pyx_v_sxz * __pyx_v_dx) + (__pyx_v_syz * __pyx_v_dy)) - ((__pyx_v_sxx + __pyx_v_syy) * __pyx_v_dz));
-
 180: 
-
+181:                     vv1 = 3*(1-aidr2)*srr*idr3
-
                                __Pyx_TraceLine(181,1,__PYX_ERR(0, 181, __pyx_L8_error))
-                                __pyx_v_vv1 = (((3.0 * (1.0 - __pyx_v_aidr2)) * __pyx_v_srr) * __pyx_v_idr3);
-
+182:                     vv2 = 1.2*aidr2*idr3
-
                                __Pyx_TraceLine(182,1,__PYX_ERR(0, 182, __pyx_L8_error))
-                                __pyx_v_vv2 = ((1.2 * __pyx_v_aidr2) * __pyx_v_idr3);
-
+183:                     vx +=  vv1*dx + vv2*srx
-
                                __Pyx_TraceLine(183,1,__PYX_ERR(0, 183, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + ((__pyx_v_vv1 * __pyx_v_dx) + (__pyx_v_vv2 * __pyx_v_srx)));
-
+184:                     vy +=  vv1*dy + vv2*sry
-
                                __Pyx_TraceLine(184,1,__PYX_ERR(0, 184, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + ((__pyx_v_vv1 * __pyx_v_dy) + (__pyx_v_vv2 * __pyx_v_sry)));
-
+185:                     vz +=  vv1*dz + vv2*srz
-
                                __Pyx_TraceLine(185,1,__PYX_ERR(0, 185, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((__pyx_v_vv1 * __pyx_v_dz) + (__pyx_v_vv2 * __pyx_v_srz)));
-
 186: 
-
+187:             depsilon += -V1s[i] * gT * vx*mus
-
                            __Pyx_TraceLine(187,1,__PYX_ERR(0, 187, __pyx_L8_error))
-                            __pyx_t_18 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_18 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gT) * __pyx_v_vx) * __pyx_v_mus));
-
+188:             depsilon += -V1s[i+N] * gT * vy*mus
-
                            __Pyx_TraceLine(188,1,__PYX_ERR(0, 188, __pyx_L8_error))
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_18 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gT) * __pyx_v_vy) * __pyx_v_mus));
-
+189:             depsilon += -V1s[i+xx] * gT * vz*mus
-
                            __Pyx_TraceLine(189,1,__PYX_ERR(0, 189, __pyx_L8_error))
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_18 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gT) * __pyx_v_vz) * __pyx_v_mus));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates2)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_aidr2;
-                                __pyx_parallel_temp1 = __pyx_v_depsilon;
-                                __pyx_parallel_temp2 = __pyx_v_dx;
-                                __pyx_parallel_temp3 = __pyx_v_dy;
-                                __pyx_parallel_temp4 = __pyx_v_dz;
-                                __pyx_parallel_temp5 = __pyx_v_i;
-                                __pyx_parallel_temp6 = __pyx_v_idr;
-                                __pyx_parallel_temp7 = __pyx_v_idr3;
-                                __pyx_parallel_temp8 = __pyx_v_j;
-                                __pyx_parallel_temp9 = __pyx_v_srr;
-                                __pyx_parallel_temp10 = __pyx_v_srx;
-                                __pyx_parallel_temp11 = __pyx_v_sry;
-                                __pyx_parallel_temp12 = __pyx_v_srz;
-                                __pyx_parallel_temp13 = __pyx_v_sxx;
-                                __pyx_parallel_temp14 = __pyx_v_sxy;
-                                __pyx_parallel_temp15 = __pyx_v_sxz;
-                                __pyx_parallel_temp16 = __pyx_v_syy;
-                                __pyx_parallel_temp17 = __pyx_v_syz;
-                                __pyx_parallel_temp18 = __pyx_v_vv1;
-                                __pyx_parallel_temp19 = __pyx_v_vv2;
-                                __pyx_parallel_temp20 = __pyx_v_vx;
-                                __pyx_parallel_temp21 = __pyx_v_vy;
-                                __pyx_parallel_temp22 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_aidr2 = __pyx_parallel_temp0;
-              __pyx_v_depsilon = __pyx_parallel_temp1;
-              __pyx_v_dx = __pyx_parallel_temp2;
-              __pyx_v_dy = __pyx_parallel_temp3;
-              __pyx_v_dz = __pyx_parallel_temp4;
-              __pyx_v_i = __pyx_parallel_temp5;
-              __pyx_v_idr = __pyx_parallel_temp6;
-              __pyx_v_idr3 = __pyx_parallel_temp7;
-              __pyx_v_j = __pyx_parallel_temp8;
-              __pyx_v_srr = __pyx_parallel_temp9;
-              __pyx_v_srx = __pyx_parallel_temp10;
-              __pyx_v_sry = __pyx_parallel_temp11;
-              __pyx_v_srz = __pyx_parallel_temp12;
-              __pyx_v_sxx = __pyx_parallel_temp13;
-              __pyx_v_sxy = __pyx_parallel_temp14;
-              __pyx_v_sxz = __pyx_parallel_temp15;
-              __pyx_v_syy = __pyx_parallel_temp16;
-              __pyx_v_syz = __pyx_parallel_temp17;
-              __pyx_v_vv1 = __pyx_parallel_temp18;
-              __pyx_v_vv2 = __pyx_parallel_temp19;
-              __pyx_v_vx = __pyx_parallel_temp20;
-              __pyx_v_vy = __pyx_parallel_temp21;
-              __pyx_v_vz = __pyx_parallel_temp22;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
 190: 
-
+191:         return depsilon
-
  __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 192: 
-
 193: 
-
+194:     cpdef frictionT3t(self, double depsilon, double [:] V1s, double [:] D, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_9frictionT3t(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_9unbounded_2PD_frictionT3t(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_D, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_Ddotidr;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  CYTHON_UNUSED double __pyx_v_mud;
-  double __pyx_v_mud1;
-  double __pyx_v_gammaT;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__14)
-  __Pyx_TraceCall("frictionT3t", __pyx_f[0], 194, 0, __PYX_ERR(0, 194, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionT3t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_9unbounded_2PD_9frictionT3t)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 194, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_V1s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_D.memview)) { __Pyx_RaiseUnboundLocalError("D"); __PYX_ERR(0, 194, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_D, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 194, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionT3t", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_9frictionT3t(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_9unbounded_2PD_8frictionT3t, "\n        Compute energy dissipation due to 3t mode of the slip :math:`\\dot{\\epsilon}=V^{1s}\\cdot\\gamma^{T,3t}\\cdot V^{3t}`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation\n        V1s: np.array\n            An array of 1s mode of velocities\n            An array of size 3*N,\n        D: np.array\n            An array of 3t mode of the slip\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_9unbounded_2PD_9frictionT3t = {"frictionT3t", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_9unbounded_2PD_9frictionT3t, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_9unbounded_2PD_8frictionT3t};
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_9frictionT3t(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_V1s = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_D = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionT3t (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_V1s,&__pyx_n_s_D,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V1s)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, 1); __PYX_ERR(0, 194, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_D)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, 2); __PYX_ERR(0, 194, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, 3); __PYX_ERR(0, 194, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionT3t") < 0)) __PYX_ERR(0, 194, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
-    __pyx_v_V1s = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V1s.memview)) __PYX_ERR(0, 194, __pyx_L3_error)
-    __pyx_v_D = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_D.memview)) __PYX_ERR(0, 194, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 194, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 194, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_D, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionT3t", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_9unbounded_2PD_8frictionT3t(((struct __pyx_obj_8pystokes_5power_9unbounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_D, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_D, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_9unbounded_2PD_8frictionT3t(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_D, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__14)
-  __Pyx_TraceCall("frictionT3t (wrapper)", __pyx_f[0], 194, 0, __PYX_ERR(0, 194, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 194, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_D.memview)) { __Pyx_RaiseUnboundLocalError("D"); __PYX_ERR(0, 194, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 194, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_9unbounded_2PD_frictionT3t(__pyx_v_self, __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_D, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionT3t", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
-/* … */
-  __pyx_tuple__35 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_V1s, __pyx_n_s_D, __pyx_n_s_r); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 194, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_9unbounded_2PD_9frictionT3t, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionT3t, NULL, __pyx_n_s_pystokes_power_unbounded, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_9unbounded_PD, __pyx_n_s_frictionT3t, __pyx_t_7) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_9unbounded_PD);
-  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_unbounded_pyx, __pyx_n_s_frictionT3t, 194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 194, __pyx_L1_error)
-
 195:         """
-
 196:         Compute energy dissipation due to 3t mode of the slip :math:`\dot{\epsilon}=V^{1s}\cdot\gamma^{T,3t}\cdot V^{3t}`
-
 197:         ...
-
 198:         Parameters
-
 199:         ----------
-
 200:         depsilon: power dissipation
-
 201:         V1s: np.array
-
 202:             An array of 1s mode of velocities
-
 203:             An array of size 3*N,
-
 204:         D: np.array
-
 205:             An array of 3t mode of the slip
-
 206:             An array of size 3*N,
-
 207:         r: np.array
-
 208:             An array of positions
-
 209:             An array of size 3*N,
-
 210:         ----------
-
 211:         """
-
 212: 
-
+213:         cdef int N = self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(213,0,__PYX_ERR(0, 213, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
+214:         cdef double dx, dy, dz, idr, idr3, Ddotidr, vx, vy, vz, mud = 3.0*self.a*self.a*self.a/5, mud1 = -1.0*(self.a**5)/10
-
  __Pyx_TraceLine(214,0,__PYX_ERR(0, 214, __pyx_L1_error))
-  __pyx_v_mud = ((((3.0 * __pyx_v_self->a) * __pyx_v_self->a) * __pyx_v_self->a) / 5.0);
-  __pyx_v_mud1 = ((-1.0 * pow(__pyx_v_self->a, 5.0)) / 10.0);
-
+215:         cdef double gammaT = self.gammaT
-
  __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->gammaT;
-  __pyx_v_gammaT = __pyx_t_10;
-
 216: 
-
+217:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_Ddotidr) reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_j) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_Ddotidr = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-/* … */
-      __Pyx_TraceLine(217,1,__PYX_ERR(0, 217, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+218:             vx=0; vy=0;   vz=0;
-
                            __Pyx_TraceLine(218,1,__PYX_ERR(0, 218, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+219:             for j in range(N):
-
                            __Pyx_TraceLine(219,1,__PYX_ERR(0, 219, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+220:                 if i != j:
-
                              __Pyx_TraceLine(220,1,__PYX_ERR(0, 220, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_16) {
-/* … */
-                              }
-                            }
-
+221:                     dx = r[ i]   - r[j]
-
                                __Pyx_TraceLine(221,1,__PYX_ERR(0, 221, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_i;
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+222:                     dy = r[i+N] - r[j+N]
-
                                __Pyx_TraceLine(222,1,__PYX_ERR(0, 222, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+223:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(223,1,__PYX_ERR(0, 223, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+224:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(224,1,__PYX_ERR(0, 224, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+225:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(225,1,__PYX_ERR(0, 225, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+226:                     Ddotidr = (D[j]*dx + D[j+N]*dy + D[j+xx]*dz)*idr*idr
-
                                __Pyx_TraceLine(226,1,__PYX_ERR(0, 226, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Ddotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_18 * __pyx_v_D.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 227: 
-
+228:                     vx += (D[j]    - 3.0*Ddotidr*dx )*idr3
-
                                __Pyx_TraceLine(228,1,__PYX_ERR(0, 228, __pyx_L8_error))
-                                __pyx_t_19 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + (((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) ))) - ((3.0 * __pyx_v_Ddotidr) * __pyx_v_dx)) * __pyx_v_idr3));
-
+229:                     vy += (D[j+N] - 3.0*Ddotidr*dy )*idr3
-
                                __Pyx_TraceLine(229,1,__PYX_ERR(0, 229, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + (((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) ))) - ((3.0 * __pyx_v_Ddotidr) * __pyx_v_dy)) * __pyx_v_idr3));
-
+230:                     vz += (D[j+xx] - 3.0*Ddotidr*dz )*idr3
-
                                __Pyx_TraceLine(230,1,__PYX_ERR(0, 230, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vz = (__pyx_v_vz + (((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) ))) - ((3.0 * __pyx_v_Ddotidr) * __pyx_v_dz)) * __pyx_v_idr3));
-
 231: 
-
+232:             depsilon += -V1s[i] * gammaT * mud1*vx
-
                            __Pyx_TraceLine(232,1,__PYX_ERR(0, 232, __pyx_L8_error))
-                            __pyx_t_19 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_19 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gammaT) * __pyx_v_mud1) * __pyx_v_vx));
-
+233:             depsilon += -V1s[i+N] * gammaT * mud1*vy
-
                            __Pyx_TraceLine(233,1,__PYX_ERR(0, 233, __pyx_L8_error))
-                            __pyx_t_19 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_19 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gammaT) * __pyx_v_mud1) * __pyx_v_vy));
-
+234:             depsilon += -V1s[i+xx] * gammaT * mud1*vz
-
                            __Pyx_TraceLine(234,1,__PYX_ERR(0, 234, __pyx_L8_error))
-                            __pyx_t_19 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_19 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gammaT) * __pyx_v_mud1) * __pyx_v_vz));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates3)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_Ddotidr;
-                                __pyx_parallel_temp1 = __pyx_v_depsilon;
-                                __pyx_parallel_temp2 = __pyx_v_dx;
-                                __pyx_parallel_temp3 = __pyx_v_dy;
-                                __pyx_parallel_temp4 = __pyx_v_dz;
-                                __pyx_parallel_temp5 = __pyx_v_i;
-                                __pyx_parallel_temp6 = __pyx_v_idr;
-                                __pyx_parallel_temp7 = __pyx_v_idr3;
-                                __pyx_parallel_temp8 = __pyx_v_j;
-                                __pyx_parallel_temp9 = __pyx_v_vx;
-                                __pyx_parallel_temp10 = __pyx_v_vy;
-                                __pyx_parallel_temp11 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_Ddotidr = __pyx_parallel_temp0;
-              __pyx_v_depsilon = __pyx_parallel_temp1;
-              __pyx_v_dx = __pyx_parallel_temp2;
-              __pyx_v_dy = __pyx_parallel_temp3;
-              __pyx_v_dz = __pyx_parallel_temp4;
-              __pyx_v_i = __pyx_parallel_temp5;
-              __pyx_v_idr = __pyx_parallel_temp6;
-              __pyx_v_idr3 = __pyx_parallel_temp7;
-              __pyx_v_j = __pyx_parallel_temp8;
-              __pyx_v_vx = __pyx_parallel_temp9;
-              __pyx_v_vy = __pyx_parallel_temp10;
-              __pyx_v_vz = __pyx_parallel_temp11;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+235:         return depsilon
-
  __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 236: 
-
 237: 
-
 238:     ## Angular velocities
-
+239:     cpdef frictionRT(self, double depsilon, double [:] v, double [:] o, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_11frictionRT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_9unbounded_2PD_frictionRT(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_ox;
-  double __pyx_v_oy;
-  double __pyx_v_oz;
-  double __pyx_v_muv;
-  double __pyx_v_gg;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__15)
-  __Pyx_TraceCall("frictionRT", __pyx_f[0], 239, 0, __PYX_ERR(0, 239, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionRT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_9unbounded_2PD_11frictionRT)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 239, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_v, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 239, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_o, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 239, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionRT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_11frictionRT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_9unbounded_2PD_10frictionRT, "\n        Compute energy dissipation due to rotation using :math:`\\dot{\\epsilon}=\\Omega\\cdot\\gamma^{RT}\\cdot V`\n        ...\n        Parameters\n        ----------\n        depsilon: np.array\n                   An array of energy dissipation\n                   An array of size 3*N,\n        v: np.array\n            An array of velocities\n            An array of size 3*N,\n        o: np.array\n            An array of angular velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_9unbounded_2PD_11frictionRT = {"frictionRT", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_9unbounded_2PD_11frictionRT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_9unbounded_2PD_10frictionRT};
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_11frictionRT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_v = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_o = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionRT (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_v,&__pyx_n_s_o,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, 1); __PYX_ERR(0, 239, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_o)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, 2); __PYX_ERR(0, 239, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, 3); __PYX_ERR(0, 239, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionRT") < 0)) __PYX_ERR(0, 239, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error)
-    __pyx_v_v = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_v.memview)) __PYX_ERR(0, 239, __pyx_L3_error)
-    __pyx_v_o = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_o.memview)) __PYX_ERR(0, 239, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 239, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 239, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionRT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_9unbounded_2PD_10frictionRT(((struct __pyx_obj_8pystokes_5power_9unbounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_9unbounded_2PD_10frictionRT(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__15)
-  __Pyx_TraceCall("frictionRT (wrapper)", __pyx_f[0], 239, 0, __PYX_ERR(0, 239, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 239, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 239, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 239, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_9unbounded_2PD_frictionRT(__pyx_v_self, __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionRT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
-
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_9unbounded_2PD_11frictionRT, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionRT, NULL, __pyx_n_s_pystokes_power_unbounded, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_9unbounded_PD, __pyx_n_s_frictionRT, __pyx_t_7) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_9unbounded_PD);
-/* … */
-  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_unbounded_pyx, __pyx_n_s_frictionRT, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 239, __pyx_L1_error)
-
 240:         """
-
 241:         Compute energy dissipation due to rotation using :math:`\dot{\epsilon}=\Omega\cdot\gamma^{RT}\cdot V`
-
 242:         ...
-
 243:         Parameters
-
 244:         ----------
-
 245:         depsilon: np.array
-
 246:                    An array of energy dissipation
-
 247:                    An array of size 3*N,
-
 248:         v: np.array
-
 249:             An array of velocities
-
 250:             An array of size 3*N,
-
 251:         o: np.array
-
 252:             An array of angular velocities
-
 253:             An array of size 3*N,
-
 254:         r: np.array
-
 255:             An array of positions
-
 256:             An array of size 3*N,
-
 257:         ----------
-
 258:         """
-
 259: 
-
+260:         cdef int N = self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
+261:         cdef double dx, dy, dz, idr, idr3, ox, oy, oz, muv=self.muv
-
  __Pyx_TraceLine(261,0,__PYX_ERR(0, 261, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_10;
-
+262:         cdef double gg= -self.gammaT*self.gammaR
-
  __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
-  __pyx_v_gg = ((-__pyx_v_self->gammaT) * __pyx_v_self->gammaR);
-
 263: 
-
+264:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(264,0,__PYX_ERR(0, 264, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_j) reduction(+:__pyx_v_ox) reduction(+:__pyx_v_oy) reduction(+:__pyx_v_oz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-/* … */
-      __Pyx_TraceLine(264,1,__PYX_ERR(0, 264, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+265:             ox=0;   oy=0;   oz=0;
-
                            __Pyx_TraceLine(265,1,__PYX_ERR(0, 265, __pyx_L8_error))
-                            __pyx_v_ox = 0.0;
-                            __pyx_v_oy = 0.0;
-                            __pyx_v_oz = 0.0;
-
+266:             for j in range(N):
-
                            __Pyx_TraceLine(266,1,__PYX_ERR(0, 266, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+267:                 if i != j:
-
                              __Pyx_TraceLine(267,1,__PYX_ERR(0, 267, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_16) {
-/* … */
-                              }
-                            }
-
+268:                     dx = r[i]    - r[j]
-
                                __Pyx_TraceLine(268,1,__PYX_ERR(0, 268, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_i;
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+269:                     dy = r[i+N] - r[j+N]
-
                                __Pyx_TraceLine(269,1,__PYX_ERR(0, 269, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+270:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(270,1,__PYX_ERR(0, 270, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+271:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(271,1,__PYX_ERR(0, 271, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+272:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(272,1,__PYX_ERR(0, 272, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
 273: 
-
+274:                     ox += (v[j+N]*dz - v[j+xx]*dy )*idr3
-
                                __Pyx_TraceLine(274,1,__PYX_ERR(0, 274, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_ox = (__pyx_v_ox + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy)) * __pyx_v_idr3));
-
+275:                     oy += (v[j+xx]*dx - v[j]   *dz )*idr3
-
                                __Pyx_TraceLine(275,1,__PYX_ERR(0, 275, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_oy = (__pyx_v_oy + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr3));
-
+276:                     oz += (v[j]   *dy - v[j+N]*dx )*idr3
-
                                __Pyx_TraceLine(276,1,__PYX_ERR(0, 276, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oz = (__pyx_v_oz + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx)) * __pyx_v_idr3));
-
+277:             depsilon += o[i] * gg * muv*ox
-
                            __Pyx_TraceLine(277,1,__PYX_ERR(0, 277, __pyx_L8_error))
-                            __pyx_t_17 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_ox));
-
+278:             depsilon += o[i+N] * gg * muv*oy
-
                            __Pyx_TraceLine(278,1,__PYX_ERR(0, 278, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_oy));
-
+279:             depsilon += o[i+xx] * gg * muv*oz
-
                            __Pyx_TraceLine(279,1,__PYX_ERR(0, 279, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_oz));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates4)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_depsilon;
-                                __pyx_parallel_temp1 = __pyx_v_dx;
-                                __pyx_parallel_temp2 = __pyx_v_dy;
-                                __pyx_parallel_temp3 = __pyx_v_dz;
-                                __pyx_parallel_temp4 = __pyx_v_i;
-                                __pyx_parallel_temp5 = __pyx_v_idr;
-                                __pyx_parallel_temp6 = __pyx_v_idr3;
-                                __pyx_parallel_temp7 = __pyx_v_j;
-                                __pyx_parallel_temp8 = __pyx_v_ox;
-                                __pyx_parallel_temp9 = __pyx_v_oy;
-                                __pyx_parallel_temp10 = __pyx_v_oz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_depsilon = __pyx_parallel_temp0;
-              __pyx_v_dx = __pyx_parallel_temp1;
-              __pyx_v_dy = __pyx_parallel_temp2;
-              __pyx_v_dz = __pyx_parallel_temp3;
-              __pyx_v_i = __pyx_parallel_temp4;
-              __pyx_v_idr = __pyx_parallel_temp5;
-              __pyx_v_idr3 = __pyx_parallel_temp6;
-              __pyx_v_j = __pyx_parallel_temp7;
-              __pyx_v_ox = __pyx_parallel_temp8;
-              __pyx_v_oy = __pyx_parallel_temp9;
-              __pyx_v_oz = __pyx_parallel_temp10;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+280:         return  depsilon
-
  __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 281: 
-
 282: 
-
+283:     cpdef frictionRR(self, double depsilon, double [:] o, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_13frictionRR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_9unbounded_2PD_frictionRR(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_Odotidr;
-  double __pyx_v_ox;
-  double __pyx_v_oy;
-  double __pyx_v_oz;
-  double __pyx_v_gR;
-  double __pyx_v_gg;
-  double __pyx_v_muv;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__16)
-  __Pyx_TraceCall("frictionRR", __pyx_f[0], 283, 0, __PYX_ERR(0, 283, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionRR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_9unbounded_2PD_13frictionRR)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 283, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_o, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 283, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
-        __pyx_t_8 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_6))) {
-          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
-          if (likely(__pyx_t_7)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-            __Pyx_INCREF(__pyx_t_7);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_6, function);
-            __pyx_t_8 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8);
-          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionRR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_13frictionRR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_9unbounded_2PD_12frictionRR, "\n        Compute energy dissipation due to translation using :math:`\\dot{\\epsilon}=\\Omega\\cdot\\gamma^{RR}\\cdot \\Omega`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation\n        o: np.array\n            An array of angular velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_9unbounded_2PD_13frictionRR = {"frictionRR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_9unbounded_2PD_13frictionRR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_9unbounded_2PD_12frictionRR};
-static PyObject *__pyx_pw_8pystokes_5power_9unbounded_2PD_13frictionRR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_o = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionRR (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_o,&__pyx_n_s_r,0};
-  PyObject* values[3] = {0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_o)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRR", 1, 3, 3, 1); __PYX_ERR(0, 283, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRR", 1, 3, 3, 2); __PYX_ERR(0, 283, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionRR") < 0)) __PYX_ERR(0, 283, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 3)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error)
-    __pyx_v_o = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_o.memview)) __PYX_ERR(0, 283, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 283, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionRR", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 283, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionRR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_9unbounded_2PD_12frictionRR(((struct __pyx_obj_8pystokes_5power_9unbounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_o, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_9unbounded_2PD_12frictionRR(struct __pyx_obj_8pystokes_5power_9unbounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__16)
-  __Pyx_TraceCall("frictionRR (wrapper)", __pyx_f[0], 283, 0, __PYX_ERR(0, 283, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 283, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 283, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_9unbounded_2PD_frictionRR(__pyx_v_self, __pyx_v_depsilon, __pyx_v_o, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.unbounded.PD.frictionRR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
-/* … */
-  __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_o, __pyx_n_s_r); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 283, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_9unbounded_2PD_13frictionRR, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionRR, NULL, __pyx_n_s_pystokes_power_unbounded, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_9unbounded_PD, __pyx_n_s_frictionRR, __pyx_t_7) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_9unbounded_PD);
-  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_unbounded_pyx, __pyx_n_s_frictionRR, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 283, __pyx_L1_error)
-
 284:         """
-
 285:         Compute energy dissipation due to translation using :math:`\dot{\epsilon}=\Omega\cdot\gamma^{RR}\cdot \Omega`
-
 286:         ...
-
 287:         Parameters
-
 288:         ----------
-
 289:         depsilon: power dissipation
-
 290:         o: np.array
-
 291:             An array of angular velocities
-
 292:             An array of size 3*N,
-
 293:         r: np.array
-
 294:             An array of positions
-
 295:             An array of size 3*N,
-
 296:         ----------
-
 297:         """
-
 298: 
-
+299:         cdef int N = self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
-  __pyx_t_8 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_8;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
+300:         cdef double dx, dy, dz, idr, idr3, Odotidr, ox, oy, oz, gR=self.gammaR, gg=-gR*gR, muv=self.muv
-
  __Pyx_TraceLine(300,0,__PYX_ERR(0, 300, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->gammaR;
-  __pyx_v_gR = __pyx_t_9;
-  __pyx_v_gg = ((-__pyx_v_gR) * __pyx_v_gR);
-  __pyx_t_9 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_9;
-
 301: 
-
+302:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(302,0,__PYX_ERR(0, 302, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_8 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_11 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_11 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_Odotidr) reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_j) reduction(+:__pyx_v_ox) reduction(+:__pyx_v_oy) reduction(+:__pyx_v_oz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_10);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_Odotidr = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-/* … */
-      __Pyx_TraceLine(302,1,__PYX_ERR(0, 302, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+303:             ox=0;   oy=0;   oz=0;
-
                            __Pyx_TraceLine(303,1,__PYX_ERR(0, 303, __pyx_L8_error))
-                            __pyx_v_ox = 0.0;
-                            __pyx_v_oy = 0.0;
-                            __pyx_v_oz = 0.0;
-
+304:             for j in range(N):
-
                            __Pyx_TraceLine(304,1,__PYX_ERR(0, 304, __pyx_L8_error))
-                            __pyx_t_12 = __pyx_v_N;
-                            __pyx_t_13 = __pyx_t_12;
-                            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-                              __pyx_v_j = __pyx_t_14;
-
+305:                 if i != j:
-
                              __Pyx_TraceLine(305,1,__PYX_ERR(0, 305, __pyx_L8_error))
-                              __pyx_t_15 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_15) {
-/* … */
-                              }
-                            }
-
+306:                     dx = r[i]      - r[j]
-
                                __Pyx_TraceLine(306,1,__PYX_ERR(0, 306, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_i;
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+307:                     dy = r[i+N]   - r[j+N]
-
                                __Pyx_TraceLine(307,1,__PYX_ERR(0, 307, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+308:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(308,1,__PYX_ERR(0, 308, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+309:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(309,1,__PYX_ERR(0, 309, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+310:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(310,1,__PYX_ERR(0, 310, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+311:                     Odotidr = ( o[j]*dx + o[j+N]*dy + o[j+xx]*dz )*idr*idr
-
                                __Pyx_TraceLine(311,1,__PYX_ERR(0, 311, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Odotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 312: 
-
+313:                     ox += ( o[j]    - 3*Odotidr*dx )*idr3
-
                                __Pyx_TraceLine(313,1,__PYX_ERR(0, 313, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_ox = (__pyx_v_ox + (((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) - ((3.0 * __pyx_v_Odotidr) * __pyx_v_dx)) * __pyx_v_idr3));
-
+314:                     oy += ( o[j+N] - 3*Odotidr*dy )*idr3
-
                                __Pyx_TraceLine(314,1,__PYX_ERR(0, 314, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oy = (__pyx_v_oy + (((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) - ((3.0 * __pyx_v_Odotidr) * __pyx_v_dy)) * __pyx_v_idr3));
-
+315:                     oz += ( o[j+xx] - 3*Odotidr*dz )*idr3
-
                                __Pyx_TraceLine(315,1,__PYX_ERR(0, 315, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_oz = (__pyx_v_oz + (((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) - ((3.0 * __pyx_v_Odotidr) * __pyx_v_dz)) * __pyx_v_idr3));
-
 316: 
-
+317:             depsilon += o[i] * (gR*o[i]    - gg*0.5*muv*ox)
-
                            __Pyx_TraceLine(317,1,__PYX_ERR(0, 317, __pyx_L8_error))
-                            __pyx_t_18 = __pyx_v_i;
-                            __pyx_t_16 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * ((__pyx_v_gR * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - (((__pyx_v_gg * 0.5) * __pyx_v_muv) * __pyx_v_ox))));
-
+318:             depsilon += o[i+N] * (gR*o[i+N] - gg*0.5*muv*oy)
-
                            __Pyx_TraceLine(318,1,__PYX_ERR(0, 318, __pyx_L8_error))
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * ((__pyx_v_gR * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - (((__pyx_v_gg * 0.5) * __pyx_v_muv) * __pyx_v_oy))));
-
+319:             depsilon += o[i+xx] * (gR*o[i+xx] - gg*0.5*muv*oz)
-
                            __Pyx_TraceLine(319,1,__PYX_ERR(0, 319, __pyx_L8_error))
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * ((__pyx_v_gR * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - (((__pyx_v_gg * 0.5) * __pyx_v_muv) * __pyx_v_oz))));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates5)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_Odotidr;
-                                __pyx_parallel_temp1 = __pyx_v_depsilon;
-                                __pyx_parallel_temp2 = __pyx_v_dx;
-                                __pyx_parallel_temp3 = __pyx_v_dy;
-                                __pyx_parallel_temp4 = __pyx_v_dz;
-                                __pyx_parallel_temp5 = __pyx_v_i;
-                                __pyx_parallel_temp6 = __pyx_v_idr;
-                                __pyx_parallel_temp7 = __pyx_v_idr3;
-                                __pyx_parallel_temp8 = __pyx_v_j;
-                                __pyx_parallel_temp9 = __pyx_v_ox;
-                                __pyx_parallel_temp10 = __pyx_v_oy;
-                                __pyx_parallel_temp11 = __pyx_v_oz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_Odotidr = __pyx_parallel_temp0;
-              __pyx_v_depsilon = __pyx_parallel_temp1;
-              __pyx_v_dx = __pyx_parallel_temp2;
-              __pyx_v_dy = __pyx_parallel_temp3;
-              __pyx_v_dz = __pyx_parallel_temp4;
-              __pyx_v_i = __pyx_parallel_temp5;
-              __pyx_v_idr = __pyx_parallel_temp6;
-              __pyx_v_idr3 = __pyx_parallel_temp7;
-              __pyx_v_j = __pyx_parallel_temp8;
-              __pyx_v_ox = __pyx_parallel_temp9;
-              __pyx_v_oy = __pyx_parallel_temp10;
-              __pyx_v_oz = __pyx_parallel_temp11;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+320:         return  depsilon
-
  __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
diff --git a/pystokes/power/wallBounded.html b/pystokes/power/wallBounded.html deleted file mode 100644 index ecc8dc4..0000000 --- a/pystokes/power/wallBounded.html +++ /dev/null @@ -1,5212 +0,0 @@ - - - - - - Cython: wallBounded.pyx - - - -

Generated by Cython 3.0.5

-

- Yellow lines hint at Python interaction.
- Click on a line that starts with a "+" to see the C code that Cython generated for it. -

-

Raw output: wallBounded.c

-
+001: cimport cython
-
  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
-  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
 002: from libc.math cimport sqrt
-
 003: from cython.parallel import prange
-
+004: cdef double PI = 3.14159265359
-
  __Pyx_TraceLine(4,0,__PYX_ERR(0, 4, __pyx_L1_error))
-  __pyx_v_8pystokes_5power_11wallBounded_PI = 3.14159265359;
-
+005: cdef double sqrt8 = 2.82842712475
-
  __Pyx_TraceLine(5,0,__PYX_ERR(0, 5, __pyx_L1_error))
-  __pyx_v_8pystokes_5power_11wallBounded_sqrt8 = 2.82842712475;
-
+006: cdef double sqrt2 = 1.41421356237
-
  __Pyx_TraceLine(6,0,__PYX_ERR(0, 6, __pyx_L1_error))
-  __pyx_v_8pystokes_5power_11wallBounded_sqrt2 = 1.41421356237;
-
+007: import numpy as np
-
  __Pyx_TraceLine(7,0,__PYX_ERR(0, 7, __pyx_L1_error))
-  __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
 008: cimport numpy as np
-
 009: 
-
 010: @cython.boundscheck(False)
-
 011: @cython.cdivision(True)
-
 012: @cython.nonecheck(False)
-
 013: @cython.wraparound(False)
-
+014: cdef class PD:
-
struct __pyx_vtabstruct_8pystokes_5power_11wallBounded_PD {
-  PyObject *(*frictionTT)(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionTR)(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionT2s)(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionT3t)(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionRT)(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-  PyObject *(*frictionRR)(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
-};
-static struct __pyx_vtabstruct_8pystokes_5power_11wallBounded_PD *__pyx_vtabptr_8pystokes_5power_11wallBounded_PD;
-
-
 015:     """
-
 016:     Power Dissipation (PD)
-
 017:     
-
 018:     ...
-
 019: 
-
 020:     Parameters
-
 021:     ----------
-
 022:     radius: float
-
 023:         Radius of the particles (a)
-
 024:     particles: int
-
 025:         Number of particles (N) 
-
 026:     viscosity: float  
-
 027:         Viscosity of the fluid (eta)
-
 028:     
-
 029:     """
-
 030: 
-
+031:     def __init__(self, radius=1, particles=1, viscosity=1.0):
-
/* Python wrapper */
-static int __pyx_pw_8pystokes_5power_11wallBounded_2PD_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_8pystokes_5power_11wallBounded_2PD_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_radius = 0;
-  PyObject *__pyx_v_particles = 0;
-  PyObject *__pyx_v_viscosity = 0;
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,&__pyx_n_s_particles,&__pyx_n_s_viscosity,0};
-  PyObject* values[3] = {0,0,0};
-    values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1));
-    values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1));
-    values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_float_1_0));
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_radius);
-          if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
-          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_particles);
-          if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
-          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_viscosity);
-          if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
-          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 31, __pyx_L3_error)
-      }
-    } else {
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_radius = values[0];
-    __pyx_v_particles = values[1];
-    __pyx_v_viscosity = values[2];
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 31, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
-    }
-  }
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_11wallBounded_2PD___init__(((struct __pyx_obj_8pystokes_5power_11wallBounded_PD *)__pyx_v_self), __pyx_v_radius, __pyx_v_particles, __pyx_v_viscosity);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_8pystokes_5power_11wallBounded_2PD___init__(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, PyObject *__pyx_v_radius, PyObject *__pyx_v_particles, PyObject *__pyx_v_viscosity) {
-  int __pyx_r;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceCall("__init__", __pyx_f[0], 31, 0, __PYX_ERR(0, 31, __pyx_L1_error));
-/* … */
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
+032:         self.a   = radius
-
  __Pyx_TraceLine(32,0,__PYX_ERR(0, 32, __pyx_L1_error))
-  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_radius); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error)
-  __pyx_v_self->a = __pyx_t_1;
-
+033:         self.N  = particles
-
  __Pyx_TraceLine(33,0,__PYX_ERR(0, 33, __pyx_L1_error))
-  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_particles); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error)
-  __pyx_v_self->N = __pyx_t_2;
-
+034:         self.eta = viscosity
-
  __Pyx_TraceLine(34,0,__PYX_ERR(0, 34, __pyx_L1_error))
-  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_viscosity); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error)
-  __pyx_v_self->eta = __pyx_t_1;
-
+035:         self.gammaT = 6*PI*self.eta*self.a
-
  __Pyx_TraceLine(35,0,__PYX_ERR(0, 35, __pyx_L1_error))
-  __pyx_v_self->gammaT = (((6.0 * __pyx_v_8pystokes_5power_11wallBounded_PI) * __pyx_v_self->eta) * __pyx_v_self->a);
-
+036:         self.gammaR = 8*PI*self.eta*self.a**3
-
  __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error))
-  __pyx_v_self->gammaR = (((8.0 * __pyx_v_8pystokes_5power_11wallBounded_PI) * __pyx_v_self->eta) * pow(__pyx_v_self->a, 3.0));
-
+037:         self.mu  = 1.0/self.gammaT
-
  __Pyx_TraceLine(37,0,__PYX_ERR(0, 37, __pyx_L1_error))
-  __pyx_v_self->mu = (1.0 / __pyx_v_self->gammaT);
-
+038:         self.muv = 1.0/(8*PI*self.eta)
-
  __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error))
-  __pyx_v_self->muv = (1.0 / ((8.0 * __pyx_v_8pystokes_5power_11wallBounded_PI) * __pyx_v_self->eta));
-
+039:         self.mur = 1.0/self.gammaR
-
  __Pyx_TraceLine(39,0,__PYX_ERR(0, 39, __pyx_L1_error))
-  __pyx_v_self->mur = (1.0 / __pyx_v_self->gammaR);
-
 040: 
-
+041:         self.Mobility = np.zeros( (3*self.N, 3*self.N), dtype=np.float64)
-
  __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error))
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyInt_From_long((3 * __pyx_v_self->N)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = __Pyx_PyInt_From_long((3 * __pyx_v_self->N)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_3);
-  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error);
-  __Pyx_GIVEREF(__pyx_t_5);
-  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error);
-  __pyx_t_3 = 0;
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_6);
-  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error);
-  __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 41, __pyx_L1_error)
-  __Pyx_GIVEREF(__pyx_t_7);
-  __Pyx_GOTREF((PyObject *)__pyx_v_self->Mobility);
-  __Pyx_DECREF((PyObject *)__pyx_v_self->Mobility);
-  __pyx_v_self->Mobility = ((PyArrayObject *)__pyx_t_7);
-  __pyx_t_7 = 0;
-
 042: 
-
 043: 
-
+044:     cpdef frictionTT(self, double depsilon, double [:] v, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_3frictionTT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_11wallBounded_2PD_frictionTT(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_N;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_idr5;
-  double __pyx_v_Vdotidr;
-  double __pyx_v_h2;
-  double __pyx_v_hsq;
-  double __pyx_v_tempV;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  double __pyx_v_mu;
-  double __pyx_v_muv;
-  double __pyx_v_a2;
-  double __pyx_v_gT;
-  double __pyx_v_gg;
-  double __pyx_v_a;
-  double __pyx_v_h;
-  double __pyx_v_hbar_inv;
-  double __pyx_v_hbar_inv3;
-  double __pyx_v_hbar_inv5;
-  double __pyx_v_muTTpara1;
-  double __pyx_v_muTTpara2;
-  double __pyx_v_muTTpara3;
-  double __pyx_v_muTTperp1;
-  double __pyx_v_muTTperp2;
-  double __pyx_v_muTTperp3;
-  double __pyx_v_mux;
-  double __pyx_v_muy;
-  double __pyx_v_muz;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__11)
-  __Pyx_TraceCall("frictionTT", __pyx_f[0], 44, 0, __PYX_ERR(0, 44, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionTT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_11wallBounded_2PD_3frictionTT)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 44, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_v, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 44, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
-        __pyx_t_8 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_6))) {
-          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
-          if (likely(__pyx_t_7)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-            __Pyx_INCREF(__pyx_t_7);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_6, function);
-            __pyx_t_8 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8);
-          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionTT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_3frictionTT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_11wallBounded_2PD_2frictionTT, "\n        Compute power dissipation due to translation using :math:`\\dot{\\epsilon}=V\\cdot\\gamma^{TT}\\cdot V`\n        ...\n        Parameters\n        ----------\n        depsilon: energy dissipation,\n        v: np.array\n            An array of velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_11wallBounded_2PD_3frictionTT = {"frictionTT", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_11wallBounded_2PD_3frictionTT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_11wallBounded_2PD_2frictionTT};
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_3frictionTT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_v = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionTT (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_v,&__pyx_n_s_r,0};
-  PyObject* values[3] = {0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTT", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTT", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionTT") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 3)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error)
-    __pyx_v_v = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_v.memview)) __PYX_ERR(0, 44, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 44, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionTT", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionTT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_11wallBounded_2PD_2frictionTT(((struct __pyx_obj_8pystokes_5power_11wallBounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_v, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_11wallBounded_2PD_2frictionTT(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__11)
-  __Pyx_TraceCall("frictionTT (wrapper)", __pyx_f[0], 44, 0, __PYX_ERR(0, 44, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 44, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 44, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_11wallBounded_2PD_frictionTT(__pyx_v_self, __pyx_v_depsilon, __pyx_v_v, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionTT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error))
-/* … */
-  __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_v, __pyx_n_s_r); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_11wallBounded_2PD_3frictionTT, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionTT, NULL, __pyx_n_s_pystokes_power_wallBounded, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_11wallBounded_PD, __pyx_n_s_frictionTT, __pyx_t_7) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_11wallBounded_PD);
-  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_wallBounded_pyx, __pyx_n_s_frictionTT, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 44, __pyx_L1_error)
-
 045:         """
-
 046:         Compute power dissipation due to translation using :math:`\dot{\epsilon}=V\cdot\gamma^{TT}\cdot V`
-
 047:         ...
-
 048:         Parameters
-
 049:         ----------
-
 050:         depsilon: energy dissipation,
-
 051:         v: np.array
-
 052:             An array of velocities
-
 053:             An array of size 3*N,
-
 054:         r: np.array
-
 055:             An array of positions
-
 056:             An array of size 3*N,
-
 057:         ----------
-
 058:         """
-
 059: 
-
+060:         cdef int i, j, N=self.N, xx=2*N
-
  __Pyx_TraceLine(60,0,__PYX_ERR(0, 60, __pyx_L1_error))
-  __pyx_t_8 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_8;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
 061:         cdef double dx, dy, dz, idr, idr3, idr5, Vdotidr, h2, hsq, tempV
-
 062:         cdef double vx, vy, vz
-
+063:         cdef double mu=self.mu, muv=self.muv, a2=self.a*self.a/3.0
-
  __Pyx_TraceLine(63,0,__PYX_ERR(0, 63, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->mu;
-  __pyx_v_mu = __pyx_t_9;
-  __pyx_t_9 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_9;
-  __pyx_v_a2 = ((__pyx_v_self->a * __pyx_v_self->a) / 3.0);
-
+064:         cdef double gT=self.gammaT, gg = -gT*gT
-
  __Pyx_TraceLine(64,0,__PYX_ERR(0, 64, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->gammaT;
-  __pyx_v_gT = __pyx_t_9;
-  __pyx_v_gg = ((-__pyx_v_gT) * __pyx_v_gT);
-
 065: 
-
+066:         cdef double a = self.a
-
  __Pyx_TraceLine(66,0,__PYX_ERR(0, 66, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->a;
-  __pyx_v_a = __pyx_t_9;
-
 067:         cdef double h, hbar_inv, hbar_inv3, hbar_inv5
-
+068:         cdef double muTTpara1 = -9./16., muTTpara2 = 1./8.
-
  __Pyx_TraceLine(68,0,__PYX_ERR(0, 68, __pyx_L1_error))
-  __pyx_v_muTTpara1 = (-9. / 16.);
-  __pyx_v_muTTpara2 = (1. / 8.);
-
+069:         cdef double muTTpara3 = -1./16.
-
  __Pyx_TraceLine(69,0,__PYX_ERR(0, 69, __pyx_L1_error))
-  __pyx_v_muTTpara3 = (-1. / 16.);
-
+070:         cdef double muTTperp1 = -9./8., muTTperp2 = 1./2.
-
  __Pyx_TraceLine(70,0,__PYX_ERR(0, 70, __pyx_L1_error))
-  __pyx_v_muTTperp1 = (-9. / 8.);
-  __pyx_v_muTTperp2 = (1. / 2.);
-
+071:         cdef double muTTperp3 = -1./8.
-
  __Pyx_TraceLine(71,0,__PYX_ERR(0, 71, __pyx_L1_error))
-  __pyx_v_muTTperp3 = (-1. / 8.);
-
 072:         cdef double mux, muy, muz
-
 073: 
-
+074:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(74,0,__PYX_ERR(0, 74, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_8 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_11 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_11 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_Vdotidr) reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) lastprivate(__pyx_v_h) lastprivate(__pyx_v_h2) lastprivate(__pyx_v_hbar_inv) lastprivate(__pyx_v_hbar_inv3) lastprivate(__pyx_v_hbar_inv5) lastprivate(__pyx_v_hsq) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_idr5) lastprivate(__pyx_v_j) lastprivate(__pyx_v_mux) lastprivate(__pyx_v_muy) lastprivate(__pyx_v_muz) lastprivate(__pyx_v_tempV) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_10);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_Vdotidr = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_h = ((double)__PYX_NAN());
-                            __pyx_v_h2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv3 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv5 = ((double)__PYX_NAN());
-                            __pyx_v_hsq = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_idr5 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_mux = ((double)__PYX_NAN());
-                            __pyx_v_muy = ((double)__PYX_NAN());
-                            __pyx_v_muz = ((double)__PYX_NAN());
-                            __pyx_v_tempV = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(74,1,__PYX_ERR(0, 74, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+075:             vx=0; vy=0; vz=0;
-
                            __Pyx_TraceLine(75,1,__PYX_ERR(0, 75, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+076:             for j in range(N):
-
                            __Pyx_TraceLine(76,1,__PYX_ERR(0, 76, __pyx_L8_error))
-                            __pyx_t_12 = __pyx_v_N;
-                            __pyx_t_13 = __pyx_t_12;
-                            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-                              __pyx_v_j = __pyx_t_14;
-
+077:                 dx = r[i]    - r[j]
-
                              __Pyx_TraceLine(77,1,__PYX_ERR(0, 77, __pyx_L8_error))
-                              __pyx_t_15 = __pyx_v_i;
-                              __pyx_t_16 = __pyx_v_j;
-                              __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+078:                 dy = r[i+N]  - r[j+N]
-
                              __Pyx_TraceLine(78,1,__PYX_ERR(0, 78, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i + __pyx_v_N);
-                              __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                              __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))));
-
+079:                 h2  =  2*r[j+xx]; hsq=r[j+xx]*r[j+xx]
-
                              __Pyx_TraceLine(79,1,__PYX_ERR(0, 79, __pyx_L8_error))
-                              __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_v_h2 = (2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))));
-                              __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_v_hsq = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))) * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+080:                 if i!=j:
-
                              __Pyx_TraceLine(80,1,__PYX_ERR(0, 80, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_17) {
-/* … */
-                                goto __pyx_L12;
-                              }
-
+081:                     dz = r[i+xx]  - r[j+xx]
-
                                __Pyx_TraceLine(81,1,__PYX_ERR(0, 81, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))));
-
+082:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(82,1,__PYX_ERR(0, 82, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+083:                     idr3=idr*idr*idr
-
                                __Pyx_TraceLine(83,1,__PYX_ERR(0, 83, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+084:                     Vdotidr = (v[j] * dx + v[j+N] * dy + v[j+xx] * dz)*idr*idr
-
                                __Pyx_TraceLine(84,1,__PYX_ERR(0, 84, __pyx_L8_error))
-                                __pyx_t_15 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Vdotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 085:                     #
-
+086:                     vx += (v[j]   +Vdotidr*dx)*idr + a2*(2*v[j]   -6*Vdotidr*dx)*idr3
-
                                __Pyx_TraceLine(86,1,__PYX_ERR(0, 86, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) + (__pyx_v_Vdotidr * __pyx_v_dx)) * __pyx_v_idr) + ((__pyx_v_a2 * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dx))) * __pyx_v_idr3)));
-
+087:                     vy += (v[j+N]+Vdotidr*dy)*idr + a2*(2*v[j+N]-6*Vdotidr*dy)*idr3
-
                                __Pyx_TraceLine(87,1,__PYX_ERR(0, 87, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) + (__pyx_v_Vdotidr * __pyx_v_dy)) * __pyx_v_idr) + ((__pyx_v_a2 * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dy))) * __pyx_v_idr3)));
-
+088:                     vz += (v[j+xx]+Vdotidr*dz)*idr + a2*(2*v[j+xx]-6*Vdotidr*dz)*idr3
-
                                __Pyx_TraceLine(88,1,__PYX_ERR(0, 88, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vz = (__pyx_v_vz + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) + (__pyx_v_Vdotidr * __pyx_v_dz)) * __pyx_v_idr) + ((__pyx_v_a2 * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dz))) * __pyx_v_idr3)));
-
 089: 
-
 090:                     ##contributions from the image
-
+091:                     dz = r[i+xx] + r[j+xx]
-
                                __Pyx_TraceLine(91,1,__PYX_ERR(0, 91, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) + (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))));
-
+092:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(92,1,__PYX_ERR(0, 92, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+093:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(93,1,__PYX_ERR(0, 93, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+094:                     idr5 = idr3*idr*idr
-
                                __Pyx_TraceLine(94,1,__PYX_ERR(0, 94, __pyx_L8_error))
-                                __pyx_v_idr5 = ((__pyx_v_idr3 * __pyx_v_idr) * __pyx_v_idr);
-
+095:                     Vdotidr = ( v[j]*dx + v[j+N]*dy + v[j+xx]*dz )*idr*idr
-
                                __Pyx_TraceLine(95,1,__PYX_ERR(0, 95, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Vdotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_18 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 096: 
-
+097:                     vx += -(v[j]   +Vdotidr*dx)*idr - a2*(2*v[j]   -6*Vdotidr*dx)*idr3
-
                                __Pyx_TraceLine(97,1,__PYX_ERR(0, 97, __pyx_L8_error))
-                                __pyx_t_15 = __pyx_v_j;
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + (((-((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) + (__pyx_v_Vdotidr * __pyx_v_dx))) * __pyx_v_idr) - ((__pyx_v_a2 * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dx))) * __pyx_v_idr3)));
-
+098:                     vy += -(v[j+N]+Vdotidr*dy)*idr - a2*(2*v[j+N]-6*Vdotidr*dy)*idr3
-
                                __Pyx_TraceLine(98,1,__PYX_ERR(0, 98, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + (((-((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) + (__pyx_v_Vdotidr * __pyx_v_dy))) * __pyx_v_idr) - ((__pyx_v_a2 * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dy))) * __pyx_v_idr3)));
-
+099:                     vz += -(v[j+xx]+Vdotidr*dz)*idr - a2*(2*v[j+xx]-6*Vdotidr*dz)*idr3
-
                                __Pyx_TraceLine(99,1,__PYX_ERR(0, 99, __pyx_L8_error))
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vz = (__pyx_v_vz + (((-((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) + (__pyx_v_Vdotidr * __pyx_v_dz))) * __pyx_v_idr) - ((__pyx_v_a2 * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dz))) * __pyx_v_idr3)));
-
 100: 
-
+101:                     tempV  = -v[j+xx]     # F_i = M_ij F_j, reflection of the strength
-
                                __Pyx_TraceLine(101,1,__PYX_ERR(0, 101, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_tempV = (-(*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))));
-
+102:                     Vdotidr = ( v[j]*dx + v[j+N]*dy + tempV*dz )*idr*idr
-
                                __Pyx_TraceLine(102,1,__PYX_ERR(0, 102, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_Vdotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy)) + (__pyx_v_tempV * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 103: 
-
+104:                     vx += -h2*(dz*(v[j]   - 3*Vdotidr*dx) + tempV*dx)*idr3
-
                                __Pyx_TraceLine(104,1,__PYX_ERR(0, 104, __pyx_L8_error))
-                                __pyx_t_15 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + (((-__pyx_v_h2) * ((__pyx_v_dz * ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) - ((3.0 * __pyx_v_Vdotidr) * __pyx_v_dx))) + (__pyx_v_tempV * __pyx_v_dx))) * __pyx_v_idr3));
-
+105:                     vy += -h2*(dz*(v[j+N]- 3*Vdotidr*dy) + tempV*dy)*idr3
-
                                __Pyx_TraceLine(105,1,__PYX_ERR(0, 105, __pyx_L8_error))
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + (((-__pyx_v_h2) * ((__pyx_v_dz * ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) - ((3.0 * __pyx_v_Vdotidr) * __pyx_v_dy))) + (__pyx_v_tempV * __pyx_v_dy))) * __pyx_v_idr3));
-
+106:                     vz += -h2*(dz*(tempV  - 3*Vdotidr*dz) + tempV*dz)*idr3 + h2*Vdotidr*idr
-
                                __Pyx_TraceLine(106,1,__PYX_ERR(0, 106, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((((-__pyx_v_h2) * ((__pyx_v_dz * (__pyx_v_tempV - ((3.0 * __pyx_v_Vdotidr) * __pyx_v_dz))) + (__pyx_v_tempV * __pyx_v_dz))) * __pyx_v_idr3) + ((__pyx_v_h2 * __pyx_v_Vdotidr) * __pyx_v_idr)));
-
 107: 
-
+108:                     vx += hsq*( 2*v[j]   - 6*Vdotidr*dx )*idr3
-
                                __Pyx_TraceLine(108,1,__PYX_ERR(0, 108, __pyx_L8_error))
-                                __pyx_t_15 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + ((__pyx_v_hsq * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dx))) * __pyx_v_idr3));
-
+109:                     vy += hsq*( 2*v[j+N]- 6*Vdotidr*dy )*idr3
-
                                __Pyx_TraceLine(109,1,__PYX_ERR(0, 109, __pyx_L8_error))
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + ((__pyx_v_hsq * ((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dy))) * __pyx_v_idr3));
-
+110:                     vz += hsq*( 2*tempV  - 6*Vdotidr*dz )*idr3
-
                                __Pyx_TraceLine(110,1,__PYX_ERR(0, 110, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((__pyx_v_hsq * ((2.0 * __pyx_v_tempV) - ((6.0 * __pyx_v_Vdotidr) * __pyx_v_dz))) * __pyx_v_idr3));
-
 111: 
-
+112:                     vx += 12*a2*dz*( dz*v[j]   - 5*dz*Vdotidr*dx + 2*tempV*dx )*idr5
-
                                __Pyx_TraceLine(112,1,__PYX_ERR(0, 112, __pyx_L8_error))
-                                __pyx_t_15 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + ((((12.0 * __pyx_v_a2) * __pyx_v_dz) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) - (((5.0 * __pyx_v_dz) * __pyx_v_Vdotidr) * __pyx_v_dx)) + ((2.0 * __pyx_v_tempV) * __pyx_v_dx))) * __pyx_v_idr5));
-
+113:                     vy += 12*a2*dz*( dz*v[j+N]- 5*dz*Vdotidr*dy + 2*tempV*dy )*idr5
-
                                __Pyx_TraceLine(113,1,__PYX_ERR(0, 113, __pyx_L8_error))
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + ((((12.0 * __pyx_v_a2) * __pyx_v_dz) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) - (((5.0 * __pyx_v_dz) * __pyx_v_Vdotidr) * __pyx_v_dy)) + ((2.0 * __pyx_v_tempV) * __pyx_v_dy))) * __pyx_v_idr5));
-
+114:                     vz += 12*a2*dz*( dz*tempV  - 5*dz*Vdotidr*dz + 2*tempV*dz )*idr5
-
                                __Pyx_TraceLine(114,1,__PYX_ERR(0, 114, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((((12.0 * __pyx_v_a2) * __pyx_v_dz) * (((__pyx_v_dz * __pyx_v_tempV) - (((5.0 * __pyx_v_dz) * __pyx_v_Vdotidr) * __pyx_v_dz)) + ((2.0 * __pyx_v_tempV) * __pyx_v_dz))) * __pyx_v_idr5));
-
 115: 
-
+116:                     vx += -h2*6*a2*(dz*v[j]   -5*Vdotidr*dx*dz + tempV*dx)*idr5
-
                                __Pyx_TraceLine(116,1,__PYX_ERR(0, 116, __pyx_L8_error))
-                                __pyx_t_15 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + (((((-__pyx_v_h2) * 6.0) * __pyx_v_a2) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) - (((5.0 * __pyx_v_Vdotidr) * __pyx_v_dx) * __pyx_v_dz)) + (__pyx_v_tempV * __pyx_v_dx))) * __pyx_v_idr5));
-
+117:                     vy += -h2*6*a2*(dz*v[j+N]-5*Vdotidr*dy*dz+ tempV*dy)*idr5
-
                                __Pyx_TraceLine(117,1,__PYX_ERR(0, 117, __pyx_L8_error))
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + (((((-__pyx_v_h2) * 6.0) * __pyx_v_a2) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) - (((5.0 * __pyx_v_Vdotidr) * __pyx_v_dy) * __pyx_v_dz)) + (__pyx_v_tempV * __pyx_v_dy))) * __pyx_v_idr5));
-
+118:                     vz += -h2*6*a2*(dz*tempV  -5*Vdotidr*dz*dz + tempV*dz)*idr5 -6*a2*h2*Vdotidr*idr3
-
                                __Pyx_TraceLine(118,1,__PYX_ERR(0, 118, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((((((-__pyx_v_h2) * 6.0) * __pyx_v_a2) * (((__pyx_v_dz * __pyx_v_tempV) - (((5.0 * __pyx_v_Vdotidr) * __pyx_v_dz) * __pyx_v_dz)) + (__pyx_v_tempV * __pyx_v_dz))) * __pyx_v_idr5) - ((((6.0 * __pyx_v_a2) * __pyx_v_h2) * __pyx_v_Vdotidr) * __pyx_v_idr3)));
-
 119:                 else:
-
+120:                     ''' self contribution from the image point'''
-
                              __Pyx_TraceLine(120,1,__PYX_ERR(0, 120, __pyx_L8_error))
-                              /*else*/ {
-
+121:                     h = r[j+xx]
-
                                __Pyx_TraceLine(121,1,__PYX_ERR(0, 121, __pyx_L8_error))
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_h = (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) )));
-
+122:                     hbar_inv = a/h; hbar_inv3 = hbar_inv*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(122,1,__PYX_ERR(0, 122, __pyx_L8_error))
-                                __pyx_v_hbar_inv = (__pyx_v_a / __pyx_v_h);
-                                __pyx_v_hbar_inv3 = ((__pyx_v_hbar_inv * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
+123:                     hbar_inv5 = hbar_inv3*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(123,1,__PYX_ERR(0, 123, __pyx_L8_error))
-                                __pyx_v_hbar_inv5 = ((__pyx_v_hbar_inv3 * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
 124: 
-
+125:                     mux = mu*(1 + muTTpara1*hbar_inv + muTTpara2*hbar_inv3
-
                                __Pyx_TraceLine(125,1,__PYX_ERR(0, 125, __pyx_L8_error))
-                                __pyx_v_mux = (__pyx_v_mu * (((1.0 + (__pyx_v_muTTpara1 * __pyx_v_hbar_inv)) + (__pyx_v_muTTpara2 * __pyx_v_hbar_inv3)) + (__pyx_v_muTTpara3 * __pyx_v_hbar_inv5)));
-
 126:                               + muTTpara3*hbar_inv5)
-
+127:                     muy = mux
-
                                __Pyx_TraceLine(127,1,__PYX_ERR(0, 127, __pyx_L8_error))
-                                __pyx_v_muy = __pyx_v_mux;
-
+128:                     muz = mu*(1 + muTTperp1*hbar_inv + muTTperp2*hbar_inv3
-
                                __Pyx_TraceLine(128,1,__PYX_ERR(0, 128, __pyx_L8_error))
-                                __pyx_v_muz = (__pyx_v_mu * (((1.0 + (__pyx_v_muTTperp1 * __pyx_v_hbar_inv)) + (__pyx_v_muTTperp2 * __pyx_v_hbar_inv3)) + (__pyx_v_muTTperp3 * __pyx_v_hbar_inv5)));
-                              }
-                              __pyx_L12:;
-                            }
-
 129:                               + muTTperp3*hbar_inv5)
-
 130: 
-
+131:             depsilon += v[i] * gg * (-mux*v[i]    + muv*vx)
-
                            __Pyx_TraceLine(131,1,__PYX_ERR(0, 131, __pyx_L8_error))
-                            __pyx_t_15 = __pyx_v_i;
-                            __pyx_t_16 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + (((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * (((-__pyx_v_mux) * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) + (__pyx_v_muv * __pyx_v_vx))));
-
+132:             depsilon += v[i+N] * gg * (-muy*v[i+N] + muv*vy)
-
                            __Pyx_TraceLine(132,1,__PYX_ERR(0, 132, __pyx_L8_error))
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_t_15 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + (((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * (((-__pyx_v_muy) * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) )))) + (__pyx_v_muv * __pyx_v_vy))));
-
+133:             depsilon += v[i+xx] * gg * (-muz*v[i+xx] + muv*vz)
-
                            __Pyx_TraceLine(133,1,__PYX_ERR(0, 133, __pyx_L8_error))
-                            __pyx_t_15 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + (((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_15 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * (((-__pyx_v_muz) * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) )))) + (__pyx_v_muv * __pyx_v_vz))));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates0)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_Vdotidr;
-                                __pyx_parallel_temp1 = __pyx_v_depsilon;
-                                __pyx_parallel_temp2 = __pyx_v_dx;
-                                __pyx_parallel_temp3 = __pyx_v_dy;
-                                __pyx_parallel_temp4 = __pyx_v_dz;
-                                __pyx_parallel_temp5 = __pyx_v_h;
-                                __pyx_parallel_temp6 = __pyx_v_h2;
-                                __pyx_parallel_temp7 = __pyx_v_hbar_inv;
-                                __pyx_parallel_temp8 = __pyx_v_hbar_inv3;
-                                __pyx_parallel_temp9 = __pyx_v_hbar_inv5;
-                                __pyx_parallel_temp10 = __pyx_v_hsq;
-                                __pyx_parallel_temp11 = __pyx_v_i;
-                                __pyx_parallel_temp12 = __pyx_v_idr;
-                                __pyx_parallel_temp13 = __pyx_v_idr3;
-                                __pyx_parallel_temp14 = __pyx_v_idr5;
-                                __pyx_parallel_temp15 = __pyx_v_j;
-                                __pyx_parallel_temp16 = __pyx_v_mux;
-                                __pyx_parallel_temp17 = __pyx_v_muy;
-                                __pyx_parallel_temp18 = __pyx_v_muz;
-                                __pyx_parallel_temp19 = __pyx_v_tempV;
-                                __pyx_parallel_temp20 = __pyx_v_vx;
-                                __pyx_parallel_temp21 = __pyx_v_vy;
-                                __pyx_parallel_temp22 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_Vdotidr = __pyx_parallel_temp0;
-              __pyx_v_depsilon = __pyx_parallel_temp1;
-              __pyx_v_dx = __pyx_parallel_temp2;
-              __pyx_v_dy = __pyx_parallel_temp3;
-              __pyx_v_dz = __pyx_parallel_temp4;
-              __pyx_v_h = __pyx_parallel_temp5;
-              __pyx_v_h2 = __pyx_parallel_temp6;
-              __pyx_v_hbar_inv = __pyx_parallel_temp7;
-              __pyx_v_hbar_inv3 = __pyx_parallel_temp8;
-              __pyx_v_hbar_inv5 = __pyx_parallel_temp9;
-              __pyx_v_hsq = __pyx_parallel_temp10;
-              __pyx_v_i = __pyx_parallel_temp11;
-              __pyx_v_idr = __pyx_parallel_temp12;
-              __pyx_v_idr3 = __pyx_parallel_temp13;
-              __pyx_v_idr5 = __pyx_parallel_temp14;
-              __pyx_v_j = __pyx_parallel_temp15;
-              __pyx_v_mux = __pyx_parallel_temp16;
-              __pyx_v_muy = __pyx_parallel_temp17;
-              __pyx_v_muz = __pyx_parallel_temp18;
-              __pyx_v_tempV = __pyx_parallel_temp19;
-              __pyx_v_vx = __pyx_parallel_temp20;
-              __pyx_v_vy = __pyx_parallel_temp21;
-              __pyx_v_vz = __pyx_parallel_temp22;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+134:         return depsilon
-
  __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 135: 
-
 136: 
-
+137:     cpdef frictionTR(self, double depsilon, double [:] v, double [:] o, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_5frictionTR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_11wallBounded_2PD_frictionTR(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_rlz;
-  double __pyx_v_h2;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  double __pyx_v_T1;
-  double __pyx_v_T2;
-  double __pyx_v_muv;
-  double __pyx_v_gg;
-  double __pyx_v_a;
-  double __pyx_v_h;
-  double __pyx_v_hbar_inv;
-  double __pyx_v_hbar_inv2;
-  double __pyx_v_hbar_inv4;
-  double __pyx_v_muTR0;
-  double __pyx_v_muTR2;
-  double __pyx_v_muTR;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__12)
-  __Pyx_TraceCall("frictionTR", __pyx_f[0], 137, 0, __PYX_ERR(0, 137, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionTR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_11wallBounded_2PD_5frictionTR)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 137, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_v, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 137, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_o, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 137, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_5frictionTR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_11wallBounded_2PD_4frictionTR, "\n        Compute energy dissipation due to rotation using :math:`\\dot{\\epsilon}=V\\cdot\\gamma^{TR}\\cdot \\Omega`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation,\n        v: np.array\n            An array of velocities\n            An array of size 3*N,\n        o: np.array\n            An array of angular velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_11wallBounded_2PD_5frictionTR = {"frictionTR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_11wallBounded_2PD_5frictionTR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_11wallBounded_2PD_4frictionTR};
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_5frictionTR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_v = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_o = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionTR (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_v,&__pyx_n_s_o,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, 1); __PYX_ERR(0, 137, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_o)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, 2); __PYX_ERR(0, 137, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, 3); __PYX_ERR(0, 137, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionTR") < 0)) __PYX_ERR(0, 137, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error)
-    __pyx_v_v = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_v.memview)) __PYX_ERR(0, 137, __pyx_L3_error)
-    __pyx_v_o = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_o.memview)) __PYX_ERR(0, 137, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 137, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionTR", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 137, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_11wallBounded_2PD_4frictionTR(((struct __pyx_obj_8pystokes_5power_11wallBounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_11wallBounded_2PD_4frictionTR(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__12)
-  __Pyx_TraceCall("frictionTR (wrapper)", __pyx_f[0], 137, 0, __PYX_ERR(0, 137, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 137, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 137, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 137, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_11wallBounded_2PD_frictionTR(__pyx_v_self, __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(137,0,__PYX_ERR(0, 137, __pyx_L1_error))
-/* … */
-  __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_v, __pyx_n_s_o, __pyx_n_s_r); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 137, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_11wallBounded_2PD_5frictionTR, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionTR, NULL, __pyx_n_s_pystokes_power_wallBounded, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_11wallBounded_PD, __pyx_n_s_frictionTR, __pyx_t_7) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_11wallBounded_PD);
-  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_wallBounded_pyx, __pyx_n_s_frictionTR, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 137, __pyx_L1_error)
-
 138:         """
-
 139:         Compute energy dissipation due to rotation using :math:`\dot{\epsilon}=V\cdot\gamma^{TR}\cdot \Omega`
-
 140:         ...
-
 141:         Parameters
-
 142:         ----------
-
 143:         depsilon: power dissipation,
-
 144:         v: np.array
-
 145:             An array of velocities
-
 146:             An array of size 3*N,
-
 147:         o: np.array
-
 148:             An array of angular velocities
-
 149:             An array of size 3*N,
-
 150:         r: np.array
-
 151:             An array of positions
-
 152:             An array of size 3*N,
-
 153:         ----------
-
 154:         """
-
 155: 
-
+156:         cdef int N = self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
 157:         cdef double dx, dy, dz, idr, idr3, rlz, Tdotidr, h2,
-
 158:         cdef double vx, vy, vz, T1, T2, T3
-
+159:         cdef double muv=self.muv, gg=-self.gammaT*self.gammaR
-
  __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_10;
-  __pyx_v_gg = ((-__pyx_v_self->gammaT) * __pyx_v_self->gammaR);
-
 160: 
-
+161:         cdef double a = self.a
-
  __Pyx_TraceLine(161,0,__PYX_ERR(0, 161, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->a;
-  __pyx_v_a = __pyx_t_10;
-
 162:         cdef double h, hbar_inv, hbar_inv2, hbar_inv4
-
+163:         cdef double muTR0 = 4.0/(3*self.a*self.a)
-
  __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
-  __pyx_v_muTR0 = (4.0 / ((3.0 * __pyx_v_self->a) * __pyx_v_self->a));
-
+164:         cdef double muTR2 = 3./32.0
-
  __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error))
-  __pyx_v_muTR2 = (3. / 32.0);
-
 165:         cdef double muTR
-
 166: 
-
+167:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(167,0,__PYX_ERR(0, 167, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_T1) lastprivate(__pyx_v_T2) reduction(-:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) lastprivate(__pyx_v_h) lastprivate(__pyx_v_h2) lastprivate(__pyx_v_hbar_inv) lastprivate(__pyx_v_hbar_inv2) lastprivate(__pyx_v_hbar_inv4) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_j) lastprivate(__pyx_v_muTR) lastprivate(__pyx_v_rlz) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_T1 = ((double)__PYX_NAN());
-                            __pyx_v_T2 = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_h = ((double)__PYX_NAN());
-                            __pyx_v_h2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv4 = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_muTR = ((double)__PYX_NAN());
-                            __pyx_v_rlz = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(167,1,__PYX_ERR(0, 167, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+168:             vx=0; vy=0; vz=0;
-
                            __Pyx_TraceLine(168,1,__PYX_ERR(0, 168, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+169:             for j in range(N):
-
                            __Pyx_TraceLine(169,1,__PYX_ERR(0, 169, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+170:                 dx = r[i]   - r[j]
-
                              __Pyx_TraceLine(170,1,__PYX_ERR(0, 170, __pyx_L8_error))
-                              __pyx_t_16 = __pyx_v_i;
-                              __pyx_t_17 = __pyx_v_j;
-                              __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+171:                 dy = r[i+N] - r[j+N]
-
                              __Pyx_TraceLine(171,1,__PYX_ERR(0, 171, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                              __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                              __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+172:                 h2 = 2*r[i+xx]
-
                              __Pyx_TraceLine(172,1,__PYX_ERR(0, 172, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                              __pyx_v_h2 = (2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+173:                 if i != j:
-
                              __Pyx_TraceLine(173,1,__PYX_ERR(0, 173, __pyx_L8_error))
-                              __pyx_t_18 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_18) {
-/* … */
-                                goto __pyx_L12;
-                              }
-
 174:                     #contributions from the source
-
+175:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(175,1,__PYX_ERR(0, 175, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+176:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(176,1,__PYX_ERR(0, 176, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+177:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(177,1,__PYX_ERR(0, 177, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
 178: 
-
+179:                     vx += (o[j+N]*dz - o[j+xx]*dy )*idr3
-
                                __Pyx_TraceLine(179,1,__PYX_ERR(0, 179, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vx = (__pyx_v_vx + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy)) * __pyx_v_idr3));
-
+180:                     vy += (o[j+xx]*dx - o[j]   *dz )*idr3
-
                                __Pyx_TraceLine(180,1,__PYX_ERR(0, 180, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_vy = (__pyx_v_vy + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr3));
-
+181:                     vz += (o[j]   *dy - o[j+N]*dx )*idr3
-
                                __Pyx_TraceLine(181,1,__PYX_ERR(0, 181, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vz = (__pyx_v_vz + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx)) * __pyx_v_idr3));
-
 182: 
-
 183:                     #contributions from the image
-
+184:                     dz = r[i+xx] + r[j+xx]
-
                                __Pyx_TraceLine(184,1,__PYX_ERR(0, 184, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) + (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+185:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(185,1,__PYX_ERR(0, 185, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+186:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(186,1,__PYX_ERR(0, 186, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
 187: 
-
+188:                     vx += -(o[j+N]*dz - o[j+xx]*dy )*idr3
-
                                __Pyx_TraceLine(188,1,__PYX_ERR(0, 188, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vx = (__pyx_v_vx + ((-(((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy))) * __pyx_v_idr3));
-
+189:                     vy += -(o[j+xx]*dx - o[j]   *dz )*idr3
-
                                __Pyx_TraceLine(189,1,__PYX_ERR(0, 189, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_vy = (__pyx_v_vy + ((-(((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz))) * __pyx_v_idr3));
-
+190:                     vz += -(o[j]   *dy - o[j+N]*dx )*idr3
-
                                __Pyx_TraceLine(190,1,__PYX_ERR(0, 190, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vz = (__pyx_v_vz + ((-(((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy) - ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx))) * __pyx_v_idr3));
-
 191: 
-
+192:                     rlz = (dx*o[j+N] - dy*o[j])*idr*idr
-
                                __Pyx_TraceLine(192,1,__PYX_ERR(0, 192, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_rlz = ((((__pyx_v_dx * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - (__pyx_v_dy * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))))) * __pyx_v_idr) * __pyx_v_idr);
-
+193:                     vx += (h2*(o[j+N]-3*rlz*dx) + 6*dz*dx*rlz)*idr3
-
                                __Pyx_TraceLine(193,1,__PYX_ERR(0, 193, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vx = (__pyx_v_vx + (((__pyx_v_h2 * ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) - ((3.0 * __pyx_v_rlz) * __pyx_v_dx))) + (((6.0 * __pyx_v_dz) * __pyx_v_dx) * __pyx_v_rlz)) * __pyx_v_idr3));
-
+194:                     vy += (h2*(-o[j]  -3*rlz*dy) + 6*dz*dy*rlz)*idr3
-
                                __Pyx_TraceLine(194,1,__PYX_ERR(0, 194, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_vy = (__pyx_v_vy + (((__pyx_v_h2 * ((-(*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) )))) - ((3.0 * __pyx_v_rlz) * __pyx_v_dy))) + (((6.0 * __pyx_v_dz) * __pyx_v_dy) * __pyx_v_rlz)) * __pyx_v_idr3));
-
+195:                     vz += (h2*(       -3*rlz*dz) + 6*dz*dz*rlz)*idr3
-
                                __Pyx_TraceLine(195,1,__PYX_ERR(0, 195, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + (((__pyx_v_h2 * ((-3.0 * __pyx_v_rlz) * __pyx_v_dz)) + (((6.0 * __pyx_v_dz) * __pyx_v_dz) * __pyx_v_rlz)) * __pyx_v_idr3));
-
 196:                 else:
-
+197:                     ''' the self contribution from the image point'''
-
                              __Pyx_TraceLine(197,1,__PYX_ERR(0, 197, __pyx_L8_error))
-                              /*else*/ {
-
+198:                     h = r[j+xx]
-
                                __Pyx_TraceLine(198,1,__PYX_ERR(0, 198, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_h = (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) )));
-
+199:                     hbar_inv = a/h; hbar_inv2 = hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(199,1,__PYX_ERR(0, 199, __pyx_L8_error))
-                                __pyx_v_hbar_inv = (__pyx_v_a / __pyx_v_h);
-                                __pyx_v_hbar_inv2 = (__pyx_v_hbar_inv * __pyx_v_hbar_inv);
-
+200:                     hbar_inv4 = hbar_inv2*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(200,1,__PYX_ERR(0, 200, __pyx_L8_error))
-                                __pyx_v_hbar_inv4 = ((__pyx_v_hbar_inv2 * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
 201: 
-
+202:                     muTR = muTR0*muTR2*hbar_inv4
-
                                __Pyx_TraceLine(202,1,__PYX_ERR(0, 202, __pyx_L8_error))
-                                __pyx_v_muTR = ((__pyx_v_muTR0 * __pyx_v_muTR2) * __pyx_v_hbar_inv4);
-
 203: 
-
+204:                     T1 = o[j];
-
                                __Pyx_TraceLine(204,1,__PYX_ERR(0, 204, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_T1 = (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) )));
-
+205:                     T2 = o[j+N]
-
                                __Pyx_TraceLine(205,1,__PYX_ERR(0, 205, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_T2 = (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) )));
-
 206: 
-
+207:                     vx += muTR*T2   #change sign here to make up for '-=' below...
-
                                __Pyx_TraceLine(207,1,__PYX_ERR(0, 207, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + (__pyx_v_muTR * __pyx_v_T2));
-
+208:                     vy += -muTR*T1  #same here
-
                                __Pyx_TraceLine(208,1,__PYX_ERR(0, 208, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + ((-__pyx_v_muTR) * __pyx_v_T1));
-                              }
-                              __pyx_L12:;
-                            }
-
 209: 
-
+210:             depsilon -= v[i] * gg * muv*vx
-
                            __Pyx_TraceLine(210,1,__PYX_ERR(0, 210, __pyx_L8_error))
-                            __pyx_t_17 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon - ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_vx));
-
+211:             depsilon -= v[i+N] * gg * muv*vy
-
                            __Pyx_TraceLine(211,1,__PYX_ERR(0, 211, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon - ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_vy));
-
+212:             depsilon -= v[i+xx] * gg * muv*vz
-
                            __Pyx_TraceLine(212,1,__PYX_ERR(0, 212, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon - ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_vz));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates1)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_T1;
-                                __pyx_parallel_temp1 = __pyx_v_T2;
-                                __pyx_parallel_temp2 = __pyx_v_depsilon;
-                                __pyx_parallel_temp3 = __pyx_v_dx;
-                                __pyx_parallel_temp4 = __pyx_v_dy;
-                                __pyx_parallel_temp5 = __pyx_v_dz;
-                                __pyx_parallel_temp6 = __pyx_v_h;
-                                __pyx_parallel_temp7 = __pyx_v_h2;
-                                __pyx_parallel_temp8 = __pyx_v_hbar_inv;
-                                __pyx_parallel_temp9 = __pyx_v_hbar_inv2;
-                                __pyx_parallel_temp10 = __pyx_v_hbar_inv4;
-                                __pyx_parallel_temp11 = __pyx_v_i;
-                                __pyx_parallel_temp12 = __pyx_v_idr;
-                                __pyx_parallel_temp13 = __pyx_v_idr3;
-                                __pyx_parallel_temp14 = __pyx_v_j;
-                                __pyx_parallel_temp15 = __pyx_v_muTR;
-                                __pyx_parallel_temp16 = __pyx_v_rlz;
-                                __pyx_parallel_temp17 = __pyx_v_vx;
-                                __pyx_parallel_temp18 = __pyx_v_vy;
-                                __pyx_parallel_temp19 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_T1 = __pyx_parallel_temp0;
-              __pyx_v_T2 = __pyx_parallel_temp1;
-              __pyx_v_depsilon = __pyx_parallel_temp2;
-              __pyx_v_dx = __pyx_parallel_temp3;
-              __pyx_v_dy = __pyx_parallel_temp4;
-              __pyx_v_dz = __pyx_parallel_temp5;
-              __pyx_v_h = __pyx_parallel_temp6;
-              __pyx_v_h2 = __pyx_parallel_temp7;
-              __pyx_v_hbar_inv = __pyx_parallel_temp8;
-              __pyx_v_hbar_inv2 = __pyx_parallel_temp9;
-              __pyx_v_hbar_inv4 = __pyx_parallel_temp10;
-              __pyx_v_i = __pyx_parallel_temp11;
-              __pyx_v_idr = __pyx_parallel_temp12;
-              __pyx_v_idr3 = __pyx_parallel_temp13;
-              __pyx_v_j = __pyx_parallel_temp14;
-              __pyx_v_muTR = __pyx_parallel_temp15;
-              __pyx_v_rlz = __pyx_parallel_temp16;
-              __pyx_v_vx = __pyx_parallel_temp17;
-              __pyx_v_vy = __pyx_parallel_temp18;
-              __pyx_v_vz = __pyx_parallel_temp19;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+213:         return depsilon
-
  __Pyx_TraceLine(213,0,__PYX_ERR(0, 213, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 214: 
-
 215: 
-
+216:     cpdef frictionT2s(self, double depsilon, double [:] V1s, double [:] S, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_7frictionT2s(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_11wallBounded_2PD_frictionT2s(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_S, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  int __pyx_v_xx1;
-  int __pyx_v_xx2;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr2;
-  double __pyx_v_idr3;
-  double __pyx_v_idr5;
-  double __pyx_v_trS;
-  double __pyx_v_h2;
-  double __pyx_v_hsq;
-  double __pyx_v_sxx;
-  double __pyx_v_syy;
-  double __pyx_v_szz;
-  double __pyx_v_sxy;
-  double __pyx_v_syx;
-  double __pyx_v_syz;
-  double __pyx_v_szy;
-  double __pyx_v_sxz;
-  double __pyx_v_szx;
-  double __pyx_v_srr;
-  double __pyx_v_srx;
-  double __pyx_v_sry;
-  double __pyx_v_srz;
-  double __pyx_v_Sljrlx;
-  double __pyx_v_Sljrly;
-  double __pyx_v_Sljrlz;
-  double __pyx_v_Sljrjx;
-  double __pyx_v_Sljrjy;
-  double __pyx_v_Sljrjz;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  double __pyx_v_mus;
-  double __pyx_v_a;
-  double __pyx_v_h;
-  double __pyx_v_hbar_inv;
-  double __pyx_v_hbar_inv2;
-  double __pyx_v_hbar_inv4;
-  double __pyx_v_hbar_inv6;
-  double __pyx_v_piT2s11;
-  double __pyx_v_piT2s12;
-  double __pyx_v_piT2s13;
-  double __pyx_v_piT2s21;
-  double __pyx_v_piT2s22;
-  double __pyx_v_piT2s23;
-  double __pyx_v_piT2s1;
-  double __pyx_v_piT2s2;
-  double __pyx_v_mus_inv;
-  double __pyx_v_gT;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__13)
-  __Pyx_TraceCall("frictionT2s", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionT2s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_11wallBounded_2PD_7frictionT2s)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 216, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_V1s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_S.memview)) { __Pyx_RaiseUnboundLocalError("S"); __PYX_ERR(0, 216, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_S, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 216, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionT2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_7frictionT2s(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_11wallBounded_2PD_6frictionT2s, "\n        Compute energy dissipation due to 2s mode of the slip :math:`\\dot{\\epsilon}=V^{1s}\\cdot\\gamma^{T,2s}\\cdot V^{2s}`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation\n        V1s: np.array\n            An array of 1s mode of velocities\n            An array of size 3*N,\n        S: np.array\n            An array of 2s mode of the slip\n            An array of size 5*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_11wallBounded_2PD_7frictionT2s = {"frictionT2s", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_11wallBounded_2PD_7frictionT2s, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_11wallBounded_2PD_6frictionT2s};
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_7frictionT2s(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_V1s = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_S = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionT2s (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_V1s,&__pyx_n_s_S,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V1s)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, 1); __PYX_ERR(0, 216, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_S)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, 2); __PYX_ERR(0, 216, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, 3); __PYX_ERR(0, 216, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionT2s") < 0)) __PYX_ERR(0, 216, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error)
-    __pyx_v_V1s = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V1s.memview)) __PYX_ERR(0, 216, __pyx_L3_error)
-    __pyx_v_S = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_S.memview)) __PYX_ERR(0, 216, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 216, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionT2s", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 216, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_S, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionT2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_11wallBounded_2PD_6frictionT2s(((struct __pyx_obj_8pystokes_5power_11wallBounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_S, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_S, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_11wallBounded_2PD_6frictionT2s(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_S, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__13)
-  __Pyx_TraceCall("frictionT2s (wrapper)", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 216, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_S.memview)) { __Pyx_RaiseUnboundLocalError("S"); __PYX_ERR(0, 216, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 216, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_11wallBounded_2PD_frictionT2s(__pyx_v_self, __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_S, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionT2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
-/* … */
-  __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_V1s, __pyx_n_s_S, __pyx_n_s_r); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 216, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_11wallBounded_2PD_7frictionT2s, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionT2s, NULL, __pyx_n_s_pystokes_power_wallBounded, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_11wallBounded_PD, __pyx_n_s_frictionT2s, __pyx_t_7) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_11wallBounded_PD);
-  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_wallBounded_pyx, __pyx_n_s_frictionT2s, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 216, __pyx_L1_error)
-
 217:         """
-
 218:         Compute energy dissipation due to 2s mode of the slip :math:`\dot{\epsilon}=V^{1s}\cdot\gamma^{T,2s}\cdot V^{2s}`
-
 219:         ...
-
 220:         Parameters
-
 221:         ----------
-
 222:         depsilon: power dissipation
-
 223:         V1s: np.array
-
 224:             An array of 1s mode of velocities
-
 225:             An array of size 3*N,
-
 226:         S: np.array
-
 227:             An array of 2s mode of the slip
-
 228:             An array of size 5*N,
-
 229:         r: np.array
-
 230:             An array of positions
-
 231:             An array of size 3*N,
-
 232:         ----------
-
 233:         """
-
 234: 
-
+235:         cdef int N=self.N, i, j, xx=2*N, xx1=3*N , xx2=4*N
-
  __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-  __pyx_v_xx1 = (3 * __pyx_v_N);
-  __pyx_v_xx2 = (4 * __pyx_v_N);
-
 236:         cdef double dx, dy, dz, idr, idr2, idr3, idr5, idr4, aidr2, trS, h2, hsq
-
 237:         cdef double sxx, syy, szz, sxy, syx, syz, szy, sxz, szx, srr, srx, sry, srz
-
 238:         cdef double Sljrlx, Sljrly, Sljrlz, Sljrjx, Sljrjy, Sljrjz
-
+239:         cdef double vx, vy, vz, mus=(28.0*self.a**3)/24
-
  __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
-  __pyx_v_mus = ((28.0 * pow(__pyx_v_self->a, 3.0)) / 24.0);
-
 240: 
-
+241:         cdef double a = self.a
-
  __Pyx_TraceLine(241,0,__PYX_ERR(0, 241, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->a;
-  __pyx_v_a = __pyx_t_10;
-
 242:         cdef double h, hbar_inv, hbar_inv2, hbar_inv4, hbar_inv6
-
+243:         cdef double piT2s11 = 5./16.0, piT2s12 = -1./4.
-
  __Pyx_TraceLine(243,0,__PYX_ERR(0, 243, __pyx_L1_error))
-  __pyx_v_piT2s11 = (5. / 16.0);
-  __pyx_v_piT2s12 = (-1. / 4.);
-
+244:         cdef double piT2s13 = 5./48.0
-
  __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error))
-  __pyx_v_piT2s13 = (5. / 48.0);
-
+245:         cdef double piT2s21 = -15./48.0, piT2s22 = 15./48.0
-
  __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
-  __pyx_v_piT2s21 = (-15. / 48.0);
-  __pyx_v_piT2s22 = (15. / 48.0);
-
+246:         cdef double piT2s23 = -5./48.0
-
  __Pyx_TraceLine(246,0,__PYX_ERR(0, 246, __pyx_L1_error))
-  __pyx_v_piT2s23 = (-5. / 48.0);
-
 247:         cdef double piT2s1, piT2s2
-
+248:         cdef double mus_inv = 1.0/mus, gT = self.gammaT
-
  __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
-  __pyx_v_mus_inv = (1.0 / __pyx_v_mus);
-  __pyx_t_10 = __pyx_v_self->gammaT;
-  __pyx_v_gT = __pyx_t_10;
-
 249: 
-
+250:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(250,0,__PYX_ERR(0, 250, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_Sljrjx) lastprivate(__pyx_v_Sljrjy) lastprivate(__pyx_v_Sljrjz) lastprivate(__pyx_v_Sljrlx) lastprivate(__pyx_v_Sljrly) lastprivate(__pyx_v_Sljrlz) reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) lastprivate(__pyx_v_h) lastprivate(__pyx_v_h2) lastprivate(__pyx_v_hbar_inv) lastprivate(__pyx_v_hbar_inv2) lastprivate(__pyx_v_hbar_inv4) lastprivate(__pyx_v_hbar_inv6) lastprivate(__pyx_v_hsq) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr2) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_idr5) lastprivate(__pyx_v_j) lastprivate(__pyx_v_piT2s1) lastprivate(__pyx_v_piT2s2) lastprivate(__pyx_v_srr) lastprivate(__pyx_v_srx) lastprivate(__pyx_v_sry) lastprivate(__pyx_v_srz) lastprivate(__pyx_v_sxx) lastprivate(__pyx_v_sxy) lastprivate(__pyx_v_sxz) lastprivate(__pyx_v_syx) lastprivate(__pyx_v_syy) lastprivate(__pyx_v_syz) lastprivate(__pyx_v_szx) lastprivate(__pyx_v_szy) lastprivate(__pyx_v_szz) lastprivate(__pyx_v_trS) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_Sljrjx = ((double)__PYX_NAN());
-                            __pyx_v_Sljrjy = ((double)__PYX_NAN());
-                            __pyx_v_Sljrjz = ((double)__PYX_NAN());
-                            __pyx_v_Sljrlx = ((double)__PYX_NAN());
-                            __pyx_v_Sljrly = ((double)__PYX_NAN());
-                            __pyx_v_Sljrlz = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_h = ((double)__PYX_NAN());
-                            __pyx_v_h2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv4 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv6 = ((double)__PYX_NAN());
-                            __pyx_v_hsq = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr2 = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_idr5 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_piT2s1 = ((double)__PYX_NAN());
-                            __pyx_v_piT2s2 = ((double)__PYX_NAN());
-                            __pyx_v_srr = ((double)__PYX_NAN());
-                            __pyx_v_srx = ((double)__PYX_NAN());
-                            __pyx_v_sry = ((double)__PYX_NAN());
-                            __pyx_v_srz = ((double)__PYX_NAN());
-                            __pyx_v_sxx = ((double)__PYX_NAN());
-                            __pyx_v_sxy = ((double)__PYX_NAN());
-                            __pyx_v_sxz = ((double)__PYX_NAN());
-                            __pyx_v_syx = ((double)__PYX_NAN());
-                            __pyx_v_syy = ((double)__PYX_NAN());
-                            __pyx_v_syz = ((double)__PYX_NAN());
-                            __pyx_v_szx = ((double)__PYX_NAN());
-                            __pyx_v_szy = ((double)__PYX_NAN());
-                            __pyx_v_szz = ((double)__PYX_NAN());
-                            __pyx_v_trS = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(250,1,__PYX_ERR(0, 250, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+251:             vx=0; vy=0;   vz=0;
-
                            __Pyx_TraceLine(251,1,__PYX_ERR(0, 251, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+252:             for j in  range(N):
-
                            __Pyx_TraceLine(252,1,__PYX_ERR(0, 252, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+253:                 h2 = 2*r[j+xx]; hsq = r[j+xx]*r[j+xx];
-
                              __Pyx_TraceLine(253,1,__PYX_ERR(0, 253, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_v_h2 = (2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-                              __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_v_hsq = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+254:                 sxx = S[j]  ; syy = S[j+N]; szz = -sxx-syy;
-
                              __Pyx_TraceLine(254,1,__PYX_ERR(0, 254, __pyx_L8_error))
-                              __pyx_t_17 = __pyx_v_j;
-                              __pyx_v_sxx = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-                              __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                              __pyx_v_syy = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-                              __pyx_v_szz = ((-__pyx_v_sxx) - __pyx_v_syy);
-
+255:                 sxy = S[j+xx]; syx = sxy;
-
                              __Pyx_TraceLine(255,1,__PYX_ERR(0, 255, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_v_sxy = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-                              __pyx_v_syx = __pyx_v_sxy;
-
+256:                 sxz = S[j+xx1]; szx = sxz;
-
                              __Pyx_TraceLine(256,1,__PYX_ERR(0, 256, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_j + __pyx_v_xx1);
-                              __pyx_v_sxz = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-                              __pyx_v_szx = __pyx_v_sxz;
-
+257:                 syz = S[j+xx2]; szy = syz;
-
                              __Pyx_TraceLine(257,1,__PYX_ERR(0, 257, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_j + __pyx_v_xx2);
-                              __pyx_v_syz = (*((double *) ( /* dim=0 */ (__pyx_v_S.data + __pyx_t_17 * __pyx_v_S.strides[0]) )));
-                              __pyx_v_szy = __pyx_v_syz;
-
+258:                 dx = r[i]   - r[j]
-
                              __Pyx_TraceLine(258,1,__PYX_ERR(0, 258, __pyx_L8_error))
-                              __pyx_t_17 = __pyx_v_i;
-                              __pyx_t_16 = __pyx_v_j;
-                              __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+259:                 dy = r[i+N] - r[j+N]
-
                              __Pyx_TraceLine(259,1,__PYX_ERR(0, 259, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i + __pyx_v_N);
-                              __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                              __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+260:                 if i!=j:
-
                              __Pyx_TraceLine(260,1,__PYX_ERR(0, 260, __pyx_L8_error))
-                              __pyx_t_18 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_18) {
-/* … */
-                                goto __pyx_L12;
-                              }
-
+261:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(261,1,__PYX_ERR(0, 261, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+262:                     idr  = 1.0/sqrt( dx*dx + dy*dy + dz*dz );
-
                                __Pyx_TraceLine(262,1,__PYX_ERR(0, 262, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+263:                     idr2 = idr*idr; idr3 = idr2*idr; idr5 = idr3*idr2;
-
                                __Pyx_TraceLine(263,1,__PYX_ERR(0, 263, __pyx_L8_error))
-                                __pyx_v_idr2 = (__pyx_v_idr * __pyx_v_idr);
-                                __pyx_v_idr3 = (__pyx_v_idr2 * __pyx_v_idr);
-                                __pyx_v_idr5 = (__pyx_v_idr3 * __pyx_v_idr2);
-
+264:                     srx = (sxx*dx +  sxy*dy + sxz*dz );
-
                                __Pyx_TraceLine(264,1,__PYX_ERR(0, 264, __pyx_L8_error))
-                                __pyx_v_srx = (((__pyx_v_sxx * __pyx_v_dx) + (__pyx_v_sxy * __pyx_v_dy)) + (__pyx_v_sxz * __pyx_v_dz));
-
+265:                     sry = (sxy*dx +  syy*dy + syz*dz );
-
                                __Pyx_TraceLine(265,1,__PYX_ERR(0, 265, __pyx_L8_error))
-                                __pyx_v_sry = (((__pyx_v_sxy * __pyx_v_dx) + (__pyx_v_syy * __pyx_v_dy)) + (__pyx_v_syz * __pyx_v_dz));
-
+266:                     srz = (sxz*dx +  syz*dy + szz*dz );
-
                                __Pyx_TraceLine(266,1,__PYX_ERR(0, 266, __pyx_L8_error))
-                                __pyx_v_srz = (((__pyx_v_sxz * __pyx_v_dx) + (__pyx_v_syz * __pyx_v_dy)) + (__pyx_v_szz * __pyx_v_dz));
-
+267:                     srr = srx*dx + sry*dy + srz*dz
-
                                __Pyx_TraceLine(267,1,__PYX_ERR(0, 267, __pyx_L8_error))
-                                __pyx_v_srr = (((__pyx_v_srx * __pyx_v_dx) + (__pyx_v_sry * __pyx_v_dy)) + (__pyx_v_srz * __pyx_v_dz));
-
 268: 
-
 269:                     ## contributions from the source
-
+270:                     vx += 3*srr*dx*idr5;
-
                                __Pyx_TraceLine(270,1,__PYX_ERR(0, 270, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + (((3.0 * __pyx_v_srr) * __pyx_v_dx) * __pyx_v_idr5));
-
+271:                     vy += 3*srr*dy*idr5;
-
                                __Pyx_TraceLine(271,1,__PYX_ERR(0, 271, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + (((3.0 * __pyx_v_srr) * __pyx_v_dy) * __pyx_v_idr5));
-
+272:                     vz += 3*srr*dz*idr5;
-
                                __Pyx_TraceLine(272,1,__PYX_ERR(0, 272, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + (((3.0 * __pyx_v_srr) * __pyx_v_dz) * __pyx_v_idr5));
-
 273: 
-
 274:                     ## contributions from the image
-
+275:                     dz = r[i+xx]+r[j+xx]
-
                                __Pyx_TraceLine(275,1,__PYX_ERR(0, 275, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) + (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+276:                     idr  = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(276,1,__PYX_ERR(0, 276, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+277:                     idr2 = idr*idr; idr3 = idr2*idr; idr5 = idr3*idr2;
-
                                __Pyx_TraceLine(277,1,__PYX_ERR(0, 277, __pyx_L8_error))
-                                __pyx_v_idr2 = (__pyx_v_idr * __pyx_v_idr);
-                                __pyx_v_idr3 = (__pyx_v_idr2 * __pyx_v_idr);
-                                __pyx_v_idr5 = (__pyx_v_idr3 * __pyx_v_idr2);
-
 278: 
-
 279: 
-
 280:                     #reflecting the first index of stresslet, S_jl M_lm
-
+281:                     sxz=-sxz; syz=-syz; szz=-szz;     trS=sxx+syy+szz;
-
                                __Pyx_TraceLine(281,1,__PYX_ERR(0, 281, __pyx_L8_error))
-                                __pyx_v_sxz = (-__pyx_v_sxz);
-                                __pyx_v_syz = (-__pyx_v_syz);
-                                __pyx_v_szz = (-__pyx_v_szz);
-                                __pyx_v_trS = ((__pyx_v_sxx + __pyx_v_syy) + __pyx_v_szz);
-
+282:                     Sljrlx = sxx*dx +  sxy*dx + sxz*dx ;
-
                                __Pyx_TraceLine(282,1,__PYX_ERR(0, 282, __pyx_L8_error))
-                                __pyx_v_Sljrlx = (((__pyx_v_sxx * __pyx_v_dx) + (__pyx_v_sxy * __pyx_v_dx)) + (__pyx_v_sxz * __pyx_v_dx));
-
+283:                     Sljrly = syx*dy +  syy*dy + syz*dy ;
-
                                __Pyx_TraceLine(283,1,__PYX_ERR(0, 283, __pyx_L8_error))
-                                __pyx_v_Sljrly = (((__pyx_v_syx * __pyx_v_dy) + (__pyx_v_syy * __pyx_v_dy)) + (__pyx_v_syz * __pyx_v_dy));
-
+284:                     Sljrlz = szx*dz +  szy*dz + szz*dz ;
-
                                __Pyx_TraceLine(284,1,__PYX_ERR(0, 284, __pyx_L8_error))
-                                __pyx_v_Sljrlz = (((__pyx_v_szx * __pyx_v_dz) + (__pyx_v_szy * __pyx_v_dz)) + (__pyx_v_szz * __pyx_v_dz));
-
 285: 
-
+286:                     Sljrjx = sxx*dx +  sxy*dy + sxz*dz ;
-
                                __Pyx_TraceLine(286,1,__PYX_ERR(0, 286, __pyx_L8_error))
-                                __pyx_v_Sljrjx = (((__pyx_v_sxx * __pyx_v_dx) + (__pyx_v_sxy * __pyx_v_dy)) + (__pyx_v_sxz * __pyx_v_dz));
-
+287:                     Sljrjy = syx*dx +  syy*dy + syz*dz ;
-
                                __Pyx_TraceLine(287,1,__PYX_ERR(0, 287, __pyx_L8_error))
-                                __pyx_v_Sljrjy = (((__pyx_v_syx * __pyx_v_dx) + (__pyx_v_syy * __pyx_v_dy)) + (__pyx_v_syz * __pyx_v_dz));
-
+288:                     Sljrjz = szx*dx +  szy*dy + szz*dz ;
-
                                __Pyx_TraceLine(288,1,__PYX_ERR(0, 288, __pyx_L8_error))
-                                __pyx_v_Sljrjz = (((__pyx_v_szx * __pyx_v_dx) + (__pyx_v_szy * __pyx_v_dy)) + (__pyx_v_szz * __pyx_v_dz));
-
+289:                     srx = sxx*dx + sxy*dy + sxz*dz
-
                                __Pyx_TraceLine(289,1,__PYX_ERR(0, 289, __pyx_L8_error))
-                                __pyx_v_srx = (((__pyx_v_sxx * __pyx_v_dx) + (__pyx_v_sxy * __pyx_v_dy)) + (__pyx_v_sxz * __pyx_v_dz));
-
+290:                     sry = syx*dx + syy*dy + syz*dz
-
                                __Pyx_TraceLine(290,1,__PYX_ERR(0, 290, __pyx_L8_error))
-                                __pyx_v_sry = (((__pyx_v_syx * __pyx_v_dx) + (__pyx_v_syy * __pyx_v_dy)) + (__pyx_v_syz * __pyx_v_dz));
-
+291:                     srz = sxz*dx + syz*dy + szz*dz
-
                                __Pyx_TraceLine(291,1,__PYX_ERR(0, 291, __pyx_L8_error))
-                                __pyx_v_srz = (((__pyx_v_sxz * __pyx_v_dx) + (__pyx_v_syz * __pyx_v_dy)) + (__pyx_v_szz * __pyx_v_dz));
-
+292:                     srr = (srx*dx + sry*dy + srz*dz)*idr2
-
                                __Pyx_TraceLine(292,1,__PYX_ERR(0, 292, __pyx_L8_error))
-                                __pyx_v_srr = ((((__pyx_v_srx * __pyx_v_dx) + (__pyx_v_sry * __pyx_v_dy)) + (__pyx_v_srz * __pyx_v_dz)) * __pyx_v_idr2);
-
 293: 
-
+294:                     vx += (-Sljrlx + Sljrjx + trS*dx -3*srr*dx)*idr3
-
                                __Pyx_TraceLine(294,1,__PYX_ERR(0, 294, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + (((((-__pyx_v_Sljrlx) + __pyx_v_Sljrjx) + (__pyx_v_trS * __pyx_v_dx)) - ((3.0 * __pyx_v_srr) * __pyx_v_dx)) * __pyx_v_idr3));
-
+295:                     vy += (-Sljrly + Sljrjy + trS*dy -3*srr*dy)*idr3
-
                                __Pyx_TraceLine(295,1,__PYX_ERR(0, 295, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + (((((-__pyx_v_Sljrly) + __pyx_v_Sljrjy) + (__pyx_v_trS * __pyx_v_dy)) - ((3.0 * __pyx_v_srr) * __pyx_v_dy)) * __pyx_v_idr3));
-
+296:                     vz += (-Sljrlz + Sljrjz + trS*dz -3*srr*dz)*idr3
-
                                __Pyx_TraceLine(296,1,__PYX_ERR(0, 296, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + (((((-__pyx_v_Sljrlz) + __pyx_v_Sljrjz) + (__pyx_v_trS * __pyx_v_dz)) - ((3.0 * __pyx_v_srr) * __pyx_v_dz)) * __pyx_v_idr3));
-
 297: 
-
+298:                     vx += -2*(dz*(sxz-3*srz*dx*idr2)+ szz*dx)*idr3;
-
                                __Pyx_TraceLine(298,1,__PYX_ERR(0, 298, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + ((-2.0 * ((__pyx_v_dz * (__pyx_v_sxz - (((3.0 * __pyx_v_srz) * __pyx_v_dx) * __pyx_v_idr2))) + (__pyx_v_szz * __pyx_v_dx))) * __pyx_v_idr3));
-
+299:                     vy += -2*(dz*(syz-3*srz*dy*idr2)+ szz*dy)*idr3;
-
                                __Pyx_TraceLine(299,1,__PYX_ERR(0, 299, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + ((-2.0 * ((__pyx_v_dz * (__pyx_v_syz - (((3.0 * __pyx_v_srz) * __pyx_v_dy) * __pyx_v_idr2))) + (__pyx_v_szz * __pyx_v_dy))) * __pyx_v_idr3));
-
+300:                     vz += -2*(dz*(szz-3*srz*dz*idr2)+ szz*dz - srz)*idr3;
-
                                __Pyx_TraceLine(300,1,__PYX_ERR(0, 300, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((-2.0 * (((__pyx_v_dz * (__pyx_v_szz - (((3.0 * __pyx_v_srz) * __pyx_v_dz) * __pyx_v_idr2))) + (__pyx_v_szz * __pyx_v_dz)) - __pyx_v_srz)) * __pyx_v_idr3));
-
 301: 
-
+302:                     vx += h2*( sxz-3*srz*dx*idr2)*idr3;
-
                                __Pyx_TraceLine(302,1,__PYX_ERR(0, 302, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + ((__pyx_v_h2 * (__pyx_v_sxz - (((3.0 * __pyx_v_srz) * __pyx_v_dx) * __pyx_v_idr2))) * __pyx_v_idr3));
-
+303:                     vy += h2*( syz-3*srz*dy*idr2)*idr3;
-
                                __Pyx_TraceLine(303,1,__PYX_ERR(0, 303, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + ((__pyx_v_h2 * (__pyx_v_syz - (((3.0 * __pyx_v_srz) * __pyx_v_dy) * __pyx_v_idr2))) * __pyx_v_idr3));
-
+304:                     vz += h2*( szz-3*srz*dz*idr2)*idr3;
-
                                __Pyx_TraceLine(304,1,__PYX_ERR(0, 304, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((__pyx_v_h2 * (__pyx_v_szz - (((3.0 * __pyx_v_srz) * __pyx_v_dz) * __pyx_v_idr2))) * __pyx_v_idr3));
-
 305: 
-
 306:                     #reflecting both the indices of stresslet, S_jl M_lm M_jk
-
+307:                     szx = -szx ; szy = -szy; szz = -szz;
-
                                __Pyx_TraceLine(307,1,__PYX_ERR(0, 307, __pyx_L8_error))
-                                __pyx_v_szx = (-__pyx_v_szx);
-                                __pyx_v_szy = (-__pyx_v_szy);
-                                __pyx_v_szz = (-__pyx_v_szz);
-
+308:                     srx = (sxx*dx +  sxy*dy + sxz*dz )
-
                                __Pyx_TraceLine(308,1,__PYX_ERR(0, 308, __pyx_L8_error))
-                                __pyx_v_srx = (((__pyx_v_sxx * __pyx_v_dx) + (__pyx_v_sxy * __pyx_v_dy)) + (__pyx_v_sxz * __pyx_v_dz));
-
+309:                     sry = (sxy*dx +  syy*dy + syz*dz )
-
                                __Pyx_TraceLine(309,1,__PYX_ERR(0, 309, __pyx_L8_error))
-                                __pyx_v_sry = (((__pyx_v_sxy * __pyx_v_dx) + (__pyx_v_syy * __pyx_v_dy)) + (__pyx_v_syz * __pyx_v_dz));
-
+310:                     srz = (sxz*dx +  syz*dy + szz*dz )
-
                                __Pyx_TraceLine(310,1,__PYX_ERR(0, 310, __pyx_L8_error))
-                                __pyx_v_srz = (((__pyx_v_sxz * __pyx_v_dx) + (__pyx_v_syz * __pyx_v_dy)) + (__pyx_v_szz * __pyx_v_dz));
-
+311:                     srr = (srx*dx + sry*dy + srz*dz)*idr2
-
                                __Pyx_TraceLine(311,1,__PYX_ERR(0, 311, __pyx_L8_error))
-                                __pyx_v_srr = ((((__pyx_v_srx * __pyx_v_dx) + (__pyx_v_sry * __pyx_v_dy)) + (__pyx_v_srz * __pyx_v_dz)) * __pyx_v_idr2);
-
 312: 
-
+313:                     vx += h2*( (dz*(-6*srx + 15*srr*dx)-3*srz*dx)*idr5 + (sxz)*idr3) ;
-
                                __Pyx_TraceLine(313,1,__PYX_ERR(0, 313, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + (__pyx_v_h2 * ((((__pyx_v_dz * ((-6.0 * __pyx_v_srx) + ((15.0 * __pyx_v_srr) * __pyx_v_dx))) - ((3.0 * __pyx_v_srz) * __pyx_v_dx)) * __pyx_v_idr5) + (__pyx_v_sxz * __pyx_v_idr3))));
-
+314:                     vy += h2*( (dz*(-6*sry + 15*srr*dy)-3*srz*dy)*idr5 + (syz)*idr3) ;
-
                                __Pyx_TraceLine(314,1,__PYX_ERR(0, 314, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + (__pyx_v_h2 * ((((__pyx_v_dz * ((-6.0 * __pyx_v_sry) + ((15.0 * __pyx_v_srr) * __pyx_v_dy))) - ((3.0 * __pyx_v_srz) * __pyx_v_dy)) * __pyx_v_idr5) + (__pyx_v_syz * __pyx_v_idr3))));
-
+315:                     vz += h2*( (dz*(-6*srz + 15*srr*dz)-3*srz*dz)*idr5 + (szz + 3*srr)*idr3);
-
                                __Pyx_TraceLine(315,1,__PYX_ERR(0, 315, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + (__pyx_v_h2 * ((((__pyx_v_dz * ((-6.0 * __pyx_v_srz) + ((15.0 * __pyx_v_srr) * __pyx_v_dz))) - ((3.0 * __pyx_v_srz) * __pyx_v_dz)) * __pyx_v_idr5) + ((__pyx_v_szz + (3.0 * __pyx_v_srr)) * __pyx_v_idr3))));
-
 316: 
-
+317:                     vx += hsq*(12*srx - 30*srr*dx)*idr5
-
                                __Pyx_TraceLine(317,1,__PYX_ERR(0, 317, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + ((__pyx_v_hsq * ((12.0 * __pyx_v_srx) - ((30.0 * __pyx_v_srr) * __pyx_v_dx))) * __pyx_v_idr5));
-
+318:                     vy += hsq*(12*sry - 30*srr*dy)*idr5
-
                                __Pyx_TraceLine(318,1,__PYX_ERR(0, 318, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + ((__pyx_v_hsq * ((12.0 * __pyx_v_sry) - ((30.0 * __pyx_v_srr) * __pyx_v_dy))) * __pyx_v_idr5));
-
+319:                     vz += hsq*(12*srz - 30*srr*dz)*idr5
-
                                __Pyx_TraceLine(319,1,__PYX_ERR(0, 319, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((__pyx_v_hsq * ((12.0 * __pyx_v_srz) - ((30.0 * __pyx_v_srr) * __pyx_v_dz))) * __pyx_v_idr5));
-
 320: 
-
 321:                 else:
-
+322:                     ''' the self contribution from the image point'''
-
                              __Pyx_TraceLine(322,1,__PYX_ERR(0, 322, __pyx_L8_error))
-                              /*else*/ {
-
+323:                     h = r[j+xx]
-
                                __Pyx_TraceLine(323,1,__PYX_ERR(0, 323, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_h = (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) )));
-
+324:                     hbar_inv = a/h; hbar_inv2 = hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(324,1,__PYX_ERR(0, 324, __pyx_L8_error))
-                                __pyx_v_hbar_inv = (__pyx_v_a / __pyx_v_h);
-                                __pyx_v_hbar_inv2 = (__pyx_v_hbar_inv * __pyx_v_hbar_inv);
-
+325:                     hbar_inv4 = hbar_inv2*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(325,1,__PYX_ERR(0, 325, __pyx_L8_error))
-                                __pyx_v_hbar_inv4 = ((__pyx_v_hbar_inv2 * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
+326:                     hbar_inv6 = hbar_inv4*hbar_inv2
-
                                __Pyx_TraceLine(326,1,__PYX_ERR(0, 326, __pyx_L8_error))
-                                __pyx_v_hbar_inv6 = (__pyx_v_hbar_inv4 * __pyx_v_hbar_inv2);
-
 327: 
-
 328:                     #implement superposition approximation only
-
+329:                     piT2s1 = piT2s11*hbar_inv2 + piT2s12*hbar_inv4 + piT2s13*hbar_inv6
-
                                __Pyx_TraceLine(329,1,__PYX_ERR(0, 329, __pyx_L8_error))
-                                __pyx_v_piT2s1 = (((__pyx_v_piT2s11 * __pyx_v_hbar_inv2) + (__pyx_v_piT2s12 * __pyx_v_hbar_inv4)) + (__pyx_v_piT2s13 * __pyx_v_hbar_inv6));
-
+330:                     piT2s2 = piT2s21*hbar_inv2 + piT2s22*hbar_inv4 + piT2s23*hbar_inv6
-
                                __Pyx_TraceLine(330,1,__PYX_ERR(0, 330, __pyx_L8_error))
-                                __pyx_v_piT2s2 = (((__pyx_v_piT2s21 * __pyx_v_hbar_inv2) + (__pyx_v_piT2s22 * __pyx_v_hbar_inv4)) + (__pyx_v_piT2s23 * __pyx_v_hbar_inv6));
-
 331: 
-
+332:                     vx += -mus_inv * 2*piT2s1*sxz
-
                                __Pyx_TraceLine(332,1,__PYX_ERR(0, 332, __pyx_L8_error))
-                                __pyx_v_vx = (__pyx_v_vx + ((((-__pyx_v_mus_inv) * 2.0) * __pyx_v_piT2s1) * __pyx_v_sxz));
-
+333:                     vy += -mus_inv * 2*piT2s1*syz
-
                                __Pyx_TraceLine(333,1,__PYX_ERR(0, 333, __pyx_L8_error))
-                                __pyx_v_vy = (__pyx_v_vy + ((((-__pyx_v_mus_inv) * 2.0) * __pyx_v_piT2s1) * __pyx_v_syz));
-
+334:                     vz += -mus_inv * 3*(piT2s2*sxx + piT2s2*syy)
-
                                __Pyx_TraceLine(334,1,__PYX_ERR(0, 334, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + (((-__pyx_v_mus_inv) * 3.0) * ((__pyx_v_piT2s2 * __pyx_v_sxx) + (__pyx_v_piT2s2 * __pyx_v_syy))));
-                              }
-                              __pyx_L12:;
-                            }
-
 335: 
-
+336:             depsilon += -V1s[i] * gT * vx*mus
-
                            __Pyx_TraceLine(336,1,__PYX_ERR(0, 336, __pyx_L8_error))
-                            __pyx_t_17 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_17 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gT) * __pyx_v_vx) * __pyx_v_mus));
-
+337:             depsilon += -V1s[i+N] * gT * vy*mus
-
                            __Pyx_TraceLine(337,1,__PYX_ERR(0, 337, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_17 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gT) * __pyx_v_vy) * __pyx_v_mus));
-
+338:             depsilon += -V1s[i+xx] * gT * vz*mus
-
                            __Pyx_TraceLine(338,1,__PYX_ERR(0, 338, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((-(*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_17 * __pyx_v_V1s.strides[0]) )))) * __pyx_v_gT) * __pyx_v_vz) * __pyx_v_mus));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates2)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_Sljrjx;
-                                __pyx_parallel_temp1 = __pyx_v_Sljrjy;
-                                __pyx_parallel_temp2 = __pyx_v_Sljrjz;
-                                __pyx_parallel_temp3 = __pyx_v_Sljrlx;
-                                __pyx_parallel_temp4 = __pyx_v_Sljrly;
-                                __pyx_parallel_temp5 = __pyx_v_Sljrlz;
-                                __pyx_parallel_temp6 = __pyx_v_depsilon;
-                                __pyx_parallel_temp7 = __pyx_v_dx;
-                                __pyx_parallel_temp8 = __pyx_v_dy;
-                                __pyx_parallel_temp9 = __pyx_v_dz;
-                                __pyx_parallel_temp10 = __pyx_v_h;
-                                __pyx_parallel_temp11 = __pyx_v_h2;
-                                __pyx_parallel_temp12 = __pyx_v_hbar_inv;
-                                __pyx_parallel_temp13 = __pyx_v_hbar_inv2;
-                                __pyx_parallel_temp14 = __pyx_v_hbar_inv4;
-                                __pyx_parallel_temp15 = __pyx_v_hbar_inv6;
-                                __pyx_parallel_temp16 = __pyx_v_hsq;
-                                __pyx_parallel_temp17 = __pyx_v_i;
-                                __pyx_parallel_temp18 = __pyx_v_idr;
-                                __pyx_parallel_temp19 = __pyx_v_idr2;
-                                __pyx_parallel_temp20 = __pyx_v_idr3;
-                                __pyx_parallel_temp21 = __pyx_v_idr5;
-                                __pyx_parallel_temp22 = __pyx_v_j;
-                                __pyx_parallel_temp23 = __pyx_v_piT2s1;
-                                __pyx_parallel_temp24 = __pyx_v_piT2s2;
-                                __pyx_parallel_temp25 = __pyx_v_srr;
-                                __pyx_parallel_temp26 = __pyx_v_srx;
-                                __pyx_parallel_temp27 = __pyx_v_sry;
-                                __pyx_parallel_temp28 = __pyx_v_srz;
-                                __pyx_parallel_temp29 = __pyx_v_sxx;
-                                __pyx_parallel_temp30 = __pyx_v_sxy;
-                                __pyx_parallel_temp31 = __pyx_v_sxz;
-                                __pyx_parallel_temp32 = __pyx_v_syx;
-                                __pyx_parallel_temp33 = __pyx_v_syy;
-                                __pyx_parallel_temp34 = __pyx_v_syz;
-                                __pyx_parallel_temp35 = __pyx_v_szx;
-                                __pyx_parallel_temp36 = __pyx_v_szy;
-                                __pyx_parallel_temp37 = __pyx_v_szz;
-                                __pyx_parallel_temp38 = __pyx_v_trS;
-                                __pyx_parallel_temp39 = __pyx_v_vx;
-                                __pyx_parallel_temp40 = __pyx_v_vy;
-                                __pyx_parallel_temp41 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_Sljrjx = __pyx_parallel_temp0;
-              __pyx_v_Sljrjy = __pyx_parallel_temp1;
-              __pyx_v_Sljrjz = __pyx_parallel_temp2;
-              __pyx_v_Sljrlx = __pyx_parallel_temp3;
-              __pyx_v_Sljrly = __pyx_parallel_temp4;
-              __pyx_v_Sljrlz = __pyx_parallel_temp5;
-              __pyx_v_depsilon = __pyx_parallel_temp6;
-              __pyx_v_dx = __pyx_parallel_temp7;
-              __pyx_v_dy = __pyx_parallel_temp8;
-              __pyx_v_dz = __pyx_parallel_temp9;
-              __pyx_v_h = __pyx_parallel_temp10;
-              __pyx_v_h2 = __pyx_parallel_temp11;
-              __pyx_v_hbar_inv = __pyx_parallel_temp12;
-              __pyx_v_hbar_inv2 = __pyx_parallel_temp13;
-              __pyx_v_hbar_inv4 = __pyx_parallel_temp14;
-              __pyx_v_hbar_inv6 = __pyx_parallel_temp15;
-              __pyx_v_hsq = __pyx_parallel_temp16;
-              __pyx_v_i = __pyx_parallel_temp17;
-              __pyx_v_idr = __pyx_parallel_temp18;
-              __pyx_v_idr2 = __pyx_parallel_temp19;
-              __pyx_v_idr3 = __pyx_parallel_temp20;
-              __pyx_v_idr5 = __pyx_parallel_temp21;
-              __pyx_v_j = __pyx_parallel_temp22;
-              __pyx_v_piT2s1 = __pyx_parallel_temp23;
-              __pyx_v_piT2s2 = __pyx_parallel_temp24;
-              __pyx_v_srr = __pyx_parallel_temp25;
-              __pyx_v_srx = __pyx_parallel_temp26;
-              __pyx_v_sry = __pyx_parallel_temp27;
-              __pyx_v_srz = __pyx_parallel_temp28;
-              __pyx_v_sxx = __pyx_parallel_temp29;
-              __pyx_v_sxy = __pyx_parallel_temp30;
-              __pyx_v_sxz = __pyx_parallel_temp31;
-              __pyx_v_syx = __pyx_parallel_temp32;
-              __pyx_v_syy = __pyx_parallel_temp33;
-              __pyx_v_syz = __pyx_parallel_temp34;
-              __pyx_v_szx = __pyx_parallel_temp35;
-              __pyx_v_szy = __pyx_parallel_temp36;
-              __pyx_v_szz = __pyx_parallel_temp37;
-              __pyx_v_trS = __pyx_parallel_temp38;
-              __pyx_v_vx = __pyx_parallel_temp39;
-              __pyx_v_vy = __pyx_parallel_temp40;
-              __pyx_v_vz = __pyx_parallel_temp41;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+339:         return depsilon
-
  __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 340: 
-
 341: 
-
+342:     cpdef frictionT3t(self, double depsilon, double [:] V1s, double [:] D, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_9frictionT3t(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_11wallBounded_2PD_frictionT3t(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_D, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_idr5;
-  double __pyx_v_Ddotidr;
-  double __pyx_v_tempD;
-  double __pyx_v_h2;
-  double __pyx_v_vx;
-  double __pyx_v_vy;
-  double __pyx_v_vz;
-  CYTHON_UNUSED double __pyx_v_mud;
-  double __pyx_v_muv;
-  double __pyx_v_a;
-  double __pyx_v_h;
-  double __pyx_v_hbar_inv;
-  double __pyx_v_hbar_inv3;
-  double __pyx_v_hbar_inv5;
-  double __pyx_v_piT3tpara1;
-  double __pyx_v_piT3tpara2;
-  double __pyx_v_piT3tperp1;
-  double __pyx_v_piT3tperp2;
-  double __pyx_v_pix;
-  double __pyx_v_piy;
-  double __pyx_v_piz;
-  double __pyx_v_gT;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__14)
-  __Pyx_TraceCall("frictionT3t", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionT3t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_11wallBounded_2PD_9frictionT3t)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 342, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_V1s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_D.memview)) { __Pyx_RaiseUnboundLocalError("D"); __PYX_ERR(0, 342, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_D, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 342, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionT3t", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_9frictionT3t(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_11wallBounded_2PD_8frictionT3t, "\n        Compute energy dissipation due to 3t mode of the slip :math:`\\dot{\\epsilon}=V^{1s}\\cdot\\gamma^{T,3t}\\cdot V^{3t}`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation\n        V1s: np.array\n            An array of 1s mode of velocities\n            An array of size 3*N,\n        D: np.array\n            An array of 3t mode of the slip\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_11wallBounded_2PD_9frictionT3t = {"frictionT3t", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_11wallBounded_2PD_9frictionT3t, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_11wallBounded_2PD_8frictionT3t};
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_9frictionT3t(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_V1s = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_D = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionT3t (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_V1s,&__pyx_n_s_D,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_V1s)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, 1); __PYX_ERR(0, 342, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_D)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, 2); __PYX_ERR(0, 342, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, 3); __PYX_ERR(0, 342, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionT3t") < 0)) __PYX_ERR(0, 342, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error)
-    __pyx_v_V1s = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_V1s.memview)) __PYX_ERR(0, 342, __pyx_L3_error)
-    __pyx_v_D = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_D.memview)) __PYX_ERR(0, 342, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 342, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionT3t", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 342, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_D, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionT3t", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_11wallBounded_2PD_8frictionT3t(((struct __pyx_obj_8pystokes_5power_11wallBounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_D, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_V1s, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_D, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_11wallBounded_2PD_8frictionT3t(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_V1s, __Pyx_memviewslice __pyx_v_D, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__14)
-  __Pyx_TraceCall("frictionT3t (wrapper)", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_V1s.memview)) { __Pyx_RaiseUnboundLocalError("V1s"); __PYX_ERR(0, 342, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_D.memview)) { __Pyx_RaiseUnboundLocalError("D"); __PYX_ERR(0, 342, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 342, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_11wallBounded_2PD_frictionT3t(__pyx_v_self, __pyx_v_depsilon, __pyx_v_V1s, __pyx_v_D, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionT3t", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
-/* … */
-  __pyx_tuple__35 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_V1s, __pyx_n_s_D, __pyx_n_s_r); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 342, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_11wallBounded_2PD_9frictionT3t, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionT3t, NULL, __pyx_n_s_pystokes_power_wallBounded, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_11wallBounded_PD, __pyx_n_s_frictionT3t, __pyx_t_7) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_11wallBounded_PD);
-  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_wallBounded_pyx, __pyx_n_s_frictionT3t, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 342, __pyx_L1_error)
-
 343:         """
-
 344:         Compute energy dissipation due to 3t mode of the slip :math:`\dot{\epsilon}=V^{1s}\cdot\gamma^{T,3t}\cdot V^{3t}`
-
 345:         ...
-
 346:         Parameters
-
 347:         ----------
-
 348:         depsilon: power dissipation
-
 349:         V1s: np.array
-
 350:             An array of 1s mode of velocities
-
 351:             An array of size 3*N,
-
 352:         D: np.array
-
 353:             An array of 3t mode of the slip
-
 354:             An array of size 3*N,
-
 355:         r: np.array
-
 356:             An array of positions
-
 357:             An array of size 3*N,
-
 358:         ----------
-
 359:         """
-
 360: 
-
+361:         cdef int N=self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
 362:         cdef double dx, dy, dz, idr, idr3, idr5, Ddotidr, tempD, hsq, h2
-
+363:         cdef double vx, vy, vz, mud = 3.0*self.a*self.a*self.a/5, muv = -1.0*(self.a**5)/10
-
  __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error))
-  __pyx_v_mud = ((((3.0 * __pyx_v_self->a) * __pyx_v_self->a) * __pyx_v_self->a) / 5.0);
-  __pyx_v_muv = ((-1.0 * pow(__pyx_v_self->a, 5.0)) / 10.0);
-
 364: 
-
+365:         cdef double a = self.a
-
  __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->a;
-  __pyx_v_a = __pyx_t_10;
-
 366:         cdef double h, hbar_inv, hbar_inv3, hbar_inv5
-
+367:         cdef double piT3tpara1 = -1./40.
-
  __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error))
-  __pyx_v_piT3tpara1 = (-1. / 40.);
-
+368:         cdef double piT3tpara2 = 1./40.
-
  __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
-  __pyx_v_piT3tpara2 = (1. / 40.);
-
+369:         cdef double piT3tperp1 = -1./10.
-
  __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error))
-  __pyx_v_piT3tperp1 = (-1. / 10.);
-
+370:         cdef double piT3tperp2 = 1./20.
-
  __Pyx_TraceLine(370,0,__PYX_ERR(0, 370, __pyx_L1_error))
-  __pyx_v_piT3tperp2 = (1. / 20.);
-
 371:         cdef double pix, piy, piz
-
+372:         cdef double gT = self.gammaT
-
  __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->gammaT;
-  __pyx_v_gT = __pyx_t_10;
-
 373: 
-
+374:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_Ddotidr) reduction(-:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) lastprivate(__pyx_v_h) lastprivate(__pyx_v_h2) lastprivate(__pyx_v_hbar_inv) lastprivate(__pyx_v_hbar_inv3) lastprivate(__pyx_v_hbar_inv5) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_idr5) lastprivate(__pyx_v_j) lastprivate(__pyx_v_pix) lastprivate(__pyx_v_piy) lastprivate(__pyx_v_piz) lastprivate(__pyx_v_tempD) reduction(+:__pyx_v_vx) reduction(+:__pyx_v_vy) reduction(+:__pyx_v_vz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_Ddotidr = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_h = ((double)__PYX_NAN());
-                            __pyx_v_h2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv3 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv5 = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_idr5 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_pix = ((double)__PYX_NAN());
-                            __pyx_v_piy = ((double)__PYX_NAN());
-                            __pyx_v_piz = ((double)__PYX_NAN());
-                            __pyx_v_tempD = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(374,1,__PYX_ERR(0, 374, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+375:             vx=0; vy=0; vz=0;
-
                            __Pyx_TraceLine(375,1,__PYX_ERR(0, 375, __pyx_L8_error))
-                            __pyx_v_vx = 0.0;
-                            __pyx_v_vy = 0.0;
-                            __pyx_v_vz = 0.0;
-
+376:             for j in range(N):
-
                            __Pyx_TraceLine(376,1,__PYX_ERR(0, 376, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+377:                 dx = r[i]    - r[j]
-
                              __Pyx_TraceLine(377,1,__PYX_ERR(0, 377, __pyx_L8_error))
-                              __pyx_t_16 = __pyx_v_i;
-                              __pyx_t_17 = __pyx_v_j;
-                              __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+378:                 dy = r[i+N]  - r[j+N]
-
                              __Pyx_TraceLine(378,1,__PYX_ERR(0, 378, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                              __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                              __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+379:                 h2  =  2*r[j+xx]
-
                              __Pyx_TraceLine(379,1,__PYX_ERR(0, 379, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_v_h2 = (2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+380:                 if i!=j:
-
                              __Pyx_TraceLine(380,1,__PYX_ERR(0, 380, __pyx_L8_error))
-                              __pyx_t_18 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_18) {
-/* … */
-                                goto __pyx_L12;
-                              }
-
+381:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(381,1,__PYX_ERR(0, 381, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+382:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(382,1,__PYX_ERR(0, 382, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+383:                     idr3=idr*idr*idr
-
                                __Pyx_TraceLine(383,1,__PYX_ERR(0, 383, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+384:                     Ddotidr = (D[j]*dx + D[j+N]*dy + D[j+xx]*dz)*idr*idr
-
                                __Pyx_TraceLine(384,1,__PYX_ERR(0, 384, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Ddotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_16 * __pyx_v_D.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 385:                     #
-
+386:                     vx += (2*D[j]    - 6*Ddotidr*dx)*idr3
-
                                __Pyx_TraceLine(386,1,__PYX_ERR(0, 386, __pyx_L8_error))
-                                __pyx_t_19 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + (((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) - ((6.0 * __pyx_v_Ddotidr) * __pyx_v_dx)) * __pyx_v_idr3));
-
+387:                     vy += (2*D[j+N] - 6*Ddotidr*dy)*idr3
-
                                __Pyx_TraceLine(387,1,__PYX_ERR(0, 387, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + (((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) - ((6.0 * __pyx_v_Ddotidr) * __pyx_v_dy)) * __pyx_v_idr3));
-
+388:                     vz += (2*D[j+xx] - 6*Ddotidr*dz)*idr3
-
                                __Pyx_TraceLine(388,1,__PYX_ERR(0, 388, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vz = (__pyx_v_vz + (((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) - ((6.0 * __pyx_v_Ddotidr) * __pyx_v_dz)) * __pyx_v_idr3));
-
 389: 
-
 390:                     ##contributions from the image
-
+391:                     dz = r[i+xx] + r[j+xx]
-
                                __Pyx_TraceLine(391,1,__PYX_ERR(0, 391, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_19 * __pyx_v_r.strides[0]) ))) + (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+392:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(392,1,__PYX_ERR(0, 392, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+393:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(393,1,__PYX_ERR(0, 393, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+394:                     idr5 = idr3*idr*idr
-
                                __Pyx_TraceLine(394,1,__PYX_ERR(0, 394, __pyx_L8_error))
-                                __pyx_v_idr5 = ((__pyx_v_idr3 * __pyx_v_idr) * __pyx_v_idr);
-
+395:                     Ddotidr = (D[j]*dx + D[j+N]*dy + D[j+xx]*dz)*idr*idr
-
                                __Pyx_TraceLine(395,1,__PYX_ERR(0, 395, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Ddotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_16 * __pyx_v_D.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 396: 
-
+397:                     vx += -(2*D[j]    - 6*Ddotidr*dx )*idr3
-
                                __Pyx_TraceLine(397,1,__PYX_ERR(0, 397, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + ((-((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) )))) - ((6.0 * __pyx_v_Ddotidr) * __pyx_v_dx))) * __pyx_v_idr3));
-
+398:                     vy += -(2*D[j+N] - 6*Ddotidr*dy )*idr3
-
                                __Pyx_TraceLine(398,1,__PYX_ERR(0, 398, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + ((-((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) )))) - ((6.0 * __pyx_v_Ddotidr) * __pyx_v_dy))) * __pyx_v_idr3));
-
+399:                     vz += -(2*D[j+xx] - 6*Ddotidr*dz )*idr3
-
                                __Pyx_TraceLine(399,1,__PYX_ERR(0, 399, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_vz = (__pyx_v_vz + ((-((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) )))) - ((6.0 * __pyx_v_Ddotidr) * __pyx_v_dz))) * __pyx_v_idr3));
-
 400: 
-
+401:                     tempD = -D[j+xx]     # D_i = M_ij D_j, reflection of the strength
-
                                __Pyx_TraceLine(401,1,__PYX_ERR(0, 401, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_tempD = (-(*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) ))));
-
+402:                     Ddotidr = ( D[j]*dx + D[j+N]*dy + tempD*dz )*idr*idr
-
                                __Pyx_TraceLine(402,1,__PYX_ERR(0, 402, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_Ddotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) ))) * __pyx_v_dy)) + (__pyx_v_tempD * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 403: 
-
+404:                     vx += 12*dz*( dz*D[j]   - 5*dz*Ddotidr*dx + 2*tempD*dx )*idr5
-
                                __Pyx_TraceLine(404,1,__PYX_ERR(0, 404, __pyx_L8_error))
-                                __pyx_t_19 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + (((12.0 * __pyx_v_dz) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) - (((5.0 * __pyx_v_dz) * __pyx_v_Ddotidr) * __pyx_v_dx)) + ((2.0 * __pyx_v_tempD) * __pyx_v_dx))) * __pyx_v_idr5));
-
+405:                     vy += 12*dz*( dz*D[j+N]- 5*dz*Ddotidr*dy + 2*tempD*dy )*idr5
-
                                __Pyx_TraceLine(405,1,__PYX_ERR(0, 405, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + (((12.0 * __pyx_v_dz) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) - (((5.0 * __pyx_v_dz) * __pyx_v_Ddotidr) * __pyx_v_dy)) + ((2.0 * __pyx_v_tempD) * __pyx_v_dy))) * __pyx_v_idr5));
-
+406:                     vz += 12*dz*( dz*tempD  - 5*dz*Ddotidr*dz + 2*tempD*dz )*idr5
-
                                __Pyx_TraceLine(406,1,__PYX_ERR(0, 406, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + (((12.0 * __pyx_v_dz) * (((__pyx_v_dz * __pyx_v_tempD) - (((5.0 * __pyx_v_dz) * __pyx_v_Ddotidr) * __pyx_v_dz)) + ((2.0 * __pyx_v_tempD) * __pyx_v_dz))) * __pyx_v_idr5));
-
 407: 
-
+408:                     vx += -6*h2*(dz*D[j]   -5*Ddotidr*dx*dz + tempD*dx)*idr5
-
                                __Pyx_TraceLine(408,1,__PYX_ERR(0, 408, __pyx_L8_error))
-                                __pyx_t_19 = __pyx_v_j;
-                                __pyx_v_vx = (__pyx_v_vx + (((-6.0 * __pyx_v_h2) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) - (((5.0 * __pyx_v_Ddotidr) * __pyx_v_dx) * __pyx_v_dz)) + (__pyx_v_tempD * __pyx_v_dx))) * __pyx_v_idr5));
-
+409:                     vy += -6*h2*(dz*D[j+N]-5*Ddotidr*dy*dz + tempD*dy)*idr5
-
                                __Pyx_TraceLine(409,1,__PYX_ERR(0, 409, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_vy = (__pyx_v_vy + (((-6.0 * __pyx_v_h2) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) - (((5.0 * __pyx_v_Ddotidr) * __pyx_v_dy) * __pyx_v_dz)) + (__pyx_v_tempD * __pyx_v_dy))) * __pyx_v_idr5));
-
+410:                     vz += -6*h2*(dz*tempD  -5*Ddotidr*dz*dz + tempD*dz)*idr5 -6*h2*Ddotidr*idr3
-
                                __Pyx_TraceLine(410,1,__PYX_ERR(0, 410, __pyx_L8_error))
-                                __pyx_v_vz = (__pyx_v_vz + ((((-6.0 * __pyx_v_h2) * (((__pyx_v_dz * __pyx_v_tempD) - (((5.0 * __pyx_v_Ddotidr) * __pyx_v_dz) * __pyx_v_dz)) + (__pyx_v_tempD * __pyx_v_dz))) * __pyx_v_idr5) - (((6.0 * __pyx_v_h2) * __pyx_v_Ddotidr) * __pyx_v_idr3)));
-
 411: 
-
 412:                 else:
-
+413:                     ''' self contribution from the image point'''
-
                              __Pyx_TraceLine(413,1,__PYX_ERR(0, 413, __pyx_L8_error))
-                              /*else*/ {
-
+414:                     h = r[j+xx]
-
                                __Pyx_TraceLine(414,1,__PYX_ERR(0, 414, __pyx_L8_error))
-                                __pyx_t_19 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_h = (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_19 * __pyx_v_r.strides[0]) )));
-
+415:                     hbar_inv = a/h; hbar_inv3 = hbar_inv*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(415,1,__PYX_ERR(0, 415, __pyx_L8_error))
-                                __pyx_v_hbar_inv = (__pyx_v_a / __pyx_v_h);
-                                __pyx_v_hbar_inv3 = ((__pyx_v_hbar_inv * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
+416:                     hbar_inv5 = hbar_inv3*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(416,1,__PYX_ERR(0, 416, __pyx_L8_error))
-                                __pyx_v_hbar_inv5 = ((__pyx_v_hbar_inv3 * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
 417: 
-
+418:                     pix = piT3tpara1*hbar_inv3 + piT3tpara2*hbar_inv5
-
                                __Pyx_TraceLine(418,1,__PYX_ERR(0, 418, __pyx_L8_error))
-                                __pyx_v_pix = ((__pyx_v_piT3tpara1 * __pyx_v_hbar_inv3) + (__pyx_v_piT3tpara2 * __pyx_v_hbar_inv5));
-
+419:                     piy = pix
-
                                __Pyx_TraceLine(419,1,__PYX_ERR(0, 419, __pyx_L8_error))
-                                __pyx_v_piy = __pyx_v_pix;
-
+420:                     piz = piT3tperp1*hbar_inv3 + piT3tperp2*hbar_inv5
-
                                __Pyx_TraceLine(420,1,__PYX_ERR(0, 420, __pyx_L8_error))
-                                __pyx_v_piz = ((__pyx_v_piT3tperp1 * __pyx_v_hbar_inv3) + (__pyx_v_piT3tperp2 * __pyx_v_hbar_inv5));
-                              }
-                              __pyx_L12:;
-                            }
-
 421: 
-
+422:             depsilon -= V1s[i] * gT * (-pix*D[j]    + muv*vx)
-
                            __Pyx_TraceLine(422,1,__PYX_ERR(0, 422, __pyx_L8_error))
-                            __pyx_t_19 = __pyx_v_i;
-                            __pyx_t_17 = __pyx_v_j;
-                            __pyx_v_depsilon = (__pyx_v_depsilon - (((*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_19 * __pyx_v_V1s.strides[0]) ))) * __pyx_v_gT) * (((-__pyx_v_pix) * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) )))) + (__pyx_v_muv * __pyx_v_vx))));
-
+423:             depsilon -= V1s[i+N] * gT * (-piy*D[j+N] + muv*vy)
-
                            __Pyx_TraceLine(423,1,__PYX_ERR(0, 423, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_t_19 = (__pyx_v_j + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon - (((*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_17 * __pyx_v_V1s.strides[0]) ))) * __pyx_v_gT) * (((-__pyx_v_piy) * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_19 * __pyx_v_D.strides[0]) )))) + (__pyx_v_muv * __pyx_v_vy))));
-
+424:             depsilon -= V1s[i+xx] * gT * (-piz*D[j+xx] + muv*vz)
-
                            __Pyx_TraceLine(424,1,__PYX_ERR(0, 424, __pyx_L8_error))
-                            __pyx_t_19 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon - (((*((double *) ( /* dim=0 */ (__pyx_v_V1s.data + __pyx_t_19 * __pyx_v_V1s.strides[0]) ))) * __pyx_v_gT) * (((-__pyx_v_piz) * (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_17 * __pyx_v_D.strides[0]) )))) + (__pyx_v_muv * __pyx_v_vz))));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates3)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_Ddotidr;
-                                __pyx_parallel_temp1 = __pyx_v_depsilon;
-                                __pyx_parallel_temp2 = __pyx_v_dx;
-                                __pyx_parallel_temp3 = __pyx_v_dy;
-                                __pyx_parallel_temp4 = __pyx_v_dz;
-                                __pyx_parallel_temp5 = __pyx_v_h;
-                                __pyx_parallel_temp6 = __pyx_v_h2;
-                                __pyx_parallel_temp7 = __pyx_v_hbar_inv;
-                                __pyx_parallel_temp8 = __pyx_v_hbar_inv3;
-                                __pyx_parallel_temp9 = __pyx_v_hbar_inv5;
-                                __pyx_parallel_temp10 = __pyx_v_i;
-                                __pyx_parallel_temp11 = __pyx_v_idr;
-                                __pyx_parallel_temp12 = __pyx_v_idr3;
-                                __pyx_parallel_temp13 = __pyx_v_idr5;
-                                __pyx_parallel_temp14 = __pyx_v_j;
-                                __pyx_parallel_temp15 = __pyx_v_pix;
-                                __pyx_parallel_temp16 = __pyx_v_piy;
-                                __pyx_parallel_temp17 = __pyx_v_piz;
-                                __pyx_parallel_temp18 = __pyx_v_tempD;
-                                __pyx_parallel_temp19 = __pyx_v_vx;
-                                __pyx_parallel_temp20 = __pyx_v_vy;
-                                __pyx_parallel_temp21 = __pyx_v_vz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_Ddotidr = __pyx_parallel_temp0;
-              __pyx_v_depsilon = __pyx_parallel_temp1;
-              __pyx_v_dx = __pyx_parallel_temp2;
-              __pyx_v_dy = __pyx_parallel_temp3;
-              __pyx_v_dz = __pyx_parallel_temp4;
-              __pyx_v_h = __pyx_parallel_temp5;
-              __pyx_v_h2 = __pyx_parallel_temp6;
-              __pyx_v_hbar_inv = __pyx_parallel_temp7;
-              __pyx_v_hbar_inv3 = __pyx_parallel_temp8;
-              __pyx_v_hbar_inv5 = __pyx_parallel_temp9;
-              __pyx_v_i = __pyx_parallel_temp10;
-              __pyx_v_idr = __pyx_parallel_temp11;
-              __pyx_v_idr3 = __pyx_parallel_temp12;
-              __pyx_v_idr5 = __pyx_parallel_temp13;
-              __pyx_v_j = __pyx_parallel_temp14;
-              __pyx_v_pix = __pyx_parallel_temp15;
-              __pyx_v_piy = __pyx_parallel_temp16;
-              __pyx_v_piz = __pyx_parallel_temp17;
-              __pyx_v_tempD = __pyx_parallel_temp18;
-              __pyx_v_vx = __pyx_parallel_temp19;
-              __pyx_v_vy = __pyx_parallel_temp20;
-              __pyx_v_vz = __pyx_parallel_temp21;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+425:         return depsilon
-
  __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 426: 
-
 427: 
-
 428: 
-
 429:     ## Angular Velocities
-
+430:     cpdef frictionRT(self, double depsilon, double [:]v, double [:] o, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_11frictionRT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_11wallBounded_2PD_frictionRT(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_rlz;
-  double __pyx_v_h2;
-  double __pyx_v_ox;
-  double __pyx_v_oy;
-  double __pyx_v_oz;
-  double __pyx_v_muv;
-  double __pyx_v_a;
-  double __pyx_v_h;
-  double __pyx_v_hbar_inv;
-  double __pyx_v_hbar_inv2;
-  double __pyx_v_hbar_inv4;
-  double __pyx_v_muRT0;
-  double __pyx_v_muRT2;
-  double __pyx_v_muRT;
-  double __pyx_v_F1;
-  double __pyx_v_F2;
-  double __pyx_v_gg;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__15)
-  __Pyx_TraceCall("frictionRT", __pyx_f[0], 430, 0, __PYX_ERR(0, 430, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionRT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_11wallBounded_2PD_11frictionRT)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 430, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_v, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 430, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_o, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 430, __pyx_L1_error) }
-        __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
-        __pyx_t_9 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_7))) {
-          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
-          if (likely(__pyx_t_8)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-            __Pyx_INCREF(__pyx_t_8);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_7, function);
-            __pyx_t_9 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9);
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionRT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_11frictionRT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_11wallBounded_2PD_10frictionRT, "\n        Compute energy dissipation due to rotation using :math:`\\dot{\\epsilon}=\\Omega\\cdot\\gamma^{RT}\\cdot V`\n        ...\n        Parameters\n        ----------\n        depsilon: np.array\n                   An array of energy dissipation\n                   An array of size 3*N,\n        v: np.array\n            An array of velocities\n            An array of size 3*N,\n        o: np.array\n            An array of angular velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_11wallBounded_2PD_11frictionRT = {"frictionRT", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_11wallBounded_2PD_11frictionRT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_11wallBounded_2PD_10frictionRT};
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_11frictionRT(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_v = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_o = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionRT (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_v,&__pyx_n_s_o,&__pyx_n_s_r,0};
-  PyObject* values[4] = {0,0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, 1); __PYX_ERR(0, 430, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_o)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, 2); __PYX_ERR(0, 430, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, 3); __PYX_ERR(0, 430, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionRT") < 0)) __PYX_ERR(0, 430, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 4)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error)
-    __pyx_v_v = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_v.memview)) __PYX_ERR(0, 430, __pyx_L3_error)
-    __pyx_v_o = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_o.memview)) __PYX_ERR(0, 430, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 430, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionRT", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 430, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionRT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_11wallBounded_2PD_10frictionRT(((struct __pyx_obj_8pystokes_5power_11wallBounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_v, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_11wallBounded_2PD_10frictionRT(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_v, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__15)
-  __Pyx_TraceCall("frictionRT (wrapper)", __pyx_f[0], 430, 0, __PYX_ERR(0, 430, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_v.memview)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 430, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 430, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 430, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_11wallBounded_2PD_frictionRT(__pyx_v_self, __pyx_v_depsilon, __pyx_v_v, __pyx_v_o, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionRT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error))
-
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_11wallBounded_2PD_11frictionRT, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionRT, NULL, __pyx_n_s_pystokes_power_wallBounded, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_11wallBounded_PD, __pyx_n_s_frictionRT, __pyx_t_7) < 0) __PYX_ERR(0, 430, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_11wallBounded_PD);
-/* … */
-  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_wallBounded_pyx, __pyx_n_s_frictionRT, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 430, __pyx_L1_error)
-
 431:         """
-
 432:         Compute energy dissipation due to rotation using :math:`\dot{\epsilon}=\Omega\cdot\gamma^{RT}\cdot V`
-
 433:         ...
-
 434:         Parameters
-
 435:         ----------
-
 436:         depsilon: np.array
-
 437:                    An array of energy dissipation
-
 438:                    An array of size 3*N,
-
 439:         v: np.array
-
 440:             An array of velocities
-
 441:             An array of size 3*N,
-
 442:         o: np.array
-
 443:             An array of angular velocities
-
 444:             An array of size 3*N,
-
 445:         r: np.array
-
 446:             An array of positions
-
 447:             An array of size 3*N,
-
 448:         ----------
-
 449:         """
-
 450: 
-
 451: 
-
+452:         cdef int N = self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_9;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
 453:         cdef double dx, dy, dz, idr, idr3, rlz, Fdotidr, h2
-
+454:         cdef double ox, oy, oz, muv=self.muv
-
  __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_10;
-
 455: 
-
+456:         cdef double a = self.a
-
  __Pyx_TraceLine(456,0,__PYX_ERR(0, 456, __pyx_L1_error))
-  __pyx_t_10 = __pyx_v_self->a;
-  __pyx_v_a = __pyx_t_10;
-
 457:         cdef double h, hbar_inv, hbar_inv2, hbar_inv4
-
+458:         cdef double muRT0 = 4.0/(3*self.a*self.a)
-
  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
-  __pyx_v_muRT0 = (4.0 / ((3.0 * __pyx_v_self->a) * __pyx_v_self->a));
-
+459:         cdef double muRT2 = -3./32.0
-
  __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error))
-  __pyx_v_muRT2 = (-3. / 32.0);
-
 460:         cdef double muRT, F1, F2
-
+461:         cdef double gg = -self.gammaT * self.gammaR
-
  __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
-  __pyx_v_gg = ((-__pyx_v_self->gammaT) * __pyx_v_self->gammaR);
-
 462: 
-
+463:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_9 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_12 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_12 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_F1) lastprivate(__pyx_v_F2) reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) lastprivate(__pyx_v_h) lastprivate(__pyx_v_h2) lastprivate(__pyx_v_hbar_inv) lastprivate(__pyx_v_hbar_inv2) lastprivate(__pyx_v_hbar_inv4) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_j) lastprivate(__pyx_v_muRT) reduction(+:__pyx_v_ox) reduction(+:__pyx_v_oy) reduction(+:__pyx_v_oz) lastprivate(__pyx_v_rlz)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_11);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_F1 = ((double)__PYX_NAN());
-                            __pyx_v_F2 = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_h = ((double)__PYX_NAN());
-                            __pyx_v_h2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv4 = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_muRT = ((double)__PYX_NAN());
-                            __pyx_v_rlz = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(463,1,__PYX_ERR(0, 463, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+464:             ox=0; oy=0; oz=0;
-
                            __Pyx_TraceLine(464,1,__PYX_ERR(0, 464, __pyx_L8_error))
-                            __pyx_v_ox = 0.0;
-                            __pyx_v_oy = 0.0;
-                            __pyx_v_oz = 0.0;
-
+465:             for j in range(N):
-
                            __Pyx_TraceLine(465,1,__PYX_ERR(0, 465, __pyx_L8_error))
-                            __pyx_t_13 = __pyx_v_N;
-                            __pyx_t_14 = __pyx_t_13;
-                            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
-                              __pyx_v_j = __pyx_t_15;
-
+466:                 dx = r[i]   - r[j]
-
                              __Pyx_TraceLine(466,1,__PYX_ERR(0, 466, __pyx_L8_error))
-                              __pyx_t_16 = __pyx_v_i;
-                              __pyx_t_17 = __pyx_v_j;
-                              __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+467:                 dy = r[i+N] - r[j+N]
-
                              __Pyx_TraceLine(467,1,__PYX_ERR(0, 467, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                              __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                              __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+468:                 h2 = 2*r[i+xx]
-
                              __Pyx_TraceLine(468,1,__PYX_ERR(0, 468, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                              __pyx_v_h2 = (2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+469:                 if i != j:
-
                              __Pyx_TraceLine(469,1,__PYX_ERR(0, 469, __pyx_L8_error))
-                              __pyx_t_18 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_18) {
-/* … */
-                                goto __pyx_L12;
-                              }
-
 470:                     #contributions from the source
-
+471:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(471,1,__PYX_ERR(0, 471, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+472:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(472,1,__PYX_ERR(0, 472, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+473:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(473,1,__PYX_ERR(0, 473, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
 474: 
-
+475:                     ox += (v[j+N]*dz - v[j+xx]*dy )*idr3
-
                                __Pyx_TraceLine(475,1,__PYX_ERR(0, 475, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_ox = (__pyx_v_ox + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy)) * __pyx_v_idr3));
-
+476:                     oy += (v[j+xx]*dx - v[j]   *dz )*idr3
-
                                __Pyx_TraceLine(476,1,__PYX_ERR(0, 476, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_oy = (__pyx_v_oy + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr3));
-
+477:                     oz += (v[j]   *dy - v[j+N]*dx )*idr3
-
                                __Pyx_TraceLine(477,1,__PYX_ERR(0, 477, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oz = (__pyx_v_oz + ((((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx)) * __pyx_v_idr3));
-
 478: 
-
 479:                     #contributions from the image
-
+480:                     dz = r[i+xx] + r[j+xx]
-
                                __Pyx_TraceLine(480,1,__PYX_ERR(0, 480, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) + (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) ))));
-
+481:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(481,1,__PYX_ERR(0, 481, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+482:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(482,1,__PYX_ERR(0, 482, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+483:                     rlz = (dx*v[j+N] - dy*v[j])*idr*idr
-
                                __Pyx_TraceLine(483,1,__PYX_ERR(0, 483, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_v_rlz = ((((__pyx_v_dx * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) )))) - (__pyx_v_dy * (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))))) * __pyx_v_idr) * __pyx_v_idr);
-
 484: 
-
+485:                     ox += -(v[j+N]*dz - v[j+xx]*dy )*idr3
-
                                __Pyx_TraceLine(485,1,__PYX_ERR(0, 485, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_ox = (__pyx_v_ox + ((-(((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy))) * __pyx_v_idr3));
-
+486:                     oy += -(v[j+xx]*dx - v[j]   *dz )*idr3
-
                                __Pyx_TraceLine(486,1,__PYX_ERR(0, 486, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_v_oy = (__pyx_v_oy + ((-(((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dz))) * __pyx_v_idr3));
-
+487:                     oz += -(v[j]   *dy - v[j+N]*dx )*idr3
-
                                __Pyx_TraceLine(487,1,__PYX_ERR(0, 487, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oz = (__pyx_v_oz + ((-(((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_16 * __pyx_v_v.strides[0]) ))) * __pyx_v_dy) - ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) * __pyx_v_dx))) * __pyx_v_idr3));
-
 488: 
-
+489:                     ox += (h2*(v[j+N]-3*rlz*dx) + 6*dz*dx*rlz)*idr3
-
                                __Pyx_TraceLine(489,1,__PYX_ERR(0, 489, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_ox = (__pyx_v_ox + (((__pyx_v_h2 * ((*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) ))) - ((3.0 * __pyx_v_rlz) * __pyx_v_dx))) + (((6.0 * __pyx_v_dz) * __pyx_v_dx) * __pyx_v_rlz)) * __pyx_v_idr3));
-
+490:                     oy += (h2*(-v[j]  -3*rlz*dy) + 6*dz*dy*rlz)*idr3
-
                                __Pyx_TraceLine(490,1,__PYX_ERR(0, 490, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_oy = (__pyx_v_oy + (((__pyx_v_h2 * ((-(*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) )))) - ((3.0 * __pyx_v_rlz) * __pyx_v_dy))) + (((6.0 * __pyx_v_dz) * __pyx_v_dy) * __pyx_v_rlz)) * __pyx_v_idr3));
-
+491:                     oz += (h2*(       -3*rlz*dz) + 6*dz*dz*rlz)*idr3
-
                                __Pyx_TraceLine(491,1,__PYX_ERR(0, 491, __pyx_L8_error))
-                                __pyx_v_oz = (__pyx_v_oz + (((__pyx_v_h2 * ((-3.0 * __pyx_v_rlz) * __pyx_v_dz)) + (((6.0 * __pyx_v_dz) * __pyx_v_dz) * __pyx_v_rlz)) * __pyx_v_idr3));
-
 492: 
-
 493:                 else:
-
+494:                     ''' the self contribution from the image point'''
-
                              __Pyx_TraceLine(494,1,__PYX_ERR(0, 494, __pyx_L8_error))
-                              /*else*/ {
-
+495:                     h = r[j+xx]
-
                                __Pyx_TraceLine(495,1,__PYX_ERR(0, 495, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_h = (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_17 * __pyx_v_r.strides[0]) )));
-
+496:                     hbar_inv = a/h; hbar_inv2 = hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(496,1,__PYX_ERR(0, 496, __pyx_L8_error))
-                                __pyx_v_hbar_inv = (__pyx_v_a / __pyx_v_h);
-                                __pyx_v_hbar_inv2 = (__pyx_v_hbar_inv * __pyx_v_hbar_inv);
-
+497:                     hbar_inv4 = hbar_inv2*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(497,1,__PYX_ERR(0, 497, __pyx_L8_error))
-                                __pyx_v_hbar_inv4 = ((__pyx_v_hbar_inv2 * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
 498: 
-
+499:                     muRT = muRT0*muRT2*hbar_inv4
-
                                __Pyx_TraceLine(499,1,__PYX_ERR(0, 499, __pyx_L8_error))
-                                __pyx_v_muRT = ((__pyx_v_muRT0 * __pyx_v_muRT2) * __pyx_v_hbar_inv4);
-
 500: 
-
+501:                     F1 = v[j];
-
                                __Pyx_TraceLine(501,1,__PYX_ERR(0, 501, __pyx_L8_error))
-                                __pyx_t_17 = __pyx_v_j;
-                                __pyx_v_F1 = (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) )));
-
+502:                     F2 = v[j+N]
-
                                __Pyx_TraceLine(502,1,__PYX_ERR(0, 502, __pyx_L8_error))
-                                __pyx_t_17 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_F2 = (*((double *) ( /* dim=0 */ (__pyx_v_v.data + __pyx_t_17 * __pyx_v_v.strides[0]) )));
-
 503: 
-
+504:                     ox += -muRT*F2
-
                                __Pyx_TraceLine(504,1,__PYX_ERR(0, 504, __pyx_L8_error))
-                                __pyx_v_ox = (__pyx_v_ox + ((-__pyx_v_muRT) * __pyx_v_F2));
-
+505:                     oy += muRT*F1
-
                                __Pyx_TraceLine(505,1,__PYX_ERR(0, 505, __pyx_L8_error))
-                                __pyx_v_oy = (__pyx_v_oy + (__pyx_v_muRT * __pyx_v_F1));
-                              }
-                              __pyx_L12:;
-                            }
-
 506: 
-
+507:             depsilon += o[i] * gg * muv*ox
-
                            __Pyx_TraceLine(507,1,__PYX_ERR(0, 507, __pyx_L8_error))
-                            __pyx_t_17 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_ox));
-
+508:             depsilon += o[i+N] * gg * muv*oy
-
                            __Pyx_TraceLine(508,1,__PYX_ERR(0, 508, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_oy));
-
+509:             depsilon += o[i+xx] * gg * muv*oz
-
                            __Pyx_TraceLine(509,1,__PYX_ERR(0, 509, __pyx_L8_error))
-                            __pyx_t_17 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + ((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_17 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * __pyx_v_muv) * __pyx_v_oz));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates4)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_F1;
-                                __pyx_parallel_temp1 = __pyx_v_F2;
-                                __pyx_parallel_temp2 = __pyx_v_depsilon;
-                                __pyx_parallel_temp3 = __pyx_v_dx;
-                                __pyx_parallel_temp4 = __pyx_v_dy;
-                                __pyx_parallel_temp5 = __pyx_v_dz;
-                                __pyx_parallel_temp6 = __pyx_v_h;
-                                __pyx_parallel_temp7 = __pyx_v_h2;
-                                __pyx_parallel_temp8 = __pyx_v_hbar_inv;
-                                __pyx_parallel_temp9 = __pyx_v_hbar_inv2;
-                                __pyx_parallel_temp10 = __pyx_v_hbar_inv4;
-                                __pyx_parallel_temp11 = __pyx_v_i;
-                                __pyx_parallel_temp12 = __pyx_v_idr;
-                                __pyx_parallel_temp13 = __pyx_v_idr3;
-                                __pyx_parallel_temp14 = __pyx_v_j;
-                                __pyx_parallel_temp15 = __pyx_v_muRT;
-                                __pyx_parallel_temp16 = __pyx_v_ox;
-                                __pyx_parallel_temp17 = __pyx_v_oy;
-                                __pyx_parallel_temp18 = __pyx_v_oz;
-                                __pyx_parallel_temp19 = __pyx_v_rlz;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_F1 = __pyx_parallel_temp0;
-              __pyx_v_F2 = __pyx_parallel_temp1;
-              __pyx_v_depsilon = __pyx_parallel_temp2;
-              __pyx_v_dx = __pyx_parallel_temp3;
-              __pyx_v_dy = __pyx_parallel_temp4;
-              __pyx_v_dz = __pyx_parallel_temp5;
-              __pyx_v_h = __pyx_parallel_temp6;
-              __pyx_v_h2 = __pyx_parallel_temp7;
-              __pyx_v_hbar_inv = __pyx_parallel_temp8;
-              __pyx_v_hbar_inv2 = __pyx_parallel_temp9;
-              __pyx_v_hbar_inv4 = __pyx_parallel_temp10;
-              __pyx_v_i = __pyx_parallel_temp11;
-              __pyx_v_idr = __pyx_parallel_temp12;
-              __pyx_v_idr3 = __pyx_parallel_temp13;
-              __pyx_v_j = __pyx_parallel_temp14;
-              __pyx_v_muRT = __pyx_parallel_temp15;
-              __pyx_v_ox = __pyx_parallel_temp16;
-              __pyx_v_oy = __pyx_parallel_temp17;
-              __pyx_v_oz = __pyx_parallel_temp18;
-              __pyx_v_rlz = __pyx_parallel_temp19;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+510:         return depsilon
-
  __Pyx_TraceLine(510,0,__PYX_ERR(0, 510, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 511: 
-
 512: 
-
+513:     cpdef frictionRR(self, double depsilon, double [:] o, double [:] r):
-
static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_13frictionRR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_f_8pystokes_5power_11wallBounded_2PD_frictionRR(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r, int __pyx_skip_dispatch) {
-  int __pyx_v_N;
-  int __pyx_v_i;
-  int __pyx_v_j;
-  int __pyx_v_xx;
-  double __pyx_v_dx;
-  double __pyx_v_dy;
-  double __pyx_v_dz;
-  double __pyx_v_idr;
-  double __pyx_v_idr3;
-  double __pyx_v_idr5;
-  double __pyx_v_Odotidr;
-  double __pyx_v_tempO;
-  double __pyx_v_h2;
-  double __pyx_v_ox;
-  double __pyx_v_oy;
-  double __pyx_v_oz;
-  double __pyx_v_mur;
-  double __pyx_v_muv;
-  double __pyx_v_a;
-  double __pyx_v_h;
-  double __pyx_v_hbar_inv;
-  double __pyx_v_hbar_inv3;
-  double __pyx_v_muRRpara;
-  double __pyx_v_muRRperp;
-  double __pyx_v_mux;
-  double __pyx_v_muy;
-  double __pyx_v_muz;
-  double __pyx_v_gg;
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__16)
-  __Pyx_TraceCall("frictionRR", __pyx_f[0], 513, 0, __PYX_ERR(0, 513, __pyx_L1_error));
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
-    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
-      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frictionRR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_8pystokes_5power_11wallBounded_2PD_13frictionRR)) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 513, __pyx_L1_error) }
-        __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_o, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 513, __pyx_L1_error) }
-        __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_INCREF(__pyx_t_1);
-        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
-        __pyx_t_8 = 0;
-        #if CYTHON_UNPACK_METHODS
-        if (unlikely(PyMethod_Check(__pyx_t_6))) {
-          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
-          if (likely(__pyx_t_7)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-            __Pyx_INCREF(__pyx_t_7);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_6, function);
-            __pyx_t_8 = 1;
-          }
-        }
-        #endif
-        {
-          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
-          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8);
-          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        }
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L0;
-      }
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
-      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
-      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
-        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
-      }
-      #endif
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
-    }
-    #endif
-  }
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionRR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_13frictionRR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-PyDoc_STRVAR(__pyx_doc_8pystokes_5power_11wallBounded_2PD_12frictionRR, "\n        Compute energy dissipation due to translation using :math:`\\dot{\\epsilon}=\\Omega\\cdot\\gamma^{RR}\\cdot \\Omega`\n        ...\n        Parameters\n        ----------\n        depsilon: power dissipation\n        o: np.array\n            An array of angular velocities\n            An array of size 3*N,\n        r: np.array\n            An array of positions\n            An array of size 3*N,\n        ----------\n        ");
-static PyMethodDef __pyx_mdef_8pystokes_5power_11wallBounded_2PD_13frictionRR = {"frictionRR", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8pystokes_5power_11wallBounded_2PD_13frictionRR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8pystokes_5power_11wallBounded_2PD_12frictionRR};
-static PyObject *__pyx_pw_8pystokes_5power_11wallBounded_2PD_13frictionRR(PyObject *__pyx_v_self, 
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
-  double __pyx_v_depsilon;
-  __Pyx_memviewslice __pyx_v_o = { 0, 0, { 0 }, { 0 }, { 0 } };
-  __Pyx_memviewslice __pyx_v_r = { 0, 0, { 0 }, { 0 }, { 0 } };
-  #if !CYTHON_METH_FASTCALL
-  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
-  #endif
-  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("frictionRR (wrapper)", 0);
-  #if !CYTHON_METH_FASTCALL
-  #if CYTHON_ASSUME_SAFE_MACROS
-  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
-  #else
-  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
-  #endif
-  #endif
-  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
-  {
-    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depsilon,&__pyx_n_s_o,&__pyx_n_s_r,0};
-  PyObject* values[3] = {0,0,0};
-    if (__pyx_kwds) {
-      Py_ssize_t kw_args;
-      switch (__pyx_nargs) {
-        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
-      switch (__pyx_nargs) {
-        case  0:
-        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_depsilon)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L3_error)
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_o)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRR", 1, 3, 3, 1); __PYX_ERR(0, 513, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) {
-          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
-          kw_args--;
-        }
-        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L3_error)
-        else {
-          __Pyx_RaiseArgtupleInvalid("frictionRR", 1, 3, 3, 2); __PYX_ERR(0, 513, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t kwd_pos_args = __pyx_nargs;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "frictionRR") < 0)) __PYX_ERR(0, 513, __pyx_L3_error)
-      }
-    } else if (unlikely(__pyx_nargs != 3)) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
-      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
-      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
-    }
-    __pyx_v_depsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_depsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L3_error)
-    __pyx_v_o = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_o.memview)) __PYX_ERR(0, 513, __pyx_L3_error)
-    __pyx_v_r = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_r.memview)) __PYX_ERR(0, 513, __pyx_L3_error)
-  }
-  goto __pyx_L6_skip;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("frictionRR", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 513, __pyx_L3_error)
-  __pyx_L6_skip:;
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionRR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_8pystokes_5power_11wallBounded_2PD_12frictionRR(((struct __pyx_obj_8pystokes_5power_11wallBounded_PD *)__pyx_v_self), __pyx_v_depsilon, __pyx_v_o, __pyx_v_r);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_o, 1);
-  __PYX_XCLEAR_MEMVIEW(&__pyx_v_r, 1);
-  {
-    Py_ssize_t __pyx_temp;
-    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
-      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
-    }
-  }
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_8pystokes_5power_11wallBounded_2PD_12frictionRR(struct __pyx_obj_8pystokes_5power_11wallBounded_PD *__pyx_v_self, double __pyx_v_depsilon, __Pyx_memviewslice __pyx_v_o, __Pyx_memviewslice __pyx_v_r) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_TraceDeclarations
-  __Pyx_TraceFrameInit(__pyx_codeobj__16)
-  __Pyx_TraceCall("frictionRR (wrapper)", __pyx_f[0], 513, 0, __PYX_ERR(0, 513, __pyx_L1_error));
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_o.memview)) { __Pyx_RaiseUnboundLocalError("o"); __PYX_ERR(0, 513, __pyx_L1_error) }
-  if (unlikely(!__pyx_v_r.memview)) { __Pyx_RaiseUnboundLocalError("r"); __PYX_ERR(0, 513, __pyx_L1_error) }
-  __pyx_t_1 = __pyx_f_8pystokes_5power_11wallBounded_2PD_frictionRR(__pyx_v_self, __pyx_v_depsilon, __pyx_v_o, __pyx_v_r, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pystokes.power.wallBounded.PD.frictionRR", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r, 0);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __Pyx_TraceLine(513,0,__PYX_ERR(0, 513, __pyx_L1_error))
-/* … */
-  __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_depsilon, __pyx_n_s_o, __pyx_n_s_r); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 513, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_8pystokes_5power_11wallBounded_2PD_13frictionRR, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PD_frictionRR, NULL, __pyx_n_s_pystokes_power_wallBounded, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_8pystokes_5power_11wallBounded_PD, __pyx_n_s_frictionRR, __pyx_t_7) < 0) __PYX_ERR(0, 513, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_8pystokes_5power_11wallBounded_PD);
-  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pystokes_power_wallBounded_pyx, __pyx_n_s_frictionRR, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 513, __pyx_L1_error)
-
 514:         """
-
 515:         Compute energy dissipation due to translation using :math:`\dot{\epsilon}=\Omega\cdot\gamma^{RR}\cdot \Omega`
-
 516:         ...
-
 517:         Parameters
-
 518:         ----------
-
 519:         depsilon: power dissipation
-
 520:         o: np.array
-
 521:             An array of angular velocities
-
 522:             An array of size 3*N,
-
 523:         r: np.array
-
 524:             An array of positions
-
 525:             An array of size 3*N,
-
 526:         ----------
-
 527:         """
-
 528: 
-
+529:         cdef int N=self.N, i, j, xx=2*N
-
  __Pyx_TraceLine(529,0,__PYX_ERR(0, 529, __pyx_L1_error))
-  __pyx_t_8 = __pyx_v_self->N;
-  __pyx_v_N = __pyx_t_8;
-  __pyx_v_xx = (2 * __pyx_v_N);
-
 530:         cdef double dx, dy, dz, idr, idr3, idr5, Odotidr, tempO, hsq, h2
-
+531:         cdef double ox, oy, oz, mur=self.mur, muv=self.muv
-
  __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->mur;
-  __pyx_v_mur = __pyx_t_9;
-  __pyx_t_9 = __pyx_v_self->muv;
-  __pyx_v_muv = __pyx_t_9;
-
 532: 
-
+533:         cdef double a = self.a
-
  __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error))
-  __pyx_t_9 = __pyx_v_self->a;
-  __pyx_v_a = __pyx_t_9;
-
 534:         cdef double h, hbar_inv, hbar_inv3
-
+535:         cdef double muRRpara = -5./16.0
-
  __Pyx_TraceLine(535,0,__PYX_ERR(0, 535, __pyx_L1_error))
-  __pyx_v_muRRpara = (-5. / 16.0);
-
+536:         cdef double muRRperp = -1./8.0
-
  __Pyx_TraceLine(536,0,__PYX_ERR(0, 536, __pyx_L1_error))
-  __pyx_v_muRRperp = (-1. / 8.0);
-
 537:         cdef double mux, muy, muz
-
+538:         cdef double gg = -self.gammaR * self.gammaR
-
  __Pyx_TraceLine(538,0,__PYX_ERR(0, 538, __pyx_L1_error))
-  __pyx_v_gg = ((-__pyx_v_self->gammaR) * __pyx_v_self->gammaR);
-
 539: 
-
+540:         for i in prange(N, nogil=True):
-
  __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
-  {
-      #ifdef WITH_THREAD
-      PyThreadState *_save;
-      _save = NULL;
-      Py_UNBLOCK_THREADS
-      __Pyx_FastGIL_Remember();
-      #endif
-      /*try:*/ {
-        __pyx_t_8 = __pyx_v_N;
-        {
-            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-                #undef likely
-                #undef unlikely
-                #define likely(x)   (x)
-                #define unlikely(x) (x)
-            #endif
-            __pyx_t_11 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1;
-            if (__pyx_t_11 > 0)
-            {
-                #ifdef _OPENMP
-                #pragma omp parallel
-                #endif /* _OPENMP */
-                {
-                    #ifdef _OPENMP
-                    #pragma omp for lastprivate(__pyx_v_Odotidr) reduction(+:__pyx_v_depsilon) lastprivate(__pyx_v_dx) lastprivate(__pyx_v_dy) lastprivate(__pyx_v_dz) lastprivate(__pyx_v_h) lastprivate(__pyx_v_h2) lastprivate(__pyx_v_hbar_inv) lastprivate(__pyx_v_hbar_inv3) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idr) lastprivate(__pyx_v_idr3) lastprivate(__pyx_v_idr5) lastprivate(__pyx_v_j) lastprivate(__pyx_v_mux) lastprivate(__pyx_v_muy) lastprivate(__pyx_v_muz) reduction(+:__pyx_v_ox) reduction(+:__pyx_v_oy) reduction(+:__pyx_v_oz) lastprivate(__pyx_v_tempO)
-                    #endif /* _OPENMP */
-                    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){
-                        {
-                            __pyx_v_i = (int)(0 + 1 * __pyx_t_10);
-                            /* Initialize private variables to invalid values */
-                            __pyx_v_Odotidr = ((double)__PYX_NAN());
-                            __pyx_v_dx = ((double)__PYX_NAN());
-                            __pyx_v_dy = ((double)__PYX_NAN());
-                            __pyx_v_dz = ((double)__PYX_NAN());
-                            __pyx_v_h = ((double)__PYX_NAN());
-                            __pyx_v_h2 = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv = ((double)__PYX_NAN());
-                            __pyx_v_hbar_inv3 = ((double)__PYX_NAN());
-                            __pyx_v_idr = ((double)__PYX_NAN());
-                            __pyx_v_idr3 = ((double)__PYX_NAN());
-                            __pyx_v_idr5 = ((double)__PYX_NAN());
-                            __pyx_v_j = ((int)0xbad0bad0);
-                            __pyx_v_mux = ((double)__PYX_NAN());
-                            __pyx_v_muy = ((double)__PYX_NAN());
-                            __pyx_v_muz = ((double)__PYX_NAN());
-                            __pyx_v_tempO = ((double)__PYX_NAN());
-/* … */
-      __Pyx_TraceLine(540,1,__PYX_ERR(0, 540, __pyx_L4_error))
-      /*finally:*/ {
-        /*normal exit:*/{
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L5;
-        }
-        __pyx_L4_error: {
-          #ifdef WITH_THREAD
-          __Pyx_FastGIL_Forget();
-          Py_BLOCK_THREADS
-          #endif
-          goto __pyx_L1_error;
-        }
-        __pyx_L5:;
-      }
-  }
-
+541:             ox=0; oy=0; oz=0;
-
                            __Pyx_TraceLine(541,1,__PYX_ERR(0, 541, __pyx_L8_error))
-                            __pyx_v_ox = 0.0;
-                            __pyx_v_oy = 0.0;
-                            __pyx_v_oz = 0.0;
-
+542:             for j in range(N):
-
                            __Pyx_TraceLine(542,1,__PYX_ERR(0, 542, __pyx_L8_error))
-                            __pyx_t_12 = __pyx_v_N;
-                            __pyx_t_13 = __pyx_t_12;
-                            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
-                              __pyx_v_j = __pyx_t_14;
-
+543:                 dx = r[i]    - r[j]
-
                              __Pyx_TraceLine(543,1,__PYX_ERR(0, 543, __pyx_L8_error))
-                              __pyx_t_15 = __pyx_v_i;
-                              __pyx_t_16 = __pyx_v_j;
-                              __pyx_v_dx = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+544:                 dy = r[i+N]  - r[j+N]
-
                              __Pyx_TraceLine(544,1,__PYX_ERR(0, 544, __pyx_L8_error))
-                              __pyx_t_16 = (__pyx_v_i + __pyx_v_N);
-                              __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                              __pyx_v_dy = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))));
-
+545:                 h2  =  2*r[j+xx]
-
                              __Pyx_TraceLine(545,1,__PYX_ERR(0, 545, __pyx_L8_error))
-                              __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                              __pyx_v_h2 = (2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))));
-
+546:                 if i!=j:
-
                              __Pyx_TraceLine(546,1,__PYX_ERR(0, 546, __pyx_L8_error))
-                              __pyx_t_17 = (__pyx_v_i != __pyx_v_j);
-                              if (__pyx_t_17) {
-/* … */
-                                goto __pyx_L12;
-                              }
-
+547:                     dz = r[i+xx] - r[j+xx]
-
                                __Pyx_TraceLine(547,1,__PYX_ERR(0, 547, __pyx_L8_error))
-                                __pyx_t_15 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_16 * __pyx_v_r.strides[0]) ))));
-
+548:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(548,1,__PYX_ERR(0, 548, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+549:                     idr3=idr*idr*idr
-
                                __Pyx_TraceLine(549,1,__PYX_ERR(0, 549, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+550:                     Odotidr = (o[j]*dx + o[j+N]*dy + o[j+xx]*dz)*idr*idr
-
                                __Pyx_TraceLine(550,1,__PYX_ERR(0, 550, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Odotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_15 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 551:                     #
-
+552:                     ox += (2*o[j]    - 6*Odotidr*dx)*idr3
-
                                __Pyx_TraceLine(552,1,__PYX_ERR(0, 552, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_ox = (__pyx_v_ox + (((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - ((6.0 * __pyx_v_Odotidr) * __pyx_v_dx)) * __pyx_v_idr3));
-
+553:                     oy += (2*o[j+N] - 6*Odotidr*dy)*idr3
-
                                __Pyx_TraceLine(553,1,__PYX_ERR(0, 553, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oy = (__pyx_v_oy + (((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - ((6.0 * __pyx_v_Odotidr) * __pyx_v_dy)) * __pyx_v_idr3));
-
+554:                     oz += (2*o[j+xx] - 6*Odotidr*dz)*idr3
-
                                __Pyx_TraceLine(554,1,__PYX_ERR(0, 554, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_oz = (__pyx_v_oz + (((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - ((6.0 * __pyx_v_Odotidr) * __pyx_v_dz)) * __pyx_v_idr3));
-
 555: 
-
 556:                     ##contributions from the image
-
+557:                     dz = r[i+xx] + r[j+xx]
-
                                __Pyx_TraceLine(557,1,__PYX_ERR(0, 557, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_i + __pyx_v_xx);
-                                __pyx_t_15 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_dz = ((*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) ))) + (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_15 * __pyx_v_r.strides[0]) ))));
-
+558:                     idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz )
-
                                __Pyx_TraceLine(558,1,__PYX_ERR(0, 558, __pyx_L8_error))
-                                __pyx_v_idr = (1.0 / sqrt((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) + (__pyx_v_dz * __pyx_v_dz))));
-
+559:                     idr3 = idr*idr*idr
-
                                __Pyx_TraceLine(559,1,__PYX_ERR(0, 559, __pyx_L8_error))
-                                __pyx_v_idr3 = ((__pyx_v_idr * __pyx_v_idr) * __pyx_v_idr);
-
+560:                     idr5 = idr3*idr*idr
-
                                __Pyx_TraceLine(560,1,__PYX_ERR(0, 560, __pyx_L8_error))
-                                __pyx_v_idr5 = ((__pyx_v_idr3 * __pyx_v_idr) * __pyx_v_idr);
-
+561:                     Odotidr = (o[j]*dx + o[j+N]*dy + o[j+xx]*dz)*idr*idr
-
                                __Pyx_TraceLine(561,1,__PYX_ERR(0, 561, __pyx_L8_error))
-                                __pyx_t_15 = __pyx_v_j;
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_Odotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_15 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy)) + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 562: 
-
+563:                     ox += -(2*o[j]    - 6*Odotidr*dx )*idr3
-
                                __Pyx_TraceLine(563,1,__PYX_ERR(0, 563, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_v_ox = (__pyx_v_ox + ((-((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - ((6.0 * __pyx_v_Odotidr) * __pyx_v_dx))) * __pyx_v_idr3));
-
+564:                     oy += -(2*o[j+N] - 6*Odotidr*dy )*idr3
-
                                __Pyx_TraceLine(564,1,__PYX_ERR(0, 564, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oy = (__pyx_v_oy + ((-((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - ((6.0 * __pyx_v_Odotidr) * __pyx_v_dy))) * __pyx_v_idr3));
-
+565:                     oz += -(2*o[j+xx] - 6*Odotidr*dz )*idr3
-
                                __Pyx_TraceLine(565,1,__PYX_ERR(0, 565, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_oz = (__pyx_v_oz + ((-((2.0 * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - ((6.0 * __pyx_v_Odotidr) * __pyx_v_dz))) * __pyx_v_idr3));
-
 566: 
-
+567:                     tempO = -o[j+xx]     # D_i = M_ij D_j, reflection of the strength
-
                                __Pyx_TraceLine(567,1,__PYX_ERR(0, 567, __pyx_L8_error))
-                                __pyx_t_16 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_tempO = (-(*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))));
-
+568:                     Odotidr = ( o[j]*dx + o[j+N]*dy + tempO*dz )*idr*idr
-
                                __Pyx_TraceLine(568,1,__PYX_ERR(0, 568, __pyx_L8_error))
-                                __pyx_t_16 = __pyx_v_j;
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_Odotidr = ((((((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_dx) + ((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * __pyx_v_dy)) + (__pyx_v_tempO * __pyx_v_dz)) * __pyx_v_idr) * __pyx_v_idr);
-
 569: 
-
+570:                     ox += 12*dz*( dz*o[j]   - 5*dz*Odotidr*dx + 2*tempO*dx )*idr5
-
                                __Pyx_TraceLine(570,1,__PYX_ERR(0, 570, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_ox = (__pyx_v_ox + (((12.0 * __pyx_v_dz) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - (((5.0 * __pyx_v_dz) * __pyx_v_Odotidr) * __pyx_v_dx)) + ((2.0 * __pyx_v_tempO) * __pyx_v_dx))) * __pyx_v_idr5));
-
+571:                     oy += 12*dz*( dz*o[j+N]- 5*dz*Odotidr*dy + 2*tempO*dy )*idr5
-
                                __Pyx_TraceLine(571,1,__PYX_ERR(0, 571, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oy = (__pyx_v_oy + (((12.0 * __pyx_v_dz) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - (((5.0 * __pyx_v_dz) * __pyx_v_Odotidr) * __pyx_v_dy)) + ((2.0 * __pyx_v_tempO) * __pyx_v_dy))) * __pyx_v_idr5));
-
+572:                     oz += 12*dz*( dz*tempO  - 5*dz*Odotidr*dz + 2*tempO*dz )*idr5
-
                                __Pyx_TraceLine(572,1,__PYX_ERR(0, 572, __pyx_L8_error))
-                                __pyx_v_oz = (__pyx_v_oz + (((12.0 * __pyx_v_dz) * (((__pyx_v_dz * __pyx_v_tempO) - (((5.0 * __pyx_v_dz) * __pyx_v_Odotidr) * __pyx_v_dz)) + ((2.0 * __pyx_v_tempO) * __pyx_v_dz))) * __pyx_v_idr5));
-
 573: 
-
+574:                     ox += -6*h2*(dz*o[j]   -5*Odotidr*dx*dz + tempO*dx)*idr5
-
                                __Pyx_TraceLine(574,1,__PYX_ERR(0, 574, __pyx_L8_error))
-                                __pyx_t_18 = __pyx_v_j;
-                                __pyx_v_ox = (__pyx_v_ox + (((-6.0 * __pyx_v_h2) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - (((5.0 * __pyx_v_Odotidr) * __pyx_v_dx) * __pyx_v_dz)) + (__pyx_v_tempO * __pyx_v_dx))) * __pyx_v_idr5));
-
+575:                     oy += -6*h2*(dz*o[j+N]-5*Odotidr*dy*dz + tempO*dy)*idr5
-
                                __Pyx_TraceLine(575,1,__PYX_ERR(0, 575, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_N);
-                                __pyx_v_oy = (__pyx_v_oy + (((-6.0 * __pyx_v_h2) * (((__pyx_v_dz * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - (((5.0 * __pyx_v_Odotidr) * __pyx_v_dy) * __pyx_v_dz)) + (__pyx_v_tempO * __pyx_v_dy))) * __pyx_v_idr5));
-
+576:                     oz += -6*h2*(dz*tempO  -5*Odotidr*dz*dz + tempO*dz)*idr5 -6*h2*Odotidr*idr3
-
                                __Pyx_TraceLine(576,1,__PYX_ERR(0, 576, __pyx_L8_error))
-                                __pyx_v_oz = (__pyx_v_oz + ((((-6.0 * __pyx_v_h2) * (((__pyx_v_dz * __pyx_v_tempO) - (((5.0 * __pyx_v_Odotidr) * __pyx_v_dz) * __pyx_v_dz)) + (__pyx_v_tempO * __pyx_v_dz))) * __pyx_v_idr5) - (((6.0 * __pyx_v_h2) * __pyx_v_Odotidr) * __pyx_v_idr3)));
-
 577: 
-
 578:                 else:
-
 579: 
-
+580:                     ''' self contribution from the image point'''
-
                              __Pyx_TraceLine(580,1,__PYX_ERR(0, 580, __pyx_L8_error))
-                              /*else*/ {
-
+581:                     h = r[j+xx]
-
                                __Pyx_TraceLine(581,1,__PYX_ERR(0, 581, __pyx_L8_error))
-                                __pyx_t_18 = (__pyx_v_j + __pyx_v_xx);
-                                __pyx_v_h = (*((double *) ( /* dim=0 */ (__pyx_v_r.data + __pyx_t_18 * __pyx_v_r.strides[0]) )));
-
+582:                     hbar_inv = a/h; hbar_inv3 = hbar_inv*hbar_inv*hbar_inv
-
                                __Pyx_TraceLine(582,1,__PYX_ERR(0, 582, __pyx_L8_error))
-                                __pyx_v_hbar_inv = (__pyx_v_a / __pyx_v_h);
-                                __pyx_v_hbar_inv3 = ((__pyx_v_hbar_inv * __pyx_v_hbar_inv) * __pyx_v_hbar_inv);
-
 583: 
-
+584:                     mux = mur*(1 + muRRpara*hbar_inv3)
-
                                __Pyx_TraceLine(584,1,__PYX_ERR(0, 584, __pyx_L8_error))
-                                __pyx_v_mux = (__pyx_v_mur * (1.0 + (__pyx_v_muRRpara * __pyx_v_hbar_inv3)));
-
+585:                     muy = mux
-
                                __Pyx_TraceLine(585,1,__PYX_ERR(0, 585, __pyx_L8_error))
-                                __pyx_v_muy = __pyx_v_mux;
-
+586:                     muz = mur*(1 + muRRperp*hbar_inv3)
-
                                __Pyx_TraceLine(586,1,__PYX_ERR(0, 586, __pyx_L8_error))
-                                __pyx_v_muz = (__pyx_v_mur * (1.0 + (__pyx_v_muRRperp * __pyx_v_hbar_inv3)));
-                              }
-                              __pyx_L12:;
-                            }
-
 587: 
-
+588:             depsilon += o[i] * gg * (-mux*o[i]  - muv*ox)
-
                            __Pyx_TraceLine(588,1,__PYX_ERR(0, 588, __pyx_L8_error))
-                            __pyx_t_18 = __pyx_v_i;
-                            __pyx_t_16 = __pyx_v_i;
-                            __pyx_v_depsilon = (__pyx_v_depsilon + (((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * (((-__pyx_v_mux) * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - (__pyx_v_muv * __pyx_v_ox))));
-
+589:             depsilon += o[i+N] * gg * (-muy*o[i+N] - muv*oy)
-
                            __Pyx_TraceLine(589,1,__PYX_ERR(0, 589, __pyx_L8_error))
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_N);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + (((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * (((-__pyx_v_muy) * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) )))) - (__pyx_v_muv * __pyx_v_oy))));
-
+590:             depsilon += o[i+xx] * gg * (-muz*o[i+xx] - muv*oz)
-
                            __Pyx_TraceLine(590,1,__PYX_ERR(0, 590, __pyx_L8_error))
-                            __pyx_t_18 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_t_16 = (__pyx_v_i + __pyx_v_xx);
-                            __pyx_v_depsilon = (__pyx_v_depsilon + (((*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_18 * __pyx_v_o.strides[0]) ))) * __pyx_v_gg) * (((-__pyx_v_muz) * (*((double *) ( /* dim=0 */ (__pyx_v_o.data + __pyx_t_16 * __pyx_v_o.strides[0]) )))) - (__pyx_v_muv * __pyx_v_oz))));
-                            goto __pyx_L14;
-                            __pyx_L8_error:;
-                            {
-                                #ifdef WITH_THREAD
-                                PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                                #endif
-                                #ifdef _OPENMP
-                                #pragma omp flush(__pyx_parallel_exc_type)
-                                #endif /* _OPENMP */
-                                if (!__pyx_parallel_exc_type) {
-                                  __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
-                                  __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
-                                  __Pyx_GOTREF(__pyx_parallel_exc_type);
-                                }
-                                #ifdef WITH_THREAD
-                                __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                                #endif
-                            }
-                            __pyx_parallel_why = 4;
-                            goto __pyx_L13;
-                            __pyx_L13:;
-                            #ifdef _OPENMP
-                            #pragma omp critical(__pyx_parallel_lastprivates5)
-                            #endif /* _OPENMP */
-                            {
-                                __pyx_parallel_temp0 = __pyx_v_Odotidr;
-                                __pyx_parallel_temp1 = __pyx_v_depsilon;
-                                __pyx_parallel_temp2 = __pyx_v_dx;
-                                __pyx_parallel_temp3 = __pyx_v_dy;
-                                __pyx_parallel_temp4 = __pyx_v_dz;
-                                __pyx_parallel_temp5 = __pyx_v_h;
-                                __pyx_parallel_temp6 = __pyx_v_h2;
-                                __pyx_parallel_temp7 = __pyx_v_hbar_inv;
-                                __pyx_parallel_temp8 = __pyx_v_hbar_inv3;
-                                __pyx_parallel_temp9 = __pyx_v_i;
-                                __pyx_parallel_temp10 = __pyx_v_idr;
-                                __pyx_parallel_temp11 = __pyx_v_idr3;
-                                __pyx_parallel_temp12 = __pyx_v_idr5;
-                                __pyx_parallel_temp13 = __pyx_v_j;
-                                __pyx_parallel_temp14 = __pyx_v_mux;
-                                __pyx_parallel_temp15 = __pyx_v_muy;
-                                __pyx_parallel_temp16 = __pyx_v_muz;
-                                __pyx_parallel_temp17 = __pyx_v_ox;
-                                __pyx_parallel_temp18 = __pyx_v_oy;
-                                __pyx_parallel_temp19 = __pyx_v_oz;
-                                __pyx_parallel_temp20 = __pyx_v_tempO;
-                            }
-                            __pyx_L14:;
-                            #ifdef _OPENMP
-                            #pragma omp flush(__pyx_parallel_why)
-                            #endif /* _OPENMP */
-                        }
-                    }
-                    #ifdef _OPENMP
-                    Py_END_ALLOW_THREADS
-                    #else
-{
-#ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    #endif /* _OPENMP */
-                    /* Clean up any temporaries */
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                    #ifndef _OPENMP
-}
-#endif /* _OPENMP */
-                }
-            }
-            if (__pyx_parallel_exc_type) {
-              /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
-              __pyx_parallel_why = 4;
-            }
-            if (__pyx_parallel_why) {
-              __pyx_v_Odotidr = __pyx_parallel_temp0;
-              __pyx_v_depsilon = __pyx_parallel_temp1;
-              __pyx_v_dx = __pyx_parallel_temp2;
-              __pyx_v_dy = __pyx_parallel_temp3;
-              __pyx_v_dz = __pyx_parallel_temp4;
-              __pyx_v_h = __pyx_parallel_temp5;
-              __pyx_v_h2 = __pyx_parallel_temp6;
-              __pyx_v_hbar_inv = __pyx_parallel_temp7;
-              __pyx_v_hbar_inv3 = __pyx_parallel_temp8;
-              __pyx_v_i = __pyx_parallel_temp9;
-              __pyx_v_idr = __pyx_parallel_temp10;
-              __pyx_v_idr3 = __pyx_parallel_temp11;
-              __pyx_v_idr5 = __pyx_parallel_temp12;
-              __pyx_v_j = __pyx_parallel_temp13;
-              __pyx_v_mux = __pyx_parallel_temp14;
-              __pyx_v_muy = __pyx_parallel_temp15;
-              __pyx_v_muz = __pyx_parallel_temp16;
-              __pyx_v_ox = __pyx_parallel_temp17;
-              __pyx_v_oy = __pyx_parallel_temp18;
-              __pyx_v_oz = __pyx_parallel_temp19;
-              __pyx_v_tempO = __pyx_parallel_temp20;
-              switch (__pyx_parallel_why) {
-                    case 4:
-                {
-                    #ifdef WITH_THREAD
-                    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
-                    #endif
-                    __Pyx_GIVEREF(__pyx_parallel_exc_type);
-                    __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
-                    __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
-                    #ifdef WITH_THREAD
-                    __Pyx_PyGILState_Release(__pyx_gilstate_save);
-                    #endif
-                }
-                goto __pyx_L4_error;
-              }
-            }
-        }
-        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
-            #undef likely
-            #undef unlikely
-            #define likely(x)   __builtin_expect(!!(x), 1)
-            #define unlikely(x) __builtin_expect(!!(x), 0)
-        #endif
-      }
-
+591:         return depsilon
-
  __Pyx_TraceLine(591,0,__PYX_ERR(0, 591, __pyx_L1_error))
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
diff --git a/pystokes/unbounded.pxd b/pystokes/unbounded.pxd index 98e4273..99a525e 100644 --- a/pystokes/unbounded.pxd +++ b/pystokes/unbounded.pxd @@ -72,23 +72,23 @@ cdef class Flow: cdef int N cdef int Nt - cpdef flowField1s(self, double [:] vv, double [:] rt, double [:] r, double [:] F) + cpdef flowField1s(self, double [:] vv, double [:] rt, double [:] r, double [:] F, double maskR=?) - cpdef flowField2a( self, double [:] vv, double [:] rt, double [:] r, double [:] T) + cpdef flowField2a( self, double [:] vv, double [:] rt, double [:] r, double [:] T, double maskR=?) - cpdef flowField2s(self, double [:] vv, double [:] rt, double [:] r, double [:] S) + cpdef flowField2s(self, double [:] vv, double [:] rt, double [:] r, double [:] S, double maskR=?) - cpdef flowField3t(self, double [:] vv, double [:] rt, double [:] r, double [:] D) + cpdef flowField3t(self, double [:] vv, double [:] rt, double [:] r, double [:] D, double maskR=?) - cpdef flowField3s(self, double [:] vv, double [:] rt, double [:] r, double [:] G) + cpdef flowField3s(self, double [:] vv, double [:] rt, double [:] r, double [:] G, double maskR=?) - cpdef flowField3a(self, double [:] vv, double [:] rt, double [:] r, double [:] V) + cpdef flowField3a(self, double [:] vv, double [:] rt, double [:] r, double [:] V, double maskR=?) - cpdef flowField4a(self, double [:] vv, double [:] rt, double [:] r, double [:] M) + cpdef flowField4a(self, double [:] vv, double [:] rt, double [:] r, double [:] M, double maskR=?) diff --git a/pystokes/unbounded.pyx b/pystokes/unbounded.pyx index 7289191..6333984 100644 --- a/pystokes/unbounded.pyx +++ b/pystokes/unbounded.pyx @@ -872,7 +872,7 @@ cdef class Flow: self.Nt = gridpoints self.eta= viscosity - cpdef flowField1s(self, double [:] vv, double [:] rt, double [:] r, double [:] F): + cpdef flowField1s(self, double [:] vv, double [:] rt, double [:] r, double [:] F, double maskR=1.0): """ Compute flow field at field points due body forces ... @@ -919,7 +919,8 @@ cdef class Flow: cdef int N = self.N, Nt = self.Nt cdef int i, ii, xx = 2*N - cdef double dx, dy, dz, idr, idr2, vv1, vv2, vx, vy, vz, muv = 1/(8*PI*self.eta), aa = self.a*self.a/3.0 + cdef double dx, dy, dz, dr, idr, idr2, vv1, vv2, vx, vy, vz, radi=self.a + cdef double muv = 1/(8*PI*self.eta), aa = self.a*self.a/3.0 for i in prange(Nt, nogil=True): vx = 0.0; vy = 0.0; vz = 0.0; for ii in range(N): @@ -927,14 +928,16 @@ cdef class Flow: dx = rt[i] - r[ii] dy = rt[i+Nt] - r[ii+N] dz = rt[i+2*Nt] - r[ii+xx] - idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz ) - idr2= idr*idr - vv1 = (1+aa*idr2)*idr - vv2 = (1-3*aa*idr2)*( F[ii]*dx + F[ii+N]*dy + F[ii+xx]*dz )*idr2*idr - - vx += vv1*F[ii] + vv2*dx - vy += vv1*F[ii+ N] + vv2*dy - vz += vv1*F[ii+ xx] + vv2*dz + dr = sqrt( dx*dx + dy*dy + dz*dz ) + if dr>maskR: + idr = 1.0/dr + idr2= idr*idr + vv1 = (1+aa*idr2)*idr + vv2 = (1-3*aa*idr2)*( F[ii]*dx + F[ii+N]*dy + F[ii+xx]*dz )*idr2*idr + + vx += vv1*F[ii] + vv2*dx + vy += vv1*F[ii+ N] + vv2*dy + vz += vv1*F[ii+ xx] + vv2*dz vv[i] += vx*muv vv[i + Nt] += vy*muv @@ -942,7 +945,7 @@ cdef class Flow: return - cpdef flowField2a(self, double [:] vv, double [:] rt, double [:] r, double [:] T): + cpdef flowField2a(self, double [:] vv, double [:] rt, double [:] r, double [:] T, double maskR=1.0): """ Compute flow field at field points due body Torque ... @@ -990,19 +993,21 @@ cdef class Flow: cdef int N = self.N, Nt = self.Nt cdef int i, ii, xx = 2*N - cdef double dx, dy, dz, idr, idr3, vx, vy, vz, mur1 = 1.0/(8*PI*self.eta) + cdef double dx, dy, dz, dr, idr, idr3, vx, vy, vz, mur1 = 1.0/(8*PI*self.eta), radi=self.a for i in prange(Nt, nogil=True): vx = 0.0; vy = 0.0; vz = 0.0; for ii in range(N): dx = rt[i] - r[ii] dy = rt[i+Nt] - r[ii+N] dz = rt[i+2*Nt] - r[ii+xx] - idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz ) - idr3 = idr*idr*idr + dr = sqrt( dx*dx + dy*dy + dz*dz ) + if dr>maskR: + idr = 1.0/dr + idr3 = idr*idr*idr - vx += ( dy*T[ii+xx] - dz*T[ii+N])*idr3 - vy += ( dz*T[ii] - dx*T[ii+xx])*idr3 - vz += ( dx*T[ii+N] - dy*T[ii] )*idr3 + vx += ( dy*T[ii+xx] - dz*T[ii+N])*idr3 + vy += ( dz*T[ii] - dx*T[ii+xx])*idr3 + vz += ( dx*T[ii+N] - dy*T[ii] )*idr3 vv[i ] += vx*mur1 vv[i + Nt] += vy*mur1 @@ -1010,7 +1015,7 @@ cdef class Flow: return - cpdef flowField2s(self, double [:] vv, double [:] rt, double [:] r, double [:] S): + cpdef flowField2s(self, double [:] vv, double [:] rt, double [:] r, double [:] S, double maskR=1.0): """ Compute flow field at field points due to 2s mode of the slip ... @@ -1057,8 +1062,8 @@ cdef class Flow: cdef int N = self.N, Nt = self.Nt cdef int i, ii, xx= 2*N, xx1= 3*N, xx2 = 4*N - cdef double dx, dy, dz, idr, idr3, aidr2, sxx, syy, sxy, sxz, syz, srr, srx, sry, srz - cdef double aa = self.a**2, vv1, vv2, vx, vy, vz, mus = (28.0*self.a**3)/24 + cdef double dx, dy, dz, dr, idr, idr3, aidr2, sxx, syy, sxy, sxz, syz, srr, srx, sry, srz + cdef double aa = self.a**2, vv1, vv2, vx, vy, vz, mus = (28.0*self.a**3)/24, radi=self.a for i in prange(Nt, nogil=True): vx = 0.0;vy = 0.0; vz = 0.0; for ii in range(N): @@ -1071,30 +1076,31 @@ cdef class Flow: dx = rt[i] - r[ii] dy = rt[i+Nt] - r[ii+N] dz = rt[i+2*Nt] - r[ii+xx] - - idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz ) - idr3 = idr*idr*idr - aidr2 = aa*idr*idr - - srr = (sxx*(dx*dx-dz*dz) + syy*(dy*dy-dz*dz) + 2*sxy*dx*dy + 2*sxz*dx*dz + 2*syz*dy*dz)*idr*idr - srx = sxx*dx + sxy*dy + sxz*dz - sry = sxy*dx + syy*dy + syz*dz - srz = sxz*dx + syz*dy - (sxx+syy)*dz - - vv1 = 3*(1-aidr2)*srr*idr3 - vv2 = 1.2*aidr2*idr3 - - vx += vv1*dx + vv2*srx - vy += vv1*dy + vv2*sry - vz += vv1*dz + vv2*srz - + dr = sqrt( dx*dx + dy*dy + dz*dz ) + if dr>maskR: + idr = 1.0/dr + idr3 = idr*idr*idr + aidr2 = aa*idr*idr + + srr = (sxx*(dx*dx-dz*dz) + syy*(dy*dy-dz*dz) + 2*sxy*dx*dy + 2*sxz*dx*dz + 2*syz*dy*dz)*idr*idr + srx = sxx*dx + sxy*dy + sxz*dz + sry = sxy*dx + syy*dy + syz*dz + srz = sxz*dx + syz*dy - (sxx+syy)*dz + + vv1 = 3*(1-aidr2)*srr*idr3 + vv2 = 1.2*aidr2*idr3 + + vx += vv1*dx + vv2*srx + vy += vv1*dy + vv2*sry + vz += vv1*dz + vv2*srz + vv[i] += vx*mus vv[i+Nt] += vy*mus vv[i+2*Nt] += vz*mus return - cpdef flowField3t(self, double [:] vv, double [:] rt, double [:] r, double [:] D): + cpdef flowField3t(self, double [:] vv, double [:] rt, double [:] r, double [:] D, double maskR=1.0): """ Compute flow field at field points due to 3t mode of the slip ... @@ -1141,7 +1147,7 @@ cdef class Flow: cdef int N = self.N, Nt = self.Nt cdef int i, ii - cdef double dx, dy, dz, idr, idr3, Ddotidr, vx, vy, vz,mud1 = -1.0*(self.a**5)/10 + cdef double dx, dy, dz, dr, idr, idr3, Ddotidr, vx, vy, vz,mud1 = -1.0*(self.a**5)/10, radi=self.a for i in prange(Nt, nogil=True): vx =0.0; vy = 0.0; vz =0.0; @@ -1149,13 +1155,16 @@ cdef class Flow: dx = rt[i] - r[ii] dy = rt[i+Nt] - r[ii+N] dz = rt[i+2*Nt] - r[ii+2*N] - idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz ) - idr3 = idr*idr*idr - Ddotidr = (D[ii]*dx + D[ii+N]*dy + D[ii+2*N]*dz)*idr*idr - vx += (D[ii] - 3.0*Ddotidr*dx )*idr3 - vy += (D[ii+N] - 3.0*Ddotidr*dy )*idr3 - vz += (D[ii+2*N] - 3.0*Ddotidr*dz )*idr3 + dr = sqrt( dx*dx + dy*dy + dz*dz ) + if dr>maskR: + idr = 1.0/dr + idr3 = idr*idr*idr + Ddotidr = (D[ii]*dx + D[ii+N]*dy + D[ii+2*N]*dz)*idr*idr + + vx += (D[ii] - 3.0*Ddotidr*dx )*idr3 + vy += (D[ii+N] - 3.0*Ddotidr*dy )*idr3 + vz += (D[ii+2*N] - 3.0*Ddotidr*dz )*idr3 vv[i] += vx*mud1 vv[i+Nt] += vy*mud1 @@ -1164,7 +1173,7 @@ cdef class Flow: return - cpdef flowField3s(self, double [:] vv, double [:] rt, double [:] r, double [:] G): + cpdef flowField3s(self, double [:] vv, double [:] rt, double [:] r, double [:] G, double maskR=1): """ Compute flow field at field points due to 3s mode of the slip ... @@ -1187,7 +1196,7 @@ cdef class Flow: cdef int N = self.N, Nt = self.Nt cdef int i, ii, - cdef double dx, dy, dz, idr, idr5, idr7 + cdef double dx, dy, dz, dr, idr, idr5, idr7, radi=self.a cdef double aidr2, grrr, grrx, grry, grrz, gxxx, gyyy, gxxy, gxxz, gxyy, gxyz, gyyz for i in prange(Nt, nogil=True): for ii in range(N): @@ -1201,24 +1210,26 @@ cdef class Flow: dx = rt[i] - r[ii] dy = rt[i+Nt] - r[ii+N] dz = rt[i+2*Nt] - r[ii+2*N] - idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz ) - idr5 = idr*idr*idr*idr*idr - idr7 = idr5*idr*idr - aidr2 = self.a*self.a*idr*idr - - grrr = gxxx*dx*(dx*dx-3*dz*dz) + 3*gxxy*dy*(dx*dx-dz*dz) + gxxz*dz*(3*dx*dx-dz*dz) +\ - 3*gxyy*dx*(dy*dy-dz*dz) + 6*gxyz*dx*dy*dz + gyyy*dy*(dy*dy-3*dz*dz) + gyyz*dz*(3*dy*dy-dz*dz) - grrx = gxxx*(dx*dx-dz*dz) + gxyy*(dy*dy-dz*dz) + 2*gxxy*dx*dy + 2*gxxz*dx*dz + 2*gxyz*dy*dz - grry = gxxy*(dx*dx-dz*dz) + gyyy*(dy*dy-dz*dz) + 2*gxyy*dx*dy + 2*gxyz*dx*dz + 2*gyyz*dy*dz - grrz = gxxz*(dx*dx-dz*dz) + gyyz*(dy*dy-dz*dz) + 2*gxyz*dx*dy - 2*(gxxx+gxyy)*dx*dz - 2*(gxxy+gyyy)*dy*dz - - vv[i] += 3*(1-(15.0/7)*aidr2)*grrx*idr5 - 15*(1-aidr2)*grrr*dx*idr7 - vv[i+Nt] += 3*(1-(15.0/7)*aidr2)*grry*idr5 - 15*(1-aidr2)*grrr*dy*idr7 - vv[i+2*Nt] += 3*(1-(15.0/7)*aidr2)*grrz*idr5 - 15*(1-aidr2)*grrr*dz*idr7 + dr = sqrt( dx*dx + dy*dy + dz*dz ) + if dr>maskR: + idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz ) + idr5 = idr*idr*idr*idr*idr + idr7 = idr5*idr*idr + aidr2 = self.a*self.a*idr*idr + + grrr = gxxx*dx*(dx*dx-3*dz*dz) + 3*gxxy*dy*(dx*dx-dz*dz) + gxxz*dz*(3*dx*dx-dz*dz) +\ + 3*gxyy*dx*(dy*dy-dz*dz) + 6*gxyz*dx*dy*dz + gyyy*dy*(dy*dy-3*dz*dz) + gyyz*dz*(3*dy*dy-dz*dz) + grrx = gxxx*(dx*dx-dz*dz) + gxyy*(dy*dy-dz*dz) + 2*gxxy*dx*dy + 2*gxxz*dx*dz + 2*gxyz*dy*dz + grry = gxxy*(dx*dx-dz*dz) + gyyy*(dy*dy-dz*dz) + 2*gxyy*dx*dy + 2*gxyz*dx*dz + 2*gyyz*dy*dz + grrz = gxxz*(dx*dx-dz*dz) + gyyz*(dy*dy-dz*dz) + 2*gxyz*dx*dy - 2*(gxxx+gxyy)*dx*dz - 2*(gxxy+gyyy)*dy*dz + + vv[i] += 3*(1-(15.0/7)*aidr2)*grrx*idr5 - 15*(1-aidr2)*grrr*dx*idr7 + vv[i+Nt] += 3*(1-(15.0/7)*aidr2)*grry*idr5 - 15*(1-aidr2)*grrr*dy*idr7 + vv[i+2*Nt] += 3*(1-(15.0/7)*aidr2)*grrz*idr5 - 15*(1-aidr2)*grrr*dz*idr7 return - cpdef flowField3a(self, double [:] vv, double [:] rt, double [:] r, double [:] V): + cpdef flowField3a(self, double [:] vv, double [:] rt, double [:] r, double [:] V, double maskR=1): """ Compute flow field at field points due to 3a mode of the slip ... @@ -1241,7 +1252,7 @@ cdef class Flow: cdef int N = self.N, Nt = self.Nt cdef int i, ii - cdef double dx, dy, dz, idr, idr5, vxx, vyy, vxy, vxz, vyz, vrx, vry, vrz + cdef double dx, dy, dz, dr, idr, idr5, vxx, vyy, vxy, vxz, vyz, vrx, vry, vrz, radi=self.a for i in prange(Nt, nogil=True): for ii in range(N): @@ -1253,19 +1264,21 @@ cdef class Flow: dx = rt[i] - r[ii] dy = rt[i+Nt] - r[ii+N] dz = rt[i+2*Nt] - r[ii+2*N] - idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz) - idr5 = idr*idr*idr*idr*idr - vrx = vxx*dx + vxy*dy + vxz*dz - vry = vxy*dx + vyy*dy + vyz*dz - vrz = vxz*dx + vyz*dy - (vxx+vyy)*dz - - vv[i] += 8*( dy*vrz - dz*vry )*idr5 - vv[i+Nt] += 8*( dz*vrx - dx*vrz )*idr5 - vv[i+2*Nt] += 8*( dx*vry - dy*vrx )*idr5 + dr = sqrt( dx*dx + dy*dy + dz*dz ) + if dr>radi: + idr = 1.0/dr + idr5 = idr*idr*idr*idr*idr + vrx = vxx*dx + vxy*dy + vxz*dz + vry = vxy*dx + vyy*dy + vyz*dz + vrz = vxz*dx + vyz*dy - (vxx+vyy)*dz + + vv[i] += 8*( dy*vrz - dz*vry )*idr5 + vv[i+Nt] += 8*( dz*vrx - dx*vrz )*idr5 + vv[i+2*Nt] += 8*( dx*vry - dy*vrx )*idr5 return - cpdef flowField4a(self, double [:] vv, double [:] rt, double [:] r, double [:] M): + cpdef flowField4a(self, double [:] vv, double [:] rt, double [:] r, double [:] M, double maskR=1): """ Compute flow field at field points due to 4a mode of the slip ... @@ -1288,7 +1301,7 @@ cdef class Flow: cdef int N = self.N, Nt = self.Nt cdef int i, ii - cdef double dx, dy, dz, idr, idr7 + cdef double dx, dy, dz, idr, idr7, dr, radi=self.a cdef double mrrx, mrry, mrrz, mxxx, myyy, mxxy, mxxz, mxyy, mxyz, myyz for i in prange(Nt, nogil=True): @@ -1303,14 +1316,16 @@ cdef class Flow: dx = rt[i] - r[ii] dy = rt[i+Nt] - r[ii+N] dz = rt[i+2*Nt] - r[ii+2*N] - idr = 1.0/sqrt( dx*dx + dy*dy + dz*dz ) - idr7 = idr*idr*idr*idr*idr*idr*idr - mrrx = mxxx*(dx*dx-dz*dz) + mxyy*(dy*dy-dz*dz) + 2*mxxy*dx*dy + 2*mxxz*dx*dz + 2*mxyz*dy*dz - mrry = mxxy*(dx*dx-dz*dz) + myyy*(dy*dy-dz*dz) + 2*mxyy*dx*dy + 2*mxyz*dx*dz + 2*myyz*dy*dz - mrrz = mxxz*(dx*dx-dz*dz) + myyz*(dy*dy-dz*dz) + 2*mxyz*dx*dy - 2*(mxxx+mxyy)*dx*dz - 2*(mxxy+myyy)*dy*dz - - vv[i] -= 6*( dy*mrrz - dz*mrry )*idr7 - vv[i+Nt] -= 6*( dz*mrrx - dx*mrrz )*idr7 - vv[i+2*Nt] -= 6*( dx*mrry - dy*mrrx )*idr7 + dr = sqrt( dx*dx + dy*dy + dz*dz ) + if dr>radi: + idr = 1.0/dr + idr7 = idr*idr*idr*idr*idr*idr*idr + mrrx = mxxx*(dx*dx-dz*dz) + mxyy*(dy*dy-dz*dz) + 2*mxxy*dx*dy + 2*mxxz*dx*dz + 2*mxyz*dy*dz + mrry = mxxy*(dx*dx-dz*dz) + myyy*(dy*dy-dz*dz) + 2*mxyy*dx*dy + 2*mxyz*dx*dz + 2*myyz*dy*dz + mrrz = mxxz*(dx*dx-dz*dz) + myyz*(dy*dy-dz*dz) + 2*mxyz*dx*dy - 2*(mxxx+mxyy)*dx*dz - 2*(mxxy+myyy)*dy*dz + + vv[i] -= 6*( dy*mrrz - dz*mrry )*idr7 + vv[i+Nt] -= 6*( dz*mrrx - dx*mrrz )*idr7 + vv[i+2*Nt] -= 6*( dx*mrry - dy*mrrx )*idr7 return diff --git a/pystokes/utils.pyx b/pystokes/utils.pyx index 8f02fea..3663b12 100644 --- a/pystokes/utils.pyx +++ b/pystokes/utils.pyx @@ -3,72 +3,72 @@ but are essential in simulations of active colloids, and plotting flow and phoretic fields """ -import numpy as np +import numpy as np cimport numpy as np cimport cython from libc.math cimport sqrt, pow, log from cython.parallel import prange cdef double PI = 3.1415926535 -DTYPE = np.float64 -DTYP1 = np.int32 +DTYPE = np.float64 +DTYP1 = np.int32 ctypedef np.float_t DTYPE_t def gridXY(dim, L, Ng): - """ - Returns the grid in XY direction centered around zero - ... - - Parameters - ---------- - L : float - Length of the grid - Ng : int - Number of grid points - - Examples - -------- - An example of creating grid - - >>> import numpy as np, pystokes - >>> dim, L, Ng = 3, 10, 32 - >>> rr, vv = pystokes.utils.gridXY(dim, L, Ng) - """ - - Nt = Ng*Ng - rr, vv = np.zeros(dim*Nt), np.zeros(dim*Nt) - X, Y = np.meshgrid(np.linspace(-L, L, Ng), np.linspace(-L, L, Ng)) - rr[0:2*Nt] = np.concatenate((X.reshape(Ng*Ng), Y.reshape(Ng*Ng))) - return rr, vv + """ + Returns the grid in XY direction centered around zero + ... + + Parameters + ---------- + L : float + Length of the grid + Ng : int + Number of grid points + + Examples + -------- + An example of creating grid + + >>> import numpy as np, pystokes + >>> dim, L, Ng = 3, 10, 32 + >>> rr, vv = pystokes.utils.gridXY(dim, L, Ng) + """ + + Nt = Ng*Ng + rr, vv = np.zeros(dim*Nt), np.zeros(dim*Nt) + X, Y = np.meshgrid(np.linspace(-L, L, Ng), np.linspace(-L, L, Ng)) + rr[0:2*Nt] = np.concatenate((X.reshape(Ng*Ng), Y.reshape(Ng*Ng))) + return rr, vv def gridYZ(dim, L, Ng): - """ - Returns the grid in YZ direction centered around zero - ... - - Parameters - ---------- - L : float - Length of the grid - Ng : int - Number of grid points - - Examples - -------- - An example of creating grid - - >>> import numpy as np, pystokes - >>> dim, L, Ng = 3, 10, 32 - >>> rr, vv = pystokes.utils.gridYZ(dim, L, Ng) - """ - - Nt = Ng*Ng - rr, vv = np.zeros(dim*Nt), np.zeros(dim*Nt) - X, Y = np.meshgrid(np.linspace(-L, L, Ng), np.linspace(-0, L, Ng)) - rr[Nt:3*Nt] = np.concatenate((X.reshape(Ng*Ng), Y.reshape(Ng*Ng))) - return rr, vv + """ + Returns the grid in YZ direction centered around zero + ... + + Parameters + ---------- + L : float + Length of the grid + Ng : int + Number of grid points + + Examples + -------- + An example of creating grid + + >>> import numpy as np, pystokes + >>> dim, L, Ng = 3, 10, 32 + >>> rr, vv = pystokes.utils.gridYZ(dim, L, Ng) + """ + + Nt = Ng*Ng + rr, vv = np.zeros(dim*Nt), np.zeros(dim*Nt) + X, Y = np.meshgrid(np.linspace(-L, L, Ng), np.linspace(-0, L, Ng)) + rr[Nt:3*Nt] = np.concatenate((X.reshape(Ng*Ng), Y.reshape(Ng*Ng))) + return rr, vv @@ -76,610 +76,626 @@ def gridYZ(dim, L, Ng): @cython.nonecheck(False) @cython.boundscheck(False) cpdef irreducibleTensors(l, p, Y0=1): - """ - Uniaxial paramterization of the tensorial harmonics (Yl) of order l - ... - - Parameters - ---------- - l : int - Tensorial Harmonics of order l - p : np.rrray - An array of size 3 - Axis along which the mode is paramterized - Y0 : float - Strength of the mode - - returns: Yl - tensorialHarmonics of rank l - """ - cdef int i, N = int (np.size(p)/3) - cdef double S0 = Y0 - YY = np.zeros((2*l+1)*N, dtype=DTYPE) - - cdef double [:] p1 = p - cdef double [:] Y1 = YY - - - if l==0: - YY = Y0 - - if l==1: - YY = Y0*p - - if l==2: - for i in prange(N, nogil=True): - Y1[i + 0*N] = S0*(p1[i]*p1[i] -(1.0/3)) - Y1[i + 1*N] = S0*(p1[i + N]*p1[i + N] -(1.0/3)) - Y1[i + 2*N] = S0*(p1[i]*p1[i + N]) - Y1[i + 3*N] = S0*(p1[i]*p1[i + 2*N]) - Y1[i + 4*N] = S0*(p1[i + N]*p1[i + 2*N]) - - if l==3: - for i in range(N): - YY[i] = Y0*(p[i]*p[i]*p[i] - 3/5*p[i]); - YY[i+N] = Y0*(p[i+N]*p[i+N]*p[i+N] - 3/5*p[i+N]); - YY[i+2*N] = Y0*(p[i]*p[i]*p[i+N] - 1/5*p[i+N]); - YY[i+3*N] = Y0*(p[i]*p[i]*p[i+2*N] - 1/5*p[i+2*N]); - YY[i+4*N] = Y0*(p[i]*p[i+N]*p[1+N] -1/5* p[i]); - YY[i+5*N] = Y0*(p[i+N]*p[i+N]*p[i+2*N]); - YY[i+6*N] = Y0*(p[i+N]*p[i+N]*p[i+2*N] -1/5*p[i+2*N]); - return YY + """ + Uniaxial paramterization of the tensorial harmonics (Yl) of order l + ... + + Parameters + ---------- + l : int + Tensorial Harmonics of order l + p : np.rrray + An array of size 3 + Axis along which the mode is paramterized + Y0 : float + Strength of the mode + + returns: Yl - tensorialHarmonics of rank l + """ + cdef int i, N = int (np.size(p)/3) + cdef double S0 = Y0 + YY = np.zeros((2*l+1)*N, dtype=DTYPE) + + cdef double [:] p1 = p + cdef double [:] Y1 = YY + + + if l==0: + YY = Y0 + + if l==1: + YY = Y0*p + + if l==2: + for i in prange(N, nogil=True): + Y1[i + 0*N] = S0*(p1[i]*p1[i] -(1.0/3)) + Y1[i + 1*N] = S0*(p1[i + N]*p1[i + N] -(1.0/3)) + Y1[i + 2*N] = S0*(p1[i]*p1[i + N]) + Y1[i + 3*N] = S0*(p1[i]*p1[i + 2*N]) + Y1[i + 4*N] = S0*(p1[i + N]*p1[i + 2*N]) + + if l==3: + for i in range(N): + YY[i] = Y0*(p[i]*p[i]*p[i] - 3/5*p[i]); + YY[i+N] = Y0*(p[i+N]*p[i+N]*p[i+N] - 3/5*p[i+N]); + YY[i+2*N] = Y0*(p[i]*p[i]*p[i+N] - 1/5*p[i+N]); + YY[i+3*N] = Y0*(p[i]*p[i]*p[i+2*N] - 1/5*p[i+2*N]); + YY[i+4*N] = Y0*(p[i]*p[i+N]*p[1+N] -1/5* p[i]); + YY[i+5*N] = Y0*(p[i+N]*p[i+N]*p[i+2*N]); + YY[i+6*N] = Y0*(p[i+N]*p[i+N]*p[i+2*N] -1/5*p[i+2*N]); + return YY def simulate(rp0, Tf, Nts, rhs, integrator='odeint', filename='this.mat', - Ti=0, maxNumSteps=100000, **kwargs): - """ - Simulates using choice of integrator - - ... - - Parameters - ---------- - rp0 : np.array - Initial condition - Tf : int - Final time - Nts: int - Number of points to return data - rhs : Python Function - Right hand side to integrate - integrator: string - Default is 'odeint' of scipy. - Please set integrator='odeint' to use - the scipy.integrate's odeint (Default) - Use integrator='solve_ivp' to use ivp - Use integrator='odespy-vode' to use vode - from odespy (github.com/rajeshrinet/odespy). - Use integrator='odespy-rkf45' to use RKF45 - from odespy (github.com/rajeshrinet/odespy). - Use integrator='odespy-rk4' to use RK4 from - odespy (github.com/rajeshrinet/odespy). - Alternatively, write your own integrator to - evolve the system in time and store the data. - filename: string - filename to write the data. - Deafult is 'this.mat' - """ - - def dxdtEval(rp, t): - """ - returns the right hand side - """ - return rhs(rp) + Ti=0, maxNumSteps=100000, **kwargs): + """ + Simulates using choice of integrator + + ... + + Parameters + ---------- + rp0 : np.array + Initial condition + Tf : int + Final time + Nts: int + Number of points to return data + rhs : Python Function + Right hand side to integrate + integrator: string + Default is 'odeint' of scipy. + Please set integrator='odeint' to use + the scipy.integrate's odeint (Default) + Use integrator='solve_ivp' to use ivp + Use integrator='odespy-vode' to use vode + from odespy (github.com/rajeshrinet/odespy). + Use integrator='odespy-rkf45' to use RKF45 + from odespy (github.com/rajeshrinet/odespy). + Use integrator='odespy-rk4' to use RK4 from + odespy (github.com/rajeshrinet/odespy). + Alternatively, write your own integrator to + evolve the system in time and store the data. + filename: string + filename to write the data. + Deafult is 'this.mat' + """ + + def dxdtEval(rp, t): + """ + returns the right hand side + """ + return rhs(rp) - if integrator=='odeint': - from scipy.integrate import odeint - time_points=np.linspace(Ti, Tf, Nts+1); - X = odeint(dxdtEval, rp0, time_points, mxstep=maxNumSteps, **kwargs) - - elif integrator=='solve_ivp': - from scipy.integrate import solve_ivp - time_points=np.linspace(Ti, Tf, Nts+1) - X = solve_ivp(lambda t, xt: dxdtEval(xt,t), [0,Tf], rp0, - t_eval=time_points, **kwargs).y.T - - elif integrator=='odespy-vode': - import odespy - time_points=np.linspace(Ti, Tf, Nts+1); - solver = odespy.Vode(dxdtEval, method = 'bdf', - atol=1E-7, rtol=1E-6, order=5, nsteps=maxNumSteps) - solver.set_initial_condition(rp0) - X, t = solver.solve(time_points, **kwargs) - - elif integrator=='odespy-rkf45': - import odespy - time_points=np.linspace(Ti, Tf, Nts+1); - solver = odespy.RKF45(dxdtEval) - solver.set_initial_condition(rp0) - X, t = solver.solve(time_points, **kwargs) - - elif integrator=='odespy-rk4': - import odespy - time_points=np.linspace(Ti, Tf, Nts+1); - solver = odespy.RK4(dxdtEval) - solver.set_initial_condition(rp0) - X, t = solver.solve(time_points, **kwargs) - - else: - raise Exception("Error: Integration method not found! \n \ - Please set integrator='odeint' to use \n \ - the scipy.integrate's odeint (Default)\n \ - Use integrator='solve_ivp' to use ivp \ - Use integrator='odespy-vode' to use vode \ - from odespy (github.com/rajeshrinet/odespy).\n \ - Use integrator='odespy-rkf45' to use RKF45 \ - from odespy (github.com/rajeshrinet/odespy).\n \ - Use integrator='odespy-rk4' to use RK4 from \ - odespy (github.com/rajeshrinet/odespy). \n \ - Alternatively, write your own integrator to \ - evolve the system in time and store the data.\n") - - from scipy.io import savemat - savemat(filename, {'X':X, 't':time_points}) - return + if integrator=='odeint': + from scipy.integrate import odeint + time_points=np.linspace(Ti, Tf, Nts+1); + X = odeint(dxdtEval, rp0, time_points, mxstep=maxNumSteps, **kwargs) + + elif integrator=='solve_ivp': + from scipy.integrate import solve_ivp + time_points=np.linspace(Ti, Tf, Nts+1) + X = solve_ivp(lambda t, xt: dxdtEval(xt,t), [0,Tf], rp0, + t_eval=time_points, **kwargs).y.T + + elif integrator=='odespy-vode': + import odespy + time_points=np.linspace(Ti, Tf, Nts+1); + solver = odespy.Vode(dxdtEval, method = 'bdf', + atol=1E-7, rtol=1E-6, order=5, nsteps=maxNumSteps) + solver.set_initial_condition(rp0) + X, t = solver.solve(time_points, **kwargs) + + elif integrator=='odespy-rkf45': + import odespy + time_points=np.linspace(Ti, Tf, Nts+1); + solver = odespy.RKF45(dxdtEval) + solver.set_initial_condition(rp0) + X, t = solver.solve(time_points, **kwargs) + + elif integrator=='odespy-rk4': + import odespy + time_points=np.linspace(Ti, Tf, Nts+1); + solver = odespy.RK4(dxdtEval) + solver.set_initial_condition(rp0) + X, t = solver.solve(time_points, **kwargs) + + else: + raise Exception("Error: Integration method not found! \n \ + Please set integrator='odeint' to use \n \ + the scipy.integrate's odeint (Default)\n \ + Use integrator='solve_ivp' to use ivp \ + Use integrator='odespy-vode' to use vode \ + from odespy (github.com/rajeshrinet/odespy).\n \ + Use integrator='odespy-rkf45' to use RKF45 \ + from odespy (github.com/rajeshrinet/odespy).\n \ + Use integrator='odespy-rk4' to use RK4 from \ + odespy (github.com/rajeshrinet/odespy). \n \ + Alternatively, write your own integrator to \ + evolve the system in time and store the data.\n") + + from scipy.io import savemat + savemat(filename, {'X':X, 't':time_points}) + return def initialCondition(N, h0=3.1): - ''' - Assigns initial condition. - To DO: Need to include options to assign possibilites - ''' - rp0 = np.zeros(3*N) - radius = np.sqrt(np.arange(N)/float(N)) - golden_angle = np.pi * (3 - np.sqrt(5)) - theta = golden_angle * np.arange(N) - - points = np.zeros((N, 2)) - points[:,0] = np.cos(theta) - points[:,1] = np.sin(theta) - points *= radius.reshape((N, 1)) - points = points*2.1*np.sqrt(N) - - points[:,0] += 2*(2*np.random.random(N)-np.ones(N)) - points[:,1] += 2*(2*np.random.random(N)-np.ones(N)) - - - rp0[0:N] = 1.5*points[:, 0] - rp0[N:2*N] = 1.5*points[:, 1] - rp0[2*N:3*N] = h0 - ##rp0[0:3*N] = ar*(2*np.random.random(3*N)-np.ones(3*N)) + rp0[0:3*N] - # - #rp0[3*N:4*N] = np.zeros(N) - #rp0[4*N:5*N] = np.zeros(N) - #rp0[5*N:6*N] = -np.ones(N) - return rp0 + ''' + Assigns initial condition. + To DO: Need to include options to assign possibilites + ''' + rp0 = np.zeros(3*N) + radius = np.sqrt(np.arange(N)/float(N)) + golden_angle = np.pi * (3 - np.sqrt(5)) + theta = golden_angle * np.arange(N) + + points = np.zeros((N, 2)) + points[:,0] = np.cos(theta) + points[:,1] = np.sin(theta) + points *= radius.reshape((N, 1)) + points = points*2.1*np.sqrt(N) + + points[:,0] += 2*(2*np.random.random(N)-np.ones(N)) + points[:,1] += 2*(2*np.random.random(N)-np.ones(N)) + + + rp0[0:N] = 1.5*points[:, 0] + rp0[N:2*N] = 1.5*points[:, 1] + rp0[2*N:3*N] = h0 + ##rp0[0:3*N] = ar*(2*np.random.random(3*N)-np.ones(3*N)) + rp0[0:3*N] + # + #rp0[3*N:4*N] = np.zeros(N) + #rp0[4*N:5*N] = np.zeros(N) + #rp0[5*N:6*N] = -np.ones(N) + return rp0 def plotLogo(): - """Plots the PyStokes Logo""" - import pystokes - import numpy as np, matplotlib.pyplot as plt - # particle radius, fluid viscosity, and number of particles - b, eta, N = 1.0, 1.0/6.0, 4 - - #initialise - r = np.zeros(3*N); r[2*N:3*N] = 2 - p = np.zeros(3*N); p[2*N:3*N] = 1 - - r[2*N]=2.8; r[N:2*N]=np.linspace(-3.2, 3.2, N); - # irreducible coeffcients - F1s = pystokes.utils.irreducibleTensors(1, p) - V2s = pystokes.utils.irreducibleTensors(2, p) - V3t = pystokes.utils.irreducibleTensors(1, p) - - # space dimension , extent , discretization - dim, L, Ng = 3, 8, 100 - - #Instantiate the Flow class - wFlow = pystokes.unbounded.Flow(radius=b, particles=N, viscosity=eta, gridpoints=Ng*Ng) - wFlow = pystokes.wallBounded.Flow(radius=b, particles=N, viscosity=eta, gridpoints=Ng*Ng) - #iFlow = pystokes.interface.Flow(radius=b, particles=N, viscosity=eta, gridpoints=Ng*Ng) - - # create the grid - rr, vv = pystokes.utils.gridYZ(dim, L, Ng); - wFlow.flowField1s(vv, rr, r, F1s) - - plt.figure(figsize=(26, 8)); Nt=Ng*Ng - - yy, zz = rr[Nt:2*Nt].reshape(Ng, Ng), rr[2*Nt:3*Nt].reshape(Ng, Ng) - vy, vz = vv[Nt:2*Nt].reshape(Ng, Ng), vv[2*Nt:3*Nt].reshape(Ng, Ng) - density=0.75; arrowSize=4; mask=0.6; ms=36; offset=1e-6 - plt.streamplot(yy, zz, vy, vz, color="gray", arrowsize =arrowSize, density=density, linewidth=4.4) - - for i in range(N): - plt.plot(r[i+N], r[i+2*N], 'o', mfc='snow', mec='darkslategray', ms=4.8*ms, mew=5.2) - plt.grid() - - ww=0.3 - plt.ylim(-ww, np.max(zz)) - plt.axhspan(-ww, ww, facecolor='gray'); - plt.axis('off') - plt.text(r[N]-.6, r[2*N]-.5, 'Py', fontsize=100); - plt.text(r[N+1]-.66, r[2*N+1]-.64, 'St', fontsize=111); - plt.text(r[N+2]-.78, r[2*N+2]-.64, 'ok', fontsize=111); - plt.text(r[N+3]-.66, r[2*N+3]-.64, 'es', fontsize=111); - - - - -def plotStreamlinesXY(vv, rr, r, density=0.82, arrowSize=1.2, mask=0.6, ms=36, offset=1e-6, title='None'): - """ - Plots streamlines in XY plane given the position and velocity; - vv: one dimensional arrays of velocity - rr: one dimensional arrays of positions where velocity is computed - """ - import matplotlib.pyplot as plt - N, Nt = int(np.size(r)/3), int(np.size(rr)/3); Ng=int(np.sqrt(Nt)) - xx, yy = rr[0:Nt].reshape(Ng, Ng), rr[Nt:2*Nt].reshape(Ng, Ng) - vx, vy = vv[0:Nt].reshape(Ng, Ng), vv[Nt:2*Nt].reshape(Ng, Ng) - - spd = np.hypot(vx, vy) - rr = np.hypot(xx-r[0], yy-r[1]) - spd[rr