Cython: advection_ext.pyx

Generated by Cython 0.29.28

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: advection_ext.c

    +01: #cython: wraparound=False, boundscheck=False, cdivision=True, profile=False, nonecheck=False, overflowcheck=False, cdivision_warnings=False, unraisable_tracebacks=False

      __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     02: import cython

     03:

     04: # import both numpy and the Cython declarations for numpy

    +05: import numpy as np

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     06: cimport numpy as np

     07:

     08: # declare the interface to the C code

     09: cdef extern from "advection.c":

     10: 	double _compute_fluxes(double* quantity_update, double* quantity_edge, double* quantity_bdry, long* domain_neighbours, long* domain_neighbour_edges, double* domain_normals, double* domain_areas, double* domain_radii, double* domain_edgelengths, long* domain_tri_full_flag, double* domain_velocity, double huge_timestep, double max_timestep, int ntri, int nbdry)

     11:

    +12: def compute_fluxes(object domain, object quantity, double huge_timestep, double max_timestep):

    /* Python wrapper */
    static PyObject *__pyx_pw_5anuga_9advection_13advection_ext_1compute_fluxes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5anuga_9advection_13advection_ext_1compute_fluxes = {"compute_fluxes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5anuga_9advection_13advection_ext_1compute_fluxes, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5anuga_9advection_13advection_ext_1compute_fluxes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_domain = 0;
      PyObject *__pyx_v_quantity = 0;
      double __pyx_v_huge_timestep;
      double __pyx_v_max_timestep;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("compute_fluxes (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain,&__pyx_n_s_quantity,&__pyx_n_s_huge_timestep,&__pyx_n_s_max_timestep,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quantity)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("compute_fluxes", 1, 4, 4, 1); __PYX_ERR(0, 12, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_huge_timestep)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("compute_fluxes", 1, 4, 4, 2); __PYX_ERR(0, 12, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  3:
            if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_timestep)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("compute_fluxes", 1, 4, 4, 3); __PYX_ERR(0, 12, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_fluxes") < 0)) __PYX_ERR(0, 12, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_domain = values[0];
        __pyx_v_quantity = values[1];
        __pyx_v_huge_timestep = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_huge_timestep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L3_error)
        __pyx_v_max_timestep = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_max_timestep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("compute_fluxes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 12, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("anuga.advection.advection_ext.compute_fluxes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5anuga_9advection_13advection_ext_compute_fluxes(__pyx_self, __pyx_v_domain, __pyx_v_quantity, __pyx_v_huge_timestep, __pyx_v_max_timestep);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5anuga_9advection_13advection_ext_compute_fluxes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain, PyObject *__pyx_v_quantity, double __pyx_v_huge_timestep, double __pyx_v_max_timestep) {
      PyArrayObject *__pyx_v_quantity_edge = 0;
      PyArrayObject *__pyx_v_quantity_bdry = 0;
      PyArrayObject *__pyx_v_quantity_update = 0;
      PyArrayObject *__pyx_v_domain_neighbours = 0;
      PyArrayObject *__pyx_v_domain_neighbour_edges = 0;
      PyArrayObject *__pyx_v_domain_normals = 0;
      PyArrayObject *__pyx_v_domain_areas = 0;
      PyArrayObject *__pyx_v_domain_radii = 0;
      PyArrayObject *__pyx_v_domain_edgelengths = 0;
      PyArrayObject *__pyx_v_domain_tri_full_flag = 0;
      PyArrayObject *__pyx_v_domain_velocity = 0;
      int __pyx_v_ntri;
      int __pyx_v_nbdry;
      double __pyx_v_timestep;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_areas;
      __Pyx_Buffer __pyx_pybuffer_domain_areas;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_edgelengths;
      __Pyx_Buffer __pyx_pybuffer_domain_edgelengths;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_neighbour_edges;
      __Pyx_Buffer __pyx_pybuffer_domain_neighbour_edges;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_neighbours;
      __Pyx_Buffer __pyx_pybuffer_domain_neighbours;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_normals;
      __Pyx_Buffer __pyx_pybuffer_domain_normals;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_radii;
      __Pyx_Buffer __pyx_pybuffer_domain_radii;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_tri_full_flag;
      __Pyx_Buffer __pyx_pybuffer_domain_tri_full_flag;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_velocity;
      __Pyx_Buffer __pyx_pybuffer_domain_velocity;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_quantity_bdry;
      __Pyx_Buffer __pyx_pybuffer_quantity_bdry;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_quantity_edge;
      __Pyx_Buffer __pyx_pybuffer_quantity_edge;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_quantity_update;
      __Pyx_Buffer __pyx_pybuffer_quantity_update;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("compute_fluxes", 0);
      __pyx_pybuffer_quantity_edge.pybuffer.buf = NULL;
      __pyx_pybuffer_quantity_edge.refcount = 0;
      __pyx_pybuffernd_quantity_edge.data = NULL;
      __pyx_pybuffernd_quantity_edge.rcbuffer = &__pyx_pybuffer_quantity_edge;
      __pyx_pybuffer_quantity_bdry.pybuffer.buf = NULL;
      __pyx_pybuffer_quantity_bdry.refcount = 0;
      __pyx_pybuffernd_quantity_bdry.data = NULL;
      __pyx_pybuffernd_quantity_bdry.rcbuffer = &__pyx_pybuffer_quantity_bdry;
      __pyx_pybuffer_quantity_update.pybuffer.buf = NULL;
      __pyx_pybuffer_quantity_update.refcount = 0;
      __pyx_pybuffernd_quantity_update.data = NULL;
      __pyx_pybuffernd_quantity_update.rcbuffer = &__pyx_pybuffer_quantity_update;
      __pyx_pybuffer_domain_neighbours.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_neighbours.refcount = 0;
      __pyx_pybuffernd_domain_neighbours.data = NULL;
      __pyx_pybuffernd_domain_neighbours.rcbuffer = &__pyx_pybuffer_domain_neighbours;
      __pyx_pybuffer_domain_neighbour_edges.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_neighbour_edges.refcount = 0;
      __pyx_pybuffernd_domain_neighbour_edges.data = NULL;
      __pyx_pybuffernd_domain_neighbour_edges.rcbuffer = &__pyx_pybuffer_domain_neighbour_edges;
      __pyx_pybuffer_domain_normals.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_normals.refcount = 0;
      __pyx_pybuffernd_domain_normals.data = NULL;
      __pyx_pybuffernd_domain_normals.rcbuffer = &__pyx_pybuffer_domain_normals;
      __pyx_pybuffer_domain_areas.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_areas.refcount = 0;
      __pyx_pybuffernd_domain_areas.data = NULL;
      __pyx_pybuffernd_domain_areas.rcbuffer = &__pyx_pybuffer_domain_areas;
      __pyx_pybuffer_domain_radii.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_radii.refcount = 0;
      __pyx_pybuffernd_domain_radii.data = NULL;
      __pyx_pybuffernd_domain_radii.rcbuffer = &__pyx_pybuffer_domain_radii;
      __pyx_pybuffer_domain_edgelengths.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_edgelengths.refcount = 0;
      __pyx_pybuffernd_domain_edgelengths.data = NULL;
      __pyx_pybuffernd_domain_edgelengths.rcbuffer = &__pyx_pybuffer_domain_edgelengths;
      __pyx_pybuffer_domain_tri_full_flag.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_tri_full_flag.refcount = 0;
      __pyx_pybuffernd_domain_tri_full_flag.data = NULL;
      __pyx_pybuffernd_domain_tri_full_flag.rcbuffer = &__pyx_pybuffer_domain_tri_full_flag;
      __pyx_pybuffer_domain_velocity.pybuffer.buf = NULL;
      __pyx_pybuffer_domain_velocity.refcount = 0;
      __pyx_pybuffernd_domain_velocity.data = NULL;
      __pyx_pybuffernd_domain_velocity.rcbuffer = &__pyx_pybuffer_domain_velocity;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_areas.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_normals.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_radii.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_update.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("anuga.advection.advection_ext.compute_fluxes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_areas.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_normals.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_radii.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_update.rcbuffer->pybuffer);
      __pyx_L2:;
      __Pyx_XDECREF((PyObject *)__pyx_v_quantity_edge);
      __Pyx_XDECREF((PyObject *)__pyx_v_quantity_bdry);
      __Pyx_XDECREF((PyObject *)__pyx_v_quantity_update);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_neighbours);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_neighbour_edges);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_normals);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_areas);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_radii);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_edgelengths);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_tri_full_flag);
      __Pyx_XDECREF((PyObject *)__pyx_v_domain_velocity);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__3 = PyTuple_Pack(18, __pyx_n_s_domain, __pyx_n_s_quantity, __pyx_n_s_huge_timestep, __pyx_n_s_max_timestep, __pyx_n_s_quantity_edge, __pyx_n_s_quantity_bdry, __pyx_n_s_quantity_update, __pyx_n_s_domain_neighbours, __pyx_n_s_domain_neighbour_edges, __pyx_n_s_domain_normals, __pyx_n_s_domain_areas, __pyx_n_s_domain_radii, __pyx_n_s_domain_edgelengths, __pyx_n_s_domain_tri_full_flag, __pyx_n_s_domain_velocity, __pyx_n_s_ntri, __pyx_n_s_nbdry, __pyx_n_s_timestep); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__3);
      __Pyx_GIVEREF(__pyx_tuple__3);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5anuga_9advection_13advection_ext_1compute_fluxes, NULL, __pyx_n_s_anuga_advection_advection_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_fluxes, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     13:

     14: 	cdef np.ndarray[double, ndim=2, mode="c"] quantity_edge

     15: 	cdef np.ndarray[double, ndim=1, mode="c"] quantity_bdry

     16: 	cdef np.ndarray[double, ndim=1, mode="c"] quantity_update

     17: 	cdef np.ndarray[long, ndim=2, mode="c"] domain_neighbours

     18: 	cdef np.ndarray[long, ndim=2, mode="c"] domain_neighbour_edges

     19: 	cdef np.ndarray[double, ndim=2, mode="c"] domain_normals

     20: 	cdef np.ndarray[double, ndim=1, mode="c"] domain_areas

     21: 	cdef np.ndarray[double, ndim=1, mode="c"] domain_radii

     22: 	cdef np.ndarray[double, ndim=2, mode="c"] domain_edgelengths

     23: 	cdef np.ndarray[long, ndim=1, mode="c"] domain_tri_full_flag

     24: 	cdef np.ndarray[double, ndim=1, mode="c"] domain_velocity

     25:

     26: 	cdef int ntri, nbdry

     27: 	cdef double timestep

     28:

    +29: 	quantity_edge = quantity.edge_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_quantity, __pyx_n_s_edge_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 29, __pyx_L1_error)
      __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_quantity_edge, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          }
          __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
        }
        __pyx_pybuffernd_quantity_edge.diminfo[0].strides = __pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_quantity_edge.diminfo[0].shape = __pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_quantity_edge.diminfo[1].strides = __pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_quantity_edge.diminfo[1].shape = __pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 29, __pyx_L1_error)
      }
      __pyx_t_2 = 0;
      __pyx_v_quantity_edge = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +30: 	quantity_bdry = quantity.boundary_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_quantity, __pyx_n_s_boundary_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 30, __pyx_L1_error)
      __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer, (PyObject*)__pyx_v_quantity_bdry, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          }
          __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
        }
        __pyx_pybuffernd_quantity_bdry.diminfo[0].strides = __pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_quantity_bdry.diminfo[0].shape = __pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 30, __pyx_L1_error)
      }
      __pyx_t_7 = 0;
      __pyx_v_quantity_bdry = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +31: 	quantity_update = quantity.explicit_update

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_quantity, __pyx_n_s_explicit_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 31, __pyx_L1_error)
      __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_quantity_update.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quantity_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_quantity_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_quantity_update, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          }
          __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
        }
        __pyx_pybuffernd_quantity_update.diminfo[0].strides = __pyx_pybuffernd_quantity_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_quantity_update.diminfo[0].shape = __pyx_pybuffernd_quantity_update.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 31, __pyx_L1_error)
      }
      __pyx_t_8 = 0;
      __pyx_v_quantity_update = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +32: 	domain_neighbours = domain.neighbours

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_neighbours); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 32, __pyx_L1_error)
      __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_neighbours, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          }
          __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
        }
        __pyx_pybuffernd_domain_neighbours.diminfo[0].strides = __pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_neighbours.diminfo[0].shape = __pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_domain_neighbours.diminfo[1].strides = __pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_domain_neighbours.diminfo[1].shape = __pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 32, __pyx_L1_error)
      }
      __pyx_t_9 = 0;
      __pyx_v_domain_neighbours = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +33: 	domain_neighbour_edges = domain.neighbour_edges

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_neighbour_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 33, __pyx_L1_error)
      __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_neighbour_edges, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          }
          __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
        }
        __pyx_pybuffernd_domain_neighbour_edges.diminfo[0].strides = __pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_neighbour_edges.diminfo[0].shape = __pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_domain_neighbour_edges.diminfo[1].strides = __pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_domain_neighbour_edges.diminfo[1].shape = __pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 33, __pyx_L1_error)
      }
      __pyx_t_10 = 0;
      __pyx_v_domain_neighbour_edges = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +34: 	domain_normals = domain.normals

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_normals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 34, __pyx_L1_error)
      __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_normals.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_normals.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_normals.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_normals, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          }
          __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
        }
        __pyx_pybuffernd_domain_normals.diminfo[0].strides = __pyx_pybuffernd_domain_normals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_normals.diminfo[0].shape = __pyx_pybuffernd_domain_normals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_domain_normals.diminfo[1].strides = __pyx_pybuffernd_domain_normals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_domain_normals.diminfo[1].shape = __pyx_pybuffernd_domain_normals.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 34, __pyx_L1_error)
      }
      __pyx_t_11 = 0;
      __pyx_v_domain_normals = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +35: 	domain_areas = domain.areas

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_areas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 35, __pyx_L1_error)
      __pyx_t_12 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_areas.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_areas.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_areas.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_areas, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          }
          __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
        }
        __pyx_pybuffernd_domain_areas.diminfo[0].strides = __pyx_pybuffernd_domain_areas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_areas.diminfo[0].shape = __pyx_pybuffernd_domain_areas.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 35, __pyx_L1_error)
      }
      __pyx_t_12 = 0;
      __pyx_v_domain_areas = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +36: 	domain_radii = domain.radii

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_radii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 36, __pyx_L1_error)
      __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_radii.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_radii.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_radii.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_radii, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          }
          __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
        }
        __pyx_pybuffernd_domain_radii.diminfo[0].strides = __pyx_pybuffernd_domain_radii.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_radii.diminfo[0].shape = __pyx_pybuffernd_domain_radii.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 36, __pyx_L1_error)
      }
      __pyx_t_13 = 0;
      __pyx_v_domain_radii = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +37: 	domain_edgelengths = domain.edgelengths

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_edgelengths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 37, __pyx_L1_error)
      __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_edgelengths, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          }
          __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
        }
        __pyx_pybuffernd_domain_edgelengths.diminfo[0].strides = __pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_edgelengths.diminfo[0].shape = __pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_domain_edgelengths.diminfo[1].strides = __pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_domain_edgelengths.diminfo[1].shape = __pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 37, __pyx_L1_error)
      }
      __pyx_t_14 = 0;
      __pyx_v_domain_edgelengths = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +38: 	domain_tri_full_flag = domain.tri_full_flag

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_tri_full_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 38, __pyx_L1_error)
      __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_tri_full_flag, &__Pyx_TypeInfo_long, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          }
          __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
        }
        __pyx_pybuffernd_domain_tri_full_flag.diminfo[0].strides = __pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_tri_full_flag.diminfo[0].shape = __pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 38, __pyx_L1_error)
      }
      __pyx_t_15 = 0;
      __pyx_v_domain_tri_full_flag = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

    +39: 	domain_velocity = domain.velocity

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_velocity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 39, __pyx_L1_error)
      __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_velocity, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          }
          __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
        }
        __pyx_pybuffernd_domain_velocity.diminfo[0].strides = __pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_velocity.diminfo[0].shape = __pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 39, __pyx_L1_error)
      }
      __pyx_t_16 = 0;
      __pyx_v_domain_velocity = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

     40:

    +41: 	ntri = quantity_edge.shape[0]

      __pyx_v_ntri = (__pyx_v_quantity_edge->dimensions[0]);

    +42: 	nbdry = quantity_bdry.shape[0]

      __pyx_v_nbdry = (__pyx_v_quantity_bdry->dimensions[0]);

     43:

    +44: 	timestep = _compute_fluxes(&quantity_update[0],\

      __pyx_t_17 = 0;
    /* … */
      __pyx_v_timestep = _compute_fluxes((&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_quantity_update.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_quantity_update.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_quantity_edge.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_quantity_edge.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_quantity_edge.diminfo[1].strides))), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_quantity_bdry.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_quantity_bdry.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(long *, __pyx_pybuffernd_domain_neighbours.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_domain_neighbours.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_domain_neighbours.diminfo[1].strides))), (&(*__Pyx_BufPtrCContig2d(long *, __pyx_pybuffernd_domain_neighbour_edges.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_domain_neighbour_edges.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_domain_neighbour_edges.diminfo[1].strides))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_domain_normals.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_domain_normals.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_domain_normals.diminfo[1].strides))), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_domain_areas.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_domain_areas.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_domain_radii.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_domain_radii.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(double *, __pyx_pybuffernd_domain_edgelengths.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_domain_edgelengths.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_domain_edgelengths.diminfo[1].strides))), (&(*__Pyx_BufPtrCContig1d(long *, __pyx_pybuffernd_domain_tri_full_flag.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_domain_tri_full_flag.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig1d(double *, __pyx_pybuffernd_domain_velocity.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_domain_velocity.diminfo[0].strides))), __pyx_v_huge_timestep, __pyx_v_max_timestep, __pyx_v_ntri, __pyx_v_nbdry);

    +45: 							&quantity_edge[0,0],\

      __pyx_t_18 = 0;
      __pyx_t_19 = 0;

    +46: 							&quantity_bdry[0],\

      __pyx_t_20 = 0;

    +47: 							&domain_neighbours[0,0],\

      __pyx_t_21 = 0;
      __pyx_t_22 = 0;

    +48: 							&domain_neighbour_edges[0,0],\

      __pyx_t_23 = 0;
      __pyx_t_24 = 0;

    +49: 							&domain_normals[0,0],\

      __pyx_t_25 = 0;
      __pyx_t_26 = 0;

    +50: 							&domain_areas[0],\

      __pyx_t_27 = 0;

    +51: 							&domain_radii[0],\

      __pyx_t_28 = 0;

    +52: 							&domain_edgelengths[0,0],\

      __pyx_t_29 = 0;
      __pyx_t_30 = 0;

    +53: 							&domain_tri_full_flag[0],\

      __pyx_t_31 = 0;

    +54: 							&domain_velocity[0],\

      __pyx_t_32 = 0;

     55: 							huge_timestep,\

     56: 							max_timestep,\

     57: 							ntri,\

     58: 							nbdry)

     59:

    +60: 	return timestep

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_timestep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     61: