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]);