3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
306 #ifndef CYTHON_INLINE
307 #if defined(__clang__)
308 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309 #elif defined(__GNUC__)
310 #define CYTHON_INLINE __inline__
311 #elif defined(_MSC_VER)
312 #define CYTHON_INLINE __inline
313 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314 #define CYTHON_INLINE inline
316 #define CYTHON_INLINE
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321 #define Py_OptimizeFlag 0
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329 #define __Pyx_DefaultClassType PyClass_Type
331 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
335 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
336 PyObject *fv, PyObject *cell, PyObject* fn,
337 PyObject *name,
int fline, PyObject *lnos) {
338 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340 const char *fn_cstr=NULL;
341 const char *name_cstr=NULL;
342 PyCodeObject* co=NULL;
343 PyObject *type, *value, *traceback;
344 PyErr_Fetch(&type, &value, &traceback);
345 if (!(kwds=PyDict_New()))
goto end;
346 if (!(argcount=PyLong_FromLong(a)))
goto end;
347 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
348 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
349 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
350 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
351 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
352 if (!(nlocals=PyLong_FromLong(l)))
goto end;
353 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
354 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
355 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
356 if (!(flags=PyLong_FromLong(
f)))
goto end;
357 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
358 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
359 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
360 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
361 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
362 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
363 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
364 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
365 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
366 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
367 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
368 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
369 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
370 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
371 Py_XDECREF((PyObject*)co);
372 co = (PyCodeObject*)call_result;
376 Py_XDECREF((PyObject*)co);
381 Py_XDECREF(argcount);
382 Py_XDECREF(posonlyargcount);
383 Py_XDECREF(kwonlyargcount);
385 Py_XDECREF(stacksize);
387 Py_XDECREF(call_result);
390 PyErr_Restore(type, value, traceback);
395 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
398 #define __Pyx_DefaultClassType PyType_Type
400 #ifndef Py_TPFLAGS_CHECKTYPES
401 #define Py_TPFLAGS_CHECKTYPES 0
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404 #define Py_TPFLAGS_HAVE_INDEX 0
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410 #define Py_TPFLAGS_HAVE_FINALIZE 0
412 #ifndef METH_STACKLESS
413 #define METH_STACKLESS 0
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416 #ifndef METH_FASTCALL
417 #define METH_FASTCALL 0x80
419 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
420 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
421 Py_ssize_t nargs, PyObject *kwnames);
423 #define __Pyx_PyCFunctionFast _PyCFunctionFast
424 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
430 #define __Pyx_PyFastCFunction_Check(func) 0
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433 #define PyObject_Malloc(s) PyMem_Malloc(s)
434 #define PyObject_Free(p) PyMem_Free(p)
435 #define PyObject_Realloc(p) PyMem_Realloc(p)
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440 #define PyMem_RawFree(p) PyMem_Free(p)
442 #if CYTHON_COMPILING_IN_PYSTON
443 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
446 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450 #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454 #define __Pyx_PyThreadState_Current PyThreadState_GET()
456 #define __Pyx_PyThreadState_Current _PyThreadState_Current
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
463 *key = PyThread_create_key();
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
467 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
468 *key = Py_tss_NEEDS_INIT;
471 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
474 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
475 return *key != Py_tss_NEEDS_INIT;
477 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
478 PyThread_delete_key(*key);
479 *key = Py_tss_NEEDS_INIT;
481 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
482 return PyThread_set_key_value(*key, value);
484 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
485 return PyThread_get_key_value(*key);
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
497 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506 #define CYTHON_PEP393_ENABLED 1
507 #if defined(PyUnicode_IS_READY)
508 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509 0 : _PyUnicode_Ready((PyObject *)(op)))
511 #define __Pyx_PyUnicode_READY(op) (0)
513 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
527 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
530 #define CYTHON_PEP393_ENABLED 0
531 #define PyUnicode_1BYTE_KIND 1
532 #define PyUnicode_2BYTE_KIND 2
533 #define PyUnicode_4BYTE_KIND 4
534 #define __Pyx_PyUnicode_READY(op) (0)
535 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
544 #if CYTHON_COMPILING_IN_PYPY
545 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
548 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
561 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
566 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569 #define PyObject_ASCII(o) PyObject_Repr(o)
571 #if PY_MAJOR_VERSION >= 3
572 #define PyBaseString_Type PyUnicode_Type
573 #define PyStringObject PyUnicodeObject
574 #define PyString_Type PyUnicode_Type
575 #define PyString_Check PyUnicode_Check
576 #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578 #define PyObject_Unicode PyObject_Str
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
585 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
588 #ifndef PySet_CheckExact
589 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
591 #if PY_VERSION_HEX >= 0x030900A4
592 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
595 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
598 #if CYTHON_ASSUME_SAFE_MACROS
599 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
601 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
603 #if PY_MAJOR_VERSION >= 3
604 #define PyIntObject PyLongObject
605 #define PyInt_Type PyLong_Type
606 #define PyInt_Check(op) PyLong_Check(op)
607 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608 #define PyInt_FromString PyLong_FromString
609 #define PyInt_FromUnicode PyLong_FromUnicode
610 #define PyInt_FromLong PyLong_FromLong
611 #define PyInt_FromSize_t PyLong_FromSize_t
612 #define PyInt_FromSsize_t PyLong_FromSsize_t
613 #define PyInt_AsLong PyLong_AsLong
614 #define PyInt_AS_LONG PyLong_AS_LONG
615 #define PyInt_AsSsize_t PyLong_AsSsize_t
616 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618 #define PyNumber_Int PyNumber_Long
620 #if PY_MAJOR_VERSION >= 3
621 #define PyBoolObject PyLongObject
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624 #ifndef PyUnicode_InternFromString
625 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
628 #if PY_VERSION_HEX < 0x030200A4
629 typedef long Py_hash_t;
630 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
633 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
636 #if PY_MAJOR_VERSION >= 3
637 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
639 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
641 #if CYTHON_USE_ASYNC_SLOTS
642 #if PY_VERSION_HEX >= 0x030500B1
643 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
646 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
649 #define __Pyx_PyType_AsAsync(obj) NULL
651 #ifndef __Pyx_PyAsyncMethodsStruct
656 } __Pyx_PyAsyncMethodsStruct;
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660 #if !defined(_USE_MATH_DEFINES)
661 #define _USE_MATH_DEFINES
666 #define __PYX_NAN() ((float) NAN)
668 static CYTHON_INLINE
float __PYX_NAN() {
670 memset(&value, 0xFF,
sizeof(value));
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
677 #define __Pyx_truncl truncl
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
685 #ifndef __PYX_EXTERN_C
687 #define __PYX_EXTERN_C extern "C"
689 #define __PYX_EXTERN_C extern
693 #define __PYX_HAVE__subsurfaceTransportFunctions
694 #define __PYX_HAVE_API__subsurfaceTransportFunctions
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
711 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
712 #define CYTHON_WITHOUT_ASSERTIONS
715 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
716 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
718 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
719 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
720 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
721 #define __PYX_DEFAULT_STRING_ENCODING ""
722 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
723 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
724 #define __Pyx_uchar_cast(c) ((unsigned char)c)
725 #define __Pyx_long_cast(x) ((long)x)
726 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
727 (sizeof(type) < sizeof(Py_ssize_t)) ||\
728 (sizeof(type) > sizeof(Py_ssize_t) &&\
729 likely(v < (type)PY_SSIZE_T_MAX ||\
730 v == (type)PY_SSIZE_T_MAX) &&\
731 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
732 v == (type)PY_SSIZE_T_MIN))) ||\
733 (sizeof(type) == sizeof(Py_ssize_t) &&\
734 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
735 v == (type)PY_SSIZE_T_MAX))) )
736 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
737 return (
size_t) i < (size_t) limit;
739 #if defined (__cplusplus) && __cplusplus >= 201103L
741 #define __Pyx_sst_abs(value) std::abs(value)
742 #elif SIZEOF_INT >= SIZEOF_SIZE_T
743 #define __Pyx_sst_abs(value) abs(value)
744 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
745 #define __Pyx_sst_abs(value) labs(value)
746 #elif defined (_MSC_VER)
747 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
748 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
749 #define __Pyx_sst_abs(value) llabs(value)
750 #elif defined (__GNUC__)
751 #define __Pyx_sst_abs(value) __builtin_llabs(value)
753 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
755 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
756 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
757 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
758 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
759 #define __Pyx_PyBytes_FromString PyBytes_FromString
760 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
761 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
762 #if PY_MAJOR_VERSION < 3
763 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
764 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
766 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
767 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
769 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
770 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
771 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
772 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
773 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
776 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
777 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
778 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
779 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
781 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
782 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
783 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
784 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
785 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
786 const Py_UNICODE *u_end =
u;
788 return (
size_t)(u_end -
u - 1);
790 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
791 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
792 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
793 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
794 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
795 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
796 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
797 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
798 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
799 #define __Pyx_PySequence_Tuple(obj)\
800 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
801 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
802 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
803 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
804 #if CYTHON_ASSUME_SAFE_MACROS
805 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
807 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
809 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
810 #if PY_MAJOR_VERSION >= 3
811 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
813 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
815 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
816 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
817 static int __Pyx_sys_getdefaultencoding_not_ascii;
818 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
820 PyObject* default_encoding = NULL;
821 PyObject* ascii_chars_u = NULL;
822 PyObject* ascii_chars_b = NULL;
823 const char* default_encoding_c;
824 sys = PyImport_ImportModule(
"sys");
826 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
828 if (!default_encoding)
goto bad;
829 default_encoding_c = PyBytes_AsString(default_encoding);
830 if (!default_encoding_c)
goto bad;
831 if (strcmp(default_encoding_c,
"ascii") == 0) {
832 __Pyx_sys_getdefaultencoding_not_ascii = 0;
834 char ascii_chars[128];
836 for (
c = 0;
c < 128;
c++) {
839 __Pyx_sys_getdefaultencoding_not_ascii = 1;
840 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
841 if (!ascii_chars_u)
goto bad;
842 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
843 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
846 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
850 Py_DECREF(ascii_chars_u);
851 Py_DECREF(ascii_chars_b);
853 Py_DECREF(default_encoding);
856 Py_XDECREF(default_encoding);
857 Py_XDECREF(ascii_chars_u);
858 Py_XDECREF(ascii_chars_b);
862 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
863 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
865 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
867 static char* __PYX_DEFAULT_STRING_ENCODING;
868 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
870 PyObject* default_encoding = NULL;
871 char* default_encoding_c;
872 sys = PyImport_ImportModule(
"sys");
874 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
876 if (!default_encoding)
goto bad;
877 default_encoding_c = PyBytes_AsString(default_encoding);
878 if (!default_encoding_c)
goto bad;
879 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
880 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
881 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
882 Py_DECREF(default_encoding);
885 Py_XDECREF(default_encoding);
893 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
894 #define likely(x) __builtin_expect(!!(x), 1)
895 #define unlikely(x) __builtin_expect(!!(x), 0)
897 #define likely(x) (x)
898 #define unlikely(x) (x)
900 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
902 static PyObject *__pyx_m = NULL;
903 static PyObject *__pyx_d;
904 static PyObject *__pyx_b;
905 static PyObject *__pyx_cython_runtime = NULL;
906 static PyObject *__pyx_empty_tuple;
907 static PyObject *__pyx_empty_bytes;
908 static PyObject *__pyx_empty_unicode;
909 static int __pyx_lineno;
910 static int __pyx_clineno = 0;
911 static const char * __pyx_cfilenm= __FILE__;
912 static const char *__pyx_filename;
915 #if !defined(CYTHON_CCOMPLEX)
916 #if defined(__cplusplus)
917 #define CYTHON_CCOMPLEX 1
918 #elif defined(_Complex_I)
919 #define CYTHON_CCOMPLEX 1
921 #define CYTHON_CCOMPLEX 0
931 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
933 #define _Complex_I 1.0fj
937 static const char *__pyx_f[] = {
938 "proteus/subsurfaceTransportFunctions.pyx",
943 #define IS_UNSIGNED(type) (((type) -1) > 0)
944 struct __Pyx_StructField_;
945 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
948 struct __Pyx_StructField_* fields;
956 typedef struct __Pyx_StructField_ {
957 __Pyx_TypeInfo* type;
962 __Pyx_StructField* field;
963 size_t parent_offset;
964 } __Pyx_BufFmt_StackElem;
966 __Pyx_StructField root;
967 __Pyx_BufFmt_StackElem* head;
969 size_t new_count, enc_count;
970 size_t struct_alignment;
976 } __Pyx_BufFmt_Context;
986 typedef npy_int8 __pyx_t_5numpy_int8_t;
995 typedef npy_int16 __pyx_t_5numpy_int16_t;
1004 typedef npy_int32 __pyx_t_5numpy_int32_t;
1013 typedef npy_int64 __pyx_t_5numpy_int64_t;
1022 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1031 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1040 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1049 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1058 typedef npy_float32 __pyx_t_5numpy_float32_t;
1067 typedef npy_float64 __pyx_t_5numpy_float64_t;
1076 typedef npy_long __pyx_t_5numpy_int_t;
1085 typedef npy_longlong __pyx_t_5numpy_long_t;
1094 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1103 typedef npy_ulong __pyx_t_5numpy_uint_t;
1112 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1121 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1130 typedef npy_intp __pyx_t_5numpy_intp_t;
1139 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1148 typedef npy_double __pyx_t_5numpy_float_t;
1157 typedef npy_double __pyx_t_5numpy_double_t;
1166 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1175 typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
1184 typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
1188 typedef ::std::complex< float > __pyx_t_float_complex;
1190 typedef float _Complex __pyx_t_float_complex;
1193 typedef struct {
float real, imag; } __pyx_t_float_complex;
1195 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1200 typedef ::std::complex< double > __pyx_t_double_complex;
1202 typedef double _Complex __pyx_t_double_complex;
1205 typedef struct {
double real, imag; } __pyx_t_double_complex;
1207 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1219 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1228 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1237 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1246 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1250 #ifndef CYTHON_REFNANNY
1251 #define CYTHON_REFNANNY 0
1255 void (*INCREF)(
void*, PyObject*, int);
1256 void (*DECREF)(
void*, PyObject*, int);
1257 void (*GOTREF)(
void*, PyObject*, int);
1258 void (*GIVEREF)(
void*, PyObject*, int);
1259 void* (*SetupContext)(
const char*, int,
const char*);
1260 void (*FinishContext)(
void**);
1261 } __Pyx_RefNannyAPIStruct;
1262 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1263 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1264 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1266 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1268 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1269 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1270 PyGILState_Release(__pyx_gilstate_save);\
1272 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1275 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1276 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1278 #define __Pyx_RefNannyFinishContext()\
1279 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1280 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1281 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1282 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1283 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1284 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1285 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1286 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1287 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1289 #define __Pyx_RefNannyDeclarations
1290 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1291 #define __Pyx_RefNannyFinishContext()
1292 #define __Pyx_INCREF(r) Py_INCREF(r)
1293 #define __Pyx_DECREF(r) Py_DECREF(r)
1294 #define __Pyx_GOTREF(r)
1295 #define __Pyx_GIVEREF(r)
1296 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1297 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1298 #define __Pyx_XGOTREF(r)
1299 #define __Pyx_XGIVEREF(r)
1301 #define __Pyx_XDECREF_SET(r, v) do {\
1302 PyObject *tmp = (PyObject *) r;\
1303 r = v; __Pyx_XDECREF(tmp);\
1305 #define __Pyx_DECREF_SET(r, v) do {\
1306 PyObject *tmp = (PyObject *) r;\
1307 r = v; __Pyx_DECREF(tmp);\
1309 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1310 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1313 #if CYTHON_USE_TYPE_SLOTS
1314 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1316 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1320 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1323 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1324 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1327 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1330 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1331 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1332 const char* function_name);
1335 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1336 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1337 __Pyx__ArgTypeTest(obj, type, name, exact))
1338 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1341 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1344 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1345 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1346 __Pyx_BufFmt_StackElem* stack,
1347 __Pyx_TypeInfo* type);
1350 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1351 ((obj == Py_None || obj == NULL) ?\
1352 (__Pyx_ZeroBuffer(buf), 0) :\
1353 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1354 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1355 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1356 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1357 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1358 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1359 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1362 static void __Pyx_RaiseBufferIndexError(
int axis);
1364 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1365 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
1367 #if CYTHON_FAST_THREAD_STATE
1368 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1369 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1370 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1372 #define __Pyx_PyThreadState_declare
1373 #define __Pyx_PyThreadState_assign
1374 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1378 #if CYTHON_FAST_THREAD_STATE
1379 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1380 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1381 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1382 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1383 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1384 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1385 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1386 #if CYTHON_COMPILING_IN_CPYTHON
1387 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1389 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1392 #define __Pyx_PyErr_Clear() PyErr_Clear()
1393 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1394 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1395 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1396 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1397 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1398 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1399 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1403 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1404 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1405 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1406 (likely(PyDict_CheckExact(obj)) ?\
1407 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1409 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1410 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1413 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
1415 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1416 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1417 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1418 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1419 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1420 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1421 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1422 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1423 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1424 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1425 int wraparound,
int boundscheck);
1426 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1427 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1428 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1429 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1430 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1431 int wraparound,
int boundscheck);
1432 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1433 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1434 int is_list,
int wraparound,
int boundscheck);
1437 #if CYTHON_USE_TYPE_SLOTS
1438 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1440 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1444 #if !CYTHON_COMPILING_IN_PYPY
1445 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1447 #define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\
1448 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1451 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
1453 #if CYTHON_FAST_PYCALL
1454 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1455 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1456 #if 1 || PY_VERSION_HEX < 0x030600B1
1457 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1459 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1461 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1462 (sizeof(char [1 - 2*!(cond)]) - 1)
1463 #ifndef Py_MEMBER_SIZE
1464 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1466 #if CYTHON_FAST_PYCALL
1467 static size_t __pyx_pyframe_localsplus_offset = 0;
1468 #include "frameobject.h"
1469 #if PY_VERSION_HEX >= 0x030b00a6
1470 #ifndef Py_BUILD_CORE
1471 #define Py_BUILD_CORE 1
1473 #include "internal/pycore_frame.h"
1475 #define __Pxy_PyFrame_Initialize_Offsets()\
1476 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1477 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1478 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1479 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1480 #endif // CYTHON_FAST_PYCALL
1484 #if CYTHON_FAST_PYCCALL
1485 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1487 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1491 #if CYTHON_COMPILING_IN_CPYTHON
1492 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1494 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1498 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1499 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1500 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1501 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1502 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1503 (cache_var) = (value);
1504 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1505 static PY_UINT64_T __pyx_dict_version = 0;\
1506 static PyObject *__pyx_dict_cached_value = NULL;\
1507 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1508 (VAR) = __pyx_dict_cached_value;\
1510 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1511 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1514 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1515 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1516 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1518 #define __PYX_GET_DICT_VERSION(dict) (0)
1519 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1520 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1524 #if CYTHON_USE_DICT_VERSIONS
1525 #define __Pyx_GetModuleGlobalName(var, name) {\
1526 static PY_UINT64_T __pyx_dict_version = 0;\
1527 static PyObject *__pyx_dict_cached_value = NULL;\
1528 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1529 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1530 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1532 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1533 PY_UINT64_T __pyx_dict_version;\
1534 PyObject *__pyx_dict_cached_value;\
1535 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1537 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1539 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1540 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1541 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1545 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1548 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1551 #if CYTHON_COMPILING_IN_CPYTHON
1552 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1556 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1559 static double __Pyx__PyObject_AsDouble(PyObject* obj);
1560 #if CYTHON_COMPILING_IN_PYPY
1561 #define __Pyx_PyObject_AsDouble(obj)\
1562 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
1563 likely(PyInt_CheckExact(obj)) ?\
1564 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
1566 #define __Pyx_PyObject_AsDouble(obj)\
1567 ((likely(PyFloat_CheckExact(obj))) ?\
1568 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
1572 #if CYTHON_USE_EXC_INFO_STACK
1573 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1577 #if CYTHON_FAST_THREAD_STATE
1578 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1579 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1580 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1581 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1583 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1584 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1588 #if CYTHON_FAST_THREAD_STATE
1589 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1590 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1592 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1596 #if CYTHON_FAST_THREAD_STATE
1597 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1598 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1600 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1604 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1607 #ifndef __PYX_HAVE_RT_ImportType_proto
1608 #define __PYX_HAVE_RT_ImportType_proto
1609 enum __Pyx_ImportType_CheckSize {
1610 __Pyx_ImportType_CheckSize_Error = 0,
1611 __Pyx_ImportType_CheckSize_Warn = 1,
1612 __Pyx_ImportType_CheckSize_Ignore = 2
1614 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1618 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1621 #ifdef CYTHON_CLINE_IN_TRACEBACK
1622 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1624 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1629 PyCodeObject* code_object;
1631 } __Pyx_CodeObjectCacheEntry;
1632 struct __Pyx_CodeObjectCache {
1635 __Pyx_CodeObjectCacheEntry* entries;
1637 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1638 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1639 static PyCodeObject *__pyx_find_code_object(
int code_line);
1640 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1643 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1644 int py_line,
const char *filename);
1648 Py_ssize_t shape, strides, suboffsets;
1649 } __Pyx_Buf_DimInfo;
1655 __Pyx_Buffer *rcbuffer;
1657 __Pyx_Buf_DimInfo diminfo[8];
1658 } __Pyx_LocalBuf_ND;
1660 #if PY_MAJOR_VERSION < 3
1661 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1662 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1664 #define __Pyx_GetBuffer PyObject_GetBuffer
1665 #define __Pyx_ReleaseBuffer PyBuffer_Release
1670 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1671 #define __Pyx_HAS_GCC_DIAGNOSTIC
1677 #define __Pyx_CREAL(z) ((z).real())
1678 #define __Pyx_CIMAG(z) ((z).imag())
1680 #define __Pyx_CREAL(z) (__real__(z))
1681 #define __Pyx_CIMAG(z) (__imag__(z))
1684 #define __Pyx_CREAL(z) ((z).real)
1685 #define __Pyx_CIMAG(z) ((z).imag)
1687 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1688 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1689 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1690 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1692 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1693 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1698 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1699 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1700 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1701 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1702 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1703 #define __Pyx_c_neg_float(a) (-(a))
1705 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1706 #define __Pyx_c_conj_float(z) (::std::conj(z))
1708 #define __Pyx_c_abs_float(z) (::std::abs(z))
1709 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1712 #define __Pyx_c_is_zero_float(z) ((z)==0)
1713 #define __Pyx_c_conj_float(z) (conjf(z))
1715 #define __Pyx_c_abs_float(z) (cabsf(z))
1716 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1720 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1721 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1722 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1723 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1724 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1725 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1726 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1727 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1729 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1730 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1736 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1737 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1738 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1739 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1740 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1741 #define __Pyx_c_neg_double(a) (-(a))
1743 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1744 #define __Pyx_c_conj_double(z) (::std::conj(z))
1746 #define __Pyx_c_abs_double(z) (::std::abs(z))
1747 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1750 #define __Pyx_c_is_zero_double(z) ((z)==0)
1751 #define __Pyx_c_conj_double(z) (conj(z))
1753 #define __Pyx_c_abs_double(z) (cabs(z))
1754 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1758 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1759 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1760 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1761 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1762 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1763 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1764 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1765 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1767 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1768 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1773 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1776 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1779 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1782 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1785 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1788 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1791 #if CYTHON_COMPILING_IN_CPYTHON
1792 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1793 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1794 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1795 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1797 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1798 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1799 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1801 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1804 static int __Pyx_check_binary_version(
void);
1807 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1819 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1832 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1833 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1834 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1835 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1836 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1837 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1838 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1839 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1840 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1841 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1842 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1843 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1844 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1845 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1846 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1849 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = {
"ITYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
1850 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = {
"DTYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0,
'R', 0, 0 };
1851 #define __Pyx_MODULE_NAME "subsurfaceTransportFunctions"
1852 extern int __pyx_module_is_main_subsurfaceTransportFunctions;
1853 int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
1856 static PyObject *__pyx_builtin_range;
1857 static PyObject *__pyx_builtin_ImportError;
1858 static const char __pyx_k_I[] =
"I";
1859 static const char __pyx_k_J[] =
"J";
1860 static const char __pyx_k_d[] =
"d";
1861 static const char __pyx_k_i[] =
"i";
1862 static const char __pyx_k_j[] =
"j";
1863 static const char __pyx_k_k[] =
"k";
1864 static const char __pyx_k_m[] =
"m";
1865 static const char __pyx_k_n[] =
"n";
1866 static const char __pyx_k_q[] =
"q";
1867 static const char __pyx_k_t[] =
"t";
1868 static const char __pyx_k_v[] =
"v";
1869 static const char __pyx_k_w[] =
"w";
1870 static const char __pyx_k_x[] =
"x";
1871 static const char __pyx_k_dS[] =
"dS";
1872 static const char __pyx_k_dV[] =
"dV";
1873 static const char __pyx_k_df[] =
"df";
1874 static const char __pyx_k_dm[] =
"dm";
1875 static const char __pyx_k_eN[] =
"eN";
1876 static const char __pyx_k_ii[] =
"ii";
1877 static const char __pyx_k_kb[] =
"kb";
1878 static const char __pyx_k_mt[] =
"mt";
1879 static const char __pyx_k_nd[] =
"nd";
1880 static const char __pyx_k_pi[] =
"pi";
1881 static const char __pyx_k_xc[] =
"xc";
1882 static const char __pyx_k_yc[] =
"yc";
1883 static const char __pyx_k_KWr[] =
"KWr";
1884 static const char __pyx_k_KWs[] =
"KWs";
1885 static const char __pyx_k_dmt[] =
"dmt";
1886 static const char __pyx_k_dot[] =
"dot";
1887 static const char __pyx_k_ebN[] =
"ebN";
1888 static const char __pyx_k_l2g[] =
"l2g";
1889 static const char __pyx_k_nnz[] =
"nnz";
1890 static const char __pyx_k_q_m[] =
"q_m";
1891 static const char __pyx_k_q_r[] =
"q_r";
1892 static const char __pyx_k_q_u[] =
"q_u";
1893 static const char __pyx_k_q_x[] =
"q_x";
1894 static const char __pyx_k_rho[] =
"rho";
1895 static const char __pyx_k_sum[] =
"sum";
1896 static const char __pyx_k_u_j[] =
"u_j";
1897 static const char __pyx_k_vol[] =
"vol";
1898 static const char __pyx_k_a_eN[] =
"a_eN";
1899 static const char __pyx_k_a_up[] =
"a_up";
1900 static const char __pyx_k_beta[] =
"beta";
1901 static const char __pyx_k_ebNE[] =
"ebNE";
1902 static const char __pyx_k_f_up[] =
"f_up";
1903 static const char __pyx_k_flat[] =
"flat";
1904 static const char __pyx_k_flux[] =
"flux";
1905 static const char __pyx_k_main[] =
"__main__";
1906 static const char __pyx_k_name[] =
"__name__";
1907 static const char __pyx_k_one8[] =
"one8";
1908 static const char __pyx_k_psiC[] =
"psiC";
1909 static const char __pyx_k_q_dm[] =
"q_dm";
1910 static const char __pyx_k_q_kr[] =
"q_kr";
1911 static const char __pyx_k_q_mt[] =
"q_mt";
1912 static const char __pyx_k_rho2[] =
"rho2";
1913 static const char __pyx_k_rhom[] =
"rhom";
1914 static const char __pyx_k_sBar[] =
"sBar";
1915 static const char __pyx_k_test[] =
"__test__";
1916 static const char __pyx_k_u_eN[] =
"u_eN";
1917 static const char __pyx_k_vBar[] =
"vBar";
1918 static const char __pyx_k_a_avg[] =
"a_avg";
1919 static const char __pyx_k_alpha[] =
"alpha";
1920 static const char __pyx_k_clock[] =
"clock";
1921 static const char __pyx_k_denom[] =
"denom";
1922 static const char __pyx_k_drhom[] =
"drhom";
1923 static const char __pyx_k_kr_eN[] =
"kr_eN";
1924 static const char __pyx_k_matID[] =
"matID";
1925 static const char __pyx_k_numer[] =
"numer";
1926 static const char __pyx_k_numpy[] =
"numpy";
1927 static const char __pyx_k_pcBar[] =
"pcBar";
1928 static const char __pyx_k_q_dkr[] =
"q_dkr";
1929 static const char __pyx_k_q_dmt[] =
"q_dmt";
1930 static const char __pyx_k_range[] =
"range";
1931 static const char __pyx_k_shape[] =
"shape";
1932 static const char __pyx_k_u_dof[] =
"u_dof";
1933 static const char __pyx_k_u_l2g[] =
"u_l2g";
1934 static const char __pyx_k_vBar2[] =
"vBar2";
1935 static const char __pyx_k_vol_e[] =
"vol_e";
1936 static const char __pyx_k_zeros[] =
"zeros";
1937 static const char __pyx_k_a_neig[] =
"a_neig";
1938 static const char __pyx_k_colind[] =
"colind";
1939 static const char __pyx_k_dkr_up[] =
"dkr_up";
1940 static const char __pyx_k_import[] =
"__import__";
1941 static const char __pyx_k_mt_avg[] =
"mt_avg";
1942 static const char __pyx_k_nSpace[] =
"nSpace";
1943 static const char __pyx_k_phi_eN[] =
"phi_eN";
1944 static const char __pyx_k_picard[] =
"picard";
1945 static const char __pyx_k_q_alin[] =
"q_alin";
1946 static const char __pyx_k_q_detJ[] =
"q_detJ";
1947 static const char __pyx_k_q_flin[] =
"q_flin";
1948 static const char __pyx_k_q_mass[] =
"q_mass";
1949 static const char __pyx_k_q_vals[] =
"q_vals";
1950 static const char __pyx_k_rowptr[] =
"rowptr";
1951 static const char __pyx_k_thetaR[] =
"thetaR";
1952 static const char __pyx_k_thetaS[] =
"thetaS";
1953 static const char __pyx_k_thetaW[] =
"thetaW";
1954 static const char __pyx_k_u_neig[] =
"u_neig";
1955 static const char __pyx_k_volume[] =
"volume";
1956 static const char __pyx_k_weight[] =
"weight";
1957 static const char __pyx_k_df_dofs[] =
"df_dofs";
1958 static const char __pyx_k_eN_left[] =
"eN_left";
1959 static const char __pyx_k_gravity[] =
"gravity";
1960 static const char __pyx_k_kr_neig[] =
"kr_neig";
1961 static const char __pyx_k_nSpace2[] =
"nSpace2";
1962 static const char __pyx_k_omega_e[] =
"omega_e";
1963 static const char __pyx_k_pcBar_n[] =
"pcBar_n";
1964 static const char __pyx_k_q_dmass[] =
"q_dmass";
1965 static const char __pyx_k_q_kr_up[] =
"q_kr_up";
1966 static const char __pyx_k_thetaSR[] =
"thetaSR";
1967 static const char __pyx_k_dmtj_avg[] =
"dmtj_avg";
1968 static const char __pyx_k_eN_right[] =
"eN_right";
1969 static const char __pyx_k_ebq_vals[] =
"ebq_vals";
1970 static const char __pyx_k_integral[] =
"integral";
1971 static const char __pyx_k_material[] =
"material";
1972 static const char __pyx_k_phi_neig[] =
"phi_neig";
1973 static const char __pyx_k_q_grad_u[] =
"q_grad_u";
1974 static const char __pyx_k_q_grad_v[] =
"q_grad_v";
1975 static const char __pyx_k_q_grad_w[] =
"q_grad_w";
1976 static const char __pyx_k_ebN_local[] =
"ebN_local";
1977 static const char __pyx_k_pcBar_nM1[] =
"pcBar_nM1";
1978 static const char __pyx_k_pcBar_nM2[] =
"pcBar_nM2";
1979 static const char __pyx_k_sqrt_sBar[] =
"sqrt_sBar";
1980 static const char __pyx_k_transient[] =
"transient";
1981 static const char __pyx_k_volFactor[] =
"volFactor";
1982 static const char __pyx_k_zVelocity[] =
"zVelocity";
1983 static const char __pyx_k_zvelocity[] =
"zvelocity";
1984 static const char __pyx_k_DKWr_DpsiC[] =
"DKWr_DpsiC";
1985 static const char __pyx_k_matID_neig[] =
"matID_neig";
1986 static const char __pyx_k_nAvgWeight[] =
"nAvgWeight";
1987 static const char __pyx_k_upwindFlag[] =
"upwindFlag";
1988 static const char __pyx_k_DsBar_DpsiC[] =
"DsBar_DpsiC";
1989 static const char __pyx_k_DvBar_DpsiC[] =
"DvBar_DpsiC";
1990 static const char __pyx_k_ImportError[] =
"ImportError";
1991 static const char __pyx_k_eN_neighbor[] =
"eN_neighbor";
1992 static const char __pyx_k_tForReversal[] =
"tForReversal";
1993 static const char __pyx_k_DthetaW_DpsiC[] =
"DthetaW_DpsiC";
1994 static const char __pyx_k_material_left[] =
"material_left";
1995 static const char __pyx_k_weak_residual[] =
"weak_residual";
1996 static const char __pyx_k_material_right[] =
"material_right";
1997 static const char __pyx_k_ebq_global_vals[] =
"ebq_global_vals";
1998 static const char __pyx_k_elementJacobian[] =
"elementJacobian";
1999 static const char __pyx_k_elementResidual[] =
"elementResidual";
2000 static const char __pyx_k_onePlus_pcBar_n[] =
"onePlus_pcBar_n";
2001 static const char __pyx_k_nElements_global[] =
"nElements_global";
2002 static const char __pyx_k_nDOF_test_element[] =
"nDOF_test_element";
2003 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2004 static const char __pyx_k_material_functions[] =
"material_functions";
2005 static const char __pyx_k_nDOF_trial_element[] =
"nDOF_trial_element";
2006 static const char __pyx_k_updateMass_weakAvg[] =
"updateMass_weakAvg";
2007 static const char __pyx_k_calculateNormalFlux[] =
"calculateNormalFlux";
2008 static const char __pyx_k_thisElementIsUpwind[] =
"thisElementIsUpwind";
2009 static const char __pyx_k_elementBoundaryTypes[] =
"elementBoundaryTypes";
2010 static const char __pyx_k_elementMaterialTypes[] =
"elementMaterialTypes";
2011 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
2012 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
2013 static const char __pyx_k_jacobian_weak_residual[] =
"jacobian_weak_residual";
2014 static const char __pyx_k_characteristic_velocity[] =
"characteristic_velocity";
2015 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
2016 static const char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
2017 static const char __pyx_k_setElementBoundariesArray[] =
"setElementBoundariesArray";
2018 static const char __pyx_k_RE_NCP1_getElementJacobian[] =
"RE_NCP1_getElementJacobian";
2019 static const char __pyx_k_RE_NCP1_getElementResidual[] =
"RE_NCP1_getElementResidual";
2020 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
2021 static const char __pyx_k_updateMassJacobian_weakAvg[] =
"updateMassJacobian_weakAvg";
2022 static const char __pyx_k_vortexElementVelocityEval3[] =
"vortexElementVelocityEval3";
2023 static const char __pyx_k_vortexElementVelocityEval4[] =
"vortexElementVelocityEval4";
2024 static const char __pyx_k_helicalElementVelocityEval3[] =
"helicalElementVelocityEval3";
2025 static const char __pyx_k_helicalElementVelocityEval4[] =
"helicalElementVelocityEval4";
2026 static const char __pyx_k_characteristic_velocity_dofs[] =
"characteristic_velocity_dofs";
2027 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
2028 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
2029 static const char __pyx_k_subsurfaceTransportFunctions[] =
"subsurfaceTransportFunctions";
2030 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
2031 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2032 static const char __pyx_k_setExteriorElementBoundaryTypes[] =
"setExteriorElementBoundaryTypes";
2033 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie[] =
"RE_NCP1_evaluateElementCoefficients_Linear";
2034 static const char __pyx_k_computeSimpleCharacteristicVeloc[] =
"computeSimpleCharacteristicVelocityFromElementVelocity";
2035 static const char __pyx_k_evaluateScalarMaterialFunctionOv[] =
"evaluateScalarMaterialFunctionOverElements";
2036 static const char __pyx_k_evaluateSparseTensorMaterialFunc[] =
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
2037 static const char __pyx_k_evaluateVectorMaterialFunctionOv[] =
"evaluateVectorMaterialFunctionOverElements";
2038 static const char __pyx_k_exteriorElementBoundaryMaterialT[] =
"exteriorElementBoundaryMaterialTypes";
2039 static const char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
2040 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2041 static const char __pyx_k_proteus_subsurfaceTransportFunct[] =
"proteus/subsurfaceTransportFunctions.pyx";
2042 static const char __pyx_k_rotatingGaussianElementVelocityE[] =
"rotatingGaussianElementVelocityEval3";
2043 static const char __pyx_k_setScalarMaterialFunctionOverEle[] =
"setScalarMaterialFunctionOverElements";
2044 static const char __pyx_k_setScalarMaterialFunctionOverGlo[] =
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
2045 static const char __pyx_k_setSparseTensorMaterialFunctionO[] =
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
2046 static const char __pyx_k_setVectorMaterialFunctionOverEle[] =
"setVectorMaterialFunctionOverElements";
2047 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie_2[] =
"RE_NCP1_evaluateElementCoefficients_VGM";
2048 static const char __pyx_k_computeSimpleCharacteristicVeloc_2[] =
"computeSimpleCharacteristicVelocityFromVelocityDOFs";
2049 static const char __pyx_k_evaluateScalarMaterialFunctionOv_2[] =
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
2050 static const char __pyx_k_evaluateScalarMaterialFunctionOv_3[] =
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
2051 static const char __pyx_k_evaluateSparseTensorMaterialFunc_2[] =
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
2052 static const char __pyx_k_rotatingGaussianElementVelocityE_2[] =
"rotatingGaussianElementVelocityEval4";
2053 static const char __pyx_k_setScalarMaterialFunctionOverEle_2[] =
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
2054 static const char __pyx_k_setSparseTensorMaterialFunctionO_2[] =
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
2055 static PyObject *__pyx_n_s_DKWr_DpsiC;
2056 static PyObject *__pyx_n_s_DsBar_DpsiC;
2057 static PyObject *__pyx_n_s_DthetaW_DpsiC;
2058 static PyObject *__pyx_n_s_DvBar_DpsiC;
2059 static PyObject *__pyx_n_s_I;
2060 static PyObject *__pyx_n_s_ImportError;
2061 static PyObject *__pyx_n_s_J;
2062 static PyObject *__pyx_n_s_KWr;
2063 static PyObject *__pyx_n_s_KWs;
2064 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie;
2065 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2;
2066 static PyObject *__pyx_n_s_RE_NCP1_getElementJacobian;
2067 static PyObject *__pyx_n_s_RE_NCP1_getElementResidual;
2068 static PyObject *__pyx_n_s_a_avg;
2069 static PyObject *__pyx_n_s_a_eN;
2070 static PyObject *__pyx_n_s_a_neig;
2071 static PyObject *__pyx_n_s_a_up;
2072 static PyObject *__pyx_n_s_alpha;
2073 static PyObject *__pyx_n_s_beta;
2074 static PyObject *__pyx_n_s_calculateNormalFlux;
2075 static PyObject *__pyx_n_s_characteristic_velocity;
2076 static PyObject *__pyx_n_s_characteristic_velocity_dofs;
2077 static PyObject *__pyx_n_s_cline_in_traceback;
2078 static PyObject *__pyx_n_s_clock;
2079 static PyObject *__pyx_n_s_colind;
2080 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc;
2081 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc_2;
2082 static PyObject *__pyx_n_s_d;
2083 static PyObject *__pyx_n_s_dS;
2084 static PyObject *__pyx_n_s_dV;
2085 static PyObject *__pyx_n_s_denom;
2086 static PyObject *__pyx_n_s_df;
2087 static PyObject *__pyx_n_s_df_dofs;
2088 static PyObject *__pyx_n_s_dkr_up;
2089 static PyObject *__pyx_n_s_dm;
2090 static PyObject *__pyx_n_s_dmt;
2091 static PyObject *__pyx_n_s_dmtj_avg;
2092 static PyObject *__pyx_n_s_dot;
2093 static PyObject *__pyx_n_s_drhom;
2094 static PyObject *__pyx_n_s_eN;
2095 static PyObject *__pyx_n_s_eN_left;
2096 static PyObject *__pyx_n_s_eN_neighbor;
2097 static PyObject *__pyx_n_s_eN_right;
2098 static PyObject *__pyx_n_s_ebN;
2099 static PyObject *__pyx_n_s_ebNE;
2100 static PyObject *__pyx_n_s_ebN_local;
2101 static PyObject *__pyx_n_s_ebq_global_vals;
2102 static PyObject *__pyx_n_s_ebq_vals;
2103 static PyObject *__pyx_n_s_elementBarycentersArray;
2104 static PyObject *__pyx_n_s_elementBoundariesArray;
2105 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
2106 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
2107 static PyObject *__pyx_n_s_elementBoundaryTypes;
2108 static PyObject *__pyx_n_s_elementJacobian;
2109 static PyObject *__pyx_n_s_elementMaterialTypes;
2110 static PyObject *__pyx_n_s_elementNeighborsArray;
2111 static PyObject *__pyx_n_s_elementResidual;
2112 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv;
2113 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_2;
2114 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_3;
2115 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc;
2116 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc_2;
2117 static PyObject *__pyx_n_s_evaluateVectorMaterialFunctionOv;
2118 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
2119 static PyObject *__pyx_n_s_exteriorElementBoundaryMaterialT;
2120 static PyObject *__pyx_n_s_f_up;
2121 static PyObject *__pyx_n_s_flat;
2122 static PyObject *__pyx_n_s_flux;
2123 static PyObject *__pyx_n_s_gravity;
2124 static PyObject *__pyx_n_s_helicalElementVelocityEval3;
2125 static PyObject *__pyx_n_s_helicalElementVelocityEval4;
2126 static PyObject *__pyx_n_s_i;
2127 static PyObject *__pyx_n_s_ii;
2128 static PyObject *__pyx_n_s_import;
2129 static PyObject *__pyx_n_s_integral;
2130 static PyObject *__pyx_n_s_j;
2131 static PyObject *__pyx_n_s_jacobian_weak_residual;
2132 static PyObject *__pyx_n_s_k;
2133 static PyObject *__pyx_n_s_kb;
2134 static PyObject *__pyx_n_s_kr_eN;
2135 static PyObject *__pyx_n_s_kr_neig;
2136 static PyObject *__pyx_n_s_l2g;
2137 static PyObject *__pyx_n_s_m;
2138 static PyObject *__pyx_n_s_main;
2139 static PyObject *__pyx_n_s_matID;
2140 static PyObject *__pyx_n_s_matID_neig;
2141 static PyObject *__pyx_n_s_material;
2142 static PyObject *__pyx_n_s_material_functions;
2143 static PyObject *__pyx_n_s_material_left;
2144 static PyObject *__pyx_n_s_material_right;
2145 static PyObject *__pyx_n_s_mt;
2146 static PyObject *__pyx_n_s_mt_avg;
2147 static PyObject *__pyx_n_s_n;
2148 static PyObject *__pyx_n_s_nAvgWeight;
2149 static PyObject *__pyx_n_s_nDOF_test_element;
2150 static PyObject *__pyx_n_s_nDOF_trial_element;
2151 static PyObject *__pyx_n_s_nElementBoundaries_element;
2152 static PyObject *__pyx_n_s_nElementBoundaries_global;
2153 static PyObject *__pyx_n_s_nElements_global;
2154 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
2155 static PyObject *__pyx_n_s_nSpace;
2156 static PyObject *__pyx_n_s_nSpace2;
2157 static PyObject *__pyx_n_s_name;
2158 static PyObject *__pyx_n_s_nd;
2159 static PyObject *__pyx_n_s_nnz;
2160 static PyObject *__pyx_n_s_numer;
2161 static PyObject *__pyx_n_s_numpy;
2162 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2163 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2164 static PyObject *__pyx_n_s_omega_e;
2165 static PyObject *__pyx_n_s_one8;
2166 static PyObject *__pyx_n_s_onePlus_pcBar_n;
2167 static PyObject *__pyx_n_s_pcBar;
2168 static PyObject *__pyx_n_s_pcBar_n;
2169 static PyObject *__pyx_n_s_pcBar_nM1;
2170 static PyObject *__pyx_n_s_pcBar_nM2;
2171 static PyObject *__pyx_n_s_phi_eN;
2172 static PyObject *__pyx_n_s_phi_neig;
2173 static PyObject *__pyx_n_s_pi;
2174 static PyObject *__pyx_n_s_picard;
2175 static PyObject *__pyx_kp_s_proteus_subsurfaceTransportFunct;
2176 static PyObject *__pyx_n_s_psiC;
2177 static PyObject *__pyx_n_s_q;
2178 static PyObject *__pyx_n_s_q_alin;
2179 static PyObject *__pyx_n_s_q_detJ;
2180 static PyObject *__pyx_n_s_q_dkr;
2181 static PyObject *__pyx_n_s_q_dm;
2182 static PyObject *__pyx_n_s_q_dmass;
2183 static PyObject *__pyx_n_s_q_dmt;
2184 static PyObject *__pyx_n_s_q_flin;
2185 static PyObject *__pyx_n_s_q_grad_u;
2186 static PyObject *__pyx_n_s_q_grad_v;
2187 static PyObject *__pyx_n_s_q_grad_w;
2188 static PyObject *__pyx_n_s_q_kr;
2189 static PyObject *__pyx_n_s_q_kr_up;
2190 static PyObject *__pyx_n_s_q_m;
2191 static PyObject *__pyx_n_s_q_mass;
2192 static PyObject *__pyx_n_s_q_mt;
2193 static PyObject *__pyx_n_s_q_r;
2194 static PyObject *__pyx_n_s_q_u;
2195 static PyObject *__pyx_n_s_q_vals;
2196 static PyObject *__pyx_n_s_q_x;
2197 static PyObject *__pyx_n_s_range;
2198 static PyObject *__pyx_n_s_rho;
2199 static PyObject *__pyx_n_s_rho2;
2200 static PyObject *__pyx_n_s_rhom;
2201 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE;
2202 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE_2;
2203 static PyObject *__pyx_n_s_rowptr;
2204 static PyObject *__pyx_n_s_sBar;
2205 static PyObject *__pyx_n_s_setElementBoundariesArray;
2206 static PyObject *__pyx_n_s_setExteriorElementBoundaryTypes;
2207 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle;
2208 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle_2;
2209 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverGlo;
2210 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO;
2211 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO_2;
2212 static PyObject *__pyx_n_s_setVectorMaterialFunctionOverEle;
2213 static PyObject *__pyx_n_s_shape;
2214 static PyObject *__pyx_n_s_sqrt_sBar;
2215 static PyObject *__pyx_n_s_subsurfaceTransportFunctions;
2216 static PyObject *__pyx_n_s_sum;
2217 static PyObject *__pyx_n_s_t;
2218 static PyObject *__pyx_n_s_tForReversal;
2219 static PyObject *__pyx_n_s_test;
2220 static PyObject *__pyx_n_s_thetaR;
2221 static PyObject *__pyx_n_s_thetaS;
2222 static PyObject *__pyx_n_s_thetaSR;
2223 static PyObject *__pyx_n_s_thetaW;
2224 static PyObject *__pyx_n_s_thisElementIsUpwind;
2225 static PyObject *__pyx_n_s_transient;
2226 static PyObject *__pyx_n_s_u_dof;
2227 static PyObject *__pyx_n_s_u_eN;
2228 static PyObject *__pyx_n_s_u_j;
2229 static PyObject *__pyx_n_s_u_l2g;
2230 static PyObject *__pyx_n_s_u_neig;
2231 static PyObject *__pyx_n_s_updateMassJacobian_weakAvg;
2232 static PyObject *__pyx_n_s_updateMass_weakAvg;
2233 static PyObject *__pyx_n_s_upwindFlag;
2234 static PyObject *__pyx_n_s_v;
2235 static PyObject *__pyx_n_s_vBar;
2236 static PyObject *__pyx_n_s_vBar2;
2237 static PyObject *__pyx_n_s_vol;
2238 static PyObject *__pyx_n_s_volFactor;
2239 static PyObject *__pyx_n_s_vol_e;
2240 static PyObject *__pyx_n_s_volume;
2241 static PyObject *__pyx_n_s_vortexElementVelocityEval3;
2242 static PyObject *__pyx_n_s_vortexElementVelocityEval4;
2243 static PyObject *__pyx_n_s_w;
2244 static PyObject *__pyx_n_s_weak_residual;
2245 static PyObject *__pyx_n_s_weight;
2246 static PyObject *__pyx_n_s_x;
2247 static PyObject *__pyx_n_s_xc;
2248 static PyObject *__pyx_n_s_yc;
2249 static PyObject *__pyx_n_s_zVelocity;
2250 static PyObject *__pyx_n_s_zeros;
2251 static PyObject *__pyx_n_s_zvelocity;
2252 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes);
2253 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes);
2254 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2255 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2256 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2257 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2258 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2259 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2260 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2261 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2262 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2263 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2264 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2265 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2266 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin);
2267 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up);
2268 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual);
2269 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian);
2270 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual);
2271 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual);
2272 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux);
2273 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2274 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2275 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2276 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2277 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2278 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2279 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2280 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2281 static PyObject *__pyx_float_0_0;
2282 static PyObject *__pyx_float_0_5;
2283 static PyObject *__pyx_float_2_0;
2284 static PyObject *__pyx_float_1_0eneg_20;
2285 static PyObject *__pyx_slice_;
2286 static PyObject *__pyx_tuple__2;
2287 static PyObject *__pyx_tuple__3;
2288 static PyObject *__pyx_tuple__4;
2289 static PyObject *__pyx_tuple__6;
2290 static PyObject *__pyx_tuple__8;
2291 static PyObject *__pyx_tuple__10;
2292 static PyObject *__pyx_tuple__12;
2293 static PyObject *__pyx_tuple__14;
2294 static PyObject *__pyx_tuple__16;
2295 static PyObject *__pyx_tuple__18;
2296 static PyObject *__pyx_tuple__20;
2297 static PyObject *__pyx_tuple__22;
2298 static PyObject *__pyx_tuple__24;
2299 static PyObject *__pyx_tuple__26;
2300 static PyObject *__pyx_tuple__28;
2301 static PyObject *__pyx_tuple__30;
2302 static PyObject *__pyx_tuple__32;
2303 static PyObject *__pyx_tuple__34;
2304 static PyObject *__pyx_tuple__36;
2305 static PyObject *__pyx_tuple__38;
2306 static PyObject *__pyx_tuple__40;
2307 static PyObject *__pyx_tuple__42;
2308 static PyObject *__pyx_tuple__44;
2309 static PyObject *__pyx_tuple__46;
2310 static PyObject *__pyx_tuple__48;
2311 static PyObject *__pyx_tuple__50;
2312 static PyObject *__pyx_tuple__52;
2313 static PyObject *__pyx_tuple__54;
2314 static PyObject *__pyx_tuple__56;
2315 static PyObject *__pyx_tuple__58;
2316 static PyObject *__pyx_tuple__60;
2317 static PyObject *__pyx_codeobj__5;
2318 static PyObject *__pyx_codeobj__7;
2319 static PyObject *__pyx_codeobj__9;
2320 static PyObject *__pyx_codeobj__11;
2321 static PyObject *__pyx_codeobj__13;
2322 static PyObject *__pyx_codeobj__15;
2323 static PyObject *__pyx_codeobj__17;
2324 static PyObject *__pyx_codeobj__19;
2325 static PyObject *__pyx_codeobj__21;
2326 static PyObject *__pyx_codeobj__23;
2327 static PyObject *__pyx_codeobj__25;
2328 static PyObject *__pyx_codeobj__27;
2329 static PyObject *__pyx_codeobj__29;
2330 static PyObject *__pyx_codeobj__31;
2331 static PyObject *__pyx_codeobj__33;
2332 static PyObject *__pyx_codeobj__35;
2333 static PyObject *__pyx_codeobj__37;
2334 static PyObject *__pyx_codeobj__39;
2335 static PyObject *__pyx_codeobj__41;
2336 static PyObject *__pyx_codeobj__43;
2337 static PyObject *__pyx_codeobj__45;
2338 static PyObject *__pyx_codeobj__47;
2339 static PyObject *__pyx_codeobj__49;
2340 static PyObject *__pyx_codeobj__51;
2341 static PyObject *__pyx_codeobj__53;
2342 static PyObject *__pyx_codeobj__55;
2343 static PyObject *__pyx_codeobj__57;
2344 static PyObject *__pyx_codeobj__59;
2345 static PyObject *__pyx_codeobj__61;
2356 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_max(
double __pyx_v_a,
double __pyx_v_b) {
2358 __Pyx_RefNannyDeclarations
2360 __Pyx_RefNannySetupContext(
"double_max", 0);
2361 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
2362 __pyx_t_1 = __pyx_v_a;
2364 __pyx_t_1 = __pyx_v_b;
2366 __pyx_r = __pyx_t_1;
2371 __Pyx_RefNannyFinishContext();
2383 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_min(
double __pyx_v_a,
double __pyx_v_b) {
2385 __Pyx_RefNannyDeclarations
2387 __Pyx_RefNannySetupContext(
"double_min", 0);
2388 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
2389 __pyx_t_1 = __pyx_v_a;
2391 __pyx_t_1 = __pyx_v_b;
2393 __pyx_r = __pyx_t_1;
2398 __Pyx_RefNannyFinishContext();
2411 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2412 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {
"setExteriorElementBoundaryTypes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, METH_VARARGS|METH_KEYWORDS, 0};
2413 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2414 int __pyx_v_nExteriorElementBoundaries_global;
2415 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
2416 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2417 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2418 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
2419 int __pyx_lineno = 0;
2420 const char *__pyx_filename = NULL;
2421 int __pyx_clineno = 0;
2422 PyObject *__pyx_r = 0;
2423 __Pyx_RefNannyDeclarations
2424 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes (wrapper)", 0);
2426 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_exteriorElementBoundaryMaterialT,0};
2427 PyObject* values[5] = {0,0,0,0,0};
2428 if (unlikely(__pyx_kwds)) {
2430 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2432 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2434 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2436 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2438 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2440 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2443 default:
goto __pyx_L5_argtuple_error;
2445 kw_args = PyDict_Size(__pyx_kwds);
2448 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2449 else goto __pyx_L5_argtuple_error;
2452 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
2454 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 1); __PYX_ERR(0, 18, __pyx_L3_error)
2458 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2460 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 2); __PYX_ERR(0, 18, __pyx_L3_error)
2464 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2466 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 3); __PYX_ERR(0, 18, __pyx_L3_error)
2470 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundaryMaterialT)) != 0)) kw_args--;
2472 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 4); __PYX_ERR(0, 18, __pyx_L3_error)
2475 if (unlikely(kw_args > 0)) {
2476 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setExteriorElementBoundaryTypes") < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
2478 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2479 goto __pyx_L5_argtuple_error;
2481 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2482 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2483 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2484 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2485 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2487 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2488 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
2489 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
2490 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
2491 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
2493 goto __pyx_L4_argument_unpacking_done;
2494 __pyx_L5_argtuple_error:;
2495 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error)
2497 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2498 __Pyx_RefNannyFinishContext();
2500 __pyx_L4_argument_unpacking_done:;
2501 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2502 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2503 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2504 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2505 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
2512 __Pyx_RefNannyFinishContext();
2516 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes) {
2520 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2521 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2522 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2523 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2524 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
2525 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
2526 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
2527 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2528 PyObject *__pyx_r = NULL;
2529 __Pyx_RefNannyDeclarations
2533 Py_ssize_t __pyx_t_4;
2535 Py_ssize_t __pyx_t_6;
2536 int __pyx_lineno = 0;
2537 const char *__pyx_filename = NULL;
2538 int __pyx_clineno = 0;
2539 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes", 0);
2540 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
2541 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
2542 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
2543 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
2544 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2545 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2546 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2547 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2548 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2549 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2550 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2551 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2552 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
2553 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
2554 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
2555 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2557 __Pyx_BufFmt_StackElem __pyx_stack[1];
2558 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2560 __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.shape[0];
2562 __Pyx_BufFmt_StackElem __pyx_stack[1];
2563 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2565 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2567 __Pyx_BufFmt_StackElem __pyx_stack[1];
2568 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2570 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2572 __Pyx_BufFmt_StackElem __pyx_stack[1];
2573 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2575 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0];
2584 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
2585 __pyx_t_2 = __pyx_t_1;
2586 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2587 __pyx_v_ebNE = __pyx_t_3;
2596 __pyx_t_4 = __pyx_v_ebNE;
2598 if (__pyx_t_4 < 0) {
2599 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
2600 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2601 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_5 = 0;
2602 if (unlikely(__pyx_t_5 != -1)) {
2603 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2604 __PYX_ERR(0, 25, __pyx_L1_error)
2606 __pyx_v_ebN = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides));
2615 __pyx_t_4 = __pyx_v_ebN;
2618 if (__pyx_t_4 < 0) {
2619 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2620 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2621 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2622 if (__pyx_t_6 < 0) {
2623 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2624 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 1;
2625 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2626 if (unlikely(__pyx_t_5 != -1)) {
2627 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2628 __PYX_ERR(0, 26, __pyx_L1_error)
2630 __pyx_v_eN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2639 __pyx_t_6 = __pyx_v_eN;
2641 if (__pyx_t_6 < 0) {
2642 __pyx_t_6 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2643 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
2644 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2645 if (unlikely(__pyx_t_5 != -1)) {
2646 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2647 __PYX_ERR(0, 27, __pyx_L1_error)
2649 __pyx_t_4 = __pyx_v_ebNE;
2651 if (__pyx_t_4 < 0) {
2652 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
2653 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2654 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2655 if (unlikely(__pyx_t_5 != -1)) {
2656 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2657 __PYX_ERR(0, 27, __pyx_L1_error)
2659 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2671 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2674 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2675 __Pyx_PyThreadState_declare
2676 __Pyx_PyThreadState_assign
2677 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2678 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2679 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2680 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2681 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2682 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2683 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2687 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2688 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2689 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2690 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2692 __Pyx_XGIVEREF(__pyx_r);
2693 __Pyx_RefNannyFinishContext();
2706 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2707 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {
"setElementBoundariesArray", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, METH_VARARGS|METH_KEYWORDS, 0};
2708 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2709 int __pyx_v_nElementBoundaries_global;
2710 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2711 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2712 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
2713 int __pyx_lineno = 0;
2714 const char *__pyx_filename = NULL;
2715 int __pyx_clineno = 0;
2716 PyObject *__pyx_r = 0;
2717 __Pyx_RefNannyDeclarations
2718 __Pyx_RefNannySetupContext(
"setElementBoundariesArray (wrapper)", 0);
2720 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElementBoundaries_global,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_elementBoundaryMaterialTypes,0};
2721 PyObject* values[4] = {0,0,0,0};
2722 if (unlikely(__pyx_kwds)) {
2724 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2726 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2728 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2730 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2732 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2735 default:
goto __pyx_L5_argtuple_error;
2737 kw_args = PyDict_Size(__pyx_kwds);
2740 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_global)) != 0)) kw_args--;
2741 else goto __pyx_L5_argtuple_error;
2744 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2746 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
2750 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2752 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
2756 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryMaterialTypes)) != 0)) kw_args--;
2758 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
2761 if (unlikely(kw_args > 0)) {
2762 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setElementBoundariesArray") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
2764 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2765 goto __pyx_L5_argtuple_error;
2767 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2768 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2769 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2770 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2772 __pyx_v_nElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2773 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
2774 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
2775 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
2777 goto __pyx_L4_argument_unpacking_done;
2778 __pyx_L5_argtuple_error:;
2779 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
2781 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2782 __Pyx_RefNannyFinishContext();
2784 __pyx_L4_argument_unpacking_done:;
2785 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
2786 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 31, __pyx_L1_error)
2787 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2788 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
2795 __Pyx_RefNannyFinishContext();
2799 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes) {
2801 int __pyx_v_eN_left;
2802 int __pyx_v_eN_right;
2803 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2804 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2805 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
2806 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
2807 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2808 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2809 PyObject *__pyx_r = NULL;
2810 __Pyx_RefNannyDeclarations
2814 Py_ssize_t __pyx_t_4;
2815 Py_ssize_t __pyx_t_5;
2817 Py_ssize_t __pyx_t_7;
2819 int __pyx_lineno = 0;
2820 const char *__pyx_filename = NULL;
2821 int __pyx_clineno = 0;
2822 __Pyx_RefNannySetupContext(
"setElementBoundariesArray", 0);
2823 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2824 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2825 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2826 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2827 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2828 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2829 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2830 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2831 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
2832 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
2833 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
2834 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
2836 __Pyx_BufFmt_StackElem __pyx_stack[1];
2837 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2839 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2841 __Pyx_BufFmt_StackElem __pyx_stack[1];
2842 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2844 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2846 __Pyx_BufFmt_StackElem __pyx_stack[1];
2847 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2849 __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[1];
2858 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
2859 __pyx_t_2 = __pyx_t_1;
2860 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2861 __pyx_v_ebN = __pyx_t_3;
2870 __pyx_t_4 = __pyx_v_ebN;
2873 if (__pyx_t_4 < 0) {
2874 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2875 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2876 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2877 if (__pyx_t_5 < 0) {
2878 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2879 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2880 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2881 if (unlikely(__pyx_t_6 != -1)) {
2882 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2883 __PYX_ERR(0, 35, __pyx_L1_error)
2885 __pyx_v_eN_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2894 __pyx_t_5 = __pyx_v_ebN;
2897 if (__pyx_t_5 < 0) {
2898 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2899 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2900 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2901 if (__pyx_t_4 < 0) {
2902 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2903 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
2904 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2905 if (unlikely(__pyx_t_6 != -1)) {
2906 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2907 __PYX_ERR(0, 36, __pyx_L1_error)
2909 __pyx_v_eN_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2918 __pyx_t_4 = __pyx_v_eN_left;
2920 if (__pyx_t_4 < 0) {
2921 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2922 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2923 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2924 if (unlikely(__pyx_t_6 != -1)) {
2925 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2926 __PYX_ERR(0, 37, __pyx_L1_error)
2928 __pyx_t_5 = __pyx_v_ebN;
2931 if (__pyx_t_5 < 0) {
2932 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2933 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2934 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2935 if (__pyx_t_7 < 0) {
2936 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2937 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
2938 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2939 if (unlikely(__pyx_t_6 != -1)) {
2940 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2941 __PYX_ERR(0, 37, __pyx_L1_error)
2943 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2952 __pyx_t_4 = __pyx_v_eN_left;
2954 if (__pyx_t_4 < 0) {
2955 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2956 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2957 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2958 if (unlikely(__pyx_t_6 != -1)) {
2959 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2960 __PYX_ERR(0, 38, __pyx_L1_error)
2962 __pyx_t_7 = __pyx_v_ebN;
2965 if (__pyx_t_7 < 0) {
2966 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2967 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
2968 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2969 if (__pyx_t_5 < 0) {
2970 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2971 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2972 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2973 if (unlikely(__pyx_t_6 != -1)) {
2974 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2975 __PYX_ERR(0, 38, __pyx_L1_error)
2977 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2986 __pyx_t_8 = ((__pyx_v_eN_right >= 0) != 0);
2996 __pyx_t_4 = __pyx_v_eN_right;
2998 if (__pyx_t_4 < 0) {
2999 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3000 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
3001 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
3002 if (unlikely(__pyx_t_6 != -1)) {
3003 __Pyx_RaiseBufferIndexError(__pyx_t_6);
3004 __PYX_ERR(0, 40, __pyx_L1_error)
3006 __pyx_t_5 = __pyx_v_ebN;
3009 if (__pyx_t_5 < 0) {
3010 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
3011 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
3012 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
3013 if (__pyx_t_7 < 0) {
3014 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
3015 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
3016 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
3017 if (unlikely(__pyx_t_6 != -1)) {
3018 __Pyx_RaiseBufferIndexError(__pyx_t_6);
3019 __PYX_ERR(0, 40, __pyx_L1_error)
3021 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3042 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3045 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3046 __Pyx_PyThreadState_declare
3047 __Pyx_PyThreadState_assign
3048 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3049 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
3050 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
3051 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3052 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3053 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
3057 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
3058 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
3059 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3061 __Pyx_XGIVEREF(__pyx_r);
3062 __Pyx_RefNannyFinishContext();
3075 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3076 static char __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and set is material j\n likely little improvement right now without correct typing of material_functions\n ";
3077 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {
"setScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
3078 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3079 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
3080 PyArrayObject *__pyx_v_q_vals = 0;
3081 PyObject *__pyx_v_material_functions = 0;
3082 int __pyx_lineno = 0;
3083 const char *__pyx_filename = NULL;
3084 int __pyx_clineno = 0;
3085 PyObject *__pyx_r = 0;
3086 __Pyx_RefNannyDeclarations
3087 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements (wrapper)", 0);
3089 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3090 PyObject* values[3] = {0,0,0};
3091 if (unlikely(__pyx_kwds)) {
3093 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3095 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3097 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3099 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3102 default:
goto __pyx_L5_argtuple_error;
3104 kw_args = PyDict_Size(__pyx_kwds);
3107 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3108 else goto __pyx_L5_argtuple_error;
3111 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3113 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 43, __pyx_L3_error)
3117 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3119 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 43, __pyx_L3_error)
3122 if (unlikely(kw_args > 0)) {
3123 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 43, __pyx_L3_error)
3125 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3126 goto __pyx_L5_argtuple_error;
3128 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3129 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3130 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3132 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3133 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3134 __pyx_v_material_functions = ((PyObject*)values[2]);
3136 goto __pyx_L4_argument_unpacking_done;
3137 __pyx_L5_argtuple_error:;
3138 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error)
3140 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3141 __Pyx_RefNannyFinishContext();
3143 __pyx_L4_argument_unpacking_done:;
3144 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
3145 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
3146 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 45, __pyx_L1_error)
3147 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3154 __Pyx_RefNannyFinishContext();
3158 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3161 int __pyx_v_material;
3162 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3163 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3164 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3165 __Pyx_Buffer __pyx_pybuffer_q_vals;
3166 PyObject *__pyx_r = NULL;
3167 __Pyx_RefNannyDeclarations
3171 Py_ssize_t __pyx_t_4;
3175 PyObject *__pyx_t_8 = NULL;
3176 PyObject *__pyx_t_9 = NULL;
3177 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_10;
3178 Py_ssize_t __pyx_t_11;
3180 int __pyx_lineno = 0;
3181 const char *__pyx_filename = NULL;
3182 int __pyx_clineno = 0;
3183 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements", 0);
3184 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3185 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3186 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3187 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3188 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3189 __pyx_pybuffer_q_vals.refcount = 0;
3190 __pyx_pybuffernd_q_vals.data = NULL;
3191 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3193 __Pyx_BufFmt_StackElem __pyx_stack[1];
3194 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3196 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3198 __Pyx_BufFmt_StackElem __pyx_stack[1];
3199 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3201 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
3210 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3211 __pyx_t_2 = __pyx_t_1;
3212 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3213 __pyx_v_eN = __pyx_t_3;
3222 __pyx_t_4 = __pyx_v_eN;
3224 if (__pyx_t_4 < 0) {
3225 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3226 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3227 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3228 if (unlikely(__pyx_t_5 != -1)) {
3229 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3230 __PYX_ERR(0, 52, __pyx_L1_error)
3232 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3241 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3242 __pyx_t_7 = __pyx_t_6;
3243 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3244 __pyx_v_k = __pyx_t_5;
3253 if (unlikely(__pyx_v_material_functions == Py_None)) {
3254 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3255 __PYX_ERR(0, 54, __pyx_L1_error)
3257 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error)
3258 __Pyx_GOTREF(__pyx_t_8);
3259 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error)
3260 __Pyx_GOTREF(__pyx_t_9);
3261 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3262 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9);
if (unlikely((__pyx_t_10 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
3263 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3264 __pyx_t_4 = __pyx_v_eN;
3265 __pyx_t_11 = __pyx_v_k;
3267 if (__pyx_t_4 < 0) {
3268 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
3269 if (unlikely(__pyx_t_4 < 0)) __pyx_t_12 = 0;
3270 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_12 = 0;
3271 if (__pyx_t_11 < 0) {
3272 __pyx_t_11 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
3273 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 1;
3274 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_12 = 1;
3275 if (unlikely(__pyx_t_12 != -1)) {
3276 __Pyx_RaiseBufferIndexError(__pyx_t_12);
3277 __PYX_ERR(0, 54, __pyx_L1_error)
3279 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_10;
3292 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3295 __Pyx_XDECREF(__pyx_t_8);
3296 __Pyx_XDECREF(__pyx_t_9);
3297 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3298 __Pyx_PyThreadState_declare
3299 __Pyx_PyThreadState_assign
3300 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3301 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3302 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3303 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3304 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3308 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3309 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3311 __Pyx_XGIVEREF(__pyx_r);
3312 __Pyx_RefNannyFinishContext();
3325 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3326 static char __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and set \013ec f_j assuming element is material j\n ";
3327 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {
"setVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
3328 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3329 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
3330 PyArrayObject *__pyx_v_q_vals = 0;
3331 PyObject *__pyx_v_material_functions = 0;
3332 int __pyx_lineno = 0;
3333 const char *__pyx_filename = NULL;
3334 int __pyx_clineno = 0;
3335 PyObject *__pyx_r = 0;
3336 __Pyx_RefNannyDeclarations
3337 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements (wrapper)", 0);
3339 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3340 PyObject* values[3] = {0,0,0};
3341 if (unlikely(__pyx_kwds)) {
3343 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3345 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3347 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3349 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3352 default:
goto __pyx_L5_argtuple_error;
3354 kw_args = PyDict_Size(__pyx_kwds);
3357 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3358 else goto __pyx_L5_argtuple_error;
3361 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3363 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 56, __pyx_L3_error)
3367 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3369 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 56, __pyx_L3_error)
3372 if (unlikely(kw_args > 0)) {
3373 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
3375 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3376 goto __pyx_L5_argtuple_error;
3378 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3379 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3380 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3382 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3383 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3384 __pyx_v_material_functions = ((PyObject*)values[2]);
3386 goto __pyx_L4_argument_unpacking_done;
3387 __pyx_L5_argtuple_error:;
3388 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
3390 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3391 __Pyx_RefNannyFinishContext();
3393 __pyx_L4_argument_unpacking_done:;
3394 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
3395 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
3396 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 58, __pyx_L1_error)
3397 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3404 __Pyx_RefNannyFinishContext();
3408 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3411 int __pyx_v_material;
3412 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3413 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3414 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3415 __Pyx_Buffer __pyx_pybuffer_q_vals;
3416 PyObject *__pyx_r = NULL;
3417 __Pyx_RefNannyDeclarations
3421 Py_ssize_t __pyx_t_4;
3425 PyObject *__pyx_t_8 = NULL;
3426 PyObject *__pyx_t_9 = NULL;
3427 PyObject *__pyx_t_10 = NULL;
3428 PyObject *__pyx_t_11 = NULL;
3429 int __pyx_lineno = 0;
3430 const char *__pyx_filename = NULL;
3431 int __pyx_clineno = 0;
3432 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements", 0);
3433 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3434 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3435 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3436 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3437 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3438 __pyx_pybuffer_q_vals.refcount = 0;
3439 __pyx_pybuffernd_q_vals.data = NULL;
3440 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3442 __Pyx_BufFmt_StackElem __pyx_stack[1];
3443 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3445 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3447 __Pyx_BufFmt_StackElem __pyx_stack[1];
3448 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3450 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
3459 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3460 __pyx_t_2 = __pyx_t_1;
3461 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3462 __pyx_v_eN = __pyx_t_3;
3471 __pyx_t_4 = __pyx_v_eN;
3473 if (__pyx_t_4 < 0) {
3474 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3475 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3476 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3477 if (unlikely(__pyx_t_5 != -1)) {
3478 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3479 __PYX_ERR(0, 64, __pyx_L1_error)
3481 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3490 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3491 __pyx_t_7 = __pyx_t_6;
3492 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3493 __pyx_v_k = __pyx_t_5;
3502 if (unlikely(__pyx_v_material_functions == Py_None)) {
3503 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3504 __PYX_ERR(0, 66, __pyx_L1_error)
3506 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3507 __Pyx_GOTREF(__pyx_t_8);
3508 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3509 __Pyx_GOTREF(__pyx_t_9);
3510 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3511 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_flat);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3512 __Pyx_GOTREF(__pyx_t_8);
3513 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3514 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3515 __Pyx_GOTREF(__pyx_t_9);
3516 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error)
3517 __Pyx_GOTREF(__pyx_t_10);
3518 __pyx_t_11 = PyTuple_New(3);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 66, __pyx_L1_error)
3519 __Pyx_GOTREF(__pyx_t_11);
3520 __Pyx_GIVEREF(__pyx_t_9);
3521 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
3522 __Pyx_GIVEREF(__pyx_t_10);
3523 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
3524 __Pyx_INCREF(__pyx_slice_);
3525 __Pyx_GIVEREF(__pyx_slice_);
3526 PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_slice_);
3529 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_11, __pyx_t_8) < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3530 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3531 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3544 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3547 __Pyx_XDECREF(__pyx_t_8);
3548 __Pyx_XDECREF(__pyx_t_9);
3549 __Pyx_XDECREF(__pyx_t_10);
3550 __Pyx_XDECREF(__pyx_t_11);
3551 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3552 __Pyx_PyThreadState_declare
3553 __Pyx_PyThreadState_assign
3554 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3555 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3556 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3557 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3558 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3562 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3563 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3565 __Pyx_XGIVEREF(__pyx_r);
3566 __Pyx_RefNannyFinishContext();
3579 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3580 static char __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and set f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3581 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
3582 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3583 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3584 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3585 PyArrayObject *__pyx_v_ebq_vals = 0;
3586 PyObject *__pyx_v_material_functions = 0;
3587 int __pyx_lineno = 0;
3588 const char *__pyx_filename = NULL;
3589 int __pyx_clineno = 0;
3590 PyObject *__pyx_r = 0;
3591 __Pyx_RefNannyDeclarations
3592 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
3594 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3595 PyObject* values[4] = {0,0,0,0};
3596 if (unlikely(__pyx_kwds)) {
3598 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3600 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3602 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3604 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3606 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3609 default:
goto __pyx_L5_argtuple_error;
3611 kw_args = PyDict_Size(__pyx_kwds);
3614 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3615 else goto __pyx_L5_argtuple_error;
3618 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3620 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error)
3624 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3626 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 69, __pyx_L3_error)
3630 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3632 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 69, __pyx_L3_error)
3635 if (unlikely(kw_args > 0)) {
3636 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
3638 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3639 goto __pyx_L5_argtuple_error;
3641 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3642 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3643 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3644 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3646 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
3647 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
3648 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
3649 __pyx_v_material_functions = ((PyObject*)values[3]);
3651 goto __pyx_L4_argument_unpacking_done;
3652 __pyx_L5_argtuple_error:;
3653 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
3655 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3656 __Pyx_RefNannyFinishContext();
3658 __pyx_L4_argument_unpacking_done:;
3659 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
3660 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
3661 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
3662 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 72, __pyx_L1_error)
3663 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3670 __Pyx_RefNannyFinishContext();
3674 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3677 int __pyx_v_ebN_local;
3679 int __pyx_v_material_left;
3680 int __pyx_v_material_right;
3681 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3682 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3683 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3684 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3685 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3686 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3687 PyObject *__pyx_r = NULL;
3688 __Pyx_RefNannyDeclarations
3695 Py_ssize_t __pyx_t_7;
3696 Py_ssize_t __pyx_t_8;
3698 npy_intp __pyx_t_10;
3699 npy_intp __pyx_t_11;
3700 PyObject *__pyx_t_12 = NULL;
3701 PyObject *__pyx_t_13 = NULL;
3702 PyObject *__pyx_t_14 = NULL;
3703 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
3704 Py_ssize_t __pyx_t_16;
3706 int __pyx_lineno = 0;
3707 const char *__pyx_filename = NULL;
3708 int __pyx_clineno = 0;
3709 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
3710 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3711 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3712 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3713 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3714 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3715 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3716 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3717 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3718 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3719 __pyx_pybuffer_ebq_vals.refcount = 0;
3720 __pyx_pybuffernd_ebq_vals.data = NULL;
3721 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3723 __Pyx_BufFmt_StackElem __pyx_stack[1];
3724 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3726 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3728 __Pyx_BufFmt_StackElem __pyx_stack[1];
3729 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3731 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3733 __Pyx_BufFmt_StackElem __pyx_stack[1];
3734 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3736 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
3745 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3746 __pyx_t_2 = __pyx_t_1;
3747 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3748 __pyx_v_eN = __pyx_t_3;
3757 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
3758 __pyx_t_5 = __pyx_t_4;
3759 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3760 __pyx_v_ebN_local = __pyx_t_6;
3769 __pyx_t_7 = __pyx_v_eN;
3770 __pyx_t_8 = __pyx_v_ebN_local;
3772 if (__pyx_t_7 < 0) {
3773 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3774 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3775 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
3776 if (__pyx_t_8 < 0) {
3777 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3778 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3779 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
3780 if (unlikely(__pyx_t_9 != -1)) {
3781 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3782 __PYX_ERR(0, 84, __pyx_L1_error)
3784 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3793 __pyx_t_8 = __pyx_v_ebN;
3796 if (__pyx_t_8 < 0) {
3797 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3798 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
3799 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3800 if (__pyx_t_7 < 0) {
3801 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3802 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
3803 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3804 if (unlikely(__pyx_t_9 != -1)) {
3805 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3806 __PYX_ERR(0, 85, __pyx_L1_error)
3808 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3817 __pyx_t_7 = __pyx_v_ebN;
3820 if (__pyx_t_7 < 0) {
3821 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3822 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3823 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3824 if (__pyx_t_8 < 0) {
3825 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3826 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3827 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3828 if (unlikely(__pyx_t_9 != -1)) {
3829 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3830 __PYX_ERR(0, 86, __pyx_L1_error)
3832 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3841 __pyx_t_10 = (__pyx_v_ebq_vals->dimensions[2]);
3842 __pyx_t_11 = __pyx_t_10;
3843 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
3844 __pyx_v_k = __pyx_t_9;
3853 if (unlikely(__pyx_v_material_functions == Py_None)) {
3854 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3855 __PYX_ERR(0, 88, __pyx_L1_error)
3857 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error)
3858 __Pyx_GOTREF(__pyx_t_12);
3859 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error)
3860 __Pyx_GOTREF(__pyx_t_13);
3861 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3870 if (unlikely(__pyx_v_material_functions == Py_None)) {
3871 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3872 __PYX_ERR(0, 89, __pyx_L1_error)
3874 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L1_error)
3875 __Pyx_GOTREF(__pyx_t_12);
3876 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 89, __pyx_L1_error)
3877 __Pyx_GOTREF(__pyx_t_14);
3878 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3887 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error)
3888 __Pyx_GOTREF(__pyx_t_12);
3889 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3890 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3891 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 88, __pyx_L1_error)
3892 __Pyx_GOTREF(__pyx_t_14);
3893 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3894 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3895 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3896 __pyx_t_8 = __pyx_v_eN;
3897 __pyx_t_7 = __pyx_v_ebN_local;
3898 __pyx_t_16 = __pyx_v_k;
3900 if (__pyx_t_8 < 0) {
3901 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3902 if (unlikely(__pyx_t_8 < 0)) __pyx_t_17 = 0;
3903 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_17 = 0;
3904 if (__pyx_t_7 < 0) {
3905 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3906 if (unlikely(__pyx_t_7 < 0)) __pyx_t_17 = 1;
3907 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_17 = 1;
3908 if (__pyx_t_16 < 0) {
3909 __pyx_t_16 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3910 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 2;
3911 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_17 = 2;
3912 if (unlikely(__pyx_t_17 != -1)) {
3913 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3914 __PYX_ERR(0, 88, __pyx_L1_error)
3916 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_15;
3930 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3933 __Pyx_XDECREF(__pyx_t_12);
3934 __Pyx_XDECREF(__pyx_t_13);
3935 __Pyx_XDECREF(__pyx_t_14);
3936 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3937 __Pyx_PyThreadState_declare
3938 __Pyx_PyThreadState_assign
3939 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3940 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3941 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3942 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3943 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3944 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3948 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3949 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3950 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3952 __Pyx_XGIVEREF(__pyx_r);
3953 __Pyx_RefNannyFinishContext();
3966 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3967 static char __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn} f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3968 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
3969 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3971 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3972 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3973 PyArrayObject *__pyx_v_ebq_vals = 0;
3974 PyObject *__pyx_v_material_functions = 0;
3975 int __pyx_lineno = 0;
3976 const char *__pyx_filename = NULL;
3977 int __pyx_clineno = 0;
3978 PyObject *__pyx_r = 0;
3979 __Pyx_RefNannyDeclarations
3980 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
3982 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3983 PyObject* values[5] = {0,0,0,0,0};
3984 if (unlikely(__pyx_kwds)) {
3986 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3988 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3990 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3992 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3994 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3996 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3999 default:
goto __pyx_L5_argtuple_error;
4001 kw_args = PyDict_Size(__pyx_kwds);
4004 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4005 else goto __pyx_L5_argtuple_error;
4008 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4010 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 91, __pyx_L3_error)
4014 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4016 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 91, __pyx_L3_error)
4020 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
4022 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 91, __pyx_L3_error)
4026 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4028 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 91, __pyx_L3_error)
4031 if (unlikely(kw_args > 0)) {
4032 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
4034 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4035 goto __pyx_L5_argtuple_error;
4037 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4038 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4039 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4040 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4041 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4043 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
4044 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4045 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4046 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
4047 __pyx_v_material_functions = ((PyObject*)values[4]);
4049 goto __pyx_L4_argument_unpacking_done;
4050 __pyx_L5_argtuple_error:;
4051 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
4053 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4054 __Pyx_RefNannyFinishContext();
4056 __pyx_L4_argument_unpacking_done:;
4057 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
4058 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
4059 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
4060 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 95, __pyx_L1_error)
4061 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
4068 __Pyx_RefNannyFinishContext();
4072 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
4075 int __pyx_v_ebN_local;
4077 int __pyx_v_material_left;
4078 int __pyx_v_material_right;
4081 double __pyx_v_numer;
4082 double __pyx_v_denom;
4083 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
4084 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
4085 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4086 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4087 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4088 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4089 PyObject *__pyx_r = NULL;
4090 __Pyx_RefNannyDeclarations
4097 Py_ssize_t __pyx_t_7;
4098 Py_ssize_t __pyx_t_8;
4100 npy_intp __pyx_t_10;
4101 npy_intp __pyx_t_11;
4108 PyObject *__pyx_t_18 = NULL;
4109 PyObject *__pyx_t_19 = NULL;
4110 PyObject *__pyx_t_20 = NULL;
4111 PyObject *__pyx_t_21 = NULL;
4112 PyObject *__pyx_t_22 = NULL;
4114 Py_ssize_t __pyx_t_24;
4115 Py_ssize_t __pyx_t_25;
4117 int __pyx_lineno = 0;
4118 const char *__pyx_filename = NULL;
4119 int __pyx_clineno = 0;
4120 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
4121 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4122 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4123 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4124 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4125 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4126 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4127 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4128 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4129 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
4130 __pyx_pybuffer_ebq_vals.refcount = 0;
4131 __pyx_pybuffernd_ebq_vals.data = NULL;
4132 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
4134 __Pyx_BufFmt_StackElem __pyx_stack[1];
4135 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4137 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4139 __Pyx_BufFmt_StackElem __pyx_stack[1];
4140 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4142 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4144 __Pyx_BufFmt_StackElem __pyx_stack[1];
4145 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4147 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
4156 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
4157 __pyx_t_2 = __pyx_t_1;
4158 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4159 __pyx_v_eN = __pyx_t_3;
4168 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
4169 __pyx_t_5 = __pyx_t_4;
4170 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4171 __pyx_v_ebN_local = __pyx_t_6;
4180 __pyx_t_7 = __pyx_v_eN;
4181 __pyx_t_8 = __pyx_v_ebN_local;
4183 if (__pyx_t_7 < 0) {
4184 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
4185 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
4186 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
4187 if (__pyx_t_8 < 0) {
4188 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
4189 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
4190 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
4191 if (unlikely(__pyx_t_9 != -1)) {
4192 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4193 __PYX_ERR(0, 108, __pyx_L1_error)
4195 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
4204 __pyx_t_8 = __pyx_v_ebN;
4207 if (__pyx_t_8 < 0) {
4208 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4209 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
4210 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4211 if (__pyx_t_7 < 0) {
4212 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4213 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
4214 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4215 if (unlikely(__pyx_t_9 != -1)) {
4216 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4217 __PYX_ERR(0, 109, __pyx_L1_error)
4219 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4228 __pyx_t_7 = __pyx_v_ebN;
4231 if (__pyx_t_7 < 0) {
4232 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4233 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
4234 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4235 if (__pyx_t_8 < 0) {
4236 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4237 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
4238 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4239 if (unlikely(__pyx_t_9 != -1)) {
4240 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4241 __PYX_ERR(0, 110, __pyx_L1_error)
4243 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4252 __pyx_t_10 = (__pyx_v_ebq_vals->dimensions[2]);
4253 __pyx_t_11 = __pyx_t_10;
4254 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
4255 __pyx_v_k = __pyx_t_9;
4264 __pyx_t_12 = __pyx_v_nd;
4265 __pyx_t_13 = __pyx_t_12;
4266 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
4267 __pyx_v_I = __pyx_t_14;
4276 __pyx_t_15 = __pyx_v_nd;
4277 __pyx_t_16 = __pyx_t_15;
4278 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
4279 __pyx_v_J = __pyx_t_17;
4288 if (unlikely(__pyx_v_material_functions == Py_None)) {
4289 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4290 __PYX_ERR(0, 114, __pyx_L1_error)
4292 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4293 __Pyx_GOTREF(__pyx_t_18);
4294 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
4295 __Pyx_GOTREF(__pyx_t_19);
4296 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4297 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4298 __Pyx_GOTREF(__pyx_t_18);
4299 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4300 __Pyx_GOTREF(__pyx_t_20);
4301 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
4302 __Pyx_GOTREF(__pyx_t_21);
4303 __Pyx_GIVEREF(__pyx_t_18);
4304 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
4305 __Pyx_GIVEREF(__pyx_t_20);
4306 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20);
4309 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4310 __Pyx_GOTREF(__pyx_t_20);
4311 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4312 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4313 __pyx_t_21 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
4314 __Pyx_GOTREF(__pyx_t_21);
4315 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4316 if (unlikely(__pyx_v_material_functions == Py_None)) {
4317 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4318 __PYX_ERR(0, 114, __pyx_L1_error)
4320 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4321 __Pyx_GOTREF(__pyx_t_20);
4322 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
4323 __Pyx_GOTREF(__pyx_t_19);
4324 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4325 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4326 __Pyx_GOTREF(__pyx_t_20);
4327 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4328 __Pyx_GOTREF(__pyx_t_18);
4329 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4330 __Pyx_GOTREF(__pyx_t_22);
4331 __Pyx_GIVEREF(__pyx_t_20);
4332 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20);
4333 __Pyx_GIVEREF(__pyx_t_18);
4334 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_18);
4337 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4338 __Pyx_GOTREF(__pyx_t_18);
4339 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4340 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4341 __pyx_t_22 = PyNumber_Multiply(__pyx_t_21, __pyx_t_18);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4342 __Pyx_GOTREF(__pyx_t_22);
4343 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4344 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4345 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_22);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4346 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4347 __pyx_v_numer = __pyx_t_23;
4356 if (unlikely(__pyx_v_material_functions == Py_None)) {
4357 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4358 __PYX_ERR(0, 115, __pyx_L1_error)
4360 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4361 __Pyx_GOTREF(__pyx_t_22);
4362 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
4363 __Pyx_GOTREF(__pyx_t_18);
4364 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4365 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4366 __Pyx_GOTREF(__pyx_t_22);
4367 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
4368 __Pyx_GOTREF(__pyx_t_21);
4369 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4370 __Pyx_GOTREF(__pyx_t_19);
4371 __Pyx_GIVEREF(__pyx_t_22);
4372 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_22);
4373 __Pyx_GIVEREF(__pyx_t_21);
4374 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
4377 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
4378 __Pyx_GOTREF(__pyx_t_21);
4379 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4380 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4381 if (unlikely(__pyx_v_material_functions == Py_None)) {
4382 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4383 __PYX_ERR(0, 115, __pyx_L1_error)
4385 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4386 __Pyx_GOTREF(__pyx_t_19);
4387 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
4388 __Pyx_GOTREF(__pyx_t_18);
4389 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4390 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4391 __Pyx_GOTREF(__pyx_t_19);
4392 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4393 __Pyx_GOTREF(__pyx_t_22);
4394 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
4395 __Pyx_GOTREF(__pyx_t_20);
4396 __Pyx_GIVEREF(__pyx_t_19);
4397 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
4398 __Pyx_GIVEREF(__pyx_t_22);
4399 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22);
4402 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_20);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4403 __Pyx_GOTREF(__pyx_t_22);
4404 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4405 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4406 __pyx_t_20 = PyNumber_Add(__pyx_t_21, __pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
4407 __Pyx_GOTREF(__pyx_t_20);
4408 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4409 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4410 __pyx_t_22 = __Pyx_PyFloat_AddObjC(__pyx_t_20, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4411 __Pyx_GOTREF(__pyx_t_22);
4412 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4413 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_22);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
4414 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4415 __pyx_v_denom = __pyx_t_23;
4424 if (unlikely(__pyx_v_denom == 0)) {
4425 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
4426 __PYX_ERR(0, 116, __pyx_L1_error)
4428 __pyx_t_8 = __pyx_v_eN;
4429 __pyx_t_7 = __pyx_v_ebN_local;
4430 __pyx_t_24 = __pyx_v_k;
4431 __pyx_t_25 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
4433 if (__pyx_t_8 < 0) {
4434 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
4435 if (unlikely(__pyx_t_8 < 0)) __pyx_t_26 = 0;
4436 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_26 = 0;
4437 if (__pyx_t_7 < 0) {
4438 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
4439 if (unlikely(__pyx_t_7 < 0)) __pyx_t_26 = 1;
4440 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_26 = 1;
4441 if (__pyx_t_24 < 0) {
4442 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
4443 if (unlikely(__pyx_t_24 < 0)) __pyx_t_26 = 2;
4444 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_26 = 2;
4445 if (__pyx_t_25 < 0) {
4446 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
4447 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 3;
4448 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_26 = 3;
4449 if (unlikely(__pyx_t_26 != -1)) {
4450 __Pyx_RaiseBufferIndexError(__pyx_t_26);
4451 __PYX_ERR(0, 116, __pyx_L1_error)
4453 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_25, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
4469 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4472 __Pyx_XDECREF(__pyx_t_18);
4473 __Pyx_XDECREF(__pyx_t_19);
4474 __Pyx_XDECREF(__pyx_t_20);
4475 __Pyx_XDECREF(__pyx_t_21);
4476 __Pyx_XDECREF(__pyx_t_22);
4477 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4478 __Pyx_PyThreadState_declare
4479 __Pyx_PyThreadState_assign
4480 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4481 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4482 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4483 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4484 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4485 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4489 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4490 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4491 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4493 __Pyx_XGIVEREF(__pyx_r);
4494 __Pyx_RefNannyFinishContext();
4507 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4508 static char __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4509 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
4510 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4511 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4512 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4513 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4514 PyObject *__pyx_v_material_functions = 0;
4515 int __pyx_lineno = 0;
4516 const char *__pyx_filename = NULL;
4517 int __pyx_clineno = 0;
4518 PyObject *__pyx_r = 0;
4519 __Pyx_RefNannyDeclarations
4520 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
4522 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4523 PyObject* values[4] = {0,0,0,0};
4524 if (unlikely(__pyx_kwds)) {
4526 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4528 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4530 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4532 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4534 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4537 default:
goto __pyx_L5_argtuple_error;
4539 kw_args = PyDict_Size(__pyx_kwds);
4542 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4543 else goto __pyx_L5_argtuple_error;
4546 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4548 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4552 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4554 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4558 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4560 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 118, __pyx_L3_error)
4563 if (unlikely(kw_args > 0)) {
4564 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4566 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4567 goto __pyx_L5_argtuple_error;
4569 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4570 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4571 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4572 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4574 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
4575 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
4576 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
4577 __pyx_v_material_functions = ((PyObject*)values[3]);
4579 goto __pyx_L4_argument_unpacking_done;
4580 __pyx_L5_argtuple_error:;
4581 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4583 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4584 __Pyx_RefNannyFinishContext();
4586 __pyx_L4_argument_unpacking_done:;
4587 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
4588 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
4589 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
4590 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
4591 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4598 __Pyx_RefNannyFinishContext();
4602 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4604 int __pyx_v_material_left;
4605 int __pyx_v_material_right;
4607 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4608 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4609 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4610 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4611 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4612 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4613 PyObject *__pyx_r = NULL;
4614 __Pyx_RefNannyDeclarations
4618 Py_ssize_t __pyx_t_4;
4619 Py_ssize_t __pyx_t_5;
4624 PyObject *__pyx_t_10 = NULL;
4625 PyObject *__pyx_t_11 = NULL;
4626 PyObject *__pyx_t_12 = NULL;
4627 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
4628 int __pyx_lineno = 0;
4629 const char *__pyx_filename = NULL;
4630 int __pyx_clineno = 0;
4631 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
4632 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4633 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4634 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4635 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4636 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4637 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4638 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4639 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4640 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4641 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4642 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4643 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4645 __Pyx_BufFmt_StackElem __pyx_stack[1];
4646 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4648 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4650 __Pyx_BufFmt_StackElem __pyx_stack[1];
4651 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4653 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4655 __Pyx_BufFmt_StackElem __pyx_stack[1];
4656 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4658 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
4667 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4668 __pyx_t_2 = __pyx_t_1;
4669 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4670 __pyx_v_ebN = __pyx_t_3;
4679 __pyx_t_4 = __pyx_v_ebN;
4682 if (__pyx_t_4 < 0) {
4683 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4684 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4685 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4686 if (__pyx_t_5 < 0) {
4687 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4688 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4689 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4690 if (unlikely(__pyx_t_6 != -1)) {
4691 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4692 __PYX_ERR(0, 132, __pyx_L1_error)
4694 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4703 __pyx_t_5 = __pyx_v_ebN;
4706 if (__pyx_t_5 < 0) {
4707 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4708 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4709 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4710 if (__pyx_t_4 < 0) {
4711 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4712 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
4713 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4714 if (unlikely(__pyx_t_6 != -1)) {
4715 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4716 __PYX_ERR(0, 133, __pyx_L1_error)
4718 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4727 __pyx_t_7 = (__pyx_v_ebq_global_vals->dimensions[1]);
4728 __pyx_t_8 = __pyx_t_7;
4729 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
4730 __pyx_v_k = __pyx_t_9;
4739 if (unlikely(__pyx_v_material_functions == Py_None)) {
4740 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4741 __PYX_ERR(0, 135, __pyx_L1_error)
4743 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4744 __Pyx_GOTREF(__pyx_t_10);
4745 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 135, __pyx_L1_error)
4746 __Pyx_GOTREF(__pyx_t_11);
4747 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4756 if (unlikely(__pyx_v_material_functions == Py_None)) {
4757 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4758 __PYX_ERR(0, 136, __pyx_L1_error)
4760 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 136, __pyx_L1_error)
4761 __Pyx_GOTREF(__pyx_t_10);
4762 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error)
4763 __Pyx_GOTREF(__pyx_t_12);
4764 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4773 __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4774 __Pyx_GOTREF(__pyx_t_10);
4775 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4776 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4777 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4778 __Pyx_GOTREF(__pyx_t_12);
4779 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4780 __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_13 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4781 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4782 __pyx_t_4 = __pyx_v_ebN;
4783 __pyx_t_5 = __pyx_v_k;
4785 if (__pyx_t_4 < 0) {
4786 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4787 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4788 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
4789 if (__pyx_t_5 < 0) {
4790 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4791 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4792 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
4793 if (unlikely(__pyx_t_6 != -1)) {
4794 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4795 __PYX_ERR(0, 135, __pyx_L1_error)
4797 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_13;
4810 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4813 __Pyx_XDECREF(__pyx_t_10);
4814 __Pyx_XDECREF(__pyx_t_11);
4815 __Pyx_XDECREF(__pyx_t_12);
4816 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4817 __Pyx_PyThreadState_declare
4818 __Pyx_PyThreadState_assign
4819 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4820 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4821 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4822 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4823 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4824 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4828 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4829 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4830 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4832 __Pyx_XGIVEREF(__pyx_r);
4833 __Pyx_RefNannyFinishContext();
4846 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4847 static char __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn}f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4848 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
4849 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4851 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4852 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4853 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4854 PyObject *__pyx_v_material_functions = 0;
4855 int __pyx_lineno = 0;
4856 const char *__pyx_filename = NULL;
4857 int __pyx_clineno = 0;
4858 PyObject *__pyx_r = 0;
4859 __Pyx_RefNannyDeclarations
4860 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
4862 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4863 PyObject* values[5] = {0,0,0,0,0};
4864 if (unlikely(__pyx_kwds)) {
4866 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4868 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4870 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4872 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4874 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4876 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4879 default:
goto __pyx_L5_argtuple_error;
4881 kw_args = PyDict_Size(__pyx_kwds);
4884 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4885 else goto __pyx_L5_argtuple_error;
4888 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4890 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 139, __pyx_L3_error)
4894 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4896 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 139, __pyx_L3_error)
4900 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4902 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 139, __pyx_L3_error)
4906 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4908 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 139, __pyx_L3_error)
4911 if (unlikely(kw_args > 0)) {
4912 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
4914 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4915 goto __pyx_L5_argtuple_error;
4917 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4918 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4919 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4920 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4921 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4923 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error)
4924 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4925 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4926 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
4927 __pyx_v_material_functions = ((PyObject*)values[4]);
4929 goto __pyx_L4_argument_unpacking_done;
4930 __pyx_L5_argtuple_error:;
4931 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error)
4933 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4934 __Pyx_RefNannyFinishContext();
4936 __pyx_L4_argument_unpacking_done:;
4937 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 140, __pyx_L1_error)
4938 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
4939 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 142, __pyx_L1_error)
4940 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 143, __pyx_L1_error)
4941 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4948 __Pyx_RefNannyFinishContext();
4952 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4955 int __pyx_v_material_left;
4956 int __pyx_v_material_right;
4959 double __pyx_v_numer;
4960 double __pyx_v_denom;
4961 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4962 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4963 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4964 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4965 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4966 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4967 PyObject *__pyx_r = NULL;
4968 __Pyx_RefNannyDeclarations
4972 Py_ssize_t __pyx_t_4;
4973 Py_ssize_t __pyx_t_5;
4983 PyObject *__pyx_t_15 = NULL;
4984 PyObject *__pyx_t_16 = NULL;
4985 PyObject *__pyx_t_17 = NULL;
4986 PyObject *__pyx_t_18 = NULL;
4987 PyObject *__pyx_t_19 = NULL;
4989 Py_ssize_t __pyx_t_21;
4991 int __pyx_lineno = 0;
4992 const char *__pyx_filename = NULL;
4993 int __pyx_clineno = 0;
4994 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
4995 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4996 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4997 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4998 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4999 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
5000 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
5001 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
5002 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
5003 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
5004 __pyx_pybuffer_ebq_global_vals.refcount = 0;
5005 __pyx_pybuffernd_ebq_global_vals.data = NULL;
5006 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
5008 __Pyx_BufFmt_StackElem __pyx_stack[1];
5009 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
5011 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
5013 __Pyx_BufFmt_StackElem __pyx_stack[1];
5014 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
5016 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
5018 __Pyx_BufFmt_StackElem __pyx_stack[1];
5019 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
5021 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
5030 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
5031 __pyx_t_2 = __pyx_t_1;
5032 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5033 __pyx_v_ebN = __pyx_t_3;
5042 __pyx_t_4 = __pyx_v_ebN;
5045 if (__pyx_t_4 < 0) {
5046 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
5047 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
5048 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
5049 if (__pyx_t_5 < 0) {
5050 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
5051 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
5052 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
5053 if (unlikely(__pyx_t_6 != -1)) {
5054 __Pyx_RaiseBufferIndexError(__pyx_t_6);
5055 __PYX_ERR(0, 155, __pyx_L1_error)
5057 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5066 __pyx_t_5 = __pyx_v_ebN;
5069 if (__pyx_t_5 < 0) {
5070 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
5071 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
5072 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
5073 if (__pyx_t_4 < 0) {
5074 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
5075 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
5076 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
5077 if (unlikely(__pyx_t_6 != -1)) {
5078 __Pyx_RaiseBufferIndexError(__pyx_t_6);
5079 __PYX_ERR(0, 156, __pyx_L1_error)
5081 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5090 __pyx_t_7 = (__pyx_v_ebq_global_vals->dimensions[1]);
5091 __pyx_t_8 = __pyx_t_7;
5092 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
5093 __pyx_v_k = __pyx_t_6;
5102 __pyx_t_9 = __pyx_v_nd;
5103 __pyx_t_10 = __pyx_t_9;
5104 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5105 __pyx_v_I = __pyx_t_11;
5114 __pyx_t_12 = __pyx_v_nd;
5115 __pyx_t_13 = __pyx_t_12;
5116 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5117 __pyx_v_J = __pyx_t_14;
5126 if (unlikely(__pyx_v_material_functions == Py_None)) {
5127 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5128 __PYX_ERR(0, 160, __pyx_L1_error)
5130 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5131 __Pyx_GOTREF(__pyx_t_15);
5132 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
5133 __Pyx_GOTREF(__pyx_t_16);
5134 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5135 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5136 __Pyx_GOTREF(__pyx_t_15);
5137 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5138 __Pyx_GOTREF(__pyx_t_17);
5139 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5140 __Pyx_GOTREF(__pyx_t_18);
5141 __Pyx_GIVEREF(__pyx_t_15);
5142 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_15);
5143 __Pyx_GIVEREF(__pyx_t_17);
5144 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_17);
5147 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5148 __Pyx_GOTREF(__pyx_t_17);
5149 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5150 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5151 __pyx_t_18 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5152 __Pyx_GOTREF(__pyx_t_18);
5153 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5154 if (unlikely(__pyx_v_material_functions == Py_None)) {
5155 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5156 __PYX_ERR(0, 160, __pyx_L1_error)
5158 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5159 __Pyx_GOTREF(__pyx_t_17);
5160 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
5161 __Pyx_GOTREF(__pyx_t_16);
5162 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5163 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5164 __Pyx_GOTREF(__pyx_t_17);
5165 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5166 __Pyx_GOTREF(__pyx_t_15);
5167 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5168 __Pyx_GOTREF(__pyx_t_19);
5169 __Pyx_GIVEREF(__pyx_t_17);
5170 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17);
5171 __Pyx_GIVEREF(__pyx_t_15);
5172 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_15);
5175 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5176 __Pyx_GOTREF(__pyx_t_15);
5177 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5178 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5179 __pyx_t_19 = PyNumber_Multiply(__pyx_t_18, __pyx_t_15);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5180 __Pyx_GOTREF(__pyx_t_19);
5181 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5182 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5183 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_19);
if (unlikely((__pyx_t_20 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
5184 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5185 __pyx_v_numer = __pyx_t_20;
5194 if (unlikely(__pyx_v_material_functions == Py_None)) {
5195 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5196 __PYX_ERR(0, 161, __pyx_L1_error)
5198 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5199 __Pyx_GOTREF(__pyx_t_19);
5200 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
5201 __Pyx_GOTREF(__pyx_t_15);
5202 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5203 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5204 __Pyx_GOTREF(__pyx_t_19);
5205 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5206 __Pyx_GOTREF(__pyx_t_18);
5207 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5208 __Pyx_GOTREF(__pyx_t_16);
5209 __Pyx_GIVEREF(__pyx_t_19);
5210 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_19);
5211 __Pyx_GIVEREF(__pyx_t_18);
5212 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18);
5215 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5216 __Pyx_GOTREF(__pyx_t_18);
5217 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5218 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5219 if (unlikely(__pyx_v_material_functions == Py_None)) {
5220 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5221 __PYX_ERR(0, 161, __pyx_L1_error)
5223 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5224 __Pyx_GOTREF(__pyx_t_16);
5225 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
5226 __Pyx_GOTREF(__pyx_t_15);
5227 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5228 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5229 __Pyx_GOTREF(__pyx_t_16);
5230 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5231 __Pyx_GOTREF(__pyx_t_19);
5232 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5233 __Pyx_GOTREF(__pyx_t_17);
5234 __Pyx_GIVEREF(__pyx_t_16);
5235 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16);
5236 __Pyx_GIVEREF(__pyx_t_19);
5237 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_19);
5240 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_17);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5241 __Pyx_GOTREF(__pyx_t_19);
5242 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5243 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5244 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5245 __Pyx_GOTREF(__pyx_t_17);
5246 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5247 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5248 __pyx_t_19 = __Pyx_PyFloat_AddObjC(__pyx_t_17, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5249 __Pyx_GOTREF(__pyx_t_19);
5250 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5251 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_19);
if (unlikely((__pyx_t_20 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5252 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5253 __pyx_v_denom = __pyx_t_20;
5262 if (unlikely(__pyx_v_denom == 0)) {
5263 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
5264 __PYX_ERR(0, 162, __pyx_L1_error)
5266 __pyx_t_4 = __pyx_v_ebN;
5267 __pyx_t_5 = __pyx_v_k;
5268 __pyx_t_21 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
5270 if (__pyx_t_4 < 0) {
5271 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
5272 if (unlikely(__pyx_t_4 < 0)) __pyx_t_22 = 0;
5273 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
5274 if (__pyx_t_5 < 0) {
5275 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
5276 if (unlikely(__pyx_t_5 < 0)) __pyx_t_22 = 1;
5277 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
5278 if (__pyx_t_21 < 0) {
5279 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
5280 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 2;
5281 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
5282 if (unlikely(__pyx_t_22 != -1)) {
5283 __Pyx_RaiseBufferIndexError(__pyx_t_22);
5284 __PYX_ERR(0, 162, __pyx_L1_error)
5286 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
5301 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5304 __Pyx_XDECREF(__pyx_t_15);
5305 __Pyx_XDECREF(__pyx_t_16);
5306 __Pyx_XDECREF(__pyx_t_17);
5307 __Pyx_XDECREF(__pyx_t_18);
5308 __Pyx_XDECREF(__pyx_t_19);
5309 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5310 __Pyx_PyThreadState_declare
5311 __Pyx_PyThreadState_assign
5312 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5313 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5314 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5315 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5316 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5317 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5321 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5322 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5323 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5325 __Pyx_XGIVEREF(__pyx_r);
5326 __Pyx_RefNannyFinishContext();
5339 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5340 static char __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function f_j(x,t) assuming element is material j\n likely little improvement right now without correct typing of material_functions\n ";
5341 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {
"evaluateScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
5342 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5344 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5345 PyArrayObject *__pyx_v_x = 0;
5346 PyArrayObject *__pyx_v_q_vals = 0;
5347 PyObject *__pyx_v_material_functions = 0;
5348 int __pyx_lineno = 0;
5349 const char *__pyx_filename = NULL;
5350 int __pyx_clineno = 0;
5351 PyObject *__pyx_r = 0;
5352 __Pyx_RefNannyDeclarations
5353 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
5355 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5356 PyObject* values[5] = {0,0,0,0,0};
5357 if (unlikely(__pyx_kwds)) {
5359 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5361 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5363 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5365 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5367 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5369 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5372 default:
goto __pyx_L5_argtuple_error;
5374 kw_args = PyDict_Size(__pyx_kwds);
5377 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5378 else goto __pyx_L5_argtuple_error;
5381 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5383 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 165, __pyx_L3_error)
5387 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5389 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 165, __pyx_L3_error)
5393 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5395 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 165, __pyx_L3_error)
5399 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5401 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 165, __pyx_L3_error)
5404 if (unlikely(kw_args > 0)) {
5405 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
5407 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5408 goto __pyx_L5_argtuple_error;
5410 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5411 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5412 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5413 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5414 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5416 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L3_error)
5417 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5418 __pyx_v_x = ((PyArrayObject *)values[2]);
5419 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5420 __pyx_v_material_functions = ((PyObject*)values[4]);
5422 goto __pyx_L4_argument_unpacking_done;
5423 __pyx_L5_argtuple_error:;
5424 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
5426 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5427 __Pyx_RefNannyFinishContext();
5429 __pyx_L4_argument_unpacking_done:;
5430 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 166, __pyx_L1_error)
5431 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
5432 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
5433 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 169, __pyx_L1_error)
5434 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5441 __Pyx_RefNannyFinishContext();
5445 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5448 int __pyx_v_material;
5449 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5450 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5451 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5452 __Pyx_Buffer __pyx_pybuffer_q_vals;
5453 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5454 __Pyx_Buffer __pyx_pybuffer_x;
5455 PyObject *__pyx_r = NULL;
5456 __Pyx_RefNannyDeclarations
5460 Py_ssize_t __pyx_t_4;
5464 PyObject *__pyx_t_8 = NULL;
5465 PyObject *__pyx_t_9 = NULL;
5466 PyObject *__pyx_t_10 = NULL;
5467 PyObject *__pyx_t_11 = NULL;
5468 PyObject *__pyx_t_12 = NULL;
5470 PyObject *__pyx_t_14 = NULL;
5471 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
5472 Py_ssize_t __pyx_t_16;
5473 int __pyx_lineno = 0;
5474 const char *__pyx_filename = NULL;
5475 int __pyx_clineno = 0;
5476 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements", 0);
5477 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5478 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5479 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5480 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5481 __pyx_pybuffer_x.pybuffer.buf = NULL;
5482 __pyx_pybuffer_x.refcount = 0;
5483 __pyx_pybuffernd_x.data = NULL;
5484 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5485 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5486 __pyx_pybuffer_q_vals.refcount = 0;
5487 __pyx_pybuffernd_q_vals.data = NULL;
5488 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5490 __Pyx_BufFmt_StackElem __pyx_stack[1];
5491 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5493 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5495 __Pyx_BufFmt_StackElem __pyx_stack[1];
5496 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5498 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5500 __Pyx_BufFmt_StackElem __pyx_stack[1];
5501 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5503 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
5512 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5513 __pyx_t_2 = __pyx_t_1;
5514 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5515 __pyx_v_eN = __pyx_t_3;
5524 __pyx_t_4 = __pyx_v_eN;
5526 if (__pyx_t_4 < 0) {
5527 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5528 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5529 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5530 if (unlikely(__pyx_t_5 != -1)) {
5531 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5532 __PYX_ERR(0, 176, __pyx_L1_error)
5534 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5543 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5544 __pyx_t_7 = __pyx_t_6;
5545 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5546 __pyx_v_k = __pyx_t_5;
5555 if (unlikely(__pyx_v_material_functions == Py_None)) {
5556 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5557 __PYX_ERR(0, 178, __pyx_L1_error)
5559 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5560 __Pyx_GOTREF(__pyx_t_9);
5561 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
5562 __Pyx_GOTREF(__pyx_t_10);
5563 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5564 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5565 __Pyx_GOTREF(__pyx_t_9);
5566 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5567 __Pyx_GOTREF(__pyx_t_11);
5568 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5569 __Pyx_GOTREF(__pyx_t_12);
5570 __Pyx_GIVEREF(__pyx_t_9);
5571 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5572 __Pyx_GIVEREF(__pyx_t_11);
5573 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5576 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5577 __Pyx_GOTREF(__pyx_t_11);
5578 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5579 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5580 __Pyx_GOTREF(__pyx_t_12);
5583 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5584 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5585 if (likely(__pyx_t_9)) {
5586 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5587 __Pyx_INCREF(__pyx_t_9);
5588 __Pyx_INCREF(
function);
5589 __Pyx_DECREF_SET(__pyx_t_10,
function);
5593 #if CYTHON_FAST_PYCALL
5594 if (PyFunction_Check(__pyx_t_10)) {
5595 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5596 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5597 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5598 __Pyx_GOTREF(__pyx_t_8);
5599 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5600 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5603 #if CYTHON_FAST_PYCCALL
5604 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5605 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5606 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5607 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5608 __Pyx_GOTREF(__pyx_t_8);
5609 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5610 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5614 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 178, __pyx_L1_error)
5615 __Pyx_GOTREF(__pyx_t_14);
5617 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5619 __Pyx_GIVEREF(__pyx_t_11);
5620 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5621 __Pyx_GIVEREF(__pyx_t_12);
5622 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5625 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5626 __Pyx_GOTREF(__pyx_t_8);
5627 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5629 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5630 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5631 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5632 __pyx_t_4 = __pyx_v_eN;
5633 __pyx_t_16 = __pyx_v_k;
5635 if (__pyx_t_4 < 0) {
5636 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
5637 if (unlikely(__pyx_t_4 < 0)) __pyx_t_13 = 0;
5638 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_13 = 0;
5639 if (__pyx_t_16 < 0) {
5640 __pyx_t_16 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
5641 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 1;
5642 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_13 = 1;
5643 if (unlikely(__pyx_t_13 != -1)) {
5644 __Pyx_RaiseBufferIndexError(__pyx_t_13);
5645 __PYX_ERR(0, 178, __pyx_L1_error)
5647 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_15;
5660 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5663 __Pyx_XDECREF(__pyx_t_8);
5664 __Pyx_XDECREF(__pyx_t_9);
5665 __Pyx_XDECREF(__pyx_t_10);
5666 __Pyx_XDECREF(__pyx_t_11);
5667 __Pyx_XDECREF(__pyx_t_12);
5668 __Pyx_XDECREF(__pyx_t_14);
5669 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5670 __Pyx_PyThreadState_declare
5671 __Pyx_PyThreadState_assign
5672 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5673 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5674 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5675 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5676 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5677 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5681 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5682 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5683 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5685 __Pyx_XGIVEREF(__pyx_r);
5686 __Pyx_RefNannyFinishContext();
5699 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5700 static char __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ";
5701 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {
"evaluateVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
5702 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5704 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5705 PyArrayObject *__pyx_v_x = 0;
5706 PyArrayObject *__pyx_v_q_vals = 0;
5707 PyObject *__pyx_v_material_functions = 0;
5708 int __pyx_lineno = 0;
5709 const char *__pyx_filename = NULL;
5710 int __pyx_clineno = 0;
5711 PyObject *__pyx_r = 0;
5712 __Pyx_RefNannyDeclarations
5713 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
5715 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5716 PyObject* values[5] = {0,0,0,0,0};
5717 if (unlikely(__pyx_kwds)) {
5719 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5721 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5723 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5725 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5727 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5729 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5732 default:
goto __pyx_L5_argtuple_error;
5734 kw_args = PyDict_Size(__pyx_kwds);
5737 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5738 else goto __pyx_L5_argtuple_error;
5741 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5743 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error)
5747 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5749 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error)
5753 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5755 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error)
5759 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5761 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error)
5764 if (unlikely(kw_args > 0)) {
5765 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 180, __pyx_L3_error)
5767 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5768 goto __pyx_L5_argtuple_error;
5770 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5771 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5772 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5773 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5774 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5776 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error)
5777 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5778 __pyx_v_x = ((PyArrayObject *)values[2]);
5779 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5780 __pyx_v_material_functions = ((PyObject*)values[4]);
5782 goto __pyx_L4_argument_unpacking_done;
5783 __pyx_L5_argtuple_error:;
5784 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
5786 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5787 __Pyx_RefNannyFinishContext();
5789 __pyx_L4_argument_unpacking_done:;
5790 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
5791 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
5792 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
5793 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 184, __pyx_L1_error)
5794 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5801 __Pyx_RefNannyFinishContext();
5805 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5808 int __pyx_v_material;
5809 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5810 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5811 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5812 __Pyx_Buffer __pyx_pybuffer_q_vals;
5813 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5814 __Pyx_Buffer __pyx_pybuffer_x;
5815 PyObject *__pyx_r = NULL;
5816 __Pyx_RefNannyDeclarations
5820 Py_ssize_t __pyx_t_4;
5824 PyObject *__pyx_t_8 = NULL;
5825 PyObject *__pyx_t_9 = NULL;
5826 PyObject *__pyx_t_10 = NULL;
5827 PyObject *__pyx_t_11 = NULL;
5828 PyObject *__pyx_t_12 = NULL;
5830 PyObject *__pyx_t_14 = NULL;
5831 int __pyx_lineno = 0;
5832 const char *__pyx_filename = NULL;
5833 int __pyx_clineno = 0;
5834 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements", 0);
5835 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5836 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5837 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5838 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5839 __pyx_pybuffer_x.pybuffer.buf = NULL;
5840 __pyx_pybuffer_x.refcount = 0;
5841 __pyx_pybuffernd_x.data = NULL;
5842 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5843 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5844 __pyx_pybuffer_q_vals.refcount = 0;
5845 __pyx_pybuffernd_q_vals.data = NULL;
5846 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5848 __Pyx_BufFmt_StackElem __pyx_stack[1];
5849 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5851 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5853 __Pyx_BufFmt_StackElem __pyx_stack[1];
5854 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5856 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5858 __Pyx_BufFmt_StackElem __pyx_stack[1];
5859 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5861 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
5870 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5871 __pyx_t_2 = __pyx_t_1;
5872 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5873 __pyx_v_eN = __pyx_t_3;
5882 __pyx_t_4 = __pyx_v_eN;
5884 if (__pyx_t_4 < 0) {
5885 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5886 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5887 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5888 if (unlikely(__pyx_t_5 != -1)) {
5889 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5890 __PYX_ERR(0, 190, __pyx_L1_error)
5892 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5901 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5902 __pyx_t_7 = __pyx_t_6;
5903 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5904 __pyx_v_k = __pyx_t_5;
5913 if (unlikely(__pyx_v_material_functions == Py_None)) {
5914 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5915 __PYX_ERR(0, 192, __pyx_L1_error)
5917 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5918 __Pyx_GOTREF(__pyx_t_9);
5919 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_10);
5921 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5922 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5923 __Pyx_GOTREF(__pyx_t_9);
5924 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5925 __Pyx_GOTREF(__pyx_t_11);
5926 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5927 __Pyx_GOTREF(__pyx_t_12);
5928 __Pyx_GIVEREF(__pyx_t_9);
5929 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5930 __Pyx_GIVEREF(__pyx_t_11);
5931 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5934 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5935 __Pyx_GOTREF(__pyx_t_11);
5936 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5937 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5938 __Pyx_GOTREF(__pyx_t_12);
5941 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5942 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5943 if (likely(__pyx_t_9)) {
5944 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5945 __Pyx_INCREF(__pyx_t_9);
5946 __Pyx_INCREF(
function);
5947 __Pyx_DECREF_SET(__pyx_t_10,
function);
5951 #if CYTHON_FAST_PYCALL
5952 if (PyFunction_Check(__pyx_t_10)) {
5953 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5954 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5955 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5956 __Pyx_GOTREF(__pyx_t_8);
5957 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5958 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5961 #if CYTHON_FAST_PYCCALL
5962 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5963 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5964 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5965 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5966 __Pyx_GOTREF(__pyx_t_8);
5967 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5968 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5972 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5973 __Pyx_GOTREF(__pyx_t_14);
5975 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5977 __Pyx_GIVEREF(__pyx_t_11);
5978 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5979 __Pyx_GIVEREF(__pyx_t_12);
5980 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5983 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5984 __Pyx_GOTREF(__pyx_t_8);
5985 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5987 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5988 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5989 __Pyx_GOTREF(__pyx_t_10);
5990 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5991 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5992 __Pyx_GOTREF(__pyx_t_8);
5993 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5994 __Pyx_GOTREF(__pyx_t_14);
5995 __pyx_t_12 = PyTuple_New(3);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5996 __Pyx_GOTREF(__pyx_t_12);
5997 __Pyx_GIVEREF(__pyx_t_8);
5998 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
5999 __Pyx_GIVEREF(__pyx_t_14);
6000 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
6001 __Pyx_INCREF(__pyx_slice_);
6002 __Pyx_GIVEREF(__pyx_slice_);
6003 PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_slice_);
6006 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_12, __pyx_t_10) < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
6007 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6008 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6021 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6024 __Pyx_XDECREF(__pyx_t_8);
6025 __Pyx_XDECREF(__pyx_t_9);
6026 __Pyx_XDECREF(__pyx_t_10);
6027 __Pyx_XDECREF(__pyx_t_11);
6028 __Pyx_XDECREF(__pyx_t_12);
6029 __Pyx_XDECREF(__pyx_t_14);
6030 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6031 __Pyx_PyThreadState_declare
6032 __Pyx_PyThreadState_assign
6033 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6034 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
6035 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
6036 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6037 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6038 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
6042 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
6043 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
6044 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6046 __Pyx_XGIVEREF(__pyx_r);
6047 __Pyx_RefNannyFinishContext();
6060 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6061 static char __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6062 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
6063 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6065 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6066 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6067 PyArrayObject *__pyx_v_x = 0;
6068 PyArrayObject *__pyx_v_ebq_vals = 0;
6069 PyObject *__pyx_v_material_functions = 0;
6070 int __pyx_lineno = 0;
6071 const char *__pyx_filename = NULL;
6072 int __pyx_clineno = 0;
6073 PyObject *__pyx_r = 0;
6074 __Pyx_RefNannyDeclarations
6075 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
6077 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
6078 PyObject* values[6] = {0,0,0,0,0,0};
6079 if (unlikely(__pyx_kwds)) {
6081 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6083 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6085 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6087 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6089 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6091 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6093 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6096 default:
goto __pyx_L5_argtuple_error;
6098 kw_args = PyDict_Size(__pyx_kwds);
6101 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6102 else goto __pyx_L5_argtuple_error;
6105 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6107 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 195, __pyx_L3_error)
6111 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6113 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 195, __pyx_L3_error)
6117 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6119 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 195, __pyx_L3_error)
6123 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6125 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 195, __pyx_L3_error)
6129 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6131 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 195, __pyx_L3_error)
6134 if (unlikely(kw_args > 0)) {
6135 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
6137 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6138 goto __pyx_L5_argtuple_error;
6140 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6141 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6142 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6143 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6144 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6145 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6147 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
6148 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
6149 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
6150 __pyx_v_x = ((PyArrayObject *)values[3]);
6151 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
6152 __pyx_v_material_functions = ((PyObject*)values[5]);
6154 goto __pyx_L4_argument_unpacking_done;
6155 __pyx_L5_argtuple_error:;
6156 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
6158 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6159 __Pyx_RefNannyFinishContext();
6161 __pyx_L4_argument_unpacking_done:;
6162 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
6163 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
6164 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
6165 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
6166 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 200, __pyx_L1_error)
6167 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6174 __Pyx_RefNannyFinishContext();
6178 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6181 int __pyx_v_ebN_local;
6183 int __pyx_v_material_left;
6184 int __pyx_v_material_right;
6185 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6186 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6187 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6188 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6189 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6190 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6191 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6192 __Pyx_Buffer __pyx_pybuffer_x;
6193 PyObject *__pyx_r = NULL;
6194 __Pyx_RefNannyDeclarations
6201 Py_ssize_t __pyx_t_7;
6202 Py_ssize_t __pyx_t_8;
6204 npy_intp __pyx_t_10;
6205 npy_intp __pyx_t_11;
6206 PyObject *__pyx_t_12 = NULL;
6207 PyObject *__pyx_t_13 = NULL;
6208 PyObject *__pyx_t_14 = NULL;
6209 PyObject *__pyx_t_15 = NULL;
6210 PyObject *__pyx_t_16 = NULL;
6211 PyObject *__pyx_t_17 = NULL;
6213 PyObject *__pyx_t_19 = NULL;
6214 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
6215 Py_ssize_t __pyx_t_21;
6216 int __pyx_lineno = 0;
6217 const char *__pyx_filename = NULL;
6218 int __pyx_clineno = 0;
6219 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
6220 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6221 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6222 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6223 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6224 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6225 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6226 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6227 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6228 __pyx_pybuffer_x.pybuffer.buf = NULL;
6229 __pyx_pybuffer_x.refcount = 0;
6230 __pyx_pybuffernd_x.data = NULL;
6231 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6232 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6233 __pyx_pybuffer_ebq_vals.refcount = 0;
6234 __pyx_pybuffernd_ebq_vals.data = NULL;
6235 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6237 __Pyx_BufFmt_StackElem __pyx_stack[1];
6238 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6240 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6242 __Pyx_BufFmt_StackElem __pyx_stack[1];
6243 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6245 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6247 __Pyx_BufFmt_StackElem __pyx_stack[1];
6248 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6250 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6252 __Pyx_BufFmt_StackElem __pyx_stack[1];
6253 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6255 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
6264 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6265 __pyx_t_2 = __pyx_t_1;
6266 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6267 __pyx_v_eN = __pyx_t_3;
6276 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6277 __pyx_t_5 = __pyx_t_4;
6278 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6279 __pyx_v_ebN_local = __pyx_t_6;
6288 __pyx_t_7 = __pyx_v_eN;
6289 __pyx_t_8 = __pyx_v_ebN_local;
6291 if (__pyx_t_7 < 0) {
6292 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6293 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6294 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6295 if (__pyx_t_8 < 0) {
6296 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6297 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6298 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6299 if (unlikely(__pyx_t_9 != -1)) {
6300 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6301 __PYX_ERR(0, 212, __pyx_L1_error)
6303 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6312 __pyx_t_8 = __pyx_v_ebN;
6315 if (__pyx_t_8 < 0) {
6316 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6317 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
6318 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6319 if (__pyx_t_7 < 0) {
6320 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6321 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
6322 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6323 if (unlikely(__pyx_t_9 != -1)) {
6324 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6325 __PYX_ERR(0, 213, __pyx_L1_error)
6327 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6336 __pyx_t_7 = __pyx_v_ebN;
6339 if (__pyx_t_7 < 0) {
6340 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6341 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6342 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6343 if (__pyx_t_8 < 0) {
6344 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6345 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6346 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6347 if (unlikely(__pyx_t_9 != -1)) {
6348 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6349 __PYX_ERR(0, 214, __pyx_L1_error)
6351 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6360 __pyx_t_10 = (__pyx_v_x->dimensions[2]);
6361 __pyx_t_11 = __pyx_t_10;
6362 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
6363 __pyx_v_k = __pyx_t_9;
6372 if (unlikely(__pyx_v_material_functions == Py_None)) {
6373 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6374 __PYX_ERR(0, 216, __pyx_L1_error)
6376 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6377 __Pyx_GOTREF(__pyx_t_13);
6378 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
6379 __Pyx_GOTREF(__pyx_t_14);
6380 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6381 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6382 __Pyx_GOTREF(__pyx_t_13);
6383 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 216, __pyx_L1_error)
6384 __Pyx_GOTREF(__pyx_t_15);
6385 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6386 __Pyx_GOTREF(__pyx_t_16);
6387 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6388 __Pyx_GOTREF(__pyx_t_17);
6389 __Pyx_GIVEREF(__pyx_t_13);
6390 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13);
6391 __Pyx_GIVEREF(__pyx_t_15);
6392 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_15);
6393 __Pyx_GIVEREF(__pyx_t_16);
6394 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_16);
6398 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6399 __Pyx_GOTREF(__pyx_t_16);
6400 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6401 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6402 __Pyx_GOTREF(__pyx_t_17);
6405 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
6406 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
6407 if (likely(__pyx_t_15)) {
6408 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
6409 __Pyx_INCREF(__pyx_t_15);
6410 __Pyx_INCREF(
function);
6411 __Pyx_DECREF_SET(__pyx_t_14,
function);
6415 #if CYTHON_FAST_PYCALL
6416 if (PyFunction_Check(__pyx_t_14)) {
6417 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_t_17};
6418 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6419 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6420 __Pyx_GOTREF(__pyx_t_12);
6421 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6422 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6425 #if CYTHON_FAST_PYCCALL
6426 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
6427 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_t_17};
6428 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6429 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6430 __Pyx_GOTREF(__pyx_t_12);
6431 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6432 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6436 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6437 __Pyx_GOTREF(__pyx_t_13);
6439 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15); __pyx_t_15 = NULL;
6441 __Pyx_GIVEREF(__pyx_t_16);
6442 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_16);
6443 __Pyx_GIVEREF(__pyx_t_17);
6444 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_17);
6447 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6448 __Pyx_GOTREF(__pyx_t_12);
6449 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6451 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6460 if (unlikely(__pyx_v_material_functions == Py_None)) {
6461 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6462 __PYX_ERR(0, 217, __pyx_L1_error)
6464 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6465 __Pyx_GOTREF(__pyx_t_13);
6466 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6467 __Pyx_GOTREF(__pyx_t_17);
6468 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6469 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6470 __Pyx_GOTREF(__pyx_t_13);
6471 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
6472 __Pyx_GOTREF(__pyx_t_16);
6473 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
6474 __Pyx_GOTREF(__pyx_t_15);
6475 __pyx_t_19 = PyTuple_New(3);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6476 __Pyx_GOTREF(__pyx_t_19);
6477 __Pyx_GIVEREF(__pyx_t_13);
6478 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_13);
6479 __Pyx_GIVEREF(__pyx_t_16);
6480 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_16);
6481 __Pyx_GIVEREF(__pyx_t_15);
6482 PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_15);
6486 __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
6487 __Pyx_GOTREF(__pyx_t_15);
6488 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6489 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6490 __Pyx_GOTREF(__pyx_t_19);
6493 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
6494 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
6495 if (likely(__pyx_t_16)) {
6496 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
6497 __Pyx_INCREF(__pyx_t_16);
6498 __Pyx_INCREF(
function);
6499 __Pyx_DECREF_SET(__pyx_t_17,
function);
6503 #if CYTHON_FAST_PYCALL
6504 if (PyFunction_Check(__pyx_t_17)) {
6505 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_15, __pyx_t_19};
6506 __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6507 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6508 __Pyx_GOTREF(__pyx_t_14);
6509 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6510 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6513 #if CYTHON_FAST_PYCCALL
6514 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
6515 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_15, __pyx_t_19};
6516 __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6517 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6518 __Pyx_GOTREF(__pyx_t_14);
6519 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6520 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6524 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6525 __Pyx_GOTREF(__pyx_t_13);
6527 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_16); __pyx_t_16 = NULL;
6529 __Pyx_GIVEREF(__pyx_t_15);
6530 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_15);
6531 __Pyx_GIVEREF(__pyx_t_19);
6532 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_19);
6535 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6536 __Pyx_GOTREF(__pyx_t_14);
6537 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6539 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6548 __pyx_t_17 = PyNumber_Add(__pyx_t_12, __pyx_t_14);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6549 __Pyx_GOTREF(__pyx_t_17);
6550 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6551 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6552 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_17);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
6553 __Pyx_GOTREF(__pyx_t_14);
6554 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6555 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_20 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
6556 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6557 __pyx_t_8 = __pyx_v_eN;
6558 __pyx_t_7 = __pyx_v_ebN_local;
6559 __pyx_t_21 = __pyx_v_k;
6561 if (__pyx_t_8 < 0) {
6562 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6563 if (unlikely(__pyx_t_8 < 0)) __pyx_t_18 = 0;
6564 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_18 = 0;
6565 if (__pyx_t_7 < 0) {
6566 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6567 if (unlikely(__pyx_t_7 < 0)) __pyx_t_18 = 1;
6568 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_18 = 1;
6569 if (__pyx_t_21 < 0) {
6570 __pyx_t_21 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6571 if (unlikely(__pyx_t_21 < 0)) __pyx_t_18 = 2;
6572 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_18 = 2;
6573 if (unlikely(__pyx_t_18 != -1)) {
6574 __Pyx_RaiseBufferIndexError(__pyx_t_18);
6575 __PYX_ERR(0, 216, __pyx_L1_error)
6577 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_20;
6591 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6594 __Pyx_XDECREF(__pyx_t_12);
6595 __Pyx_XDECREF(__pyx_t_13);
6596 __Pyx_XDECREF(__pyx_t_14);
6597 __Pyx_XDECREF(__pyx_t_15);
6598 __Pyx_XDECREF(__pyx_t_16);
6599 __Pyx_XDECREF(__pyx_t_17);
6600 __Pyx_XDECREF(__pyx_t_19);
6601 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6602 __Pyx_PyThreadState_declare
6603 __Pyx_PyThreadState_assign
6604 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6605 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6606 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6607 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6608 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6609 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6610 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6614 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6615 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6616 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6617 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6619 __Pyx_XGIVEREF(__pyx_r);
6620 __Pyx_RefNannyFinishContext();
6633 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6634 static char __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6635 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
6636 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6639 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6640 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6641 PyArrayObject *__pyx_v_x = 0;
6642 PyArrayObject *__pyx_v_ebq_vals = 0;
6643 PyObject *__pyx_v_material_functions = 0;
6644 int __pyx_lineno = 0;
6645 const char *__pyx_filename = NULL;
6646 int __pyx_clineno = 0;
6647 PyObject *__pyx_r = 0;
6648 __Pyx_RefNannyDeclarations
6649 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
6651 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
6652 PyObject* values[7] = {0,0,0,0,0,0,0};
6653 if (unlikely(__pyx_kwds)) {
6655 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6657 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6659 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6661 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6663 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6665 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6667 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6669 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6672 default:
goto __pyx_L5_argtuple_error;
6674 kw_args = PyDict_Size(__pyx_kwds);
6677 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
6678 else goto __pyx_L5_argtuple_error;
6681 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6683 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 219, __pyx_L3_error)
6687 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6689 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 219, __pyx_L3_error)
6693 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6695 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 219, __pyx_L3_error)
6699 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6701 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 219, __pyx_L3_error)
6705 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6707 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 219, __pyx_L3_error)
6711 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6713 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 219, __pyx_L3_error)
6716 if (unlikely(kw_args > 0)) {
6717 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
6719 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
6720 goto __pyx_L5_argtuple_error;
6722 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6723 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6724 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6725 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6726 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6727 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6728 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6730 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L3_error)
6731 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
6732 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
6733 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
6734 __pyx_v_x = ((PyArrayObject *)values[4]);
6735 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
6736 __pyx_v_material_functions = ((PyObject*)values[6]);
6738 goto __pyx_L4_argument_unpacking_done;
6739 __pyx_L5_argtuple_error:;
6740 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
6742 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6743 __Pyx_RefNannyFinishContext();
6745 __pyx_L4_argument_unpacking_done:;
6746 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 221, __pyx_L1_error)
6747 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
6748 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
6749 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
6750 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 225, __pyx_L1_error)
6751 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6758 __Pyx_RefNannyFinishContext();
6762 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6765 int __pyx_v_ebN_local;
6767 int __pyx_v_material_left;
6768 int __pyx_v_material_right;
6771 double __pyx_v_numer;
6772 double __pyx_v_denom;
6773 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6774 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6775 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6776 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6777 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6778 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6779 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6780 __Pyx_Buffer __pyx_pybuffer_x;
6781 PyObject *__pyx_r = NULL;
6782 __Pyx_RefNannyDeclarations
6789 Py_ssize_t __pyx_t_7;
6790 Py_ssize_t __pyx_t_8;
6792 npy_intp __pyx_t_10;
6793 npy_intp __pyx_t_11;
6800 PyObject *__pyx_t_18 = NULL;
6801 PyObject *__pyx_t_19 = NULL;
6802 PyObject *__pyx_t_20 = NULL;
6803 PyObject *__pyx_t_21 = NULL;
6804 PyObject *__pyx_t_22 = NULL;
6805 PyObject *__pyx_t_23 = NULL;
6807 PyObject *__pyx_t_25 = NULL;
6809 Py_ssize_t __pyx_t_27;
6810 Py_ssize_t __pyx_t_28;
6811 int __pyx_lineno = 0;
6812 const char *__pyx_filename = NULL;
6813 int __pyx_clineno = 0;
6814 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
6815 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6816 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6817 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6818 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6819 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6820 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6821 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6822 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6823 __pyx_pybuffer_x.pybuffer.buf = NULL;
6824 __pyx_pybuffer_x.refcount = 0;
6825 __pyx_pybuffernd_x.data = NULL;
6826 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6827 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6828 __pyx_pybuffer_ebq_vals.refcount = 0;
6829 __pyx_pybuffernd_ebq_vals.data = NULL;
6830 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6832 __Pyx_BufFmt_StackElem __pyx_stack[1];
6833 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6835 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6837 __Pyx_BufFmt_StackElem __pyx_stack[1];
6838 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6840 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6842 __Pyx_BufFmt_StackElem __pyx_stack[1];
6843 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6845 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6847 __Pyx_BufFmt_StackElem __pyx_stack[1];
6848 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6850 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
6859 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6860 __pyx_t_2 = __pyx_t_1;
6861 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6862 __pyx_v_eN = __pyx_t_3;
6871 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6872 __pyx_t_5 = __pyx_t_4;
6873 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6874 __pyx_v_ebN_local = __pyx_t_6;
6883 __pyx_t_7 = __pyx_v_eN;
6884 __pyx_t_8 = __pyx_v_ebN_local;
6886 if (__pyx_t_7 < 0) {
6887 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6888 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6889 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6890 if (__pyx_t_8 < 0) {
6891 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6892 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6893 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6894 if (unlikely(__pyx_t_9 != -1)) {
6895 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6896 __PYX_ERR(0, 238, __pyx_L1_error)
6898 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6907 __pyx_t_8 = __pyx_v_ebN;
6910 if (__pyx_t_8 < 0) {
6911 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6912 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
6913 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6914 if (__pyx_t_7 < 0) {
6915 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6916 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
6917 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6918 if (unlikely(__pyx_t_9 != -1)) {
6919 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6920 __PYX_ERR(0, 239, __pyx_L1_error)
6922 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6931 __pyx_t_7 = __pyx_v_ebN;
6934 if (__pyx_t_7 < 0) {
6935 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6936 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6937 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6938 if (__pyx_t_8 < 0) {
6939 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6940 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6941 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6942 if (unlikely(__pyx_t_9 != -1)) {
6943 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6944 __PYX_ERR(0, 240, __pyx_L1_error)
6946 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6955 __pyx_t_10 = (__pyx_v_x->dimensions[2]);
6956 __pyx_t_11 = __pyx_t_10;
6957 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
6958 __pyx_v_k = __pyx_t_9;
6967 __pyx_t_12 = __pyx_v_nd;
6968 __pyx_t_13 = __pyx_t_12;
6969 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
6970 __pyx_v_I = __pyx_t_14;
6979 __pyx_t_15 = __pyx_v_nd;
6980 __pyx_t_16 = __pyx_t_15;
6981 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
6982 __pyx_v_J = __pyx_t_17;
6991 if (unlikely(__pyx_v_material_functions == Py_None)) {
6992 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6993 __PYX_ERR(0, 244, __pyx_L1_error)
6995 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6996 __Pyx_GOTREF(__pyx_t_19);
6997 __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6998 __Pyx_GOTREF(__pyx_t_20);
6999 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7000 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7001 __Pyx_GOTREF(__pyx_t_19);
7002 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
7003 __Pyx_GOTREF(__pyx_t_21);
7004 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7005 __Pyx_GOTREF(__pyx_t_22);
7006 __pyx_t_23 = PyTuple_New(3);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7007 __Pyx_GOTREF(__pyx_t_23);
7008 __Pyx_GIVEREF(__pyx_t_19);
7009 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_19);
7010 __Pyx_GIVEREF(__pyx_t_21);
7011 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
7012 __Pyx_GIVEREF(__pyx_t_22);
7013 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
7017 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7018 __Pyx_GOTREF(__pyx_t_22);
7019 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7020 __pyx_t_23 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7021 __Pyx_GOTREF(__pyx_t_23);
7024 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
7025 __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
7026 if (likely(__pyx_t_21)) {
7027 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
7028 __Pyx_INCREF(__pyx_t_21);
7029 __Pyx_INCREF(
function);
7030 __Pyx_DECREF_SET(__pyx_t_20,
function);
7034 #if CYTHON_FAST_PYCALL
7035 if (PyFunction_Check(__pyx_t_20)) {
7036 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_22, __pyx_t_23};
7037 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7038 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
7039 __Pyx_GOTREF(__pyx_t_18);
7040 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7041 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7044 #if CYTHON_FAST_PYCCALL
7045 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
7046 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_22, __pyx_t_23};
7047 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7048 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
7049 __Pyx_GOTREF(__pyx_t_18);
7050 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7051 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7055 __pyx_t_19 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7056 __Pyx_GOTREF(__pyx_t_19);
7058 __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_21); __pyx_t_21 = NULL;
7060 __Pyx_GIVEREF(__pyx_t_22);
7061 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_24, __pyx_t_22);
7062 __Pyx_GIVEREF(__pyx_t_23);
7063 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_24, __pyx_t_23);
7066 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7067 __Pyx_GOTREF(__pyx_t_18);
7068 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7070 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7071 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
7072 __Pyx_GOTREF(__pyx_t_20);
7073 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7074 __Pyx_GOTREF(__pyx_t_19);
7075 __pyx_t_23 = PyTuple_New(2);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7076 __Pyx_GOTREF(__pyx_t_23);
7077 __Pyx_GIVEREF(__pyx_t_20);
7078 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
7079 __Pyx_GIVEREF(__pyx_t_19);
7080 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_19);
7083 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_23);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7084 __Pyx_GOTREF(__pyx_t_19);
7085 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7086 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7087 __pyx_t_23 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_23);
7089 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7090 if (unlikely(__pyx_v_material_functions == Py_None)) {
7091 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7092 __PYX_ERR(0, 244, __pyx_L1_error)
7094 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7095 __Pyx_GOTREF(__pyx_t_18);
7096 __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
7097 __Pyx_GOTREF(__pyx_t_20);
7098 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7099 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7100 __Pyx_GOTREF(__pyx_t_18);
7101 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7102 __Pyx_GOTREF(__pyx_t_22);
7103 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
7104 __Pyx_GOTREF(__pyx_t_21);
7105 __pyx_t_25 = PyTuple_New(3);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7106 __Pyx_GOTREF(__pyx_t_25);
7107 __Pyx_GIVEREF(__pyx_t_18);
7108 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_18);
7109 __Pyx_GIVEREF(__pyx_t_22);
7110 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_22);
7111 __Pyx_GIVEREF(__pyx_t_21);
7112 PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_21);
7116 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_25);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
7117 __Pyx_GOTREF(__pyx_t_21);
7118 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7119 __pyx_t_25 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7120 __Pyx_GOTREF(__pyx_t_25);
7123 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
7124 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20);
7125 if (likely(__pyx_t_22)) {
7126 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
7127 __Pyx_INCREF(__pyx_t_22);
7128 __Pyx_INCREF(
function);
7129 __Pyx_DECREF_SET(__pyx_t_20,
function);
7133 #if CYTHON_FAST_PYCALL
7134 if (PyFunction_Check(__pyx_t_20)) {
7135 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_25};
7136 __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7137 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
7138 __Pyx_GOTREF(__pyx_t_19);
7139 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7140 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7143 #if CYTHON_FAST_PYCCALL
7144 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
7145 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_25};
7146 __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7147 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
7148 __Pyx_GOTREF(__pyx_t_19);
7149 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7150 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7154 __pyx_t_18 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7155 __Pyx_GOTREF(__pyx_t_18);
7157 __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_22); __pyx_t_22 = NULL;
7159 __Pyx_GIVEREF(__pyx_t_21);
7160 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_24, __pyx_t_21);
7161 __Pyx_GIVEREF(__pyx_t_25);
7162 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_24, __pyx_t_25);
7165 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7166 __Pyx_GOTREF(__pyx_t_19);
7167 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7169 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7170 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
7171 __Pyx_GOTREF(__pyx_t_20);
7172 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7173 __Pyx_GOTREF(__pyx_t_18);
7174 __pyx_t_25 = PyTuple_New(2);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7175 __Pyx_GOTREF(__pyx_t_25);
7176 __Pyx_GIVEREF(__pyx_t_20);
7177 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_20);
7178 __Pyx_GIVEREF(__pyx_t_18);
7179 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_18);
7182 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_25);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7183 __Pyx_GOTREF(__pyx_t_18);
7184 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7185 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7186 __pyx_t_25 = PyNumber_Multiply(__pyx_t_23, __pyx_t_18);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7187 __Pyx_GOTREF(__pyx_t_25);
7188 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7189 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7190 __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_25);
if (unlikely((__pyx_t_26 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
7191 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7192 __pyx_v_numer = __pyx_t_26;
7201 if (unlikely(__pyx_v_material_functions == Py_None)) {
7202 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7203 __PYX_ERR(0, 245, __pyx_L1_error)
7205 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7206 __Pyx_GOTREF(__pyx_t_18);
7207 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7208 __Pyx_GOTREF(__pyx_t_23);
7209 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7210 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7211 __Pyx_GOTREF(__pyx_t_18);
7212 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7213 __Pyx_GOTREF(__pyx_t_19);
7214 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7215 __Pyx_GOTREF(__pyx_t_20);
7216 __pyx_t_21 = PyTuple_New(3);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7217 __Pyx_GOTREF(__pyx_t_21);
7218 __Pyx_GIVEREF(__pyx_t_18);
7219 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
7220 __Pyx_GIVEREF(__pyx_t_19);
7221 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19);
7222 __Pyx_GIVEREF(__pyx_t_20);
7223 PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_20);
7227 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7228 __Pyx_GOTREF(__pyx_t_20);
7229 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7230 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7231 __Pyx_GOTREF(__pyx_t_21);
7234 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
7235 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_23);
7236 if (likely(__pyx_t_19)) {
7237 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_23);
7238 __Pyx_INCREF(__pyx_t_19);
7239 __Pyx_INCREF(
function);
7240 __Pyx_DECREF_SET(__pyx_t_23,
function);
7244 #if CYTHON_FAST_PYCALL
7245 if (PyFunction_Check(__pyx_t_23)) {
7246 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
7247 __pyx_t_25 = __Pyx_PyFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7248 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7249 __Pyx_GOTREF(__pyx_t_25);
7250 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7251 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7254 #if CYTHON_FAST_PYCCALL
7255 if (__Pyx_PyFastCFunction_Check(__pyx_t_23)) {
7256 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
7257 __pyx_t_25 = __Pyx_PyCFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7258 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7259 __Pyx_GOTREF(__pyx_t_25);
7260 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7261 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7265 __pyx_t_18 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7266 __Pyx_GOTREF(__pyx_t_18);
7268 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_19); __pyx_t_19 = NULL;
7270 __Pyx_GIVEREF(__pyx_t_20);
7271 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_24, __pyx_t_20);
7272 __Pyx_GIVEREF(__pyx_t_21);
7273 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_24, __pyx_t_21);
7276 __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7277 __Pyx_GOTREF(__pyx_t_25);
7278 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7280 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7281 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7282 __Pyx_GOTREF(__pyx_t_23);
7283 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7284 __Pyx_GOTREF(__pyx_t_18);
7285 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7286 __Pyx_GOTREF(__pyx_t_21);
7287 __Pyx_GIVEREF(__pyx_t_23);
7288 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_23);
7289 __Pyx_GIVEREF(__pyx_t_18);
7290 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_18);
7293 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_25, __pyx_t_21);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7294 __Pyx_GOTREF(__pyx_t_18);
7295 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7296 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7297 if (unlikely(__pyx_v_material_functions == Py_None)) {
7298 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7299 __PYX_ERR(0, 245, __pyx_L1_error)
7301 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7302 __Pyx_GOTREF(__pyx_t_25);
7303 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_25);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7304 __Pyx_GOTREF(__pyx_t_23);
7305 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7306 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7307 __Pyx_GOTREF(__pyx_t_25);
7308 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7309 __Pyx_GOTREF(__pyx_t_20);
7310 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7311 __Pyx_GOTREF(__pyx_t_19);
7312 __pyx_t_22 = PyTuple_New(3);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7313 __Pyx_GOTREF(__pyx_t_22);
7314 __Pyx_GIVEREF(__pyx_t_25);
7315 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_25);
7316 __Pyx_GIVEREF(__pyx_t_20);
7317 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
7318 __Pyx_GIVEREF(__pyx_t_19);
7319 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_19);
7323 __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7324 __Pyx_GOTREF(__pyx_t_19);
7325 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7326 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7327 __Pyx_GOTREF(__pyx_t_22);
7330 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
7331 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_23);
7332 if (likely(__pyx_t_20)) {
7333 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_23);
7334 __Pyx_INCREF(__pyx_t_20);
7335 __Pyx_INCREF(
function);
7336 __Pyx_DECREF_SET(__pyx_t_23,
function);
7340 #if CYTHON_FAST_PYCALL
7341 if (PyFunction_Check(__pyx_t_23)) {
7342 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_22};
7343 __pyx_t_21 = __Pyx_PyFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7344 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7345 __Pyx_GOTREF(__pyx_t_21);
7346 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7347 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7350 #if CYTHON_FAST_PYCCALL
7351 if (__Pyx_PyFastCFunction_Check(__pyx_t_23)) {
7352 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_22};
7353 __pyx_t_21 = __Pyx_PyCFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7354 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7355 __Pyx_GOTREF(__pyx_t_21);
7356 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7357 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7361 __pyx_t_25 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7362 __Pyx_GOTREF(__pyx_t_25);
7364 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_20); __pyx_t_20 = NULL;
7366 __Pyx_GIVEREF(__pyx_t_19);
7367 PyTuple_SET_ITEM(__pyx_t_25, 0+__pyx_t_24, __pyx_t_19);
7368 __Pyx_GIVEREF(__pyx_t_22);
7369 PyTuple_SET_ITEM(__pyx_t_25, 1+__pyx_t_24, __pyx_t_22);
7372 __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_25, NULL);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7373 __Pyx_GOTREF(__pyx_t_21);
7374 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7376 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7377 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7378 __Pyx_GOTREF(__pyx_t_23);
7379 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7380 __Pyx_GOTREF(__pyx_t_25);
7381 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7382 __Pyx_GOTREF(__pyx_t_22);
7383 __Pyx_GIVEREF(__pyx_t_23);
7384 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23);
7385 __Pyx_GIVEREF(__pyx_t_25);
7386 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_25);
7389 __pyx_t_25 = __Pyx_PyObject_GetItem(__pyx_t_21, __pyx_t_22);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7390 __Pyx_GOTREF(__pyx_t_25);
7391 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7392 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7393 __pyx_t_22 = PyNumber_Add(__pyx_t_18, __pyx_t_25);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7394 __Pyx_GOTREF(__pyx_t_22);
7395 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7396 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7397 __pyx_t_25 = __Pyx_PyFloat_AddObjC(__pyx_t_22, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7398 __Pyx_GOTREF(__pyx_t_25);
7399 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7400 __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_25);
if (unlikely((__pyx_t_26 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
7401 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7402 __pyx_v_denom = __pyx_t_26;
7411 if (unlikely(__pyx_v_denom == 0)) {
7412 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
7413 __PYX_ERR(0, 246, __pyx_L1_error)
7415 __pyx_t_8 = __pyx_v_eN;
7416 __pyx_t_7 = __pyx_v_ebN_local;
7417 __pyx_t_27 = __pyx_v_k;
7418 __pyx_t_28 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
7420 if (__pyx_t_8 < 0) {
7421 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
7422 if (unlikely(__pyx_t_8 < 0)) __pyx_t_24 = 0;
7423 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_24 = 0;
7424 if (__pyx_t_7 < 0) {
7425 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
7426 if (unlikely(__pyx_t_7 < 0)) __pyx_t_24 = 1;
7427 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_24 = 1;
7428 if (__pyx_t_27 < 0) {
7429 __pyx_t_27 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
7430 if (unlikely(__pyx_t_27 < 0)) __pyx_t_24 = 2;
7431 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_24 = 2;
7432 if (__pyx_t_28 < 0) {
7433 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
7434 if (unlikely(__pyx_t_28 < 0)) __pyx_t_24 = 3;
7435 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_24 = 3;
7436 if (unlikely(__pyx_t_24 != -1)) {
7437 __Pyx_RaiseBufferIndexError(__pyx_t_24);
7438 __PYX_ERR(0, 246, __pyx_L1_error)
7440 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
7456 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7459 __Pyx_XDECREF(__pyx_t_18);
7460 __Pyx_XDECREF(__pyx_t_19);
7461 __Pyx_XDECREF(__pyx_t_20);
7462 __Pyx_XDECREF(__pyx_t_21);
7463 __Pyx_XDECREF(__pyx_t_22);
7464 __Pyx_XDECREF(__pyx_t_23);
7465 __Pyx_XDECREF(__pyx_t_25);
7466 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7467 __Pyx_PyThreadState_declare
7468 __Pyx_PyThreadState_assign
7469 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7470 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7471 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7472 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7473 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7474 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7475 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7479 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7480 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7481 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7482 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7484 __Pyx_XGIVEREF(__pyx_r);
7485 __Pyx_RefNannyFinishContext();
7498 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7499 static char __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7500 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
7501 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7503 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7504 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7505 PyArrayObject *__pyx_v_x = 0;
7506 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7507 PyObject *__pyx_v_material_functions = 0;
7508 int __pyx_lineno = 0;
7509 const char *__pyx_filename = NULL;
7510 int __pyx_clineno = 0;
7511 PyObject *__pyx_r = 0;
7512 __Pyx_RefNannyDeclarations
7513 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
7515 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7516 PyObject* values[6] = {0,0,0,0,0,0};
7517 if (unlikely(__pyx_kwds)) {
7519 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7521 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7523 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7525 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7527 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7529 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7531 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7534 default:
goto __pyx_L5_argtuple_error;
7536 kw_args = PyDict_Size(__pyx_kwds);
7539 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7540 else goto __pyx_L5_argtuple_error;
7543 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7545 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 248, __pyx_L3_error)
7549 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7551 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 248, __pyx_L3_error)
7555 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7557 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 248, __pyx_L3_error)
7561 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7563 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 248, __pyx_L3_error)
7567 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7569 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 248, __pyx_L3_error)
7572 if (unlikely(kw_args > 0)) {
7573 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
7575 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
7576 goto __pyx_L5_argtuple_error;
7578 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7579 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7580 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7581 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7582 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7583 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7585 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
7586 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
7587 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
7588 __pyx_v_x = ((PyArrayObject *)values[3]);
7589 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
7590 __pyx_v_material_functions = ((PyObject*)values[5]);
7592 goto __pyx_L4_argument_unpacking_done;
7593 __pyx_L5_argtuple_error:;
7594 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
7596 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7597 __Pyx_RefNannyFinishContext();
7599 __pyx_L4_argument_unpacking_done:;
7600 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 249, __pyx_L1_error)
7601 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
7602 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
7603 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
7604 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
7605 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7612 __Pyx_RefNannyFinishContext();
7616 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7618 int __pyx_v_material_left;
7619 int __pyx_v_material_right;
7621 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7622 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7623 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7624 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7625 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7626 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7627 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7628 __Pyx_Buffer __pyx_pybuffer_x;
7629 PyObject *__pyx_r = NULL;
7630 __Pyx_RefNannyDeclarations
7634 Py_ssize_t __pyx_t_4;
7635 Py_ssize_t __pyx_t_5;
7640 PyObject *__pyx_t_10 = NULL;
7641 PyObject *__pyx_t_11 = NULL;
7642 PyObject *__pyx_t_12 = NULL;
7643 PyObject *__pyx_t_13 = NULL;
7644 PyObject *__pyx_t_14 = NULL;
7645 PyObject *__pyx_t_15 = NULL;
7646 PyObject *__pyx_t_16 = NULL;
7647 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
7648 int __pyx_lineno = 0;
7649 const char *__pyx_filename = NULL;
7650 int __pyx_clineno = 0;
7651 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
7652 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7653 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7654 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7655 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7656 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7657 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7658 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7659 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7660 __pyx_pybuffer_x.pybuffer.buf = NULL;
7661 __pyx_pybuffer_x.refcount = 0;
7662 __pyx_pybuffernd_x.data = NULL;
7663 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7664 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7665 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7666 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7667 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7669 __Pyx_BufFmt_StackElem __pyx_stack[1];
7670 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7672 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7674 __Pyx_BufFmt_StackElem __pyx_stack[1];
7675 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7677 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7679 __Pyx_BufFmt_StackElem __pyx_stack[1];
7680 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7682 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
7684 __Pyx_BufFmt_StackElem __pyx_stack[1];
7685 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7687 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
7696 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7697 __pyx_t_2 = __pyx_t_1;
7698 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7699 __pyx_v_ebN = __pyx_t_3;
7708 __pyx_t_4 = __pyx_v_ebN;
7711 if (__pyx_t_4 < 0) {
7712 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7713 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7714 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7715 if (__pyx_t_5 < 0) {
7716 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7717 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7718 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7719 if (unlikely(__pyx_t_6 != -1)) {
7720 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7721 __PYX_ERR(0, 264, __pyx_L1_error)
7723 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7732 __pyx_t_5 = __pyx_v_ebN;
7735 if (__pyx_t_5 < 0) {
7736 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7737 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
7738 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7739 if (__pyx_t_4 < 0) {
7740 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7741 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
7742 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7743 if (unlikely(__pyx_t_6 != -1)) {
7744 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7745 __PYX_ERR(0, 265, __pyx_L1_error)
7747 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7756 __pyx_t_7 = (__pyx_v_x->dimensions[1]);
7757 __pyx_t_8 = __pyx_t_7;
7758 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
7759 __pyx_v_k = __pyx_t_9;
7768 if (unlikely(__pyx_v_material_functions == Py_None)) {
7769 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7770 __PYX_ERR(0, 267, __pyx_L1_error)
7772 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7773 __Pyx_GOTREF(__pyx_t_11);
7774 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7775 __Pyx_GOTREF(__pyx_t_12);
7776 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7777 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7778 __Pyx_GOTREF(__pyx_t_11);
7779 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7780 __Pyx_GOTREF(__pyx_t_13);
7781 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7782 __Pyx_GOTREF(__pyx_t_14);
7783 __Pyx_GIVEREF(__pyx_t_11);
7784 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
7785 __Pyx_GIVEREF(__pyx_t_13);
7786 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13);
7789 __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_14);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7790 __Pyx_GOTREF(__pyx_t_13);
7791 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7792 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7793 __Pyx_GOTREF(__pyx_t_14);
7796 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
7797 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
7798 if (likely(__pyx_t_11)) {
7799 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
7800 __Pyx_INCREF(__pyx_t_11);
7801 __Pyx_INCREF(
function);
7802 __Pyx_DECREF_SET(__pyx_t_12,
function);
7806 #if CYTHON_FAST_PYCALL
7807 if (PyFunction_Check(__pyx_t_12)) {
7808 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7809 __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7810 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7811 __Pyx_GOTREF(__pyx_t_10);
7812 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7813 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7816 #if CYTHON_FAST_PYCCALL
7817 if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
7818 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7819 __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7820 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7821 __Pyx_GOTREF(__pyx_t_10);
7822 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7823 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7827 __pyx_t_15 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7828 __Pyx_GOTREF(__pyx_t_15);
7830 __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11); __pyx_t_11 = NULL;
7832 __Pyx_GIVEREF(__pyx_t_13);
7833 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_6, __pyx_t_13);
7834 __Pyx_GIVEREF(__pyx_t_14);
7835 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_6, __pyx_t_14);
7838 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7839 __Pyx_GOTREF(__pyx_t_10);
7840 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7842 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7851 if (unlikely(__pyx_v_material_functions == Py_None)) {
7852 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7853 __PYX_ERR(0, 268, __pyx_L1_error)
7855 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7856 __Pyx_GOTREF(__pyx_t_15);
7857 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7858 __Pyx_GOTREF(__pyx_t_14);
7859 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7860 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7861 __Pyx_GOTREF(__pyx_t_15);
7862 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7863 __Pyx_GOTREF(__pyx_t_13);
7864 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7865 __Pyx_GOTREF(__pyx_t_11);
7866 __Pyx_GIVEREF(__pyx_t_15);
7867 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_15);
7868 __Pyx_GIVEREF(__pyx_t_13);
7869 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
7872 __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_11);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7873 __Pyx_GOTREF(__pyx_t_13);
7874 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7875 __pyx_t_11 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7876 __Pyx_GOTREF(__pyx_t_11);
7879 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
7880 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
7881 if (likely(__pyx_t_15)) {
7882 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
7883 __Pyx_INCREF(__pyx_t_15);
7884 __Pyx_INCREF(
function);
7885 __Pyx_DECREF_SET(__pyx_t_14,
function);
7889 #if CYTHON_FAST_PYCALL
7890 if (PyFunction_Check(__pyx_t_14)) {
7891 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7892 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7893 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7894 __Pyx_GOTREF(__pyx_t_12);
7895 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7896 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7899 #if CYTHON_FAST_PYCCALL
7900 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
7901 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7902 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7903 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7904 __Pyx_GOTREF(__pyx_t_12);
7905 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7906 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7910 __pyx_t_16 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 268, __pyx_L1_error)
7911 __Pyx_GOTREF(__pyx_t_16);
7913 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
7915 __Pyx_GIVEREF(__pyx_t_13);
7916 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_t_13);
7917 __Pyx_GIVEREF(__pyx_t_11);
7918 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_11);
7921 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7922 __Pyx_GOTREF(__pyx_t_12);
7923 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7925 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7934 __pyx_t_14 = PyNumber_Add(__pyx_t_10, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7935 __Pyx_GOTREF(__pyx_t_14);
7936 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7937 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7938 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7939 __Pyx_GOTREF(__pyx_t_12);
7940 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7941 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
7942 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7943 __pyx_t_4 = __pyx_v_ebN;
7944 __pyx_t_5 = __pyx_v_k;
7946 if (__pyx_t_4 < 0) {
7947 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
7948 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7949 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
7950 if (__pyx_t_5 < 0) {
7951 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
7952 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7953 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
7954 if (unlikely(__pyx_t_6 != -1)) {
7955 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7956 __PYX_ERR(0, 267, __pyx_L1_error)
7958 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_17;
7971 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7974 __Pyx_XDECREF(__pyx_t_10);
7975 __Pyx_XDECREF(__pyx_t_11);
7976 __Pyx_XDECREF(__pyx_t_12);
7977 __Pyx_XDECREF(__pyx_t_13);
7978 __Pyx_XDECREF(__pyx_t_14);
7979 __Pyx_XDECREF(__pyx_t_15);
7980 __Pyx_XDECREF(__pyx_t_16);
7981 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7982 __Pyx_PyThreadState_declare
7983 __Pyx_PyThreadState_assign
7984 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7985 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7986 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7987 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7988 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7989 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7990 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7994 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7995 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7996 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7997 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7999 __Pyx_XGIVEREF(__pyx_r);
8000 __Pyx_RefNannyFinishContext();
8013 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8014 static char __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
8015 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
8016 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8019 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
8020 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
8021 PyArrayObject *__pyx_v_x = 0;
8022 PyArrayObject *__pyx_v_ebq_global_vals = 0;
8023 PyObject *__pyx_v_material_functions = 0;
8024 int __pyx_lineno = 0;
8025 const char *__pyx_filename = NULL;
8026 int __pyx_clineno = 0;
8027 PyObject *__pyx_r = 0;
8028 __Pyx_RefNannyDeclarations
8029 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
8031 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
8032 PyObject* values[7] = {0,0,0,0,0,0,0};
8033 if (unlikely(__pyx_kwds)) {
8035 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8037 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8039 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8041 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8043 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8045 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8047 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8049 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8052 default:
goto __pyx_L5_argtuple_error;
8054 kw_args = PyDict_Size(__pyx_kwds);
8057 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
8058 else goto __pyx_L5_argtuple_error;
8061 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
8063 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 271, __pyx_L3_error)
8067 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
8069 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 271, __pyx_L3_error)
8073 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
8075 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 271, __pyx_L3_error)
8079 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
8081 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 271, __pyx_L3_error)
8085 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
8087 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 271, __pyx_L3_error)
8091 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
8093 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 271, __pyx_L3_error)
8096 if (unlikely(kw_args > 0)) {
8097 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
8099 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
8100 goto __pyx_L5_argtuple_error;
8102 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8103 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8104 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8105 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8106 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8107 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8108 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8110 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
8111 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
8112 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
8113 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
8114 __pyx_v_x = ((PyArrayObject *)values[4]);
8115 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
8116 __pyx_v_material_functions = ((PyObject*)values[6]);
8118 goto __pyx_L4_argument_unpacking_done;
8119 __pyx_L5_argtuple_error:;
8120 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
8122 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8123 __Pyx_RefNannyFinishContext();
8125 __pyx_L4_argument_unpacking_done:;
8126 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 273, __pyx_L1_error)
8127 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
8128 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 275, __pyx_L1_error)
8129 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
8130 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 277, __pyx_L1_error)
8131 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
8138 __Pyx_RefNannyFinishContext();
8142 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
8145 int __pyx_v_material_left;
8146 int __pyx_v_material_right;
8149 double __pyx_v_numer;
8150 double __pyx_v_denom;
8151 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
8152 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
8153 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
8154 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
8155 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
8156 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
8157 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
8158 __Pyx_Buffer __pyx_pybuffer_x;
8159 PyObject *__pyx_r = NULL;
8160 __Pyx_RefNannyDeclarations
8164 Py_ssize_t __pyx_t_4;
8165 Py_ssize_t __pyx_t_5;
8175 PyObject *__pyx_t_15 = NULL;
8176 PyObject *__pyx_t_16 = NULL;
8177 PyObject *__pyx_t_17 = NULL;
8178 PyObject *__pyx_t_18 = NULL;
8179 PyObject *__pyx_t_19 = NULL;
8181 PyObject *__pyx_t_21 = NULL;
8182 PyObject *__pyx_t_22 = NULL;
8184 Py_ssize_t __pyx_t_24;
8185 int __pyx_lineno = 0;
8186 const char *__pyx_filename = NULL;
8187 int __pyx_clineno = 0;
8188 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
8189 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
8190 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
8191 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
8192 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
8193 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
8194 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
8195 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
8196 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
8197 __pyx_pybuffer_x.pybuffer.buf = NULL;
8198 __pyx_pybuffer_x.refcount = 0;
8199 __pyx_pybuffernd_x.data = NULL;
8200 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
8201 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
8202 __pyx_pybuffer_ebq_global_vals.refcount = 0;
8203 __pyx_pybuffernd_ebq_global_vals.data = NULL;
8204 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
8206 __Pyx_BufFmt_StackElem __pyx_stack[1];
8207 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8209 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
8211 __Pyx_BufFmt_StackElem __pyx_stack[1];
8212 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8214 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
8216 __Pyx_BufFmt_StackElem __pyx_stack[1];
8217 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8219 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
8221 __Pyx_BufFmt_StackElem __pyx_stack[1];
8222 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8224 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
8233 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
8234 __pyx_t_2 = __pyx_t_1;
8235 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8236 __pyx_v_ebN = __pyx_t_3;
8245 __pyx_t_4 = __pyx_v_ebN;
8248 if (__pyx_t_4 < 0) {
8249 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8250 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
8251 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8252 if (__pyx_t_5 < 0) {
8253 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8254 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
8255 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8256 if (unlikely(__pyx_t_6 != -1)) {
8257 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8258 __PYX_ERR(0, 289, __pyx_L1_error)
8260 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8269 __pyx_t_5 = __pyx_v_ebN;
8272 if (__pyx_t_5 < 0) {
8273 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8274 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
8275 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8276 if (__pyx_t_4 < 0) {
8277 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8278 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
8279 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8280 if (unlikely(__pyx_t_6 != -1)) {
8281 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8282 __PYX_ERR(0, 290, __pyx_L1_error)
8284 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8293 __pyx_t_7 = (__pyx_v_x->dimensions[1]);
8294 __pyx_t_8 = __pyx_t_7;
8295 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
8296 __pyx_v_k = __pyx_t_6;
8305 __pyx_t_9 = __pyx_v_nd;
8306 __pyx_t_10 = __pyx_t_9;
8307 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
8308 __pyx_v_I = __pyx_t_11;
8317 __pyx_t_12 = __pyx_v_nd;
8318 __pyx_t_13 = __pyx_t_12;
8319 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
8320 __pyx_v_J = __pyx_t_14;
8329 if (unlikely(__pyx_v_material_functions == Py_None)) {
8330 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8331 __PYX_ERR(0, 294, __pyx_L1_error)
8333 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8334 __Pyx_GOTREF(__pyx_t_16);
8335 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8336 __Pyx_GOTREF(__pyx_t_17);
8337 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8338 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8339 __Pyx_GOTREF(__pyx_t_16);
8340 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8341 __Pyx_GOTREF(__pyx_t_18);
8342 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8343 __Pyx_GOTREF(__pyx_t_19);
8344 __Pyx_GIVEREF(__pyx_t_16);
8345 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_16);
8346 __Pyx_GIVEREF(__pyx_t_18);
8347 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_18);
8350 __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8351 __Pyx_GOTREF(__pyx_t_18);
8352 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8353 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8354 __Pyx_GOTREF(__pyx_t_19);
8357 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
8358 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
8359 if (likely(__pyx_t_16)) {
8360 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
8361 __Pyx_INCREF(__pyx_t_16);
8362 __Pyx_INCREF(
function);
8363 __Pyx_DECREF_SET(__pyx_t_17,
function);
8367 #if CYTHON_FAST_PYCALL
8368 if (PyFunction_Check(__pyx_t_17)) {
8369 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_18, __pyx_t_19};
8370 __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8371 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8372 __Pyx_GOTREF(__pyx_t_15);
8373 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8374 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8377 #if CYTHON_FAST_PYCCALL
8378 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
8379 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_18, __pyx_t_19};
8380 __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8381 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8382 __Pyx_GOTREF(__pyx_t_15);
8383 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8384 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8388 __pyx_t_21 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8389 __Pyx_GOTREF(__pyx_t_21);
8391 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_16); __pyx_t_16 = NULL;
8393 __Pyx_GIVEREF(__pyx_t_18);
8394 PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_20, __pyx_t_18);
8395 __Pyx_GIVEREF(__pyx_t_19);
8396 PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_20, __pyx_t_19);
8399 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_21, NULL);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8400 __Pyx_GOTREF(__pyx_t_15);
8401 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8403 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8404 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8405 __Pyx_GOTREF(__pyx_t_17);
8406 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8407 __Pyx_GOTREF(__pyx_t_21);
8408 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8409 __Pyx_GOTREF(__pyx_t_19);
8410 __Pyx_GIVEREF(__pyx_t_17);
8411 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17);
8412 __Pyx_GIVEREF(__pyx_t_21);
8413 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
8416 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8417 __Pyx_GOTREF(__pyx_t_21);
8418 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8419 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8420 __pyx_t_19 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_21);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8421 __Pyx_GOTREF(__pyx_t_19);
8422 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8423 if (unlikely(__pyx_v_material_functions == Py_None)) {
8424 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8425 __PYX_ERR(0, 294, __pyx_L1_error)
8427 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8428 __Pyx_GOTREF(__pyx_t_15);
8429 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8430 __Pyx_GOTREF(__pyx_t_17);
8431 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8432 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8433 __Pyx_GOTREF(__pyx_t_15);
8434 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8435 __Pyx_GOTREF(__pyx_t_18);
8436 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8437 __Pyx_GOTREF(__pyx_t_16);
8438 __Pyx_GIVEREF(__pyx_t_15);
8439 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
8440 __Pyx_GIVEREF(__pyx_t_18);
8441 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18);
8444 __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8445 __Pyx_GOTREF(__pyx_t_18);
8446 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8447 __pyx_t_16 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8448 __Pyx_GOTREF(__pyx_t_16);
8451 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
8452 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
8453 if (likely(__pyx_t_15)) {
8454 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
8455 __Pyx_INCREF(__pyx_t_15);
8456 __Pyx_INCREF(
function);
8457 __Pyx_DECREF_SET(__pyx_t_17,
function);
8461 #if CYTHON_FAST_PYCALL
8462 if (PyFunction_Check(__pyx_t_17)) {
8463 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_18, __pyx_t_16};
8464 __pyx_t_21 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8465 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
8466 __Pyx_GOTREF(__pyx_t_21);
8467 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8468 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8471 #if CYTHON_FAST_PYCCALL
8472 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
8473 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_18, __pyx_t_16};
8474 __pyx_t_21 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8475 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
8476 __Pyx_GOTREF(__pyx_t_21);
8477 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8478 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8482 __pyx_t_22 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8483 __Pyx_GOTREF(__pyx_t_22);
8485 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_15); __pyx_t_15 = NULL;
8487 __Pyx_GIVEREF(__pyx_t_18);
8488 PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_20, __pyx_t_18);
8489 __Pyx_GIVEREF(__pyx_t_16);
8490 PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_20, __pyx_t_16);
8493 __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_22, NULL);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8494 __Pyx_GOTREF(__pyx_t_21);
8495 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8497 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8498 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8499 __Pyx_GOTREF(__pyx_t_17);
8500 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8501 __Pyx_GOTREF(__pyx_t_22);
8502 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8503 __Pyx_GOTREF(__pyx_t_16);
8504 __Pyx_GIVEREF(__pyx_t_17);
8505 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17);
8506 __Pyx_GIVEREF(__pyx_t_22);
8507 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_22);
8510 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_21, __pyx_t_16);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8511 __Pyx_GOTREF(__pyx_t_22);
8512 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8513 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8514 __pyx_t_16 = PyNumber_Multiply(__pyx_t_19, __pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8515 __Pyx_GOTREF(__pyx_t_16);
8516 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8517 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8518 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_16);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
8519 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8520 __pyx_v_numer = __pyx_t_23;
8529 if (unlikely(__pyx_v_material_functions == Py_None)) {
8530 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8531 __PYX_ERR(0, 295, __pyx_L1_error)
8533 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8534 __Pyx_GOTREF(__pyx_t_22);
8535 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8536 __Pyx_GOTREF(__pyx_t_19);
8537 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8538 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8539 __Pyx_GOTREF(__pyx_t_22);
8540 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8541 __Pyx_GOTREF(__pyx_t_21);
8542 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8543 __Pyx_GOTREF(__pyx_t_17);
8544 __Pyx_GIVEREF(__pyx_t_22);
8545 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_22);
8546 __Pyx_GIVEREF(__pyx_t_21);
8547 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_21);
8550 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8551 __Pyx_GOTREF(__pyx_t_21);
8552 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8553 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8554 __Pyx_GOTREF(__pyx_t_17);
8557 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8558 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_19);
8559 if (likely(__pyx_t_22)) {
8560 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8561 __Pyx_INCREF(__pyx_t_22);
8562 __Pyx_INCREF(
function);
8563 __Pyx_DECREF_SET(__pyx_t_19,
function);
8567 #if CYTHON_FAST_PYCALL
8568 if (PyFunction_Check(__pyx_t_19)) {
8569 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_17};
8570 __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8571 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
8572 __Pyx_GOTREF(__pyx_t_16);
8573 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8574 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8577 #if CYTHON_FAST_PYCCALL
8578 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8579 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_17};
8580 __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8581 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
8582 __Pyx_GOTREF(__pyx_t_16);
8583 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8584 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8588 __pyx_t_18 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8589 __Pyx_GOTREF(__pyx_t_18);
8591 __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_22); __pyx_t_22 = NULL;
8593 __Pyx_GIVEREF(__pyx_t_21);
8594 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_20, __pyx_t_21);
8595 __Pyx_GIVEREF(__pyx_t_17);
8596 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_20, __pyx_t_17);
8599 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8600 __Pyx_GOTREF(__pyx_t_16);
8601 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8603 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8604 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8605 __Pyx_GOTREF(__pyx_t_19);
8606 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8607 __Pyx_GOTREF(__pyx_t_18);
8608 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8609 __Pyx_GOTREF(__pyx_t_17);
8610 __Pyx_GIVEREF(__pyx_t_19);
8611 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19);
8612 __Pyx_GIVEREF(__pyx_t_18);
8613 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18);
8616 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8617 __Pyx_GOTREF(__pyx_t_18);
8618 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8619 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8620 if (unlikely(__pyx_v_material_functions == Py_None)) {
8621 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8622 __PYX_ERR(0, 295, __pyx_L1_error)
8624 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8625 __Pyx_GOTREF(__pyx_t_16);
8626 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8627 __Pyx_GOTREF(__pyx_t_19);
8628 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8629 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8630 __Pyx_GOTREF(__pyx_t_16);
8631 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8632 __Pyx_GOTREF(__pyx_t_21);
8633 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8634 __Pyx_GOTREF(__pyx_t_22);
8635 __Pyx_GIVEREF(__pyx_t_16);
8636 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_16);
8637 __Pyx_GIVEREF(__pyx_t_21);
8638 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_21);
8641 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8642 __Pyx_GOTREF(__pyx_t_21);
8643 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8644 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8645 __Pyx_GOTREF(__pyx_t_22);
8648 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8649 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_19);
8650 if (likely(__pyx_t_16)) {
8651 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8652 __Pyx_INCREF(__pyx_t_16);
8653 __Pyx_INCREF(
function);
8654 __Pyx_DECREF_SET(__pyx_t_19,
function);
8658 #if CYTHON_FAST_PYCALL
8659 if (PyFunction_Check(__pyx_t_19)) {
8660 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_21, __pyx_t_22};
8661 __pyx_t_17 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8662 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8663 __Pyx_GOTREF(__pyx_t_17);
8664 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8665 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8668 #if CYTHON_FAST_PYCCALL
8669 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8670 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_21, __pyx_t_22};
8671 __pyx_t_17 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8672 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8673 __Pyx_GOTREF(__pyx_t_17);
8674 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8675 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8679 __pyx_t_15 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8680 __Pyx_GOTREF(__pyx_t_15);
8682 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); __pyx_t_16 = NULL;
8684 __Pyx_GIVEREF(__pyx_t_21);
8685 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_20, __pyx_t_21);
8686 __Pyx_GIVEREF(__pyx_t_22);
8687 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_20, __pyx_t_22);
8690 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8691 __Pyx_GOTREF(__pyx_t_17);
8692 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8694 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8695 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8696 __Pyx_GOTREF(__pyx_t_19);
8697 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8698 __Pyx_GOTREF(__pyx_t_15);
8699 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8700 __Pyx_GOTREF(__pyx_t_22);
8701 __Pyx_GIVEREF(__pyx_t_19);
8702 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19);
8703 __Pyx_GIVEREF(__pyx_t_15);
8704 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_15);
8707 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_22);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8708 __Pyx_GOTREF(__pyx_t_15);
8709 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8710 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8711 __pyx_t_22 = PyNumber_Add(__pyx_t_18, __pyx_t_15);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8712 __Pyx_GOTREF(__pyx_t_22);
8713 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8714 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8715 __pyx_t_15 = __Pyx_PyFloat_AddObjC(__pyx_t_22, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8716 __Pyx_GOTREF(__pyx_t_15);
8717 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8718 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
8719 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8720 __pyx_v_denom = __pyx_t_23;
8729 if (unlikely(__pyx_v_denom == 0)) {
8730 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
8731 __PYX_ERR(0, 296, __pyx_L1_error)
8733 __pyx_t_4 = __pyx_v_ebN;
8734 __pyx_t_5 = __pyx_v_k;
8735 __pyx_t_24 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
8737 if (__pyx_t_4 < 0) {
8738 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
8739 if (unlikely(__pyx_t_4 < 0)) __pyx_t_20 = 0;
8740 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_20 = 0;
8741 if (__pyx_t_5 < 0) {
8742 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
8743 if (unlikely(__pyx_t_5 < 0)) __pyx_t_20 = 1;
8744 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_20 = 1;
8745 if (__pyx_t_24 < 0) {
8746 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
8747 if (unlikely(__pyx_t_24 < 0)) __pyx_t_20 = 2;
8748 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_20 = 2;
8749 if (unlikely(__pyx_t_20 != -1)) {
8750 __Pyx_RaiseBufferIndexError(__pyx_t_20);
8751 __PYX_ERR(0, 296, __pyx_L1_error)
8753 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
8768 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8771 __Pyx_XDECREF(__pyx_t_15);
8772 __Pyx_XDECREF(__pyx_t_16);
8773 __Pyx_XDECREF(__pyx_t_17);
8774 __Pyx_XDECREF(__pyx_t_18);
8775 __Pyx_XDECREF(__pyx_t_19);
8776 __Pyx_XDECREF(__pyx_t_21);
8777 __Pyx_XDECREF(__pyx_t_22);
8778 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8779 __Pyx_PyThreadState_declare
8780 __Pyx_PyThreadState_assign
8781 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8782 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8783 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8784 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8785 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8786 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8787 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8791 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8792 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8793 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8794 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8796 __Pyx_XGIVEREF(__pyx_r);
8797 __Pyx_RefNannyFinishContext();
8810 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8811 static char __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear[] =
"\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
8812 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {
"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
8813 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8815 PyArrayObject *__pyx_v_gravity = 0;
8816 PyArrayObject *__pyx_v_rowptr = 0;
8817 PyArrayObject *__pyx_v_colind = 0;
8818 PyArrayObject *__pyx_v_KWs = 0;
8820 int __pyx_v_nElements_global;
8821 int __pyx_v_nElementBoundaries_element;
8822 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
8823 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
8824 PyArrayObject *__pyx_v_q_flin = 0;
8825 PyArrayObject *__pyx_v_q_alin = 0;
8826 int __pyx_lineno = 0;
8827 const char *__pyx_filename = NULL;
8828 int __pyx_clineno = 0;
8829 PyObject *__pyx_r = 0;
8830 __Pyx_RefNannyDeclarations
8831 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
8833 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_KWs,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,0};
8834 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
8835 if (unlikely(__pyx_kwds)) {
8837 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8839 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8841 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8843 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8845 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8847 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8849 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8851 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8853 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8855 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8857 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8859 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8861 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8864 default:
goto __pyx_L5_argtuple_error;
8866 kw_args = PyDict_Size(__pyx_kwds);
8869 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
8870 else goto __pyx_L5_argtuple_error;
8873 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
8875 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 1); __PYX_ERR(0, 301, __pyx_L3_error)
8879 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8881 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 2); __PYX_ERR(0, 301, __pyx_L3_error)
8885 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8887 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 3); __PYX_ERR(0, 301, __pyx_L3_error)
8891 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_KWs)) != 0)) kw_args--;
8893 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 4); __PYX_ERR(0, 301, __pyx_L3_error)
8897 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
8899 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 5); __PYX_ERR(0, 301, __pyx_L3_error)
8903 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
8905 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 6); __PYX_ERR(0, 301, __pyx_L3_error)
8909 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
8911 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 7); __PYX_ERR(0, 301, __pyx_L3_error)
8915 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
8917 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 8); __PYX_ERR(0, 301, __pyx_L3_error)
8921 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
8923 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 9); __PYX_ERR(0, 301, __pyx_L3_error)
8927 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
8929 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 10); __PYX_ERR(0, 301, __pyx_L3_error)
8933 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
8935 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 11); __PYX_ERR(0, 301, __pyx_L3_error)
8938 if (unlikely(kw_args > 0)) {
8939 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_Linear") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
8941 }
else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
8942 goto __pyx_L5_argtuple_error;
8944 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8945 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8946 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8947 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8948 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8949 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8950 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8951 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8952 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8953 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8954 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8955 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8957 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error)
8958 __pyx_v_gravity = ((PyArrayObject *)values[1]);
8959 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
8960 __pyx_v_colind = ((PyArrayObject *)values[3]);
8961 __pyx_v_KWs = ((PyArrayObject *)values[4]);
8962 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
8963 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
8964 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
8965 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
8966 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
8967 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
8968 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
8970 goto __pyx_L4_argument_unpacking_done;
8971 __pyx_L5_argtuple_error:;
8972 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
8974 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
8975 __Pyx_RefNannyFinishContext();
8977 __pyx_L4_argument_unpacking_done:;
8978 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 302, __pyx_L1_error)
8979 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 303, __pyx_L1_error)
8980 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
8981 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_ptype_5numpy_ndarray, 1,
"KWs", 0))) __PYX_ERR(0, 305, __pyx_L1_error)
8982 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 310, __pyx_L1_error)
8983 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 311, __pyx_L1_error)
8984 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 312, __pyx_L1_error)
8985 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 313, __pyx_L1_error)
8986 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
8993 __Pyx_RefNannyFinishContext();
8997 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin) {
8999 int __pyx_v_eN_neighbor;
9004 int __pyx_v_matID_neig;
9005 CYTHON_UNUSED
int __pyx_v_nSpace2;
9007 PyArrayObject *__pyx_v_a_eN = 0;
9008 PyArrayObject *__pyx_v_a_neig = 0;
9009 PyArrayObject *__pyx_v_a_avg = 0;
9010 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
9011 __Pyx_Buffer __pyx_pybuffer_KWs;
9012 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
9013 __Pyx_Buffer __pyx_pybuffer_a_avg;
9014 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
9015 __Pyx_Buffer __pyx_pybuffer_a_eN;
9016 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
9017 __Pyx_Buffer __pyx_pybuffer_a_neig;
9018 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
9019 __Pyx_Buffer __pyx_pybuffer_colind;
9020 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
9021 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
9022 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
9023 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
9024 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
9025 __Pyx_Buffer __pyx_pybuffer_gravity;
9026 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
9027 __Pyx_Buffer __pyx_pybuffer_q_alin;
9028 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
9029 __Pyx_Buffer __pyx_pybuffer_q_flin;
9030 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
9031 __Pyx_Buffer __pyx_pybuffer_rowptr;
9032 PyObject *__pyx_r = NULL;
9033 __Pyx_RefNannyDeclarations
9034 Py_ssize_t __pyx_t_1;
9036 PyObject *__pyx_t_3 = NULL;
9037 PyObject *__pyx_t_4 = NULL;
9038 PyObject *__pyx_t_5 = NULL;
9039 PyObject *__pyx_t_6 = NULL;
9040 PyObject *__pyx_t_7 = NULL;
9041 PyArrayObject *__pyx_t_8 = NULL;
9042 PyArrayObject *__pyx_t_9 = NULL;
9043 PyArrayObject *__pyx_t_10 = NULL;
9049 Py_ssize_t __pyx_t_16;
9051 Py_ssize_t __pyx_t_18;
9056 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_23;
9057 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_24;
9058 Py_ssize_t __pyx_t_25;
9059 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_26;
9060 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_27;
9062 Py_ssize_t __pyx_t_29;
9063 Py_ssize_t __pyx_t_30;
9064 Py_ssize_t __pyx_t_31;
9065 int __pyx_lineno = 0;
9066 const char *__pyx_filename = NULL;
9067 int __pyx_clineno = 0;
9068 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear", 0);
9069 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
9070 __pyx_pybuffer_a_eN.refcount = 0;
9071 __pyx_pybuffernd_a_eN.data = NULL;
9072 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
9073 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
9074 __pyx_pybuffer_a_neig.refcount = 0;
9075 __pyx_pybuffernd_a_neig.data = NULL;
9076 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
9077 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
9078 __pyx_pybuffer_a_avg.refcount = 0;
9079 __pyx_pybuffernd_a_avg.data = NULL;
9080 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
9081 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
9082 __pyx_pybuffer_gravity.refcount = 0;
9083 __pyx_pybuffernd_gravity.data = NULL;
9084 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
9085 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
9086 __pyx_pybuffer_rowptr.refcount = 0;
9087 __pyx_pybuffernd_rowptr.data = NULL;
9088 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
9089 __pyx_pybuffer_colind.pybuffer.buf = NULL;
9090 __pyx_pybuffer_colind.refcount = 0;
9091 __pyx_pybuffernd_colind.data = NULL;
9092 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
9093 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
9094 __pyx_pybuffer_KWs.refcount = 0;
9095 __pyx_pybuffernd_KWs.data = NULL;
9096 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
9097 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
9098 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
9099 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
9100 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
9101 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
9102 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
9103 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
9104 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
9105 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
9106 __pyx_pybuffer_q_flin.refcount = 0;
9107 __pyx_pybuffernd_q_flin.data = NULL;
9108 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
9109 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
9110 __pyx_pybuffer_q_alin.refcount = 0;
9111 __pyx_pybuffernd_q_alin.data = NULL;
9112 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
9114 __Pyx_BufFmt_StackElem __pyx_stack[1];
9115 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9117 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
9119 __Pyx_BufFmt_StackElem __pyx_stack[1];
9120 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9122 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
9124 __Pyx_BufFmt_StackElem __pyx_stack[1];
9125 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9127 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
9129 __Pyx_BufFmt_StackElem __pyx_stack[1];
9130 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9132 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
9134 __Pyx_BufFmt_StackElem __pyx_stack[1];
9135 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9137 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
9139 __Pyx_BufFmt_StackElem __pyx_stack[1];
9140 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9142 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
9144 __Pyx_BufFmt_StackElem __pyx_stack[1];
9145 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9147 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
9149 __Pyx_BufFmt_StackElem __pyx_stack[1];
9150 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9152 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
9161 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
9170 __pyx_t_1 = __pyx_v_nSpace;
9172 if (__pyx_t_1 < 0) {
9173 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9174 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
9175 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
9176 if (unlikely(__pyx_t_2 != -1)) {
9177 __Pyx_RaiseBufferIndexError(__pyx_t_2);
9178 __PYX_ERR(0, 329, __pyx_L1_error)
9180 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9189 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9190 __Pyx_GOTREF(__pyx_t_4);
9191 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
9192 __Pyx_GOTREF(__pyx_t_5);
9193 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9194 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9195 __Pyx_GOTREF(__pyx_t_4);
9198 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9199 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9200 if (likely(__pyx_t_6)) {
9201 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9202 __Pyx_INCREF(__pyx_t_6);
9203 __Pyx_INCREF(
function);
9204 __Pyx_DECREF_SET(__pyx_t_5,
function);
9208 #if CYTHON_FAST_PYCALL
9209 if (PyFunction_Check(__pyx_t_5)) {
9210 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9211 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9212 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9213 __Pyx_GOTREF(__pyx_t_3);
9214 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9217 #if CYTHON_FAST_PYCCALL
9218 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9219 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9220 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9221 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9222 __Pyx_GOTREF(__pyx_t_3);
9223 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9227 __pyx_t_7 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
9228 __Pyx_GOTREF(__pyx_t_7);
9230 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
9232 __Pyx_GIVEREF(__pyx_t_4);
9233 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_4);
9234 __Pyx_INCREF(__pyx_n_s_d);
9235 __Pyx_GIVEREF(__pyx_n_s_d);
9236 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_n_s_d);
9238 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9239 __Pyx_GOTREF(__pyx_t_3);
9240 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9242 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9243 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
9244 __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
9246 __Pyx_BufFmt_StackElem __pyx_stack[1];
9247 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9248 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
9249 __PYX_ERR(0, 331, __pyx_L1_error)
9250 }
else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
9254 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
9264 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9265 __Pyx_GOTREF(__pyx_t_5);
9266 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
9267 __Pyx_GOTREF(__pyx_t_7);
9268 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9269 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9270 __Pyx_GOTREF(__pyx_t_5);
9273 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9274 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
9275 if (likely(__pyx_t_4)) {
9276 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
9277 __Pyx_INCREF(__pyx_t_4);
9278 __Pyx_INCREF(
function);
9279 __Pyx_DECREF_SET(__pyx_t_7,
function);
9283 #if CYTHON_FAST_PYCALL
9284 if (PyFunction_Check(__pyx_t_7)) {
9285 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9286 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9287 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9288 __Pyx_GOTREF(__pyx_t_3);
9289 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9292 #if CYTHON_FAST_PYCCALL
9293 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9294 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9295 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9296 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9297 __Pyx_GOTREF(__pyx_t_3);
9298 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9302 __pyx_t_6 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
9303 __Pyx_GOTREF(__pyx_t_6);
9305 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
9307 __Pyx_GIVEREF(__pyx_t_5);
9308 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_5);
9309 __Pyx_INCREF(__pyx_n_s_d);
9310 __Pyx_GIVEREF(__pyx_n_s_d);
9311 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_n_s_d);
9313 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9314 __Pyx_GOTREF(__pyx_t_3);
9315 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9317 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9318 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error)
9319 __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
9321 __Pyx_BufFmt_StackElem __pyx_stack[1];
9322 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9323 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
9324 __PYX_ERR(0, 332, __pyx_L1_error)
9325 }
else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
9329 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
9339 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9340 __Pyx_GOTREF(__pyx_t_7);
9341 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
9342 __Pyx_GOTREF(__pyx_t_6);
9343 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9344 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9345 __Pyx_GOTREF(__pyx_t_7);
9348 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9349 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9350 if (likely(__pyx_t_5)) {
9351 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
9352 __Pyx_INCREF(__pyx_t_5);
9353 __Pyx_INCREF(
function);
9354 __Pyx_DECREF_SET(__pyx_t_6,
function);
9358 #if CYTHON_FAST_PYCALL
9359 if (PyFunction_Check(__pyx_t_6)) {
9360 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9361 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9362 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9363 __Pyx_GOTREF(__pyx_t_3);
9364 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9367 #if CYTHON_FAST_PYCCALL
9368 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9369 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9370 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9371 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9372 __Pyx_GOTREF(__pyx_t_3);
9373 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9377 __pyx_t_4 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
9378 __Pyx_GOTREF(__pyx_t_4);
9380 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
9382 __Pyx_GIVEREF(__pyx_t_7);
9383 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_7);
9384 __Pyx_INCREF(__pyx_n_s_d);
9385 __Pyx_GIVEREF(__pyx_n_s_d);
9386 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_n_s_d);
9388 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9389 __Pyx_GOTREF(__pyx_t_3);
9390 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9392 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9393 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
9394 __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
9396 __Pyx_BufFmt_StackElem __pyx_stack[1];
9397 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9398 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
9399 __PYX_ERR(0, 333, __pyx_L1_error)
9400 }
else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
9404 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
9414 __pyx_t_2 = __pyx_v_nElements_global;
9415 __pyx_t_11 = __pyx_t_2;
9416 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
9417 __pyx_v_eN = __pyx_t_12;
9426 __pyx_t_1 = __pyx_v_eN;
9428 if (__pyx_t_1 < 0) {
9429 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9430 if (unlikely(__pyx_t_1 < 0)) __pyx_t_13 = 0;
9431 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_13 = 0;
9432 if (unlikely(__pyx_t_13 != -1)) {
9433 __Pyx_RaiseBufferIndexError(__pyx_t_13);
9434 __PYX_ERR(0, 337, __pyx_L1_error)
9436 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9445 __pyx_t_13 = __pyx_v_nnz;
9446 __pyx_t_14 = __pyx_t_13;
9447 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
9448 __pyx_v_ii = __pyx_t_15;
9457 __pyx_t_1 = __pyx_v_matID;
9458 __pyx_t_16 = __pyx_v_ii;
9460 if (__pyx_t_1 < 0) {
9461 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9462 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 0;
9463 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_17 = 0;
9464 if (__pyx_t_16 < 0) {
9465 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9466 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
9467 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_17 = 1;
9468 if (unlikely(__pyx_t_17 != -1)) {
9469 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9470 __PYX_ERR(0, 339, __pyx_L1_error)
9472 __pyx_t_18 = __pyx_v_ii;
9474 if (__pyx_t_18 < 0) {
9475 __pyx_t_18 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9476 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
9477 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_17 = 0;
9478 if (unlikely(__pyx_t_17 != -1)) {
9479 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9480 __PYX_ERR(0, 339, __pyx_L1_error)
9482 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9492 __pyx_t_13 = __pyx_v_nElementBoundaries_element;
9493 __pyx_t_14 = __pyx_t_13;
9494 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
9495 __pyx_v_ebN = __pyx_t_15;
9504 __pyx_t_16 = __pyx_v_eN;
9505 __pyx_t_1 = __pyx_v_ebN;
9507 if (__pyx_t_16 < 0) {
9508 __pyx_t_16 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
9509 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
9510 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_17 = 0;
9511 if (__pyx_t_1 < 0) {
9512 __pyx_t_1 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
9513 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 1;
9514 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_17 = 1;
9515 if (unlikely(__pyx_t_17 != -1)) {
9516 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9517 __PYX_ERR(0, 341, __pyx_L1_error)
9519 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_1, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
9528 __pyx_t_17 = __pyx_v_nnz;
9529 __pyx_t_19 = __pyx_t_17;
9530 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9531 __pyx_v_ii = __pyx_t_20;
9540 __pyx_t_1 = __pyx_v_ii;
9542 if (__pyx_t_1 < 0) {
9543 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9544 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9545 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9546 if (unlikely(__pyx_t_21 != -1)) {
9547 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9548 __PYX_ERR(0, 343, __pyx_L1_error)
9550 __pyx_t_16 = __pyx_v_ii;
9552 if (__pyx_t_16 < 0) {
9553 __pyx_t_16 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9554 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9555 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9556 if (unlikely(__pyx_t_21 != -1)) {
9557 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9558 __PYX_ERR(0, 343, __pyx_L1_error)
9560 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides));
9570 __pyx_t_22 = ((__pyx_v_eN_neighbor >= 0) != 0);
9580 __pyx_t_1 = __pyx_v_eN_neighbor;
9582 if (__pyx_t_1 < 0) {
9583 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9584 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 0;
9585 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_17 = 0;
9586 if (unlikely(__pyx_t_17 != -1)) {
9587 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9588 __PYX_ERR(0, 345, __pyx_L1_error)
9590 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9599 __pyx_t_17 = __pyx_v_nnz;
9600 __pyx_t_19 = __pyx_t_17;
9601 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9602 __pyx_v_ii = __pyx_t_20;
9611 __pyx_t_1 = __pyx_v_matID_neig;
9612 __pyx_t_16 = __pyx_v_ii;
9614 if (__pyx_t_1 < 0) {
9615 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9616 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9617 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_21 = 0;
9618 if (__pyx_t_16 < 0) {
9619 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9620 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 1;
9621 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_21 = 1;
9622 if (unlikely(__pyx_t_21 != -1)) {
9623 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9624 __PYX_ERR(0, 347, __pyx_L1_error)
9626 __pyx_t_18 = __pyx_v_ii;
9628 if (__pyx_t_18 < 0) {
9629 __pyx_t_18 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9630 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9631 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9632 if (unlikely(__pyx_t_21 != -1)) {
9633 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9634 __PYX_ERR(0, 347, __pyx_L1_error)
9636 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9655 __pyx_t_17 = __pyx_v_nnz;
9656 __pyx_t_19 = __pyx_t_17;
9657 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9658 __pyx_v_ii = __pyx_t_20;
9667 __pyx_t_16 = __pyx_v_ii;
9669 if (__pyx_t_16 < 0) {
9670 __pyx_t_16 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9671 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9672 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9673 if (unlikely(__pyx_t_21 != -1)) {
9674 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9675 __PYX_ERR(0, 349, __pyx_L1_error)
9677 __pyx_t_1 = __pyx_v_ii;
9679 if (__pyx_t_1 < 0) {
9680 __pyx_t_1 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9681 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9682 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9683 if (unlikely(__pyx_t_21 != -1)) {
9684 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9685 __PYX_ERR(0, 349, __pyx_L1_error)
9687 __pyx_t_23 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
9688 __pyx_t_1 = __pyx_v_ii;
9690 if (__pyx_t_1 < 0) {
9691 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9692 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9693 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9694 if (unlikely(__pyx_t_21 != -1)) {
9695 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9696 __PYX_ERR(0, 349, __pyx_L1_error)
9698 __pyx_t_16 = __pyx_v_ii;
9700 if (__pyx_t_16 < 0) {
9701 __pyx_t_16 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9702 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9703 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9704 if (unlikely(__pyx_t_21 != -1)) {
9705 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9706 __PYX_ERR(0, 349, __pyx_L1_error)
9708 __pyx_t_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
9709 if (unlikely(__pyx_t_24 == 0)) {
9710 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9711 __PYX_ERR(0, 349, __pyx_L1_error)
9713 __pyx_t_16 = __pyx_v_ii;
9715 if (__pyx_t_16 < 0) {
9716 __pyx_t_16 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9717 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9718 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_21 = 0;
9719 if (unlikely(__pyx_t_21 != -1)) {
9720 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9721 __PYX_ERR(0, 349, __pyx_L1_error)
9723 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_23 / __pyx_t_24);
9732 __pyx_t_16 = __pyx_v_ii;
9734 if (__pyx_t_16 < 0) {
9735 __pyx_t_16 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9736 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9737 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_21 = 0;
9738 if (unlikely(__pyx_t_21 != -1)) {
9739 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9740 __PYX_ERR(0, 350, __pyx_L1_error)
9742 __pyx_t_1 = __pyx_v_eN;
9743 __pyx_t_18 = __pyx_v_ebN;
9744 __pyx_t_25 = __pyx_v_ii;
9746 if (__pyx_t_1 < 0) {
9747 __pyx_t_1 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
9748 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9749 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_21 = 0;
9750 if (__pyx_t_18 < 0) {
9751 __pyx_t_18 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
9752 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 1;
9753 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_21 = 1;
9754 if (__pyx_t_25 < 0) {
9755 __pyx_t_25 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
9756 if (unlikely(__pyx_t_25 < 0)) __pyx_t_21 = 2;
9757 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_21 = 2;
9758 if (unlikely(__pyx_t_21 != -1)) {
9759 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9760 __PYX_ERR(0, 350, __pyx_L1_error)
9762 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_avg.diminfo[0].strides));
9772 __pyx_t_17 = __pyx_v_nSpace;
9773 __pyx_t_19 = __pyx_t_17;
9774 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9775 __pyx_v_I = __pyx_t_20;
9784 __pyx_t_16 = __pyx_v_eN;
9785 __pyx_t_25 = __pyx_v_ebN;
9786 __pyx_t_18 = __pyx_v_I;
9788 if (__pyx_t_16 < 0) {
9789 __pyx_t_16 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9790 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9791 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_21 = 0;
9792 if (__pyx_t_25 < 0) {
9793 __pyx_t_25 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9794 if (unlikely(__pyx_t_25 < 0)) __pyx_t_21 = 1;
9795 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_21 = 1;
9796 if (__pyx_t_18 < 0) {
9797 __pyx_t_18 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9798 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 2;
9799 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_21 = 2;
9800 if (unlikely(__pyx_t_21 != -1)) {
9801 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9802 __PYX_ERR(0, 352, __pyx_L1_error)
9804 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
9813 __pyx_t_18 = (__pyx_v_I + 1);
9815 if (__pyx_t_18 < 0) {
9816 __pyx_t_18 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9817 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9818 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_21 = 0;
9819 if (unlikely(__pyx_t_21 != -1)) {
9820 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9821 __PYX_ERR(0, 353, __pyx_L1_error)
9823 __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9824 __pyx_t_18 = __pyx_v_I;
9826 if (__pyx_t_18 < 0) {
9827 __pyx_t_18 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9828 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9829 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_21 = 0;
9830 if (unlikely(__pyx_t_21 != -1)) {
9831 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9832 __PYX_ERR(0, 353, __pyx_L1_error)
9834 __pyx_t_27 = __pyx_t_26;
9835 for (__pyx_t_21 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_21 < __pyx_t_27; __pyx_t_21+=1) {
9836 __pyx_v_ii = __pyx_t_21;
9845 __pyx_t_25 = __pyx_v_ii;
9847 if (__pyx_t_25 < 0) {
9848 __pyx_t_25 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9849 if (unlikely(__pyx_t_25 < 0)) __pyx_t_28 = 0;
9850 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_28 = 0;
9851 if (unlikely(__pyx_t_28 != -1)) {
9852 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9853 __PYX_ERR(0, 354, __pyx_L1_error)
9855 __pyx_t_16 = __pyx_v_ii;
9857 if (__pyx_t_16 < 0) {
9858 __pyx_t_16 += __pyx_pybuffernd_colind.diminfo[0].shape;
9859 if (unlikely(__pyx_t_16 < 0)) __pyx_t_28 = 0;
9860 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_28 = 0;
9861 if (unlikely(__pyx_t_28 != -1)) {
9862 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9863 __PYX_ERR(0, 354, __pyx_L1_error)
9865 __pyx_t_1 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_colind.diminfo[0].strides));
9867 if (__pyx_t_1 < 0) {
9868 __pyx_t_1 += __pyx_pybuffernd_gravity.diminfo[0].shape;
9869 if (unlikely(__pyx_t_1 < 0)) __pyx_t_28 = 0;
9870 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_28 = 0;
9871 if (unlikely(__pyx_t_28 != -1)) {
9872 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9873 __PYX_ERR(0, 354, __pyx_L1_error)
9875 __pyx_t_29 = __pyx_v_eN;
9876 __pyx_t_30 = __pyx_v_ebN;
9877 __pyx_t_31 = __pyx_v_I;
9879 if (__pyx_t_29 < 0) {
9880 __pyx_t_29 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9881 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
9882 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_28 = 0;
9883 if (__pyx_t_30 < 0) {
9884 __pyx_t_30 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9885 if (unlikely(__pyx_t_30 < 0)) __pyx_t_28 = 1;
9886 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_28 = 1;
9887 if (__pyx_t_31 < 0) {
9888 __pyx_t_31 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9889 if (unlikely(__pyx_t_31 < 0)) __pyx_t_28 = 2;
9890 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_28 = 2;
9891 if (unlikely(__pyx_t_28 != -1)) {
9892 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9893 __PYX_ERR(0, 354, __pyx_L1_error)
9895 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gravity.diminfo[0].strides)));
9910 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9913 __Pyx_XDECREF(__pyx_t_3);
9914 __Pyx_XDECREF(__pyx_t_4);
9915 __Pyx_XDECREF(__pyx_t_5);
9916 __Pyx_XDECREF(__pyx_t_6);
9917 __Pyx_XDECREF(__pyx_t_7);
9918 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9919 __Pyx_PyThreadState_declare
9920 __Pyx_PyThreadState_assign
9921 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9922 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9923 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9924 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9925 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9926 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9927 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9928 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9929 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9930 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9931 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9932 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9933 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9934 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
9938 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9939 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9940 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9941 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9942 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9943 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9944 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9945 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9946 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9947 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9948 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9950 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
9951 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
9952 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
9953 __Pyx_XGIVEREF(__pyx_r);
9954 __Pyx_RefNannyFinishContext();
9967 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9968 static char __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM[] =
"\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
9969 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {
"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
9970 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9972 double __pyx_v_beta;
9973 PyArrayObject *__pyx_v_gravity = 0;
9974 PyArrayObject *__pyx_v_alpha = 0;
9975 PyArrayObject *__pyx_v_n = 0;
9976 PyArrayObject *__pyx_v_thetaR = 0;
9977 PyArrayObject *__pyx_v_thetaSR = 0;
9979 int __pyx_v_nElements_global;
9980 int __pyx_v_nElementBoundaries_element;
9981 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
9982 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
9983 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
9984 int __pyx_v_nDOF_trial_element;
9985 PyArrayObject *__pyx_v_u_l2g = 0;
9986 PyArrayObject *__pyx_v_u_dof = 0;
9987 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
9988 PyArrayObject *__pyx_v_q_u = 0;
9989 PyArrayObject *__pyx_v_q_mass = 0;
9990 PyArrayObject *__pyx_v_q_dmass = 0;
9991 PyArrayObject *__pyx_v_q_r = 0;
9992 PyArrayObject *__pyx_v_q_kr = 0;
9993 PyArrayObject *__pyx_v_q_dkr = 0;
9994 PyArrayObject *__pyx_v_q_kr_up = 0;
9995 int __pyx_lineno = 0;
9996 const char *__pyx_filename = NULL;
9997 int __pyx_clineno = 0;
9998 PyObject *__pyx_r = 0;
9999 __Pyx_RefNannyDeclarations
10000 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
10002 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_beta,&__pyx_n_s_gravity,&__pyx_n_s_alpha,&__pyx_n_s_n,&__pyx_n_s_thetaR,&__pyx_n_s_thetaSR,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_u_l2g,&__pyx_n_s_u_dof,&__pyx_n_s_q_x,&__pyx_n_s_q_u,&__pyx_n_s_q_mass,&__pyx_n_s_q_dmass,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,0};
10003 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
10004 if (unlikely(__pyx_kwds)) {
10005 Py_ssize_t kw_args;
10006 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10007 switch (pos_args) {
10008 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10009 CYTHON_FALLTHROUGH;
10010 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10011 CYTHON_FALLTHROUGH;
10012 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10013 CYTHON_FALLTHROUGH;
10014 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10015 CYTHON_FALLTHROUGH;
10016 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10017 CYTHON_FALLTHROUGH;
10018 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10019 CYTHON_FALLTHROUGH;
10020 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10021 CYTHON_FALLTHROUGH;
10022 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10023 CYTHON_FALLTHROUGH;
10024 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10025 CYTHON_FALLTHROUGH;
10026 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10027 CYTHON_FALLTHROUGH;
10028 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10029 CYTHON_FALLTHROUGH;
10030 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10031 CYTHON_FALLTHROUGH;
10032 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10033 CYTHON_FALLTHROUGH;
10034 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10035 CYTHON_FALLTHROUGH;
10036 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10037 CYTHON_FALLTHROUGH;
10038 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10039 CYTHON_FALLTHROUGH;
10040 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10041 CYTHON_FALLTHROUGH;
10042 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10043 CYTHON_FALLTHROUGH;
10044 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10045 CYTHON_FALLTHROUGH;
10046 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10047 CYTHON_FALLTHROUGH;
10048 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10049 CYTHON_FALLTHROUGH;
10050 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10051 CYTHON_FALLTHROUGH;
10052 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10053 CYTHON_FALLTHROUGH;
10054 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10055 CYTHON_FALLTHROUGH;
10057 default:
goto __pyx_L5_argtuple_error;
10059 kw_args = PyDict_Size(__pyx_kwds);
10060 switch (pos_args) {
10062 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
10063 else goto __pyx_L5_argtuple_error;
10064 CYTHON_FALLTHROUGH;
10066 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
10068 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 1); __PYX_ERR(0, 359, __pyx_L3_error)
10070 CYTHON_FALLTHROUGH;
10072 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
10074 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 2); __PYX_ERR(0, 359, __pyx_L3_error)
10076 CYTHON_FALLTHROUGH;
10078 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
10080 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 3); __PYX_ERR(0, 359, __pyx_L3_error)
10082 CYTHON_FALLTHROUGH;
10084 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
10086 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 4); __PYX_ERR(0, 359, __pyx_L3_error)
10088 CYTHON_FALLTHROUGH;
10090 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaR)) != 0)) kw_args--;
10092 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 5); __PYX_ERR(0, 359, __pyx_L3_error)
10094 CYTHON_FALLTHROUGH;
10096 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaSR)) != 0)) kw_args--;
10098 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 6); __PYX_ERR(0, 359, __pyx_L3_error)
10100 CYTHON_FALLTHROUGH;
10102 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
10104 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 7); __PYX_ERR(0, 359, __pyx_L3_error)
10106 CYTHON_FALLTHROUGH;
10108 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
10110 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 8); __PYX_ERR(0, 359, __pyx_L3_error)
10112 CYTHON_FALLTHROUGH;
10114 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
10116 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 9); __PYX_ERR(0, 359, __pyx_L3_error)
10118 CYTHON_FALLTHROUGH;
10120 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
10122 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 10); __PYX_ERR(0, 359, __pyx_L3_error)
10124 CYTHON_FALLTHROUGH;
10126 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
10128 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 11); __PYX_ERR(0, 359, __pyx_L3_error)
10130 CYTHON_FALLTHROUGH;
10132 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
10134 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 12); __PYX_ERR(0, 359, __pyx_L3_error)
10136 CYTHON_FALLTHROUGH;
10138 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
10140 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 13); __PYX_ERR(0, 359, __pyx_L3_error)
10142 CYTHON_FALLTHROUGH;
10144 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_l2g)) != 0)) kw_args--;
10146 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 14); __PYX_ERR(0, 359, __pyx_L3_error)
10148 CYTHON_FALLTHROUGH;
10150 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_dof)) != 0)) kw_args--;
10152 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 15); __PYX_ERR(0, 359, __pyx_L3_error)
10154 CYTHON_FALLTHROUGH;
10156 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_x)) != 0)) kw_args--;
10158 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 16); __PYX_ERR(0, 359, __pyx_L3_error)
10160 CYTHON_FALLTHROUGH;
10162 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
10164 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 17); __PYX_ERR(0, 359, __pyx_L3_error)
10166 CYTHON_FALLTHROUGH;
10168 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mass)) != 0)) kw_args--;
10170 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 18); __PYX_ERR(0, 359, __pyx_L3_error)
10172 CYTHON_FALLTHROUGH;
10174 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmass)) != 0)) kw_args--;
10176 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 19); __PYX_ERR(0, 359, __pyx_L3_error)
10178 CYTHON_FALLTHROUGH;
10180 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
10182 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 20); __PYX_ERR(0, 359, __pyx_L3_error)
10184 CYTHON_FALLTHROUGH;
10186 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
10188 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 21); __PYX_ERR(0, 359, __pyx_L3_error)
10190 CYTHON_FALLTHROUGH;
10192 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
10194 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 22); __PYX_ERR(0, 359, __pyx_L3_error)
10196 CYTHON_FALLTHROUGH;
10198 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
10200 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 23); __PYX_ERR(0, 359, __pyx_L3_error)
10203 if (unlikely(kw_args > 0)) {
10204 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_VGM") < 0)) __PYX_ERR(0, 359, __pyx_L3_error)
10206 }
else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
10207 goto __pyx_L5_argtuple_error;
10209 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10210 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10211 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10212 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10213 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10214 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10215 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10216 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10217 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10218 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10219 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10220 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10221 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10222 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10223 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10224 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10225 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10226 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10227 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10228 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10229 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10230 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10231 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10232 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10234 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error)
10235 __pyx_v_beta = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
10236 __pyx_v_gravity = ((PyArrayObject *)values[2]);
10237 __pyx_v_alpha = ((PyArrayObject *)values[3]);
10238 __pyx_v_n = ((PyArrayObject *)values[4]);
10239 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
10240 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
10241 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
10242 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
10243 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error)
10244 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
10245 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
10246 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
10247 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[13]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L3_error)
10248 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
10249 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
10250 __pyx_v_q_x = ((PyArrayObject *)values[16]);
10251 __pyx_v_q_u = ((PyArrayObject *)values[17]);
10252 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
10253 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
10254 __pyx_v_q_r = ((PyArrayObject *)values[20]);
10255 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
10256 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
10257 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
10259 goto __pyx_L4_argument_unpacking_done;
10260 __pyx_L5_argtuple_error:;
10261 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error)
10263 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
10264 __Pyx_RefNannyFinishContext();
10266 __pyx_L4_argument_unpacking_done:;
10267 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 361, __pyx_L1_error)
10268 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_ptype_5numpy_ndarray, 1,
"alpha", 0))) __PYX_ERR(0, 362, __pyx_L1_error)
10269 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
10270 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_ptype_5numpy_ndarray, 1,
"thetaR", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
10271 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_ptype_5numpy_ndarray, 1,
"thetaSR", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
10272 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 370, __pyx_L1_error)
10273 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
10274 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
10275 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_ptype_5numpy_ndarray, 1,
"u_l2g", 0))) __PYX_ERR(0, 375, __pyx_L1_error)
10276 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_ptype_5numpy_ndarray, 1,
"u_dof", 0))) __PYX_ERR(0, 376, __pyx_L1_error)
10277 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_ptype_5numpy_ndarray, 1,
"q_x", 0))) __PYX_ERR(0, 378, __pyx_L1_error)
10278 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 379, __pyx_L1_error)
10279 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_ptype_5numpy_ndarray, 1,
"q_mass", 0))) __PYX_ERR(0, 380, __pyx_L1_error)
10280 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_ptype_5numpy_ndarray, 1,
"q_dmass", 0))) __PYX_ERR(0, 381, __pyx_L1_error)
10281 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 382, __pyx_L1_error)
10282 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
10283 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 384, __pyx_L1_error)
10284 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 385, __pyx_L1_error)
10285 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
10292 __Pyx_RefNannyFinishContext();
10296 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up) {
10297 PyObject *__pyx_v_q = NULL;
10298 double __pyx_v_psiC;
10299 double __pyx_v_pcBar;
10300 double __pyx_v_pcBar_n;
10301 double __pyx_v_pcBar_nM1;
10302 double __pyx_v_pcBar_nM2;
10303 double __pyx_v_onePlus_pcBar_n;
10304 double __pyx_v_sBar;
10305 double __pyx_v_sqrt_sBar;
10306 double __pyx_v_DsBar_DpsiC;
10307 double __pyx_v_thetaW;
10308 double __pyx_v_DthetaW_DpsiC;
10309 double __pyx_v_vBar;
10310 double __pyx_v_vBar2;
10311 double __pyx_v_DvBar_DpsiC;
10312 double __pyx_v_KWr;
10313 double __pyx_v_DKWr_DpsiC;
10314 CYTHON_UNUSED
double __pyx_v_rho2;
10315 double __pyx_v_thetaS;
10316 double __pyx_v_rhom;
10317 double __pyx_v_drhom;
10319 double __pyx_v_u_j;
10320 double __pyx_v_u_eN;
10321 double __pyx_v_u_neig;
10322 double __pyx_v_kr_eN;
10323 double __pyx_v_kr_neig;
10324 double __pyx_v_phi_eN;
10325 double __pyx_v_phi_neig;
10327 int __pyx_v_eN_neighbor;
10331 double __pyx_v_nAvgWeight;
10332 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
10333 __Pyx_Buffer __pyx_pybuffer_alpha;
10334 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
10335 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
10336 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
10337 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
10338 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
10339 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
10340 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
10341 __Pyx_Buffer __pyx_pybuffer_gravity;
10342 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
10343 __Pyx_Buffer __pyx_pybuffer_n;
10344 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
10345 __Pyx_Buffer __pyx_pybuffer_q_dkr;
10346 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
10347 __Pyx_Buffer __pyx_pybuffer_q_dmass;
10348 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
10349 __Pyx_Buffer __pyx_pybuffer_q_kr;
10350 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
10351 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
10352 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
10353 __Pyx_Buffer __pyx_pybuffer_q_mass;
10354 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
10355 __Pyx_Buffer __pyx_pybuffer_q_r;
10356 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
10357 __Pyx_Buffer __pyx_pybuffer_q_u;
10358 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
10359 __Pyx_Buffer __pyx_pybuffer_q_x;
10360 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
10361 __Pyx_Buffer __pyx_pybuffer_thetaR;
10362 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
10363 __Pyx_Buffer __pyx_pybuffer_thetaSR;
10364 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
10365 __Pyx_Buffer __pyx_pybuffer_u_dof;
10366 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
10367 __Pyx_Buffer __pyx_pybuffer_u_l2g;
10368 PyObject *__pyx_r = NULL;
10369 __Pyx_RefNannyDeclarations
10370 PyObject *__pyx_t_1 = NULL;
10371 PyObject *__pyx_t_2 = NULL;
10372 Py_ssize_t __pyx_t_3;
10373 PyObject *__pyx_t_4 = NULL;
10374 PyObject *__pyx_t_5 = NULL;
10380 Py_ssize_t __pyx_t_11;
10384 Py_ssize_t __pyx_t_15;
10386 Py_ssize_t __pyx_t_17;
10387 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_18;
10388 PyObject *__pyx_t_19 = NULL;
10389 PyObject *__pyx_t_20 = NULL;
10390 int __pyx_lineno = 0;
10391 const char *__pyx_filename = NULL;
10392 int __pyx_clineno = 0;
10393 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM", 0);
10394 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
10395 __pyx_pybuffer_gravity.refcount = 0;
10396 __pyx_pybuffernd_gravity.data = NULL;
10397 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
10398 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
10399 __pyx_pybuffer_alpha.refcount = 0;
10400 __pyx_pybuffernd_alpha.data = NULL;
10401 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
10402 __pyx_pybuffer_n.pybuffer.buf = NULL;
10403 __pyx_pybuffer_n.refcount = 0;
10404 __pyx_pybuffernd_n.data = NULL;
10405 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
10406 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
10407 __pyx_pybuffer_thetaR.refcount = 0;
10408 __pyx_pybuffernd_thetaR.data = NULL;
10409 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
10410 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
10411 __pyx_pybuffer_thetaSR.refcount = 0;
10412 __pyx_pybuffernd_thetaSR.data = NULL;
10413 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
10414 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
10415 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
10416 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
10417 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
10418 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
10419 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
10420 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
10421 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
10422 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
10423 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
10424 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
10425 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
10426 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
10427 __pyx_pybuffer_u_l2g.refcount = 0;
10428 __pyx_pybuffernd_u_l2g.data = NULL;
10429 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
10430 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
10431 __pyx_pybuffer_u_dof.refcount = 0;
10432 __pyx_pybuffernd_u_dof.data = NULL;
10433 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
10434 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
10435 __pyx_pybuffer_q_x.refcount = 0;
10436 __pyx_pybuffernd_q_x.data = NULL;
10437 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
10438 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
10439 __pyx_pybuffer_q_u.refcount = 0;
10440 __pyx_pybuffernd_q_u.data = NULL;
10441 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
10442 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
10443 __pyx_pybuffer_q_mass.refcount = 0;
10444 __pyx_pybuffernd_q_mass.data = NULL;
10445 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
10446 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
10447 __pyx_pybuffer_q_dmass.refcount = 0;
10448 __pyx_pybuffernd_q_dmass.data = NULL;
10449 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
10450 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
10451 __pyx_pybuffer_q_r.refcount = 0;
10452 __pyx_pybuffernd_q_r.data = NULL;
10453 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
10454 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
10455 __pyx_pybuffer_q_kr.refcount = 0;
10456 __pyx_pybuffernd_q_kr.data = NULL;
10457 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
10458 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
10459 __pyx_pybuffer_q_dkr.refcount = 0;
10460 __pyx_pybuffernd_q_dkr.data = NULL;
10461 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
10462 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
10463 __pyx_pybuffer_q_kr_up.refcount = 0;
10464 __pyx_pybuffernd_q_kr_up.data = NULL;
10465 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
10467 __Pyx_BufFmt_StackElem __pyx_stack[1];
10468 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10470 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
10472 __Pyx_BufFmt_StackElem __pyx_stack[1];
10473 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10475 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
10477 __Pyx_BufFmt_StackElem __pyx_stack[1];
10478 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10480 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
10482 __Pyx_BufFmt_StackElem __pyx_stack[1];
10483 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10485 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
10487 __Pyx_BufFmt_StackElem __pyx_stack[1];
10488 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10490 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
10492 __Pyx_BufFmt_StackElem __pyx_stack[1];
10493 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10495 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
10497 __Pyx_BufFmt_StackElem __pyx_stack[1];
10498 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10500 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
10502 __Pyx_BufFmt_StackElem __pyx_stack[1];
10503 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10505 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
10507 __Pyx_BufFmt_StackElem __pyx_stack[1];
10508 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10510 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
10512 __Pyx_BufFmt_StackElem __pyx_stack[1];
10513 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10515 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
10517 __Pyx_BufFmt_StackElem __pyx_stack[1];
10518 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10520 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
10522 __Pyx_BufFmt_StackElem __pyx_stack[1];
10523 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10525 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
10527 __Pyx_BufFmt_StackElem __pyx_stack[1];
10528 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10530 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
10532 __Pyx_BufFmt_StackElem __pyx_stack[1];
10533 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10535 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
10537 __Pyx_BufFmt_StackElem __pyx_stack[1];
10538 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10540 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
10542 __Pyx_BufFmt_StackElem __pyx_stack[1];
10543 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10545 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
10547 __Pyx_BufFmt_StackElem __pyx_stack[1];
10548 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10550 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
10552 __Pyx_BufFmt_StackElem __pyx_stack[1];
10553 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10555 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
10564 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10565 __Pyx_GOTREF(__pyx_t_1);
10566 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
10567 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
10568 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
10569 __Pyx_INCREF(((PyObject *)__pyx_v_q_mass));
10570 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mass));
10571 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass));
10572 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
10573 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
10574 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r));
10575 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
10576 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
10577 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr));
10578 __Pyx_INCREF(((PyObject *)__pyx_v_q_dkr));
10579 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_dkr));
10580 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr));
10581 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10582 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10584 if (__pyx_t_3 >= 5)
break;
10585 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10586 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
10588 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10589 __Pyx_GOTREF(__pyx_t_1);
10591 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
10601 #ifndef CYTHON_WITHOUT_ASSERTIONS
10602 if (unlikely(!Py_OptimizeFlag)) {
10603 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10604 __Pyx_GOTREF(__pyx_t_1);
10605 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
10606 __Pyx_GOTREF(__pyx_t_4);
10607 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10608 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10609 __Pyx_GOTREF(__pyx_t_1);
10610 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
10611 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10613 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
10614 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10615 if (unlikely(!__pyx_t_6)) {
10616 PyErr_SetNone(PyExc_AssertionError);
10617 __PYX_ERR(0, 400, __pyx_L1_error)
10630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10639 #ifndef CYTHON_WITHOUT_ASSERTIONS
10640 if (unlikely(!Py_OptimizeFlag)) {
10641 if (unlikely(!((__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1)) != 0))) {
10642 PyErr_SetNone(PyExc_AssertionError);
10643 __PYX_ERR(0, 401, __pyx_L1_error)
10655 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
10664 __pyx_t_7 = (__pyx_v_nSpace + 1.);
10665 if (unlikely(__pyx_t_7 == 0)) {
10666 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10667 __PYX_ERR(0, 409, __pyx_L1_error)
10669 __pyx_v_nAvgWeight = (1.0 / __pyx_t_7);
10678 __pyx_t_8 = __pyx_v_nElements_global;
10679 __pyx_t_9 = __pyx_t_8;
10680 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10681 __pyx_v_eN = __pyx_t_10;
10690 __pyx_t_11 = __pyx_v_eN;
10692 if (__pyx_t_11 < 0) {
10693 __pyx_t_11 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
10694 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
10695 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_12 = 0;
10696 if (unlikely(__pyx_t_12 != -1)) {
10697 __Pyx_RaiseBufferIndexError(__pyx_t_12);
10698 __PYX_ERR(0, 413, __pyx_L1_error)
10700 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
10709 __pyx_t_12 = __pyx_v_nDOF_trial_element;
10710 __pyx_t_13 = __pyx_t_12;
10711 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
10712 __pyx_v_j = __pyx_t_14;
10721 __pyx_t_11 = __pyx_v_eN;
10722 __pyx_t_15 = __pyx_v_j;
10724 if (__pyx_t_11 < 0) {
10725 __pyx_t_11 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
10726 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10727 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_16 = 0;
10728 if (__pyx_t_15 < 0) {
10729 __pyx_t_15 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
10730 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
10731 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_16 = 1;
10732 if (unlikely(__pyx_t_16 != -1)) {
10733 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10734 __PYX_ERR(0, 415, __pyx_L1_error)
10736 __pyx_t_17 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
10738 if (__pyx_t_17 < 0) {
10739 __pyx_t_17 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
10740 if (unlikely(__pyx_t_17 < 0)) __pyx_t_16 = 0;
10741 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_16 = 0;
10742 if (unlikely(__pyx_t_16 != -1)) {
10743 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10744 __PYX_ERR(0, 415, __pyx_L1_error)
10746 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_u_dof.diminfo[0].strides));
10755 __pyx_t_15 = __pyx_v_eN;
10756 __pyx_t_11 = __pyx_v_j;
10758 if (__pyx_t_15 < 0) {
10759 __pyx_t_15 += __pyx_pybuffernd_q_u.diminfo[0].shape;
10760 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10761 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_16 = 0;
10762 if (__pyx_t_11 < 0) {
10763 __pyx_t_11 += __pyx_pybuffernd_q_u.diminfo[1].shape;
10764 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
10765 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_16 = 1;
10766 if (unlikely(__pyx_t_16 != -1)) {
10767 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10768 __PYX_ERR(0, 416, __pyx_L1_error)
10770 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
10779 __pyx_v_psiC = (-__pyx_v_u_j);
10788 __pyx_t_11 = __pyx_v_matID;
10790 if (__pyx_t_11 < 0) {
10791 __pyx_t_11 += __pyx_pybuffernd_n.diminfo[0].shape;
10792 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10793 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10794 if (unlikely(__pyx_t_16 != -1)) {
10795 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10796 __PYX_ERR(0, 420, __pyx_L1_error)
10798 __pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_n.diminfo[0].strides));
10799 if (unlikely(__pyx_t_18 == 0)) {
10800 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10801 __PYX_ERR(0, 420, __pyx_L1_error)
10803 __pyx_v_m = (1.0 - (1.0 / __pyx_t_18));
10812 __pyx_t_11 = __pyx_v_matID;
10814 if (__pyx_t_11 < 0) {
10815 __pyx_t_11 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10816 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10817 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_16 = 0;
10818 if (unlikely(__pyx_t_16 != -1)) {
10819 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10820 __PYX_ERR(0, 421, __pyx_L1_error)
10822 __pyx_t_15 = __pyx_v_matID;
10824 if (__pyx_t_15 < 0) {
10825 __pyx_t_15 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10826 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10827 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
10828 if (unlikely(__pyx_t_16 != -1)) {
10829 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10830 __PYX_ERR(0, 421, __pyx_L1_error)
10832 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
10841 __pyx_t_6 = ((__pyx_v_psiC > 0.0) != 0);
10851 __pyx_t_15 = __pyx_v_matID;
10853 if (__pyx_t_15 < 0) {
10854 __pyx_t_15 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10855 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10856 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10857 if (unlikely(__pyx_t_16 != -1)) {
10858 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10859 __PYX_ERR(0, 423, __pyx_L1_error)
10861 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
10870 __pyx_t_15 = __pyx_v_matID;
10872 if (__pyx_t_15 < 0) {
10873 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[0].shape;
10874 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10875 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10876 if (unlikely(__pyx_t_16 != -1)) {
10877 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10878 __PYX_ERR(0, 424, __pyx_L1_error)
10880 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
10889 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
10898 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
10907 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
10916 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
10925 __pyx_t_15 = __pyx_v_matID;
10927 if (__pyx_t_15 < 0) {
10928 __pyx_t_15 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10929 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10930 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10931 if (unlikely(__pyx_t_16 != -1)) {
10932 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10933 __PYX_ERR(0, 431, __pyx_L1_error)
10935 __pyx_t_11 = __pyx_v_matID;
10937 if (__pyx_t_11 < 0) {
10938 __pyx_t_11 += __pyx_pybuffernd_n.diminfo[0].shape;
10939 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10940 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10941 if (unlikely(__pyx_t_16 != -1)) {
10942 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10943 __PYX_ERR(0, 431, __pyx_L1_error)
10945 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
10946 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10947 __PYX_ERR(0, 431, __pyx_L1_error)
10949 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
10958 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
10967 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
10976 __pyx_t_11 = __pyx_v_matID;
10978 if (__pyx_t_11 < 0) {
10979 __pyx_t_11 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10980 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10981 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10982 if (unlikely(__pyx_t_16 != -1)) {
10983 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10984 __PYX_ERR(0, 435, __pyx_L1_error)
10986 __pyx_t_15 = __pyx_v_matID;
10988 if (__pyx_t_15 < 0) {
10989 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[0].shape;
10990 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10991 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10992 if (unlikely(__pyx_t_16 != -1)) {
10993 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10994 __PYX_ERR(0, 435, __pyx_L1_error)
10996 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
11005 __pyx_t_15 = __pyx_v_matID;
11007 if (__pyx_t_15 < 0) {
11008 __pyx_t_15 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
11009 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11010 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
11011 if (unlikely(__pyx_t_16 != -1)) {
11012 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11013 __PYX_ERR(0, 437, __pyx_L1_error)
11015 __pyx_t_11 = __pyx_v_matID;
11017 if (__pyx_t_11 < 0) {
11018 __pyx_t_11 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
11019 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11020 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_16 = 0;
11021 if (unlikely(__pyx_t_16 != -1)) {
11022 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11023 __PYX_ERR(0, 437, __pyx_L1_error)
11025 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
11034 __pyx_t_11 = __pyx_v_matID;
11036 if (__pyx_t_11 < 0) {
11037 __pyx_t_11 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
11038 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11039 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
11040 if (unlikely(__pyx_t_16 != -1)) {
11041 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11042 __PYX_ERR(0, 438, __pyx_L1_error)
11044 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
11053 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
11062 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
11071 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
11072 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
11073 __PYX_ERR(0, 442, __pyx_L1_error)
11075 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
11095 __pyx_v_thetaW = __pyx_v_thetaS;
11104 __pyx_v_DthetaW_DpsiC = 0.0;
11122 __pyx_v_DKWr_DpsiC = 0.0;
11133 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
11142 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
11151 __pyx_t_11 = __pyx_v_eN;
11152 __pyx_t_15 = __pyx_v_j;
11154 if (__pyx_t_11 < 0) {
11155 __pyx_t_11 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
11156 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11157 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_16 = 0;
11158 if (__pyx_t_15 < 0) {
11159 __pyx_t_15 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
11160 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11161 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_16 = 1;
11162 if (unlikely(__pyx_t_16 != -1)) {
11163 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11164 __PYX_ERR(0, 451, __pyx_L1_error)
11166 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
11175 __pyx_t_15 = __pyx_v_eN;
11176 __pyx_t_11 = __pyx_v_j;
11178 if (__pyx_t_15 < 0) {
11179 __pyx_t_15 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
11180 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11181 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_16 = 0;
11182 if (__pyx_t_11 < 0) {
11183 __pyx_t_11 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
11184 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11185 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_16 = 1;
11186 if (unlikely(__pyx_t_16 != -1)) {
11187 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11188 __PYX_ERR(0, 452, __pyx_L1_error)
11190 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
11199 __pyx_t_11 = __pyx_v_eN;
11200 __pyx_t_15 = __pyx_v_j;
11202 if (__pyx_t_11 < 0) {
11203 __pyx_t_11 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
11204 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11205 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_16 = 0;
11206 if (__pyx_t_15 < 0) {
11207 __pyx_t_15 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
11208 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11209 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_16 = 1;
11210 if (unlikely(__pyx_t_16 != -1)) {
11211 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11212 __PYX_ERR(0, 454, __pyx_L1_error)
11214 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
11223 __pyx_t_15 = __pyx_v_eN;
11224 __pyx_t_11 = __pyx_v_j;
11226 if (__pyx_t_15 < 0) {
11227 __pyx_t_15 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
11228 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11229 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_16 = 0;
11230 if (__pyx_t_11 < 0) {
11231 __pyx_t_11 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
11232 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11233 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_16 = 1;
11234 if (unlikely(__pyx_t_16 != -1)) {
11235 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11236 __PYX_ERR(0, 455, __pyx_L1_error)
11238 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
11249 __pyx_t_8 = __pyx_v_nElements_global;
11250 __pyx_t_9 = __pyx_t_8;
11251 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
11252 __pyx_v_eN = __pyx_t_10;
11261 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11262 __Pyx_GOTREF(__pyx_t_5);
11263 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11264 __Pyx_GOTREF(__pyx_t_1);
11265 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11266 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11267 __Pyx_GOTREF(__pyx_t_5);
11269 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11270 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
11271 if (likely(__pyx_t_4)) {
11272 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11273 __Pyx_INCREF(__pyx_t_4);
11274 __Pyx_INCREF(
function);
11275 __Pyx_DECREF_SET(__pyx_t_1,
function);
11278 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
11279 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11280 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11281 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11282 __Pyx_GOTREF(__pyx_t_2);
11283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11284 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11285 __Pyx_GOTREF(__pyx_t_1);
11286 __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11287 __Pyx_GOTREF(__pyx_t_5);
11288 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11290 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
11291 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11292 __pyx_v_u_eN = __pyx_t_7;
11301 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11302 __Pyx_GOTREF(__pyx_t_1);
11303 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11304 __Pyx_GOTREF(__pyx_t_2);
11305 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11306 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11307 __Pyx_GOTREF(__pyx_t_1);
11309 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11310 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11311 if (likely(__pyx_t_4)) {
11312 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11313 __Pyx_INCREF(__pyx_t_4);
11314 __Pyx_INCREF(
function);
11315 __Pyx_DECREF_SET(__pyx_t_2,
function);
11318 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
11319 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11321 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
11322 __Pyx_GOTREF(__pyx_t_5);
11323 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11324 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11325 __Pyx_GOTREF(__pyx_t_2);
11326 __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11327 __Pyx_GOTREF(__pyx_t_1);
11328 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11330 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
11331 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11332 __pyx_v_kr_eN = __pyx_t_7;
11341 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_eN);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
11342 __Pyx_GOTREF(__pyx_t_1);
11343 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11344 __Pyx_GOTREF(__pyx_t_5);
11345 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dot);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11346 __Pyx_GOTREF(__pyx_t_4);
11347 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11348 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11349 __Pyx_GOTREF(__pyx_t_5);
11352 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11353 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_4);
11354 if (likely(__pyx_t_19)) {
11355 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11356 __Pyx_INCREF(__pyx_t_19);
11357 __Pyx_INCREF(
function);
11358 __Pyx_DECREF_SET(__pyx_t_4,
function);
11362 #if CYTHON_FAST_PYCALL
11363 if (PyFunction_Check(__pyx_t_4)) {
11364 PyObject *__pyx_temp[3] = {__pyx_t_19, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11365 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11366 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
11367 __Pyx_GOTREF(__pyx_t_2);
11368 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11371 #if CYTHON_FAST_PYCCALL
11372 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11373 PyObject *__pyx_temp[3] = {__pyx_t_19, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11374 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11375 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
11376 __Pyx_GOTREF(__pyx_t_2);
11377 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11381 __pyx_t_20 = PyTuple_New(2+__pyx_t_12);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 465, __pyx_L1_error)
11382 __Pyx_GOTREF(__pyx_t_20);
11384 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL;
11386 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11387 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11388 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_12, ((PyObject *)__pyx_v_gravity));
11389 __Pyx_GIVEREF(__pyx_t_5);
11390 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_12, __pyx_t_5);
11392 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11393 __Pyx_GOTREF(__pyx_t_2);
11394 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11396 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11397 __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11398 __Pyx_GOTREF(__pyx_t_4);
11399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11400 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11401 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
11402 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11403 __pyx_v_phi_eN = __pyx_t_7;
11412 __pyx_t_12 = __pyx_v_nElementBoundaries_element;
11413 __pyx_t_13 = __pyx_t_12;
11414 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
11415 __pyx_v_ebN = __pyx_t_14;
11424 __pyx_t_11 = __pyx_v_eN;
11425 __pyx_t_15 = __pyx_v_ebN;
11427 if (__pyx_t_11 < 0) {
11428 __pyx_t_11 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11429 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11430 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_16 = 0;
11431 if (__pyx_t_15 < 0) {
11432 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11433 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11434 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_16 = 1;
11435 if (unlikely(__pyx_t_16 != -1)) {
11436 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11437 __PYX_ERR(0, 471, __pyx_L1_error)
11439 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
11448 __pyx_t_15 = __pyx_v_eN;
11449 __pyx_t_11 = __pyx_v_ebN;
11451 if (__pyx_t_15 < 0) {
11452 __pyx_t_15 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
11453 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11454 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_16 = 0;
11455 if (__pyx_t_11 < 0) {
11456 __pyx_t_11 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
11457 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11458 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_16 = 1;
11459 if (unlikely(__pyx_t_16 != -1)) {
11460 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11461 __PYX_ERR(0, 472, __pyx_L1_error)
11463 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
11472 __pyx_t_6 = ((__pyx_v_eN_neighbor >= 0) != 0);
11482 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11483 __Pyx_GOTREF(__pyx_t_2);
11484 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11485 __Pyx_GOTREF(__pyx_t_1);
11486 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11487 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11488 __Pyx_GOTREF(__pyx_t_2);
11490 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11491 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
11492 if (likely(__pyx_t_20)) {
11493 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11494 __Pyx_INCREF(__pyx_t_20);
11495 __Pyx_INCREF(
function);
11496 __Pyx_DECREF_SET(__pyx_t_1,
function);
11499 __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_20, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
11500 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
11501 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11502 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
11503 __Pyx_GOTREF(__pyx_t_4);
11504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11505 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11506 __Pyx_GOTREF(__pyx_t_1);
11507 __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11508 __Pyx_GOTREF(__pyx_t_2);
11509 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11511 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error)
11512 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11513 __pyx_v_u_neig = __pyx_t_7;
11522 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11523 __Pyx_GOTREF(__pyx_t_1);
11524 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11525 __Pyx_GOTREF(__pyx_t_4);
11526 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11527 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11528 __Pyx_GOTREF(__pyx_t_1);
11530 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11531 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4);
11532 if (likely(__pyx_t_20)) {
11533 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11534 __Pyx_INCREF(__pyx_t_20);
11535 __Pyx_INCREF(
function);
11536 __Pyx_DECREF_SET(__pyx_t_4,
function);
11539 __pyx_t_2 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_20, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1);
11540 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
11541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11542 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11543 __Pyx_GOTREF(__pyx_t_2);
11544 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11545 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11546 __Pyx_GOTREF(__pyx_t_4);
11547 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11548 __Pyx_GOTREF(__pyx_t_1);
11549 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11550 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11551 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error)
11552 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11553 __pyx_v_kr_neig = __pyx_t_7;
11562 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_neig);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11563 __Pyx_GOTREF(__pyx_t_1);
11564 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11565 __Pyx_GOTREF(__pyx_t_2);
11566 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 477, __pyx_L1_error)
11567 __Pyx_GOTREF(__pyx_t_20);
11568 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11569 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11570 __Pyx_GOTREF(__pyx_t_2);
11573 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
11574 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_20);
11575 if (likely(__pyx_t_5)) {
11576 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
11577 __Pyx_INCREF(__pyx_t_5);
11578 __Pyx_INCREF(
function);
11579 __Pyx_DECREF_SET(__pyx_t_20,
function);
11583 #if CYTHON_FAST_PYCALL
11584 if (PyFunction_Check(__pyx_t_20)) {
11585 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11586 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11587 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11588 __Pyx_GOTREF(__pyx_t_4);
11589 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11592 #if CYTHON_FAST_PYCCALL
11593 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
11594 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11595 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11596 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11597 __Pyx_GOTREF(__pyx_t_4);
11598 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11602 __pyx_t_19 = PyTuple_New(2+__pyx_t_16);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 477, __pyx_L1_error)
11603 __Pyx_GOTREF(__pyx_t_19);
11605 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5); __pyx_t_5 = NULL;
11607 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11608 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11609 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_16, ((PyObject *)__pyx_v_gravity));
11610 __Pyx_GIVEREF(__pyx_t_2);
11611 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_16, __pyx_t_2);
11613 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11614 __Pyx_GOTREF(__pyx_t_4);
11615 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
11617 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11618 __pyx_t_20 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 477, __pyx_L1_error)
11619 __Pyx_GOTREF(__pyx_t_20);
11620 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11621 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11622 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_20);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
11623 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11624 __pyx_v_phi_neig = __pyx_t_7;
11633 __pyx_t_6 = ((__pyx_v_phi_eN < __pyx_v_phi_neig) != 0);
11643 __pyx_t_11 = __pyx_v_eN;
11644 __pyx_t_15 = __pyx_v_ebN;
11646 if (__pyx_t_11 < 0) {
11647 __pyx_t_11 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11648 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11649 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_16 = 0;
11650 if (__pyx_t_15 < 0) {
11651 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11652 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11653 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_16 = 1;
11654 if (unlikely(__pyx_t_16 != -1)) {
11655 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11656 __PYX_ERR(0, 480, __pyx_L1_error)
11658 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
11689 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11692 __Pyx_XDECREF(__pyx_t_1);
11693 __Pyx_XDECREF(__pyx_t_2);
11694 __Pyx_XDECREF(__pyx_t_4);
11695 __Pyx_XDECREF(__pyx_t_5);
11696 __Pyx_XDECREF(__pyx_t_19);
11697 __Pyx_XDECREF(__pyx_t_20);
11698 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11699 __Pyx_PyThreadState_declare
11700 __Pyx_PyThreadState_assign
11701 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11702 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11703 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11704 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11705 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11706 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11707 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11708 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11709 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11710 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11711 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11712 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11713 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11714 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11715 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11716 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11717 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11718 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11719 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11720 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11721 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
11725 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11726 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11727 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11728 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11729 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11730 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11731 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11732 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11733 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11734 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11735 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11736 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11737 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11738 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11739 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11740 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11741 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11742 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11744 __Pyx_XDECREF(__pyx_v_q);
11745 __Pyx_XGIVEREF(__pyx_r);
11746 __Pyx_RefNannyFinishContext();
11759 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11760 static char __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
11761 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {
"RE_NCP1_getElementResidual", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
11762 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11763 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
11764 PyArrayObject *__pyx_v_rowptr = 0;
11765 PyArrayObject *__pyx_v_colind = 0;
11766 int __pyx_v_nSpace;
11767 int __pyx_v_nElements_global;
11768 int __pyx_v_nElementBoundaries_element;
11769 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
11770 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
11771 int __pyx_v_nDOF_test_element;
11772 PyArrayObject *__pyx_v_q_u = 0;
11773 PyArrayObject *__pyx_v_q_grad_u = 0;
11774 PyArrayObject *__pyx_v_q_grad_w = 0;
11775 PyArrayObject *__pyx_v_q_detJ = 0;
11776 PyArrayObject *__pyx_v_q_m = 0;
11777 PyArrayObject *__pyx_v_q_mt = 0;
11778 PyArrayObject *__pyx_v_q_r = 0;
11779 PyArrayObject *__pyx_v_q_kr = 0;
11780 PyArrayObject *__pyx_v_q_kr_up = 0;
11781 PyArrayObject *__pyx_v_q_flin = 0;
11782 PyArrayObject *__pyx_v_q_alin = 0;
11783 PyArrayObject *__pyx_v_elementResidual = 0;
11784 int __pyx_lineno = 0;
11785 const char *__pyx_filename = NULL;
11786 int __pyx_clineno = 0;
11787 PyObject *__pyx_r = 0;
11788 __Pyx_RefNannyDeclarations
11789 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual (wrapper)", 0);
11791 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_mt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementResidual,0};
11792 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11793 if (unlikely(__pyx_kwds)) {
11794 Py_ssize_t kw_args;
11795 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11796 switch (pos_args) {
11797 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11798 CYTHON_FALLTHROUGH;
11799 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11800 CYTHON_FALLTHROUGH;
11801 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11802 CYTHON_FALLTHROUGH;
11803 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11804 CYTHON_FALLTHROUGH;
11805 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11806 CYTHON_FALLTHROUGH;
11807 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11808 CYTHON_FALLTHROUGH;
11809 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11810 CYTHON_FALLTHROUGH;
11811 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11812 CYTHON_FALLTHROUGH;
11813 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11814 CYTHON_FALLTHROUGH;
11815 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11816 CYTHON_FALLTHROUGH;
11817 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11818 CYTHON_FALLTHROUGH;
11819 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11820 CYTHON_FALLTHROUGH;
11821 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11822 CYTHON_FALLTHROUGH;
11823 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11824 CYTHON_FALLTHROUGH;
11825 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11826 CYTHON_FALLTHROUGH;
11827 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11828 CYTHON_FALLTHROUGH;
11829 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11830 CYTHON_FALLTHROUGH;
11831 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11832 CYTHON_FALLTHROUGH;
11833 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11834 CYTHON_FALLTHROUGH;
11835 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11836 CYTHON_FALLTHROUGH;
11837 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11838 CYTHON_FALLTHROUGH;
11840 default:
goto __pyx_L5_argtuple_error;
11842 kw_args = PyDict_Size(__pyx_kwds);
11843 switch (pos_args) {
11845 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
11846 else goto __pyx_L5_argtuple_error;
11847 CYTHON_FALLTHROUGH;
11849 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11851 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 1); __PYX_ERR(0, 486, __pyx_L3_error)
11853 CYTHON_FALLTHROUGH;
11855 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11857 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 2); __PYX_ERR(0, 486, __pyx_L3_error)
11859 CYTHON_FALLTHROUGH;
11861 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
11863 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 3); __PYX_ERR(0, 486, __pyx_L3_error)
11865 CYTHON_FALLTHROUGH;
11867 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
11869 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 4); __PYX_ERR(0, 486, __pyx_L3_error)
11871 CYTHON_FALLTHROUGH;
11873 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
11875 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 5); __PYX_ERR(0, 486, __pyx_L3_error)
11877 CYTHON_FALLTHROUGH;
11879 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
11881 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 6); __PYX_ERR(0, 486, __pyx_L3_error)
11883 CYTHON_FALLTHROUGH;
11885 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
11887 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 7); __PYX_ERR(0, 486, __pyx_L3_error)
11889 CYTHON_FALLTHROUGH;
11891 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
11893 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 8); __PYX_ERR(0, 486, __pyx_L3_error)
11895 CYTHON_FALLTHROUGH;
11897 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
11899 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 9); __PYX_ERR(0, 486, __pyx_L3_error)
11901 CYTHON_FALLTHROUGH;
11903 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
11905 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 10); __PYX_ERR(0, 486, __pyx_L3_error)
11907 CYTHON_FALLTHROUGH;
11909 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
11911 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 11); __PYX_ERR(0, 486, __pyx_L3_error)
11913 CYTHON_FALLTHROUGH;
11915 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
11917 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 12); __PYX_ERR(0, 486, __pyx_L3_error)
11919 CYTHON_FALLTHROUGH;
11921 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
11923 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 13); __PYX_ERR(0, 486, __pyx_L3_error)
11925 CYTHON_FALLTHROUGH;
11927 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
11929 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 14); __PYX_ERR(0, 486, __pyx_L3_error)
11931 CYTHON_FALLTHROUGH;
11933 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
11935 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 15); __PYX_ERR(0, 486, __pyx_L3_error)
11937 CYTHON_FALLTHROUGH;
11939 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
11941 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 16); __PYX_ERR(0, 486, __pyx_L3_error)
11943 CYTHON_FALLTHROUGH;
11945 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
11947 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 17); __PYX_ERR(0, 486, __pyx_L3_error)
11949 CYTHON_FALLTHROUGH;
11951 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
11953 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 18); __PYX_ERR(0, 486, __pyx_L3_error)
11955 CYTHON_FALLTHROUGH;
11957 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
11959 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 19); __PYX_ERR(0, 486, __pyx_L3_error)
11961 CYTHON_FALLTHROUGH;
11963 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementResidual)) != 0)) kw_args--;
11965 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 20); __PYX_ERR(0, 486, __pyx_L3_error)
11968 if (unlikely(kw_args > 0)) {
11969 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementResidual") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
11971 }
else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
11972 goto __pyx_L5_argtuple_error;
11974 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11975 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11976 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11977 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11978 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11979 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11980 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11981 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11982 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11983 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11984 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11985 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11986 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11987 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11988 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11989 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11990 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11991 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11992 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11993 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11994 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11996 __pyx_v_gravity = ((PyArrayObject *)values[0]);
11997 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
11998 __pyx_v_colind = ((PyArrayObject *)values[2]);
11999 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
12000 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
12001 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error)
12002 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
12003 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
12004 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error)
12005 __pyx_v_q_u = ((PyArrayObject *)values[9]);
12006 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
12007 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
12008 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
12009 __pyx_v_q_m = ((PyArrayObject *)values[13]);
12010 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
12011 __pyx_v_q_r = ((PyArrayObject *)values[15]);
12012 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
12013 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
12014 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
12015 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
12016 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
12018 goto __pyx_L4_argument_unpacking_done;
12019 __pyx_L5_argtuple_error:;
12020 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error)
12022 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
12023 __Pyx_RefNannyFinishContext();
12025 __pyx_L4_argument_unpacking_done:;
12026 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 486, __pyx_L1_error)
12027 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
12028 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
12029 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 493, __pyx_L1_error)
12030 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 494, __pyx_L1_error)
12031 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 497, __pyx_L1_error)
12032 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
12033 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
12034 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 501, __pyx_L1_error)
12035 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 502, __pyx_L1_error)
12036 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
12037 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
12038 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 505, __pyx_L1_error)
12039 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 506, __pyx_L1_error)
12040 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 509, __pyx_L1_error)
12041 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
12042 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_ptype_5numpy_ndarray, 1,
"elementResidual", 0))) __PYX_ERR(0, 512, __pyx_L1_error)
12043 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
12050 __Pyx_RefNannyFinishContext();
12054 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual) {
12055 CYTHON_UNUSED
int __pyx_v_upwindFlag;
12056 PyObject *__pyx_v_q = NULL;
12063 PyArrayObject *__pyx_v_a_up = 0;
12064 PyArrayObject *__pyx_v_f_up = 0;
12065 double __pyx_v_nAvgWeight;
12066 double __pyx_v_weight;
12067 double __pyx_v_volFactor;
12068 double __pyx_v_volume;
12069 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
12070 __Pyx_Buffer __pyx_pybuffer_a_up;
12071 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
12072 __Pyx_Buffer __pyx_pybuffer_colind;
12073 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
12074 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
12075 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
12076 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
12077 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
12078 __Pyx_Buffer __pyx_pybuffer_elementResidual;
12079 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
12080 __Pyx_Buffer __pyx_pybuffer_f_up;
12081 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
12082 __Pyx_Buffer __pyx_pybuffer_gravity;
12083 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
12084 __Pyx_Buffer __pyx_pybuffer_q_alin;
12085 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
12086 __Pyx_Buffer __pyx_pybuffer_q_detJ;
12087 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
12088 __Pyx_Buffer __pyx_pybuffer_q_flin;
12089 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
12090 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
12091 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
12092 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
12093 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
12094 __Pyx_Buffer __pyx_pybuffer_q_kr;
12095 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
12096 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
12097 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
12098 __Pyx_Buffer __pyx_pybuffer_q_m;
12099 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
12100 __Pyx_Buffer __pyx_pybuffer_q_mt;
12101 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
12102 __Pyx_Buffer __pyx_pybuffer_q_r;
12103 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
12104 __Pyx_Buffer __pyx_pybuffer_q_u;
12105 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
12106 __Pyx_Buffer __pyx_pybuffer_rowptr;
12107 PyObject *__pyx_r = NULL;
12108 __Pyx_RefNannyDeclarations
12109 PyObject *__pyx_t_1 = NULL;
12110 PyObject *__pyx_t_2 = NULL;
12111 Py_ssize_t __pyx_t_3;
12112 PyObject *__pyx_t_4 = NULL;
12113 PyObject *__pyx_t_5 = NULL;
12115 Py_ssize_t __pyx_t_7;
12117 PyObject *__pyx_t_9 = NULL;
12118 PyArrayObject *__pyx_t_10 = NULL;
12119 PyArrayObject *__pyx_t_11 = NULL;
12123 Py_ssize_t __pyx_t_15;
12128 Py_ssize_t __pyx_t_20;
12129 Py_ssize_t __pyx_t_21;
12136 Py_ssize_t __pyx_t_28;
12137 Py_ssize_t __pyx_t_29;
12138 Py_ssize_t __pyx_t_30;
12139 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_31;
12140 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_32;
12142 Py_ssize_t __pyx_t_34;
12143 Py_ssize_t __pyx_t_35;
12144 Py_ssize_t __pyx_t_36;
12145 Py_ssize_t __pyx_t_37;
12146 Py_ssize_t __pyx_t_38;
12147 int __pyx_lineno = 0;
12148 const char *__pyx_filename = NULL;
12149 int __pyx_clineno = 0;
12150 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual", 0);
12151 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
12152 __pyx_pybuffer_a_up.refcount = 0;
12153 __pyx_pybuffernd_a_up.data = NULL;
12154 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
12155 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
12156 __pyx_pybuffer_f_up.refcount = 0;
12157 __pyx_pybuffernd_f_up.data = NULL;
12158 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
12159 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
12160 __pyx_pybuffer_gravity.refcount = 0;
12161 __pyx_pybuffernd_gravity.data = NULL;
12162 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
12163 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
12164 __pyx_pybuffer_rowptr.refcount = 0;
12165 __pyx_pybuffernd_rowptr.data = NULL;
12166 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
12167 __pyx_pybuffer_colind.pybuffer.buf = NULL;
12168 __pyx_pybuffer_colind.refcount = 0;
12169 __pyx_pybuffernd_colind.data = NULL;
12170 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
12171 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
12172 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
12173 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
12174 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
12175 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
12176 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
12177 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
12178 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
12179 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
12180 __pyx_pybuffer_q_u.refcount = 0;
12181 __pyx_pybuffernd_q_u.data = NULL;
12182 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
12183 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
12184 __pyx_pybuffer_q_grad_u.refcount = 0;
12185 __pyx_pybuffernd_q_grad_u.data = NULL;
12186 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
12187 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
12188 __pyx_pybuffer_q_grad_w.refcount = 0;
12189 __pyx_pybuffernd_q_grad_w.data = NULL;
12190 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
12191 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
12192 __pyx_pybuffer_q_detJ.refcount = 0;
12193 __pyx_pybuffernd_q_detJ.data = NULL;
12194 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
12195 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
12196 __pyx_pybuffer_q_m.refcount = 0;
12197 __pyx_pybuffernd_q_m.data = NULL;
12198 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
12199 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
12200 __pyx_pybuffer_q_mt.refcount = 0;
12201 __pyx_pybuffernd_q_mt.data = NULL;
12202 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
12203 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
12204 __pyx_pybuffer_q_r.refcount = 0;
12205 __pyx_pybuffernd_q_r.data = NULL;
12206 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
12207 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
12208 __pyx_pybuffer_q_kr.refcount = 0;
12209 __pyx_pybuffernd_q_kr.data = NULL;
12210 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
12211 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
12212 __pyx_pybuffer_q_kr_up.refcount = 0;
12213 __pyx_pybuffernd_q_kr_up.data = NULL;
12214 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
12215 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
12216 __pyx_pybuffer_q_flin.refcount = 0;
12217 __pyx_pybuffernd_q_flin.data = NULL;
12218 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
12219 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
12220 __pyx_pybuffer_q_alin.refcount = 0;
12221 __pyx_pybuffernd_q_alin.data = NULL;
12222 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
12223 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
12224 __pyx_pybuffer_elementResidual.refcount = 0;
12225 __pyx_pybuffernd_elementResidual.data = NULL;
12226 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
12228 __Pyx_BufFmt_StackElem __pyx_stack[1];
12229 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12231 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
12233 __Pyx_BufFmt_StackElem __pyx_stack[1];
12234 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12236 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
12238 __Pyx_BufFmt_StackElem __pyx_stack[1];
12239 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12241 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
12243 __Pyx_BufFmt_StackElem __pyx_stack[1];
12244 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12246 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
12248 __Pyx_BufFmt_StackElem __pyx_stack[1];
12249 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12251 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
12253 __Pyx_BufFmt_StackElem __pyx_stack[1];
12254 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12256 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
12258 __Pyx_BufFmt_StackElem __pyx_stack[1];
12259 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12261 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
12263 __Pyx_BufFmt_StackElem __pyx_stack[1];
12264 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12266 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
12268 __Pyx_BufFmt_StackElem __pyx_stack[1];
12269 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12271 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
12273 __Pyx_BufFmt_StackElem __pyx_stack[1];
12274 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12276 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
12278 __Pyx_BufFmt_StackElem __pyx_stack[1];
12279 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12281 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
12283 __Pyx_BufFmt_StackElem __pyx_stack[1];
12284 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12286 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
12288 __Pyx_BufFmt_StackElem __pyx_stack[1];
12289 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12291 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
12293 __Pyx_BufFmt_StackElem __pyx_stack[1];
12294 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12296 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
12298 __Pyx_BufFmt_StackElem __pyx_stack[1];
12299 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12301 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
12303 __Pyx_BufFmt_StackElem __pyx_stack[1];
12304 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12306 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
12308 __Pyx_BufFmt_StackElem __pyx_stack[1];
12309 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12311 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
12320 __pyx_v_upwindFlag = 1;
12329 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12330 __Pyx_GOTREF(__pyx_t_1);
12331 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
12332 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
12333 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
12334 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
12335 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
12336 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
12337 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
12338 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
12339 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
12340 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
12341 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
12342 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
12343 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
12344 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
12345 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
12346 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12349 if (__pyx_t_3 >= 5)
break;
12350 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12351 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error)
12353 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12354 __Pyx_GOTREF(__pyx_t_1);
12356 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
12366 #ifndef CYTHON_WITHOUT_ASSERTIONS
12367 if (unlikely(!Py_OptimizeFlag)) {
12368 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12369 __Pyx_GOTREF(__pyx_t_1);
12370 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
12371 __Pyx_GOTREF(__pyx_t_4);
12372 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12373 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12374 __Pyx_GOTREF(__pyx_t_1);
12375 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
12376 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12377 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12378 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
12379 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12380 if (unlikely(!__pyx_t_6)) {
12381 PyErr_SetNone(PyExc_AssertionError);
12382 __PYX_ERR(0, 530, __pyx_L1_error)
12395 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12404 #ifndef CYTHON_WITHOUT_ASSERTIONS
12405 if (unlikely(!Py_OptimizeFlag)) {
12406 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
12407 PyErr_SetNone(PyExc_AssertionError);
12408 __PYX_ERR(0, 531, __pyx_L1_error)
12420 __pyx_t_7 = __pyx_v_nSpace;
12422 if (__pyx_t_7 < 0) {
12423 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12424 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
12425 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
12426 if (unlikely(__pyx_t_8 != -1)) {
12427 __Pyx_RaiseBufferIndexError(__pyx_t_8);
12428 __PYX_ERR(0, 532, __pyx_L1_error)
12430 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12439 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12440 __Pyx_GOTREF(__pyx_t_5);
12441 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
12442 __Pyx_GOTREF(__pyx_t_1);
12443 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12444 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12445 __Pyx_GOTREF(__pyx_t_5);
12448 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
12449 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
12450 if (likely(__pyx_t_4)) {
12451 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12452 __Pyx_INCREF(__pyx_t_4);
12453 __Pyx_INCREF(
function);
12454 __Pyx_DECREF_SET(__pyx_t_1,
function);
12458 #if CYTHON_FAST_PYCALL
12459 if (PyFunction_Check(__pyx_t_1)) {
12460 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12461 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12462 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12463 __Pyx_GOTREF(__pyx_t_2);
12464 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12467 #if CYTHON_FAST_PYCCALL
12468 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
12469 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12470 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12471 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12472 __Pyx_GOTREF(__pyx_t_2);
12473 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12477 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L1_error)
12478 __Pyx_GOTREF(__pyx_t_9);
12480 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
12482 __Pyx_GIVEREF(__pyx_t_5);
12483 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
12484 __Pyx_INCREF(__pyx_n_s_d);
12485 __Pyx_GIVEREF(__pyx_n_s_d);
12486 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
12488 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12489 __Pyx_GOTREF(__pyx_t_2);
12490 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12492 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12493 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
12494 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
12496 __Pyx_BufFmt_StackElem __pyx_stack[1];
12497 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12498 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
12499 __PYX_ERR(0, 536, __pyx_L1_error)
12500 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
12504 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
12514 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12515 __Pyx_GOTREF(__pyx_t_1);
12516 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error)
12517 __Pyx_GOTREF(__pyx_t_9);
12518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12519 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12520 __Pyx_GOTREF(__pyx_t_1);
12523 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
12524 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
12525 if (likely(__pyx_t_5)) {
12526 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12527 __Pyx_INCREF(__pyx_t_5);
12528 __Pyx_INCREF(
function);
12529 __Pyx_DECREF_SET(__pyx_t_9,
function);
12533 #if CYTHON_FAST_PYCALL
12534 if (PyFunction_Check(__pyx_t_9)) {
12535 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12536 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12537 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12538 __Pyx_GOTREF(__pyx_t_2);
12539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12542 #if CYTHON_FAST_PYCCALL
12543 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12544 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12545 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12546 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12547 __Pyx_GOTREF(__pyx_t_2);
12548 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12552 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
12553 __Pyx_GOTREF(__pyx_t_4);
12555 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
12557 __Pyx_GIVEREF(__pyx_t_1);
12558 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
12559 __Pyx_INCREF(__pyx_n_s_d);
12560 __Pyx_GIVEREF(__pyx_n_s_d);
12561 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
12563 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12564 __Pyx_GOTREF(__pyx_t_2);
12565 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12567 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12568 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error)
12569 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
12571 __Pyx_BufFmt_StackElem __pyx_stack[1];
12572 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12573 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
12574 __PYX_ERR(0, 537, __pyx_L1_error)
12575 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
12579 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
12589 __pyx_t_12 = (__pyx_v_nSpace + 1.);
12590 if (unlikely(__pyx_t_12 == 0)) {
12591 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
12592 __PYX_ERR(0, 539, __pyx_L1_error)
12594 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
12603 __pyx_v_weight = 1.0;
12604 __pyx_v_volFactor = 1.0;
12613 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
12623 __pyx_v_volFactor = 0.5;
12641 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
12651 __pyx_v_volFactor = (1.0 / 6.0);
12669 __pyx_t_8 = __pyx_v_nElements_global;
12670 __pyx_t_13 = __pyx_t_8;
12671 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
12672 __pyx_v_eN = __pyx_t_14;
12681 __pyx_t_7 = __pyx_v_eN;
12684 if (__pyx_t_7 < 0) {
12685 __pyx_t_7 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
12686 if (unlikely(__pyx_t_7 < 0)) __pyx_t_16 = 0;
12687 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
12688 if (__pyx_t_15 < 0) {
12689 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
12690 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
12691 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
12692 if (unlikely(__pyx_t_16 != -1)) {
12693 __Pyx_RaiseBufferIndexError(__pyx_t_16);
12694 __PYX_ERR(0, 547, __pyx_L1_error)
12696 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
12705 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
12714 __pyx_t_16 = __pyx_v_nDOF_test_element;
12715 __pyx_t_17 = __pyx_t_16;
12716 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
12717 __pyx_v_i = __pyx_t_18;
12726 __pyx_t_15 = __pyx_v_eN;
12727 __pyx_t_7 = __pyx_v_i;
12729 if (__pyx_t_15 < 0) {
12730 __pyx_t_15 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
12731 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 0;
12732 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_19 = 0;
12733 if (__pyx_t_7 < 0) {
12734 __pyx_t_7 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
12735 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 1;
12736 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_19 = 1;
12737 if (unlikely(__pyx_t_19 != -1)) {
12738 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12739 __PYX_ERR(0, 553, __pyx_L1_error)
12741 __pyx_t_20 = __pyx_v_eN;
12742 __pyx_t_21 = __pyx_v_i;
12744 if (__pyx_t_20 < 0) {
12745 __pyx_t_20 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12746 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
12747 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_19 = 0;
12748 if (__pyx_t_21 < 0) {
12749 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12750 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 1;
12751 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_19 = 1;
12752 if (unlikely(__pyx_t_19 != -1)) {
12753 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12754 __PYX_ERR(0, 553, __pyx_L1_error)
12756 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
12765 __pyx_t_7 = __pyx_v_eN;
12766 __pyx_t_15 = __pyx_v_i;
12768 if (__pyx_t_7 < 0) {
12769 __pyx_t_7 += __pyx_pybuffernd_q_r.diminfo[0].shape;
12770 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 0;
12771 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_19 = 0;
12772 if (__pyx_t_15 < 0) {
12773 __pyx_t_15 += __pyx_pybuffernd_q_r.diminfo[1].shape;
12774 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 1;
12775 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_19 = 1;
12776 if (unlikely(__pyx_t_19 != -1)) {
12777 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12778 __PYX_ERR(0, 555, __pyx_L1_error)
12780 __pyx_t_21 = __pyx_v_eN;
12781 __pyx_t_20 = __pyx_v_i;
12783 if (__pyx_t_21 < 0) {
12784 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12785 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 0;
12786 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_19 = 0;
12787 if (__pyx_t_20 < 0) {
12788 __pyx_t_20 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12789 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 1;
12790 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_19 = 1;
12791 if (unlikely(__pyx_t_19 != -1)) {
12792 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12793 __PYX_ERR(0, 555, __pyx_L1_error)
12795 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_r.diminfo[1].strides)));
12804 __pyx_t_19 = __pyx_v_nElementBoundaries_element;
12805 __pyx_t_22 = __pyx_t_19;
12806 for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
12807 __pyx_v_ebN = __pyx_t_23;
12816 __pyx_t_24 = __pyx_v_nnz;
12817 __pyx_t_25 = __pyx_t_24;
12818 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12819 __pyx_v_ii = __pyx_t_26;
12828 __pyx_t_15 = __pyx_v_eN;
12829 __pyx_t_7 = __pyx_v_ebN;
12830 __pyx_t_20 = __pyx_v_ii;
12832 if (__pyx_t_15 < 0) {
12833 __pyx_t_15 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
12834 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 0;
12835 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_27 = 0;
12836 if (__pyx_t_7 < 0) {
12837 __pyx_t_7 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
12838 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 1;
12839 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_27 = 1;
12840 if (__pyx_t_20 < 0) {
12841 __pyx_t_20 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
12842 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 2;
12843 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_27 = 2;
12844 if (unlikely(__pyx_t_27 != -1)) {
12845 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12846 __PYX_ERR(0, 561, __pyx_L1_error)
12848 __pyx_t_21 = __pyx_v_eN;
12849 __pyx_t_28 = __pyx_v_ebN;
12851 if (__pyx_t_21 < 0) {
12852 __pyx_t_21 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12853 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 0;
12854 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_27 = 0;
12855 if (__pyx_t_28 < 0) {
12856 __pyx_t_28 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12857 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 1;
12858 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_27 = 1;
12859 if (unlikely(__pyx_t_27 != -1)) {
12860 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12861 __PYX_ERR(0, 561, __pyx_L1_error)
12863 __pyx_t_29 = __pyx_v_ii;
12865 if (__pyx_t_29 < 0) {
12866 __pyx_t_29 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12867 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12868 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_27 = 0;
12869 if (unlikely(__pyx_t_27 != -1)) {
12870 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12871 __PYX_ERR(0, 561, __pyx_L1_error)
12873 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12883 __pyx_t_24 = __pyx_v_nSpace;
12884 __pyx_t_25 = __pyx_t_24;
12885 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12886 __pyx_v_I = __pyx_t_26;
12895 __pyx_t_28 = __pyx_v_eN;
12896 __pyx_t_21 = __pyx_v_ebN;
12897 __pyx_t_20 = __pyx_v_I;
12899 if (__pyx_t_28 < 0) {
12900 __pyx_t_28 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
12901 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
12902 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_27 = 0;
12903 if (__pyx_t_21 < 0) {
12904 __pyx_t_21 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
12905 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 1;
12906 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_27 = 1;
12907 if (__pyx_t_20 < 0) {
12908 __pyx_t_20 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
12909 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 2;
12910 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_27 = 2;
12911 if (unlikely(__pyx_t_27 != -1)) {
12912 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12913 __PYX_ERR(0, 563, __pyx_L1_error)
12915 __pyx_t_7 = __pyx_v_eN;
12916 __pyx_t_15 = __pyx_v_ebN;
12918 if (__pyx_t_7 < 0) {
12919 __pyx_t_7 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12920 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 0;
12921 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_27 = 0;
12922 if (__pyx_t_15 < 0) {
12923 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12924 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 1;
12925 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_27 = 1;
12926 if (unlikely(__pyx_t_27 != -1)) {
12927 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12928 __PYX_ERR(0, 563, __pyx_L1_error)
12930 __pyx_t_29 = __pyx_v_I;
12932 if (__pyx_t_29 < 0) {
12933 __pyx_t_29 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12934 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12935 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_27 = 0;
12936 if (unlikely(__pyx_t_27 != -1)) {
12937 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12938 __PYX_ERR(0, 563, __pyx_L1_error)
12940 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12950 __pyx_t_24 = __pyx_v_nSpace;
12951 __pyx_t_25 = __pyx_t_24;
12952 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12953 __pyx_v_I = __pyx_t_26;
12962 __pyx_t_15 = __pyx_v_I;
12964 if (__pyx_t_15 < 0) {
12965 __pyx_t_15 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12966 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 0;
12967 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_27 = 0;
12968 if (unlikely(__pyx_t_27 != -1)) {
12969 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12970 __PYX_ERR(0, 567, __pyx_L1_error)
12972 __pyx_t_7 = __pyx_v_eN;
12973 __pyx_t_20 = __pyx_v_ebN;
12974 __pyx_t_21 = __pyx_v_i;
12975 __pyx_t_28 = __pyx_v_I;
12977 if (__pyx_t_7 < 0) {
12978 __pyx_t_7 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
12979 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 0;
12980 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_27 = 0;
12981 if (__pyx_t_20 < 0) {
12982 __pyx_t_20 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
12983 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 1;
12984 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_27 = 1;
12985 if (__pyx_t_21 < 0) {
12986 __pyx_t_21 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
12987 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 2;
12988 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_27 = 2;
12989 if (__pyx_t_28 < 0) {
12990 __pyx_t_28 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
12991 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 3;
12992 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_27 = 3;
12993 if (unlikely(__pyx_t_27 != -1)) {
12994 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12995 __PYX_ERR(0, 567, __pyx_L1_error)
12997 __pyx_t_29 = __pyx_v_eN;
12998 __pyx_t_30 = __pyx_v_i;
13000 if (__pyx_t_29 < 0) {
13001 __pyx_t_29 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
13002 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
13003 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_27 = 0;
13004 if (__pyx_t_30 < 0) {
13005 __pyx_t_30 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
13006 if (unlikely(__pyx_t_30 < 0)) __pyx_t_27 = 1;
13007 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_27 = 1;
13008 if (unlikely(__pyx_t_27 != -1)) {
13009 __Pyx_RaiseBufferIndexError(__pyx_t_27);
13010 __PYX_ERR(0, 567, __pyx_L1_error)
13012 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
13021 __pyx_t_28 = (__pyx_v_I + 1);
13023 if (__pyx_t_28 < 0) {
13024 __pyx_t_28 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13025 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
13026 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_27 = 0;
13027 if (unlikely(__pyx_t_27 != -1)) {
13028 __Pyx_RaiseBufferIndexError(__pyx_t_27);
13029 __PYX_ERR(0, 568, __pyx_L1_error)
13031 __pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13032 __pyx_t_28 = __pyx_v_I;
13034 if (__pyx_t_28 < 0) {
13035 __pyx_t_28 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13036 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
13037 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_27 = 0;
13038 if (unlikely(__pyx_t_27 != -1)) {
13039 __Pyx_RaiseBufferIndexError(__pyx_t_27);
13040 __PYX_ERR(0, 568, __pyx_L1_error)
13042 __pyx_t_32 = __pyx_t_31;
13043 for (__pyx_t_27 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_27 < __pyx_t_32; __pyx_t_27+=1) {
13044 __pyx_v_ii = __pyx_t_27;
13053 __pyx_t_21 = __pyx_v_ii;
13055 if (__pyx_t_21 < 0) {
13056 __pyx_t_21 += __pyx_pybuffernd_a_up.diminfo[0].shape;
13057 if (unlikely(__pyx_t_21 < 0)) __pyx_t_33 = 0;
13058 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_33 = 0;
13059 if (unlikely(__pyx_t_33 != -1)) {
13060 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13061 __PYX_ERR(0, 569, __pyx_L1_error)
13063 __pyx_t_20 = __pyx_v_ii;
13065 if (__pyx_t_20 < 0) {
13066 __pyx_t_20 += __pyx_pybuffernd_colind.diminfo[0].shape;
13067 if (unlikely(__pyx_t_20 < 0)) __pyx_t_33 = 0;
13068 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_33 = 0;
13069 if (unlikely(__pyx_t_33 != -1)) {
13070 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13071 __PYX_ERR(0, 569, __pyx_L1_error)
13073 __pyx_t_7 = __pyx_v_eN;
13074 __pyx_t_15 = __pyx_v_ebN;
13075 __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_colind.diminfo[0].strides));
13077 if (__pyx_t_7 < 0) {
13078 __pyx_t_7 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
13079 if (unlikely(__pyx_t_7 < 0)) __pyx_t_33 = 0;
13080 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_33 = 0;
13081 if (__pyx_t_15 < 0) {
13082 __pyx_t_15 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
13083 if (unlikely(__pyx_t_15 < 0)) __pyx_t_33 = 1;
13084 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_33 = 1;
13085 if (__pyx_t_30 < 0) {
13086 __pyx_t_30 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
13087 if (unlikely(__pyx_t_30 < 0)) __pyx_t_33 = 2;
13088 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_33 = 2;
13089 if (unlikely(__pyx_t_33 != -1)) {
13090 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13091 __PYX_ERR(0, 569, __pyx_L1_error)
13093 __pyx_t_29 = __pyx_v_eN;
13094 __pyx_t_34 = __pyx_v_ebN;
13095 __pyx_t_35 = __pyx_v_i;
13096 __pyx_t_36 = __pyx_v_I;
13098 if (__pyx_t_29 < 0) {
13099 __pyx_t_29 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
13100 if (unlikely(__pyx_t_29 < 0)) __pyx_t_33 = 0;
13101 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_33 = 0;
13102 if (__pyx_t_34 < 0) {
13103 __pyx_t_34 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
13104 if (unlikely(__pyx_t_34 < 0)) __pyx_t_33 = 1;
13105 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_33 = 1;
13106 if (__pyx_t_35 < 0) {
13107 __pyx_t_35 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
13108 if (unlikely(__pyx_t_35 < 0)) __pyx_t_33 = 2;
13109 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_33 = 2;
13110 if (__pyx_t_36 < 0) {
13111 __pyx_t_36 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
13112 if (unlikely(__pyx_t_36 < 0)) __pyx_t_33 = 3;
13113 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_33 = 3;
13114 if (unlikely(__pyx_t_33 != -1)) {
13115 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13116 __PYX_ERR(0, 569, __pyx_L1_error)
13118 __pyx_t_37 = __pyx_v_eN;
13119 __pyx_t_38 = __pyx_v_i;
13121 if (__pyx_t_37 < 0) {
13122 __pyx_t_37 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
13123 if (unlikely(__pyx_t_37 < 0)) __pyx_t_33 = 0;
13124 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_33 = 0;
13125 if (__pyx_t_38 < 0) {
13126 __pyx_t_38 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
13127 if (unlikely(__pyx_t_38 < 0)) __pyx_t_33 = 1;
13128 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_33 = 1;
13129 if (unlikely(__pyx_t_33 != -1)) {
13130 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13131 __PYX_ERR(0, 569, __pyx_L1_error)
13133 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_36, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
13149 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13152 __Pyx_XDECREF(__pyx_t_1);
13153 __Pyx_XDECREF(__pyx_t_2);
13154 __Pyx_XDECREF(__pyx_t_4);
13155 __Pyx_XDECREF(__pyx_t_5);
13156 __Pyx_XDECREF(__pyx_t_9);
13157 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13158 __Pyx_PyThreadState_declare
13159 __Pyx_PyThreadState_assign
13160 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13161 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13162 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13163 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13164 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13165 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13166 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13167 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13168 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13169 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13170 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13171 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13172 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13173 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13174 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13175 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13176 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13177 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13178 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13179 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13180 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13181 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
13185 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13186 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13187 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13188 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13189 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13190 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13191 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13192 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13193 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13194 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13195 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13196 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13197 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13198 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13199 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13200 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13201 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13202 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13203 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13205 __Pyx_XDECREF(__pyx_v_q);
13206 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
13207 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
13208 __Pyx_XGIVEREF(__pyx_r);
13209 __Pyx_RefNannyFinishContext();
13222 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13223 static char __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
13224 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {
"RE_NCP1_getElementJacobian", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
13225 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13226 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
13227 PyArrayObject *__pyx_v_rowptr = 0;
13228 PyArrayObject *__pyx_v_colind = 0;
13229 int __pyx_v_nSpace;
13230 int __pyx_v_nElements_global;
13231 int __pyx_v_nElementBoundaries_element;
13232 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
13233 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
13234 int __pyx_v_nDOF_test_element;
13235 int __pyx_v_nDOF_trial_element;
13236 PyArrayObject *__pyx_v_q_u = 0;
13237 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
13238 PyArrayObject *__pyx_v_q_grad_w = 0;
13239 PyArrayObject *__pyx_v_q_grad_v = 0;
13240 PyArrayObject *__pyx_v_q_detJ = 0;
13241 PyArrayObject *__pyx_v_q_m = 0;
13242 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
13243 PyArrayObject *__pyx_v_q_mt = 0;
13244 PyArrayObject *__pyx_v_q_dmt = 0;
13245 PyArrayObject *__pyx_v_q_r = 0;
13246 PyArrayObject *__pyx_v_q_kr = 0;
13247 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
13248 PyArrayObject *__pyx_v_q_kr_up = 0;
13249 PyArrayObject *__pyx_v_q_flin = 0;
13250 PyArrayObject *__pyx_v_q_alin = 0;
13251 PyArrayObject *__pyx_v_elementJacobian = 0;
13252 int __pyx_lineno = 0;
13253 const char *__pyx_filename = NULL;
13254 int __pyx_clineno = 0;
13255 PyObject *__pyx_r = 0;
13256 __Pyx_RefNannyDeclarations
13257 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian (wrapper)", 0);
13259 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_grad_v,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_dm,&__pyx_n_s_q_mt,&__pyx_n_s_q_dmt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementJacobian,0};
13260 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
13261 if (unlikely(__pyx_kwds)) {
13262 Py_ssize_t kw_args;
13263 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13264 switch (pos_args) {
13265 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13266 CYTHON_FALLTHROUGH;
13267 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13268 CYTHON_FALLTHROUGH;
13269 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13270 CYTHON_FALLTHROUGH;
13271 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13272 CYTHON_FALLTHROUGH;
13273 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13274 CYTHON_FALLTHROUGH;
13275 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13276 CYTHON_FALLTHROUGH;
13277 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13278 CYTHON_FALLTHROUGH;
13279 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13280 CYTHON_FALLTHROUGH;
13281 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13282 CYTHON_FALLTHROUGH;
13283 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13284 CYTHON_FALLTHROUGH;
13285 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13286 CYTHON_FALLTHROUGH;
13287 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13288 CYTHON_FALLTHROUGH;
13289 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13290 CYTHON_FALLTHROUGH;
13291 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13292 CYTHON_FALLTHROUGH;
13293 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13294 CYTHON_FALLTHROUGH;
13295 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13296 CYTHON_FALLTHROUGH;
13297 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13298 CYTHON_FALLTHROUGH;
13299 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13300 CYTHON_FALLTHROUGH;
13301 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13302 CYTHON_FALLTHROUGH;
13303 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13304 CYTHON_FALLTHROUGH;
13305 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13306 CYTHON_FALLTHROUGH;
13307 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13308 CYTHON_FALLTHROUGH;
13309 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13310 CYTHON_FALLTHROUGH;
13311 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13312 CYTHON_FALLTHROUGH;
13313 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13314 CYTHON_FALLTHROUGH;
13315 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13316 CYTHON_FALLTHROUGH;
13318 default:
goto __pyx_L5_argtuple_error;
13320 kw_args = PyDict_Size(__pyx_kwds);
13321 switch (pos_args) {
13323 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
13324 else goto __pyx_L5_argtuple_error;
13325 CYTHON_FALLTHROUGH;
13327 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
13329 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 1); __PYX_ERR(0, 574, __pyx_L3_error)
13331 CYTHON_FALLTHROUGH;
13333 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
13335 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 2); __PYX_ERR(0, 574, __pyx_L3_error)
13337 CYTHON_FALLTHROUGH;
13339 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
13341 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 3); __PYX_ERR(0, 574, __pyx_L3_error)
13343 CYTHON_FALLTHROUGH;
13345 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
13347 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 4); __PYX_ERR(0, 574, __pyx_L3_error)
13349 CYTHON_FALLTHROUGH;
13351 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
13353 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 5); __PYX_ERR(0, 574, __pyx_L3_error)
13355 CYTHON_FALLTHROUGH;
13357 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
13359 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 6); __PYX_ERR(0, 574, __pyx_L3_error)
13361 CYTHON_FALLTHROUGH;
13363 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
13365 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 7); __PYX_ERR(0, 574, __pyx_L3_error)
13367 CYTHON_FALLTHROUGH;
13369 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
13371 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 8); __PYX_ERR(0, 574, __pyx_L3_error)
13373 CYTHON_FALLTHROUGH;
13375 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
13377 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 9); __PYX_ERR(0, 574, __pyx_L3_error)
13379 CYTHON_FALLTHROUGH;
13381 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
13383 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 10); __PYX_ERR(0, 574, __pyx_L3_error)
13385 CYTHON_FALLTHROUGH;
13387 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
13389 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 11); __PYX_ERR(0, 574, __pyx_L3_error)
13391 CYTHON_FALLTHROUGH;
13393 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
13395 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 12); __PYX_ERR(0, 574, __pyx_L3_error)
13397 CYTHON_FALLTHROUGH;
13399 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_v)) != 0)) kw_args--;
13401 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 13); __PYX_ERR(0, 574, __pyx_L3_error)
13403 CYTHON_FALLTHROUGH;
13405 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
13407 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 14); __PYX_ERR(0, 574, __pyx_L3_error)
13409 CYTHON_FALLTHROUGH;
13411 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
13413 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 15); __PYX_ERR(0, 574, __pyx_L3_error)
13415 CYTHON_FALLTHROUGH;
13417 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dm)) != 0)) kw_args--;
13419 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 16); __PYX_ERR(0, 574, __pyx_L3_error)
13421 CYTHON_FALLTHROUGH;
13423 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
13425 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 17); __PYX_ERR(0, 574, __pyx_L3_error)
13427 CYTHON_FALLTHROUGH;
13429 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmt)) != 0)) kw_args--;
13431 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 18); __PYX_ERR(0, 574, __pyx_L3_error)
13433 CYTHON_FALLTHROUGH;
13435 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
13437 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 19); __PYX_ERR(0, 574, __pyx_L3_error)
13439 CYTHON_FALLTHROUGH;
13441 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
13443 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 20); __PYX_ERR(0, 574, __pyx_L3_error)
13445 CYTHON_FALLTHROUGH;
13447 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
13449 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 21); __PYX_ERR(0, 574, __pyx_L3_error)
13451 CYTHON_FALLTHROUGH;
13453 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
13455 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 22); __PYX_ERR(0, 574, __pyx_L3_error)
13457 CYTHON_FALLTHROUGH;
13459 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
13461 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 23); __PYX_ERR(0, 574, __pyx_L3_error)
13463 CYTHON_FALLTHROUGH;
13465 if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
13467 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 24); __PYX_ERR(0, 574, __pyx_L3_error)
13469 CYTHON_FALLTHROUGH;
13471 if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementJacobian)) != 0)) kw_args--;
13473 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 25); __PYX_ERR(0, 574, __pyx_L3_error)
13476 if (unlikely(kw_args > 0)) {
13477 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementJacobian") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
13479 }
else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
13480 goto __pyx_L5_argtuple_error;
13482 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13483 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13484 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13485 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13486 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13487 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13488 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13489 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13490 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13491 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13492 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13493 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13494 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13495 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13496 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13497 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13498 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13499 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13500 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13501 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13502 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13503 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13504 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13505 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13506 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13507 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13509 __pyx_v_gravity = ((PyArrayObject *)values[0]);
13510 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
13511 __pyx_v_colind = ((PyArrayObject *)values[2]);
13512 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
13513 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
13514 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
13515 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
13516 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
13517 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error)
13518 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error)
13519 __pyx_v_q_u = ((PyArrayObject *)values[10]);
13520 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
13521 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
13522 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
13523 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
13524 __pyx_v_q_m = ((PyArrayObject *)values[15]);
13525 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
13526 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
13527 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
13528 __pyx_v_q_r = ((PyArrayObject *)values[19]);
13529 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
13530 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
13531 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
13532 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
13533 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
13534 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
13536 goto __pyx_L4_argument_unpacking_done;
13537 __pyx_L5_argtuple_error:;
13538 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
13540 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
13541 __Pyx_RefNannyFinishContext();
13543 __pyx_L4_argument_unpacking_done:;
13544 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 574, __pyx_L1_error)
13545 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 575, __pyx_L1_error)
13546 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 576, __pyx_L1_error)
13547 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 581, __pyx_L1_error)
13548 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 582, __pyx_L1_error)
13549 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 586, __pyx_L1_error)
13550 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 587, __pyx_L1_error)
13551 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 588, __pyx_L1_error)
13552 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_v", 0))) __PYX_ERR(0, 589, __pyx_L1_error)
13553 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 591, __pyx_L1_error)
13554 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 592, __pyx_L1_error)
13555 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_ptype_5numpy_ndarray, 1,
"q_dm", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
13556 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
13557 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_ptype_5numpy_ndarray, 1,
"q_dmt", 0))) __PYX_ERR(0, 595, __pyx_L1_error)
13558 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 596, __pyx_L1_error)
13559 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 597, __pyx_L1_error)
13560 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
13561 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 599, __pyx_L1_error)
13562 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 602, __pyx_L1_error)
13563 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
13564 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_ptype_5numpy_ndarray, 1,
"elementJacobian", 0))) __PYX_ERR(0, 605, __pyx_L1_error)
13565 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
13572 __Pyx_RefNannyFinishContext();
13576 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian) {
13577 CYTHON_UNUSED
int __pyx_v_upwindFlag;
13578 CYTHON_UNUSED
int __pyx_v_picard;
13579 PyObject *__pyx_v_q = NULL;
13584 PyArrayObject *__pyx_v_a_up = 0;
13585 PyArrayObject *__pyx_v_f_up = 0;
13586 double __pyx_v_nAvgWeight;
13587 double __pyx_v_weight;
13588 double __pyx_v_volFactor;
13589 CYTHON_UNUSED
int __pyx_v_thisElementIsUpwind;
13590 double __pyx_v_volume;
13594 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
13595 __Pyx_Buffer __pyx_pybuffer_a_up;
13596 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
13597 __Pyx_Buffer __pyx_pybuffer_colind;
13598 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
13599 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
13600 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
13601 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
13602 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
13603 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
13604 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
13605 __Pyx_Buffer __pyx_pybuffer_f_up;
13606 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
13607 __Pyx_Buffer __pyx_pybuffer_gravity;
13608 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
13609 __Pyx_Buffer __pyx_pybuffer_q_alin;
13610 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
13611 __Pyx_Buffer __pyx_pybuffer_q_detJ;
13612 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
13613 __Pyx_Buffer __pyx_pybuffer_q_dkr;
13614 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
13615 __Pyx_Buffer __pyx_pybuffer_q_dm;
13616 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
13617 __Pyx_Buffer __pyx_pybuffer_q_dmt;
13618 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
13619 __Pyx_Buffer __pyx_pybuffer_q_flin;
13620 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
13621 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
13622 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
13623 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
13624 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
13625 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
13626 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
13627 __Pyx_Buffer __pyx_pybuffer_q_kr;
13628 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
13629 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
13630 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
13631 __Pyx_Buffer __pyx_pybuffer_q_m;
13632 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
13633 __Pyx_Buffer __pyx_pybuffer_q_mt;
13634 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
13635 __Pyx_Buffer __pyx_pybuffer_q_r;
13636 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
13637 __Pyx_Buffer __pyx_pybuffer_q_u;
13638 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
13639 __Pyx_Buffer __pyx_pybuffer_rowptr;
13640 PyObject *__pyx_r = NULL;
13641 __Pyx_RefNannyDeclarations
13642 PyObject *__pyx_t_1 = NULL;
13643 PyObject *__pyx_t_2 = NULL;
13644 Py_ssize_t __pyx_t_3;
13645 PyObject *__pyx_t_4 = NULL;
13646 PyObject *__pyx_t_5 = NULL;
13648 Py_ssize_t __pyx_t_7;
13650 PyObject *__pyx_t_9 = NULL;
13651 PyArrayObject *__pyx_t_10 = NULL;
13652 PyArrayObject *__pyx_t_11 = NULL;
13656 Py_ssize_t __pyx_t_15;
13661 Py_ssize_t __pyx_t_20;
13662 Py_ssize_t __pyx_t_21;
13663 Py_ssize_t __pyx_t_22;
13670 Py_ssize_t __pyx_t_29;
13674 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_33;
13675 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_34;
13677 Py_ssize_t __pyx_t_36;
13678 Py_ssize_t __pyx_t_37;
13679 Py_ssize_t __pyx_t_38;
13680 Py_ssize_t __pyx_t_39;
13681 Py_ssize_t __pyx_t_40;
13682 Py_ssize_t __pyx_t_41;
13683 Py_ssize_t __pyx_t_42;
13684 Py_ssize_t __pyx_t_43;
13685 int __pyx_lineno = 0;
13686 const char *__pyx_filename = NULL;
13687 int __pyx_clineno = 0;
13688 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian", 0);
13689 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
13690 __pyx_pybuffer_a_up.refcount = 0;
13691 __pyx_pybuffernd_a_up.data = NULL;
13692 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
13693 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
13694 __pyx_pybuffer_f_up.refcount = 0;
13695 __pyx_pybuffernd_f_up.data = NULL;
13696 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
13697 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
13698 __pyx_pybuffer_gravity.refcount = 0;
13699 __pyx_pybuffernd_gravity.data = NULL;
13700 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
13701 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
13702 __pyx_pybuffer_rowptr.refcount = 0;
13703 __pyx_pybuffernd_rowptr.data = NULL;
13704 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
13705 __pyx_pybuffer_colind.pybuffer.buf = NULL;
13706 __pyx_pybuffer_colind.refcount = 0;
13707 __pyx_pybuffernd_colind.data = NULL;
13708 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
13709 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
13710 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
13711 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
13712 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
13713 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
13714 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
13715 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
13716 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
13717 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
13718 __pyx_pybuffer_q_u.refcount = 0;
13719 __pyx_pybuffernd_q_u.data = NULL;
13720 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
13721 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
13722 __pyx_pybuffer_q_grad_u.refcount = 0;
13723 __pyx_pybuffernd_q_grad_u.data = NULL;
13724 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
13725 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
13726 __pyx_pybuffer_q_grad_w.refcount = 0;
13727 __pyx_pybuffernd_q_grad_w.data = NULL;
13728 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
13729 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
13730 __pyx_pybuffer_q_grad_v.refcount = 0;
13731 __pyx_pybuffernd_q_grad_v.data = NULL;
13732 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
13733 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
13734 __pyx_pybuffer_q_detJ.refcount = 0;
13735 __pyx_pybuffernd_q_detJ.data = NULL;
13736 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
13737 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
13738 __pyx_pybuffer_q_m.refcount = 0;
13739 __pyx_pybuffernd_q_m.data = NULL;
13740 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
13741 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
13742 __pyx_pybuffer_q_dm.refcount = 0;
13743 __pyx_pybuffernd_q_dm.data = NULL;
13744 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
13745 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
13746 __pyx_pybuffer_q_mt.refcount = 0;
13747 __pyx_pybuffernd_q_mt.data = NULL;
13748 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
13749 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
13750 __pyx_pybuffer_q_dmt.refcount = 0;
13751 __pyx_pybuffernd_q_dmt.data = NULL;
13752 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
13753 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
13754 __pyx_pybuffer_q_r.refcount = 0;
13755 __pyx_pybuffernd_q_r.data = NULL;
13756 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
13757 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
13758 __pyx_pybuffer_q_kr.refcount = 0;
13759 __pyx_pybuffernd_q_kr.data = NULL;
13760 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
13761 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
13762 __pyx_pybuffer_q_dkr.refcount = 0;
13763 __pyx_pybuffernd_q_dkr.data = NULL;
13764 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
13765 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
13766 __pyx_pybuffer_q_kr_up.refcount = 0;
13767 __pyx_pybuffernd_q_kr_up.data = NULL;
13768 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
13769 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
13770 __pyx_pybuffer_q_flin.refcount = 0;
13771 __pyx_pybuffernd_q_flin.data = NULL;
13772 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
13773 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
13774 __pyx_pybuffer_q_alin.refcount = 0;
13775 __pyx_pybuffernd_q_alin.data = NULL;
13776 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
13777 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
13778 __pyx_pybuffer_elementJacobian.refcount = 0;
13779 __pyx_pybuffernd_elementJacobian.data = NULL;
13780 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
13782 __Pyx_BufFmt_StackElem __pyx_stack[1];
13783 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13785 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
13787 __Pyx_BufFmt_StackElem __pyx_stack[1];
13788 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13790 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
13792 __Pyx_BufFmt_StackElem __pyx_stack[1];
13793 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13795 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
13797 __Pyx_BufFmt_StackElem __pyx_stack[1];
13798 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13800 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
13802 __Pyx_BufFmt_StackElem __pyx_stack[1];
13803 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13805 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
13807 __Pyx_BufFmt_StackElem __pyx_stack[1];
13808 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13810 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
13812 __Pyx_BufFmt_StackElem __pyx_stack[1];
13813 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13815 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
13817 __Pyx_BufFmt_StackElem __pyx_stack[1];
13818 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13820 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
13822 __Pyx_BufFmt_StackElem __pyx_stack[1];
13823 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13825 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
13827 __Pyx_BufFmt_StackElem __pyx_stack[1];
13828 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13830 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
13832 __Pyx_BufFmt_StackElem __pyx_stack[1];
13833 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13835 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
13837 __Pyx_BufFmt_StackElem __pyx_stack[1];
13838 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13840 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
13842 __Pyx_BufFmt_StackElem __pyx_stack[1];
13843 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13845 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
13847 __Pyx_BufFmt_StackElem __pyx_stack[1];
13848 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13850 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
13852 __Pyx_BufFmt_StackElem __pyx_stack[1];
13853 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13855 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
13857 __Pyx_BufFmt_StackElem __pyx_stack[1];
13858 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13860 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
13862 __Pyx_BufFmt_StackElem __pyx_stack[1];
13863 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13865 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
13867 __Pyx_BufFmt_StackElem __pyx_stack[1];
13868 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13870 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
13872 __Pyx_BufFmt_StackElem __pyx_stack[1];
13873 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13875 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
13877 __Pyx_BufFmt_StackElem __pyx_stack[1];
13878 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13880 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
13882 __Pyx_BufFmt_StackElem __pyx_stack[1];
13883 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13885 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
13894 __pyx_v_upwindFlag = 1;
13903 __pyx_v_picard = 1;
13912 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13913 __Pyx_GOTREF(__pyx_t_1);
13914 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
13915 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
13916 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
13917 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
13918 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
13919 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
13920 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
13921 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
13922 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
13923 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
13924 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
13925 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
13926 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
13927 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
13928 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
13929 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13932 if (__pyx_t_3 >= 5)
break;
13933 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13934 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
13936 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13937 __Pyx_GOTREF(__pyx_t_1);
13939 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
13949 #ifndef CYTHON_WITHOUT_ASSERTIONS
13950 if (unlikely(!Py_OptimizeFlag)) {
13951 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13952 __Pyx_GOTREF(__pyx_t_1);
13953 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
13954 __Pyx_GOTREF(__pyx_t_4);
13955 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13956 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13957 __Pyx_GOTREF(__pyx_t_1);
13958 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
13959 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13960 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13961 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
13962 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13963 if (unlikely(!__pyx_t_6)) {
13964 PyErr_SetNone(PyExc_AssertionError);
13965 __PYX_ERR(0, 624, __pyx_L1_error)
13978 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13987 #ifndef CYTHON_WITHOUT_ASSERTIONS
13988 if (unlikely(!Py_OptimizeFlag)) {
13989 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
13990 PyErr_SetNone(PyExc_AssertionError);
13991 __PYX_ERR(0, 625, __pyx_L1_error)
14003 __pyx_t_7 = __pyx_v_nSpace;
14005 if (__pyx_t_7 < 0) {
14006 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14007 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
14008 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
14009 if (unlikely(__pyx_t_8 != -1)) {
14010 __Pyx_RaiseBufferIndexError(__pyx_t_8);
14011 __PYX_ERR(0, 626, __pyx_L1_error)
14013 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14022 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
14023 __Pyx_GOTREF(__pyx_t_5);
14024 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
14025 __Pyx_GOTREF(__pyx_t_1);
14026 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14027 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
14028 __Pyx_GOTREF(__pyx_t_5);
14031 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
14032 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
14033 if (likely(__pyx_t_4)) {
14034 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
14035 __Pyx_INCREF(__pyx_t_4);
14036 __Pyx_INCREF(
function);
14037 __Pyx_DECREF_SET(__pyx_t_1,
function);
14041 #if CYTHON_FAST_PYCALL
14042 if (PyFunction_Check(__pyx_t_1)) {
14043 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
14044 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14045 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14046 __Pyx_GOTREF(__pyx_t_2);
14047 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14050 #if CYTHON_FAST_PYCCALL
14051 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
14052 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
14053 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14054 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14055 __Pyx_GOTREF(__pyx_t_2);
14056 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14060 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error)
14061 __Pyx_GOTREF(__pyx_t_9);
14063 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
14065 __Pyx_GIVEREF(__pyx_t_5);
14066 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
14067 __Pyx_INCREF(__pyx_n_s_d);
14068 __Pyx_GIVEREF(__pyx_n_s_d);
14069 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
14071 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14072 __Pyx_GOTREF(__pyx_t_2);
14073 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14075 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14076 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error)
14077 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
14079 __Pyx_BufFmt_StackElem __pyx_stack[1];
14080 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14081 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
14082 __PYX_ERR(0, 630, __pyx_L1_error)
14083 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
14087 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
14097 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14098 __Pyx_GOTREF(__pyx_t_1);
14099 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 631, __pyx_L1_error)
14100 __Pyx_GOTREF(__pyx_t_9);
14101 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14102 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14103 __Pyx_GOTREF(__pyx_t_1);
14106 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14107 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
14108 if (likely(__pyx_t_5)) {
14109 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14110 __Pyx_INCREF(__pyx_t_5);
14111 __Pyx_INCREF(
function);
14112 __Pyx_DECREF_SET(__pyx_t_9,
function);
14116 #if CYTHON_FAST_PYCALL
14117 if (PyFunction_Check(__pyx_t_9)) {
14118 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14119 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14120 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14121 __Pyx_GOTREF(__pyx_t_2);
14122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14125 #if CYTHON_FAST_PYCCALL
14126 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14127 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14128 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14129 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14130 __Pyx_GOTREF(__pyx_t_2);
14131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14135 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
14136 __Pyx_GOTREF(__pyx_t_4);
14138 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
14140 __Pyx_GIVEREF(__pyx_t_1);
14141 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
14142 __Pyx_INCREF(__pyx_n_s_d);
14143 __Pyx_GIVEREF(__pyx_n_s_d);
14144 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
14146 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14147 __Pyx_GOTREF(__pyx_t_2);
14148 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14150 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14151 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
14152 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
14154 __Pyx_BufFmt_StackElem __pyx_stack[1];
14155 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14156 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
14157 __PYX_ERR(0, 631, __pyx_L1_error)
14158 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
14162 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
14172 __pyx_t_12 = (__pyx_v_nSpace + 1.);
14173 if (unlikely(__pyx_t_12 == 0)) {
14174 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14175 __PYX_ERR(0, 633, __pyx_L1_error)
14177 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
14186 __pyx_v_weight = 1.0;
14187 __pyx_v_volFactor = 1.0;
14196 __pyx_v_thisElementIsUpwind = 1;
14205 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
14215 __pyx_v_volFactor = 0.5;
14233 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
14243 __pyx_v_volFactor = (1.0 / 6.0);
14261 __pyx_t_8 = __pyx_v_nElements_global;
14262 __pyx_t_13 = __pyx_t_8;
14263 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
14264 __pyx_v_eN = __pyx_t_14;
14273 __pyx_t_7 = __pyx_v_eN;
14276 if (__pyx_t_7 < 0) {
14277 __pyx_t_7 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
14278 if (unlikely(__pyx_t_7 < 0)) __pyx_t_16 = 0;
14279 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
14280 if (__pyx_t_15 < 0) {
14281 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
14282 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
14283 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
14284 if (unlikely(__pyx_t_16 != -1)) {
14285 __Pyx_RaiseBufferIndexError(__pyx_t_16);
14286 __PYX_ERR(0, 642, __pyx_L1_error)
14288 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
14297 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
14306 __pyx_t_16 = __pyx_v_nDOF_test_element;
14307 __pyx_t_17 = __pyx_t_16;
14308 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
14309 __pyx_v_i = __pyx_t_18;
14318 __pyx_t_15 = __pyx_v_eN;
14319 __pyx_t_7 = __pyx_v_i;
14321 if (__pyx_t_15 < 0) {
14322 __pyx_t_15 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
14323 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 0;
14324 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_19 = 0;
14325 if (__pyx_t_7 < 0) {
14326 __pyx_t_7 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
14327 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 1;
14328 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_19 = 1;
14329 if (unlikely(__pyx_t_19 != -1)) {
14330 __Pyx_RaiseBufferIndexError(__pyx_t_19);
14331 __PYX_ERR(0, 650, __pyx_L1_error)
14333 __pyx_t_20 = __pyx_v_eN;
14334 __pyx_t_21 = __pyx_v_i;
14335 __pyx_t_22 = __pyx_v_i;
14337 if (__pyx_t_20 < 0) {
14338 __pyx_t_20 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14339 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
14340 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_19 = 0;
14341 if (__pyx_t_21 < 0) {
14342 __pyx_t_21 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14343 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 1;
14344 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_19 = 1;
14345 if (__pyx_t_22 < 0) {
14346 __pyx_t_22 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14347 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 2;
14348 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_19 = 2;
14349 if (unlikely(__pyx_t_19 != -1)) {
14350 __Pyx_RaiseBufferIndexError(__pyx_t_19);
14351 __PYX_ERR(0, 650, __pyx_L1_error)
14353 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
14362 __pyx_t_19 = __pyx_v_nElementBoundaries_element;
14363 __pyx_t_23 = __pyx_t_19;
14364 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
14365 __pyx_v_ebN = __pyx_t_24;
14374 __pyx_t_25 = __pyx_v_nnz;
14375 __pyx_t_26 = __pyx_t_25;
14376 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14377 __pyx_v_ii = __pyx_t_27;
14386 __pyx_t_7 = __pyx_v_eN;
14387 __pyx_t_15 = __pyx_v_ebN;
14388 __pyx_t_22 = __pyx_v_ii;
14390 if (__pyx_t_7 < 0) {
14391 __pyx_t_7 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
14392 if (unlikely(__pyx_t_7 < 0)) __pyx_t_28 = 0;
14393 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_28 = 0;
14394 if (__pyx_t_15 < 0) {
14395 __pyx_t_15 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
14396 if (unlikely(__pyx_t_15 < 0)) __pyx_t_28 = 1;
14397 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_28 = 1;
14398 if (__pyx_t_22 < 0) {
14399 __pyx_t_22 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
14400 if (unlikely(__pyx_t_22 < 0)) __pyx_t_28 = 2;
14401 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_28 = 2;
14402 if (unlikely(__pyx_t_28 != -1)) {
14403 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14404 __PYX_ERR(0, 656, __pyx_L1_error)
14406 __pyx_t_21 = __pyx_v_eN;
14407 __pyx_t_20 = __pyx_v_ebN;
14409 if (__pyx_t_21 < 0) {
14410 __pyx_t_21 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14411 if (unlikely(__pyx_t_21 < 0)) __pyx_t_28 = 0;
14412 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_28 = 0;
14413 if (__pyx_t_20 < 0) {
14414 __pyx_t_20 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14415 if (unlikely(__pyx_t_20 < 0)) __pyx_t_28 = 1;
14416 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_28 = 1;
14417 if (unlikely(__pyx_t_28 != -1)) {
14418 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14419 __PYX_ERR(0, 656, __pyx_L1_error)
14421 __pyx_t_29 = __pyx_v_ii;
14423 if (__pyx_t_29 < 0) {
14424 __pyx_t_29 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14425 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
14426 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_28 = 0;
14427 if (unlikely(__pyx_t_28 != -1)) {
14428 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14429 __PYX_ERR(0, 656, __pyx_L1_error)
14431 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14441 __pyx_t_25 = __pyx_v_nSpace;
14442 __pyx_t_26 = __pyx_t_25;
14443 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14444 __pyx_v_I = __pyx_t_27;
14453 __pyx_t_20 = __pyx_v_eN;
14454 __pyx_t_21 = __pyx_v_ebN;
14455 __pyx_t_22 = __pyx_v_I;
14457 if (__pyx_t_20 < 0) {
14458 __pyx_t_20 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
14459 if (unlikely(__pyx_t_20 < 0)) __pyx_t_28 = 0;
14460 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_28 = 0;
14461 if (__pyx_t_21 < 0) {
14462 __pyx_t_21 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
14463 if (unlikely(__pyx_t_21 < 0)) __pyx_t_28 = 1;
14464 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_28 = 1;
14465 if (__pyx_t_22 < 0) {
14466 __pyx_t_22 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
14467 if (unlikely(__pyx_t_22 < 0)) __pyx_t_28 = 2;
14468 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_28 = 2;
14469 if (unlikely(__pyx_t_28 != -1)) {
14470 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14471 __PYX_ERR(0, 658, __pyx_L1_error)
14473 __pyx_t_15 = __pyx_v_eN;
14474 __pyx_t_7 = __pyx_v_ebN;
14476 if (__pyx_t_15 < 0) {
14477 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14478 if (unlikely(__pyx_t_15 < 0)) __pyx_t_28 = 0;
14479 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_28 = 0;
14480 if (__pyx_t_7 < 0) {
14481 __pyx_t_7 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14482 if (unlikely(__pyx_t_7 < 0)) __pyx_t_28 = 1;
14483 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_28 = 1;
14484 if (unlikely(__pyx_t_28 != -1)) {
14485 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14486 __PYX_ERR(0, 658, __pyx_L1_error)
14488 __pyx_t_29 = __pyx_v_I;
14490 if (__pyx_t_29 < 0) {
14491 __pyx_t_29 += __pyx_pybuffernd_f_up.diminfo[0].shape;
14492 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
14493 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_28 = 0;
14494 if (unlikely(__pyx_t_28 != -1)) {
14495 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14496 __PYX_ERR(0, 658, __pyx_L1_error)
14498 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14508 __pyx_t_25 = __pyx_v_nDOF_trial_element;
14509 __pyx_t_26 = __pyx_t_25;
14510 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14511 __pyx_v_j = __pyx_t_27;
14520 __pyx_t_28 = __pyx_v_nSpace;
14521 __pyx_t_30 = __pyx_t_28;
14522 for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
14523 __pyx_v_I = __pyx_t_31;
14532 __pyx_t_7 = (__pyx_v_I + 1);
14534 if (__pyx_t_7 < 0) {
14535 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14536 if (unlikely(__pyx_t_7 < 0)) __pyx_t_32 = 0;
14537 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_32 = 0;
14538 if (unlikely(__pyx_t_32 != -1)) {
14539 __Pyx_RaiseBufferIndexError(__pyx_t_32);
14540 __PYX_ERR(0, 664, __pyx_L1_error)
14542 __pyx_t_33 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14543 __pyx_t_7 = __pyx_v_I;
14545 if (__pyx_t_7 < 0) {
14546 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14547 if (unlikely(__pyx_t_7 < 0)) __pyx_t_32 = 0;
14548 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_32 = 0;
14549 if (unlikely(__pyx_t_32 != -1)) {
14550 __Pyx_RaiseBufferIndexError(__pyx_t_32);
14551 __PYX_ERR(0, 664, __pyx_L1_error)
14553 __pyx_t_34 = __pyx_t_33;
14554 for (__pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_32 < __pyx_t_34; __pyx_t_32+=1) {
14555 __pyx_v_ii = __pyx_t_32;
14564 __pyx_t_15 = __pyx_v_ii;
14566 if (__pyx_t_15 < 0) {
14567 __pyx_t_15 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14568 if (unlikely(__pyx_t_15 < 0)) __pyx_t_35 = 0;
14569 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_35 = 0;
14570 if (unlikely(__pyx_t_35 != -1)) {
14571 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14572 __PYX_ERR(0, 665, __pyx_L1_error)
14574 __pyx_t_22 = __pyx_v_ii;
14576 if (__pyx_t_22 < 0) {
14577 __pyx_t_22 += __pyx_pybuffernd_colind.diminfo[0].shape;
14578 if (unlikely(__pyx_t_22 < 0)) __pyx_t_35 = 0;
14579 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_35 = 0;
14580 if (unlikely(__pyx_t_35 != -1)) {
14581 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14582 __PYX_ERR(0, 665, __pyx_L1_error)
14584 __pyx_t_21 = __pyx_v_eN;
14585 __pyx_t_20 = __pyx_v_ebN;
14586 __pyx_t_29 = __pyx_v_j;
14587 __pyx_t_36 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_colind.diminfo[0].strides));
14589 if (__pyx_t_21 < 0) {
14590 __pyx_t_21 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
14591 if (unlikely(__pyx_t_21 < 0)) __pyx_t_35 = 0;
14592 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_35 = 0;
14593 if (__pyx_t_20 < 0) {
14594 __pyx_t_20 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
14595 if (unlikely(__pyx_t_20 < 0)) __pyx_t_35 = 1;
14596 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_35 = 1;
14597 if (__pyx_t_29 < 0) {
14598 __pyx_t_29 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
14599 if (unlikely(__pyx_t_29 < 0)) __pyx_t_35 = 2;
14600 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_35 = 2;
14601 if (__pyx_t_36 < 0) {
14602 __pyx_t_36 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
14603 if (unlikely(__pyx_t_36 < 0)) __pyx_t_35 = 3;
14604 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_35 = 3;
14605 if (unlikely(__pyx_t_35 != -1)) {
14606 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14607 __PYX_ERR(0, 665, __pyx_L1_error)
14609 __pyx_t_37 = __pyx_v_eN;
14610 __pyx_t_38 = __pyx_v_ebN;
14611 __pyx_t_39 = __pyx_v_i;
14612 __pyx_t_40 = __pyx_v_I;
14614 if (__pyx_t_37 < 0) {
14615 __pyx_t_37 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
14616 if (unlikely(__pyx_t_37 < 0)) __pyx_t_35 = 0;
14617 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_35 = 0;
14618 if (__pyx_t_38 < 0) {
14619 __pyx_t_38 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
14620 if (unlikely(__pyx_t_38 < 0)) __pyx_t_35 = 1;
14621 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_35 = 1;
14622 if (__pyx_t_39 < 0) {
14623 __pyx_t_39 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
14624 if (unlikely(__pyx_t_39 < 0)) __pyx_t_35 = 2;
14625 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_35 = 2;
14626 if (__pyx_t_40 < 0) {
14627 __pyx_t_40 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
14628 if (unlikely(__pyx_t_40 < 0)) __pyx_t_35 = 3;
14629 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_35 = 3;
14630 if (unlikely(__pyx_t_35 != -1)) {
14631 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14632 __PYX_ERR(0, 665, __pyx_L1_error)
14634 __pyx_t_41 = __pyx_v_eN;
14635 __pyx_t_42 = __pyx_v_i;
14636 __pyx_t_43 = __pyx_v_j;
14638 if (__pyx_t_41 < 0) {
14639 __pyx_t_41 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14640 if (unlikely(__pyx_t_41 < 0)) __pyx_t_35 = 0;
14641 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_35 = 0;
14642 if (__pyx_t_42 < 0) {
14643 __pyx_t_42 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14644 if (unlikely(__pyx_t_42 < 0)) __pyx_t_35 = 1;
14645 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_35 = 1;
14646 if (__pyx_t_43 < 0) {
14647 __pyx_t_43 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14648 if (unlikely(__pyx_t_43 < 0)) __pyx_t_35 = 2;
14649 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_35 = 2;
14650 if (unlikely(__pyx_t_35 != -1)) {
14651 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14652 __PYX_ERR(0, 665, __pyx_L1_error)
14654 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_36, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_40, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
14671 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14674 __Pyx_XDECREF(__pyx_t_1);
14675 __Pyx_XDECREF(__pyx_t_2);
14676 __Pyx_XDECREF(__pyx_t_4);
14677 __Pyx_XDECREF(__pyx_t_5);
14678 __Pyx_XDECREF(__pyx_t_9);
14679 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14680 __Pyx_PyThreadState_declare
14681 __Pyx_PyThreadState_assign
14682 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14683 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14684 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14685 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14686 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14687 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14688 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14689 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14690 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14691 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14692 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14693 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14694 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14695 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14696 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14697 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14698 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14699 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14700 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14701 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14702 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14703 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14704 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14705 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14706 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14707 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
14711 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14712 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14713 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14714 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14715 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14716 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14717 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14718 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14719 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14720 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14721 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14722 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14723 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14724 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14725 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14726 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14727 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14728 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14729 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14730 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14731 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14732 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14733 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14735 __Pyx_XDECREF(__pyx_v_q);
14736 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
14737 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
14738 __Pyx_XGIVEREF(__pyx_r);
14739 __Pyx_RefNannyFinishContext();
14752 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14753 static char __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg[] =
"\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ";
14754 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {
"updateMass_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
14755 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14756 PyArrayObject *__pyx_v_mt = 0;
14757 PyArrayObject *__pyx_v_w = 0;
14758 PyArrayObject *__pyx_v_dV = 0;
14759 PyArrayObject *__pyx_v_weak_residual = 0;
14760 int __pyx_lineno = 0;
14761 const char *__pyx_filename = NULL;
14762 int __pyx_clineno = 0;
14763 PyObject *__pyx_r = 0;
14764 __Pyx_RefNannyDeclarations
14765 __Pyx_RefNannySetupContext(
"updateMass_weakAvg (wrapper)", 0);
14767 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mt,&__pyx_n_s_w,&__pyx_n_s_dV,&__pyx_n_s_weak_residual,0};
14768 PyObject* values[4] = {0,0,0,0};
14769 if (unlikely(__pyx_kwds)) {
14770 Py_ssize_t kw_args;
14771 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14772 switch (pos_args) {
14773 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14774 CYTHON_FALLTHROUGH;
14775 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14776 CYTHON_FALLTHROUGH;
14777 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14778 CYTHON_FALLTHROUGH;
14779 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14780 CYTHON_FALLTHROUGH;
14782 default:
goto __pyx_L5_argtuple_error;
14784 kw_args = PyDict_Size(__pyx_kwds);
14785 switch (pos_args) {
14787 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
14788 else goto __pyx_L5_argtuple_error;
14789 CYTHON_FALLTHROUGH;
14791 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
14793 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 1); __PYX_ERR(0, 673, __pyx_L3_error)
14795 CYTHON_FALLTHROUGH;
14797 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14799 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 2); __PYX_ERR(0, 673, __pyx_L3_error)
14801 CYTHON_FALLTHROUGH;
14803 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weak_residual)) != 0)) kw_args--;
14805 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 3); __PYX_ERR(0, 673, __pyx_L3_error)
14808 if (unlikely(kw_args > 0)) {
14809 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMass_weakAvg") < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
14811 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14812 goto __pyx_L5_argtuple_error;
14814 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14815 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14816 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14817 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14819 __pyx_v_mt = ((PyArrayObject *)values[0]);
14820 __pyx_v_w = ((PyArrayObject *)values[1]);
14821 __pyx_v_dV = ((PyArrayObject *)values[2]);
14822 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
14824 goto __pyx_L4_argument_unpacking_done;
14825 __pyx_L5_argtuple_error:;
14826 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 673, __pyx_L3_error)
14828 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14829 __Pyx_RefNannyFinishContext();
14831 __pyx_L4_argument_unpacking_done:;
14832 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 673, __pyx_L1_error)
14833 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
14834 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 675, __pyx_L1_error)
14835 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"weak_residual", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
14836 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
14843 __Pyx_RefNannyFinishContext();
14847 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual) {
14851 PyObject *__pyx_v_mt_avg = 0;
14852 PyObject *__pyx_v_vol = 0;
14853 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14854 __Pyx_Buffer __pyx_pybuffer_dV;
14855 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
14856 __Pyx_Buffer __pyx_pybuffer_mt;
14857 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
14858 __Pyx_Buffer __pyx_pybuffer_w;
14859 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
14860 __Pyx_Buffer __pyx_pybuffer_weak_residual;
14861 PyObject *__pyx_r = NULL;
14862 __Pyx_RefNannyDeclarations
14863 npy_intp __pyx_t_1;
14864 npy_intp __pyx_t_2;
14866 npy_intp __pyx_t_4;
14867 npy_intp __pyx_t_5;
14869 Py_ssize_t __pyx_t_7;
14870 Py_ssize_t __pyx_t_8;
14872 Py_ssize_t __pyx_t_10;
14873 Py_ssize_t __pyx_t_11;
14874 PyObject *__pyx_t_12 = NULL;
14875 PyObject *__pyx_t_13 = NULL;
14876 PyObject *__pyx_t_14 = NULL;
14878 int __pyx_lineno = 0;
14879 const char *__pyx_filename = NULL;
14880 int __pyx_clineno = 0;
14881 __Pyx_RefNannySetupContext(
"updateMass_weakAvg", 0);
14882 __pyx_pybuffer_mt.pybuffer.buf = NULL;
14883 __pyx_pybuffer_mt.refcount = 0;
14884 __pyx_pybuffernd_mt.data = NULL;
14885 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
14886 __pyx_pybuffer_w.pybuffer.buf = NULL;
14887 __pyx_pybuffer_w.refcount = 0;
14888 __pyx_pybuffernd_w.data = NULL;
14889 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
14890 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14891 __pyx_pybuffer_dV.refcount = 0;
14892 __pyx_pybuffernd_dV.data = NULL;
14893 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14894 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
14895 __pyx_pybuffer_weak_residual.refcount = 0;
14896 __pyx_pybuffernd_weak_residual.data = NULL;
14897 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
14899 __Pyx_BufFmt_StackElem __pyx_stack[1];
14900 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14902 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
14904 __Pyx_BufFmt_StackElem __pyx_stack[1];
14905 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14907 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
14909 __Pyx_BufFmt_StackElem __pyx_stack[1];
14910 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14912 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14914 __Pyx_BufFmt_StackElem __pyx_stack[1];
14915 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14917 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
14926 __pyx_t_1 = (__pyx_v_mt->dimensions[0]);
14927 __pyx_t_2 = __pyx_t_1;
14928 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14929 __pyx_v_eN = __pyx_t_3;
14938 __Pyx_INCREF(__pyx_float_0_0);
14939 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_float_0_0);
14948 __Pyx_INCREF(__pyx_float_0_0);
14949 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_float_0_0);
14958 __pyx_t_4 = (__pyx_v_mt->dimensions[1]);
14959 __pyx_t_5 = __pyx_t_4;
14960 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14961 __pyx_v_k = __pyx_t_6;
14970 __pyx_t_7 = __pyx_v_eN;
14971 __pyx_t_8 = __pyx_v_k;
14973 if (__pyx_t_7 < 0) {
14974 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
14975 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
14976 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14977 if (__pyx_t_8 < 0) {
14978 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
14979 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
14980 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14981 if (unlikely(__pyx_t_9 != -1)) {
14982 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14983 __PYX_ERR(0, 686, __pyx_L1_error)
14985 __pyx_t_10 = __pyx_v_eN;
14986 __pyx_t_11 = __pyx_v_k;
14988 if (__pyx_t_10 < 0) {
14989 __pyx_t_10 += __pyx_pybuffernd_mt.diminfo[0].shape;
14990 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
14991 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_9 = 0;
14992 if (__pyx_t_11 < 0) {
14993 __pyx_t_11 += __pyx_pybuffernd_mt.diminfo[1].shape;
14994 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
14995 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_9 = 1;
14996 if (unlikely(__pyx_t_9 != -1)) {
14997 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14998 __PYX_ERR(0, 686, __pyx_L1_error)
15000 __pyx_t_12 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_mt.diminfo[1].strides))));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 686, __pyx_L1_error)
15001 __Pyx_GOTREF(__pyx_t_12);
15002 __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 686, __pyx_L1_error)
15003 __Pyx_GOTREF(__pyx_t_13);
15004 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15005 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_13);
15015 __pyx_t_11 = __pyx_v_eN;
15016 __pyx_t_10 = __pyx_v_k;
15018 if (__pyx_t_11 < 0) {
15019 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[0].shape;
15020 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
15021 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15022 if (__pyx_t_10 < 0) {
15023 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[1].shape;
15024 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
15025 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15026 if (unlikely(__pyx_t_9 != -1)) {
15027 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15028 __PYX_ERR(0, 687, __pyx_L1_error)
15030 __pyx_t_13 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 687, __pyx_L1_error)
15031 __Pyx_GOTREF(__pyx_t_13);
15032 __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_vol, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 687, __pyx_L1_error)
15033 __Pyx_GOTREF(__pyx_t_12);
15034 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15035 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_12);
15046 __pyx_t_12 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error)
15047 __Pyx_GOTREF(__pyx_t_12);
15048 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_12);
15058 __pyx_t_4 = (__pyx_v_weak_residual->dimensions[1]);
15059 __pyx_t_5 = __pyx_t_4;
15060 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15061 __pyx_v_i = __pyx_t_6;
15070 __pyx_t_10 = __pyx_v_eN;
15071 __pyx_t_11 = __pyx_v_k;
15072 __pyx_t_8 = __pyx_v_i;
15074 if (__pyx_t_10 < 0) {
15075 __pyx_t_10 += __pyx_pybuffernd_w.diminfo[0].shape;
15076 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
15077 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_9 = 0;
15078 if (__pyx_t_11 < 0) {
15079 __pyx_t_11 += __pyx_pybuffernd_w.diminfo[1].shape;
15080 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
15081 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_9 = 1;
15082 if (__pyx_t_8 < 0) {
15083 __pyx_t_8 += __pyx_pybuffernd_w.diminfo[2].shape;
15084 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
15085 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_9 = 2;
15086 if (unlikely(__pyx_t_9 != -1)) {
15087 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15088 __PYX_ERR(0, 691, __pyx_L1_error)
15090 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_w.diminfo[2].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15091 __Pyx_GOTREF(__pyx_t_12);
15092 __pyx_t_13 = PyNumber_Multiply(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 691, __pyx_L1_error)
15093 __Pyx_GOTREF(__pyx_t_13);
15094 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15095 __pyx_t_8 = __pyx_v_eN;
15096 __pyx_t_11 = __pyx_v_k;
15098 if (__pyx_t_8 < 0) {
15099 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15100 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
15101 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15102 if (__pyx_t_11 < 0) {
15103 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
15104 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
15105 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15106 if (unlikely(__pyx_t_9 != -1)) {
15107 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15108 __PYX_ERR(0, 691, __pyx_L1_error)
15110 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15111 __Pyx_GOTREF(__pyx_t_12);
15112 __pyx_t_14 = PyNumber_Multiply(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 691, __pyx_L1_error)
15113 __Pyx_GOTREF(__pyx_t_14);
15114 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15115 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15116 __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_t_14);
if (unlikely(__pyx_t_15 == ((
double)((
double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L1_error)
15117 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
15118 __pyx_t_11 = __pyx_v_eN;
15119 __pyx_t_8 = __pyx_v_i;
15121 if (__pyx_t_11 < 0) {
15122 __pyx_t_11 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
15123 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
15124 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_9 = 0;
15125 if (__pyx_t_8 < 0) {
15126 __pyx_t_8 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
15127 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15128 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_9 = 1;
15129 if (unlikely(__pyx_t_9 != -1)) {
15130 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15131 __PYX_ERR(0, 691, __pyx_L1_error)
15133 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_15;
15146 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15149 __Pyx_XDECREF(__pyx_t_12);
15150 __Pyx_XDECREF(__pyx_t_13);
15151 __Pyx_XDECREF(__pyx_t_14);
15152 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15153 __Pyx_PyThreadState_declare
15154 __Pyx_PyThreadState_assign
15155 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15156 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15157 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15158 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15159 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15160 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15161 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15165 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15166 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15167 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15168 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15170 __Pyx_XDECREF(__pyx_v_mt_avg);
15171 __Pyx_XDECREF(__pyx_v_vol);
15172 __Pyx_XGIVEREF(__pyx_r);
15173 __Pyx_RefNannyFinishContext();
15186 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15187 static char __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg[] =
"\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ";
15188 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {
"updateMassJacobian_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
15189 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15190 PyArrayObject *__pyx_v_dmt = 0;
15191 PyArrayObject *__pyx_v_w = 0;
15192 PyArrayObject *__pyx_v_v = 0;
15193 PyArrayObject *__pyx_v_dV = 0;
15194 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
15195 int __pyx_lineno = 0;
15196 const char *__pyx_filename = NULL;
15197 int __pyx_clineno = 0;
15198 PyObject *__pyx_r = 0;
15199 __Pyx_RefNannyDeclarations
15200 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg (wrapper)", 0);
15202 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmt,&__pyx_n_s_w,&__pyx_n_s_v,&__pyx_n_s_dV,&__pyx_n_s_jacobian_weak_residual,0};
15203 PyObject* values[5] = {0,0,0,0,0};
15204 if (unlikely(__pyx_kwds)) {
15205 Py_ssize_t kw_args;
15206 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15207 switch (pos_args) {
15208 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15209 CYTHON_FALLTHROUGH;
15210 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15211 CYTHON_FALLTHROUGH;
15212 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15213 CYTHON_FALLTHROUGH;
15214 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15215 CYTHON_FALLTHROUGH;
15216 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15217 CYTHON_FALLTHROUGH;
15219 default:
goto __pyx_L5_argtuple_error;
15221 kw_args = PyDict_Size(__pyx_kwds);
15222 switch (pos_args) {
15224 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
15225 else goto __pyx_L5_argtuple_error;
15226 CYTHON_FALLTHROUGH;
15228 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
15230 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 1); __PYX_ERR(0, 692, __pyx_L3_error)
15232 CYTHON_FALLTHROUGH;
15234 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15236 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 2); __PYX_ERR(0, 692, __pyx_L3_error)
15238 CYTHON_FALLTHROUGH;
15240 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15242 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 3); __PYX_ERR(0, 692, __pyx_L3_error)
15244 CYTHON_FALLTHROUGH;
15246 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian_weak_residual)) != 0)) kw_args--;
15248 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 4); __PYX_ERR(0, 692, __pyx_L3_error)
15251 if (unlikely(kw_args > 0)) {
15252 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMassJacobian_weakAvg") < 0)) __PYX_ERR(0, 692, __pyx_L3_error)
15254 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
15255 goto __pyx_L5_argtuple_error;
15257 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15258 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15259 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15260 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15261 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15263 __pyx_v_dmt = ((PyArrayObject *)values[0]);
15264 __pyx_v_w = ((PyArrayObject *)values[1]);
15265 __pyx_v_v = ((PyArrayObject *)values[2]);
15266 __pyx_v_dV = ((PyArrayObject *)values[3]);
15267 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
15269 goto __pyx_L4_argument_unpacking_done;
15270 __pyx_L5_argtuple_error:;
15271 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 692, __pyx_L3_error)
15273 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15274 __Pyx_RefNannyFinishContext();
15276 __pyx_L4_argument_unpacking_done:;
15277 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1,
"dmt", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
15278 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
15279 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 694, __pyx_L1_error)
15280 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 695, __pyx_L1_error)
15281 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"jacobian_weak_residual", 0))) __PYX_ERR(0, 696, __pyx_L1_error)
15282 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
15289 __Pyx_RefNannyFinishContext();
15293 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual) {
15298 double __pyx_v_dmtj_avg;
15299 double __pyx_v_vol;
15300 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15301 __Pyx_Buffer __pyx_pybuffer_dV;
15302 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
15303 __Pyx_Buffer __pyx_pybuffer_dmt;
15304 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
15305 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
15306 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15307 __Pyx_Buffer __pyx_pybuffer_v;
15308 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
15309 __Pyx_Buffer __pyx_pybuffer_w;
15310 PyObject *__pyx_r = NULL;
15311 __Pyx_RefNannyDeclarations
15312 npy_intp __pyx_t_1;
15313 npy_intp __pyx_t_2;
15315 npy_intp __pyx_t_4;
15316 npy_intp __pyx_t_5;
15318 Py_ssize_t __pyx_t_7;
15319 Py_ssize_t __pyx_t_8;
15321 npy_intp __pyx_t_10;
15322 npy_intp __pyx_t_11;
15323 npy_intp __pyx_t_12;
15324 npy_intp __pyx_t_13;
15327 Py_ssize_t __pyx_t_16;
15328 Py_ssize_t __pyx_t_17;
15329 Py_ssize_t __pyx_t_18;
15330 Py_ssize_t __pyx_t_19;
15331 Py_ssize_t __pyx_t_20;
15332 Py_ssize_t __pyx_t_21;
15333 int __pyx_lineno = 0;
15334 const char *__pyx_filename = NULL;
15335 int __pyx_clineno = 0;
15336 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg", 0);
15337 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
15338 __pyx_pybuffer_dmt.refcount = 0;
15339 __pyx_pybuffernd_dmt.data = NULL;
15340 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
15341 __pyx_pybuffer_w.pybuffer.buf = NULL;
15342 __pyx_pybuffer_w.refcount = 0;
15343 __pyx_pybuffernd_w.data = NULL;
15344 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
15345 __pyx_pybuffer_v.pybuffer.buf = NULL;
15346 __pyx_pybuffer_v.refcount = 0;
15347 __pyx_pybuffernd_v.data = NULL;
15348 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15349 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15350 __pyx_pybuffer_dV.refcount = 0;
15351 __pyx_pybuffernd_dV.data = NULL;
15352 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15353 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
15354 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
15355 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
15356 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
15358 __Pyx_BufFmt_StackElem __pyx_stack[1];
15359 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15361 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
15363 __Pyx_BufFmt_StackElem __pyx_stack[1];
15364 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15366 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
15368 __Pyx_BufFmt_StackElem __pyx_stack[1];
15369 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15371 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
15373 __Pyx_BufFmt_StackElem __pyx_stack[1];
15374 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15376 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15378 __Pyx_BufFmt_StackElem __pyx_stack[1];
15379 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15381 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
15390 __pyx_t_1 = (__pyx_v_dmt->dimensions[0]);
15391 __pyx_t_2 = __pyx_t_1;
15392 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15393 __pyx_v_eN = __pyx_t_3;
15411 __pyx_t_4 = (__pyx_v_dmt->dimensions[1]);
15412 __pyx_t_5 = __pyx_t_4;
15413 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15414 __pyx_v_k = __pyx_t_6;
15423 __pyx_t_7 = __pyx_v_eN;
15424 __pyx_t_8 = __pyx_v_k;
15426 if (__pyx_t_7 < 0) {
15427 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
15428 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
15429 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15430 if (__pyx_t_8 < 0) {
15431 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
15432 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15433 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15434 if (unlikely(__pyx_t_9 != -1)) {
15435 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15436 __PYX_ERR(0, 705, __pyx_L1_error)
15438 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
15448 __pyx_t_4 = (__pyx_v_w->dimensions[2]);
15449 __pyx_t_5 = __pyx_t_4;
15450 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15451 __pyx_v_i = __pyx_t_6;
15460 __pyx_t_10 = (__pyx_v_v->dimensions[2]);
15461 __pyx_t_11 = __pyx_t_10;
15462 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
15463 __pyx_v_j = __pyx_t_9;
15472 __pyx_v_dmtj_avg = 0.0;
15481 __pyx_t_12 = (__pyx_v_dmt->dimensions[1]);
15482 __pyx_t_13 = __pyx_t_12;
15483 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
15484 __pyx_v_k = __pyx_t_14;
15493 __pyx_t_8 = __pyx_v_eN;
15494 __pyx_t_7 = __pyx_v_k;
15496 if (__pyx_t_8 < 0) {
15497 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15498 if (unlikely(__pyx_t_8 < 0)) __pyx_t_15 = 0;
15499 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_15 = 0;
15500 if (__pyx_t_7 < 0) {
15501 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
15502 if (unlikely(__pyx_t_7 < 0)) __pyx_t_15 = 1;
15503 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_15 = 1;
15504 if (unlikely(__pyx_t_15 != -1)) {
15505 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15506 __PYX_ERR(0, 710, __pyx_L1_error)
15508 __pyx_t_16 = __pyx_v_eN;
15509 __pyx_t_17 = __pyx_v_k;
15511 if (__pyx_t_16 < 0) {
15512 __pyx_t_16 += __pyx_pybuffernd_dmt.diminfo[0].shape;
15513 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
15514 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_15 = 0;
15515 if (__pyx_t_17 < 0) {
15516 __pyx_t_17 += __pyx_pybuffernd_dmt.diminfo[1].shape;
15517 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
15518 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_15 = 1;
15519 if (unlikely(__pyx_t_15 != -1)) {
15520 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15521 __PYX_ERR(0, 710, __pyx_L1_error)
15523 __pyx_t_18 = __pyx_v_eN;
15524 __pyx_t_19 = __pyx_v_k;
15525 __pyx_t_20 = __pyx_v_j;
15527 if (__pyx_t_18 < 0) {
15528 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
15529 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
15530 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
15531 if (__pyx_t_19 < 0) {
15532 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
15533 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 1;
15534 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
15535 if (__pyx_t_20 < 0) {
15536 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
15537 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 2;
15538 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
15539 if (unlikely(__pyx_t_15 != -1)) {
15540 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15541 __PYX_ERR(0, 710, __pyx_L1_error)
15543 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides))));
15553 if (unlikely(__pyx_v_vol == 0)) {
15554 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15555 __PYX_ERR(0, 711, __pyx_L1_error)
15557 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
15566 __pyx_t_20 = __pyx_v_eN;
15567 __pyx_t_19 = __pyx_v_k;
15568 __pyx_t_18 = __pyx_v_i;
15570 if (__pyx_t_20 < 0) {
15571 __pyx_t_20 += __pyx_pybuffernd_w.diminfo[0].shape;
15572 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 0;
15573 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_14 = 0;
15574 if (__pyx_t_19 < 0) {
15575 __pyx_t_19 += __pyx_pybuffernd_w.diminfo[1].shape;
15576 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 1;
15577 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_14 = 1;
15578 if (__pyx_t_18 < 0) {
15579 __pyx_t_18 += __pyx_pybuffernd_w.diminfo[2].shape;
15580 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 2;
15581 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_14 = 2;
15582 if (unlikely(__pyx_t_14 != -1)) {
15583 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15584 __PYX_ERR(0, 712, __pyx_L1_error)
15586 __pyx_t_17 = __pyx_v_eN;
15587 __pyx_t_16 = __pyx_v_k;
15589 if (__pyx_t_17 < 0) {
15590 __pyx_t_17 += __pyx_pybuffernd_dV.diminfo[0].shape;
15591 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 0;
15592 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_14 = 0;
15593 if (__pyx_t_16 < 0) {
15594 __pyx_t_16 += __pyx_pybuffernd_dV.diminfo[1].shape;
15595 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
15596 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_14 = 1;
15597 if (unlikely(__pyx_t_14 != -1)) {
15598 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15599 __PYX_ERR(0, 712, __pyx_L1_error)
15601 __pyx_t_7 = __pyx_v_eN;
15602 __pyx_t_8 = __pyx_v_i;
15603 __pyx_t_21 = __pyx_v_j;
15605 if (__pyx_t_7 < 0) {
15606 __pyx_t_7 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
15607 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
15608 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_14 = 0;
15609 if (__pyx_t_8 < 0) {
15610 __pyx_t_8 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
15611 if (unlikely(__pyx_t_8 < 0)) __pyx_t_14 = 1;
15612 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_14 = 1;
15613 if (__pyx_t_21 < 0) {
15614 __pyx_t_21 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
15615 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
15616 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_14 = 2;
15617 if (unlikely(__pyx_t_14 != -1)) {
15618 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15619 __PYX_ERR(0, 712, __pyx_L1_error)
15621 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_dV.diminfo[1].strides)));
15635 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15638 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15639 __Pyx_PyThreadState_declare
15640 __Pyx_PyThreadState_assign
15641 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15643 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15644 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15645 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15646 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15647 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15648 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15652 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15653 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15654 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15656 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15658 __Pyx_XGIVEREF(__pyx_r);
15659 __Pyx_RefNannyFinishContext();
15672 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15673 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {
"calculateNormalFlux", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, METH_VARARGS|METH_KEYWORDS, 0};
15674 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15675 PyArrayObject *__pyx_v_v = 0;
15676 PyArrayObject *__pyx_v_n = 0;
15677 PyArrayObject *__pyx_v_dS = 0;
15678 PyArrayObject *__pyx_v_flux = 0;
15679 int __pyx_lineno = 0;
15680 const char *__pyx_filename = NULL;
15681 int __pyx_clineno = 0;
15682 PyObject *__pyx_r = 0;
15683 __Pyx_RefNannyDeclarations
15684 __Pyx_RefNannySetupContext(
"calculateNormalFlux (wrapper)", 0);
15686 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_n,&__pyx_n_s_dS,&__pyx_n_s_flux,0};
15687 PyObject* values[4] = {0,0,0,0};
15688 if (unlikely(__pyx_kwds)) {
15689 Py_ssize_t kw_args;
15690 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15691 switch (pos_args) {
15692 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15693 CYTHON_FALLTHROUGH;
15694 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15695 CYTHON_FALLTHROUGH;
15696 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15697 CYTHON_FALLTHROUGH;
15698 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15699 CYTHON_FALLTHROUGH;
15701 default:
goto __pyx_L5_argtuple_error;
15703 kw_args = PyDict_Size(__pyx_kwds);
15704 switch (pos_args) {
15706 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15707 else goto __pyx_L5_argtuple_error;
15708 CYTHON_FALLTHROUGH;
15710 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
15712 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 1); __PYX_ERR(0, 717, __pyx_L3_error)
15714 CYTHON_FALLTHROUGH;
15716 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dS)) != 0)) kw_args--;
15718 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 2); __PYX_ERR(0, 717, __pyx_L3_error)
15720 CYTHON_FALLTHROUGH;
15722 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
15724 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 3); __PYX_ERR(0, 717, __pyx_L3_error)
15727 if (unlikely(kw_args > 0)) {
15728 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateNormalFlux") < 0)) __PYX_ERR(0, 717, __pyx_L3_error)
15730 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
15731 goto __pyx_L5_argtuple_error;
15733 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15734 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15735 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15736 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15738 __pyx_v_v = ((PyArrayObject *)values[0]);
15739 __pyx_v_n = ((PyArrayObject *)values[1]);
15740 __pyx_v_dS = ((PyArrayObject *)values[2]);
15741 __pyx_v_flux = ((PyArrayObject *)values[3]);
15743 goto __pyx_L4_argument_unpacking_done;
15744 __pyx_L5_argtuple_error:;
15745 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 717, __pyx_L3_error)
15747 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15748 __Pyx_RefNannyFinishContext();
15750 __pyx_L4_argument_unpacking_done:;
15751 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 717, __pyx_L1_error)
15752 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
15753 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_ptype_5numpy_ndarray, 1,
"dS", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
15754 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
15755 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
15762 __Pyx_RefNannyFinishContext();
15766 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux) {
15770 double __pyx_v_integral;
15771 npy_intp __pyx_v_I;
15772 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
15773 __Pyx_Buffer __pyx_pybuffer_dS;
15774 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
15775 __Pyx_Buffer __pyx_pybuffer_flux;
15776 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
15777 __Pyx_Buffer __pyx_pybuffer_n;
15778 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15779 __Pyx_Buffer __pyx_pybuffer_v;
15780 PyObject *__pyx_r = NULL;
15781 __Pyx_RefNannyDeclarations
15782 npy_intp __pyx_t_1;
15783 npy_intp __pyx_t_2;
15785 npy_intp __pyx_t_4;
15786 npy_intp __pyx_t_5;
15788 npy_intp __pyx_t_7;
15789 npy_intp __pyx_t_8;
15791 npy_intp __pyx_t_10;
15792 npy_intp __pyx_t_11;
15793 npy_intp __pyx_t_12;
15794 Py_ssize_t __pyx_t_13;
15795 Py_ssize_t __pyx_t_14;
15796 Py_ssize_t __pyx_t_15;
15797 Py_ssize_t __pyx_t_16;
15799 Py_ssize_t __pyx_t_18;
15800 Py_ssize_t __pyx_t_19;
15801 Py_ssize_t __pyx_t_20;
15802 Py_ssize_t __pyx_t_21;
15803 Py_ssize_t __pyx_t_22;
15804 Py_ssize_t __pyx_t_23;
15805 Py_ssize_t __pyx_t_24;
15806 int __pyx_lineno = 0;
15807 const char *__pyx_filename = NULL;
15808 int __pyx_clineno = 0;
15809 __Pyx_RefNannySetupContext(
"calculateNormalFlux", 0);
15810 __pyx_pybuffer_v.pybuffer.buf = NULL;
15811 __pyx_pybuffer_v.refcount = 0;
15812 __pyx_pybuffernd_v.data = NULL;
15813 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15814 __pyx_pybuffer_n.pybuffer.buf = NULL;
15815 __pyx_pybuffer_n.refcount = 0;
15816 __pyx_pybuffernd_n.data = NULL;
15817 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
15818 __pyx_pybuffer_dS.pybuffer.buf = NULL;
15819 __pyx_pybuffer_dS.refcount = 0;
15820 __pyx_pybuffernd_dS.data = NULL;
15821 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
15822 __pyx_pybuffer_flux.pybuffer.buf = NULL;
15823 __pyx_pybuffer_flux.refcount = 0;
15824 __pyx_pybuffernd_flux.data = NULL;
15825 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
15827 __Pyx_BufFmt_StackElem __pyx_stack[1];
15828 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15830 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
15832 __Pyx_BufFmt_StackElem __pyx_stack[1];
15833 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15835 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
15837 __Pyx_BufFmt_StackElem __pyx_stack[1];
15838 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15840 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
15842 __Pyx_BufFmt_StackElem __pyx_stack[1];
15843 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15845 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
15854 __pyx_t_1 = (__pyx_v_n->dimensions[0]);
15855 __pyx_t_2 = __pyx_t_1;
15856 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15857 __pyx_v_eN = __pyx_t_3;
15866 __pyx_t_4 = (__pyx_v_n->dimensions[1]);
15867 __pyx_t_5 = __pyx_t_4;
15868 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15869 __pyx_v_ebN = __pyx_t_6;
15878 __pyx_v_integral = 0.0;
15887 __pyx_t_7 = (__pyx_v_n->dimensions[2]);
15888 __pyx_t_8 = __pyx_t_7;
15889 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
15890 __pyx_v_kb = __pyx_t_9;
15899 __pyx_t_10 = (__pyx_v_n->dimensions[3]);
15900 __pyx_t_11 = __pyx_t_10;
15901 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
15902 __pyx_v_I = __pyx_t_12;
15911 __pyx_t_13 = __pyx_v_eN;
15912 __pyx_t_14 = __pyx_v_ebN;
15913 __pyx_t_15 = __pyx_v_kb;
15914 __pyx_t_16 = __pyx_v_I;
15916 if (__pyx_t_13 < 0) {
15917 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
15918 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
15919 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
15920 if (__pyx_t_14 < 0) {
15921 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
15922 if (unlikely(__pyx_t_14 < 0)) __pyx_t_17 = 1;
15923 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
15924 if (__pyx_t_15 < 0) {
15925 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
15926 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 2;
15927 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
15928 if (__pyx_t_16 < 0) {
15929 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
15930 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 3;
15931 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_17 = 3;
15932 if (unlikely(__pyx_t_17 != -1)) {
15933 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15934 __PYX_ERR(0, 729, __pyx_L1_error)
15936 __pyx_t_18 = __pyx_v_eN;
15937 __pyx_t_19 = __pyx_v_ebN;
15938 __pyx_t_20 = __pyx_v_kb;
15939 __pyx_t_21 = __pyx_v_I;
15941 if (__pyx_t_18 < 0) {
15942 __pyx_t_18 += __pyx_pybuffernd_n.diminfo[0].shape;
15943 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
15944 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
15945 if (__pyx_t_19 < 0) {
15946 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[1].shape;
15947 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
15948 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_17 = 1;
15949 if (__pyx_t_20 < 0) {
15950 __pyx_t_20 += __pyx_pybuffernd_n.diminfo[2].shape;
15951 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 2;
15952 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_17 = 2;
15953 if (__pyx_t_21 < 0) {
15954 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[3].shape;
15955 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 3;
15956 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_17 = 3;
15957 if (unlikely(__pyx_t_17 != -1)) {
15958 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15959 __PYX_ERR(0, 729, __pyx_L1_error)
15961 __pyx_t_22 = __pyx_v_eN;
15962 __pyx_t_23 = __pyx_v_ebN;
15963 __pyx_t_24 = __pyx_v_kb;
15965 if (__pyx_t_22 < 0) {
15966 __pyx_t_22 += __pyx_pybuffernd_dS.diminfo[0].shape;
15967 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
15968 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_17 = 0;
15969 if (__pyx_t_23 < 0) {
15970 __pyx_t_23 += __pyx_pybuffernd_dS.diminfo[1].shape;
15971 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 1;
15972 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_17 = 1;
15973 if (__pyx_t_24 < 0) {
15974 __pyx_t_24 += __pyx_pybuffernd_dS.diminfo[2].shape;
15975 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 2;
15976 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_17 = 2;
15977 if (unlikely(__pyx_t_17 != -1)) {
15978 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15979 __PYX_ERR(0, 729, __pyx_L1_error)
15981 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_21, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_dS.diminfo[2].strides))));
15992 __pyx_t_24 = __pyx_v_eN;
15993 __pyx_t_23 = __pyx_v_ebN;
15995 if (__pyx_t_24 < 0) {
15996 __pyx_t_24 += __pyx_pybuffernd_flux.diminfo[0].shape;
15997 if (unlikely(__pyx_t_24 < 0)) __pyx_t_9 = 0;
15998 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_9 = 0;
15999 if (__pyx_t_23 < 0) {
16000 __pyx_t_23 += __pyx_pybuffernd_flux.diminfo[1].shape;
16001 if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 1;
16002 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_9 = 1;
16003 if (unlikely(__pyx_t_9 != -1)) {
16004 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16005 __PYX_ERR(0, 730, __pyx_L1_error)
16007 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
16020 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16023 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16024 __Pyx_PyThreadState_declare
16025 __Pyx_PyThreadState_assign
16026 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16027 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
16028 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
16029 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
16030 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
16031 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16032 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
16036 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
16037 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
16038 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
16039 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
16041 __Pyx_XGIVEREF(__pyx_r);
16042 __Pyx_RefNannyFinishContext();
16055 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16056 static char __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16057 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {
"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
16058 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16059 PyArrayObject *__pyx_v_df = 0;
16060 PyArrayObject *__pyx_v_characteristic_velocity = 0;
16061 PyArrayObject *__pyx_v_dm = 0;
16062 PyArrayObject *__pyx_v_dV = 0;
16063 int __pyx_lineno = 0;
16064 const char *__pyx_filename = NULL;
16065 int __pyx_clineno = 0;
16066 PyObject *__pyx_r = 0;
16067 __Pyx_RefNannyDeclarations
16068 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
16070 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_characteristic_velocity,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16071 PyObject* values[4] = {0,0,0,0};
16072 if (unlikely(__pyx_kwds)) {
16073 Py_ssize_t kw_args;
16074 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16075 switch (pos_args) {
16076 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16077 CYTHON_FALLTHROUGH;
16078 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16079 CYTHON_FALLTHROUGH;
16080 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16081 CYTHON_FALLTHROUGH;
16082 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16083 CYTHON_FALLTHROUGH;
16085 default:
goto __pyx_L5_argtuple_error;
16087 kw_args = PyDict_Size(__pyx_kwds);
16088 switch (pos_args) {
16090 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
16091 else goto __pyx_L5_argtuple_error;
16092 CYTHON_FALLTHROUGH;
16094 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity)) != 0)) kw_args--;
16096 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 1); __PYX_ERR(0, 732, __pyx_L3_error)
16098 CYTHON_FALLTHROUGH;
16100 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16102 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 2); __PYX_ERR(0, 732, __pyx_L3_error)
16104 CYTHON_FALLTHROUGH;
16106 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16108 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 3); __PYX_ERR(0, 732, __pyx_L3_error)
16111 if (unlikely(kw_args > 0)) {
16112 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromElementVelocity") < 0)) __PYX_ERR(0, 732, __pyx_L3_error)
16114 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
16115 goto __pyx_L5_argtuple_error;
16117 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16118 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16119 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16120 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16122 __pyx_v_df = ((PyArrayObject *)values[0]);
16123 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
16124 __pyx_v_dm = ((PyArrayObject *)values[2]);
16125 __pyx_v_dV = ((PyArrayObject *)values[3]);
16127 goto __pyx_L4_argument_unpacking_done;
16128 __pyx_L5_argtuple_error:;
16129 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error)
16131 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16132 __Pyx_RefNannyFinishContext();
16134 __pyx_L4_argument_unpacking_done:;
16135 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1,
"df", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
16136 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity", 0))) __PYX_ERR(0, 733, __pyx_L1_error)
16137 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
16138 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
16139 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
16146 __Pyx_RefNannyFinishContext();
16150 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16154 double __pyx_v_omega_e;
16155 double __pyx_v_vol_e;
16156 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
16157 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
16158 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16159 __Pyx_Buffer __pyx_pybuffer_dV;
16160 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
16161 __Pyx_Buffer __pyx_pybuffer_df;
16162 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16163 __Pyx_Buffer __pyx_pybuffer_dm;
16164 PyObject *__pyx_r = NULL;
16165 __Pyx_RefNannyDeclarations
16166 npy_intp __pyx_t_1;
16167 npy_intp __pyx_t_2;
16169 npy_intp __pyx_t_4;
16170 npy_intp __pyx_t_5;
16172 Py_ssize_t __pyx_t_7;
16173 Py_ssize_t __pyx_t_8;
16175 Py_ssize_t __pyx_t_10;
16176 Py_ssize_t __pyx_t_11;
16177 npy_intp __pyx_t_12;
16178 npy_intp __pyx_t_13;
16180 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
16182 int __pyx_lineno = 0;
16183 const char *__pyx_filename = NULL;
16184 int __pyx_clineno = 0;
16185 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity", 0);
16186 __pyx_pybuffer_df.pybuffer.buf = NULL;
16187 __pyx_pybuffer_df.refcount = 0;
16188 __pyx_pybuffernd_df.data = NULL;
16189 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
16190 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
16191 __pyx_pybuffer_characteristic_velocity.refcount = 0;
16192 __pyx_pybuffernd_characteristic_velocity.data = NULL;
16193 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
16194 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16195 __pyx_pybuffer_dm.refcount = 0;
16196 __pyx_pybuffernd_dm.data = NULL;
16197 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16198 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16199 __pyx_pybuffer_dV.refcount = 0;
16200 __pyx_pybuffernd_dV.data = NULL;
16201 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16203 __Pyx_BufFmt_StackElem __pyx_stack[1];
16204 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16206 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
16208 __Pyx_BufFmt_StackElem __pyx_stack[1];
16209 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16211 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
16213 __Pyx_BufFmt_StackElem __pyx_stack[1];
16214 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16216 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16218 __Pyx_BufFmt_StackElem __pyx_stack[1];
16219 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16221 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16230 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16231 __pyx_t_2 = __pyx_t_1;
16232 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16233 __pyx_v_eN = __pyx_t_3;
16242 __pyx_v_omega_e = 0.0;
16251 __pyx_v_vol_e = 0.0;
16260 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16261 __pyx_t_5 = __pyx_t_4;
16262 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16263 __pyx_v_k = __pyx_t_6;
16272 __pyx_t_7 = __pyx_v_eN;
16273 __pyx_t_8 = __pyx_v_k;
16275 if (__pyx_t_7 < 0) {
16276 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16277 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16278 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16279 if (__pyx_t_8 < 0) {
16280 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16281 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16282 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16283 if (unlikely(__pyx_t_9 != -1)) {
16284 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16285 __PYX_ERR(0, 747, __pyx_L1_error)
16287 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16296 __pyx_t_8 = __pyx_v_eN;
16297 __pyx_t_7 = __pyx_v_k;
16299 if (__pyx_t_8 < 0) {
16300 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
16301 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
16302 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16303 if (__pyx_t_7 < 0) {
16304 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
16305 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
16306 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16307 if (unlikely(__pyx_t_9 != -1)) {
16308 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16309 __PYX_ERR(0, 748, __pyx_L1_error)
16311 __pyx_t_10 = __pyx_v_eN;
16312 __pyx_t_11 = __pyx_v_k;
16314 if (__pyx_t_10 < 0) {
16315 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
16316 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16317 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16318 if (__pyx_t_11 < 0) {
16319 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
16320 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16321 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16322 if (unlikely(__pyx_t_9 != -1)) {
16323 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16324 __PYX_ERR(0, 748, __pyx_L1_error)
16326 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
16336 __pyx_t_4 = (__pyx_v_df->dimensions[1]);
16337 __pyx_t_5 = __pyx_t_4;
16338 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16339 __pyx_v_k = __pyx_t_6;
16348 __pyx_t_12 = (__pyx_v_df->dimensions[2]);
16349 __pyx_t_13 = __pyx_t_12;
16350 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_13; __pyx_t_9+=1) {
16351 __pyx_v_I = __pyx_t_9;
16360 __pyx_t_11 = __pyx_v_eN;
16361 __pyx_t_10 = __pyx_v_k;
16362 __pyx_t_7 = __pyx_v_I;
16364 if (__pyx_t_11 < 0) {
16365 __pyx_t_11 += __pyx_pybuffernd_df.diminfo[0].shape;
16366 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 0;
16367 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_14 = 0;
16368 if (__pyx_t_10 < 0) {
16369 __pyx_t_10 += __pyx_pybuffernd_df.diminfo[1].shape;
16370 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
16371 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_14 = 1;
16372 if (__pyx_t_7 < 0) {
16373 __pyx_t_7 += __pyx_pybuffernd_df.diminfo[2].shape;
16374 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 2;
16375 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_14 = 2;
16376 if (unlikely(__pyx_t_14 != -1)) {
16377 __Pyx_RaiseBufferIndexError(__pyx_t_14);
16378 __PYX_ERR(0, 751, __pyx_L1_error)
16380 __pyx_t_15 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
16381 __pyx_t_16 = (__pyx_v_omega_e + 1.0e-12);
16382 if (unlikely(__pyx_t_16 == 0)) {
16383 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16384 __PYX_ERR(0, 751, __pyx_L1_error)
16386 __pyx_t_7 = __pyx_v_eN;
16387 __pyx_t_10 = __pyx_v_k;
16388 __pyx_t_11 = __pyx_v_I;
16390 if (__pyx_t_7 < 0) {
16391 __pyx_t_7 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
16392 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
16393 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_14 = 0;
16394 if (__pyx_t_10 < 0) {
16395 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
16396 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
16397 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_14 = 1;
16398 if (__pyx_t_11 < 0) {
16399 __pyx_t_11 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
16400 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
16401 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_14 = 2;
16402 if (unlikely(__pyx_t_14 != -1)) {
16403 __Pyx_RaiseBufferIndexError(__pyx_t_14);
16404 __PYX_ERR(0, 751, __pyx_L1_error)
16406 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_15 / __pyx_t_16);
16420 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16423 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16424 __Pyx_PyThreadState_declare
16425 __Pyx_PyThreadState_assign
16426 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16427 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16428 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16429 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16430 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16431 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16432 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16436 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16437 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16438 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16439 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16441 __Pyx_XGIVEREF(__pyx_r);
16442 __Pyx_RefNannyFinishContext();
16455 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16456 static char __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16457 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {
"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
16458 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16459 PyArrayObject *__pyx_v_df_dofs = 0;
16460 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
16461 PyArrayObject *__pyx_v_l2g = 0;
16462 PyArrayObject *__pyx_v_dm = 0;
16463 PyArrayObject *__pyx_v_dV = 0;
16464 int __pyx_lineno = 0;
16465 const char *__pyx_filename = NULL;
16466 int __pyx_clineno = 0;
16467 PyObject *__pyx_r = 0;
16468 __Pyx_RefNannyDeclarations
16469 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
16471 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_dofs,&__pyx_n_s_characteristic_velocity_dofs,&__pyx_n_s_l2g,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16472 PyObject* values[5] = {0,0,0,0,0};
16473 if (unlikely(__pyx_kwds)) {
16474 Py_ssize_t kw_args;
16475 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16476 switch (pos_args) {
16477 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16478 CYTHON_FALLTHROUGH;
16479 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16480 CYTHON_FALLTHROUGH;
16481 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16482 CYTHON_FALLTHROUGH;
16483 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16484 CYTHON_FALLTHROUGH;
16485 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16486 CYTHON_FALLTHROUGH;
16488 default:
goto __pyx_L5_argtuple_error;
16490 kw_args = PyDict_Size(__pyx_kwds);
16491 switch (pos_args) {
16493 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df_dofs)) != 0)) kw_args--;
16494 else goto __pyx_L5_argtuple_error;
16495 CYTHON_FALLTHROUGH;
16497 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity_dofs)) != 0)) kw_args--;
16499 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 1); __PYX_ERR(0, 753, __pyx_L3_error)
16501 CYTHON_FALLTHROUGH;
16503 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
16505 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 2); __PYX_ERR(0, 753, __pyx_L3_error)
16507 CYTHON_FALLTHROUGH;
16509 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16511 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 3); __PYX_ERR(0, 753, __pyx_L3_error)
16513 CYTHON_FALLTHROUGH;
16515 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16517 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 4); __PYX_ERR(0, 753, __pyx_L3_error)
16520 if (unlikely(kw_args > 0)) {
16521 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromVelocityDOFs") < 0)) __PYX_ERR(0, 753, __pyx_L3_error)
16523 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
16524 goto __pyx_L5_argtuple_error;
16526 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16527 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16528 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16529 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16530 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16532 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
16533 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
16534 __pyx_v_l2g = ((PyArrayObject *)values[2]);
16535 __pyx_v_dm = ((PyArrayObject *)values[3]);
16536 __pyx_v_dV = ((PyArrayObject *)values[4]);
16538 goto __pyx_L4_argument_unpacking_done;
16539 __pyx_L5_argtuple_error:;
16540 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
16542 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16543 __Pyx_RefNannyFinishContext();
16545 __pyx_L4_argument_unpacking_done:;
16546 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_ptype_5numpy_ndarray, 1,
"df_dofs", 0))) __PYX_ERR(0, 753, __pyx_L1_error)
16547 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity_dofs", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
16548 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
16549 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
16550 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
16551 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
16558 __Pyx_RefNannyFinishContext();
16562 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16567 double __pyx_v_omega_e;
16568 double __pyx_v_vol_e;
16569 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
16570 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
16571 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16572 __Pyx_Buffer __pyx_pybuffer_dV;
16573 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
16574 __Pyx_Buffer __pyx_pybuffer_df_dofs;
16575 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16576 __Pyx_Buffer __pyx_pybuffer_dm;
16577 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
16578 __Pyx_Buffer __pyx_pybuffer_l2g;
16579 PyObject *__pyx_r = NULL;
16580 __Pyx_RefNannyDeclarations
16581 npy_intp __pyx_t_1;
16582 npy_intp __pyx_t_2;
16584 npy_intp __pyx_t_4;
16585 npy_intp __pyx_t_5;
16587 Py_ssize_t __pyx_t_7;
16588 Py_ssize_t __pyx_t_8;
16590 Py_ssize_t __pyx_t_10;
16591 Py_ssize_t __pyx_t_11;
16592 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_12;
16594 int __pyx_lineno = 0;
16595 const char *__pyx_filename = NULL;
16596 int __pyx_clineno = 0;
16597 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
16598 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
16599 __pyx_pybuffer_df_dofs.refcount = 0;
16600 __pyx_pybuffernd_df_dofs.data = NULL;
16601 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
16602 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
16603 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
16604 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
16605 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
16606 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
16607 __pyx_pybuffer_l2g.refcount = 0;
16608 __pyx_pybuffernd_l2g.data = NULL;
16609 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
16610 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16611 __pyx_pybuffer_dm.refcount = 0;
16612 __pyx_pybuffernd_dm.data = NULL;
16613 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16614 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16615 __pyx_pybuffer_dV.refcount = 0;
16616 __pyx_pybuffernd_dV.data = NULL;
16617 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16619 __Pyx_BufFmt_StackElem __pyx_stack[1];
16620 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16622 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
16624 __Pyx_BufFmt_StackElem __pyx_stack[1];
16625 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16627 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
16629 __Pyx_BufFmt_StackElem __pyx_stack[1];
16630 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16632 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
16634 __Pyx_BufFmt_StackElem __pyx_stack[1];
16635 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16637 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16639 __Pyx_BufFmt_StackElem __pyx_stack[1];
16640 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16642 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16651 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16652 __pyx_t_2 = __pyx_t_1;
16653 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16654 __pyx_v_eN = __pyx_t_3;
16663 __pyx_v_omega_e = 0.0;
16672 __pyx_v_vol_e = 0.0;
16681 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16682 __pyx_t_5 = __pyx_t_4;
16683 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16684 __pyx_v_k = __pyx_t_6;
16693 __pyx_t_7 = __pyx_v_eN;
16694 __pyx_t_8 = __pyx_v_k;
16696 if (__pyx_t_7 < 0) {
16697 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16698 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16699 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16700 if (__pyx_t_8 < 0) {
16701 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16702 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16703 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16704 if (unlikely(__pyx_t_9 != -1)) {
16705 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16706 __PYX_ERR(0, 769, __pyx_L1_error)
16708 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16717 __pyx_t_8 = __pyx_v_eN;
16718 __pyx_t_7 = __pyx_v_k;
16720 if (__pyx_t_8 < 0) {
16721 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
16722 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
16723 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16724 if (__pyx_t_7 < 0) {
16725 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
16726 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
16727 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16728 if (unlikely(__pyx_t_9 != -1)) {
16729 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16730 __PYX_ERR(0, 770, __pyx_L1_error)
16732 __pyx_t_10 = __pyx_v_eN;
16733 __pyx_t_11 = __pyx_v_k;
16735 if (__pyx_t_10 < 0) {
16736 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
16737 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16738 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16739 if (__pyx_t_11 < 0) {
16740 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
16741 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16742 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16743 if (unlikely(__pyx_t_9 != -1)) {
16744 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16745 __PYX_ERR(0, 770, __pyx_L1_error)
16747 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
16757 __pyx_t_4 = (__pyx_v_l2g->dimensions[1]);
16758 __pyx_t_5 = __pyx_t_4;
16759 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16760 __pyx_v_j = __pyx_t_6;
16769 __pyx_t_11 = __pyx_v_eN;
16770 __pyx_t_10 = __pyx_v_j;
16772 if (__pyx_t_11 < 0) {
16773 __pyx_t_11 += __pyx_pybuffernd_l2g.diminfo[0].shape;
16774 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
16775 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_9 = 0;
16776 if (__pyx_t_10 < 0) {
16777 __pyx_t_10 += __pyx_pybuffernd_l2g.diminfo[1].shape;
16778 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
16779 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_9 = 1;
16780 if (unlikely(__pyx_t_9 != -1)) {
16781 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16782 __PYX_ERR(0, 772, __pyx_L1_error)
16784 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_l2g.diminfo[1].strides));
16793 __pyx_t_10 = __pyx_v_J;
16795 if (__pyx_t_10 < 0) {
16796 __pyx_t_10 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
16797 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16798 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16799 if (unlikely(__pyx_t_9 != -1)) {
16800 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16801 __PYX_ERR(0, 773, __pyx_L1_error)
16803 __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
16804 __pyx_t_13 = (__pyx_v_omega_e + 1.0e-12);
16805 if (unlikely(__pyx_t_13 == 0)) {
16806 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16807 __PYX_ERR(0, 773, __pyx_L1_error)
16809 __pyx_t_10 = __pyx_v_J;
16811 if (__pyx_t_10 < 0) {
16812 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
16813 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16814 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16815 if (unlikely(__pyx_t_9 != -1)) {
16816 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16817 __PYX_ERR(0, 773, __pyx_L1_error)
16819 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_12 / __pyx_t_13);
16832 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16835 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16836 __Pyx_PyThreadState_declare
16837 __Pyx_PyThreadState_assign
16838 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16839 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16840 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16841 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16842 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16843 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16844 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16845 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16849 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16850 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16851 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16852 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16853 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16855 __Pyx_XGIVEREF(__pyx_r);
16856 __Pyx_RefNannyFinishContext();
16869 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16870 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {
"rotatingGaussianElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
16871 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16872 int __pyx_v_transient;
16874 double __pyx_v_tForReversal;
16875 double __pyx_v_clock;
16878 PyArrayObject *__pyx_v_x = 0;
16879 PyArrayObject *__pyx_v_v = 0;
16880 double __pyx_v_zvelocity;
16881 int __pyx_lineno = 0;
16882 const char *__pyx_filename = NULL;
16883 int __pyx_clineno = 0;
16884 PyObject *__pyx_r = 0;
16885 __Pyx_RefNannyDeclarations
16886 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3 (wrapper)", 0);
16888 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
16889 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
16890 if (unlikely(__pyx_kwds)) {
16891 Py_ssize_t kw_args;
16892 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16893 switch (pos_args) {
16894 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16895 CYTHON_FALLTHROUGH;
16896 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16897 CYTHON_FALLTHROUGH;
16898 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16899 CYTHON_FALLTHROUGH;
16900 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16901 CYTHON_FALLTHROUGH;
16902 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16903 CYTHON_FALLTHROUGH;
16904 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16905 CYTHON_FALLTHROUGH;
16906 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16907 CYTHON_FALLTHROUGH;
16908 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16909 CYTHON_FALLTHROUGH;
16910 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16911 CYTHON_FALLTHROUGH;
16913 default:
goto __pyx_L5_argtuple_error;
16915 kw_args = PyDict_Size(__pyx_kwds);
16916 switch (pos_args) {
16918 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
16919 else goto __pyx_L5_argtuple_error;
16920 CYTHON_FALLTHROUGH;
16922 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
16924 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 1); __PYX_ERR(0, 776, __pyx_L3_error)
16926 CYTHON_FALLTHROUGH;
16928 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
16930 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 2); __PYX_ERR(0, 776, __pyx_L3_error)
16932 CYTHON_FALLTHROUGH;
16934 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
16936 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 3); __PYX_ERR(0, 776, __pyx_L3_error)
16938 CYTHON_FALLTHROUGH;
16940 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
16942 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 4); __PYX_ERR(0, 776, __pyx_L3_error)
16944 CYTHON_FALLTHROUGH;
16946 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
16948 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 5); __PYX_ERR(0, 776, __pyx_L3_error)
16950 CYTHON_FALLTHROUGH;
16952 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
16954 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 6); __PYX_ERR(0, 776, __pyx_L3_error)
16956 CYTHON_FALLTHROUGH;
16958 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
16960 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 7); __PYX_ERR(0, 776, __pyx_L3_error)
16962 CYTHON_FALLTHROUGH;
16965 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
16966 if (value) { values[8] = value; kw_args--; }
16969 if (unlikely(kw_args > 0)) {
16970 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval3") < 0)) __PYX_ERR(0, 776, __pyx_L3_error)
16973 switch (PyTuple_GET_SIZE(__pyx_args)) {
16974 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16975 CYTHON_FALLTHROUGH;
16976 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16977 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16978 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16979 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16980 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16981 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16982 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16983 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16985 default:
goto __pyx_L5_argtuple_error;
16988 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
16989 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
16990 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error)
16991 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error)
16992 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16993 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16994 __pyx_v_x = ((PyArrayObject *)values[6]);
16995 __pyx_v_v = ((PyArrayObject *)values[7]);
16997 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L3_error)
16999 __pyx_v_zvelocity = ((double)0.0);
17002 goto __pyx_L4_argument_unpacking_done;
17003 __pyx_L5_argtuple_error:;
17004 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 776, __pyx_L3_error)
17006 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17007 __Pyx_RefNannyFinishContext();
17009 __pyx_L4_argument_unpacking_done:;
17010 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 781, __pyx_L1_error)
17011 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 782, __pyx_L1_error)
17012 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
17019 __Pyx_RefNannyFinishContext();
17023 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
17027 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
17028 __Pyx_Buffer __pyx_pybuffer_v;
17029 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
17030 __Pyx_Buffer __pyx_pybuffer_x;
17031 PyObject *__pyx_r = NULL;
17032 __Pyx_RefNannyDeclarations
17034 npy_intp __pyx_t_2;
17035 npy_intp __pyx_t_3;
17037 npy_intp __pyx_t_5;
17038 npy_intp __pyx_t_6;
17040 Py_ssize_t __pyx_t_8;
17041 Py_ssize_t __pyx_t_9;
17042 Py_ssize_t __pyx_t_10;
17044 Py_ssize_t __pyx_t_12;
17045 Py_ssize_t __pyx_t_13;
17046 Py_ssize_t __pyx_t_14;
17047 PyObject *__pyx_t_15 = NULL;
17048 PyObject *__pyx_t_16 = NULL;
17049 PyObject *__pyx_t_17 = NULL;
17052 PyObject *__pyx_t_20 = NULL;
17053 int __pyx_lineno = 0;
17054 const char *__pyx_filename = NULL;
17055 int __pyx_clineno = 0;
17056 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3", 0);
17057 __pyx_pybuffer_x.pybuffer.buf = NULL;
17058 __pyx_pybuffer_x.refcount = 0;
17059 __pyx_pybuffernd_x.data = NULL;
17060 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
17061 __pyx_pybuffer_v.pybuffer.buf = NULL;
17062 __pyx_pybuffer_v.refcount = 0;
17063 __pyx_pybuffernd_v.data = NULL;
17064 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
17066 __Pyx_BufFmt_StackElem __pyx_stack[1];
17067 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
17069 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
17071 __Pyx_BufFmt_StackElem __pyx_stack[1];
17072 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
17074 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
17092 __pyx_t_1 = (((__pyx_v_v->dimensions[2]) == 3) != 0);
17102 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17112 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17113 __pyx_t_3 = __pyx_t_2;
17114 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17115 __pyx_v_eN = __pyx_t_4;
17124 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17125 __pyx_t_6 = __pyx_t_5;
17126 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17127 __pyx_v_k = __pyx_t_7;
17136 __pyx_t_8 = __pyx_v_eN;
17137 __pyx_t_9 = __pyx_v_k;
17140 if (__pyx_t_8 < 0) {
17141 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17142 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17143 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17144 if (__pyx_t_9 < 0) {
17145 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17146 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17147 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17148 if (__pyx_t_10 < 0) {
17149 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17150 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17151 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17152 if (unlikely(__pyx_t_11 != -1)) {
17153 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17154 __PYX_ERR(0, 791, __pyx_L1_error)
17156 __pyx_t_12 = __pyx_v_eN;
17157 __pyx_t_13 = __pyx_v_k;
17160 if (__pyx_t_12 < 0) {
17161 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17162 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17163 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17164 if (__pyx_t_13 < 0) {
17165 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17166 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17167 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17168 if (__pyx_t_14 < 0) {
17169 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17170 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17171 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17172 if (unlikely(__pyx_t_11 != -1)) {
17173 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17174 __PYX_ERR(0, 791, __pyx_L1_error)
17176 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17185 __pyx_t_10 = __pyx_v_eN;
17186 __pyx_t_9 = __pyx_v_k;
17189 if (__pyx_t_10 < 0) {
17190 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17191 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17192 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17193 if (__pyx_t_9 < 0) {
17194 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17195 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17196 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17197 if (__pyx_t_8 < 0) {
17198 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17199 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17200 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17201 if (unlikely(__pyx_t_11 != -1)) {
17202 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17203 __PYX_ERR(0, 792, __pyx_L1_error)
17205 __pyx_t_14 = __pyx_v_eN;
17206 __pyx_t_13 = __pyx_v_k;
17209 if (__pyx_t_14 < 0) {
17210 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17211 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17212 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17213 if (__pyx_t_13 < 0) {
17214 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17215 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17216 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17217 if (__pyx_t_12 < 0) {
17218 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17219 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17220 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17221 if (unlikely(__pyx_t_11 != -1)) {
17222 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17223 __PYX_ERR(0, 792, __pyx_L1_error)
17225 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17234 __pyx_t_8 = __pyx_v_eN;
17235 __pyx_t_9 = __pyx_v_k;
17238 if (__pyx_t_8 < 0) {
17239 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
17240 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17241 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17242 if (__pyx_t_9 < 0) {
17243 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
17244 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17245 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17246 if (__pyx_t_10 < 0) {
17247 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
17248 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17249 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17250 if (unlikely(__pyx_t_11 != -1)) {
17251 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17252 __PYX_ERR(0, 793, __pyx_L1_error)
17254 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17263 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
17264 __Pyx_GOTREF(__pyx_t_15);
17265 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 794, __pyx_L1_error)
17266 __Pyx_GOTREF(__pyx_t_16);
17267 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 794, __pyx_L1_error)
17268 __Pyx_GOTREF(__pyx_t_17);
17269 __Pyx_GIVEREF(__pyx_t_15);
17270 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
17271 __Pyx_GIVEREF(__pyx_t_16);
17272 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
17273 __Pyx_INCREF(__pyx_slice_);
17274 __Pyx_GIVEREF(__pyx_slice_);
17275 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_slice_);
17278 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 794, __pyx_L1_error)
17279 __Pyx_GOTREF(__pyx_t_16);
17280 __pyx_t_18 = (__pyx_v_tForReversal - __pyx_v_t);
17281 __pyx_t_19 = (__pyx_v_tForReversal - 0.0);
17282 if (unlikely(__pyx_t_19 == 0)) {
17283 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17284 __PYX_ERR(0, 794, __pyx_L1_error)
17286 __pyx_t_15 = PyFloat_FromDouble(((__pyx_t_18 / __pyx_t_19) * __pyx_v_clock));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
17287 __Pyx_GOTREF(__pyx_t_15);
17288 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 794, __pyx_L1_error)
17289 __Pyx_GOTREF(__pyx_t_20);
17290 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
17291 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
17292 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
17293 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
17294 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17316 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17317 __pyx_t_3 = __pyx_t_2;
17318 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17319 __pyx_v_eN = __pyx_t_4;
17328 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17329 __pyx_t_6 = __pyx_t_5;
17330 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17331 __pyx_v_k = __pyx_t_7;
17340 __pyx_t_10 = __pyx_v_eN;
17341 __pyx_t_9 = __pyx_v_k;
17344 if (__pyx_t_10 < 0) {
17345 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17346 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17347 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17348 if (__pyx_t_9 < 0) {
17349 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17350 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17351 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17352 if (__pyx_t_8 < 0) {
17353 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17354 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17355 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17356 if (unlikely(__pyx_t_11 != -1)) {
17357 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17358 __PYX_ERR(0, 798, __pyx_L1_error)
17360 __pyx_t_12 = __pyx_v_eN;
17361 __pyx_t_13 = __pyx_v_k;
17364 if (__pyx_t_12 < 0) {
17365 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17366 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17367 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17368 if (__pyx_t_13 < 0) {
17369 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17370 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17371 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17372 if (__pyx_t_14 < 0) {
17373 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17374 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17375 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17376 if (unlikely(__pyx_t_11 != -1)) {
17377 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17378 __PYX_ERR(0, 798, __pyx_L1_error)
17380 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17389 __pyx_t_8 = __pyx_v_eN;
17390 __pyx_t_9 = __pyx_v_k;
17393 if (__pyx_t_8 < 0) {
17394 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17395 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17396 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17397 if (__pyx_t_9 < 0) {
17398 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17399 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17400 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17401 if (__pyx_t_10 < 0) {
17402 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17403 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17404 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17405 if (unlikely(__pyx_t_11 != -1)) {
17406 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17407 __PYX_ERR(0, 799, __pyx_L1_error)
17409 __pyx_t_14 = __pyx_v_eN;
17410 __pyx_t_13 = __pyx_v_k;
17413 if (__pyx_t_14 < 0) {
17414 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17415 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17416 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17417 if (__pyx_t_13 < 0) {
17418 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17419 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17420 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17421 if (__pyx_t_12 < 0) {
17422 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17423 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17424 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17425 if (unlikely(__pyx_t_11 != -1)) {
17426 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17427 __PYX_ERR(0, 799, __pyx_L1_error)
17429 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
17438 __pyx_t_10 = __pyx_v_eN;
17439 __pyx_t_9 = __pyx_v_k;
17442 if (__pyx_t_10 < 0) {
17443 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
17444 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17445 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17446 if (__pyx_t_9 < 0) {
17447 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
17448 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17449 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17450 if (__pyx_t_8 < 0) {
17451 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
17452 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17453 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17454 if (unlikely(__pyx_t_11 != -1)) {
17455 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17456 __PYX_ERR(0, 800, __pyx_L1_error)
17458 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17482 #ifndef CYTHON_WITHOUT_ASSERTIONS
17483 if (unlikely(!Py_OptimizeFlag)) {
17484 if (unlikely(!(((__pyx_v_v->dimensions[2]) == 2) != 0))) {
17485 PyErr_SetNone(PyExc_AssertionError);
17486 __PYX_ERR(0, 802, __pyx_L1_error)
17498 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17508 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17509 __pyx_t_3 = __pyx_t_2;
17510 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17511 __pyx_v_eN = __pyx_t_4;
17520 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17521 __pyx_t_6 = __pyx_t_5;
17522 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17523 __pyx_v_k = __pyx_t_7;
17532 __pyx_t_8 = __pyx_v_eN;
17533 __pyx_t_9 = __pyx_v_k;
17536 if (__pyx_t_8 < 0) {
17537 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17538 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17539 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17540 if (__pyx_t_9 < 0) {
17541 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17542 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17543 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17544 if (__pyx_t_10 < 0) {
17545 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17546 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17547 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17548 if (unlikely(__pyx_t_11 != -1)) {
17549 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17550 __PYX_ERR(0, 806, __pyx_L1_error)
17552 __pyx_t_12 = __pyx_v_eN;
17553 __pyx_t_13 = __pyx_v_k;
17556 if (__pyx_t_12 < 0) {
17557 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17558 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17559 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17560 if (__pyx_t_13 < 0) {
17561 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17562 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17563 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17564 if (__pyx_t_14 < 0) {
17565 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17566 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17567 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17568 if (unlikely(__pyx_t_11 != -1)) {
17569 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17570 __PYX_ERR(0, 806, __pyx_L1_error)
17572 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17581 __pyx_t_10 = __pyx_v_eN;
17582 __pyx_t_9 = __pyx_v_k;
17585 if (__pyx_t_10 < 0) {
17586 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17587 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17588 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17589 if (__pyx_t_9 < 0) {
17590 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17591 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17592 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17593 if (__pyx_t_8 < 0) {
17594 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17595 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17596 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17597 if (unlikely(__pyx_t_11 != -1)) {
17598 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17599 __PYX_ERR(0, 807, __pyx_L1_error)
17601 __pyx_t_14 = __pyx_v_eN;
17602 __pyx_t_13 = __pyx_v_k;
17605 if (__pyx_t_14 < 0) {
17606 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17607 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17608 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17609 if (__pyx_t_13 < 0) {
17610 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17611 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17612 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17613 if (__pyx_t_12 < 0) {
17614 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17615 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17616 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17617 if (unlikely(__pyx_t_11 != -1)) {
17618 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17619 __PYX_ERR(0, 807, __pyx_L1_error)
17621 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17630 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 808, __pyx_L1_error)
17631 __Pyx_GOTREF(__pyx_t_17);
17632 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 808, __pyx_L1_error)
17633 __Pyx_GOTREF(__pyx_t_20);
17634 __pyx_t_15 = PyTuple_New(3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 808, __pyx_L1_error)
17635 __Pyx_GOTREF(__pyx_t_15);
17636 __Pyx_GIVEREF(__pyx_t_17);
17637 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_17);
17638 __Pyx_GIVEREF(__pyx_t_20);
17639 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_20);
17640 __Pyx_INCREF(__pyx_slice_);
17641 __Pyx_GIVEREF(__pyx_slice_);
17642 PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_slice_);
17645 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 808, __pyx_L1_error)
17646 __Pyx_GOTREF(__pyx_t_20);
17647 __pyx_t_19 = (__pyx_v_tForReversal - __pyx_v_t);
17648 __pyx_t_18 = (__pyx_v_tForReversal - 0.0);
17649 if (unlikely(__pyx_t_18 == 0)) {
17650 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17651 __PYX_ERR(0, 808, __pyx_L1_error)
17653 __pyx_t_17 = PyFloat_FromDouble(((__pyx_t_19 / __pyx_t_18) * __pyx_v_clock));
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 808, __pyx_L1_error)
17654 __Pyx_GOTREF(__pyx_t_17);
17655 __pyx_t_16 = PyNumber_InPlaceMultiply(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 808, __pyx_L1_error)
17656 __Pyx_GOTREF(__pyx_t_16);
17657 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
17658 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17659 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_15, __pyx_t_16) < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
17660 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
17661 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
17683 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17684 __pyx_t_3 = __pyx_t_2;
17685 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17686 __pyx_v_eN = __pyx_t_4;
17695 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17696 __pyx_t_6 = __pyx_t_5;
17697 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17698 __pyx_v_k = __pyx_t_7;
17707 __pyx_t_8 = __pyx_v_eN;
17708 __pyx_t_9 = __pyx_v_k;
17711 if (__pyx_t_8 < 0) {
17712 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17713 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17714 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17715 if (__pyx_t_9 < 0) {
17716 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17717 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17718 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17719 if (__pyx_t_10 < 0) {
17720 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17721 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17722 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17723 if (unlikely(__pyx_t_11 != -1)) {
17724 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17725 __PYX_ERR(0, 812, __pyx_L1_error)
17727 __pyx_t_12 = __pyx_v_eN;
17728 __pyx_t_13 = __pyx_v_k;
17731 if (__pyx_t_12 < 0) {
17732 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17733 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17734 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17735 if (__pyx_t_13 < 0) {
17736 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17737 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17738 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17739 if (__pyx_t_14 < 0) {
17740 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17741 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17742 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17743 if (unlikely(__pyx_t_11 != -1)) {
17744 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17745 __PYX_ERR(0, 812, __pyx_L1_error)
17747 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17756 __pyx_t_10 = __pyx_v_eN;
17757 __pyx_t_9 = __pyx_v_k;
17760 if (__pyx_t_10 < 0) {
17761 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17762 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17763 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17764 if (__pyx_t_9 < 0) {
17765 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17766 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17767 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17768 if (__pyx_t_8 < 0) {
17769 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17770 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17771 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17772 if (unlikely(__pyx_t_11 != -1)) {
17773 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17774 __PYX_ERR(0, 813, __pyx_L1_error)
17776 __pyx_t_14 = __pyx_v_eN;
17777 __pyx_t_13 = __pyx_v_k;
17780 if (__pyx_t_14 < 0) {
17781 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17782 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17783 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17784 if (__pyx_t_13 < 0) {
17785 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17786 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17787 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17788 if (__pyx_t_12 < 0) {
17789 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17790 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17791 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17792 if (unlikely(__pyx_t_11 != -1)) {
17793 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17794 __PYX_ERR(0, 813, __pyx_L1_error)
17796 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17813 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17816 __Pyx_XDECREF(__pyx_t_15);
17817 __Pyx_XDECREF(__pyx_t_16);
17818 __Pyx_XDECREF(__pyx_t_17);
17819 __Pyx_XDECREF(__pyx_t_20);
17820 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17821 __Pyx_PyThreadState_declare
17822 __Pyx_PyThreadState_assign
17823 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17824 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17825 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17826 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17827 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17831 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17832 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17834 __Pyx_XGIVEREF(__pyx_r);
17835 __Pyx_RefNannyFinishContext();
17848 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17849 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {
"rotatingGaussianElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
17850 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17851 int __pyx_v_transient;
17853 double __pyx_v_tForReversal;
17854 double __pyx_v_clock;
17857 PyArrayObject *__pyx_v_x = 0;
17858 PyArrayObject *__pyx_v_v = 0;
17859 double __pyx_v_zvelocity;
17860 int __pyx_lineno = 0;
17861 const char *__pyx_filename = NULL;
17862 int __pyx_clineno = 0;
17863 PyObject *__pyx_r = 0;
17864 __Pyx_RefNannyDeclarations
17865 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4 (wrapper)", 0);
17867 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
17868 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
17869 if (unlikely(__pyx_kwds)) {
17870 Py_ssize_t kw_args;
17871 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17872 switch (pos_args) {
17873 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17874 CYTHON_FALLTHROUGH;
17875 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17876 CYTHON_FALLTHROUGH;
17877 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17878 CYTHON_FALLTHROUGH;
17879 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17880 CYTHON_FALLTHROUGH;
17881 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17882 CYTHON_FALLTHROUGH;
17883 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17884 CYTHON_FALLTHROUGH;
17885 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17886 CYTHON_FALLTHROUGH;
17887 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17888 CYTHON_FALLTHROUGH;
17889 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17890 CYTHON_FALLTHROUGH;
17892 default:
goto __pyx_L5_argtuple_error;
17894 kw_args = PyDict_Size(__pyx_kwds);
17895 switch (pos_args) {
17897 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
17898 else goto __pyx_L5_argtuple_error;
17899 CYTHON_FALLTHROUGH;
17901 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
17903 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 1); __PYX_ERR(0, 816, __pyx_L3_error)
17905 CYTHON_FALLTHROUGH;
17907 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
17909 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 2); __PYX_ERR(0, 816, __pyx_L3_error)
17911 CYTHON_FALLTHROUGH;
17913 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
17915 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 3); __PYX_ERR(0, 816, __pyx_L3_error)
17917 CYTHON_FALLTHROUGH;
17919 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
17921 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 4); __PYX_ERR(0, 816, __pyx_L3_error)
17923 CYTHON_FALLTHROUGH;
17925 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
17927 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 5); __PYX_ERR(0, 816, __pyx_L3_error)
17929 CYTHON_FALLTHROUGH;
17931 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
17933 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 6); __PYX_ERR(0, 816, __pyx_L3_error)
17935 CYTHON_FALLTHROUGH;
17937 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
17939 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 7); __PYX_ERR(0, 816, __pyx_L3_error)
17941 CYTHON_FALLTHROUGH;
17944 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
17945 if (value) { values[8] = value; kw_args--; }
17948 if (unlikely(kw_args > 0)) {
17949 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval4") < 0)) __PYX_ERR(0, 816, __pyx_L3_error)
17952 switch (PyTuple_GET_SIZE(__pyx_args)) {
17953 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17954 CYTHON_FALLTHROUGH;
17955 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17956 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17957 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17958 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17959 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17960 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17961 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17962 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17964 default:
goto __pyx_L5_argtuple_error;
17967 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L3_error)
17968 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
17969 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
17970 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
17971 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17972 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17973 __pyx_v_x = ((PyArrayObject *)values[6]);
17974 __pyx_v_v = ((PyArrayObject *)values[7]);
17976 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error)
17978 __pyx_v_zvelocity = ((double)0.0);
17981 goto __pyx_L4_argument_unpacking_done;
17982 __pyx_L5_argtuple_error:;
17983 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 816, __pyx_L3_error)
17985 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
17986 __Pyx_RefNannyFinishContext();
17988 __pyx_L4_argument_unpacking_done:;
17989 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 821, __pyx_L1_error)
17990 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 822, __pyx_L1_error)
17991 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
17998 __Pyx_RefNannyFinishContext();
18002 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
18007 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
18008 __Pyx_Buffer __pyx_pybuffer_v;
18009 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
18010 __Pyx_Buffer __pyx_pybuffer_x;
18011 PyObject *__pyx_r = NULL;
18012 __Pyx_RefNannyDeclarations
18014 npy_intp __pyx_t_2;
18015 npy_intp __pyx_t_3;
18017 npy_intp __pyx_t_5;
18018 npy_intp __pyx_t_6;
18020 npy_intp __pyx_t_8;
18021 npy_intp __pyx_t_9;
18023 Py_ssize_t __pyx_t_11;
18024 Py_ssize_t __pyx_t_12;
18025 Py_ssize_t __pyx_t_13;
18026 Py_ssize_t __pyx_t_14;
18028 Py_ssize_t __pyx_t_16;
18029 Py_ssize_t __pyx_t_17;
18030 Py_ssize_t __pyx_t_18;
18031 Py_ssize_t __pyx_t_19;
18032 PyObject *__pyx_t_20 = NULL;
18033 PyObject *__pyx_t_21 = NULL;
18034 PyObject *__pyx_t_22 = NULL;
18035 PyObject *__pyx_t_23 = NULL;
18038 int __pyx_lineno = 0;
18039 const char *__pyx_filename = NULL;
18040 int __pyx_clineno = 0;
18041 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4", 0);
18042 __pyx_pybuffer_x.pybuffer.buf = NULL;
18043 __pyx_pybuffer_x.refcount = 0;
18044 __pyx_pybuffernd_x.data = NULL;
18045 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
18046 __pyx_pybuffer_v.pybuffer.buf = NULL;
18047 __pyx_pybuffer_v.refcount = 0;
18048 __pyx_pybuffernd_v.data = NULL;
18049 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
18051 __Pyx_BufFmt_StackElem __pyx_stack[1];
18052 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
18054 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
18056 __Pyx_BufFmt_StackElem __pyx_stack[1];
18057 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
18059 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
18077 __pyx_t_1 = (((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 3) != 0);
18087 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18097 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18098 __pyx_t_3 = __pyx_t_2;
18099 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18100 __pyx_v_eN = __pyx_t_4;
18109 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18110 __pyx_t_6 = __pyx_t_5;
18111 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18112 __pyx_v_ebN = __pyx_t_7;
18121 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18122 __pyx_t_9 = __pyx_t_8;
18123 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18124 __pyx_v_k = __pyx_t_10;
18133 __pyx_t_11 = __pyx_v_eN;
18134 __pyx_t_12 = __pyx_v_ebN;
18135 __pyx_t_13 = __pyx_v_k;
18138 if (__pyx_t_11 < 0) {
18139 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18140 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18141 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18142 if (__pyx_t_12 < 0) {
18143 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18144 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18145 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18146 if (__pyx_t_13 < 0) {
18147 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18148 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18149 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18150 if (__pyx_t_14 < 0) {
18151 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18152 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18153 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18154 if (unlikely(__pyx_t_15 != -1)) {
18155 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18156 __PYX_ERR(0, 832, __pyx_L1_error)
18158 __pyx_t_16 = __pyx_v_eN;
18159 __pyx_t_17 = __pyx_v_ebN;
18160 __pyx_t_18 = __pyx_v_k;
18163 if (__pyx_t_16 < 0) {
18164 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18165 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18166 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18167 if (__pyx_t_17 < 0) {
18168 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18169 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18170 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18171 if (__pyx_t_18 < 0) {
18172 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18173 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18174 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18175 if (__pyx_t_19 < 0) {
18176 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18177 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18178 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18179 if (unlikely(__pyx_t_15 != -1)) {
18180 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18181 __PYX_ERR(0, 832, __pyx_L1_error)
18183 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18192 __pyx_t_14 = __pyx_v_eN;
18193 __pyx_t_13 = __pyx_v_ebN;
18194 __pyx_t_12 = __pyx_v_k;
18197 if (__pyx_t_14 < 0) {
18198 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18199 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18200 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18201 if (__pyx_t_13 < 0) {
18202 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18203 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18204 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18205 if (__pyx_t_12 < 0) {
18206 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18207 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18208 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18209 if (__pyx_t_11 < 0) {
18210 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18211 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18212 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18213 if (unlikely(__pyx_t_15 != -1)) {
18214 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18215 __PYX_ERR(0, 833, __pyx_L1_error)
18217 __pyx_t_19 = __pyx_v_eN;
18218 __pyx_t_18 = __pyx_v_ebN;
18219 __pyx_t_17 = __pyx_v_k;
18222 if (__pyx_t_19 < 0) {
18223 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18224 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18225 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18226 if (__pyx_t_18 < 0) {
18227 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18228 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18229 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18230 if (__pyx_t_17 < 0) {
18231 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18232 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18233 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18234 if (__pyx_t_16 < 0) {
18235 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18236 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18237 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18238 if (unlikely(__pyx_t_15 != -1)) {
18239 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18240 __PYX_ERR(0, 833, __pyx_L1_error)
18242 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18251 __pyx_t_11 = __pyx_v_eN;
18252 __pyx_t_12 = __pyx_v_ebN;
18253 __pyx_t_13 = __pyx_v_k;
18256 if (__pyx_t_11 < 0) {
18257 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
18258 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18259 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18260 if (__pyx_t_12 < 0) {
18261 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
18262 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18263 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18264 if (__pyx_t_13 < 0) {
18265 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
18266 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18267 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18268 if (__pyx_t_14 < 0) {
18269 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
18270 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18271 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18272 if (unlikely(__pyx_t_15 != -1)) {
18273 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18274 __PYX_ERR(0, 834, __pyx_L1_error)
18276 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18285 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 835, __pyx_L1_error)
18286 __Pyx_GOTREF(__pyx_t_20);
18287 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 835, __pyx_L1_error)
18288 __Pyx_GOTREF(__pyx_t_21);
18289 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 835, __pyx_L1_error)
18290 __Pyx_GOTREF(__pyx_t_22);
18291 __pyx_t_23 = PyTuple_New(4);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 835, __pyx_L1_error)
18292 __Pyx_GOTREF(__pyx_t_23);
18293 __Pyx_GIVEREF(__pyx_t_20);
18294 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
18295 __Pyx_GIVEREF(__pyx_t_21);
18296 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
18297 __Pyx_GIVEREF(__pyx_t_22);
18298 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
18299 __Pyx_INCREF(__pyx_slice_);
18300 __Pyx_GIVEREF(__pyx_slice_);
18301 PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_slice_);
18305 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 835, __pyx_L1_error)
18306 __Pyx_GOTREF(__pyx_t_22);
18307 __pyx_t_24 = (__pyx_v_tForReversal - __pyx_v_t);
18308 __pyx_t_25 = (__pyx_v_tForReversal - 0.0);
18309 if (unlikely(__pyx_t_25 == 0)) {
18310 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18311 __PYX_ERR(0, 835, __pyx_L1_error)
18313 __pyx_t_21 = PyFloat_FromDouble(((__pyx_t_24 / __pyx_t_25) * __pyx_v_clock));
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 835, __pyx_L1_error)
18314 __Pyx_GOTREF(__pyx_t_21);
18315 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_22, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 835, __pyx_L1_error)
18316 __Pyx_GOTREF(__pyx_t_20);
18317 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18318 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
18319 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
18320 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
18321 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18344 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18345 __pyx_t_3 = __pyx_t_2;
18346 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18347 __pyx_v_eN = __pyx_t_4;
18356 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18357 __pyx_t_6 = __pyx_t_5;
18358 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18359 __pyx_v_ebN = __pyx_t_7;
18368 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18369 __pyx_t_9 = __pyx_t_8;
18370 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18371 __pyx_v_k = __pyx_t_10;
18380 __pyx_t_14 = __pyx_v_eN;
18381 __pyx_t_13 = __pyx_v_ebN;
18382 __pyx_t_12 = __pyx_v_k;
18385 if (__pyx_t_14 < 0) {
18386 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18387 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18388 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18389 if (__pyx_t_13 < 0) {
18390 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18391 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18392 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18393 if (__pyx_t_12 < 0) {
18394 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18395 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18396 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18397 if (__pyx_t_11 < 0) {
18398 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18399 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18400 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18401 if (unlikely(__pyx_t_15 != -1)) {
18402 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18403 __PYX_ERR(0, 840, __pyx_L1_error)
18405 __pyx_t_16 = __pyx_v_eN;
18406 __pyx_t_17 = __pyx_v_ebN;
18407 __pyx_t_18 = __pyx_v_k;
18410 if (__pyx_t_16 < 0) {
18411 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18412 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18413 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18414 if (__pyx_t_17 < 0) {
18415 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18416 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18417 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18418 if (__pyx_t_18 < 0) {
18419 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18420 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18421 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18422 if (__pyx_t_19 < 0) {
18423 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18424 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18425 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18426 if (unlikely(__pyx_t_15 != -1)) {
18427 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18428 __PYX_ERR(0, 840, __pyx_L1_error)
18430 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18439 __pyx_t_11 = __pyx_v_eN;
18440 __pyx_t_12 = __pyx_v_ebN;
18441 __pyx_t_13 = __pyx_v_k;
18444 if (__pyx_t_11 < 0) {
18445 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18446 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18447 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18448 if (__pyx_t_12 < 0) {
18449 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18450 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18451 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18452 if (__pyx_t_13 < 0) {
18453 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18454 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18455 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18456 if (__pyx_t_14 < 0) {
18457 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18458 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18459 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18460 if (unlikely(__pyx_t_15 != -1)) {
18461 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18462 __PYX_ERR(0, 841, __pyx_L1_error)
18464 __pyx_t_19 = __pyx_v_eN;
18465 __pyx_t_18 = __pyx_v_ebN;
18466 __pyx_t_17 = __pyx_v_k;
18469 if (__pyx_t_19 < 0) {
18470 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18471 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18472 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18473 if (__pyx_t_18 < 0) {
18474 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18475 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18476 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18477 if (__pyx_t_17 < 0) {
18478 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18479 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18480 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18481 if (__pyx_t_16 < 0) {
18482 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18483 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18484 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18485 if (unlikely(__pyx_t_15 != -1)) {
18486 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18487 __PYX_ERR(0, 841, __pyx_L1_error)
18489 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
18498 __pyx_t_14 = __pyx_v_eN;
18499 __pyx_t_13 = __pyx_v_ebN;
18500 __pyx_t_12 = __pyx_v_k;
18503 if (__pyx_t_14 < 0) {
18504 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
18505 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18506 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18507 if (__pyx_t_13 < 0) {
18508 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
18509 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18510 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18511 if (__pyx_t_12 < 0) {
18512 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
18513 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18514 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18515 if (__pyx_t_11 < 0) {
18516 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
18517 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18518 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18519 if (unlikely(__pyx_t_15 != -1)) {
18520 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18521 __PYX_ERR(0, 842, __pyx_L1_error)
18523 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18548 #ifndef CYTHON_WITHOUT_ASSERTIONS
18549 if (unlikely(!Py_OptimizeFlag)) {
18550 if (unlikely(!(((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 2) != 0))) {
18551 PyErr_SetNone(PyExc_AssertionError);
18552 __PYX_ERR(0, 844, __pyx_L1_error)
18564 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18574 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18575 __pyx_t_3 = __pyx_t_2;
18576 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18577 __pyx_v_eN = __pyx_t_4;
18586 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18587 __pyx_t_6 = __pyx_t_5;
18588 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18589 __pyx_v_ebN = __pyx_t_7;
18598 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18599 __pyx_t_9 = __pyx_t_8;
18600 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18601 __pyx_v_k = __pyx_t_10;
18610 __pyx_t_11 = __pyx_v_eN;
18611 __pyx_t_12 = __pyx_v_ebN;
18612 __pyx_t_13 = __pyx_v_k;
18615 if (__pyx_t_11 < 0) {
18616 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18617 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18618 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18619 if (__pyx_t_12 < 0) {
18620 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18621 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18622 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18623 if (__pyx_t_13 < 0) {
18624 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18625 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18626 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18627 if (__pyx_t_14 < 0) {
18628 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18629 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18630 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18631 if (unlikely(__pyx_t_15 != -1)) {
18632 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18633 __PYX_ERR(0, 849, __pyx_L1_error)
18635 __pyx_t_16 = __pyx_v_eN;
18636 __pyx_t_17 = __pyx_v_ebN;
18637 __pyx_t_18 = __pyx_v_k;
18640 if (__pyx_t_16 < 0) {
18641 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18642 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18643 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18644 if (__pyx_t_17 < 0) {
18645 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18646 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18647 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18648 if (__pyx_t_18 < 0) {
18649 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18650 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18651 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18652 if (__pyx_t_19 < 0) {
18653 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18654 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18655 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18656 if (unlikely(__pyx_t_15 != -1)) {
18657 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18658 __PYX_ERR(0, 849, __pyx_L1_error)
18660 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18669 __pyx_t_14 = __pyx_v_eN;
18670 __pyx_t_13 = __pyx_v_ebN;
18671 __pyx_t_12 = __pyx_v_k;
18674 if (__pyx_t_14 < 0) {
18675 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18676 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18677 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18678 if (__pyx_t_13 < 0) {
18679 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18680 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18681 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18682 if (__pyx_t_12 < 0) {
18683 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18684 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18685 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18686 if (__pyx_t_11 < 0) {
18687 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18688 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18689 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18690 if (unlikely(__pyx_t_15 != -1)) {
18691 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18692 __PYX_ERR(0, 850, __pyx_L1_error)
18694 __pyx_t_19 = __pyx_v_eN;
18695 __pyx_t_18 = __pyx_v_ebN;
18696 __pyx_t_17 = __pyx_v_k;
18699 if (__pyx_t_19 < 0) {
18700 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18701 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18702 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18703 if (__pyx_t_18 < 0) {
18704 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18705 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18706 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18707 if (__pyx_t_17 < 0) {
18708 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18709 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18710 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18711 if (__pyx_t_16 < 0) {
18712 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18713 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18714 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18715 if (unlikely(__pyx_t_15 != -1)) {
18716 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18717 __PYX_ERR(0, 850, __pyx_L1_error)
18719 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18728 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 851, __pyx_L1_error)
18729 __Pyx_GOTREF(__pyx_t_23);
18730 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 851, __pyx_L1_error)
18731 __Pyx_GOTREF(__pyx_t_20);
18732 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 851, __pyx_L1_error)
18733 __Pyx_GOTREF(__pyx_t_21);
18734 __pyx_t_22 = PyTuple_New(4);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 851, __pyx_L1_error)
18735 __Pyx_GOTREF(__pyx_t_22);
18736 __Pyx_GIVEREF(__pyx_t_23);
18737 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23);
18738 __Pyx_GIVEREF(__pyx_t_20);
18739 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
18740 __Pyx_GIVEREF(__pyx_t_21);
18741 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_21);
18742 __Pyx_INCREF(__pyx_slice_);
18743 __Pyx_GIVEREF(__pyx_slice_);
18744 PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_slice_);
18748 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_22);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 851, __pyx_L1_error)
18749 __Pyx_GOTREF(__pyx_t_21);
18750 __pyx_t_25 = (__pyx_v_tForReversal - __pyx_v_t);
18751 __pyx_t_24 = (__pyx_v_tForReversal - 0.0);
18752 if (unlikely(__pyx_t_24 == 0)) {
18753 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18754 __PYX_ERR(0, 851, __pyx_L1_error)
18756 __pyx_t_20 = PyFloat_FromDouble(((__pyx_t_25 / __pyx_t_24) * __pyx_v_clock));
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 851, __pyx_L1_error)
18757 __Pyx_GOTREF(__pyx_t_20);
18758 __pyx_t_23 = PyNumber_InPlaceMultiply(__pyx_t_21, __pyx_t_20);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 851, __pyx_L1_error)
18759 __Pyx_GOTREF(__pyx_t_23);
18760 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
18761 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
18762 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_22, __pyx_t_23) < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
18763 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18764 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18787 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18788 __pyx_t_3 = __pyx_t_2;
18789 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18790 __pyx_v_eN = __pyx_t_4;
18799 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18800 __pyx_t_6 = __pyx_t_5;
18801 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18802 __pyx_v_ebN = __pyx_t_7;
18811 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18812 __pyx_t_9 = __pyx_t_8;
18813 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18814 __pyx_v_k = __pyx_t_10;
18823 __pyx_t_11 = __pyx_v_eN;
18824 __pyx_t_12 = __pyx_v_ebN;
18825 __pyx_t_13 = __pyx_v_k;
18828 if (__pyx_t_11 < 0) {
18829 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18830 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18831 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18832 if (__pyx_t_12 < 0) {
18833 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18834 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18835 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18836 if (__pyx_t_13 < 0) {
18837 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18838 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18839 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18840 if (__pyx_t_14 < 0) {
18841 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18842 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18843 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18844 if (unlikely(__pyx_t_15 != -1)) {
18845 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18846 __PYX_ERR(0, 856, __pyx_L1_error)
18848 __pyx_t_16 = __pyx_v_eN;
18849 __pyx_t_17 = __pyx_v_ebN;
18850 __pyx_t_18 = __pyx_v_k;
18853 if (__pyx_t_16 < 0) {
18854 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18855 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18856 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18857 if (__pyx_t_17 < 0) {
18858 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18859 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18860 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18861 if (__pyx_t_18 < 0) {
18862 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18863 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18864 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18865 if (__pyx_t_19 < 0) {
18866 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18867 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18868 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18869 if (unlikely(__pyx_t_15 != -1)) {
18870 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18871 __PYX_ERR(0, 856, __pyx_L1_error)
18873 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18882 __pyx_t_14 = __pyx_v_eN;
18883 __pyx_t_13 = __pyx_v_ebN;
18884 __pyx_t_12 = __pyx_v_k;
18887 if (__pyx_t_14 < 0) {
18888 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18889 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18890 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18891 if (__pyx_t_13 < 0) {
18892 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18893 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18894 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18895 if (__pyx_t_12 < 0) {
18896 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18897 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18898 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18899 if (__pyx_t_11 < 0) {
18900 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18901 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18902 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18903 if (unlikely(__pyx_t_15 != -1)) {
18904 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18905 __PYX_ERR(0, 857, __pyx_L1_error)
18907 __pyx_t_19 = __pyx_v_eN;
18908 __pyx_t_18 = __pyx_v_ebN;
18909 __pyx_t_17 = __pyx_v_k;
18912 if (__pyx_t_19 < 0) {
18913 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18914 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18915 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18916 if (__pyx_t_18 < 0) {
18917 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18918 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18919 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18920 if (__pyx_t_17 < 0) {
18921 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18922 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18923 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18924 if (__pyx_t_16 < 0) {
18925 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18926 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18927 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18928 if (unlikely(__pyx_t_15 != -1)) {
18929 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18930 __PYX_ERR(0, 857, __pyx_L1_error)
18932 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18950 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18953 __Pyx_XDECREF(__pyx_t_20);
18954 __Pyx_XDECREF(__pyx_t_21);
18955 __Pyx_XDECREF(__pyx_t_22);
18956 __Pyx_XDECREF(__pyx_t_23);
18957 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18958 __Pyx_PyThreadState_declare
18959 __Pyx_PyThreadState_assign
18960 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18961 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18962 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18963 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
18964 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18968 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18969 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18971 __Pyx_XGIVEREF(__pyx_r);
18972 __Pyx_RefNannyFinishContext();
18985 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18986 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {
"helicalElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
18987 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18988 int __pyx_v_transient;
18990 double __pyx_v_tForReversal;
18991 double __pyx_v_clock;
18992 double __pyx_v_zVelocity;
18995 PyArrayObject *__pyx_v_x = 0;
18996 PyArrayObject *__pyx_v_v = 0;
18997 int __pyx_lineno = 0;
18998 const char *__pyx_filename = NULL;
18999 int __pyx_clineno = 0;
19000 PyObject *__pyx_r = 0;
19001 __Pyx_RefNannyDeclarations
19002 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3 (wrapper)", 0);
19004 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19005 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19006 if (unlikely(__pyx_kwds)) {
19007 Py_ssize_t kw_args;
19008 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19009 switch (pos_args) {
19010 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19011 CYTHON_FALLTHROUGH;
19012 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19013 CYTHON_FALLTHROUGH;
19014 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19015 CYTHON_FALLTHROUGH;
19016 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19017 CYTHON_FALLTHROUGH;
19018 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19019 CYTHON_FALLTHROUGH;
19020 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19021 CYTHON_FALLTHROUGH;
19022 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19023 CYTHON_FALLTHROUGH;
19024 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19025 CYTHON_FALLTHROUGH;
19026 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19027 CYTHON_FALLTHROUGH;
19029 default:
goto __pyx_L5_argtuple_error;
19031 kw_args = PyDict_Size(__pyx_kwds);
19032 switch (pos_args) {
19034 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19035 else goto __pyx_L5_argtuple_error;
19036 CYTHON_FALLTHROUGH;
19038 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19040 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 1); __PYX_ERR(0, 859, __pyx_L3_error)
19042 CYTHON_FALLTHROUGH;
19044 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19046 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 2); __PYX_ERR(0, 859, __pyx_L3_error)
19048 CYTHON_FALLTHROUGH;
19050 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19052 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 3); __PYX_ERR(0, 859, __pyx_L3_error)
19054 CYTHON_FALLTHROUGH;
19056 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19058 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 4); __PYX_ERR(0, 859, __pyx_L3_error)
19060 CYTHON_FALLTHROUGH;
19062 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19064 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 5); __PYX_ERR(0, 859, __pyx_L3_error)
19066 CYTHON_FALLTHROUGH;
19068 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19070 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 6); __PYX_ERR(0, 859, __pyx_L3_error)
19072 CYTHON_FALLTHROUGH;
19074 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19076 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 7); __PYX_ERR(0, 859, __pyx_L3_error)
19078 CYTHON_FALLTHROUGH;
19080 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19082 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 8); __PYX_ERR(0, 859, __pyx_L3_error)
19085 if (unlikely(kw_args > 0)) {
19086 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval3") < 0)) __PYX_ERR(0, 859, __pyx_L3_error)
19088 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19089 goto __pyx_L5_argtuple_error;
19091 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19092 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19093 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19094 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19095 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19096 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19097 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19098 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19099 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19101 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L3_error)
19102 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L3_error)
19103 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
19104 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
19105 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
19106 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19107 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19108 __pyx_v_x = ((PyArrayObject *)values[7]);
19109 __pyx_v_v = ((PyArrayObject *)values[8]);
19111 goto __pyx_L4_argument_unpacking_done;
19112 __pyx_L5_argtuple_error:;
19113 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 859, __pyx_L3_error)
19115 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19116 __Pyx_RefNannyFinishContext();
19118 __pyx_L4_argument_unpacking_done:;
19119 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 865, __pyx_L1_error)
19120 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
19121 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19128 __Pyx_RefNannyFinishContext();
19132 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19136 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19137 __Pyx_Buffer __pyx_pybuffer_v;
19138 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19139 __Pyx_Buffer __pyx_pybuffer_x;
19140 PyObject *__pyx_r = NULL;
19141 __Pyx_RefNannyDeclarations
19143 npy_intp __pyx_t_2;
19144 npy_intp __pyx_t_3;
19146 npy_intp __pyx_t_5;
19147 npy_intp __pyx_t_6;
19149 Py_ssize_t __pyx_t_8;
19150 Py_ssize_t __pyx_t_9;
19151 Py_ssize_t __pyx_t_10;
19153 Py_ssize_t __pyx_t_12;
19154 Py_ssize_t __pyx_t_13;
19155 Py_ssize_t __pyx_t_14;
19156 PyObject *__pyx_t_15 = NULL;
19157 PyObject *__pyx_t_16 = NULL;
19158 PyObject *__pyx_t_17 = NULL;
19161 PyObject *__pyx_t_20 = NULL;
19162 int __pyx_lineno = 0;
19163 const char *__pyx_filename = NULL;
19164 int __pyx_clineno = 0;
19165 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3", 0);
19166 __pyx_pybuffer_x.pybuffer.buf = NULL;
19167 __pyx_pybuffer_x.refcount = 0;
19168 __pyx_pybuffernd_x.data = NULL;
19169 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19170 __pyx_pybuffer_v.pybuffer.buf = NULL;
19171 __pyx_pybuffer_v.refcount = 0;
19172 __pyx_pybuffernd_v.data = NULL;
19173 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19175 __Pyx_BufFmt_StackElem __pyx_stack[1];
19176 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19178 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
19180 __Pyx_BufFmt_StackElem __pyx_stack[1];
19181 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19183 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19201 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19211 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19212 __pyx_t_3 = __pyx_t_2;
19213 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19214 __pyx_v_eN = __pyx_t_4;
19223 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19224 __pyx_t_6 = __pyx_t_5;
19225 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19226 __pyx_v_k = __pyx_t_7;
19235 __pyx_t_8 = __pyx_v_eN;
19236 __pyx_t_9 = __pyx_v_k;
19239 if (__pyx_t_8 < 0) {
19240 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19241 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19242 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19243 if (__pyx_t_9 < 0) {
19244 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19245 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19246 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19247 if (__pyx_t_10 < 0) {
19248 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19249 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19250 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19251 if (unlikely(__pyx_t_11 != -1)) {
19252 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19253 __PYX_ERR(0, 873, __pyx_L1_error)
19255 __pyx_t_12 = __pyx_v_eN;
19256 __pyx_t_13 = __pyx_v_k;
19259 if (__pyx_t_12 < 0) {
19260 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19261 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19262 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19263 if (__pyx_t_13 < 0) {
19264 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19265 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19266 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19267 if (__pyx_t_14 < 0) {
19268 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19269 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19270 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19271 if (unlikely(__pyx_t_11 != -1)) {
19272 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19273 __PYX_ERR(0, 873, __pyx_L1_error)
19275 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19284 __pyx_t_10 = __pyx_v_eN;
19285 __pyx_t_9 = __pyx_v_k;
19288 if (__pyx_t_10 < 0) {
19289 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
19290 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19291 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19292 if (__pyx_t_9 < 0) {
19293 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19294 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19295 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19296 if (__pyx_t_8 < 0) {
19297 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
19298 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19299 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19300 if (unlikely(__pyx_t_11 != -1)) {
19301 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19302 __PYX_ERR(0, 874, __pyx_L1_error)
19304 __pyx_t_14 = __pyx_v_eN;
19305 __pyx_t_13 = __pyx_v_k;
19308 if (__pyx_t_14 < 0) {
19309 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
19310 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
19311 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19312 if (__pyx_t_13 < 0) {
19313 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19314 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19315 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19316 if (__pyx_t_12 < 0) {
19317 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
19318 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
19319 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19320 if (unlikely(__pyx_t_11 != -1)) {
19321 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19322 __PYX_ERR(0, 874, __pyx_L1_error)
19324 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
19333 __pyx_t_8 = __pyx_v_eN;
19334 __pyx_t_9 = __pyx_v_k;
19337 if (__pyx_t_8 < 0) {
19338 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
19339 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19340 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19341 if (__pyx_t_9 < 0) {
19342 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
19343 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19344 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19345 if (__pyx_t_10 < 0) {
19346 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
19347 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19348 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19349 if (unlikely(__pyx_t_11 != -1)) {
19350 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19351 __PYX_ERR(0, 875, __pyx_L1_error)
19353 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19362 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 876, __pyx_L1_error)
19363 __Pyx_GOTREF(__pyx_t_15);
19364 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 876, __pyx_L1_error)
19365 __Pyx_GOTREF(__pyx_t_16);
19366 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 876, __pyx_L1_error)
19367 __Pyx_GOTREF(__pyx_t_17);
19368 __Pyx_GIVEREF(__pyx_t_15);
19369 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
19370 __Pyx_GIVEREF(__pyx_t_16);
19371 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
19372 __Pyx_INCREF(__pyx_slice_);
19373 __Pyx_GIVEREF(__pyx_slice_);
19374 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_slice_);
19377 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 876, __pyx_L1_error)
19378 __Pyx_GOTREF(__pyx_t_16);
19379 __pyx_t_18 = (__pyx_v_pi * __pyx_v_t);
19380 __pyx_t_19 = (__pyx_v_tForReversal * 2.0);
19381 if (unlikely(__pyx_t_19 == 0)) {
19382 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19383 __PYX_ERR(0, 876, __pyx_L1_error)
19385 __pyx_t_15 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_18 / __pyx_t_19))));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 876, __pyx_L1_error)
19386 __Pyx_GOTREF(__pyx_t_15);
19387 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 876, __pyx_L1_error)
19388 __Pyx_GOTREF(__pyx_t_20);
19389 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19390 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19391 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
19392 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
19393 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
19415 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19416 __pyx_t_3 = __pyx_t_2;
19417 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19418 __pyx_v_eN = __pyx_t_4;
19427 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19428 __pyx_t_6 = __pyx_t_5;
19429 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19430 __pyx_v_k = __pyx_t_7;
19439 __pyx_t_10 = __pyx_v_eN;
19440 __pyx_t_9 = __pyx_v_k;
19443 if (__pyx_t_10 < 0) {
19444 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
19445 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19446 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19447 if (__pyx_t_9 < 0) {
19448 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19449 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19450 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19451 if (__pyx_t_8 < 0) {
19452 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
19453 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19454 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19455 if (unlikely(__pyx_t_11 != -1)) {
19456 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19457 __PYX_ERR(0, 880, __pyx_L1_error)
19459 __pyx_t_12 = __pyx_v_eN;
19460 __pyx_t_13 = __pyx_v_k;
19463 if (__pyx_t_12 < 0) {
19464 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19465 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19466 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19467 if (__pyx_t_13 < 0) {
19468 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19469 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19470 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19471 if (__pyx_t_14 < 0) {
19472 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19473 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19474 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19475 if (unlikely(__pyx_t_11 != -1)) {
19476 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19477 __PYX_ERR(0, 880, __pyx_L1_error)
19479 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19488 __pyx_t_8 = __pyx_v_eN;
19489 __pyx_t_9 = __pyx_v_k;
19492 if (__pyx_t_8 < 0) {
19493 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19494 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19495 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19496 if (__pyx_t_9 < 0) {
19497 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19498 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19499 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19500 if (__pyx_t_10 < 0) {
19501 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19502 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19503 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19504 if (unlikely(__pyx_t_11 != -1)) {
19505 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19506 __PYX_ERR(0, 881, __pyx_L1_error)
19508 __pyx_t_14 = __pyx_v_eN;
19509 __pyx_t_13 = __pyx_v_k;
19512 if (__pyx_t_14 < 0) {
19513 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
19514 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
19515 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19516 if (__pyx_t_13 < 0) {
19517 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19518 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19519 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19520 if (__pyx_t_12 < 0) {
19521 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
19522 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
19523 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19524 if (unlikely(__pyx_t_11 != -1)) {
19525 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19526 __PYX_ERR(0, 881, __pyx_L1_error)
19528 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
19537 __pyx_t_10 = __pyx_v_eN;
19538 __pyx_t_9 = __pyx_v_k;
19541 if (__pyx_t_10 < 0) {
19542 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
19543 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19544 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19545 if (__pyx_t_9 < 0) {
19546 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
19547 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19548 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19549 if (__pyx_t_8 < 0) {
19550 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
19551 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19552 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19553 if (unlikely(__pyx_t_11 != -1)) {
19554 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19555 __PYX_ERR(0, 882, __pyx_L1_error)
19557 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19572 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19575 __Pyx_XDECREF(__pyx_t_15);
19576 __Pyx_XDECREF(__pyx_t_16);
19577 __Pyx_XDECREF(__pyx_t_17);
19578 __Pyx_XDECREF(__pyx_t_20);
19579 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19580 __Pyx_PyThreadState_declare
19581 __Pyx_PyThreadState_assign
19582 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19583 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19584 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19585 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19586 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19590 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19591 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19593 __Pyx_XGIVEREF(__pyx_r);
19594 __Pyx_RefNannyFinishContext();
19607 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19608 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {
"helicalElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
19609 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19610 int __pyx_v_transient;
19612 double __pyx_v_tForReversal;
19613 double __pyx_v_clock;
19614 double __pyx_v_zVelocity;
19617 PyArrayObject *__pyx_v_x = 0;
19618 PyArrayObject *__pyx_v_v = 0;
19619 int __pyx_lineno = 0;
19620 const char *__pyx_filename = NULL;
19621 int __pyx_clineno = 0;
19622 PyObject *__pyx_r = 0;
19623 __Pyx_RefNannyDeclarations
19624 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4 (wrapper)", 0);
19626 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19627 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19628 if (unlikely(__pyx_kwds)) {
19629 Py_ssize_t kw_args;
19630 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19631 switch (pos_args) {
19632 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19633 CYTHON_FALLTHROUGH;
19634 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19635 CYTHON_FALLTHROUGH;
19636 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19637 CYTHON_FALLTHROUGH;
19638 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19639 CYTHON_FALLTHROUGH;
19640 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19641 CYTHON_FALLTHROUGH;
19642 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19643 CYTHON_FALLTHROUGH;
19644 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19645 CYTHON_FALLTHROUGH;
19646 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19647 CYTHON_FALLTHROUGH;
19648 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19649 CYTHON_FALLTHROUGH;
19651 default:
goto __pyx_L5_argtuple_error;
19653 kw_args = PyDict_Size(__pyx_kwds);
19654 switch (pos_args) {
19656 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19657 else goto __pyx_L5_argtuple_error;
19658 CYTHON_FALLTHROUGH;
19660 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19662 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 1); __PYX_ERR(0, 884, __pyx_L3_error)
19664 CYTHON_FALLTHROUGH;
19666 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19668 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 2); __PYX_ERR(0, 884, __pyx_L3_error)
19670 CYTHON_FALLTHROUGH;
19672 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19674 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 3); __PYX_ERR(0, 884, __pyx_L3_error)
19676 CYTHON_FALLTHROUGH;
19678 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19680 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 4); __PYX_ERR(0, 884, __pyx_L3_error)
19682 CYTHON_FALLTHROUGH;
19684 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19686 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 5); __PYX_ERR(0, 884, __pyx_L3_error)
19688 CYTHON_FALLTHROUGH;
19690 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19692 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 6); __PYX_ERR(0, 884, __pyx_L3_error)
19694 CYTHON_FALLTHROUGH;
19696 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19698 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 7); __PYX_ERR(0, 884, __pyx_L3_error)
19700 CYTHON_FALLTHROUGH;
19702 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19704 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 8); __PYX_ERR(0, 884, __pyx_L3_error)
19707 if (unlikely(kw_args > 0)) {
19708 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval4") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
19710 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19711 goto __pyx_L5_argtuple_error;
19713 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19714 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19715 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19716 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19717 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19718 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19719 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19720 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19721 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19723 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error)
19724 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error)
19725 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error)
19726 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error)
19727 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
19728 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19729 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19730 __pyx_v_x = ((PyArrayObject *)values[7]);
19731 __pyx_v_v = ((PyArrayObject *)values[8]);
19733 goto __pyx_L4_argument_unpacking_done;
19734 __pyx_L5_argtuple_error:;
19735 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
19737 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19738 __Pyx_RefNannyFinishContext();
19740 __pyx_L4_argument_unpacking_done:;
19741 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
19742 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
19743 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19750 __Pyx_RefNannyFinishContext();
19754 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19759 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19760 __Pyx_Buffer __pyx_pybuffer_v;
19761 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19762 __Pyx_Buffer __pyx_pybuffer_x;
19763 PyObject *__pyx_r = NULL;
19764 __Pyx_RefNannyDeclarations
19766 npy_intp __pyx_t_2;
19767 npy_intp __pyx_t_3;
19769 npy_intp __pyx_t_5;
19770 npy_intp __pyx_t_6;
19772 npy_intp __pyx_t_8;
19773 npy_intp __pyx_t_9;
19775 Py_ssize_t __pyx_t_11;
19776 Py_ssize_t __pyx_t_12;
19777 Py_ssize_t __pyx_t_13;
19778 Py_ssize_t __pyx_t_14;
19780 Py_ssize_t __pyx_t_16;
19781 Py_ssize_t __pyx_t_17;
19782 Py_ssize_t __pyx_t_18;
19783 Py_ssize_t __pyx_t_19;
19784 PyObject *__pyx_t_20 = NULL;
19785 PyObject *__pyx_t_21 = NULL;
19786 PyObject *__pyx_t_22 = NULL;
19787 PyObject *__pyx_t_23 = NULL;
19790 int __pyx_lineno = 0;
19791 const char *__pyx_filename = NULL;
19792 int __pyx_clineno = 0;
19793 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4", 0);
19794 __pyx_pybuffer_x.pybuffer.buf = NULL;
19795 __pyx_pybuffer_x.refcount = 0;
19796 __pyx_pybuffernd_x.data = NULL;
19797 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19798 __pyx_pybuffer_v.pybuffer.buf = NULL;
19799 __pyx_pybuffer_v.refcount = 0;
19800 __pyx_pybuffernd_v.data = NULL;
19801 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19803 __Pyx_BufFmt_StackElem __pyx_stack[1];
19804 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19806 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
19808 __Pyx_BufFmt_StackElem __pyx_stack[1];
19809 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19811 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
19829 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19839 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19840 __pyx_t_3 = __pyx_t_2;
19841 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19842 __pyx_v_eN = __pyx_t_4;
19851 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19852 __pyx_t_6 = __pyx_t_5;
19853 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19854 __pyx_v_ebN = __pyx_t_7;
19863 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
19864 __pyx_t_9 = __pyx_t_8;
19865 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
19866 __pyx_v_k = __pyx_t_10;
19875 __pyx_t_11 = __pyx_v_eN;
19876 __pyx_t_12 = __pyx_v_ebN;
19877 __pyx_t_13 = __pyx_v_k;
19880 if (__pyx_t_11 < 0) {
19881 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
19882 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
19883 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
19884 if (__pyx_t_12 < 0) {
19885 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
19886 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
19887 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
19888 if (__pyx_t_13 < 0) {
19889 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
19890 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
19891 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
19892 if (__pyx_t_14 < 0) {
19893 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
19894 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
19895 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
19896 if (unlikely(__pyx_t_15 != -1)) {
19897 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19898 __PYX_ERR(0, 899, __pyx_L1_error)
19900 __pyx_t_16 = __pyx_v_eN;
19901 __pyx_t_17 = __pyx_v_ebN;
19902 __pyx_t_18 = __pyx_v_k;
19905 if (__pyx_t_16 < 0) {
19906 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
19907 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
19908 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19909 if (__pyx_t_17 < 0) {
19910 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
19911 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
19912 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19913 if (__pyx_t_18 < 0) {
19914 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
19915 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
19916 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19917 if (__pyx_t_19 < 0) {
19918 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
19919 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
19920 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19921 if (unlikely(__pyx_t_15 != -1)) {
19922 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19923 __PYX_ERR(0, 899, __pyx_L1_error)
19925 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
19934 __pyx_t_14 = __pyx_v_eN;
19935 __pyx_t_13 = __pyx_v_ebN;
19936 __pyx_t_12 = __pyx_v_k;
19939 if (__pyx_t_14 < 0) {
19940 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
19941 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
19942 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
19943 if (__pyx_t_13 < 0) {
19944 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
19945 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
19946 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
19947 if (__pyx_t_12 < 0) {
19948 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
19949 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
19950 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
19951 if (__pyx_t_11 < 0) {
19952 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
19953 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
19954 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
19955 if (unlikely(__pyx_t_15 != -1)) {
19956 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19957 __PYX_ERR(0, 900, __pyx_L1_error)
19959 __pyx_t_19 = __pyx_v_eN;
19960 __pyx_t_18 = __pyx_v_ebN;
19961 __pyx_t_17 = __pyx_v_k;
19964 if (__pyx_t_19 < 0) {
19965 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
19966 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
19967 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19968 if (__pyx_t_18 < 0) {
19969 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
19970 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
19971 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19972 if (__pyx_t_17 < 0) {
19973 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
19974 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
19975 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19976 if (__pyx_t_16 < 0) {
19977 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
19978 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
19979 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19980 if (unlikely(__pyx_t_15 != -1)) {
19981 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19982 __PYX_ERR(0, 900, __pyx_L1_error)
19984 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
19993 __pyx_t_11 = __pyx_v_eN;
19994 __pyx_t_12 = __pyx_v_ebN;
19995 __pyx_t_13 = __pyx_v_k;
19998 if (__pyx_t_11 < 0) {
19999 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
20000 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
20001 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20002 if (__pyx_t_12 < 0) {
20003 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
20004 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
20005 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20006 if (__pyx_t_13 < 0) {
20007 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
20008 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
20009 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20010 if (__pyx_t_14 < 0) {
20011 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
20012 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
20013 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20014 if (unlikely(__pyx_t_15 != -1)) {
20015 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20016 __PYX_ERR(0, 901, __pyx_L1_error)
20018 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20027 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
20028 __Pyx_GOTREF(__pyx_t_20);
20029 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 902, __pyx_L1_error)
20030 __Pyx_GOTREF(__pyx_t_21);
20031 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 902, __pyx_L1_error)
20032 __Pyx_GOTREF(__pyx_t_22);
20033 __pyx_t_23 = PyTuple_New(4);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 902, __pyx_L1_error)
20034 __Pyx_GOTREF(__pyx_t_23);
20035 __Pyx_GIVEREF(__pyx_t_20);
20036 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
20037 __Pyx_GIVEREF(__pyx_t_21);
20038 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
20039 __Pyx_GIVEREF(__pyx_t_22);
20040 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
20041 __Pyx_INCREF(__pyx_slice_);
20042 __Pyx_GIVEREF(__pyx_slice_);
20043 PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_slice_);
20047 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 902, __pyx_L1_error)
20048 __Pyx_GOTREF(__pyx_t_22);
20049 __pyx_t_24 = (__pyx_v_pi * __pyx_v_t);
20050 __pyx_t_25 = (__pyx_v_tForReversal * 2.0);
20051 if (unlikely(__pyx_t_25 == 0)) {
20052 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
20053 __PYX_ERR(0, 902, __pyx_L1_error)
20055 __pyx_t_21 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_24 / __pyx_t_25))));
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 902, __pyx_L1_error)
20056 __Pyx_GOTREF(__pyx_t_21);
20057 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_22, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
20058 __Pyx_GOTREF(__pyx_t_20);
20059 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
20060 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
20061 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
20062 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
20063 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
20086 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
20087 __pyx_t_3 = __pyx_t_2;
20088 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20089 __pyx_v_eN = __pyx_t_4;
20098 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
20099 __pyx_t_6 = __pyx_t_5;
20100 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
20101 __pyx_v_ebN = __pyx_t_7;
20110 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
20111 __pyx_t_9 = __pyx_t_8;
20112 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
20113 __pyx_v_k = __pyx_t_10;
20122 __pyx_t_14 = __pyx_v_eN;
20123 __pyx_t_13 = __pyx_v_ebN;
20124 __pyx_t_12 = __pyx_v_k;
20127 if (__pyx_t_14 < 0) {
20128 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20129 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
20130 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20131 if (__pyx_t_13 < 0) {
20132 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
20133 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
20134 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20135 if (__pyx_t_12 < 0) {
20136 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
20137 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
20138 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20139 if (__pyx_t_11 < 0) {
20140 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
20141 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
20142 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20143 if (unlikely(__pyx_t_15 != -1)) {
20144 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20145 __PYX_ERR(0, 907, __pyx_L1_error)
20147 __pyx_t_16 = __pyx_v_eN;
20148 __pyx_t_17 = __pyx_v_ebN;
20149 __pyx_t_18 = __pyx_v_k;
20152 if (__pyx_t_16 < 0) {
20153 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
20154 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
20155 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20156 if (__pyx_t_17 < 0) {
20157 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
20158 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
20159 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20160 if (__pyx_t_18 < 0) {
20161 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
20162 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
20163 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20164 if (__pyx_t_19 < 0) {
20165 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
20166 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
20167 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20168 if (unlikely(__pyx_t_15 != -1)) {
20169 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20170 __PYX_ERR(0, 907, __pyx_L1_error)
20172 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
20181 __pyx_t_11 = __pyx_v_eN;
20182 __pyx_t_12 = __pyx_v_ebN;
20183 __pyx_t_13 = __pyx_v_k;
20186 if (__pyx_t_11 < 0) {
20187 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20188 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
20189 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20190 if (__pyx_t_12 < 0) {
20191 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20192 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
20193 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20194 if (__pyx_t_13 < 0) {
20195 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20196 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
20197 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20198 if (__pyx_t_14 < 0) {
20199 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
20200 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
20201 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20202 if (unlikely(__pyx_t_15 != -1)) {
20203 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20204 __PYX_ERR(0, 908, __pyx_L1_error)
20206 __pyx_t_19 = __pyx_v_eN;
20207 __pyx_t_18 = __pyx_v_ebN;
20208 __pyx_t_17 = __pyx_v_k;
20211 if (__pyx_t_19 < 0) {
20212 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
20213 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
20214 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20215 if (__pyx_t_18 < 0) {
20216 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20217 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
20218 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20219 if (__pyx_t_17 < 0) {
20220 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
20221 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
20222 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20223 if (__pyx_t_16 < 0) {
20224 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
20225 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
20226 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20227 if (unlikely(__pyx_t_15 != -1)) {
20228 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20229 __PYX_ERR(0, 908, __pyx_L1_error)
20231 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
20240 __pyx_t_14 = __pyx_v_eN;
20241 __pyx_t_13 = __pyx_v_ebN;
20242 __pyx_t_12 = __pyx_v_k;
20245 if (__pyx_t_14 < 0) {
20246 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
20247 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
20248 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20249 if (__pyx_t_13 < 0) {
20250 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
20251 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
20252 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20253 if (__pyx_t_12 < 0) {
20254 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
20255 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
20256 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20257 if (__pyx_t_11 < 0) {
20258 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
20259 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
20260 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20261 if (unlikely(__pyx_t_15 != -1)) {
20262 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20263 __PYX_ERR(0, 909, __pyx_L1_error)
20265 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20281 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20284 __Pyx_XDECREF(__pyx_t_20);
20285 __Pyx_XDECREF(__pyx_t_21);
20286 __Pyx_XDECREF(__pyx_t_22);
20287 __Pyx_XDECREF(__pyx_t_23);
20288 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20289 __Pyx_PyThreadState_declare
20290 __Pyx_PyThreadState_assign
20291 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20292 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20293 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20294 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20295 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20299 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20300 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20302 __Pyx_XGIVEREF(__pyx_r);
20303 __Pyx_RefNannyFinishContext();
20316 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20317 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {
"vortexElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
20318 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20320 PyArrayObject *__pyx_v_x = 0;
20321 PyArrayObject *__pyx_v_v = 0;
20322 int __pyx_lineno = 0;
20323 const char *__pyx_filename = NULL;
20324 int __pyx_clineno = 0;
20325 PyObject *__pyx_r = 0;
20326 __Pyx_RefNannyDeclarations
20327 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3 (wrapper)", 0);
20329 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20330 PyObject* values[3] = {0,0,0};
20331 if (unlikely(__pyx_kwds)) {
20332 Py_ssize_t kw_args;
20333 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20334 switch (pos_args) {
20335 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20336 CYTHON_FALLTHROUGH;
20337 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20338 CYTHON_FALLTHROUGH;
20339 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20340 CYTHON_FALLTHROUGH;
20342 default:
goto __pyx_L5_argtuple_error;
20344 kw_args = PyDict_Size(__pyx_kwds);
20345 switch (pos_args) {
20347 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20348 else goto __pyx_L5_argtuple_error;
20349 CYTHON_FALLTHROUGH;
20351 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20353 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 1); __PYX_ERR(0, 911, __pyx_L3_error)
20355 CYTHON_FALLTHROUGH;
20357 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20359 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 2); __PYX_ERR(0, 911, __pyx_L3_error)
20362 if (unlikely(kw_args > 0)) {
20363 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval3") < 0)) __PYX_ERR(0, 911, __pyx_L3_error)
20365 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20366 goto __pyx_L5_argtuple_error;
20368 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20369 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20370 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20372 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
20373 __pyx_v_x = ((PyArrayObject *)values[1]);
20374 __pyx_v_v = ((PyArrayObject *)values[2]);
20376 goto __pyx_L4_argument_unpacking_done;
20377 __pyx_L5_argtuple_error:;
20378 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 911, __pyx_L3_error)
20380 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20381 __Pyx_RefNannyFinishContext();
20383 __pyx_L4_argument_unpacking_done:;
20384 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
20385 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
20386 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20393 __Pyx_RefNannyFinishContext();
20397 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20401 double __pyx_v_one8;
20402 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20403 __Pyx_Buffer __pyx_pybuffer_v;
20404 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20405 __Pyx_Buffer __pyx_pybuffer_x;
20406 PyObject *__pyx_r = NULL;
20407 __Pyx_RefNannyDeclarations
20408 npy_intp __pyx_t_1;
20409 npy_intp __pyx_t_2;
20411 npy_intp __pyx_t_4;
20412 npy_intp __pyx_t_5;
20414 Py_ssize_t __pyx_t_7;
20415 Py_ssize_t __pyx_t_8;
20416 Py_ssize_t __pyx_t_9;
20418 Py_ssize_t __pyx_t_11;
20419 Py_ssize_t __pyx_t_12;
20420 Py_ssize_t __pyx_t_13;
20421 Py_ssize_t __pyx_t_14;
20422 Py_ssize_t __pyx_t_15;
20423 Py_ssize_t __pyx_t_16;
20424 Py_ssize_t __pyx_t_17;
20425 Py_ssize_t __pyx_t_18;
20426 Py_ssize_t __pyx_t_19;
20427 int __pyx_lineno = 0;
20428 const char *__pyx_filename = NULL;
20429 int __pyx_clineno = 0;
20430 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3", 0);
20431 __pyx_pybuffer_x.pybuffer.buf = NULL;
20432 __pyx_pybuffer_x.refcount = 0;
20433 __pyx_pybuffernd_x.data = NULL;
20434 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20435 __pyx_pybuffer_v.pybuffer.buf = NULL;
20436 __pyx_pybuffer_v.refcount = 0;
20437 __pyx_pybuffernd_v.data = NULL;
20438 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20440 __Pyx_BufFmt_StackElem __pyx_stack[1];
20441 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20443 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
20445 __Pyx_BufFmt_StackElem __pyx_stack[1];
20446 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20448 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
20466 __pyx_v_one8 = (1.0 / 8.0);
20475 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20476 __pyx_t_2 = __pyx_t_1;
20477 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20478 __pyx_v_eN = __pyx_t_3;
20487 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20488 __pyx_t_5 = __pyx_t_4;
20489 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20490 __pyx_v_k = __pyx_t_6;
20499 __pyx_t_7 = __pyx_v_eN;
20500 __pyx_t_8 = __pyx_v_k;
20503 if (__pyx_t_7 < 0) {
20504 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
20505 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 0;
20506 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20507 if (__pyx_t_8 < 0) {
20508 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20509 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20510 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20511 if (__pyx_t_9 < 0) {
20512 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
20513 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 2;
20514 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20515 if (unlikely(__pyx_t_10 != -1)) {
20516 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20517 __PYX_ERR(0, 920, __pyx_L1_error)
20519 __pyx_t_11 = __pyx_v_eN;
20520 __pyx_t_12 = __pyx_v_k;
20523 if (__pyx_t_11 < 0) {
20524 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20525 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20526 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20527 if (__pyx_t_12 < 0) {
20528 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20529 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20530 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20531 if (__pyx_t_13 < 0) {
20532 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20533 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 2;
20534 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20535 if (unlikely(__pyx_t_10 != -1)) {
20536 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20537 __PYX_ERR(0, 920, __pyx_L1_error)
20539 __pyx_t_14 = __pyx_v_eN;
20540 __pyx_t_15 = __pyx_v_k;
20543 if (__pyx_t_14 < 0) {
20544 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20545 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
20546 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20547 if (__pyx_t_15 < 0) {
20548 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20549 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20550 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20551 if (__pyx_t_16 < 0) {
20552 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
20553 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 2;
20554 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20555 if (unlikely(__pyx_t_10 != -1)) {
20556 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20557 __PYX_ERR(0, 920, __pyx_L1_error)
20559 __pyx_t_17 = __pyx_v_eN;
20560 __pyx_t_18 = __pyx_v_k;
20563 if (__pyx_t_17 < 0) {
20564 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[0].shape;
20565 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
20566 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20567 if (__pyx_t_18 < 0) {
20568 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20569 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20570 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20571 if (__pyx_t_19 < 0) {
20572 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[2].shape;
20573 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 2;
20574 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20575 if (unlikely(__pyx_t_10 != -1)) {
20576 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20577 __PYX_ERR(0, 920, __pyx_L1_error)
20579 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides)))));
20588 __pyx_t_16 = __pyx_v_eN;
20589 __pyx_t_15 = __pyx_v_k;
20592 if (__pyx_t_16 < 0) {
20593 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape;
20594 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
20595 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20596 if (__pyx_t_15 < 0) {
20597 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20598 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20599 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20600 if (__pyx_t_14 < 0) {
20601 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
20602 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 2;
20603 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20604 if (unlikely(__pyx_t_10 != -1)) {
20605 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20606 __PYX_ERR(0, 921, __pyx_L1_error)
20608 __pyx_t_13 = __pyx_v_eN;
20609 __pyx_t_12 = __pyx_v_k;
20612 if (__pyx_t_13 < 0) {
20613 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
20614 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
20615 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20616 if (__pyx_t_12 < 0) {
20617 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20618 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20619 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20620 if (__pyx_t_11 < 0) {
20621 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
20622 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 2;
20623 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20624 if (unlikely(__pyx_t_10 != -1)) {
20625 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20626 __PYX_ERR(0, 921, __pyx_L1_error)
20628 __pyx_t_9 = __pyx_v_eN;
20629 __pyx_t_8 = __pyx_v_k;
20632 if (__pyx_t_9 < 0) {
20633 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[0].shape;
20634 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
20635 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20636 if (__pyx_t_8 < 0) {
20637 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20638 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20639 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20640 if (__pyx_t_7 < 0) {
20641 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[2].shape;
20642 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 2;
20643 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20644 if (unlikely(__pyx_t_10 != -1)) {
20645 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20646 __PYX_ERR(0, 921, __pyx_L1_error)
20648 __pyx_t_19 = __pyx_v_eN;
20649 __pyx_t_18 = __pyx_v_k;
20652 if (__pyx_t_19 < 0) {
20653 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
20654 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
20655 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20656 if (__pyx_t_18 < 0) {
20657 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20658 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20659 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20660 if (__pyx_t_17 < 0) {
20661 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
20662 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 2;
20663 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20664 if (unlikely(__pyx_t_10 != -1)) {
20665 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20666 __PYX_ERR(0, 921, __pyx_L1_error)
20668 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[2].strides)))));
20681 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20684 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20685 __Pyx_PyThreadState_declare
20686 __Pyx_PyThreadState_assign
20687 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20688 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20689 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20690 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20691 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20695 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20696 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20698 __Pyx_XGIVEREF(__pyx_r);
20699 __Pyx_RefNannyFinishContext();
20712 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20713 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {
"vortexElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
20714 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20716 PyArrayObject *__pyx_v_x = 0;
20717 PyArrayObject *__pyx_v_v = 0;
20718 int __pyx_lineno = 0;
20719 const char *__pyx_filename = NULL;
20720 int __pyx_clineno = 0;
20721 PyObject *__pyx_r = 0;
20722 __Pyx_RefNannyDeclarations
20723 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4 (wrapper)", 0);
20725 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20726 PyObject* values[3] = {0,0,0};
20727 if (unlikely(__pyx_kwds)) {
20728 Py_ssize_t kw_args;
20729 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20730 switch (pos_args) {
20731 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20732 CYTHON_FALLTHROUGH;
20733 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20734 CYTHON_FALLTHROUGH;
20735 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20736 CYTHON_FALLTHROUGH;
20738 default:
goto __pyx_L5_argtuple_error;
20740 kw_args = PyDict_Size(__pyx_kwds);
20741 switch (pos_args) {
20743 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20744 else goto __pyx_L5_argtuple_error;
20745 CYTHON_FALLTHROUGH;
20747 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20749 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 1); __PYX_ERR(0, 924, __pyx_L3_error)
20751 CYTHON_FALLTHROUGH;
20753 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20755 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 2); __PYX_ERR(0, 924, __pyx_L3_error)
20758 if (unlikely(kw_args > 0)) {
20759 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval4") < 0)) __PYX_ERR(0, 924, __pyx_L3_error)
20761 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20762 goto __pyx_L5_argtuple_error;
20764 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20765 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20766 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20768 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L3_error)
20769 __pyx_v_x = ((PyArrayObject *)values[1]);
20770 __pyx_v_v = ((PyArrayObject *)values[2]);
20772 goto __pyx_L4_argument_unpacking_done;
20773 __pyx_L5_argtuple_error:;
20774 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 924, __pyx_L3_error)
20776 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20777 __Pyx_RefNannyFinishContext();
20779 __pyx_L4_argument_unpacking_done:;
20780 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 925, __pyx_L1_error)
20781 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
20782 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20789 __Pyx_RefNannyFinishContext();
20793 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20798 double __pyx_v_one8;
20799 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20800 __Pyx_Buffer __pyx_pybuffer_v;
20801 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20802 __Pyx_Buffer __pyx_pybuffer_x;
20803 PyObject *__pyx_r = NULL;
20804 __Pyx_RefNannyDeclarations
20805 npy_intp __pyx_t_1;
20806 npy_intp __pyx_t_2;
20808 npy_intp __pyx_t_4;
20809 npy_intp __pyx_t_5;
20811 npy_intp __pyx_t_7;
20812 npy_intp __pyx_t_8;
20814 Py_ssize_t __pyx_t_10;
20815 Py_ssize_t __pyx_t_11;
20816 Py_ssize_t __pyx_t_12;
20817 Py_ssize_t __pyx_t_13;
20819 Py_ssize_t __pyx_t_15;
20820 Py_ssize_t __pyx_t_16;
20821 Py_ssize_t __pyx_t_17;
20822 Py_ssize_t __pyx_t_18;
20823 Py_ssize_t __pyx_t_19;
20824 Py_ssize_t __pyx_t_20;
20825 Py_ssize_t __pyx_t_21;
20826 Py_ssize_t __pyx_t_22;
20827 Py_ssize_t __pyx_t_23;
20828 Py_ssize_t __pyx_t_24;
20829 Py_ssize_t __pyx_t_25;
20830 Py_ssize_t __pyx_t_26;
20831 int __pyx_lineno = 0;
20832 const char *__pyx_filename = NULL;
20833 int __pyx_clineno = 0;
20834 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4", 0);
20835 __pyx_pybuffer_x.pybuffer.buf = NULL;
20836 __pyx_pybuffer_x.refcount = 0;
20837 __pyx_pybuffernd_x.data = NULL;
20838 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20839 __pyx_pybuffer_v.pybuffer.buf = NULL;
20840 __pyx_pybuffer_v.refcount = 0;
20841 __pyx_pybuffernd_v.data = NULL;
20842 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20844 __Pyx_BufFmt_StackElem __pyx_stack[1];
20845 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20847 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
20849 __Pyx_BufFmt_StackElem __pyx_stack[1];
20850 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20852 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
20870 __pyx_v_one8 = (1.0 / 8.0);
20879 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20880 __pyx_t_2 = __pyx_t_1;
20881 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20882 __pyx_v_eN = __pyx_t_3;
20891 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20892 __pyx_t_5 = __pyx_t_4;
20893 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20894 __pyx_v_ebN = __pyx_t_6;
20903 __pyx_t_7 = (__pyx_v_x->dimensions[2]);
20904 __pyx_t_8 = __pyx_t_7;
20905 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
20906 __pyx_v_k = __pyx_t_9;
20915 __pyx_t_10 = __pyx_v_eN;
20916 __pyx_t_11 = __pyx_v_ebN;
20917 __pyx_t_12 = __pyx_v_k;
20920 if (__pyx_t_10 < 0) {
20921 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
20922 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 0;
20923 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20924 if (__pyx_t_11 < 0) {
20925 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[1].shape;
20926 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 1;
20927 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20928 if (__pyx_t_12 < 0) {
20929 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
20930 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 2;
20931 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20932 if (__pyx_t_13 < 0) {
20933 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[3].shape;
20934 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 3;
20935 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20936 if (unlikely(__pyx_t_14 != -1)) {
20937 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20938 __PYX_ERR(0, 934, __pyx_L1_error)
20940 __pyx_t_15 = __pyx_v_eN;
20941 __pyx_t_16 = __pyx_v_ebN;
20942 __pyx_t_17 = __pyx_v_k;
20945 if (__pyx_t_15 < 0) {
20946 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
20947 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
20948 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20949 if (__pyx_t_16 < 0) {
20950 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
20951 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
20952 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20953 if (__pyx_t_17 < 0) {
20954 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
20955 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 2;
20956 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20957 if (__pyx_t_18 < 0) {
20958 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[3].shape;
20959 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 3;
20960 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20961 if (unlikely(__pyx_t_14 != -1)) {
20962 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20963 __PYX_ERR(0, 934, __pyx_L1_error)
20965 __pyx_t_19 = __pyx_v_eN;
20966 __pyx_t_20 = __pyx_v_ebN;
20967 __pyx_t_21 = __pyx_v_k;
20970 if (__pyx_t_19 < 0) {
20971 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape;
20972 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0;
20973 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20974 if (__pyx_t_20 < 0) {
20975 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[1].shape;
20976 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 1;
20977 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20978 if (__pyx_t_21 < 0) {
20979 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[2].shape;
20980 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
20981 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20982 if (__pyx_t_22 < 0) {
20983 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[3].shape;
20984 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 3;
20985 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20986 if (unlikely(__pyx_t_14 != -1)) {
20987 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20988 __PYX_ERR(0, 934, __pyx_L1_error)
20990 __pyx_t_23 = __pyx_v_eN;
20991 __pyx_t_24 = __pyx_v_ebN;
20992 __pyx_t_25 = __pyx_v_k;
20995 if (__pyx_t_23 < 0) {
20996 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
20997 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
20998 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
20999 if (__pyx_t_24 < 0) {
21000 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[1].shape;
21001 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
21002 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21003 if (__pyx_t_25 < 0) {
21004 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[2].shape;
21005 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
21006 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21007 if (__pyx_t_26 < 0) {
21008 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[3].shape;
21009 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 3;
21010 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21011 if (unlikely(__pyx_t_14 != -1)) {
21012 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21013 __PYX_ERR(0, 934, __pyx_L1_error)
21015 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[3].strides)))));
21024 __pyx_t_22 = __pyx_v_eN;
21025 __pyx_t_21 = __pyx_v_ebN;
21026 __pyx_t_20 = __pyx_v_k;
21029 if (__pyx_t_22 < 0) {
21030 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[0].shape;
21031 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 0;
21032 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21033 if (__pyx_t_21 < 0) {
21034 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
21035 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 1;
21036 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21037 if (__pyx_t_20 < 0) {
21038 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[2].shape;
21039 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 2;
21040 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21041 if (__pyx_t_19 < 0) {
21042 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[3].shape;
21043 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 3;
21044 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21045 if (unlikely(__pyx_t_14 != -1)) {
21046 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21047 __PYX_ERR(0, 935, __pyx_L1_error)
21049 __pyx_t_18 = __pyx_v_eN;
21050 __pyx_t_17 = __pyx_v_ebN;
21051 __pyx_t_16 = __pyx_v_k;
21054 if (__pyx_t_18 < 0) {
21055 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[0].shape;
21056 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 0;
21057 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21058 if (__pyx_t_17 < 0) {
21059 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[1].shape;
21060 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 1;
21061 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21062 if (__pyx_t_16 < 0) {
21063 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
21064 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 2;
21065 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21066 if (__pyx_t_15 < 0) {
21067 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[3].shape;
21068 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 3;
21069 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21070 if (unlikely(__pyx_t_14 != -1)) {
21071 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21072 __PYX_ERR(0, 935, __pyx_L1_error)
21074 __pyx_t_13 = __pyx_v_eN;
21075 __pyx_t_12 = __pyx_v_ebN;
21076 __pyx_t_11 = __pyx_v_k;
21079 if (__pyx_t_13 < 0) {
21080 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
21081 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
21082 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21083 if (__pyx_t_12 < 0) {
21084 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
21085 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 1;
21086 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21087 if (__pyx_t_11 < 0) {
21088 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
21089 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
21090 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21091 if (__pyx_t_10 < 0) {
21092 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[3].shape;
21093 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 3;
21094 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21095 if (unlikely(__pyx_t_14 != -1)) {
21096 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21097 __PYX_ERR(0, 935, __pyx_L1_error)
21099 __pyx_t_26 = __pyx_v_eN;
21100 __pyx_t_25 = __pyx_v_ebN;
21101 __pyx_t_24 = __pyx_v_k;
21104 if (__pyx_t_26 < 0) {
21105 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[0].shape;
21106 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0;
21107 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
21108 if (__pyx_t_25 < 0) {
21109 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
21110 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 1;
21111 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21112 if (__pyx_t_24 < 0) {
21113 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[2].shape;
21114 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 2;
21115 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21116 if (__pyx_t_23 < 0) {
21117 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[3].shape;
21118 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 3;
21119 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21120 if (unlikely(__pyx_t_14 != -1)) {
21121 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21122 __PYX_ERR(0, 935, __pyx_L1_error)
21124 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[3].strides)))));
21138 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21141 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
21142 __Pyx_PyThreadState_declare
21143 __Pyx_PyThreadState_assign
21144 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
21145 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21146 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21147 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
21148 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21152 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21153 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21155 __Pyx_XGIVEREF(__pyx_r);
21156 __Pyx_RefNannyFinishContext();
21168 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
21169 PyObject *__pyx_r = NULL;
21170 __Pyx_RefNannyDeclarations
21171 PyObject *__pyx_t_1 = NULL;
21172 int __pyx_lineno = 0;
21173 const char *__pyx_filename = NULL;
21174 int __pyx_clineno = 0;
21175 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
21184 __Pyx_XDECREF(__pyx_r);
21185 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
21186 __Pyx_GOTREF(__pyx_t_1);
21187 __pyx_r = __pyx_t_1;
21201 __Pyx_XDECREF(__pyx_t_1);
21202 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
21205 __Pyx_XGIVEREF(__pyx_r);
21206 __Pyx_RefNannyFinishContext();
21218 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
21219 PyObject *__pyx_r = NULL;
21220 __Pyx_RefNannyDeclarations
21221 PyObject *__pyx_t_1 = NULL;
21222 int __pyx_lineno = 0;
21223 const char *__pyx_filename = NULL;
21224 int __pyx_clineno = 0;
21225 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
21234 __Pyx_XDECREF(__pyx_r);
21235 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
21236 __Pyx_GOTREF(__pyx_t_1);
21237 __pyx_r = __pyx_t_1;
21251 __Pyx_XDECREF(__pyx_t_1);
21252 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
21255 __Pyx_XGIVEREF(__pyx_r);
21256 __Pyx_RefNannyFinishContext();
21268 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
21269 PyObject *__pyx_r = NULL;
21270 __Pyx_RefNannyDeclarations
21271 PyObject *__pyx_t_1 = NULL;
21272 int __pyx_lineno = 0;
21273 const char *__pyx_filename = NULL;
21274 int __pyx_clineno = 0;
21275 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
21284 __Pyx_XDECREF(__pyx_r);
21285 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
21286 __Pyx_GOTREF(__pyx_t_1);
21287 __pyx_r = __pyx_t_1;
21301 __Pyx_XDECREF(__pyx_t_1);
21302 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
21305 __Pyx_XGIVEREF(__pyx_r);
21306 __Pyx_RefNannyFinishContext();
21318 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
21319 PyObject *__pyx_r = NULL;
21320 __Pyx_RefNannyDeclarations
21321 PyObject *__pyx_t_1 = NULL;
21322 int __pyx_lineno = 0;
21323 const char *__pyx_filename = NULL;
21324 int __pyx_clineno = 0;
21325 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
21334 __Pyx_XDECREF(__pyx_r);
21335 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
21336 __Pyx_GOTREF(__pyx_t_1);
21337 __pyx_r = __pyx_t_1;
21351 __Pyx_XDECREF(__pyx_t_1);
21352 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21355 __Pyx_XGIVEREF(__pyx_r);
21356 __Pyx_RefNannyFinishContext();
21368 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
21369 PyObject *__pyx_r = NULL;
21370 __Pyx_RefNannyDeclarations
21371 PyObject *__pyx_t_1 = NULL;
21372 int __pyx_lineno = 0;
21373 const char *__pyx_filename = NULL;
21374 int __pyx_clineno = 0;
21375 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
21384 __Pyx_XDECREF(__pyx_r);
21385 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
21386 __Pyx_GOTREF(__pyx_t_1);
21387 __pyx_r = __pyx_t_1;
21401 __Pyx_XDECREF(__pyx_t_1);
21402 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
21405 __Pyx_XGIVEREF(__pyx_r);
21406 __Pyx_RefNannyFinishContext();
21418 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
21419 PyObject *__pyx_r = NULL;
21420 __Pyx_RefNannyDeclarations
21422 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
21431 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
21441 __Pyx_XDECREF(__pyx_r);
21442 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
21443 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
21463 __Pyx_XDECREF(__pyx_r);
21464 __Pyx_INCREF(__pyx_empty_tuple);
21465 __pyx_r = __pyx_empty_tuple;
21479 __Pyx_XGIVEREF(__pyx_r);
21480 __Pyx_RefNannyFinishContext();
21492 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
21493 __Pyx_RefNannyDeclarations
21494 __Pyx_RefNannySetupContext(
"set_array_base", 0);
21503 Py_INCREF(__pyx_v_base);
21512 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
21523 __Pyx_RefNannyFinishContext();
21534 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
21535 PyObject *__pyx_v_base;
21536 PyObject *__pyx_r = NULL;
21537 __Pyx_RefNannyDeclarations
21539 __Pyx_RefNannySetupContext(
"get_array_base", 0);
21548 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
21557 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
21567 __Pyx_XDECREF(__pyx_r);
21568 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21587 __Pyx_XDECREF(__pyx_r);
21588 __Pyx_INCREF(((PyObject *)__pyx_v_base));
21589 __pyx_r = ((PyObject *)__pyx_v_base);
21602 __Pyx_XGIVEREF(__pyx_r);
21603 __Pyx_RefNannyFinishContext();
21615 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
21617 __Pyx_RefNannyDeclarations
21618 PyObject *__pyx_t_1 = NULL;
21619 PyObject *__pyx_t_2 = NULL;
21620 PyObject *__pyx_t_3 = NULL;
21622 PyObject *__pyx_t_5 = NULL;
21623 PyObject *__pyx_t_6 = NULL;
21624 PyObject *__pyx_t_7 = NULL;
21625 PyObject *__pyx_t_8 = NULL;
21626 int __pyx_lineno = 0;
21627 const char *__pyx_filename = NULL;
21628 int __pyx_clineno = 0;
21629 __Pyx_RefNannySetupContext(
"import_array", 0);
21639 __Pyx_PyThreadState_declare
21640 __Pyx_PyThreadState_assign
21641 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21642 __Pyx_XGOTREF(__pyx_t_1);
21643 __Pyx_XGOTREF(__pyx_t_2);
21644 __Pyx_XGOTREF(__pyx_t_3);
21654 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
21664 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21665 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21666 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21667 goto __pyx_L8_try_end;
21677 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21679 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21680 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
21681 __Pyx_GOTREF(__pyx_t_5);
21682 __Pyx_GOTREF(__pyx_t_6);
21683 __Pyx_GOTREF(__pyx_t_7);
21692 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
21693 __Pyx_GOTREF(__pyx_t_8);
21694 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21695 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21696 __PYX_ERR(1, 945, __pyx_L5_except_error)
21698 goto __pyx_L5_except_error;
21699 __pyx_L5_except_error:;
21708 __Pyx_XGIVEREF(__pyx_t_1);
21709 __Pyx_XGIVEREF(__pyx_t_2);
21710 __Pyx_XGIVEREF(__pyx_t_3);
21711 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21712 goto __pyx_L1_error;
21728 __Pyx_XDECREF(__pyx_t_5);
21729 __Pyx_XDECREF(__pyx_t_6);
21730 __Pyx_XDECREF(__pyx_t_7);
21731 __Pyx_XDECREF(__pyx_t_8);
21732 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21735 __Pyx_RefNannyFinishContext();
21747 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
21749 __Pyx_RefNannyDeclarations
21750 PyObject *__pyx_t_1 = NULL;
21751 PyObject *__pyx_t_2 = NULL;
21752 PyObject *__pyx_t_3 = NULL;
21754 PyObject *__pyx_t_5 = NULL;
21755 PyObject *__pyx_t_6 = NULL;
21756 PyObject *__pyx_t_7 = NULL;
21757 PyObject *__pyx_t_8 = NULL;
21758 int __pyx_lineno = 0;
21759 const char *__pyx_filename = NULL;
21760 int __pyx_clineno = 0;
21761 __Pyx_RefNannySetupContext(
"import_umath", 0);
21771 __Pyx_PyThreadState_declare
21772 __Pyx_PyThreadState_assign
21773 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21774 __Pyx_XGOTREF(__pyx_t_1);
21775 __Pyx_XGOTREF(__pyx_t_2);
21776 __Pyx_XGOTREF(__pyx_t_3);
21786 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
21796 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21797 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21798 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21799 goto __pyx_L8_try_end;
21809 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21811 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21812 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
21813 __Pyx_GOTREF(__pyx_t_5);
21814 __Pyx_GOTREF(__pyx_t_6);
21815 __Pyx_GOTREF(__pyx_t_7);
21824 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
21825 __Pyx_GOTREF(__pyx_t_8);
21826 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21827 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21828 __PYX_ERR(1, 951, __pyx_L5_except_error)
21830 goto __pyx_L5_except_error;
21831 __pyx_L5_except_error:;
21840 __Pyx_XGIVEREF(__pyx_t_1);
21841 __Pyx_XGIVEREF(__pyx_t_2);
21842 __Pyx_XGIVEREF(__pyx_t_3);
21843 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21844 goto __pyx_L1_error;
21860 __Pyx_XDECREF(__pyx_t_5);
21861 __Pyx_XDECREF(__pyx_t_6);
21862 __Pyx_XDECREF(__pyx_t_7);
21863 __Pyx_XDECREF(__pyx_t_8);
21864 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21867 __Pyx_RefNannyFinishContext();
21879 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
21881 __Pyx_RefNannyDeclarations
21882 PyObject *__pyx_t_1 = NULL;
21883 PyObject *__pyx_t_2 = NULL;
21884 PyObject *__pyx_t_3 = NULL;
21886 PyObject *__pyx_t_5 = NULL;
21887 PyObject *__pyx_t_6 = NULL;
21888 PyObject *__pyx_t_7 = NULL;
21889 PyObject *__pyx_t_8 = NULL;
21890 int __pyx_lineno = 0;
21891 const char *__pyx_filename = NULL;
21892 int __pyx_clineno = 0;
21893 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
21903 __Pyx_PyThreadState_declare
21904 __Pyx_PyThreadState_assign
21905 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21906 __Pyx_XGOTREF(__pyx_t_1);
21907 __Pyx_XGOTREF(__pyx_t_2);
21908 __Pyx_XGOTREF(__pyx_t_3);
21918 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
21928 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21929 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21930 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21931 goto __pyx_L8_try_end;
21941 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21943 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21944 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
21945 __Pyx_GOTREF(__pyx_t_5);
21946 __Pyx_GOTREF(__pyx_t_6);
21947 __Pyx_GOTREF(__pyx_t_7);
21956 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
21957 __Pyx_GOTREF(__pyx_t_8);
21958 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21959 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21960 __PYX_ERR(1, 957, __pyx_L5_except_error)
21962 goto __pyx_L5_except_error;
21963 __pyx_L5_except_error:;
21972 __Pyx_XGIVEREF(__pyx_t_1);
21973 __Pyx_XGIVEREF(__pyx_t_2);
21974 __Pyx_XGIVEREF(__pyx_t_3);
21975 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21976 goto __pyx_L1_error;
21992 __Pyx_XDECREF(__pyx_t_5);
21993 __Pyx_XDECREF(__pyx_t_6);
21994 __Pyx_XDECREF(__pyx_t_7);
21995 __Pyx_XDECREF(__pyx_t_8);
21996 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21999 __Pyx_RefNannyFinishContext();
22011 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
22013 __Pyx_RefNannyDeclarations
22014 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
22023 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
22036 __Pyx_RefNannyFinishContext();
22048 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
22050 __Pyx_RefNannyDeclarations
22051 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
22060 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
22073 __Pyx_RefNannyFinishContext();
22085 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
22086 npy_datetime __pyx_r;
22095 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
22119 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
22120 npy_timedelta __pyx_r;
22129 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
22153 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
22154 NPY_DATETIMEUNIT __pyx_r;
22161 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
22177 static PyMethodDef __pyx_methods[] = {
22181 #if PY_MAJOR_VERSION >= 3
22182 #if CYTHON_PEP489_MULTI_PHASE_INIT
22183 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22184 static int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject* module);
22185 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22186 {Py_mod_create, (
void*)__pyx_pymod_create},
22187 {Py_mod_exec, (
void*)__pyx_pymod_exec_subsurfaceTransportFunctions},
22192 static struct PyModuleDef __pyx_moduledef = {
22193 PyModuleDef_HEAD_INIT,
22194 "subsurfaceTransportFunctions",
22196 #if CYTHON_PEP489_MULTI_PHASE_INIT
22202 #if CYTHON_PEP489_MULTI_PHASE_INIT
22203 __pyx_moduledef_slots,
22212 #ifndef CYTHON_SMALL_CODE
22213 #if defined(__clang__)
22214 #define CYTHON_SMALL_CODE
22215 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22216 #define CYTHON_SMALL_CODE __attribute__((cold))
22218 #define CYTHON_SMALL_CODE
22222 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22223 {&__pyx_n_s_DKWr_DpsiC, __pyx_k_DKWr_DpsiC,
sizeof(__pyx_k_DKWr_DpsiC), 0, 0, 1, 1},
22224 {&__pyx_n_s_DsBar_DpsiC, __pyx_k_DsBar_DpsiC,
sizeof(__pyx_k_DsBar_DpsiC), 0, 0, 1, 1},
22225 {&__pyx_n_s_DthetaW_DpsiC, __pyx_k_DthetaW_DpsiC,
sizeof(__pyx_k_DthetaW_DpsiC), 0, 0, 1, 1},
22226 {&__pyx_n_s_DvBar_DpsiC, __pyx_k_DvBar_DpsiC,
sizeof(__pyx_k_DvBar_DpsiC), 0, 0, 1, 1},
22227 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
22228 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22229 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
22230 {&__pyx_n_s_KWr, __pyx_k_KWr,
sizeof(__pyx_k_KWr), 0, 0, 1, 1},
22231 {&__pyx_n_s_KWs, __pyx_k_KWs,
sizeof(__pyx_k_KWs), 0, 0, 1, 1},
22232 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_k_RE_NCP1_evaluateElementCoefficie,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie), 0, 0, 1, 1},
22233 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_k_RE_NCP1_evaluateElementCoefficie_2,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie_2), 0, 0, 1, 1},
22234 {&__pyx_n_s_RE_NCP1_getElementJacobian, __pyx_k_RE_NCP1_getElementJacobian,
sizeof(__pyx_k_RE_NCP1_getElementJacobian), 0, 0, 1, 1},
22235 {&__pyx_n_s_RE_NCP1_getElementResidual, __pyx_k_RE_NCP1_getElementResidual,
sizeof(__pyx_k_RE_NCP1_getElementResidual), 0, 0, 1, 1},
22236 {&__pyx_n_s_a_avg, __pyx_k_a_avg,
sizeof(__pyx_k_a_avg), 0, 0, 1, 1},
22237 {&__pyx_n_s_a_eN, __pyx_k_a_eN,
sizeof(__pyx_k_a_eN), 0, 0, 1, 1},
22238 {&__pyx_n_s_a_neig, __pyx_k_a_neig,
sizeof(__pyx_k_a_neig), 0, 0, 1, 1},
22239 {&__pyx_n_s_a_up, __pyx_k_a_up,
sizeof(__pyx_k_a_up), 0, 0, 1, 1},
22240 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
22241 {&__pyx_n_s_beta, __pyx_k_beta,
sizeof(__pyx_k_beta), 0, 0, 1, 1},
22242 {&__pyx_n_s_calculateNormalFlux, __pyx_k_calculateNormalFlux,
sizeof(__pyx_k_calculateNormalFlux), 0, 0, 1, 1},
22243 {&__pyx_n_s_characteristic_velocity, __pyx_k_characteristic_velocity,
sizeof(__pyx_k_characteristic_velocity), 0, 0, 1, 1},
22244 {&__pyx_n_s_characteristic_velocity_dofs, __pyx_k_characteristic_velocity_dofs,
sizeof(__pyx_k_characteristic_velocity_dofs), 0, 0, 1, 1},
22245 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22246 {&__pyx_n_s_clock, __pyx_k_clock,
sizeof(__pyx_k_clock), 0, 0, 1, 1},
22247 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
22248 {&__pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_k_computeSimpleCharacteristicVeloc,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc), 0, 0, 1, 1},
22249 {&__pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_k_computeSimpleCharacteristicVeloc_2,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc_2), 0, 0, 1, 1},
22250 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
22251 {&__pyx_n_s_dS, __pyx_k_dS,
sizeof(__pyx_k_dS), 0, 0, 1, 1},
22252 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
22253 {&__pyx_n_s_denom, __pyx_k_denom,
sizeof(__pyx_k_denom), 0, 0, 1, 1},
22254 {&__pyx_n_s_df, __pyx_k_df,
sizeof(__pyx_k_df), 0, 0, 1, 1},
22255 {&__pyx_n_s_df_dofs, __pyx_k_df_dofs,
sizeof(__pyx_k_df_dofs), 0, 0, 1, 1},
22256 {&__pyx_n_s_dkr_up, __pyx_k_dkr_up,
sizeof(__pyx_k_dkr_up), 0, 0, 1, 1},
22257 {&__pyx_n_s_dm, __pyx_k_dm,
sizeof(__pyx_k_dm), 0, 0, 1, 1},
22258 {&__pyx_n_s_dmt, __pyx_k_dmt,
sizeof(__pyx_k_dmt), 0, 0, 1, 1},
22259 {&__pyx_n_s_dmtj_avg, __pyx_k_dmtj_avg,
sizeof(__pyx_k_dmtj_avg), 0, 0, 1, 1},
22260 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
22261 {&__pyx_n_s_drhom, __pyx_k_drhom,
sizeof(__pyx_k_drhom), 0, 0, 1, 1},
22262 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
22263 {&__pyx_n_s_eN_left, __pyx_k_eN_left,
sizeof(__pyx_k_eN_left), 0, 0, 1, 1},
22264 {&__pyx_n_s_eN_neighbor, __pyx_k_eN_neighbor,
sizeof(__pyx_k_eN_neighbor), 0, 0, 1, 1},
22265 {&__pyx_n_s_eN_right, __pyx_k_eN_right,
sizeof(__pyx_k_eN_right), 0, 0, 1, 1},
22266 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
22267 {&__pyx_n_s_ebNE, __pyx_k_ebNE,
sizeof(__pyx_k_ebNE), 0, 0, 1, 1},
22268 {&__pyx_n_s_ebN_local, __pyx_k_ebN_local,
sizeof(__pyx_k_ebN_local), 0, 0, 1, 1},
22269 {&__pyx_n_s_ebq_global_vals, __pyx_k_ebq_global_vals,
sizeof(__pyx_k_ebq_global_vals), 0, 0, 1, 1},
22270 {&__pyx_n_s_ebq_vals, __pyx_k_ebq_vals,
sizeof(__pyx_k_ebq_vals), 0, 0, 1, 1},
22271 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
22272 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
22273 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
22274 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
22275 {&__pyx_n_s_elementBoundaryTypes, __pyx_k_elementBoundaryTypes,
sizeof(__pyx_k_elementBoundaryTypes), 0, 0, 1, 1},
22276 {&__pyx_n_s_elementJacobian, __pyx_k_elementJacobian,
sizeof(__pyx_k_elementJacobian), 0, 0, 1, 1},
22277 {&__pyx_n_s_elementMaterialTypes, __pyx_k_elementMaterialTypes,
sizeof(__pyx_k_elementMaterialTypes), 0, 0, 1, 1},
22278 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
22279 {&__pyx_n_s_elementResidual, __pyx_k_elementResidual,
sizeof(__pyx_k_elementResidual), 0, 0, 1, 1},
22280 {&__pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_k_evaluateScalarMaterialFunctionOv,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv), 0, 0, 1, 1},
22281 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_k_evaluateScalarMaterialFunctionOv_2,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_2), 0, 0, 1, 1},
22282 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_k_evaluateScalarMaterialFunctionOv_3,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_3), 0, 0, 1, 1},
22283 {&__pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_k_evaluateSparseTensorMaterialFunc,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc), 0, 0, 1, 1},
22284 {&__pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_k_evaluateSparseTensorMaterialFunc_2,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc_2), 0, 0, 1, 1},
22285 {&__pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_k_evaluateVectorMaterialFunctionOv,
sizeof(__pyx_k_evaluateVectorMaterialFunctionOv), 0, 0, 1, 1},
22286 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
22287 {&__pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_k_exteriorElementBoundaryMaterialT,
sizeof(__pyx_k_exteriorElementBoundaryMaterialT), 0, 0, 1, 1},
22288 {&__pyx_n_s_f_up, __pyx_k_f_up,
sizeof(__pyx_k_f_up), 0, 0, 1, 1},
22289 {&__pyx_n_s_flat, __pyx_k_flat,
sizeof(__pyx_k_flat), 0, 0, 1, 1},
22290 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
22291 {&__pyx_n_s_gravity, __pyx_k_gravity,
sizeof(__pyx_k_gravity), 0, 0, 1, 1},
22292 {&__pyx_n_s_helicalElementVelocityEval3, __pyx_k_helicalElementVelocityEval3,
sizeof(__pyx_k_helicalElementVelocityEval3), 0, 0, 1, 1},
22293 {&__pyx_n_s_helicalElementVelocityEval4, __pyx_k_helicalElementVelocityEval4,
sizeof(__pyx_k_helicalElementVelocityEval4), 0, 0, 1, 1},
22294 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
22295 {&__pyx_n_s_ii, __pyx_k_ii,
sizeof(__pyx_k_ii), 0, 0, 1, 1},
22296 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22297 {&__pyx_n_s_integral, __pyx_k_integral,
sizeof(__pyx_k_integral), 0, 0, 1, 1},
22298 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
22299 {&__pyx_n_s_jacobian_weak_residual, __pyx_k_jacobian_weak_residual,
sizeof(__pyx_k_jacobian_weak_residual), 0, 0, 1, 1},
22300 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
22301 {&__pyx_n_s_kb, __pyx_k_kb,
sizeof(__pyx_k_kb), 0, 0, 1, 1},
22302 {&__pyx_n_s_kr_eN, __pyx_k_kr_eN,
sizeof(__pyx_k_kr_eN), 0, 0, 1, 1},
22303 {&__pyx_n_s_kr_neig, __pyx_k_kr_neig,
sizeof(__pyx_k_kr_neig), 0, 0, 1, 1},
22304 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
22305 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
22306 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22307 {&__pyx_n_s_matID, __pyx_k_matID,
sizeof(__pyx_k_matID), 0, 0, 1, 1},
22308 {&__pyx_n_s_matID_neig, __pyx_k_matID_neig,
sizeof(__pyx_k_matID_neig), 0, 0, 1, 1},
22309 {&__pyx_n_s_material, __pyx_k_material,
sizeof(__pyx_k_material), 0, 0, 1, 1},
22310 {&__pyx_n_s_material_functions, __pyx_k_material_functions,
sizeof(__pyx_k_material_functions), 0, 0, 1, 1},
22311 {&__pyx_n_s_material_left, __pyx_k_material_left,
sizeof(__pyx_k_material_left), 0, 0, 1, 1},
22312 {&__pyx_n_s_material_right, __pyx_k_material_right,
sizeof(__pyx_k_material_right), 0, 0, 1, 1},
22313 {&__pyx_n_s_mt, __pyx_k_mt,
sizeof(__pyx_k_mt), 0, 0, 1, 1},
22314 {&__pyx_n_s_mt_avg, __pyx_k_mt_avg,
sizeof(__pyx_k_mt_avg), 0, 0, 1, 1},
22315 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
22316 {&__pyx_n_s_nAvgWeight, __pyx_k_nAvgWeight,
sizeof(__pyx_k_nAvgWeight), 0, 0, 1, 1},
22317 {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element,
sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
22318 {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element,
sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
22319 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
22320 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
22321 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
22322 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
22323 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22324 {&__pyx_n_s_nSpace2, __pyx_k_nSpace2,
sizeof(__pyx_k_nSpace2), 0, 0, 1, 1},
22325 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22326 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22327 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
22328 {&__pyx_n_s_numer, __pyx_k_numer,
sizeof(__pyx_k_numer), 0, 0, 1, 1},
22329 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22330 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22331 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22332 {&__pyx_n_s_omega_e, __pyx_k_omega_e,
sizeof(__pyx_k_omega_e), 0, 0, 1, 1},
22333 {&__pyx_n_s_one8, __pyx_k_one8,
sizeof(__pyx_k_one8), 0, 0, 1, 1},
22334 {&__pyx_n_s_onePlus_pcBar_n, __pyx_k_onePlus_pcBar_n,
sizeof(__pyx_k_onePlus_pcBar_n), 0, 0, 1, 1},
22335 {&__pyx_n_s_pcBar, __pyx_k_pcBar,
sizeof(__pyx_k_pcBar), 0, 0, 1, 1},
22336 {&__pyx_n_s_pcBar_n, __pyx_k_pcBar_n,
sizeof(__pyx_k_pcBar_n), 0, 0, 1, 1},
22337 {&__pyx_n_s_pcBar_nM1, __pyx_k_pcBar_nM1,
sizeof(__pyx_k_pcBar_nM1), 0, 0, 1, 1},
22338 {&__pyx_n_s_pcBar_nM2, __pyx_k_pcBar_nM2,
sizeof(__pyx_k_pcBar_nM2), 0, 0, 1, 1},
22339 {&__pyx_n_s_phi_eN, __pyx_k_phi_eN,
sizeof(__pyx_k_phi_eN), 0, 0, 1, 1},
22340 {&__pyx_n_s_phi_neig, __pyx_k_phi_neig,
sizeof(__pyx_k_phi_neig), 0, 0, 1, 1},
22341 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
22342 {&__pyx_n_s_picard, __pyx_k_picard,
sizeof(__pyx_k_picard), 0, 0, 1, 1},
22343 {&__pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_k_proteus_subsurfaceTransportFunct,
sizeof(__pyx_k_proteus_subsurfaceTransportFunct), 0, 0, 1, 0},
22344 {&__pyx_n_s_psiC, __pyx_k_psiC,
sizeof(__pyx_k_psiC), 0, 0, 1, 1},
22345 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
22346 {&__pyx_n_s_q_alin, __pyx_k_q_alin,
sizeof(__pyx_k_q_alin), 0, 0, 1, 1},
22347 {&__pyx_n_s_q_detJ, __pyx_k_q_detJ,
sizeof(__pyx_k_q_detJ), 0, 0, 1, 1},
22348 {&__pyx_n_s_q_dkr, __pyx_k_q_dkr,
sizeof(__pyx_k_q_dkr), 0, 0, 1, 1},
22349 {&__pyx_n_s_q_dm, __pyx_k_q_dm,
sizeof(__pyx_k_q_dm), 0, 0, 1, 1},
22350 {&__pyx_n_s_q_dmass, __pyx_k_q_dmass,
sizeof(__pyx_k_q_dmass), 0, 0, 1, 1},
22351 {&__pyx_n_s_q_dmt, __pyx_k_q_dmt,
sizeof(__pyx_k_q_dmt), 0, 0, 1, 1},
22352 {&__pyx_n_s_q_flin, __pyx_k_q_flin,
sizeof(__pyx_k_q_flin), 0, 0, 1, 1},
22353 {&__pyx_n_s_q_grad_u, __pyx_k_q_grad_u,
sizeof(__pyx_k_q_grad_u), 0, 0, 1, 1},
22354 {&__pyx_n_s_q_grad_v, __pyx_k_q_grad_v,
sizeof(__pyx_k_q_grad_v), 0, 0, 1, 1},
22355 {&__pyx_n_s_q_grad_w, __pyx_k_q_grad_w,
sizeof(__pyx_k_q_grad_w), 0, 0, 1, 1},
22356 {&__pyx_n_s_q_kr, __pyx_k_q_kr,
sizeof(__pyx_k_q_kr), 0, 0, 1, 1},
22357 {&__pyx_n_s_q_kr_up, __pyx_k_q_kr_up,
sizeof(__pyx_k_q_kr_up), 0, 0, 1, 1},
22358 {&__pyx_n_s_q_m, __pyx_k_q_m,
sizeof(__pyx_k_q_m), 0, 0, 1, 1},
22359 {&__pyx_n_s_q_mass, __pyx_k_q_mass,
sizeof(__pyx_k_q_mass), 0, 0, 1, 1},
22360 {&__pyx_n_s_q_mt, __pyx_k_q_mt,
sizeof(__pyx_k_q_mt), 0, 0, 1, 1},
22361 {&__pyx_n_s_q_r, __pyx_k_q_r,
sizeof(__pyx_k_q_r), 0, 0, 1, 1},
22362 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
22363 {&__pyx_n_s_q_vals, __pyx_k_q_vals,
sizeof(__pyx_k_q_vals), 0, 0, 1, 1},
22364 {&__pyx_n_s_q_x, __pyx_k_q_x,
sizeof(__pyx_k_q_x), 0, 0, 1, 1},
22365 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22366 {&__pyx_n_s_rho, __pyx_k_rho,
sizeof(__pyx_k_rho), 0, 0, 1, 1},
22367 {&__pyx_n_s_rho2, __pyx_k_rho2,
sizeof(__pyx_k_rho2), 0, 0, 1, 1},
22368 {&__pyx_n_s_rhom, __pyx_k_rhom,
sizeof(__pyx_k_rhom), 0, 0, 1, 1},
22369 {&__pyx_n_s_rotatingGaussianElementVelocityE, __pyx_k_rotatingGaussianElementVelocityE,
sizeof(__pyx_k_rotatingGaussianElementVelocityE), 0, 0, 1, 1},
22370 {&__pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_k_rotatingGaussianElementVelocityE_2,
sizeof(__pyx_k_rotatingGaussianElementVelocityE_2), 0, 0, 1, 1},
22371 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
22372 {&__pyx_n_s_sBar, __pyx_k_sBar,
sizeof(__pyx_k_sBar), 0, 0, 1, 1},
22373 {&__pyx_n_s_setElementBoundariesArray, __pyx_k_setElementBoundariesArray,
sizeof(__pyx_k_setElementBoundariesArray), 0, 0, 1, 1},
22374 {&__pyx_n_s_setExteriorElementBoundaryTypes, __pyx_k_setExteriorElementBoundaryTypes,
sizeof(__pyx_k_setExteriorElementBoundaryTypes), 0, 0, 1, 1},
22375 {&__pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_k_setScalarMaterialFunctionOverEle,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle), 0, 0, 1, 1},
22376 {&__pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_k_setScalarMaterialFunctionOverEle_2,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle_2), 0, 0, 1, 1},
22377 {&__pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_k_setScalarMaterialFunctionOverGlo,
sizeof(__pyx_k_setScalarMaterialFunctionOverGlo), 0, 0, 1, 1},
22378 {&__pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_k_setSparseTensorMaterialFunctionO,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO), 0, 0, 1, 1},
22379 {&__pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_k_setSparseTensorMaterialFunctionO_2,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO_2), 0, 0, 1, 1},
22380 {&__pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_k_setVectorMaterialFunctionOverEle,
sizeof(__pyx_k_setVectorMaterialFunctionOverEle), 0, 0, 1, 1},
22381 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22382 {&__pyx_n_s_sqrt_sBar, __pyx_k_sqrt_sBar,
sizeof(__pyx_k_sqrt_sBar), 0, 0, 1, 1},
22383 {&__pyx_n_s_subsurfaceTransportFunctions, __pyx_k_subsurfaceTransportFunctions,
sizeof(__pyx_k_subsurfaceTransportFunctions), 0, 0, 1, 1},
22384 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
22385 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22386 {&__pyx_n_s_tForReversal, __pyx_k_tForReversal,
sizeof(__pyx_k_tForReversal), 0, 0, 1, 1},
22387 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22388 {&__pyx_n_s_thetaR, __pyx_k_thetaR,
sizeof(__pyx_k_thetaR), 0, 0, 1, 1},
22389 {&__pyx_n_s_thetaS, __pyx_k_thetaS,
sizeof(__pyx_k_thetaS), 0, 0, 1, 1},
22390 {&__pyx_n_s_thetaSR, __pyx_k_thetaSR,
sizeof(__pyx_k_thetaSR), 0, 0, 1, 1},
22391 {&__pyx_n_s_thetaW, __pyx_k_thetaW,
sizeof(__pyx_k_thetaW), 0, 0, 1, 1},
22392 {&__pyx_n_s_thisElementIsUpwind, __pyx_k_thisElementIsUpwind,
sizeof(__pyx_k_thisElementIsUpwind), 0, 0, 1, 1},
22393 {&__pyx_n_s_transient, __pyx_k_transient,
sizeof(__pyx_k_transient), 0, 0, 1, 1},
22394 {&__pyx_n_s_u_dof, __pyx_k_u_dof,
sizeof(__pyx_k_u_dof), 0, 0, 1, 1},
22395 {&__pyx_n_s_u_eN, __pyx_k_u_eN,
sizeof(__pyx_k_u_eN), 0, 0, 1, 1},
22396 {&__pyx_n_s_u_j, __pyx_k_u_j,
sizeof(__pyx_k_u_j), 0, 0, 1, 1},
22397 {&__pyx_n_s_u_l2g, __pyx_k_u_l2g,
sizeof(__pyx_k_u_l2g), 0, 0, 1, 1},
22398 {&__pyx_n_s_u_neig, __pyx_k_u_neig,
sizeof(__pyx_k_u_neig), 0, 0, 1, 1},
22399 {&__pyx_n_s_updateMassJacobian_weakAvg, __pyx_k_updateMassJacobian_weakAvg,
sizeof(__pyx_k_updateMassJacobian_weakAvg), 0, 0, 1, 1},
22400 {&__pyx_n_s_updateMass_weakAvg, __pyx_k_updateMass_weakAvg,
sizeof(__pyx_k_updateMass_weakAvg), 0, 0, 1, 1},
22401 {&__pyx_n_s_upwindFlag, __pyx_k_upwindFlag,
sizeof(__pyx_k_upwindFlag), 0, 0, 1, 1},
22402 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
22403 {&__pyx_n_s_vBar, __pyx_k_vBar,
sizeof(__pyx_k_vBar), 0, 0, 1, 1},
22404 {&__pyx_n_s_vBar2, __pyx_k_vBar2,
sizeof(__pyx_k_vBar2), 0, 0, 1, 1},
22405 {&__pyx_n_s_vol, __pyx_k_vol,
sizeof(__pyx_k_vol), 0, 0, 1, 1},
22406 {&__pyx_n_s_volFactor, __pyx_k_volFactor,
sizeof(__pyx_k_volFactor), 0, 0, 1, 1},
22407 {&__pyx_n_s_vol_e, __pyx_k_vol_e,
sizeof(__pyx_k_vol_e), 0, 0, 1, 1},
22408 {&__pyx_n_s_volume, __pyx_k_volume,
sizeof(__pyx_k_volume), 0, 0, 1, 1},
22409 {&__pyx_n_s_vortexElementVelocityEval3, __pyx_k_vortexElementVelocityEval3,
sizeof(__pyx_k_vortexElementVelocityEval3), 0, 0, 1, 1},
22410 {&__pyx_n_s_vortexElementVelocityEval4, __pyx_k_vortexElementVelocityEval4,
sizeof(__pyx_k_vortexElementVelocityEval4), 0, 0, 1, 1},
22411 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
22412 {&__pyx_n_s_weak_residual, __pyx_k_weak_residual,
sizeof(__pyx_k_weak_residual), 0, 0, 1, 1},
22413 {&__pyx_n_s_weight, __pyx_k_weight,
sizeof(__pyx_k_weight), 0, 0, 1, 1},
22414 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22415 {&__pyx_n_s_xc, __pyx_k_xc,
sizeof(__pyx_k_xc), 0, 0, 1, 1},
22416 {&__pyx_n_s_yc, __pyx_k_yc,
sizeof(__pyx_k_yc), 0, 0, 1, 1},
22417 {&__pyx_n_s_zVelocity, __pyx_k_zVelocity,
sizeof(__pyx_k_zVelocity), 0, 0, 1, 1},
22418 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22419 {&__pyx_n_s_zvelocity, __pyx_k_zvelocity,
sizeof(__pyx_k_zvelocity), 0, 0, 1, 1},
22420 {0, 0, 0, 0, 0, 0, 0}
22422 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22423 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 24, __pyx_L1_error)
22424 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
22430 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22431 __Pyx_RefNannyDeclarations
22432 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22441 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 66, __pyx_L1_error)
22442 __Pyx_GOTREF(__pyx_slice_);
22443 __Pyx_GIVEREF(__pyx_slice_);
22452 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 945, __pyx_L1_error)
22453 __Pyx_GOTREF(__pyx_tuple__2);
22454 __Pyx_GIVEREF(__pyx_tuple__2);
22463 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 951, __pyx_L1_error)
22464 __Pyx_GOTREF(__pyx_tuple__3);
22465 __Pyx_GIVEREF(__pyx_tuple__3);
22474 __pyx_tuple__4 = PyTuple_Pack(8, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_exteriorElementBoundariesArray, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_n_s_ebNE, __pyx_n_s_ebN, __pyx_n_s_eN);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 18, __pyx_L1_error)
22475 __Pyx_GOTREF(__pyx_tuple__4);
22476 __Pyx_GIVEREF(__pyx_tuple__4);
22477 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setExteriorElementBoundaryTypes, 18, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 18, __pyx_L1_error)
22486 __pyx_tuple__6 = PyTuple_Pack(7, __pyx_n_s_nElementBoundaries_global, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_n_s_ebN, __pyx_n_s_eN_left, __pyx_n_s_eN_right);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 29, __pyx_L1_error)
22487 __Pyx_GOTREF(__pyx_tuple__6);
22488 __Pyx_GIVEREF(__pyx_tuple__6);
22489 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setElementBoundariesArray, 29, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 29, __pyx_L1_error)
22498 __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 43, __pyx_L1_error)
22499 __Pyx_GOTREF(__pyx_tuple__8);
22500 __Pyx_GIVEREF(__pyx_tuple__8);
22501 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle, 43, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 43, __pyx_L1_error)
22510 __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 56, __pyx_L1_error)
22511 __Pyx_GOTREF(__pyx_tuple__10);
22512 __Pyx_GIVEREF(__pyx_tuple__10);
22513 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setVectorMaterialFunctionOverEle, 56, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 56, __pyx_L1_error)
22522 __pyx_tuple__12 = PyTuple_Pack(10, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 69, __pyx_L1_error)
22523 __Pyx_GOTREF(__pyx_tuple__12);
22524 __Pyx_GIVEREF(__pyx_tuple__12);
22525 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle_2, 69, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 69, __pyx_L1_error)
22534 __pyx_tuple__14 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 91, __pyx_L1_error)
22535 __Pyx_GOTREF(__pyx_tuple__14);
22536 __Pyx_GIVEREF(__pyx_tuple__14);
22537 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO, 91, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 91, __pyx_L1_error)
22546 __pyx_tuple__16 = PyTuple_Pack(8, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 118, __pyx_L1_error)
22547 __Pyx_GOTREF(__pyx_tuple__16);
22548 __Pyx_GIVEREF(__pyx_tuple__16);
22549 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverGlo, 118, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 118, __pyx_L1_error)
22558 __pyx_tuple__18 = PyTuple_Pack(13, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 139, __pyx_L1_error)
22559 __Pyx_GOTREF(__pyx_tuple__18);
22560 __Pyx_GIVEREF(__pyx_tuple__18);
22561 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO_2, 139, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 139, __pyx_L1_error)
22570 __pyx_tuple__20 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 165, __pyx_L1_error)
22571 __Pyx_GOTREF(__pyx_tuple__20);
22572 __Pyx_GIVEREF(__pyx_tuple__20);
22573 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 165, __pyx_L1_error)
22582 __pyx_tuple__22 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 180, __pyx_L1_error)
22583 __Pyx_GOTREF(__pyx_tuple__22);
22584 __Pyx_GIVEREF(__pyx_tuple__22);
22585 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateVectorMaterialFunctionOv, 180, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 180, __pyx_L1_error)
22594 __pyx_tuple__24 = PyTuple_Pack(12, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 195, __pyx_L1_error)
22595 __Pyx_GOTREF(__pyx_tuple__24);
22596 __Pyx_GIVEREF(__pyx_tuple__24);
22597 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, 195, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 195, __pyx_L1_error)
22606 __pyx_tuple__26 = PyTuple_Pack(17, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 219, __pyx_L1_error)
22607 __Pyx_GOTREF(__pyx_tuple__26);
22608 __Pyx_GIVEREF(__pyx_tuple__26);
22609 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 219, __pyx_L1_error)
22618 __pyx_tuple__28 = PyTuple_Pack(10, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 248, __pyx_L1_error)
22619 __Pyx_GOTREF(__pyx_tuple__28);
22620 __Pyx_GIVEREF(__pyx_tuple__28);
22621 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, 248, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 248, __pyx_L1_error)
22630 __pyx_tuple__30 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 271, __pyx_L1_error)
22631 __Pyx_GOTREF(__pyx_tuple__30);
22632 __Pyx_GIVEREF(__pyx_tuple__30);
22633 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, 271, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 271, __pyx_L1_error)
22642 __pyx_tuple__32 = PyTuple_Pack(24, __pyx_n_s_rho, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_KWs, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_ebN, __pyx_n_s_matID, __pyx_n_s_matID_neig, __pyx_n_s_nSpace2, __pyx_n_s_nnz, __pyx_n_s_a_eN, __pyx_n_s_a_neig, __pyx_n_s_a_avg);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 301, __pyx_L1_error)
22643 __Pyx_GOTREF(__pyx_tuple__32);
22644 __Pyx_GIVEREF(__pyx_tuple__32);
22645 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(12, 0, 24, 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_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, 301, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 301, __pyx_L1_error)
22654 __pyx_tuple__34 = PyTuple_Pack(61, __pyx_n_s_rho, __pyx_n_s_beta, __pyx_n_s_gravity, __pyx_n_s_alpha, __pyx_n_s_n, __pyx_n_s_thetaR, __pyx_n_s_thetaSR, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_nDOF_trial_element, __pyx_n_s_u_l2g, __pyx_n_s_u_dof, __pyx_n_s_q_x, __pyx_n_s_q_u, __pyx_n_s_q_mass, __pyx_n_s_q_dmass, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q, __pyx_n_s_psiC, __pyx_n_s_pcBar, __pyx_n_s_pcBar_n, __pyx_n_s_pcBar_nM1, __pyx_n_s_pcBar_nM2, __pyx_n_s_onePlus_pcBar_n, __pyx_n_s_sBar, __pyx_n_s_sqrt_sBar, __pyx_n_s_DsBar_DpsiC, __pyx_n_s_thetaW, __pyx_n_s_DthetaW_DpsiC, __pyx_n_s_vBar, __pyx_n_s_vBar2, __pyx_n_s_DvBar_DpsiC, __pyx_n_s_KWr, __pyx_n_s_DKWr_DpsiC, __pyx_n_s_rho2, __pyx_n_s_thetaS, __pyx_n_s_rhom, __pyx_n_s_drhom, __pyx_n_s_m, __pyx_n_s_u_j, __pyx_n_s_u_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_eN, __pyx_n_s_kr_neig, __pyx_n_s_phi_eN, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ebN, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_j, __pyx_n_s_matID, __pyx_n_s_nAvgWeight);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 359, __pyx_L1_error)
22655 __Pyx_GOTREF(__pyx_tuple__34);
22656 __Pyx_GIVEREF(__pyx_tuple__34);
22657 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(24, 0, 61, 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_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 359, __pyx_L1_error)
22666 __pyx_tuple__36 = PyTuple_Pack(42, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_mt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementResidual, __pyx_n_s_upwindFlag, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_volume);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 486, __pyx_L1_error)
22667 __Pyx_GOTREF(__pyx_tuple__36);
22668 __Pyx_GIVEREF(__pyx_tuple__36);
22669 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(21, 0, 42, 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_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementResidual, 486, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 486, __pyx_L1_error)
22678 __pyx_tuple__38 = PyTuple_Pack(51, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_nDOF_trial_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_grad_v, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_dm, __pyx_n_s_q_mt, __pyx_n_s_q_dmt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementJacobian, __pyx_n_s_upwindFlag, __pyx_n_s_picard, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_dkr_up, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_thisElementIsUpwind, __pyx_n_s_volume, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 574, __pyx_L1_error)
22679 __Pyx_GOTREF(__pyx_tuple__38);
22680 __Pyx_GIVEREF(__pyx_tuple__38);
22681 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(26, 0, 51, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementJacobian, 574, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 574, __pyx_L1_error)
22690 __pyx_tuple__40 = PyTuple_Pack(9, __pyx_n_s_mt, __pyx_n_s_w, __pyx_n_s_dV, __pyx_n_s_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_mt_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 673, __pyx_L1_error)
22691 __Pyx_GOTREF(__pyx_tuple__40);
22692 __Pyx_GIVEREF(__pyx_tuple__40);
22693 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMass_weakAvg, 673, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 673, __pyx_L1_error)
22702 __pyx_tuple__42 = PyTuple_Pack(11, __pyx_n_s_dmt, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_dV, __pyx_n_s_jacobian_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dmtj_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 692, __pyx_L1_error)
22703 __Pyx_GOTREF(__pyx_tuple__42);
22704 __Pyx_GIVEREF(__pyx_tuple__42);
22705 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMassJacobian_weakAvg, 692, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 692, __pyx_L1_error)
22714 __pyx_tuple__44 = PyTuple_Pack(9, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_dS, __pyx_n_s_flux, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_kb, __pyx_n_s_integral, __pyx_n_s_I);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 717, __pyx_L1_error)
22715 __Pyx_GOTREF(__pyx_tuple__44);
22716 __Pyx_GIVEREF(__pyx_tuple__44);
22717 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_calculateNormalFlux, 717, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 717, __pyx_L1_error)
22726 __pyx_tuple__46 = PyTuple_Pack(9, __pyx_n_s_df, __pyx_n_s_characteristic_velocity, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_I, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 732, __pyx_L1_error)
22727 __Pyx_GOTREF(__pyx_tuple__46);
22728 __Pyx_GIVEREF(__pyx_tuple__46);
22729 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc, 732, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 732, __pyx_L1_error)
22738 __pyx_tuple__48 = PyTuple_Pack(11, __pyx_n_s_df_dofs, __pyx_n_s_characteristic_velocity_dofs, __pyx_n_s_l2g, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_J, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 753, __pyx_L1_error)
22739 __Pyx_GOTREF(__pyx_tuple__48);
22740 __Pyx_GIVEREF(__pyx_tuple__48);
22741 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc_2, 753, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 753, __pyx_L1_error)
22750 __pyx_tuple__50 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 776, __pyx_L1_error)
22751 __Pyx_GOTREF(__pyx_tuple__50);
22752 __Pyx_GIVEREF(__pyx_tuple__50);
22753 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE, 776, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 776, __pyx_L1_error)
22762 __pyx_tuple__52 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 816, __pyx_L1_error)
22763 __Pyx_GOTREF(__pyx_tuple__52);
22764 __Pyx_GIVEREF(__pyx_tuple__52);
22765 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE_2, 816, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 816, __pyx_L1_error)
22774 __pyx_tuple__54 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 859, __pyx_L1_error)
22775 __Pyx_GOTREF(__pyx_tuple__54);
22776 __Pyx_GIVEREF(__pyx_tuple__54);
22777 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval3, 859, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 859, __pyx_L1_error)
22786 __pyx_tuple__56 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 884, __pyx_L1_error)
22787 __Pyx_GOTREF(__pyx_tuple__56);
22788 __Pyx_GIVEREF(__pyx_tuple__56);
22789 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval4, 884, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 884, __pyx_L1_error)
22798 __pyx_tuple__58 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 911, __pyx_L1_error)
22799 __Pyx_GOTREF(__pyx_tuple__58);
22800 __Pyx_GIVEREF(__pyx_tuple__58);
22801 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval3, 911, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 911, __pyx_L1_error)
22810 __pyx_tuple__60 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_ebN, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 924, __pyx_L1_error)
22811 __Pyx_GOTREF(__pyx_tuple__60);
22812 __Pyx_GIVEREF(__pyx_tuple__60);
22813 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval4, 924, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 924, __pyx_L1_error)
22814 __Pyx_RefNannyFinishContext();
22817 __Pyx_RefNannyFinishContext();
22821 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
22822 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22823 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22824 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
22825 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22826 __pyx_float_1_0eneg_20 = PyFloat_FromDouble(1.0e-20);
if (unlikely(!__pyx_float_1_0eneg_20)) __PYX_ERR(0, 1, __pyx_L1_error)
22832 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
22833 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
22834 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
22835 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
22836 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
22837 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
22838 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
22840 static int __Pyx_modinit_global_init_code(
void) {
22841 __Pyx_RefNannyDeclarations
22842 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22844 __Pyx_RefNannyFinishContext();
22848 static int __Pyx_modinit_variable_export_code(
void) {
22849 __Pyx_RefNannyDeclarations
22850 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22852 __Pyx_RefNannyFinishContext();
22856 static int __Pyx_modinit_function_export_code(
void) {
22857 __Pyx_RefNannyDeclarations
22858 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22860 __Pyx_RefNannyFinishContext();
22864 static int __Pyx_modinit_type_init_code(
void) {
22865 __Pyx_RefNannyDeclarations
22866 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22868 __Pyx_RefNannyFinishContext();
22872 static int __Pyx_modinit_type_import_code(
void) {
22873 __Pyx_RefNannyDeclarations
22874 PyObject *__pyx_t_1 = NULL;
22875 int __pyx_lineno = 0;
22876 const char *__pyx_filename = NULL;
22877 int __pyx_clineno = 0;
22878 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22880 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
22881 __Pyx_GOTREF(__pyx_t_1);
22882 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
22883 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22884 sizeof(PyTypeObject),
22886 sizeof(PyHeapTypeObject),
22888 __Pyx_ImportType_CheckSize_Warn);
22889 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
22890 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22891 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
22892 __Pyx_GOTREF(__pyx_t_1);
22893 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
22894 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
22895 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
22896 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
22897 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
22898 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
22899 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
22900 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
22901 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22902 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
22903 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22904 if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
22905 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22906 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
22907 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22908 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
22909 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22910 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
22911 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22912 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
22913 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22914 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
22915 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22916 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
22917 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22918 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
22919 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22920 if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
22921 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
22922 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
22923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22924 __Pyx_RefNannyFinishContext();
22927 __Pyx_XDECREF(__pyx_t_1);
22928 __Pyx_RefNannyFinishContext();
22932 static int __Pyx_modinit_variable_import_code(
void) {
22933 __Pyx_RefNannyDeclarations
22934 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22936 __Pyx_RefNannyFinishContext();
22940 static int __Pyx_modinit_function_import_code(
void) {
22941 __Pyx_RefNannyDeclarations
22942 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22944 __Pyx_RefNannyFinishContext();
22949 #ifndef CYTHON_NO_PYINIT_EXPORT
22950 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22951 #elif PY_MAJOR_VERSION < 3
22953 #define __Pyx_PyMODINIT_FUNC extern "C" void
22955 #define __Pyx_PyMODINIT_FUNC void
22959 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22961 #define __Pyx_PyMODINIT_FUNC PyObject *
22966 #if PY_MAJOR_VERSION < 3
22967 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
22968 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void)
22970 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
22971 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void)
22972 #if CYTHON_PEP489_MULTI_PHASE_INIT
22974 return PyModuleDef_Init(&__pyx_moduledef);
22976 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22977 #if PY_VERSION_HEX >= 0x030700A1
22978 static PY_INT64_T main_interpreter_id = -1;
22979 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22980 if (main_interpreter_id == -1) {
22981 main_interpreter_id = current_id;
22982 return (unlikely(current_id == -1)) ? -1 : 0;
22983 }
else if (unlikely(main_interpreter_id != current_id))
22985 static PyInterpreterState *main_interpreter = NULL;
22986 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22987 if (!main_interpreter) {
22988 main_interpreter = current_interpreter;
22989 }
else if (unlikely(main_interpreter != current_interpreter))
22994 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22999 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
23000 PyObject *value = PyObject_GetAttrString(spec, from_name);
23002 if (likely(value)) {
23003 if (allow_none || value != Py_None) {
23004 result = PyDict_SetItemString(moddict, to_name, value);
23007 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23014 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23015 PyObject *module = NULL, *moddict, *modname;
23016 if (__Pyx_check_single_interpreter())
23019 return __Pyx_NewRef(__pyx_m);
23020 modname = PyObject_GetAttrString(spec,
"name");
23021 if (unlikely(!modname))
goto bad;
23022 module = PyModule_NewObject(modname);
23023 Py_DECREF(modname);
23024 if (unlikely(!module))
goto bad;
23025 moddict = PyModule_GetDict(module);
23026 if (unlikely(!moddict))
goto bad;
23027 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
23028 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
23029 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
23030 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
23033 Py_XDECREF(module);
23038 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject *__pyx_pyinit_module)
23042 PyObject *__pyx_t_1 = NULL;
23043 int __pyx_lineno = 0;
23044 const char *__pyx_filename = NULL;
23045 int __pyx_clineno = 0;
23046 __Pyx_RefNannyDeclarations
23047 #if CYTHON_PEP489_MULTI_PHASE_INIT
23049 if (__pyx_m == __pyx_pyinit_module)
return 0;
23050 PyErr_SetString(PyExc_RuntimeError,
"Module 'subsurfaceTransportFunctions' has already been imported. Re-initialisation is not supported.");
23053 #elif PY_MAJOR_VERSION >= 3
23054 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23056 #if CYTHON_REFNANNY
23057 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23058 if (!__Pyx_RefNanny) {
23060 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23061 if (!__Pyx_RefNanny)
23062 Py_FatalError(
"failed to import 'refnanny' module");
23065 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)", 0);
23066 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23067 #ifdef __Pxy_PyFrame_Initialize_Offsets
23068 __Pxy_PyFrame_Initialize_Offsets();
23070 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23071 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23072 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23073 #ifdef __Pyx_CyFunction_USED
23074 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23076 #ifdef __Pyx_FusedFunction_USED
23077 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23079 #ifdef __Pyx_Coroutine_USED
23080 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23082 #ifdef __Pyx_Generator_USED
23083 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23085 #ifdef __Pyx_AsyncGen_USED
23086 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23088 #ifdef __Pyx_StopAsyncIteration_USED
23089 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23093 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23094 PyEval_InitThreads();
23097 #if CYTHON_PEP489_MULTI_PHASE_INIT
23098 __pyx_m = __pyx_pyinit_module;
23099 Py_INCREF(__pyx_m);
23101 #if PY_MAJOR_VERSION < 3
23102 __pyx_m = Py_InitModule4(
"subsurfaceTransportFunctions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23104 __pyx_m = PyModule_Create(&__pyx_moduledef);
23106 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23108 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23109 Py_INCREF(__pyx_d);
23110 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23111 Py_INCREF(__pyx_b);
23112 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23113 Py_INCREF(__pyx_cython_runtime);
23114 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23116 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23117 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23118 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23120 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
23121 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23123 #if PY_MAJOR_VERSION >= 3
23125 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23126 if (!PyDict_GetItemString(modules,
"subsurfaceTransportFunctions")) {
23127 if (unlikely(PyDict_SetItemString(modules,
"subsurfaceTransportFunctions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23132 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23134 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23136 (void)__Pyx_modinit_global_init_code();
23137 (void)__Pyx_modinit_variable_export_code();
23138 (void)__Pyx_modinit_function_export_code();
23139 (void)__Pyx_modinit_type_init_code();
23140 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23141 (void)__Pyx_modinit_variable_import_code();
23142 (void)__Pyx_modinit_function_import_code();
23144 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23145 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23153 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23154 __Pyx_GOTREF(__pyx_t_1);
23155 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23165 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
23166 __Pyx_GOTREF(__pyx_t_1);
23167 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setExteriorElementBoundaryTypes, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
23168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23177 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
23178 __Pyx_GOTREF(__pyx_t_1);
23179 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
23180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23189 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
23190 __Pyx_GOTREF(__pyx_t_1);
23191 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
23192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23201 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
23202 __Pyx_GOTREF(__pyx_t_1);
23203 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
23204 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23213 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
23214 __Pyx_GOTREF(__pyx_t_1);
23215 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
23216 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23225 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
23226 __Pyx_GOTREF(__pyx_t_1);
23227 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
23228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23237 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
23238 __Pyx_GOTREF(__pyx_t_1);
23239 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
23240 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23249 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
23250 __Pyx_GOTREF(__pyx_t_1);
23251 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
23252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23261 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23262 __Pyx_GOTREF(__pyx_t_1);
23263 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23273 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
23274 __Pyx_GOTREF(__pyx_t_1);
23275 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
23276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23285 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
23286 __Pyx_GOTREF(__pyx_t_1);
23287 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
23288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23297 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
23298 __Pyx_GOTREF(__pyx_t_1);
23299 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
23300 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23309 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
23310 __Pyx_GOTREF(__pyx_t_1);
23311 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_t_1) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
23312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23321 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
23322 __Pyx_GOTREF(__pyx_t_1);
23323 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
23324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23333 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
23334 __Pyx_GOTREF(__pyx_t_1);
23335 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
23336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23345 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
23346 __Pyx_GOTREF(__pyx_t_1);
23347 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_1) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
23348 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23357 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
23358 __Pyx_GOTREF(__pyx_t_1);
23359 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementResidual, __pyx_t_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
23360 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23369 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
23370 __Pyx_GOTREF(__pyx_t_1);
23371 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementJacobian, __pyx_t_1) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
23372 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23381 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
23382 __Pyx_GOTREF(__pyx_t_1);
23383 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMass_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
23384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23393 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
23394 __Pyx_GOTREF(__pyx_t_1);
23395 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMassJacobian_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
23396 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23405 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
23406 __Pyx_GOTREF(__pyx_t_1);
23407 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateNormalFlux, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
23408 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23417 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
23418 __Pyx_GOTREF(__pyx_t_1);
23419 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_t_1) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
23420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23429 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
23430 __Pyx_GOTREF(__pyx_t_1);
23431 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
23432 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23441 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
23442 __Pyx_GOTREF(__pyx_t_1);
23443 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE, __pyx_t_1) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
23444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23453 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
23454 __Pyx_GOTREF(__pyx_t_1);
23455 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_t_1) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
23456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23465 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
23466 __Pyx_GOTREF(__pyx_t_1);
23467 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
23468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23477 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
23478 __Pyx_GOTREF(__pyx_t_1);
23479 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
23480 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23489 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
23490 __Pyx_GOTREF(__pyx_t_1);
23491 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
23492 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23501 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
23502 __Pyx_GOTREF(__pyx_t_1);
23503 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
23504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23511 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23512 __Pyx_GOTREF(__pyx_t_1);
23513 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23528 __Pyx_XDECREF(__pyx_t_1);
23531 __Pyx_AddTraceback(
"init subsurfaceTransportFunctions", __pyx_clineno, __pyx_lineno, __pyx_filename);
23534 }
else if (!PyErr_Occurred()) {
23535 PyErr_SetString(PyExc_ImportError,
"init subsurfaceTransportFunctions");
23538 __Pyx_RefNannyFinishContext();
23539 #if CYTHON_PEP489_MULTI_PHASE_INIT
23540 return (__pyx_m != NULL) ? 0 : -1;
23541 #elif PY_MAJOR_VERSION >= 3
23550 #if CYTHON_REFNANNY
23551 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23552 PyObject *m = NULL, *p = NULL;
23554 m = PyImport_ImportModule(modname);
23556 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23558 r = PyLong_AsVoidPtr(p);
23562 return (__Pyx_RefNannyAPIStruct *)
r;
23567 #if CYTHON_USE_TYPE_SLOTS
23568 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23569 PyTypeObject* tp = Py_TYPE(obj);
23570 if (likely(tp->tp_getattro))
23571 return tp->tp_getattro(obj, attr_name);
23572 #if PY_MAJOR_VERSION < 3
23573 if (likely(tp->tp_getattr))
23574 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23576 return PyObject_GetAttr(obj, attr_name);
23581 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23582 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23583 if (unlikely(!result)) {
23584 PyErr_Format(PyExc_NameError,
23585 #
if PY_MAJOR_VERSION >= 3
23586 "name '%U' is not defined", name);
23588 "name '%.200s' is not defined", PyString_AS_STRING(name));
23595 static void __Pyx_RaiseArgtupleInvalid(
23596 const char* func_name,
23598 Py_ssize_t num_min,
23599 Py_ssize_t num_max,
23600 Py_ssize_t num_found)
23602 Py_ssize_t num_expected;
23603 const char *more_or_less;
23604 if (num_found < num_min) {
23605 num_expected = num_min;
23606 more_or_less =
"at least";
23608 num_expected = num_max;
23609 more_or_less =
"at most";
23612 more_or_less =
"exactly";
23614 PyErr_Format(PyExc_TypeError,
23615 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23616 func_name, more_or_less, num_expected,
23617 (num_expected == 1) ?
"" :
"s", num_found);
23621 static void __Pyx_RaiseDoubleKeywordsError(
23622 const char* func_name,
23625 PyErr_Format(PyExc_TypeError,
23626 #
if PY_MAJOR_VERSION >= 3
23627 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23629 "%s() got multiple values for keyword argument '%s'", func_name,
23630 PyString_AsString(kw_name));
23635 static int __Pyx_ParseOptionalKeywords(
23637 PyObject **argnames[],
23639 PyObject *values[],
23640 Py_ssize_t num_pos_args,
23641 const char* function_name)
23643 PyObject *key = 0, *value = 0;
23644 Py_ssize_t
pos = 0;
23646 PyObject*** first_kw_arg = argnames + num_pos_args;
23647 while (PyDict_Next(kwds, &
pos, &key, &value)) {
23648 name = first_kw_arg;
23649 while (*name && (**name != key)) name++;
23651 values[name-argnames] = value;
23654 name = first_kw_arg;
23655 #if PY_MAJOR_VERSION < 3
23656 if (likely(PyString_Check(key))) {
23658 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23659 && _PyString_Eq(**name, key)) {
23660 values[name-argnames] = value;
23665 if (*name)
continue;
23667 PyObject*** argname = argnames;
23668 while (argname != first_kw_arg) {
23669 if ((**argname == key) || (
23670 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23671 && _PyString_Eq(**argname, key))) {
23672 goto arg_passed_twice;
23679 if (likely(PyUnicode_Check(key))) {
23681 int cmp = (**name == key) ? 0 :
23682 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23683 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23685 PyUnicode_Compare(**name, key);
23686 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23688 values[name-argnames] = value;
23693 if (*name)
continue;
23695 PyObject*** argname = argnames;
23696 while (argname != first_kw_arg) {
23697 int cmp = (**argname == key) ? 0 :
23698 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23699 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23701 PyUnicode_Compare(**argname, key);
23702 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23703 if (cmp == 0)
goto arg_passed_twice;
23708 goto invalid_keyword_type;
23710 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23712 goto invalid_keyword;
23717 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23719 invalid_keyword_type:
23720 PyErr_Format(PyExc_TypeError,
23721 "%.200s() keywords must be strings", function_name);
23724 PyErr_Format(PyExc_TypeError,
23725 #
if PY_MAJOR_VERSION < 3
23726 "%.200s() got an unexpected keyword argument '%.200s'",
23727 function_name, PyString_AsString(key));
23729 "%s() got an unexpected keyword argument '%U'",
23730 function_name, key);
23737 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
23739 if (unlikely(!type)) {
23740 PyErr_SetString(PyExc_SystemError,
"Missing type object");
23744 #if PY_MAJOR_VERSION == 2
23745 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
23749 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
23751 PyErr_Format(PyExc_TypeError,
23752 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23753 name, type->tp_name, Py_TYPE(obj)->tp_name);
23758 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
23764 S.u32 = 0x01020304;
23765 return S.u8[0] == 4;
23769 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
23770 __Pyx_BufFmt_StackElem* stack,
23771 __Pyx_TypeInfo* type) {
23772 stack[0].field = &ctx->root;
23773 stack[0].parent_offset = 0;
23774 ctx->root.type = type;
23775 ctx->root.name =
"buffer dtype";
23776 ctx->root.offset = 0;
23778 ctx->head->field = &ctx->root;
23779 ctx->fmt_offset = 0;
23780 ctx->head->parent_offset = 0;
23781 ctx->new_packmode =
'@';
23782 ctx->enc_packmode =
'@';
23783 ctx->new_count = 1;
23784 ctx->enc_count = 0;
23786 ctx->is_complex = 0;
23787 ctx->is_valid_array = 0;
23788 ctx->struct_alignment = 0;
23789 while (type->typegroup ==
'S') {
23791 ctx->head->field = type->fields;
23792 ctx->head->parent_offset = 0;
23793 type = type->fields->type;
23796 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
23798 const char* t = *ts;
23799 if (*t < '0' || *t >
'9') {
23802 count = *t++ -
'0';
23803 while (*t >=
'0' && *t <=
'9') {
23805 count += *t++ -
'0';
23811 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
23812 int number = __Pyx_BufFmt_ParseNumber(ts);
23814 PyErr_Format(PyExc_ValueError,\
23815 "Does not understand character buffer dtype format string ('%c')", **ts);
23818 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
23819 PyErr_Format(PyExc_ValueError,
23820 "Unexpected format string character: '%c'", ch);
23822 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
23824 case '?':
return "'bool'";
23825 case 'c':
return "'char'";
23826 case 'b':
return "'signed char'";
23827 case 'B':
return "'unsigned char'";
23828 case 'h':
return "'short'";
23829 case 'H':
return "'unsigned short'";
23830 case 'i':
return "'int'";
23831 case 'I':
return "'unsigned int'";
23832 case 'l':
return "'long'";
23833 case 'L':
return "'unsigned long'";
23834 case 'q':
return "'long long'";
23835 case 'Q':
return "'unsigned long long'";
23836 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
23837 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
23838 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
23839 case 'T':
return "a struct";
23840 case 'O':
return "Python object";
23841 case 'P':
return "a pointer";
23842 case 's':
case 'p':
return "a string";
23843 case 0:
return "end";
23844 default:
return "unparseable format string";
23847 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
23849 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23850 case 'h':
case 'H':
return 2;
23851 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
23852 case 'q':
case 'Q':
return 8;
23853 case 'f':
return (is_complex ? 8 : 4);
23854 case 'd':
return (is_complex ? 16 : 8);
23856 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
23859 case 'O':
case 'P':
return sizeof(
void*);
23861 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23865 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
23867 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23868 case 'h':
case 'H':
return sizeof(short);
23869 case 'i':
case 'I':
return sizeof(int);
23870 case 'l':
case 'L':
return sizeof(long);
23871 #ifdef HAVE_LONG_LONG
23872 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
23874 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
23875 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
23876 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
23877 case 'O':
case 'P':
return sizeof(
void*);
23879 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23884 typedef struct {
char c;
short x; } __Pyx_st_short;
23885 typedef struct {
char c;
int x; } __Pyx_st_int;
23886 typedef struct {
char c;
long x; } __Pyx_st_long;
23887 typedef struct {
char c;
float x; } __Pyx_st_float;
23888 typedef struct {
char c;
double x; } __Pyx_st_double;
23889 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
23890 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
23891 #ifdef HAVE_LONG_LONG
23892 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
23894 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
23896 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23897 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
23898 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
23899 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
23900 #ifdef HAVE_LONG_LONG
23901 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
23903 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
23904 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
23905 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
23906 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
23908 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23916 typedef struct {
short x;
char c; } __Pyx_pad_short;
23917 typedef struct {
int x;
char c; } __Pyx_pad_int;
23918 typedef struct {
long x;
char c; } __Pyx_pad_long;
23919 typedef struct {
float x;
char c; } __Pyx_pad_float;
23920 typedef struct {
double x;
char c; } __Pyx_pad_double;
23921 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
23922 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
23923 #ifdef HAVE_LONG_LONG
23924 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
23926 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
23928 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23929 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
23930 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
23931 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
23932 #ifdef HAVE_LONG_LONG
23933 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
23935 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
23936 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
23937 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
23938 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
23940 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23944 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
23948 case 'b':
case 'h':
case 'i':
23949 case 'l':
case 'q':
case 's':
case 'p':
23951 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
23953 case 'f':
case 'd':
case 'g':
23954 return (is_complex ?
'C' :
'R');
23960 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23965 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
23966 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
23967 const char* expected;
23969 if (ctx->head == NULL) {
23973 expected = ctx->head->field->type->name;
23976 PyErr_Format(PyExc_ValueError,
23977 "Buffer dtype mismatch, expected %s%s%s but got %s",
23978 quote, expected, quote,
23979 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
23981 __Pyx_StructField* field = ctx->head->field;
23982 __Pyx_StructField* parent = (ctx->head - 1)->field;
23983 PyErr_Format(PyExc_ValueError,
23984 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
23985 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
23986 parent->type->name, field->name);
23989 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
23991 size_t size, offset, arraysize = 1;
23992 if (ctx->enc_type == 0)
return 0;
23993 if (ctx->head->field->type->arraysize[0]) {
23995 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
23996 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
23998 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
23999 PyErr_Format(PyExc_ValueError,
24000 "Expected a dimension of size %zu, got %zu",
24001 ctx->head->field->type->arraysize[0], ctx->enc_count);
24005 if (!ctx->is_valid_array) {
24006 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
24007 ctx->head->field->type->ndim, ndim);
24010 for (i = 0; i < ctx->head->field->type->ndim; i++) {
24011 arraysize *= ctx->head->field->type->arraysize[i];
24013 ctx->is_valid_array = 0;
24014 ctx->enc_count = 1;
24016 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
24018 __Pyx_StructField* field = ctx->head->field;
24019 __Pyx_TypeInfo* type = field->type;
24020 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
24021 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
24023 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
24025 if (ctx->enc_packmode ==
'@') {
24026 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
24027 size_t align_mod_offset;
24028 if (align_at == 0)
return -1;
24029 align_mod_offset = ctx->fmt_offset % align_at;
24030 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
24031 if (ctx->struct_alignment == 0)
24032 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
24035 if (type->size != size || type->typegroup != group) {
24036 if (type->typegroup ==
'C' && type->fields != NULL) {
24037 size_t parent_offset = ctx->head->parent_offset + field->offset;
24039 ctx->head->field = type->fields;
24040 ctx->head->parent_offset = parent_offset;
24043 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
24045 __Pyx_BufFmt_RaiseExpected(ctx);
24049 offset = ctx->head->parent_offset + field->offset;
24050 if (ctx->fmt_offset != offset) {
24051 PyErr_Format(PyExc_ValueError,
24052 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
24053 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
24056 ctx->fmt_offset += size;
24058 ctx->fmt_offset += (arraysize - 1) * size;
24061 if (field == &ctx->root) {
24063 if (ctx->enc_count != 0) {
24064 __Pyx_BufFmt_RaiseExpected(ctx);
24069 ctx->head->field = ++field;
24070 if (field->type == NULL) {
24072 field = ctx->head->field;
24074 }
else if (field->type->typegroup ==
'S') {
24075 size_t parent_offset = ctx->head->parent_offset + field->offset;
24076 if (field->type->fields->type == NULL)
continue;
24077 field = field->type->fields;
24079 ctx->head->field = field;
24080 ctx->head->parent_offset = parent_offset;
24086 }
while (ctx->enc_count);
24088 ctx->is_complex = 0;
24092 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
24094 const char *ts = *tsp;
24095 int i = 0,
number, ndim;
24097 if (ctx->new_count != 1) {
24098 PyErr_SetString(PyExc_ValueError,
24099 "Cannot handle repeated arrays in format string");
24102 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24103 ndim = ctx->head->field->type->ndim;
24104 while (*ts && *ts !=
')') {
24106 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
24109 number = __Pyx_BufFmt_ExpectNumber(&ts);
24110 if (
number == -1)
return NULL;
24111 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
24112 return PyErr_Format(PyExc_ValueError,
24113 "Expected a dimension of size %zu, got %d",
24114 ctx->head->field->type->arraysize[i],
number);
24115 if (*ts !=
',' && *ts !=
')')
24116 return PyErr_Format(PyExc_ValueError,
24117 "Expected a comma in format string, got '%c'", *ts);
24118 if (*ts ==
',') ts++;
24122 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
24123 ctx->head->field->type->ndim, i);
24125 PyErr_SetString(PyExc_ValueError,
24126 "Unexpected end of format string, expected ')'");
24129 ctx->is_valid_array = 1;
24130 ctx->new_count = 1;
24134 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
24139 if (ctx->enc_type != 0 && ctx->head == NULL) {
24140 __Pyx_BufFmt_RaiseExpected(ctx);
24143 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24144 if (ctx->head != NULL) {
24145 __Pyx_BufFmt_RaiseExpected(ctx);
24155 if (!__Pyx_Is_Little_Endian()) {
24156 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
24159 ctx->new_packmode =
'=';
24164 if (__Pyx_Is_Little_Endian()) {
24165 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
24168 ctx->new_packmode =
'=';
24174 ctx->new_packmode = *ts++;
24178 const char* ts_after_sub;
24179 size_t i, struct_count = ctx->new_count;
24180 size_t struct_alignment = ctx->struct_alignment;
24181 ctx->new_count = 1;
24184 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
24187 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24189 ctx->enc_count = 0;
24190 ctx->struct_alignment = 0;
24193 for (i = 0; i != struct_count; ++i) {
24194 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
24195 if (!ts_after_sub)
return NULL;
24198 if (struct_alignment) ctx->struct_alignment = struct_alignment;
24203 size_t alignment = ctx->struct_alignment;
24205 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24207 if (alignment && ctx->fmt_offset % alignment) {
24208 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
24213 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24214 ctx->fmt_offset += ctx->new_count;
24215 ctx->new_count = 1;
24216 ctx->enc_count = 0;
24218 ctx->enc_packmode = ctx->new_packmode;
24224 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
24225 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
24228 CYTHON_FALLTHROUGH;
24229 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
24230 case 'l':
case 'L':
case 'q':
case 'Q':
24231 case 'f':
case 'd':
case 'g':
24232 case 'O':
case 'p':
24233 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
24234 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
24235 ctx->enc_count += ctx->new_count;
24236 ctx->new_count = 1;
24241 CYTHON_FALLTHROUGH;
24243 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24244 ctx->enc_count = ctx->new_count;
24245 ctx->enc_packmode = ctx->new_packmode;
24246 ctx->enc_type = *ts;
24247 ctx->is_complex = got_Z;
24249 ctx->new_count = 1;
24254 while(*ts !=
':') ++ts;
24258 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
24262 int number = __Pyx_BufFmt_ExpectNumber(&ts);
24263 if (
number == -1)
return NULL;
24264 ctx->new_count = (size_t)
number;
24271 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
24272 if (unlikely(info->buf == NULL))
return;
24273 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
24274 __Pyx_ReleaseBuffer(info);
24276 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
24279 buf->strides = __Pyx_zeros;
24280 buf->shape = __Pyx_zeros;
24281 buf->suboffsets = __Pyx_minusones;
24283 static int __Pyx__GetBufferAndValidate(
24284 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
24285 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
24288 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
24289 __Pyx_ZeroBuffer(buf);
24292 if (unlikely(buf->ndim != nd)) {
24293 PyErr_Format(PyExc_ValueError,
24294 "Buffer has wrong number of dimensions (expected %d, got %d)",
24299 __Pyx_BufFmt_Context ctx;
24300 __Pyx_BufFmt_Init(&ctx, stack, dtype);
24301 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
24303 if (unlikely((
size_t)buf->itemsize != dtype->size)) {
24304 PyErr_Format(PyExc_ValueError,
24305 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
24306 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
24307 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
24310 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
24313 __Pyx_SafeReleaseBuffer(buf);
24318 static void __Pyx_RaiseBufferIndexError(
int axis) {
24319 PyErr_Format(PyExc_IndexError,
24320 "Out of bounds on buffer access (axis %d)", axis);
24324 #if CYTHON_FAST_THREAD_STATE
24325 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24326 PyObject *tmp_type, *tmp_value, *tmp_tb;
24327 tmp_type = tstate->curexc_type;
24328 tmp_value = tstate->curexc_value;
24329 tmp_tb = tstate->curexc_traceback;
24330 tstate->curexc_type = type;
24331 tstate->curexc_value = value;
24332 tstate->curexc_traceback = tb;
24333 Py_XDECREF(tmp_type);
24334 Py_XDECREF(tmp_value);
24335 Py_XDECREF(tmp_tb);
24337 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24338 *type = tstate->curexc_type;
24339 *value = tstate->curexc_value;
24340 *tb = tstate->curexc_traceback;
24341 tstate->curexc_type = 0;
24342 tstate->curexc_value = 0;
24343 tstate->curexc_traceback = 0;
24348 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24349 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24351 value = PyDict_GetItemWithError(d, key);
24352 if (unlikely(!value)) {
24353 if (!PyErr_Occurred()) {
24354 if (unlikely(PyTuple_Check(key))) {
24355 PyObject* args = PyTuple_Pack(1, key);
24356 if (likely(args)) {
24357 PyErr_SetObject(PyExc_KeyError, args);
24361 PyErr_SetObject(PyExc_KeyError, key);
24372 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24374 if (!j)
return NULL;
24375 r = PyObject_GetItem(o, j);
24379 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24380 CYTHON_NCP_UNUSED
int wraparound,
24381 CYTHON_NCP_UNUSED
int boundscheck) {
24382 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24383 Py_ssize_t wrapped_i = i;
24384 if (wraparound & unlikely(i < 0)) {
24385 wrapped_i += PyList_GET_SIZE(o);
24387 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24388 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24392 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24394 return PySequence_GetItem(o, i);
24397 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24398 CYTHON_NCP_UNUSED
int wraparound,
24399 CYTHON_NCP_UNUSED
int boundscheck) {
24400 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24401 Py_ssize_t wrapped_i = i;
24402 if (wraparound & unlikely(i < 0)) {
24403 wrapped_i += PyTuple_GET_SIZE(o);
24405 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24406 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24410 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24412 return PySequence_GetItem(o, i);
24415 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24416 CYTHON_NCP_UNUSED
int wraparound,
24417 CYTHON_NCP_UNUSED
int boundscheck) {
24418 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24419 if (is_list || PyList_CheckExact(o)) {
24420 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24421 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
24422 PyObject *
r = PyList_GET_ITEM(o,
n);
24427 else if (PyTuple_CheckExact(o)) {
24428 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24429 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
24430 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24435 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24436 if (likely(m && m->sq_item)) {
24437 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24438 Py_ssize_t l = m->sq_length(o);
24439 if (likely(l >= 0)) {
24442 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24447 return m->sq_item(o, i);
24451 if (is_list || PySequence_Check(o)) {
24452 return PySequence_GetItem(o, i);
24455 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24459 #if CYTHON_USE_TYPE_SLOTS
24460 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24462 Py_ssize_t key_value;
24463 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24464 if (unlikely(!(m && m->sq_item))) {
24465 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24468 key_value = __Pyx_PyIndex_AsSsize_t(index);
24469 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24470 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24472 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24474 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24478 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24479 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24480 if (likely(m && m->mp_subscript)) {
24481 return m->mp_subscript(obj, key);
24483 return __Pyx_PyObject_GetIndex(obj, key);
24488 #if !CYTHON_COMPILING_IN_PYPY
24489 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
24490 const double b = floatval;
24493 (void)zerodivision_check;
24494 if (likely(PyFloat_CheckExact(op1))) {
24495 a = PyFloat_AS_DOUBLE(op1);
24498 #if PY_MAJOR_VERSION < 3
24499 if (likely(PyInt_CheckExact(op1))) {
24500 a = (double) PyInt_AS_LONG(op1);
24504 if (likely(PyLong_CheckExact(op1))) {
24505 #if CYTHON_USE_PYLONG_INTERNALS
24506 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24507 const Py_ssize_t size = Py_SIZE(op1);
24509 case 0: a = 0.0;
break;
24510 case -1: a = -(double) digits[0];
break;
24511 case 1: a = (double) digits[0];
break;
24514 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
24515 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24516 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24522 CYTHON_FALLTHROUGH;
24525 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
24526 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24527 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24533 CYTHON_FALLTHROUGH;
24536 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
24537 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24538 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24544 CYTHON_FALLTHROUGH;
24549 a = PyLong_AsDouble(op1);
24550 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
24554 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24557 PyFPE_START_PROTECT(
"add",
return NULL)
24559 PyFPE_END_PROTECT(result)
24560 return PyFloat_FromDouble(result);
24565 #if CYTHON_FAST_PYCALL
24566 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24567 PyObject *globals) {
24569 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24570 PyObject **fastlocals;
24573 assert(globals != NULL);
24578 assert(tstate != NULL);
24579 f = PyFrame_New(tstate, co, globals, NULL);
24583 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
24584 for (i = 0; i < na; i++) {
24586 fastlocals[i] = *args++;
24588 result = PyEval_EvalFrameEx(
f,0);
24589 ++tstate->recursion_depth;
24591 --tstate->recursion_depth;
24594 #if 1 || PY_VERSION_HEX < 0x030600B1
24595 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24596 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24597 PyObject *globals = PyFunction_GET_GLOBALS(func);
24598 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24600 #if PY_MAJOR_VERSION >= 3
24603 PyObject *kwtuple, **k;
24608 assert(kwargs == NULL || PyDict_Check(kwargs));
24609 nk = kwargs ? PyDict_Size(kwargs) : 0;
24610 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24614 #
if PY_MAJOR_VERSION >= 3
24615 co->co_kwonlyargcount == 0 &&
24617 likely(kwargs == NULL || nk == 0) &&
24618 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24619 if (argdefs == NULL && co->co_argcount == nargs) {
24620 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24623 else if (nargs == 0 && argdefs != NULL
24624 && co->co_argcount == Py_SIZE(argdefs)) {
24627 args = &PyTuple_GET_ITEM(argdefs, 0);
24628 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24632 if (kwargs != NULL) {
24634 kwtuple = PyTuple_New(2 * nk);
24635 if (kwtuple == NULL) {
24639 k = &PyTuple_GET_ITEM(kwtuple, 0);
24641 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24652 closure = PyFunction_GET_CLOSURE(func);
24653 #if PY_MAJOR_VERSION >= 3
24654 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24656 if (argdefs != NULL) {
24657 d = &PyTuple_GET_ITEM(argdefs, 0);
24658 nd = Py_SIZE(argdefs);
24664 #if PY_MAJOR_VERSION >= 3
24665 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24668 d, (
int)nd, kwdefs, closure);
24670 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24673 d, (
int)nd, closure);
24675 Py_XDECREF(kwtuple);
24677 Py_LeaveRecursiveCall();
24684 #if CYTHON_FAST_PYCCALL
24685 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24686 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24687 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24688 PyObject *
self = PyCFunction_GET_SELF(func);
24689 int flags = PyCFunction_GET_FLAGS(func);
24690 assert(PyCFunction_Check(func));
24691 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24692 assert(nargs >= 0);
24693 assert(nargs == 0 || args != NULL);
24697 assert(!PyErr_Occurred());
24698 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24699 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24701 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24707 #if CYTHON_COMPILING_IN_CPYTHON
24708 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24710 ternaryfunc call = Py_TYPE(func)->tp_call;
24711 if (unlikely(!call))
24712 return PyObject_Call(func, arg, kw);
24713 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24715 result = (*call)(func, arg, kw);
24716 Py_LeaveRecursiveCall();
24717 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24720 "NULL result without error in PyObject_Call");
24727 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24728 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24729 PyObject *dict = Py_TYPE(obj)->tp_dict;
24730 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24732 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24733 PyObject **dictptr = NULL;
24734 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24736 #if CYTHON_COMPILING_IN_CPYTHON
24737 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24739 dictptr = _PyObject_GetDictPtr(obj);
24742 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24744 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24745 PyObject *dict = Py_TYPE(obj)->tp_dict;
24746 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24748 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24753 #if CYTHON_USE_DICT_VERSIONS
24754 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24756 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24760 #if !CYTHON_AVOID_BORROWED_REFS
24761 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24762 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24763 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24764 if (likely(result)) {
24765 return __Pyx_NewRef(result);
24766 }
else if (unlikely(PyErr_Occurred())) {
24770 result = PyDict_GetItem(__pyx_d, name);
24771 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24772 if (likely(result)) {
24773 return __Pyx_NewRef(result);
24777 result = PyObject_GetItem(__pyx_d, name);
24778 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24779 if (likely(result)) {
24780 return __Pyx_NewRef(result);
24784 return __Pyx_GetBuiltinName(name);
24788 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24789 if (unlikely(!type)) {
24790 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24793 if (likely(__Pyx_TypeCheck(obj, type)))
24795 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
24796 Py_TYPE(obj)->tp_name, type->tp_name);
24801 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
24802 PyObject *args, *result = NULL;
24803 #if CYTHON_FAST_PYCALL
24804 if (PyFunction_Check(
function)) {
24805 PyObject *args[2] = {arg1, arg2};
24806 return __Pyx_PyFunction_FastCall(
function, args, 2);
24809 #if CYTHON_FAST_PYCCALL
24810 if (__Pyx_PyFastCFunction_Check(
function)) {
24811 PyObject *args[2] = {arg1, arg2};
24812 return __Pyx_PyCFunction_FastCall(
function, args, 2);
24815 args = PyTuple_New(2);
24816 if (unlikely(!args))
goto done;
24818 PyTuple_SET_ITEM(args, 0, arg1);
24820 PyTuple_SET_ITEM(args, 1, arg2);
24821 Py_INCREF(
function);
24822 result = __Pyx_PyObject_Call(
function, args, NULL);
24824 Py_DECREF(
function);
24830 #if CYTHON_COMPILING_IN_CPYTHON
24831 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24832 PyObject *
self, *result;
24834 cfunc = PyCFunction_GET_FUNCTION(func);
24835 self = PyCFunction_GET_SELF(func);
24836 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24838 result = cfunc(
self, arg);
24839 Py_LeaveRecursiveCall();
24840 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24843 "NULL result without error in PyObject_Call");
24850 #if CYTHON_COMPILING_IN_CPYTHON
24851 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24853 PyObject *args = PyTuple_New(1);
24854 if (unlikely(!args))
return NULL;
24856 PyTuple_SET_ITEM(args, 0, arg);
24857 result = __Pyx_PyObject_Call(func, args, NULL);
24861 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24862 #if CYTHON_FAST_PYCALL
24863 if (PyFunction_Check(func)) {
24864 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24867 if (likely(PyCFunction_Check(func))) {
24868 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24869 return __Pyx_PyObject_CallMethO(func, arg);
24870 #if CYTHON_FAST_PYCCALL
24871 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24872 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24876 return __Pyx__PyObject_CallOneArg(func, arg);
24879 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24881 PyObject *args = PyTuple_Pack(1, arg);
24882 if (unlikely(!args))
return NULL;
24883 result = __Pyx_PyObject_Call(func, args, NULL);
24890 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
24891 PyObject* float_value;
24892 #if !CYTHON_USE_TYPE_SLOTS
24893 float_value = PyNumber_Float(obj);
if ((0))
goto bad;
24895 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
24896 if (likely(nb) && likely(nb->nb_float)) {
24897 float_value = nb->nb_float(obj);
24898 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
24899 PyErr_Format(PyExc_TypeError,
24900 "__float__ returned non-float (type %.200s)",
24901 Py_TYPE(float_value)->tp_name);
24902 Py_DECREF(float_value);
24905 }
else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
24906 #if PY_MAJOR_VERSION >= 3
24907 float_value = PyFloat_FromString(obj);
24909 float_value = PyFloat_FromString(obj, 0);
24912 PyObject* args = PyTuple_New(1);
24913 if (unlikely(!args))
goto bad;
24914 PyTuple_SET_ITEM(args, 0, obj);
24915 float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
24916 PyTuple_SET_ITEM(args, 0, 0);
24920 if (likely(float_value)) {
24921 double value = PyFloat_AS_DOUBLE(float_value);
24922 Py_DECREF(float_value);
24930 #if CYTHON_USE_EXC_INFO_STACK
24931 static _PyErr_StackItem *
24932 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24934 _PyErr_StackItem *exc_info = tstate->exc_info;
24935 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24936 exc_info->previous_item != NULL)
24938 exc_info = exc_info->previous_item;
24945 #if CYTHON_FAST_THREAD_STATE
24946 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24947 #if CYTHON_USE_EXC_INFO_STACK
24948 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24949 *type = exc_info->exc_type;
24950 *value = exc_info->exc_value;
24951 *tb = exc_info->exc_traceback;
24953 *type = tstate->exc_type;
24954 *value = tstate->exc_value;
24955 *tb = tstate->exc_traceback;
24958 Py_XINCREF(*value);
24961 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24962 PyObject *tmp_type, *tmp_value, *tmp_tb;
24963 #if CYTHON_USE_EXC_INFO_STACK
24964 _PyErr_StackItem *exc_info = tstate->exc_info;
24965 tmp_type = exc_info->exc_type;
24966 tmp_value = exc_info->exc_value;
24967 tmp_tb = exc_info->exc_traceback;
24968 exc_info->exc_type = type;
24969 exc_info->exc_value = value;
24970 exc_info->exc_traceback = tb;
24972 tmp_type = tstate->exc_type;
24973 tmp_value = tstate->exc_value;
24974 tmp_tb = tstate->exc_traceback;
24975 tstate->exc_type = type;
24976 tstate->exc_value = value;
24977 tstate->exc_traceback = tb;
24979 Py_XDECREF(tmp_type);
24980 Py_XDECREF(tmp_value);
24981 Py_XDECREF(tmp_tb);
24986 #if CYTHON_FAST_THREAD_STATE
24987 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24989 n = PyTuple_GET_SIZE(tuple);
24990 #if PY_MAJOR_VERSION >= 3
24991 for (i=0; i<
n; i++) {
24992 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24995 for (i=0; i<
n; i++) {
24996 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25000 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25001 PyObject *exc_type = tstate->curexc_type;
25002 if (exc_type == err)
return 1;
25003 if (unlikely(!exc_type))
return 0;
25004 if (unlikely(PyTuple_Check(err)))
25005 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25006 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25011 #if CYTHON_FAST_THREAD_STATE
25012 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25014 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25017 PyObject *local_type, *local_value, *local_tb;
25018 #if CYTHON_FAST_THREAD_STATE
25019 PyObject *tmp_type, *tmp_value, *tmp_tb;
25020 local_type = tstate->curexc_type;
25021 local_value = tstate->curexc_value;
25022 local_tb = tstate->curexc_traceback;
25023 tstate->curexc_type = 0;
25024 tstate->curexc_value = 0;
25025 tstate->curexc_traceback = 0;
25027 PyErr_Fetch(&local_type, &local_value, &local_tb);
25029 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25030 #if CYTHON_FAST_THREAD_STATE
25031 if (unlikely(tstate->curexc_type))
25033 if (unlikely(PyErr_Occurred()))
25036 #if PY_MAJOR_VERSION >= 3
25038 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25042 Py_XINCREF(local_tb);
25043 Py_XINCREF(local_type);
25044 Py_XINCREF(local_value);
25045 *type = local_type;
25046 *value = local_value;
25048 #if CYTHON_FAST_THREAD_STATE
25049 #if CYTHON_USE_EXC_INFO_STACK
25051 _PyErr_StackItem *exc_info = tstate->exc_info;
25052 tmp_type = exc_info->exc_type;
25053 tmp_value = exc_info->exc_value;
25054 tmp_tb = exc_info->exc_traceback;
25055 exc_info->exc_type = local_type;
25056 exc_info->exc_value = local_value;
25057 exc_info->exc_traceback = local_tb;
25060 tmp_type = tstate->exc_type;
25061 tmp_value = tstate->exc_value;
25062 tmp_tb = tstate->exc_traceback;
25063 tstate->exc_type = local_type;
25064 tstate->exc_value = local_value;
25065 tstate->exc_traceback = local_tb;
25067 Py_XDECREF(tmp_type);
25068 Py_XDECREF(tmp_value);
25069 Py_XDECREF(tmp_tb);
25071 PyErr_SetExcInfo(local_type, local_value, local_tb);
25078 Py_XDECREF(local_type);
25079 Py_XDECREF(local_value);
25080 Py_XDECREF(local_tb);
25085 #if PY_MAJOR_VERSION < 3
25086 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25087 CYTHON_UNUSED PyObject *cause) {
25088 __Pyx_PyThreadState_declare
25090 if (!value || value == Py_None)
25094 if (!tb || tb == Py_None)
25098 if (!PyTraceBack_Check(tb)) {
25099 PyErr_SetString(PyExc_TypeError,
25100 "raise: arg 3 must be a traceback or None");
25104 if (PyType_Check(type)) {
25105 #if CYTHON_COMPILING_IN_PYPY
25107 Py_INCREF(Py_None);
25111 PyErr_NormalizeException(&type, &value, &tb);
25114 PyErr_SetString(PyExc_TypeError,
25115 "instance exception may not have a separate value");
25119 type = (PyObject*) Py_TYPE(type);
25121 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25122 PyErr_SetString(PyExc_TypeError,
25123 "raise: exception class must be a subclass of BaseException");
25127 __Pyx_PyThreadState_assign
25128 __Pyx_ErrRestore(type, value, tb);
25137 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25138 PyObject* owned_instance = NULL;
25139 if (tb == Py_None) {
25141 }
else if (tb && !PyTraceBack_Check(tb)) {
25142 PyErr_SetString(PyExc_TypeError,
25143 "raise: arg 3 must be a traceback or None");
25146 if (value == Py_None)
25148 if (PyExceptionInstance_Check(type)) {
25150 PyErr_SetString(PyExc_TypeError,
25151 "instance exception may not have a separate value");
25155 type = (PyObject*) Py_TYPE(value);
25156 }
else if (PyExceptionClass_Check(type)) {
25157 PyObject *instance_class = NULL;
25158 if (value && PyExceptionInstance_Check(value)) {
25159 instance_class = (PyObject*) Py_TYPE(value);
25160 if (instance_class != type) {
25161 int is_subclass = PyObject_IsSubclass(instance_class, type);
25162 if (!is_subclass) {
25163 instance_class = NULL;
25164 }
else if (unlikely(is_subclass == -1)) {
25167 type = instance_class;
25171 if (!instance_class) {
25174 args = PyTuple_New(0);
25175 else if (PyTuple_Check(value)) {
25179 args = PyTuple_Pack(1, value);
25182 owned_instance = PyObject_Call(type, args, NULL);
25184 if (!owned_instance)
25186 value = owned_instance;
25187 if (!PyExceptionInstance_Check(value)) {
25188 PyErr_Format(PyExc_TypeError,
25189 "calling %R should have returned an instance of "
25190 "BaseException, not %R",
25191 type, Py_TYPE(value));
25196 PyErr_SetString(PyExc_TypeError,
25197 "raise: exception class must be a subclass of BaseException");
25201 PyObject *fixed_cause;
25202 if (cause == Py_None) {
25203 fixed_cause = NULL;
25204 }
else if (PyExceptionClass_Check(cause)) {
25205 fixed_cause = PyObject_CallObject(cause, NULL);
25206 if (fixed_cause == NULL)
25208 }
else if (PyExceptionInstance_Check(cause)) {
25209 fixed_cause = cause;
25210 Py_INCREF(fixed_cause);
25212 PyErr_SetString(PyExc_TypeError,
25213 "exception causes must derive from "
25217 PyException_SetCause(value, fixed_cause);
25219 PyErr_SetObject(type, value);
25221 #if CYTHON_COMPILING_IN_PYPY
25222 PyObject *tmp_type, *tmp_value, *tmp_tb;
25223 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25225 PyErr_Restore(tmp_type, tmp_value, tb);
25226 Py_XDECREF(tmp_tb);
25228 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25229 PyObject* tmp_tb = tstate->curexc_traceback;
25230 if (tb != tmp_tb) {
25232 tstate->curexc_traceback = tb;
25233 Py_XDECREF(tmp_tb);
25238 Py_XDECREF(owned_instance);
25244 #ifndef __PYX_HAVE_RT_ImportType
25245 #define __PYX_HAVE_RT_ImportType
25246 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
25247 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
25249 PyObject *result = 0;
25251 Py_ssize_t basicsize;
25252 #ifdef Py_LIMITED_API
25253 PyObject *py_basicsize;
25255 result = PyObject_GetAttrString(module, class_name);
25258 if (!PyType_Check(result)) {
25259 PyErr_Format(PyExc_TypeError,
25260 "%.200s.%.200s is not a type object",
25261 module_name, class_name);
25264 #ifndef Py_LIMITED_API
25265 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25267 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25270 basicsize = PyLong_AsSsize_t(py_basicsize);
25271 Py_DECREF(py_basicsize);
25273 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25276 if ((
size_t)basicsize < size) {
25277 PyErr_Format(PyExc_ValueError,
25278 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25279 "Expected %zd from C header, got %zd from PyObject",
25280 module_name, class_name, size, basicsize);
25283 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
25284 PyErr_Format(PyExc_ValueError,
25285 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25286 "Expected %zd from C header, got %zd from PyObject",
25287 module_name, class_name, size, basicsize);
25290 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
25291 PyOS_snprintf(warning,
sizeof(warning),
25292 "%s.%s size changed, may indicate binary incompatibility. "
25293 "Expected %zd from C header, got %zd from PyObject",
25294 module_name, class_name, size, basicsize);
25295 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25297 return (PyTypeObject *)result;
25299 Py_XDECREF(result);
25305 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25306 PyObject *empty_list = 0;
25307 PyObject *module = 0;
25308 PyObject *global_dict = 0;
25309 PyObject *empty_dict = 0;
25311 #if PY_MAJOR_VERSION < 3
25312 PyObject *py_import;
25313 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25320 empty_list = PyList_New(0);
25325 global_dict = PyModule_GetDict(__pyx_m);
25328 empty_dict = PyDict_New();
25332 #if PY_MAJOR_VERSION >= 3
25334 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25335 module = PyImport_ImportModuleLevelObject(
25336 name, global_dict, empty_dict, list, 1);
25338 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25347 #if PY_MAJOR_VERSION < 3
25348 PyObject *py_level = PyInt_FromLong(level);
25351 module = PyObject_CallFunctionObjArgs(py_import,
25352 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25353 Py_DECREF(py_level);
25355 module = PyImport_ImportModuleLevelObject(
25356 name, global_dict, empty_dict, list, level);
25361 #if PY_MAJOR_VERSION < 3
25362 Py_XDECREF(py_import);
25364 Py_XDECREF(empty_list);
25365 Py_XDECREF(empty_dict);
25370 #ifndef CYTHON_CLINE_IN_TRACEBACK
25371 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
25372 PyObject *use_cline;
25373 PyObject *ptype, *pvalue, *ptraceback;
25374 #if CYTHON_COMPILING_IN_CPYTHON
25375 PyObject **cython_runtime_dict;
25377 if (unlikely(!__pyx_cython_runtime)) {
25380 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25381 #if CYTHON_COMPILING_IN_CPYTHON
25382 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25383 if (likely(cython_runtime_dict)) {
25384 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25385 use_cline, *cython_runtime_dict,
25386 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25390 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25391 if (use_cline_obj) {
25392 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25393 Py_DECREF(use_cline_obj);
25401 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25403 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25406 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25412 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25413 int start = 0, mid = 0, end = count - 1;
25414 if (end >= 0 && code_line > entries[end].code_line) {
25417 while (start < end) {
25418 mid = start + (end - start) / 2;
25419 if (code_line < entries[mid].code_line) {
25421 }
else if (code_line > entries[mid].code_line) {
25427 if (code_line <= entries[mid].code_line) {
25433 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25434 PyCodeObject* code_object;
25436 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25439 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25440 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
25443 code_object = __pyx_code_cache.entries[
pos].code_object;
25444 Py_INCREF(code_object);
25445 return code_object;
25447 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25449 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25450 if (unlikely(!code_line)) {
25453 if (unlikely(!entries)) {
25454 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25455 if (likely(entries)) {
25456 __pyx_code_cache.entries = entries;
25457 __pyx_code_cache.max_count = 64;
25458 __pyx_code_cache.count = 1;
25459 entries[0].code_line = code_line;
25460 entries[0].code_object = code_object;
25461 Py_INCREF(code_object);
25465 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25466 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
25467 PyCodeObject* tmp = entries[
pos].code_object;
25468 entries[
pos].code_object = code_object;
25472 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25473 int new_max = __pyx_code_cache.max_count + 64;
25474 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25475 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
25476 if (unlikely(!entries)) {
25479 __pyx_code_cache.entries = entries;
25480 __pyx_code_cache.max_count = new_max;
25482 for (i=__pyx_code_cache.count; i>
pos; i--) {
25483 entries[i] = entries[i-1];
25485 entries[
pos].code_line = code_line;
25486 entries[
pos].code_object = code_object;
25487 __pyx_code_cache.count++;
25488 Py_INCREF(code_object);
25492 #include "compile.h"
25493 #include "frameobject.h"
25494 #include "traceback.h"
25495 #if PY_VERSION_HEX >= 0x030b00a6
25496 #ifndef Py_BUILD_CORE
25497 #define Py_BUILD_CORE 1
25499 #include "internal/pycore_frame.h"
25501 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25502 const char *funcname,
int c_line,
25503 int py_line,
const char *filename) {
25504 PyCodeObject *py_code = NULL;
25505 PyObject *py_funcname = NULL;
25506 #if PY_MAJOR_VERSION < 3
25507 PyObject *py_srcfile = NULL;
25508 py_srcfile = PyString_FromString(filename);
25509 if (!py_srcfile)
goto bad;
25512 #if PY_MAJOR_VERSION < 3
25513 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25514 if (!py_funcname)
goto bad;
25516 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25517 if (!py_funcname)
goto bad;
25518 funcname = PyUnicode_AsUTF8(py_funcname);
25519 if (!funcname)
goto bad;
25523 #if PY_MAJOR_VERSION < 3
25524 py_funcname = PyString_FromString(funcname);
25525 if (!py_funcname)
goto bad;
25528 #if PY_MAJOR_VERSION < 3
25529 py_code = __Pyx_PyCode_New(
25546 Py_DECREF(py_srcfile);
25548 py_code = PyCode_NewEmpty(filename, funcname, py_line);
25550 Py_XDECREF(py_funcname);
25553 Py_XDECREF(py_funcname);
25554 #if PY_MAJOR_VERSION < 3
25555 Py_XDECREF(py_srcfile);
25559 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
25560 int py_line,
const char *filename) {
25561 PyCodeObject *py_code = 0;
25562 PyFrameObject *py_frame = 0;
25563 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25564 PyObject *ptype, *pvalue, *ptraceback;
25566 c_line = __Pyx_CLineForTraceback(tstate, c_line);
25568 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25570 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25571 py_code = __Pyx_CreateCodeObjectForTraceback(
25572 funcname, c_line, py_line, filename);
25577 Py_XDECREF(pvalue);
25578 Py_XDECREF(ptraceback);
25581 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25582 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25584 py_frame = PyFrame_New(
25590 if (!py_frame)
goto bad;
25591 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25592 PyTraceBack_Here(py_frame);
25594 Py_XDECREF(py_code);
25595 Py_XDECREF(py_frame);
25598 #if PY_MAJOR_VERSION < 3
25599 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
25600 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
25601 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
25604 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
25605 PyObject *obj = view->obj;
25607 if (PyObject_CheckBuffer(obj)) {
25608 PyBuffer_Release(view);
25619 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25620 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25621 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25622 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25623 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25625 func_type value = func_value;\
25626 if (sizeof(target_type) < sizeof(func_type)) {\
25627 if (unlikely(value != (func_type) (target_type) value)) {\
25628 func_type zero = 0;\
25629 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25630 return (target_type) -1;\
25631 if (is_unsigned && unlikely(value < zero))\
25632 goto raise_neg_overflow;\
25634 goto raise_overflow;\
25637 return (target_type) value;\
25641 #if CYTHON_CCOMPLEX
25643 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25644 return ::std::complex< float >(x, y);
25647 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25648 return x + y*(__pyx_t_float_complex)_Complex_I;
25652 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25653 __pyx_t_float_complex
z;
25661 #if CYTHON_CCOMPLEX
25663 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25664 return (a.real == b.real) && (a.imag == b.imag);
25666 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25667 __pyx_t_float_complex
z;
25668 z.real = a.real + b.real;
25669 z.imag = a.imag + b.imag;
25672 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25673 __pyx_t_float_complex
z;
25674 z.real = a.real - b.real;
25675 z.imag = a.imag - b.imag;
25678 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25679 __pyx_t_float_complex
z;
25680 z.real = a.real * b.real - a.imag * b.imag;
25681 z.imag = a.real * b.imag + a.imag * b.real;
25685 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25687 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25688 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
25689 if (b.real == 0 && b.imag == 0) {
25690 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
25692 float r = b.imag / b.real;
25693 float s = (float)(1.0) / (b.real + b.imag *
r);
25694 return __pyx_t_float_complex_from_parts(
25695 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
25698 float r = b.real / b.imag;
25699 float s = (float)(1.0) / (b.imag + b.real *
r);
25700 return __pyx_t_float_complex_from_parts(
25701 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
25705 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25707 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25709 float denom = b.real * b.real + b.imag * b.imag;
25710 return __pyx_t_float_complex_from_parts(
25711 (a.real * b.real + a.imag * b.imag) / denom,
25712 (a.imag * b.real - a.real * b.imag) / denom);
25716 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
25717 __pyx_t_float_complex
z;
25722 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
25723 return (a.real == 0) && (a.imag == 0);
25725 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
25726 __pyx_t_float_complex
z;
25732 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
25733 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25734 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
25736 return hypotf(
z.real,
z.imag);
25739 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25740 __pyx_t_float_complex
z;
25741 float r, lnr, theta, z_r, z_theta;
25742 if (b.imag == 0 && b.real == (
int)b.real) {
25744 float denom = a.real * a.real + a.imag * a.imag;
25745 a.real = a.real / denom;
25746 a.imag = -a.imag / denom;
25749 switch ((
int)b.real) {
25757 return __Pyx_c_prod_float(a, a);
25759 z = __Pyx_c_prod_float(a, a);
25760 return __Pyx_c_prod_float(
z, a);
25762 z = __Pyx_c_prod_float(a, a);
25763 return __Pyx_c_prod_float(
z,
z);
25769 }
else if (b.imag == 0) {
25770 z.real = powf(a.real, b.real);
25773 }
else if (a.real > 0) {
25778 theta = atan2f(0.0, -1.0);
25781 r = __Pyx_c_abs_float(a);
25782 theta = atan2f(a.imag, a.real);
25785 z_r = expf(lnr * b.real - theta * b.imag);
25786 z_theta = theta * b.real + lnr * b.imag;
25787 z.real = z_r * cosf(z_theta);
25788 z.imag = z_r * sinf(z_theta);
25795 #if CYTHON_CCOMPLEX
25797 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25798 return ::std::complex< double >(x, y);
25801 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25802 return x + y*(__pyx_t_double_complex)_Complex_I;
25806 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25807 __pyx_t_double_complex
z;
25815 #if CYTHON_CCOMPLEX
25817 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25818 return (a.real == b.real) && (a.imag == b.imag);
25820 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25821 __pyx_t_double_complex
z;
25822 z.real = a.real + b.real;
25823 z.imag = a.imag + b.imag;
25826 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25827 __pyx_t_double_complex
z;
25828 z.real = a.real - b.real;
25829 z.imag = a.imag - b.imag;
25832 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25833 __pyx_t_double_complex
z;
25834 z.real = a.real * b.real - a.imag * b.imag;
25835 z.imag = a.real * b.imag + a.imag * b.real;
25839 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25841 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
25842 }
else if (fabs(b.real) >= fabs(b.imag)) {
25843 if (b.real == 0 && b.imag == 0) {
25844 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
25846 double r = b.imag / b.real;
25847 double s = (double)(1.0) / (b.real + b.imag *
r);
25848 return __pyx_t_double_complex_from_parts(
25849 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
25852 double r = b.real / b.imag;
25853 double s = (double)(1.0) / (b.imag + b.real *
r);
25854 return __pyx_t_double_complex_from_parts(
25855 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
25859 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25861 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
25863 double denom = b.real * b.real + b.imag * b.imag;
25864 return __pyx_t_double_complex_from_parts(
25865 (a.real * b.real + a.imag * b.imag) / denom,
25866 (a.imag * b.real - a.real * b.imag) / denom);
25870 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
25871 __pyx_t_double_complex
z;
25876 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
25877 return (a.real == 0) && (a.imag == 0);
25879 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
25880 __pyx_t_double_complex
z;
25886 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
25887 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25888 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
25890 return hypot(
z.real,
z.imag);
25893 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25894 __pyx_t_double_complex
z;
25895 double r, lnr, theta, z_r, z_theta;
25896 if (b.imag == 0 && b.real == (
int)b.real) {
25898 double denom = a.real * a.real + a.imag * a.imag;
25899 a.real = a.real / denom;
25900 a.imag = -a.imag / denom;
25903 switch ((
int)b.real) {
25911 return __Pyx_c_prod_double(a, a);
25913 z = __Pyx_c_prod_double(a, a);
25914 return __Pyx_c_prod_double(
z, a);
25916 z = __Pyx_c_prod_double(a, a);
25917 return __Pyx_c_prod_double(
z,
z);
25923 }
else if (b.imag == 0) {
25924 z.real = pow(a.real, b.real);
25927 }
else if (a.real > 0) {
25932 theta = atan2(0.0, -1.0);
25935 r = __Pyx_c_abs_double(a);
25936 theta = atan2(a.imag, a.real);
25939 z_r = exp(lnr * b.real - theta * b.imag);
25940 z_theta = theta * b.real + lnr * b.imag;
25941 z.real = z_r * cos(z_theta);
25942 z.imag = z_r * sin(z_theta);
25949 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
25950 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25951 #pragma GCC diagnostic push
25952 #pragma GCC diagnostic ignored "-Wconversion"
25954 const int neg_one = (int) -1, const_zero = (
int) 0;
25955 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25956 #pragma GCC diagnostic pop
25958 const int is_unsigned = neg_one > const_zero;
25959 #if PY_MAJOR_VERSION < 3
25960 if (likely(PyInt_Check(x))) {
25961 if (
sizeof(
int) <
sizeof(long)) {
25962 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
25964 long val = PyInt_AS_LONG(x);
25965 if (is_unsigned && unlikely(val < 0)) {
25966 goto raise_neg_overflow;
25972 if (likely(PyLong_Check(x))) {
25974 #if CYTHON_USE_PYLONG_INTERNALS
25975 const digit* digits = ((PyLongObject*)x)->ob_digit;
25976 switch (Py_SIZE(x)) {
25977 case 0:
return (
int) 0;
25978 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
25980 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
25981 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25982 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25983 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
25984 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
25989 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
25990 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25991 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25992 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
25993 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
25998 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
25999 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26000 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26001 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
26002 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26008 #if CYTHON_COMPILING_IN_CPYTHON
26009 if (unlikely(Py_SIZE(x) < 0)) {
26010 goto raise_neg_overflow;
26014 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26015 if (unlikely(result < 0))
26017 if (unlikely(result == 1))
26018 goto raise_neg_overflow;
26021 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26022 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
26023 #ifdef HAVE_LONG_LONG
26024 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26025 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26029 #if CYTHON_USE_PYLONG_INTERNALS
26030 const digit* digits = ((PyLongObject*)x)->ob_digit;
26031 switch (Py_SIZE(x)) {
26032 case 0:
return (
int) 0;
26033 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
26034 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
26036 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
26037 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26038 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26039 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26040 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26045 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26046 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26047 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26048 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26049 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26054 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26055 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26056 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26057 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26058 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26063 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26064 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26065 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26066 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26067 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26072 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26073 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26074 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26075 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26076 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26081 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
26082 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26083 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26084 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26085 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26091 if (
sizeof(
int) <=
sizeof(long)) {
26092 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
26093 #ifdef HAVE_LONG_LONG
26094 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26095 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
26100 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26101 PyErr_SetString(PyExc_RuntimeError,
26102 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26105 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26106 #if PY_MAJOR_VERSION < 3
26107 if (likely(
v) && !PyLong_Check(
v)) {
26109 v = PyNumber_Long(tmp);
26114 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26115 unsigned char *bytes = (
unsigned char *)&val;
26116 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26117 bytes,
sizeof(val),
26118 is_little, !is_unsigned);
26128 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26129 if (!tmp)
return (
int) -1;
26130 val = __Pyx_PyInt_As_int(tmp);
26135 PyErr_SetString(PyExc_OverflowError,
26136 "value too large to convert to int");
26138 raise_neg_overflow:
26139 PyErr_SetString(PyExc_OverflowError,
26140 "can't convert negative value to int");
26145 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
26146 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26147 #pragma GCC diagnostic push
26148 #pragma GCC diagnostic ignored "-Wconversion"
26150 const int neg_one = (int) -1, const_zero = (
int) 0;
26151 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26152 #pragma GCC diagnostic pop
26154 const int is_unsigned = neg_one > const_zero;
26156 if (
sizeof(
int) <
sizeof(long)) {
26157 return PyInt_FromLong((
long) value);
26158 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26159 return PyLong_FromUnsignedLong((
unsigned long) value);
26160 #ifdef HAVE_LONG_LONG
26161 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26162 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26166 if (
sizeof(
int) <=
sizeof(
long)) {
26167 return PyInt_FromLong((
long) value);
26168 #ifdef HAVE_LONG_LONG
26169 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26170 return PyLong_FromLongLong((PY_LONG_LONG) value);
26175 int one = 1;
int little = (int)*(
unsigned char *)&one;
26176 unsigned char *bytes = (
unsigned char *)&value;
26177 return _PyLong_FromByteArray(bytes,
sizeof(
int),
26178 little, !is_unsigned);
26183 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
26184 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26185 #pragma GCC diagnostic push
26186 #pragma GCC diagnostic ignored "-Wconversion"
26188 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
26189 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26190 #pragma GCC diagnostic pop
26192 const int is_unsigned = neg_one > const_zero;
26194 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26195 return PyInt_FromLong((
long) value);
26196 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26197 return PyLong_FromUnsignedLong((
unsigned long) value);
26198 #ifdef HAVE_LONG_LONG
26199 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26200 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26204 if (
sizeof(Py_intptr_t) <=
sizeof(
long)) {
26205 return PyInt_FromLong((
long) value);
26206 #ifdef HAVE_LONG_LONG
26207 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26208 return PyLong_FromLongLong((PY_LONG_LONG) value);
26213 int one = 1;
int little = (int)*(
unsigned char *)&one;
26214 unsigned char *bytes = (
unsigned char *)&value;
26215 return _PyLong_FromByteArray(bytes,
sizeof(Py_intptr_t),
26216 little, !is_unsigned);
26221 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
26222 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26223 #pragma GCC diagnostic push
26224 #pragma GCC diagnostic ignored "-Wconversion"
26226 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
26227 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26228 #pragma GCC diagnostic pop
26230 const int is_unsigned = neg_one > const_zero;
26231 #if PY_MAJOR_VERSION < 3
26232 if (likely(PyInt_Check(x))) {
26233 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26234 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, PyInt_AS_LONG(x))
26236 long val = PyInt_AS_LONG(x);
26237 if (is_unsigned && unlikely(val < 0)) {
26238 goto raise_neg_overflow;
26240 return (Py_intptr_t) val;
26244 if (likely(PyLong_Check(x))) {
26246 #if CYTHON_USE_PYLONG_INTERNALS
26247 const digit* digits = ((PyLongObject*)x)->ob_digit;
26248 switch (Py_SIZE(x)) {
26249 case 0:
return (Py_intptr_t) 0;
26250 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
26252 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26253 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26254 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26255 }
else if (8 *
sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
26256 return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26261 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26262 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26263 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26264 }
else if (8 *
sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
26265 return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26270 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26271 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26272 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26273 }
else if (8 *
sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
26274 return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26280 #if CYTHON_COMPILING_IN_CPYTHON
26281 if (unlikely(Py_SIZE(x) < 0)) {
26282 goto raise_neg_overflow;
26286 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26287 if (unlikely(result < 0))
26288 return (Py_intptr_t) -1;
26289 if (unlikely(result == 1))
26290 goto raise_neg_overflow;
26293 if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26294 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned long, PyLong_AsUnsignedLong(x))
26295 #ifdef HAVE_LONG_LONG
26296 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26297 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26301 #if CYTHON_USE_PYLONG_INTERNALS
26302 const digit* digits = ((PyLongObject*)x)->ob_digit;
26303 switch (Py_SIZE(x)) {
26304 case 0:
return (Py_intptr_t) 0;
26305 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
26306 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
26308 if (8 *
sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
26309 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26310 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26311 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26312 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26317 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26318 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26319 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26320 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26321 return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26326 if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26327 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26328 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26329 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26330 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26335 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26336 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26337 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26338 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26339 return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26344 if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26345 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26346 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26347 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26348 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26353 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26354 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26355 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26356 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26357 return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26363 if (
sizeof(Py_intptr_t) <=
sizeof(long)) {
26364 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
long, PyLong_AsLong(x))
26365 #ifdef HAVE_LONG_LONG
26366 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26367 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
26372 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26373 PyErr_SetString(PyExc_RuntimeError,
26374 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26377 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26378 #if PY_MAJOR_VERSION < 3
26379 if (likely(
v) && !PyLong_Check(
v)) {
26381 v = PyNumber_Long(tmp);
26386 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26387 unsigned char *bytes = (
unsigned char *)&val;
26388 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26389 bytes,
sizeof(val),
26390 is_little, !is_unsigned);
26396 return (Py_intptr_t) -1;
26400 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26401 if (!tmp)
return (Py_intptr_t) -1;
26402 val = __Pyx_PyInt_As_Py_intptr_t(tmp);
26407 PyErr_SetString(PyExc_OverflowError,
26408 "value too large to convert to Py_intptr_t");
26409 return (Py_intptr_t) -1;
26410 raise_neg_overflow:
26411 PyErr_SetString(PyExc_OverflowError,
26412 "can't convert negative value to Py_intptr_t");
26413 return (Py_intptr_t) -1;
26417 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
26418 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26419 #pragma GCC diagnostic push
26420 #pragma GCC diagnostic ignored "-Wconversion"
26422 const long neg_one = (long) -1, const_zero = (
long) 0;
26423 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26424 #pragma GCC diagnostic pop
26426 const int is_unsigned = neg_one > const_zero;
26428 if (
sizeof(
long) <
sizeof(long)) {
26429 return PyInt_FromLong((
long) value);
26430 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26431 return PyLong_FromUnsignedLong((
unsigned long) value);
26432 #ifdef HAVE_LONG_LONG
26433 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
26434 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26438 if (
sizeof(
long) <=
sizeof(
long)) {
26439 return PyInt_FromLong((
long) value);
26440 #ifdef HAVE_LONG_LONG
26441 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
26442 return PyLong_FromLongLong((PY_LONG_LONG) value);
26447 int one = 1;
int little = (int)*(
unsigned char *)&one;
26448 unsigned char *bytes = (
unsigned char *)&value;
26449 return _PyLong_FromByteArray(bytes,
sizeof(
long),
26450 little, !is_unsigned);
26455 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
26456 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26457 #pragma GCC diagnostic push
26458 #pragma GCC diagnostic ignored "-Wconversion"
26460 const long neg_one = (long) -1, const_zero = (
long) 0;
26461 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26462 #pragma GCC diagnostic pop
26464 const int is_unsigned = neg_one > const_zero;
26465 #if PY_MAJOR_VERSION < 3
26466 if (likely(PyInt_Check(x))) {
26467 if (
sizeof(
long) <
sizeof(long)) {
26468 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
26470 long val = PyInt_AS_LONG(x);
26471 if (is_unsigned && unlikely(val < 0)) {
26472 goto raise_neg_overflow;
26478 if (likely(PyLong_Check(x))) {
26480 #if CYTHON_USE_PYLONG_INTERNALS
26481 const digit* digits = ((PyLongObject*)x)->ob_digit;
26482 switch (Py_SIZE(x)) {
26483 case 0:
return (
long) 0;
26484 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
26486 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26487 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26488 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26489 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
26490 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26495 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26496 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26497 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26498 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
26499 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26504 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
26505 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26506 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26507 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
26508 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26514 #if CYTHON_COMPILING_IN_CPYTHON
26515 if (unlikely(Py_SIZE(x) < 0)) {
26516 goto raise_neg_overflow;
26520 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26521 if (unlikely(result < 0))
26523 if (unlikely(result == 1))
26524 goto raise_neg_overflow;
26527 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26528 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
26529 #ifdef HAVE_LONG_LONG
26530 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
26531 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26535 #if CYTHON_USE_PYLONG_INTERNALS
26536 const digit* digits = ((PyLongObject*)x)->ob_digit;
26537 switch (Py_SIZE(x)) {
26538 case 0:
return (
long) 0;
26539 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
26540 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
26542 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
26543 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26544 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26545 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26546 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26551 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26552 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26553 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26554 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26555 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26560 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26561 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26562 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26563 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26564 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26569 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26570 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26571 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26572 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26573 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26578 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26579 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26580 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26581 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26582 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26587 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
26588 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26589 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26590 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26591 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26597 if (
sizeof(
long) <=
sizeof(long)) {
26598 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
26599 #ifdef HAVE_LONG_LONG
26600 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
26601 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
26606 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26607 PyErr_SetString(PyExc_RuntimeError,
26608 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26611 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26612 #if PY_MAJOR_VERSION < 3
26613 if (likely(
v) && !PyLong_Check(
v)) {
26615 v = PyNumber_Long(tmp);
26620 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26621 unsigned char *bytes = (
unsigned char *)&val;
26622 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26623 bytes,
sizeof(val),
26624 is_little, !is_unsigned);
26634 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26635 if (!tmp)
return (
long) -1;
26636 val = __Pyx_PyInt_As_long(tmp);
26641 PyErr_SetString(PyExc_OverflowError,
26642 "value too large to convert to long");
26644 raise_neg_overflow:
26645 PyErr_SetString(PyExc_OverflowError,
26646 "can't convert negative value to long");
26651 #if CYTHON_COMPILING_IN_CPYTHON
26652 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26658 return b == &PyBaseObject_Type;
26660 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26662 if (a == b)
return 1;
26666 n = PyTuple_GET_SIZE(mro);
26667 for (i = 0; i <
n; i++) {
26668 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26673 return __Pyx_InBases(a, b);
26675 #if PY_MAJOR_VERSION == 2
26676 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26677 PyObject *exception, *value, *tb;
26679 __Pyx_PyThreadState_declare
26680 __Pyx_PyThreadState_assign
26681 __Pyx_ErrFetch(&exception, &value, &tb);
26682 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26683 if (unlikely(res == -1)) {
26684 PyErr_WriteUnraisable(err);
26688 res = PyObject_IsSubclass(err, exc_type2);
26689 if (unlikely(res == -1)) {
26690 PyErr_WriteUnraisable(err);
26694 __Pyx_ErrRestore(exception, value, tb);
26698 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26699 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26701 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26706 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26708 assert(PyExceptionClass_Check(exc_type));
26709 n = PyTuple_GET_SIZE(tuple);
26710 #if PY_MAJOR_VERSION >= 3
26711 for (i=0; i<
n; i++) {
26712 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26715 for (i=0; i<
n; i++) {
26716 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26717 #if PY_MAJOR_VERSION < 3
26718 if (likely(exc_type == t))
return 1;
26720 if (likely(PyExceptionClass_Check(t))) {
26721 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26727 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26728 if (likely(err == exc_type))
return 1;
26729 if (likely(PyExceptionClass_Check(err))) {
26730 if (likely(PyExceptionClass_Check(exc_type))) {
26731 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26732 }
else if (likely(PyTuple_Check(exc_type))) {
26733 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26737 return PyErr_GivenExceptionMatches(err, exc_type);
26739 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26740 assert(PyExceptionClass_Check(exc_type1));
26741 assert(PyExceptionClass_Check(exc_type2));
26742 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26743 if (likely(PyExceptionClass_Check(err))) {
26744 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26746 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26751 static int __Pyx_check_binary_version(
void) {
26753 int same=1, i, found_dot;
26754 const char* rt_from_call = Py_GetVersion();
26755 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
26757 for (i = 0; i < 4; i++) {
26758 if (!ctversion[i]) {
26759 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
26762 if (rt_from_call[i] != ctversion[i]) {
26768 char rtversion[5] = {
'\0'};
26770 for (i=0; i<4; ++i) {
26771 if (rt_from_call[i] ==
'.') {
26772 if (found_dot)
break;
26774 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
26777 rtversion[i] = rt_from_call[i];
26779 PyOS_snprintf(message,
sizeof(message),
26780 "compiletime version %s of module '%.100s' "
26781 "does not match runtime version %s",
26782 ctversion, __Pyx_MODULE_NAME, rtversion);
26783 return PyErr_WarnEx(NULL, message, 1);
26789 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
26791 #if PY_MAJOR_VERSION < 3
26792 if (t->is_unicode) {
26793 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
26794 }
else if (t->intern) {
26795 *t->p = PyString_InternFromString(t->s);
26797 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
26800 if (t->is_unicode | t->is_str) {
26802 *t->p = PyUnicode_InternFromString(t->s);
26803 }
else if (t->encoding) {
26804 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
26806 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
26809 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
26814 if (PyObject_Hash(*t->p) == -1)
26821 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
26822 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
26824 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
26826 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
26828 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
26829 #if !CYTHON_PEP393_ENABLED
26830 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
26832 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
26833 if (!defenc)
return NULL;
26834 defenc_c = PyBytes_AS_STRING(defenc);
26835 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
26837 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
26839 for (
c = defenc_c;
c < end;
c++) {
26840 if ((
unsigned char) (*
c) >= 128) {
26841 PyUnicode_AsASCIIString(o);
26847 *length = PyBytes_GET_SIZE(defenc);
26851 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
26852 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
26853 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
26854 if (likely(PyUnicode_IS_ASCII(o))) {
26855 *length = PyUnicode_GET_LENGTH(o);
26856 return PyUnicode_AsUTF8(o);
26858 PyUnicode_AsASCIIString(o);
26862 return PyUnicode_AsUTF8AndSize(o, length);
26867 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
26868 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
26870 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
26871 __Pyx_sys_getdefaultencoding_not_ascii &&
26873 PyUnicode_Check(o)) {
26874 return __Pyx_PyUnicode_AsStringAndSize(o, length);
26877 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
26878 if (PyByteArray_Check(o)) {
26879 *length = PyByteArray_GET_SIZE(o);
26880 return PyByteArray_AS_STRING(o);
26885 int r = PyBytes_AsStringAndSize(o, &result, length);
26886 if (unlikely(
r < 0)) {
26893 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
26894 int is_true = x == Py_True;
26895 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
26896 else return PyObject_IsTrue(x);
26898 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
26900 if (unlikely(!x))
return -1;
26901 retval = __Pyx_PyObject_IsTrue(x);
26905 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
26906 #if PY_MAJOR_VERSION >= 3
26907 if (PyLong_Check(result)) {
26908 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
26909 "__int__ returned non-int (type %.200s). "
26910 "The ability to return an instance of a strict subclass of int "
26911 "is deprecated, and may be removed in a future version of Python.",
26912 Py_TYPE(result)->tp_name)) {
26919 PyErr_Format(PyExc_TypeError,
26920 "__%.4s__ returned non-%.4s (type %.200s)",
26921 type_name, type_name, Py_TYPE(result)->tp_name);
26925 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
26926 #if CYTHON_USE_TYPE_SLOTS
26927 PyNumberMethods *m;
26929 const char *name = NULL;
26930 PyObject *res = NULL;
26931 #if PY_MAJOR_VERSION < 3
26932 if (likely(PyInt_Check(x) || PyLong_Check(x)))
26934 if (likely(PyLong_Check(x)))
26936 return __Pyx_NewRef(x);
26937 #if CYTHON_USE_TYPE_SLOTS
26938 m = Py_TYPE(x)->tp_as_number;
26939 #if PY_MAJOR_VERSION < 3
26940 if (m && m->nb_int) {
26942 res = m->nb_int(x);
26944 else if (m && m->nb_long) {
26946 res = m->nb_long(x);
26949 if (likely(m && m->nb_int)) {
26951 res = m->nb_int(x);
26955 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
26956 res = PyNumber_Int(x);
26960 #if PY_MAJOR_VERSION < 3
26961 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
26963 if (unlikely(!PyLong_CheckExact(res))) {
26965 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
26968 else if (!PyErr_Occurred()) {
26969 PyErr_SetString(PyExc_TypeError,
26970 "an integer is required");
26974 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
26977 #if PY_MAJOR_VERSION < 3
26978 if (likely(PyInt_CheckExact(b))) {
26979 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
26980 return PyInt_AS_LONG(b);
26982 return PyInt_AsSsize_t(b);
26985 if (likely(PyLong_CheckExact(b))) {
26986 #if CYTHON_USE_PYLONG_INTERNALS
26987 const digit* digits = ((PyLongObject*)b)->ob_digit;
26988 const Py_ssize_t size = Py_SIZE(b);
26989 if (likely(__Pyx_sst_abs(size) <= 1)) {
26990 ival = likely(size) ? digits[0] : 0;
26991 if (size == -1) ival = -ival;
26996 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
26997 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27001 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27002 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27006 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27007 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27011 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27012 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27016 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27017 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27021 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27022 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27028 return PyLong_AsSsize_t(b);
27030 x = PyNumber_Index(b);
27032 ival = PyInt_AsSsize_t(x);
27036 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
27037 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
27038 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
27039 #if PY_MAJOR_VERSION < 3
27040 }
else if (likely(PyInt_CheckExact(o))) {
27041 return PyInt_AS_LONG(o);
27046 x = PyNumber_Index(o);
27048 ival = PyInt_AsLong(x);
27053 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
27054 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27056 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
27057 return PyInt_FromSize_t(ival);