proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
subsurfaceTransportFunctions.c
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "depends": [
7 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
8 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
9 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
10 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
11 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h"
12 ],
13 "extra_link_args": [
14 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
15 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
16 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
17 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
18 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
19 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
20 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
21 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
22 ],
23 "include_dirs": [
24 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include",
25 "proteus"
26 ],
27 "name": "subsurfaceTransportFunctions",
28 "sources": [
29 "proteus/subsurfaceTransportFunctions.pyx"
30 ]
31 },
32 "module_name": "subsurfaceTransportFunctions"
33}
34END: Cython Metadata */
35
36#ifndef PY_SSIZE_T_CLEAN
37#define PY_SSIZE_T_CLEAN
38#endif /* PY_SSIZE_T_CLEAN */
39/* InitLimitedAPI */
40#if defined(Py_LIMITED_API)
41 #if !defined(CYTHON_LIMITED_API)
42 #define CYTHON_LIMITED_API 1
43 #endif
44#elif defined(CYTHON_LIMITED_API)
45 #ifdef _MSC_VER
46 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
47 #else
48 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
49 #endif
50#endif
51
52#include "Python.h"
53#ifndef Py_PYTHON_H
54 #error Python headers needed to compile C extensions, please install development version of Python.
55#elif PY_VERSION_HEX < 0x03090000
56 #error Cython requires Python 3.9+.
57#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
58 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
59#else
60#define __PYX_ABI_VERSION "3_3_0"
61#define CYTHON_HEX_VERSION 0x030300F0
62#define CYTHON_FUTURE_DIVISION 1
63/* CModulePreamble */
64#include <stddef.h>
65#ifndef offsetof
66 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
67#endif
68#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
69 #ifndef __stdcall
70 #define __stdcall
71 #endif
72 #ifndef __cdecl
73 #define __cdecl
74 #endif
75 #ifndef __fastcall
76 #define __fastcall
77 #endif
78#endif
79#ifdef __has_builtin
80 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
81#else
82 #define __Pyx_has_cbuiltin(name) (0)
83#endif
84#ifndef DL_IMPORT
85 #define DL_IMPORT(t) t
86#endif
87#ifndef DL_EXPORT
88 #define DL_EXPORT(t) t
89#endif
90#define __PYX_COMMA ,
91#ifndef PY_LONG_LONG
92 #define PY_LONG_LONG LONG_LONG
93#endif
94#ifndef Py_HUGE_VAL
95 #define Py_HUGE_VAL HUGE_VAL
96#endif
97#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
98#if defined(CYTHON_LIMITED_API)
99 #ifdef Py_LIMITED_API
100 #undef __PYX_LIMITED_VERSION_HEX
101 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
102 #if Py_LIMITED_API < 0x03090000
103 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
104 #endif
105 #endif
106 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
107 #ifdef _MSC_VER
108 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
109 code for PyPy and GraalPy and is unlikely to work.")
110 #else
111 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
112 code for PyPy and GraalPy and is unlikely to work."
113 #endif
114 #endif
115 #define CYTHON_COMPILING_IN_PYPY 0
116 #define CYTHON_COMPILING_IN_CPYTHON 0
117 #define CYTHON_COMPILING_IN_LIMITED_API 1
118 #define CYTHON_COMPILING_IN_GRAAL 0
119 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
120 #undef CYTHON_USE_TYPE_SLOTS
121 #define CYTHON_USE_TYPE_SLOTS 0
122 #undef CYTHON_USE_TYPE_SPECS
123 #define CYTHON_USE_TYPE_SPECS 1
124 #undef CYTHON_USE_PYTYPE_LOOKUP
125 #define CYTHON_USE_PYTYPE_LOOKUP 0
126 #undef CYTHON_USE_PYLIST_INTERNALS
127 #define CYTHON_USE_PYLIST_INTERNALS 0
128 #undef CYTHON_USE_UNICODE_INTERNALS
129 #define CYTHON_USE_UNICODE_INTERNALS 0
130 #ifndef CYTHON_USE_UNICODE_WRITER
131 #define CYTHON_USE_UNICODE_WRITER 0
132 #endif
133 #undef CYTHON_USE_PYLONG_INTERNALS
134 #define CYTHON_USE_PYLONG_INTERNALS 0
135 #ifndef CYTHON_AVOID_BORROWED_REFS
136 #define CYTHON_AVOID_BORROWED_REFS 0
137 #endif
138 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
139 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
140 #endif
141 #undef CYTHON_ASSUME_SAFE_MACROS
142 #define CYTHON_ASSUME_SAFE_MACROS 0
143 #undef CYTHON_ASSUME_SAFE_SIZE
144 #define CYTHON_ASSUME_SAFE_SIZE 0
145 #undef CYTHON_UNPACK_METHODS
146 #define CYTHON_UNPACK_METHODS 0
147 #undef CYTHON_FAST_THREAD_STATE
148 #define CYTHON_FAST_THREAD_STATE 0
149 #undef CYTHON_FAST_GIL
150 #define CYTHON_FAST_GIL 0
151 #undef CYTHON_VECTORCALL
152 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
153 #ifndef CYTHON_VECTORCALL_TPNEW
154 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
155 #endif
156 #ifndef CYTHON_PEP487_INIT_SUBCLASS
157 #define CYTHON_PEP487_INIT_SUBCLASS 1
158 #endif
159 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
160 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
161 #endif
162 #ifndef CYTHON_USE_MODULE_STATE
163 #define CYTHON_USE_MODULE_STATE 0
164 #endif
165 #undef CYTHON_USE_SYS_MONITORING
166 #define CYTHON_USE_SYS_MONITORING 0
167 #ifndef CYTHON_USE_TP_FINALIZE
168 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
169 #endif
170 #ifndef CYTHON_USE_AM_SEND
171 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
172 #endif
173 #undef CYTHON_USE_DICT_VERSIONS
174 #define CYTHON_USE_DICT_VERSIONS 0
175 #undef CYTHON_USE_EXC_INFO_STACK
176 #define CYTHON_USE_EXC_INFO_STACK 0
177 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
178 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
179 #endif
180 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
181 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
182 #endif
183 #ifndef CYTHON_USE_FREELISTS
184 #define CYTHON_USE_FREELISTS 1
185 #endif
186 #undef CYTHON_IMMORTAL_CONSTANTS
187 #define CYTHON_IMMORTAL_CONSTANTS 0
188 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
189 #undef CYTHON_OPAQUE_OBJECTS
190 #define CYTHON_OPAQUE_OBJECTS 0
191 #elif !defined(CYTHON_OPAQUE_OBJECTS)
192 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
193 #endif
194#elif defined(GRAALVM_PYTHON)
195 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
196 The existence of this section does not imply that anything works or is even tested */
197 #define CYTHON_COMPILING_IN_PYPY 0
198 #define CYTHON_COMPILING_IN_CPYTHON 0
199 #define CYTHON_COMPILING_IN_LIMITED_API 0
200 #define CYTHON_COMPILING_IN_GRAAL 1
201 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
202 #ifndef CYTHON_USE_TYPE_SLOTS
203 #define CYTHON_USE_TYPE_SLOTS 0
204 #endif
205 #undef CYTHON_USE_TYPE_SPECS
206 #define CYTHON_USE_TYPE_SPECS 0
207 #undef CYTHON_USE_PYTYPE_LOOKUP
208 #define CYTHON_USE_PYTYPE_LOOKUP 0
209 #undef CYTHON_USE_PYLIST_INTERNALS
210 #define CYTHON_USE_PYLIST_INTERNALS 0
211 #undef CYTHON_USE_UNICODE_INTERNALS
212 #define CYTHON_USE_UNICODE_INTERNALS 0
213 #undef CYTHON_USE_UNICODE_WRITER
214 #define CYTHON_USE_UNICODE_WRITER 0
215 #undef CYTHON_USE_PYLONG_INTERNALS
216 #define CYTHON_USE_PYLONG_INTERNALS 0
217 #undef CYTHON_AVOID_BORROWED_REFS
218 #define CYTHON_AVOID_BORROWED_REFS 1
219 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
220 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
221 #undef CYTHON_ASSUME_SAFE_MACROS
222 #define CYTHON_ASSUME_SAFE_MACROS 0
223 #undef CYTHON_ASSUME_SAFE_SIZE
224 #define CYTHON_ASSUME_SAFE_SIZE 0
225 #undef CYTHON_UNPACK_METHODS
226 #define CYTHON_UNPACK_METHODS 0
227 #undef CYTHON_FAST_THREAD_STATE
228 #define CYTHON_FAST_THREAD_STATE 0
229 #undef CYTHON_FAST_GIL
230 #define CYTHON_FAST_GIL 0
231 #ifndef CYTHON_VECTORCALL
232 #define CYTHON_VECTORCALL 1
233 #endif
234 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
235 #undef CYTHON_VECTORCALL_TPNEW
236 #define CYTHON_VECTORCALL_TPNEW 0
237 #elif !defined(CYTHON_VECTORCALL_TPNEW)
238 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
239 #endif
240 #ifndef CYTHON_PEP487_INIT_SUBCLASS
241 #define CYTHON_PEP487_INIT_SUBCLASS 1
242 #endif
243 #undef CYTHON_PEP489_MULTI_PHASE_INIT
244 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
245 #undef CYTHON_USE_MODULE_STATE
246 #define CYTHON_USE_MODULE_STATE 0
247 #undef CYTHON_USE_SYS_MONITORING
248 #define CYTHON_USE_SYS_MONITORING 0
249 #undef CYTHON_USE_TP_FINALIZE
250 #define CYTHON_USE_TP_FINALIZE 0
251 #undef CYTHON_USE_AM_SEND
252 #define CYTHON_USE_AM_SEND 0
253 #undef CYTHON_USE_DICT_VERSIONS
254 #define CYTHON_USE_DICT_VERSIONS 0
255 #undef CYTHON_USE_EXC_INFO_STACK
256 #define CYTHON_USE_EXC_INFO_STACK 1
257 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
258 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
259 #endif
260 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
261 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
262 #endif
263 #undef CYTHON_USE_FREELISTS
264 #define CYTHON_USE_FREELISTS 0
265 #undef CYTHON_IMMORTAL_CONSTANTS
266 #define CYTHON_IMMORTAL_CONSTANTS 0
267 #undef CYTHON_OPAQUE_OBJECTS
268 #define CYTHON_OPAQUE_OBJECTS 0
269#elif defined(PYPY_VERSION)
270 #define CYTHON_COMPILING_IN_PYPY 1
271 #define CYTHON_COMPILING_IN_CPYTHON 0
272 #define CYTHON_COMPILING_IN_LIMITED_API 0
273 #define CYTHON_COMPILING_IN_GRAAL 0
274 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
275 #undef CYTHON_USE_TYPE_SLOTS
276 #define CYTHON_USE_TYPE_SLOTS 1
277 #ifndef CYTHON_USE_TYPE_SPECS
278 #define CYTHON_USE_TYPE_SPECS 0
279 #endif
280 #undef CYTHON_USE_PYTYPE_LOOKUP
281 #define CYTHON_USE_PYTYPE_LOOKUP 0
282 #undef CYTHON_USE_PYLIST_INTERNALS
283 #define CYTHON_USE_PYLIST_INTERNALS 0
284 #undef CYTHON_USE_UNICODE_INTERNALS
285 #define CYTHON_USE_UNICODE_INTERNALS 0
286 #undef CYTHON_USE_UNICODE_WRITER
287 #define CYTHON_USE_UNICODE_WRITER 0
288 #undef CYTHON_USE_PYLONG_INTERNALS
289 #define CYTHON_USE_PYLONG_INTERNALS 0
290 #undef CYTHON_AVOID_BORROWED_REFS
291 #define CYTHON_AVOID_BORROWED_REFS 1
292 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
293 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
294 #undef CYTHON_ASSUME_SAFE_MACROS
295 #define CYTHON_ASSUME_SAFE_MACROS 0
296 #ifndef CYTHON_ASSUME_SAFE_SIZE
297 #define CYTHON_ASSUME_SAFE_SIZE 1
298 #endif
299 #undef CYTHON_UNPACK_METHODS
300 #define CYTHON_UNPACK_METHODS 0
301 #undef CYTHON_FAST_THREAD_STATE
302 #define CYTHON_FAST_THREAD_STATE 0
303 #undef CYTHON_FAST_GIL
304 #define CYTHON_FAST_GIL 0
305 #ifndef CYTHON_VECTORCALL
306 #define CYTHON_VECTORCALL 1
307 #endif
308 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
309 #undef CYTHON_VECTORCALL_TPNEW
310 #define CYTHON_VECTORCALL_TPNEW 0
311 #elif !defined(CYTHON_VECTORCALL_TPNEW)
312 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
313 #endif
314 #ifndef CYTHON_PEP487_INIT_SUBCLASS
315 #define CYTHON_PEP487_INIT_SUBCLASS 1
316 #endif
317 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
318 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
319 #endif
320 #undef CYTHON_USE_MODULE_STATE
321 #define CYTHON_USE_MODULE_STATE 0
322 #undef CYTHON_USE_SYS_MONITORING
323 #define CYTHON_USE_SYS_MONITORING 0
324 #ifndef CYTHON_USE_TP_FINALIZE
325 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
326 #endif
327 #undef CYTHON_USE_AM_SEND
328 #define CYTHON_USE_AM_SEND 0
329 #undef CYTHON_USE_DICT_VERSIONS
330 #define CYTHON_USE_DICT_VERSIONS 0
331 #undef CYTHON_USE_EXC_INFO_STACK
332 #define CYTHON_USE_EXC_INFO_STACK 0
333 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
334 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
335 #endif
336 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
337 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
338 #endif
339 #undef CYTHON_USE_FREELISTS
340 #define CYTHON_USE_FREELISTS 0
341 #undef CYTHON_IMMORTAL_CONSTANTS
342 #define CYTHON_IMMORTAL_CONSTANTS 0
343 #undef CYTHON_OPAQUE_OBJECTS
344 #define CYTHON_OPAQUE_OBJECTS 0
345#else
346 #define CYTHON_COMPILING_IN_PYPY 0
347 #define CYTHON_COMPILING_IN_CPYTHON 1
348 #define CYTHON_COMPILING_IN_LIMITED_API 0
349 #define CYTHON_COMPILING_IN_GRAAL 0
350 #ifdef Py_GIL_DISABLED
351 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
352 #else
353 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
354 #endif
355 #if PY_VERSION_HEX < 0x030A0000
356 #undef CYTHON_USE_TYPE_SLOTS
357 #define CYTHON_USE_TYPE_SLOTS 1
358 #elif !defined(CYTHON_USE_TYPE_SLOTS)
359 #define CYTHON_USE_TYPE_SLOTS 1
360 #endif
361 #ifndef CYTHON_USE_TYPE_SPECS
362 #define CYTHON_USE_TYPE_SPECS 0
363 #endif
364 #ifndef CYTHON_USE_PYTYPE_LOOKUP
365 #define CYTHON_USE_PYTYPE_LOOKUP 1
366 #endif
367 #ifndef CYTHON_USE_PYLONG_INTERNALS
368 #define CYTHON_USE_PYLONG_INTERNALS 1
369 #endif
370 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
371 #undef CYTHON_USE_PYLIST_INTERNALS
372 #define CYTHON_USE_PYLIST_INTERNALS 0
373 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
374 #define CYTHON_USE_PYLIST_INTERNALS 1
375 #endif
376 #ifndef CYTHON_USE_UNICODE_INTERNALS
377 #define CYTHON_USE_UNICODE_INTERNALS 1
378 #endif
379 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
380 #undef CYTHON_USE_UNICODE_WRITER
381 #define CYTHON_USE_UNICODE_WRITER 0
382 #elif !defined(CYTHON_USE_UNICODE_WRITER)
383 #define CYTHON_USE_UNICODE_WRITER 1
384 #endif
385 #ifndef CYTHON_AVOID_BORROWED_REFS
386 #define CYTHON_AVOID_BORROWED_REFS 0
387 #endif
388 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
389 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
390 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
391 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
392 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
393 #endif
394 #ifndef CYTHON_ASSUME_SAFE_MACROS
395 #define CYTHON_ASSUME_SAFE_MACROS 1
396 #endif
397 #ifndef CYTHON_ASSUME_SAFE_SIZE
398 #define CYTHON_ASSUME_SAFE_SIZE 1
399 #endif
400 #ifndef CYTHON_UNPACK_METHODS
401 #define CYTHON_UNPACK_METHODS 1
402 #endif
403 #ifndef CYTHON_FAST_THREAD_STATE
404 #define CYTHON_FAST_THREAD_STATE 1
405 #endif
406 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
407 #undef CYTHON_FAST_GIL
408 #define CYTHON_FAST_GIL 0
409 #elif !defined(CYTHON_FAST_GIL)
410 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
411 #endif
412 #ifndef CYTHON_VECTORCALL
413 #define CYTHON_VECTORCALL 1
414 #endif
415 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
416 #undef CYTHON_VECTORCALL_TPNEW
417 #define CYTHON_VECTORCALL_TPNEW 0
418 #elif !defined(CYTHON_VECTORCALL_TPNEW)
419 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
420 #endif
421 #ifndef CYTHON_PEP487_INIT_SUBCLASS
422 #define CYTHON_PEP487_INIT_SUBCLASS 1
423 #endif
424 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
425 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
426 #endif
427 #ifndef CYTHON_USE_MODULE_STATE
428 #define CYTHON_USE_MODULE_STATE 0
429 #endif
430 #ifndef CYTHON_USE_SYS_MONITORING
431 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
432 #endif
433 #ifndef CYTHON_USE_TP_FINALIZE
434 #define CYTHON_USE_TP_FINALIZE 1
435 #endif
436 #ifndef CYTHON_USE_AM_SEND
437 #define CYTHON_USE_AM_SEND 1
438 #endif
439 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
440 #undef CYTHON_USE_DICT_VERSIONS
441 #define CYTHON_USE_DICT_VERSIONS 0
442 #elif !defined(CYTHON_USE_DICT_VERSIONS)
443 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
444 #endif
445 #ifndef CYTHON_USE_EXC_INFO_STACK
446 #define CYTHON_USE_EXC_INFO_STACK 1
447 #endif
448 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
449 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
450 #endif
451 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
452 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
453 #endif
454 #ifndef CYTHON_USE_FREELISTS
455 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
456 #endif
457 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
458 #undef CYTHON_IMMORTAL_CONSTANTS
459 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
460 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
461 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
462 #endif
463 #ifndef CYTHON_OPAQUE_OBJECTS
464 #define CYTHON_OPAQUE_OBJECTS 0
465 #endif
466#endif
467#if CYTHON_USE_PYLONG_INTERNALS
468 #undef SHIFT
469 #undef BASE
470 #undef MASK
471 #ifdef SIZEOF_VOID_P
472 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
473 #endif
474#endif
475#ifndef __has_attribute
476 #define __has_attribute(x) 0
477#endif
478#ifndef __has_cpp_attribute
479 #define __has_cpp_attribute(x) 0
480#endif
481#ifndef CYTHON_RESTRICT
482 #if defined(__GNUC__)
483 #define CYTHON_RESTRICT __restrict__
484 #elif defined(_MSC_VER) && _MSC_VER >= 1400
485 #define CYTHON_RESTRICT __restrict
486 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
487 #define CYTHON_RESTRICT restrict
488 #else
489 #define CYTHON_RESTRICT
490 #endif
491#endif
492#ifndef CYTHON_UNUSED
493 #if defined(__cplusplus)
494 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
495 * but leads to warnings with -pedantic, since it is a C++17 feature */
496 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
497 #if __has_cpp_attribute(maybe_unused)
498 #define CYTHON_UNUSED [[maybe_unused]]
499 #endif
500 #endif
501 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
502 #define CYTHON_UNUSED [[maybe_unused]]
503 #endif
504#endif
505#ifndef CYTHON_UNUSED
506# if defined(__GNUC__)
507# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
508# define CYTHON_UNUSED __attribute__ ((__unused__))
509# else
510# define CYTHON_UNUSED
511# endif
512# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
513# define CYTHON_UNUSED __attribute__ ((__unused__))
514# else
515# define CYTHON_UNUSED
516# endif
517#endif
518#ifndef CYTHON_UNUSED_VAR
519# if defined(__cplusplus)
520 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
521# else
522# define CYTHON_UNUSED_VAR(x) (void)(x)
523# endif
524#endif
525#ifndef CYTHON_MAYBE_UNUSED_VAR
526 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
527#endif
528#ifndef CYTHON_NCP_UNUSED
529# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
530# define CYTHON_NCP_UNUSED
531# else
532# define CYTHON_NCP_UNUSED CYTHON_UNUSED
533# endif
534#endif
535#ifndef CYTHON_USE_CPP_STD_MOVE
536 #if defined(__cplusplus) && (\
537 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
538 #define CYTHON_USE_CPP_STD_MOVE 1
539 #else
540 #define CYTHON_USE_CPP_STD_MOVE 0
541 #endif
542#endif
543#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
544#include <stdint.h>
545typedef uintptr_t __pyx_uintptr_t;
546#ifndef CYTHON_FALLTHROUGH
547 #if defined(__cplusplus)
548 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
549 * but leads to warnings with -pedantic, since it is a C++17 feature */
550 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
551 #if __has_cpp_attribute(fallthrough)
552 #define CYTHON_FALLTHROUGH [[fallthrough]]
553 #endif
554 #endif
555 #ifndef CYTHON_FALLTHROUGH
556 #if __has_cpp_attribute(clang::fallthrough)
557 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
558 #elif __has_cpp_attribute(gnu::fallthrough)
559 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
560 #endif
561 #endif
562 #endif
563 #ifndef CYTHON_FALLTHROUGH
564 #if __has_attribute(fallthrough)
565 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
566 #else
567 #define CYTHON_FALLTHROUGH
568 #endif
569 #endif
570 #if defined(__clang__) && defined(__apple_build_version__)
571 #if __apple_build_version__ < 7000000
572 #undef CYTHON_FALLTHROUGH
573 #define CYTHON_FALLTHROUGH
574 #endif
575 #endif
576#endif
577#ifdef Py_UNREACHABLE
578 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
579#elif __Pyx_has_cbuiltin(__builtin_unreachable)
580 #define __Pyx_UNREACHABLE() __builtin_unreachable()
581#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
582 #define __Pyx_UNREACHABLE() __builtin_unreachable()
583#elif defined(_MSC_VER)
584 #define __Pyx_UNREACHABLE() __assume(0)
585#else
586 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
587#endif
588#ifndef Py_UNREACHABLE
589 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
590#endif
591#ifdef __cplusplus
592 template <typename T>
593 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
594 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
595#else
596 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
597#endif
598#if CYTHON_COMPILING_IN_PYPY == 1
599 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
600#else
601 #define __PYX_NEED_TP_PRINT_SLOT 0
602#endif
603#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
604#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
605#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
606#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
607#else
608#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
609#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
610#endif
611
612/* CInitCode */
613#ifndef CYTHON_INLINE
614 #if defined(__clang__)
615 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
616 #elif defined(__GNUC__)
617 #define CYTHON_INLINE __inline__
618 #elif defined(_MSC_VER)
619 #define CYTHON_INLINE __inline
620 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
621 #define CYTHON_INLINE inline
622 #else
623 #define CYTHON_INLINE
624 #endif
625#endif
626
627/* PythonCompatibility */
628#define __PYX_BUILD_PY_SSIZE_T "n"
629#define CYTHON_FORMAT_SSIZE_T "z"
630#define __Pyx_BUILTIN_MODULE_NAME "builtins"
631#define __Pyx_DefaultClassType PyType_Type
632#if CYTHON_COMPILING_IN_LIMITED_API
633 #ifndef CO_OPTIMIZED
634 static int CO_OPTIMIZED;
635 #endif
636 #ifndef CO_NEWLOCALS
637 static int CO_NEWLOCALS;
638 #endif
639 #ifndef CO_VARARGS
640 static int CO_VARARGS;
641 #endif
642 #ifndef CO_VARKEYWORDS
643 static int CO_VARKEYWORDS;
644 #endif
645 #ifndef CO_ASYNC_GENERATOR
646 static int CO_ASYNC_GENERATOR;
647 #endif
648 #ifndef CO_GENERATOR
649 static int CO_GENERATOR;
650 #endif
651 #ifndef CO_COROUTINE
652 static int CO_COROUTINE;
653 #endif
654#else
655 #ifndef CO_COROUTINE
656 #define CO_COROUTINE 0x80
657 #endif
658 #ifndef CO_ASYNC_GENERATOR
659 #define CO_ASYNC_GENERATOR 0x200
660 #endif
661#endif
662static int __Pyx_init_co_variables(void);
663#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
664 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
665#else
666 #define __Pyx_Py_Is(x, y) ((x) == (y))
667#endif
668#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
669 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
670#else
671 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
672#endif
673#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
674 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
675#else
676 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
677#endif
678#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
679 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
680#else
681 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
682#endif
683#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
684#if CYTHON_COMPILING_IN_PYPY
685 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
686#else
687 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
688#endif
689#if CYTHON_COMPILING_IN_LIMITED_API
690static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
691static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
692#else
693#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
694#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
695#endif
696static int __Pyx_init_tpflags_variables(void);
697#ifndef Py_TPFLAGS_HAVE_FINALIZE
698 #define Py_TPFLAGS_HAVE_FINALIZE 0
699#endif
700#ifndef Py_TPFLAGS_SEQUENCE
701 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
702#endif
703#ifndef Py_TPFLAGS_MAPPING
704 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
705#endif
706#ifndef Py_TPFLAGS_IMMUTABLETYPE
707 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
708#endif
709#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
710 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
711#endif
712#ifndef METH_STACKLESS
713 #define METH_STACKLESS 0
714#endif
715#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
716 #ifndef METH_FASTCALL
717 #define METH_FASTCALL 0x80
718 #endif
719 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
720 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
721 Py_ssize_t nargs, PyObject *kwnames);
722#else
723 #if PY_VERSION_HEX >= 0x030d00A4
724 # define __Pyx_PyCFunctionFast PyCFunctionFast
725 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
726 #else
727 # define __Pyx_PyCFunctionFast _PyCFunctionFast
728 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
729 #endif
730#endif
731#if CYTHON_VECTORCALL
732 #define __Pyx_METH_FASTCALL METH_FASTCALL
733 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
734 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
735#else
736 #define __Pyx_METH_FASTCALL METH_VARARGS
737 #define __Pyx_PyCFunction_FastCall PyCFunction
738 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
739#endif
740#if CYTHON_VECTORCALL
741 #define __pyx_vectorcallfunc vectorcallfunc
742 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
743 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
744#else
745 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
746 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
747#endif
748#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
749#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
750#if CYTHON_COMPILING_IN_CPYTHON
751#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
752#elif !CYTHON_COMPILING_IN_LIMITED_API
753#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
754#endif
755#if CYTHON_COMPILING_IN_CPYTHON
756#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
757static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
758 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
759}
760#endif
761static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
762#if CYTHON_COMPILING_IN_LIMITED_API
763 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
764#else
765 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
766#endif
767}
768#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
769#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
770 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
771#else
772 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
773#endif
774#if CYTHON_COMPILING_IN_PYPY
775 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
776#else
777 #define __Pyx_PyCMethod PyCMethod
778#endif
779#ifndef METH_METHOD
780 #define METH_METHOD 0x200
781#endif
782#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
783 #define PyObject_Malloc(s) PyMem_Malloc(s)
784 #define PyObject_Free(p) PyMem_Free(p)
785 #define PyObject_Realloc(p) PyMem_Realloc(p)
786#endif
787#if CYTHON_COMPILING_IN_LIMITED_API
788 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
789#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
790 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
791 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
792#elif CYTHON_COMPILING_IN_GRAAL
793 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
794 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
795#else
796 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
797 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
798#endif
799#if CYTHON_COMPILING_IN_LIMITED_API
800 #define __Pyx_PyThreadState_Current PyThreadState_Get()
801#elif !CYTHON_FAST_THREAD_STATE
802 #define __Pyx_PyThreadState_Current PyThreadState_GET()
803#elif PY_VERSION_HEX >= 0x030d00A1
804 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
805#else
806 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
807#endif
808#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
809 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
810 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
811 #define CYTHON_OPAQUE_SHARED_TYPES 1
812#else
813 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
814 #define __PYX_SHARED_RELATIVE_OFFSET 0
815 #define CYTHON_OPAQUE_SHARED_TYPES 0
816#endif
817#if CYTHON_USE_MODULE_STATE
818static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
819{
820 void *result;
821 result = PyModule_GetState(op);
822 if (!result)
823 Py_FatalError("Couldn't find the module state");
824 return result;
825}
826#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
827#else
828#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
829#endif
830#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
831#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
832#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
833#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
834#if CYTHON_USE_TYPE_SLOTS
835 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
836 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
837 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
838 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
839#else
840 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
841 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
842 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
843 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
844 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
845 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
846 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
847#endif
848#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
849#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
850#else
851#define __Pyx_PyDict_NewPresized(n) PyDict_New()
852#endif
853#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
854#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
855#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
856#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
857static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
858 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
859 if (res == NULL && PyErr_Occurred()) {
860 PyErr_WriteUnraisable(NULL);
861 }
862 return res;
863}
864#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
865#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
866#define __Pyx_PyDict_GetItemStr PyDict_GetItem
867#else
868static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
869#if CYTHON_COMPILING_IN_PYPY
870 return PyDict_GetItem(dict, name);
871#else
872 PyDictEntry *ep;
873 PyDictObject *mp = (PyDictObject*) dict;
874 long hash = ((PyStringObject *) name)->ob_shash;
875 assert(hash != -1);
876 ep = (mp->ma_lookup)(mp, name, hash);
877 if (ep == NULL) {
878 return NULL;
879 }
880 return ep->me_value;
881#endif
882}
883#define __Pyx_PyDict_GetItemStr PyDict_GetItem
884#endif
885#if CYTHON_USE_TYPE_SLOTS
886 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
887 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
888#else
889 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
890 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
891#endif
892#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
893#if CYTHON_USE_TYPE_SPECS
894#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
895 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
896 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
897 PyObject_GC_Del(obj);\
898 Py_DECREF(type);\
899}
900#else
901#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
902#endif
903#if CYTHON_COMPILING_IN_LIMITED_API
904 #define __Pyx_PyUnicode_READY(op) (0)
905 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
906 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
907 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
908 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
909 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
910 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
911 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
912#else
913 #if PY_VERSION_HEX >= 0x030C0000
914 #define __Pyx_PyUnicode_READY(op) (0)
915 #else
916 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
917 0 : _PyUnicode_Ready((PyObject *)(op)))
918 #endif
919 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
920 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
921 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
922 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
923 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
924 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
925 #if PY_VERSION_HEX >= 0x030C0000
926 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
927 #else
928 #if CYTHON_COMPILING_IN_CPYTHON
929 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
930 #else
931 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
932 #endif
933 #endif
934 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
935 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
936 }
937#endif
938#if CYTHON_COMPILING_IN_PYPY
939 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
940 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
941#else
942 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
943 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
944 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
945#endif
946#if CYTHON_COMPILING_IN_PYPY
947 #if !defined(PyUnicode_DecodeUnicodeEscape)
948 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
949 #endif
950 #if !defined(PyUnicode_Contains)
951 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
952 #endif
953 #if !defined(PyByteArray_Check)
954 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
955 #endif
956 #if !defined(PyObject_Format)
957 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
958 #endif
959#endif
960#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
961#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
962 #define __Pyx_PySequence_ListKeepNew(obj)\
963 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
964#elif CYTHON_COMPILING_IN_CPYTHON
965 #define __Pyx_PySequence_ListKeepNew(obj)\
966 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
967#else
968 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
969#endif
970#ifndef PySet_CheckExact
971 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
972#endif
973enum __Pyx_ReferenceSharing {
974 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
975 __Pyx_ReferenceSharing_OwnStrongReference,
976 __Pyx_ReferenceSharing_FunctionArgument,
977 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
978};
979#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
980#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
981 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
982 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
983 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
984#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
985#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
986#else
987#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
988#endif
989#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
990 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
991#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
992 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
993 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
994 #else
995 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
996 #endif
997#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
998 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
999#else
1000 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1001 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1002#endif
1003#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1004 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1005 __Pyx_PyList_GetItemRef(o, i))
1006#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1007 #if CYTHON_ASSUME_SAFE_MACROS
1008 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1009 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1010 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1011 #else
1012 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1013 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1014 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1015 #endif
1016#elif CYTHON_ASSUME_SAFE_MACROS
1017 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1018 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1019#else
1020 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1021 __Pyx_XNewRef(PyList_GetItem(o, i)))
1022#endif
1023#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1024#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1025#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1026static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1027 *result = PyObject_GetItem(dict, key);
1028 if (*result == NULL) {
1029 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1030 PyErr_Clear();
1031 return 0;
1032 }
1033 return -1;
1034 }
1035 return 1;
1036}
1037#else
1038static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1039 *result = PyDict_GetItemWithError(dict, key);
1040 if (*result == NULL) {
1041 return PyErr_Occurred() ? -1 : 0;
1042 }
1043 Py_INCREF(*result);
1044 return 1;
1045}
1046#endif
1047#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1048 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1049#else
1050 #define __Pyx_VISIT_CONST(obj)
1051#endif
1052#if CYTHON_ASSUME_SAFE_MACROS
1053 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1054 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1055 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1056 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1057 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1058 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1059#else
1060 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1061 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1062 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1063 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1064 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1065 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1066#endif
1067#if CYTHON_ASSUME_SAFE_SIZE
1068 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1069 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1070 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1071 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1072 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1073 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1074 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1075#else
1076 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1077 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1078 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1079 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1080 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1081 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1082 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1083#endif
1084#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1085 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1086#endif
1087#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1088#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1089#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1090 #define __Pyx_PySendResult PySendResult
1091#else
1092 typedef enum {
1093 PYGEN_RETURN = 0,
1094 PYGEN_ERROR = -1,
1095 PYGEN_NEXT = 1,
1096 } __Pyx_PySendResult;
1097#endif
1098#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1099 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1100#else
1101 #define __Pyx_pyiter_sendfunc sendfunc
1102#endif
1103#if !CYTHON_USE_AM_SEND
1104#define __PYX_HAS_PY_AM_SEND 0
1105#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1106#define __PYX_HAS_PY_AM_SEND 1
1107#else
1108#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1109#endif
1110#if __PYX_HAS_PY_AM_SEND < 2
1111 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1112#else
1113 typedef struct {
1114 unaryfunc am_await;
1115 unaryfunc am_aiter;
1116 unaryfunc am_anext;
1117 __Pyx_pyiter_sendfunc am_send;
1118 } __Pyx_PyAsyncMethodsStruct;
1119 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1120#endif
1121#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1122 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1123#else
1124 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1125#endif
1126#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1127#ifdef __cplusplus
1128extern "C"
1129#endif
1130PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1131#endif
1132#if CYTHON_COMPILING_IN_LIMITED_API
1133static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1134 int value;
1135 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1136 if (!py_value) return 0;
1137 value = (int) PyLong_AsLong(py_value);
1138 Py_DECREF(py_value);
1139 *write_to = value;
1140 return value != -1 || !PyErr_Occurred();
1141}
1142static int __Pyx_init_co_variables(void) {
1143 PyObject *inspect;
1144 int result;
1145 inspect = PyImport_ImportModule("inspect");
1146 result =
1147#if !defined(CO_OPTIMIZED)
1148 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1149#endif
1150#if !defined(CO_NEWLOCALS)
1151 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1152#endif
1153#if !defined(CO_VARARGS)
1154 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1155#endif
1156#if !defined(CO_VARKEYWORDS)
1157 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1158#endif
1159#if !defined(CO_ASYNC_GENERATOR)
1160 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1161#endif
1162#if !defined(CO_GENERATOR)
1163 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1164#endif
1165#if !defined(CO_COROUTINE)
1166 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1167#endif
1168 1;
1169 Py_DECREF(inspect);
1170 return result ? 0 : -1;
1171}
1172static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1173 int count = 0;
1174 while (flag) {
1175 count += (int) (flag & 1);
1176 flag >>= 1;
1177 }
1178 return count;
1179}
1180static int __Pyx_init_tpflags_variables(void) {
1181 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1182 return 0;
1183 }
1184 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1185 if (!collections_abc) return -1;
1186 int result = 0;
1187 PyObject *sequence = NULL, *mapping = NULL;
1188#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1189 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1190 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1191#else
1192 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1193 if (!sequence) goto fail_attr_lookup;
1194 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1195 if (!mapping) goto fail_attr_lookup;
1196#endif
1197 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1198 {
1199 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1200 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1201 unsigned long mutual_flags = sequence_flags & mapping_flags;
1202 sequence_flags = sequence_flags ^ mutual_flags;
1203 mapping_flags = mapping_flags ^ mutual_flags;
1204 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1205 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1206 }
1207 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1208 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1209 }
1210 }
1211 cleanup:
1212 Py_XDECREF(mapping);
1213 Py_XDECREF(sequence);
1214 Py_DECREF(collections_abc);
1215 return result;
1216#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1217 fail_attr_lookup:
1218 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1219 PyErr_Clear();
1220 }
1221#endif
1222 fail:
1223 result = PyErr_Occurred() ? -1 : 0;
1224 goto cleanup;
1225}
1226#else
1227static int __Pyx_init_co_variables(void) {
1228 return 0; // It's a limited API-only feature
1229}
1230static int __Pyx_init_tpflags_variables(void) {
1231 return 0; // It's a limited API-only feature
1232}
1233#endif
1234
1235/* MathInitCode */
1236#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1237 #ifndef _USE_MATH_DEFINES
1238 #define _USE_MATH_DEFINES
1239 #endif
1240#endif
1241#include <math.h>
1242#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1243#define __Pyx_truncl trunc
1244#else
1245#define __Pyx_truncl truncl
1246#endif
1247
1248#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1249#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1250#endif
1251#ifndef CYTHON_CLINE_IN_TRACEBACK
1252#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1253#endif
1254#if CYTHON_CLINE_IN_TRACEBACK
1255#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1256#else
1257#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1258#endif
1259#define __PYX_ERR(f_index, lineno, Ln_error) \
1260 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1261
1262#ifdef CYTHON_EXTERN_C
1263 #undef __PYX_EXTERN_C
1264 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1265#elif defined(__PYX_EXTERN_C)
1266 #ifdef _MSC_VER
1267 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1268 #else
1269 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1270 #endif
1271#else
1272 #ifdef __cplusplus
1273 #define __PYX_EXTERN_C extern "C"
1274 #else
1275 #define __PYX_EXTERN_C extern
1276 #endif
1277#endif
1278
1279#define __PYX_HAVE__subsurfaceTransportFunctions
1280#define __PYX_HAVE_API__subsurfaceTransportFunctions
1281/* Early includes */
1282#include <string.h>
1283#include <stdio.h>
1284
1285 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1286
1287#include "numpy/arrayobject.h"
1288#include "numpy/ndarrayobject.h"
1289#include "numpy/ndarraytypes.h"
1290#include "numpy/arrayscalars.h"
1291#include "numpy/ufuncobject.h"
1292#include "math.h"
1293#ifdef _OPENMP
1294#include <omp.h>
1295#endif /* _OPENMP */
1296
1297#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1298#define CYTHON_WITHOUT_ASSERTIONS
1299#endif
1300
1301#ifdef CYTHON_FREETHREADING_COMPATIBLE
1302#if CYTHON_FREETHREADING_COMPATIBLE
1303#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1304#else
1305#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1306#endif
1307#else
1308#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1309#endif
1310#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1311#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1312#define __PYX_DEFAULT_STRING_ENCODING ""
1313#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1314#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1315#define __Pyx_uchar_cast(c) ((unsigned char)c)
1316#define __Pyx_long_cast(x) ((long)x)
1317#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1318 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1319 (sizeof(type) > sizeof(Py_ssize_t) &&\
1320 likely(v < (type)PY_SSIZE_T_MAX ||\
1321 v == (type)PY_SSIZE_T_MAX) &&\
1322 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1323 v == (type)PY_SSIZE_T_MIN))) ||\
1324 (sizeof(type) == sizeof(Py_ssize_t) &&\
1325 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1326 v == (type)PY_SSIZE_T_MAX))) )
1327static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1328 return (size_t) i < (size_t) limit;
1329}
1330#if defined (__cplusplus) && __cplusplus >= 201103L
1331 #include <cstdlib>
1332 #define __Pyx_sst_abs(value) std::abs(value)
1333#elif SIZEOF_INT >= SIZEOF_SIZE_T
1334 #define __Pyx_sst_abs(value) abs(value)
1335#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1336 #define __Pyx_sst_abs(value) labs(value)
1337#elif defined (_MSC_VER)
1338 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1339#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1340 #define __Pyx_sst_abs(value) llabs(value)
1341#elif defined (__GNUC__)
1342 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1343#else
1344 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1345#endif
1346static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1347static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1348static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1349static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1350#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1351#define __Pyx_PyBytes_FromString PyBytes_FromString
1352#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1353static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1354#if CYTHON_ASSUME_SAFE_MACROS
1355 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1356 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1357 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1358 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1359 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1360 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1361 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1362#else
1363 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1364 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1365 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1366 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1367 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1368 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1369 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1370#endif
1371#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1372#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1373#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1374#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1375#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1376#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1377#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1378#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1379#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1380#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1381#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1382static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1383#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1384 return Py_NewRef(obj);
1385#else
1386 Py_INCREF(obj);
1387 return obj;
1388#endif
1389}
1390static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1391#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1392 return Py_XNewRef(obj);
1393#else
1394 Py_XINCREF(obj);
1395 return obj;
1396#endif
1397}
1398static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1399static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1400static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1401static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1402static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1403#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1404#define __Pyx_PySequence_Tuple(obj)\
1405 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1406static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1407static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1408static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1409#if CYTHON_ASSUME_SAFE_MACROS
1410#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1411#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1412#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1413#else
1414#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1415#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1416#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1417#endif
1418#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1419#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1420#if CYTHON_USE_PYLONG_INTERNALS
1421 #if PY_VERSION_HEX >= 0x030C00A7
1422 #ifndef _PyLong_SIGN_MASK
1423 #define _PyLong_SIGN_MASK 3
1424 #endif
1425 #ifndef _PyLong_NON_SIZE_BITS
1426 #define _PyLong_NON_SIZE_BITS 3
1427 #endif
1428 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1429 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1430 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1431 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1432 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1433 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1434 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1435 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1436 #define __Pyx_PyLong_SignedDigitCount(x)\
1437 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1438 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1439 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1440 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1441 #else
1442 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1443 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1444 #endif
1445 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1446 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1447 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1448 if (tag_a == tag_b) return 0;
1449 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1450 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1451 if (sign_a > sign_b) return -1;
1452 if (sign_a < sign_b) return 1;
1453 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1454 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1455 return (1 - sign_a) * (size_a - size_b);
1456 }
1457 typedef Py_ssize_t __Pyx_compact_pylong;
1458 typedef size_t __Pyx_compact_upylong;
1459 #else
1460 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1461 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1462 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1463 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1464 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1465 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1466 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1467 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1468 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1469 #define __Pyx_PyLong_CompactValue(x)\
1470 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1471 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1472 typedef sdigit __Pyx_compact_pylong;
1473 typedef digit __Pyx_compact_upylong;
1474 #endif
1475 #if PY_VERSION_HEX >= 0x030C00A5
1476 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1477 #else
1478 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1479 #endif
1480 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1481#else
1482 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1483#endif
1484#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1485 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1486#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1487 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1488#else
1489 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1490#endif
1491
1492
1493/* Test for GCC > 2.95 */
1494#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1495 #define likely(x) __builtin_expect(!!(x), 1)
1496 #define unlikely(x) __builtin_expect(!!(x), 0)
1497#else /* !__GNUC__ or GCC < 2.95 */
1498 #define likely(x) (x)
1499 #define unlikely(x) (x)
1500#endif /* __GNUC__ */
1501/* PretendToInitialize */
1502#ifdef __cplusplus
1503#if __cplusplus > 201103L
1504#include <type_traits>
1505#endif
1506template <typename T>
1507static void __Pyx_pretend_to_initialize(T* ptr) {
1508#if __cplusplus > 201103L
1509 if ((std::is_trivially_default_constructible<T>::value))
1510#endif
1511 *ptr = T();
1512 (void)ptr;
1513}
1514#else
1515static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1516#endif
1517
1518
1519#if !CYTHON_USE_MODULE_STATE
1520static PyObject *__pyx_m = NULL;
1521#endif
1522static const char * const __pyx_cfilenm = __FILE__;
1523
1524/* Header.proto */
1525#if !defined(CYTHON_CCOMPLEX)
1526 #if defined(__cplusplus)
1527 #define CYTHON_CCOMPLEX 1
1528 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1529 #define CYTHON_CCOMPLEX 1
1530 #else
1531 #define CYTHON_CCOMPLEX 0
1532 #endif
1533#endif
1534#if CYTHON_CCOMPLEX
1535 #ifdef __cplusplus
1536 #include <complex>
1537 #else
1538 #include <complex.h>
1539 #endif
1540#endif
1541#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1542 #undef _Complex_I
1543 #define _Complex_I 1.0fj
1544#endif
1545
1546/* #### Code section: filename_table ### */
1547
1548static const char* const __pyx_f[] = {
1549 "proteus/subsurfaceTransportFunctions.pyx",
1550 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1551 "cpython/type.pxd",
1552};
1553/* #### Code section: utility_code_proto_before_types ### */
1554/* Atomics.proto (used by UnpackUnboundCMethod) */
1555#include <pythread.h>
1556#ifndef CYTHON_ATOMICS
1557 #define CYTHON_ATOMICS 1
1558#endif
1559#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1560#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1561#define __pyx_atomic_int_type int
1562#define __pyx_nonatomic_int_type int
1563#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1564 (__STDC_VERSION__ >= 201112L) &&\
1565 !defined(__STDC_NO_ATOMICS__))
1566 #include <stdatomic.h>
1567#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1568 (__cplusplus >= 201103L) ||\
1569 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1570 #include <atomic>
1571#endif
1572#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1573 (__STDC_VERSION__ >= 201112L) &&\
1574 !defined(__STDC_NO_ATOMICS__) &&\
1575 ATOMIC_INT_LOCK_FREE == 2)
1576 #undef __pyx_atomic_int_type
1577 #define __pyx_atomic_int_type atomic_int
1578 #define __pyx_atomic_ptr_type atomic_uintptr_t
1579 #define __pyx_nonatomic_ptr_type uintptr_t
1580 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1581 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1582 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1583 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1584 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1585 #define __pyx_atomic_load(value) atomic_load(value)
1586 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1587 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1588 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1589 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1590 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1591 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1592 #pragma message ("Using standard C atomics")
1593 #elif defined(__PYX_DEBUG_ATOMICS)
1594 #warning "Using standard C atomics"
1595 #endif
1596#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1597 (__cplusplus >= 201103L) ||\
1598\
1599 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1600 ATOMIC_INT_LOCK_FREE == 2)
1601 #undef __pyx_atomic_int_type
1602 #define __pyx_atomic_int_type std::atomic_int
1603 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1604 #define __pyx_nonatomic_ptr_type uintptr_t
1605 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1606 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1607 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1608 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1609 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1610 #define __pyx_atomic_load(value) std::atomic_load(value)
1611 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1612 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1613 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1614 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1615 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1616 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1617 #pragma message ("Using standard C++ atomics")
1618 #elif defined(__PYX_DEBUG_ATOMICS)
1619 #warning "Using standard C++ atomics"
1620 #endif
1621#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1622 (__GNUC_MINOR__ > 1 ||\
1623 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1624 #define __pyx_atomic_ptr_type void*
1625 #define __pyx_nonatomic_ptr_type void*
1626 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1627 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1628 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1629 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1630 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1631 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1632 int result = old == *expected;
1633 *expected = old;
1634 return result;
1635 }
1636 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1637 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1638 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1639 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1640 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1641 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1642 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1643 int result = old == *expected;
1644 *expected = old;
1645 return result;
1646 }
1647 #ifdef __PYX_DEBUG_ATOMICS
1648 #warning "Using GNU atomics"
1649 #endif
1650#elif CYTHON_ATOMICS && defined(_MSC_VER)
1651 #include <intrin.h>
1652 #undef __pyx_atomic_int_type
1653 #define __pyx_atomic_int_type long
1654 #define __pyx_atomic_ptr_type void*
1655 #undef __pyx_nonatomic_int_type
1656 #define __pyx_nonatomic_int_type long
1657 #define __pyx_nonatomic_ptr_type void*
1658 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1659 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1660 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1661 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1662 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1663 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1664 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1665 int result = old == *expected;
1666 *expected = old;
1667 return result;
1668 }
1669 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1670 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1671 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1672 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1673 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1674 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1675 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1676 int result = old == *expected;
1677 *expected = old;
1678 return result;
1679 }
1680 #ifdef __PYX_DEBUG_ATOMICS
1681 #pragma message ("Using MSVC atomics")
1682 #endif
1683#else
1684 #undef CYTHON_ATOMICS
1685 #define CYTHON_ATOMICS 0
1686 #ifdef __PYX_DEBUG_ATOMICS
1687 #warning "Not using atomics"
1688 #endif
1689#endif
1690
1691/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1692#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1693#define __Pyx_PyCriticalSection void*
1694#define __Pyx_PyCriticalSection2 void*
1695#define __Pyx_PyCriticalSection_End(cs)
1696#define __Pyx_PyCriticalSection2_End(cs)
1697#else
1698#define __Pyx_PyCriticalSection PyCriticalSection
1699#define __Pyx_PyCriticalSection2 PyCriticalSection2
1700#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1701#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1702#endif
1703
1704/* CriticalSections.proto (used by ParseKeywordsImpl) */
1705#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1706#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1707#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1708#else
1709#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1710#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1711#endif
1712#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1713#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1714#define __Pyx_END_CRITICAL_SECTION() }
1715#else
1716#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1717#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1718#endif
1719
1720/* BufferFormatStructs.proto (used by BufferFormatCheck) */
1721struct __Pyx_StructField_;
1722#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1723typedef struct {
1724 const char* name;
1725 const struct __Pyx_StructField_* fields;
1726 size_t size;
1727 size_t arraysize[8];
1728 int ndim;
1729 char typegroup;
1730 char is_unsigned;
1731 int flags;
1732} __Pyx_TypeInfo;
1733typedef struct __Pyx_StructField_ {
1734 const __Pyx_TypeInfo* type;
1735 const char* name;
1736 size_t offset;
1737} __Pyx_StructField;
1738typedef struct {
1739 const __Pyx_StructField* field;
1740 size_t parent_offset;
1741} __Pyx_BufFmt_StackElem;
1742typedef struct {
1743 __Pyx_StructField root;
1744 __Pyx_BufFmt_StackElem* head;
1745 size_t fmt_offset;
1746 size_t new_count, enc_count;
1747 size_t struct_alignment;
1748 int is_complex;
1749 char enc_type;
1750 char new_packmode;
1751 char enc_packmode;
1752 char is_valid_array;
1753} __Pyx_BufFmt_Context;
1754
1755/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1756#include <structmember.h>
1757
1758/* #### Code section: numeric_typedefs ### */
1759
1760/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1761 * # in Cython to enable them only on the right systems.
1762 *
1763 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1764 * ctypedef npy_int16 int16_t
1765 * ctypedef npy_int32 int32_t
1766*/
1767typedef npy_int8 __pyx_t_5numpy_int8_t;
1768
1769/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1770 *
1771 * ctypedef npy_int8 int8_t
1772 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1773 * ctypedef npy_int32 int32_t
1774 * ctypedef npy_int64 int64_t
1775*/
1776typedef npy_int16 __pyx_t_5numpy_int16_t;
1777
1778/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1779 * ctypedef npy_int8 int8_t
1780 * ctypedef npy_int16 int16_t
1781 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1782 * ctypedef npy_int64 int64_t
1783 *
1784*/
1785typedef npy_int32 __pyx_t_5numpy_int32_t;
1786
1787/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1788 * ctypedef npy_int16 int16_t
1789 * ctypedef npy_int32 int32_t
1790 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1791 *
1792 * ctypedef npy_uint8 uint8_t
1793*/
1794typedef npy_int64 __pyx_t_5numpy_int64_t;
1795
1796/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1797 * ctypedef npy_int64 int64_t
1798 *
1799 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1800 * ctypedef npy_uint16 uint16_t
1801 * ctypedef npy_uint32 uint32_t
1802*/
1803typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1804
1805/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1806 *
1807 * ctypedef npy_uint8 uint8_t
1808 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1809 * ctypedef npy_uint32 uint32_t
1810 * ctypedef npy_uint64 uint64_t
1811*/
1812typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1813
1814/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1815 * ctypedef npy_uint8 uint8_t
1816 * ctypedef npy_uint16 uint16_t
1817 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1818 * ctypedef npy_uint64 uint64_t
1819 *
1820*/
1821typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1822
1823/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1824 * ctypedef npy_uint16 uint16_t
1825 * ctypedef npy_uint32 uint32_t
1826 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1827 *
1828 * ctypedef npy_float32 float32_t
1829*/
1830typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1831
1832/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1833 * ctypedef npy_uint64 uint64_t
1834 *
1835 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1836 * ctypedef npy_float64 float64_t
1837 * #ctypedef npy_float80 float80_t
1838*/
1839typedef npy_float32 __pyx_t_5numpy_float32_t;
1840
1841/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1842 *
1843 * ctypedef npy_float32 float32_t
1844 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1845 * #ctypedef npy_float80 float80_t
1846 * #ctypedef npy_float128 float128_t
1847*/
1848typedef npy_float64 __pyx_t_5numpy_float64_t;
1849
1850/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1851 * ctypedef double complex complex128_t
1852 *
1853 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1854 * ctypedef npy_ulonglong ulonglong_t
1855 *
1856*/
1857typedef npy_longlong __pyx_t_5numpy_longlong_t;
1858
1859/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1860 *
1861 * ctypedef npy_longlong longlong_t
1862 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1863 *
1864 * ctypedef npy_intp intp_t
1865*/
1866typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1867
1868/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1869 * ctypedef npy_ulonglong ulonglong_t
1870 *
1871 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1872 * ctypedef npy_uintp uintp_t
1873 *
1874*/
1875typedef npy_intp __pyx_t_5numpy_intp_t;
1876
1877/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1878 *
1879 * ctypedef npy_intp intp_t
1880 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1881 *
1882 * ctypedef npy_double float_t
1883*/
1884typedef npy_uintp __pyx_t_5numpy_uintp_t;
1885
1886/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1887 * ctypedef npy_uintp uintp_t
1888 *
1889 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1890 * ctypedef npy_double double_t
1891 * ctypedef npy_longdouble longdouble_t
1892*/
1893typedef npy_double __pyx_t_5numpy_float_t;
1894
1895/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1896 *
1897 * ctypedef npy_double float_t
1898 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1899 * ctypedef npy_longdouble longdouble_t
1900 *
1901*/
1902typedef npy_double __pyx_t_5numpy_double_t;
1903
1904/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1905 * ctypedef npy_double float_t
1906 * ctypedef npy_double double_t
1907 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1908 *
1909 * ctypedef float complex cfloat_t
1910*/
1911typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1912
1913/* "subsurfaceTransportFunctions.pyx":15
1914 * cdef inline double double_min(double a, double b): return a if a <= b else b
1915 *
1916 * ctypedef numpy.double_t DTYPE_t # <<<<<<<<<<<<<<
1917 * #numpy.intc_t not in cython's numpy.pxd
1918 * ctypedef int ITYPE_t
1919*/
1920typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
1921
1922/* "subsurfaceTransportFunctions.pyx":17
1923 * ctypedef numpy.double_t DTYPE_t
1924 * #numpy.intc_t not in cython's numpy.pxd
1925 * ctypedef int ITYPE_t # <<<<<<<<<<<<<<
1926 *
1927 * def setExteriorElementBoundaryTypes(int nExteriorElementBoundaries_global,
1928*/
1929typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
1930/* #### Code section: complex_type_declarations ### */
1931/* Declarations.proto */
1932#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1933 #ifdef __cplusplus
1934 typedef ::std::complex< float > __pyx_t_float_complex;
1935 #else
1936 typedef float _Complex __pyx_t_float_complex;
1937 #endif
1938#else
1939 typedef struct { float real, imag; } __pyx_t_float_complex;
1940#endif
1941static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1942
1943/* Declarations.proto */
1944#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1945 #ifdef __cplusplus
1946 typedef ::std::complex< double > __pyx_t_double_complex;
1947 #else
1948 typedef double _Complex __pyx_t_double_complex;
1949 #endif
1950#else
1951 typedef struct { double real, imag; } __pyx_t_double_complex;
1952#endif
1953static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1954
1955/* Declarations.proto */
1956#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1957 #ifdef __cplusplus
1958 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1959 #else
1960 typedef long double _Complex __pyx_t_long_double_complex;
1961 #endif
1962#else
1963 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1964#endif
1965static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1966
1967/* #### Code section: type_declarations ### */
1968
1969/*--- Type declarations ---*/
1970/* #### Code section: utility_code_proto ### */
1971
1972/* --- Runtime support code (head) --- */
1973/* Refnanny.proto */
1974#ifndef CYTHON_REFNANNY
1975 #define CYTHON_REFNANNY 0
1976#endif
1977#if CYTHON_REFNANNY
1978 typedef struct {
1979 void (*INCREF)(void*, PyObject*, Py_ssize_t);
1980 void (*DECREF)(void*, PyObject*, Py_ssize_t);
1981 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
1982 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
1983 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
1984 void (*FinishContext)(void**);
1985 } __Pyx_RefNannyAPIStruct;
1986 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1987 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1988 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1989 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1990 if (acquire_gil) {\
1991 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1992 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1993 PyGILState_Release(__pyx_gilstate_save);\
1994 } else {\
1995 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1996 }
1997 #define __Pyx_RefNannyFinishContextNogil() {\
1998 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1999 __Pyx_RefNannyFinishContext();\
2000 PyGILState_Release(__pyx_gilstate_save);\
2001 }
2002 #define __Pyx_RefNannyFinishContextNogil() {\
2003 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2004 __Pyx_RefNannyFinishContext();\
2005 PyGILState_Release(__pyx_gilstate_save);\
2006 }
2007 #define __Pyx_RefNannyFinishContext()\
2008 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2009 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2010 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2011 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2012 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2013 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2014 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2015 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2016 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2017#else
2018 #define __Pyx_RefNannyDeclarations
2019 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2020 #define __Pyx_RefNannyFinishContextNogil()
2021 #define __Pyx_RefNannyFinishContext()
2022 #define __Pyx_INCREF(r) Py_INCREF(r)
2023 #define __Pyx_DECREF(r) Py_DECREF(r)
2024 #define __Pyx_GOTREF(r)
2025 #define __Pyx_GIVEREF(r)
2026 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2027 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2028 #define __Pyx_XGOTREF(r)
2029 #define __Pyx_XGIVEREF(r)
2030#endif
2031#define __Pyx_Py_XDECREF_SET(r, v) do {\
2032 PyObject *tmp = (PyObject *) r;\
2033 r = v; Py_XDECREF(tmp);\
2034 } while (0)
2035#define __Pyx_XDECREF_SET(r, v) do {\
2036 PyObject *tmp = (PyObject *) r;\
2037 r = v; __Pyx_XDECREF(tmp);\
2038 } while (0)
2039#define __Pyx_DECREF_SET(r, v) do {\
2040 PyObject *tmp = (PyObject *) r;\
2041 r = v; __Pyx_DECREF(tmp);\
2042 } while (0)
2043#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2044#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2045
2046/* GetTopmostException.proto (used by SaveResetException) */
2047#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2048static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2049#endif
2050
2051/* PyThreadStateGet.proto (used by SaveResetException) */
2052#if CYTHON_FAST_THREAD_STATE
2053#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2054#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2055#if PY_VERSION_HEX >= 0x030C00A6
2056#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2057#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2058#else
2059#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2060#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2061#endif
2062#else
2063#define __Pyx_PyThreadState_declare
2064#define __Pyx_PyThreadState_assign
2065#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2066#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2067#endif
2068
2069/* SaveResetException.proto */
2070#if CYTHON_FAST_THREAD_STATE
2071#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2072static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2073#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2074static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2075#else
2076#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2077#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2078#endif
2079
2080/* FastTypeChecks.proto (used by PyException_Check) */
2081#if CYTHON_COMPILING_IN_CPYTHON
2082#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2083#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2084static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2085static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2086#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2087#else
2088#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2089#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2090#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2091#endif
2092
2093/* PyException_Check.proto */
2094#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2095
2096/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2097#if CYTHON_FAST_THREAD_STATE
2098#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2099#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2100#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2101#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2102#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2103static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2104static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2105#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2106#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2107#else
2108#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2109#endif
2110#else
2111#define __Pyx_PyErr_Clear() PyErr_Clear()
2112#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2113#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2114#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2115#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2116#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2117#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2118#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2119#endif
2120
2121/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
2122#if CYTHON_COMPILING_IN_CPYTHON
2123static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2124static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2125#else
2126#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2127static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2128 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2129}
2130#endif
2131#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2132
2133/* PyErrExceptionMatches.proto */
2134#if CYTHON_FAST_THREAD_STATE
2135#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2136static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2137#else
2138#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2139#endif
2140
2141/* GetException.proto */
2142#if CYTHON_FAST_THREAD_STATE
2143#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2144static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2145#else
2146static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2147#endif
2148
2149/* PyImportError_Check.proto */
2150#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2151
2152/* PyObjectCall.proto (used by PyObjectFastCall) */
2153#if CYTHON_COMPILING_IN_CPYTHON
2154static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2155#else
2156#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2157#endif
2158
2159/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2160#if CYTHON_COMPILING_IN_CPYTHON
2161static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2162#endif
2163
2164/* PyObjectFastCall.proto */
2165#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2166static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2167
2168/* RaiseException.export */
2169static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2170
2171/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2172#if CYTHON_COMPILING_IN_CPYTHON
2173static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2174#endif
2175
2176/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2177#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2178#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2179#else
2180CYTHON_UNUSED static PyObject *
2181__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2182#endif
2183
2184/* TupleFromArray.proto (used by fastcall) */
2185
2186
2187/* IncludeStringH.proto (used by PyObjectCompare) */
2188#include <string.h>
2189
2190/* PyObjectCompare.proto (used by UnicodeEquals) */
2191static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2192
2193/* UnicodeEquals.proto (used by fastcall) */
2194#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2195
2196/* fastcall.proto */
2197#if CYTHON_AVOID_BORROWED_REFS
2198 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2199#elif CYTHON_ASSUME_SAFE_MACROS
2200 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2201#else
2202 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2203#endif
2204#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2205#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2206#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2207#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2208#if CYTHON_VECTORCALL
2209 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2210 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2211 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2212 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2213 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2214 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2215 #else
2216 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2217 #endif
2218#else
2219 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2220 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2221 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2222 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2223 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2224#endif
2225#if CYTHON_VECTORCALL_TPNEW
2226 #if !CYTHON_VECTORCALL
2227 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2228 #endif
2229 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2230 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2231 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2232 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2233 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2234#else
2235 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2236 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2237 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2238 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2239 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2240#endif
2241#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2242#if CYTHON_VECTORCALL
2243#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2244#else
2245#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2246#endif
2247
2248/* py_dict_items.proto (used by OwnedDictNext) */
2249#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2250#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2251#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2252static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2253
2254/* CallCFunction.proto (used by CallUnboundCMethod0) */
2255#define __Pyx_CallCFunction(cfunc, self, args)\
2256 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2257#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2258 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2259#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2260 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2261#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2262 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2263
2264/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2265static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2266
2267/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2268typedef struct {
2269 PyObject *type;
2270 PyObject **method_name;
2271 PyCFunction func;
2272 PyObject *method;
2273 int flag;
2274#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2275 __pyx_atomic_int_type initialized;
2276#endif
2277} __Pyx_CachedCFunction;
2278
2279/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2280static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2281#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2282
2283/* PyObjectGetAttrStr.proto (used by UnpackUnboundCMethod_impl) */
2284#if CYTHON_USE_TYPE_SLOTS
2285static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2286#else
2287#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2288#endif
2289
2290/* UnpackUnboundCMethod_impl.export */
2291static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2292
2293/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2294#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2295static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2296#if !CYTHON_ATOMICS
2297 return 1;
2298#else
2299 __pyx_nonatomic_int_type expected = 0;
2300 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2301 return 0;
2302 }
2303 return expected;
2304#endif
2305}
2306static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2307#if CYTHON_ATOMICS
2308 __pyx_atomic_store(&cfunc->initialized, 2);
2309#endif
2310}
2311#else
2312#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2313#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2314#endif
2315
2316/* CallUnboundCMethod0.proto */
2317CYTHON_UNUSED
2318static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2319#if CYTHON_COMPILING_IN_CPYTHON
2320static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2321#else
2322#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2323#endif
2324
2325/* py_dict_values.proto (used by OwnedDictNext) */
2326#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2327#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2328#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2329static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2330
2331/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2332#if CYTHON_AVOID_BORROWED_REFS
2333static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2334#else
2335CYTHON_INLINE
2336static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2337#endif
2338
2339/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2340static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2341
2342/* ParseKeywordsImpl.export */
2343static int __Pyx_ParseKeywordsTuple(
2344 PyObject *kwds,
2345 PyObject * const *kwvalues,
2346 PyObject ** const argnames[],
2347 PyObject *kwds2,
2348 PyObject *values[],
2349 Py_ssize_t num_pos_args,
2350 Py_ssize_t num_kwargs,
2351 const char* function_name,
2352 int ignore_unknown_kwargs
2353);
2354static int __Pyx_ParseKeywordDictToDict(
2355 PyObject *kwds,
2356 PyObject ** const argnames[],
2357 PyObject *kwds2,
2358 PyObject *values[],
2359 Py_ssize_t num_pos_args,
2360 const char* function_name
2361);
2362static int __Pyx_ParseKeywordDict(
2363 PyObject *kwds,
2364 PyObject ** const argnames[],
2365 PyObject *values[],
2366 Py_ssize_t num_pos_args,
2367 Py_ssize_t num_kwargs,
2368 const char* function_name,
2369 int ignore_unknown_kwargs
2370);
2371
2372/* CallUnboundCMethod2.proto */
2373CYTHON_UNUSED
2374static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2375#if CYTHON_COMPILING_IN_CPYTHON
2376static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2377#else
2378#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2379#endif
2380
2381/* ParseKeywords.proto */
2382static CYTHON_INLINE int __Pyx_ParseKeywords(
2383 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2384 PyObject *kwds2, PyObject *values[],
2385 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2386 const char* function_name,
2387 int ignore_unknown_kwargs
2388);
2389
2390/* RaiseArgTupleInvalid.export */
2391static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2392 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2393
2394/* ArgTypeTestError.export */
2395static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2396
2397/* ArgTypeTest.proto */
2398static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
2399
2400/* IsLittleEndian.proto (used by BufferFormatCheck) */
2401static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2402
2403/* BufferFormatCheck.proto (used by BufferGetAndValidate) */
2404static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2405static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2406 __Pyx_BufFmt_StackElem* stack,
2407 const __Pyx_TypeInfo* type);
2408
2409/* BufferGetAndValidate.proto */
2410#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
2411 ((obj == Py_None || obj == NULL) ?\
2412 (__Pyx_ZeroBuffer(buf), 0) :\
2413 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
2414static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
2415 const __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
2416static void __Pyx_ZeroBuffer(Py_buffer* buf);
2417static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
2418static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
2419static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
2420
2421/* BufferIndexError.proto */
2422static void __Pyx_RaiseBufferIndexError(int axis);
2423
2424#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
2425#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
2426/* PyFrozenDict.proto (used by DictGetItem) */
2427#if CYTHON_COMPILING_IN_LIMITED_API
2428#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2429#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2430static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2431#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2432#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2433#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2434#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2435static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2436 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2437}
2438#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2439static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2440 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2441}
2442#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2443 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2444#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2445#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2446#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2447#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2448#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2449#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2450#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2451#else
2452#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2453static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2454 if (!it) {
2455 return PyDict_New();
2456 } else if (PyDict_Check(it)) {
2457 return PyDict_Copy(it);
2458 } else {
2459 PyObject *dict = PyDict_New();
2460 if (!dict) return NULL;
2461 PyObject *result = PyNumber_InPlaceOr(dict, it);
2462 Py_DECREF(dict);
2463 return result;
2464 }
2465}
2466#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2467#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2468#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2469#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2470#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2471#endif
2472
2473/* DictGetItem.proto */
2474#if !CYTHON_COMPILING_IN_PYPY
2475static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2476#define __Pyx_PyObject_Dict_GetItem(obj, name)\
2477 (likely(__Pyx_PyAnyDict_CheckExact(obj)) ?\
2478 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2479#else
2480#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2481#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2482#endif
2483
2484/* FormatTypeName.proto (used by RaiseErrorWithObjectTypes) */
2485#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2486typedef PyObject *__Pyx_TypeName;
2487#define __Pyx_FMT_TYPENAME "%N"
2488#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2489#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2490#elif CYTHON_COMPILING_IN_LIMITED_API
2491typedef PyObject *__Pyx_TypeName;
2492#define __Pyx_FMT_TYPENAME "%U"
2493#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2494static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2495#else // !LIMITED_API
2496typedef const char *__Pyx_TypeName;
2497#define __Pyx_FMT_TYPENAME "%.200s"
2498#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2499#define __Pyx_DECREF_TypeName(obj)
2500#endif
2501
2502/* RaiseErrorWithObjectTypes.proto (used by PyNumberBinop) */
2503#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2504#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2505#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2506CYTHON_UNUSED
2507static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2508
2509/* PyNumberBinop.proto */
2510#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2511#define __Pyx_PyNumber_Add_object_object(op1, op2) PyNumber_Add(op1, op2)
2512#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) PyNumber_InPlaceAdd(op1, op2)
2513#else
2514#define __Pyx_PyNumber_Add_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 0)
2515#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 1)
2516static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2, int inplace);
2517#endif
2518
2519/* PyNumberBinop.proto */
2520#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2521#define __Pyx_PyNumber_Multiply_float_object(op1, op2) PyNumber_Multiply(op1, op2)
2522#define __Pyx_PyNumber_InPlaceMultiply_float_object(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2523#else
2524#define __Pyx_PyNumber_Multiply_float_object(op1, op2) __Pyx__PyNumber_Multiply_float_object(op1, op2, 0)
2525#define __Pyx_PyNumber_InPlaceMultiply_float_object(op1, op2) __Pyx__PyNumber_Multiply_float_object(op1, op2, 1)
2526static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_float_object(PyObject *op1, PyObject *op2, int inplace);
2527#endif
2528
2529#define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
2530/* GetItemInt.proto */
2531#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2532 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2533 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2534 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2535#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2536 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2537 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2538 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2539static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2540 int wraparound, int boundscheck, int unsafe_shared);
2541#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2542 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2543 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2544 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2545static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2546 int wraparound, int boundscheck, int unsafe_shared);
2547static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2548static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2549 int wraparound, int boundscheck, int unsafe_shared);
2550
2551/* PyObjectGetAttrStrNoError.proto (used by ObjectGetItem) */
2552static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2553
2554/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
2555#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2556#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2557CYTHON_UNUSED
2558static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
2559
2560/* ObjectGetItem.proto */
2561#if CYTHON_USE_TYPE_SLOTS
2562static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2563#else
2564#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2565#endif
2566
2567/* PyNumberBinop.proto */
2568#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2569#define __Pyx_PyNumber_Multiply_object_object(op1, op2) PyNumber_Multiply(op1, op2)
2570#define __Pyx_PyNumber_InPlaceMultiply_object_object(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2571#else
2572#define __Pyx_PyNumber_Multiply_object_object(op1, op2) __Pyx__PyNumber_Multiply_object_object(op1, op2, 0)
2573#define __Pyx_PyNumber_InPlaceMultiply_object_object(op1, op2) __Pyx__PyNumber_Multiply_object_object(op1, op2, 1)
2574static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_object(PyObject *op1, PyObject *op2, int inplace);
2575#endif
2576
2577/* PyFloatBinop.proto */
2578#if !CYTHON_COMPILING_IN_PYPY
2579static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
2580#else
2581#define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\
2582 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2583#endif
2584
2585#define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
2586/* GetBuiltinName.proto (used by GetModuleGlobalName) */
2587static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2588
2589/* PyDictVersioning.proto (used by GetModuleGlobalName) */
2590#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2591#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2592#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2593#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2594 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2595 (cache_var) = (value);
2596#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2597 static PY_UINT64_T __pyx_dict_version = 0;\
2598 static PyObject *__pyx_dict_cached_value = NULL;\
2599 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2600 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2601 } else {\
2602 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2603 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2604 }\
2605}
2606static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2607static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2608static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2609#else
2610#define __PYX_GET_DICT_VERSION(dict) (0)
2611#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2612#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2613#endif
2614
2615/* GetModuleGlobalName.proto */
2616#if CYTHON_USE_DICT_VERSIONS
2617#define __Pyx_GetModuleGlobalName(var, name) do {\
2618 static PY_UINT64_T __pyx_dict_version = 0;\
2619 static PyObject *__pyx_dict_cached_value = NULL;\
2620 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2621 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2622 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2623} while(0)
2624#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2625 PY_UINT64_T __pyx_dict_version;\
2626 PyObject *__pyx_dict_cached_value;\
2627 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2628} while(0)
2629static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2630#else
2631#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2632#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2633static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2634#endif
2635
2636/* ExtTypeTest.proto */
2637static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2638
2639/* AssertionsEnabled.proto */
2640#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2641 static int __pyx_assertions_enabled_flag;
2642 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2643 #if __clang__ || __GNUC__
2644 __attribute__((no_sanitize("thread")))
2645 #endif
2646 static int __Pyx_init_assertions_enabled(void) {
2647 PyObject *builtins, *debug, *debug_str;
2648 int flag;
2649 builtins = PyEval_GetBuiltins();
2650 if (!builtins) goto bad;
2651 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2652 if (!debug_str) goto bad;
2653 debug = PyObject_GetItem(builtins, debug_str);
2654 Py_DECREF(debug_str);
2655 if (!debug) goto bad;
2656 flag = PyObject_IsTrue(debug);
2657 Py_DECREF(debug);
2658 if (flag == -1) goto bad;
2659 __pyx_assertions_enabled_flag = flag;
2660 return 0;
2661 bad:
2662 __pyx_assertions_enabled_flag = 1;
2663 return -1;
2664 }
2665#else
2666 #define __Pyx_init_assertions_enabled() (0)
2667 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2668#endif
2669
2670/* PyObjectCompare.proto */
2671static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_int(PyObject *op1, PyObject *op2, int pyop);
2672
2673/* PyAssertionError_Check.proto */
2674#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2675
2676/* PyNumberBinop.proto */
2677#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2678#define __Pyx_PyNumber_Multiply_object_float(op1, op2) PyNumber_Multiply(op1, op2)
2679#define __Pyx_PyNumber_InPlaceMultiply_object_float(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2680#else
2681#define __Pyx_PyNumber_Multiply_object_float(op1, op2) __Pyx__PyNumber_Multiply_object_float(op1, op2, 0)
2682#define __Pyx_PyNumber_InPlaceMultiply_object_float(op1, op2) __Pyx__PyNumber_Multiply_object_float(op1, op2, 1)
2683static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_float(PyObject *op1, PyObject *op2, int inplace);
2684#endif
2685
2686/* PyNumberBinop.proto */
2687#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2688#define __Pyx_PyNumber_Subtract_float_object(op1, op2) PyNumber_Subtract(op1, op2)
2689#define __Pyx_PyNumber_InPlaceSubtract_float_object(op1, op2) PyNumber_InPlaceSubtract(op1, op2)
2690#else
2691#define __Pyx_PyNumber_Subtract_float_object(op1, op2) __Pyx__PyNumber_Subtract_float_object(op1, op2, 0)
2692#define __Pyx_PyNumber_InPlaceSubtract_float_object(op1, op2) __Pyx__PyNumber_Subtract_float_object(op1, op2, 1)
2693static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_float_object(PyObject *op1, PyObject *op2, int inplace);
2694#endif
2695
2696/* PyNumberBinop.proto */
2697#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2698#define __Pyx_PyNumber_Add_object_float(op1, op2) PyNumber_Add(op1, op2)
2699#define __Pyx_PyNumber_InPlaceAdd_object_float(op1, op2) PyNumber_InPlaceAdd(op1, op2)
2700#else
2701#define __Pyx_PyNumber_Add_object_float(op1, op2) __Pyx__PyNumber_Add_object_float(op1, op2, 0)
2702#define __Pyx_PyNumber_InPlaceAdd_object_float(op1, op2) __Pyx__PyNumber_Add_object_float(op1, op2, 1)
2703static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_float(PyObject *op1, PyObject *op2, int inplace);
2704#endif
2705
2706/* pybytes_as_double.proto (used by pyobject_as_double) */
2707static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
2708static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
2709static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
2710 char* as_c_string;
2711 Py_ssize_t size;
2712#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2713 as_c_string = PyBytes_AS_STRING(obj);
2714 size = PyBytes_GET_SIZE(obj);
2715#else
2716 if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
2717 return (double)-1;
2718 }
2719#endif
2720 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
2721}
2722static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
2723 char* as_c_string;
2724 Py_ssize_t size;
2725#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2726 as_c_string = PyByteArray_AS_STRING(obj);
2727 size = PyByteArray_GET_SIZE(obj);
2728#else
2729 as_c_string = PyByteArray_AsString(obj);
2730 if (as_c_string == NULL) {
2731 return (double)-1;
2732 }
2733 size = PyByteArray_Size(obj);
2734#endif
2735 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
2736}
2737
2738/* pyunicode_as_double.proto (used by pyobject_as_double) */
2739#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
2740static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
2741 int last_was_punctuation;
2742 Py_ssize_t i;
2743 last_was_punctuation = 1;
2744 for (i=start; i <= end; i++) {
2745 Py_UCS4 chr = PyUnicode_READ(kind, data, i);
2746 int is_punctuation = (chr == '_') | (chr == '.');
2747 *buffer = (char)chr;
2748 buffer += (chr != '_');
2749 if (unlikely(chr > 127)) goto parse_failure;
2750 if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
2751 last_was_punctuation = is_punctuation;
2752 }
2753 if (unlikely(last_was_punctuation)) goto parse_failure;
2754 *buffer = '\0';
2755 return buffer;
2756parse_failure:
2757 return NULL;
2758}
2759static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
2760 int matches = 1;
2761 Py_UCS4 chr;
2762 Py_UCS4 sign = PyUnicode_READ(kind, data, start);
2763 int is_signed = (sign == '-') | (sign == '+');
2764 start += is_signed;
2765 length -= is_signed;
2766 switch (PyUnicode_READ(kind, data, start)) {
2767 #ifdef Py_NAN
2768 case 'n':
2769 case 'N':
2770 if (unlikely(length != 3)) goto parse_failure;
2771 chr = PyUnicode_READ(kind, data, start+1);
2772 matches &= (chr == 'a') | (chr == 'A');
2773 chr = PyUnicode_READ(kind, data, start+2);
2774 matches &= (chr == 'n') | (chr == 'N');
2775 if (unlikely(!matches)) goto parse_failure;
2776 return (sign == '-') ? -Py_NAN : Py_NAN;
2777 #endif
2778 case 'i':
2779 case 'I':
2780 if (unlikely(length < 3)) goto parse_failure;
2781 chr = PyUnicode_READ(kind, data, start+1);
2782 matches &= (chr == 'n') | (chr == 'N');
2783 chr = PyUnicode_READ(kind, data, start+2);
2784 matches &= (chr == 'f') | (chr == 'F');
2785 if (likely(length == 3 && matches))
2786 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
2787 if (unlikely(length != 8)) goto parse_failure;
2788 chr = PyUnicode_READ(kind, data, start+3);
2789 matches &= (chr == 'i') | (chr == 'I');
2790 chr = PyUnicode_READ(kind, data, start+4);
2791 matches &= (chr == 'n') | (chr == 'N');
2792 chr = PyUnicode_READ(kind, data, start+5);
2793 matches &= (chr == 'i') | (chr == 'I');
2794 chr = PyUnicode_READ(kind, data, start+6);
2795 matches &= (chr == 't') | (chr == 'T');
2796 chr = PyUnicode_READ(kind, data, start+7);
2797 matches &= (chr == 'y') | (chr == 'Y');
2798 if (unlikely(!matches)) goto parse_failure;
2799 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
2800 case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
2801 break;
2802 default:
2803 goto parse_failure;
2804 }
2805 return 0.0;
2806parse_failure:
2807 return -1.0;
2808}
2809static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
2810 double value;
2811 const char *last;
2812 char *end;
2813 int valid_parse;
2814 Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
2815 const int kind = PyUnicode_KIND(obj);
2816 const void* data = PyUnicode_DATA(obj);
2817 start = 0;
2818 while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
2819 start++;
2820 while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
2821 length--;
2822 length -= start;
2823 if (unlikely(length <= 0)) goto fallback;
2824 value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
2825 if (value != 0.0) {
2826 if (unlikely(value == -1.0)) goto fallback;
2827 return value;
2828 }
2829 if (length < 40) {
2830 char number[40];
2831 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
2832 if (unlikely(!last)) goto fallback;
2833 value = PyOS_string_to_double(number, &end, NULL);
2834 valid_parse = (end == last);
2835 } else {
2836 char *number = (char*) PyMem_Malloc(((size_t) length + 1) * sizeof(char));
2837 if (unlikely(!number)) goto fallback;
2838 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
2839 if (unlikely(!last)) {
2840 PyMem_Free(number);
2841 goto fallback;
2842 }
2843 value = PyOS_string_to_double(number, &end, NULL);
2844 valid_parse = (end == last);
2845 PyMem_Free(number);
2846 }
2847 if (likely(valid_parse) || (value == (double)-1 && PyErr_Occurred())) {
2848 return value;
2849 }
2850fallback:
2851 return __Pyx_SlowPyString_AsDouble(obj);
2852}
2853#endif
2854static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
2855#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
2856 if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
2857 return (double)-1;
2858 if (likely(PyUnicode_IS_ASCII(obj))) {
2859 const char *s;
2860 Py_ssize_t length;
2861 s = PyUnicode_AsUTF8AndSize(obj, &length);
2862 return __Pyx__PyBytes_AsDouble(obj, s, length);
2863 }
2864 return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
2865#else
2866 return __Pyx_SlowPyString_AsDouble(obj);
2867#endif
2868}
2869
2870/* pyobject_as_double.proto */
2871static double __Pyx__PyObject_AsDouble(PyObject* obj);
2872#if CYTHON_COMPILING_IN_PYPY
2873#define __Pyx_PyObject_AsDouble(obj)\
2874(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
2875 likely(PyLong_CheckExact(obj)) ?\
2876 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
2877#else
2878#define __Pyx_PyObject_AsDouble(obj)\
2879((likely(PyFloat_CheckExact(obj))) ? __Pyx_PyFloat_AS_DOUBLE(obj) :\
2880 likely(PyLong_CheckExact(obj)) ?\
2881 PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
2882#endif
2883
2884/* FloatExceptionCheck.proto */
2885#define __PYX_CHECK_FLOAT_EXCEPTION(value, error_value)\
2886 ((error_value) == (error_value) ?\
2887 (value) == (error_value) :\
2888 (value) != (value))
2889
2890/* TypeImport.proto */
2891#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2892#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2893#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2894#include <stdalign.h>
2895#endif
2896#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2897#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2898#else
2899#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2900#endif
2901enum __Pyx_ImportType_CheckSize_3_3_0 {
2902 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2903 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2904 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2905};
2906static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
2907#endif
2908
2909/* HasAttr.proto (used by ImportImpl) */
2910#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2911#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2912#else
2913static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2914#endif
2915
2916/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
2917CYTHON_UNUSED static PyObject *
2918__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2919
2920/* ListFromArray.proto (used by ImportImpl) */
2921
2922
2923/* ImportImpl.export */
2924static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
2925
2926/* Import.proto */
2927static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
2928
2929/* dict_setdefault.proto (used by FetchCommonType) */
2930static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2931
2932/* AddModuleRef.proto (used by FetchSharedCythonModule) */
2933#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2934 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2935 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
2936#else
2937 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2938#endif
2939
2940/* FetchSharedCythonModule.proto (used by FetchCommonType) */
2941static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2942
2943/* VerifyCachedType.proto (used by FetchCommonType) */
2944static int __Pyx_VerifyCachedType(PyObject *cached_type,
2945 const char *name,
2946 Py_ssize_t expected_basicsize);
2947
2948/* FetchCommonType.proto (used by CommonTypesMetaclass) */
2949static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2950
2951/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
2952static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2953#define __Pyx_CommonTypesMetaclass_USED
2954
2955/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
2956#define __Pyx_CyFunction_USED
2957#if CYTHON_OPAQUE_SHARED_TYPES
2958#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2959#else
2960#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2961#endif
2962#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2963#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2964#define __Pyx_CYFUNCTION_CCLASS 0x04
2965#define __Pyx_CYFUNCTION_COROUTINE 0x08
2966#define __Pyx_CyFunction_GetClosure(f)\
2967 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2968#if CYTHON_COMPILING_IN_LIMITED_API
2969 #define __Pyx__CyFunction_GetClassObj(f)\
2970 ((f)->func_classobj)
2971#else
2972 #define __Pyx__CyFunction_GetClassObj(f)\
2973 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2974#endif
2975#define __Pyx_CyFunction_GetClassObj(f)\
2976 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2977#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2978 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2979#define __Pyx_CyFunction_Defaults(type, f)\
2980 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2981#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2982 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2983typedef struct {
2984#if CYTHON_COMPILING_IN_LIMITED_API
2985#if !CYTHON_OPAQUE_OBJECTS
2986 PyObject_HEAD
2987#endif
2988 PyMethodDef *func_methoddef;
2989 PyObject *func_module;
2990#else
2991 PyCMethodObject func;
2992#endif
2993#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2994 __pyx_vectorcallfunc func_vectorcall;
2995#endif
2996#if CYTHON_COMPILING_IN_LIMITED_API
2997 PyObject *func_weakreflist;
2998#endif
2999#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3000 PyObject *func_dict;
3001#endif
3002 PyObject *func_name;
3003 PyObject *func_qualname;
3004 PyObject *func_doc;
3005 PyObject *func_globals;
3006 PyObject *func_code;
3007 PyObject *func_closure;
3008#if CYTHON_COMPILING_IN_LIMITED_API
3009 PyObject *func_classobj;
3010#endif
3011 PyObject *defaults;
3012 int flags;
3013 PyObject *defaults_tuple;
3014 PyObject *defaults_kwdict;
3015 PyObject *(*defaults_getter)(PyObject *);
3016 PyObject *func_annotations;
3017#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3018 PyObject *func_is_coroutine;
3019#endif
3020} __pyx_CyFunctionObject;
3021#undef __Pyx_CyOrPyCFunction_Check
3022#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3023#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3024#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3025static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
3026#undef __Pyx_IsSameCFunction
3027#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3028static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3029static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3030 PyTypeObject *defaults_type);
3031static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3032 PyObject *tuple);
3033static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3034 PyObject *dict);
3035static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3036 PyObject *dict);
3037static int __pyx_CyFunction_init(PyObject *module);
3038#if CYTHON_VECTORCALL
3039#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3040#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3041#else
3042#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3043#endif
3044#endif
3045
3046/* CallTypeTraverse.proto (used by CythonFunctionShared) */
3047#if !CYTHON_USE_TYPE_SPECS
3048#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3049#else
3050static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
3051#endif
3052
3053/* PyMethodNew.proto (used by CythonFunctionShared) */
3054static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3055
3056/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
3057#if CYTHON_VECTORCALL
3058static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3059#endif
3060
3061/* CythonFunctionShared.proto (used by CythonFunction) */
3062static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3063 int flags, PyObject* qualname,
3064 PyObject *closure,
3065 PyObject *module, PyObject *globals,
3066 PyObject* code);
3067#if CYTHON_VECTORCALL
3068static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3069static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3070static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3071static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3072#endif
3073
3074/* CythonFunction.export */
3075static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3076 int flags, PyObject* qualname,
3077 PyObject *closure,
3078 PyObject *module, PyObject *globals,
3079 PyObject* code);
3080static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3081
3082/* CLineInTraceback.proto (used by AddTraceback) */
3083#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3084static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3085#else
3086#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3087#endif
3088
3089/* CodeObjectCache.proto (used by AddTraceback) */
3090#if CYTHON_COMPILING_IN_LIMITED_API
3091typedef PyObject __Pyx_CachedCodeObjectType;
3092#else
3093typedef PyCodeObject __Pyx_CachedCodeObjectType;
3094#endif
3095typedef struct {
3096 __Pyx_CachedCodeObjectType* code_object;
3097 int code_line;
3098} __Pyx_CodeObjectCacheEntry;
3099struct __Pyx_CodeObjectCache {
3100 int count;
3101 int max_count;
3102 __Pyx_CodeObjectCacheEntry* entries;
3103 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3104 __pyx_atomic_int_type accessor_count;
3105 #endif
3106};
3107static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3108static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3109static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3110
3111/* AddTraceback.proto */
3112static void __Pyx_AddTraceback(const char *funcname, int c_line,
3113 int py_line, const char *filename);
3114
3115/* BufferStructDeclare.proto */
3116typedef struct {
3117 Py_ssize_t shape, strides, suboffsets;
3118} __Pyx_Buf_DimInfo;
3119typedef struct {
3120 size_t refcount;
3121 Py_buffer pybuffer;
3122} __Pyx_Buffer;
3123typedef struct {
3124 __Pyx_Buffer *rcbuffer;
3125 char *data;
3126 __Pyx_Buf_DimInfo diminfo[8];
3127} __Pyx_LocalBuf_ND;
3128
3129/* GCCDiagnostics.proto */
3130#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
3131#define __Pyx_HAS_GCC_DIAGNOSTIC
3132#endif
3133
3134/* RealImag.proto */
3135#if CYTHON_CCOMPLEX
3136 #ifdef __cplusplus
3137 #define __Pyx_CREAL(z) ((z).real())
3138 #define __Pyx_CIMAG(z) ((z).imag())
3139 #else
3140 #define __Pyx_CREAL(z) (__real__(z))
3141 #define __Pyx_CIMAG(z) (__imag__(z))
3142 #endif
3143#else
3144 #define __Pyx_CREAL(z) ((z).real)
3145 #define __Pyx_CIMAG(z) ((z).imag)
3146#endif
3147#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3148 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3149 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3150 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3151#else
3152 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3153 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3154#endif
3155
3156/* Arithmetic.proto */
3157#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3158 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3159 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3160 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3161 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3162 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3163 #define __Pyx_c_neg_float(a) (-(a))
3164 #ifdef __cplusplus
3165 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3166 #define __Pyx_c_conj_float(z) (::std::conj(z))
3167 #if 1
3168 #define __Pyx_c_abs_float(z) (::std::abs(z))
3169 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3170 #endif
3171 #else
3172 #define __Pyx_c_is_zero_float(z) ((z)==0)
3173 #define __Pyx_c_conj_float(z) (conjf(z))
3174 #if 1
3175 #define __Pyx_c_abs_float(z) (cabsf(z))
3176 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3177 #endif
3178 #endif
3179#else
3180 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3181 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3182 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3183 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3184 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3185 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3186 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3187 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3188 #if 1
3189 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3190 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3191 #endif
3192#endif
3193
3194/* Arithmetic.proto */
3195#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3196 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3197 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3198 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3199 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3200 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3201 #define __Pyx_c_neg_double(a) (-(a))
3202 #ifdef __cplusplus
3203 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3204 #define __Pyx_c_conj_double(z) (::std::conj(z))
3205 #if 1
3206 #define __Pyx_c_abs_double(z) (::std::abs(z))
3207 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3208 #endif
3209 #else
3210 #define __Pyx_c_is_zero_double(z) ((z)==0)
3211 #define __Pyx_c_conj_double(z) (conj(z))
3212 #if 1
3213 #define __Pyx_c_abs_double(z) (cabs(z))
3214 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3215 #endif
3216 #endif
3217#else
3218 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3219 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3220 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3221 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3222 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3223 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3224 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3225 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3226 #if 1
3227 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3228 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3229 #endif
3230#endif
3231
3232/* Arithmetic.proto */
3233#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3234 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3235 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3236 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3237 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3238 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3239 #define __Pyx_c_neg_long__double(a) (-(a))
3240 #ifdef __cplusplus
3241 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3242 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3243 #if 1
3244 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3245 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3246 #endif
3247 #else
3248 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3249 #define __Pyx_c_conj_long__double(z) (conjl(z))
3250 #if 1
3251 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3252 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3253 #endif
3254 #endif
3255#else
3256 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3257 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3258 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3259 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3260 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3261 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3262 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3263 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3264 #if 1
3265 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3266 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3267 #endif
3268#endif
3269
3270/* CIntFromPy.proto */
3271static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3272
3273/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
3274#if CYTHON_VECTORCALL
3275#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3276CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3277#else
3278#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3279CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
3280CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3281#endif
3282
3283/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
3284#if CYTHON_VECTORCALL
3285#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3286#else
3287static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3288#endif
3289
3290/* CIntToPy.proto */
3291static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
3292
3293/* CIntToPy.proto */
3294static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_intp(npy_intp value);
3295
3296/* CIntFromPy.proto */
3297static CYTHON_INLINE npy_intp __Pyx_PyLong_As_npy_intp(PyObject *);
3298
3299/* CIntToPy.proto */
3300static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
3301
3302/* CIntFromPy.proto */
3303static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
3304
3305/* GetRuntimeVersion.proto */
3306#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3307static unsigned long __Pyx_cached_runtime_version = 0;
3308static void __Pyx_init_runtime_version(void);
3309#else
3310#define __Pyx_init_runtime_version()
3311#endif
3312static unsigned long __Pyx_get_runtime_version(void);
3313
3314/* CheckBinaryVersion.proto */
3315static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3316
3317/* DecompressString.proto */
3318static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
3319
3320/* DecompressString_LZSS.proto */
3321static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
3322
3323/* MultiPhaseInitModuleState.proto */
3324#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3325#include <stdlib.h>
3326static PyObject *__Pyx_State_FindModule(void*);
3327static int __Pyx_State_AddModule(PyObject* module, void*);
3328static int __Pyx_State_RemoveModule(void*);
3329#elif CYTHON_USE_MODULE_STATE
3330#define __Pyx_State_FindModule PyState_FindModule
3331#define __Pyx_State_AddModule PyState_AddModule
3332#define __Pyx_State_RemoveModule PyState_RemoveModule
3333#endif
3334
3335/* #### Code section: module_declarations ### */
3336/* CythonABIVersion.proto */
3337#if CYTHON_COMPILING_IN_LIMITED_API
3338 #if CYTHON_VECTORCALL
3339 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3340 #else
3341 #define __PYX_VECTORCALL_ABI_SUFFIX
3342 #endif
3343 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3344#else
3345 #define __PYX_LIMITED_ABI_SUFFIX
3346#endif
3347#if __PYX_HAS_PY_AM_SEND == 1
3348 #define __PYX_AM_SEND_ABI_SUFFIX
3349#elif __PYX_HAS_PY_AM_SEND == 2
3350 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3351#else
3352 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3353#endif
3354#ifndef __PYX_MONITORING_ABI_SUFFIX
3355 #define __PYX_MONITORING_ABI_SUFFIX
3356#endif
3357#if CYTHON_USE_TP_FINALIZE
3358 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3359#else
3360 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3361#endif
3362#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3363 #define __PYX_FREELISTS_ABI_SUFFIX
3364#else
3365 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3366#endif
3367#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3368 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3369#else
3370 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3371#endif
3372#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3373#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3374#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3375
3376static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3377static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3378static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3379static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3380static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3381static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3382static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3383static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3384static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3385static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3386static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3387static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3388static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3389static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3390static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3391static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3392static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3393static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
3394static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
3395static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
3396static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
3397static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
3398static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
3399static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
3400static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3401static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3402static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3403static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3404static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3405static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3406static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3407static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3408static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3409static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3410static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3411
3412/* Module declarations from "libc.string" */
3413
3414/* Module declarations from "libc.stdio" */
3415
3416/* Module declarations from "__builtin__" */
3417
3418/* Module declarations from "cpython.type" */
3419
3420/* Module declarations from "cpython" */
3421
3422/* Module declarations from "cpython.object" */
3423
3424/* Module declarations from "cpython.ref" */
3425
3426/* Module declarations from "numpy" */
3427
3428/* Module declarations from "numpy" */
3429
3430/* Module declarations from "subsurfaceTransportFunctions" */
3431/* #### Code section: typeinfo ### */
3432static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = { "ITYPE_t", NULL, sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
3433static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = { "DTYPE_t", NULL, sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0, 'R', 0, 0 };
3434/* #### Code section: before_global_var ### */
3435#define __Pyx_MODULE_NAME "subsurfaceTransportFunctions"
3436extern int __pyx_module_is_main_subsurfaceTransportFunctions;
3437int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
3438
3439/* Implementation of "subsurfaceTransportFunctions" */
3440/* #### Code section: global_var ### */
3441/* #### Code section: string_decls ### */
3442/* #### Code section: decls ### */
3443static 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); /* proto */
3444static 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); /* proto */
3445static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions); /* proto */
3446static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions); /* proto */
3447static 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); /* proto */
3448static 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); /* proto */
3449static 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); /* proto */
3450static 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); /* proto */
3451static 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); /* proto */
3452static 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); /* proto */
3453static 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); /* proto */
3454static 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); /* proto */
3455static 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); /* proto */
3456static 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); /* proto */
3457static 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); /* proto */
3458static 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); /* proto */
3459static 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); /* proto */
3460static 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); /* proto */
3461static 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); /* proto */
3462static 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); /* proto */
3463static 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); /* proto */
3464static 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); /* proto */
3465static 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); /* proto */
3466static 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); /* proto */
3467static 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); /* proto */
3468static 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); /* proto */
3469static 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); /* proto */
3470static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v); /* proto */
3471static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v); /* proto */
3472/* #### Code section: late_includes ### */
3473/* #### Code section: module_state ### */
3474/* SmallCodeConfig */
3475#ifndef CYTHON_SMALL_CODE
3476#if defined(__clang__)
3477 #define CYTHON_SMALL_CODE
3478#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3479 #define CYTHON_SMALL_CODE __attribute__((cold))
3480#else
3481 #define CYTHON_SMALL_CODE
3482#endif
3483#endif
3484
3485#ifdef __cplusplus
3486namespace {
3487 #endif
3488 typedef struct {
3489 PyObject *__pyx_d;
3490 PyObject *__pyx_b;
3491 PyObject *__pyx_cython_runtime;
3492 PyObject *__pyx_empty_tuple;
3493 PyObject *__pyx_empty_bytes;
3494 PyObject *__pyx_empty_unicode;
3495 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3496 PyTypeObject *__pyx_ptype_5numpy_dtype;
3497 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3498 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3499 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3500 PyTypeObject *__pyx_ptype_5numpy_generic;
3501 PyTypeObject *__pyx_ptype_5numpy_number;
3502 PyTypeObject *__pyx_ptype_5numpy_integer;
3503 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3504 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3505 PyTypeObject *__pyx_ptype_5numpy_inexact;
3506 PyTypeObject *__pyx_ptype_5numpy_floating;
3507 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3508 PyTypeObject *__pyx_ptype_5numpy_flexible;
3509 PyTypeObject *__pyx_ptype_5numpy_character;
3510 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3511 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3512 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3513 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
3514 PyObject *__pyx_slice[1];
3515 PyObject *__pyx_codeobj_tab[29];
3516 PyObject *__pyx_string_tab[238];
3517 PyObject *__pyx_number_tab[4];
3518/* #### Code section: module_state_contents ### */
3519/* PyFrozenDict.module_state_decls */
3520#if CYTHON_COMPILING_IN_LIMITED_API
3521PyObject *__Pyx_PyFrozenDictType;
3522#endif
3523
3524/* CommonTypesMetaclass.module_state_decls */
3525PyTypeObject *__pyx_CommonTypesMetaclassType;
3526
3527/* CachedMethodType.module_state_decls */
3528#if CYTHON_COMPILING_IN_LIMITED_API
3529PyObject *__Pyx_CachedMethodType;
3530#endif
3531
3532/* CythonFunctionPerModule.module_state_decls */
3533PyTypeObject *__pyx_CyFunctionType;
3534
3535/* CodeObjectCache.module_state_decls */
3536struct __Pyx_CodeObjectCache __pyx_code_cache;
3537
3538/* #### Code section: module_state_end ### */
3539} __pyx_mstatetype;
3540#ifdef __cplusplus
3541} /* anonymous namespace */
3542#endif
3543
3544#if CYTHON_USE_MODULE_STATE
3545#ifdef __cplusplus
3546namespace {
3547extern struct PyModuleDef __pyx_moduledef;
3548} /* anonymous namespace */
3549#else
3550static struct PyModuleDef __pyx_moduledef;
3551#endif
3552
3553#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3554
3555#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3556#else
3557static __pyx_mstatetype __pyx_mstate_global_static =
3558#ifdef __cplusplus
3559 {};
3560#else
3561 {0};
3562#endif
3563static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
3564#endif
3565/* #### Code section: constant_name_defines ### */
3566#define __pyx_kp_u_ __pyx_string_tab[0]
3567#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[1]
3568#define __pyx_kp_u_add_note __pyx_string_tab[2]
3569#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[3]
3570#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[4]
3571#define __pyx_kp_u_proteus_subsurfaceTransportFunct __pyx_string_tab[5]
3572#define __pyx_n_u_DKWr_DpsiC __pyx_string_tab[6]
3573#define __pyx_n_u_DsBar_DpsiC __pyx_string_tab[7]
3574#define __pyx_n_u_DthetaW_DpsiC __pyx_string_tab[8]
3575#define __pyx_n_u_DvBar_DpsiC __pyx_string_tab[9]
3576#define __pyx_n_u_I __pyx_string_tab[10]
3577#define __pyx_n_u_J __pyx_string_tab[11]
3578#define __pyx_n_u_KWr __pyx_string_tab[12]
3579#define __pyx_n_u_KWs __pyx_string_tab[13]
3580#define __pyx_n_u_RE_NCP1_evaluateElementCoefficie __pyx_string_tab[14]
3581#define __pyx_n_u_RE_NCP1_evaluateElementCoefficie_2 __pyx_string_tab[15]
3582#define __pyx_n_u_RE_NCP1_getElementJacobian __pyx_string_tab[16]
3583#define __pyx_n_u_RE_NCP1_getElementResidual __pyx_string_tab[17]
3584#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[18]
3585#define __pyx_n_u_annotate __pyx_string_tab[19]
3586#define __pyx_n_u_class_getitem __pyx_string_tab[20]
3587#define __pyx_n_u_func __pyx_string_tab[21]
3588#define __pyx_n_u_main __pyx_string_tab[22]
3589#define __pyx_n_u_module __pyx_string_tab[23]
3590#define __pyx_n_u_name __pyx_string_tab[24]
3591#define __pyx_n_u_qualname __pyx_string_tab[25]
3592#define __pyx_n_u_test __pyx_string_tab[26]
3593#define __pyx_n_u_is_coroutine __pyx_string_tab[27]
3594#define __pyx_n_u_a_avg __pyx_string_tab[28]
3595#define __pyx_n_u_a_eN __pyx_string_tab[29]
3596#define __pyx_n_u_a_neig __pyx_string_tab[30]
3597#define __pyx_n_u_a_up __pyx_string_tab[31]
3598#define __pyx_n_u_alpha __pyx_string_tab[32]
3599#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[33]
3600#define __pyx_n_u_beta __pyx_string_tab[34]
3601#define __pyx_n_u_calculateNormalFlux __pyx_string_tab[35]
3602#define __pyx_n_u_characteristic_velocity __pyx_string_tab[36]
3603#define __pyx_n_u_characteristic_velocity_dofs __pyx_string_tab[37]
3604#define __pyx_n_u_cline_in_traceback __pyx_string_tab[38]
3605#define __pyx_n_u_clock __pyx_string_tab[39]
3606#define __pyx_n_u_colind __pyx_string_tab[40]
3607#define __pyx_n_u_computeSimpleCharacteristicVeloc __pyx_string_tab[41]
3608#define __pyx_n_u_computeSimpleCharacteristicVeloc_2 __pyx_string_tab[42]
3609#define __pyx_n_u_d __pyx_string_tab[43]
3610#define __pyx_n_u_dS __pyx_string_tab[44]
3611#define __pyx_n_u_dV __pyx_string_tab[45]
3612#define __pyx_n_u_denom __pyx_string_tab[46]
3613#define __pyx_n_u_df __pyx_string_tab[47]
3614#define __pyx_n_u_df_dofs __pyx_string_tab[48]
3615#define __pyx_n_u_dkr_up __pyx_string_tab[49]
3616#define __pyx_n_u_dm __pyx_string_tab[50]
3617#define __pyx_n_u_dmt __pyx_string_tab[51]
3618#define __pyx_n_u_dmtj_avg __pyx_string_tab[52]
3619#define __pyx_n_u_dot __pyx_string_tab[53]
3620#define __pyx_n_u_drhom __pyx_string_tab[54]
3621#define __pyx_n_u_eN __pyx_string_tab[55]
3622#define __pyx_n_u_eN_left __pyx_string_tab[56]
3623#define __pyx_n_u_eN_neighbor __pyx_string_tab[57]
3624#define __pyx_n_u_eN_right __pyx_string_tab[58]
3625#define __pyx_n_u_ebN __pyx_string_tab[59]
3626#define __pyx_n_u_ebNE __pyx_string_tab[60]
3627#define __pyx_n_u_ebN_local __pyx_string_tab[61]
3628#define __pyx_n_u_ebq_global_vals __pyx_string_tab[62]
3629#define __pyx_n_u_ebq_vals __pyx_string_tab[63]
3630#define __pyx_n_u_elementBarycentersArray __pyx_string_tab[64]
3631#define __pyx_n_u_elementBoundariesArray __pyx_string_tab[65]
3632#define __pyx_n_u_elementBoundaryElementsArray __pyx_string_tab[66]
3633#define __pyx_n_u_elementBoundaryMaterialTypes __pyx_string_tab[67]
3634#define __pyx_n_u_elementBoundaryTypes __pyx_string_tab[68]
3635#define __pyx_n_u_elementJacobian __pyx_string_tab[69]
3636#define __pyx_n_u_elementMaterialTypes __pyx_string_tab[70]
3637#define __pyx_n_u_elementNeighborsArray __pyx_string_tab[71]
3638#define __pyx_n_u_elementResidual __pyx_string_tab[72]
3639#define __pyx_n_u_evaluateScalarMaterialFunctionOv_2 __pyx_string_tab[73]
3640#define __pyx_n_u_evaluateScalarMaterialFunctionOv __pyx_string_tab[74]
3641#define __pyx_n_u_evaluateScalarMaterialFunctionOv_3 __pyx_string_tab[75]
3642#define __pyx_n_u_evaluateSparseTensorMaterialFunc __pyx_string_tab[76]
3643#define __pyx_n_u_evaluateSparseTensorMaterialFunc_2 __pyx_string_tab[77]
3644#define __pyx_n_u_evaluateVectorMaterialFunctionOv __pyx_string_tab[78]
3645#define __pyx_n_u_exteriorElementBoundariesArray __pyx_string_tab[79]
3646#define __pyx_n_u_exteriorElementBoundaryMaterialT __pyx_string_tab[80]
3647#define __pyx_n_u_f_up __pyx_string_tab[81]
3648#define __pyx_n_u_flat __pyx_string_tab[82]
3649#define __pyx_n_u_flux __pyx_string_tab[83]
3650#define __pyx_n_u_gravity __pyx_string_tab[84]
3651#define __pyx_n_u_helicalElementVelocityEval3 __pyx_string_tab[85]
3652#define __pyx_n_u_helicalElementVelocityEval4 __pyx_string_tab[86]
3653#define __pyx_n_u_i __pyx_string_tab[87]
3654#define __pyx_n_u_ii __pyx_string_tab[88]
3655#define __pyx_n_u_integral __pyx_string_tab[89]
3656#define __pyx_n_u_items __pyx_string_tab[90]
3657#define __pyx_n_u_j __pyx_string_tab[91]
3658#define __pyx_n_u_jacobian_weak_residual __pyx_string_tab[92]
3659#define __pyx_n_u_k __pyx_string_tab[93]
3660#define __pyx_n_u_kb __pyx_string_tab[94]
3661#define __pyx_n_u_kr_eN __pyx_string_tab[95]
3662#define __pyx_n_u_kr_neig __pyx_string_tab[96]
3663#define __pyx_n_u_l2g __pyx_string_tab[97]
3664#define __pyx_n_u_m __pyx_string_tab[98]
3665#define __pyx_n_u_matID __pyx_string_tab[99]
3666#define __pyx_n_u_matID_neig __pyx_string_tab[100]
3667#define __pyx_n_u_material __pyx_string_tab[101]
3668#define __pyx_n_u_material_functions __pyx_string_tab[102]
3669#define __pyx_n_u_material_left __pyx_string_tab[103]
3670#define __pyx_n_u_material_right __pyx_string_tab[104]
3671#define __pyx_n_u_mt __pyx_string_tab[105]
3672#define __pyx_n_u_mt_avg __pyx_string_tab[106]
3673#define __pyx_n_u_n __pyx_string_tab[107]
3674#define __pyx_n_u_nAvgWeight __pyx_string_tab[108]
3675#define __pyx_n_u_nDOF_test_element __pyx_string_tab[109]
3676#define __pyx_n_u_nDOF_trial_element __pyx_string_tab[110]
3677#define __pyx_n_u_nElementBoundaries_element __pyx_string_tab[111]
3678#define __pyx_n_u_nElementBoundaries_global __pyx_string_tab[112]
3679#define __pyx_n_u_nElements_global __pyx_string_tab[113]
3680#define __pyx_n_u_nExteriorElementBoundaries_globa __pyx_string_tab[114]
3681#define __pyx_n_u_nSpace __pyx_string_tab[115]
3682#define __pyx_n_u_nSpace2 __pyx_string_tab[116]
3683#define __pyx_n_u_nd __pyx_string_tab[117]
3684#define __pyx_n_u_nnz __pyx_string_tab[118]
3685#define __pyx_n_u_numer __pyx_string_tab[119]
3686#define __pyx_n_u_numpy __pyx_string_tab[120]
3687#define __pyx_n_u_omega_e __pyx_string_tab[121]
3688#define __pyx_n_u_one8 __pyx_string_tab[122]
3689#define __pyx_n_u_onePlus_pcBar_n __pyx_string_tab[123]
3690#define __pyx_n_u_pcBar __pyx_string_tab[124]
3691#define __pyx_n_u_pcBar_n __pyx_string_tab[125]
3692#define __pyx_n_u_pcBar_nM1 __pyx_string_tab[126]
3693#define __pyx_n_u_pcBar_nM2 __pyx_string_tab[127]
3694#define __pyx_n_u_phi_eN __pyx_string_tab[128]
3695#define __pyx_n_u_phi_neig __pyx_string_tab[129]
3696#define __pyx_n_u_pi __pyx_string_tab[130]
3697#define __pyx_n_u_picard __pyx_string_tab[131]
3698#define __pyx_n_u_pop __pyx_string_tab[132]
3699#define __pyx_n_u_psiC __pyx_string_tab[133]
3700#define __pyx_n_u_q __pyx_string_tab[134]
3701#define __pyx_n_u_q_alin __pyx_string_tab[135]
3702#define __pyx_n_u_q_detJ __pyx_string_tab[136]
3703#define __pyx_n_u_q_dkr __pyx_string_tab[137]
3704#define __pyx_n_u_q_dm __pyx_string_tab[138]
3705#define __pyx_n_u_q_dmass __pyx_string_tab[139]
3706#define __pyx_n_u_q_dmt __pyx_string_tab[140]
3707#define __pyx_n_u_q_flin __pyx_string_tab[141]
3708#define __pyx_n_u_q_grad_u __pyx_string_tab[142]
3709#define __pyx_n_u_q_grad_v __pyx_string_tab[143]
3710#define __pyx_n_u_q_grad_w __pyx_string_tab[144]
3711#define __pyx_n_u_q_kr __pyx_string_tab[145]
3712#define __pyx_n_u_q_kr_up __pyx_string_tab[146]
3713#define __pyx_n_u_q_m __pyx_string_tab[147]
3714#define __pyx_n_u_q_mass __pyx_string_tab[148]
3715#define __pyx_n_u_q_mt __pyx_string_tab[149]
3716#define __pyx_n_u_q_r __pyx_string_tab[150]
3717#define __pyx_n_u_q_u __pyx_string_tab[151]
3718#define __pyx_n_u_q_vals __pyx_string_tab[152]
3719#define __pyx_n_u_q_x __pyx_string_tab[153]
3720#define __pyx_n_u_rho __pyx_string_tab[154]
3721#define __pyx_n_u_rho2 __pyx_string_tab[155]
3722#define __pyx_n_u_rhom __pyx_string_tab[156]
3723#define __pyx_n_u_rotatingGaussianElementVelocityE __pyx_string_tab[157]
3724#define __pyx_n_u_rotatingGaussianElementVelocityE_2 __pyx_string_tab[158]
3725#define __pyx_n_u_rowptr __pyx_string_tab[159]
3726#define __pyx_n_u_sBar __pyx_string_tab[160]
3727#define __pyx_n_u_setElementBoundariesArray __pyx_string_tab[161]
3728#define __pyx_n_u_setExteriorElementBoundaryTypes __pyx_string_tab[162]
3729#define __pyx_n_u_setScalarMaterialFunctionOverEle_2 __pyx_string_tab[163]
3730#define __pyx_n_u_setScalarMaterialFunctionOverEle __pyx_string_tab[164]
3731#define __pyx_n_u_setScalarMaterialFunctionOverGlo __pyx_string_tab[165]
3732#define __pyx_n_u_setSparseTensorMaterialFunctionO __pyx_string_tab[166]
3733#define __pyx_n_u_setSparseTensorMaterialFunctionO_2 __pyx_string_tab[167]
3734#define __pyx_n_u_setVectorMaterialFunctionOverEle __pyx_string_tab[168]
3735#define __pyx_n_u_setdefault __pyx_string_tab[169]
3736#define __pyx_n_u_shape __pyx_string_tab[170]
3737#define __pyx_n_u_sqrt_sBar __pyx_string_tab[171]
3738#define __pyx_n_u_subsurfaceTransportFunctions __pyx_string_tab[172]
3739#define __pyx_n_u_sum __pyx_string_tab[173]
3740#define __pyx_n_u_t __pyx_string_tab[174]
3741#define __pyx_n_u_tForReversal __pyx_string_tab[175]
3742#define __pyx_n_u_thetaR __pyx_string_tab[176]
3743#define __pyx_n_u_thetaS __pyx_string_tab[177]
3744#define __pyx_n_u_thetaSR __pyx_string_tab[178]
3745#define __pyx_n_u_thetaW __pyx_string_tab[179]
3746#define __pyx_n_u_thisElementIsUpwind __pyx_string_tab[180]
3747#define __pyx_n_u_transient __pyx_string_tab[181]
3748#define __pyx_n_u_u_dof __pyx_string_tab[182]
3749#define __pyx_n_u_u_eN __pyx_string_tab[183]
3750#define __pyx_n_u_u_j __pyx_string_tab[184]
3751#define __pyx_n_u_u_l2g __pyx_string_tab[185]
3752#define __pyx_n_u_u_neig __pyx_string_tab[186]
3753#define __pyx_n_u_updateMassJacobian_weakAvg __pyx_string_tab[187]
3754#define __pyx_n_u_updateMass_weakAvg __pyx_string_tab[188]
3755#define __pyx_n_u_upwindFlag __pyx_string_tab[189]
3756#define __pyx_n_u_v __pyx_string_tab[190]
3757#define __pyx_n_u_vBar __pyx_string_tab[191]
3758#define __pyx_n_u_vBar2 __pyx_string_tab[192]
3759#define __pyx_n_u_values __pyx_string_tab[193]
3760#define __pyx_n_u_vol __pyx_string_tab[194]
3761#define __pyx_n_u_volFactor __pyx_string_tab[195]
3762#define __pyx_n_u_vol_e __pyx_string_tab[196]
3763#define __pyx_n_u_volume __pyx_string_tab[197]
3764#define __pyx_n_u_vortexElementVelocityEval3 __pyx_string_tab[198]
3765#define __pyx_n_u_vortexElementVelocityEval4 __pyx_string_tab[199]
3766#define __pyx_n_u_w __pyx_string_tab[200]
3767#define __pyx_n_u_weak_residual __pyx_string_tab[201]
3768#define __pyx_n_u_weight __pyx_string_tab[202]
3769#define __pyx_n_u_x __pyx_string_tab[203]
3770#define __pyx_n_u_xc __pyx_string_tab[204]
3771#define __pyx_n_u_yc __pyx_string_tab[205]
3772#define __pyx_n_u_zVelocity __pyx_string_tab[206]
3773#define __pyx_n_u_zeros __pyx_string_tab[207]
3774#define __pyx_n_u_zvelocity __pyx_string_tab[208]
3775#define __pyx_kp_b_iso88591_Qa_vU_1F_1_uAQfAQ_3b_Cq_4q_3as __pyx_string_tab[209]
3776#define __pyx_kp_b_iso88591_Qa_vU_1F_1_aq_aq_U_q_q_Qc_Rt3ar __pyx_string_tab[210]
3777#define __pyx_kp_b_iso88591_uAQ_at1_at1_AT_B_1_AT_B_1_9Cq_U __pyx_string_tab[211]
3778#define __pyx_kp_b_iso88591_Qa_AQ_4q_AX5I __pyx_string_tab[212]
3779#define __pyx_kp_b_iso88591_vU_1F_1_aq_aq_A_V5_U_1F_1_1AS_C __pyx_string_tab[213]
3780#define __pyx_kp_b_iso88591_e1F_q_E_avV1A_3g_q __pyx_string_tab[214]
3781#define __pyx_kp_b_iso88591_avQauAS_1_3a_V5_uAQfAQ_5_QavQa __pyx_string_tab[215]
3782#define __pyx_kp_b_iso88591_avQc_A_3a_V5_U_1F_1_Bc_ARr_3b_1 __pyx_string_tab[216]
3783#define __pyx_kp_b_iso88591_e1F_q_E_avV1A_3e_Qa __pyx_string_tab[217]
3784#define __pyx_kp_b_iso88591_vU_2V1A_q_q_uARvQa_2Qc_1Bas_3a __pyx_string_tab[218]
3785#define __pyx_kp_b_iso88591_e1AV1A_q_E_aq_aq_3g_q_1Cs_A __pyx_string_tab[219]
3786#define __pyx_kp_b_iso88591_vU_3fAQ_A_uAS_aq_3a_uAQfAQ_U_q __pyx_string_tab[220]
3787#define __pyx_kp_b_iso88591_j_1_QavQa_U_q_q_Qc_3c_Baq_2Rq_Q __pyx_string_tab[221]
3788#define __pyx_kp_b_iso88591_j_1_QavQa_WE_6_U_1F_1_D_S_2Qas __pyx_string_tab[222]
3789#define __pyx_kp_b_iso88591_e1AV1A_q_E_aq_aq_3e_Qiq_S __pyx_string_tab[223]
3790#define __pyx_kp_b_iso88591_vU_2V1A_a_uARvQa_Bas_Bas_ARq_1 __pyx_string_tab[224]
3791#define __pyx_kp_b_iso88591_vU_2V1A_a_uARvQa_Bas_Bas_ARq_1_2 __pyx_string_tab[225]
3792#define __pyx_kp_b_iso88591_e1HF_1_M_axvQa_A_0_Q_0_Q_U_86_J __pyx_string_tab[226]
3793#define __pyx_kp_b_iso88591_uA_F_1_AT_AT_E_a_fAQ_1D_S_A_1_A __pyx_string_tab[227]
3794#define __pyx_kp_b_iso88591_e1AV1A_M_aq_aq_A_0_Q_0_Q_U_1F_1 __pyx_string_tab[228]
3795#define __pyx_kp_b_iso88591_e1HF_1_M_axvQa_A_0_Q_0_Q_U_86_E __pyx_string_tab[229]
3796#define __pyx_kp_b_iso88591_uAQfAQ_AT_AT_E_aq_aq_1D_S_A_1AQ __pyx_string_tab[230]
3797#define __pyx_kp_b_iso88591_uA_F_1_AT_AT_E_a_fAQ_U_1_E_aq_C __pyx_string_tab[231]
3798#define __pyx_kp_b_iso88591_e1AV1A_M_aq_aq_A_0_Q_0_Q_U_1F_1_2 __pyx_string_tab[232]
3799#define __pyx_kp_b_iso88591_uAQfAQ_AT_AT_E_aq_aq_U_1_E_aq_C __pyx_string_tab[233]
3800#define __pyx_kp_b_iso88591_6_vQa_6_0_V1D_0_V1D_0_V1D_e1A_A __pyx_string_tab[234]
3801#define __pyx_kp_b_iso88591_P_Qd_U_q_as_V1A_c_3aq_S_e1A_AQ __pyx_string_tab[235]
3802#define __pyx_kp_b_iso88591_R_Qd_e4q_q_as_V1A_S_aq_6_U_Q_U __pyx_string_tab[236]
3803#define __pyx_kp_b_iso88591_a_Qd_e4q_q_as_V1A_S_aq_6_U_Q_U __pyx_string_tab[237]
3804#define __pyx_float_0_0 __pyx_number_tab[0]
3805#define __pyx_float_0_5 __pyx_number_tab[1]
3806#define __pyx_float_2_0 __pyx_number_tab[2]
3807#define __pyx_float_1_0eneg_20 __pyx_number_tab[3]
3808/* #### Code section: module_state_clear ### */
3809#if CYTHON_USE_MODULE_STATE
3810static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
3811 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
3812 if (!clear_module_state) return 0;
3813 Py_CLEAR(clear_module_state->__pyx_d);
3814 Py_CLEAR(clear_module_state->__pyx_b);
3815 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3816 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3817 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3818 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3819 #if CYTHON_PEP489_MULTI_PHASE_INIT
3820 __Pyx_State_RemoveModule(NULL);
3821 #endif
3822 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3823 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3824 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3825 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3826 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3827 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3828 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3829 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3830 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3831 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3832 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3833 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3834 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3835 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3836 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3837 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3838 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
3839 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
3840 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
3841 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
3842 for (int i=0; i<29; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3843 for (int i=0; i<238; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3844 for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
3845/* #### Code section: module_state_clear_contents ### */
3846/* CommonTypesMetaclass.module_state_clear */
3847Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3848
3849/* CythonFunctionPerModule.module_state_clear */
3850Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3851
3852/* #### Code section: module_state_clear_end ### */
3853return 0;
3854}
3855#endif
3856/* #### Code section: module_state_traverse ### */
3857#if CYTHON_USE_MODULE_STATE
3858static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
3859 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
3860 if (!traverse_module_state) return 0;
3861 Py_VISIT(traverse_module_state->__pyx_d);
3862 Py_VISIT(traverse_module_state->__pyx_b);
3863 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3864 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
3865 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
3866 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
3867 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3868 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3869 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3870 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3871 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3872 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3873 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3874 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3875 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3876 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3877 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3878 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3879 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3880 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3881 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3882 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3883 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
3884 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
3885 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
3886 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
3887 for (int i=0; i<29; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3888 for (int i=0; i<238; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3889 for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
3890/* #### Code section: module_state_traverse_contents ### */
3891/* CommonTypesMetaclass.module_state_traverse */
3892Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3893
3894/* CythonFunctionPerModule.module_state_traverse */
3895Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3896
3897/* #### Code section: module_state_traverse_end ### */
3898return 0;
3899}
3900#endif
3901/* #### Code section: module_code ### */
3902
3903/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
3904 *
3905 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
3906 * @property # <<<<<<<<<<<<<<
3907 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3908 * return PyDataType_TYPEOBJ(self)
3909*/
3910
3911static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3912 PyTypeObject *__pyx_r;
3913
3914 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
3915 * @property
3916 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3917 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
3918 *
3919 * @property
3920*/
3921 {
3922
3923 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3924 }
3925 goto __pyx_L0;
3926
3927 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
3928 *
3929 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
3930 * @property # <<<<<<<<<<<<<<
3931 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3932 * return PyDataType_TYPEOBJ(self)
3933*/
3934
3935 /* function exit code */
3936 __pyx_L0:;
3937 return __pyx_r;
3938}
3939
3940/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
3941 * return PyDataType_TYPEOBJ(self)
3942 *
3943 * @property # <<<<<<<<<<<<<<
3944 * cdef inline char kind(self) noexcept nogil:
3945 * return PyDataType_KIND(self)
3946*/
3947
3948static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3949 char __pyx_r;
3950
3951 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
3952 * @property
3953 * cdef inline char kind(self) noexcept nogil:
3954 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
3955 *
3956 * @property
3957*/
3958 {
3959
3960 __pyx_r = PyDataType_KIND(__pyx_v_self);
3961 }
3962 goto __pyx_L0;
3963
3964 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
3965 * return PyDataType_TYPEOBJ(self)
3966 *
3967 * @property # <<<<<<<<<<<<<<
3968 * cdef inline char kind(self) noexcept nogil:
3969 * return PyDataType_KIND(self)
3970*/
3971
3972 /* function exit code */
3973 __pyx_L0:;
3974 return __pyx_r;
3975}
3976
3977/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
3978 * return PyDataType_KIND(self)
3979 *
3980 * @property # <<<<<<<<<<<<<<
3981 * cdef inline char type(self) noexcept nogil:
3982 * return PyDataType_TYPE(self)
3983*/
3984
3985static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3986 char __pyx_r;
3987
3988 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
3989 * @property
3990 * cdef inline char type(self) noexcept nogil:
3991 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
3992 *
3993 * # Numpy sometimes mutates this without warning (e.g. it'll
3994*/
3995 {
3996
3997 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3998 }
3999 goto __pyx_L0;
4000
4001 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
4002 * return PyDataType_KIND(self)
4003 *
4004 * @property # <<<<<<<<<<<<<<
4005 * cdef inline char type(self) noexcept nogil:
4006 * return PyDataType_TYPE(self)
4007*/
4008
4009 /* function exit code */
4010 __pyx_L0:;
4011 return __pyx_r;
4012}
4013
4014/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
4015 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
4016 * # directly accessing this field.
4017 * @property # <<<<<<<<<<<<<<
4018 * cdef inline char byteorder(self) noexcept nogil:
4019 * return PyDataType_BYTEORDER(self)
4020*/
4021
4022static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
4023 char __pyx_r;
4024
4025 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
4026 * @property
4027 * cdef inline char byteorder(self) noexcept nogil:
4028 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
4029 *
4030 * @property
4031*/
4032 {
4033
4034 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
4035 }
4036 goto __pyx_L0;
4037
4038 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
4039 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
4040 * # directly accessing this field.
4041 * @property # <<<<<<<<<<<<<<
4042 * cdef inline char byteorder(self) noexcept nogil:
4043 * return PyDataType_BYTEORDER(self)
4044*/
4045
4046 /* function exit code */
4047 __pyx_L0:;
4048 return __pyx_r;
4049}
4050
4051/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
4052 * return PyDataType_BYTEORDER(self)
4053 *
4054 * @property # <<<<<<<<<<<<<<
4055 * cdef inline int type_num(self) noexcept nogil:
4056 * return PyDataType_TYPENUM(self)
4057*/
4058
4059static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
4060 int __pyx_r;
4061
4062 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
4063 * @property
4064 * cdef inline int type_num(self) noexcept nogil:
4065 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
4066 *
4067 * @property
4068*/
4069 {
4070
4071 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
4072 }
4073 goto __pyx_L0;
4074
4075 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
4076 * return PyDataType_BYTEORDER(self)
4077 *
4078 * @property # <<<<<<<<<<<<<<
4079 * cdef inline int type_num(self) noexcept nogil:
4080 * return PyDataType_TYPENUM(self)
4081*/
4082
4083 /* function exit code */
4084 __pyx_L0:;
4085 return __pyx_r;
4086}
4087
4088/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
4089 * return PyDataType_TYPENUM(self)
4090 *
4091 * @property # <<<<<<<<<<<<<<
4092 * cdef inline npy_intp itemsize(self) noexcept nogil:
4093 * return PyDataType_ELSIZE(self)
4094*/
4095
4096static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
4097 npy_intp __pyx_r;
4098
4099 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
4100 * @property
4101 * cdef inline npy_intp itemsize(self) noexcept nogil:
4102 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
4103 *
4104 * @property
4105*/
4106 {
4107
4108 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
4109 }
4110 goto __pyx_L0;
4111
4112 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
4113 * return PyDataType_TYPENUM(self)
4114 *
4115 * @property # <<<<<<<<<<<<<<
4116 * cdef inline npy_intp itemsize(self) noexcept nogil:
4117 * return PyDataType_ELSIZE(self)
4118*/
4119
4120 /* function exit code */
4121 __pyx_L0:;
4122 return __pyx_r;
4123}
4124
4125/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
4126 * return PyDataType_ELSIZE(self)
4127 *
4128 * @property # <<<<<<<<<<<<<<
4129 * cdef inline npy_intp alignment(self) noexcept nogil:
4130 * return PyDataType_ALIGNMENT(self)
4131*/
4132
4133static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
4134 npy_intp __pyx_r;
4135
4136 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
4137 * @property
4138 * cdef inline npy_intp alignment(self) noexcept nogil:
4139 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
4140 *
4141 * # Use fields/names with care as they may be NULL. You must check
4142*/
4143 {
4144
4145 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
4146 }
4147 goto __pyx_L0;
4148
4149 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
4150 * return PyDataType_ELSIZE(self)
4151 *
4152 * @property # <<<<<<<<<<<<<<
4153 * cdef inline npy_intp alignment(self) noexcept nogil:
4154 * return PyDataType_ALIGNMENT(self)
4155*/
4156
4157 /* function exit code */
4158 __pyx_L0:;
4159 return __pyx_r;
4160}
4161
4162/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
4163 * # Use fields/names with care as they may be NULL. You must check
4164 * # for this using PyDataType_HASFIELDS.
4165 * @property # <<<<<<<<<<<<<<
4166 * cdef inline object fields(self):
4167 * return <object>PyDataType_FIELDS(self)
4168*/
4169
4170static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
4171 PyObject *__pyx_r = NULL;
4172 __Pyx_RefNannyDeclarations
4173 PyObject *__pyx_t_1;
4174 __Pyx_RefNannySetupContext("__get__", 0);
4175
4176 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
4177 * @property
4178 * cdef inline object fields(self):
4179 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
4180 *
4181 * @property
4182*/
4183 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
4184
4185 {
4186 PyObject *__pyx_temp;
4187 {
4188 __pyx_temp = __pyx_r;
4189 __Pyx_INCREF(((PyObject *)__pyx_t_1));
4190 __pyx_r = ((PyObject *)__pyx_t_1);
4191 }
4192 __Pyx_XDECREF(__pyx_temp);
4193 }
4194
4195 goto __pyx_L0;
4196
4197 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
4198 * # Use fields/names with care as they may be NULL. You must check
4199 * # for this using PyDataType_HASFIELDS.
4200 * @property # <<<<<<<<<<<<<<
4201 * cdef inline object fields(self):
4202 * return <object>PyDataType_FIELDS(self)
4203*/
4204
4205 /* function exit code */
4206 __pyx_L0:;
4207 __Pyx_XGIVEREF(__pyx_r);
4208 __Pyx_RefNannyFinishContext();
4209 return __pyx_r;
4210}
4211
4212/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
4213 * return <object>PyDataType_FIELDS(self)
4214 *
4215 * @property # <<<<<<<<<<<<<<
4216 * cdef inline tuple names(self):
4217 * return <tuple>PyDataType_NAMES(self)
4218*/
4219
4220static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
4221 PyObject *__pyx_r = NULL;
4222 __Pyx_RefNannyDeclarations
4223 PyObject *__pyx_t_1;
4224 __Pyx_RefNannySetupContext("__get__", 0);
4225
4226 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
4227 * @property
4228 * cdef inline tuple names(self):
4229 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
4230 *
4231 * # Use PyDataType_HASSUBARRAY to test whether this field is
4232*/
4233 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
4234
4235 {
4236 PyObject *__pyx_temp;
4237 {
4238 __pyx_temp = __pyx_r;
4239 __Pyx_INCREF(((PyObject*)__pyx_t_1));
4240 __pyx_r = ((PyObject*)__pyx_t_1);
4241 }
4242 __Pyx_XDECREF(__pyx_temp);
4243 }
4244
4245 goto __pyx_L0;
4246
4247 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
4248 * return <object>PyDataType_FIELDS(self)
4249 *
4250 * @property # <<<<<<<<<<<<<<
4251 * cdef inline tuple names(self):
4252 * return <tuple>PyDataType_NAMES(self)
4253*/
4254
4255 /* function exit code */
4256 __pyx_L0:;
4257 __Pyx_XGIVEREF(__pyx_r);
4258 __Pyx_RefNannyFinishContext();
4259 return __pyx_r;
4260}
4261
4262/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
4263 * # valid (the pointer can be NULL). Most users should access
4264 * # this field via the inline helper method PyDataType_SHAPE.
4265 * @property # <<<<<<<<<<<<<<
4266 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4267 * return PyDataType_SUBARRAY(self)
4268*/
4269
4270static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
4271 PyArray_ArrayDescr *__pyx_r;
4272
4273 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
4274 * @property
4275 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4276 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
4277 *
4278 * @property
4279*/
4280 {
4281
4282 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
4283 }
4284 goto __pyx_L0;
4285
4286 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
4287 * # valid (the pointer can be NULL). Most users should access
4288 * # this field via the inline helper method PyDataType_SHAPE.
4289 * @property # <<<<<<<<<<<<<<
4290 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4291 * return PyDataType_SUBARRAY(self)
4292*/
4293
4294 /* function exit code */
4295 __pyx_L0:;
4296 return __pyx_r;
4297}
4298
4299/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
4300 * return PyDataType_SUBARRAY(self)
4301 *
4302 * @property # <<<<<<<<<<<<<<
4303 * cdef inline npy_uint64 flags(self) noexcept nogil:
4304 * """The data types flags."""
4305*/
4306
4307static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
4308 npy_uint64 __pyx_r;
4309
4310 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
4311 * cdef inline npy_uint64 flags(self) noexcept nogil:
4312 * """The data types flags."""
4313 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
4314 *
4315 *
4316*/
4317 {
4318
4319 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
4320 }
4321 goto __pyx_L0;
4322
4323 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
4324 * return PyDataType_SUBARRAY(self)
4325 *
4326 * @property # <<<<<<<<<<<<<<
4327 * cdef inline npy_uint64 flags(self) noexcept nogil:
4328 * """The data types flags."""
4329*/
4330
4331 /* function exit code */
4332 __pyx_L0:;
4333 return __pyx_r;
4334}
4335
4336/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
4337 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
4338 *
4339 * @property # <<<<<<<<<<<<<<
4340 * cdef inline int numiter(self) noexcept nogil:
4341 * """The number of arrays that need to be broadcast to the same shape."""
4342*/
4343
4344static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
4345 int __pyx_r;
4346
4347 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
4348 * cdef inline int numiter(self) noexcept nogil:
4349 * """The number of arrays that need to be broadcast to the same shape."""
4350 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
4351 *
4352 * @property
4353*/
4354 {
4355
4356 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
4357 }
4358 goto __pyx_L0;
4359
4360 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
4361 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
4362 *
4363 * @property # <<<<<<<<<<<<<<
4364 * cdef inline int numiter(self) noexcept nogil:
4365 * """The number of arrays that need to be broadcast to the same shape."""
4366*/
4367
4368 /* function exit code */
4369 __pyx_L0:;
4370 return __pyx_r;
4371}
4372
4373/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
4374 * return PyArray_MultiIter_NUMITER(self)
4375 *
4376 * @property # <<<<<<<<<<<<<<
4377 * cdef inline npy_intp size(self) noexcept nogil:
4378 * """The total broadcasted size."""
4379*/
4380
4381static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
4382 npy_intp __pyx_r;
4383
4384 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
4385 * cdef inline npy_intp size(self) noexcept nogil:
4386 * """The total broadcasted size."""
4387 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
4388 *
4389 * @property
4390*/
4391 {
4392
4393 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
4394 }
4395 goto __pyx_L0;
4396
4397 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
4398 * return PyArray_MultiIter_NUMITER(self)
4399 *
4400 * @property # <<<<<<<<<<<<<<
4401 * cdef inline npy_intp size(self) noexcept nogil:
4402 * """The total broadcasted size."""
4403*/
4404
4405 /* function exit code */
4406 __pyx_L0:;
4407 return __pyx_r;
4408}
4409
4410/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
4411 * return PyArray_MultiIter_SIZE(self)
4412 *
4413 * @property # <<<<<<<<<<<<<<
4414 * cdef inline npy_intp index(self) noexcept nogil:
4415 * """The current (1-d) index into the broadcasted result."""
4416*/
4417
4418static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
4419 npy_intp __pyx_r;
4420
4421 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
4422 * cdef inline npy_intp index(self) noexcept nogil:
4423 * """The current (1-d) index into the broadcasted result."""
4424 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
4425 *
4426 * @property
4427*/
4428 {
4429
4430 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
4431 }
4432 goto __pyx_L0;
4433
4434 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
4435 * return PyArray_MultiIter_SIZE(self)
4436 *
4437 * @property # <<<<<<<<<<<<<<
4438 * cdef inline npy_intp index(self) noexcept nogil:
4439 * """The current (1-d) index into the broadcasted result."""
4440*/
4441
4442 /* function exit code */
4443 __pyx_L0:;
4444 return __pyx_r;
4445}
4446
4447/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
4448 * return PyArray_MultiIter_INDEX(self)
4449 *
4450 * @property # <<<<<<<<<<<<<<
4451 * cdef inline int nd(self) noexcept nogil:
4452 * """The number of dimensions in the broadcasted result."""
4453*/
4454
4455static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
4456 int __pyx_r;
4457
4458 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
4459 * cdef inline int nd(self) noexcept nogil:
4460 * """The number of dimensions in the broadcasted result."""
4461 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
4462 *
4463 * @property
4464*/
4465 {
4466
4467 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
4468 }
4469 goto __pyx_L0;
4470
4471 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
4472 * return PyArray_MultiIter_INDEX(self)
4473 *
4474 * @property # <<<<<<<<<<<<<<
4475 * cdef inline int nd(self) noexcept nogil:
4476 * """The number of dimensions in the broadcasted result."""
4477*/
4478
4479 /* function exit code */
4480 __pyx_L0:;
4481 return __pyx_r;
4482}
4483
4484/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
4485 * return PyArray_MultiIter_NDIM(self)
4486 *
4487 * @property # <<<<<<<<<<<<<<
4488 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4489 * """The shape of the broadcasted result."""
4490*/
4491
4492static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
4493 npy_intp *__pyx_r;
4494
4495 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
4496 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4497 * """The shape of the broadcasted result."""
4498 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
4499 *
4500 * @property
4501*/
4502 {
4503
4504 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
4505 }
4506 goto __pyx_L0;
4507
4508 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
4509 * return PyArray_MultiIter_NDIM(self)
4510 *
4511 * @property # <<<<<<<<<<<<<<
4512 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4513 * """The shape of the broadcasted result."""
4514*/
4515
4516 /* function exit code */
4517 __pyx_L0:;
4518 return __pyx_r;
4519}
4520
4521/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
4522 * return PyArray_MultiIter_DIMS(self)
4523 *
4524 * @property # <<<<<<<<<<<<<<
4525 * cdef inline void** iters(self) noexcept nogil:
4526 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4527*/
4528
4529static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
4530 void **__pyx_r;
4531
4532 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
4533 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4534 * On return, the iterators are adjusted for broadcasting."""
4535 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
4536 *
4537 *
4538*/
4539 {
4540
4541 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
4542 }
4543 goto __pyx_L0;
4544
4545 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
4546 * return PyArray_MultiIter_DIMS(self)
4547 *
4548 * @property # <<<<<<<<<<<<<<
4549 * cdef inline void** iters(self) noexcept nogil:
4550 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4551*/
4552
4553 /* function exit code */
4554 __pyx_L0:;
4555 return __pyx_r;
4556}
4557
4558/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
4559 * # Instead, we use properties that map to the corresponding C-API functions.
4560 *
4561 * @property # <<<<<<<<<<<<<<
4562 * cdef inline PyObject* base(self) noexcept nogil:
4563 * """Returns a borrowed reference to the object owning the data/memory.
4564*/
4565
4566static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
4567 PyObject *__pyx_r;
4568
4569 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
4570 * """Returns a borrowed reference to the object owning the data/memory.
4571 * """
4572 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
4573 *
4574 * @property
4575*/
4576 {
4577
4578 __pyx_r = PyArray_BASE(__pyx_v_self);
4579 }
4580 goto __pyx_L0;
4581
4582 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
4583 * # Instead, we use properties that map to the corresponding C-API functions.
4584 *
4585 * @property # <<<<<<<<<<<<<<
4586 * cdef inline PyObject* base(self) noexcept nogil:
4587 * """Returns a borrowed reference to the object owning the data/memory.
4588*/
4589
4590 /* function exit code */
4591 __pyx_L0:;
4592 return __pyx_r;
4593}
4594
4595/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
4596 * return PyArray_BASE(self)
4597 *
4598 * @property # <<<<<<<<<<<<<<
4599 * cdef inline dtype descr(self):
4600 * """Returns an owned reference to the dtype of the array.
4601*/
4602
4603static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
4604 PyArray_Descr *__pyx_r = NULL;
4605 __Pyx_RefNannyDeclarations
4606 PyArray_Descr *__pyx_t_1;
4607 __Pyx_RefNannySetupContext("__get__", 0);
4608
4609 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
4610 * """Returns an owned reference to the dtype of the array.
4611 * """
4612 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
4613 *
4614 * @property
4615*/
4616 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
4617
4618 {
4619 PyArray_Descr *__pyx_temp;
4620 {
4621 __pyx_temp = __pyx_r;
4622 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
4623 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
4624 }
4625 __Pyx_XDECREF((PyObject *)__pyx_temp);
4626 }
4627
4628 goto __pyx_L0;
4629
4630 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
4631 * return PyArray_BASE(self)
4632 *
4633 * @property # <<<<<<<<<<<<<<
4634 * cdef inline dtype descr(self):
4635 * """Returns an owned reference to the dtype of the array.
4636*/
4637
4638 /* function exit code */
4639 __pyx_L0:;
4640 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4641 __Pyx_RefNannyFinishContext();
4642 return __pyx_r;
4643}
4644
4645/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
4646 * return <dtype>PyArray_DESCR(self)
4647 *
4648 * @property # <<<<<<<<<<<<<<
4649 * cdef inline int ndim(self) noexcept nogil:
4650 * """Returns the number of dimensions in the array.
4651*/
4652
4653static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
4654 int __pyx_r;
4655
4656 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
4657 * """Returns the number of dimensions in the array.
4658 * """
4659 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
4660 *
4661 * @property
4662*/
4663 {
4664
4665 __pyx_r = PyArray_NDIM(__pyx_v_self);
4666 }
4667 goto __pyx_L0;
4668
4669 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
4670 * return <dtype>PyArray_DESCR(self)
4671 *
4672 * @property # <<<<<<<<<<<<<<
4673 * cdef inline int ndim(self) noexcept nogil:
4674 * """Returns the number of dimensions in the array.
4675*/
4676
4677 /* function exit code */
4678 __pyx_L0:;
4679 return __pyx_r;
4680}
4681
4682/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
4683 * return PyArray_NDIM(self)
4684 *
4685 * @property # <<<<<<<<<<<<<<
4686 * cdef inline npy_intp *shape(self) noexcept nogil:
4687 * """Returns a pointer to the dimensions/shape of the array.
4688*/
4689
4690static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
4691 npy_intp *__pyx_r;
4692
4693 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
4694 * Can return NULL for 0-dimensional arrays.
4695 * """
4696 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
4697 *
4698 * @property
4699*/
4700 {
4701
4702 __pyx_r = PyArray_DIMS(__pyx_v_self);
4703 }
4704 goto __pyx_L0;
4705
4706 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
4707 * return PyArray_NDIM(self)
4708 *
4709 * @property # <<<<<<<<<<<<<<
4710 * cdef inline npy_intp *shape(self) noexcept nogil:
4711 * """Returns a pointer to the dimensions/shape of the array.
4712*/
4713
4714 /* function exit code */
4715 __pyx_L0:;
4716 return __pyx_r;
4717}
4718
4719/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
4720 * return PyArray_DIMS(self)
4721 *
4722 * @property # <<<<<<<<<<<<<<
4723 * cdef inline npy_intp *strides(self) noexcept nogil:
4724 * """Returns a pointer to the strides of the array.
4725*/
4726
4727static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4728 npy_intp *__pyx_r;
4729
4730 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
4731 * The number of elements matches the number of dimensions of the array (ndim).
4732 * """
4733 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
4734 *
4735 * @property
4736*/
4737 {
4738
4739 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4740 }
4741 goto __pyx_L0;
4742
4743 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
4744 * return PyArray_DIMS(self)
4745 *
4746 * @property # <<<<<<<<<<<<<<
4747 * cdef inline npy_intp *strides(self) noexcept nogil:
4748 * """Returns a pointer to the strides of the array.
4749*/
4750
4751 /* function exit code */
4752 __pyx_L0:;
4753 return __pyx_r;
4754}
4755
4756/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4757 * return PyArray_STRIDES(self)
4758 *
4759 * @property # <<<<<<<<<<<<<<
4760 * cdef inline npy_intp size(self) noexcept nogil:
4761 * """Returns the total size (in number of elements) of the array.
4762*/
4763
4764static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4765 npy_intp __pyx_r;
4766
4767 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
4768 * """Returns the total size (in number of elements) of the array.
4769 * """
4770 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
4771 *
4772 * @property
4773*/
4774 {
4775
4776 __pyx_r = PyArray_SIZE(__pyx_v_self);
4777 }
4778 goto __pyx_L0;
4779
4780 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4781 * return PyArray_STRIDES(self)
4782 *
4783 * @property # <<<<<<<<<<<<<<
4784 * cdef inline npy_intp size(self) noexcept nogil:
4785 * """Returns the total size (in number of elements) of the array.
4786*/
4787
4788 /* function exit code */
4789 __pyx_L0:;
4790 return __pyx_r;
4791}
4792
4793/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
4794 * return PyArray_SIZE(self)
4795 *
4796 * @property # <<<<<<<<<<<<<<
4797 * cdef inline char* data(self) noexcept nogil:
4798 * """The pointer to the data buffer as a char*.
4799*/
4800
4801static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4802 char *__pyx_r;
4803
4804 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
4805 * of `PyArray_DATA()` instead, which returns a 'void*'.
4806 * """
4807 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
4808 *
4809 *
4810*/
4811 {
4812
4813 __pyx_r = PyArray_BYTES(__pyx_v_self);
4814 }
4815 goto __pyx_L0;
4816
4817 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
4818 * return PyArray_SIZE(self)
4819 *
4820 * @property # <<<<<<<<<<<<<<
4821 * cdef inline char* data(self) noexcept nogil:
4822 * """The pointer to the data buffer as a char*.
4823*/
4824
4825 /* function exit code */
4826 __pyx_L0:;
4827 return __pyx_r;
4828}
4829
4830/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
4831 * ctypedef long double complex clongdouble_t
4832 *
4833 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4834 * return PyArray_MultiIterNew(1, <void*>a)
4835 *
4836*/
4837
4838static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4839 PyObject *__pyx_r = NULL;
4840 __Pyx_RefNannyDeclarations
4841 PyObject *__pyx_t_1 = NULL;
4842 int __pyx_lineno = 0;
4843 const char *__pyx_filename = NULL;
4844 int __pyx_clineno = 0;
4845 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
4846
4847 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
4848 *
4849 * cdef inline object PyArray_MultiIterNew1(a):
4850 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
4851 *
4852 * cdef inline object PyArray_MultiIterNew2(a, b):
4853*/
4854 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
4855 __Pyx_GOTREF(__pyx_t_1);
4856 {
4857 PyObject *__pyx_temp;
4858 {
4859 __pyx_temp = __pyx_r;
4860 __pyx_r = __pyx_t_1;
4861 }
4862 __Pyx_XDECREF(__pyx_temp);
4863 }
4864 __pyx_t_1 = 0;
4865 goto __pyx_L0;
4866
4867 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
4868 * ctypedef long double complex clongdouble_t
4869 *
4870 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4871 * return PyArray_MultiIterNew(1, <void*>a)
4872 *
4873*/
4874
4875 /* function exit code */
4876 __pyx_L1_error:;
4877 __Pyx_XDECREF(__pyx_t_1);
4878 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4879 __pyx_r = 0;
4880 __pyx_L0:;
4881 __Pyx_XGIVEREF(__pyx_r);
4882 __Pyx_RefNannyFinishContext();
4883 return __pyx_r;
4884}
4885
4886/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
4887 * return PyArray_MultiIterNew(1, <void*>a)
4888 *
4889 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4890 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4891 *
4892*/
4893
4894static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4895 PyObject *__pyx_r = NULL;
4896 __Pyx_RefNannyDeclarations
4897 PyObject *__pyx_t_1 = NULL;
4898 int __pyx_lineno = 0;
4899 const char *__pyx_filename = NULL;
4900 int __pyx_clineno = 0;
4901 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
4902
4903 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
4904 *
4905 * cdef inline object PyArray_MultiIterNew2(a, b):
4906 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
4907 *
4908 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4909*/
4910 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 798, __pyx_L1_error)
4911 __Pyx_GOTREF(__pyx_t_1);
4912 {
4913 PyObject *__pyx_temp;
4914 {
4915 __pyx_temp = __pyx_r;
4916 __pyx_r = __pyx_t_1;
4917 }
4918 __Pyx_XDECREF(__pyx_temp);
4919 }
4920 __pyx_t_1 = 0;
4921 goto __pyx_L0;
4922
4923 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
4924 * return PyArray_MultiIterNew(1, <void*>a)
4925 *
4926 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4927 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4928 *
4929*/
4930
4931 /* function exit code */
4932 __pyx_L1_error:;
4933 __Pyx_XDECREF(__pyx_t_1);
4934 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4935 __pyx_r = 0;
4936 __pyx_L0:;
4937 __Pyx_XGIVEREF(__pyx_r);
4938 __Pyx_RefNannyFinishContext();
4939 return __pyx_r;
4940}
4941
4942/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
4943 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4944 *
4945 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4946 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4947 *
4948*/
4949
4950static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4951 PyObject *__pyx_r = NULL;
4952 __Pyx_RefNannyDeclarations
4953 PyObject *__pyx_t_1 = NULL;
4954 int __pyx_lineno = 0;
4955 const char *__pyx_filename = NULL;
4956 int __pyx_clineno = 0;
4957 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4958
4959 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
4960 *
4961 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4962 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4963 *
4964 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4965*/
4966 __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 801, __pyx_L1_error)
4967 __Pyx_GOTREF(__pyx_t_1);
4968 {
4969 PyObject *__pyx_temp;
4970 {
4971 __pyx_temp = __pyx_r;
4972 __pyx_r = __pyx_t_1;
4973 }
4974 __Pyx_XDECREF(__pyx_temp);
4975 }
4976 __pyx_t_1 = 0;
4977 goto __pyx_L0;
4978
4979 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
4980 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4981 *
4982 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4983 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4984 *
4985*/
4986
4987 /* function exit code */
4988 __pyx_L1_error:;
4989 __Pyx_XDECREF(__pyx_t_1);
4990 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4991 __pyx_r = 0;
4992 __pyx_L0:;
4993 __Pyx_XGIVEREF(__pyx_r);
4994 __Pyx_RefNannyFinishContext();
4995 return __pyx_r;
4996}
4997
4998/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
4999 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5000 *
5001 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5002 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5003 *
5004*/
5005
5006static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
5007 PyObject *__pyx_r = NULL;
5008 __Pyx_RefNannyDeclarations
5009 PyObject *__pyx_t_1 = NULL;
5010 int __pyx_lineno = 0;
5011 const char *__pyx_filename = NULL;
5012 int __pyx_clineno = 0;
5013 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
5014
5015 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
5016 *
5017 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5018 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
5019 *
5020 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5021*/
5022 __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 804, __pyx_L1_error)
5023 __Pyx_GOTREF(__pyx_t_1);
5024 {
5025 PyObject *__pyx_temp;
5026 {
5027 __pyx_temp = __pyx_r;
5028 __pyx_r = __pyx_t_1;
5029 }
5030 __Pyx_XDECREF(__pyx_temp);
5031 }
5032 __pyx_t_1 = 0;
5033 goto __pyx_L0;
5034
5035 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
5036 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5037 *
5038 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5039 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5040 *
5041*/
5042
5043 /* function exit code */
5044 __pyx_L1_error:;
5045 __Pyx_XDECREF(__pyx_t_1);
5046 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
5047 __pyx_r = 0;
5048 __pyx_L0:;
5049 __Pyx_XGIVEREF(__pyx_r);
5050 __Pyx_RefNannyFinishContext();
5051 return __pyx_r;
5052}
5053
5054/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
5055 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5056 *
5057 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5058 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5059 *
5060*/
5061
5062static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
5063 PyObject *__pyx_r = NULL;
5064 __Pyx_RefNannyDeclarations
5065 PyObject *__pyx_t_1 = NULL;
5066 int __pyx_lineno = 0;
5067 const char *__pyx_filename = NULL;
5068 int __pyx_clineno = 0;
5069 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
5070
5071 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
5072 *
5073 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5074 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
5075 *
5076 * cdef inline tuple PyDataType_SHAPE(dtype d):
5077*/
5078 __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 807, __pyx_L1_error)
5079 __Pyx_GOTREF(__pyx_t_1);
5080 {
5081 PyObject *__pyx_temp;
5082 {
5083 __pyx_temp = __pyx_r;
5084 __pyx_r = __pyx_t_1;
5085 }
5086 __Pyx_XDECREF(__pyx_temp);
5087 }
5088 __pyx_t_1 = 0;
5089 goto __pyx_L0;
5090
5091 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
5092 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5093 *
5094 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5095 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5096 *
5097*/
5098
5099 /* function exit code */
5100 __pyx_L1_error:;
5101 __Pyx_XDECREF(__pyx_t_1);
5102 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5103 __pyx_r = 0;
5104 __pyx_L0:;
5105 __Pyx_XGIVEREF(__pyx_r);
5106 __Pyx_RefNannyFinishContext();
5107 return __pyx_r;
5108}
5109
5110/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
5111 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5112 *
5113 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5114 * if PyDataType_HASSUBARRAY(d):
5115 * return <tuple>d.subarray.shape
5116*/
5117
5118static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5119 PyObject *__pyx_r = NULL;
5120 __Pyx_RefNannyDeclarations
5121 int __pyx_t_1;
5122 PyObject *__pyx_t_2;
5123 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
5124
5125 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
5126 *
5127 * cdef inline tuple PyDataType_SHAPE(dtype d):
5128 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5129 * return <tuple>d.subarray.shape
5130 * else:
5131*/
5132 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
5133
5134 if (__pyx_t_1) {
5135
5136
5137 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
5138 * cdef inline tuple PyDataType_SHAPE(dtype d):
5139 * if PyDataType_HASSUBARRAY(d):
5140 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
5141 * else:
5142 * return ()
5143*/
5144 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
5145
5146 {
5147 PyObject *__pyx_temp;
5148 {
5149 __pyx_temp = __pyx_r;
5150 __Pyx_INCREF(((PyObject*)__pyx_t_2));
5151 __pyx_r = ((PyObject*)__pyx_t_2);
5152 }
5153 __Pyx_XDECREF(__pyx_temp);
5154 }
5155
5156 goto __pyx_L0;
5157
5158 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
5159 *
5160 * cdef inline tuple PyDataType_SHAPE(dtype d):
5161 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5162 * return <tuple>d.subarray.shape
5163 * else:
5164*/
5165 }
5166
5167 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
5168 * return <tuple>d.subarray.shape
5169 * else:
5170 * return () # <<<<<<<<<<<<<<
5171 *
5172 *
5173*/
5174 /*else*/ {
5175 {
5176 PyObject *__pyx_temp;
5177 {
5178 __pyx_temp = __pyx_r;
5179 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
5180 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
5181 }
5182 __Pyx_XDECREF(__pyx_temp);
5183 }
5184 goto __pyx_L0;
5185 }
5186
5187 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
5188 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5189 *
5190 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5191 * if PyDataType_HASSUBARRAY(d):
5192 * return <tuple>d.subarray.shape
5193*/
5194
5195 /* function exit code */
5196 __pyx_L0:;
5197 __Pyx_XGIVEREF(__pyx_r);
5198 __Pyx_RefNannyFinishContext();
5199 return __pyx_r;
5200}
5201
5202/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
5203 *
5204 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
5205 * @property # <<<<<<<<<<<<<<
5206 * cdef inline int nin(self) noexcept nogil:
5207 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5208*/
5209
5210static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
5211 int __pyx_r;
5212
5213 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
5214 * @property
5215 * cdef inline int nin(self) noexcept nogil:
5216 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
5217 *
5218 * @property
5219*/
5220 {
5221
5222 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
5223 }
5224 goto __pyx_L0;
5225
5226 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
5227 *
5228 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
5229 * @property # <<<<<<<<<<<<<<
5230 * cdef inline int nin(self) noexcept nogil:
5231 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5232*/
5233
5234 /* function exit code */
5235 __pyx_L0:;
5236 return __pyx_r;
5237}
5238
5239/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
5240 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5241 *
5242 * @property # <<<<<<<<<<<<<<
5243 * cdef inline int nout(self) noexcept nogil:
5244 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5245*/
5246
5247static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
5248 int __pyx_r;
5249
5250 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
5251 * @property
5252 * cdef inline int nout(self) noexcept nogil:
5253 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
5254 *
5255 * @property
5256*/
5257 {
5258
5259 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
5260 }
5261 goto __pyx_L0;
5262
5263 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
5264 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5265 *
5266 * @property # <<<<<<<<<<<<<<
5267 * cdef inline int nout(self) noexcept nogil:
5268 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5269*/
5270
5271 /* function exit code */
5272 __pyx_L0:;
5273 return __pyx_r;
5274}
5275
5276/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
5277 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5278 *
5279 * @property # <<<<<<<<<<<<<<
5280 * cdef inline int nargs(self) noexcept nogil:
5281 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5282*/
5283
5284static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
5285 int __pyx_r;
5286
5287 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
5288 * @property
5289 * cdef inline int nargs(self) noexcept nogil:
5290 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
5291 *
5292 * @property
5293*/
5294 {
5295
5296 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
5297 }
5298 goto __pyx_L0;
5299
5300 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
5301 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5302 *
5303 * @property # <<<<<<<<<<<<<<
5304 * cdef inline int nargs(self) noexcept nogil:
5305 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5306*/
5307
5308 /* function exit code */
5309 __pyx_L0:;
5310 return __pyx_r;
5311}
5312
5313/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
5314 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5315 *
5316 * @property # <<<<<<<<<<<<<<
5317 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5318 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5319*/
5320
5321static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
5322 PyUFuncGenericFunction *__pyx_r;
5323
5324 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
5325 * @property
5326 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5327 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
5328 *
5329 * @property
5330*/
5331 {
5332
5333 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
5334 }
5335 goto __pyx_L0;
5336
5337 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
5338 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5339 *
5340 * @property # <<<<<<<<<<<<<<
5341 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5342 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5343*/
5344
5345 /* function exit code */
5346 __pyx_L0:;
5347 return __pyx_r;
5348}
5349
5350/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
5351 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5352 *
5353 * @property # <<<<<<<<<<<<<<
5354 * cdef inline void ** data(self) noexcept nogil:
5355 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5356*/
5357
5358static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
5359 void **__pyx_r;
5360
5361 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
5362 * @property
5363 * cdef inline void ** data(self) noexcept nogil:
5364 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
5365 *
5366 * @property
5367*/
5368 {
5369
5370 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
5371 }
5372 goto __pyx_L0;
5373
5374 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
5375 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5376 *
5377 * @property # <<<<<<<<<<<<<<
5378 * cdef inline void ** data(self) noexcept nogil:
5379 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5380*/
5381
5382 /* function exit code */
5383 __pyx_L0:;
5384 return __pyx_r;
5385}
5386
5387/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
5388 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5389 *
5390 * @property # <<<<<<<<<<<<<<
5391 * cdef inline int ntypes(self) noexcept nogil:
5392 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5393*/
5394
5395static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
5396 int __pyx_r;
5397
5398 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
5399 * @property
5400 * cdef inline int ntypes(self) noexcept nogil:
5401 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
5402 *
5403 * @property
5404*/
5405 {
5406
5407 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
5408 }
5409 goto __pyx_L0;
5410
5411 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
5412 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5413 *
5414 * @property # <<<<<<<<<<<<<<
5415 * cdef inline int ntypes(self) noexcept nogil:
5416 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5417*/
5418
5419 /* function exit code */
5420 __pyx_L0:;
5421 return __pyx_r;
5422}
5423
5424/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
5425 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5426 *
5427 * @property # <<<<<<<<<<<<<<
5428 * cdef inline const char* name(self) noexcept nogil:
5429 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5430*/
5431
5432static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
5433 char const *__pyx_r;
5434
5435 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
5436 * @property
5437 * cdef inline const char* name(self) noexcept nogil:
5438 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
5439 *
5440 * @property
5441*/
5442 {
5443
5444 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
5445 }
5446 goto __pyx_L0;
5447
5448 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
5449 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5450 *
5451 * @property # <<<<<<<<<<<<<<
5452 * cdef inline const char* name(self) noexcept nogil:
5453 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5454*/
5455
5456 /* function exit code */
5457 __pyx_L0:;
5458 return __pyx_r;
5459}
5460
5461/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
5462 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5463 *
5464 * @property # <<<<<<<<<<<<<<
5465 * cdef inline const char* doc(self) noexcept nogil:
5466 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5467*/
5468
5469static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
5470 char const *__pyx_r;
5471
5472 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
5473 * @property
5474 * cdef inline const char* doc(self) noexcept nogil:
5475 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
5476 *
5477 * @property
5478*/
5479 {
5480
5481 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
5482 }
5483 goto __pyx_L0;
5484
5485 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
5486 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5487 *
5488 * @property # <<<<<<<<<<<<<<
5489 * cdef inline const char* doc(self) noexcept nogil:
5490 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5491*/
5492
5493 /* function exit code */
5494 __pyx_L0:;
5495 return __pyx_r;
5496}
5497
5498/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
5499 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5500 *
5501 * @property # <<<<<<<<<<<<<<
5502 * cdef inline void* ptr(self) noexcept nogil:
5503 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5504*/
5505
5506static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
5507 void *__pyx_r;
5508
5509 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
5510 * @property
5511 * cdef inline void* ptr(self) noexcept nogil:
5512 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
5513 *
5514 * @property
5515*/
5516 {
5517
5518 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
5519 }
5520 goto __pyx_L0;
5521
5522 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
5523 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5524 *
5525 * @property # <<<<<<<<<<<<<<
5526 * cdef inline void* ptr(self) noexcept nogil:
5527 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5528*/
5529
5530 /* function exit code */
5531 __pyx_L0:;
5532 return __pyx_r;
5533}
5534
5535/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
5536 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5537 *
5538 * @property # <<<<<<<<<<<<<<
5539 * cdef inline PyObject* obj(self) noexcept nogil:
5540 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5541*/
5542
5543static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
5544 PyObject *__pyx_r;
5545
5546 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
5547 * @property
5548 * cdef inline PyObject* obj(self) noexcept nogil:
5549 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
5550 *
5551 * @property
5552*/
5553 {
5554
5555 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
5556 }
5557 goto __pyx_L0;
5558
5559 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
5560 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5561 *
5562 * @property # <<<<<<<<<<<<<<
5563 * cdef inline PyObject* obj(self) noexcept nogil:
5564 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5565*/
5566
5567 /* function exit code */
5568 __pyx_L0:;
5569 return __pyx_r;
5570}
5571
5572/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
5573 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5574 *
5575 * @property # <<<<<<<<<<<<<<
5576 * cdef inline PyObject* userloops(self) noexcept nogil:
5577 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
5578*/
5579
5580static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
5581 PyObject *__pyx_r;
5582
5583 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
5584 * @property
5585 * cdef inline PyObject* userloops(self) noexcept nogil:
5586 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
5587 *
5588 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
5589*/
5590 {
5591
5592 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
5593 }
5594 goto __pyx_L0;
5595
5596 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
5597 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5598 *
5599 * @property # <<<<<<<<<<<<<<
5600 * cdef inline PyObject* userloops(self) noexcept nogil:
5601 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
5602*/
5603
5604 /* function exit code */
5605 __pyx_L0:;
5606 return __pyx_r;
5607}
5608
5609/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
5610 * int _import_umath() except -1
5611 *
5612 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5613 * Py_INCREF(base) # important to do this before stealing the reference below!
5614 * PyArray_SetBaseObject(arr, base)
5615*/
5616
5617static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5618 int __pyx_t_1;
5619 int __pyx_lineno = 0;
5620 const char *__pyx_filename = NULL;
5621 int __pyx_clineno = 0;
5622
5623 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
5624 *
5625 * cdef inline void set_array_base(ndarray arr, object base) except *:
5626 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
5627 * PyArray_SetBaseObject(arr, base)
5628 *
5629*/
5630 Py_INCREF(__pyx_v_base);
5631
5632 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
5633 * cdef inline void set_array_base(ndarray arr, object base) except *:
5634 * Py_INCREF(base) # important to do this before stealing the reference below!
5635 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
5636 *
5637 * cdef inline object get_array_base(ndarray arr):
5638*/
5639 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1067, __pyx_L1_error)
5640
5641
5642 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
5643 * int _import_umath() except -1
5644 *
5645 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5646 * Py_INCREF(base) # important to do this before stealing the reference below!
5647 * PyArray_SetBaseObject(arr, base)
5648*/
5649
5650 /* function exit code */
5651 goto __pyx_L0;
5652 __pyx_L1_error:;
5653 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5654 __pyx_L0:;
5655
5656}
5657
5658/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
5659 * PyArray_SetBaseObject(arr, base)
5660 *
5661 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5662 * base = PyArray_BASE(arr)
5663 * if base is NULL:
5664*/
5665
5666static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5667 PyObject *__pyx_v_base;
5668 PyObject *__pyx_r = NULL;
5669 __Pyx_RefNannyDeclarations
5670 int __pyx_t_1;
5671 __Pyx_RefNannySetupContext("get_array_base", 0);
5672
5673 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
5674 *
5675 * cdef inline object get_array_base(ndarray arr):
5676 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
5677 * if base is NULL:
5678 * return None
5679*/
5680 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5681
5682 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
5683 * cdef inline object get_array_base(ndarray arr):
5684 * base = PyArray_BASE(arr)
5685 * if base is NULL: # <<<<<<<<<<<<<<
5686 * return None
5687 * return <object>base
5688*/
5689 __pyx_t_1 = (__pyx_v_base == NULL);
5690
5691 if (__pyx_t_1) {
5692
5693
5694 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
5695 * base = PyArray_BASE(arr)
5696 * if base is NULL:
5697 * return None # <<<<<<<<<<<<<<
5698 * return <object>base
5699 *
5700*/
5701 {
5702 PyObject *__pyx_temp;
5703 {
5704 __pyx_temp = __pyx_r;
5705 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5706 }
5707 __Pyx_XDECREF(__pyx_temp);
5708 }
5709 goto __pyx_L0;
5710
5711 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
5712 * cdef inline object get_array_base(ndarray arr):
5713 * base = PyArray_BASE(arr)
5714 * if base is NULL: # <<<<<<<<<<<<<<
5715 * return None
5716 * return <object>base
5717*/
5718 }
5719
5720 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
5721 * if base is NULL:
5722 * return None
5723 * return <object>base # <<<<<<<<<<<<<<
5724 *
5725 * # Versions of the import_* functions which are more suitable for
5726*/
5727 {
5728 PyObject *__pyx_temp;
5729 {
5730 __pyx_temp = __pyx_r;
5731 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5732 __pyx_r = ((PyObject *)__pyx_v_base);
5733 }
5734 __Pyx_XDECREF(__pyx_temp);
5735 }
5736 goto __pyx_L0;
5737
5738 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
5739 * PyArray_SetBaseObject(arr, base)
5740 *
5741 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5742 * base = PyArray_BASE(arr)
5743 * if base is NULL:
5744*/
5745
5746 /* function exit code */
5747 __pyx_L0:;
5748
5749 __Pyx_XGIVEREF(__pyx_r);
5750 __Pyx_RefNannyFinishContext();
5751 return __pyx_r;
5752}
5753
5754/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
5755 * # Versions of the import_* functions which are more suitable for
5756 * # Cython code.
5757 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5758 * try:
5759 * __pyx_import_array()
5760*/
5761
5762static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5763 int __pyx_r;
5764 __Pyx_RefNannyDeclarations
5765 PyObject *__pyx_t_1 = NULL;
5766 PyObject *__pyx_t_2 = NULL;
5767 PyObject *__pyx_t_3 = NULL;
5768 int __pyx_t_4;
5769 PyObject *__pyx_t_5 = NULL;
5770 PyObject *__pyx_t_6 = NULL;
5771 PyObject *__pyx_t_7 = NULL;
5772 PyObject *__pyx_t_8 = NULL;
5773 PyObject *__pyx_t_9 = NULL;
5774 size_t __pyx_t_10;
5775 int __pyx_lineno = 0;
5776 const char *__pyx_filename = NULL;
5777 int __pyx_clineno = 0;
5778 __Pyx_RefNannySetupContext("import_array", 0);
5779
5780 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5781 * # Cython code.
5782 * cdef inline int import_array() except -1:
5783 * try: # <<<<<<<<<<<<<<
5784 * __pyx_import_array()
5785 * except Exception:
5786*/
5787 {
5788 __Pyx_PyThreadState_declare
5789 __Pyx_PyThreadState_assign
5790 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5791 __Pyx_XGOTREF(__pyx_t_1);
5792 __Pyx_XGOTREF(__pyx_t_2);
5793 __Pyx_XGOTREF(__pyx_t_3);
5794 /*try:*/ {
5795
5796 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
5797 * cdef inline int import_array() except -1:
5798 * try:
5799 * __pyx_import_array() # <<<<<<<<<<<<<<
5800 * except Exception:
5801 * raise ImportError("numpy._core.multiarray failed to import")
5802*/
5803 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5804
5805
5806 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5807 * # Cython code.
5808 * cdef inline int import_array() except -1:
5809 * try: # <<<<<<<<<<<<<<
5810 * __pyx_import_array()
5811 * except Exception:
5812*/
5813 }
5814 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5815 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5816 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5817 goto __pyx_L8_try_end;
5818 __pyx_L3_error:;
5819
5820 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
5821 * try:
5822 * __pyx_import_array()
5823 * except Exception: # <<<<<<<<<<<<<<
5824 * raise ImportError("numpy._core.multiarray failed to import")
5825 *
5826*/
5827 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5828 if (__pyx_t_4) {
5829 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5830 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
5831 __Pyx_XGOTREF(__pyx_t_5);
5832 __Pyx_XGOTREF(__pyx_t_6);
5833 __Pyx_XGOTREF(__pyx_t_7);
5834
5835 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
5836 * __pyx_import_array()
5837 * except Exception:
5838 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
5839 *
5840 * cdef inline int import_umath() except -1:
5841*/
5842 __pyx_t_9 = NULL;
5843 __pyx_t_10 = 1;
5844 {
5845 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
5846 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5847 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5848 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
5849 __Pyx_GOTREF(__pyx_t_8);
5850 }
5851 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5852 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5853 __PYX_ERR(1, 1081, __pyx_L5_except_error)
5854 }
5855 goto __pyx_L5_except_error;
5856
5857 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5858 * # Cython code.
5859 * cdef inline int import_array() except -1:
5860 * try: # <<<<<<<<<<<<<<
5861 * __pyx_import_array()
5862 * except Exception:
5863*/
5864 __pyx_L5_except_error:;
5865 __Pyx_XGIVEREF(__pyx_t_1);
5866 __Pyx_XGIVEREF(__pyx_t_2);
5867 __Pyx_XGIVEREF(__pyx_t_3);
5868 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5869 goto __pyx_L1_error;
5870 __pyx_L8_try_end:;
5871 }
5872
5873 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
5874 * # Versions of the import_* functions which are more suitable for
5875 * # Cython code.
5876 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5877 * try:
5878 * __pyx_import_array()
5879*/
5880
5881 /* function exit code */
5882 __pyx_r = 0;
5883 goto __pyx_L0;
5884 __pyx_L1_error:;
5885 __Pyx_XDECREF(__pyx_t_5);
5886 __Pyx_XDECREF(__pyx_t_6);
5887 __Pyx_XDECREF(__pyx_t_7);
5888 __Pyx_XDECREF(__pyx_t_8);
5889 __Pyx_XDECREF(__pyx_t_9);
5890 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5891 __pyx_r = -1;
5892 __pyx_L0:;
5893
5894 __Pyx_RefNannyFinishContext();
5895 return __pyx_r;
5896}
5897
5898/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
5899 * raise ImportError("numpy._core.multiarray failed to import")
5900 *
5901 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5902 * try:
5903 * _import_umath()
5904*/
5905
5906static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5907 int __pyx_r;
5908 __Pyx_RefNannyDeclarations
5909 PyObject *__pyx_t_1 = NULL;
5910 PyObject *__pyx_t_2 = NULL;
5911 PyObject *__pyx_t_3 = NULL;
5912 int __pyx_t_4;
5913 PyObject *__pyx_t_5 = NULL;
5914 PyObject *__pyx_t_6 = NULL;
5915 PyObject *__pyx_t_7 = NULL;
5916 PyObject *__pyx_t_8 = NULL;
5917 PyObject *__pyx_t_9 = NULL;
5918 size_t __pyx_t_10;
5919 int __pyx_lineno = 0;
5920 const char *__pyx_filename = NULL;
5921 int __pyx_clineno = 0;
5922 __Pyx_RefNannySetupContext("import_umath", 0);
5923
5924 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5925 *
5926 * cdef inline int import_umath() except -1:
5927 * try: # <<<<<<<<<<<<<<
5928 * _import_umath()
5929 * except Exception:
5930*/
5931 {
5932 __Pyx_PyThreadState_declare
5933 __Pyx_PyThreadState_assign
5934 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5935 __Pyx_XGOTREF(__pyx_t_1);
5936 __Pyx_XGOTREF(__pyx_t_2);
5937 __Pyx_XGOTREF(__pyx_t_3);
5938 /*try:*/ {
5939
5940 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
5941 * cdef inline int import_umath() except -1:
5942 * try:
5943 * _import_umath() # <<<<<<<<<<<<<<
5944 * except Exception:
5945 * raise ImportError("numpy._core.umath failed to import")
5946*/
5947 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5948
5949
5950 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5951 *
5952 * cdef inline int import_umath() except -1:
5953 * try: # <<<<<<<<<<<<<<
5954 * _import_umath()
5955 * except Exception:
5956*/
5957 }
5958 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5959 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5960 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5961 goto __pyx_L8_try_end;
5962 __pyx_L3_error:;
5963
5964 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
5965 * try:
5966 * _import_umath()
5967 * except Exception: # <<<<<<<<<<<<<<
5968 * raise ImportError("numpy._core.umath failed to import")
5969 *
5970*/
5971 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5972 if (__pyx_t_4) {
5973 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5974 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
5975 __Pyx_XGOTREF(__pyx_t_5);
5976 __Pyx_XGOTREF(__pyx_t_6);
5977 __Pyx_XGOTREF(__pyx_t_7);
5978
5979 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
5980 * _import_umath()
5981 * except Exception:
5982 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
5983 *
5984 * cdef inline int import_ufunc() except -1:
5985*/
5986 __pyx_t_9 = NULL;
5987 __pyx_t_10 = 1;
5988 {
5989 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5990 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5991 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5992 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
5993 __Pyx_GOTREF(__pyx_t_8);
5994 }
5995 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5996 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5997 __PYX_ERR(1, 1087, __pyx_L5_except_error)
5998 }
5999 goto __pyx_L5_except_error;
6000
6001 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
6002 *
6003 * cdef inline int import_umath() except -1:
6004 * try: # <<<<<<<<<<<<<<
6005 * _import_umath()
6006 * except Exception:
6007*/
6008 __pyx_L5_except_error:;
6009 __Pyx_XGIVEREF(__pyx_t_1);
6010 __Pyx_XGIVEREF(__pyx_t_2);
6011 __Pyx_XGIVEREF(__pyx_t_3);
6012 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6013 goto __pyx_L1_error;
6014 __pyx_L8_try_end:;
6015 }
6016
6017 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
6018 * raise ImportError("numpy._core.multiarray failed to import")
6019 *
6020 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6021 * try:
6022 * _import_umath()
6023*/
6024
6025 /* function exit code */
6026 __pyx_r = 0;
6027 goto __pyx_L0;
6028 __pyx_L1_error:;
6029 __Pyx_XDECREF(__pyx_t_5);
6030 __Pyx_XDECREF(__pyx_t_6);
6031 __Pyx_XDECREF(__pyx_t_7);
6032 __Pyx_XDECREF(__pyx_t_8);
6033 __Pyx_XDECREF(__pyx_t_9);
6034 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6035 __pyx_r = -1;
6036 __pyx_L0:;
6037
6038 __Pyx_RefNannyFinishContext();
6039 return __pyx_r;
6040}
6041
6042/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
6043 * raise ImportError("numpy._core.umath failed to import")
6044 *
6045 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6046 * try:
6047 * _import_umath()
6048*/
6049
6050static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6051 int __pyx_r;
6052 __Pyx_RefNannyDeclarations
6053 PyObject *__pyx_t_1 = NULL;
6054 PyObject *__pyx_t_2 = NULL;
6055 PyObject *__pyx_t_3 = NULL;
6056 int __pyx_t_4;
6057 PyObject *__pyx_t_5 = NULL;
6058 PyObject *__pyx_t_6 = NULL;
6059 PyObject *__pyx_t_7 = NULL;
6060 PyObject *__pyx_t_8 = NULL;
6061 PyObject *__pyx_t_9 = NULL;
6062 size_t __pyx_t_10;
6063 int __pyx_lineno = 0;
6064 const char *__pyx_filename = NULL;
6065 int __pyx_clineno = 0;
6066 __Pyx_RefNannySetupContext("import_ufunc", 0);
6067
6068 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
6069 *
6070 * cdef inline int import_ufunc() except -1:
6071 * try: # <<<<<<<<<<<<<<
6072 * _import_umath()
6073 * except Exception:
6074*/
6075 {
6076 __Pyx_PyThreadState_declare
6077 __Pyx_PyThreadState_assign
6078 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6079 __Pyx_XGOTREF(__pyx_t_1);
6080 __Pyx_XGOTREF(__pyx_t_2);
6081 __Pyx_XGOTREF(__pyx_t_3);
6082 /*try:*/ {
6083
6084 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
6085 * cdef inline int import_ufunc() except -1:
6086 * try:
6087 * _import_umath() # <<<<<<<<<<<<<<
6088 * except Exception:
6089 * raise ImportError("numpy._core.umath failed to import")
6090*/
6091 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
6092
6093
6094 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
6095 *
6096 * cdef inline int import_ufunc() except -1:
6097 * try: # <<<<<<<<<<<<<<
6098 * _import_umath()
6099 * except Exception:
6100*/
6101 }
6102 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6103 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6104 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6105 goto __pyx_L8_try_end;
6106 __pyx_L3_error:;
6107
6108 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
6109 * try:
6110 * _import_umath()
6111 * except Exception: # <<<<<<<<<<<<<<
6112 * raise ImportError("numpy._core.umath failed to import")
6113 *
6114*/
6115 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
6116 if (__pyx_t_4) {
6117 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6118 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
6119 __Pyx_XGOTREF(__pyx_t_5);
6120 __Pyx_XGOTREF(__pyx_t_6);
6121 __Pyx_XGOTREF(__pyx_t_7);
6122
6123 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
6124 * _import_umath()
6125 * except Exception:
6126 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
6127 *
6128 *
6129*/
6130 __pyx_t_9 = NULL;
6131 __pyx_t_10 = 1;
6132 {
6133 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
6134 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6135 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6136 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
6137 __Pyx_GOTREF(__pyx_t_8);
6138 }
6139 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6140 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6141 __PYX_ERR(1, 1093, __pyx_L5_except_error)
6142 }
6143 goto __pyx_L5_except_error;
6144
6145 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
6146 *
6147 * cdef inline int import_ufunc() except -1:
6148 * try: # <<<<<<<<<<<<<<
6149 * _import_umath()
6150 * except Exception:
6151*/
6152 __pyx_L5_except_error:;
6153 __Pyx_XGIVEREF(__pyx_t_1);
6154 __Pyx_XGIVEREF(__pyx_t_2);
6155 __Pyx_XGIVEREF(__pyx_t_3);
6156 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6157 goto __pyx_L1_error;
6158 __pyx_L8_try_end:;
6159 }
6160
6161 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
6162 * raise ImportError("numpy._core.umath failed to import")
6163 *
6164 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6165 * try:
6166 * _import_umath()
6167*/
6168
6169 /* function exit code */
6170 __pyx_r = 0;
6171 goto __pyx_L0;
6172 __pyx_L1_error:;
6173 __Pyx_XDECREF(__pyx_t_5);
6174 __Pyx_XDECREF(__pyx_t_6);
6175 __Pyx_XDECREF(__pyx_t_7);
6176 __Pyx_XDECREF(__pyx_t_8);
6177 __Pyx_XDECREF(__pyx_t_9);
6178 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6179 __pyx_r = -1;
6180 __pyx_L0:;
6181
6182 __Pyx_RefNannyFinishContext();
6183 return __pyx_r;
6184}
6185
6186/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
6187 *
6188 *
6189 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6190 * """
6191 * Cython equivalent of `isinstance(obj, np.timedelta64)`
6192*/
6193
6194static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
6195 int __pyx_r;
6196
6197 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
6198 * bool
6199 * """
6200 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
6201 *
6202 *
6203*/
6204 {
6205
6206 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
6207 }
6208 goto __pyx_L0;
6209
6210 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
6211 *
6212 *
6213 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6214 * """
6215 * Cython equivalent of `isinstance(obj, np.timedelta64)`
6216*/
6217
6218 /* function exit code */
6219 __pyx_L0:;
6220
6221 return __pyx_r;
6222}
6223
6224/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
6225 *
6226 *
6227 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6228 * """
6229 * Cython equivalent of `isinstance(obj, np.datetime64)`
6230*/
6231
6232static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
6233 int __pyx_r;
6234
6235 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
6236 * bool
6237 * """
6238 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
6239 *
6240 *
6241*/
6242 {
6243
6244 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
6245 }
6246 goto __pyx_L0;
6247
6248 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
6249 *
6250 *
6251 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6252 * """
6253 * Cython equivalent of `isinstance(obj, np.datetime64)`
6254*/
6255
6256 /* function exit code */
6257 __pyx_L0:;
6258
6259 return __pyx_r;
6260}
6261
6262/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
6263 *
6264 *
6265 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6266 * """
6267 * returns the int64 value underlying scalar numpy datetime64 object
6268*/
6269
6270static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
6271 npy_datetime __pyx_r;
6272
6273 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
6274 * also needed. That can be found using `get_datetime64_unit`.
6275 * """
6276 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
6277 *
6278 *
6279*/
6280 {
6281
6282 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
6283 }
6284 goto __pyx_L0;
6285
6286 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
6287 *
6288 *
6289 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6290 * """
6291 * returns the int64 value underlying scalar numpy datetime64 object
6292*/
6293
6294 /* function exit code */
6295 __pyx_L0:;
6296 return __pyx_r;
6297}
6298
6299/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
6300 *
6301 *
6302 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6303 * """
6304 * returns the int64 value underlying scalar numpy timedelta64 object
6305*/
6306
6307static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
6308 npy_timedelta __pyx_r;
6309
6310 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
6311 * returns the int64 value underlying scalar numpy timedelta64 object
6312 * """
6313 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
6314 *
6315 *
6316*/
6317 {
6318
6319 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
6320 }
6321 goto __pyx_L0;
6322
6323 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
6324 *
6325 *
6326 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6327 * """
6328 * returns the int64 value underlying scalar numpy timedelta64 object
6329*/
6330
6331 /* function exit code */
6332 __pyx_L0:;
6333 return __pyx_r;
6334}
6335
6336/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
6337 *
6338 *
6339 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6340 * """
6341 * returns the unit part of the dtype for a numpy datetime64 object.
6342*/
6343
6344static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
6345 NPY_DATETIMEUNIT __pyx_r;
6346
6347 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
6348 * returns the unit part of the dtype for a numpy datetime64 object.
6349 * """
6350 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
6351 *
6352 *
6353*/
6354 {
6355
6356 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
6357 }
6358 goto __pyx_L0;
6359
6360 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
6361 *
6362 *
6363 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6364 * """
6365 * returns the unit part of the dtype for a numpy datetime64 object.
6366*/
6367
6368 /* function exit code */
6369 __pyx_L0:;
6370 return __pyx_r;
6371}
6372
6373/* "subsurfaceTransportFunctions.pyx":12
6374 * double sin(double x)
6375 * double M_PI
6376 * cdef inline double double_max(double a, double b): return a if a >= b else b # <<<<<<<<<<<<<<
6377 * cdef inline double double_min(double a, double b): return a if a <= b else b
6378 *
6379*/
6380
6381static CYTHON_INLINE double __pyx_f_28subsurfaceTransportFunctions_double_max(double __pyx_v_a, double __pyx_v_b) {
6382 double __pyx_r;
6383 double __pyx_t_1;
6384 int __pyx_t_2;
6385 __pyx_t_2 = (__pyx_v_a >= __pyx_v_b);
6386
6387 if (__pyx_t_2) {
6388
6389 __pyx_t_1 = __pyx_v_a;
6390 } else {
6391
6392 __pyx_t_1 = __pyx_v_b;
6393 }
6394
6395 {
6396 __pyx_r = __pyx_t_1;
6397 }
6398 goto __pyx_L0;
6399
6400 /* function exit code */
6401 __pyx_L0:;
6402
6403 return __pyx_r;
6404}
6405
6406/* "subsurfaceTransportFunctions.pyx":13
6407 * double M_PI
6408 * cdef inline double double_max(double a, double b): return a if a >= b else b
6409 * cdef inline double double_min(double a, double b): return a if a <= b else b # <<<<<<<<<<<<<<
6410 *
6411 * ctypedef numpy.double_t DTYPE_t
6412*/
6413
6414static CYTHON_INLINE double __pyx_f_28subsurfaceTransportFunctions_double_min(double __pyx_v_a, double __pyx_v_b) {
6415 double __pyx_r;
6416 double __pyx_t_1;
6417 int __pyx_t_2;
6418 __pyx_t_2 = (__pyx_v_a <= __pyx_v_b);
6419
6420 if (__pyx_t_2) {
6421
6422 __pyx_t_1 = __pyx_v_a;
6423 } else {
6424
6425 __pyx_t_1 = __pyx_v_b;
6426 }
6427
6428 {
6429 __pyx_r = __pyx_t_1;
6430 }
6431 goto __pyx_L0;
6432
6433 /* function exit code */
6434 __pyx_L0:;
6435
6436 return __pyx_r;
6437}
6438
6439/* "subsurfaceTransportFunctions.pyx":19
6440 * ctypedef int ITYPE_t
6441 *
6442 * def setExteriorElementBoundaryTypes(int nExteriorElementBoundaries_global, # <<<<<<<<<<<<<<
6443 * numpy.ndarray[ITYPE_t,ndim=1] exteriorElementBoundariesArray,
6444 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryElementsArray,
6445*/
6446
6447/* Python wrapper */
6448static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self,
6449#if CYTHON_VECTORCALL
6450PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6451#else
6452PyObject *__pyx_args, PyObject *__pyx_kwds
6453#endif
6454); /*proto*/
6455static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {"setExteriorElementBoundaryTypes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6456static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self,
6457#if CYTHON_VECTORCALL
6458PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6459#else
6460PyObject *__pyx_args, PyObject *__pyx_kwds
6461#endif
6462) {
6463 int __pyx_v_nExteriorElementBoundaries_global;
6464 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
6465 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
6466 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
6467 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
6468 #if !CYTHON_VECTORCALL
6469 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6470 #endif
6471 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6472 PyObject* values[5] = {0,0,0,0,0};
6473 int __pyx_lineno = 0;
6474 const char *__pyx_filename = NULL;
6475 int __pyx_clineno = 0;
6476 PyObject *__pyx_r = 0;
6477 __Pyx_RefNannyDeclarations
6478 __Pyx_RefNannySetupContext("setExteriorElementBoundaryTypes (wrapper)", 0);
6479 #if !CYTHON_VECTORCALL
6480 #if CYTHON_ASSUME_SAFE_SIZE
6481 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6482 #else
6483 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6484 #endif
6485 #endif
6486 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6487 {
6488 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nExteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryElementsArray,&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_exteriorElementBoundaryMaterialT,0};
6489 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6490 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
6491 if (__pyx_kwds_len > 0) {
6492 switch (__pyx_nargs) {
6493 case 5:
6494 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6495 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 19, __pyx_L3_error)
6496 CYTHON_FALLTHROUGH;
6497 case 4:
6498 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6499 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 19, __pyx_L3_error)
6500 CYTHON_FALLTHROUGH;
6501 case 3:
6502 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6503 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 19, __pyx_L3_error)
6504 CYTHON_FALLTHROUGH;
6505 case 2:
6506 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6507 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 19, __pyx_L3_error)
6508 CYTHON_FALLTHROUGH;
6509 case 1:
6510 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6511 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 19, __pyx_L3_error)
6512 CYTHON_FALLTHROUGH;
6513 case 0: break;
6514 default: goto __pyx_L5_argtuple_error;
6515 }
6516 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6517 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setExteriorElementBoundaryTypes", 0) < (0)) __PYX_ERR(0, 19, __pyx_L3_error)
6518 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
6519 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setExteriorElementBoundaryTypes", 1, 5, 5, i); __PYX_ERR(0, 19, __pyx_L3_error) }
6520 }
6521 } else if (unlikely(__pyx_nargs != 5)) {
6522 goto __pyx_L5_argtuple_error;
6523 } else {
6524 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6525 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 19, __pyx_L3_error)
6526 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6527 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 19, __pyx_L3_error)
6528 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6529 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 19, __pyx_L3_error)
6530 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6531 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 19, __pyx_L3_error)
6532 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 19, __pyx_L3_error)
6534 }
6535 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
6536 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
6537 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
6538 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
6539 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
6540 }
6541 goto __pyx_L6_skip;
6542 __pyx_L5_argtuple_error:;
6543 __Pyx_RaiseArgtupleInvalid("setExteriorElementBoundaryTypes", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 19, __pyx_L3_error)
6544 __pyx_L6_skip:;
6545 goto __pyx_L4_argument_unpacking_done;
6546 __pyx_L3_error:;
6547 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6548 Py_XDECREF(values[__pyx_temp]);
6549 }
6550 __Pyx_AddTraceback("subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
6551 __Pyx_RefNannyFinishContext();
6552 return NULL;
6553 __pyx_L4_argument_unpacking_done:;
6554 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
6555 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryElementsArray", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
6556 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
6557 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "exteriorElementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 23, __pyx_L1_error)
6558 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
6559
6560 /* function exit code */
6561 goto __pyx_L0;
6562 __pyx_L1_error:;
6563 __pyx_r = NULL;
6564 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6565 Py_XDECREF(values[__pyx_temp]);
6566 }
6567 goto __pyx_L7_cleaned_up;
6568 __pyx_L0:;
6569 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6570 Py_XDECREF(values[__pyx_temp]);
6571 }
6572 __pyx_L7_cleaned_up:;
6573
6574 __Pyx_RefNannyFinishContext();
6575 return __pyx_r;
6576}
6577
6578static 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) {
6579 int __pyx_v_ebNE;
6580 int __pyx_v_ebN;
6581 int __pyx_v_eN;
6582 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
6583 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
6584 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
6585 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
6586 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
6587 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
6588 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
6589 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
6590 PyObject *__pyx_r = NULL;
6591 __Pyx_RefNannyDeclarations
6592 int __pyx_t_1;
6593 int __pyx_t_2;
6594 int __pyx_t_3;
6595 Py_ssize_t __pyx_t_4;
6596 int __pyx_t_5;
6597 Py_ssize_t __pyx_t_6;
6598 int __pyx_lineno = 0;
6599 const char *__pyx_filename = NULL;
6600 int __pyx_clineno = 0;
6601 __Pyx_RefNannySetupContext("setExteriorElementBoundaryTypes", 0);
6602 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
6603 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
6604 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
6605 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
6606 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
6607 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
6608 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
6609 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
6610 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
6611 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
6612 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
6613 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
6614 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
6615 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
6616 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
6617 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
6618 {
6619 __Pyx_BufFmt_StackElem __pyx_stack[1];
6620 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, 19, __pyx_L1_error)
6621 }
6622 __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];
6623 {
6624 __Pyx_BufFmt_StackElem __pyx_stack[1];
6625 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, 19, __pyx_L1_error)
6626 }
6627 __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];
6628 {
6629 __Pyx_BufFmt_StackElem __pyx_stack[1];
6630 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, 19, __pyx_L1_error)
6631 }
6632 __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];
6633 {
6634 __Pyx_BufFmt_StackElem __pyx_stack[1];
6635 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, 19, __pyx_L1_error)
6636 }
6637 __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];
6638
6639 /* "subsurfaceTransportFunctions.pyx":25
6640 * numpy.ndarray[ITYPE_t,ndim=1] exteriorElementBoundaryMaterialTypes):
6641 * cdef int ebNE,ebN,eN
6642 * for ebNE in range(nExteriorElementBoundaries_global): # <<<<<<<<<<<<<<
6643 * ebN = exteriorElementBoundariesArray[ebNE]
6644 * eN = elementBoundaryElementsArray[ebN,0]
6645*/
6646
6647 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
6648 __pyx_t_2 = __pyx_t_1;
6649
6650 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6651 __pyx_v_ebNE = __pyx_t_3;
6652
6653 /* "subsurfaceTransportFunctions.pyx":26
6654 * cdef int ebNE,ebN,eN
6655 * for ebNE in range(nExteriorElementBoundaries_global):
6656 * ebN = exteriorElementBoundariesArray[ebNE] # <<<<<<<<<<<<<<
6657 * eN = elementBoundaryElementsArray[ebN,0]
6658 * exteriorElementBoundaryMaterialTypes[ebNE] = elementMaterialTypes[eN]
6659*/
6660 __pyx_t_4 = __pyx_v_ebNE;
6661 __pyx_t_5 = -1;
6662 if (__pyx_t_4 < 0) {
6663 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
6664 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
6665 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_5 = 0;
6666 if (unlikely(__pyx_t_5 != -1)) {
6667 __Pyx_RaiseBufferIndexError(__pyx_t_5);
6668 __PYX_ERR(0, 26, __pyx_L1_error)
6669 }
6670 __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));
6671
6672 /* "subsurfaceTransportFunctions.pyx":27
6673 * for ebNE in range(nExteriorElementBoundaries_global):
6674 * ebN = exteriorElementBoundariesArray[ebNE]
6675 * eN = elementBoundaryElementsArray[ebN,0] # <<<<<<<<<<<<<<
6676 * exteriorElementBoundaryMaterialTypes[ebNE] = elementMaterialTypes[eN]
6677 *
6678*/
6679 __pyx_t_4 = __pyx_v_ebN;
6680 __pyx_t_6 = 0;
6681 __pyx_t_5 = -1;
6682 if (__pyx_t_4 < 0) {
6683 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
6684 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
6685 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
6686 if (__pyx_t_6 < 0) {
6687 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
6688 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 1;
6689 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
6690 if (unlikely(__pyx_t_5 != -1)) {
6691 __Pyx_RaiseBufferIndexError(__pyx_t_5);
6692 __PYX_ERR(0, 27, __pyx_L1_error)
6693 }
6694 __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));
6695
6696 /* "subsurfaceTransportFunctions.pyx":28
6697 * ebN = exteriorElementBoundariesArray[ebNE]
6698 * eN = elementBoundaryElementsArray[ebN,0]
6699 * exteriorElementBoundaryMaterialTypes[ebNE] = elementMaterialTypes[eN] # <<<<<<<<<<<<<<
6700 *
6701 * def setElementBoundariesArray(int nElementBoundaries_global,
6702*/
6703 __pyx_t_6 = __pyx_v_eN;
6704 __pyx_t_5 = -1;
6705 if (__pyx_t_6 < 0) {
6706 __pyx_t_6 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
6707 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
6708 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
6709 if (unlikely(__pyx_t_5 != -1)) {
6710 __Pyx_RaiseBufferIndexError(__pyx_t_5);
6711 __PYX_ERR(0, 28, __pyx_L1_error)
6712 }
6713 __pyx_t_4 = __pyx_v_ebNE;
6714 __pyx_t_5 = -1;
6715 if (__pyx_t_4 < 0) {
6716 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
6717 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
6718 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
6719 if (unlikely(__pyx_t_5 != -1)) {
6720 __Pyx_RaiseBufferIndexError(__pyx_t_5);
6721 __PYX_ERR(0, 28, __pyx_L1_error)
6722 }
6723 *__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));
6724 }
6725
6726
6727 /* "subsurfaceTransportFunctions.pyx":19
6728 * ctypedef int ITYPE_t
6729 *
6730 * def setExteriorElementBoundaryTypes(int nExteriorElementBoundaries_global, # <<<<<<<<<<<<<<
6731 * numpy.ndarray[ITYPE_t,ndim=1] exteriorElementBoundariesArray,
6732 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryElementsArray,
6733*/
6734
6735 /* function exit code */
6736 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6737 goto __pyx_L0;
6738 __pyx_L1_error:;
6739 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6740 __Pyx_PyThreadState_declare
6741 __Pyx_PyThreadState_assign
6742 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6743 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
6744 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
6745 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
6746 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
6747 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6748 __Pyx_AddTraceback("subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
6749 __pyx_r = NULL;
6750 goto __pyx_L2;
6751 __pyx_L0:;
6752 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
6753 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
6754 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
6755 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
6756 __pyx_L2:;
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768 __Pyx_XGIVEREF(__pyx_r);
6769 __Pyx_RefNannyFinishContext();
6770 return __pyx_r;
6771}
6772
6773/* "subsurfaceTransportFunctions.pyx":30
6774 * exteriorElementBoundaryMaterialTypes[ebNE] = elementMaterialTypes[eN]
6775 *
6776 * def setElementBoundariesArray(int nElementBoundaries_global, # <<<<<<<<<<<<<<
6777 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryElementsArray,
6778 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
6779*/
6780
6781/* Python wrapper */
6782static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self,
6783#if CYTHON_VECTORCALL
6784PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6785#else
6786PyObject *__pyx_args, PyObject *__pyx_kwds
6787#endif
6788); /*proto*/
6789static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {"setElementBoundariesArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6790static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self,
6791#if CYTHON_VECTORCALL
6792PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6793#else
6794PyObject *__pyx_args, PyObject *__pyx_kwds
6795#endif
6796) {
6797 int __pyx_v_nElementBoundaries_global;
6798 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
6799 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
6800 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
6801 #if !CYTHON_VECTORCALL
6802 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6803 #endif
6804 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6805 PyObject* values[4] = {0,0,0,0};
6806 int __pyx_lineno = 0;
6807 const char *__pyx_filename = NULL;
6808 int __pyx_clineno = 0;
6809 PyObject *__pyx_r = 0;
6810 __Pyx_RefNannyDeclarations
6811 __Pyx_RefNannySetupContext("setElementBoundariesArray (wrapper)", 0);
6812 #if !CYTHON_VECTORCALL
6813 #if CYTHON_ASSUME_SAFE_SIZE
6814 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6815 #else
6816 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6817 #endif
6818 #endif
6819 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6820 {
6821 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_global,&__pyx_mstate_global->__pyx_n_u_elementBoundaryElementsArray,&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_elementBoundaryMaterialTypes,0};
6822 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6823 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 30, __pyx_L3_error)
6824 if (__pyx_kwds_len > 0) {
6825 switch (__pyx_nargs) {
6826 case 4:
6827 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6828 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 30, __pyx_L3_error)
6829 CYTHON_FALLTHROUGH;
6830 case 3:
6831 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6832 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 30, __pyx_L3_error)
6833 CYTHON_FALLTHROUGH;
6834 case 2:
6835 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6836 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 30, __pyx_L3_error)
6837 CYTHON_FALLTHROUGH;
6838 case 1:
6839 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6840 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 30, __pyx_L3_error)
6841 CYTHON_FALLTHROUGH;
6842 case 0: break;
6843 default: goto __pyx_L5_argtuple_error;
6844 }
6845 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6846 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setElementBoundariesArray", 0) < (0)) __PYX_ERR(0, 30, __pyx_L3_error)
6847 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
6848 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setElementBoundariesArray", 1, 4, 4, i); __PYX_ERR(0, 30, __pyx_L3_error) }
6849 }
6850 } else if (unlikely(__pyx_nargs != 4)) {
6851 goto __pyx_L5_argtuple_error;
6852 } else {
6853 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6854 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 30, __pyx_L3_error)
6855 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6856 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 30, __pyx_L3_error)
6857 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6858 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 30, __pyx_L3_error)
6859 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6860 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 30, __pyx_L3_error)
6861 }
6862 __pyx_v_nElementBoundaries_global = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error)
6863 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
6864 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
6865 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
6866 }
6867 goto __pyx_L6_skip;
6868 __pyx_L5_argtuple_error:;
6869 __Pyx_RaiseArgtupleInvalid("setElementBoundariesArray", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 30, __pyx_L3_error)
6870 __pyx_L6_skip:;
6871 goto __pyx_L4_argument_unpacking_done;
6872 __pyx_L3_error:;
6873 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6874 Py_XDECREF(values[__pyx_temp]);
6875 }
6876 __Pyx_AddTraceback("subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
6877 __Pyx_RefNannyFinishContext();
6878 return NULL;
6879 __pyx_L4_argument_unpacking_done:;
6880 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryElementsArray", 0))) __PYX_ERR(0, 31, __pyx_L1_error)
6881 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
6882 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
6883 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
6884
6885 /* function exit code */
6886 goto __pyx_L0;
6887 __pyx_L1_error:;
6888 __pyx_r = NULL;
6889 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6890 Py_XDECREF(values[__pyx_temp]);
6891 }
6892 goto __pyx_L7_cleaned_up;
6893 __pyx_L0:;
6894 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6895 Py_XDECREF(values[__pyx_temp]);
6896 }
6897 __pyx_L7_cleaned_up:;
6898
6899 __Pyx_RefNannyFinishContext();
6900 return __pyx_r;
6901}
6902
6903static 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) {
6904 int __pyx_v_ebN;
6905 int __pyx_v_eN_left;
6906 int __pyx_v_eN_right;
6907 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
6908 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
6909 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
6910 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
6911 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
6912 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
6913 PyObject *__pyx_r = NULL;
6914 __Pyx_RefNannyDeclarations
6915 int __pyx_t_1;
6916 int __pyx_t_2;
6917 int __pyx_t_3;
6918 Py_ssize_t __pyx_t_4;
6919 Py_ssize_t __pyx_t_5;
6920 int __pyx_t_6;
6921 Py_ssize_t __pyx_t_7;
6922 int __pyx_t_8;
6923 int __pyx_lineno = 0;
6924 const char *__pyx_filename = NULL;
6925 int __pyx_clineno = 0;
6926 __Pyx_RefNannySetupContext("setElementBoundariesArray", 0);
6927 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
6928 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
6929 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
6930 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
6931 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
6932 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
6933 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
6934 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
6935 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
6936 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
6937 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
6938 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
6939 {
6940 __Pyx_BufFmt_StackElem __pyx_stack[1];
6941 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, 30, __pyx_L1_error)
6942 }
6943 __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];
6944 {
6945 __Pyx_BufFmt_StackElem __pyx_stack[1];
6946 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, 30, __pyx_L1_error)
6947 }
6948 __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];
6949 {
6950 __Pyx_BufFmt_StackElem __pyx_stack[1];
6951 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, 30, __pyx_L1_error)
6952 }
6953 __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];
6954
6955 /* "subsurfaceTransportFunctions.pyx":35
6956 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryMaterialTypes):
6957 * cdef int ebN,eN_left,eN_right
6958 * for ebN in range(nElementBoundaries_global): # <<<<<<<<<<<<<<
6959 * eN_left = elementBoundaryElementsArray[ebN,0]
6960 * eN_right= elementBoundaryElementsArray[ebN,1]
6961*/
6962
6963 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
6964 __pyx_t_2 = __pyx_t_1;
6965
6966 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6967 __pyx_v_ebN = __pyx_t_3;
6968
6969 /* "subsurfaceTransportFunctions.pyx":36
6970 * cdef int ebN,eN_left,eN_right
6971 * for ebN in range(nElementBoundaries_global):
6972 * eN_left = elementBoundaryElementsArray[ebN,0] # <<<<<<<<<<<<<<
6973 * eN_right= elementBoundaryElementsArray[ebN,1]
6974 * elementBoundaryMaterialTypes[ebN,0] = elementMaterialTypes[eN_left]
6975*/
6976 __pyx_t_4 = __pyx_v_ebN;
6977 __pyx_t_5 = 0;
6978 __pyx_t_6 = -1;
6979 if (__pyx_t_4 < 0) {
6980 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
6981 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
6982 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
6983 if (__pyx_t_5 < 0) {
6984 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
6985 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
6986 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
6987 if (unlikely(__pyx_t_6 != -1)) {
6988 __Pyx_RaiseBufferIndexError(__pyx_t_6);
6989 __PYX_ERR(0, 36, __pyx_L1_error)
6990 }
6991 __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));
6992
6993 /* "subsurfaceTransportFunctions.pyx":37
6994 * for ebN in range(nElementBoundaries_global):
6995 * eN_left = elementBoundaryElementsArray[ebN,0]
6996 * eN_right= elementBoundaryElementsArray[ebN,1] # <<<<<<<<<<<<<<
6997 * elementBoundaryMaterialTypes[ebN,0] = elementMaterialTypes[eN_left]
6998 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_left]
6999*/
7000 __pyx_t_5 = __pyx_v_ebN;
7001 __pyx_t_4 = 1;
7002 __pyx_t_6 = -1;
7003 if (__pyx_t_5 < 0) {
7004 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
7005 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
7006 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
7007 if (__pyx_t_4 < 0) {
7008 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
7009 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
7010 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
7011 if (unlikely(__pyx_t_6 != -1)) {
7012 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7013 __PYX_ERR(0, 37, __pyx_L1_error)
7014 }
7015 __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));
7016
7017 /* "subsurfaceTransportFunctions.pyx":38
7018 * eN_left = elementBoundaryElementsArray[ebN,0]
7019 * eN_right= elementBoundaryElementsArray[ebN,1]
7020 * elementBoundaryMaterialTypes[ebN,0] = elementMaterialTypes[eN_left] # <<<<<<<<<<<<<<
7021 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_left]
7022 * if eN_right >= 0:
7023*/
7024 __pyx_t_4 = __pyx_v_eN_left;
7025 __pyx_t_6 = -1;
7026 if (__pyx_t_4 < 0) {
7027 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
7028 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7029 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7030 if (unlikely(__pyx_t_6 != -1)) {
7031 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7032 __PYX_ERR(0, 38, __pyx_L1_error)
7033 }
7034 __pyx_t_5 = __pyx_v_ebN;
7035 __pyx_t_7 = 0;
7036 __pyx_t_6 = -1;
7037 if (__pyx_t_5 < 0) {
7038 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
7039 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
7040 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7041 if (__pyx_t_7 < 0) {
7042 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
7043 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
7044 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7045 if (unlikely(__pyx_t_6 != -1)) {
7046 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7047 __PYX_ERR(0, 38, __pyx_L1_error)
7048 }
7049 *__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));
7050
7051 /* "subsurfaceTransportFunctions.pyx":39
7052 * eN_right= elementBoundaryElementsArray[ebN,1]
7053 * elementBoundaryMaterialTypes[ebN,0] = elementMaterialTypes[eN_left]
7054 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_left] # <<<<<<<<<<<<<<
7055 * if eN_right >= 0:
7056 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_right]
7057*/
7058 __pyx_t_4 = __pyx_v_eN_left;
7059 __pyx_t_6 = -1;
7060 if (__pyx_t_4 < 0) {
7061 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
7062 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7063 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7064 if (unlikely(__pyx_t_6 != -1)) {
7065 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7066 __PYX_ERR(0, 39, __pyx_L1_error)
7067 }
7068 __pyx_t_7 = __pyx_v_ebN;
7069 __pyx_t_5 = 1;
7070 __pyx_t_6 = -1;
7071 if (__pyx_t_7 < 0) {
7072 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
7073 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
7074 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7075 if (__pyx_t_5 < 0) {
7076 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
7077 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7078 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7079 if (unlikely(__pyx_t_6 != -1)) {
7080 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7081 __PYX_ERR(0, 39, __pyx_L1_error)
7082 }
7083 *__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));
7084
7085 /* "subsurfaceTransportFunctions.pyx":40
7086 * elementBoundaryMaterialTypes[ebN,0] = elementMaterialTypes[eN_left]
7087 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_left]
7088 * if eN_right >= 0: # <<<<<<<<<<<<<<
7089 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_right]
7090 *
7091*/
7092 __pyx_t_8 = (__pyx_v_eN_right >= 0);
7093
7094 if (__pyx_t_8) {
7095
7096
7097 /* "subsurfaceTransportFunctions.pyx":41
7098 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_left]
7099 * if eN_right >= 0:
7100 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_right] # <<<<<<<<<<<<<<
7101 *
7102 * ###
7103*/
7104 __pyx_t_4 = __pyx_v_eN_right;
7105 __pyx_t_6 = -1;
7106 if (__pyx_t_4 < 0) {
7107 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
7108 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7109 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7110 if (unlikely(__pyx_t_6 != -1)) {
7111 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7112 __PYX_ERR(0, 41, __pyx_L1_error)
7113 }
7114 __pyx_t_5 = __pyx_v_ebN;
7115 __pyx_t_7 = 1;
7116 __pyx_t_6 = -1;
7117 if (__pyx_t_5 < 0) {
7118 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
7119 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
7120 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7121 if (__pyx_t_7 < 0) {
7122 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
7123 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
7124 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7125 if (unlikely(__pyx_t_6 != -1)) {
7126 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7127 __PYX_ERR(0, 41, __pyx_L1_error)
7128 }
7129 *__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));
7130
7131 /* "subsurfaceTransportFunctions.pyx":40
7132 * elementBoundaryMaterialTypes[ebN,0] = elementMaterialTypes[eN_left]
7133 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_left]
7134 * if eN_right >= 0: # <<<<<<<<<<<<<<
7135 * elementBoundaryMaterialTypes[ebN,1] = elementMaterialTypes[eN_right]
7136 *
7137*/
7138 }
7139 }
7140
7141
7142 /* "subsurfaceTransportFunctions.pyx":30
7143 * exteriorElementBoundaryMaterialTypes[ebNE] = elementMaterialTypes[eN]
7144 *
7145 * def setElementBoundariesArray(int nElementBoundaries_global, # <<<<<<<<<<<<<<
7146 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryElementsArray,
7147 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
7148*/
7149
7150 /* function exit code */
7151 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7152 goto __pyx_L0;
7153 __pyx_L1_error:;
7154 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7155 __Pyx_PyThreadState_declare
7156 __Pyx_PyThreadState_assign
7157 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7158 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
7159 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
7160 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
7161 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7162 __Pyx_AddTraceback("subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
7163 __pyx_r = NULL;
7164 goto __pyx_L2;
7165 __pyx_L0:;
7166 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
7167 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
7168 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
7169 __pyx_L2:;
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179 __Pyx_XGIVEREF(__pyx_r);
7180 __Pyx_RefNannyFinishContext();
7181 return __pyx_r;
7182}
7183
7184/* "subsurfaceTransportFunctions.pyx":44
7185 *
7186 * ###
7187 * def setScalarMaterialFunctionOverElements(numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes, # <<<<<<<<<<<<<<
7188 * numpy.ndarray[DTYPE_t,ndim=2] q_vals,
7189 * dict material_functions):
7190*/
7191
7192/* Python wrapper */
7193static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self,
7194#if CYTHON_VECTORCALL
7195PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7196#else
7197PyObject *__pyx_args, PyObject *__pyx_kwds
7198#endif
7199); /*proto*/
7200PyDoc_STRVAR(__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 ");
7201static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {"setScalarMaterialFunctionOverElements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
7202static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self,
7203#if CYTHON_VECTORCALL
7204PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7205#else
7206PyObject *__pyx_args, PyObject *__pyx_kwds
7207#endif
7208) {
7209 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
7210 PyArrayObject *__pyx_v_q_vals = 0;
7211 PyObject *__pyx_v_material_functions = 0;
7212 #if !CYTHON_VECTORCALL
7213 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7214 #endif
7215 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7216 PyObject* values[3] = {0,0,0};
7217 int __pyx_lineno = 0;
7218 const char *__pyx_filename = NULL;
7219 int __pyx_clineno = 0;
7220 PyObject *__pyx_r = 0;
7221 __Pyx_RefNannyDeclarations
7222 __Pyx_RefNannySetupContext("setScalarMaterialFunctionOverElements (wrapper)", 0);
7223 #if !CYTHON_VECTORCALL
7224 #if CYTHON_ASSUME_SAFE_SIZE
7225 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7226 #else
7227 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7228 #endif
7229 #endif
7230 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7231 {
7232 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_q_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
7233 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7234 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
7235 if (__pyx_kwds_len > 0) {
7236 switch (__pyx_nargs) {
7237 case 3:
7238 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7239 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 44, __pyx_L3_error)
7240 CYTHON_FALLTHROUGH;
7241 case 2:
7242 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7243 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 44, __pyx_L3_error)
7244 CYTHON_FALLTHROUGH;
7245 case 1:
7246 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7247 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __pyx_L3_error)
7248 CYTHON_FALLTHROUGH;
7249 case 0: break;
7250 default: goto __pyx_L5_argtuple_error;
7251 }
7252 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7253 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setScalarMaterialFunctionOverElements", 0) < (0)) __PYX_ERR(0, 44, __pyx_L3_error)
7254 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
7255 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setScalarMaterialFunctionOverElements", 1, 3, 3, i); __PYX_ERR(0, 44, __pyx_L3_error) }
7256 }
7257 } else if (unlikely(__pyx_nargs != 3)) {
7258 goto __pyx_L5_argtuple_error;
7259 } else {
7260 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7261 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __pyx_L3_error)
7262 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7263 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 44, __pyx_L3_error)
7264 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7265 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 44, __pyx_L3_error)
7266 }
7267 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
7268 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
7269 __pyx_v_material_functions = ((PyObject*)values[2]);
7270 }
7271 goto __pyx_L6_skip;
7272 __pyx_L5_argtuple_error:;
7273 __Pyx_RaiseArgtupleInvalid("setScalarMaterialFunctionOverElements", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error)
7274 __pyx_L6_skip:;
7275 goto __pyx_L4_argument_unpacking_done;
7276 __pyx_L3_error:;
7277 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7278 Py_XDECREF(values[__pyx_temp]);
7279 }
7280 __Pyx_AddTraceback("subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
7281 __Pyx_RefNannyFinishContext();
7282 return NULL;
7283 __pyx_L4_argument_unpacking_done:;
7284 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
7285 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_vals", 0))) __PYX_ERR(0, 45, __pyx_L1_error)
7286 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 46, __pyx_L1_error)
7287 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
7288
7289 /* function exit code */
7290 goto __pyx_L0;
7291 __pyx_L1_error:;
7292 __pyx_r = NULL;
7293 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7294 Py_XDECREF(values[__pyx_temp]);
7295 }
7296 goto __pyx_L7_cleaned_up;
7297 __pyx_L0:;
7298 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7299 Py_XDECREF(values[__pyx_temp]);
7300 }
7301 __pyx_L7_cleaned_up:;
7302 __Pyx_RefNannyFinishContext();
7303 return __pyx_r;
7304}
7305
7306static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
7307 int __pyx_v_eN;
7308 int __pyx_v_k;
7309 int __pyx_v_material;
7310 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
7311 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
7312 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
7313 __Pyx_Buffer __pyx_pybuffer_q_vals;
7314 PyObject *__pyx_r = NULL;
7315 __Pyx_RefNannyDeclarations
7316 npy_intp __pyx_t_1;
7317 npy_intp __pyx_t_2;
7318 int __pyx_t_3;
7319 Py_ssize_t __pyx_t_4;
7320 int __pyx_t_5;
7321 npy_intp __pyx_t_6;
7322 npy_intp __pyx_t_7;
7323 PyObject *__pyx_t_8 = NULL;
7324 PyObject *__pyx_t_9 = NULL;
7325 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_10;
7326 Py_ssize_t __pyx_t_11;
7327 int __pyx_t_12;
7328 int __pyx_lineno = 0;
7329 const char *__pyx_filename = NULL;
7330 int __pyx_clineno = 0;
7331 __Pyx_RefNannySetupContext("setScalarMaterialFunctionOverElements", 0);
7332 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
7333 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
7334 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
7335 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
7336 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
7337 __pyx_pybuffer_q_vals.refcount = 0;
7338 __pyx_pybuffernd_q_vals.data = NULL;
7339 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
7340 {
7341 __Pyx_BufFmt_StackElem __pyx_stack[1];
7342 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, 44, __pyx_L1_error)
7343 }
7344 __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];
7345 {
7346 __Pyx_BufFmt_StackElem __pyx_stack[1];
7347 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, 44, __pyx_L1_error)
7348 }
7349 __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];
7350
7351 /* "subsurfaceTransportFunctions.pyx":52
7352 * """
7353 * cdef int eN,k,material
7354 * for eN in range(q_vals.shape[0]): # <<<<<<<<<<<<<<
7355 * material = elementMaterialTypes[eN]
7356 * for k in range(q_vals.shape[1]):
7357*/
7358
7359 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_q_vals))[0]);
7360 __pyx_t_2 = __pyx_t_1;
7361
7362 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7363 __pyx_v_eN = __pyx_t_3;
7364
7365 /* "subsurfaceTransportFunctions.pyx":53
7366 * cdef int eN,k,material
7367 * for eN in range(q_vals.shape[0]):
7368 * material = elementMaterialTypes[eN] # <<<<<<<<<<<<<<
7369 * for k in range(q_vals.shape[1]):
7370 * q_vals[eN,k] = material_functions[material]
7371*/
7372 __pyx_t_4 = __pyx_v_eN;
7373 __pyx_t_5 = -1;
7374 if (__pyx_t_4 < 0) {
7375 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
7376 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
7377 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7378 if (unlikely(__pyx_t_5 != -1)) {
7379 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7380 __PYX_ERR(0, 53, __pyx_L1_error)
7381 }
7382 __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));
7383
7384 /* "subsurfaceTransportFunctions.pyx":54
7385 * for eN in range(q_vals.shape[0]):
7386 * material = elementMaterialTypes[eN]
7387 * for k in range(q_vals.shape[1]): # <<<<<<<<<<<<<<
7388 * q_vals[eN,k] = material_functions[material]
7389 *
7390*/
7391
7392 __pyx_t_6 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_q_vals))[1]);
7393 __pyx_t_7 = __pyx_t_6;
7394
7395 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
7396 __pyx_v_k = __pyx_t_5;
7397
7398 /* "subsurfaceTransportFunctions.pyx":55
7399 * material = elementMaterialTypes[eN]
7400 * for k in range(q_vals.shape[1]):
7401 * q_vals[eN,k] = material_functions[material] # <<<<<<<<<<<<<<
7402 *
7403 * def setVectorMaterialFunctionOverElements(numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
7404*/
7405 if (unlikely(__pyx_v_material_functions == Py_None)) {
7406 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
7407 __PYX_ERR(0, 55, __pyx_L1_error)
7408 }
7409 __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_material); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error)
7410 __Pyx_GOTREF(__pyx_t_8);
7411 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error)
7412 __Pyx_GOTREF(__pyx_t_9);
7413 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7414 __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_10 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
7415 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7416 __pyx_t_4 = __pyx_v_eN;
7417 __pyx_t_11 = __pyx_v_k;
7418 __pyx_t_12 = -1;
7419 if (__pyx_t_4 < 0) {
7420 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
7421 if (unlikely(__pyx_t_4 < 0)) __pyx_t_12 = 0;
7422 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_12 = 0;
7423 if (__pyx_t_11 < 0) {
7424 __pyx_t_11 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
7425 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 1;
7426 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_12 = 1;
7427 if (unlikely(__pyx_t_12 != -1)) {
7428 __Pyx_RaiseBufferIndexError(__pyx_t_12);
7429 __PYX_ERR(0, 55, __pyx_L1_error)
7430 }
7431 *__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;
7432
7433 }
7434
7435 }
7436
7437
7438 /* "subsurfaceTransportFunctions.pyx":44
7439 *
7440 * ###
7441 * def setScalarMaterialFunctionOverElements(numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes, # <<<<<<<<<<<<<<
7442 * numpy.ndarray[DTYPE_t,ndim=2] q_vals,
7443 * dict material_functions):
7444*/
7445
7446 /* function exit code */
7447 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7448 goto __pyx_L0;
7449 __pyx_L1_error:;
7450 __Pyx_XDECREF(__pyx_t_8);
7451 __Pyx_XDECREF(__pyx_t_9);
7452 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7453 __Pyx_PyThreadState_declare
7454 __Pyx_PyThreadState_assign
7455 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7456 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
7457 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
7458 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7459 __Pyx_AddTraceback("subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
7460 __pyx_r = NULL;
7461 goto __pyx_L2;
7462 __pyx_L0:;
7463 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
7464 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
7465 __pyx_L2:;
7466
7467
7468
7469
7470
7471
7472
7473 __Pyx_XGIVEREF(__pyx_r);
7474 __Pyx_RefNannyFinishContext();
7475 return __pyx_r;
7476}
7477
7478/* "subsurfaceTransportFunctions.pyx":57
7479 * q_vals[eN,k] = material_functions[material]
7480 *
7481 * def setVectorMaterialFunctionOverElements(numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes, # <<<<<<<<<<<<<<
7482 * numpy.ndarray[DTYPE_t,ndim=3] q_vals,
7483 * dict material_functions):
7484*/
7485
7486/* Python wrapper */
7487static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self,
7488#if CYTHON_VECTORCALL
7489PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7490#else
7491PyObject *__pyx_args, PyObject *__pyx_kwds
7492#endif
7493); /*proto*/
7494PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements, "\n loop over quadrature array and set \013ec f_j assuming element is material j\n ");
7495static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {"setVectorMaterialFunctionOverElements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
7496static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self,
7497#if CYTHON_VECTORCALL
7498PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7499#else
7500PyObject *__pyx_args, PyObject *__pyx_kwds
7501#endif
7502) {
7503 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
7504 PyArrayObject *__pyx_v_q_vals = 0;
7505 PyObject *__pyx_v_material_functions = 0;
7506 #if !CYTHON_VECTORCALL
7507 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7508 #endif
7509 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7510 PyObject* values[3] = {0,0,0};
7511 int __pyx_lineno = 0;
7512 const char *__pyx_filename = NULL;
7513 int __pyx_clineno = 0;
7514 PyObject *__pyx_r = 0;
7515 __Pyx_RefNannyDeclarations
7516 __Pyx_RefNannySetupContext("setVectorMaterialFunctionOverElements (wrapper)", 0);
7517 #if !CYTHON_VECTORCALL
7518 #if CYTHON_ASSUME_SAFE_SIZE
7519 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7520 #else
7521 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7522 #endif
7523 #endif
7524 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7525 {
7526 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_q_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
7527 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7528 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 57, __pyx_L3_error)
7529 if (__pyx_kwds_len > 0) {
7530 switch (__pyx_nargs) {
7531 case 3:
7532 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 57, __pyx_L3_error)
7534 CYTHON_FALLTHROUGH;
7535 case 2:
7536 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7537 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 57, __pyx_L3_error)
7538 CYTHON_FALLTHROUGH;
7539 case 1:
7540 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7541 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 57, __pyx_L3_error)
7542 CYTHON_FALLTHROUGH;
7543 case 0: break;
7544 default: goto __pyx_L5_argtuple_error;
7545 }
7546 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7547 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVectorMaterialFunctionOverElements", 0) < (0)) __PYX_ERR(0, 57, __pyx_L3_error)
7548 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
7549 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVectorMaterialFunctionOverElements", 1, 3, 3, i); __PYX_ERR(0, 57, __pyx_L3_error) }
7550 }
7551 } else if (unlikely(__pyx_nargs != 3)) {
7552 goto __pyx_L5_argtuple_error;
7553 } else {
7554 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7555 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 57, __pyx_L3_error)
7556 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7557 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 57, __pyx_L3_error)
7558 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7559 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 57, __pyx_L3_error)
7560 }
7561 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
7562 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
7563 __pyx_v_material_functions = ((PyObject*)values[2]);
7564 }
7565 goto __pyx_L6_skip;
7566 __pyx_L5_argtuple_error:;
7567 __Pyx_RaiseArgtupleInvalid("setVectorMaterialFunctionOverElements", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 57, __pyx_L3_error)
7568 __pyx_L6_skip:;
7569 goto __pyx_L4_argument_unpacking_done;
7570 __pyx_L3_error:;
7571 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7572 Py_XDECREF(values[__pyx_temp]);
7573 }
7574 __Pyx_AddTraceback("subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
7575 __Pyx_RefNannyFinishContext();
7576 return NULL;
7577 __pyx_L4_argument_unpacking_done:;
7578 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
7579 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_vals", 0))) __PYX_ERR(0, 58, __pyx_L1_error)
7580 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 59, __pyx_L1_error)
7581 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
7582
7583 /* function exit code */
7584 goto __pyx_L0;
7585 __pyx_L1_error:;
7586 __pyx_r = NULL;
7587 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7588 Py_XDECREF(values[__pyx_temp]);
7589 }
7590 goto __pyx_L7_cleaned_up;
7591 __pyx_L0:;
7592 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7593 Py_XDECREF(values[__pyx_temp]);
7594 }
7595 __pyx_L7_cleaned_up:;
7596 __Pyx_RefNannyFinishContext();
7597 return __pyx_r;
7598}
7599
7600static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
7601 int __pyx_v_eN;
7602 int __pyx_v_k;
7603 int __pyx_v_material;
7604 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
7605 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
7606 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
7607 __Pyx_Buffer __pyx_pybuffer_q_vals;
7608 PyObject *__pyx_r = NULL;
7609 __Pyx_RefNannyDeclarations
7610 npy_intp __pyx_t_1;
7611 npy_intp __pyx_t_2;
7612 int __pyx_t_3;
7613 Py_ssize_t __pyx_t_4;
7614 int __pyx_t_5;
7615 npy_intp __pyx_t_6;
7616 npy_intp __pyx_t_7;
7617 PyObject *__pyx_t_8 = NULL;
7618 PyObject *__pyx_t_9 = NULL;
7619 PyObject *__pyx_t_10 = NULL;
7620 PyObject *__pyx_t_11 = NULL;
7621 int __pyx_lineno = 0;
7622 const char *__pyx_filename = NULL;
7623 int __pyx_clineno = 0;
7624 __Pyx_RefNannySetupContext("setVectorMaterialFunctionOverElements", 0);
7625 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
7626 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
7627 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
7628 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
7629 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
7630 __pyx_pybuffer_q_vals.refcount = 0;
7631 __pyx_pybuffernd_q_vals.data = NULL;
7632 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
7633 {
7634 __Pyx_BufFmt_StackElem __pyx_stack[1];
7635 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, 57, __pyx_L1_error)
7636 }
7637 __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];
7638 {
7639 __Pyx_BufFmt_StackElem __pyx_stack[1];
7640 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, 57, __pyx_L1_error)
7641 }
7642 __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];
7643
7644 /* "subsurfaceTransportFunctions.pyx":64
7645 * """
7646 * cdef int eN,k,material
7647 * for eN in range(q_vals.shape[0]): # <<<<<<<<<<<<<<
7648 * material = elementMaterialTypes[eN]
7649 * for k in range(q_vals.shape[1]):
7650*/
7651
7652 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_q_vals))[0]);
7653 __pyx_t_2 = __pyx_t_1;
7654
7655 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7656 __pyx_v_eN = __pyx_t_3;
7657
7658 /* "subsurfaceTransportFunctions.pyx":65
7659 * cdef int eN,k,material
7660 * for eN in range(q_vals.shape[0]):
7661 * material = elementMaterialTypes[eN] # <<<<<<<<<<<<<<
7662 * for k in range(q_vals.shape[1]):
7663 * q_vals[eN,k,:] = material_functions[material].flat
7664*/
7665 __pyx_t_4 = __pyx_v_eN;
7666 __pyx_t_5 = -1;
7667 if (__pyx_t_4 < 0) {
7668 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
7669 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
7670 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7671 if (unlikely(__pyx_t_5 != -1)) {
7672 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7673 __PYX_ERR(0, 65, __pyx_L1_error)
7674 }
7675 __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));
7676
7677 /* "subsurfaceTransportFunctions.pyx":66
7678 * for eN in range(q_vals.shape[0]):
7679 * material = elementMaterialTypes[eN]
7680 * for k in range(q_vals.shape[1]): # <<<<<<<<<<<<<<
7681 * q_vals[eN,k,:] = material_functions[material].flat
7682 *
7683*/
7684
7685 __pyx_t_6 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_q_vals))[1]);
7686 __pyx_t_7 = __pyx_t_6;
7687
7688 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
7689 __pyx_v_k = __pyx_t_5;
7690
7691 /* "subsurfaceTransportFunctions.pyx":67
7692 * material = elementMaterialTypes[eN]
7693 * for k in range(q_vals.shape[1]):
7694 * q_vals[eN,k,:] = material_functions[material].flat # <<<<<<<<<<<<<<
7695 *
7696 *
7697*/
7698 if (unlikely(__pyx_v_material_functions == Py_None)) {
7699 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
7700 __PYX_ERR(0, 67, __pyx_L1_error)
7701 }
7702 __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_material); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error)
7703 __Pyx_GOTREF(__pyx_t_8);
7704 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error)
7705 __Pyx_GOTREF(__pyx_t_9);
7706 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7707 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_flat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error)
7708 __Pyx_GOTREF(__pyx_t_8);
7709 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7710 __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error)
7711 __Pyx_GOTREF(__pyx_t_9);
7712 __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 67, __pyx_L1_error)
7713 __Pyx_GOTREF(__pyx_t_10);
7714 __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 67, __pyx_L1_error)
7715 __Pyx_GOTREF(__pyx_t_11);
7716 __Pyx_GIVEREF(__pyx_t_9);
7717 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 67, __pyx_L1_error);
7718 __Pyx_GIVEREF(__pyx_t_10);
7719 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 67, __pyx_L1_error);
7720 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
7721 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
7722 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 67, __pyx_L1_error);
7723 __pyx_t_9 = 0;
7724 __pyx_t_10 = 0;
7725 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_11, __pyx_t_8) < 0))) __PYX_ERR(0, 67, __pyx_L1_error)
7726 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7727 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7728 }
7729
7730 }
7731
7732
7733 /* "subsurfaceTransportFunctions.pyx":57
7734 * q_vals[eN,k] = material_functions[material]
7735 *
7736 * def setVectorMaterialFunctionOverElements(numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes, # <<<<<<<<<<<<<<
7737 * numpy.ndarray[DTYPE_t,ndim=3] q_vals,
7738 * dict material_functions):
7739*/
7740
7741 /* function exit code */
7742 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7743 goto __pyx_L0;
7744 __pyx_L1_error:;
7745 __Pyx_XDECREF(__pyx_t_8);
7746 __Pyx_XDECREF(__pyx_t_9);
7747 __Pyx_XDECREF(__pyx_t_10);
7748 __Pyx_XDECREF(__pyx_t_11);
7749 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7750 __Pyx_PyThreadState_declare
7751 __Pyx_PyThreadState_assign
7752 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7753 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
7754 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
7755 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7756 __Pyx_AddTraceback("subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
7757 __pyx_r = NULL;
7758 goto __pyx_L2;
7759 __pyx_L0:;
7760 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
7761 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
7762 __pyx_L2:;
7763
7764
7765
7766
7767
7768
7769
7770 __Pyx_XGIVEREF(__pyx_r);
7771 __Pyx_RefNannyFinishContext();
7772 return __pyx_r;
7773}
7774
7775/* "subsurfaceTransportFunctions.pyx":70
7776 *
7777 *
7778 * def setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray, # <<<<<<<<<<<<<<
7779 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
7780 * numpy.ndarray[DTYPE_t,ndim=3] ebq_vals,
7781*/
7782
7783/* Python wrapper */
7784static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
7785#if CYTHON_VECTORCALL
7786PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7787#else
7788PyObject *__pyx_args, PyObject *__pyx_kwds
7789#endif
7790); /*proto*/
7791PyDoc_STRVAR(__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 ");
7792static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
7793static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
7794#if CYTHON_VECTORCALL
7795PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7796#else
7797PyObject *__pyx_args, PyObject *__pyx_kwds
7798#endif
7799) {
7800 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7801 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7802 PyArrayObject *__pyx_v_ebq_vals = 0;
7803 PyObject *__pyx_v_material_functions = 0;
7804 #if !CYTHON_VECTORCALL
7805 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7806 #endif
7807 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7808 PyObject* values[4] = {0,0,0,0};
7809 int __pyx_lineno = 0;
7810 const char *__pyx_filename = NULL;
7811 int __pyx_clineno = 0;
7812 PyObject *__pyx_r = 0;
7813 __Pyx_RefNannyDeclarations
7814 __Pyx_RefNannySetupContext("setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
7815 #if !CYTHON_VECTORCALL
7816 #if CYTHON_ASSUME_SAFE_SIZE
7817 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7818 #else
7819 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7820 #endif
7821 #endif
7822 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7823 {
7824 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_ebq_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
7825 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7826 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 70, __pyx_L3_error)
7827 if (__pyx_kwds_len > 0) {
7828 switch (__pyx_nargs) {
7829 case 4:
7830 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
7831 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 70, __pyx_L3_error)
7832 CYTHON_FALLTHROUGH;
7833 case 3:
7834 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7835 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 70, __pyx_L3_error)
7836 CYTHON_FALLTHROUGH;
7837 case 2:
7838 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7839 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 70, __pyx_L3_error)
7840 CYTHON_FALLTHROUGH;
7841 case 1:
7842 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7843 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 70, __pyx_L3_error)
7844 CYTHON_FALLTHROUGH;
7845 case 0: break;
7846 default: goto __pyx_L5_argtuple_error;
7847 }
7848 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7849 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0) < (0)) __PYX_ERR(0, 70, __pyx_L3_error)
7850 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
7851 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, i); __PYX_ERR(0, 70, __pyx_L3_error) }
7852 }
7853 } else if (unlikely(__pyx_nargs != 4)) {
7854 goto __pyx_L5_argtuple_error;
7855 } else {
7856 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7857 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 70, __pyx_L3_error)
7858 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7859 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 70, __pyx_L3_error)
7860 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7861 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 70, __pyx_L3_error)
7862 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
7863 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 70, __pyx_L3_error)
7864 }
7865 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
7866 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
7867 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
7868 __pyx_v_material_functions = ((PyObject*)values[3]);
7869 }
7870 goto __pyx_L6_skip;
7871 __pyx_L5_argtuple_error:;
7872 __Pyx_RaiseArgtupleInvalid("setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 70, __pyx_L3_error)
7873 __pyx_L6_skip:;
7874 goto __pyx_L4_argument_unpacking_done;
7875 __pyx_L3_error:;
7876 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7877 Py_XDECREF(values[__pyx_temp]);
7878 }
7879 __Pyx_AddTraceback("subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7880 __Pyx_RefNannyFinishContext();
7881 return NULL;
7882 __pyx_L4_argument_unpacking_done:;
7883 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
7884 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
7885 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_vals", 0))) __PYX_ERR(0, 72, __pyx_L1_error)
7886 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 73, __pyx_L1_error)
7887 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
7888
7889 /* function exit code */
7890 goto __pyx_L0;
7891 __pyx_L1_error:;
7892 __pyx_r = NULL;
7893 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7894 Py_XDECREF(values[__pyx_temp]);
7895 }
7896 goto __pyx_L7_cleaned_up;
7897 __pyx_L0:;
7898 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7899 Py_XDECREF(values[__pyx_temp]);
7900 }
7901 __pyx_L7_cleaned_up:;
7902 __Pyx_RefNannyFinishContext();
7903 return __pyx_r;
7904}
7905
7906static 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) {
7907 int __pyx_v_eN;
7908 int __pyx_v_ebN;
7909 int __pyx_v_ebN_local;
7910 int __pyx_v_k;
7911 int __pyx_v_material_left;
7912 int __pyx_v_material_right;
7913 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
7914 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
7915 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7916 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7917 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7918 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7919 PyObject *__pyx_r = NULL;
7920 __Pyx_RefNannyDeclarations
7921 npy_intp __pyx_t_1;
7922 npy_intp __pyx_t_2;
7923 int __pyx_t_3;
7924 npy_intp __pyx_t_4;
7925 npy_intp __pyx_t_5;
7926 int __pyx_t_6;
7927 Py_ssize_t __pyx_t_7;
7928 Py_ssize_t __pyx_t_8;
7929 int __pyx_t_9;
7930 npy_intp __pyx_t_10;
7931 npy_intp __pyx_t_11;
7932 PyObject *__pyx_t_12 = NULL;
7933 PyObject *__pyx_t_13 = NULL;
7934 PyObject *__pyx_t_14 = NULL;
7935 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
7936 Py_ssize_t __pyx_t_16;
7937 int __pyx_t_17;
7938 int __pyx_lineno = 0;
7939 const char *__pyx_filename = NULL;
7940 int __pyx_clineno = 0;
7941 __Pyx_RefNannySetupContext("setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
7942 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7943 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7944 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7945 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7946 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7947 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7948 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7949 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7950 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
7951 __pyx_pybuffer_ebq_vals.refcount = 0;
7952 __pyx_pybuffernd_ebq_vals.data = NULL;
7953 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
7954 {
7955 __Pyx_BufFmt_StackElem __pyx_stack[1];
7956 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, 70, __pyx_L1_error)
7957 }
7958 __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];
7959 {
7960 __Pyx_BufFmt_StackElem __pyx_stack[1];
7961 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, 70, __pyx_L1_error)
7962 }
7963 __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];
7964 {
7965 __Pyx_BufFmt_StackElem __pyx_stack[1];
7966 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, 70, __pyx_L1_error)
7967 }
7968 __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];
7969
7970 /* "subsurfaceTransportFunctions.pyx":83
7971 * cdef int eN,ebN,ebN_local,k,material_left,material_right
7972 *
7973 * for eN in range(ebq_vals.shape[0]): # <<<<<<<<<<<<<<
7974 * for ebN_local in range(ebq_vals.shape[1]):
7975 * ebN = elementBoundariesArray[eN,ebN_local]
7976*/
7977
7978 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_vals))[0]);
7979 __pyx_t_2 = __pyx_t_1;
7980
7981 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7982 __pyx_v_eN = __pyx_t_3;
7983
7984 /* "subsurfaceTransportFunctions.pyx":84
7985 *
7986 * for eN in range(ebq_vals.shape[0]):
7987 * for ebN_local in range(ebq_vals.shape[1]): # <<<<<<<<<<<<<<
7988 * ebN = elementBoundariesArray[eN,ebN_local]
7989 * material_left = elementBoundaryTypes[ebN,0]
7990*/
7991
7992 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_vals))[1]);
7993 __pyx_t_5 = __pyx_t_4;
7994
7995 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
7996 __pyx_v_ebN_local = __pyx_t_6;
7997
7998 /* "subsurfaceTransportFunctions.pyx":85
7999 * for eN in range(ebq_vals.shape[0]):
8000 * for ebN_local in range(ebq_vals.shape[1]):
8001 * ebN = elementBoundariesArray[eN,ebN_local] # <<<<<<<<<<<<<<
8002 * material_left = elementBoundaryTypes[ebN,0]
8003 * material_right= elementBoundaryTypes[ebN,1]
8004*/
8005 __pyx_t_7 = __pyx_v_eN;
8006 __pyx_t_8 = __pyx_v_ebN_local;
8007 __pyx_t_9 = -1;
8008 if (__pyx_t_7 < 0) {
8009 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
8010 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
8011 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
8012 if (__pyx_t_8 < 0) {
8013 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
8014 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
8015 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
8016 if (unlikely(__pyx_t_9 != -1)) {
8017 __Pyx_RaiseBufferIndexError(__pyx_t_9);
8018 __PYX_ERR(0, 85, __pyx_L1_error)
8019 }
8020 __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));
8021
8022 /* "subsurfaceTransportFunctions.pyx":86
8023 * for ebN_local in range(ebq_vals.shape[1]):
8024 * ebN = elementBoundariesArray[eN,ebN_local]
8025 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
8026 * material_right= elementBoundaryTypes[ebN,1]
8027 * for k in range(ebq_vals.shape[2]):
8028*/
8029 __pyx_t_8 = __pyx_v_ebN;
8030 __pyx_t_7 = 0;
8031 __pyx_t_9 = -1;
8032 if (__pyx_t_8 < 0) {
8033 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8034 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
8035 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
8036 if (__pyx_t_7 < 0) {
8037 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8038 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
8039 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
8040 if (unlikely(__pyx_t_9 != -1)) {
8041 __Pyx_RaiseBufferIndexError(__pyx_t_9);
8042 __PYX_ERR(0, 86, __pyx_L1_error)
8043 }
8044 __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));
8045
8046 /* "subsurfaceTransportFunctions.pyx":87
8047 * ebN = elementBoundariesArray[eN,ebN_local]
8048 * material_left = elementBoundaryTypes[ebN,0]
8049 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
8050 * for k in range(ebq_vals.shape[2]):
8051 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left]+
8052*/
8053 __pyx_t_7 = __pyx_v_ebN;
8054 __pyx_t_8 = 1;
8055 __pyx_t_9 = -1;
8056 if (__pyx_t_7 < 0) {
8057 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8058 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
8059 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
8060 if (__pyx_t_8 < 0) {
8061 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8062 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
8063 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
8064 if (unlikely(__pyx_t_9 != -1)) {
8065 __Pyx_RaiseBufferIndexError(__pyx_t_9);
8066 __PYX_ERR(0, 87, __pyx_L1_error)
8067 }
8068 __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));
8069
8070 /* "subsurfaceTransportFunctions.pyx":88
8071 * material_left = elementBoundaryTypes[ebN,0]
8072 * material_right= elementBoundaryTypes[ebN,1]
8073 * for k in range(ebq_vals.shape[2]): # <<<<<<<<<<<<<<
8074 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left]+
8075 * material_functions[material_right])
8076*/
8077
8078 __pyx_t_10 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_vals))[2]);
8079 __pyx_t_11 = __pyx_t_10;
8080
8081 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
8082 __pyx_v_k = __pyx_t_9;
8083
8084 /* "subsurfaceTransportFunctions.pyx":89
8085 * material_right= elementBoundaryTypes[ebN,1]
8086 * for k in range(ebq_vals.shape[2]):
8087 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left]+ # <<<<<<<<<<<<<<
8088 * material_functions[material_right])
8089 *
8090*/
8091 if (unlikely(__pyx_v_material_functions == Py_None)) {
8092 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
8093 __PYX_ERR(0, 89, __pyx_L1_error)
8094 }
8095 __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L1_error)
8096 __Pyx_GOTREF(__pyx_t_12);
8097 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 89, __pyx_L1_error)
8098 __Pyx_GOTREF(__pyx_t_13);
8099 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8100
8101 /* "subsurfaceTransportFunctions.pyx":90
8102 * for k in range(ebq_vals.shape[2]):
8103 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left]+
8104 * material_functions[material_right]) # <<<<<<<<<<<<<<
8105 *
8106 * def setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd,
8107*/
8108 if (unlikely(__pyx_v_material_functions == Py_None)) {
8109 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
8110 __PYX_ERR(0, 90, __pyx_L1_error)
8111 }
8112 __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error)
8113 __Pyx_GOTREF(__pyx_t_12);
8114 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 90, __pyx_L1_error)
8115 __Pyx_GOTREF(__pyx_t_14);
8116 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8117
8118 /* "subsurfaceTransportFunctions.pyx":89
8119 * material_right= elementBoundaryTypes[ebN,1]
8120 * for k in range(ebq_vals.shape[2]):
8121 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left]+ # <<<<<<<<<<<<<<
8122 * material_functions[material_right])
8123 *
8124*/
8125 __pyx_t_12 = __Pyx_PyNumber_Add_object_object(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L1_error)
8126 __Pyx_GOTREF(__pyx_t_12);
8127 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8128 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
8129 __pyx_t_14 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 89, __pyx_L1_error)
8130 __Pyx_GOTREF(__pyx_t_14);
8131 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8132 __pyx_t_15 = __Pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error)
8133 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
8134 __pyx_t_8 = __pyx_v_eN;
8135 __pyx_t_7 = __pyx_v_ebN_local;
8136 __pyx_t_16 = __pyx_v_k;
8137 __pyx_t_17 = -1;
8138 if (__pyx_t_8 < 0) {
8139 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
8140 if (unlikely(__pyx_t_8 < 0)) __pyx_t_17 = 0;
8141 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_17 = 0;
8142 if (__pyx_t_7 < 0) {
8143 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
8144 if (unlikely(__pyx_t_7 < 0)) __pyx_t_17 = 1;
8145 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_17 = 1;
8146 if (__pyx_t_16 < 0) {
8147 __pyx_t_16 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
8148 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 2;
8149 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_17 = 2;
8150 if (unlikely(__pyx_t_17 != -1)) {
8151 __Pyx_RaiseBufferIndexError(__pyx_t_17);
8152 __PYX_ERR(0, 89, __pyx_L1_error)
8153 }
8154 *__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;
8155
8156 }
8157
8158 }
8159
8160 }
8161
8162
8163 /* "subsurfaceTransportFunctions.pyx":70
8164 *
8165 *
8166 * def setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray, # <<<<<<<<<<<<<<
8167 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
8168 * numpy.ndarray[DTYPE_t,ndim=3] ebq_vals,
8169*/
8170
8171 /* function exit code */
8172 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8173 goto __pyx_L0;
8174 __pyx_L1_error:;
8175 __Pyx_XDECREF(__pyx_t_12);
8176 __Pyx_XDECREF(__pyx_t_13);
8177 __Pyx_XDECREF(__pyx_t_14);
8178 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8179 __Pyx_PyThreadState_declare
8180 __Pyx_PyThreadState_assign
8181 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8182 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
8183 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8184 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8185 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8186 __Pyx_AddTraceback("subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8187 __pyx_r = NULL;
8188 goto __pyx_L2;
8189 __pyx_L0:;
8190 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
8191 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8192 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8193 __pyx_L2:;
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206 __Pyx_XGIVEREF(__pyx_r);
8207 __Pyx_RefNannyFinishContext();
8208 return __pyx_r;
8209}
8210
8211/* "subsurfaceTransportFunctions.pyx":92
8212 * material_functions[material_right])
8213 *
8214 * def setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
8215 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
8216 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
8217*/
8218
8219/* Python wrapper */
8220static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self,
8221#if CYTHON_VECTORCALL
8222PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8223#else
8224PyObject *__pyx_args, PyObject *__pyx_kwds
8225#endif
8226); /*proto*/
8227PyDoc_STRVAR(__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 ");
8228static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
8229static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self,
8230#if CYTHON_VECTORCALL
8231PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8232#else
8233PyObject *__pyx_args, PyObject *__pyx_kwds
8234#endif
8235) {
8236 int __pyx_v_nd;
8237 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
8238 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
8239 PyArrayObject *__pyx_v_ebq_vals = 0;
8240 PyObject *__pyx_v_material_functions = 0;
8241 #if !CYTHON_VECTORCALL
8242 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8243 #endif
8244 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8245 PyObject* values[5] = {0,0,0,0,0};
8246 int __pyx_lineno = 0;
8247 const char *__pyx_filename = NULL;
8248 int __pyx_clineno = 0;
8249 PyObject *__pyx_r = 0;
8250 __Pyx_RefNannyDeclarations
8251 __Pyx_RefNannySetupContext("setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
8252 #if !CYTHON_VECTORCALL
8253 #if CYTHON_ASSUME_SAFE_SIZE
8254 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8255 #else
8256 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
8257 #endif
8258 #endif
8259 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
8260 {
8261 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nd,&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_ebq_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
8262 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
8263 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 92, __pyx_L3_error)
8264 if (__pyx_kwds_len > 0) {
8265 switch (__pyx_nargs) {
8266 case 5:
8267 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
8268 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 92, __pyx_L3_error)
8269 CYTHON_FALLTHROUGH;
8270 case 4:
8271 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
8272 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 92, __pyx_L3_error)
8273 CYTHON_FALLTHROUGH;
8274 case 3:
8275 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8276 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error)
8277 CYTHON_FALLTHROUGH;
8278 case 2:
8279 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8280 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error)
8281 CYTHON_FALLTHROUGH;
8282 case 1:
8283 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8284 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error)
8285 CYTHON_FALLTHROUGH;
8286 case 0: break;
8287 default: goto __pyx_L5_argtuple_error;
8288 }
8289 const Py_ssize_t kwd_pos_args = __pyx_nargs;
8290 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0) < (0)) __PYX_ERR(0, 92, __pyx_L3_error)
8291 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
8292 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, i); __PYX_ERR(0, 92, __pyx_L3_error) }
8293 }
8294 } else if (unlikely(__pyx_nargs != 5)) {
8295 goto __pyx_L5_argtuple_error;
8296 } else {
8297 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8298 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error)
8299 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8300 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error)
8301 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8302 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error)
8303 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
8304 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 92, __pyx_L3_error)
8305 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
8306 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 92, __pyx_L3_error)
8307 }
8308 __pyx_v_nd = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nd == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error)
8309 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
8310 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
8311 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
8312 __pyx_v_material_functions = ((PyObject*)values[4]);
8313 }
8314 goto __pyx_L6_skip;
8315 __pyx_L5_argtuple_error:;
8316 __Pyx_RaiseArgtupleInvalid("setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error)
8317 __pyx_L6_skip:;
8318 goto __pyx_L4_argument_unpacking_done;
8319 __pyx_L3_error:;
8320 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8321 Py_XDECREF(values[__pyx_temp]);
8322 }
8323 __Pyx_AddTraceback("subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8324 __Pyx_RefNannyFinishContext();
8325 return NULL;
8326 __pyx_L4_argument_unpacking_done:;
8327 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
8328 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
8329 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_vals", 0))) __PYX_ERR(0, 95, __pyx_L1_error)
8330 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 96, __pyx_L1_error)
8331 __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);
8332
8333 /* function exit code */
8334 goto __pyx_L0;
8335 __pyx_L1_error:;
8336 __pyx_r = NULL;
8337 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8338 Py_XDECREF(values[__pyx_temp]);
8339 }
8340 goto __pyx_L7_cleaned_up;
8341 __pyx_L0:;
8342 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8343 Py_XDECREF(values[__pyx_temp]);
8344 }
8345 __pyx_L7_cleaned_up:;
8346
8347 __Pyx_RefNannyFinishContext();
8348 return __pyx_r;
8349}
8350
8351static 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) {
8352 int __pyx_v_eN;
8353 int __pyx_v_ebN;
8354 int __pyx_v_ebN_local;
8355 int __pyx_v_k;
8356 int __pyx_v_material_left;
8357 int __pyx_v_material_right;
8358 int __pyx_v_I;
8359 int __pyx_v_J;
8360 double __pyx_v_numer;
8361 double __pyx_v_denom;
8362 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
8363 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
8364 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
8365 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
8366 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
8367 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
8368 PyObject *__pyx_r = NULL;
8369 __Pyx_RefNannyDeclarations
8370 npy_intp __pyx_t_1;
8371 npy_intp __pyx_t_2;
8372 int __pyx_t_3;
8373 npy_intp __pyx_t_4;
8374 npy_intp __pyx_t_5;
8375 int __pyx_t_6;
8376 Py_ssize_t __pyx_t_7;
8377 Py_ssize_t __pyx_t_8;
8378 int __pyx_t_9;
8379 npy_intp __pyx_t_10;
8380 npy_intp __pyx_t_11;
8381 int __pyx_t_12;
8382 int __pyx_t_13;
8383 int __pyx_t_14;
8384 int __pyx_t_15;
8385 int __pyx_t_16;
8386 int __pyx_t_17;
8387 PyObject *__pyx_t_18 = NULL;
8388 PyObject *__pyx_t_19 = NULL;
8389 PyObject *__pyx_t_20 = NULL;
8390 PyObject *__pyx_t_21 = NULL;
8391 PyObject *__pyx_t_22 = NULL;
8392 double __pyx_t_23;
8393 Py_ssize_t __pyx_t_24;
8394 Py_ssize_t __pyx_t_25;
8395 int __pyx_t_26;
8396 int __pyx_lineno = 0;
8397 const char *__pyx_filename = NULL;
8398 int __pyx_clineno = 0;
8399 __Pyx_RefNannySetupContext("setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
8400 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
8401 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
8402 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
8403 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
8404 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
8405 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
8406 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
8407 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
8408 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
8409 __pyx_pybuffer_ebq_vals.refcount = 0;
8410 __pyx_pybuffernd_ebq_vals.data = NULL;
8411 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
8412 {
8413 __Pyx_BufFmt_StackElem __pyx_stack[1];
8414 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, 92, __pyx_L1_error)
8415 }
8416 __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];
8417 {
8418 __Pyx_BufFmt_StackElem __pyx_stack[1];
8419 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, 92, __pyx_L1_error)
8420 }
8421 __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];
8422 {
8423 __Pyx_BufFmt_StackElem __pyx_stack[1];
8424 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, 92, __pyx_L1_error)
8425 }
8426 __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];
8427
8428 /* "subsurfaceTransportFunctions.pyx":107
8429 * cdef double numer,denom
8430 *
8431 * for eN in range(ebq_vals.shape[0]): # <<<<<<<<<<<<<<
8432 * for ebN_local in range(ebq_vals.shape[1]):
8433 * ebN = elementBoundariesArray[eN,ebN_local]
8434*/
8435
8436 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_vals))[0]);
8437 __pyx_t_2 = __pyx_t_1;
8438
8439 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8440 __pyx_v_eN = __pyx_t_3;
8441
8442 /* "subsurfaceTransportFunctions.pyx":108
8443 *
8444 * for eN in range(ebq_vals.shape[0]):
8445 * for ebN_local in range(ebq_vals.shape[1]): # <<<<<<<<<<<<<<
8446 * ebN = elementBoundariesArray[eN,ebN_local]
8447 * material_left = elementBoundaryTypes[ebN,0]
8448*/
8449
8450 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_vals))[1]);
8451 __pyx_t_5 = __pyx_t_4;
8452
8453 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
8454 __pyx_v_ebN_local = __pyx_t_6;
8455
8456 /* "subsurfaceTransportFunctions.pyx":109
8457 * for eN in range(ebq_vals.shape[0]):
8458 * for ebN_local in range(ebq_vals.shape[1]):
8459 * ebN = elementBoundariesArray[eN,ebN_local] # <<<<<<<<<<<<<<
8460 * material_left = elementBoundaryTypes[ebN,0]
8461 * material_right= elementBoundaryTypes[ebN,1]
8462*/
8463 __pyx_t_7 = __pyx_v_eN;
8464 __pyx_t_8 = __pyx_v_ebN_local;
8465 __pyx_t_9 = -1;
8466 if (__pyx_t_7 < 0) {
8467 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
8468 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
8469 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
8470 if (__pyx_t_8 < 0) {
8471 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
8472 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
8473 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
8474 if (unlikely(__pyx_t_9 != -1)) {
8475 __Pyx_RaiseBufferIndexError(__pyx_t_9);
8476 __PYX_ERR(0, 109, __pyx_L1_error)
8477 }
8478 __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));
8479
8480 /* "subsurfaceTransportFunctions.pyx":110
8481 * for ebN_local in range(ebq_vals.shape[1]):
8482 * ebN = elementBoundariesArray[eN,ebN_local]
8483 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
8484 * material_right= elementBoundaryTypes[ebN,1]
8485 * for k in range(ebq_vals.shape[2]):
8486*/
8487 __pyx_t_8 = __pyx_v_ebN;
8488 __pyx_t_7 = 0;
8489 __pyx_t_9 = -1;
8490 if (__pyx_t_8 < 0) {
8491 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8492 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
8493 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
8494 if (__pyx_t_7 < 0) {
8495 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8496 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
8497 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
8498 if (unlikely(__pyx_t_9 != -1)) {
8499 __Pyx_RaiseBufferIndexError(__pyx_t_9);
8500 __PYX_ERR(0, 110, __pyx_L1_error)
8501 }
8502 __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));
8503
8504 /* "subsurfaceTransportFunctions.pyx":111
8505 * ebN = elementBoundariesArray[eN,ebN_local]
8506 * material_left = elementBoundaryTypes[ebN,0]
8507 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
8508 * for k in range(ebq_vals.shape[2]):
8509 * for I in range(nd):
8510*/
8511 __pyx_t_7 = __pyx_v_ebN;
8512 __pyx_t_8 = 1;
8513 __pyx_t_9 = -1;
8514 if (__pyx_t_7 < 0) {
8515 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8516 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
8517 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
8518 if (__pyx_t_8 < 0) {
8519 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8520 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
8521 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
8522 if (unlikely(__pyx_t_9 != -1)) {
8523 __Pyx_RaiseBufferIndexError(__pyx_t_9);
8524 __PYX_ERR(0, 111, __pyx_L1_error)
8525 }
8526 __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));
8527
8528 /* "subsurfaceTransportFunctions.pyx":112
8529 * material_left = elementBoundaryTypes[ebN,0]
8530 * material_right= elementBoundaryTypes[ebN,1]
8531 * for k in range(ebq_vals.shape[2]): # <<<<<<<<<<<<<<
8532 * for I in range(nd):
8533 * for J in range(nd):
8534*/
8535
8536 __pyx_t_10 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_vals))[2]);
8537 __pyx_t_11 = __pyx_t_10;
8538
8539 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
8540 __pyx_v_k = __pyx_t_9;
8541
8542 /* "subsurfaceTransportFunctions.pyx":113
8543 * material_right= elementBoundaryTypes[ebN,1]
8544 * for k in range(ebq_vals.shape[2]):
8545 * for I in range(nd): # <<<<<<<<<<<<<<
8546 * for J in range(nd):
8547 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
8548*/
8549
8550 __pyx_t_12 = __pyx_v_nd;
8551 __pyx_t_13 = __pyx_t_12;
8552
8553 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
8554 __pyx_v_I = __pyx_t_14;
8555
8556 /* "subsurfaceTransportFunctions.pyx":114
8557 * for k in range(ebq_vals.shape[2]):
8558 * for I in range(nd):
8559 * for J in range(nd): # <<<<<<<<<<<<<<
8560 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
8561 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20
8562*/
8563
8564 __pyx_t_15 = __pyx_v_nd;
8565 __pyx_t_16 = __pyx_t_15;
8566
8567 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
8568 __pyx_v_J = __pyx_t_17;
8569
8570 /* "subsurfaceTransportFunctions.pyx":115
8571 * for I in range(nd):
8572 * for J in range(nd):
8573 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J] # <<<<<<<<<<<<<<
8574 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20
8575 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
8576*/
8577 if (unlikely(__pyx_v_material_functions == Py_None)) {
8578 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
8579 __PYX_ERR(0, 115, __pyx_L1_error)
8580 }
8581 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
8582 __Pyx_GOTREF(__pyx_t_18);
8583 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
8584 __Pyx_GOTREF(__pyx_t_19);
8585 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8586 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
8587 __Pyx_GOTREF(__pyx_t_18);
8588 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
8589 __Pyx_GOTREF(__pyx_t_20);
8590 __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
8591 __Pyx_GOTREF(__pyx_t_21);
8592 __Pyx_GIVEREF(__pyx_t_18);
8593 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18) != (0)) __PYX_ERR(0, 115, __pyx_L1_error);
8594 __Pyx_GIVEREF(__pyx_t_20);
8595 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20) != (0)) __PYX_ERR(0, 115, __pyx_L1_error);
8596 __pyx_t_18 = 0;
8597 __pyx_t_20 = 0;
8598 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
8599 __Pyx_GOTREF(__pyx_t_20);
8600 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8601 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8602 __pyx_t_21 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_2_0, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
8603 __Pyx_GOTREF(__pyx_t_21);
8604 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8605 if (unlikely(__pyx_v_material_functions == Py_None)) {
8606 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
8607 __PYX_ERR(0, 115, __pyx_L1_error)
8608 }
8609 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
8610 __Pyx_GOTREF(__pyx_t_20);
8611 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
8612 __Pyx_GOTREF(__pyx_t_19);
8613 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8614 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
8615 __Pyx_GOTREF(__pyx_t_20);
8616 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
8617 __Pyx_GOTREF(__pyx_t_18);
8618 __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
8619 __Pyx_GOTREF(__pyx_t_22);
8620 __Pyx_GIVEREF(__pyx_t_20);
8621 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20) != (0)) __PYX_ERR(0, 115, __pyx_L1_error);
8622 __Pyx_GIVEREF(__pyx_t_18);
8623 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_18) != (0)) __PYX_ERR(0, 115, __pyx_L1_error);
8624 __pyx_t_20 = 0;
8625 __pyx_t_18 = 0;
8626 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_22); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
8627 __Pyx_GOTREF(__pyx_t_18);
8628 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8629 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8630 __pyx_t_22 = __Pyx_PyNumber_Multiply_object_object(__pyx_t_21, __pyx_t_18); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
8631 __Pyx_GOTREF(__pyx_t_22);
8632 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8633 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8634 __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)
8635 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8636 __pyx_v_numer = __pyx_t_23;
8637
8638 /* "subsurfaceTransportFunctions.pyx":116
8639 * for J in range(nd):
8640 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
8641 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20 # <<<<<<<<<<<<<<
8642 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
8643 *
8644*/
8645 if (unlikely(__pyx_v_material_functions == Py_None)) {
8646 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
8647 __PYX_ERR(0, 116, __pyx_L1_error)
8648 }
8649 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 116, __pyx_L1_error)
8650 __Pyx_GOTREF(__pyx_t_22);
8651 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 116, __pyx_L1_error)
8652 __Pyx_GOTREF(__pyx_t_18);
8653 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8654 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 116, __pyx_L1_error)
8655 __Pyx_GOTREF(__pyx_t_22);
8656 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 116, __pyx_L1_error)
8657 __Pyx_GOTREF(__pyx_t_21);
8658 __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 116, __pyx_L1_error)
8659 __Pyx_GOTREF(__pyx_t_19);
8660 __Pyx_GIVEREF(__pyx_t_22);
8661 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_22) != (0)) __PYX_ERR(0, 116, __pyx_L1_error);
8662 __Pyx_GIVEREF(__pyx_t_21);
8663 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21) != (0)) __PYX_ERR(0, 116, __pyx_L1_error);
8664 __pyx_t_22 = 0;
8665 __pyx_t_21 = 0;
8666 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_19); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 116, __pyx_L1_error)
8667 __Pyx_GOTREF(__pyx_t_21);
8668 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8669 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8670 if (unlikely(__pyx_v_material_functions == Py_None)) {
8671 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
8672 __PYX_ERR(0, 116, __pyx_L1_error)
8673 }
8674 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 116, __pyx_L1_error)
8675 __Pyx_GOTREF(__pyx_t_19);
8676 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 116, __pyx_L1_error)
8677 __Pyx_GOTREF(__pyx_t_18);
8678 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8679 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 116, __pyx_L1_error)
8680 __Pyx_GOTREF(__pyx_t_19);
8681 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 116, __pyx_L1_error)
8682 __Pyx_GOTREF(__pyx_t_22);
8683 __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 116, __pyx_L1_error)
8684 __Pyx_GOTREF(__pyx_t_20);
8685 __Pyx_GIVEREF(__pyx_t_19);
8686 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19) != (0)) __PYX_ERR(0, 116, __pyx_L1_error);
8687 __Pyx_GIVEREF(__pyx_t_22);
8688 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22) != (0)) __PYX_ERR(0, 116, __pyx_L1_error);
8689 __pyx_t_19 = 0;
8690 __pyx_t_22 = 0;
8691 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_20); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 116, __pyx_L1_error)
8692 __Pyx_GOTREF(__pyx_t_22);
8693 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8694 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8695 __pyx_t_20 = __Pyx_PyNumber_Add_object_object(__pyx_t_21, __pyx_t_22); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 116, __pyx_L1_error)
8696 __Pyx_GOTREF(__pyx_t_20);
8697 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8698 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8699 __pyx_t_22 = __Pyx_PyFloat_AddObjC(__pyx_t_20, __pyx_mstate_global->__pyx_float_1_0eneg_20, 1.0e-20, 0, 0); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 116, __pyx_L1_error)
8700 __Pyx_GOTREF(__pyx_t_22);
8701 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8702 __pyx_t_23 = __Pyx_PyFloat_AsDouble(__pyx_t_22); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
8703 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8704 __pyx_v_denom = __pyx_t_23;
8705
8706 /* "subsurfaceTransportFunctions.pyx":117
8707 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
8708 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20
8709 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom # <<<<<<<<<<<<<<
8710 *
8711 * def setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
8712*/
8713 if (unlikely(__pyx_v_denom == 0)) {
8714 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
8715 __PYX_ERR(0, 117, __pyx_L1_error)
8716 }
8717 __pyx_t_8 = __pyx_v_eN;
8718 __pyx_t_7 = __pyx_v_ebN_local;
8719 __pyx_t_24 = __pyx_v_k;
8720 __pyx_t_25 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
8721 __pyx_t_26 = -1;
8722 if (__pyx_t_8 < 0) {
8723 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
8724 if (unlikely(__pyx_t_8 < 0)) __pyx_t_26 = 0;
8725 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_26 = 0;
8726 if (__pyx_t_7 < 0) {
8727 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
8728 if (unlikely(__pyx_t_7 < 0)) __pyx_t_26 = 1;
8729 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_26 = 1;
8730 if (__pyx_t_24 < 0) {
8731 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
8732 if (unlikely(__pyx_t_24 < 0)) __pyx_t_26 = 2;
8733 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_26 = 2;
8734 if (__pyx_t_25 < 0) {
8735 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
8736 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 3;
8737 } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_26 = 3;
8738 if (unlikely(__pyx_t_26 != -1)) {
8739 __Pyx_RaiseBufferIndexError(__pyx_t_26);
8740 __PYX_ERR(0, 117, __pyx_L1_error)
8741 }
8742 *__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);
8743 }
8744
8745 }
8746
8747 }
8748
8749 }
8750
8751 }
8752
8753
8754 /* "subsurfaceTransportFunctions.pyx":92
8755 * material_functions[material_right])
8756 *
8757 * def setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
8758 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
8759 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
8760*/
8761
8762 /* function exit code */
8763 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8764 goto __pyx_L0;
8765 __pyx_L1_error:;
8766 __Pyx_XDECREF(__pyx_t_18);
8767 __Pyx_XDECREF(__pyx_t_19);
8768 __Pyx_XDECREF(__pyx_t_20);
8769 __Pyx_XDECREF(__pyx_t_21);
8770 __Pyx_XDECREF(__pyx_t_22);
8771 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8772 __Pyx_PyThreadState_declare
8773 __Pyx_PyThreadState_assign
8774 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8775 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
8776 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8777 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8778 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8779 __Pyx_AddTraceback("subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8780 __pyx_r = NULL;
8781 goto __pyx_L2;
8782 __pyx_L0:;
8783 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
8784 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8785 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8786 __pyx_L2:;
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803 __Pyx_XGIVEREF(__pyx_r);
8804 __Pyx_RefNannyFinishContext();
8805 return __pyx_r;
8806}
8807
8808/* "subsurfaceTransportFunctions.pyx":119
8809 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
8810 *
8811 * def setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray, # <<<<<<<<<<<<<<
8812 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
8813 * numpy.ndarray[DTYPE_t,ndim=2] ebq_global_vals,
8814*/
8815
8816/* Python wrapper */
8817static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
8818#if CYTHON_VECTORCALL
8819PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8820#else
8821PyObject *__pyx_args, PyObject *__pyx_kwds
8822#endif
8823); /*proto*/
8824PyDoc_STRVAR(__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 ");
8825static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
8826static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
8827#if CYTHON_VECTORCALL
8828PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8829#else
8830PyObject *__pyx_args, PyObject *__pyx_kwds
8831#endif
8832) {
8833 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
8834 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
8835 PyArrayObject *__pyx_v_ebq_global_vals = 0;
8836 PyObject *__pyx_v_material_functions = 0;
8837 #if !CYTHON_VECTORCALL
8838 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8839 #endif
8840 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8841 PyObject* values[4] = {0,0,0,0};
8842 int __pyx_lineno = 0;
8843 const char *__pyx_filename = NULL;
8844 int __pyx_clineno = 0;
8845 PyObject *__pyx_r = 0;
8846 __Pyx_RefNannyDeclarations
8847 __Pyx_RefNannySetupContext("setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
8848 #if !CYTHON_VECTORCALL
8849 #if CYTHON_ASSUME_SAFE_SIZE
8850 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8851 #else
8852 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
8853 #endif
8854 #endif
8855 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
8856 {
8857 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_ebq_global_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
8858 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
8859 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
8860 if (__pyx_kwds_len > 0) {
8861 switch (__pyx_nargs) {
8862 case 4:
8863 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
8864 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 119, __pyx_L3_error)
8865 CYTHON_FALLTHROUGH;
8866 case 3:
8867 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8868 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 119, __pyx_L3_error)
8869 CYTHON_FALLTHROUGH;
8870 case 2:
8871 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8872 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 119, __pyx_L3_error)
8873 CYTHON_FALLTHROUGH;
8874 case 1:
8875 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8876 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 119, __pyx_L3_error)
8877 CYTHON_FALLTHROUGH;
8878 case 0: break;
8879 default: goto __pyx_L5_argtuple_error;
8880 }
8881 const Py_ssize_t kwd_pos_args = __pyx_nargs;
8882 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0) < (0)) __PYX_ERR(0, 119, __pyx_L3_error)
8883 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
8884 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, i); __PYX_ERR(0, 119, __pyx_L3_error) }
8885 }
8886 } else if (unlikely(__pyx_nargs != 4)) {
8887 goto __pyx_L5_argtuple_error;
8888 } else {
8889 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8890 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 119, __pyx_L3_error)
8891 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8892 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 119, __pyx_L3_error)
8893 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8894 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 119, __pyx_L3_error)
8895 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
8896 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 119, __pyx_L3_error)
8897 }
8898 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
8899 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
8900 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
8901 __pyx_v_material_functions = ((PyObject*)values[3]);
8902 }
8903 goto __pyx_L6_skip;
8904 __pyx_L5_argtuple_error:;
8905 __Pyx_RaiseArgtupleInvalid("setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 119, __pyx_L3_error)
8906 __pyx_L6_skip:;
8907 goto __pyx_L4_argument_unpacking_done;
8908 __pyx_L3_error:;
8909 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8910 Py_XDECREF(values[__pyx_temp]);
8911 }
8912 __Pyx_AddTraceback("subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8913 __Pyx_RefNannyFinishContext();
8914 return NULL;
8915 __pyx_L4_argument_unpacking_done:;
8916 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
8917 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
8918 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_global_vals", 0))) __PYX_ERR(0, 121, __pyx_L1_error)
8919 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 122, __pyx_L1_error)
8920 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
8921
8922 /* function exit code */
8923 goto __pyx_L0;
8924 __pyx_L1_error:;
8925 __pyx_r = NULL;
8926 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8927 Py_XDECREF(values[__pyx_temp]);
8928 }
8929 goto __pyx_L7_cleaned_up;
8930 __pyx_L0:;
8931 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8932 Py_XDECREF(values[__pyx_temp]);
8933 }
8934 __pyx_L7_cleaned_up:;
8935 __Pyx_RefNannyFinishContext();
8936 return __pyx_r;
8937}
8938
8939static 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) {
8940 int __pyx_v_ebN;
8941 int __pyx_v_material_left;
8942 int __pyx_v_material_right;
8943 npy_intp __pyx_v_k;
8944 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
8945 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
8946 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
8947 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
8948 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
8949 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
8950 PyObject *__pyx_r = NULL;
8951 __Pyx_RefNannyDeclarations
8952 npy_intp __pyx_t_1;
8953 npy_intp __pyx_t_2;
8954 int __pyx_t_3;
8955 Py_ssize_t __pyx_t_4;
8956 Py_ssize_t __pyx_t_5;
8957 int __pyx_t_6;
8958 npy_intp __pyx_t_7;
8959 npy_intp __pyx_t_8;
8960 npy_intp __pyx_t_9;
8961 PyObject *__pyx_t_10 = NULL;
8962 PyObject *__pyx_t_11 = NULL;
8963 PyObject *__pyx_t_12 = NULL;
8964 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
8965 int __pyx_lineno = 0;
8966 const char *__pyx_filename = NULL;
8967 int __pyx_clineno = 0;
8968 __Pyx_RefNannySetupContext("setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
8969 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
8970 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
8971 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
8972 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
8973 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
8974 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
8975 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
8976 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
8977 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
8978 __pyx_pybuffer_ebq_global_vals.refcount = 0;
8979 __pyx_pybuffernd_ebq_global_vals.data = NULL;
8980 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
8981 {
8982 __Pyx_BufFmt_StackElem __pyx_stack[1];
8983 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, 119, __pyx_L1_error)
8984 }
8985 __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];
8986 {
8987 __Pyx_BufFmt_StackElem __pyx_stack[1];
8988 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, 119, __pyx_L1_error)
8989 }
8990 __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];
8991 {
8992 __Pyx_BufFmt_StackElem __pyx_stack[1];
8993 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, 119, __pyx_L1_error)
8994 }
8995 __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];
8996
8997 /* "subsurfaceTransportFunctions.pyx":132
8998 * cdef int ebN,material_left,material_right
8999 *
9000 * for ebN in range(ebq_global_vals.shape[0]): # <<<<<<<<<<<<<<
9001 * material_left = elementBoundaryTypes[ebN,0]
9002 * material_right= elementBoundaryTypes[ebN,1]
9003*/
9004
9005 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_global_vals))[0]);
9006 __pyx_t_2 = __pyx_t_1;
9007
9008 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
9009 __pyx_v_ebN = __pyx_t_3;
9010
9011 /* "subsurfaceTransportFunctions.pyx":133
9012 *
9013 * for ebN in range(ebq_global_vals.shape[0]):
9014 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
9015 * material_right= elementBoundaryTypes[ebN,1]
9016 * for k in range(ebq_global_vals.shape[1]):
9017*/
9018 __pyx_t_4 = __pyx_v_ebN;
9019 __pyx_t_5 = 0;
9020 __pyx_t_6 = -1;
9021 if (__pyx_t_4 < 0) {
9022 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
9023 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
9024 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
9025 if (__pyx_t_5 < 0) {
9026 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
9027 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
9028 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
9029 if (unlikely(__pyx_t_6 != -1)) {
9030 __Pyx_RaiseBufferIndexError(__pyx_t_6);
9031 __PYX_ERR(0, 133, __pyx_L1_error)
9032 }
9033 __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));
9034
9035 /* "subsurfaceTransportFunctions.pyx":134
9036 * for ebN in range(ebq_global_vals.shape[0]):
9037 * material_left = elementBoundaryTypes[ebN,0]
9038 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
9039 * for k in range(ebq_global_vals.shape[1]):
9040 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left]+
9041*/
9042 __pyx_t_5 = __pyx_v_ebN;
9043 __pyx_t_4 = 1;
9044 __pyx_t_6 = -1;
9045 if (__pyx_t_5 < 0) {
9046 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
9047 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
9048 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
9049 if (__pyx_t_4 < 0) {
9050 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
9051 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
9052 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
9053 if (unlikely(__pyx_t_6 != -1)) {
9054 __Pyx_RaiseBufferIndexError(__pyx_t_6);
9055 __PYX_ERR(0, 134, __pyx_L1_error)
9056 }
9057 __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));
9058
9059 /* "subsurfaceTransportFunctions.pyx":135
9060 * material_left = elementBoundaryTypes[ebN,0]
9061 * material_right= elementBoundaryTypes[ebN,1]
9062 * for k in range(ebq_global_vals.shape[1]): # <<<<<<<<<<<<<<
9063 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left]+
9064 * material_functions[material_right])
9065*/
9066
9067 __pyx_t_7 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_global_vals))[1]);
9068 __pyx_t_8 = __pyx_t_7;
9069
9070 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
9071 __pyx_v_k = __pyx_t_9;
9072
9073 /* "subsurfaceTransportFunctions.pyx":136
9074 * material_right= elementBoundaryTypes[ebN,1]
9075 * for k in range(ebq_global_vals.shape[1]):
9076 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left]+ # <<<<<<<<<<<<<<
9077 * material_functions[material_right])
9078 *
9079*/
9080 if (unlikely(__pyx_v_material_functions == Py_None)) {
9081 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
9082 __PYX_ERR(0, 136, __pyx_L1_error)
9083 }
9084 __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 136, __pyx_L1_error)
9085 __Pyx_GOTREF(__pyx_t_10);
9086 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L1_error)
9087 __Pyx_GOTREF(__pyx_t_11);
9088 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9089
9090 /* "subsurfaceTransportFunctions.pyx":137
9091 * for k in range(ebq_global_vals.shape[1]):
9092 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left]+
9093 * material_functions[material_right]) # <<<<<<<<<<<<<<
9094 *
9095 *
9096*/
9097 if (unlikely(__pyx_v_material_functions == Py_None)) {
9098 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
9099 __PYX_ERR(0, 137, __pyx_L1_error)
9100 }
9101 __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 137, __pyx_L1_error)
9102 __Pyx_GOTREF(__pyx_t_10);
9103 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 137, __pyx_L1_error)
9104 __Pyx_GOTREF(__pyx_t_12);
9105 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9106
9107 /* "subsurfaceTransportFunctions.pyx":136
9108 * material_right= elementBoundaryTypes[ebN,1]
9109 * for k in range(ebq_global_vals.shape[1]):
9110 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left]+ # <<<<<<<<<<<<<<
9111 * material_functions[material_right])
9112 *
9113*/
9114 __pyx_t_10 = __Pyx_PyNumber_Add_object_object(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 136, __pyx_L1_error)
9115 __Pyx_GOTREF(__pyx_t_10);
9116 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9117 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
9118 __pyx_t_12 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error)
9119 __Pyx_GOTREF(__pyx_t_12);
9120 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9121 __pyx_t_13 = __Pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_13 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
9122 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
9123 __pyx_t_4 = __pyx_v_ebN;
9124 __pyx_t_5 = __pyx_v_k;
9125 __pyx_t_6 = -1;
9126 if (__pyx_t_4 < 0) {
9127 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
9128 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
9129 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
9130 if (__pyx_t_5 < 0) {
9131 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
9132 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
9133 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
9134 if (unlikely(__pyx_t_6 != -1)) {
9135 __Pyx_RaiseBufferIndexError(__pyx_t_6);
9136 __PYX_ERR(0, 136, __pyx_L1_error)
9137 }
9138 *__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;
9139
9140 }
9141
9142 }
9143
9144
9145 /* "subsurfaceTransportFunctions.pyx":119
9146 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
9147 *
9148 * def setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray, # <<<<<<<<<<<<<<
9149 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
9150 * numpy.ndarray[DTYPE_t,ndim=2] ebq_global_vals,
9151*/
9152
9153 /* function exit code */
9154 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9155 goto __pyx_L0;
9156 __pyx_L1_error:;
9157 __Pyx_XDECREF(__pyx_t_10);
9158 __Pyx_XDECREF(__pyx_t_11);
9159 __Pyx_XDECREF(__pyx_t_12);
9160 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9161 __Pyx_PyThreadState_declare
9162 __Pyx_PyThreadState_assign
9163 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9164 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
9165 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
9166 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
9167 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9168 __Pyx_AddTraceback("subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
9169 __pyx_r = NULL;
9170 goto __pyx_L2;
9171 __pyx_L0:;
9172 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
9173 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
9174 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
9175 __pyx_L2:;
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186 __Pyx_XGIVEREF(__pyx_r);
9187 __Pyx_RefNannyFinishContext();
9188 return __pyx_r;
9189}
9190
9191/* "subsurfaceTransportFunctions.pyx":140
9192 *
9193 *
9194 * def setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
9195 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
9196 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
9197*/
9198
9199/* Python wrapper */
9200static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self,
9201#if CYTHON_VECTORCALL
9202PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
9203#else
9204PyObject *__pyx_args, PyObject *__pyx_kwds
9205#endif
9206); /*proto*/
9207PyDoc_STRVAR(__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 ");
9208static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
9209static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self,
9210#if CYTHON_VECTORCALL
9211PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
9212#else
9213PyObject *__pyx_args, PyObject *__pyx_kwds
9214#endif
9215) {
9216 int __pyx_v_nd;
9217 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
9218 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
9219 PyArrayObject *__pyx_v_ebq_global_vals = 0;
9220 PyObject *__pyx_v_material_functions = 0;
9221 #if !CYTHON_VECTORCALL
9222 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
9223 #endif
9224 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9225 PyObject* values[5] = {0,0,0,0,0};
9226 int __pyx_lineno = 0;
9227 const char *__pyx_filename = NULL;
9228 int __pyx_clineno = 0;
9229 PyObject *__pyx_r = 0;
9230 __Pyx_RefNannyDeclarations
9231 __Pyx_RefNannySetupContext("setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
9232 #if !CYTHON_VECTORCALL
9233 #if CYTHON_ASSUME_SAFE_SIZE
9234 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
9235 #else
9236 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
9237 #endif
9238 #endif
9239 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
9240 {
9241 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nd,&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_ebq_global_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
9242 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
9243 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 140, __pyx_L3_error)
9244 if (__pyx_kwds_len > 0) {
9245 switch (__pyx_nargs) {
9246 case 5:
9247 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
9248 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 140, __pyx_L3_error)
9249 CYTHON_FALLTHROUGH;
9250 case 4:
9251 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
9252 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 140, __pyx_L3_error)
9253 CYTHON_FALLTHROUGH;
9254 case 3:
9255 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
9256 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 140, __pyx_L3_error)
9257 CYTHON_FALLTHROUGH;
9258 case 2:
9259 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
9260 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 140, __pyx_L3_error)
9261 CYTHON_FALLTHROUGH;
9262 case 1:
9263 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
9264 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 140, __pyx_L3_error)
9265 CYTHON_FALLTHROUGH;
9266 case 0: break;
9267 default: goto __pyx_L5_argtuple_error;
9268 }
9269 const Py_ssize_t kwd_pos_args = __pyx_nargs;
9270 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0) < (0)) __PYX_ERR(0, 140, __pyx_L3_error)
9271 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
9272 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, i); __PYX_ERR(0, 140, __pyx_L3_error) }
9273 }
9274 } else if (unlikely(__pyx_nargs != 5)) {
9275 goto __pyx_L5_argtuple_error;
9276 } else {
9277 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
9278 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 140, __pyx_L3_error)
9279 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
9280 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 140, __pyx_L3_error)
9281 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
9282 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 140, __pyx_L3_error)
9283 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
9284 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 140, __pyx_L3_error)
9285 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
9286 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 140, __pyx_L3_error)
9287 }
9288 __pyx_v_nd = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nd == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error)
9289 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
9290 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
9291 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
9292 __pyx_v_material_functions = ((PyObject*)values[4]);
9293 }
9294 goto __pyx_L6_skip;
9295 __pyx_L5_argtuple_error:;
9296 __Pyx_RaiseArgtupleInvalid("setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 140, __pyx_L3_error)
9297 __pyx_L6_skip:;
9298 goto __pyx_L4_argument_unpacking_done;
9299 __pyx_L3_error:;
9300 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9301 Py_XDECREF(values[__pyx_temp]);
9302 }
9303 __Pyx_AddTraceback("subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
9304 __Pyx_RefNannyFinishContext();
9305 return NULL;
9306 __pyx_L4_argument_unpacking_done:;
9307 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
9308 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 142, __pyx_L1_error)
9309 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_global_vals", 0))) __PYX_ERR(0, 143, __pyx_L1_error)
9310 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 144, __pyx_L1_error)
9311 __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);
9312
9313 /* function exit code */
9314 goto __pyx_L0;
9315 __pyx_L1_error:;
9316 __pyx_r = NULL;
9317 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9318 Py_XDECREF(values[__pyx_temp]);
9319 }
9320 goto __pyx_L7_cleaned_up;
9321 __pyx_L0:;
9322 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9323 Py_XDECREF(values[__pyx_temp]);
9324 }
9325 __pyx_L7_cleaned_up:;
9326
9327 __Pyx_RefNannyFinishContext();
9328 return __pyx_r;
9329}
9330
9331static 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) {
9332 int __pyx_v_ebN;
9333 int __pyx_v_k;
9334 int __pyx_v_material_left;
9335 int __pyx_v_material_right;
9336 int __pyx_v_I;
9337 int __pyx_v_J;
9338 double __pyx_v_numer;
9339 double __pyx_v_denom;
9340 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
9341 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
9342 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
9343 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
9344 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
9345 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
9346 PyObject *__pyx_r = NULL;
9347 __Pyx_RefNannyDeclarations
9348 npy_intp __pyx_t_1;
9349 npy_intp __pyx_t_2;
9350 int __pyx_t_3;
9351 Py_ssize_t __pyx_t_4;
9352 Py_ssize_t __pyx_t_5;
9353 int __pyx_t_6;
9354 npy_intp __pyx_t_7;
9355 npy_intp __pyx_t_8;
9356 int __pyx_t_9;
9357 int __pyx_t_10;
9358 int __pyx_t_11;
9359 int __pyx_t_12;
9360 int __pyx_t_13;
9361 int __pyx_t_14;
9362 PyObject *__pyx_t_15 = NULL;
9363 PyObject *__pyx_t_16 = NULL;
9364 PyObject *__pyx_t_17 = NULL;
9365 PyObject *__pyx_t_18 = NULL;
9366 PyObject *__pyx_t_19 = NULL;
9367 double __pyx_t_20;
9368 Py_ssize_t __pyx_t_21;
9369 int __pyx_t_22;
9370 int __pyx_lineno = 0;
9371 const char *__pyx_filename = NULL;
9372 int __pyx_clineno = 0;
9373 __Pyx_RefNannySetupContext("setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
9374 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
9375 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
9376 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
9377 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
9378 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
9379 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
9380 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
9381 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
9382 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
9383 __pyx_pybuffer_ebq_global_vals.refcount = 0;
9384 __pyx_pybuffernd_ebq_global_vals.data = NULL;
9385 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
9386 {
9387 __Pyx_BufFmt_StackElem __pyx_stack[1];
9388 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, 140, __pyx_L1_error)
9389 }
9390 __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];
9391 {
9392 __Pyx_BufFmt_StackElem __pyx_stack[1];
9393 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, 140, __pyx_L1_error)
9394 }
9395 __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];
9396 {
9397 __Pyx_BufFmt_StackElem __pyx_stack[1];
9398 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, 140, __pyx_L1_error)
9399 }
9400 __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];
9401
9402 /* "subsurfaceTransportFunctions.pyx":155
9403 * cdef double numer,denom
9404 *
9405 * for ebN in range(ebq_global_vals.shape[0]): # <<<<<<<<<<<<<<
9406 * material_left = elementBoundaryTypes[ebN,0]
9407 * material_right= elementBoundaryTypes[ebN,1]
9408*/
9409
9410 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_global_vals))[0]);
9411 __pyx_t_2 = __pyx_t_1;
9412
9413 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
9414 __pyx_v_ebN = __pyx_t_3;
9415
9416 /* "subsurfaceTransportFunctions.pyx":156
9417 *
9418 * for ebN in range(ebq_global_vals.shape[0]):
9419 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
9420 * material_right= elementBoundaryTypes[ebN,1]
9421 * for k in range(ebq_global_vals.shape[1]):
9422*/
9423 __pyx_t_4 = __pyx_v_ebN;
9424 __pyx_t_5 = 0;
9425 __pyx_t_6 = -1;
9426 if (__pyx_t_4 < 0) {
9427 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
9428 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
9429 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
9430 if (__pyx_t_5 < 0) {
9431 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
9432 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
9433 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
9434 if (unlikely(__pyx_t_6 != -1)) {
9435 __Pyx_RaiseBufferIndexError(__pyx_t_6);
9436 __PYX_ERR(0, 156, __pyx_L1_error)
9437 }
9438 __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));
9439
9440 /* "subsurfaceTransportFunctions.pyx":157
9441 * for ebN in range(ebq_global_vals.shape[0]):
9442 * material_left = elementBoundaryTypes[ebN,0]
9443 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
9444 * for k in range(ebq_global_vals.shape[1]):
9445 * for I in range(nd):
9446*/
9447 __pyx_t_5 = __pyx_v_ebN;
9448 __pyx_t_4 = 1;
9449 __pyx_t_6 = -1;
9450 if (__pyx_t_5 < 0) {
9451 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
9452 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
9453 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
9454 if (__pyx_t_4 < 0) {
9455 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
9456 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
9457 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
9458 if (unlikely(__pyx_t_6 != -1)) {
9459 __Pyx_RaiseBufferIndexError(__pyx_t_6);
9460 __PYX_ERR(0, 157, __pyx_L1_error)
9461 }
9462 __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));
9463
9464 /* "subsurfaceTransportFunctions.pyx":158
9465 * material_left = elementBoundaryTypes[ebN,0]
9466 * material_right= elementBoundaryTypes[ebN,1]
9467 * for k in range(ebq_global_vals.shape[1]): # <<<<<<<<<<<<<<
9468 * for I in range(nd):
9469 * for J in range(nd):
9470*/
9471
9472 __pyx_t_7 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_ebq_global_vals))[1]);
9473 __pyx_t_8 = __pyx_t_7;
9474
9475 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
9476 __pyx_v_k = __pyx_t_6;
9477
9478 /* "subsurfaceTransportFunctions.pyx":159
9479 * material_right= elementBoundaryTypes[ebN,1]
9480 * for k in range(ebq_global_vals.shape[1]):
9481 * for I in range(nd): # <<<<<<<<<<<<<<
9482 * for J in range(nd):
9483 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
9484*/
9485
9486 __pyx_t_9 = __pyx_v_nd;
9487 __pyx_t_10 = __pyx_t_9;
9488
9489 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
9490 __pyx_v_I = __pyx_t_11;
9491
9492 /* "subsurfaceTransportFunctions.pyx":160
9493 * for k in range(ebq_global_vals.shape[1]):
9494 * for I in range(nd):
9495 * for J in range(nd): # <<<<<<<<<<<<<<
9496 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
9497 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20
9498*/
9499
9500 __pyx_t_12 = __pyx_v_nd;
9501 __pyx_t_13 = __pyx_t_12;
9502
9503 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
9504 __pyx_v_J = __pyx_t_14;
9505
9506 /* "subsurfaceTransportFunctions.pyx":161
9507 * for I in range(nd):
9508 * for J in range(nd):
9509 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J] # <<<<<<<<<<<<<<
9510 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20
9511 * ebq_global_vals[ebN,k,I*nd+J] = numer/denom
9512*/
9513 if (unlikely(__pyx_v_material_functions == Py_None)) {
9514 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
9515 __PYX_ERR(0, 161, __pyx_L1_error)
9516 }
9517 __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
9518 __Pyx_GOTREF(__pyx_t_15);
9519 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
9520 __Pyx_GOTREF(__pyx_t_16);
9521 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9522 __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
9523 __Pyx_GOTREF(__pyx_t_15);
9524 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
9525 __Pyx_GOTREF(__pyx_t_17);
9526 __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
9527 __Pyx_GOTREF(__pyx_t_18);
9528 __Pyx_GIVEREF(__pyx_t_15);
9529 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_15) != (0)) __PYX_ERR(0, 161, __pyx_L1_error);
9530 __Pyx_GIVEREF(__pyx_t_17);
9531 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_17) != (0)) __PYX_ERR(0, 161, __pyx_L1_error);
9532 __pyx_t_15 = 0;
9533 __pyx_t_17 = 0;
9534 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
9535 __Pyx_GOTREF(__pyx_t_17);
9536 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9537 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
9538 __pyx_t_18 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_2_0, __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
9539 __Pyx_GOTREF(__pyx_t_18);
9540 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
9541 if (unlikely(__pyx_v_material_functions == Py_None)) {
9542 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
9543 __PYX_ERR(0, 161, __pyx_L1_error)
9544 }
9545 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
9546 __Pyx_GOTREF(__pyx_t_17);
9547 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
9548 __Pyx_GOTREF(__pyx_t_16);
9549 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
9550 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
9551 __Pyx_GOTREF(__pyx_t_17);
9552 __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
9553 __Pyx_GOTREF(__pyx_t_15);
9554 __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
9555 __Pyx_GOTREF(__pyx_t_19);
9556 __Pyx_GIVEREF(__pyx_t_17);
9557 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17) != (0)) __PYX_ERR(0, 161, __pyx_L1_error);
9558 __Pyx_GIVEREF(__pyx_t_15);
9559 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_15) != (0)) __PYX_ERR(0, 161, __pyx_L1_error);
9560 __pyx_t_17 = 0;
9561 __pyx_t_15 = 0;
9562 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_19); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
9563 __Pyx_GOTREF(__pyx_t_15);
9564 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9565 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
9566 __pyx_t_19 = __Pyx_PyNumber_Multiply_object_object(__pyx_t_18, __pyx_t_15); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
9567 __Pyx_GOTREF(__pyx_t_19);
9568 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
9569 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9570 __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)
9571 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
9572 __pyx_v_numer = __pyx_t_20;
9573
9574 /* "subsurfaceTransportFunctions.pyx":162
9575 * for J in range(nd):
9576 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
9577 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20 # <<<<<<<<<<<<<<
9578 * ebq_global_vals[ebN,k,I*nd+J] = numer/denom
9579 *
9580*/
9581 if (unlikely(__pyx_v_material_functions == Py_None)) {
9582 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
9583 __PYX_ERR(0, 162, __pyx_L1_error)
9584 }
9585 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 162, __pyx_L1_error)
9586 __Pyx_GOTREF(__pyx_t_19);
9587 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 162, __pyx_L1_error)
9588 __Pyx_GOTREF(__pyx_t_15);
9589 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
9590 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 162, __pyx_L1_error)
9591 __Pyx_GOTREF(__pyx_t_19);
9592 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 162, __pyx_L1_error)
9593 __Pyx_GOTREF(__pyx_t_18);
9594 __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 162, __pyx_L1_error)
9595 __Pyx_GOTREF(__pyx_t_16);
9596 __Pyx_GIVEREF(__pyx_t_19);
9597 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_19) != (0)) __PYX_ERR(0, 162, __pyx_L1_error);
9598 __Pyx_GIVEREF(__pyx_t_18);
9599 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18) != (0)) __PYX_ERR(0, 162, __pyx_L1_error);
9600 __pyx_t_19 = 0;
9601 __pyx_t_18 = 0;
9602 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 162, __pyx_L1_error)
9603 __Pyx_GOTREF(__pyx_t_18);
9604 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9605 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9606 if (unlikely(__pyx_v_material_functions == Py_None)) {
9607 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
9608 __PYX_ERR(0, 162, __pyx_L1_error)
9609 }
9610 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 162, __pyx_L1_error)
9611 __Pyx_GOTREF(__pyx_t_16);
9612 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 162, __pyx_L1_error)
9613 __Pyx_GOTREF(__pyx_t_15);
9614 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9615 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 162, __pyx_L1_error)
9616 __Pyx_GOTREF(__pyx_t_16);
9617 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 162, __pyx_L1_error)
9618 __Pyx_GOTREF(__pyx_t_19);
9619 __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 162, __pyx_L1_error)
9620 __Pyx_GOTREF(__pyx_t_17);
9621 __Pyx_GIVEREF(__pyx_t_16);
9622 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 162, __pyx_L1_error);
9623 __Pyx_GIVEREF(__pyx_t_19);
9624 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_19) != (0)) __PYX_ERR(0, 162, __pyx_L1_error);
9625 __pyx_t_16 = 0;
9626 __pyx_t_19 = 0;
9627 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_17); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 162, __pyx_L1_error)
9628 __Pyx_GOTREF(__pyx_t_19);
9629 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9630 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
9631 __pyx_t_17 = __Pyx_PyNumber_Add_object_object(__pyx_t_18, __pyx_t_19); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 162, __pyx_L1_error)
9632 __Pyx_GOTREF(__pyx_t_17);
9633 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
9634 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
9635 __pyx_t_19 = __Pyx_PyFloat_AddObjC(__pyx_t_17, __pyx_mstate_global->__pyx_float_1_0eneg_20, 1.0e-20, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 162, __pyx_L1_error)
9636 __Pyx_GOTREF(__pyx_t_19);
9637 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
9638 __pyx_t_20 = __Pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_20 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
9639 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
9640 __pyx_v_denom = __pyx_t_20;
9641
9642 /* "subsurfaceTransportFunctions.pyx":163
9643 * numer = 2.0*material_functions[material_left][I,J]*material_functions[material_right][I,J]
9644 * denom = material_functions[material_left][I,J] + material_functions[material_right][I,J] + 1.0e-20
9645 * ebq_global_vals[ebN,k,I*nd+J] = numer/denom # <<<<<<<<<<<<<<
9646 *
9647 * ###
9648*/
9649 if (unlikely(__pyx_v_denom == 0)) {
9650 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
9651 __PYX_ERR(0, 163, __pyx_L1_error)
9652 }
9653 __pyx_t_4 = __pyx_v_ebN;
9654 __pyx_t_5 = __pyx_v_k;
9655 __pyx_t_21 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
9656 __pyx_t_22 = -1;
9657 if (__pyx_t_4 < 0) {
9658 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
9659 if (unlikely(__pyx_t_4 < 0)) __pyx_t_22 = 0;
9660 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
9661 if (__pyx_t_5 < 0) {
9662 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
9663 if (unlikely(__pyx_t_5 < 0)) __pyx_t_22 = 1;
9664 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
9665 if (__pyx_t_21 < 0) {
9666 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
9667 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 2;
9668 } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
9669 if (unlikely(__pyx_t_22 != -1)) {
9670 __Pyx_RaiseBufferIndexError(__pyx_t_22);
9671 __PYX_ERR(0, 163, __pyx_L1_error)
9672 }
9673 *__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);
9674 }
9675
9676 }
9677
9678 }
9679
9680 }
9681
9682
9683 /* "subsurfaceTransportFunctions.pyx":140
9684 *
9685 *
9686 * def setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
9687 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
9688 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
9689*/
9690
9691 /* function exit code */
9692 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9693 goto __pyx_L0;
9694 __pyx_L1_error:;
9695 __Pyx_XDECREF(__pyx_t_15);
9696 __Pyx_XDECREF(__pyx_t_16);
9697 __Pyx_XDECREF(__pyx_t_17);
9698 __Pyx_XDECREF(__pyx_t_18);
9699 __Pyx_XDECREF(__pyx_t_19);
9700 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9701 __Pyx_PyThreadState_declare
9702 __Pyx_PyThreadState_assign
9703 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9704 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
9705 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
9706 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
9707 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9708 __Pyx_AddTraceback("subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
9709 __pyx_r = NULL;
9710 goto __pyx_L2;
9711 __pyx_L0:;
9712 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
9713 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
9714 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
9715 __pyx_L2:;
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730 __Pyx_XGIVEREF(__pyx_r);
9731 __Pyx_RefNannyFinishContext();
9732 return __pyx_r;
9733}
9734
9735/* "subsurfaceTransportFunctions.pyx":166
9736 *
9737 * ###
9738 * def evaluateScalarMaterialFunctionOverElements(double t, # <<<<<<<<<<<<<<
9739 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
9740 * numpy.ndarray[DTYPE_t,ndim=3] x,
9741*/
9742
9743/* Python wrapper */
9744static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self,
9745#if CYTHON_VECTORCALL
9746PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
9747#else
9748PyObject *__pyx_args, PyObject *__pyx_kwds
9749#endif
9750); /*proto*/
9751PyDoc_STRVAR(__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 ");
9752static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {"evaluateScalarMaterialFunctionOverElements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
9753static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self,
9754#if CYTHON_VECTORCALL
9755PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
9756#else
9757PyObject *__pyx_args, PyObject *__pyx_kwds
9758#endif
9759) {
9760 double __pyx_v_t;
9761 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
9762 PyArrayObject *__pyx_v_x = 0;
9763 PyArrayObject *__pyx_v_q_vals = 0;
9764 PyObject *__pyx_v_material_functions = 0;
9765 #if !CYTHON_VECTORCALL
9766 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
9767 #endif
9768 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9769 PyObject* values[5] = {0,0,0,0,0};
9770 int __pyx_lineno = 0;
9771 const char *__pyx_filename = NULL;
9772 int __pyx_clineno = 0;
9773 PyObject *__pyx_r = 0;
9774 __Pyx_RefNannyDeclarations
9775 __Pyx_RefNannySetupContext("evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
9776 #if !CYTHON_VECTORCALL
9777 #if CYTHON_ASSUME_SAFE_SIZE
9778 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
9779 #else
9780 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
9781 #endif
9782 #endif
9783 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
9784 {
9785 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_q_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
9786 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
9787 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
9788 if (__pyx_kwds_len > 0) {
9789 switch (__pyx_nargs) {
9790 case 5:
9791 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
9792 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 166, __pyx_L3_error)
9793 CYTHON_FALLTHROUGH;
9794 case 4:
9795 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
9796 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
9797 CYTHON_FALLTHROUGH;
9798 case 3:
9799 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
9800 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
9801 CYTHON_FALLTHROUGH;
9802 case 2:
9803 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
9804 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
9805 CYTHON_FALLTHROUGH;
9806 case 1:
9807 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
9808 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
9809 CYTHON_FALLTHROUGH;
9810 case 0: break;
9811 default: goto __pyx_L5_argtuple_error;
9812 }
9813 const Py_ssize_t kwd_pos_args = __pyx_nargs;
9814 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "evaluateScalarMaterialFunctionOverElements", 0) < (0)) __PYX_ERR(0, 166, __pyx_L3_error)
9815 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
9816 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("evaluateScalarMaterialFunctionOverElements", 1, 5, 5, i); __PYX_ERR(0, 166, __pyx_L3_error) }
9817 }
9818 } else if (unlikely(__pyx_nargs != 5)) {
9819 goto __pyx_L5_argtuple_error;
9820 } else {
9821 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
9822 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
9823 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
9824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
9825 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
9826 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
9827 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
9828 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
9829 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
9830 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 166, __pyx_L3_error)
9831 }
9832 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
9833 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
9834 __pyx_v_x = ((PyArrayObject *)values[2]);
9835 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
9836 __pyx_v_material_functions = ((PyObject*)values[4]);
9837 }
9838 goto __pyx_L6_skip;
9839 __pyx_L5_argtuple_error:;
9840 __Pyx_RaiseArgtupleInvalid("evaluateScalarMaterialFunctionOverElements", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
9841 __pyx_L6_skip:;
9842 goto __pyx_L4_argument_unpacking_done;
9843 __pyx_L3_error:;
9844 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9845 Py_XDECREF(values[__pyx_temp]);
9846 }
9847 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
9848 __Pyx_RefNannyFinishContext();
9849 return NULL;
9850 __pyx_L4_argument_unpacking_done:;
9851 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
9852 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
9853 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_vals", 0))) __PYX_ERR(0, 169, __pyx_L1_error)
9854 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 170, __pyx_L1_error)
9855 __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);
9856
9857 /* function exit code */
9858 goto __pyx_L0;
9859 __pyx_L1_error:;
9860 __pyx_r = NULL;
9861 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9862 Py_XDECREF(values[__pyx_temp]);
9863 }
9864 goto __pyx_L7_cleaned_up;
9865 __pyx_L0:;
9866 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9867 Py_XDECREF(values[__pyx_temp]);
9868 }
9869 __pyx_L7_cleaned_up:;
9870
9871 __Pyx_RefNannyFinishContext();
9872 return __pyx_r;
9873}
9874
9875static 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) {
9876 int __pyx_v_eN;
9877 int __pyx_v_k;
9878 int __pyx_v_material;
9879 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
9880 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
9881 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
9882 __Pyx_Buffer __pyx_pybuffer_q_vals;
9883 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
9884 __Pyx_Buffer __pyx_pybuffer_x;
9885 PyObject *__pyx_r = NULL;
9886 __Pyx_RefNannyDeclarations
9887 npy_intp __pyx_t_1;
9888 npy_intp __pyx_t_2;
9889 int __pyx_t_3;
9890 Py_ssize_t __pyx_t_4;
9891 int __pyx_t_5;
9892 npy_intp __pyx_t_6;
9893 npy_intp __pyx_t_7;
9894 PyObject *__pyx_t_8 = NULL;
9895 PyObject *__pyx_t_9 = NULL;
9896 PyObject *__pyx_t_10 = NULL;
9897 PyObject *__pyx_t_11 = NULL;
9898 PyObject *__pyx_t_12 = NULL;
9899 PyObject *__pyx_t_13 = NULL;
9900 size_t __pyx_t_14;
9901 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
9902 Py_ssize_t __pyx_t_16;
9903 int __pyx_t_17;
9904 int __pyx_lineno = 0;
9905 const char *__pyx_filename = NULL;
9906 int __pyx_clineno = 0;
9907 __Pyx_RefNannySetupContext("evaluateScalarMaterialFunctionOverElements", 0);
9908 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
9909 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
9910 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
9911 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
9912 __pyx_pybuffer_x.pybuffer.buf = NULL;
9913 __pyx_pybuffer_x.refcount = 0;
9914 __pyx_pybuffernd_x.data = NULL;
9915 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
9916 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
9917 __pyx_pybuffer_q_vals.refcount = 0;
9918 __pyx_pybuffernd_q_vals.data = NULL;
9919 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
9920 {
9921 __Pyx_BufFmt_StackElem __pyx_stack[1];
9922 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, 166, __pyx_L1_error)
9923 }
9924 __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];
9925 {
9926 __Pyx_BufFmt_StackElem __pyx_stack[1];
9927 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, 166, __pyx_L1_error)
9928 }
9929 __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];
9930 {
9931 __Pyx_BufFmt_StackElem __pyx_stack[1];
9932 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, 166, __pyx_L1_error)
9933 }
9934 __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];
9935
9936 /* "subsurfaceTransportFunctions.pyx":176
9937 * """
9938 * cdef int eN,k,material
9939 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
9940 * material = elementMaterialTypes[eN]
9941 * for k in range(x.shape[1]):
9942*/
9943
9944 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
9945 __pyx_t_2 = __pyx_t_1;
9946
9947 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
9948 __pyx_v_eN = __pyx_t_3;
9949
9950 /* "subsurfaceTransportFunctions.pyx":177
9951 * cdef int eN,k,material
9952 * for eN in range(x.shape[0]):
9953 * material = elementMaterialTypes[eN] # <<<<<<<<<<<<<<
9954 * for k in range(x.shape[1]):
9955 * q_vals[eN,k] = material_functions[material](x[eN,k],t)
9956*/
9957 __pyx_t_4 = __pyx_v_eN;
9958 __pyx_t_5 = -1;
9959 if (__pyx_t_4 < 0) {
9960 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9961 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
9962 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
9963 if (unlikely(__pyx_t_5 != -1)) {
9964 __Pyx_RaiseBufferIndexError(__pyx_t_5);
9965 __PYX_ERR(0, 177, __pyx_L1_error)
9966 }
9967 __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));
9968
9969 /* "subsurfaceTransportFunctions.pyx":178
9970 * for eN in range(x.shape[0]):
9971 * material = elementMaterialTypes[eN]
9972 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
9973 * q_vals[eN,k] = material_functions[material](x[eN,k],t)
9974 *
9975*/
9976
9977 __pyx_t_6 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
9978 __pyx_t_7 = __pyx_t_6;
9979
9980 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
9981 __pyx_v_k = __pyx_t_5;
9982
9983 /* "subsurfaceTransportFunctions.pyx":179
9984 * material = elementMaterialTypes[eN]
9985 * for k in range(x.shape[1]):
9986 * q_vals[eN,k] = material_functions[material](x[eN,k],t) # <<<<<<<<<<<<<<
9987 *
9988 * def evaluateVectorMaterialFunctionOverElements(double t,
9989*/
9990 __pyx_t_9 = NULL;
9991 if (unlikely(__pyx_v_material_functions == Py_None)) {
9992 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
9993 __PYX_ERR(0, 179, __pyx_L1_error)
9994 }
9995 __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_material); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error)
9996 __Pyx_GOTREF(__pyx_t_10);
9997 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error)
9998 __Pyx_GOTREF(__pyx_t_11);
9999 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10000 __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error)
10001 __Pyx_GOTREF(__pyx_t_10);
10002 __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 179, __pyx_L1_error)
10003 __Pyx_GOTREF(__pyx_t_12);
10004 __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 179, __pyx_L1_error)
10005 __Pyx_GOTREF(__pyx_t_13);
10006 __Pyx_GIVEREF(__pyx_t_10);
10007 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 179, __pyx_L1_error);
10008 __Pyx_GIVEREF(__pyx_t_12);
10009 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 179, __pyx_L1_error);
10010 __pyx_t_10 = 0;
10011 __pyx_t_12 = 0;
10012 __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 179, __pyx_L1_error)
10013 __Pyx_GOTREF(__pyx_t_12);
10014 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10015 __pyx_t_13 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 179, __pyx_L1_error)
10016 __Pyx_GOTREF(__pyx_t_13);
10017 __pyx_t_14 = 1;
10018 #if CYTHON_UNPACK_METHODS
10019 if (unlikely(PyMethod_Check(__pyx_t_11))) {
10020 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
10021 assert(__pyx_t_9);
10022 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
10023 __Pyx_INCREF(__pyx_t_9);
10024 __Pyx_INCREF(__pyx__function);
10025 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
10026 __pyx_t_14 = 0;
10027 }
10028 #endif
10029 {
10030 PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_12, __pyx_t_13};
10031 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10032 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10033 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10034 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10035 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
10036 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 179, __pyx_L1_error)
10037 __Pyx_GOTREF(__pyx_t_8);
10038 }
10039 __pyx_t_15 = __Pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
10040 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10041 __pyx_t_4 = __pyx_v_eN;
10042 __pyx_t_16 = __pyx_v_k;
10043 __pyx_t_17 = -1;
10044 if (__pyx_t_4 < 0) {
10045 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
10046 if (unlikely(__pyx_t_4 < 0)) __pyx_t_17 = 0;
10047 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_17 = 0;
10048 if (__pyx_t_16 < 0) {
10049 __pyx_t_16 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
10050 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
10051 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_17 = 1;
10052 if (unlikely(__pyx_t_17 != -1)) {
10053 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10054 __PYX_ERR(0, 179, __pyx_L1_error)
10055 }
10056 *__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;
10057
10058 }
10059
10060 }
10061
10062
10063 /* "subsurfaceTransportFunctions.pyx":166
10064 *
10065 * ###
10066 * def evaluateScalarMaterialFunctionOverElements(double t, # <<<<<<<<<<<<<<
10067 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
10068 * numpy.ndarray[DTYPE_t,ndim=3] x,
10069*/
10070
10071 /* function exit code */
10072 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10073 goto __pyx_L0;
10074 __pyx_L1_error:;
10075 __Pyx_XDECREF(__pyx_t_8);
10076 __Pyx_XDECREF(__pyx_t_9);
10077 __Pyx_XDECREF(__pyx_t_10);
10078 __Pyx_XDECREF(__pyx_t_11);
10079 __Pyx_XDECREF(__pyx_t_12);
10080 __Pyx_XDECREF(__pyx_t_13);
10081 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
10082 __Pyx_PyThreadState_declare
10083 __Pyx_PyThreadState_assign
10084 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
10085 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
10086 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
10087 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
10088 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
10089 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
10090 __pyx_r = NULL;
10091 goto __pyx_L2;
10092 __pyx_L0:;
10093 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
10094 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
10095 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
10096 __pyx_L2:;
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106 __Pyx_XGIVEREF(__pyx_r);
10107 __Pyx_RefNannyFinishContext();
10108 return __pyx_r;
10109}
10110
10111/* "subsurfaceTransportFunctions.pyx":181
10112 * q_vals[eN,k] = material_functions[material](x[eN,k],t)
10113 *
10114 * def evaluateVectorMaterialFunctionOverElements(double t, # <<<<<<<<<<<<<<
10115 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
10116 * numpy.ndarray[DTYPE_t,ndim=3] x,
10117*/
10118
10119/* Python wrapper */
10120static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self,
10121#if CYTHON_VECTORCALL
10122PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
10123#else
10124PyObject *__pyx_args, PyObject *__pyx_kwds
10125#endif
10126); /*proto*/
10127PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements, "\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ");
10128static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {"evaluateVectorMaterialFunctionOverElements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
10129static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self,
10130#if CYTHON_VECTORCALL
10131PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
10132#else
10133PyObject *__pyx_args, PyObject *__pyx_kwds
10134#endif
10135) {
10136 double __pyx_v_t;
10137 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
10138 PyArrayObject *__pyx_v_x = 0;
10139 PyArrayObject *__pyx_v_q_vals = 0;
10140 PyObject *__pyx_v_material_functions = 0;
10141 #if !CYTHON_VECTORCALL
10142 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
10143 #endif
10144 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10145 PyObject* values[5] = {0,0,0,0,0};
10146 int __pyx_lineno = 0;
10147 const char *__pyx_filename = NULL;
10148 int __pyx_clineno = 0;
10149 PyObject *__pyx_r = 0;
10150 __Pyx_RefNannyDeclarations
10151 __Pyx_RefNannySetupContext("evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
10152 #if !CYTHON_VECTORCALL
10153 #if CYTHON_ASSUME_SAFE_SIZE
10154 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
10155 #else
10156 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
10157 #endif
10158 #endif
10159 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
10160 {
10161 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_q_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
10162 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
10163 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 181, __pyx_L3_error)
10164 if (__pyx_kwds_len > 0) {
10165 switch (__pyx_nargs) {
10166 case 5:
10167 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
10168 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 181, __pyx_L3_error)
10169 CYTHON_FALLTHROUGH;
10170 case 4:
10171 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
10172 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 181, __pyx_L3_error)
10173 CYTHON_FALLTHROUGH;
10174 case 3:
10175 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
10176 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 181, __pyx_L3_error)
10177 CYTHON_FALLTHROUGH;
10178 case 2:
10179 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
10180 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 181, __pyx_L3_error)
10181 CYTHON_FALLTHROUGH;
10182 case 1:
10183 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
10184 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 181, __pyx_L3_error)
10185 CYTHON_FALLTHROUGH;
10186 case 0: break;
10187 default: goto __pyx_L5_argtuple_error;
10188 }
10189 const Py_ssize_t kwd_pos_args = __pyx_nargs;
10190 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "evaluateVectorMaterialFunctionOverElements", 0) < (0)) __PYX_ERR(0, 181, __pyx_L3_error)
10191 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
10192 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("evaluateVectorMaterialFunctionOverElements", 1, 5, 5, i); __PYX_ERR(0, 181, __pyx_L3_error) }
10193 }
10194 } else if (unlikely(__pyx_nargs != 5)) {
10195 goto __pyx_L5_argtuple_error;
10196 } else {
10197 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
10198 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 181, __pyx_L3_error)
10199 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
10200 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 181, __pyx_L3_error)
10201 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
10202 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 181, __pyx_L3_error)
10203 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
10204 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 181, __pyx_L3_error)
10205 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
10206 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 181, __pyx_L3_error)
10207 }
10208 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
10209 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
10210 __pyx_v_x = ((PyArrayObject *)values[2]);
10211 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
10212 __pyx_v_material_functions = ((PyObject*)values[4]);
10213 }
10214 goto __pyx_L6_skip;
10215 __pyx_L5_argtuple_error:;
10216 __Pyx_RaiseArgtupleInvalid("evaluateVectorMaterialFunctionOverElements", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 181, __pyx_L3_error)
10217 __pyx_L6_skip:;
10218 goto __pyx_L4_argument_unpacking_done;
10219 __pyx_L3_error:;
10220 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
10221 Py_XDECREF(values[__pyx_temp]);
10222 }
10223 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
10224 __Pyx_RefNannyFinishContext();
10225 return NULL;
10226 __pyx_L4_argument_unpacking_done:;
10227 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
10228 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
10229 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_vals", 0))) __PYX_ERR(0, 184, __pyx_L1_error)
10230 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 185, __pyx_L1_error)
10231 __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);
10232
10233 /* function exit code */
10234 goto __pyx_L0;
10235 __pyx_L1_error:;
10236 __pyx_r = NULL;
10237 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
10238 Py_XDECREF(values[__pyx_temp]);
10239 }
10240 goto __pyx_L7_cleaned_up;
10241 __pyx_L0:;
10242 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
10243 Py_XDECREF(values[__pyx_temp]);
10244 }
10245 __pyx_L7_cleaned_up:;
10246
10247 __Pyx_RefNannyFinishContext();
10248 return __pyx_r;
10249}
10250
10251static 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) {
10252 int __pyx_v_eN;
10253 int __pyx_v_k;
10254 int __pyx_v_material;
10255 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
10256 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
10257 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
10258 __Pyx_Buffer __pyx_pybuffer_q_vals;
10259 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
10260 __Pyx_Buffer __pyx_pybuffer_x;
10261 PyObject *__pyx_r = NULL;
10262 __Pyx_RefNannyDeclarations
10263 npy_intp __pyx_t_1;
10264 npy_intp __pyx_t_2;
10265 int __pyx_t_3;
10266 Py_ssize_t __pyx_t_4;
10267 int __pyx_t_5;
10268 npy_intp __pyx_t_6;
10269 npy_intp __pyx_t_7;
10270 PyObject *__pyx_t_8 = NULL;
10271 PyObject *__pyx_t_9 = NULL;
10272 PyObject *__pyx_t_10 = NULL;
10273 PyObject *__pyx_t_11 = NULL;
10274 PyObject *__pyx_t_12 = NULL;
10275 PyObject *__pyx_t_13 = NULL;
10276 size_t __pyx_t_14;
10277 int __pyx_lineno = 0;
10278 const char *__pyx_filename = NULL;
10279 int __pyx_clineno = 0;
10280 __Pyx_RefNannySetupContext("evaluateVectorMaterialFunctionOverElements", 0);
10281 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
10282 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
10283 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
10284 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
10285 __pyx_pybuffer_x.pybuffer.buf = NULL;
10286 __pyx_pybuffer_x.refcount = 0;
10287 __pyx_pybuffernd_x.data = NULL;
10288 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
10289 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
10290 __pyx_pybuffer_q_vals.refcount = 0;
10291 __pyx_pybuffernd_q_vals.data = NULL;
10292 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
10293 {
10294 __Pyx_BufFmt_StackElem __pyx_stack[1];
10295 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, 181, __pyx_L1_error)
10296 }
10297 __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];
10298 {
10299 __Pyx_BufFmt_StackElem __pyx_stack[1];
10300 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, 181, __pyx_L1_error)
10301 }
10302 __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];
10303 {
10304 __Pyx_BufFmt_StackElem __pyx_stack[1];
10305 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, 181, __pyx_L1_error)
10306 }
10307 __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];
10308
10309 /* "subsurfaceTransportFunctions.pyx":190
10310 * """
10311 * cdef int eN,k,material
10312 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
10313 * material = elementMaterialTypes[eN]
10314 * for k in range(x.shape[1]):
10315*/
10316
10317 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
10318 __pyx_t_2 = __pyx_t_1;
10319
10320 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
10321 __pyx_v_eN = __pyx_t_3;
10322
10323 /* "subsurfaceTransportFunctions.pyx":191
10324 * cdef int eN,k,material
10325 * for eN in range(x.shape[0]):
10326 * material = elementMaterialTypes[eN] # <<<<<<<<<<<<<<
10327 * for k in range(x.shape[1]):
10328 * q_vals[eN,k,:] = material_functions[material](x[eN,k],t).flat
10329*/
10330 __pyx_t_4 = __pyx_v_eN;
10331 __pyx_t_5 = -1;
10332 if (__pyx_t_4 < 0) {
10333 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
10334 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
10335 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
10336 if (unlikely(__pyx_t_5 != -1)) {
10337 __Pyx_RaiseBufferIndexError(__pyx_t_5);
10338 __PYX_ERR(0, 191, __pyx_L1_error)
10339 }
10340 __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));
10341
10342 /* "subsurfaceTransportFunctions.pyx":192
10343 * for eN in range(x.shape[0]):
10344 * material = elementMaterialTypes[eN]
10345 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
10346 * q_vals[eN,k,:] = material_functions[material](x[eN,k],t).flat
10347 *
10348*/
10349
10350 __pyx_t_6 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
10351 __pyx_t_7 = __pyx_t_6;
10352
10353 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
10354 __pyx_v_k = __pyx_t_5;
10355
10356 /* "subsurfaceTransportFunctions.pyx":193
10357 * material = elementMaterialTypes[eN]
10358 * for k in range(x.shape[1]):
10359 * q_vals[eN,k,:] = material_functions[material](x[eN,k],t).flat # <<<<<<<<<<<<<<
10360 *
10361 *
10362*/
10363 __pyx_t_9 = NULL;
10364 if (unlikely(__pyx_v_material_functions == Py_None)) {
10365 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
10366 __PYX_ERR(0, 193, __pyx_L1_error)
10367 }
10368 __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_material); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L1_error)
10369 __Pyx_GOTREF(__pyx_t_10);
10370 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 193, __pyx_L1_error)
10371 __Pyx_GOTREF(__pyx_t_11);
10372 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10373 __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L1_error)
10374 __Pyx_GOTREF(__pyx_t_10);
10375 __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 193, __pyx_L1_error)
10376 __Pyx_GOTREF(__pyx_t_12);
10377 __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 193, __pyx_L1_error)
10378 __Pyx_GOTREF(__pyx_t_13);
10379 __Pyx_GIVEREF(__pyx_t_10);
10380 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 193, __pyx_L1_error);
10381 __Pyx_GIVEREF(__pyx_t_12);
10382 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 193, __pyx_L1_error);
10383 __pyx_t_10 = 0;
10384 __pyx_t_12 = 0;
10385 __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 193, __pyx_L1_error)
10386 __Pyx_GOTREF(__pyx_t_12);
10387 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10388 __pyx_t_13 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 193, __pyx_L1_error)
10389 __Pyx_GOTREF(__pyx_t_13);
10390 __pyx_t_14 = 1;
10391 #if CYTHON_UNPACK_METHODS
10392 if (unlikely(PyMethod_Check(__pyx_t_11))) {
10393 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
10394 assert(__pyx_t_9);
10395 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
10396 __Pyx_INCREF(__pyx_t_9);
10397 __Pyx_INCREF(__pyx__function);
10398 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
10399 __pyx_t_14 = 0;
10400 }
10401 #endif
10402 {
10403 PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_12, __pyx_t_13};
10404 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10405 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10406 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10407 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10408 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
10409 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 193, __pyx_L1_error)
10410 __Pyx_GOTREF(__pyx_t_8);
10411 }
10412 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_flat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 193, __pyx_L1_error)
10413 __Pyx_GOTREF(__pyx_t_11);
10414 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10415 __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 193, __pyx_L1_error)
10416 __Pyx_GOTREF(__pyx_t_8);
10417 __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 193, __pyx_L1_error)
10418 __Pyx_GOTREF(__pyx_t_13);
10419 __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 193, __pyx_L1_error)
10420 __Pyx_GOTREF(__pyx_t_12);
10421 __Pyx_GIVEREF(__pyx_t_8);
10422 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 193, __pyx_L1_error);
10423 __Pyx_GIVEREF(__pyx_t_13);
10424 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 193, __pyx_L1_error);
10425 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
10426 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
10427 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 193, __pyx_L1_error);
10428 __pyx_t_8 = 0;
10429 __pyx_t_13 = 0;
10430 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_12, __pyx_t_11) < 0))) __PYX_ERR(0, 193, __pyx_L1_error)
10431 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10432 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
10433 }
10434
10435 }
10436
10437
10438 /* "subsurfaceTransportFunctions.pyx":181
10439 * q_vals[eN,k] = material_functions[material](x[eN,k],t)
10440 *
10441 * def evaluateVectorMaterialFunctionOverElements(double t, # <<<<<<<<<<<<<<
10442 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
10443 * numpy.ndarray[DTYPE_t,ndim=3] x,
10444*/
10445
10446 /* function exit code */
10447 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10448 goto __pyx_L0;
10449 __pyx_L1_error:;
10450 __Pyx_XDECREF(__pyx_t_8);
10451 __Pyx_XDECREF(__pyx_t_9);
10452 __Pyx_XDECREF(__pyx_t_10);
10453 __Pyx_XDECREF(__pyx_t_11);
10454 __Pyx_XDECREF(__pyx_t_12);
10455 __Pyx_XDECREF(__pyx_t_13);
10456 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
10457 __Pyx_PyThreadState_declare
10458 __Pyx_PyThreadState_assign
10459 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
10460 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
10461 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
10462 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
10463 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
10464 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
10465 __pyx_r = NULL;
10466 goto __pyx_L2;
10467 __pyx_L0:;
10468 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
10469 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
10470 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
10471 __pyx_L2:;
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481 __Pyx_XGIVEREF(__pyx_r);
10482 __Pyx_RefNannyFinishContext();
10483 return __pyx_r;
10484}
10485
10486/* "subsurfaceTransportFunctions.pyx":196
10487 *
10488 *
10489 * def evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(double t, # <<<<<<<<<<<<<<
10490 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
10491 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
10492*/
10493
10494/* Python wrapper */
10495static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
10496#if CYTHON_VECTORCALL
10497PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
10498#else
10499PyObject *__pyx_args, PyObject *__pyx_kwds
10500#endif
10501); /*proto*/
10502PyDoc_STRVAR(__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 ");
10503static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
10504static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
10505#if CYTHON_VECTORCALL
10506PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
10507#else
10508PyObject *__pyx_args, PyObject *__pyx_kwds
10509#endif
10510) {
10511 double __pyx_v_t;
10512 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
10513 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
10514 PyArrayObject *__pyx_v_x = 0;
10515 PyArrayObject *__pyx_v_ebq_vals = 0;
10516 PyObject *__pyx_v_material_functions = 0;
10517 #if !CYTHON_VECTORCALL
10518 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
10519 #endif
10520 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10521 PyObject* values[6] = {0,0,0,0,0,0};
10522 int __pyx_lineno = 0;
10523 const char *__pyx_filename = NULL;
10524 int __pyx_clineno = 0;
10525 PyObject *__pyx_r = 0;
10526 __Pyx_RefNannyDeclarations
10527 __Pyx_RefNannySetupContext("evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
10528 #if !CYTHON_VECTORCALL
10529 #if CYTHON_ASSUME_SAFE_SIZE
10530 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
10531 #else
10532 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
10533 #endif
10534 #endif
10535 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
10536 {
10537 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_ebq_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
10538 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
10539 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 196, __pyx_L3_error)
10540 if (__pyx_kwds_len > 0) {
10541 switch (__pyx_nargs) {
10542 case 6:
10543 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
10544 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 196, __pyx_L3_error)
10545 CYTHON_FALLTHROUGH;
10546 case 5:
10547 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
10548 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 196, __pyx_L3_error)
10549 CYTHON_FALLTHROUGH;
10550 case 4:
10551 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
10552 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 196, __pyx_L3_error)
10553 CYTHON_FALLTHROUGH;
10554 case 3:
10555 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
10556 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 196, __pyx_L3_error)
10557 CYTHON_FALLTHROUGH;
10558 case 2:
10559 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
10560 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 196, __pyx_L3_error)
10561 CYTHON_FALLTHROUGH;
10562 case 1:
10563 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
10564 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 196, __pyx_L3_error)
10565 CYTHON_FALLTHROUGH;
10566 case 0: break;
10567 default: goto __pyx_L5_argtuple_error;
10568 }
10569 const Py_ssize_t kwd_pos_args = __pyx_nargs;
10570 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0) < (0)) __PYX_ERR(0, 196, __pyx_L3_error)
10571 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
10572 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, i); __PYX_ERR(0, 196, __pyx_L3_error) }
10573 }
10574 } else if (unlikely(__pyx_nargs != 6)) {
10575 goto __pyx_L5_argtuple_error;
10576 } else {
10577 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
10578 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 196, __pyx_L3_error)
10579 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
10580 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 196, __pyx_L3_error)
10581 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
10582 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 196, __pyx_L3_error)
10583 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
10584 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 196, __pyx_L3_error)
10585 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
10586 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 196, __pyx_L3_error)
10587 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
10588 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 196, __pyx_L3_error)
10589 }
10590 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L3_error)
10591 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
10592 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
10593 __pyx_v_x = ((PyArrayObject *)values[3]);
10594 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
10595 __pyx_v_material_functions = ((PyObject*)values[5]);
10596 }
10597 goto __pyx_L6_skip;
10598 __pyx_L5_argtuple_error:;
10599 __Pyx_RaiseArgtupleInvalid("evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 196, __pyx_L3_error)
10600 __pyx_L6_skip:;
10601 goto __pyx_L4_argument_unpacking_done;
10602 __pyx_L3_error:;
10603 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
10604 Py_XDECREF(values[__pyx_temp]);
10605 }
10606 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
10607 __Pyx_RefNannyFinishContext();
10608 return NULL;
10609 __pyx_L4_argument_unpacking_done:;
10610 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
10611 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
10612 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
10613 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_vals", 0))) __PYX_ERR(0, 200, __pyx_L1_error)
10614 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 201, __pyx_L1_error)
10615 __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);
10616
10617 /* function exit code */
10618 goto __pyx_L0;
10619 __pyx_L1_error:;
10620 __pyx_r = NULL;
10621 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
10622 Py_XDECREF(values[__pyx_temp]);
10623 }
10624 goto __pyx_L7_cleaned_up;
10625 __pyx_L0:;
10626 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
10627 Py_XDECREF(values[__pyx_temp]);
10628 }
10629 __pyx_L7_cleaned_up:;
10630
10631 __Pyx_RefNannyFinishContext();
10632 return __pyx_r;
10633}
10634
10635static 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) {
10636 int __pyx_v_eN;
10637 int __pyx_v_ebN;
10638 int __pyx_v_ebN_local;
10639 int __pyx_v_k;
10640 int __pyx_v_material_left;
10641 int __pyx_v_material_right;
10642 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
10643 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
10644 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
10645 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
10646 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
10647 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
10648 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
10649 __Pyx_Buffer __pyx_pybuffer_x;
10650 PyObject *__pyx_r = NULL;
10651 __Pyx_RefNannyDeclarations
10652 npy_intp __pyx_t_1;
10653 npy_intp __pyx_t_2;
10654 int __pyx_t_3;
10655 npy_intp __pyx_t_4;
10656 npy_intp __pyx_t_5;
10657 int __pyx_t_6;
10658 Py_ssize_t __pyx_t_7;
10659 Py_ssize_t __pyx_t_8;
10660 int __pyx_t_9;
10661 npy_intp __pyx_t_10;
10662 npy_intp __pyx_t_11;
10663 PyObject *__pyx_t_12 = NULL;
10664 PyObject *__pyx_t_13 = NULL;
10665 PyObject *__pyx_t_14 = NULL;
10666 PyObject *__pyx_t_15 = NULL;
10667 PyObject *__pyx_t_16 = NULL;
10668 PyObject *__pyx_t_17 = NULL;
10669 PyObject *__pyx_t_18 = NULL;
10670 size_t __pyx_t_19;
10671 PyObject *__pyx_t_20 = NULL;
10672 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_21;
10673 Py_ssize_t __pyx_t_22;
10674 int __pyx_t_23;
10675 int __pyx_lineno = 0;
10676 const char *__pyx_filename = NULL;
10677 int __pyx_clineno = 0;
10678 __Pyx_RefNannySetupContext("evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
10679 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
10680 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
10681 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
10682 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
10683 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
10684 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
10685 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
10686 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
10687 __pyx_pybuffer_x.pybuffer.buf = NULL;
10688 __pyx_pybuffer_x.refcount = 0;
10689 __pyx_pybuffernd_x.data = NULL;
10690 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
10691 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
10692 __pyx_pybuffer_ebq_vals.refcount = 0;
10693 __pyx_pybuffernd_ebq_vals.data = NULL;
10694 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
10695 {
10696 __Pyx_BufFmt_StackElem __pyx_stack[1];
10697 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, 196, __pyx_L1_error)
10698 }
10699 __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];
10700 {
10701 __Pyx_BufFmt_StackElem __pyx_stack[1];
10702 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, 196, __pyx_L1_error)
10703 }
10704 __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];
10705 {
10706 __Pyx_BufFmt_StackElem __pyx_stack[1];
10707 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, 196, __pyx_L1_error)
10708 }
10709 __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];
10710 {
10711 __Pyx_BufFmt_StackElem __pyx_stack[1];
10712 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, 196, __pyx_L1_error)
10713 }
10714 __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];
10715
10716 /* "subsurfaceTransportFunctions.pyx":211
10717 * cdef int eN,ebN,ebN_local,k,material_left,material_right
10718 *
10719 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
10720 * for ebN_local in range(x.shape[1]):
10721 * ebN = elementBoundariesArray[eN,ebN_local]
10722*/
10723
10724 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
10725 __pyx_t_2 = __pyx_t_1;
10726
10727 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
10728 __pyx_v_eN = __pyx_t_3;
10729
10730 /* "subsurfaceTransportFunctions.pyx":212
10731 *
10732 * for eN in range(x.shape[0]):
10733 * for ebN_local in range(x.shape[1]): # <<<<<<<<<<<<<<
10734 * ebN = elementBoundariesArray[eN,ebN_local]
10735 * material_left = elementBoundaryTypes[ebN,0]
10736*/
10737
10738 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
10739 __pyx_t_5 = __pyx_t_4;
10740
10741 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
10742 __pyx_v_ebN_local = __pyx_t_6;
10743
10744 /* "subsurfaceTransportFunctions.pyx":213
10745 * for eN in range(x.shape[0]):
10746 * for ebN_local in range(x.shape[1]):
10747 * ebN = elementBoundariesArray[eN,ebN_local] # <<<<<<<<<<<<<<
10748 * material_left = elementBoundaryTypes[ebN,0]
10749 * material_right= elementBoundaryTypes[ebN,1]
10750*/
10751 __pyx_t_7 = __pyx_v_eN;
10752 __pyx_t_8 = __pyx_v_ebN_local;
10753 __pyx_t_9 = -1;
10754 if (__pyx_t_7 < 0) {
10755 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
10756 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
10757 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
10758 if (__pyx_t_8 < 0) {
10759 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
10760 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
10761 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
10762 if (unlikely(__pyx_t_9 != -1)) {
10763 __Pyx_RaiseBufferIndexError(__pyx_t_9);
10764 __PYX_ERR(0, 213, __pyx_L1_error)
10765 }
10766 __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));
10767
10768 /* "subsurfaceTransportFunctions.pyx":214
10769 * for ebN_local in range(x.shape[1]):
10770 * ebN = elementBoundariesArray[eN,ebN_local]
10771 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
10772 * material_right= elementBoundaryTypes[ebN,1]
10773 * for k in range(x.shape[2]):
10774*/
10775 __pyx_t_8 = __pyx_v_ebN;
10776 __pyx_t_7 = 0;
10777 __pyx_t_9 = -1;
10778 if (__pyx_t_8 < 0) {
10779 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
10780 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
10781 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
10782 if (__pyx_t_7 < 0) {
10783 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
10784 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
10785 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
10786 if (unlikely(__pyx_t_9 != -1)) {
10787 __Pyx_RaiseBufferIndexError(__pyx_t_9);
10788 __PYX_ERR(0, 214, __pyx_L1_error)
10789 }
10790 __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));
10791
10792 /* "subsurfaceTransportFunctions.pyx":215
10793 * ebN = elementBoundariesArray[eN,ebN_local]
10794 * material_left = elementBoundaryTypes[ebN,0]
10795 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
10796 * for k in range(x.shape[2]):
10797 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left](x[eN,ebN_local,k],t)+
10798*/
10799 __pyx_t_7 = __pyx_v_ebN;
10800 __pyx_t_8 = 1;
10801 __pyx_t_9 = -1;
10802 if (__pyx_t_7 < 0) {
10803 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
10804 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
10805 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
10806 if (__pyx_t_8 < 0) {
10807 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
10808 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
10809 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
10810 if (unlikely(__pyx_t_9 != -1)) {
10811 __Pyx_RaiseBufferIndexError(__pyx_t_9);
10812 __PYX_ERR(0, 215, __pyx_L1_error)
10813 }
10814 __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));
10815
10816 /* "subsurfaceTransportFunctions.pyx":216
10817 * material_left = elementBoundaryTypes[ebN,0]
10818 * material_right= elementBoundaryTypes[ebN,1]
10819 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
10820 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left](x[eN,ebN_local,k],t)+
10821 * material_functions[material_right](x[eN,ebN_local,k],t))
10822*/
10823
10824 __pyx_t_10 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
10825 __pyx_t_11 = __pyx_t_10;
10826
10827 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
10828 __pyx_v_k = __pyx_t_9;
10829
10830 /* "subsurfaceTransportFunctions.pyx":217
10831 * material_right= elementBoundaryTypes[ebN,1]
10832 * for k in range(x.shape[2]):
10833 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left](x[eN,ebN_local,k],t)+ # <<<<<<<<<<<<<<
10834 * material_functions[material_right](x[eN,ebN_local,k],t))
10835 *
10836*/
10837 __pyx_t_13 = NULL;
10838 if (unlikely(__pyx_v_material_functions == Py_None)) {
10839 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
10840 __PYX_ERR(0, 217, __pyx_L1_error)
10841 }
10842 __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
10843 __Pyx_GOTREF(__pyx_t_14);
10844 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
10845 __Pyx_GOTREF(__pyx_t_15);
10846 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10847 __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
10848 __Pyx_GOTREF(__pyx_t_14);
10849 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_ebN_local); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
10850 __Pyx_GOTREF(__pyx_t_16);
10851 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
10852 __Pyx_GOTREF(__pyx_t_17);
10853 __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
10854 __Pyx_GOTREF(__pyx_t_18);
10855 __Pyx_GIVEREF(__pyx_t_14);
10856 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_14) != (0)) __PYX_ERR(0, 217, __pyx_L1_error);
10857 __Pyx_GIVEREF(__pyx_t_16);
10858 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 217, __pyx_L1_error);
10859 __Pyx_GIVEREF(__pyx_t_17);
10860 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_17) != (0)) __PYX_ERR(0, 217, __pyx_L1_error);
10861 __pyx_t_14 = 0;
10862 __pyx_t_16 = 0;
10863 __pyx_t_17 = 0;
10864 __pyx_t_17 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
10865 __Pyx_GOTREF(__pyx_t_17);
10866 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
10867 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
10868 __Pyx_GOTREF(__pyx_t_18);
10869 __pyx_t_19 = 1;
10870 #if CYTHON_UNPACK_METHODS
10871 if (unlikely(PyMethod_Check(__pyx_t_15))) {
10872 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
10873 assert(__pyx_t_13);
10874 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
10875 __Pyx_INCREF(__pyx_t_13);
10876 __Pyx_INCREF(__pyx__function);
10877 __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
10878 __pyx_t_19 = 0;
10879 }
10880 #endif
10881 {
10882 PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_17, __pyx_t_18};
10883 __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_19, (3-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10884 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
10885 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10886 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
10887 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10888 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 217, __pyx_L1_error)
10889 __Pyx_GOTREF(__pyx_t_12);
10890 }
10891
10892 /* "subsurfaceTransportFunctions.pyx":218
10893 * for k in range(x.shape[2]):
10894 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left](x[eN,ebN_local,k],t)+
10895 * material_functions[material_right](x[eN,ebN_local,k],t)) # <<<<<<<<<<<<<<
10896 *
10897 * def evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd,
10898*/
10899 __pyx_t_18 = NULL;
10900 if (unlikely(__pyx_v_material_functions == Py_None)) {
10901 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
10902 __PYX_ERR(0, 218, __pyx_L1_error)
10903 }
10904 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 218, __pyx_L1_error)
10905 __Pyx_GOTREF(__pyx_t_17);
10906 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 218, __pyx_L1_error)
10907 __Pyx_GOTREF(__pyx_t_13);
10908 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10909 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 218, __pyx_L1_error)
10910 __Pyx_GOTREF(__pyx_t_17);
10911 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_ebN_local); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 218, __pyx_L1_error)
10912 __Pyx_GOTREF(__pyx_t_16);
10913 __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 218, __pyx_L1_error)
10914 __Pyx_GOTREF(__pyx_t_14);
10915 __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 218, __pyx_L1_error)
10916 __Pyx_GOTREF(__pyx_t_20);
10917 __Pyx_GIVEREF(__pyx_t_17);
10918 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17) != (0)) __PYX_ERR(0, 218, __pyx_L1_error);
10919 __Pyx_GIVEREF(__pyx_t_16);
10920 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 218, __pyx_L1_error);
10921 __Pyx_GIVEREF(__pyx_t_14);
10922 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_14) != (0)) __PYX_ERR(0, 218, __pyx_L1_error);
10923 __pyx_t_17 = 0;
10924 __pyx_t_16 = 0;
10925 __pyx_t_14 = 0;
10926 __pyx_t_14 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 218, __pyx_L1_error)
10927 __Pyx_GOTREF(__pyx_t_14);
10928 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
10929 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 218, __pyx_L1_error)
10930 __Pyx_GOTREF(__pyx_t_20);
10931 __pyx_t_19 = 1;
10932 #if CYTHON_UNPACK_METHODS
10933 if (unlikely(PyMethod_Check(__pyx_t_13))) {
10934 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_13);
10935 assert(__pyx_t_18);
10936 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
10937 __Pyx_INCREF(__pyx_t_18);
10938 __Pyx_INCREF(__pyx__function);
10939 __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
10940 __pyx_t_19 = 0;
10941 }
10942 #endif
10943 {
10944 PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_14, __pyx_t_20};
10945 __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_19, (3-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10946 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
10947 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
10948 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
10949 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10950 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 218, __pyx_L1_error)
10951 __Pyx_GOTREF(__pyx_t_15);
10952 }
10953
10954 /* "subsurfaceTransportFunctions.pyx":217
10955 * material_right= elementBoundaryTypes[ebN,1]
10956 * for k in range(x.shape[2]):
10957 * ebq_vals[eN,ebN_local,k] = 0.5*(material_functions[material_left](x[eN,ebN_local,k],t)+ # <<<<<<<<<<<<<<
10958 * material_functions[material_right](x[eN,ebN_local,k],t))
10959 *
10960*/
10961 __pyx_t_13 = __Pyx_PyNumber_Add_object_object(__pyx_t_12, __pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
10962 __Pyx_GOTREF(__pyx_t_13);
10963 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10964 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10965 __pyx_t_15 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_13); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
10966 __Pyx_GOTREF(__pyx_t_15);
10967 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10968 __pyx_t_21 = __Pyx_PyFloat_AsDouble(__pyx_t_15); if (unlikely((__pyx_t_21 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error)
10969 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10970 __pyx_t_8 = __pyx_v_eN;
10971 __pyx_t_7 = __pyx_v_ebN_local;
10972 __pyx_t_22 = __pyx_v_k;
10973 __pyx_t_23 = -1;
10974 if (__pyx_t_8 < 0) {
10975 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
10976 if (unlikely(__pyx_t_8 < 0)) __pyx_t_23 = 0;
10977 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_23 = 0;
10978 if (__pyx_t_7 < 0) {
10979 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
10980 if (unlikely(__pyx_t_7 < 0)) __pyx_t_23 = 1;
10981 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_23 = 1;
10982 if (__pyx_t_22 < 0) {
10983 __pyx_t_22 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
10984 if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 2;
10985 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_23 = 2;
10986 if (unlikely(__pyx_t_23 != -1)) {
10987 __Pyx_RaiseBufferIndexError(__pyx_t_23);
10988 __PYX_ERR(0, 217, __pyx_L1_error)
10989 }
10990 *__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_22, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_21;
10991
10992 }
10993
10994 }
10995
10996 }
10997
10998
10999 /* "subsurfaceTransportFunctions.pyx":196
11000 *
11001 *
11002 * def evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(double t, # <<<<<<<<<<<<<<
11003 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
11004 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
11005*/
11006
11007 /* function exit code */
11008 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11009 goto __pyx_L0;
11010 __pyx_L1_error:;
11011 __Pyx_XDECREF(__pyx_t_12);
11012 __Pyx_XDECREF(__pyx_t_13);
11013 __Pyx_XDECREF(__pyx_t_14);
11014 __Pyx_XDECREF(__pyx_t_15);
11015 __Pyx_XDECREF(__pyx_t_16);
11016 __Pyx_XDECREF(__pyx_t_17);
11017 __Pyx_XDECREF(__pyx_t_18);
11018 __Pyx_XDECREF(__pyx_t_20);
11019 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11020 __Pyx_PyThreadState_declare
11021 __Pyx_PyThreadState_assign
11022 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11023 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
11024 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
11025 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
11026 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
11027 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11028 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
11029 __pyx_r = NULL;
11030 goto __pyx_L2;
11031 __pyx_L0:;
11032 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
11033 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
11034 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
11035 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
11036 __pyx_L2:;
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051 __Pyx_XGIVEREF(__pyx_r);
11052 __Pyx_RefNannyFinishContext();
11053 return __pyx_r;
11054}
11055
11056/* "subsurfaceTransportFunctions.pyx":220
11057 * material_functions[material_right](x[eN,ebN_local,k],t))
11058 *
11059 * def evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
11060 * double t,
11061 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
11062*/
11063
11064/* Python wrapper */
11065static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self,
11066#if CYTHON_VECTORCALL
11067PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11068#else
11069PyObject *__pyx_args, PyObject *__pyx_kwds
11070#endif
11071); /*proto*/
11072PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, "\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ");
11073static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
11074static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self,
11075#if CYTHON_VECTORCALL
11076PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11077#else
11078PyObject *__pyx_args, PyObject *__pyx_kwds
11079#endif
11080) {
11081 int __pyx_v_nd;
11082 double __pyx_v_t;
11083 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
11084 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
11085 PyArrayObject *__pyx_v_x = 0;
11086 PyArrayObject *__pyx_v_ebq_vals = 0;
11087 PyObject *__pyx_v_material_functions = 0;
11088 #if !CYTHON_VECTORCALL
11089 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11090 #endif
11091 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11092 PyObject* values[7] = {0,0,0,0,0,0,0};
11093 int __pyx_lineno = 0;
11094 const char *__pyx_filename = NULL;
11095 int __pyx_clineno = 0;
11096 PyObject *__pyx_r = 0;
11097 __Pyx_RefNannyDeclarations
11098 __Pyx_RefNannySetupContext("evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
11099 #if !CYTHON_VECTORCALL
11100 #if CYTHON_ASSUME_SAFE_SIZE
11101 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11102 #else
11103 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11104 #endif
11105 #endif
11106 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11107 {
11108 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nd,&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_ebq_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
11109 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11110 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 220, __pyx_L3_error)
11111 if (__pyx_kwds_len > 0) {
11112 switch (__pyx_nargs) {
11113 case 7:
11114 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
11115 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 220, __pyx_L3_error)
11116 CYTHON_FALLTHROUGH;
11117 case 6:
11118 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
11119 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 220, __pyx_L3_error)
11120 CYTHON_FALLTHROUGH;
11121 case 5:
11122 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
11123 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 220, __pyx_L3_error)
11124 CYTHON_FALLTHROUGH;
11125 case 4:
11126 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
11127 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 220, __pyx_L3_error)
11128 CYTHON_FALLTHROUGH;
11129 case 3:
11130 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
11131 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 220, __pyx_L3_error)
11132 CYTHON_FALLTHROUGH;
11133 case 2:
11134 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
11135 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 220, __pyx_L3_error)
11136 CYTHON_FALLTHROUGH;
11137 case 1:
11138 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
11139 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 220, __pyx_L3_error)
11140 CYTHON_FALLTHROUGH;
11141 case 0: break;
11142 default: goto __pyx_L5_argtuple_error;
11143 }
11144 const Py_ssize_t kwd_pos_args = __pyx_nargs;
11145 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0) < (0)) __PYX_ERR(0, 220, __pyx_L3_error)
11146 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
11147 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, i); __PYX_ERR(0, 220, __pyx_L3_error) }
11148 }
11149 } else if (unlikely(__pyx_nargs != 7)) {
11150 goto __pyx_L5_argtuple_error;
11151 } else {
11152 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
11153 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 220, __pyx_L3_error)
11154 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
11155 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 220, __pyx_L3_error)
11156 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
11157 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 220, __pyx_L3_error)
11158 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
11159 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 220, __pyx_L3_error)
11160 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
11161 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 220, __pyx_L3_error)
11162 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
11163 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 220, __pyx_L3_error)
11164 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
11165 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 220, __pyx_L3_error)
11166 }
11167 __pyx_v_nd = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nd == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
11168 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L3_error)
11169 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
11170 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
11171 __pyx_v_x = ((PyArrayObject *)values[4]);
11172 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
11173 __pyx_v_material_functions = ((PyObject*)values[6]);
11174 }
11175 goto __pyx_L6_skip;
11176 __pyx_L5_argtuple_error:;
11177 __Pyx_RaiseArgtupleInvalid("evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 220, __pyx_L3_error)
11178 __pyx_L6_skip:;
11179 goto __pyx_L4_argument_unpacking_done;
11180 __pyx_L3_error:;
11181 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11182 Py_XDECREF(values[__pyx_temp]);
11183 }
11184 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
11185 __Pyx_RefNannyFinishContext();
11186 return NULL;
11187 __pyx_L4_argument_unpacking_done:;
11188 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
11189 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
11190 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
11191 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_vals", 0))) __PYX_ERR(0, 225, __pyx_L1_error)
11192 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 226, __pyx_L1_error)
11193 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
11194
11195 /* function exit code */
11196 goto __pyx_L0;
11197 __pyx_L1_error:;
11198 __pyx_r = NULL;
11199 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11200 Py_XDECREF(values[__pyx_temp]);
11201 }
11202 goto __pyx_L7_cleaned_up;
11203 __pyx_L0:;
11204 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11205 Py_XDECREF(values[__pyx_temp]);
11206 }
11207 __pyx_L7_cleaned_up:;
11208
11209
11210 __Pyx_RefNannyFinishContext();
11211 return __pyx_r;
11212}
11213
11214static 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) {
11215 int __pyx_v_eN;
11216 int __pyx_v_ebN;
11217 int __pyx_v_ebN_local;
11218 int __pyx_v_k;
11219 int __pyx_v_material_left;
11220 int __pyx_v_material_right;
11221 int __pyx_v_I;
11222 int __pyx_v_J;
11223 double __pyx_v_numer;
11224 double __pyx_v_denom;
11225 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
11226 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
11227 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
11228 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
11229 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
11230 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
11231 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
11232 __Pyx_Buffer __pyx_pybuffer_x;
11233 PyObject *__pyx_r = NULL;
11234 __Pyx_RefNannyDeclarations
11235 npy_intp __pyx_t_1;
11236 npy_intp __pyx_t_2;
11237 int __pyx_t_3;
11238 npy_intp __pyx_t_4;
11239 npy_intp __pyx_t_5;
11240 int __pyx_t_6;
11241 Py_ssize_t __pyx_t_7;
11242 Py_ssize_t __pyx_t_8;
11243 int __pyx_t_9;
11244 npy_intp __pyx_t_10;
11245 npy_intp __pyx_t_11;
11246 int __pyx_t_12;
11247 int __pyx_t_13;
11248 int __pyx_t_14;
11249 int __pyx_t_15;
11250 int __pyx_t_16;
11251 int __pyx_t_17;
11252 PyObject *__pyx_t_18 = NULL;
11253 PyObject *__pyx_t_19 = NULL;
11254 PyObject *__pyx_t_20 = NULL;
11255 PyObject *__pyx_t_21 = NULL;
11256 PyObject *__pyx_t_22 = NULL;
11257 PyObject *__pyx_t_23 = NULL;
11258 PyObject *__pyx_t_24 = NULL;
11259 size_t __pyx_t_25;
11260 PyObject *__pyx_t_26 = NULL;
11261 double __pyx_t_27;
11262 Py_ssize_t __pyx_t_28;
11263 Py_ssize_t __pyx_t_29;
11264 int __pyx_t_30;
11265 int __pyx_lineno = 0;
11266 const char *__pyx_filename = NULL;
11267 int __pyx_clineno = 0;
11268 __Pyx_RefNannySetupContext("evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
11269 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
11270 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
11271 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
11272 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
11273 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
11274 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
11275 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
11276 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
11277 __pyx_pybuffer_x.pybuffer.buf = NULL;
11278 __pyx_pybuffer_x.refcount = 0;
11279 __pyx_pybuffernd_x.data = NULL;
11280 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
11281 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
11282 __pyx_pybuffer_ebq_vals.refcount = 0;
11283 __pyx_pybuffernd_ebq_vals.data = NULL;
11284 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
11285 {
11286 __Pyx_BufFmt_StackElem __pyx_stack[1];
11287 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, 220, __pyx_L1_error)
11288 }
11289 __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];
11290 {
11291 __Pyx_BufFmt_StackElem __pyx_stack[1];
11292 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, 220, __pyx_L1_error)
11293 }
11294 __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];
11295 {
11296 __Pyx_BufFmt_StackElem __pyx_stack[1];
11297 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, 220, __pyx_L1_error)
11298 }
11299 __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];
11300 {
11301 __Pyx_BufFmt_StackElem __pyx_stack[1];
11302 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, 220, __pyx_L1_error)
11303 }
11304 __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];
11305
11306 /* "subsurfaceTransportFunctions.pyx":237
11307 * cdef double numer,denom
11308 *
11309 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
11310 * for ebN_local in range(x.shape[1]):
11311 * ebN = elementBoundariesArray[eN,ebN_local]
11312*/
11313
11314 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
11315 __pyx_t_2 = __pyx_t_1;
11316
11317 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
11318 __pyx_v_eN = __pyx_t_3;
11319
11320 /* "subsurfaceTransportFunctions.pyx":238
11321 *
11322 * for eN in range(x.shape[0]):
11323 * for ebN_local in range(x.shape[1]): # <<<<<<<<<<<<<<
11324 * ebN = elementBoundariesArray[eN,ebN_local]
11325 * material_left = elementBoundaryTypes[ebN,0]
11326*/
11327
11328 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
11329 __pyx_t_5 = __pyx_t_4;
11330
11331 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
11332 __pyx_v_ebN_local = __pyx_t_6;
11333
11334 /* "subsurfaceTransportFunctions.pyx":239
11335 * for eN in range(x.shape[0]):
11336 * for ebN_local in range(x.shape[1]):
11337 * ebN = elementBoundariesArray[eN,ebN_local] # <<<<<<<<<<<<<<
11338 * material_left = elementBoundaryTypes[ebN,0]
11339 * material_right= elementBoundaryTypes[ebN,1]
11340*/
11341 __pyx_t_7 = __pyx_v_eN;
11342 __pyx_t_8 = __pyx_v_ebN_local;
11343 __pyx_t_9 = -1;
11344 if (__pyx_t_7 < 0) {
11345 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
11346 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
11347 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
11348 if (__pyx_t_8 < 0) {
11349 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
11350 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
11351 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
11352 if (unlikely(__pyx_t_9 != -1)) {
11353 __Pyx_RaiseBufferIndexError(__pyx_t_9);
11354 __PYX_ERR(0, 239, __pyx_L1_error)
11355 }
11356 __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));
11357
11358 /* "subsurfaceTransportFunctions.pyx":240
11359 * for ebN_local in range(x.shape[1]):
11360 * ebN = elementBoundariesArray[eN,ebN_local]
11361 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
11362 * material_right= elementBoundaryTypes[ebN,1]
11363 * for k in range(x.shape[2]):
11364*/
11365 __pyx_t_8 = __pyx_v_ebN;
11366 __pyx_t_7 = 0;
11367 __pyx_t_9 = -1;
11368 if (__pyx_t_8 < 0) {
11369 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
11370 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
11371 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
11372 if (__pyx_t_7 < 0) {
11373 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
11374 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
11375 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
11376 if (unlikely(__pyx_t_9 != -1)) {
11377 __Pyx_RaiseBufferIndexError(__pyx_t_9);
11378 __PYX_ERR(0, 240, __pyx_L1_error)
11379 }
11380 __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));
11381
11382 /* "subsurfaceTransportFunctions.pyx":241
11383 * ebN = elementBoundariesArray[eN,ebN_local]
11384 * material_left = elementBoundaryTypes[ebN,0]
11385 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
11386 * for k in range(x.shape[2]):
11387 * for I in range(nd):
11388*/
11389 __pyx_t_7 = __pyx_v_ebN;
11390 __pyx_t_8 = 1;
11391 __pyx_t_9 = -1;
11392 if (__pyx_t_7 < 0) {
11393 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
11394 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
11395 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
11396 if (__pyx_t_8 < 0) {
11397 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
11398 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
11399 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
11400 if (unlikely(__pyx_t_9 != -1)) {
11401 __Pyx_RaiseBufferIndexError(__pyx_t_9);
11402 __PYX_ERR(0, 241, __pyx_L1_error)
11403 }
11404 __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));
11405
11406 /* "subsurfaceTransportFunctions.pyx":242
11407 * material_left = elementBoundaryTypes[ebN,0]
11408 * material_right= elementBoundaryTypes[ebN,1]
11409 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
11410 * for I in range(nd):
11411 * for J in range(nd):
11412*/
11413
11414 __pyx_t_10 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
11415 __pyx_t_11 = __pyx_t_10;
11416
11417 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
11418 __pyx_v_k = __pyx_t_9;
11419
11420 /* "subsurfaceTransportFunctions.pyx":243
11421 * material_right= elementBoundaryTypes[ebN,1]
11422 * for k in range(x.shape[2]):
11423 * for I in range(nd): # <<<<<<<<<<<<<<
11424 * for J in range(nd):
11425 * numer = 2.0*material_functions[material_left](x[eN,ebN_local,k],t)[I,J]*material_functions[material_right](x[eN,ebN_local,k],t)[I,J]
11426*/
11427
11428 __pyx_t_12 = __pyx_v_nd;
11429 __pyx_t_13 = __pyx_t_12;
11430
11431 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
11432 __pyx_v_I = __pyx_t_14;
11433
11434 /* "subsurfaceTransportFunctions.pyx":244
11435 * for k in range(x.shape[2]):
11436 * for I in range(nd):
11437 * for J in range(nd): # <<<<<<<<<<<<<<
11438 * numer = 2.0*material_functions[material_left](x[eN,ebN_local,k],t)[I,J]*material_functions[material_right](x[eN,ebN_local,k],t)[I,J]
11439 * denom = material_functions[material_left](x[eN,ebN_local,k],t)[I,J] + material_functions[material_right](x[eN,ebN_local,k],t)[I,J] + 1.0e-20
11440*/
11441
11442 __pyx_t_15 = __pyx_v_nd;
11443 __pyx_t_16 = __pyx_t_15;
11444
11445 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
11446 __pyx_v_J = __pyx_t_17;
11447
11448 /* "subsurfaceTransportFunctions.pyx":245
11449 * for I in range(nd):
11450 * for J in range(nd):
11451 * numer = 2.0*material_functions[material_left](x[eN,ebN_local,k],t)[I,J]*material_functions[material_right](x[eN,ebN_local,k],t)[I,J] # <<<<<<<<<<<<<<
11452 * denom = material_functions[material_left](x[eN,ebN_local,k],t)[I,J] + material_functions[material_right](x[eN,ebN_local,k],t)[I,J] + 1.0e-20
11453 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
11454*/
11455 __pyx_t_19 = NULL;
11456 if (unlikely(__pyx_v_material_functions == Py_None)) {
11457 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
11458 __PYX_ERR(0, 245, __pyx_L1_error)
11459 }
11460 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
11461 __Pyx_GOTREF(__pyx_t_20);
11462 __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
11463 __Pyx_GOTREF(__pyx_t_21);
11464 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11465 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
11466 __Pyx_GOTREF(__pyx_t_20);
11467 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_ebN_local); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
11468 __Pyx_GOTREF(__pyx_t_22);
11469 __pyx_t_23 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
11470 __Pyx_GOTREF(__pyx_t_23);
11471 __pyx_t_24 = PyTuple_New(3); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
11472 __Pyx_GOTREF(__pyx_t_24);
11473 __Pyx_GIVEREF(__pyx_t_20);
11474 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_20) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11475 __Pyx_GIVEREF(__pyx_t_22);
11476 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_22) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11477 __Pyx_GIVEREF(__pyx_t_23);
11478 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_23) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11479 __pyx_t_20 = 0;
11480 __pyx_t_22 = 0;
11481 __pyx_t_23 = 0;
11482 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
11483 __Pyx_GOTREF(__pyx_t_23);
11484 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
11485 __pyx_t_24 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
11486 __Pyx_GOTREF(__pyx_t_24);
11487 __pyx_t_25 = 1;
11488 #if CYTHON_UNPACK_METHODS
11489 if (unlikely(PyMethod_Check(__pyx_t_21))) {
11490 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_21);
11491 assert(__pyx_t_19);
11492 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_21);
11493 __Pyx_INCREF(__pyx_t_19);
11494 __Pyx_INCREF(__pyx__function);
11495 __Pyx_DECREF_SET(__pyx_t_21, __pyx__function);
11496 __pyx_t_25 = 0;
11497 }
11498 #endif
11499 {
11500 PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_t_23, __pyx_t_24};
11501 __pyx_t_18 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_21, __pyx_callargs+__pyx_t_25, (3-__pyx_t_25) | (__pyx_t_25*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
11502 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
11503 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
11504 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
11505 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
11506 if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
11507 __Pyx_GOTREF(__pyx_t_18);
11508 }
11509 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
11510 __Pyx_GOTREF(__pyx_t_21);
11511 __pyx_t_24 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
11512 __Pyx_GOTREF(__pyx_t_24);
11513 __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
11514 __Pyx_GOTREF(__pyx_t_23);
11515 __Pyx_GIVEREF(__pyx_t_21);
11516 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_21) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11517 __Pyx_GIVEREF(__pyx_t_24);
11518 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_24) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11519 __pyx_t_21 = 0;
11520 __pyx_t_24 = 0;
11521 __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_23); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
11522 __Pyx_GOTREF(__pyx_t_24);
11523 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
11524 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
11525 __pyx_t_23 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_2_0, __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
11526 __Pyx_GOTREF(__pyx_t_23);
11527 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
11528 __pyx_t_18 = NULL;
11529 if (unlikely(__pyx_v_material_functions == Py_None)) {
11530 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
11531 __PYX_ERR(0, 245, __pyx_L1_error)
11532 }
11533 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
11534 __Pyx_GOTREF(__pyx_t_21);
11535 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_21); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
11536 __Pyx_GOTREF(__pyx_t_19);
11537 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
11538 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
11539 __Pyx_GOTREF(__pyx_t_21);
11540 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_ebN_local); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
11541 __Pyx_GOTREF(__pyx_t_22);
11542 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
11543 __Pyx_GOTREF(__pyx_t_20);
11544 __pyx_t_26 = PyTuple_New(3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
11545 __Pyx_GOTREF(__pyx_t_26);
11546 __Pyx_GIVEREF(__pyx_t_21);
11547 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_21) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11548 __Pyx_GIVEREF(__pyx_t_22);
11549 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_22) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11550 __Pyx_GIVEREF(__pyx_t_20);
11551 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_t_20) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11552 __pyx_t_21 = 0;
11553 __pyx_t_22 = 0;
11554 __pyx_t_20 = 0;
11555 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_26); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
11556 __Pyx_GOTREF(__pyx_t_20);
11557 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
11558 __pyx_t_26 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
11559 __Pyx_GOTREF(__pyx_t_26);
11560 __pyx_t_25 = 1;
11561 #if CYTHON_UNPACK_METHODS
11562 if (unlikely(PyMethod_Check(__pyx_t_19))) {
11563 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19);
11564 assert(__pyx_t_18);
11565 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_19);
11566 __Pyx_INCREF(__pyx_t_18);
11567 __Pyx_INCREF(__pyx__function);
11568 __Pyx_DECREF_SET(__pyx_t_19, __pyx__function);
11569 __pyx_t_25 = 0;
11570 }
11571 #endif
11572 {
11573 PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_20, __pyx_t_26};
11574 __pyx_t_24 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_19, __pyx_callargs+__pyx_t_25, (3-__pyx_t_25) | (__pyx_t_25*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
11575 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
11576 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11577 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
11578 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
11579 if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
11580 __Pyx_GOTREF(__pyx_t_24);
11581 }
11582 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
11583 __Pyx_GOTREF(__pyx_t_19);
11584 __pyx_t_26 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
11585 __Pyx_GOTREF(__pyx_t_26);
11586 __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
11587 __Pyx_GOTREF(__pyx_t_20);
11588 __Pyx_GIVEREF(__pyx_t_19);
11589 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11590 __Pyx_GIVEREF(__pyx_t_26);
11591 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_26) != (0)) __PYX_ERR(0, 245, __pyx_L1_error);
11592 __pyx_t_19 = 0;
11593 __pyx_t_26 = 0;
11594 __pyx_t_26 = __Pyx_PyObject_GetItem(__pyx_t_24, __pyx_t_20); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
11595 __Pyx_GOTREF(__pyx_t_26);
11596 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
11597 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11598 __pyx_t_20 = __Pyx_PyNumber_Multiply_object_object(__pyx_t_23, __pyx_t_26); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
11599 __Pyx_GOTREF(__pyx_t_20);
11600 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
11601 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
11602 __pyx_t_27 = __Pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_27 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
11603 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11604 __pyx_v_numer = __pyx_t_27;
11605
11606 /* "subsurfaceTransportFunctions.pyx":246
11607 * for J in range(nd):
11608 * numer = 2.0*material_functions[material_left](x[eN,ebN_local,k],t)[I,J]*material_functions[material_right](x[eN,ebN_local,k],t)[I,J]
11609 * denom = material_functions[material_left](x[eN,ebN_local,k],t)[I,J] + material_functions[material_right](x[eN,ebN_local,k],t)[I,J] + 1.0e-20 # <<<<<<<<<<<<<<
11610 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
11611 *
11612*/
11613 __pyx_t_26 = NULL;
11614 if (unlikely(__pyx_v_material_functions == Py_None)) {
11615 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
11616 __PYX_ERR(0, 246, __pyx_L1_error)
11617 }
11618 __pyx_t_23 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 246, __pyx_L1_error)
11619 __Pyx_GOTREF(__pyx_t_23);
11620 __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_23); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 246, __pyx_L1_error)
11621 __Pyx_GOTREF(__pyx_t_24);
11622 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
11623 __pyx_t_23 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 246, __pyx_L1_error)
11624 __Pyx_GOTREF(__pyx_t_23);
11625 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_ebN_local); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 246, __pyx_L1_error)
11626 __Pyx_GOTREF(__pyx_t_19);
11627 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 246, __pyx_L1_error)
11628 __Pyx_GOTREF(__pyx_t_18);
11629 __pyx_t_22 = PyTuple_New(3); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 246, __pyx_L1_error)
11630 __Pyx_GOTREF(__pyx_t_22);
11631 __Pyx_GIVEREF(__pyx_t_23);
11632 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11633 __Pyx_GIVEREF(__pyx_t_19);
11634 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_19) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11635 __Pyx_GIVEREF(__pyx_t_18);
11636 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_18) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11637 __pyx_t_23 = 0;
11638 __pyx_t_19 = 0;
11639 __pyx_t_18 = 0;
11640 __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 246, __pyx_L1_error)
11641 __Pyx_GOTREF(__pyx_t_18);
11642 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
11643 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 246, __pyx_L1_error)
11644 __Pyx_GOTREF(__pyx_t_22);
11645 __pyx_t_25 = 1;
11646 #if CYTHON_UNPACK_METHODS
11647 if (unlikely(PyMethod_Check(__pyx_t_24))) {
11648 __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_24);
11649 assert(__pyx_t_26);
11650 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_24);
11651 __Pyx_INCREF(__pyx_t_26);
11652 __Pyx_INCREF(__pyx__function);
11653 __Pyx_DECREF_SET(__pyx_t_24, __pyx__function);
11654 __pyx_t_25 = 0;
11655 }
11656 #endif
11657 {
11658 PyObject *__pyx_callargs[3] = {__pyx_t_26, __pyx_t_18, __pyx_t_22};
11659 __pyx_t_20 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_24, __pyx_callargs+__pyx_t_25, (3-__pyx_t_25) | (__pyx_t_25*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
11660 __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
11661 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
11662 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
11663 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
11664 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 246, __pyx_L1_error)
11665 __Pyx_GOTREF(__pyx_t_20);
11666 }
11667 __pyx_t_24 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 246, __pyx_L1_error)
11668 __Pyx_GOTREF(__pyx_t_24);
11669 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 246, __pyx_L1_error)
11670 __Pyx_GOTREF(__pyx_t_22);
11671 __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 246, __pyx_L1_error)
11672 __Pyx_GOTREF(__pyx_t_18);
11673 __Pyx_GIVEREF(__pyx_t_24);
11674 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_24) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11675 __Pyx_GIVEREF(__pyx_t_22);
11676 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_22) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11677 __pyx_t_24 = 0;
11678 __pyx_t_22 = 0;
11679 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_20, __pyx_t_18); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 246, __pyx_L1_error)
11680 __Pyx_GOTREF(__pyx_t_22);
11681 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11682 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
11683 __pyx_t_20 = NULL;
11684 if (unlikely(__pyx_v_material_functions == Py_None)) {
11685 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
11686 __PYX_ERR(0, 246, __pyx_L1_error)
11687 }
11688 __pyx_t_24 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 246, __pyx_L1_error)
11689 __Pyx_GOTREF(__pyx_t_24);
11690 __pyx_t_26 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_24); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 246, __pyx_L1_error)
11691 __Pyx_GOTREF(__pyx_t_26);
11692 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
11693 __pyx_t_24 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 246, __pyx_L1_error)
11694 __Pyx_GOTREF(__pyx_t_24);
11695 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_ebN_local); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 246, __pyx_L1_error)
11696 __Pyx_GOTREF(__pyx_t_19);
11697 __pyx_t_23 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 246, __pyx_L1_error)
11698 __Pyx_GOTREF(__pyx_t_23);
11699 __pyx_t_21 = PyTuple_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 246, __pyx_L1_error)
11700 __Pyx_GOTREF(__pyx_t_21);
11701 __Pyx_GIVEREF(__pyx_t_24);
11702 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_24) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11703 __Pyx_GIVEREF(__pyx_t_19);
11704 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11705 __Pyx_GIVEREF(__pyx_t_23);
11706 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_23) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11707 __pyx_t_24 = 0;
11708 __pyx_t_19 = 0;
11709 __pyx_t_23 = 0;
11710 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 246, __pyx_L1_error)
11711 __Pyx_GOTREF(__pyx_t_23);
11712 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
11713 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 246, __pyx_L1_error)
11714 __Pyx_GOTREF(__pyx_t_21);
11715 __pyx_t_25 = 1;
11716 #if CYTHON_UNPACK_METHODS
11717 if (unlikely(PyMethod_Check(__pyx_t_26))) {
11718 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_26);
11719 assert(__pyx_t_20);
11720 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_26);
11721 __Pyx_INCREF(__pyx_t_20);
11722 __Pyx_INCREF(__pyx__function);
11723 __Pyx_DECREF_SET(__pyx_t_26, __pyx__function);
11724 __pyx_t_25 = 0;
11725 }
11726 #endif
11727 {
11728 PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_23, __pyx_t_21};
11729 __pyx_t_18 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_26, __pyx_callargs+__pyx_t_25, (3-__pyx_t_25) | (__pyx_t_25*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
11730 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
11731 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
11732 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
11733 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
11734 if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 246, __pyx_L1_error)
11735 __Pyx_GOTREF(__pyx_t_18);
11736 }
11737 __pyx_t_26 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 246, __pyx_L1_error)
11738 __Pyx_GOTREF(__pyx_t_26);
11739 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 246, __pyx_L1_error)
11740 __Pyx_GOTREF(__pyx_t_21);
11741 __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 246, __pyx_L1_error)
11742 __Pyx_GOTREF(__pyx_t_23);
11743 __Pyx_GIVEREF(__pyx_t_26);
11744 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_26) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11745 __Pyx_GIVEREF(__pyx_t_21);
11746 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21) != (0)) __PYX_ERR(0, 246, __pyx_L1_error);
11747 __pyx_t_26 = 0;
11748 __pyx_t_21 = 0;
11749 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_23); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 246, __pyx_L1_error)
11750 __Pyx_GOTREF(__pyx_t_21);
11751 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
11752 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
11753 __pyx_t_23 = __Pyx_PyNumber_Add_object_object(__pyx_t_22, __pyx_t_21); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 246, __pyx_L1_error)
11754 __Pyx_GOTREF(__pyx_t_23);
11755 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
11756 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
11757 __pyx_t_21 = __Pyx_PyFloat_AddObjC(__pyx_t_23, __pyx_mstate_global->__pyx_float_1_0eneg_20, 1.0e-20, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 246, __pyx_L1_error)
11758 __Pyx_GOTREF(__pyx_t_21);
11759 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
11760 __pyx_t_27 = __Pyx_PyFloat_AsDouble(__pyx_t_21); if (unlikely((__pyx_t_27 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
11761 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
11762 __pyx_v_denom = __pyx_t_27;
11763
11764 /* "subsurfaceTransportFunctions.pyx":247
11765 * numer = 2.0*material_functions[material_left](x[eN,ebN_local,k],t)[I,J]*material_functions[material_right](x[eN,ebN_local,k],t)[I,J]
11766 * denom = material_functions[material_left](x[eN,ebN_local,k],t)[I,J] + material_functions[material_right](x[eN,ebN_local,k],t)[I,J] + 1.0e-20
11767 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom # <<<<<<<<<<<<<<
11768 *
11769 * def evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(double t,
11770*/
11771 if (unlikely(__pyx_v_denom == 0)) {
11772 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11773 __PYX_ERR(0, 247, __pyx_L1_error)
11774 }
11775 __pyx_t_8 = __pyx_v_eN;
11776 __pyx_t_7 = __pyx_v_ebN_local;
11777 __pyx_t_28 = __pyx_v_k;
11778 __pyx_t_29 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
11779 __pyx_t_30 = -1;
11780 if (__pyx_t_8 < 0) {
11781 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
11782 if (unlikely(__pyx_t_8 < 0)) __pyx_t_30 = 0;
11783 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_30 = 0;
11784 if (__pyx_t_7 < 0) {
11785 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
11786 if (unlikely(__pyx_t_7 < 0)) __pyx_t_30 = 1;
11787 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_30 = 1;
11788 if (__pyx_t_28 < 0) {
11789 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
11790 if (unlikely(__pyx_t_28 < 0)) __pyx_t_30 = 2;
11791 } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_30 = 2;
11792 if (__pyx_t_29 < 0) {
11793 __pyx_t_29 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
11794 if (unlikely(__pyx_t_29 < 0)) __pyx_t_30 = 3;
11795 } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_30 = 3;
11796 if (unlikely(__pyx_t_30 != -1)) {
11797 __Pyx_RaiseBufferIndexError(__pyx_t_30);
11798 __PYX_ERR(0, 247, __pyx_L1_error)
11799 }
11800 *__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_28, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_29, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
11801 }
11802
11803 }
11804
11805 }
11806
11807 }
11808
11809 }
11810
11811
11812 /* "subsurfaceTransportFunctions.pyx":220
11813 * material_functions[material_right](x[eN,ebN_local,k],t))
11814 *
11815 * def evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
11816 * double t,
11817 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
11818*/
11819
11820 /* function exit code */
11821 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11822 goto __pyx_L0;
11823 __pyx_L1_error:;
11824 __Pyx_XDECREF(__pyx_t_18);
11825 __Pyx_XDECREF(__pyx_t_19);
11826 __Pyx_XDECREF(__pyx_t_20);
11827 __Pyx_XDECREF(__pyx_t_21);
11828 __Pyx_XDECREF(__pyx_t_22);
11829 __Pyx_XDECREF(__pyx_t_23);
11830 __Pyx_XDECREF(__pyx_t_24);
11831 __Pyx_XDECREF(__pyx_t_26);
11832 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11833 __Pyx_PyThreadState_declare
11834 __Pyx_PyThreadState_assign
11835 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11836 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
11837 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
11838 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
11839 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
11840 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11841 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
11842 __pyx_r = NULL;
11843 goto __pyx_L2;
11844 __pyx_L0:;
11845 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
11846 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
11847 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
11848 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
11849 __pyx_L2:;
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868 __Pyx_XGIVEREF(__pyx_r);
11869 __Pyx_RefNannyFinishContext();
11870 return __pyx_r;
11871}
11872
11873/* "subsurfaceTransportFunctions.pyx":249
11874 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
11875 *
11876 * def evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(double t, # <<<<<<<<<<<<<<
11877 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
11878 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
11879*/
11880
11881/* Python wrapper */
11882static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
11883#if CYTHON_VECTORCALL
11884PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11885#else
11886PyObject *__pyx_args, PyObject *__pyx_kwds
11887#endif
11888); /*proto*/
11889PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, "\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ");
11890static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
11891static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self,
11892#if CYTHON_VECTORCALL
11893PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11894#else
11895PyObject *__pyx_args, PyObject *__pyx_kwds
11896#endif
11897) {
11898 double __pyx_v_t;
11899 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
11900 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
11901 PyArrayObject *__pyx_v_x = 0;
11902 PyArrayObject *__pyx_v_ebq_global_vals = 0;
11903 PyObject *__pyx_v_material_functions = 0;
11904 #if !CYTHON_VECTORCALL
11905 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11906 #endif
11907 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11908 PyObject* values[6] = {0,0,0,0,0,0};
11909 int __pyx_lineno = 0;
11910 const char *__pyx_filename = NULL;
11911 int __pyx_clineno = 0;
11912 PyObject *__pyx_r = 0;
11913 __Pyx_RefNannyDeclarations
11914 __Pyx_RefNannySetupContext("evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
11915 #if !CYTHON_VECTORCALL
11916 #if CYTHON_ASSUME_SAFE_SIZE
11917 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11918 #else
11919 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11920 #endif
11921 #endif
11922 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11923 {
11924 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_ebq_global_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
11925 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11926 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 249, __pyx_L3_error)
11927 if (__pyx_kwds_len > 0) {
11928 switch (__pyx_nargs) {
11929 case 6:
11930 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
11931 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 249, __pyx_L3_error)
11932 CYTHON_FALLTHROUGH;
11933 case 5:
11934 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
11935 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 249, __pyx_L3_error)
11936 CYTHON_FALLTHROUGH;
11937 case 4:
11938 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
11939 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 249, __pyx_L3_error)
11940 CYTHON_FALLTHROUGH;
11941 case 3:
11942 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
11943 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 249, __pyx_L3_error)
11944 CYTHON_FALLTHROUGH;
11945 case 2:
11946 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
11947 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 249, __pyx_L3_error)
11948 CYTHON_FALLTHROUGH;
11949 case 1:
11950 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
11951 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 249, __pyx_L3_error)
11952 CYTHON_FALLTHROUGH;
11953 case 0: break;
11954 default: goto __pyx_L5_argtuple_error;
11955 }
11956 const Py_ssize_t kwd_pos_args = __pyx_nargs;
11957 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0) < (0)) __PYX_ERR(0, 249, __pyx_L3_error)
11958 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
11959 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, i); __PYX_ERR(0, 249, __pyx_L3_error) }
11960 }
11961 } else if (unlikely(__pyx_nargs != 6)) {
11962 goto __pyx_L5_argtuple_error;
11963 } else {
11964 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
11965 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 249, __pyx_L3_error)
11966 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
11967 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 249, __pyx_L3_error)
11968 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
11969 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 249, __pyx_L3_error)
11970 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
11971 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 249, __pyx_L3_error)
11972 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
11973 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 249, __pyx_L3_error)
11974 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
11975 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 249, __pyx_L3_error)
11976 }
11977 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L3_error)
11978 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
11979 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
11980 __pyx_v_x = ((PyArrayObject *)values[3]);
11981 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
11982 __pyx_v_material_functions = ((PyObject*)values[5]);
11983 }
11984 goto __pyx_L6_skip;
11985 __pyx_L5_argtuple_error:;
11986 __Pyx_RaiseArgtupleInvalid("evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 249, __pyx_L3_error)
11987 __pyx_L6_skip:;
11988 goto __pyx_L4_argument_unpacking_done;
11989 __pyx_L3_error:;
11990 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11991 Py_XDECREF(values[__pyx_temp]);
11992 }
11993 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
11994 __Pyx_RefNannyFinishContext();
11995 return NULL;
11996 __pyx_L4_argument_unpacking_done:;
11997 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
11998 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
11999 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
12000 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_global_vals", 0))) __PYX_ERR(0, 253, __pyx_L1_error)
12001 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 254, __pyx_L1_error)
12002 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
12003
12004 /* function exit code */
12005 goto __pyx_L0;
12006 __pyx_L1_error:;
12007 __pyx_r = NULL;
12008 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12009 Py_XDECREF(values[__pyx_temp]);
12010 }
12011 goto __pyx_L7_cleaned_up;
12012 __pyx_L0:;
12013 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12014 Py_XDECREF(values[__pyx_temp]);
12015 }
12016 __pyx_L7_cleaned_up:;
12017
12018 __Pyx_RefNannyFinishContext();
12019 return __pyx_r;
12020}
12021
12022static 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) {
12023 int __pyx_v_ebN;
12024 int __pyx_v_material_left;
12025 int __pyx_v_material_right;
12026 npy_intp __pyx_v_k;
12027 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
12028 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
12029 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
12030 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
12031 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
12032 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
12033 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
12034 __Pyx_Buffer __pyx_pybuffer_x;
12035 PyObject *__pyx_r = NULL;
12036 __Pyx_RefNannyDeclarations
12037 npy_intp __pyx_t_1;
12038 npy_intp __pyx_t_2;
12039 int __pyx_t_3;
12040 Py_ssize_t __pyx_t_4;
12041 Py_ssize_t __pyx_t_5;
12042 int __pyx_t_6;
12043 npy_intp __pyx_t_7;
12044 npy_intp __pyx_t_8;
12045 npy_intp __pyx_t_9;
12046 PyObject *__pyx_t_10 = NULL;
12047 PyObject *__pyx_t_11 = NULL;
12048 PyObject *__pyx_t_12 = NULL;
12049 PyObject *__pyx_t_13 = NULL;
12050 PyObject *__pyx_t_14 = NULL;
12051 PyObject *__pyx_t_15 = NULL;
12052 size_t __pyx_t_16;
12053 PyObject *__pyx_t_17 = NULL;
12054 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_18;
12055 int __pyx_lineno = 0;
12056 const char *__pyx_filename = NULL;
12057 int __pyx_clineno = 0;
12058 __Pyx_RefNannySetupContext("evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
12059 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
12060 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
12061 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
12062 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
12063 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
12064 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
12065 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
12066 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
12067 __pyx_pybuffer_x.pybuffer.buf = NULL;
12068 __pyx_pybuffer_x.refcount = 0;
12069 __pyx_pybuffernd_x.data = NULL;
12070 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
12071 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
12072 __pyx_pybuffer_ebq_global_vals.refcount = 0;
12073 __pyx_pybuffernd_ebq_global_vals.data = NULL;
12074 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
12075 {
12076 __Pyx_BufFmt_StackElem __pyx_stack[1];
12077 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, 249, __pyx_L1_error)
12078 }
12079 __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];
12080 {
12081 __Pyx_BufFmt_StackElem __pyx_stack[1];
12082 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, 249, __pyx_L1_error)
12083 }
12084 __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];
12085 {
12086 __Pyx_BufFmt_StackElem __pyx_stack[1];
12087 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, 249, __pyx_L1_error)
12088 }
12089 __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];
12090 {
12091 __Pyx_BufFmt_StackElem __pyx_stack[1];
12092 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, 249, __pyx_L1_error)
12093 }
12094 __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];
12095
12096 /* "subsurfaceTransportFunctions.pyx":264
12097 * cdef int ebN,material_left,material_right
12098 *
12099 * for ebN in range(x.shape[0]): # <<<<<<<<<<<<<<
12100 * material_left = elementBoundaryTypes[ebN,0]
12101 * material_right= elementBoundaryTypes[ebN,1]
12102*/
12103
12104 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
12105 __pyx_t_2 = __pyx_t_1;
12106
12107 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
12108 __pyx_v_ebN = __pyx_t_3;
12109
12110 /* "subsurfaceTransportFunctions.pyx":265
12111 *
12112 * for ebN in range(x.shape[0]):
12113 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
12114 * material_right= elementBoundaryTypes[ebN,1]
12115 * for k in range(x.shape[1]):
12116*/
12117 __pyx_t_4 = __pyx_v_ebN;
12118 __pyx_t_5 = 0;
12119 __pyx_t_6 = -1;
12120 if (__pyx_t_4 < 0) {
12121 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
12122 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
12123 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
12124 if (__pyx_t_5 < 0) {
12125 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
12126 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
12127 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
12128 if (unlikely(__pyx_t_6 != -1)) {
12129 __Pyx_RaiseBufferIndexError(__pyx_t_6);
12130 __PYX_ERR(0, 265, __pyx_L1_error)
12131 }
12132 __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));
12133
12134 /* "subsurfaceTransportFunctions.pyx":266
12135 * for ebN in range(x.shape[0]):
12136 * material_left = elementBoundaryTypes[ebN,0]
12137 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
12138 * for k in range(x.shape[1]):
12139 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left](x[ebN,k],t)+
12140*/
12141 __pyx_t_5 = __pyx_v_ebN;
12142 __pyx_t_4 = 1;
12143 __pyx_t_6 = -1;
12144 if (__pyx_t_5 < 0) {
12145 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
12146 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
12147 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
12148 if (__pyx_t_4 < 0) {
12149 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
12150 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
12151 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
12152 if (unlikely(__pyx_t_6 != -1)) {
12153 __Pyx_RaiseBufferIndexError(__pyx_t_6);
12154 __PYX_ERR(0, 266, __pyx_L1_error)
12155 }
12156 __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));
12157
12158 /* "subsurfaceTransportFunctions.pyx":267
12159 * material_left = elementBoundaryTypes[ebN,0]
12160 * material_right= elementBoundaryTypes[ebN,1]
12161 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
12162 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left](x[ebN,k],t)+
12163 * material_functions[material_right](x[ebN,k],t))
12164*/
12165
12166 __pyx_t_7 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
12167 __pyx_t_8 = __pyx_t_7;
12168
12169 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
12170 __pyx_v_k = __pyx_t_9;
12171
12172 /* "subsurfaceTransportFunctions.pyx":268
12173 * material_right= elementBoundaryTypes[ebN,1]
12174 * for k in range(x.shape[1]):
12175 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left](x[ebN,k],t)+ # <<<<<<<<<<<<<<
12176 * material_functions[material_right](x[ebN,k],t))
12177 *
12178*/
12179 __pyx_t_11 = NULL;
12180 if (unlikely(__pyx_v_material_functions == Py_None)) {
12181 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
12182 __PYX_ERR(0, 268, __pyx_L1_error)
12183 }
12184 __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
12185 __Pyx_GOTREF(__pyx_t_12);
12186 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
12187 __Pyx_GOTREF(__pyx_t_13);
12188 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12189 __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
12190 __Pyx_GOTREF(__pyx_t_12);
12191 __pyx_t_14 = __Pyx_PyLong_From_npy_intp(__pyx_v_k); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
12192 __Pyx_GOTREF(__pyx_t_14);
12193 __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
12194 __Pyx_GOTREF(__pyx_t_15);
12195 __Pyx_GIVEREF(__pyx_t_12);
12196 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 268, __pyx_L1_error);
12197 __Pyx_GIVEREF(__pyx_t_14);
12198 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_14) != (0)) __PYX_ERR(0, 268, __pyx_L1_error);
12199 __pyx_t_12 = 0;
12200 __pyx_t_14 = 0;
12201 __pyx_t_14 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
12202 __Pyx_GOTREF(__pyx_t_14);
12203 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
12204 __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
12205 __Pyx_GOTREF(__pyx_t_15);
12206 __pyx_t_16 = 1;
12207 #if CYTHON_UNPACK_METHODS
12208 if (unlikely(PyMethod_Check(__pyx_t_13))) {
12209 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
12210 assert(__pyx_t_11);
12211 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
12212 __Pyx_INCREF(__pyx_t_11);
12213 __Pyx_INCREF(__pyx__function);
12214 __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
12215 __pyx_t_16 = 0;
12216 }
12217 #endif
12218 {
12219 PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_14, __pyx_t_15};
12220 __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12221 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12222 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
12223 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
12224 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
12225 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 268, __pyx_L1_error)
12226 __Pyx_GOTREF(__pyx_t_10);
12227 }
12228
12229 /* "subsurfaceTransportFunctions.pyx":269
12230 * for k in range(x.shape[1]):
12231 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left](x[ebN,k],t)+
12232 * material_functions[material_right](x[ebN,k],t)) # <<<<<<<<<<<<<<
12233 *
12234 *
12235*/
12236 __pyx_t_15 = NULL;
12237 if (unlikely(__pyx_v_material_functions == Py_None)) {
12238 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
12239 __PYX_ERR(0, 269, __pyx_L1_error)
12240 }
12241 __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 269, __pyx_L1_error)
12242 __Pyx_GOTREF(__pyx_t_14);
12243 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 269, __pyx_L1_error)
12244 __Pyx_GOTREF(__pyx_t_11);
12245 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
12246 __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 269, __pyx_L1_error)
12247 __Pyx_GOTREF(__pyx_t_14);
12248 __pyx_t_12 = __Pyx_PyLong_From_npy_intp(__pyx_v_k); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
12249 __Pyx_GOTREF(__pyx_t_12);
12250 __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 269, __pyx_L1_error)
12251 __Pyx_GOTREF(__pyx_t_17);
12252 __Pyx_GIVEREF(__pyx_t_14);
12253 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14) != (0)) __PYX_ERR(0, 269, __pyx_L1_error);
12254 __Pyx_GIVEREF(__pyx_t_12);
12255 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 269, __pyx_L1_error);
12256 __pyx_t_14 = 0;
12257 __pyx_t_12 = 0;
12258 __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
12259 __Pyx_GOTREF(__pyx_t_12);
12260 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12261 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 269, __pyx_L1_error)
12262 __Pyx_GOTREF(__pyx_t_17);
12263 __pyx_t_16 = 1;
12264 #if CYTHON_UNPACK_METHODS
12265 if (unlikely(PyMethod_Check(__pyx_t_11))) {
12266 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_11);
12267 assert(__pyx_t_15);
12268 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
12269 __Pyx_INCREF(__pyx_t_15);
12270 __Pyx_INCREF(__pyx__function);
12271 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
12272 __pyx_t_16 = 0;
12273 }
12274 #endif
12275 {
12276 PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_12, __pyx_t_17};
12277 __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12278 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
12279 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12280 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12281 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12282 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 269, __pyx_L1_error)
12283 __Pyx_GOTREF(__pyx_t_13);
12284 }
12285
12286 /* "subsurfaceTransportFunctions.pyx":268
12287 * material_right= elementBoundaryTypes[ebN,1]
12288 * for k in range(x.shape[1]):
12289 * ebq_global_vals[ebN,k] = 0.5*(material_functions[material_left](x[ebN,k],t)+ # <<<<<<<<<<<<<<
12290 * material_functions[material_right](x[ebN,k],t))
12291 *
12292*/
12293 __pyx_t_11 = __Pyx_PyNumber_Add_object_object(__pyx_t_10, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
12294 __Pyx_GOTREF(__pyx_t_11);
12295 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12296 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
12297 __pyx_t_13 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
12298 __Pyx_GOTREF(__pyx_t_13);
12299 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12300 __pyx_t_18 = __Pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_18 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
12301 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
12302 __pyx_t_4 = __pyx_v_ebN;
12303 __pyx_t_5 = __pyx_v_k;
12304 __pyx_t_6 = -1;
12305 if (__pyx_t_4 < 0) {
12306 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
12307 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
12308 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
12309 if (__pyx_t_5 < 0) {
12310 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
12311 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
12312 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
12313 if (unlikely(__pyx_t_6 != -1)) {
12314 __Pyx_RaiseBufferIndexError(__pyx_t_6);
12315 __PYX_ERR(0, 268, __pyx_L1_error)
12316 }
12317 *__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_18;
12318
12319 }
12320
12321 }
12322
12323
12324 /* "subsurfaceTransportFunctions.pyx":249
12325 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
12326 *
12327 * def evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(double t, # <<<<<<<<<<<<<<
12328 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
12329 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
12330*/
12331
12332 /* function exit code */
12333 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12334 goto __pyx_L0;
12335 __pyx_L1_error:;
12336 __Pyx_XDECREF(__pyx_t_10);
12337 __Pyx_XDECREF(__pyx_t_11);
12338 __Pyx_XDECREF(__pyx_t_12);
12339 __Pyx_XDECREF(__pyx_t_13);
12340 __Pyx_XDECREF(__pyx_t_14);
12341 __Pyx_XDECREF(__pyx_t_15);
12342 __Pyx_XDECREF(__pyx_t_17);
12343 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12344 __Pyx_PyThreadState_declare
12345 __Pyx_PyThreadState_assign
12346 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12347 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
12348 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
12349 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
12350 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
12351 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12352 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
12353 __pyx_r = NULL;
12354 goto __pyx_L2;
12355 __pyx_L0:;
12356 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
12357 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
12358 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
12359 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
12360 __pyx_L2:;
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373 __Pyx_XGIVEREF(__pyx_r);
12374 __Pyx_RefNannyFinishContext();
12375 return __pyx_r;
12376}
12377
12378/* "subsurfaceTransportFunctions.pyx":272
12379 *
12380 *
12381 * def evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
12382 * double t,
12383 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
12384*/
12385
12386/* Python wrapper */
12387static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self,
12388#if CYTHON_VECTORCALL
12389PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12390#else
12391PyObject *__pyx_args, PyObject *__pyx_kwds
12392#endif
12393); /*proto*/
12394PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, "\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ");
12395static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
12396static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self,
12397#if CYTHON_VECTORCALL
12398PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12399#else
12400PyObject *__pyx_args, PyObject *__pyx_kwds
12401#endif
12402) {
12403 int __pyx_v_nd;
12404 double __pyx_v_t;
12405 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
12406 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
12407 PyArrayObject *__pyx_v_x = 0;
12408 PyArrayObject *__pyx_v_ebq_global_vals = 0;
12409 PyObject *__pyx_v_material_functions = 0;
12410 #if !CYTHON_VECTORCALL
12411 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12412 #endif
12413 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12414 PyObject* values[7] = {0,0,0,0,0,0,0};
12415 int __pyx_lineno = 0;
12416 const char *__pyx_filename = NULL;
12417 int __pyx_clineno = 0;
12418 PyObject *__pyx_r = 0;
12419 __Pyx_RefNannyDeclarations
12420 __Pyx_RefNannySetupContext("evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
12421 #if !CYTHON_VECTORCALL
12422 #if CYTHON_ASSUME_SAFE_SIZE
12423 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12424 #else
12425 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12426 #endif
12427 #endif
12428 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12429 {
12430 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nd,&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_elementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryTypes,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_ebq_global_vals,&__pyx_mstate_global->__pyx_n_u_material_functions,0};
12431 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12432 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 272, __pyx_L3_error)
12433 if (__pyx_kwds_len > 0) {
12434 switch (__pyx_nargs) {
12435 case 7:
12436 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
12437 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 272, __pyx_L3_error)
12438 CYTHON_FALLTHROUGH;
12439 case 6:
12440 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
12441 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 272, __pyx_L3_error)
12442 CYTHON_FALLTHROUGH;
12443 case 5:
12444 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
12445 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 272, __pyx_L3_error)
12446 CYTHON_FALLTHROUGH;
12447 case 4:
12448 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
12449 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 272, __pyx_L3_error)
12450 CYTHON_FALLTHROUGH;
12451 case 3:
12452 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
12453 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 272, __pyx_L3_error)
12454 CYTHON_FALLTHROUGH;
12455 case 2:
12456 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
12457 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 272, __pyx_L3_error)
12458 CYTHON_FALLTHROUGH;
12459 case 1:
12460 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12461 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 272, __pyx_L3_error)
12462 CYTHON_FALLTHROUGH;
12463 case 0: break;
12464 default: goto __pyx_L5_argtuple_error;
12465 }
12466 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12467 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0) < (0)) __PYX_ERR(0, 272, __pyx_L3_error)
12468 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
12469 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, i); __PYX_ERR(0, 272, __pyx_L3_error) }
12470 }
12471 } else if (unlikely(__pyx_nargs != 7)) {
12472 goto __pyx_L5_argtuple_error;
12473 } else {
12474 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12475 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 272, __pyx_L3_error)
12476 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
12477 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 272, __pyx_L3_error)
12478 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
12479 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 272, __pyx_L3_error)
12480 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
12481 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 272, __pyx_L3_error)
12482 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
12483 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 272, __pyx_L3_error)
12484 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
12485 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 272, __pyx_L3_error)
12486 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
12487 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 272, __pyx_L3_error)
12488 }
12489 __pyx_v_nd = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nd == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
12490 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error)
12491 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
12492 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
12493 __pyx_v_x = ((PyArrayObject *)values[4]);
12494 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
12495 __pyx_v_material_functions = ((PyObject*)values[6]);
12496 }
12497 goto __pyx_L6_skip;
12498 __pyx_L5_argtuple_error:;
12499 __Pyx_RaiseArgtupleInvalid("evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 272, __pyx_L3_error)
12500 __pyx_L6_skip:;
12501 goto __pyx_L4_argument_unpacking_done;
12502 __pyx_L3_error:;
12503 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12504 Py_XDECREF(values[__pyx_temp]);
12505 }
12506 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
12507 __Pyx_RefNannyFinishContext();
12508 return NULL;
12509 __pyx_L4_argument_unpacking_done:;
12510 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundariesArray", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
12511 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryTypes", 0))) __PYX_ERR(0, 275, __pyx_L1_error)
12512 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
12513 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "ebq_global_vals", 0))) __PYX_ERR(0, 277, __pyx_L1_error)
12514 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1, "material_functions", 1))) __PYX_ERR(0, 278, __pyx_L1_error)
12515 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
12516
12517 /* function exit code */
12518 goto __pyx_L0;
12519 __pyx_L1_error:;
12520 __pyx_r = NULL;
12521 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12522 Py_XDECREF(values[__pyx_temp]);
12523 }
12524 goto __pyx_L7_cleaned_up;
12525 __pyx_L0:;
12526 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12527 Py_XDECREF(values[__pyx_temp]);
12528 }
12529 __pyx_L7_cleaned_up:;
12530
12531
12532 __Pyx_RefNannyFinishContext();
12533 return __pyx_r;
12534}
12535
12536static 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) {
12537 int __pyx_v_ebN;
12538 int __pyx_v_k;
12539 int __pyx_v_material_left;
12540 int __pyx_v_material_right;
12541 int __pyx_v_I;
12542 int __pyx_v_J;
12543 double __pyx_v_numer;
12544 double __pyx_v_denom;
12545 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
12546 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
12547 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
12548 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
12549 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
12550 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
12551 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
12552 __Pyx_Buffer __pyx_pybuffer_x;
12553 PyObject *__pyx_r = NULL;
12554 __Pyx_RefNannyDeclarations
12555 npy_intp __pyx_t_1;
12556 npy_intp __pyx_t_2;
12557 int __pyx_t_3;
12558 Py_ssize_t __pyx_t_4;
12559 Py_ssize_t __pyx_t_5;
12560 int __pyx_t_6;
12561 npy_intp __pyx_t_7;
12562 npy_intp __pyx_t_8;
12563 int __pyx_t_9;
12564 int __pyx_t_10;
12565 int __pyx_t_11;
12566 int __pyx_t_12;
12567 int __pyx_t_13;
12568 int __pyx_t_14;
12569 PyObject *__pyx_t_15 = NULL;
12570 PyObject *__pyx_t_16 = NULL;
12571 PyObject *__pyx_t_17 = NULL;
12572 PyObject *__pyx_t_18 = NULL;
12573 PyObject *__pyx_t_19 = NULL;
12574 PyObject *__pyx_t_20 = NULL;
12575 size_t __pyx_t_21;
12576 PyObject *__pyx_t_22 = NULL;
12577 double __pyx_t_23;
12578 Py_ssize_t __pyx_t_24;
12579 int __pyx_t_25;
12580 int __pyx_lineno = 0;
12581 const char *__pyx_filename = NULL;
12582 int __pyx_clineno = 0;
12583 __Pyx_RefNannySetupContext("evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
12584 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
12585 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
12586 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
12587 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
12588 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
12589 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
12590 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
12591 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
12592 __pyx_pybuffer_x.pybuffer.buf = NULL;
12593 __pyx_pybuffer_x.refcount = 0;
12594 __pyx_pybuffernd_x.data = NULL;
12595 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
12596 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
12597 __pyx_pybuffer_ebq_global_vals.refcount = 0;
12598 __pyx_pybuffernd_ebq_global_vals.data = NULL;
12599 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
12600 {
12601 __Pyx_BufFmt_StackElem __pyx_stack[1];
12602 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, 272, __pyx_L1_error)
12603 }
12604 __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];
12605 {
12606 __Pyx_BufFmt_StackElem __pyx_stack[1];
12607 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, 272, __pyx_L1_error)
12608 }
12609 __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];
12610 {
12611 __Pyx_BufFmt_StackElem __pyx_stack[1];
12612 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, 272, __pyx_L1_error)
12613 }
12614 __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];
12615 {
12616 __Pyx_BufFmt_StackElem __pyx_stack[1];
12617 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, 272, __pyx_L1_error)
12618 }
12619 __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];
12620
12621 /* "subsurfaceTransportFunctions.pyx":289
12622 * cdef double numer,denom
12623 *
12624 * for ebN in range(x.shape[0]): # <<<<<<<<<<<<<<
12625 * material_left = elementBoundaryTypes[ebN,0]
12626 * material_right= elementBoundaryTypes[ebN,1]
12627*/
12628
12629 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
12630 __pyx_t_2 = __pyx_t_1;
12631
12632 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
12633 __pyx_v_ebN = __pyx_t_3;
12634
12635 /* "subsurfaceTransportFunctions.pyx":290
12636 *
12637 * for ebN in range(x.shape[0]):
12638 * material_left = elementBoundaryTypes[ebN,0] # <<<<<<<<<<<<<<
12639 * material_right= elementBoundaryTypes[ebN,1]
12640 * for k in range(x.shape[1]):
12641*/
12642 __pyx_t_4 = __pyx_v_ebN;
12643 __pyx_t_5 = 0;
12644 __pyx_t_6 = -1;
12645 if (__pyx_t_4 < 0) {
12646 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
12647 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
12648 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
12649 if (__pyx_t_5 < 0) {
12650 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
12651 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
12652 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
12653 if (unlikely(__pyx_t_6 != -1)) {
12654 __Pyx_RaiseBufferIndexError(__pyx_t_6);
12655 __PYX_ERR(0, 290, __pyx_L1_error)
12656 }
12657 __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));
12658
12659 /* "subsurfaceTransportFunctions.pyx":291
12660 * for ebN in range(x.shape[0]):
12661 * material_left = elementBoundaryTypes[ebN,0]
12662 * material_right= elementBoundaryTypes[ebN,1] # <<<<<<<<<<<<<<
12663 * for k in range(x.shape[1]):
12664 * for I in range(nd):
12665*/
12666 __pyx_t_5 = __pyx_v_ebN;
12667 __pyx_t_4 = 1;
12668 __pyx_t_6 = -1;
12669 if (__pyx_t_5 < 0) {
12670 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
12671 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
12672 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
12673 if (__pyx_t_4 < 0) {
12674 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
12675 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
12676 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
12677 if (unlikely(__pyx_t_6 != -1)) {
12678 __Pyx_RaiseBufferIndexError(__pyx_t_6);
12679 __PYX_ERR(0, 291, __pyx_L1_error)
12680 }
12681 __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));
12682
12683 /* "subsurfaceTransportFunctions.pyx":292
12684 * material_left = elementBoundaryTypes[ebN,0]
12685 * material_right= elementBoundaryTypes[ebN,1]
12686 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
12687 * for I in range(nd):
12688 * for J in range(nd):
12689*/
12690
12691 __pyx_t_7 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
12692 __pyx_t_8 = __pyx_t_7;
12693
12694 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
12695 __pyx_v_k = __pyx_t_6;
12696
12697 /* "subsurfaceTransportFunctions.pyx":293
12698 * material_right= elementBoundaryTypes[ebN,1]
12699 * for k in range(x.shape[1]):
12700 * for I in range(nd): # <<<<<<<<<<<<<<
12701 * for J in range(nd):
12702 * numer = 2.0*material_functions[material_left](x[ebN,k],t)[I,J]*material_functions[material_right](x[ebN,k],t)[I,J]
12703*/
12704
12705 __pyx_t_9 = __pyx_v_nd;
12706 __pyx_t_10 = __pyx_t_9;
12707
12708 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
12709 __pyx_v_I = __pyx_t_11;
12710
12711 /* "subsurfaceTransportFunctions.pyx":294
12712 * for k in range(x.shape[1]):
12713 * for I in range(nd):
12714 * for J in range(nd): # <<<<<<<<<<<<<<
12715 * numer = 2.0*material_functions[material_left](x[ebN,k],t)[I,J]*material_functions[material_right](x[ebN,k],t)[I,J]
12716 * denom = material_functions[material_left](x[ebN,k],t)[I,J] + material_functions[material_right](x[ebN,k],t)[I,J] + 1.0e-20
12717*/
12718
12719 __pyx_t_12 = __pyx_v_nd;
12720 __pyx_t_13 = __pyx_t_12;
12721
12722 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
12723 __pyx_v_J = __pyx_t_14;
12724
12725 /* "subsurfaceTransportFunctions.pyx":295
12726 * for I in range(nd):
12727 * for J in range(nd):
12728 * numer = 2.0*material_functions[material_left](x[ebN,k],t)[I,J]*material_functions[material_right](x[ebN,k],t)[I,J] # <<<<<<<<<<<<<<
12729 * denom = material_functions[material_left](x[ebN,k],t)[I,J] + material_functions[material_right](x[ebN,k],t)[I,J] + 1.0e-20
12730 * ebq_global_vals[ebN,k,I*nd+J] = numer/denom
12731*/
12732 __pyx_t_16 = NULL;
12733 if (unlikely(__pyx_v_material_functions == Py_None)) {
12734 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
12735 __PYX_ERR(0, 295, __pyx_L1_error)
12736 }
12737 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
12738 __Pyx_GOTREF(__pyx_t_17);
12739 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
12740 __Pyx_GOTREF(__pyx_t_18);
12741 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12742 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
12743 __Pyx_GOTREF(__pyx_t_17);
12744 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
12745 __Pyx_GOTREF(__pyx_t_19);
12746 __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
12747 __Pyx_GOTREF(__pyx_t_20);
12748 __Pyx_GIVEREF(__pyx_t_17);
12749 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12750 __Pyx_GIVEREF(__pyx_t_19);
12751 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12752 __pyx_t_17 = 0;
12753 __pyx_t_19 = 0;
12754 __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
12755 __Pyx_GOTREF(__pyx_t_19);
12756 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
12757 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
12758 __Pyx_GOTREF(__pyx_t_20);
12759 __pyx_t_21 = 1;
12760 #if CYTHON_UNPACK_METHODS
12761 if (unlikely(PyMethod_Check(__pyx_t_18))) {
12762 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_18);
12763 assert(__pyx_t_16);
12764 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
12765 __Pyx_INCREF(__pyx_t_16);
12766 __Pyx_INCREF(__pyx__function);
12767 __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
12768 __pyx_t_21 = 0;
12769 }
12770 #endif
12771 {
12772 PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_19, __pyx_t_20};
12773 __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_21, (3-__pyx_t_21) | (__pyx_t_21*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12774 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
12775 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
12776 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
12777 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
12778 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
12779 __Pyx_GOTREF(__pyx_t_15);
12780 }
12781 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
12782 __Pyx_GOTREF(__pyx_t_18);
12783 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
12784 __Pyx_GOTREF(__pyx_t_20);
12785 __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
12786 __Pyx_GOTREF(__pyx_t_19);
12787 __Pyx_GIVEREF(__pyx_t_18);
12788 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12789 __Pyx_GIVEREF(__pyx_t_20);
12790 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_20) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12791 __pyx_t_18 = 0;
12792 __pyx_t_20 = 0;
12793 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
12794 __Pyx_GOTREF(__pyx_t_20);
12795 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
12796 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
12797 __pyx_t_19 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_2_0, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
12798 __Pyx_GOTREF(__pyx_t_19);
12799 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
12800 __pyx_t_15 = NULL;
12801 if (unlikely(__pyx_v_material_functions == Py_None)) {
12802 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
12803 __PYX_ERR(0, 295, __pyx_L1_error)
12804 }
12805 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
12806 __Pyx_GOTREF(__pyx_t_18);
12807 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
12808 __Pyx_GOTREF(__pyx_t_16);
12809 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
12810 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
12811 __Pyx_GOTREF(__pyx_t_18);
12812 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
12813 __Pyx_GOTREF(__pyx_t_17);
12814 __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
12815 __Pyx_GOTREF(__pyx_t_22);
12816 __Pyx_GIVEREF(__pyx_t_18);
12817 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_18) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12818 __Pyx_GIVEREF(__pyx_t_17);
12819 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_17) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12820 __pyx_t_18 = 0;
12821 __pyx_t_17 = 0;
12822 __pyx_t_17 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
12823 __Pyx_GOTREF(__pyx_t_17);
12824 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
12825 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
12826 __Pyx_GOTREF(__pyx_t_22);
12827 __pyx_t_21 = 1;
12828 #if CYTHON_UNPACK_METHODS
12829 if (unlikely(PyMethod_Check(__pyx_t_16))) {
12830 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
12831 assert(__pyx_t_15);
12832 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
12833 __Pyx_INCREF(__pyx_t_15);
12834 __Pyx_INCREF(__pyx__function);
12835 __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
12836 __pyx_t_21 = 0;
12837 }
12838 #endif
12839 {
12840 PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_17, __pyx_t_22};
12841 __pyx_t_20 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_21, (3-__pyx_t_21) | (__pyx_t_21*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12842 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
12843 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12844 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
12845 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12846 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
12847 __Pyx_GOTREF(__pyx_t_20);
12848 }
12849 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
12850 __Pyx_GOTREF(__pyx_t_16);
12851 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
12852 __Pyx_GOTREF(__pyx_t_22);
12853 __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
12854 __Pyx_GOTREF(__pyx_t_17);
12855 __Pyx_GIVEREF(__pyx_t_16);
12856 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12857 __Pyx_GIVEREF(__pyx_t_22);
12858 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_22) != (0)) __PYX_ERR(0, 295, __pyx_L1_error);
12859 __pyx_t_16 = 0;
12860 __pyx_t_22 = 0;
12861 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_20, __pyx_t_17); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
12862 __Pyx_GOTREF(__pyx_t_22);
12863 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
12864 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12865 __pyx_t_17 = __Pyx_PyNumber_Multiply_object_object(__pyx_t_19, __pyx_t_22); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
12866 __Pyx_GOTREF(__pyx_t_17);
12867 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
12868 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
12869 __pyx_t_23 = __Pyx_PyFloat_AsDouble(__pyx_t_17); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
12870 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12871 __pyx_v_numer = __pyx_t_23;
12872
12873 /* "subsurfaceTransportFunctions.pyx":296
12874 * for J in range(nd):
12875 * numer = 2.0*material_functions[material_left](x[ebN,k],t)[I,J]*material_functions[material_right](x[ebN,k],t)[I,J]
12876 * denom = material_functions[material_left](x[ebN,k],t)[I,J] + material_functions[material_right](x[ebN,k],t)[I,J] + 1.0e-20 # <<<<<<<<<<<<<<
12877 * ebq_global_vals[ebN,k,I*nd+J] = numer/denom
12878 *
12879*/
12880 __pyx_t_22 = NULL;
12881 if (unlikely(__pyx_v_material_functions == Py_None)) {
12882 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
12883 __PYX_ERR(0, 296, __pyx_L1_error)
12884 }
12885 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_material_left); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 296, __pyx_L1_error)
12886 __Pyx_GOTREF(__pyx_t_19);
12887 __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 296, __pyx_L1_error)
12888 __Pyx_GOTREF(__pyx_t_20);
12889 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
12890 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 296, __pyx_L1_error)
12891 __Pyx_GOTREF(__pyx_t_19);
12892 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error)
12893 __Pyx_GOTREF(__pyx_t_16);
12894 __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 296, __pyx_L1_error)
12895 __Pyx_GOTREF(__pyx_t_15);
12896 __Pyx_GIVEREF(__pyx_t_19);
12897 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_19) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
12898 __Pyx_GIVEREF(__pyx_t_16);
12899 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
12900 __pyx_t_19 = 0;
12901 __pyx_t_16 = 0;
12902 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error)
12903 __Pyx_GOTREF(__pyx_t_16);
12904 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
12905 __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 296, __pyx_L1_error)
12906 __Pyx_GOTREF(__pyx_t_15);
12907 __pyx_t_21 = 1;
12908 #if CYTHON_UNPACK_METHODS
12909 if (unlikely(PyMethod_Check(__pyx_t_20))) {
12910 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20);
12911 assert(__pyx_t_22);
12912 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_20);
12913 __Pyx_INCREF(__pyx_t_22);
12914 __Pyx_INCREF(__pyx__function);
12915 __Pyx_DECREF_SET(__pyx_t_20, __pyx__function);
12916 __pyx_t_21 = 0;
12917 }
12918 #endif
12919 {
12920 PyObject *__pyx_callargs[3] = {__pyx_t_22, __pyx_t_16, __pyx_t_15};
12921 __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_20, __pyx_callargs+__pyx_t_21, (3-__pyx_t_21) | (__pyx_t_21*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12922 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
12923 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12924 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
12925 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
12926 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 296, __pyx_L1_error)
12927 __Pyx_GOTREF(__pyx_t_17);
12928 }
12929 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 296, __pyx_L1_error)
12930 __Pyx_GOTREF(__pyx_t_20);
12931 __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 296, __pyx_L1_error)
12932 __Pyx_GOTREF(__pyx_t_15);
12933 __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error)
12934 __Pyx_GOTREF(__pyx_t_16);
12935 __Pyx_GIVEREF(__pyx_t_20);
12936 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
12937 __Pyx_GIVEREF(__pyx_t_15);
12938 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
12939 __pyx_t_20 = 0;
12940 __pyx_t_15 = 0;
12941 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 296, __pyx_L1_error)
12942 __Pyx_GOTREF(__pyx_t_15);
12943 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12944 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12945 __pyx_t_17 = NULL;
12946 if (unlikely(__pyx_v_material_functions == Py_None)) {
12947 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
12948 __PYX_ERR(0, 296, __pyx_L1_error)
12949 }
12950 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_material_right); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 296, __pyx_L1_error)
12951 __Pyx_GOTREF(__pyx_t_20);
12952 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 296, __pyx_L1_error)
12953 __Pyx_GOTREF(__pyx_t_22);
12954 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
12955 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 296, __pyx_L1_error)
12956 __Pyx_GOTREF(__pyx_t_20);
12957 __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 296, __pyx_L1_error)
12958 __Pyx_GOTREF(__pyx_t_19);
12959 __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 296, __pyx_L1_error)
12960 __Pyx_GOTREF(__pyx_t_18);
12961 __Pyx_GIVEREF(__pyx_t_20);
12962 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_20) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
12963 __Pyx_GIVEREF(__pyx_t_19);
12964 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_19) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
12965 __pyx_t_20 = 0;
12966 __pyx_t_19 = 0;
12967 __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 296, __pyx_L1_error)
12968 __Pyx_GOTREF(__pyx_t_19);
12969 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
12970 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 296, __pyx_L1_error)
12971 __Pyx_GOTREF(__pyx_t_18);
12972 __pyx_t_21 = 1;
12973 #if CYTHON_UNPACK_METHODS
12974 if (unlikely(PyMethod_Check(__pyx_t_22))) {
12975 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_22);
12976 assert(__pyx_t_17);
12977 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_22);
12978 __Pyx_INCREF(__pyx_t_17);
12979 __Pyx_INCREF(__pyx__function);
12980 __Pyx_DECREF_SET(__pyx_t_22, __pyx__function);
12981 __pyx_t_21 = 0;
12982 }
12983 #endif
12984 {
12985 PyObject *__pyx_callargs[3] = {__pyx_t_17, __pyx_t_19, __pyx_t_18};
12986 __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_22, __pyx_callargs+__pyx_t_21, (3-__pyx_t_21) | (__pyx_t_21*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12987 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
12988 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
12989 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
12990 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
12991 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error)
12992 __Pyx_GOTREF(__pyx_t_16);
12993 }
12994 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 296, __pyx_L1_error)
12995 __Pyx_GOTREF(__pyx_t_22);
12996 __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_J); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 296, __pyx_L1_error)
12997 __Pyx_GOTREF(__pyx_t_18);
12998 __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 296, __pyx_L1_error)
12999 __Pyx_GOTREF(__pyx_t_19);
13000 __Pyx_GIVEREF(__pyx_t_22);
13001 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_22) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
13002 __Pyx_GIVEREF(__pyx_t_18);
13003 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_18) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
13004 __pyx_t_22 = 0;
13005 __pyx_t_18 = 0;
13006 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 296, __pyx_L1_error)
13007 __Pyx_GOTREF(__pyx_t_18);
13008 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13009 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
13010 __pyx_t_19 = __Pyx_PyNumber_Add_object_object(__pyx_t_15, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 296, __pyx_L1_error)
13011 __Pyx_GOTREF(__pyx_t_19);
13012 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
13013 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
13014 __pyx_t_18 = __Pyx_PyFloat_AddObjC(__pyx_t_19, __pyx_mstate_global->__pyx_float_1_0eneg_20, 1.0e-20, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 296, __pyx_L1_error)
13015 __Pyx_GOTREF(__pyx_t_18);
13016 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
13017 __pyx_t_23 = __Pyx_PyFloat_AsDouble(__pyx_t_18); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
13018 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
13019 __pyx_v_denom = __pyx_t_23;
13020
13021 /* "subsurfaceTransportFunctions.pyx":297
13022 * numer = 2.0*material_functions[material_left](x[ebN,k],t)[I,J]*material_functions[material_right](x[ebN,k],t)[I,J]
13023 * denom = material_functions[material_left](x[ebN,k],t)[I,J] + material_functions[material_right](x[ebN,k],t)[I,J] + 1.0e-20
13024 * ebq_global_vals[ebN,k,I*nd+J] = numer/denom # <<<<<<<<<<<<<<
13025 *
13026 *
13027*/
13028 if (unlikely(__pyx_v_denom == 0)) {
13029 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
13030 __PYX_ERR(0, 297, __pyx_L1_error)
13031 }
13032 __pyx_t_4 = __pyx_v_ebN;
13033 __pyx_t_5 = __pyx_v_k;
13034 __pyx_t_24 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
13035 __pyx_t_25 = -1;
13036 if (__pyx_t_4 < 0) {
13037 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
13038 if (unlikely(__pyx_t_4 < 0)) __pyx_t_25 = 0;
13039 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_25 = 0;
13040 if (__pyx_t_5 < 0) {
13041 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
13042 if (unlikely(__pyx_t_5 < 0)) __pyx_t_25 = 1;
13043 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_25 = 1;
13044 if (__pyx_t_24 < 0) {
13045 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
13046 if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 2;
13047 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_25 = 2;
13048 if (unlikely(__pyx_t_25 != -1)) {
13049 __Pyx_RaiseBufferIndexError(__pyx_t_25);
13050 __PYX_ERR(0, 297, __pyx_L1_error)
13051 }
13052 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
13053 }
13054
13055 }
13056
13057 }
13058
13059 }
13060
13061
13062 /* "subsurfaceTransportFunctions.pyx":272
13063 *
13064 *
13065 * def evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
13066 * double t,
13067 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
13068*/
13069
13070 /* function exit code */
13071 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13072 goto __pyx_L0;
13073 __pyx_L1_error:;
13074 __Pyx_XDECREF(__pyx_t_15);
13075 __Pyx_XDECREF(__pyx_t_16);
13076 __Pyx_XDECREF(__pyx_t_17);
13077 __Pyx_XDECREF(__pyx_t_18);
13078 __Pyx_XDECREF(__pyx_t_19);
13079 __Pyx_XDECREF(__pyx_t_20);
13080 __Pyx_XDECREF(__pyx_t_22);
13081 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13082 __Pyx_PyThreadState_declare
13083 __Pyx_PyThreadState_assign
13084 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13085 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
13086 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
13087 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
13088 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
13089 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13090 __Pyx_AddTraceback("subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
13091 __pyx_r = NULL;
13092 goto __pyx_L2;
13093 __pyx_L0:;
13094 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
13095 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
13096 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
13097 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
13098 __pyx_L2:;
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115 __Pyx_XGIVEREF(__pyx_r);
13116 __Pyx_RefNannyFinishContext();
13117 return __pyx_r;
13118}
13119
13120/* "subsurfaceTransportFunctions.pyx":302
13121 *
13122 * ##################################################
13123 * def RE_NCP1_evaluateElementCoefficients_Linear(double rho, # <<<<<<<<<<<<<<
13124 * numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities
13125 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
13126*/
13127
13128/* Python wrapper */
13129static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self,
13130#if CYTHON_VECTORCALL
13131PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13132#else
13133PyObject *__pyx_args, PyObject *__pyx_kwds
13134#endif
13135); /*proto*/
13136PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear, "\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ");
13137static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
13138static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self,
13139#if CYTHON_VECTORCALL
13140PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13141#else
13142PyObject *__pyx_args, PyObject *__pyx_kwds
13143#endif
13144) {
13145 double __pyx_v_rho;
13146 PyArrayObject *__pyx_v_gravity = 0;
13147 PyArrayObject *__pyx_v_rowptr = 0;
13148 PyArrayObject *__pyx_v_colind = 0;
13149 PyArrayObject *__pyx_v_KWs = 0;
13150 int __pyx_v_nSpace;
13151 int __pyx_v_nElements_global;
13152 int __pyx_v_nElementBoundaries_element;
13153 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
13154 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
13155 PyArrayObject *__pyx_v_q_flin = 0;
13156 PyArrayObject *__pyx_v_q_alin = 0;
13157 #if !CYTHON_VECTORCALL
13158 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
13159 #endif
13160 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
13161 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
13162 int __pyx_lineno = 0;
13163 const char *__pyx_filename = NULL;
13164 int __pyx_clineno = 0;
13165 PyObject *__pyx_r = 0;
13166 __Pyx_RefNannyDeclarations
13167 __Pyx_RefNannySetupContext("RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
13168 #if !CYTHON_VECTORCALL
13169 #if CYTHON_ASSUME_SAFE_SIZE
13170 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
13171 #else
13172 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
13173 #endif
13174 #endif
13175 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
13176 {
13177 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rho,&__pyx_mstate_global->__pyx_n_u_gravity,&__pyx_mstate_global->__pyx_n_u_rowptr,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_KWs,&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_q_flin,&__pyx_mstate_global->__pyx_n_u_q_alin,0};
13178 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
13179 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 302, __pyx_L3_error)
13180 if (__pyx_kwds_len > 0) {
13181 switch (__pyx_nargs) {
13182 case 12:
13183 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
13184 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 302, __pyx_L3_error)
13185 CYTHON_FALLTHROUGH;
13186 case 11:
13187 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
13188 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 302, __pyx_L3_error)
13189 CYTHON_FALLTHROUGH;
13190 case 10:
13191 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
13192 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 302, __pyx_L3_error)
13193 CYTHON_FALLTHROUGH;
13194 case 9:
13195 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
13196 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 302, __pyx_L3_error)
13197 CYTHON_FALLTHROUGH;
13198 case 8:
13199 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
13200 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 302, __pyx_L3_error)
13201 CYTHON_FALLTHROUGH;
13202 case 7:
13203 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
13204 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 302, __pyx_L3_error)
13205 CYTHON_FALLTHROUGH;
13206 case 6:
13207 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
13208 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 302, __pyx_L3_error)
13209 CYTHON_FALLTHROUGH;
13210 case 5:
13211 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
13212 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 302, __pyx_L3_error)
13213 CYTHON_FALLTHROUGH;
13214 case 4:
13215 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
13216 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 302, __pyx_L3_error)
13217 CYTHON_FALLTHROUGH;
13218 case 3:
13219 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
13220 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 302, __pyx_L3_error)
13221 CYTHON_FALLTHROUGH;
13222 case 2:
13223 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
13224 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 302, __pyx_L3_error)
13225 CYTHON_FALLTHROUGH;
13226 case 1:
13227 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
13228 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 302, __pyx_L3_error)
13229 CYTHON_FALLTHROUGH;
13230 case 0: break;
13231 default: goto __pyx_L5_argtuple_error;
13232 }
13233 const Py_ssize_t kwd_pos_args = __pyx_nargs;
13234 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "RE_NCP1_evaluateElementCoefficients_Linear", 0) < (0)) __PYX_ERR(0, 302, __pyx_L3_error)
13235 for (Py_ssize_t i = __pyx_nargs; i < 12; i++) {
13236 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, i); __PYX_ERR(0, 302, __pyx_L3_error) }
13237 }
13238 } else if (unlikely(__pyx_nargs != 12)) {
13239 goto __pyx_L5_argtuple_error;
13240 } else {
13241 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
13242 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 302, __pyx_L3_error)
13243 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
13244 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 302, __pyx_L3_error)
13245 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
13246 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 302, __pyx_L3_error)
13247 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
13248 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 302, __pyx_L3_error)
13249 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
13250 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 302, __pyx_L3_error)
13251 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
13252 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 302, __pyx_L3_error)
13253 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
13254 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 302, __pyx_L3_error)
13255 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
13256 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 302, __pyx_L3_error)
13257 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
13258 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 302, __pyx_L3_error)
13259 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
13260 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 302, __pyx_L3_error)
13261 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
13262 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 302, __pyx_L3_error)
13263 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
13264 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 302, __pyx_L3_error)
13265 }
13266 __pyx_v_rho = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_rho == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error)
13267 __pyx_v_gravity = ((PyArrayObject *)values[1]);
13268 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
13269 __pyx_v_colind = ((PyArrayObject *)values[3]);
13270 __pyx_v_KWs = ((PyArrayObject *)values[4]);
13271 __pyx_v_nSpace = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
13272 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
13273 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error)
13274 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
13275 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
13276 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
13277 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
13278 }
13279 goto __pyx_L6_skip;
13280 __pyx_L5_argtuple_error:;
13281 __Pyx_RaiseArgtupleInvalid("RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, __pyx_nargs); __PYX_ERR(0, 302, __pyx_L3_error)
13282 __pyx_L6_skip:;
13283 goto __pyx_L4_argument_unpacking_done;
13284 __pyx_L3_error:;
13285 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
13286 Py_XDECREF(values[__pyx_temp]);
13287 }
13288 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
13289 __Pyx_RefNannyFinishContext();
13290 return NULL;
13291 __pyx_L4_argument_unpacking_done:;
13292 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "gravity", 0))) __PYX_ERR(0, 303, __pyx_L1_error)
13293 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
13294 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 305, __pyx_L1_error)
13295 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "KWs", 0))) __PYX_ERR(0, 306, __pyx_L1_error)
13296 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(0, 311, __pyx_L1_error)
13297 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 312, __pyx_L1_error)
13298 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_flin", 0))) __PYX_ERR(0, 313, __pyx_L1_error)
13299 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_alin", 0))) __PYX_ERR(0, 314, __pyx_L1_error)
13300 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
13301
13302 /* function exit code */
13303 goto __pyx_L0;
13304 __pyx_L1_error:;
13305 __pyx_r = NULL;
13306 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
13307 Py_XDECREF(values[__pyx_temp]);
13308 }
13309 goto __pyx_L7_cleaned_up;
13310 __pyx_L0:;
13311 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
13312 Py_XDECREF(values[__pyx_temp]);
13313 }
13314 __pyx_L7_cleaned_up:;
13315
13316
13317
13318
13319 __Pyx_RefNannyFinishContext();
13320 return __pyx_r;
13321}
13322
13323static 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) {
13324 int __pyx_v_eN;
13325 int __pyx_v_eN_neighbor;
13326 int __pyx_v_ii;
13327 int __pyx_v_I;
13328 int __pyx_v_ebN;
13329 int __pyx_v_matID;
13330 int __pyx_v_matID_neig;
13331 CYTHON_UNUSED int __pyx_v_nSpace2;
13332 int __pyx_v_nnz;
13333 PyArrayObject *__pyx_v_a_eN = 0;
13334 PyArrayObject *__pyx_v_a_neig = 0;
13335 PyArrayObject *__pyx_v_a_avg = 0;
13336 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
13337 __Pyx_Buffer __pyx_pybuffer_KWs;
13338 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
13339 __Pyx_Buffer __pyx_pybuffer_a_avg;
13340 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
13341 __Pyx_Buffer __pyx_pybuffer_a_eN;
13342 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
13343 __Pyx_Buffer __pyx_pybuffer_a_neig;
13344 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
13345 __Pyx_Buffer __pyx_pybuffer_colind;
13346 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
13347 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
13348 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
13349 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
13350 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
13351 __Pyx_Buffer __pyx_pybuffer_gravity;
13352 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
13353 __Pyx_Buffer __pyx_pybuffer_q_alin;
13354 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
13355 __Pyx_Buffer __pyx_pybuffer_q_flin;
13356 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
13357 __Pyx_Buffer __pyx_pybuffer_rowptr;
13358 PyObject *__pyx_r = NULL;
13359 __Pyx_RefNannyDeclarations
13360 Py_ssize_t __pyx_t_1;
13361 int __pyx_t_2;
13362 PyObject *__pyx_t_3 = NULL;
13363 PyObject *__pyx_t_4 = NULL;
13364 PyObject *__pyx_t_5 = NULL;
13365 PyObject *__pyx_t_6 = NULL;
13366 size_t __pyx_t_7;
13367 int __pyx_t_8;
13368 int __pyx_t_9;
13369 int __pyx_t_10;
13370 int __pyx_t_11;
13371 int __pyx_t_12;
13372 Py_ssize_t __pyx_t_13;
13373 int __pyx_t_14;
13374 Py_ssize_t __pyx_t_15;
13375 int __pyx_t_16;
13376 int __pyx_t_17;
13377 int __pyx_t_18;
13378 int __pyx_t_19;
13379 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
13380 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_21;
13381 Py_ssize_t __pyx_t_22;
13382 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_23;
13383 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_24;
13384 int __pyx_t_25;
13385 Py_ssize_t __pyx_t_26;
13386 Py_ssize_t __pyx_t_27;
13387 Py_ssize_t __pyx_t_28;
13388 int __pyx_lineno = 0;
13389 const char *__pyx_filename = NULL;
13390 int __pyx_clineno = 0;
13391 __Pyx_RefNannySetupContext("RE_NCP1_evaluateElementCoefficients_Linear", 0);
13392 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
13393 __pyx_pybuffer_a_eN.refcount = 0;
13394 __pyx_pybuffernd_a_eN.data = NULL;
13395 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
13396 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
13397 __pyx_pybuffer_a_neig.refcount = 0;
13398 __pyx_pybuffernd_a_neig.data = NULL;
13399 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
13400 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
13401 __pyx_pybuffer_a_avg.refcount = 0;
13402 __pyx_pybuffernd_a_avg.data = NULL;
13403 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
13404 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
13405 __pyx_pybuffer_gravity.refcount = 0;
13406 __pyx_pybuffernd_gravity.data = NULL;
13407 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
13408 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
13409 __pyx_pybuffer_rowptr.refcount = 0;
13410 __pyx_pybuffernd_rowptr.data = NULL;
13411 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
13412 __pyx_pybuffer_colind.pybuffer.buf = NULL;
13413 __pyx_pybuffer_colind.refcount = 0;
13414 __pyx_pybuffernd_colind.data = NULL;
13415 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
13416 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
13417 __pyx_pybuffer_KWs.refcount = 0;
13418 __pyx_pybuffernd_KWs.data = NULL;
13419 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
13420 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
13421 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
13422 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
13423 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
13424 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
13425 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
13426 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
13427 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
13428 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
13429 __pyx_pybuffer_q_flin.refcount = 0;
13430 __pyx_pybuffernd_q_flin.data = NULL;
13431 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
13432 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
13433 __pyx_pybuffer_q_alin.refcount = 0;
13434 __pyx_pybuffernd_q_alin.data = NULL;
13435 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
13436 {
13437 __Pyx_BufFmt_StackElem __pyx_stack[1];
13438 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
13439 }
13440 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
13441 {
13442 __Pyx_BufFmt_StackElem __pyx_stack[1];
13443 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
13444 }
13445 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
13446 {
13447 __Pyx_BufFmt_StackElem __pyx_stack[1];
13448 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
13449 }
13450 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
13451 {
13452 __Pyx_BufFmt_StackElem __pyx_stack[1];
13453 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
13454 }
13455 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
13456 {
13457 __Pyx_BufFmt_StackElem __pyx_stack[1];
13458 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
13459 }
13460 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
13461 {
13462 __Pyx_BufFmt_StackElem __pyx_stack[1];
13463 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, 302, __pyx_L1_error)
13464 }
13465 __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];
13466 {
13467 __Pyx_BufFmt_StackElem __pyx_stack[1];
13468 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
13469 }
13470 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
13471 {
13472 __Pyx_BufFmt_StackElem __pyx_stack[1];
13473 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
13474 }
13475 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
13476
13477 /* "subsurfaceTransportFunctions.pyx":329
13478 * #temporaries
13479 * cdef int eN,eN_neighbor,ii,I,ebN,matID,matID_neig
13480 * cdef int nSpace2 = nSpace*nSpace # <<<<<<<<<<<<<<
13481 * cdef int nnz = rowptr[nSpace]
13482 *
13483*/
13484 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
13485
13486 /* "subsurfaceTransportFunctions.pyx":330
13487 * cdef int eN,eN_neighbor,ii,I,ebN,matID,matID_neig
13488 * cdef int nSpace2 = nSpace*nSpace
13489 * cdef int nnz = rowptr[nSpace] # <<<<<<<<<<<<<<
13490 *
13491 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_eN = numpy.zeros(nnz,'d')
13492*/
13493 __pyx_t_1 = __pyx_v_nSpace;
13494 __pyx_t_2 = -1;
13495 if (__pyx_t_1 < 0) {
13496 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13497 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
13498 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
13499 if (unlikely(__pyx_t_2 != -1)) {
13500 __Pyx_RaiseBufferIndexError(__pyx_t_2);
13501 __PYX_ERR(0, 330, __pyx_L1_error)
13502 }
13503 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13504
13505 /* "subsurfaceTransportFunctions.pyx":332
13506 * cdef int nnz = rowptr[nSpace]
13507 *
13508 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_eN = numpy.zeros(nnz,'d') # <<<<<<<<<<<<<<
13509 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_neig = numpy.zeros(nnz,'d')
13510 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_avg = numpy.zeros(nnz,'d')
13511*/
13512 __pyx_t_4 = NULL;
13513 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
13514 __Pyx_GOTREF(__pyx_t_5);
13515 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
13516 __Pyx_GOTREF(__pyx_t_6);
13517 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13518 __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
13519 __Pyx_GOTREF(__pyx_t_5);
13520 __pyx_t_7 = 1;
13521 #if CYTHON_UNPACK_METHODS
13522 if (unlikely(PyMethod_Check(__pyx_t_6))) {
13523 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
13524 assert(__pyx_t_4);
13525 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
13526 __Pyx_INCREF(__pyx_t_4);
13527 __Pyx_INCREF(__pyx__function);
13528 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
13529 __pyx_t_7 = 0;
13530 }
13531 #endif
13532 {
13533 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_d};
13534 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
13535 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13536 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13537 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13538 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
13539 __Pyx_GOTREF(__pyx_t_3);
13540 }
13541 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error)
13542 {
13543 __Pyx_BufFmt_StackElem __pyx_stack[1];
13544 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13545 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
13546 __PYX_ERR(0, 332, __pyx_L1_error)
13547 } else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
13548 }
13549 }
13550 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
13551 __pyx_t_3 = 0;
13552
13553 /* "subsurfaceTransportFunctions.pyx":333
13554 *
13555 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_eN = numpy.zeros(nnz,'d')
13556 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_neig = numpy.zeros(nnz,'d') # <<<<<<<<<<<<<<
13557 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_avg = numpy.zeros(nnz,'d')
13558 *
13559*/
13560 __pyx_t_6 = NULL;
13561 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
13562 __Pyx_GOTREF(__pyx_t_5);
13563 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
13564 __Pyx_GOTREF(__pyx_t_4);
13565 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13566 __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
13567 __Pyx_GOTREF(__pyx_t_5);
13568 __pyx_t_7 = 1;
13569 #if CYTHON_UNPACK_METHODS
13570 if (unlikely(PyMethod_Check(__pyx_t_4))) {
13571 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
13572 assert(__pyx_t_6);
13573 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
13574 __Pyx_INCREF(__pyx_t_6);
13575 __Pyx_INCREF(__pyx__function);
13576 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
13577 __pyx_t_7 = 0;
13578 }
13579 #endif
13580 {
13581 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_d};
13582 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
13583 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13584 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13585 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13586 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
13587 __Pyx_GOTREF(__pyx_t_3);
13588 }
13589 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
13590 {
13591 __Pyx_BufFmt_StackElem __pyx_stack[1];
13592 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13593 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
13594 __PYX_ERR(0, 333, __pyx_L1_error)
13595 } else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
13596 }
13597 }
13598 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
13599 __pyx_t_3 = 0;
13600
13601 /* "subsurfaceTransportFunctions.pyx":334
13602 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_eN = numpy.zeros(nnz,'d')
13603 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_neig = numpy.zeros(nnz,'d')
13604 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_avg = numpy.zeros(nnz,'d') # <<<<<<<<<<<<<<
13605 *
13606 * #loop through and evaluate
13607*/
13608 __pyx_t_4 = NULL;
13609 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
13610 __Pyx_GOTREF(__pyx_t_5);
13611 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
13612 __Pyx_GOTREF(__pyx_t_6);
13613 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13614 __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
13615 __Pyx_GOTREF(__pyx_t_5);
13616 __pyx_t_7 = 1;
13617 #if CYTHON_UNPACK_METHODS
13618 if (unlikely(PyMethod_Check(__pyx_t_6))) {
13619 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
13620 assert(__pyx_t_4);
13621 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
13622 __Pyx_INCREF(__pyx_t_4);
13623 __Pyx_INCREF(__pyx__function);
13624 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
13625 __pyx_t_7 = 0;
13626 }
13627 #endif
13628 {
13629 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_d};
13630 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
13631 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13632 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13633 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13634 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
13635 __Pyx_GOTREF(__pyx_t_3);
13636 }
13637 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 334, __pyx_L1_error)
13638 {
13639 __Pyx_BufFmt_StackElem __pyx_stack[1];
13640 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13641 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
13642 __PYX_ERR(0, 334, __pyx_L1_error)
13643 } else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
13644 }
13645 }
13646 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
13647 __pyx_t_3 = 0;
13648
13649 /* "subsurfaceTransportFunctions.pyx":337
13650 *
13651 * #loop through and evaluate
13652 * for eN in range(nElements_global): # <<<<<<<<<<<<<<
13653 * matID = elementMaterialTypes[eN]
13654 * for ii in range(nnz):
13655*/
13656
13657 __pyx_t_2 = __pyx_v_nElements_global;
13658 __pyx_t_8 = __pyx_t_2;
13659
13660 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
13661 __pyx_v_eN = __pyx_t_9;
13662
13663 /* "subsurfaceTransportFunctions.pyx":338
13664 * #loop through and evaluate
13665 * for eN in range(nElements_global):
13666 * matID = elementMaterialTypes[eN] # <<<<<<<<<<<<<<
13667 * for ii in range(nnz):
13668 * a_eN[ii] = rho*KWs[matID,ii]
13669*/
13670 __pyx_t_1 = __pyx_v_eN;
13671 __pyx_t_10 = -1;
13672 if (__pyx_t_1 < 0) {
13673 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
13674 if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
13675 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_10 = 0;
13676 if (unlikely(__pyx_t_10 != -1)) {
13677 __Pyx_RaiseBufferIndexError(__pyx_t_10);
13678 __PYX_ERR(0, 338, __pyx_L1_error)
13679 }
13680 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
13681
13682 /* "subsurfaceTransportFunctions.pyx":339
13683 * for eN in range(nElements_global):
13684 * matID = elementMaterialTypes[eN]
13685 * for ii in range(nnz): # <<<<<<<<<<<<<<
13686 * a_eN[ii] = rho*KWs[matID,ii]
13687 * for ebN in range(nElementBoundaries_element):
13688*/
13689
13690 __pyx_t_10 = __pyx_v_nnz;
13691 __pyx_t_11 = __pyx_t_10;
13692
13693 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
13694 __pyx_v_ii = __pyx_t_12;
13695
13696 /* "subsurfaceTransportFunctions.pyx":340
13697 * matID = elementMaterialTypes[eN]
13698 * for ii in range(nnz):
13699 * a_eN[ii] = rho*KWs[matID,ii] # <<<<<<<<<<<<<<
13700 * for ebN in range(nElementBoundaries_element):
13701 * eN_neighbor = elementNeighborsArray[eN,ebN]
13702*/
13703 __pyx_t_1 = __pyx_v_matID;
13704 __pyx_t_13 = __pyx_v_ii;
13705 __pyx_t_14 = -1;
13706 if (__pyx_t_1 < 0) {
13707 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
13708 if (unlikely(__pyx_t_1 < 0)) __pyx_t_14 = 0;
13709 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_14 = 0;
13710 if (__pyx_t_13 < 0) {
13711 __pyx_t_13 += __pyx_pybuffernd_KWs.diminfo[1].shape;
13712 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1;
13713 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_14 = 1;
13714 if (unlikely(__pyx_t_14 != -1)) {
13715 __Pyx_RaiseBufferIndexError(__pyx_t_14);
13716 __PYX_ERR(0, 340, __pyx_L1_error)
13717 }
13718 __pyx_t_15 = __pyx_v_ii;
13719 __pyx_t_14 = -1;
13720 if (__pyx_t_15 < 0) {
13721 __pyx_t_15 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
13722 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
13723 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_14 = 0;
13724 if (unlikely(__pyx_t_14 != -1)) {
13725 __Pyx_RaiseBufferIndexError(__pyx_t_14);
13726 __PYX_ERR(0, 340, __pyx_L1_error)
13727 }
13728 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_KWs.diminfo[1].strides)));
13729 }
13730
13731
13732 /* "subsurfaceTransportFunctions.pyx":341
13733 * for ii in range(nnz):
13734 * a_eN[ii] = rho*KWs[matID,ii]
13735 * for ebN in range(nElementBoundaries_element): # <<<<<<<<<<<<<<
13736 * eN_neighbor = elementNeighborsArray[eN,ebN]
13737 * for ii in range(nnz):
13738*/
13739
13740 __pyx_t_10 = __pyx_v_nElementBoundaries_element;
13741 __pyx_t_11 = __pyx_t_10;
13742
13743 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
13744 __pyx_v_ebN = __pyx_t_12;
13745
13746 /* "subsurfaceTransportFunctions.pyx":342
13747 * a_eN[ii] = rho*KWs[matID,ii]
13748 * for ebN in range(nElementBoundaries_element):
13749 * eN_neighbor = elementNeighborsArray[eN,ebN] # <<<<<<<<<<<<<<
13750 * for ii in range(nnz):
13751 * a_neig[ii] = a_eN[ii]
13752*/
13753 __pyx_t_13 = __pyx_v_eN;
13754 __pyx_t_1 = __pyx_v_ebN;
13755 __pyx_t_14 = -1;
13756 if (__pyx_t_13 < 0) {
13757 __pyx_t_13 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
13758 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
13759 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_14 = 0;
13760 if (__pyx_t_1 < 0) {
13761 __pyx_t_1 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
13762 if (unlikely(__pyx_t_1 < 0)) __pyx_t_14 = 1;
13763 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_14 = 1;
13764 if (unlikely(__pyx_t_14 != -1)) {
13765 __Pyx_RaiseBufferIndexError(__pyx_t_14);
13766 __PYX_ERR(0, 342, __pyx_L1_error)
13767 }
13768 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_1, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
13769
13770 /* "subsurfaceTransportFunctions.pyx":343
13771 * for ebN in range(nElementBoundaries_element):
13772 * eN_neighbor = elementNeighborsArray[eN,ebN]
13773 * for ii in range(nnz): # <<<<<<<<<<<<<<
13774 * a_neig[ii] = a_eN[ii]
13775 * if eN_neighbor >= 0:
13776*/
13777
13778 __pyx_t_14 = __pyx_v_nnz;
13779 __pyx_t_16 = __pyx_t_14;
13780
13781 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
13782 __pyx_v_ii = __pyx_t_17;
13783
13784 /* "subsurfaceTransportFunctions.pyx":344
13785 * eN_neighbor = elementNeighborsArray[eN,ebN]
13786 * for ii in range(nnz):
13787 * a_neig[ii] = a_eN[ii] # <<<<<<<<<<<<<<
13788 * if eN_neighbor >= 0:
13789 * matID_neig = elementMaterialTypes[eN_neighbor]
13790*/
13791 __pyx_t_1 = __pyx_v_ii;
13792 __pyx_t_18 = -1;
13793 if (__pyx_t_1 < 0) {
13794 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
13795 if (unlikely(__pyx_t_1 < 0)) __pyx_t_18 = 0;
13796 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_18 = 0;
13797 if (unlikely(__pyx_t_18 != -1)) {
13798 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13799 __PYX_ERR(0, 344, __pyx_L1_error)
13800 }
13801 __pyx_t_13 = __pyx_v_ii;
13802 __pyx_t_18 = -1;
13803 if (__pyx_t_13 < 0) {
13804 __pyx_t_13 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
13805 if (unlikely(__pyx_t_13 < 0)) __pyx_t_18 = 0;
13806 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_18 = 0;
13807 if (unlikely(__pyx_t_18 != -1)) {
13808 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13809 __PYX_ERR(0, 344, __pyx_L1_error)
13810 }
13811 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides));
13812 }
13813
13814
13815 /* "subsurfaceTransportFunctions.pyx":345
13816 * for ii in range(nnz):
13817 * a_neig[ii] = a_eN[ii]
13818 * if eN_neighbor >= 0: # <<<<<<<<<<<<<<
13819 * matID_neig = elementMaterialTypes[eN_neighbor]
13820 * for ii in range(nnz):
13821*/
13822 __pyx_t_19 = (__pyx_v_eN_neighbor >= 0);
13823
13824 if (__pyx_t_19) {
13825
13826
13827 /* "subsurfaceTransportFunctions.pyx":346
13828 * a_neig[ii] = a_eN[ii]
13829 * if eN_neighbor >= 0:
13830 * matID_neig = elementMaterialTypes[eN_neighbor] # <<<<<<<<<<<<<<
13831 * for ii in range(nnz):
13832 * a_neig[ii] = rho*KWs[matID_neig,ii]
13833*/
13834 __pyx_t_1 = __pyx_v_eN_neighbor;
13835 __pyx_t_14 = -1;
13836 if (__pyx_t_1 < 0) {
13837 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
13838 if (unlikely(__pyx_t_1 < 0)) __pyx_t_14 = 0;
13839 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_14 = 0;
13840 if (unlikely(__pyx_t_14 != -1)) {
13841 __Pyx_RaiseBufferIndexError(__pyx_t_14);
13842 __PYX_ERR(0, 346, __pyx_L1_error)
13843 }
13844 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
13845
13846 /* "subsurfaceTransportFunctions.pyx":347
13847 * if eN_neighbor >= 0:
13848 * matID_neig = elementMaterialTypes[eN_neighbor]
13849 * for ii in range(nnz): # <<<<<<<<<<<<<<
13850 * a_neig[ii] = rho*KWs[matID_neig,ii]
13851 * for ii in range(nnz):
13852*/
13853
13854 __pyx_t_14 = __pyx_v_nnz;
13855 __pyx_t_16 = __pyx_t_14;
13856
13857 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
13858 __pyx_v_ii = __pyx_t_17;
13859
13860 /* "subsurfaceTransportFunctions.pyx":348
13861 * matID_neig = elementMaterialTypes[eN_neighbor]
13862 * for ii in range(nnz):
13863 * a_neig[ii] = rho*KWs[matID_neig,ii] # <<<<<<<<<<<<<<
13864 * for ii in range(nnz):
13865 * a_avg[ii] = 2.0*a_eN[ii]*a_neig[ii]/(a_eN[ii]+a_neig[ii]+1.0e-20)
13866*/
13867 __pyx_t_1 = __pyx_v_matID_neig;
13868 __pyx_t_13 = __pyx_v_ii;
13869 __pyx_t_18 = -1;
13870 if (__pyx_t_1 < 0) {
13871 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
13872 if (unlikely(__pyx_t_1 < 0)) __pyx_t_18 = 0;
13873 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_18 = 0;
13874 if (__pyx_t_13 < 0) {
13875 __pyx_t_13 += __pyx_pybuffernd_KWs.diminfo[1].shape;
13876 if (unlikely(__pyx_t_13 < 0)) __pyx_t_18 = 1;
13877 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_18 = 1;
13878 if (unlikely(__pyx_t_18 != -1)) {
13879 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13880 __PYX_ERR(0, 348, __pyx_L1_error)
13881 }
13882 __pyx_t_15 = __pyx_v_ii;
13883 __pyx_t_18 = -1;
13884 if (__pyx_t_15 < 0) {
13885 __pyx_t_15 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
13886 if (unlikely(__pyx_t_15 < 0)) __pyx_t_18 = 0;
13887 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_18 = 0;
13888 if (unlikely(__pyx_t_18 != -1)) {
13889 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13890 __PYX_ERR(0, 348, __pyx_L1_error)
13891 }
13892 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_KWs.diminfo[1].strides)));
13893 }
13894
13895
13896 /* "subsurfaceTransportFunctions.pyx":345
13897 * for ii in range(nnz):
13898 * a_neig[ii] = a_eN[ii]
13899 * if eN_neighbor >= 0: # <<<<<<<<<<<<<<
13900 * matID_neig = elementMaterialTypes[eN_neighbor]
13901 * for ii in range(nnz):
13902*/
13903 }
13904
13905 /* "subsurfaceTransportFunctions.pyx":349
13906 * for ii in range(nnz):
13907 * a_neig[ii] = rho*KWs[matID_neig,ii]
13908 * for ii in range(nnz): # <<<<<<<<<<<<<<
13909 * a_avg[ii] = 2.0*a_eN[ii]*a_neig[ii]/(a_eN[ii]+a_neig[ii]+1.0e-20)
13910 * q_alin[eN,ebN,ii] = a_avg[ii]
13911*/
13912
13913 __pyx_t_14 = __pyx_v_nnz;
13914 __pyx_t_16 = __pyx_t_14;
13915
13916 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
13917 __pyx_v_ii = __pyx_t_17;
13918
13919 /* "subsurfaceTransportFunctions.pyx":350
13920 * a_neig[ii] = rho*KWs[matID_neig,ii]
13921 * for ii in range(nnz):
13922 * a_avg[ii] = 2.0*a_eN[ii]*a_neig[ii]/(a_eN[ii]+a_neig[ii]+1.0e-20) # <<<<<<<<<<<<<<
13923 * q_alin[eN,ebN,ii] = a_avg[ii]
13924 * for I in range(nSpace):
13925*/
13926 __pyx_t_13 = __pyx_v_ii;
13927 __pyx_t_18 = -1;
13928 if (__pyx_t_13 < 0) {
13929 __pyx_t_13 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
13930 if (unlikely(__pyx_t_13 < 0)) __pyx_t_18 = 0;
13931 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_18 = 0;
13932 if (unlikely(__pyx_t_18 != -1)) {
13933 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13934 __PYX_ERR(0, 350, __pyx_L1_error)
13935 }
13936 __pyx_t_1 = __pyx_v_ii;
13937 __pyx_t_18 = -1;
13938 if (__pyx_t_1 < 0) {
13939 __pyx_t_1 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
13940 if (unlikely(__pyx_t_1 < 0)) __pyx_t_18 = 0;
13941 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_18 = 0;
13942 if (unlikely(__pyx_t_18 != -1)) {
13943 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13944 __PYX_ERR(0, 350, __pyx_L1_error)
13945 }
13946 __pyx_t_20 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
13947
13948 __pyx_t_1 = __pyx_v_ii;
13949 __pyx_t_18 = -1;
13950 if (__pyx_t_1 < 0) {
13951 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
13952 if (unlikely(__pyx_t_1 < 0)) __pyx_t_18 = 0;
13953 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_18 = 0;
13954 if (unlikely(__pyx_t_18 != -1)) {
13955 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13956 __PYX_ERR(0, 350, __pyx_L1_error)
13957 }
13958 __pyx_t_13 = __pyx_v_ii;
13959 __pyx_t_18 = -1;
13960 if (__pyx_t_13 < 0) {
13961 __pyx_t_13 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
13962 if (unlikely(__pyx_t_13 < 0)) __pyx_t_18 = 0;
13963 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_18 = 0;
13964 if (unlikely(__pyx_t_18 != -1)) {
13965 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13966 __PYX_ERR(0, 350, __pyx_L1_error)
13967 }
13968 __pyx_t_21 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
13969
13970 if (unlikely(__pyx_t_21 == 0)) {
13971 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
13972 __PYX_ERR(0, 350, __pyx_L1_error)
13973 }
13974 __pyx_t_13 = __pyx_v_ii;
13975 __pyx_t_18 = -1;
13976 if (__pyx_t_13 < 0) {
13977 __pyx_t_13 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
13978 if (unlikely(__pyx_t_13 < 0)) __pyx_t_18 = 0;
13979 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_18 = 0;
13980 if (unlikely(__pyx_t_18 != -1)) {
13981 __Pyx_RaiseBufferIndexError(__pyx_t_18);
13982 __PYX_ERR(0, 350, __pyx_L1_error)
13983 }
13984 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_20 / __pyx_t_21);
13985
13986
13987
13988 /* "subsurfaceTransportFunctions.pyx":351
13989 * for ii in range(nnz):
13990 * a_avg[ii] = 2.0*a_eN[ii]*a_neig[ii]/(a_eN[ii]+a_neig[ii]+1.0e-20)
13991 * q_alin[eN,ebN,ii] = a_avg[ii] # <<<<<<<<<<<<<<
13992 * for I in range(nSpace):
13993 * q_flin[eN,ebN,I] = 0.0
13994*/
13995 __pyx_t_13 = __pyx_v_ii;
13996 __pyx_t_18 = -1;
13997 if (__pyx_t_13 < 0) {
13998 __pyx_t_13 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
13999 if (unlikely(__pyx_t_13 < 0)) __pyx_t_18 = 0;
14000 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_18 = 0;
14001 if (unlikely(__pyx_t_18 != -1)) {
14002 __Pyx_RaiseBufferIndexError(__pyx_t_18);
14003 __PYX_ERR(0, 351, __pyx_L1_error)
14004 }
14005 __pyx_t_1 = __pyx_v_eN;
14006 __pyx_t_15 = __pyx_v_ebN;
14007 __pyx_t_22 = __pyx_v_ii;
14008 __pyx_t_18 = -1;
14009 if (__pyx_t_1 < 0) {
14010 __pyx_t_1 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
14011 if (unlikely(__pyx_t_1 < 0)) __pyx_t_18 = 0;
14012 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_18 = 0;
14013 if (__pyx_t_15 < 0) {
14014 __pyx_t_15 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
14015 if (unlikely(__pyx_t_15 < 0)) __pyx_t_18 = 1;
14016 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_18 = 1;
14017 if (__pyx_t_22 < 0) {
14018 __pyx_t_22 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
14019 if (unlikely(__pyx_t_22 < 0)) __pyx_t_18 = 2;
14020 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_18 = 2;
14021 if (unlikely(__pyx_t_18 != -1)) {
14022 __Pyx_RaiseBufferIndexError(__pyx_t_18);
14023 __PYX_ERR(0, 351, __pyx_L1_error)
14024 }
14025 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a_avg.diminfo[0].strides));
14026 }
14027
14028
14029 /* "subsurfaceTransportFunctions.pyx":352
14030 * a_avg[ii] = 2.0*a_eN[ii]*a_neig[ii]/(a_eN[ii]+a_neig[ii]+1.0e-20)
14031 * q_alin[eN,ebN,ii] = a_avg[ii]
14032 * for I in range(nSpace): # <<<<<<<<<<<<<<
14033 * q_flin[eN,ebN,I] = 0.0
14034 * for ii in range(rowptr[I],rowptr[I+1]):
14035*/
14036
14037 __pyx_t_14 = __pyx_v_nSpace;
14038 __pyx_t_16 = __pyx_t_14;
14039
14040 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
14041 __pyx_v_I = __pyx_t_17;
14042
14043 /* "subsurfaceTransportFunctions.pyx":353
14044 * q_alin[eN,ebN,ii] = a_avg[ii]
14045 * for I in range(nSpace):
14046 * q_flin[eN,ebN,I] = 0.0 # <<<<<<<<<<<<<<
14047 * for ii in range(rowptr[I],rowptr[I+1]):
14048 * q_flin[eN,ebN,I] += rho*a_avg[ii]*gravity[colind[ii]]
14049*/
14050 __pyx_t_13 = __pyx_v_eN;
14051 __pyx_t_22 = __pyx_v_ebN;
14052 __pyx_t_15 = __pyx_v_I;
14053 __pyx_t_18 = -1;
14054 if (__pyx_t_13 < 0) {
14055 __pyx_t_13 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
14056 if (unlikely(__pyx_t_13 < 0)) __pyx_t_18 = 0;
14057 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_18 = 0;
14058 if (__pyx_t_22 < 0) {
14059 __pyx_t_22 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
14060 if (unlikely(__pyx_t_22 < 0)) __pyx_t_18 = 1;
14061 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_18 = 1;
14062 if (__pyx_t_15 < 0) {
14063 __pyx_t_15 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
14064 if (unlikely(__pyx_t_15 < 0)) __pyx_t_18 = 2;
14065 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_18 = 2;
14066 if (unlikely(__pyx_t_18 != -1)) {
14067 __Pyx_RaiseBufferIndexError(__pyx_t_18);
14068 __PYX_ERR(0, 353, __pyx_L1_error)
14069 }
14070 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
14071
14072 /* "subsurfaceTransportFunctions.pyx":354
14073 * for I in range(nSpace):
14074 * q_flin[eN,ebN,I] = 0.0
14075 * for ii in range(rowptr[I],rowptr[I+1]): # <<<<<<<<<<<<<<
14076 * q_flin[eN,ebN,I] += rho*a_avg[ii]*gravity[colind[ii]]
14077 * #ebN
14078*/
14079 __pyx_t_15 = (__pyx_v_I + 1);
14080 __pyx_t_18 = -1;
14081 if (__pyx_t_15 < 0) {
14082 __pyx_t_15 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14083 if (unlikely(__pyx_t_15 < 0)) __pyx_t_18 = 0;
14084 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_18 = 0;
14085 if (unlikely(__pyx_t_18 != -1)) {
14086 __Pyx_RaiseBufferIndexError(__pyx_t_18);
14087 __PYX_ERR(0, 354, __pyx_L1_error)
14088 }
14089
14090 __pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14091 __pyx_t_15 = __pyx_v_I;
14092 __pyx_t_18 = -1;
14093 if (__pyx_t_15 < 0) {
14094 __pyx_t_15 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14095 if (unlikely(__pyx_t_15 < 0)) __pyx_t_18 = 0;
14096 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_18 = 0;
14097 if (unlikely(__pyx_t_18 != -1)) {
14098 __Pyx_RaiseBufferIndexError(__pyx_t_18);
14099 __PYX_ERR(0, 354, __pyx_L1_error)
14100 }
14101 __pyx_t_24 = __pyx_t_23;
14102
14103 for (__pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_18 < __pyx_t_24; __pyx_t_18+=1) {
14104 __pyx_v_ii = __pyx_t_18;
14105
14106 /* "subsurfaceTransportFunctions.pyx":355
14107 * q_flin[eN,ebN,I] = 0.0
14108 * for ii in range(rowptr[I],rowptr[I+1]):
14109 * q_flin[eN,ebN,I] += rho*a_avg[ii]*gravity[colind[ii]] # <<<<<<<<<<<<<<
14110 * #ebN
14111 * #eN
14112*/
14113 __pyx_t_22 = __pyx_v_ii;
14114 __pyx_t_25 = -1;
14115 if (__pyx_t_22 < 0) {
14116 __pyx_t_22 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
14117 if (unlikely(__pyx_t_22 < 0)) __pyx_t_25 = 0;
14118 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_25 = 0;
14119 if (unlikely(__pyx_t_25 != -1)) {
14120 __Pyx_RaiseBufferIndexError(__pyx_t_25);
14121 __PYX_ERR(0, 355, __pyx_L1_error)
14122 }
14123 __pyx_t_13 = __pyx_v_ii;
14124 __pyx_t_25 = -1;
14125 if (__pyx_t_13 < 0) {
14126 __pyx_t_13 += __pyx_pybuffernd_colind.diminfo[0].shape;
14127 if (unlikely(__pyx_t_13 < 0)) __pyx_t_25 = 0;
14128 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_25 = 0;
14129 if (unlikely(__pyx_t_25 != -1)) {
14130 __Pyx_RaiseBufferIndexError(__pyx_t_25);
14131 __PYX_ERR(0, 355, __pyx_L1_error)
14132 }
14133 __pyx_t_1 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_colind.diminfo[0].strides));
14134 __pyx_t_25 = -1;
14135 if (__pyx_t_1 < 0) {
14136 __pyx_t_1 += __pyx_pybuffernd_gravity.diminfo[0].shape;
14137 if (unlikely(__pyx_t_1 < 0)) __pyx_t_25 = 0;
14138 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_25 = 0;
14139 if (unlikely(__pyx_t_25 != -1)) {
14140 __Pyx_RaiseBufferIndexError(__pyx_t_25);
14141 __PYX_ERR(0, 355, __pyx_L1_error)
14142 }
14143 __pyx_t_26 = __pyx_v_eN;
14144 __pyx_t_27 = __pyx_v_ebN;
14145 __pyx_t_28 = __pyx_v_I;
14146 __pyx_t_25 = -1;
14147 if (__pyx_t_26 < 0) {
14148 __pyx_t_26 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
14149 if (unlikely(__pyx_t_26 < 0)) __pyx_t_25 = 0;
14150 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_25 = 0;
14151 if (__pyx_t_27 < 0) {
14152 __pyx_t_27 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
14153 if (unlikely(__pyx_t_27 < 0)) __pyx_t_25 = 1;
14154 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_25 = 1;
14155 if (__pyx_t_28 < 0) {
14156 __pyx_t_28 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
14157 if (unlikely(__pyx_t_28 < 0)) __pyx_t_25 = 2;
14158 } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_25 = 2;
14159 if (unlikely(__pyx_t_25 != -1)) {
14160 __Pyx_RaiseBufferIndexError(__pyx_t_25);
14161 __PYX_ERR(0, 355, __pyx_L1_error)
14162 }
14163 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gravity.diminfo[0].strides)));
14164 }
14165
14166 }
14167
14168 }
14169
14170 }
14171
14172
14173 /* "subsurfaceTransportFunctions.pyx":302
14174 *
14175 * ##################################################
14176 * def RE_NCP1_evaluateElementCoefficients_Linear(double rho, # <<<<<<<<<<<<<<
14177 * numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities
14178 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
14179*/
14180
14181 /* function exit code */
14182 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14183 goto __pyx_L0;
14184 __pyx_L1_error:;
14185 __Pyx_XDECREF(__pyx_t_3);
14186 __Pyx_XDECREF(__pyx_t_4);
14187 __Pyx_XDECREF(__pyx_t_5);
14188 __Pyx_XDECREF(__pyx_t_6);
14189 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14190 __Pyx_PyThreadState_declare
14191 __Pyx_PyThreadState_assign
14192 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14193 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
14194 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
14195 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
14196 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
14197 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14198 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
14199 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14200 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14201 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14202 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14203 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14204 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14205 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
14206 __pyx_r = NULL;
14207 goto __pyx_L2;
14208 __pyx_L0:;
14209 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
14210 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
14211 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
14212 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
14213 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14214 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
14215 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14216 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14217 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14218 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14219 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14220 __pyx_L2:;
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
14231 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
14232 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255 __Pyx_XGIVEREF(__pyx_r);
14256 __Pyx_RefNannyFinishContext();
14257 return __pyx_r;
14258}
14259
14260/* "subsurfaceTransportFunctions.pyx":360
14261 *
14262 *
14263 * def RE_NCP1_evaluateElementCoefficients_VGM(double rho, # <<<<<<<<<<<<<<
14264 * double beta,
14265 * numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities
14266*/
14267
14268/* Python wrapper */
14269static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self,
14270#if CYTHON_VECTORCALL
14271PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14272#else
14273PyObject *__pyx_args, PyObject *__pyx_kwds
14274#endif
14275); /*proto*/
14276PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM, "\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ");
14277static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
14278static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self,
14279#if CYTHON_VECTORCALL
14280PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14281#else
14282PyObject *__pyx_args, PyObject *__pyx_kwds
14283#endif
14284) {
14285 double __pyx_v_rho;
14286 double __pyx_v_beta;
14287 PyArrayObject *__pyx_v_gravity = 0;
14288 PyArrayObject *__pyx_v_alpha = 0;
14289 PyArrayObject *__pyx_v_n = 0;
14290 PyArrayObject *__pyx_v_thetaR = 0;
14291 PyArrayObject *__pyx_v_thetaSR = 0;
14292 int __pyx_v_nSpace;
14293 int __pyx_v_nElements_global;
14294 int __pyx_v_nElementBoundaries_element;
14295 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
14296 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
14297 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
14298 int __pyx_v_nDOF_trial_element;
14299 PyArrayObject *__pyx_v_u_l2g = 0;
14300 PyArrayObject *__pyx_v_u_dof = 0;
14301 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
14302 PyArrayObject *__pyx_v_q_u = 0;
14303 PyArrayObject *__pyx_v_q_mass = 0;
14304 PyArrayObject *__pyx_v_q_dmass = 0;
14305 PyArrayObject *__pyx_v_q_r = 0;
14306 PyArrayObject *__pyx_v_q_kr = 0;
14307 PyArrayObject *__pyx_v_q_dkr = 0;
14308 PyArrayObject *__pyx_v_q_kr_up = 0;
14309 #if !CYTHON_VECTORCALL
14310 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14311 #endif
14312 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14313 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
14314 int __pyx_lineno = 0;
14315 const char *__pyx_filename = NULL;
14316 int __pyx_clineno = 0;
14317 PyObject *__pyx_r = 0;
14318 __Pyx_RefNannyDeclarations
14319 __Pyx_RefNannySetupContext("RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
14320 #if !CYTHON_VECTORCALL
14321 #if CYTHON_ASSUME_SAFE_SIZE
14322 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14323 #else
14324 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14325 #endif
14326 #endif
14327 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14328 {
14329 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rho,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_gravity,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_thetaR,&__pyx_mstate_global->__pyx_n_u_thetaSR,&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_elementBarycentersArray,&__pyx_mstate_global->__pyx_n_u_elementMaterialTypes,&__pyx_mstate_global->__pyx_n_u_nDOF_trial_element,&__pyx_mstate_global->__pyx_n_u_u_l2g,&__pyx_mstate_global->__pyx_n_u_u_dof,&__pyx_mstate_global->__pyx_n_u_q_x,&__pyx_mstate_global->__pyx_n_u_q_u,&__pyx_mstate_global->__pyx_n_u_q_mass,&__pyx_mstate_global->__pyx_n_u_q_dmass,&__pyx_mstate_global->__pyx_n_u_q_r,&__pyx_mstate_global->__pyx_n_u_q_kr,&__pyx_mstate_global->__pyx_n_u_q_dkr,&__pyx_mstate_global->__pyx_n_u_q_kr_up,0};
14330 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14331 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 360, __pyx_L3_error)
14332 if (__pyx_kwds_len > 0) {
14333 switch (__pyx_nargs) {
14334 case 24:
14335 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
14336 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 360, __pyx_L3_error)
14337 CYTHON_FALLTHROUGH;
14338 case 23:
14339 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
14340 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 360, __pyx_L3_error)
14341 CYTHON_FALLTHROUGH;
14342 case 22:
14343 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
14344 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 360, __pyx_L3_error)
14345 CYTHON_FALLTHROUGH;
14346 case 21:
14347 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
14348 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 360, __pyx_L3_error)
14349 CYTHON_FALLTHROUGH;
14350 case 20:
14351 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
14352 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 360, __pyx_L3_error)
14353 CYTHON_FALLTHROUGH;
14354 case 19:
14355 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
14356 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 360, __pyx_L3_error)
14357 CYTHON_FALLTHROUGH;
14358 case 18:
14359 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
14360 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 360, __pyx_L3_error)
14361 CYTHON_FALLTHROUGH;
14362 case 17:
14363 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
14364 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 360, __pyx_L3_error)
14365 CYTHON_FALLTHROUGH;
14366 case 16:
14367 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
14368 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 360, __pyx_L3_error)
14369 CYTHON_FALLTHROUGH;
14370 case 15:
14371 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
14372 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 360, __pyx_L3_error)
14373 CYTHON_FALLTHROUGH;
14374 case 14:
14375 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
14376 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 360, __pyx_L3_error)
14377 CYTHON_FALLTHROUGH;
14378 case 13:
14379 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
14380 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 360, __pyx_L3_error)
14381 CYTHON_FALLTHROUGH;
14382 case 12:
14383 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
14384 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 360, __pyx_L3_error)
14385 CYTHON_FALLTHROUGH;
14386 case 11:
14387 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
14388 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 360, __pyx_L3_error)
14389 CYTHON_FALLTHROUGH;
14390 case 10:
14391 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
14392 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 360, __pyx_L3_error)
14393 CYTHON_FALLTHROUGH;
14394 case 9:
14395 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
14396 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 360, __pyx_L3_error)
14397 CYTHON_FALLTHROUGH;
14398 case 8:
14399 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
14400 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 360, __pyx_L3_error)
14401 CYTHON_FALLTHROUGH;
14402 case 7:
14403 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
14404 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 360, __pyx_L3_error)
14405 CYTHON_FALLTHROUGH;
14406 case 6:
14407 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
14408 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 360, __pyx_L3_error)
14409 CYTHON_FALLTHROUGH;
14410 case 5:
14411 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
14412 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 360, __pyx_L3_error)
14413 CYTHON_FALLTHROUGH;
14414 case 4:
14415 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
14416 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 360, __pyx_L3_error)
14417 CYTHON_FALLTHROUGH;
14418 case 3:
14419 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
14420 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 360, __pyx_L3_error)
14421 CYTHON_FALLTHROUGH;
14422 case 2:
14423 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
14424 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 360, __pyx_L3_error)
14425 CYTHON_FALLTHROUGH;
14426 case 1:
14427 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14428 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 360, __pyx_L3_error)
14429 CYTHON_FALLTHROUGH;
14430 case 0: break;
14431 default: goto __pyx_L5_argtuple_error;
14432 }
14433 const Py_ssize_t kwd_pos_args = __pyx_nargs;
14434 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "RE_NCP1_evaluateElementCoefficients_VGM", 0) < (0)) __PYX_ERR(0, 360, __pyx_L3_error)
14435 for (Py_ssize_t i = __pyx_nargs; i < 24; i++) {
14436 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, i); __PYX_ERR(0, 360, __pyx_L3_error) }
14437 }
14438 } else if (unlikely(__pyx_nargs != 24)) {
14439 goto __pyx_L5_argtuple_error;
14440 } else {
14441 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14442 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 360, __pyx_L3_error)
14443 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
14444 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 360, __pyx_L3_error)
14445 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
14446 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 360, __pyx_L3_error)
14447 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
14448 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 360, __pyx_L3_error)
14449 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
14450 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 360, __pyx_L3_error)
14451 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
14452 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 360, __pyx_L3_error)
14453 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
14454 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 360, __pyx_L3_error)
14455 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
14456 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 360, __pyx_L3_error)
14457 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
14458 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 360, __pyx_L3_error)
14459 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
14460 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 360, __pyx_L3_error)
14461 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
14462 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 360, __pyx_L3_error)
14463 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
14464 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 360, __pyx_L3_error)
14465 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
14466 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 360, __pyx_L3_error)
14467 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
14468 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 360, __pyx_L3_error)
14469 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
14470 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 360, __pyx_L3_error)
14471 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
14472 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 360, __pyx_L3_error)
14473 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
14474 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 360, __pyx_L3_error)
14475 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
14476 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 360, __pyx_L3_error)
14477 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
14478 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 360, __pyx_L3_error)
14479 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
14480 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 360, __pyx_L3_error)
14481 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
14482 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 360, __pyx_L3_error)
14483 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
14484 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 360, __pyx_L3_error)
14485 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
14486 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 360, __pyx_L3_error)
14487 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
14488 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 360, __pyx_L3_error)
14489 }
14490 __pyx_v_rho = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_rho == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
14491 __pyx_v_beta = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_beta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error)
14492 __pyx_v_gravity = ((PyArrayObject *)values[2]);
14493 __pyx_v_alpha = ((PyArrayObject *)values[3]);
14494 __pyx_v_n = ((PyArrayObject *)values[4]);
14495 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
14496 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
14497 __pyx_v_nSpace = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
14498 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error)
14499 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L3_error)
14500 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
14501 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
14502 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
14503 __pyx_v_nDOF_trial_element = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_nDOF_trial_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L3_error)
14504 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
14505 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
14506 __pyx_v_q_x = ((PyArrayObject *)values[16]);
14507 __pyx_v_q_u = ((PyArrayObject *)values[17]);
14508 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
14509 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
14510 __pyx_v_q_r = ((PyArrayObject *)values[20]);
14511 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
14512 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
14513 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
14514 }
14515 goto __pyx_L6_skip;
14516 __pyx_L5_argtuple_error:;
14517 __Pyx_RaiseArgtupleInvalid("RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, __pyx_nargs); __PYX_ERR(0, 360, __pyx_L3_error)
14518 __pyx_L6_skip:;
14519 goto __pyx_L4_argument_unpacking_done;
14520 __pyx_L3_error:;
14521 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14522 Py_XDECREF(values[__pyx_temp]);
14523 }
14524 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
14525 __Pyx_RefNannyFinishContext();
14526 return NULL;
14527 __pyx_L4_argument_unpacking_done:;
14528 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "gravity", 0))) __PYX_ERR(0, 362, __pyx_L1_error)
14529 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "alpha", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
14530 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "n", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
14531 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "thetaR", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
14532 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "thetaSR", 0))) __PYX_ERR(0, 366, __pyx_L1_error)
14533 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
14534 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBarycentersArray", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
14535 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementMaterialTypes", 0))) __PYX_ERR(0, 373, __pyx_L1_error)
14536 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "u_l2g", 0))) __PYX_ERR(0, 376, __pyx_L1_error)
14537 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "u_dof", 0))) __PYX_ERR(0, 377, __pyx_L1_error)
14538 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_x", 0))) __PYX_ERR(0, 379, __pyx_L1_error)
14539 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_u", 0))) __PYX_ERR(0, 380, __pyx_L1_error)
14540 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_mass", 0))) __PYX_ERR(0, 381, __pyx_L1_error)
14541 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_dmass", 0))) __PYX_ERR(0, 382, __pyx_L1_error)
14542 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_r", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
14543 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_kr", 0))) __PYX_ERR(0, 384, __pyx_L1_error)
14544 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_dkr", 0))) __PYX_ERR(0, 385, __pyx_L1_error)
14545 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_kr_up", 0))) __PYX_ERR(0, 386, __pyx_L1_error)
14546 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
14547
14548 /* function exit code */
14549 goto __pyx_L0;
14550 __pyx_L1_error:;
14551 __pyx_r = NULL;
14552 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14553 Py_XDECREF(values[__pyx_temp]);
14554 }
14555 goto __pyx_L7_cleaned_up;
14556 __pyx_L0:;
14557 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14558 Py_XDECREF(values[__pyx_temp]);
14559 }
14560 __pyx_L7_cleaned_up:;
14561
14562
14563
14564
14565
14566
14567 __Pyx_RefNannyFinishContext();
14568 return __pyx_r;
14569}
14570
14571static 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) {
14572 PyObject *__pyx_v_q = NULL;
14573 double __pyx_v_psiC;
14574 double __pyx_v_pcBar;
14575 double __pyx_v_pcBar_n;
14576 double __pyx_v_pcBar_nM1;
14577 double __pyx_v_pcBar_nM2;
14578 double __pyx_v_onePlus_pcBar_n;
14579 double __pyx_v_sBar;
14580 double __pyx_v_sqrt_sBar;
14581 double __pyx_v_DsBar_DpsiC;
14582 double __pyx_v_thetaW;
14583 double __pyx_v_DthetaW_DpsiC;
14584 double __pyx_v_vBar;
14585 double __pyx_v_vBar2;
14586 double __pyx_v_DvBar_DpsiC;
14587 double __pyx_v_KWr;
14588 double __pyx_v_DKWr_DpsiC;
14589 CYTHON_UNUSED double __pyx_v_rho2;
14590 double __pyx_v_thetaS;
14591 double __pyx_v_rhom;
14592 double __pyx_v_drhom;
14593 double __pyx_v_m;
14594 double __pyx_v_u_j;
14595 double __pyx_v_u_eN;
14596 double __pyx_v_u_neig;
14597 double __pyx_v_kr_eN;
14598 double __pyx_v_kr_neig;
14599 double __pyx_v_phi_eN;
14600 double __pyx_v_phi_neig;
14601 int __pyx_v_eN;
14602 int __pyx_v_eN_neighbor;
14603 int __pyx_v_ebN;
14604 int __pyx_v_j;
14605 int __pyx_v_matID;
14606 double __pyx_v_nAvgWeight;
14607 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
14608 __Pyx_Buffer __pyx_pybuffer_alpha;
14609 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
14610 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
14611 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
14612 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
14613 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
14614 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
14615 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
14616 __Pyx_Buffer __pyx_pybuffer_gravity;
14617 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
14618 __Pyx_Buffer __pyx_pybuffer_n;
14619 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
14620 __Pyx_Buffer __pyx_pybuffer_q_dkr;
14621 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
14622 __Pyx_Buffer __pyx_pybuffer_q_dmass;
14623 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
14624 __Pyx_Buffer __pyx_pybuffer_q_kr;
14625 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
14626 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
14627 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
14628 __Pyx_Buffer __pyx_pybuffer_q_mass;
14629 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
14630 __Pyx_Buffer __pyx_pybuffer_q_r;
14631 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
14632 __Pyx_Buffer __pyx_pybuffer_q_u;
14633 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
14634 __Pyx_Buffer __pyx_pybuffer_q_x;
14635 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
14636 __Pyx_Buffer __pyx_pybuffer_thetaR;
14637 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
14638 __Pyx_Buffer __pyx_pybuffer_thetaSR;
14639 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
14640 __Pyx_Buffer __pyx_pybuffer_u_dof;
14641 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
14642 __Pyx_Buffer __pyx_pybuffer_u_l2g;
14643 PyObject *__pyx_r = NULL;
14644 __Pyx_RefNannyDeclarations
14645 PyObject *__pyx_t_1 = NULL;
14646 PyObject *__pyx_t_2 = NULL;
14647 Py_ssize_t __pyx_t_3;
14648 PyObject *__pyx_t_4 = NULL;
14649 int __pyx_t_5;
14650 double __pyx_t_6;
14651 int __pyx_t_7;
14652 int __pyx_t_8;
14653 int __pyx_t_9;
14654 Py_ssize_t __pyx_t_10;
14655 int __pyx_t_11;
14656 int __pyx_t_12;
14657 int __pyx_t_13;
14658 Py_ssize_t __pyx_t_14;
14659 int __pyx_t_15;
14660 Py_ssize_t __pyx_t_16;
14661 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
14662 PyObject *__pyx_t_18 = NULL;
14663 size_t __pyx_t_19;
14664 PyObject *__pyx_t_20 = NULL;
14665 int __pyx_lineno = 0;
14666 const char *__pyx_filename = NULL;
14667 int __pyx_clineno = 0;
14668 __Pyx_RefNannySetupContext("RE_NCP1_evaluateElementCoefficients_VGM", 0);
14669 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
14670 __pyx_pybuffer_gravity.refcount = 0;
14671 __pyx_pybuffernd_gravity.data = NULL;
14672 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
14673 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
14674 __pyx_pybuffer_alpha.refcount = 0;
14675 __pyx_pybuffernd_alpha.data = NULL;
14676 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
14677 __pyx_pybuffer_n.pybuffer.buf = NULL;
14678 __pyx_pybuffer_n.refcount = 0;
14679 __pyx_pybuffernd_n.data = NULL;
14680 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
14681 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
14682 __pyx_pybuffer_thetaR.refcount = 0;
14683 __pyx_pybuffernd_thetaR.data = NULL;
14684 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
14685 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
14686 __pyx_pybuffer_thetaSR.refcount = 0;
14687 __pyx_pybuffernd_thetaSR.data = NULL;
14688 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
14689 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
14690 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
14691 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
14692 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
14693 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
14694 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
14695 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
14696 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
14697 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
14698 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
14699 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
14700 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
14701 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
14702 __pyx_pybuffer_u_l2g.refcount = 0;
14703 __pyx_pybuffernd_u_l2g.data = NULL;
14704 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
14705 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
14706 __pyx_pybuffer_u_dof.refcount = 0;
14707 __pyx_pybuffernd_u_dof.data = NULL;
14708 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
14709 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
14710 __pyx_pybuffer_q_x.refcount = 0;
14711 __pyx_pybuffernd_q_x.data = NULL;
14712 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
14713 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
14714 __pyx_pybuffer_q_u.refcount = 0;
14715 __pyx_pybuffernd_q_u.data = NULL;
14716 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
14717 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
14718 __pyx_pybuffer_q_mass.refcount = 0;
14719 __pyx_pybuffernd_q_mass.data = NULL;
14720 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
14721 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
14722 __pyx_pybuffer_q_dmass.refcount = 0;
14723 __pyx_pybuffernd_q_dmass.data = NULL;
14724 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
14725 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
14726 __pyx_pybuffer_q_r.refcount = 0;
14727 __pyx_pybuffernd_q_r.data = NULL;
14728 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
14729 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
14730 __pyx_pybuffer_q_kr.refcount = 0;
14731 __pyx_pybuffernd_q_kr.data = NULL;
14732 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
14733 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
14734 __pyx_pybuffer_q_dkr.refcount = 0;
14735 __pyx_pybuffernd_q_dkr.data = NULL;
14736 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
14737 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
14738 __pyx_pybuffer_q_kr_up.refcount = 0;
14739 __pyx_pybuffernd_q_kr_up.data = NULL;
14740 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
14741 {
14742 __Pyx_BufFmt_StackElem __pyx_stack[1];
14743 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14744 }
14745 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
14746 {
14747 __Pyx_BufFmt_StackElem __pyx_stack[1];
14748 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14749 }
14750 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
14751 {
14752 __Pyx_BufFmt_StackElem __pyx_stack[1];
14753 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14754 }
14755 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
14756 {
14757 __Pyx_BufFmt_StackElem __pyx_stack[1];
14758 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14759 }
14760 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
14761 {
14762 __Pyx_BufFmt_StackElem __pyx_stack[1];
14763 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14764 }
14765 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
14766 {
14767 __Pyx_BufFmt_StackElem __pyx_stack[1];
14768 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14769 }
14770 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
14771 {
14772 __Pyx_BufFmt_StackElem __pyx_stack[1];
14773 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14774 }
14775 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
14776 {
14777 __Pyx_BufFmt_StackElem __pyx_stack[1];
14778 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, 360, __pyx_L1_error)
14779 }
14780 __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];
14781 {
14782 __Pyx_BufFmt_StackElem __pyx_stack[1];
14783 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14784 }
14785 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
14786 {
14787 __Pyx_BufFmt_StackElem __pyx_stack[1];
14788 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14789 }
14790 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
14791 {
14792 __Pyx_BufFmt_StackElem __pyx_stack[1];
14793 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14794 }
14795 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
14796 {
14797 __Pyx_BufFmt_StackElem __pyx_stack[1];
14798 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14799 }
14800 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
14801 {
14802 __Pyx_BufFmt_StackElem __pyx_stack[1];
14803 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14804 }
14805 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
14806 {
14807 __Pyx_BufFmt_StackElem __pyx_stack[1];
14808 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14809 }
14810 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
14811 {
14812 __Pyx_BufFmt_StackElem __pyx_stack[1];
14813 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14814 }
14815 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
14816 {
14817 __Pyx_BufFmt_StackElem __pyx_stack[1];
14818 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14819 }
14820 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
14821 {
14822 __Pyx_BufFmt_StackElem __pyx_stack[1];
14823 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14824 }
14825 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
14826 {
14827 __Pyx_BufFmt_StackElem __pyx_stack[1];
14828 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
14829 }
14830 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
14831
14832 /* "subsurfaceTransportFunctions.pyx":400
14833 * """
14834 * #check some sizes
14835 * for q in [q_u,q_mass,q_r,q_kr,q_dkr]: # <<<<<<<<<<<<<<
14836 * assert q.shape[1] == nSpace+1
14837 * assert nDOF_trial_element == nSpace + 1
14838*/
14839 __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
14840 __Pyx_GOTREF(__pyx_t_1);
14841 __Pyx_INCREF((PyObject *)__pyx_v_q_u);
14842 __Pyx_GIVEREF((PyObject *)__pyx_v_q_u);
14843 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u)) != (0)) __PYX_ERR(0, 400, __pyx_L1_error);
14844 __Pyx_INCREF((PyObject *)__pyx_v_q_mass);
14845 __Pyx_GIVEREF((PyObject *)__pyx_v_q_mass);
14846 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass)) != (0)) __PYX_ERR(0, 400, __pyx_L1_error);
14847 __Pyx_INCREF((PyObject *)__pyx_v_q_r);
14848 __Pyx_GIVEREF((PyObject *)__pyx_v_q_r);
14849 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r)) != (0)) __PYX_ERR(0, 400, __pyx_L1_error);
14850 __Pyx_INCREF((PyObject *)__pyx_v_q_kr);
14851 __Pyx_GIVEREF((PyObject *)__pyx_v_q_kr);
14852 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr)) != (0)) __PYX_ERR(0, 400, __pyx_L1_error);
14853 __Pyx_INCREF((PyObject *)__pyx_v_q_dkr);
14854 __Pyx_GIVEREF((PyObject *)__pyx_v_q_dkr);
14855 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr)) != (0)) __PYX_ERR(0, 400, __pyx_L1_error);
14856 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
14857 __pyx_t_3 = 0;
14858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14859 for (;;) {
14860 if (__pyx_t_3 >= 5) break;
14861 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14862 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
14863 #else
14864 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
14865 #endif
14866 ++__pyx_t_3;
14867 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
14868 __Pyx_GOTREF(__pyx_t_1);
14869 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
14870 __pyx_t_1 = 0;
14871
14872 /* "subsurfaceTransportFunctions.pyx":401
14873 * #check some sizes
14874 * for q in [q_u,q_mass,q_r,q_kr,q_dkr]:
14875 * assert q.shape[1] == nSpace+1 # <<<<<<<<<<<<<<
14876 * assert nDOF_trial_element == nSpace + 1
14877 * #temporaries
14878*/
14879 #ifndef CYTHON_WITHOUT_ASSERTIONS
14880 if (unlikely(__pyx_assertions_enabled())) {
14881 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
14882 __Pyx_GOTREF(__pyx_t_1);
14883 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
14884 __Pyx_GOTREF(__pyx_t_4);
14885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14886 __pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_nSpace + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
14887 __Pyx_GOTREF(__pyx_t_1);
14888 __pyx_t_5 = __Pyx_PyObject_CompareBoolEq_object_int(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 401, __pyx_L1_error)
14889 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14890 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14891 if (unlikely(!__pyx_t_5)) {
14892 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
14893 __PYX_ERR(0, 401, __pyx_L1_error)
14894 }
14895
14896 }
14897 #else
14898 if ((1)); else __PYX_ERR(0, 401, __pyx_L1_error)
14899 #endif
14900
14901 /* "subsurfaceTransportFunctions.pyx":400
14902 * """
14903 * #check some sizes
14904 * for q in [q_u,q_mass,q_r,q_kr,q_dkr]: # <<<<<<<<<<<<<<
14905 * assert q.shape[1] == nSpace+1
14906 * assert nDOF_trial_element == nSpace + 1
14907*/
14908 }
14909 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14910
14911 /* "subsurfaceTransportFunctions.pyx":402
14912 * for q in [q_u,q_mass,q_r,q_kr,q_dkr]:
14913 * assert q.shape[1] == nSpace+1
14914 * assert nDOF_trial_element == nSpace + 1 # <<<<<<<<<<<<<<
14915 * #temporaries
14916 * cdef double psiC,pcBar,pcBar_n,pcBar_nM1,pcBar_nM2,onePlus_pcBar_n,sBar,sqrt_sBar,DsBar_DpsiC,thetaW,DthetaW_DpsiC
14917*/
14918 #ifndef CYTHON_WITHOUT_ASSERTIONS
14919 if (unlikely(__pyx_assertions_enabled())) {
14920 __pyx_t_5 = (__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1));
14921
14922 if (unlikely(!__pyx_t_5)) {
14923 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
14924 __PYX_ERR(0, 402, __pyx_L1_error)
14925 }
14926
14927 }
14928 #else
14929 if ((1)); else __PYX_ERR(0, 402, __pyx_L1_error)
14930 #endif
14931
14932 /* "subsurfaceTransportFunctions.pyx":405
14933 * #temporaries
14934 * cdef double psiC,pcBar,pcBar_n,pcBar_nM1,pcBar_nM2,onePlus_pcBar_n,sBar,sqrt_sBar,DsBar_DpsiC,thetaW,DthetaW_DpsiC
14935 * cdef double vBar,vBar2,DvBar_DpsiC,KWr,DKWr_DpsiC,rho2=rho*rho,thetaS,rhom,drhom,m # <<<<<<<<<<<<<<
14936 *
14937 * cdef double u_j,u_eN,u_neig,kr_eN,kr_neig,phi_eN,phi_neig
14938*/
14939 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
14940
14941 /* "subsurfaceTransportFunctions.pyx":410
14942 * cdef int eN,eN_neighbor,ebN,ii,I,j,matID
14943 * #for averaging/integration weights
14944 * cdef double nAvgWeight = 1.0/(nSpace+1.) # <<<<<<<<<<<<<<
14945 *
14946 * #loop through and evaluate
14947*/
14948 __pyx_t_6 = (__pyx_v_nSpace + 1.);
14949
14950 if (unlikely(__pyx_t_6 == 0)) {
14951 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
14952 __PYX_ERR(0, 410, __pyx_L1_error)
14953 }
14954 __pyx_v_nAvgWeight = (1.0 / __pyx_t_6);
14955
14956
14957 /* "subsurfaceTransportFunctions.pyx":413
14958 *
14959 * #loop through and evaluate
14960 * for eN in range(nElements_global): # <<<<<<<<<<<<<<
14961 * matID = elementMaterialTypes[eN]
14962 * for j in range(nDOF_trial_element):
14963*/
14964
14965 __pyx_t_7 = __pyx_v_nElements_global;
14966 __pyx_t_8 = __pyx_t_7;
14967
14968 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
14969 __pyx_v_eN = __pyx_t_9;
14970
14971 /* "subsurfaceTransportFunctions.pyx":414
14972 * #loop through and evaluate
14973 * for eN in range(nElements_global):
14974 * matID = elementMaterialTypes[eN] # <<<<<<<<<<<<<<
14975 * for j in range(nDOF_trial_element):
14976 * u_j = u_dof[u_l2g[eN,j]]
14977*/
14978 __pyx_t_10 = __pyx_v_eN;
14979 __pyx_t_11 = -1;
14980 if (__pyx_t_10 < 0) {
14981 __pyx_t_10 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
14982 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
14983 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_11 = 0;
14984 if (unlikely(__pyx_t_11 != -1)) {
14985 __Pyx_RaiseBufferIndexError(__pyx_t_11);
14986 __PYX_ERR(0, 414, __pyx_L1_error)
14987 }
14988 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
14989
14990 /* "subsurfaceTransportFunctions.pyx":415
14991 * for eN in range(nElements_global):
14992 * matID = elementMaterialTypes[eN]
14993 * for j in range(nDOF_trial_element): # <<<<<<<<<<<<<<
14994 * u_j = u_dof[u_l2g[eN,j]]
14995 * q_u[eN,j] = u_j
14996*/
14997
14998 __pyx_t_11 = __pyx_v_nDOF_trial_element;
14999 __pyx_t_12 = __pyx_t_11;
15000
15001 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
15002 __pyx_v_j = __pyx_t_13;
15003
15004 /* "subsurfaceTransportFunctions.pyx":416
15005 * matID = elementMaterialTypes[eN]
15006 * for j in range(nDOF_trial_element):
15007 * u_j = u_dof[u_l2g[eN,j]] # <<<<<<<<<<<<<<
15008 * q_u[eN,j] = u_j
15009 *
15010*/
15011 __pyx_t_10 = __pyx_v_eN;
15012 __pyx_t_14 = __pyx_v_j;
15013 __pyx_t_15 = -1;
15014 if (__pyx_t_10 < 0) {
15015 __pyx_t_10 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
15016 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15017 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_15 = 0;
15018 if (__pyx_t_14 < 0) {
15019 __pyx_t_14 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
15020 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1;
15021 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_15 = 1;
15022 if (unlikely(__pyx_t_15 != -1)) {
15023 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15024 __PYX_ERR(0, 416, __pyx_L1_error)
15025 }
15026 __pyx_t_16 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
15027 __pyx_t_15 = -1;
15028 if (__pyx_t_16 < 0) {
15029 __pyx_t_16 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
15030 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
15031 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_15 = 0;
15032 if (unlikely(__pyx_t_15 != -1)) {
15033 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15034 __PYX_ERR(0, 416, __pyx_L1_error)
15035 }
15036 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_u_dof.diminfo[0].strides));
15037
15038 /* "subsurfaceTransportFunctions.pyx":417
15039 * for j in range(nDOF_trial_element):
15040 * u_j = u_dof[u_l2g[eN,j]]
15041 * q_u[eN,j] = u_j # <<<<<<<<<<<<<<
15042 *
15043 * #VGM evaluation
15044*/
15045 __pyx_t_14 = __pyx_v_eN;
15046 __pyx_t_10 = __pyx_v_j;
15047 __pyx_t_15 = -1;
15048 if (__pyx_t_14 < 0) {
15049 __pyx_t_14 += __pyx_pybuffernd_q_u.diminfo[0].shape;
15050 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15051 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_15 = 0;
15052 if (__pyx_t_10 < 0) {
15053 __pyx_t_10 += __pyx_pybuffernd_q_u.diminfo[1].shape;
15054 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 1;
15055 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_15 = 1;
15056 if (unlikely(__pyx_t_15 != -1)) {
15057 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15058 __PYX_ERR(0, 417, __pyx_L1_error)
15059 }
15060 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
15061
15062 /* "subsurfaceTransportFunctions.pyx":420
15063 *
15064 * #VGM evaluation
15065 * psiC = -u_j # <<<<<<<<<<<<<<
15066 * m = 1.0 - 1.0/n[matID]
15067 * thetaS = thetaR[matID] + thetaSR[matID]
15068*/
15069 __pyx_v_psiC = (-__pyx_v_u_j);
15070
15071 /* "subsurfaceTransportFunctions.pyx":421
15072 * #VGM evaluation
15073 * psiC = -u_j
15074 * m = 1.0 - 1.0/n[matID] # <<<<<<<<<<<<<<
15075 * thetaS = thetaR[matID] + thetaSR[matID]
15076 * if psiC > 0.0:
15077*/
15078 __pyx_t_10 = __pyx_v_matID;
15079 __pyx_t_15 = -1;
15080 if (__pyx_t_10 < 0) {
15081 __pyx_t_10 += __pyx_pybuffernd_n.diminfo[0].shape;
15082 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15083 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
15084 if (unlikely(__pyx_t_15 != -1)) {
15085 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15086 __PYX_ERR(0, 421, __pyx_L1_error)
15087 }
15088 __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_n.diminfo[0].strides));
15089
15090 if (unlikely(__pyx_t_17 == 0)) {
15091 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
15092 __PYX_ERR(0, 421, __pyx_L1_error)
15093 }
15094 __pyx_v_m = (1.0 - (((__pyx_t_28subsurfaceTransportFunctions_DTYPE_t)1.0) / __pyx_t_17));
15095
15096
15097 /* "subsurfaceTransportFunctions.pyx":422
15098 * psiC = -u_j
15099 * m = 1.0 - 1.0/n[matID]
15100 * thetaS = thetaR[matID] + thetaSR[matID] # <<<<<<<<<<<<<<
15101 * if psiC > 0.0:
15102 * pcBar = alpha[matID]*psiC
15103*/
15104 __pyx_t_10 = __pyx_v_matID;
15105 __pyx_t_15 = -1;
15106 if (__pyx_t_10 < 0) {
15107 __pyx_t_10 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
15108 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15109 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_15 = 0;
15110 if (unlikely(__pyx_t_15 != -1)) {
15111 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15112 __PYX_ERR(0, 422, __pyx_L1_error)
15113 }
15114 __pyx_t_14 = __pyx_v_matID;
15115 __pyx_t_15 = -1;
15116 if (__pyx_t_14 < 0) {
15117 __pyx_t_14 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
15118 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15119 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
15120 if (unlikely(__pyx_t_15 != -1)) {
15121 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15122 __PYX_ERR(0, 422, __pyx_L1_error)
15123 }
15124 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
15125
15126 /* "subsurfaceTransportFunctions.pyx":423
15127 * m = 1.0 - 1.0/n[matID]
15128 * thetaS = thetaR[matID] + thetaSR[matID]
15129 * if psiC > 0.0: # <<<<<<<<<<<<<<
15130 * pcBar = alpha[matID]*psiC
15131 * pcBar_nM2 = pow(pcBar,n[matID]-2)
15132*/
15133 __pyx_t_5 = (__pyx_v_psiC > 0.0);
15134
15135 if (__pyx_t_5) {
15136
15137
15138 /* "subsurfaceTransportFunctions.pyx":424
15139 * thetaS = thetaR[matID] + thetaSR[matID]
15140 * if psiC > 0.0:
15141 * pcBar = alpha[matID]*psiC # <<<<<<<<<<<<<<
15142 * pcBar_nM2 = pow(pcBar,n[matID]-2)
15143 * pcBar_nM1 = pcBar_nM2*pcBar
15144*/
15145 __pyx_t_14 = __pyx_v_matID;
15146 __pyx_t_15 = -1;
15147 if (__pyx_t_14 < 0) {
15148 __pyx_t_14 += __pyx_pybuffernd_alpha.diminfo[0].shape;
15149 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15150 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
15151 if (unlikely(__pyx_t_15 != -1)) {
15152 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15153 __PYX_ERR(0, 424, __pyx_L1_error)
15154 }
15155 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
15156
15157 /* "subsurfaceTransportFunctions.pyx":425
15158 * if psiC > 0.0:
15159 * pcBar = alpha[matID]*psiC
15160 * pcBar_nM2 = pow(pcBar,n[matID]-2) # <<<<<<<<<<<<<<
15161 * pcBar_nM1 = pcBar_nM2*pcBar
15162 * pcBar_n = pcBar_nM1*pcBar
15163*/
15164 __pyx_t_14 = __pyx_v_matID;
15165 __pyx_t_15 = -1;
15166 if (__pyx_t_14 < 0) {
15167 __pyx_t_14 += __pyx_pybuffernd_n.diminfo[0].shape;
15168 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15169 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
15170 if (unlikely(__pyx_t_15 != -1)) {
15171 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15172 __PYX_ERR(0, 425, __pyx_L1_error)
15173 }
15174 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
15175
15176 /* "subsurfaceTransportFunctions.pyx":426
15177 * pcBar = alpha[matID]*psiC
15178 * pcBar_nM2 = pow(pcBar,n[matID]-2)
15179 * pcBar_nM1 = pcBar_nM2*pcBar # <<<<<<<<<<<<<<
15180 * pcBar_n = pcBar_nM1*pcBar
15181 * onePlus_pcBar_n = 1.0 + pcBar_n
15182*/
15183 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
15184
15185 /* "subsurfaceTransportFunctions.pyx":427
15186 * pcBar_nM2 = pow(pcBar,n[matID]-2)
15187 * pcBar_nM1 = pcBar_nM2*pcBar
15188 * pcBar_n = pcBar_nM1*pcBar # <<<<<<<<<<<<<<
15189 * onePlus_pcBar_n = 1.0 + pcBar_n
15190 *
15191*/
15192 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
15193
15194 /* "subsurfaceTransportFunctions.pyx":428
15195 * pcBar_nM1 = pcBar_nM2*pcBar
15196 * pcBar_n = pcBar_nM1*pcBar
15197 * onePlus_pcBar_n = 1.0 + pcBar_n # <<<<<<<<<<<<<<
15198 *
15199 * sBar = pow(onePlus_pcBar_n,-m)
15200*/
15201 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
15202
15203 /* "subsurfaceTransportFunctions.pyx":430
15204 * onePlus_pcBar_n = 1.0 + pcBar_n
15205 *
15206 * sBar = pow(onePlus_pcBar_n,-m) # <<<<<<<<<<<<<<
15207 * # using -mn = 1-n
15208 * DsBar_DpsiC = alpha[matID]*(1.0-n[matID])*(sBar/onePlus_pcBar_n)*pcBar_nM1
15209*/
15210 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
15211
15212 /* "subsurfaceTransportFunctions.pyx":432
15213 * sBar = pow(onePlus_pcBar_n,-m)
15214 * # using -mn = 1-n
15215 * DsBar_DpsiC = alpha[matID]*(1.0-n[matID])*(sBar/onePlus_pcBar_n)*pcBar_nM1 # <<<<<<<<<<<<<<
15216 *
15217 * vBar = 1.0-pcBar_nM1*sBar
15218*/
15219 __pyx_t_14 = __pyx_v_matID;
15220 __pyx_t_15 = -1;
15221 if (__pyx_t_14 < 0) {
15222 __pyx_t_14 += __pyx_pybuffernd_alpha.diminfo[0].shape;
15223 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15224 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
15225 if (unlikely(__pyx_t_15 != -1)) {
15226 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15227 __PYX_ERR(0, 432, __pyx_L1_error)
15228 }
15229 __pyx_t_10 = __pyx_v_matID;
15230 __pyx_t_15 = -1;
15231 if (__pyx_t_10 < 0) {
15232 __pyx_t_10 += __pyx_pybuffernd_n.diminfo[0].shape;
15233 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15234 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
15235 if (unlikely(__pyx_t_15 != -1)) {
15236 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15237 __PYX_ERR(0, 432, __pyx_L1_error)
15238 }
15239 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
15240 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
15241 __PYX_ERR(0, 432, __pyx_L1_error)
15242 }
15243 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
15244
15245 /* "subsurfaceTransportFunctions.pyx":434
15246 * DsBar_DpsiC = alpha[matID]*(1.0-n[matID])*(sBar/onePlus_pcBar_n)*pcBar_nM1
15247 *
15248 * vBar = 1.0-pcBar_nM1*sBar # <<<<<<<<<<<<<<
15249 * vBar2 = vBar*vBar
15250 * DvBar_DpsiC = -alpha[matID]*(n[matID]-1.0)*pcBar_nM2*sBar - pcBar_nM1*DsBar_DpsiC
15251*/
15252 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
15253
15254 /* "subsurfaceTransportFunctions.pyx":435
15255 *
15256 * vBar = 1.0-pcBar_nM1*sBar
15257 * vBar2 = vBar*vBar # <<<<<<<<<<<<<<
15258 * DvBar_DpsiC = -alpha[matID]*(n[matID]-1.0)*pcBar_nM2*sBar - pcBar_nM1*DsBar_DpsiC
15259 *
15260*/
15261 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
15262
15263 /* "subsurfaceTransportFunctions.pyx":436
15264 * vBar = 1.0-pcBar_nM1*sBar
15265 * vBar2 = vBar*vBar
15266 * DvBar_DpsiC = -alpha[matID]*(n[matID]-1.0)*pcBar_nM2*sBar - pcBar_nM1*DsBar_DpsiC # <<<<<<<<<<<<<<
15267 *
15268 * thetaW = thetaSR[matID]*sBar + thetaR[matID]
15269*/
15270 __pyx_t_10 = __pyx_v_matID;
15271 __pyx_t_15 = -1;
15272 if (__pyx_t_10 < 0) {
15273 __pyx_t_10 += __pyx_pybuffernd_alpha.diminfo[0].shape;
15274 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15275 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
15276 if (unlikely(__pyx_t_15 != -1)) {
15277 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15278 __PYX_ERR(0, 436, __pyx_L1_error)
15279 }
15280 __pyx_t_14 = __pyx_v_matID;
15281 __pyx_t_15 = -1;
15282 if (__pyx_t_14 < 0) {
15283 __pyx_t_14 += __pyx_pybuffernd_n.diminfo[0].shape;
15284 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15285 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
15286 if (unlikely(__pyx_t_15 != -1)) {
15287 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15288 __PYX_ERR(0, 436, __pyx_L1_error)
15289 }
15290 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
15291
15292 /* "subsurfaceTransportFunctions.pyx":438
15293 * DvBar_DpsiC = -alpha[matID]*(n[matID]-1.0)*pcBar_nM2*sBar - pcBar_nM1*DsBar_DpsiC
15294 *
15295 * thetaW = thetaSR[matID]*sBar + thetaR[matID] # <<<<<<<<<<<<<<
15296 * DthetaW_DpsiC = thetaSR[matID] * DsBar_DpsiC
15297 *
15298*/
15299 __pyx_t_14 = __pyx_v_matID;
15300 __pyx_t_15 = -1;
15301 if (__pyx_t_14 < 0) {
15302 __pyx_t_14 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
15303 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15304 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
15305 if (unlikely(__pyx_t_15 != -1)) {
15306 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15307 __PYX_ERR(0, 438, __pyx_L1_error)
15308 }
15309 __pyx_t_10 = __pyx_v_matID;
15310 __pyx_t_15 = -1;
15311 if (__pyx_t_10 < 0) {
15312 __pyx_t_10 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
15313 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15314 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_15 = 0;
15315 if (unlikely(__pyx_t_15 != -1)) {
15316 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15317 __PYX_ERR(0, 438, __pyx_L1_error)
15318 }
15319 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
15320
15321 /* "subsurfaceTransportFunctions.pyx":439
15322 *
15323 * thetaW = thetaSR[matID]*sBar + thetaR[matID]
15324 * DthetaW_DpsiC = thetaSR[matID] * DsBar_DpsiC # <<<<<<<<<<<<<<
15325 *
15326 * sqrt_sBar = sqrt(sBar)
15327*/
15328 __pyx_t_10 = __pyx_v_matID;
15329 __pyx_t_15 = -1;
15330 if (__pyx_t_10 < 0) {
15331 __pyx_t_10 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
15332 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15333 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
15334 if (unlikely(__pyx_t_15 != -1)) {
15335 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15336 __PYX_ERR(0, 439, __pyx_L1_error)
15337 }
15338 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
15339
15340 /* "subsurfaceTransportFunctions.pyx":441
15341 * DthetaW_DpsiC = thetaSR[matID] * DsBar_DpsiC
15342 *
15343 * sqrt_sBar = sqrt(sBar) # <<<<<<<<<<<<<<
15344 * KWr= sqrt_sBar*vBar2
15345 * DKWr_DpsiC= ((0.5/sqrt_sBar)*DsBar_DpsiC*vBar2 + 2.0*sqrt_sBar*vBar*DvBar_DpsiC)
15346*/
15347 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
15348
15349 /* "subsurfaceTransportFunctions.pyx":442
15350 *
15351 * sqrt_sBar = sqrt(sBar)
15352 * KWr= sqrt_sBar*vBar2 # <<<<<<<<<<<<<<
15353 * DKWr_DpsiC= ((0.5/sqrt_sBar)*DsBar_DpsiC*vBar2 + 2.0*sqrt_sBar*vBar*DvBar_DpsiC)
15354 * else:
15355*/
15356 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
15357
15358 /* "subsurfaceTransportFunctions.pyx":443
15359 * sqrt_sBar = sqrt(sBar)
15360 * KWr= sqrt_sBar*vBar2
15361 * DKWr_DpsiC= ((0.5/sqrt_sBar)*DsBar_DpsiC*vBar2 + 2.0*sqrt_sBar*vBar*DvBar_DpsiC) # <<<<<<<<<<<<<<
15362 * else:
15363 * thetaW = thetaS
15364*/
15365 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
15366 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
15367 __PYX_ERR(0, 443, __pyx_L1_error)
15368 }
15369 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
15370
15371 /* "subsurfaceTransportFunctions.pyx":423
15372 * m = 1.0 - 1.0/n[matID]
15373 * thetaS = thetaR[matID] + thetaSR[matID]
15374 * if psiC > 0.0: # <<<<<<<<<<<<<<
15375 * pcBar = alpha[matID]*psiC
15376 * pcBar_nM2 = pow(pcBar,n[matID]-2)
15377*/
15378 goto __pyx_L10;
15379 }
15380
15381 /* "subsurfaceTransportFunctions.pyx":445
15382 * DKWr_DpsiC= ((0.5/sqrt_sBar)*DsBar_DpsiC*vBar2 + 2.0*sqrt_sBar*vBar*DvBar_DpsiC)
15383 * else:
15384 * thetaW = thetaS # <<<<<<<<<<<<<<
15385 * DthetaW_DpsiC = 0.0
15386 * KWr = 1.0
15387*/
15388 /*else*/ {
15389 __pyx_v_thetaW = __pyx_v_thetaS;
15390
15391 /* "subsurfaceTransportFunctions.pyx":446
15392 * else:
15393 * thetaW = thetaS
15394 * DthetaW_DpsiC = 0.0 # <<<<<<<<<<<<<<
15395 * KWr = 1.0
15396 * DKWr_DpsiC = 0.0
15397*/
15398 __pyx_v_DthetaW_DpsiC = 0.0;
15399
15400 /* "subsurfaceTransportFunctions.pyx":447
15401 * thetaW = thetaS
15402 * DthetaW_DpsiC = 0.0
15403 * KWr = 1.0 # <<<<<<<<<<<<<<
15404 * DKWr_DpsiC = 0.0
15405 * #
15406*/
15407 __pyx_v_KWr = 1.0;
15408
15409 /* "subsurfaceTransportFunctions.pyx":448
15410 * DthetaW_DpsiC = 0.0
15411 * KWr = 1.0
15412 * DKWr_DpsiC = 0.0 # <<<<<<<<<<<<<<
15413 * #
15414 * rhom = rho*exp(beta*u_j)
15415*/
15416 __pyx_v_DKWr_DpsiC = 0.0;
15417 }
15418 __pyx_L10:;
15419
15420 /* "subsurfaceTransportFunctions.pyx":450
15421 * DKWr_DpsiC = 0.0
15422 * #
15423 * rhom = rho*exp(beta*u_j) # <<<<<<<<<<<<<<
15424 * drhom= beta*rhom
15425 * q_mass[eN,j] = rhom*thetaW
15426*/
15427 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
15428
15429 /* "subsurfaceTransportFunctions.pyx":451
15430 * #
15431 * rhom = rho*exp(beta*u_j)
15432 * drhom= beta*rhom # <<<<<<<<<<<<<<
15433 * q_mass[eN,j] = rhom*thetaW
15434 * q_dmass[eN,j]=-rhom*DthetaW_DpsiC+drhom*thetaW
15435*/
15436 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
15437
15438 /* "subsurfaceTransportFunctions.pyx":452
15439 * rhom = rho*exp(beta*u_j)
15440 * drhom= beta*rhom
15441 * q_mass[eN,j] = rhom*thetaW # <<<<<<<<<<<<<<
15442 * q_dmass[eN,j]=-rhom*DthetaW_DpsiC+drhom*thetaW
15443 *
15444*/
15445 __pyx_t_10 = __pyx_v_eN;
15446 __pyx_t_14 = __pyx_v_j;
15447 __pyx_t_15 = -1;
15448 if (__pyx_t_10 < 0) {
15449 __pyx_t_10 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
15450 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15451 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_15 = 0;
15452 if (__pyx_t_14 < 0) {
15453 __pyx_t_14 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
15454 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1;
15455 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_15 = 1;
15456 if (unlikely(__pyx_t_15 != -1)) {
15457 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15458 __PYX_ERR(0, 452, __pyx_L1_error)
15459 }
15460 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
15461
15462 /* "subsurfaceTransportFunctions.pyx":453
15463 * drhom= beta*rhom
15464 * q_mass[eN,j] = rhom*thetaW
15465 * q_dmass[eN,j]=-rhom*DthetaW_DpsiC+drhom*thetaW # <<<<<<<<<<<<<<
15466 *
15467 * q_kr[eN,j] = KWr
15468*/
15469 __pyx_t_14 = __pyx_v_eN;
15470 __pyx_t_10 = __pyx_v_j;
15471 __pyx_t_15 = -1;
15472 if (__pyx_t_14 < 0) {
15473 __pyx_t_14 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
15474 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15475 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_15 = 0;
15476 if (__pyx_t_10 < 0) {
15477 __pyx_t_10 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
15478 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 1;
15479 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_15 = 1;
15480 if (unlikely(__pyx_t_15 != -1)) {
15481 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15482 __PYX_ERR(0, 453, __pyx_L1_error)
15483 }
15484 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
15485
15486 /* "subsurfaceTransportFunctions.pyx":455
15487 * q_dmass[eN,j]=-rhom*DthetaW_DpsiC+drhom*thetaW
15488 *
15489 * q_kr[eN,j] = KWr # <<<<<<<<<<<<<<
15490 * q_dkr[eN,j]= -DKWr_DpsiC
15491 *
15492*/
15493 __pyx_t_10 = __pyx_v_eN;
15494 __pyx_t_14 = __pyx_v_j;
15495 __pyx_t_15 = -1;
15496 if (__pyx_t_10 < 0) {
15497 __pyx_t_10 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
15498 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15499 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_15 = 0;
15500 if (__pyx_t_14 < 0) {
15501 __pyx_t_14 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
15502 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1;
15503 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_15 = 1;
15504 if (unlikely(__pyx_t_15 != -1)) {
15505 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15506 __PYX_ERR(0, 455, __pyx_L1_error)
15507 }
15508 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
15509
15510 /* "subsurfaceTransportFunctions.pyx":456
15511 *
15512 * q_kr[eN,j] = KWr
15513 * q_dkr[eN,j]= -DKWr_DpsiC # <<<<<<<<<<<<<<
15514 *
15515 * #j
15516*/
15517 __pyx_t_14 = __pyx_v_eN;
15518 __pyx_t_10 = __pyx_v_j;
15519 __pyx_t_15 = -1;
15520 if (__pyx_t_14 < 0) {
15521 __pyx_t_14 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
15522 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15523 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_15 = 0;
15524 if (__pyx_t_10 < 0) {
15525 __pyx_t_10 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
15526 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 1;
15527 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_15 = 1;
15528 if (unlikely(__pyx_t_15 != -1)) {
15529 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15530 __PYX_ERR(0, 456, __pyx_L1_error)
15531 }
15532 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
15533 }
15534
15535 }
15536
15537
15538 /* "subsurfaceTransportFunctions.pyx":462
15539 *
15540 * #now upwind kr
15541 * for eN in range(nElements_global): # <<<<<<<<<<<<<<
15542 * u_eN = numpy.sum(q_u[eN])*nAvgWeight
15543 * kr_eN = numpy.sum(q_kr[eN])*nAvgWeight
15544*/
15545
15546 __pyx_t_7 = __pyx_v_nElements_global;
15547 __pyx_t_8 = __pyx_t_7;
15548
15549 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
15550 __pyx_v_eN = __pyx_t_9;
15551
15552 /* "subsurfaceTransportFunctions.pyx":463
15553 * #now upwind kr
15554 * for eN in range(nElements_global):
15555 * u_eN = numpy.sum(q_u[eN])*nAvgWeight # <<<<<<<<<<<<<<
15556 * kr_eN = numpy.sum(q_kr[eN])*nAvgWeight
15557 * #potential assumes slight compressibility
15558*/
15559 __pyx_t_1 = NULL;
15560 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
15561 __Pyx_GOTREF(__pyx_t_4);
15562 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 463, __pyx_L1_error)
15563 __Pyx_GOTREF(__pyx_t_18);
15564 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15565 __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
15566 __Pyx_GOTREF(__pyx_t_4);
15567 __pyx_t_19 = 1;
15568 #if CYTHON_UNPACK_METHODS
15569 if (unlikely(PyMethod_Check(__pyx_t_18))) {
15570 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_18);
15571 assert(__pyx_t_1);
15572 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
15573 __Pyx_INCREF(__pyx_t_1);
15574 __Pyx_INCREF(__pyx__function);
15575 __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
15576 __pyx_t_19 = 0;
15577 }
15578 #endif
15579 {
15580 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
15581 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_19, (2-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15582 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15583 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15584 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15585 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
15586 __Pyx_GOTREF(__pyx_t_2);
15587 }
15588 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_nAvgWeight); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 463, __pyx_L1_error)
15589 __Pyx_GOTREF(__pyx_t_18);
15590 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_float(__pyx_t_2, __pyx_t_18); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
15591 __Pyx_GOTREF(__pyx_t_4);
15592 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15593 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15594 __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
15595 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15596 __pyx_v_u_eN = __pyx_t_6;
15597
15598 /* "subsurfaceTransportFunctions.pyx":464
15599 * for eN in range(nElements_global):
15600 * u_eN = numpy.sum(q_u[eN])*nAvgWeight
15601 * kr_eN = numpy.sum(q_kr[eN])*nAvgWeight # <<<<<<<<<<<<<<
15602 * #potential assumes slight compressibility
15603 * phi_eN= u_eN - numpy.dot(gravity,elementBarycentersArray[eN])
15604*/
15605 __pyx_t_18 = NULL;
15606 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
15607 __Pyx_GOTREF(__pyx_t_2);
15608 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
15609 __Pyx_GOTREF(__pyx_t_1);
15610 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15611 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
15612 __Pyx_GOTREF(__pyx_t_2);
15613 __pyx_t_19 = 1;
15614 #if CYTHON_UNPACK_METHODS
15615 if (unlikely(PyMethod_Check(__pyx_t_1))) {
15616 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_1);
15617 assert(__pyx_t_18);
15618 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
15619 __Pyx_INCREF(__pyx_t_18);
15620 __Pyx_INCREF(__pyx__function);
15621 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
15622 __pyx_t_19 = 0;
15623 }
15624 #endif
15625 {
15626 PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_2};
15627 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_19, (2-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15628 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
15629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15630 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15631 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
15632 __Pyx_GOTREF(__pyx_t_4);
15633 }
15634 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
15635 __Pyx_GOTREF(__pyx_t_1);
15636 __pyx_t_2 = __Pyx_PyNumber_Multiply_object_float(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
15637 __Pyx_GOTREF(__pyx_t_2);
15638 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15639 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15640 __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L1_error)
15641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15642 __pyx_v_kr_eN = __pyx_t_6;
15643
15644 /* "subsurfaceTransportFunctions.pyx":466
15645 * kr_eN = numpy.sum(q_kr[eN])*nAvgWeight
15646 * #potential assumes slight compressibility
15647 * phi_eN= u_eN - numpy.dot(gravity,elementBarycentersArray[eN]) # <<<<<<<<<<<<<<
15648 *
15649 *
15650*/
15651 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_u_eN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
15652 __Pyx_GOTREF(__pyx_t_2);
15653 __pyx_t_4 = NULL;
15654 __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 466, __pyx_L1_error)
15655 __Pyx_GOTREF(__pyx_t_18);
15656 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_dot); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 466, __pyx_L1_error)
15657 __Pyx_GOTREF(__pyx_t_20);
15658 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15659 __pyx_t_18 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 466, __pyx_L1_error)
15660 __Pyx_GOTREF(__pyx_t_18);
15661 __pyx_t_19 = 1;
15662 #if CYTHON_UNPACK_METHODS
15663 if (unlikely(PyMethod_Check(__pyx_t_20))) {
15664 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_20);
15665 assert(__pyx_t_4);
15666 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_20);
15667 __Pyx_INCREF(__pyx_t_4);
15668 __Pyx_INCREF(__pyx__function);
15669 __Pyx_DECREF_SET(__pyx_t_20, __pyx__function);
15670 __pyx_t_19 = 0;
15671 }
15672 #endif
15673 {
15674 PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_gravity), __pyx_t_18};
15675 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_20, __pyx_callargs+__pyx_t_19, (3-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15676 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15677 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15678 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15679 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
15680 __Pyx_GOTREF(__pyx_t_1);
15681 }
15682 __pyx_t_20 = __Pyx_PyNumber_Subtract_float_object(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 466, __pyx_L1_error)
15683 __Pyx_GOTREF(__pyx_t_20);
15684 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15686 __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L1_error)
15687 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15688 __pyx_v_phi_eN = __pyx_t_6;
15689
15690 /* "subsurfaceTransportFunctions.pyx":470
15691 *
15692 * #loop over faces to upwind
15693 * for ebN in range(nElementBoundaries_element): # <<<<<<<<<<<<<<
15694 * #by default eN is upwind
15695 * q_kr_up[eN,ebN] = kr_eN
15696*/
15697
15698 __pyx_t_11 = __pyx_v_nElementBoundaries_element;
15699 __pyx_t_12 = __pyx_t_11;
15700
15701 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
15702 __pyx_v_ebN = __pyx_t_13;
15703
15704 /* "subsurfaceTransportFunctions.pyx":472
15705 * for ebN in range(nElementBoundaries_element):
15706 * #by default eN is upwind
15707 * q_kr_up[eN,ebN] = kr_eN # <<<<<<<<<<<<<<
15708 * eN_neighbor = elementNeighborsArray[eN,ebN]
15709 * if eN_neighbor >= 0:
15710*/
15711 __pyx_t_10 = __pyx_v_eN;
15712 __pyx_t_14 = __pyx_v_ebN;
15713 __pyx_t_15 = -1;
15714 if (__pyx_t_10 < 0) {
15715 __pyx_t_10 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
15716 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15717 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_15 = 0;
15718 if (__pyx_t_14 < 0) {
15719 __pyx_t_14 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
15720 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1;
15721 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_15 = 1;
15722 if (unlikely(__pyx_t_15 != -1)) {
15723 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15724 __PYX_ERR(0, 472, __pyx_L1_error)
15725 }
15726 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
15727
15728 /* "subsurfaceTransportFunctions.pyx":473
15729 * #by default eN is upwind
15730 * q_kr_up[eN,ebN] = kr_eN
15731 * eN_neighbor = elementNeighborsArray[eN,ebN] # <<<<<<<<<<<<<<
15732 * if eN_neighbor >= 0:
15733 * u_neig = numpy.sum(q_u[eN_neighbor])*nAvgWeight
15734*/
15735 __pyx_t_14 = __pyx_v_eN;
15736 __pyx_t_10 = __pyx_v_ebN;
15737 __pyx_t_15 = -1;
15738 if (__pyx_t_14 < 0) {
15739 __pyx_t_14 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
15740 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
15741 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_15 = 0;
15742 if (__pyx_t_10 < 0) {
15743 __pyx_t_10 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
15744 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 1;
15745 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_15 = 1;
15746 if (unlikely(__pyx_t_15 != -1)) {
15747 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15748 __PYX_ERR(0, 473, __pyx_L1_error)
15749 }
15750 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
15751
15752 /* "subsurfaceTransportFunctions.pyx":474
15753 * q_kr_up[eN,ebN] = kr_eN
15754 * eN_neighbor = elementNeighborsArray[eN,ebN]
15755 * if eN_neighbor >= 0: # <<<<<<<<<<<<<<
15756 * u_neig = numpy.sum(q_u[eN_neighbor])*nAvgWeight
15757 * kr_neig = numpy.sum(q_kr[eN_neighbor])*nAvgWeight
15758*/
15759 __pyx_t_5 = (__pyx_v_eN_neighbor >= 0);
15760
15761 if (__pyx_t_5) {
15762
15763
15764 /* "subsurfaceTransportFunctions.pyx":475
15765 * eN_neighbor = elementNeighborsArray[eN,ebN]
15766 * if eN_neighbor >= 0:
15767 * u_neig = numpy.sum(q_u[eN_neighbor])*nAvgWeight # <<<<<<<<<<<<<<
15768 * kr_neig = numpy.sum(q_kr[eN_neighbor])*nAvgWeight
15769 * #potential, assumes slight compressibility
15770*/
15771 __pyx_t_1 = NULL;
15772 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
15773 __Pyx_GOTREF(__pyx_t_2);
15774 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 475, __pyx_L1_error)
15775 __Pyx_GOTREF(__pyx_t_18);
15776 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15777 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
15778 __Pyx_GOTREF(__pyx_t_2);
15779 __pyx_t_19 = 1;
15780 #if CYTHON_UNPACK_METHODS
15781 if (unlikely(PyMethod_Check(__pyx_t_18))) {
15782 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_18);
15783 assert(__pyx_t_1);
15784 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
15785 __Pyx_INCREF(__pyx_t_1);
15786 __Pyx_INCREF(__pyx__function);
15787 __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
15788 __pyx_t_19 = 0;
15789 }
15790 #endif
15791 {
15792 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
15793 __pyx_t_20 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_19, (2-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15794 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15795 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15796 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15797 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 475, __pyx_L1_error)
15798 __Pyx_GOTREF(__pyx_t_20);
15799 }
15800 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_nAvgWeight); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 475, __pyx_L1_error)
15801 __Pyx_GOTREF(__pyx_t_18);
15802 __pyx_t_2 = __Pyx_PyNumber_Multiply_object_float(__pyx_t_20, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
15803 __Pyx_GOTREF(__pyx_t_2);
15804 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15805 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15806 __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error)
15807 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15808 __pyx_v_u_neig = __pyx_t_6;
15809
15810 /* "subsurfaceTransportFunctions.pyx":476
15811 * if eN_neighbor >= 0:
15812 * u_neig = numpy.sum(q_u[eN_neighbor])*nAvgWeight
15813 * kr_neig = numpy.sum(q_kr[eN_neighbor])*nAvgWeight # <<<<<<<<<<<<<<
15814 * #potential, assumes slight compressibility
15815 * phi_neig= u_neig - numpy.dot(gravity,elementBarycentersArray[eN_neighbor])
15816*/
15817 __pyx_t_18 = NULL;
15818 __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 476, __pyx_L1_error)
15819 __Pyx_GOTREF(__pyx_t_20);
15820 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
15821 __Pyx_GOTREF(__pyx_t_1);
15822 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15823 __pyx_t_20 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 476, __pyx_L1_error)
15824 __Pyx_GOTREF(__pyx_t_20);
15825 __pyx_t_19 = 1;
15826 #if CYTHON_UNPACK_METHODS
15827 if (unlikely(PyMethod_Check(__pyx_t_1))) {
15828 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_1);
15829 assert(__pyx_t_18);
15830 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
15831 __Pyx_INCREF(__pyx_t_18);
15832 __Pyx_INCREF(__pyx__function);
15833 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
15834 __pyx_t_19 = 0;
15835 }
15836 #endif
15837 {
15838 PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_20};
15839 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_19, (2-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15840 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
15841 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15842 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15843 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error)
15844 __Pyx_GOTREF(__pyx_t_2);
15845 }
15846 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
15847 __Pyx_GOTREF(__pyx_t_1);
15848 __pyx_t_20 = __Pyx_PyNumber_Multiply_object_float(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 476, __pyx_L1_error)
15849 __Pyx_GOTREF(__pyx_t_20);
15850 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15851 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15852 __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error)
15853 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15854 __pyx_v_kr_neig = __pyx_t_6;
15855
15856 /* "subsurfaceTransportFunctions.pyx":478
15857 * kr_neig = numpy.sum(q_kr[eN_neighbor])*nAvgWeight
15858 * #potential, assumes slight compressibility
15859 * phi_neig= u_neig - numpy.dot(gravity,elementBarycentersArray[eN_neighbor]) # <<<<<<<<<<<<<<
15860 *
15861 * if phi_eN < phi_neig: #neighbor is upwind
15862*/
15863 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_u_neig); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 478, __pyx_L1_error)
15864 __Pyx_GOTREF(__pyx_t_20);
15865 __pyx_t_2 = NULL;
15866 __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 478, __pyx_L1_error)
15867 __Pyx_GOTREF(__pyx_t_18);
15868 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error)
15869 __Pyx_GOTREF(__pyx_t_4);
15870 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15871 __pyx_t_18 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 478, __pyx_L1_error)
15872 __Pyx_GOTREF(__pyx_t_18);
15873 __pyx_t_19 = 1;
15874 #if CYTHON_UNPACK_METHODS
15875 if (unlikely(PyMethod_Check(__pyx_t_4))) {
15876 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
15877 assert(__pyx_t_2);
15878 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
15879 __Pyx_INCREF(__pyx_t_2);
15880 __Pyx_INCREF(__pyx__function);
15881 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
15882 __pyx_t_19 = 0;
15883 }
15884 #endif
15885 {
15886 PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_gravity), __pyx_t_18};
15887 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_19, (3-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15888 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15889 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15890 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15891 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
15892 __Pyx_GOTREF(__pyx_t_1);
15893 }
15894 __pyx_t_4 = __Pyx_PyNumber_Subtract_float_object(__pyx_t_20, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error)
15895 __Pyx_GOTREF(__pyx_t_4);
15896 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15898 __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L1_error)
15899 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15900 __pyx_v_phi_neig = __pyx_t_6;
15901
15902 /* "subsurfaceTransportFunctions.pyx":480
15903 * phi_neig= u_neig - numpy.dot(gravity,elementBarycentersArray[eN_neighbor])
15904 *
15905 * if phi_eN < phi_neig: #neighbor is upwind # <<<<<<<<<<<<<<
15906 * q_kr_up[eN,ebN] = kr_neig
15907 *
15908*/
15909 __pyx_t_5 = (__pyx_v_phi_eN < __pyx_v_phi_neig);
15910
15911 if (__pyx_t_5) {
15912
15913
15914 /* "subsurfaceTransportFunctions.pyx":481
15915 *
15916 * if phi_eN < phi_neig: #neighbor is upwind
15917 * q_kr_up[eN,ebN] = kr_neig # <<<<<<<<<<<<<<
15918 *
15919 * #neighbor
15920*/
15921 __pyx_t_10 = __pyx_v_eN;
15922 __pyx_t_14 = __pyx_v_ebN;
15923 __pyx_t_15 = -1;
15924 if (__pyx_t_10 < 0) {
15925 __pyx_t_10 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
15926 if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
15927 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_15 = 0;
15928 if (__pyx_t_14 < 0) {
15929 __pyx_t_14 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
15930 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1;
15931 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_15 = 1;
15932 if (unlikely(__pyx_t_15 != -1)) {
15933 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15934 __PYX_ERR(0, 481, __pyx_L1_error)
15935 }
15936 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
15937
15938 /* "subsurfaceTransportFunctions.pyx":480
15939 * phi_neig= u_neig - numpy.dot(gravity,elementBarycentersArray[eN_neighbor])
15940 *
15941 * if phi_eN < phi_neig: #neighbor is upwind # <<<<<<<<<<<<<<
15942 * q_kr_up[eN,ebN] = kr_neig
15943 *
15944*/
15945 }
15946
15947 /* "subsurfaceTransportFunctions.pyx":474
15948 * q_kr_up[eN,ebN] = kr_eN
15949 * eN_neighbor = elementNeighborsArray[eN,ebN]
15950 * if eN_neighbor >= 0: # <<<<<<<<<<<<<<
15951 * u_neig = numpy.sum(q_u[eN_neighbor])*nAvgWeight
15952 * kr_neig = numpy.sum(q_kr[eN_neighbor])*nAvgWeight
15953*/
15954 }
15955 }
15956
15957 }
15958
15959
15960 /* "subsurfaceTransportFunctions.pyx":360
15961 *
15962 *
15963 * def RE_NCP1_evaluateElementCoefficients_VGM(double rho, # <<<<<<<<<<<<<<
15964 * double beta,
15965 * numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities
15966*/
15967
15968 /* function exit code */
15969 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15970 goto __pyx_L0;
15971 __pyx_L1_error:;
15972 __Pyx_XDECREF(__pyx_t_1);
15973 __Pyx_XDECREF(__pyx_t_2);
15974 __Pyx_XDECREF(__pyx_t_4);
15975 __Pyx_XDECREF(__pyx_t_18);
15976 __Pyx_XDECREF(__pyx_t_20);
15977 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15978 __Pyx_PyThreadState_declare
15979 __Pyx_PyThreadState_assign
15980 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15981 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
15982 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
15983 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
15984 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
15985 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
15986 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15987 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
15988 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
15989 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
15990 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
15991 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
15992 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
15993 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
15994 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
15995 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
15996 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
15997 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
15998 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
15999 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16000 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
16001 __pyx_r = NULL;
16002 goto __pyx_L2;
16003 __pyx_L0:;
16004 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
16005 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
16006 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
16007 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
16008 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
16009 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
16010 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
16011 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
16012 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
16013 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
16014 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
16015 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
16016 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
16017 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
16018 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
16019 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
16020 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
16021 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
16022 __pyx_L2:;
16023 __Pyx_XDECREF(__pyx_v_q);
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094 __Pyx_XGIVEREF(__pyx_r);
16095 __Pyx_RefNannyFinishContext();
16096 return __pyx_r;
16097}
16098
16099/* "subsurfaceTransportFunctions.pyx":487
16100 * #eN for upwind
16101 *
16102 * def RE_NCP1_getElementResidual(numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities # <<<<<<<<<<<<<<
16103 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
16104 * numpy.ndarray[ITYPE_t,ndim=1] colind,
16105*/
16106
16107/* Python wrapper */
16108static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self,
16109#if CYTHON_VECTORCALL
16110PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
16111#else
16112PyObject *__pyx_args, PyObject *__pyx_kwds
16113#endif
16114); /*proto*/
16115PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual, "\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ");
16116static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {"RE_NCP1_getElementResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
16117static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self,
16118#if CYTHON_VECTORCALL
16119PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
16120#else
16121PyObject *__pyx_args, PyObject *__pyx_kwds
16122#endif
16123) {
16124 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
16125 PyArrayObject *__pyx_v_rowptr = 0;
16126 PyArrayObject *__pyx_v_colind = 0;
16127 int __pyx_v_nSpace;
16128 int __pyx_v_nElements_global;
16129 int __pyx_v_nElementBoundaries_element;
16130 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
16131 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
16132 int __pyx_v_nDOF_test_element;
16133 PyArrayObject *__pyx_v_q_u = 0;
16134 PyArrayObject *__pyx_v_q_grad_u = 0;
16135 PyArrayObject *__pyx_v_q_grad_w = 0;
16136 PyArrayObject *__pyx_v_q_detJ = 0;
16137 PyArrayObject *__pyx_v_q_m = 0;
16138 PyArrayObject *__pyx_v_q_mt = 0;
16139 PyArrayObject *__pyx_v_q_r = 0;
16140 PyArrayObject *__pyx_v_q_kr = 0;
16141 PyArrayObject *__pyx_v_q_kr_up = 0;
16142 PyArrayObject *__pyx_v_q_flin = 0;
16143 PyArrayObject *__pyx_v_q_alin = 0;
16144 PyArrayObject *__pyx_v_elementResidual = 0;
16145 #if !CYTHON_VECTORCALL
16146 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
16147 #endif
16148 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
16149 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
16150 int __pyx_lineno = 0;
16151 const char *__pyx_filename = NULL;
16152 int __pyx_clineno = 0;
16153 PyObject *__pyx_r = 0;
16154 __Pyx_RefNannyDeclarations
16155 __Pyx_RefNannySetupContext("RE_NCP1_getElementResidual (wrapper)", 0);
16156 #if !CYTHON_VECTORCALL
16157 #if CYTHON_ASSUME_SAFE_SIZE
16158 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
16159 #else
16160 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
16161 #endif
16162 #endif
16163 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
16164 {
16165 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gravity,&__pyx_mstate_global->__pyx_n_u_rowptr,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_elementBarycentersArray,&__pyx_mstate_global->__pyx_n_u_nDOF_test_element,&__pyx_mstate_global->__pyx_n_u_q_u,&__pyx_mstate_global->__pyx_n_u_q_grad_u,&__pyx_mstate_global->__pyx_n_u_q_grad_w,&__pyx_mstate_global->__pyx_n_u_q_detJ,&__pyx_mstate_global->__pyx_n_u_q_m,&__pyx_mstate_global->__pyx_n_u_q_mt,&__pyx_mstate_global->__pyx_n_u_q_r,&__pyx_mstate_global->__pyx_n_u_q_kr,&__pyx_mstate_global->__pyx_n_u_q_kr_up,&__pyx_mstate_global->__pyx_n_u_q_flin,&__pyx_mstate_global->__pyx_n_u_q_alin,&__pyx_mstate_global->__pyx_n_u_elementResidual,0};
16166 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
16167 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 487, __pyx_L3_error)
16168 if (__pyx_kwds_len > 0) {
16169 switch (__pyx_nargs) {
16170 case 21:
16171 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
16172 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 487, __pyx_L3_error)
16173 CYTHON_FALLTHROUGH;
16174 case 20:
16175 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
16176 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 487, __pyx_L3_error)
16177 CYTHON_FALLTHROUGH;
16178 case 19:
16179 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
16180 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 487, __pyx_L3_error)
16181 CYTHON_FALLTHROUGH;
16182 case 18:
16183 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
16184 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 487, __pyx_L3_error)
16185 CYTHON_FALLTHROUGH;
16186 case 17:
16187 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
16188 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 487, __pyx_L3_error)
16189 CYTHON_FALLTHROUGH;
16190 case 16:
16191 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
16192 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 487, __pyx_L3_error)
16193 CYTHON_FALLTHROUGH;
16194 case 15:
16195 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
16196 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 487, __pyx_L3_error)
16197 CYTHON_FALLTHROUGH;
16198 case 14:
16199 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
16200 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 487, __pyx_L3_error)
16201 CYTHON_FALLTHROUGH;
16202 case 13:
16203 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
16204 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 487, __pyx_L3_error)
16205 CYTHON_FALLTHROUGH;
16206 case 12:
16207 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
16208 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 487, __pyx_L3_error)
16209 CYTHON_FALLTHROUGH;
16210 case 11:
16211 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
16212 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 487, __pyx_L3_error)
16213 CYTHON_FALLTHROUGH;
16214 case 10:
16215 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
16216 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 487, __pyx_L3_error)
16217 CYTHON_FALLTHROUGH;
16218 case 9:
16219 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
16220 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 487, __pyx_L3_error)
16221 CYTHON_FALLTHROUGH;
16222 case 8:
16223 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
16224 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 487, __pyx_L3_error)
16225 CYTHON_FALLTHROUGH;
16226 case 7:
16227 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
16228 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 487, __pyx_L3_error)
16229 CYTHON_FALLTHROUGH;
16230 case 6:
16231 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
16232 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 487, __pyx_L3_error)
16233 CYTHON_FALLTHROUGH;
16234 case 5:
16235 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
16236 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 487, __pyx_L3_error)
16237 CYTHON_FALLTHROUGH;
16238 case 4:
16239 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
16240 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 487, __pyx_L3_error)
16241 CYTHON_FALLTHROUGH;
16242 case 3:
16243 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
16244 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 487, __pyx_L3_error)
16245 CYTHON_FALLTHROUGH;
16246 case 2:
16247 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
16248 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 487, __pyx_L3_error)
16249 CYTHON_FALLTHROUGH;
16250 case 1:
16251 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
16252 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 487, __pyx_L3_error)
16253 CYTHON_FALLTHROUGH;
16254 case 0: break;
16255 default: goto __pyx_L5_argtuple_error;
16256 }
16257 const Py_ssize_t kwd_pos_args = __pyx_nargs;
16258 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "RE_NCP1_getElementResidual", 0) < (0)) __PYX_ERR(0, 487, __pyx_L3_error)
16259 for (Py_ssize_t i = __pyx_nargs; i < 21; i++) {
16260 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("RE_NCP1_getElementResidual", 1, 21, 21, i); __PYX_ERR(0, 487, __pyx_L3_error) }
16261 }
16262 } else if (unlikely(__pyx_nargs != 21)) {
16263 goto __pyx_L5_argtuple_error;
16264 } else {
16265 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
16266 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 487, __pyx_L3_error)
16267 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
16268 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 487, __pyx_L3_error)
16269 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
16270 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 487, __pyx_L3_error)
16271 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
16272 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 487, __pyx_L3_error)
16273 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
16274 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 487, __pyx_L3_error)
16275 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
16276 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 487, __pyx_L3_error)
16277 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
16278 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 487, __pyx_L3_error)
16279 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
16280 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 487, __pyx_L3_error)
16281 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
16282 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 487, __pyx_L3_error)
16283 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
16284 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 487, __pyx_L3_error)
16285 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
16286 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 487, __pyx_L3_error)
16287 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
16288 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 487, __pyx_L3_error)
16289 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
16290 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 487, __pyx_L3_error)
16291 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
16292 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 487, __pyx_L3_error)
16293 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
16294 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 487, __pyx_L3_error)
16295 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
16296 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 487, __pyx_L3_error)
16297 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
16298 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 487, __pyx_L3_error)
16299 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
16300 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 487, __pyx_L3_error)
16301 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
16302 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 487, __pyx_L3_error)
16303 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
16304 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 487, __pyx_L3_error)
16305 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
16306 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 487, __pyx_L3_error)
16307 }
16308 __pyx_v_gravity = ((PyArrayObject *)values[0]);
16309 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
16310 __pyx_v_colind = ((PyArrayObject *)values[2]);
16311 __pyx_v_nSpace = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
16312 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error)
16313 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 493, __pyx_L3_error)
16314 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
16315 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
16316 __pyx_v_nDOF_test_element = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_nDOF_test_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L3_error)
16317 __pyx_v_q_u = ((PyArrayObject *)values[9]);
16318 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
16319 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
16320 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
16321 __pyx_v_q_m = ((PyArrayObject *)values[13]);
16322 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
16323 __pyx_v_q_r = ((PyArrayObject *)values[15]);
16324 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
16325 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
16326 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
16327 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
16328 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
16329 }
16330 goto __pyx_L6_skip;
16331 __pyx_L5_argtuple_error:;
16332 __Pyx_RaiseArgtupleInvalid("RE_NCP1_getElementResidual", 1, 21, 21, __pyx_nargs); __PYX_ERR(0, 487, __pyx_L3_error)
16333 __pyx_L6_skip:;
16334 goto __pyx_L4_argument_unpacking_done;
16335 __pyx_L3_error:;
16336 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
16337 Py_XDECREF(values[__pyx_temp]);
16338 }
16339 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
16340 __Pyx_RefNannyFinishContext();
16341 return NULL;
16342 __pyx_L4_argument_unpacking_done:;
16343 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "gravity", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
16344 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
16345 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 489, __pyx_L1_error)
16346 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(0, 494, __pyx_L1_error)
16347 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBarycentersArray", 0))) __PYX_ERR(0, 495, __pyx_L1_error)
16348 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_u", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
16349 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_grad_u", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
16350 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_grad_w", 0))) __PYX_ERR(0, 500, __pyx_L1_error)
16351 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_detJ", 0))) __PYX_ERR(0, 502, __pyx_L1_error)
16352 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_m", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
16353 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_mt", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
16354 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_r", 0))) __PYX_ERR(0, 505, __pyx_L1_error)
16355 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_kr", 0))) __PYX_ERR(0, 506, __pyx_L1_error)
16356 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_kr_up", 0))) __PYX_ERR(0, 507, __pyx_L1_error)
16357 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_flin", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
16358 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_alin", 0))) __PYX_ERR(0, 511, __pyx_L1_error)
16359 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementResidual", 0))) __PYX_ERR(0, 513, __pyx_L1_error)
16360 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
16361
16362 /* function exit code */
16363 goto __pyx_L0;
16364 __pyx_L1_error:;
16365 __pyx_r = NULL;
16366 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
16367 Py_XDECREF(values[__pyx_temp]);
16368 }
16369 goto __pyx_L7_cleaned_up;
16370 __pyx_L0:;
16371 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
16372 Py_XDECREF(values[__pyx_temp]);
16373 }
16374 __pyx_L7_cleaned_up:;
16375
16376
16377
16378
16379 __Pyx_RefNannyFinishContext();
16380 return __pyx_r;
16381}
16382
16383static 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) {
16384 CYTHON_UNUSED int __pyx_v_upwindFlag;
16385 PyObject *__pyx_v_q = NULL;
16386 int __pyx_v_nnz;
16387 int __pyx_v_eN;
16388 int __pyx_v_ii;
16389 int __pyx_v_I;
16390 int __pyx_v_i;
16391 int __pyx_v_ebN;
16392 PyArrayObject *__pyx_v_a_up = 0;
16393 PyArrayObject *__pyx_v_f_up = 0;
16394 double __pyx_v_nAvgWeight;
16395 double __pyx_v_weight;
16396 double __pyx_v_volFactor;
16397 double __pyx_v_volume;
16398 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
16399 __Pyx_Buffer __pyx_pybuffer_a_up;
16400 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
16401 __Pyx_Buffer __pyx_pybuffer_colind;
16402 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
16403 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
16404 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
16405 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
16406 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
16407 __Pyx_Buffer __pyx_pybuffer_elementResidual;
16408 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
16409 __Pyx_Buffer __pyx_pybuffer_f_up;
16410 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
16411 __Pyx_Buffer __pyx_pybuffer_gravity;
16412 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
16413 __Pyx_Buffer __pyx_pybuffer_q_alin;
16414 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
16415 __Pyx_Buffer __pyx_pybuffer_q_detJ;
16416 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
16417 __Pyx_Buffer __pyx_pybuffer_q_flin;
16418 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
16419 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
16420 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
16421 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
16422 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
16423 __Pyx_Buffer __pyx_pybuffer_q_kr;
16424 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
16425 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
16426 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
16427 __Pyx_Buffer __pyx_pybuffer_q_m;
16428 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
16429 __Pyx_Buffer __pyx_pybuffer_q_mt;
16430 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
16431 __Pyx_Buffer __pyx_pybuffer_q_r;
16432 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
16433 __Pyx_Buffer __pyx_pybuffer_q_u;
16434 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
16435 __Pyx_Buffer __pyx_pybuffer_rowptr;
16436 PyObject *__pyx_r = NULL;
16437 __Pyx_RefNannyDeclarations
16438 PyObject *__pyx_t_1 = NULL;
16439 PyObject *__pyx_t_2 = NULL;
16440 Py_ssize_t __pyx_t_3;
16441 PyObject *__pyx_t_4 = NULL;
16442 int __pyx_t_5;
16443 Py_ssize_t __pyx_t_6;
16444 int __pyx_t_7;
16445 PyObject *__pyx_t_8 = NULL;
16446 size_t __pyx_t_9;
16447 double __pyx_t_10;
16448 int __pyx_t_11;
16449 int __pyx_t_12;
16450 Py_ssize_t __pyx_t_13;
16451 int __pyx_t_14;
16452 int __pyx_t_15;
16453 int __pyx_t_16;
16454 int __pyx_t_17;
16455 Py_ssize_t __pyx_t_18;
16456 Py_ssize_t __pyx_t_19;
16457 int __pyx_t_20;
16458 int __pyx_t_21;
16459 int __pyx_t_22;
16460 int __pyx_t_23;
16461 int __pyx_t_24;
16462 int __pyx_t_25;
16463 Py_ssize_t __pyx_t_26;
16464 Py_ssize_t __pyx_t_27;
16465 Py_ssize_t __pyx_t_28;
16466 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_29;
16467 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_30;
16468 int __pyx_t_31;
16469 Py_ssize_t __pyx_t_32;
16470 Py_ssize_t __pyx_t_33;
16471 Py_ssize_t __pyx_t_34;
16472 Py_ssize_t __pyx_t_35;
16473 Py_ssize_t __pyx_t_36;
16474 int __pyx_lineno = 0;
16475 const char *__pyx_filename = NULL;
16476 int __pyx_clineno = 0;
16477 __Pyx_RefNannySetupContext("RE_NCP1_getElementResidual", 0);
16478 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
16479 __pyx_pybuffer_a_up.refcount = 0;
16480 __pyx_pybuffernd_a_up.data = NULL;
16481 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
16482 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
16483 __pyx_pybuffer_f_up.refcount = 0;
16484 __pyx_pybuffernd_f_up.data = NULL;
16485 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
16486 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
16487 __pyx_pybuffer_gravity.refcount = 0;
16488 __pyx_pybuffernd_gravity.data = NULL;
16489 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
16490 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
16491 __pyx_pybuffer_rowptr.refcount = 0;
16492 __pyx_pybuffernd_rowptr.data = NULL;
16493 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
16494 __pyx_pybuffer_colind.pybuffer.buf = NULL;
16495 __pyx_pybuffer_colind.refcount = 0;
16496 __pyx_pybuffernd_colind.data = NULL;
16497 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
16498 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
16499 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
16500 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
16501 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
16502 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
16503 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
16504 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
16505 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
16506 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
16507 __pyx_pybuffer_q_u.refcount = 0;
16508 __pyx_pybuffernd_q_u.data = NULL;
16509 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
16510 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
16511 __pyx_pybuffer_q_grad_u.refcount = 0;
16512 __pyx_pybuffernd_q_grad_u.data = NULL;
16513 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
16514 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
16515 __pyx_pybuffer_q_grad_w.refcount = 0;
16516 __pyx_pybuffernd_q_grad_w.data = NULL;
16517 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
16518 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
16519 __pyx_pybuffer_q_detJ.refcount = 0;
16520 __pyx_pybuffernd_q_detJ.data = NULL;
16521 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
16522 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
16523 __pyx_pybuffer_q_m.refcount = 0;
16524 __pyx_pybuffernd_q_m.data = NULL;
16525 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
16526 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
16527 __pyx_pybuffer_q_mt.refcount = 0;
16528 __pyx_pybuffernd_q_mt.data = NULL;
16529 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
16530 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
16531 __pyx_pybuffer_q_r.refcount = 0;
16532 __pyx_pybuffernd_q_r.data = NULL;
16533 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
16534 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
16535 __pyx_pybuffer_q_kr.refcount = 0;
16536 __pyx_pybuffernd_q_kr.data = NULL;
16537 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
16538 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
16539 __pyx_pybuffer_q_kr_up.refcount = 0;
16540 __pyx_pybuffernd_q_kr_up.data = NULL;
16541 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
16542 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
16543 __pyx_pybuffer_q_flin.refcount = 0;
16544 __pyx_pybuffernd_q_flin.data = NULL;
16545 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
16546 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
16547 __pyx_pybuffer_q_alin.refcount = 0;
16548 __pyx_pybuffernd_q_alin.data = NULL;
16549 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
16550 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
16551 __pyx_pybuffer_elementResidual.refcount = 0;
16552 __pyx_pybuffernd_elementResidual.data = NULL;
16553 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
16554 {
16555 __Pyx_BufFmt_StackElem __pyx_stack[1];
16556 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16557 }
16558 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
16559 {
16560 __Pyx_BufFmt_StackElem __pyx_stack[1];
16561 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16562 }
16563 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
16564 {
16565 __Pyx_BufFmt_StackElem __pyx_stack[1];
16566 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16567 }
16568 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
16569 {
16570 __Pyx_BufFmt_StackElem __pyx_stack[1];
16571 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16572 }
16573 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
16574 {
16575 __Pyx_BufFmt_StackElem __pyx_stack[1];
16576 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16577 }
16578 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
16579 {
16580 __Pyx_BufFmt_StackElem __pyx_stack[1];
16581 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16582 }
16583 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
16584 {
16585 __Pyx_BufFmt_StackElem __pyx_stack[1];
16586 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16587 }
16588 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
16589 {
16590 __Pyx_BufFmt_StackElem __pyx_stack[1];
16591 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16592 }
16593 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
16594 {
16595 __Pyx_BufFmt_StackElem __pyx_stack[1];
16596 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16597 }
16598 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
16599 {
16600 __Pyx_BufFmt_StackElem __pyx_stack[1];
16601 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16602 }
16603 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
16604 {
16605 __Pyx_BufFmt_StackElem __pyx_stack[1];
16606 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16607 }
16608 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
16609 {
16610 __Pyx_BufFmt_StackElem __pyx_stack[1];
16611 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16612 }
16613 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
16614 {
16615 __Pyx_BufFmt_StackElem __pyx_stack[1];
16616 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16617 }
16618 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
16619 {
16620 __Pyx_BufFmt_StackElem __pyx_stack[1];
16621 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16622 }
16623 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
16624 {
16625 __Pyx_BufFmt_StackElem __pyx_stack[1];
16626 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16627 }
16628 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
16629 {
16630 __Pyx_BufFmt_StackElem __pyx_stack[1];
16631 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16632 }
16633 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
16634 {
16635 __Pyx_BufFmt_StackElem __pyx_stack[1];
16636 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
16637 }
16638 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
16639
16640 /* "subsurfaceTransportFunctions.pyx":528
16641 *
16642 * """
16643 * cdef int upwindFlag = 1 # <<<<<<<<<<<<<<
16644 * #check some sizes
16645 * for q in [q_u,q_m,q_mt,q_r,q_kr]:
16646*/
16647 __pyx_v_upwindFlag = 1;
16648
16649 /* "subsurfaceTransportFunctions.pyx":530
16650 * cdef int upwindFlag = 1
16651 * #check some sizes
16652 * for q in [q_u,q_m,q_mt,q_r,q_kr]: # <<<<<<<<<<<<<<
16653 * assert q.shape[1] == nSpace+1
16654 * assert nDOF_test_element == nSpace+1
16655*/
16656 __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
16657 __Pyx_GOTREF(__pyx_t_1);
16658 __Pyx_INCREF((PyObject *)__pyx_v_q_u);
16659 __Pyx_GIVEREF((PyObject *)__pyx_v_q_u);
16660 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u)) != (0)) __PYX_ERR(0, 530, __pyx_L1_error);
16661 __Pyx_INCREF((PyObject *)__pyx_v_q_m);
16662 __Pyx_GIVEREF((PyObject *)__pyx_v_q_m);
16663 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m)) != (0)) __PYX_ERR(0, 530, __pyx_L1_error);
16664 __Pyx_INCREF((PyObject *)__pyx_v_q_mt);
16665 __Pyx_GIVEREF((PyObject *)__pyx_v_q_mt);
16666 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt)) != (0)) __PYX_ERR(0, 530, __pyx_L1_error);
16667 __Pyx_INCREF((PyObject *)__pyx_v_q_r);
16668 __Pyx_GIVEREF((PyObject *)__pyx_v_q_r);
16669 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r)) != (0)) __PYX_ERR(0, 530, __pyx_L1_error);
16670 __Pyx_INCREF((PyObject *)__pyx_v_q_kr);
16671 __Pyx_GIVEREF((PyObject *)__pyx_v_q_kr);
16672 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr)) != (0)) __PYX_ERR(0, 530, __pyx_L1_error);
16673 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
16674 __pyx_t_3 = 0;
16675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16676 for (;;) {
16677 if (__pyx_t_3 >= 5) break;
16678 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16679 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
16680 #else
16681 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
16682 #endif
16683 ++__pyx_t_3;
16684 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
16685 __Pyx_GOTREF(__pyx_t_1);
16686 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
16687 __pyx_t_1 = 0;
16688
16689 /* "subsurfaceTransportFunctions.pyx":531
16690 * #check some sizes
16691 * for q in [q_u,q_m,q_mt,q_r,q_kr]:
16692 * assert q.shape[1] == nSpace+1 # <<<<<<<<<<<<<<
16693 * assert nDOF_test_element == nSpace+1
16694 * cdef int nnz = rowptr[nSpace]
16695*/
16696 #ifndef CYTHON_WITHOUT_ASSERTIONS
16697 if (unlikely(__pyx_assertions_enabled())) {
16698 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
16699 __Pyx_GOTREF(__pyx_t_1);
16700 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
16701 __Pyx_GOTREF(__pyx_t_4);
16702 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16703 __pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_nSpace + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
16704 __Pyx_GOTREF(__pyx_t_1);
16705 __pyx_t_5 = __Pyx_PyObject_CompareBoolEq_object_int(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 531, __pyx_L1_error)
16706 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16708 if (unlikely(!__pyx_t_5)) {
16709 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
16710 __PYX_ERR(0, 531, __pyx_L1_error)
16711 }
16712
16713 }
16714 #else
16715 if ((1)); else __PYX_ERR(0, 531, __pyx_L1_error)
16716 #endif
16717
16718 /* "subsurfaceTransportFunctions.pyx":530
16719 * cdef int upwindFlag = 1
16720 * #check some sizes
16721 * for q in [q_u,q_m,q_mt,q_r,q_kr]: # <<<<<<<<<<<<<<
16722 * assert q.shape[1] == nSpace+1
16723 * assert nDOF_test_element == nSpace+1
16724*/
16725 }
16726 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16727
16728 /* "subsurfaceTransportFunctions.pyx":532
16729 * for q in [q_u,q_m,q_mt,q_r,q_kr]:
16730 * assert q.shape[1] == nSpace+1
16731 * assert nDOF_test_element == nSpace+1 # <<<<<<<<<<<<<<
16732 * cdef int nnz = rowptr[nSpace]
16733 * #temporaries
16734*/
16735 #ifndef CYTHON_WITHOUT_ASSERTIONS
16736 if (unlikely(__pyx_assertions_enabled())) {
16737 __pyx_t_5 = (__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1));
16738
16739 if (unlikely(!__pyx_t_5)) {
16740 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
16741 __PYX_ERR(0, 532, __pyx_L1_error)
16742 }
16743
16744 }
16745 #else
16746 if ((1)); else __PYX_ERR(0, 532, __pyx_L1_error)
16747 #endif
16748
16749 /* "subsurfaceTransportFunctions.pyx":533
16750 * assert q.shape[1] == nSpace+1
16751 * assert nDOF_test_element == nSpace+1
16752 * cdef int nnz = rowptr[nSpace] # <<<<<<<<<<<<<<
16753 * #temporaries
16754 * cdef double u_eN,kr_eN,phi_eN,u_neig,kr_neig,phi_neig
16755*/
16756 __pyx_t_6 = __pyx_v_nSpace;
16757 __pyx_t_7 = -1;
16758 if (__pyx_t_6 < 0) {
16759 __pyx_t_6 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
16760 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
16761 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_7 = 0;
16762 if (unlikely(__pyx_t_7 != -1)) {
16763 __Pyx_RaiseBufferIndexError(__pyx_t_7);
16764 __PYX_ERR(0, 533, __pyx_L1_error)
16765 }
16766 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_rowptr.diminfo[0].strides));
16767
16768 /* "subsurfaceTransportFunctions.pyx":537
16769 * cdef double u_eN,kr_eN,phi_eN,u_neig,kr_neig,phi_neig
16770 * cdef int eN,eN_neighbor,ii,I,i,ebN
16771 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_up= numpy.zeros(nnz,'d') # <<<<<<<<<<<<<<
16772 * cdef numpy.ndarray[DTYPE_t,ndim=1] f_up= numpy.zeros(nSpace,'d')
16773 * #for averaging/integration weights
16774*/
16775 __pyx_t_1 = NULL;
16776 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
16777 __Pyx_GOTREF(__pyx_t_4);
16778 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error)
16779 __Pyx_GOTREF(__pyx_t_8);
16780 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16781 __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_nnz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
16782 __Pyx_GOTREF(__pyx_t_4);
16783 __pyx_t_9 = 1;
16784 #if CYTHON_UNPACK_METHODS
16785 if (unlikely(PyMethod_Check(__pyx_t_8))) {
16786 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
16787 assert(__pyx_t_1);
16788 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
16789 __Pyx_INCREF(__pyx_t_1);
16790 __Pyx_INCREF(__pyx__function);
16791 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
16792 __pyx_t_9 = 0;
16793 }
16794 #endif
16795 {
16796 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_d};
16797 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16798 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16799 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16800 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16801 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
16802 __Pyx_GOTREF(__pyx_t_2);
16803 }
16804 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error)
16805 {
16806 __Pyx_BufFmt_StackElem __pyx_stack[1];
16807 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
16808 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
16809 __PYX_ERR(0, 537, __pyx_L1_error)
16810 } else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
16811 }
16812 }
16813 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
16814 __pyx_t_2 = 0;
16815
16816 /* "subsurfaceTransportFunctions.pyx":538
16817 * cdef int eN,eN_neighbor,ii,I,i,ebN
16818 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_up= numpy.zeros(nnz,'d')
16819 * cdef numpy.ndarray[DTYPE_t,ndim=1] f_up= numpy.zeros(nSpace,'d') # <<<<<<<<<<<<<<
16820 * #for averaging/integration weights
16821 * cdef double nAvgWeight = 1.0/(nSpace+1.)
16822*/
16823 __pyx_t_8 = NULL;
16824 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
16825 __Pyx_GOTREF(__pyx_t_4);
16826 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
16827 __Pyx_GOTREF(__pyx_t_1);
16828 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16829 __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_nSpace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
16830 __Pyx_GOTREF(__pyx_t_4);
16831 __pyx_t_9 = 1;
16832 #if CYTHON_UNPACK_METHODS
16833 if (unlikely(PyMethod_Check(__pyx_t_1))) {
16834 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
16835 assert(__pyx_t_8);
16836 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
16837 __Pyx_INCREF(__pyx_t_8);
16838 __Pyx_INCREF(__pyx__function);
16839 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
16840 __pyx_t_9 = 0;
16841 }
16842 #endif
16843 {
16844 PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_d};
16845 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16846 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16847 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16848 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16849 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
16850 __Pyx_GOTREF(__pyx_t_2);
16851 }
16852 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 538, __pyx_L1_error)
16853 {
16854 __Pyx_BufFmt_StackElem __pyx_stack[1];
16855 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
16856 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
16857 __PYX_ERR(0, 538, __pyx_L1_error)
16858 } else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
16859 }
16860 }
16861 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
16862 __pyx_t_2 = 0;
16863
16864 /* "subsurfaceTransportFunctions.pyx":540
16865 * cdef numpy.ndarray[DTYPE_t,ndim=1] f_up= numpy.zeros(nSpace,'d')
16866 * #for averaging/integration weights
16867 * cdef double nAvgWeight = 1.0/(nSpace+1.) # <<<<<<<<<<<<<<
16868 * cdef double weight=1.0,volFactor = 1.0
16869 * if nSpace == 2:
16870*/
16871 __pyx_t_10 = (__pyx_v_nSpace + 1.);
16872
16873 if (unlikely(__pyx_t_10 == 0)) {
16874 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
16875 __PYX_ERR(0, 540, __pyx_L1_error)
16876 }
16877 __pyx_v_nAvgWeight = (1.0 / __pyx_t_10);
16878
16879
16880 /* "subsurfaceTransportFunctions.pyx":541
16881 * #for averaging/integration weights
16882 * cdef double nAvgWeight = 1.0/(nSpace+1.)
16883 * cdef double weight=1.0,volFactor = 1.0 # <<<<<<<<<<<<<<
16884 * if nSpace == 2:
16885 * volFactor = 0.5
16886*/
16887 __pyx_v_weight = 1.0;
16888 __pyx_v_volFactor = 1.0;
16889
16890 /* "subsurfaceTransportFunctions.pyx":542
16891 * cdef double nAvgWeight = 1.0/(nSpace+1.)
16892 * cdef double weight=1.0,volFactor = 1.0
16893 * if nSpace == 2: # <<<<<<<<<<<<<<
16894 * volFactor = 0.5
16895 * if nSpace == 3:
16896*/
16897 __pyx_t_5 = (__pyx_v_nSpace == 2);
16898
16899 if (__pyx_t_5) {
16900
16901
16902 /* "subsurfaceTransportFunctions.pyx":543
16903 * cdef double weight=1.0,volFactor = 1.0
16904 * if nSpace == 2:
16905 * volFactor = 0.5 # <<<<<<<<<<<<<<
16906 * if nSpace == 3:
16907 * volFactor = 1.0/6.0
16908*/
16909 __pyx_v_volFactor = 0.5;
16910
16911 /* "subsurfaceTransportFunctions.pyx":542
16912 * cdef double nAvgWeight = 1.0/(nSpace+1.)
16913 * cdef double weight=1.0,volFactor = 1.0
16914 * if nSpace == 2: # <<<<<<<<<<<<<<
16915 * volFactor = 0.5
16916 * if nSpace == 3:
16917*/
16918 }
16919
16920 /* "subsurfaceTransportFunctions.pyx":544
16921 * if nSpace == 2:
16922 * volFactor = 0.5
16923 * if nSpace == 3: # <<<<<<<<<<<<<<
16924 * volFactor = 1.0/6.0
16925 * #
16926*/
16927 __pyx_t_5 = (__pyx_v_nSpace == 3);
16928
16929 if (__pyx_t_5) {
16930
16931
16932 /* "subsurfaceTransportFunctions.pyx":545
16933 * volFactor = 0.5
16934 * if nSpace == 3:
16935 * volFactor = 1.0/6.0 # <<<<<<<<<<<<<<
16936 * #
16937 * for eN in range(nElements_global):
16938*/
16939 __pyx_v_volFactor = (1.0 / 6.0);
16940
16941 /* "subsurfaceTransportFunctions.pyx":544
16942 * if nSpace == 2:
16943 * volFactor = 0.5
16944 * if nSpace == 3: # <<<<<<<<<<<<<<
16945 * volFactor = 1.0/6.0
16946 * #
16947*/
16948 }
16949
16950 /* "subsurfaceTransportFunctions.pyx":547
16951 * volFactor = 1.0/6.0
16952 * #
16953 * for eN in range(nElements_global): # <<<<<<<<<<<<<<
16954 * volume = volFactor*fabs(q_detJ[eN,0]) #affine transformation
16955 * weight = nAvgWeight*volume
16956*/
16957
16958 __pyx_t_7 = __pyx_v_nElements_global;
16959 __pyx_t_11 = __pyx_t_7;
16960
16961 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
16962 __pyx_v_eN = __pyx_t_12;
16963
16964 /* "subsurfaceTransportFunctions.pyx":548
16965 * #
16966 * for eN in range(nElements_global):
16967 * volume = volFactor*fabs(q_detJ[eN,0]) #affine transformation # <<<<<<<<<<<<<<
16968 * weight = nAvgWeight*volume
16969 *
16970*/
16971 __pyx_t_6 = __pyx_v_eN;
16972 __pyx_t_13 = 0;
16973 __pyx_t_14 = -1;
16974 if (__pyx_t_6 < 0) {
16975 __pyx_t_6 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
16976 if (unlikely(__pyx_t_6 < 0)) __pyx_t_14 = 0;
16977 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_14 = 0;
16978 if (__pyx_t_13 < 0) {
16979 __pyx_t_13 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
16980 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1;
16981 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_14 = 1;
16982 if (unlikely(__pyx_t_14 != -1)) {
16983 __Pyx_RaiseBufferIndexError(__pyx_t_14);
16984 __PYX_ERR(0, 548, __pyx_L1_error)
16985 }
16986 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
16987
16988 /* "subsurfaceTransportFunctions.pyx":549
16989 * for eN in range(nElements_global):
16990 * volume = volFactor*fabs(q_detJ[eN,0]) #affine transformation
16991 * weight = nAvgWeight*volume # <<<<<<<<<<<<<<
16992 *
16993 * for i in range(nDOF_test_element):
16994*/
16995 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
16996
16997 /* "subsurfaceTransportFunctions.pyx":551
16998 * weight = nAvgWeight*volume
16999 *
17000 * for i in range(nDOF_test_element): # <<<<<<<<<<<<<<
17001 * #nodal quadrature so diagonal
17002 * ##mass
17003*/
17004
17005 __pyx_t_14 = __pyx_v_nDOF_test_element;
17006 __pyx_t_15 = __pyx_t_14;
17007
17008 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
17009 __pyx_v_i = __pyx_t_16;
17010
17011 /* "subsurfaceTransportFunctions.pyx":554
17012 * #nodal quadrature so diagonal
17013 * ##mass
17014 * elementResidual[eN,i] += weight*q_mt[eN,i] # <<<<<<<<<<<<<<
17015 * ##sources
17016 * elementResidual[eN,i] += weight*q_r[eN,i]
17017*/
17018 __pyx_t_13 = __pyx_v_eN;
17019 __pyx_t_6 = __pyx_v_i;
17020 __pyx_t_17 = -1;
17021 if (__pyx_t_13 < 0) {
17022 __pyx_t_13 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
17023 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
17024 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_17 = 0;
17025 if (__pyx_t_6 < 0) {
17026 __pyx_t_6 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
17027 if (unlikely(__pyx_t_6 < 0)) __pyx_t_17 = 1;
17028 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_17 = 1;
17029 if (unlikely(__pyx_t_17 != -1)) {
17030 __Pyx_RaiseBufferIndexError(__pyx_t_17);
17031 __PYX_ERR(0, 554, __pyx_L1_error)
17032 }
17033 __pyx_t_18 = __pyx_v_eN;
17034 __pyx_t_19 = __pyx_v_i;
17035 __pyx_t_17 = -1;
17036 if (__pyx_t_18 < 0) {
17037 __pyx_t_18 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
17038 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
17039 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_17 = 0;
17040 if (__pyx_t_19 < 0) {
17041 __pyx_t_19 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
17042 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
17043 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_17 = 1;
17044 if (unlikely(__pyx_t_17 != -1)) {
17045 __Pyx_RaiseBufferIndexError(__pyx_t_17);
17046 __PYX_ERR(0, 554, __pyx_L1_error)
17047 }
17048 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
17049
17050 /* "subsurfaceTransportFunctions.pyx":556
17051 * elementResidual[eN,i] += weight*q_mt[eN,i]
17052 * ##sources
17053 * elementResidual[eN,i] += weight*q_r[eN,i] # <<<<<<<<<<<<<<
17054 *
17055 * #have to actually compute loop over other nodes for stiffness terms
17056*/
17057 __pyx_t_6 = __pyx_v_eN;
17058 __pyx_t_13 = __pyx_v_i;
17059 __pyx_t_17 = -1;
17060 if (__pyx_t_6 < 0) {
17061 __pyx_t_6 += __pyx_pybuffernd_q_r.diminfo[0].shape;
17062 if (unlikely(__pyx_t_6 < 0)) __pyx_t_17 = 0;
17063 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_17 = 0;
17064 if (__pyx_t_13 < 0) {
17065 __pyx_t_13 += __pyx_pybuffernd_q_r.diminfo[1].shape;
17066 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 1;
17067 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_17 = 1;
17068 if (unlikely(__pyx_t_17 != -1)) {
17069 __Pyx_RaiseBufferIndexError(__pyx_t_17);
17070 __PYX_ERR(0, 556, __pyx_L1_error)
17071 }
17072 __pyx_t_19 = __pyx_v_eN;
17073 __pyx_t_18 = __pyx_v_i;
17074 __pyx_t_17 = -1;
17075 if (__pyx_t_19 < 0) {
17076 __pyx_t_19 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
17077 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 0;
17078 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_17 = 0;
17079 if (__pyx_t_18 < 0) {
17080 __pyx_t_18 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
17081 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 1;
17082 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_17 = 1;
17083 if (unlikely(__pyx_t_17 != -1)) {
17084 __Pyx_RaiseBufferIndexError(__pyx_t_17);
17085 __PYX_ERR(0, 556, __pyx_L1_error)
17086 }
17087 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_q_r.diminfo[1].strides)));
17088
17089 /* "subsurfaceTransportFunctions.pyx":559
17090 *
17091 * #have to actually compute loop over other nodes for stiffness terms
17092 * for ebN in range(nElementBoundaries_element): #same as nDOF_trial , nElementBoundaries_ # <<<<<<<<<<<<<<
17093 * #assumes linear parts of f and a and upwind k_r have already been evaluated correctly for interface
17094 * for ii in range(nnz):
17095*/
17096
17097 __pyx_t_17 = __pyx_v_nElementBoundaries_element;
17098 __pyx_t_20 = __pyx_t_17;
17099
17100 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
17101 __pyx_v_ebN = __pyx_t_21;
17102
17103 /* "subsurfaceTransportFunctions.pyx":561
17104 * for ebN in range(nElementBoundaries_element): #same as nDOF_trial , nElementBoundaries_
17105 * #assumes linear parts of f and a and upwind k_r have already been evaluated correctly for interface
17106 * for ii in range(nnz): # <<<<<<<<<<<<<<
17107 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN]
17108 * for I in range(nSpace):
17109*/
17110
17111 __pyx_t_22 = __pyx_v_nnz;
17112 __pyx_t_23 = __pyx_t_22;
17113
17114 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
17115 __pyx_v_ii = __pyx_t_24;
17116
17117 /* "subsurfaceTransportFunctions.pyx":562
17118 * #assumes linear parts of f and a and upwind k_r have already been evaluated correctly for interface
17119 * for ii in range(nnz):
17120 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN] # <<<<<<<<<<<<<<
17121 * for I in range(nSpace):
17122 * f_up[I] = q_flin[eN,ebN,I]*q_kr_up[eN,ebN]
17123*/
17124 __pyx_t_13 = __pyx_v_eN;
17125 __pyx_t_6 = __pyx_v_ebN;
17126 __pyx_t_18 = __pyx_v_ii;
17127 __pyx_t_25 = -1;
17128 if (__pyx_t_13 < 0) {
17129 __pyx_t_13 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
17130 if (unlikely(__pyx_t_13 < 0)) __pyx_t_25 = 0;
17131 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_25 = 0;
17132 if (__pyx_t_6 < 0) {
17133 __pyx_t_6 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
17134 if (unlikely(__pyx_t_6 < 0)) __pyx_t_25 = 1;
17135 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_25 = 1;
17136 if (__pyx_t_18 < 0) {
17137 __pyx_t_18 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
17138 if (unlikely(__pyx_t_18 < 0)) __pyx_t_25 = 2;
17139 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_25 = 2;
17140 if (unlikely(__pyx_t_25 != -1)) {
17141 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17142 __PYX_ERR(0, 562, __pyx_L1_error)
17143 }
17144 __pyx_t_19 = __pyx_v_eN;
17145 __pyx_t_26 = __pyx_v_ebN;
17146 __pyx_t_25 = -1;
17147 if (__pyx_t_19 < 0) {
17148 __pyx_t_19 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
17149 if (unlikely(__pyx_t_19 < 0)) __pyx_t_25 = 0;
17150 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_25 = 0;
17151 if (__pyx_t_26 < 0) {
17152 __pyx_t_26 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
17153 if (unlikely(__pyx_t_26 < 0)) __pyx_t_25 = 1;
17154 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_25 = 1;
17155 if (unlikely(__pyx_t_25 != -1)) {
17156 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17157 __PYX_ERR(0, 562, __pyx_L1_error)
17158 }
17159 __pyx_t_27 = __pyx_v_ii;
17160 __pyx_t_25 = -1;
17161 if (__pyx_t_27 < 0) {
17162 __pyx_t_27 += __pyx_pybuffernd_a_up.diminfo[0].shape;
17163 if (unlikely(__pyx_t_27 < 0)) __pyx_t_25 = 0;
17164 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_25 = 0;
17165 if (unlikely(__pyx_t_25 != -1)) {
17166 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17167 __PYX_ERR(0, 562, __pyx_L1_error)
17168 }
17169 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
17170 }
17171
17172
17173 /* "subsurfaceTransportFunctions.pyx":563
17174 * for ii in range(nnz):
17175 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN]
17176 * for I in range(nSpace): # <<<<<<<<<<<<<<
17177 * f_up[I] = q_flin[eN,ebN,I]*q_kr_up[eN,ebN]
17178 * #
17179*/
17180
17181 __pyx_t_22 = __pyx_v_nSpace;
17182 __pyx_t_23 = __pyx_t_22;
17183
17184 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
17185 __pyx_v_I = __pyx_t_24;
17186
17187 /* "subsurfaceTransportFunctions.pyx":564
17188 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN]
17189 * for I in range(nSpace):
17190 * f_up[I] = q_flin[eN,ebN,I]*q_kr_up[eN,ebN] # <<<<<<<<<<<<<<
17191 * #
17192 * #accumulate advection and stiffness contributions
17193*/
17194 __pyx_t_26 = __pyx_v_eN;
17195 __pyx_t_19 = __pyx_v_ebN;
17196 __pyx_t_18 = __pyx_v_I;
17197 __pyx_t_25 = -1;
17198 if (__pyx_t_26 < 0) {
17199 __pyx_t_26 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
17200 if (unlikely(__pyx_t_26 < 0)) __pyx_t_25 = 0;
17201 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_25 = 0;
17202 if (__pyx_t_19 < 0) {
17203 __pyx_t_19 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
17204 if (unlikely(__pyx_t_19 < 0)) __pyx_t_25 = 1;
17205 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_25 = 1;
17206 if (__pyx_t_18 < 0) {
17207 __pyx_t_18 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
17208 if (unlikely(__pyx_t_18 < 0)) __pyx_t_25 = 2;
17209 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_25 = 2;
17210 if (unlikely(__pyx_t_25 != -1)) {
17211 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17212 __PYX_ERR(0, 564, __pyx_L1_error)
17213 }
17214 __pyx_t_6 = __pyx_v_eN;
17215 __pyx_t_13 = __pyx_v_ebN;
17216 __pyx_t_25 = -1;
17217 if (__pyx_t_6 < 0) {
17218 __pyx_t_6 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
17219 if (unlikely(__pyx_t_6 < 0)) __pyx_t_25 = 0;
17220 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_25 = 0;
17221 if (__pyx_t_13 < 0) {
17222 __pyx_t_13 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
17223 if (unlikely(__pyx_t_13 < 0)) __pyx_t_25 = 1;
17224 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_25 = 1;
17225 if (unlikely(__pyx_t_25 != -1)) {
17226 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17227 __PYX_ERR(0, 564, __pyx_L1_error)
17228 }
17229 __pyx_t_27 = __pyx_v_I;
17230 __pyx_t_25 = -1;
17231 if (__pyx_t_27 < 0) {
17232 __pyx_t_27 += __pyx_pybuffernd_f_up.diminfo[0].shape;
17233 if (unlikely(__pyx_t_27 < 0)) __pyx_t_25 = 0;
17234 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_25 = 0;
17235 if (unlikely(__pyx_t_25 != -1)) {
17236 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17237 __PYX_ERR(0, 564, __pyx_L1_error)
17238 }
17239 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
17240 }
17241
17242
17243 /* "subsurfaceTransportFunctions.pyx":567
17244 * #
17245 * #accumulate advection and stiffness contributions
17246 * for I in range(nSpace): # <<<<<<<<<<<<<<
17247 * elementResidual[eN,i] -= weight*f_up[I]*q_grad_w[eN,ebN,i,I]
17248 * for ii in range(rowptr[I],rowptr[I+1]):
17249*/
17250
17251 __pyx_t_22 = __pyx_v_nSpace;
17252 __pyx_t_23 = __pyx_t_22;
17253
17254 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
17255 __pyx_v_I = __pyx_t_24;
17256
17257 /* "subsurfaceTransportFunctions.pyx":568
17258 * #accumulate advection and stiffness contributions
17259 * for I in range(nSpace):
17260 * elementResidual[eN,i] -= weight*f_up[I]*q_grad_w[eN,ebN,i,I] # <<<<<<<<<<<<<<
17261 * for ii in range(rowptr[I],rowptr[I+1]):
17262 * elementResidual[eN,i] += weight*a_up[ii]*q_grad_u[eN,ebN,colind[ii]]*q_grad_w[eN,ebN,i,I]
17263*/
17264 __pyx_t_13 = __pyx_v_I;
17265 __pyx_t_25 = -1;
17266 if (__pyx_t_13 < 0) {
17267 __pyx_t_13 += __pyx_pybuffernd_f_up.diminfo[0].shape;
17268 if (unlikely(__pyx_t_13 < 0)) __pyx_t_25 = 0;
17269 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_25 = 0;
17270 if (unlikely(__pyx_t_25 != -1)) {
17271 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17272 __PYX_ERR(0, 568, __pyx_L1_error)
17273 }
17274 __pyx_t_6 = __pyx_v_eN;
17275 __pyx_t_18 = __pyx_v_ebN;
17276 __pyx_t_19 = __pyx_v_i;
17277 __pyx_t_26 = __pyx_v_I;
17278 __pyx_t_25 = -1;
17279 if (__pyx_t_6 < 0) {
17280 __pyx_t_6 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
17281 if (unlikely(__pyx_t_6 < 0)) __pyx_t_25 = 0;
17282 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_25 = 0;
17283 if (__pyx_t_18 < 0) {
17284 __pyx_t_18 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
17285 if (unlikely(__pyx_t_18 < 0)) __pyx_t_25 = 1;
17286 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_25 = 1;
17287 if (__pyx_t_19 < 0) {
17288 __pyx_t_19 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
17289 if (unlikely(__pyx_t_19 < 0)) __pyx_t_25 = 2;
17290 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_25 = 2;
17291 if (__pyx_t_26 < 0) {
17292 __pyx_t_26 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
17293 if (unlikely(__pyx_t_26 < 0)) __pyx_t_25 = 3;
17294 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_25 = 3;
17295 if (unlikely(__pyx_t_25 != -1)) {
17296 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17297 __PYX_ERR(0, 568, __pyx_L1_error)
17298 }
17299 __pyx_t_27 = __pyx_v_eN;
17300 __pyx_t_28 = __pyx_v_i;
17301 __pyx_t_25 = -1;
17302 if (__pyx_t_27 < 0) {
17303 __pyx_t_27 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
17304 if (unlikely(__pyx_t_27 < 0)) __pyx_t_25 = 0;
17305 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_25 = 0;
17306 if (__pyx_t_28 < 0) {
17307 __pyx_t_28 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
17308 if (unlikely(__pyx_t_28 < 0)) __pyx_t_25 = 1;
17309 } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_25 = 1;
17310 if (unlikely(__pyx_t_25 != -1)) {
17311 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17312 __PYX_ERR(0, 568, __pyx_L1_error)
17313 }
17314 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
17315
17316 /* "subsurfaceTransportFunctions.pyx":569
17317 * for I in range(nSpace):
17318 * elementResidual[eN,i] -= weight*f_up[I]*q_grad_w[eN,ebN,i,I]
17319 * for ii in range(rowptr[I],rowptr[I+1]): # <<<<<<<<<<<<<<
17320 * elementResidual[eN,i] += weight*a_up[ii]*q_grad_u[eN,ebN,colind[ii]]*q_grad_w[eN,ebN,i,I]
17321 * #I
17322*/
17323 __pyx_t_26 = (__pyx_v_I + 1);
17324 __pyx_t_25 = -1;
17325 if (__pyx_t_26 < 0) {
17326 __pyx_t_26 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
17327 if (unlikely(__pyx_t_26 < 0)) __pyx_t_25 = 0;
17328 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_25 = 0;
17329 if (unlikely(__pyx_t_25 != -1)) {
17330 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17331 __PYX_ERR(0, 569, __pyx_L1_error)
17332 }
17333
17334 __pyx_t_29 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rowptr.diminfo[0].strides));
17335 __pyx_t_26 = __pyx_v_I;
17336 __pyx_t_25 = -1;
17337 if (__pyx_t_26 < 0) {
17338 __pyx_t_26 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
17339 if (unlikely(__pyx_t_26 < 0)) __pyx_t_25 = 0;
17340 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_25 = 0;
17341 if (unlikely(__pyx_t_25 != -1)) {
17342 __Pyx_RaiseBufferIndexError(__pyx_t_25);
17343 __PYX_ERR(0, 569, __pyx_L1_error)
17344 }
17345 __pyx_t_30 = __pyx_t_29;
17346
17347 for (__pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_25 < __pyx_t_30; __pyx_t_25+=1) {
17348 __pyx_v_ii = __pyx_t_25;
17349
17350 /* "subsurfaceTransportFunctions.pyx":570
17351 * elementResidual[eN,i] -= weight*f_up[I]*q_grad_w[eN,ebN,i,I]
17352 * for ii in range(rowptr[I],rowptr[I+1]):
17353 * elementResidual[eN,i] += weight*a_up[ii]*q_grad_u[eN,ebN,colind[ii]]*q_grad_w[eN,ebN,i,I] # <<<<<<<<<<<<<<
17354 * #I
17355 * #j
17356*/
17357 __pyx_t_19 = __pyx_v_ii;
17358 __pyx_t_31 = -1;
17359 if (__pyx_t_19 < 0) {
17360 __pyx_t_19 += __pyx_pybuffernd_a_up.diminfo[0].shape;
17361 if (unlikely(__pyx_t_19 < 0)) __pyx_t_31 = 0;
17362 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_31 = 0;
17363 if (unlikely(__pyx_t_31 != -1)) {
17364 __Pyx_RaiseBufferIndexError(__pyx_t_31);
17365 __PYX_ERR(0, 570, __pyx_L1_error)
17366 }
17367 __pyx_t_18 = __pyx_v_ii;
17368 __pyx_t_31 = -1;
17369 if (__pyx_t_18 < 0) {
17370 __pyx_t_18 += __pyx_pybuffernd_colind.diminfo[0].shape;
17371 if (unlikely(__pyx_t_18 < 0)) __pyx_t_31 = 0;
17372 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_31 = 0;
17373 if (unlikely(__pyx_t_31 != -1)) {
17374 __Pyx_RaiseBufferIndexError(__pyx_t_31);
17375 __PYX_ERR(0, 570, __pyx_L1_error)
17376 }
17377 __pyx_t_6 = __pyx_v_eN;
17378 __pyx_t_13 = __pyx_v_ebN;
17379 __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_colind.diminfo[0].strides));
17380 __pyx_t_31 = -1;
17381 if (__pyx_t_6 < 0) {
17382 __pyx_t_6 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
17383 if (unlikely(__pyx_t_6 < 0)) __pyx_t_31 = 0;
17384 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_31 = 0;
17385 if (__pyx_t_13 < 0) {
17386 __pyx_t_13 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
17387 if (unlikely(__pyx_t_13 < 0)) __pyx_t_31 = 1;
17388 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_31 = 1;
17389 if (__pyx_t_28 < 0) {
17390 __pyx_t_28 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
17391 if (unlikely(__pyx_t_28 < 0)) __pyx_t_31 = 2;
17392 } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_31 = 2;
17393 if (unlikely(__pyx_t_31 != -1)) {
17394 __Pyx_RaiseBufferIndexError(__pyx_t_31);
17395 __PYX_ERR(0, 570, __pyx_L1_error)
17396 }
17397 __pyx_t_27 = __pyx_v_eN;
17398 __pyx_t_32 = __pyx_v_ebN;
17399 __pyx_t_33 = __pyx_v_i;
17400 __pyx_t_34 = __pyx_v_I;
17401 __pyx_t_31 = -1;
17402 if (__pyx_t_27 < 0) {
17403 __pyx_t_27 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
17404 if (unlikely(__pyx_t_27 < 0)) __pyx_t_31 = 0;
17405 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_31 = 0;
17406 if (__pyx_t_32 < 0) {
17407 __pyx_t_32 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
17408 if (unlikely(__pyx_t_32 < 0)) __pyx_t_31 = 1;
17409 } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_31 = 1;
17410 if (__pyx_t_33 < 0) {
17411 __pyx_t_33 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
17412 if (unlikely(__pyx_t_33 < 0)) __pyx_t_31 = 2;
17413 } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_31 = 2;
17414 if (__pyx_t_34 < 0) {
17415 __pyx_t_34 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
17416 if (unlikely(__pyx_t_34 < 0)) __pyx_t_31 = 3;
17417 } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_31 = 3;
17418 if (unlikely(__pyx_t_31 != -1)) {
17419 __Pyx_RaiseBufferIndexError(__pyx_t_31);
17420 __PYX_ERR(0, 570, __pyx_L1_error)
17421 }
17422 __pyx_t_35 = __pyx_v_eN;
17423 __pyx_t_36 = __pyx_v_i;
17424 __pyx_t_31 = -1;
17425 if (__pyx_t_35 < 0) {
17426 __pyx_t_35 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
17427 if (unlikely(__pyx_t_35 < 0)) __pyx_t_31 = 0;
17428 } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_31 = 0;
17429 if (__pyx_t_36 < 0) {
17430 __pyx_t_36 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
17431 if (unlikely(__pyx_t_36 < 0)) __pyx_t_31 = 1;
17432 } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_31 = 1;
17433 if (unlikely(__pyx_t_31 != -1)) {
17434 __Pyx_RaiseBufferIndexError(__pyx_t_31);
17435 __PYX_ERR(0, 570, __pyx_L1_error)
17436 }
17437 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_34, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
17438 }
17439
17440 }
17441
17442 }
17443
17444 }
17445
17446 }
17447
17448
17449 /* "subsurfaceTransportFunctions.pyx":487
17450 * #eN for upwind
17451 *
17452 * def RE_NCP1_getElementResidual(numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities # <<<<<<<<<<<<<<
17453 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
17454 * numpy.ndarray[ITYPE_t,ndim=1] colind,
17455*/
17456
17457 /* function exit code */
17458 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17459 goto __pyx_L0;
17460 __pyx_L1_error:;
17461 __Pyx_XDECREF(__pyx_t_1);
17462 __Pyx_XDECREF(__pyx_t_2);
17463 __Pyx_XDECREF(__pyx_t_4);
17464 __Pyx_XDECREF(__pyx_t_8);
17465 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17466 __Pyx_PyThreadState_declare
17467 __Pyx_PyThreadState_assign
17468 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17469 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
17470 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
17471 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
17472 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
17473 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
17474 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
17475 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
17476 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
17477 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
17478 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
17479 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
17480 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
17481 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
17482 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
17483 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
17484 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
17485 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
17486 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
17487 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
17488 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17489 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
17490 __pyx_r = NULL;
17491 goto __pyx_L2;
17492 __pyx_L0:;
17493 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
17494 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
17495 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
17496 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
17497 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
17498 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
17499 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
17500 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
17501 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
17502 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
17503 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
17504 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
17505 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
17506 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
17507 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
17508 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
17509 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
17510 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
17511 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
17512 __pyx_L2:;
17513
17514 __Pyx_XDECREF(__pyx_v_q);
17515
17516
17517
17518
17519
17520
17521 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
17522 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565 __Pyx_XGIVEREF(__pyx_r);
17566 __Pyx_RefNannyFinishContext();
17567 return __pyx_r;
17568}
17569
17570/* "subsurfaceTransportFunctions.pyx":575
17571 * #i
17572 * #eN
17573 * def RE_NCP1_getElementJacobian(numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities # <<<<<<<<<<<<<<
17574 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
17575 * numpy.ndarray[ITYPE_t,ndim=1] colind,
17576*/
17577
17578/* Python wrapper */
17579static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self,
17580#if CYTHON_VECTORCALL
17581PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17582#else
17583PyObject *__pyx_args, PyObject *__pyx_kwds
17584#endif
17585); /*proto*/
17586PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian, "\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ");
17587static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {"RE_NCP1_getElementJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
17588static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self,
17589#if CYTHON_VECTORCALL
17590PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17591#else
17592PyObject *__pyx_args, PyObject *__pyx_kwds
17593#endif
17594) {
17595 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
17596 PyArrayObject *__pyx_v_rowptr = 0;
17597 PyArrayObject *__pyx_v_colind = 0;
17598 int __pyx_v_nSpace;
17599 int __pyx_v_nElements_global;
17600 int __pyx_v_nElementBoundaries_element;
17601 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
17602 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
17603 int __pyx_v_nDOF_test_element;
17604 int __pyx_v_nDOF_trial_element;
17605 PyArrayObject *__pyx_v_q_u = 0;
17606 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
17607 PyArrayObject *__pyx_v_q_grad_w = 0;
17608 PyArrayObject *__pyx_v_q_grad_v = 0;
17609 PyArrayObject *__pyx_v_q_detJ = 0;
17610 PyArrayObject *__pyx_v_q_m = 0;
17611 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
17612 PyArrayObject *__pyx_v_q_mt = 0;
17613 PyArrayObject *__pyx_v_q_dmt = 0;
17614 PyArrayObject *__pyx_v_q_r = 0;
17615 PyArrayObject *__pyx_v_q_kr = 0;
17616 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
17617 PyArrayObject *__pyx_v_q_kr_up = 0;
17618 PyArrayObject *__pyx_v_q_flin = 0;
17619 PyArrayObject *__pyx_v_q_alin = 0;
17620 PyArrayObject *__pyx_v_elementJacobian = 0;
17621 #if !CYTHON_VECTORCALL
17622 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
17623 #endif
17624 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
17625 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
17626 int __pyx_lineno = 0;
17627 const char *__pyx_filename = NULL;
17628 int __pyx_clineno = 0;
17629 PyObject *__pyx_r = 0;
17630 __Pyx_RefNannyDeclarations
17631 __Pyx_RefNannySetupContext("RE_NCP1_getElementJacobian (wrapper)", 0);
17632 #if !CYTHON_VECTORCALL
17633 #if CYTHON_ASSUME_SAFE_SIZE
17634 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
17635 #else
17636 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
17637 #endif
17638 #endif
17639 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
17640 {
17641 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gravity,&__pyx_mstate_global->__pyx_n_u_rowptr,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_elementBarycentersArray,&__pyx_mstate_global->__pyx_n_u_nDOF_test_element,&__pyx_mstate_global->__pyx_n_u_nDOF_trial_element,&__pyx_mstate_global->__pyx_n_u_q_u,&__pyx_mstate_global->__pyx_n_u_q_grad_u,&__pyx_mstate_global->__pyx_n_u_q_grad_w,&__pyx_mstate_global->__pyx_n_u_q_grad_v,&__pyx_mstate_global->__pyx_n_u_q_detJ,&__pyx_mstate_global->__pyx_n_u_q_m,&__pyx_mstate_global->__pyx_n_u_q_dm,&__pyx_mstate_global->__pyx_n_u_q_mt,&__pyx_mstate_global->__pyx_n_u_q_dmt,&__pyx_mstate_global->__pyx_n_u_q_r,&__pyx_mstate_global->__pyx_n_u_q_kr,&__pyx_mstate_global->__pyx_n_u_q_dkr,&__pyx_mstate_global->__pyx_n_u_q_kr_up,&__pyx_mstate_global->__pyx_n_u_q_flin,&__pyx_mstate_global->__pyx_n_u_q_alin,&__pyx_mstate_global->__pyx_n_u_elementJacobian,0};
17642 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
17643 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 575, __pyx_L3_error)
17644 if (__pyx_kwds_len > 0) {
17645 switch (__pyx_nargs) {
17646 case 26:
17647 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
17648 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 575, __pyx_L3_error)
17649 CYTHON_FALLTHROUGH;
17650 case 25:
17651 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
17652 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 575, __pyx_L3_error)
17653 CYTHON_FALLTHROUGH;
17654 case 24:
17655 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
17656 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 575, __pyx_L3_error)
17657 CYTHON_FALLTHROUGH;
17658 case 23:
17659 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
17660 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 575, __pyx_L3_error)
17661 CYTHON_FALLTHROUGH;
17662 case 22:
17663 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
17664 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 575, __pyx_L3_error)
17665 CYTHON_FALLTHROUGH;
17666 case 21:
17667 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
17668 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 575, __pyx_L3_error)
17669 CYTHON_FALLTHROUGH;
17670 case 20:
17671 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
17672 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 575, __pyx_L3_error)
17673 CYTHON_FALLTHROUGH;
17674 case 19:
17675 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
17676 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 575, __pyx_L3_error)
17677 CYTHON_FALLTHROUGH;
17678 case 18:
17679 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
17680 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 575, __pyx_L3_error)
17681 CYTHON_FALLTHROUGH;
17682 case 17:
17683 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
17684 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 575, __pyx_L3_error)
17685 CYTHON_FALLTHROUGH;
17686 case 16:
17687 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
17688 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 575, __pyx_L3_error)
17689 CYTHON_FALLTHROUGH;
17690 case 15:
17691 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
17692 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 575, __pyx_L3_error)
17693 CYTHON_FALLTHROUGH;
17694 case 14:
17695 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
17696 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 575, __pyx_L3_error)
17697 CYTHON_FALLTHROUGH;
17698 case 13:
17699 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
17700 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 575, __pyx_L3_error)
17701 CYTHON_FALLTHROUGH;
17702 case 12:
17703 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
17704 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 575, __pyx_L3_error)
17705 CYTHON_FALLTHROUGH;
17706 case 11:
17707 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
17708 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 575, __pyx_L3_error)
17709 CYTHON_FALLTHROUGH;
17710 case 10:
17711 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
17712 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 575, __pyx_L3_error)
17713 CYTHON_FALLTHROUGH;
17714 case 9:
17715 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
17716 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 575, __pyx_L3_error)
17717 CYTHON_FALLTHROUGH;
17718 case 8:
17719 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
17720 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 575, __pyx_L3_error)
17721 CYTHON_FALLTHROUGH;
17722 case 7:
17723 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
17724 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 575, __pyx_L3_error)
17725 CYTHON_FALLTHROUGH;
17726 case 6:
17727 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
17728 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 575, __pyx_L3_error)
17729 CYTHON_FALLTHROUGH;
17730 case 5:
17731 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
17732 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 575, __pyx_L3_error)
17733 CYTHON_FALLTHROUGH;
17734 case 4:
17735 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
17736 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 575, __pyx_L3_error)
17737 CYTHON_FALLTHROUGH;
17738 case 3:
17739 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
17740 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 575, __pyx_L3_error)
17741 CYTHON_FALLTHROUGH;
17742 case 2:
17743 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
17744 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 575, __pyx_L3_error)
17745 CYTHON_FALLTHROUGH;
17746 case 1:
17747 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
17748 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 575, __pyx_L3_error)
17749 CYTHON_FALLTHROUGH;
17750 case 0: break;
17751 default: goto __pyx_L5_argtuple_error;
17752 }
17753 const Py_ssize_t kwd_pos_args = __pyx_nargs;
17754 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "RE_NCP1_getElementJacobian", 0) < (0)) __PYX_ERR(0, 575, __pyx_L3_error)
17755 for (Py_ssize_t i = __pyx_nargs; i < 26; i++) {
17756 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("RE_NCP1_getElementJacobian", 1, 26, 26, i); __PYX_ERR(0, 575, __pyx_L3_error) }
17757 }
17758 } else if (unlikely(__pyx_nargs != 26)) {
17759 goto __pyx_L5_argtuple_error;
17760 } else {
17761 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
17762 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 575, __pyx_L3_error)
17763 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
17764 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 575, __pyx_L3_error)
17765 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
17766 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 575, __pyx_L3_error)
17767 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
17768 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 575, __pyx_L3_error)
17769 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
17770 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 575, __pyx_L3_error)
17771 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
17772 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 575, __pyx_L3_error)
17773 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
17774 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 575, __pyx_L3_error)
17775 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
17776 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 575, __pyx_L3_error)
17777 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
17778 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 575, __pyx_L3_error)
17779 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
17780 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 575, __pyx_L3_error)
17781 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
17782 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 575, __pyx_L3_error)
17783 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
17784 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 575, __pyx_L3_error)
17785 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
17786 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 575, __pyx_L3_error)
17787 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
17788 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 575, __pyx_L3_error)
17789 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
17790 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 575, __pyx_L3_error)
17791 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
17792 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 575, __pyx_L3_error)
17793 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
17794 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 575, __pyx_L3_error)
17795 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
17796 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 575, __pyx_L3_error)
17797 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
17798 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 575, __pyx_L3_error)
17799 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
17800 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 575, __pyx_L3_error)
17801 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
17802 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 575, __pyx_L3_error)
17803 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
17804 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 575, __pyx_L3_error)
17805 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
17806 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 575, __pyx_L3_error)
17807 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
17808 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 575, __pyx_L3_error)
17809 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
17810 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 575, __pyx_L3_error)
17811 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
17812 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 575, __pyx_L3_error)
17813 }
17814 __pyx_v_gravity = ((PyArrayObject *)values[0]);
17815 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
17816 __pyx_v_colind = ((PyArrayObject *)values[2]);
17817 __pyx_v_nSpace = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
17818 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
17819 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L3_error)
17820 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
17821 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
17822 __pyx_v_nDOF_test_element = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_nDOF_test_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error)
17823 __pyx_v_nDOF_trial_element = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_nDOF_trial_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L3_error)
17824 __pyx_v_q_u = ((PyArrayObject *)values[10]);
17825 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
17826 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
17827 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
17828 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
17829 __pyx_v_q_m = ((PyArrayObject *)values[15]);
17830 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
17831 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
17832 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
17833 __pyx_v_q_r = ((PyArrayObject *)values[19]);
17834 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
17835 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
17836 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
17837 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
17838 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
17839 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
17840 }
17841 goto __pyx_L6_skip;
17842 __pyx_L5_argtuple_error:;
17843 __Pyx_RaiseArgtupleInvalid("RE_NCP1_getElementJacobian", 1, 26, 26, __pyx_nargs); __PYX_ERR(0, 575, __pyx_L3_error)
17844 __pyx_L6_skip:;
17845 goto __pyx_L4_argument_unpacking_done;
17846 __pyx_L3_error:;
17847 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
17848 Py_XDECREF(values[__pyx_temp]);
17849 }
17850 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
17851 __Pyx_RefNannyFinishContext();
17852 return NULL;
17853 __pyx_L4_argument_unpacking_done:;
17854 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "gravity", 0))) __PYX_ERR(0, 575, __pyx_L1_error)
17855 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 576, __pyx_L1_error)
17856 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 577, __pyx_L1_error)
17857 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(0, 582, __pyx_L1_error)
17858 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBarycentersArray", 0))) __PYX_ERR(0, 583, __pyx_L1_error)
17859 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_u", 0))) __PYX_ERR(0, 587, __pyx_L1_error)
17860 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_grad_u", 0))) __PYX_ERR(0, 588, __pyx_L1_error)
17861 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_grad_w", 0))) __PYX_ERR(0, 589, __pyx_L1_error)
17862 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_grad_v", 0))) __PYX_ERR(0, 590, __pyx_L1_error)
17863 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_detJ", 0))) __PYX_ERR(0, 592, __pyx_L1_error)
17864 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_m", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
17865 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_dm", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
17866 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_mt", 0))) __PYX_ERR(0, 595, __pyx_L1_error)
17867 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_dmt", 0))) __PYX_ERR(0, 596, __pyx_L1_error)
17868 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_r", 0))) __PYX_ERR(0, 597, __pyx_L1_error)
17869 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_kr", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
17870 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_dkr", 0))) __PYX_ERR(0, 599, __pyx_L1_error)
17871 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_kr_up", 0))) __PYX_ERR(0, 600, __pyx_L1_error)
17872 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_flin", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
17873 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "q_alin", 0))) __PYX_ERR(0, 604, __pyx_L1_error)
17874 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementJacobian", 0))) __PYX_ERR(0, 606, __pyx_L1_error)
17875 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
17876
17877 /* function exit code */
17878 goto __pyx_L0;
17879 __pyx_L1_error:;
17880 __pyx_r = NULL;
17881 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
17882 Py_XDECREF(values[__pyx_temp]);
17883 }
17884 goto __pyx_L7_cleaned_up;
17885 __pyx_L0:;
17886 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
17887 Py_XDECREF(values[__pyx_temp]);
17888 }
17889 __pyx_L7_cleaned_up:;
17890
17891
17892
17893
17894
17895 __Pyx_RefNannyFinishContext();
17896 return __pyx_r;
17897}
17898
17899static 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) {
17900 CYTHON_UNUSED int __pyx_v_upwindFlag;
17901 CYTHON_UNUSED int __pyx_v_picard;
17902 PyObject *__pyx_v_q = NULL;
17903 int __pyx_v_nnz;
17904 int __pyx_v_eN;
17905 int __pyx_v_ii;
17906 int __pyx_v_I;
17907 PyArrayObject *__pyx_v_a_up = 0;
17908 PyArrayObject *__pyx_v_f_up = 0;
17909 double __pyx_v_nAvgWeight;
17910 double __pyx_v_weight;
17911 double __pyx_v_volFactor;
17912 CYTHON_UNUSED int __pyx_v_thisElementIsUpwind;
17913 double __pyx_v_volume;
17914 int __pyx_v_i;
17915 int __pyx_v_ebN;
17916 int __pyx_v_j;
17917 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
17918 __Pyx_Buffer __pyx_pybuffer_a_up;
17919 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
17920 __Pyx_Buffer __pyx_pybuffer_colind;
17921 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
17922 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
17923 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
17924 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
17925 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
17926 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
17927 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
17928 __Pyx_Buffer __pyx_pybuffer_f_up;
17929 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
17930 __Pyx_Buffer __pyx_pybuffer_gravity;
17931 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
17932 __Pyx_Buffer __pyx_pybuffer_q_alin;
17933 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
17934 __Pyx_Buffer __pyx_pybuffer_q_detJ;
17935 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
17936 __Pyx_Buffer __pyx_pybuffer_q_dkr;
17937 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
17938 __Pyx_Buffer __pyx_pybuffer_q_dm;
17939 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
17940 __Pyx_Buffer __pyx_pybuffer_q_dmt;
17941 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
17942 __Pyx_Buffer __pyx_pybuffer_q_flin;
17943 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
17944 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
17945 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
17946 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
17947 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
17948 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
17949 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
17950 __Pyx_Buffer __pyx_pybuffer_q_kr;
17951 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
17952 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
17953 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
17954 __Pyx_Buffer __pyx_pybuffer_q_m;
17955 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
17956 __Pyx_Buffer __pyx_pybuffer_q_mt;
17957 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
17958 __Pyx_Buffer __pyx_pybuffer_q_r;
17959 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
17960 __Pyx_Buffer __pyx_pybuffer_q_u;
17961 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
17962 __Pyx_Buffer __pyx_pybuffer_rowptr;
17963 PyObject *__pyx_r = NULL;
17964 __Pyx_RefNannyDeclarations
17965 PyObject *__pyx_t_1 = NULL;
17966 PyObject *__pyx_t_2 = NULL;
17967 Py_ssize_t __pyx_t_3;
17968 PyObject *__pyx_t_4 = NULL;
17969 int __pyx_t_5;
17970 Py_ssize_t __pyx_t_6;
17971 int __pyx_t_7;
17972 PyObject *__pyx_t_8 = NULL;
17973 size_t __pyx_t_9;
17974 double __pyx_t_10;
17975 int __pyx_t_11;
17976 int __pyx_t_12;
17977 Py_ssize_t __pyx_t_13;
17978 int __pyx_t_14;
17979 int __pyx_t_15;
17980 int __pyx_t_16;
17981 int __pyx_t_17;
17982 Py_ssize_t __pyx_t_18;
17983 Py_ssize_t __pyx_t_19;
17984 Py_ssize_t __pyx_t_20;
17985 int __pyx_t_21;
17986 int __pyx_t_22;
17987 int __pyx_t_23;
17988 int __pyx_t_24;
17989 int __pyx_t_25;
17990 int __pyx_t_26;
17991 Py_ssize_t __pyx_t_27;
17992 int __pyx_t_28;
17993 int __pyx_t_29;
17994 int __pyx_t_30;
17995 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_31;
17996 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_32;
17997 int __pyx_t_33;
17998 Py_ssize_t __pyx_t_34;
17999 Py_ssize_t __pyx_t_35;
18000 Py_ssize_t __pyx_t_36;
18001 Py_ssize_t __pyx_t_37;
18002 Py_ssize_t __pyx_t_38;
18003 Py_ssize_t __pyx_t_39;
18004 Py_ssize_t __pyx_t_40;
18005 Py_ssize_t __pyx_t_41;
18006 int __pyx_lineno = 0;
18007 const char *__pyx_filename = NULL;
18008 int __pyx_clineno = 0;
18009 __Pyx_RefNannySetupContext("RE_NCP1_getElementJacobian", 0);
18010 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
18011 __pyx_pybuffer_a_up.refcount = 0;
18012 __pyx_pybuffernd_a_up.data = NULL;
18013 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
18014 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
18015 __pyx_pybuffer_f_up.refcount = 0;
18016 __pyx_pybuffernd_f_up.data = NULL;
18017 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
18018 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
18019 __pyx_pybuffer_gravity.refcount = 0;
18020 __pyx_pybuffernd_gravity.data = NULL;
18021 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
18022 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
18023 __pyx_pybuffer_rowptr.refcount = 0;
18024 __pyx_pybuffernd_rowptr.data = NULL;
18025 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
18026 __pyx_pybuffer_colind.pybuffer.buf = NULL;
18027 __pyx_pybuffer_colind.refcount = 0;
18028 __pyx_pybuffernd_colind.data = NULL;
18029 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
18030 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
18031 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
18032 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
18033 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
18034 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
18035 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
18036 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
18037 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
18038 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
18039 __pyx_pybuffer_q_u.refcount = 0;
18040 __pyx_pybuffernd_q_u.data = NULL;
18041 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
18042 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
18043 __pyx_pybuffer_q_grad_u.refcount = 0;
18044 __pyx_pybuffernd_q_grad_u.data = NULL;
18045 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
18046 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
18047 __pyx_pybuffer_q_grad_w.refcount = 0;
18048 __pyx_pybuffernd_q_grad_w.data = NULL;
18049 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
18050 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
18051 __pyx_pybuffer_q_grad_v.refcount = 0;
18052 __pyx_pybuffernd_q_grad_v.data = NULL;
18053 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
18054 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
18055 __pyx_pybuffer_q_detJ.refcount = 0;
18056 __pyx_pybuffernd_q_detJ.data = NULL;
18057 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
18058 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
18059 __pyx_pybuffer_q_m.refcount = 0;
18060 __pyx_pybuffernd_q_m.data = NULL;
18061 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
18062 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
18063 __pyx_pybuffer_q_dm.refcount = 0;
18064 __pyx_pybuffernd_q_dm.data = NULL;
18065 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
18066 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
18067 __pyx_pybuffer_q_mt.refcount = 0;
18068 __pyx_pybuffernd_q_mt.data = NULL;
18069 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
18070 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
18071 __pyx_pybuffer_q_dmt.refcount = 0;
18072 __pyx_pybuffernd_q_dmt.data = NULL;
18073 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
18074 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
18075 __pyx_pybuffer_q_r.refcount = 0;
18076 __pyx_pybuffernd_q_r.data = NULL;
18077 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
18078 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
18079 __pyx_pybuffer_q_kr.refcount = 0;
18080 __pyx_pybuffernd_q_kr.data = NULL;
18081 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
18082 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
18083 __pyx_pybuffer_q_dkr.refcount = 0;
18084 __pyx_pybuffernd_q_dkr.data = NULL;
18085 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
18086 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
18087 __pyx_pybuffer_q_kr_up.refcount = 0;
18088 __pyx_pybuffernd_q_kr_up.data = NULL;
18089 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
18090 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
18091 __pyx_pybuffer_q_flin.refcount = 0;
18092 __pyx_pybuffernd_q_flin.data = NULL;
18093 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
18094 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
18095 __pyx_pybuffer_q_alin.refcount = 0;
18096 __pyx_pybuffernd_q_alin.data = NULL;
18097 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
18098 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
18099 __pyx_pybuffer_elementJacobian.refcount = 0;
18100 __pyx_pybuffernd_elementJacobian.data = NULL;
18101 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
18102 {
18103 __Pyx_BufFmt_StackElem __pyx_stack[1];
18104 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18105 }
18106 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
18107 {
18108 __Pyx_BufFmt_StackElem __pyx_stack[1];
18109 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18110 }
18111 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
18112 {
18113 __Pyx_BufFmt_StackElem __pyx_stack[1];
18114 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18115 }
18116 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
18117 {
18118 __Pyx_BufFmt_StackElem __pyx_stack[1];
18119 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18120 }
18121 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
18122 {
18123 __Pyx_BufFmt_StackElem __pyx_stack[1];
18124 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18125 }
18126 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
18127 {
18128 __Pyx_BufFmt_StackElem __pyx_stack[1];
18129 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18130 }
18131 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
18132 {
18133 __Pyx_BufFmt_StackElem __pyx_stack[1];
18134 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18135 }
18136 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
18137 {
18138 __Pyx_BufFmt_StackElem __pyx_stack[1];
18139 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18140 }
18141 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
18142 {
18143 __Pyx_BufFmt_StackElem __pyx_stack[1];
18144 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18145 }
18146 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
18147 {
18148 __Pyx_BufFmt_StackElem __pyx_stack[1];
18149 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18150 }
18151 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
18152 {
18153 __Pyx_BufFmt_StackElem __pyx_stack[1];
18154 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18155 }
18156 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
18157 {
18158 __Pyx_BufFmt_StackElem __pyx_stack[1];
18159 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18160 }
18161 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
18162 {
18163 __Pyx_BufFmt_StackElem __pyx_stack[1];
18164 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18165 }
18166 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
18167 {
18168 __Pyx_BufFmt_StackElem __pyx_stack[1];
18169 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18170 }
18171 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
18172 {
18173 __Pyx_BufFmt_StackElem __pyx_stack[1];
18174 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18175 }
18176 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
18177 {
18178 __Pyx_BufFmt_StackElem __pyx_stack[1];
18179 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18180 }
18181 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
18182 {
18183 __Pyx_BufFmt_StackElem __pyx_stack[1];
18184 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18185 }
18186 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
18187 {
18188 __Pyx_BufFmt_StackElem __pyx_stack[1];
18189 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18190 }
18191 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
18192 {
18193 __Pyx_BufFmt_StackElem __pyx_stack[1];
18194 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18195 }
18196 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
18197 {
18198 __Pyx_BufFmt_StackElem __pyx_stack[1];
18199 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18200 }
18201 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
18202 {
18203 __Pyx_BufFmt_StackElem __pyx_stack[1];
18204 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error)
18205 }
18206 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
18207
18208 /* "subsurfaceTransportFunctions.pyx":621
18209 *
18210 * """
18211 * cdef int upwindFlag = 1 # <<<<<<<<<<<<<<
18212 * cdef int picard = 1
18213 * #check some sizes
18214*/
18215 __pyx_v_upwindFlag = 1;
18216
18217 /* "subsurfaceTransportFunctions.pyx":622
18218 * """
18219 * cdef int upwindFlag = 1
18220 * cdef int picard = 1 # <<<<<<<<<<<<<<
18221 * #check some sizes
18222 * for q in [q_u,q_m,q_mt,q_r,q_kr]:
18223*/
18224 __pyx_v_picard = 1;
18225
18226 /* "subsurfaceTransportFunctions.pyx":624
18227 * cdef int picard = 1
18228 * #check some sizes
18229 * for q in [q_u,q_m,q_mt,q_r,q_kr]: # <<<<<<<<<<<<<<
18230 * assert q.shape[1] == nSpace+1
18231 * assert nDOF_test_element == nSpace+1
18232*/
18233 __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
18234 __Pyx_GOTREF(__pyx_t_1);
18235 __Pyx_INCREF((PyObject *)__pyx_v_q_u);
18236 __Pyx_GIVEREF((PyObject *)__pyx_v_q_u);
18237 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u)) != (0)) __PYX_ERR(0, 624, __pyx_L1_error);
18238 __Pyx_INCREF((PyObject *)__pyx_v_q_m);
18239 __Pyx_GIVEREF((PyObject *)__pyx_v_q_m);
18240 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m)) != (0)) __PYX_ERR(0, 624, __pyx_L1_error);
18241 __Pyx_INCREF((PyObject *)__pyx_v_q_mt);
18242 __Pyx_GIVEREF((PyObject *)__pyx_v_q_mt);
18243 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt)) != (0)) __PYX_ERR(0, 624, __pyx_L1_error);
18244 __Pyx_INCREF((PyObject *)__pyx_v_q_r);
18245 __Pyx_GIVEREF((PyObject *)__pyx_v_q_r);
18246 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r)) != (0)) __PYX_ERR(0, 624, __pyx_L1_error);
18247 __Pyx_INCREF((PyObject *)__pyx_v_q_kr);
18248 __Pyx_GIVEREF((PyObject *)__pyx_v_q_kr);
18249 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr)) != (0)) __PYX_ERR(0, 624, __pyx_L1_error);
18250 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
18251 __pyx_t_3 = 0;
18252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18253 for (;;) {
18254 if (__pyx_t_3 >= 5) break;
18255 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18256 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
18257 #else
18258 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
18259 #endif
18260 ++__pyx_t_3;
18261 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
18262 __Pyx_GOTREF(__pyx_t_1);
18263 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
18264 __pyx_t_1 = 0;
18265
18266 /* "subsurfaceTransportFunctions.pyx":625
18267 * #check some sizes
18268 * for q in [q_u,q_m,q_mt,q_r,q_kr]:
18269 * assert q.shape[1] == nSpace+1 # <<<<<<<<<<<<<<
18270 * assert nDOF_test_element == nSpace+1
18271 * cdef int nnz = rowptr[nSpace]
18272*/
18273 #ifndef CYTHON_WITHOUT_ASSERTIONS
18274 if (unlikely(__pyx_assertions_enabled())) {
18275 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
18276 __Pyx_GOTREF(__pyx_t_1);
18277 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error)
18278 __Pyx_GOTREF(__pyx_t_4);
18279 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18280 __pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_nSpace + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
18281 __Pyx_GOTREF(__pyx_t_1);
18282 __pyx_t_5 = __Pyx_PyObject_CompareBoolEq_object_int(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 625, __pyx_L1_error)
18283 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18284 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18285 if (unlikely(!__pyx_t_5)) {
18286 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18287 __PYX_ERR(0, 625, __pyx_L1_error)
18288 }
18289
18290 }
18291 #else
18292 if ((1)); else __PYX_ERR(0, 625, __pyx_L1_error)
18293 #endif
18294
18295 /* "subsurfaceTransportFunctions.pyx":624
18296 * cdef int picard = 1
18297 * #check some sizes
18298 * for q in [q_u,q_m,q_mt,q_r,q_kr]: # <<<<<<<<<<<<<<
18299 * assert q.shape[1] == nSpace+1
18300 * assert nDOF_test_element == nSpace+1
18301*/
18302 }
18303 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18304
18305 /* "subsurfaceTransportFunctions.pyx":626
18306 * for q in [q_u,q_m,q_mt,q_r,q_kr]:
18307 * assert q.shape[1] == nSpace+1
18308 * assert nDOF_test_element == nSpace+1 # <<<<<<<<<<<<<<
18309 * cdef int nnz = rowptr[nSpace]
18310 * #temporaries
18311*/
18312 #ifndef CYTHON_WITHOUT_ASSERTIONS
18313 if (unlikely(__pyx_assertions_enabled())) {
18314 __pyx_t_5 = (__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1));
18315
18316 if (unlikely(!__pyx_t_5)) {
18317 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18318 __PYX_ERR(0, 626, __pyx_L1_error)
18319 }
18320
18321 }
18322 #else
18323 if ((1)); else __PYX_ERR(0, 626, __pyx_L1_error)
18324 #endif
18325
18326 /* "subsurfaceTransportFunctions.pyx":627
18327 * assert q.shape[1] == nSpace+1
18328 * assert nDOF_test_element == nSpace+1
18329 * cdef int nnz = rowptr[nSpace] # <<<<<<<<<<<<<<
18330 * #temporaries
18331 * cdef double u_eN,kr_eN,phi_eN,u_neig,kr_neig,phi_neig,dkr_up
18332*/
18333 __pyx_t_6 = __pyx_v_nSpace;
18334 __pyx_t_7 = -1;
18335 if (__pyx_t_6 < 0) {
18336 __pyx_t_6 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
18337 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
18338 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_7 = 0;
18339 if (unlikely(__pyx_t_7 != -1)) {
18340 __Pyx_RaiseBufferIndexError(__pyx_t_7);
18341 __PYX_ERR(0, 627, __pyx_L1_error)
18342 }
18343 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_rowptr.diminfo[0].strides));
18344
18345 /* "subsurfaceTransportFunctions.pyx":631
18346 * cdef double u_eN,kr_eN,phi_eN,u_neig,kr_neig,phi_neig,dkr_up
18347 * cdef int eN,eN_neighbor,ii,I
18348 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_up= numpy.zeros(nnz,'d') # <<<<<<<<<<<<<<
18349 * cdef numpy.ndarray[DTYPE_t,ndim=1] f_up= numpy.zeros(nSpace,'d')
18350 * #for averaging/integration weights
18351*/
18352 __pyx_t_1 = NULL;
18353 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
18354 __Pyx_GOTREF(__pyx_t_4);
18355 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 631, __pyx_L1_error)
18356 __Pyx_GOTREF(__pyx_t_8);
18357 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18358 __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_nnz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
18359 __Pyx_GOTREF(__pyx_t_4);
18360 __pyx_t_9 = 1;
18361 #if CYTHON_UNPACK_METHODS
18362 if (unlikely(PyMethod_Check(__pyx_t_8))) {
18363 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
18364 assert(__pyx_t_1);
18365 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
18366 __Pyx_INCREF(__pyx_t_1);
18367 __Pyx_INCREF(__pyx__function);
18368 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
18369 __pyx_t_9 = 0;
18370 }
18371 #endif
18372 {
18373 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_d};
18374 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18375 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18376 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18377 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18378 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
18379 __Pyx_GOTREF(__pyx_t_2);
18380 }
18381 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
18382 {
18383 __Pyx_BufFmt_StackElem __pyx_stack[1];
18384 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
18385 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
18386 __PYX_ERR(0, 631, __pyx_L1_error)
18387 } else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
18388 }
18389 }
18390 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
18391 __pyx_t_2 = 0;
18392
18393 /* "subsurfaceTransportFunctions.pyx":632
18394 * cdef int eN,eN_neighbor,ii,I
18395 * cdef numpy.ndarray[DTYPE_t,ndim=1] a_up= numpy.zeros(nnz,'d')
18396 * cdef numpy.ndarray[DTYPE_t,ndim=1] f_up= numpy.zeros(nSpace,'d') # <<<<<<<<<<<<<<
18397 * #for averaging/integration weights
18398 * cdef double nAvgWeight = 1.0/(nSpace+1.)
18399*/
18400 __pyx_t_8 = NULL;
18401 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
18402 __Pyx_GOTREF(__pyx_t_4);
18403 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
18404 __Pyx_GOTREF(__pyx_t_1);
18405 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18406 __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_nSpace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
18407 __Pyx_GOTREF(__pyx_t_4);
18408 __pyx_t_9 = 1;
18409 #if CYTHON_UNPACK_METHODS
18410 if (unlikely(PyMethod_Check(__pyx_t_1))) {
18411 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
18412 assert(__pyx_t_8);
18413 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
18414 __Pyx_INCREF(__pyx_t_8);
18415 __Pyx_INCREF(__pyx__function);
18416 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
18417 __pyx_t_9 = 0;
18418 }
18419 #endif
18420 {
18421 PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_d};
18422 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18423 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18424 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18425 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18426 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
18427 __Pyx_GOTREF(__pyx_t_2);
18428 }
18429 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 632, __pyx_L1_error)
18430 {
18431 __Pyx_BufFmt_StackElem __pyx_stack[1];
18432 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
18433 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
18434 __PYX_ERR(0, 632, __pyx_L1_error)
18435 } else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
18436 }
18437 }
18438 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
18439 __pyx_t_2 = 0;
18440
18441 /* "subsurfaceTransportFunctions.pyx":634
18442 * cdef numpy.ndarray[DTYPE_t,ndim=1] f_up= numpy.zeros(nSpace,'d')
18443 * #for averaging/integration weights
18444 * cdef double nAvgWeight = 1.0/(nSpace+1.) # <<<<<<<<<<<<<<
18445 * cdef double weight=1.0,volFactor = 1.0
18446 * cdef int thisElementIsUpwind = 1
18447*/
18448 __pyx_t_10 = (__pyx_v_nSpace + 1.);
18449
18450 if (unlikely(__pyx_t_10 == 0)) {
18451 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
18452 __PYX_ERR(0, 634, __pyx_L1_error)
18453 }
18454 __pyx_v_nAvgWeight = (1.0 / __pyx_t_10);
18455
18456
18457 /* "subsurfaceTransportFunctions.pyx":635
18458 * #for averaging/integration weights
18459 * cdef double nAvgWeight = 1.0/(nSpace+1.)
18460 * cdef double weight=1.0,volFactor = 1.0 # <<<<<<<<<<<<<<
18461 * cdef int thisElementIsUpwind = 1
18462 * if nSpace == 2:
18463*/
18464 __pyx_v_weight = 1.0;
18465 __pyx_v_volFactor = 1.0;
18466
18467 /* "subsurfaceTransportFunctions.pyx":636
18468 * cdef double nAvgWeight = 1.0/(nSpace+1.)
18469 * cdef double weight=1.0,volFactor = 1.0
18470 * cdef int thisElementIsUpwind = 1 # <<<<<<<<<<<<<<
18471 * if nSpace == 2:
18472 * volFactor = 0.5
18473*/
18474 __pyx_v_thisElementIsUpwind = 1;
18475
18476 /* "subsurfaceTransportFunctions.pyx":637
18477 * cdef double weight=1.0,volFactor = 1.0
18478 * cdef int thisElementIsUpwind = 1
18479 * if nSpace == 2: # <<<<<<<<<<<<<<
18480 * volFactor = 0.5
18481 * if nSpace == 3:
18482*/
18483 __pyx_t_5 = (__pyx_v_nSpace == 2);
18484
18485 if (__pyx_t_5) {
18486
18487
18488 /* "subsurfaceTransportFunctions.pyx":638
18489 * cdef int thisElementIsUpwind = 1
18490 * if nSpace == 2:
18491 * volFactor = 0.5 # <<<<<<<<<<<<<<
18492 * if nSpace == 3:
18493 * volFactor = 1.0/6.0
18494*/
18495 __pyx_v_volFactor = 0.5;
18496
18497 /* "subsurfaceTransportFunctions.pyx":637
18498 * cdef double weight=1.0,volFactor = 1.0
18499 * cdef int thisElementIsUpwind = 1
18500 * if nSpace == 2: # <<<<<<<<<<<<<<
18501 * volFactor = 0.5
18502 * if nSpace == 3:
18503*/
18504 }
18505
18506 /* "subsurfaceTransportFunctions.pyx":639
18507 * if nSpace == 2:
18508 * volFactor = 0.5
18509 * if nSpace == 3: # <<<<<<<<<<<<<<
18510 * volFactor = 1.0/6.0
18511 * #
18512*/
18513 __pyx_t_5 = (__pyx_v_nSpace == 3);
18514
18515 if (__pyx_t_5) {
18516
18517
18518 /* "subsurfaceTransportFunctions.pyx":640
18519 * volFactor = 0.5
18520 * if nSpace == 3:
18521 * volFactor = 1.0/6.0 # <<<<<<<<<<<<<<
18522 * #
18523 * for eN in range(nElements_global):
18524*/
18525 __pyx_v_volFactor = (1.0 / 6.0);
18526
18527 /* "subsurfaceTransportFunctions.pyx":639
18528 * if nSpace == 2:
18529 * volFactor = 0.5
18530 * if nSpace == 3: # <<<<<<<<<<<<<<
18531 * volFactor = 1.0/6.0
18532 * #
18533*/
18534 }
18535
18536 /* "subsurfaceTransportFunctions.pyx":642
18537 * volFactor = 1.0/6.0
18538 * #
18539 * for eN in range(nElements_global): # <<<<<<<<<<<<<<
18540 * volume = volFactor*fabs(q_detJ[eN,0]) #affine transformation
18541 * weight = nAvgWeight*volume
18542*/
18543
18544 __pyx_t_7 = __pyx_v_nElements_global;
18545 __pyx_t_11 = __pyx_t_7;
18546
18547 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
18548 __pyx_v_eN = __pyx_t_12;
18549
18550 /* "subsurfaceTransportFunctions.pyx":643
18551 * #
18552 * for eN in range(nElements_global):
18553 * volume = volFactor*fabs(q_detJ[eN,0]) #affine transformation # <<<<<<<<<<<<<<
18554 * weight = nAvgWeight*volume
18555 *
18556*/
18557 __pyx_t_6 = __pyx_v_eN;
18558 __pyx_t_13 = 0;
18559 __pyx_t_14 = -1;
18560 if (__pyx_t_6 < 0) {
18561 __pyx_t_6 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
18562 if (unlikely(__pyx_t_6 < 0)) __pyx_t_14 = 0;
18563 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_14 = 0;
18564 if (__pyx_t_13 < 0) {
18565 __pyx_t_13 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
18566 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1;
18567 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_14 = 1;
18568 if (unlikely(__pyx_t_14 != -1)) {
18569 __Pyx_RaiseBufferIndexError(__pyx_t_14);
18570 __PYX_ERR(0, 643, __pyx_L1_error)
18571 }
18572 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
18573
18574 /* "subsurfaceTransportFunctions.pyx":644
18575 * for eN in range(nElements_global):
18576 * volume = volFactor*fabs(q_detJ[eN,0]) #affine transformation
18577 * weight = nAvgWeight*volume # <<<<<<<<<<<<<<
18578 *
18579 *
18580*/
18581 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
18582
18583 /* "subsurfaceTransportFunctions.pyx":647
18584 *
18585 *
18586 * for i in range(nDOF_test_element): # <<<<<<<<<<<<<<
18587 * #nodal quadrature so diagonal
18588 * ##mass
18589*/
18590
18591 __pyx_t_14 = __pyx_v_nDOF_test_element;
18592 __pyx_t_15 = __pyx_t_14;
18593
18594 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
18595 __pyx_v_i = __pyx_t_16;
18596
18597 /* "subsurfaceTransportFunctions.pyx":651
18598 * ##mass
18599 * #elementResidual[eN,i] += weight*q_m[eN,i]
18600 * elementJacobian[eN,i,i] += weight*q_dmt[eN,i] # <<<<<<<<<<<<<<
18601 *
18602 * #have to actually compute loop over other nodes for stiffness terms
18603*/
18604 __pyx_t_13 = __pyx_v_eN;
18605 __pyx_t_6 = __pyx_v_i;
18606 __pyx_t_17 = -1;
18607 if (__pyx_t_13 < 0) {
18608 __pyx_t_13 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
18609 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
18610 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_17 = 0;
18611 if (__pyx_t_6 < 0) {
18612 __pyx_t_6 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
18613 if (unlikely(__pyx_t_6 < 0)) __pyx_t_17 = 1;
18614 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_17 = 1;
18615 if (unlikely(__pyx_t_17 != -1)) {
18616 __Pyx_RaiseBufferIndexError(__pyx_t_17);
18617 __PYX_ERR(0, 651, __pyx_L1_error)
18618 }
18619 __pyx_t_18 = __pyx_v_eN;
18620 __pyx_t_19 = __pyx_v_i;
18621 __pyx_t_20 = __pyx_v_i;
18622 __pyx_t_17 = -1;
18623 if (__pyx_t_18 < 0) {
18624 __pyx_t_18 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
18625 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
18626 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_17 = 0;
18627 if (__pyx_t_19 < 0) {
18628 __pyx_t_19 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
18629 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
18630 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_17 = 1;
18631 if (__pyx_t_20 < 0) {
18632 __pyx_t_20 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
18633 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 2;
18634 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_17 = 2;
18635 if (unlikely(__pyx_t_17 != -1)) {
18636 __Pyx_RaiseBufferIndexError(__pyx_t_17);
18637 __PYX_ERR(0, 651, __pyx_L1_error)
18638 }
18639 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
18640
18641 /* "subsurfaceTransportFunctions.pyx":654
18642 *
18643 * #have to actually compute loop over other nodes for stiffness terms
18644 * for ebN in range(nElementBoundaries_element): #same as nDOF_trial , nElementBoundaries_ # <<<<<<<<<<<<<<
18645 * #assumes linear parts of f and a and upwind k_r have already been evaluated correctly for interface
18646 * for ii in range(nnz):
18647*/
18648
18649 __pyx_t_17 = __pyx_v_nElementBoundaries_element;
18650 __pyx_t_21 = __pyx_t_17;
18651
18652 for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
18653 __pyx_v_ebN = __pyx_t_22;
18654
18655 /* "subsurfaceTransportFunctions.pyx":656
18656 * for ebN in range(nElementBoundaries_element): #same as nDOF_trial , nElementBoundaries_
18657 * #assumes linear parts of f and a and upwind k_r have already been evaluated correctly for interface
18658 * for ii in range(nnz): # <<<<<<<<<<<<<<
18659 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN]
18660 * for I in range(nSpace):
18661*/
18662
18663 __pyx_t_23 = __pyx_v_nnz;
18664 __pyx_t_24 = __pyx_t_23;
18665
18666 for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
18667 __pyx_v_ii = __pyx_t_25;
18668
18669 /* "subsurfaceTransportFunctions.pyx":657
18670 * #assumes linear parts of f and a and upwind k_r have already been evaluated correctly for interface
18671 * for ii in range(nnz):
18672 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN] # <<<<<<<<<<<<<<
18673 * for I in range(nSpace):
18674 * f_up[I] = q_flin[eN,ebN,I]*q_kr_up[eN,ebN]
18675*/
18676 __pyx_t_6 = __pyx_v_eN;
18677 __pyx_t_13 = __pyx_v_ebN;
18678 __pyx_t_20 = __pyx_v_ii;
18679 __pyx_t_26 = -1;
18680 if (__pyx_t_6 < 0) {
18681 __pyx_t_6 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
18682 if (unlikely(__pyx_t_6 < 0)) __pyx_t_26 = 0;
18683 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_26 = 0;
18684 if (__pyx_t_13 < 0) {
18685 __pyx_t_13 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
18686 if (unlikely(__pyx_t_13 < 0)) __pyx_t_26 = 1;
18687 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_26 = 1;
18688 if (__pyx_t_20 < 0) {
18689 __pyx_t_20 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
18690 if (unlikely(__pyx_t_20 < 0)) __pyx_t_26 = 2;
18691 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_26 = 2;
18692 if (unlikely(__pyx_t_26 != -1)) {
18693 __Pyx_RaiseBufferIndexError(__pyx_t_26);
18694 __PYX_ERR(0, 657, __pyx_L1_error)
18695 }
18696 __pyx_t_19 = __pyx_v_eN;
18697 __pyx_t_18 = __pyx_v_ebN;
18698 __pyx_t_26 = -1;
18699 if (__pyx_t_19 < 0) {
18700 __pyx_t_19 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
18701 if (unlikely(__pyx_t_19 < 0)) __pyx_t_26 = 0;
18702 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_26 = 0;
18703 if (__pyx_t_18 < 0) {
18704 __pyx_t_18 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
18705 if (unlikely(__pyx_t_18 < 0)) __pyx_t_26 = 1;
18706 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_26 = 1;
18707 if (unlikely(__pyx_t_26 != -1)) {
18708 __Pyx_RaiseBufferIndexError(__pyx_t_26);
18709 __PYX_ERR(0, 657, __pyx_L1_error)
18710 }
18711 __pyx_t_27 = __pyx_v_ii;
18712 __pyx_t_26 = -1;
18713 if (__pyx_t_27 < 0) {
18714 __pyx_t_27 += __pyx_pybuffernd_a_up.diminfo[0].shape;
18715 if (unlikely(__pyx_t_27 < 0)) __pyx_t_26 = 0;
18716 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_26 = 0;
18717 if (unlikely(__pyx_t_26 != -1)) {
18718 __Pyx_RaiseBufferIndexError(__pyx_t_26);
18719 __PYX_ERR(0, 657, __pyx_L1_error)
18720 }
18721 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
18722 }
18723
18724
18725 /* "subsurfaceTransportFunctions.pyx":658
18726 * for ii in range(nnz):
18727 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN]
18728 * for I in range(nSpace): # <<<<<<<<<<<<<<
18729 * f_up[I] = q_flin[eN,ebN,I]*q_kr_up[eN,ebN]
18730 * #
18731*/
18732
18733 __pyx_t_23 = __pyx_v_nSpace;
18734 __pyx_t_24 = __pyx_t_23;
18735
18736 for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
18737 __pyx_v_I = __pyx_t_25;
18738
18739 /* "subsurfaceTransportFunctions.pyx":659
18740 * a_up[ii] = q_alin[eN,ebN,ii]*q_kr_up[eN,ebN]
18741 * for I in range(nSpace):
18742 * f_up[I] = q_flin[eN,ebN,I]*q_kr_up[eN,ebN] # <<<<<<<<<<<<<<
18743 * #
18744 *
18745*/
18746 __pyx_t_18 = __pyx_v_eN;
18747 __pyx_t_19 = __pyx_v_ebN;
18748 __pyx_t_20 = __pyx_v_I;
18749 __pyx_t_26 = -1;
18750 if (__pyx_t_18 < 0) {
18751 __pyx_t_18 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
18752 if (unlikely(__pyx_t_18 < 0)) __pyx_t_26 = 0;
18753 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_26 = 0;
18754 if (__pyx_t_19 < 0) {
18755 __pyx_t_19 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
18756 if (unlikely(__pyx_t_19 < 0)) __pyx_t_26 = 1;
18757 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_26 = 1;
18758 if (__pyx_t_20 < 0) {
18759 __pyx_t_20 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
18760 if (unlikely(__pyx_t_20 < 0)) __pyx_t_26 = 2;
18761 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_26 = 2;
18762 if (unlikely(__pyx_t_26 != -1)) {
18763 __Pyx_RaiseBufferIndexError(__pyx_t_26);
18764 __PYX_ERR(0, 659, __pyx_L1_error)
18765 }
18766 __pyx_t_13 = __pyx_v_eN;
18767 __pyx_t_6 = __pyx_v_ebN;
18768 __pyx_t_26 = -1;
18769 if (__pyx_t_13 < 0) {
18770 __pyx_t_13 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
18771 if (unlikely(__pyx_t_13 < 0)) __pyx_t_26 = 0;
18772 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_26 = 0;
18773 if (__pyx_t_6 < 0) {
18774 __pyx_t_6 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
18775 if (unlikely(__pyx_t_6 < 0)) __pyx_t_26 = 1;
18776 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_26 = 1;
18777 if (unlikely(__pyx_t_26 != -1)) {
18778 __Pyx_RaiseBufferIndexError(__pyx_t_26);
18779 __PYX_ERR(0, 659, __pyx_L1_error)
18780 }
18781 __pyx_t_27 = __pyx_v_I;
18782 __pyx_t_26 = -1;
18783 if (__pyx_t_27 < 0) {
18784 __pyx_t_27 += __pyx_pybuffernd_f_up.diminfo[0].shape;
18785 if (unlikely(__pyx_t_27 < 0)) __pyx_t_26 = 0;
18786 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_26 = 0;
18787 if (unlikely(__pyx_t_26 != -1)) {
18788 __Pyx_RaiseBufferIndexError(__pyx_t_26);
18789 __PYX_ERR(0, 659, __pyx_L1_error)
18790 }
18791 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
18792 }
18793
18794
18795 /* "subsurfaceTransportFunctions.pyx":663
18796 *
18797 * #Picard part first
18798 * for j in range(nDOF_trial_element): # <<<<<<<<<<<<<<
18799 * for I in range(nSpace):
18800 * for ii in range(rowptr[I],rowptr[I+1]):
18801*/
18802
18803 __pyx_t_23 = __pyx_v_nDOF_trial_element;
18804 __pyx_t_24 = __pyx_t_23;
18805
18806 for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
18807 __pyx_v_j = __pyx_t_25;
18808
18809 /* "subsurfaceTransportFunctions.pyx":664
18810 * #Picard part first
18811 * for j in range(nDOF_trial_element):
18812 * for I in range(nSpace): # <<<<<<<<<<<<<<
18813 * for ii in range(rowptr[I],rowptr[I+1]):
18814 * elementJacobian[eN,i,j] += weight*a_up[ii]*q_grad_v[eN,ebN,j,colind[ii]]*q_grad_w[eN,ebN,i,I]
18815*/
18816
18817 __pyx_t_26 = __pyx_v_nSpace;
18818 __pyx_t_28 = __pyx_t_26;
18819
18820 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
18821 __pyx_v_I = __pyx_t_29;
18822
18823 /* "subsurfaceTransportFunctions.pyx":665
18824 * for j in range(nDOF_trial_element):
18825 * for I in range(nSpace):
18826 * for ii in range(rowptr[I],rowptr[I+1]): # <<<<<<<<<<<<<<
18827 * elementJacobian[eN,i,j] += weight*a_up[ii]*q_grad_v[eN,ebN,j,colind[ii]]*q_grad_w[eN,ebN,i,I]
18828 * #j picard
18829*/
18830 __pyx_t_6 = (__pyx_v_I + 1);
18831 __pyx_t_30 = -1;
18832 if (__pyx_t_6 < 0) {
18833 __pyx_t_6 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
18834 if (unlikely(__pyx_t_6 < 0)) __pyx_t_30 = 0;
18835 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_30 = 0;
18836 if (unlikely(__pyx_t_30 != -1)) {
18837 __Pyx_RaiseBufferIndexError(__pyx_t_30);
18838 __PYX_ERR(0, 665, __pyx_L1_error)
18839 }
18840
18841 __pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_rowptr.diminfo[0].strides));
18842 __pyx_t_6 = __pyx_v_I;
18843 __pyx_t_30 = -1;
18844 if (__pyx_t_6 < 0) {
18845 __pyx_t_6 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
18846 if (unlikely(__pyx_t_6 < 0)) __pyx_t_30 = 0;
18847 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_30 = 0;
18848 if (unlikely(__pyx_t_30 != -1)) {
18849 __Pyx_RaiseBufferIndexError(__pyx_t_30);
18850 __PYX_ERR(0, 665, __pyx_L1_error)
18851 }
18852 __pyx_t_32 = __pyx_t_31;
18853
18854 for (__pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_30 < __pyx_t_32; __pyx_t_30+=1) {
18855 __pyx_v_ii = __pyx_t_30;
18856
18857 /* "subsurfaceTransportFunctions.pyx":666
18858 * for I in range(nSpace):
18859 * for ii in range(rowptr[I],rowptr[I+1]):
18860 * elementJacobian[eN,i,j] += weight*a_up[ii]*q_grad_v[eN,ebN,j,colind[ii]]*q_grad_w[eN,ebN,i,I] # <<<<<<<<<<<<<<
18861 * #j picard
18862 * #i
18863*/
18864 __pyx_t_13 = __pyx_v_ii;
18865 __pyx_t_33 = -1;
18866 if (__pyx_t_13 < 0) {
18867 __pyx_t_13 += __pyx_pybuffernd_a_up.diminfo[0].shape;
18868 if (unlikely(__pyx_t_13 < 0)) __pyx_t_33 = 0;
18869 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_33 = 0;
18870 if (unlikely(__pyx_t_33 != -1)) {
18871 __Pyx_RaiseBufferIndexError(__pyx_t_33);
18872 __PYX_ERR(0, 666, __pyx_L1_error)
18873 }
18874 __pyx_t_20 = __pyx_v_ii;
18875 __pyx_t_33 = -1;
18876 if (__pyx_t_20 < 0) {
18877 __pyx_t_20 += __pyx_pybuffernd_colind.diminfo[0].shape;
18878 if (unlikely(__pyx_t_20 < 0)) __pyx_t_33 = 0;
18879 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_33 = 0;
18880 if (unlikely(__pyx_t_33 != -1)) {
18881 __Pyx_RaiseBufferIndexError(__pyx_t_33);
18882 __PYX_ERR(0, 666, __pyx_L1_error)
18883 }
18884 __pyx_t_19 = __pyx_v_eN;
18885 __pyx_t_18 = __pyx_v_ebN;
18886 __pyx_t_27 = __pyx_v_j;
18887 __pyx_t_34 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_colind.diminfo[0].strides));
18888 __pyx_t_33 = -1;
18889 if (__pyx_t_19 < 0) {
18890 __pyx_t_19 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
18891 if (unlikely(__pyx_t_19 < 0)) __pyx_t_33 = 0;
18892 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_33 = 0;
18893 if (__pyx_t_18 < 0) {
18894 __pyx_t_18 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
18895 if (unlikely(__pyx_t_18 < 0)) __pyx_t_33 = 1;
18896 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_33 = 1;
18897 if (__pyx_t_27 < 0) {
18898 __pyx_t_27 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
18899 if (unlikely(__pyx_t_27 < 0)) __pyx_t_33 = 2;
18900 } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_33 = 2;
18901 if (__pyx_t_34 < 0) {
18902 __pyx_t_34 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
18903 if (unlikely(__pyx_t_34 < 0)) __pyx_t_33 = 3;
18904 } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_33 = 3;
18905 if (unlikely(__pyx_t_33 != -1)) {
18906 __Pyx_RaiseBufferIndexError(__pyx_t_33);
18907 __PYX_ERR(0, 666, __pyx_L1_error)
18908 }
18909 __pyx_t_35 = __pyx_v_eN;
18910 __pyx_t_36 = __pyx_v_ebN;
18911 __pyx_t_37 = __pyx_v_i;
18912 __pyx_t_38 = __pyx_v_I;
18913 __pyx_t_33 = -1;
18914 if (__pyx_t_35 < 0) {
18915 __pyx_t_35 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
18916 if (unlikely(__pyx_t_35 < 0)) __pyx_t_33 = 0;
18917 } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_33 = 0;
18918 if (__pyx_t_36 < 0) {
18919 __pyx_t_36 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
18920 if (unlikely(__pyx_t_36 < 0)) __pyx_t_33 = 1;
18921 } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_33 = 1;
18922 if (__pyx_t_37 < 0) {
18923 __pyx_t_37 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
18924 if (unlikely(__pyx_t_37 < 0)) __pyx_t_33 = 2;
18925 } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_33 = 2;
18926 if (__pyx_t_38 < 0) {
18927 __pyx_t_38 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
18928 if (unlikely(__pyx_t_38 < 0)) __pyx_t_33 = 3;
18929 } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_33 = 3;
18930 if (unlikely(__pyx_t_33 != -1)) {
18931 __Pyx_RaiseBufferIndexError(__pyx_t_33);
18932 __PYX_ERR(0, 666, __pyx_L1_error)
18933 }
18934 __pyx_t_39 = __pyx_v_eN;
18935 __pyx_t_40 = __pyx_v_i;
18936 __pyx_t_41 = __pyx_v_j;
18937 __pyx_t_33 = -1;
18938 if (__pyx_t_39 < 0) {
18939 __pyx_t_39 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
18940 if (unlikely(__pyx_t_39 < 0)) __pyx_t_33 = 0;
18941 } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_33 = 0;
18942 if (__pyx_t_40 < 0) {
18943 __pyx_t_40 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
18944 if (unlikely(__pyx_t_40 < 0)) __pyx_t_33 = 1;
18945 } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_33 = 1;
18946 if (__pyx_t_41 < 0) {
18947 __pyx_t_41 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
18948 if (unlikely(__pyx_t_41 < 0)) __pyx_t_33 = 2;
18949 } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_33 = 2;
18950 if (unlikely(__pyx_t_33 != -1)) {
18951 __Pyx_RaiseBufferIndexError(__pyx_t_33);
18952 __PYX_ERR(0, 666, __pyx_L1_error)
18953 }
18954 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_34, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_38, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
18955 }
18956
18957 }
18958
18959 }
18960
18961 }
18962
18963 }
18964
18965 }
18966
18967
18968 /* "subsurfaceTransportFunctions.pyx":575
18969 * #i
18970 * #eN
18971 * def RE_NCP1_getElementJacobian(numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities # <<<<<<<<<<<<<<
18972 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
18973 * numpy.ndarray[ITYPE_t,ndim=1] colind,
18974*/
18975
18976 /* function exit code */
18977 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18978 goto __pyx_L0;
18979 __pyx_L1_error:;
18980 __Pyx_XDECREF(__pyx_t_1);
18981 __Pyx_XDECREF(__pyx_t_2);
18982 __Pyx_XDECREF(__pyx_t_4);
18983 __Pyx_XDECREF(__pyx_t_8);
18984 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18985 __Pyx_PyThreadState_declare
18986 __Pyx_PyThreadState_assign
18987 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18988 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
18989 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
18990 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
18991 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
18992 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
18993 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
18994 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
18995 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
18996 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
18997 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
18998 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
18999 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
19000 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
19001 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
19002 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
19003 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
19004 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
19005 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
19006 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
19007 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
19008 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
19009 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
19010 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
19011 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19012 __Pyx_AddTraceback("subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
19013 __pyx_r = NULL;
19014 goto __pyx_L2;
19015 __pyx_L0:;
19016 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
19017 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
19018 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
19019 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
19020 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
19021 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
19022 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
19023 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
19024 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
19025 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
19026 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
19027 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
19028 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
19029 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
19030 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
19031 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
19032 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
19033 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
19034 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
19035 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
19036 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
19037 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
19038 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
19039 __pyx_L2:;
19040
19041
19042 __Pyx_XDECREF(__pyx_v_q);
19043
19044
19045
19046
19047 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
19048 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103 __Pyx_XGIVEREF(__pyx_r);
19104 __Pyx_RefNannyFinishContext();
19105 return __pyx_r;
19106}
19107
19108/* "subsurfaceTransportFunctions.pyx":674
19109 * ##################################################
19110 *
19111 * def updateMass_weakAvg(numpy.ndarray[DTYPE_t,ndim=2] mt, # <<<<<<<<<<<<<<
19112 * numpy.ndarray[DTYPE_t,ndim=3] w,
19113 * numpy.ndarray[DTYPE_t,ndim=2] dV,
19114*/
19115
19116/* Python wrapper */
19117static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self,
19118#if CYTHON_VECTORCALL
19119PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19120#else
19121PyObject *__pyx_args, PyObject *__pyx_kwds
19122#endif
19123); /*proto*/
19124PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg, "\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ");
19125static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {"updateMass_weakAvg", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
19126static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self,
19127#if CYTHON_VECTORCALL
19128PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19129#else
19130PyObject *__pyx_args, PyObject *__pyx_kwds
19131#endif
19132) {
19133 PyArrayObject *__pyx_v_mt = 0;
19134 PyArrayObject *__pyx_v_w = 0;
19135 PyArrayObject *__pyx_v_dV = 0;
19136 PyArrayObject *__pyx_v_weak_residual = 0;
19137 #if !CYTHON_VECTORCALL
19138 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
19139 #endif
19140 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
19141 PyObject* values[4] = {0,0,0,0};
19142 int __pyx_lineno = 0;
19143 const char *__pyx_filename = NULL;
19144 int __pyx_clineno = 0;
19145 PyObject *__pyx_r = 0;
19146 __Pyx_RefNannyDeclarations
19147 __Pyx_RefNannySetupContext("updateMass_weakAvg (wrapper)", 0);
19148 #if !CYTHON_VECTORCALL
19149 #if CYTHON_ASSUME_SAFE_SIZE
19150 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
19151 #else
19152 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
19153 #endif
19154 #endif
19155 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
19156 {
19157 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mt,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_dV,&__pyx_mstate_global->__pyx_n_u_weak_residual,0};
19158 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
19159 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 674, __pyx_L3_error)
19160 if (__pyx_kwds_len > 0) {
19161 switch (__pyx_nargs) {
19162 case 4:
19163 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
19164 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 674, __pyx_L3_error)
19165 CYTHON_FALLTHROUGH;
19166 case 3:
19167 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
19168 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 674, __pyx_L3_error)
19169 CYTHON_FALLTHROUGH;
19170 case 2:
19171 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
19172 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 674, __pyx_L3_error)
19173 CYTHON_FALLTHROUGH;
19174 case 1:
19175 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
19176 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 674, __pyx_L3_error)
19177 CYTHON_FALLTHROUGH;
19178 case 0: break;
19179 default: goto __pyx_L5_argtuple_error;
19180 }
19181 const Py_ssize_t kwd_pos_args = __pyx_nargs;
19182 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "updateMass_weakAvg", 0) < (0)) __PYX_ERR(0, 674, __pyx_L3_error)
19183 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
19184 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("updateMass_weakAvg", 1, 4, 4, i); __PYX_ERR(0, 674, __pyx_L3_error) }
19185 }
19186 } else if (unlikely(__pyx_nargs != 4)) {
19187 goto __pyx_L5_argtuple_error;
19188 } else {
19189 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
19190 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 674, __pyx_L3_error)
19191 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
19192 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 674, __pyx_L3_error)
19193 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
19194 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 674, __pyx_L3_error)
19195 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
19196 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 674, __pyx_L3_error)
19197 }
19198 __pyx_v_mt = ((PyArrayObject *)values[0]);
19199 __pyx_v_w = ((PyArrayObject *)values[1]);
19200 __pyx_v_dV = ((PyArrayObject *)values[2]);
19201 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
19202 }
19203 goto __pyx_L6_skip;
19204 __pyx_L5_argtuple_error:;
19205 __Pyx_RaiseArgtupleInvalid("updateMass_weakAvg", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 674, __pyx_L3_error)
19206 __pyx_L6_skip:;
19207 goto __pyx_L4_argument_unpacking_done;
19208 __pyx_L3_error:;
19209 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19210 Py_XDECREF(values[__pyx_temp]);
19211 }
19212 __Pyx_AddTraceback("subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
19213 __Pyx_RefNannyFinishContext();
19214 return NULL;
19215 __pyx_L4_argument_unpacking_done:;
19216 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "mt", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
19217 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "w", 0))) __PYX_ERR(0, 675, __pyx_L1_error)
19218 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dV", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
19219 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "weak_residual", 0))) __PYX_ERR(0, 677, __pyx_L1_error)
19220 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
19221
19222 /* function exit code */
19223 goto __pyx_L0;
19224 __pyx_L1_error:;
19225 __pyx_r = NULL;
19226 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19227 Py_XDECREF(values[__pyx_temp]);
19228 }
19229 goto __pyx_L7_cleaned_up;
19230 __pyx_L0:;
19231 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19232 Py_XDECREF(values[__pyx_temp]);
19233 }
19234 __pyx_L7_cleaned_up:;
19235 __Pyx_RefNannyFinishContext();
19236 return __pyx_r;
19237}
19238
19239static 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) {
19240 int __pyx_v_eN;
19241 int __pyx_v_i;
19242 int __pyx_v_k;
19243 PyObject *__pyx_v_mt_avg = 0;
19244 PyObject *__pyx_v_vol = 0;
19245 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
19246 __Pyx_Buffer __pyx_pybuffer_dV;
19247 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
19248 __Pyx_Buffer __pyx_pybuffer_mt;
19249 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
19250 __Pyx_Buffer __pyx_pybuffer_w;
19251 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
19252 __Pyx_Buffer __pyx_pybuffer_weak_residual;
19253 PyObject *__pyx_r = NULL;
19254 __Pyx_RefNannyDeclarations
19255 npy_intp __pyx_t_1;
19256 npy_intp __pyx_t_2;
19257 int __pyx_t_3;
19258 npy_intp __pyx_t_4;
19259 npy_intp __pyx_t_5;
19260 int __pyx_t_6;
19261 Py_ssize_t __pyx_t_7;
19262 Py_ssize_t __pyx_t_8;
19263 int __pyx_t_9;
19264 Py_ssize_t __pyx_t_10;
19265 Py_ssize_t __pyx_t_11;
19266 PyObject *__pyx_t_12 = NULL;
19267 PyObject *__pyx_t_13 = NULL;
19268 PyObject *__pyx_t_14 = NULL;
19269 double __pyx_t_15;
19270 int __pyx_lineno = 0;
19271 const char *__pyx_filename = NULL;
19272 int __pyx_clineno = 0;
19273 __Pyx_RefNannySetupContext("updateMass_weakAvg", 0);
19274 __pyx_pybuffer_mt.pybuffer.buf = NULL;
19275 __pyx_pybuffer_mt.refcount = 0;
19276 __pyx_pybuffernd_mt.data = NULL;
19277 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
19278 __pyx_pybuffer_w.pybuffer.buf = NULL;
19279 __pyx_pybuffer_w.refcount = 0;
19280 __pyx_pybuffernd_w.data = NULL;
19281 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
19282 __pyx_pybuffer_dV.pybuffer.buf = NULL;
19283 __pyx_pybuffer_dV.refcount = 0;
19284 __pyx_pybuffernd_dV.data = NULL;
19285 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
19286 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
19287 __pyx_pybuffer_weak_residual.refcount = 0;
19288 __pyx_pybuffernd_weak_residual.data = NULL;
19289 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
19290 {
19291 __Pyx_BufFmt_StackElem __pyx_stack[1];
19292 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 674, __pyx_L1_error)
19293 }
19294 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
19295 {
19296 __Pyx_BufFmt_StackElem __pyx_stack[1];
19297 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 674, __pyx_L1_error)
19298 }
19299 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
19300 {
19301 __Pyx_BufFmt_StackElem __pyx_stack[1];
19302 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 674, __pyx_L1_error)
19303 }
19304 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
19305 {
19306 __Pyx_BufFmt_StackElem __pyx_stack[1];
19307 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 674, __pyx_L1_error)
19308 }
19309 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
19310
19311 /* "subsurfaceTransportFunctions.pyx":683
19312 * cdef int eN,i,k
19313 * cdef mt_avg,vol
19314 * for eN in range(mt.shape[0]): # <<<<<<<<<<<<<<
19315 * mt_avg = 0.0
19316 * vol = 0.0
19317*/
19318
19319 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_mt))[0]);
19320 __pyx_t_2 = __pyx_t_1;
19321
19322 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19323 __pyx_v_eN = __pyx_t_3;
19324
19325 /* "subsurfaceTransportFunctions.pyx":684
19326 * cdef mt_avg,vol
19327 * for eN in range(mt.shape[0]):
19328 * mt_avg = 0.0 # <<<<<<<<<<<<<<
19329 * vol = 0.0
19330 * for k in range(mt.shape[1]):
19331*/
19332 __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
19333 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_mstate_global->__pyx_float_0_0);
19334
19335 /* "subsurfaceTransportFunctions.pyx":685
19336 * for eN in range(mt.shape[0]):
19337 * mt_avg = 0.0
19338 * vol = 0.0 # <<<<<<<<<<<<<<
19339 * for k in range(mt.shape[1]):
19340 * mt_avg += dV[eN,k]*mt[eN,k]
19341*/
19342 __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
19343 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_mstate_global->__pyx_float_0_0);
19344
19345 /* "subsurfaceTransportFunctions.pyx":686
19346 * mt_avg = 0.0
19347 * vol = 0.0
19348 * for k in range(mt.shape[1]): # <<<<<<<<<<<<<<
19349 * mt_avg += dV[eN,k]*mt[eN,k]
19350 * vol += dV[eN,k]
19351*/
19352
19353 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_mt))[1]);
19354 __pyx_t_5 = __pyx_t_4;
19355
19356 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19357 __pyx_v_k = __pyx_t_6;
19358
19359 /* "subsurfaceTransportFunctions.pyx":687
19360 * vol = 0.0
19361 * for k in range(mt.shape[1]):
19362 * mt_avg += dV[eN,k]*mt[eN,k] # <<<<<<<<<<<<<<
19363 * vol += dV[eN,k]
19364 * mt_avg /= vol
19365*/
19366 __pyx_t_7 = __pyx_v_eN;
19367 __pyx_t_8 = __pyx_v_k;
19368 __pyx_t_9 = -1;
19369 if (__pyx_t_7 < 0) {
19370 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
19371 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
19372 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
19373 if (__pyx_t_8 < 0) {
19374 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
19375 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
19376 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
19377 if (unlikely(__pyx_t_9 != -1)) {
19378 __Pyx_RaiseBufferIndexError(__pyx_t_9);
19379 __PYX_ERR(0, 687, __pyx_L1_error)
19380 }
19381 __pyx_t_10 = __pyx_v_eN;
19382 __pyx_t_11 = __pyx_v_k;
19383 __pyx_t_9 = -1;
19384 if (__pyx_t_10 < 0) {
19385 __pyx_t_10 += __pyx_pybuffernd_mt.diminfo[0].shape;
19386 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
19387 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_9 = 0;
19388 if (__pyx_t_11 < 0) {
19389 __pyx_t_11 += __pyx_pybuffernd_mt.diminfo[1].shape;
19390 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
19391 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_9 = 1;
19392 if (unlikely(__pyx_t_9 != -1)) {
19393 __Pyx_RaiseBufferIndexError(__pyx_t_9);
19394 __PYX_ERR(0, 687, __pyx_L1_error)
19395 }
19396 __pyx_t_12 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_mt.diminfo[1].strides)))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 687, __pyx_L1_error)
19397 __Pyx_GOTREF(__pyx_t_12);
19398 __pyx_t_13 = __Pyx_PyNumber_InPlaceAdd_object_float(__pyx_v_mt_avg, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 687, __pyx_L1_error)
19399 __Pyx_GOTREF(__pyx_t_13);
19400 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19401 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_13);
19402 __pyx_t_13 = 0;
19403
19404 /* "subsurfaceTransportFunctions.pyx":688
19405 * for k in range(mt.shape[1]):
19406 * mt_avg += dV[eN,k]*mt[eN,k]
19407 * vol += dV[eN,k] # <<<<<<<<<<<<<<
19408 * mt_avg /= vol
19409 * for i in range(weak_residual.shape[1]):
19410*/
19411 __pyx_t_11 = __pyx_v_eN;
19412 __pyx_t_10 = __pyx_v_k;
19413 __pyx_t_9 = -1;
19414 if (__pyx_t_11 < 0) {
19415 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[0].shape;
19416 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
19417 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
19418 if (__pyx_t_10 < 0) {
19419 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[1].shape;
19420 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
19421 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
19422 if (unlikely(__pyx_t_9 != -1)) {
19423 __Pyx_RaiseBufferIndexError(__pyx_t_9);
19424 __PYX_ERR(0, 688, __pyx_L1_error)
19425 }
19426 __pyx_t_13 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[1].strides))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 688, __pyx_L1_error)
19427 __Pyx_GOTREF(__pyx_t_13);
19428 __pyx_t_12 = __Pyx_PyNumber_InPlaceAdd_object_float(__pyx_v_vol, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error)
19429 __Pyx_GOTREF(__pyx_t_12);
19430 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
19431 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_12);
19432 __pyx_t_12 = 0;
19433 }
19434
19435
19436 /* "subsurfaceTransportFunctions.pyx":689
19437 * mt_avg += dV[eN,k]*mt[eN,k]
19438 * vol += dV[eN,k]
19439 * mt_avg /= vol # <<<<<<<<<<<<<<
19440 * for i in range(weak_residual.shape[1]):
19441 * #cek hack, seems like cython needed some help figuring out that the rvalue was a float
19442*/
19443 __pyx_t_12 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 689, __pyx_L1_error)
19444 __Pyx_GOTREF(__pyx_t_12);
19445 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_12);
19446 __pyx_t_12 = 0;
19447
19448 /* "subsurfaceTransportFunctions.pyx":690
19449 * vol += dV[eN,k]
19450 * mt_avg /= vol
19451 * for i in range(weak_residual.shape[1]): # <<<<<<<<<<<<<<
19452 * #cek hack, seems like cython needed some help figuring out that the rvalue was a float
19453 * weak_residual[eN,i] += float(mt_avg*w[eN,k,i]*dV[eN,k])
19454*/
19455
19456 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_weak_residual))[1]);
19457 __pyx_t_5 = __pyx_t_4;
19458
19459 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19460 __pyx_v_i = __pyx_t_6;
19461
19462 /* "subsurfaceTransportFunctions.pyx":692
19463 * for i in range(weak_residual.shape[1]):
19464 * #cek hack, seems like cython needed some help figuring out that the rvalue was a float
19465 * weak_residual[eN,i] += float(mt_avg*w[eN,k,i]*dV[eN,k]) # <<<<<<<<<<<<<<
19466 * def updateMassJacobian_weakAvg(numpy.ndarray[DTYPE_t,ndim=2] dmt,
19467 * numpy.ndarray[DTYPE_t,ndim=3] w,
19468*/
19469 __pyx_t_10 = __pyx_v_eN;
19470 __pyx_t_11 = __pyx_v_k;
19471 __pyx_t_8 = __pyx_v_i;
19472 __pyx_t_9 = -1;
19473 if (__pyx_t_10 < 0) {
19474 __pyx_t_10 += __pyx_pybuffernd_w.diminfo[0].shape;
19475 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
19476 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_9 = 0;
19477 if (__pyx_t_11 < 0) {
19478 __pyx_t_11 += __pyx_pybuffernd_w.diminfo[1].shape;
19479 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
19480 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_9 = 1;
19481 if (__pyx_t_8 < 0) {
19482 __pyx_t_8 += __pyx_pybuffernd_w.diminfo[2].shape;
19483 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
19484 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_9 = 2;
19485 if (unlikely(__pyx_t_9 != -1)) {
19486 __Pyx_RaiseBufferIndexError(__pyx_t_9);
19487 __PYX_ERR(0, 692, __pyx_L1_error)
19488 }
19489 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_w.diminfo[2].strides))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 692, __pyx_L1_error)
19490 __Pyx_GOTREF(__pyx_t_12);
19491 __pyx_t_13 = __Pyx_PyNumber_Multiply_object_float(__pyx_v_mt_avg, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 692, __pyx_L1_error)
19492 __Pyx_GOTREF(__pyx_t_13);
19493 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19494 __pyx_t_8 = __pyx_v_eN;
19495 __pyx_t_11 = __pyx_v_k;
19496 __pyx_t_9 = -1;
19497 if (__pyx_t_8 < 0) {
19498 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
19499 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
19500 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
19501 if (__pyx_t_11 < 0) {
19502 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
19503 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
19504 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
19505 if (unlikely(__pyx_t_9 != -1)) {
19506 __Pyx_RaiseBufferIndexError(__pyx_t_9);
19507 __PYX_ERR(0, 692, __pyx_L1_error)
19508 }
19509 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 692, __pyx_L1_error)
19510 __Pyx_GOTREF(__pyx_t_12);
19511 __pyx_t_14 = __Pyx_PyNumber_Multiply_object_float(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 692, __pyx_L1_error)
19512 __Pyx_GOTREF(__pyx_t_14);
19513 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
19514 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19515 __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_t_14); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_15, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error)
19516 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19517 __pyx_t_11 = __pyx_v_eN;
19518 __pyx_t_8 = __pyx_v_i;
19519 __pyx_t_9 = -1;
19520 if (__pyx_t_11 < 0) {
19521 __pyx_t_11 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
19522 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
19523 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_9 = 0;
19524 if (__pyx_t_8 < 0) {
19525 __pyx_t_8 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
19526 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
19527 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_9 = 1;
19528 if (unlikely(__pyx_t_9 != -1)) {
19529 __Pyx_RaiseBufferIndexError(__pyx_t_9);
19530 __PYX_ERR(0, 692, __pyx_L1_error)
19531 }
19532 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_15;
19533
19534 }
19535
19536 }
19537
19538
19539 /* "subsurfaceTransportFunctions.pyx":674
19540 * ##################################################
19541 *
19542 * def updateMass_weakAvg(numpy.ndarray[DTYPE_t,ndim=2] mt, # <<<<<<<<<<<<<<
19543 * numpy.ndarray[DTYPE_t,ndim=3] w,
19544 * numpy.ndarray[DTYPE_t,ndim=2] dV,
19545*/
19546
19547 /* function exit code */
19548 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19549 goto __pyx_L0;
19550 __pyx_L1_error:;
19551 __Pyx_XDECREF(__pyx_t_12);
19552 __Pyx_XDECREF(__pyx_t_13);
19553 __Pyx_XDECREF(__pyx_t_14);
19554 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19555 __Pyx_PyThreadState_declare
19556 __Pyx_PyThreadState_assign
19557 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19558 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
19559 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
19560 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
19561 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
19562 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19563 __Pyx_AddTraceback("subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
19564 __pyx_r = NULL;
19565 goto __pyx_L2;
19566 __pyx_L0:;
19567 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
19568 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
19569 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
19570 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
19571 __pyx_L2:;
19572
19573
19574
19575 __Pyx_XDECREF(__pyx_v_mt_avg);
19576 __Pyx_XDECREF(__pyx_v_vol);
19577
19578
19579
19580
19581
19582
19583
19584
19585 __Pyx_XGIVEREF(__pyx_r);
19586 __Pyx_RefNannyFinishContext();
19587 return __pyx_r;
19588}
19589
19590/* "subsurfaceTransportFunctions.pyx":693
19591 * #cek hack, seems like cython needed some help figuring out that the rvalue was a float
19592 * weak_residual[eN,i] += float(mt_avg*w[eN,k,i]*dV[eN,k])
19593 * def updateMassJacobian_weakAvg(numpy.ndarray[DTYPE_t,ndim=2] dmt, # <<<<<<<<<<<<<<
19594 * numpy.ndarray[DTYPE_t,ndim=3] w,
19595 * numpy.ndarray[DTYPE_t,ndim=3] v,
19596*/
19597
19598/* Python wrapper */
19599static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self,
19600#if CYTHON_VECTORCALL
19601PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19602#else
19603PyObject *__pyx_args, PyObject *__pyx_kwds
19604#endif
19605); /*proto*/
19606PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg, "\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ");
19607static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {"updateMassJacobian_weakAvg", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
19608static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self,
19609#if CYTHON_VECTORCALL
19610PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19611#else
19612PyObject *__pyx_args, PyObject *__pyx_kwds
19613#endif
19614) {
19615 PyArrayObject *__pyx_v_dmt = 0;
19616 PyArrayObject *__pyx_v_w = 0;
19617 PyArrayObject *__pyx_v_v = 0;
19618 PyArrayObject *__pyx_v_dV = 0;
19619 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
19620 #if !CYTHON_VECTORCALL
19621 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
19622 #endif
19623 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
19624 PyObject* values[5] = {0,0,0,0,0};
19625 int __pyx_lineno = 0;
19626 const char *__pyx_filename = NULL;
19627 int __pyx_clineno = 0;
19628 PyObject *__pyx_r = 0;
19629 __Pyx_RefNannyDeclarations
19630 __Pyx_RefNannySetupContext("updateMassJacobian_weakAvg (wrapper)", 0);
19631 #if !CYTHON_VECTORCALL
19632 #if CYTHON_ASSUME_SAFE_SIZE
19633 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
19634 #else
19635 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
19636 #endif
19637 #endif
19638 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
19639 {
19640 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dmt,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_dV,&__pyx_mstate_global->__pyx_n_u_jacobian_weak_residual,0};
19641 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
19642 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 693, __pyx_L3_error)
19643 if (__pyx_kwds_len > 0) {
19644 switch (__pyx_nargs) {
19645 case 5:
19646 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
19647 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 693, __pyx_L3_error)
19648 CYTHON_FALLTHROUGH;
19649 case 4:
19650 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
19651 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 693, __pyx_L3_error)
19652 CYTHON_FALLTHROUGH;
19653 case 3:
19654 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
19655 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 693, __pyx_L3_error)
19656 CYTHON_FALLTHROUGH;
19657 case 2:
19658 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
19659 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error)
19660 CYTHON_FALLTHROUGH;
19661 case 1:
19662 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
19663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error)
19664 CYTHON_FALLTHROUGH;
19665 case 0: break;
19666 default: goto __pyx_L5_argtuple_error;
19667 }
19668 const Py_ssize_t kwd_pos_args = __pyx_nargs;
19669 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "updateMassJacobian_weakAvg", 0) < (0)) __PYX_ERR(0, 693, __pyx_L3_error)
19670 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
19671 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("updateMassJacobian_weakAvg", 1, 5, 5, i); __PYX_ERR(0, 693, __pyx_L3_error) }
19672 }
19673 } else if (unlikely(__pyx_nargs != 5)) {
19674 goto __pyx_L5_argtuple_error;
19675 } else {
19676 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
19677 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error)
19678 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
19679 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error)
19680 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
19681 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 693, __pyx_L3_error)
19682 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
19683 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 693, __pyx_L3_error)
19684 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
19685 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 693, __pyx_L3_error)
19686 }
19687 __pyx_v_dmt = ((PyArrayObject *)values[0]);
19688 __pyx_v_w = ((PyArrayObject *)values[1]);
19689 __pyx_v_v = ((PyArrayObject *)values[2]);
19690 __pyx_v_dV = ((PyArrayObject *)values[3]);
19691 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
19692 }
19693 goto __pyx_L6_skip;
19694 __pyx_L5_argtuple_error:;
19695 __Pyx_RaiseArgtupleInvalid("updateMassJacobian_weakAvg", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 693, __pyx_L3_error)
19696 __pyx_L6_skip:;
19697 goto __pyx_L4_argument_unpacking_done;
19698 __pyx_L3_error:;
19699 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19700 Py_XDECREF(values[__pyx_temp]);
19701 }
19702 __Pyx_AddTraceback("subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
19703 __Pyx_RefNannyFinishContext();
19704 return NULL;
19705 __pyx_L4_argument_unpacking_done:;
19706 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
19707 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "w", 0))) __PYX_ERR(0, 694, __pyx_L1_error)
19708 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 695, __pyx_L1_error)
19709 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dV", 0))) __PYX_ERR(0, 696, __pyx_L1_error)
19710 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "jacobian_weak_residual", 0))) __PYX_ERR(0, 697, __pyx_L1_error)
19711 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
19712
19713 /* function exit code */
19714 goto __pyx_L0;
19715 __pyx_L1_error:;
19716 __pyx_r = NULL;
19717 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19718 Py_XDECREF(values[__pyx_temp]);
19719 }
19720 goto __pyx_L7_cleaned_up;
19721 __pyx_L0:;
19722 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19723 Py_XDECREF(values[__pyx_temp]);
19724 }
19725 __pyx_L7_cleaned_up:;
19726 __Pyx_RefNannyFinishContext();
19727 return __pyx_r;
19728}
19729
19730static 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) {
19731 int __pyx_v_eN;
19732 int __pyx_v_i;
19733 int __pyx_v_j;
19734 int __pyx_v_k;
19735 double __pyx_v_dmtj_avg;
19736 double __pyx_v_vol;
19737 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
19738 __Pyx_Buffer __pyx_pybuffer_dV;
19739 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
19740 __Pyx_Buffer __pyx_pybuffer_dmt;
19741 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
19742 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
19743 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19744 __Pyx_Buffer __pyx_pybuffer_v;
19745 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
19746 __Pyx_Buffer __pyx_pybuffer_w;
19747 PyObject *__pyx_r = NULL;
19748 __Pyx_RefNannyDeclarations
19749 npy_intp __pyx_t_1;
19750 npy_intp __pyx_t_2;
19751 int __pyx_t_3;
19752 npy_intp __pyx_t_4;
19753 npy_intp __pyx_t_5;
19754 int __pyx_t_6;
19755 Py_ssize_t __pyx_t_7;
19756 Py_ssize_t __pyx_t_8;
19757 int __pyx_t_9;
19758 npy_intp __pyx_t_10;
19759 npy_intp __pyx_t_11;
19760 npy_intp __pyx_t_12;
19761 npy_intp __pyx_t_13;
19762 int __pyx_t_14;
19763 int __pyx_t_15;
19764 Py_ssize_t __pyx_t_16;
19765 Py_ssize_t __pyx_t_17;
19766 Py_ssize_t __pyx_t_18;
19767 Py_ssize_t __pyx_t_19;
19768 Py_ssize_t __pyx_t_20;
19769 Py_ssize_t __pyx_t_21;
19770 int __pyx_lineno = 0;
19771 const char *__pyx_filename = NULL;
19772 int __pyx_clineno = 0;
19773 __Pyx_RefNannySetupContext("updateMassJacobian_weakAvg", 0);
19774 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
19775 __pyx_pybuffer_dmt.refcount = 0;
19776 __pyx_pybuffernd_dmt.data = NULL;
19777 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
19778 __pyx_pybuffer_w.pybuffer.buf = NULL;
19779 __pyx_pybuffer_w.refcount = 0;
19780 __pyx_pybuffernd_w.data = NULL;
19781 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
19782 __pyx_pybuffer_v.pybuffer.buf = NULL;
19783 __pyx_pybuffer_v.refcount = 0;
19784 __pyx_pybuffernd_v.data = NULL;
19785 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19786 __pyx_pybuffer_dV.pybuffer.buf = NULL;
19787 __pyx_pybuffer_dV.refcount = 0;
19788 __pyx_pybuffernd_dV.data = NULL;
19789 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
19790 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
19791 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
19792 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
19793 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
19794 {
19795 __Pyx_BufFmt_StackElem __pyx_stack[1];
19796 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 693, __pyx_L1_error)
19797 }
19798 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
19799 {
19800 __Pyx_BufFmt_StackElem __pyx_stack[1];
19801 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 693, __pyx_L1_error)
19802 }
19803 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
19804 {
19805 __Pyx_BufFmt_StackElem __pyx_stack[1];
19806 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 693, __pyx_L1_error)
19807 }
19808 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19809 {
19810 __Pyx_BufFmt_StackElem __pyx_stack[1];
19811 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 693, __pyx_L1_error)
19812 }
19813 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
19814 {
19815 __Pyx_BufFmt_StackElem __pyx_stack[1];
19816 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 693, __pyx_L1_error)
19817 }
19818 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
19819
19820 /* "subsurfaceTransportFunctions.pyx":703
19821 * cdef int eN,i,j,k
19822 * cdef double dmtj_avg,vol
19823 * for eN in range(dmt.shape[0]): # <<<<<<<<<<<<<<
19824 * vol = 0.0 #should I save a loop?
19825 * for k in range(dmt.shape[1]):
19826*/
19827
19828 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_dmt))[0]);
19829 __pyx_t_2 = __pyx_t_1;
19830
19831 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19832 __pyx_v_eN = __pyx_t_3;
19833
19834 /* "subsurfaceTransportFunctions.pyx":704
19835 * cdef double dmtj_avg,vol
19836 * for eN in range(dmt.shape[0]):
19837 * vol = 0.0 #should I save a loop? # <<<<<<<<<<<<<<
19838 * for k in range(dmt.shape[1]):
19839 * vol += dV[eN,k]
19840*/
19841 __pyx_v_vol = 0.0;
19842
19843 /* "subsurfaceTransportFunctions.pyx":705
19844 * for eN in range(dmt.shape[0]):
19845 * vol = 0.0 #should I save a loop?
19846 * for k in range(dmt.shape[1]): # <<<<<<<<<<<<<<
19847 * vol += dV[eN,k]
19848 * for i in range(w.shape[2]):
19849*/
19850
19851 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_dmt))[1]);
19852 __pyx_t_5 = __pyx_t_4;
19853
19854 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19855 __pyx_v_k = __pyx_t_6;
19856
19857 /* "subsurfaceTransportFunctions.pyx":706
19858 * vol = 0.0 #should I save a loop?
19859 * for k in range(dmt.shape[1]):
19860 * vol += dV[eN,k] # <<<<<<<<<<<<<<
19861 * for i in range(w.shape[2]):
19862 * for j in range(v.shape[2]):
19863*/
19864 __pyx_t_7 = __pyx_v_eN;
19865 __pyx_t_8 = __pyx_v_k;
19866 __pyx_t_9 = -1;
19867 if (__pyx_t_7 < 0) {
19868 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
19869 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
19870 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
19871 if (__pyx_t_8 < 0) {
19872 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
19873 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
19874 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
19875 if (unlikely(__pyx_t_9 != -1)) {
19876 __Pyx_RaiseBufferIndexError(__pyx_t_9);
19877 __PYX_ERR(0, 706, __pyx_L1_error)
19878 }
19879 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
19880 }
19881
19882
19883 /* "subsurfaceTransportFunctions.pyx":707
19884 * for k in range(dmt.shape[1]):
19885 * vol += dV[eN,k]
19886 * for i in range(w.shape[2]): # <<<<<<<<<<<<<<
19887 * for j in range(v.shape[2]):
19888 * dmtj_avg = 0.0
19889*/
19890
19891 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_w))[2]);
19892 __pyx_t_5 = __pyx_t_4;
19893
19894 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19895 __pyx_v_i = __pyx_t_6;
19896
19897 /* "subsurfaceTransportFunctions.pyx":708
19898 * vol += dV[eN,k]
19899 * for i in range(w.shape[2]):
19900 * for j in range(v.shape[2]): # <<<<<<<<<<<<<<
19901 * dmtj_avg = 0.0
19902 * for k in range(dmt.shape[1]):
19903*/
19904
19905 __pyx_t_10 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_v))[2]);
19906 __pyx_t_11 = __pyx_t_10;
19907
19908 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
19909 __pyx_v_j = __pyx_t_9;
19910
19911 /* "subsurfaceTransportFunctions.pyx":709
19912 * for i in range(w.shape[2]):
19913 * for j in range(v.shape[2]):
19914 * dmtj_avg = 0.0 # <<<<<<<<<<<<<<
19915 * for k in range(dmt.shape[1]):
19916 * dmtj_avg += dV[eN,k]*dmt[eN,k]*v[eN,k,j]
19917*/
19918 __pyx_v_dmtj_avg = 0.0;
19919
19920 /* "subsurfaceTransportFunctions.pyx":710
19921 * for j in range(v.shape[2]):
19922 * dmtj_avg = 0.0
19923 * for k in range(dmt.shape[1]): # <<<<<<<<<<<<<<
19924 * dmtj_avg += dV[eN,k]*dmt[eN,k]*v[eN,k,j]
19925 * dmtj_avg /= vol
19926*/
19927
19928 __pyx_t_12 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_dmt))[1]);
19929 __pyx_t_13 = __pyx_t_12;
19930
19931 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
19932 __pyx_v_k = __pyx_t_14;
19933
19934 /* "subsurfaceTransportFunctions.pyx":711
19935 * dmtj_avg = 0.0
19936 * for k in range(dmt.shape[1]):
19937 * dmtj_avg += dV[eN,k]*dmt[eN,k]*v[eN,k,j] # <<<<<<<<<<<<<<
19938 * dmtj_avg /= vol
19939 * jacobian_weak_residual[eN,i,j] += dmtj_avg*w[eN,k,i]*dV[eN,k]
19940*/
19941 __pyx_t_8 = __pyx_v_eN;
19942 __pyx_t_7 = __pyx_v_k;
19943 __pyx_t_15 = -1;
19944 if (__pyx_t_8 < 0) {
19945 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
19946 if (unlikely(__pyx_t_8 < 0)) __pyx_t_15 = 0;
19947 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_15 = 0;
19948 if (__pyx_t_7 < 0) {
19949 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
19950 if (unlikely(__pyx_t_7 < 0)) __pyx_t_15 = 1;
19951 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_15 = 1;
19952 if (unlikely(__pyx_t_15 != -1)) {
19953 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19954 __PYX_ERR(0, 711, __pyx_L1_error)
19955 }
19956 __pyx_t_16 = __pyx_v_eN;
19957 __pyx_t_17 = __pyx_v_k;
19958 __pyx_t_15 = -1;
19959 if (__pyx_t_16 < 0) {
19960 __pyx_t_16 += __pyx_pybuffernd_dmt.diminfo[0].shape;
19961 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
19962 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_15 = 0;
19963 if (__pyx_t_17 < 0) {
19964 __pyx_t_17 += __pyx_pybuffernd_dmt.diminfo[1].shape;
19965 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
19966 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_15 = 1;
19967 if (unlikely(__pyx_t_15 != -1)) {
19968 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19969 __PYX_ERR(0, 711, __pyx_L1_error)
19970 }
19971 __pyx_t_18 = __pyx_v_eN;
19972 __pyx_t_19 = __pyx_v_k;
19973 __pyx_t_20 = __pyx_v_j;
19974 __pyx_t_15 = -1;
19975 if (__pyx_t_18 < 0) {
19976 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
19977 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
19978 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19979 if (__pyx_t_19 < 0) {
19980 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
19981 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 1;
19982 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19983 if (__pyx_t_20 < 0) {
19984 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
19985 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 2;
19986 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19987 if (unlikely(__pyx_t_15 != -1)) {
19988 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19989 __PYX_ERR(0, 711, __pyx_L1_error)
19990 }
19991 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides))));
19992 }
19993
19994
19995 /* "subsurfaceTransportFunctions.pyx":712
19996 * for k in range(dmt.shape[1]):
19997 * dmtj_avg += dV[eN,k]*dmt[eN,k]*v[eN,k,j]
19998 * dmtj_avg /= vol # <<<<<<<<<<<<<<
19999 * jacobian_weak_residual[eN,i,j] += dmtj_avg*w[eN,k,i]*dV[eN,k]
20000 *
20001*/
20002 if (unlikely(__pyx_v_vol == 0)) {
20003 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
20004 __PYX_ERR(0, 712, __pyx_L1_error)
20005 }
20006 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
20007
20008 /* "subsurfaceTransportFunctions.pyx":713
20009 * dmtj_avg += dV[eN,k]*dmt[eN,k]*v[eN,k,j]
20010 * dmtj_avg /= vol
20011 * jacobian_weak_residual[eN,i,j] += dmtj_avg*w[eN,k,i]*dV[eN,k] # <<<<<<<<<<<<<<
20012 *
20013 * ########################################################################
20014*/
20015 __pyx_t_20 = __pyx_v_eN;
20016 __pyx_t_19 = __pyx_v_k;
20017 __pyx_t_18 = __pyx_v_i;
20018 __pyx_t_14 = -1;
20019 if (__pyx_t_20 < 0) {
20020 __pyx_t_20 += __pyx_pybuffernd_w.diminfo[0].shape;
20021 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 0;
20022 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_14 = 0;
20023 if (__pyx_t_19 < 0) {
20024 __pyx_t_19 += __pyx_pybuffernd_w.diminfo[1].shape;
20025 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 1;
20026 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_14 = 1;
20027 if (__pyx_t_18 < 0) {
20028 __pyx_t_18 += __pyx_pybuffernd_w.diminfo[2].shape;
20029 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 2;
20030 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_14 = 2;
20031 if (unlikely(__pyx_t_14 != -1)) {
20032 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20033 __PYX_ERR(0, 713, __pyx_L1_error)
20034 }
20035 __pyx_t_17 = __pyx_v_eN;
20036 __pyx_t_16 = __pyx_v_k;
20037 __pyx_t_14 = -1;
20038 if (__pyx_t_17 < 0) {
20039 __pyx_t_17 += __pyx_pybuffernd_dV.diminfo[0].shape;
20040 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 0;
20041 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_14 = 0;
20042 if (__pyx_t_16 < 0) {
20043 __pyx_t_16 += __pyx_pybuffernd_dV.diminfo[1].shape;
20044 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
20045 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_14 = 1;
20046 if (unlikely(__pyx_t_14 != -1)) {
20047 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20048 __PYX_ERR(0, 713, __pyx_L1_error)
20049 }
20050 __pyx_t_7 = __pyx_v_eN;
20051 __pyx_t_8 = __pyx_v_i;
20052 __pyx_t_21 = __pyx_v_j;
20053 __pyx_t_14 = -1;
20054 if (__pyx_t_7 < 0) {
20055 __pyx_t_7 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
20056 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
20057 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_14 = 0;
20058 if (__pyx_t_8 < 0) {
20059 __pyx_t_8 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
20060 if (unlikely(__pyx_t_8 < 0)) __pyx_t_14 = 1;
20061 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_14 = 1;
20062 if (__pyx_t_21 < 0) {
20063 __pyx_t_21 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
20064 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
20065 } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_14 = 2;
20066 if (unlikely(__pyx_t_14 != -1)) {
20067 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20068 __PYX_ERR(0, 713, __pyx_L1_error)
20069 }
20070 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_dV.diminfo[1].strides)));
20071 }
20072
20073 }
20074
20075 }
20076
20077
20078 /* "subsurfaceTransportFunctions.pyx":693
20079 * #cek hack, seems like cython needed some help figuring out that the rvalue was a float
20080 * weak_residual[eN,i] += float(mt_avg*w[eN,k,i]*dV[eN,k])
20081 * def updateMassJacobian_weakAvg(numpy.ndarray[DTYPE_t,ndim=2] dmt, # <<<<<<<<<<<<<<
20082 * numpy.ndarray[DTYPE_t,ndim=3] w,
20083 * numpy.ndarray[DTYPE_t,ndim=3] v,
20084*/
20085
20086 /* function exit code */
20087 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20088 goto __pyx_L0;
20089 __pyx_L1_error:;
20090 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20091 __Pyx_PyThreadState_declare
20092 __Pyx_PyThreadState_assign
20093 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20094 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
20095 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
20096 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
20097 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20098 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
20099 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20100 __Pyx_AddTraceback("subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
20101 __pyx_r = NULL;
20102 goto __pyx_L2;
20103 __pyx_L0:;
20104 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
20105 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
20106 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
20107 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20108 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
20109 __pyx_L2:;
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126 __Pyx_XGIVEREF(__pyx_r);
20127 __Pyx_RefNannyFinishContext();
20128 return __pyx_r;
20129}
20130
20131/* "subsurfaceTransportFunctions.pyx":718
20132 * #ELLAM
20133 * ########################################################################
20134 * def calculateNormalFlux(numpy.ndarray[DTYPE_t,ndim=4] v, # <<<<<<<<<<<<<<
20135 * numpy.ndarray[DTYPE_t,ndim=4] n,
20136 * numpy.ndarray[DTYPE_t,ndim=3] dS,
20137*/
20138
20139/* Python wrapper */
20140static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self,
20141#if CYTHON_VECTORCALL
20142PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20143#else
20144PyObject *__pyx_args, PyObject *__pyx_kwds
20145#endif
20146); /*proto*/
20147static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {"calculateNormalFlux", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
20148static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self,
20149#if CYTHON_VECTORCALL
20150PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20151#else
20152PyObject *__pyx_args, PyObject *__pyx_kwds
20153#endif
20154) {
20155 PyArrayObject *__pyx_v_v = 0;
20156 PyArrayObject *__pyx_v_n = 0;
20157 PyArrayObject *__pyx_v_dS = 0;
20158 PyArrayObject *__pyx_v_flux = 0;
20159 #if !CYTHON_VECTORCALL
20160 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20161 #endif
20162 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20163 PyObject* values[4] = {0,0,0,0};
20164 int __pyx_lineno = 0;
20165 const char *__pyx_filename = NULL;
20166 int __pyx_clineno = 0;
20167 PyObject *__pyx_r = 0;
20168 __Pyx_RefNannyDeclarations
20169 __Pyx_RefNannySetupContext("calculateNormalFlux (wrapper)", 0);
20170 #if !CYTHON_VECTORCALL
20171 #if CYTHON_ASSUME_SAFE_SIZE
20172 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20173 #else
20174 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20175 #endif
20176 #endif
20177 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20178 {
20179 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_dS,&__pyx_mstate_global->__pyx_n_u_flux,0};
20180 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
20181 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 718, __pyx_L3_error)
20182 if (__pyx_kwds_len > 0) {
20183 switch (__pyx_nargs) {
20184 case 4:
20185 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
20186 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 718, __pyx_L3_error)
20187 CYTHON_FALLTHROUGH;
20188 case 3:
20189 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
20190 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 718, __pyx_L3_error)
20191 CYTHON_FALLTHROUGH;
20192 case 2:
20193 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
20194 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 718, __pyx_L3_error)
20195 CYTHON_FALLTHROUGH;
20196 case 1:
20197 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
20198 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 718, __pyx_L3_error)
20199 CYTHON_FALLTHROUGH;
20200 case 0: break;
20201 default: goto __pyx_L5_argtuple_error;
20202 }
20203 const Py_ssize_t kwd_pos_args = __pyx_nargs;
20204 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "calculateNormalFlux", 0) < (0)) __PYX_ERR(0, 718, __pyx_L3_error)
20205 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
20206 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("calculateNormalFlux", 1, 4, 4, i); __PYX_ERR(0, 718, __pyx_L3_error) }
20207 }
20208 } else if (unlikely(__pyx_nargs != 4)) {
20209 goto __pyx_L5_argtuple_error;
20210 } else {
20211 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
20212 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 718, __pyx_L3_error)
20213 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
20214 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 718, __pyx_L3_error)
20215 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
20216 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 718, __pyx_L3_error)
20217 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
20218 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 718, __pyx_L3_error)
20219 }
20220 __pyx_v_v = ((PyArrayObject *)values[0]);
20221 __pyx_v_n = ((PyArrayObject *)values[1]);
20222 __pyx_v_dS = ((PyArrayObject *)values[2]);
20223 __pyx_v_flux = ((PyArrayObject *)values[3]);
20224 }
20225 goto __pyx_L6_skip;
20226 __pyx_L5_argtuple_error:;
20227 __Pyx_RaiseArgtupleInvalid("calculateNormalFlux", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 718, __pyx_L3_error)
20228 __pyx_L6_skip:;
20229 goto __pyx_L4_argument_unpacking_done;
20230 __pyx_L3_error:;
20231 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20232 Py_XDECREF(values[__pyx_temp]);
20233 }
20234 __Pyx_AddTraceback("subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
20235 __Pyx_RefNannyFinishContext();
20236 return NULL;
20237 __pyx_L4_argument_unpacking_done:;
20238 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
20239 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "n", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
20240 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dS", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
20241 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "flux", 0))) __PYX_ERR(0, 721, __pyx_L1_error)
20242 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
20243
20244 /* function exit code */
20245 goto __pyx_L0;
20246 __pyx_L1_error:;
20247 __pyx_r = NULL;
20248 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20249 Py_XDECREF(values[__pyx_temp]);
20250 }
20251 goto __pyx_L7_cleaned_up;
20252 __pyx_L0:;
20253 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20254 Py_XDECREF(values[__pyx_temp]);
20255 }
20256 __pyx_L7_cleaned_up:;
20257 __Pyx_RefNannyFinishContext();
20258 return __pyx_r;
20259}
20260
20261static 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) {
20262 int __pyx_v_eN;
20263 int __pyx_v_ebN;
20264 int __pyx_v_kb;
20265 double __pyx_v_integral;
20266 npy_intp __pyx_v_I;
20267 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
20268 __Pyx_Buffer __pyx_pybuffer_dS;
20269 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
20270 __Pyx_Buffer __pyx_pybuffer_flux;
20271 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
20272 __Pyx_Buffer __pyx_pybuffer_n;
20273 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20274 __Pyx_Buffer __pyx_pybuffer_v;
20275 PyObject *__pyx_r = NULL;
20276 __Pyx_RefNannyDeclarations
20277 npy_intp __pyx_t_1;
20278 npy_intp __pyx_t_2;
20279 int __pyx_t_3;
20280 npy_intp __pyx_t_4;
20281 npy_intp __pyx_t_5;
20282 int __pyx_t_6;
20283 npy_intp __pyx_t_7;
20284 npy_intp __pyx_t_8;
20285 int __pyx_t_9;
20286 npy_intp __pyx_t_10;
20287 npy_intp __pyx_t_11;
20288 npy_intp __pyx_t_12;
20289 Py_ssize_t __pyx_t_13;
20290 Py_ssize_t __pyx_t_14;
20291 Py_ssize_t __pyx_t_15;
20292 Py_ssize_t __pyx_t_16;
20293 int __pyx_t_17;
20294 Py_ssize_t __pyx_t_18;
20295 Py_ssize_t __pyx_t_19;
20296 Py_ssize_t __pyx_t_20;
20297 Py_ssize_t __pyx_t_21;
20298 Py_ssize_t __pyx_t_22;
20299 Py_ssize_t __pyx_t_23;
20300 Py_ssize_t __pyx_t_24;
20301 int __pyx_lineno = 0;
20302 const char *__pyx_filename = NULL;
20303 int __pyx_clineno = 0;
20304 __Pyx_RefNannySetupContext("calculateNormalFlux", 0);
20305 __pyx_pybuffer_v.pybuffer.buf = NULL;
20306 __pyx_pybuffer_v.refcount = 0;
20307 __pyx_pybuffernd_v.data = NULL;
20308 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20309 __pyx_pybuffer_n.pybuffer.buf = NULL;
20310 __pyx_pybuffer_n.refcount = 0;
20311 __pyx_pybuffernd_n.data = NULL;
20312 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
20313 __pyx_pybuffer_dS.pybuffer.buf = NULL;
20314 __pyx_pybuffer_dS.refcount = 0;
20315 __pyx_pybuffernd_dS.data = NULL;
20316 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
20317 __pyx_pybuffer_flux.pybuffer.buf = NULL;
20318 __pyx_pybuffer_flux.refcount = 0;
20319 __pyx_pybuffernd_flux.data = NULL;
20320 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
20321 {
20322 __Pyx_BufFmt_StackElem __pyx_stack[1];
20323 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 718, __pyx_L1_error)
20324 }
20325 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
20326 {
20327 __Pyx_BufFmt_StackElem __pyx_stack[1];
20328 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 718, __pyx_L1_error)
20329 }
20330 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
20331 {
20332 __Pyx_BufFmt_StackElem __pyx_stack[1];
20333 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 718, __pyx_L1_error)
20334 }
20335 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
20336 {
20337 __Pyx_BufFmt_StackElem __pyx_stack[1];
20338 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 718, __pyx_L1_error)
20339 }
20340 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
20341
20342 /* "subsurfaceTransportFunctions.pyx":725
20343 * cdef int eN,ebN,kb
20344 * cdef double integral
20345 * for eN in range(n.shape[0]): # <<<<<<<<<<<<<<
20346 * for ebN in range(n.shape[1]):
20347 * integral = 0.0
20348*/
20349
20350 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_n))[0]);
20351 __pyx_t_2 = __pyx_t_1;
20352
20353 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20354 __pyx_v_eN = __pyx_t_3;
20355
20356 /* "subsurfaceTransportFunctions.pyx":726
20357 * cdef double integral
20358 * for eN in range(n.shape[0]):
20359 * for ebN in range(n.shape[1]): # <<<<<<<<<<<<<<
20360 * integral = 0.0
20361 * for kb in range(n.shape[2]):
20362*/
20363
20364 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_n))[1]);
20365 __pyx_t_5 = __pyx_t_4;
20366
20367 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20368 __pyx_v_ebN = __pyx_t_6;
20369
20370 /* "subsurfaceTransportFunctions.pyx":727
20371 * for eN in range(n.shape[0]):
20372 * for ebN in range(n.shape[1]):
20373 * integral = 0.0 # <<<<<<<<<<<<<<
20374 * for kb in range(n.shape[2]):
20375 * for I in range(n.shape[3]):
20376*/
20377 __pyx_v_integral = 0.0;
20378
20379 /* "subsurfaceTransportFunctions.pyx":728
20380 * for ebN in range(n.shape[1]):
20381 * integral = 0.0
20382 * for kb in range(n.shape[2]): # <<<<<<<<<<<<<<
20383 * for I in range(n.shape[3]):
20384 * integral += v[eN,ebN,kb,I]*n[eN,ebN,kb,I]*dS[eN,ebN,kb]
20385*/
20386
20387 __pyx_t_7 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_n))[2]);
20388 __pyx_t_8 = __pyx_t_7;
20389
20390 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
20391 __pyx_v_kb = __pyx_t_9;
20392
20393 /* "subsurfaceTransportFunctions.pyx":729
20394 * integral = 0.0
20395 * for kb in range(n.shape[2]):
20396 * for I in range(n.shape[3]): # <<<<<<<<<<<<<<
20397 * integral += v[eN,ebN,kb,I]*n[eN,ebN,kb,I]*dS[eN,ebN,kb]
20398 * flux[eN,ebN] = integral
20399*/
20400
20401 __pyx_t_10 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_n))[3]);
20402 __pyx_t_11 = __pyx_t_10;
20403
20404 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
20405 __pyx_v_I = __pyx_t_12;
20406
20407 /* "subsurfaceTransportFunctions.pyx":730
20408 * for kb in range(n.shape[2]):
20409 * for I in range(n.shape[3]):
20410 * integral += v[eN,ebN,kb,I]*n[eN,ebN,kb,I]*dS[eN,ebN,kb] # <<<<<<<<<<<<<<
20411 * flux[eN,ebN] = integral
20412 *
20413*/
20414 __pyx_t_13 = __pyx_v_eN;
20415 __pyx_t_14 = __pyx_v_ebN;
20416 __pyx_t_15 = __pyx_v_kb;
20417 __pyx_t_16 = __pyx_v_I;
20418 __pyx_t_17 = -1;
20419 if (__pyx_t_13 < 0) {
20420 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
20421 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
20422 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
20423 if (__pyx_t_14 < 0) {
20424 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
20425 if (unlikely(__pyx_t_14 < 0)) __pyx_t_17 = 1;
20426 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
20427 if (__pyx_t_15 < 0) {
20428 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
20429 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 2;
20430 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
20431 if (__pyx_t_16 < 0) {
20432 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
20433 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 3;
20434 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_17 = 3;
20435 if (unlikely(__pyx_t_17 != -1)) {
20436 __Pyx_RaiseBufferIndexError(__pyx_t_17);
20437 __PYX_ERR(0, 730, __pyx_L1_error)
20438 }
20439 __pyx_t_18 = __pyx_v_eN;
20440 __pyx_t_19 = __pyx_v_ebN;
20441 __pyx_t_20 = __pyx_v_kb;
20442 __pyx_t_21 = __pyx_v_I;
20443 __pyx_t_17 = -1;
20444 if (__pyx_t_18 < 0) {
20445 __pyx_t_18 += __pyx_pybuffernd_n.diminfo[0].shape;
20446 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
20447 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
20448 if (__pyx_t_19 < 0) {
20449 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[1].shape;
20450 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
20451 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_17 = 1;
20452 if (__pyx_t_20 < 0) {
20453 __pyx_t_20 += __pyx_pybuffernd_n.diminfo[2].shape;
20454 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 2;
20455 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_17 = 2;
20456 if (__pyx_t_21 < 0) {
20457 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[3].shape;
20458 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 3;
20459 } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_17 = 3;
20460 if (unlikely(__pyx_t_17 != -1)) {
20461 __Pyx_RaiseBufferIndexError(__pyx_t_17);
20462 __PYX_ERR(0, 730, __pyx_L1_error)
20463 }
20464 __pyx_t_22 = __pyx_v_eN;
20465 __pyx_t_23 = __pyx_v_ebN;
20466 __pyx_t_24 = __pyx_v_kb;
20467 __pyx_t_17 = -1;
20468 if (__pyx_t_22 < 0) {
20469 __pyx_t_22 += __pyx_pybuffernd_dS.diminfo[0].shape;
20470 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
20471 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_17 = 0;
20472 if (__pyx_t_23 < 0) {
20473 __pyx_t_23 += __pyx_pybuffernd_dS.diminfo[1].shape;
20474 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 1;
20475 } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_17 = 1;
20476 if (__pyx_t_24 < 0) {
20477 __pyx_t_24 += __pyx_pybuffernd_dS.diminfo[2].shape;
20478 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 2;
20479 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_17 = 2;
20480 if (unlikely(__pyx_t_17 != -1)) {
20481 __Pyx_RaiseBufferIndexError(__pyx_t_17);
20482 __PYX_ERR(0, 730, __pyx_L1_error)
20483 }
20484 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_21, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_dS.diminfo[2].strides))));
20485 }
20486
20487 }
20488
20489
20490 /* "subsurfaceTransportFunctions.pyx":731
20491 * for I in range(n.shape[3]):
20492 * integral += v[eN,ebN,kb,I]*n[eN,ebN,kb,I]*dS[eN,ebN,kb]
20493 * flux[eN,ebN] = integral # <<<<<<<<<<<<<<
20494 *
20495 * def computeSimpleCharacteristicVelocityFromElementVelocity(numpy.ndarray[DTYPE_t,ndim=3] df,
20496*/
20497 __pyx_t_24 = __pyx_v_eN;
20498 __pyx_t_23 = __pyx_v_ebN;
20499 __pyx_t_9 = -1;
20500 if (__pyx_t_24 < 0) {
20501 __pyx_t_24 += __pyx_pybuffernd_flux.diminfo[0].shape;
20502 if (unlikely(__pyx_t_24 < 0)) __pyx_t_9 = 0;
20503 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_9 = 0;
20504 if (__pyx_t_23 < 0) {
20505 __pyx_t_23 += __pyx_pybuffernd_flux.diminfo[1].shape;
20506 if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 1;
20507 } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_9 = 1;
20508 if (unlikely(__pyx_t_9 != -1)) {
20509 __Pyx_RaiseBufferIndexError(__pyx_t_9);
20510 __PYX_ERR(0, 731, __pyx_L1_error)
20511 }
20512 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
20513 }
20514
20515 }
20516
20517
20518 /* "subsurfaceTransportFunctions.pyx":718
20519 * #ELLAM
20520 * ########################################################################
20521 * def calculateNormalFlux(numpy.ndarray[DTYPE_t,ndim=4] v, # <<<<<<<<<<<<<<
20522 * numpy.ndarray[DTYPE_t,ndim=4] n,
20523 * numpy.ndarray[DTYPE_t,ndim=3] dS,
20524*/
20525
20526 /* function exit code */
20527 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20528 goto __pyx_L0;
20529 __pyx_L1_error:;
20530 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20531 __Pyx_PyThreadState_declare
20532 __Pyx_PyThreadState_assign
20533 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20534 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
20535 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
20536 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
20537 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20538 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20539 __Pyx_AddTraceback("subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
20540 __pyx_r = NULL;
20541 goto __pyx_L2;
20542 __pyx_L0:;
20543 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
20544 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
20545 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
20546 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20547 __pyx_L2:;
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561 __Pyx_XGIVEREF(__pyx_r);
20562 __Pyx_RefNannyFinishContext();
20563 return __pyx_r;
20564}
20565
20566/* "subsurfaceTransportFunctions.pyx":733
20567 * flux[eN,ebN] = integral
20568 *
20569 * def computeSimpleCharacteristicVelocityFromElementVelocity(numpy.ndarray[DTYPE_t,ndim=3] df, # <<<<<<<<<<<<<<
20570 * numpy.ndarray[DTYPE_t,ndim=3] characteristic_velocity,
20571 * numpy.ndarray[DTYPE_t,ndim=2] dm,
20572*/
20573
20574/* Python wrapper */
20575static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self,
20576#if CYTHON_VECTORCALL
20577PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20578#else
20579PyObject *__pyx_args, PyObject *__pyx_kwds
20580#endif
20581); /*proto*/
20582PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity, "\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ");
20583static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
20584static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self,
20585#if CYTHON_VECTORCALL
20586PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20587#else
20588PyObject *__pyx_args, PyObject *__pyx_kwds
20589#endif
20590) {
20591 PyArrayObject *__pyx_v_df = 0;
20592 PyArrayObject *__pyx_v_characteristic_velocity = 0;
20593 PyArrayObject *__pyx_v_dm = 0;
20594 PyArrayObject *__pyx_v_dV = 0;
20595 #if !CYTHON_VECTORCALL
20596 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20597 #endif
20598 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20599 PyObject* values[4] = {0,0,0,0};
20600 int __pyx_lineno = 0;
20601 const char *__pyx_filename = NULL;
20602 int __pyx_clineno = 0;
20603 PyObject *__pyx_r = 0;
20604 __Pyx_RefNannyDeclarations
20605 __Pyx_RefNannySetupContext("computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
20606 #if !CYTHON_VECTORCALL
20607 #if CYTHON_ASSUME_SAFE_SIZE
20608 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20609 #else
20610 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20611 #endif
20612 #endif
20613 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20614 {
20615 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_df,&__pyx_mstate_global->__pyx_n_u_characteristic_velocity,&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_dV,0};
20616 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
20617 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 733, __pyx_L3_error)
20618 if (__pyx_kwds_len > 0) {
20619 switch (__pyx_nargs) {
20620 case 4:
20621 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
20622 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 733, __pyx_L3_error)
20623 CYTHON_FALLTHROUGH;
20624 case 3:
20625 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
20626 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 733, __pyx_L3_error)
20627 CYTHON_FALLTHROUGH;
20628 case 2:
20629 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
20630 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 733, __pyx_L3_error)
20631 CYTHON_FALLTHROUGH;
20632 case 1:
20633 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
20634 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 733, __pyx_L3_error)
20635 CYTHON_FALLTHROUGH;
20636 case 0: break;
20637 default: goto __pyx_L5_argtuple_error;
20638 }
20639 const Py_ssize_t kwd_pos_args = __pyx_nargs;
20640 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeSimpleCharacteristicVelocityFromElementVelocity", 0) < (0)) __PYX_ERR(0, 733, __pyx_L3_error)
20641 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
20642 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, i); __PYX_ERR(0, 733, __pyx_L3_error) }
20643 }
20644 } else if (unlikely(__pyx_nargs != 4)) {
20645 goto __pyx_L5_argtuple_error;
20646 } else {
20647 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
20648 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 733, __pyx_L3_error)
20649 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
20650 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 733, __pyx_L3_error)
20651 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
20652 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 733, __pyx_L3_error)
20653 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
20654 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 733, __pyx_L3_error)
20655 }
20656 __pyx_v_df = ((PyArrayObject *)values[0]);
20657 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
20658 __pyx_v_dm = ((PyArrayObject *)values[2]);
20659 __pyx_v_dV = ((PyArrayObject *)values[3]);
20660 }
20661 goto __pyx_L6_skip;
20662 __pyx_L5_argtuple_error:;
20663 __Pyx_RaiseArgtupleInvalid("computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 733, __pyx_L3_error)
20664 __pyx_L6_skip:;
20665 goto __pyx_L4_argument_unpacking_done;
20666 __pyx_L3_error:;
20667 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20668 Py_XDECREF(values[__pyx_temp]);
20669 }
20670 __Pyx_AddTraceback("subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
20671 __Pyx_RefNannyFinishContext();
20672 return NULL;
20673 __pyx_L4_argument_unpacking_done:;
20674 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 733, __pyx_L1_error)
20675 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "characteristic_velocity", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
20676 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
20677 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dV", 0))) __PYX_ERR(0, 736, __pyx_L1_error)
20678 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
20679
20680 /* function exit code */
20681 goto __pyx_L0;
20682 __pyx_L1_error:;
20683 __pyx_r = NULL;
20684 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20685 Py_XDECREF(values[__pyx_temp]);
20686 }
20687 goto __pyx_L7_cleaned_up;
20688 __pyx_L0:;
20689 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20690 Py_XDECREF(values[__pyx_temp]);
20691 }
20692 __pyx_L7_cleaned_up:;
20693 __Pyx_RefNannyFinishContext();
20694 return __pyx_r;
20695}
20696
20697static 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) {
20698 int __pyx_v_eN;
20699 int __pyx_v_k;
20700 int __pyx_v_I;
20701 double __pyx_v_omega_e;
20702 double __pyx_v_vol_e;
20703 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
20704 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
20705 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
20706 __Pyx_Buffer __pyx_pybuffer_dV;
20707 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
20708 __Pyx_Buffer __pyx_pybuffer_df;
20709 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
20710 __Pyx_Buffer __pyx_pybuffer_dm;
20711 PyObject *__pyx_r = NULL;
20712 __Pyx_RefNannyDeclarations
20713 npy_intp __pyx_t_1;
20714 npy_intp __pyx_t_2;
20715 int __pyx_t_3;
20716 npy_intp __pyx_t_4;
20717 npy_intp __pyx_t_5;
20718 int __pyx_t_6;
20719 Py_ssize_t __pyx_t_7;
20720 Py_ssize_t __pyx_t_8;
20721 int __pyx_t_9;
20722 Py_ssize_t __pyx_t_10;
20723 Py_ssize_t __pyx_t_11;
20724 npy_intp __pyx_t_12;
20725 npy_intp __pyx_t_13;
20726 int __pyx_t_14;
20727 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
20728 double __pyx_t_16;
20729 int __pyx_lineno = 0;
20730 const char *__pyx_filename = NULL;
20731 int __pyx_clineno = 0;
20732 __Pyx_RefNannySetupContext("computeSimpleCharacteristicVelocityFromElementVelocity", 0);
20733 __pyx_pybuffer_df.pybuffer.buf = NULL;
20734 __pyx_pybuffer_df.refcount = 0;
20735 __pyx_pybuffernd_df.data = NULL;
20736 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
20737 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
20738 __pyx_pybuffer_characteristic_velocity.refcount = 0;
20739 __pyx_pybuffernd_characteristic_velocity.data = NULL;
20740 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
20741 __pyx_pybuffer_dm.pybuffer.buf = NULL;
20742 __pyx_pybuffer_dm.refcount = 0;
20743 __pyx_pybuffernd_dm.data = NULL;
20744 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
20745 __pyx_pybuffer_dV.pybuffer.buf = NULL;
20746 __pyx_pybuffer_dV.refcount = 0;
20747 __pyx_pybuffernd_dV.data = NULL;
20748 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
20749 {
20750 __Pyx_BufFmt_StackElem __pyx_stack[1];
20751 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 733, __pyx_L1_error)
20752 }
20753 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
20754 {
20755 __Pyx_BufFmt_StackElem __pyx_stack[1];
20756 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 733, __pyx_L1_error)
20757 }
20758 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
20759 {
20760 __Pyx_BufFmt_StackElem __pyx_stack[1];
20761 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 733, __pyx_L1_error)
20762 }
20763 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
20764 {
20765 __Pyx_BufFmt_StackElem __pyx_stack[1];
20766 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 733, __pyx_L1_error)
20767 }
20768 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
20769
20770 /* "subsurfaceTransportFunctions.pyx":744
20771 * cdef double omega_e, vol_e
20772 *
20773 * for eN in range(dm.shape[0]): # <<<<<<<<<<<<<<
20774 * omega_e = 0.0
20775 * vol_e = 0.0
20776*/
20777
20778 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_dm))[0]);
20779 __pyx_t_2 = __pyx_t_1;
20780
20781 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20782 __pyx_v_eN = __pyx_t_3;
20783
20784 /* "subsurfaceTransportFunctions.pyx":745
20785 *
20786 * for eN in range(dm.shape[0]):
20787 * omega_e = 0.0 # <<<<<<<<<<<<<<
20788 * vol_e = 0.0
20789 * for k in range(dm.shape[1]):
20790*/
20791 __pyx_v_omega_e = 0.0;
20792
20793 /* "subsurfaceTransportFunctions.pyx":746
20794 * for eN in range(dm.shape[0]):
20795 * omega_e = 0.0
20796 * vol_e = 0.0 # <<<<<<<<<<<<<<
20797 * for k in range(dm.shape[1]):
20798 * vol_e += dV[eN,k]
20799*/
20800 __pyx_v_vol_e = 0.0;
20801
20802 /* "subsurfaceTransportFunctions.pyx":747
20803 * omega_e = 0.0
20804 * vol_e = 0.0
20805 * for k in range(dm.shape[1]): # <<<<<<<<<<<<<<
20806 * vol_e += dV[eN,k]
20807 * omega_e += dV[eN,k]*dm[eN,k]
20808*/
20809
20810 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_dm))[1]);
20811 __pyx_t_5 = __pyx_t_4;
20812
20813 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20814 __pyx_v_k = __pyx_t_6;
20815
20816 /* "subsurfaceTransportFunctions.pyx":748
20817 * vol_e = 0.0
20818 * for k in range(dm.shape[1]):
20819 * vol_e += dV[eN,k] # <<<<<<<<<<<<<<
20820 * omega_e += dV[eN,k]*dm[eN,k]
20821 * for k in range(df.shape[1]):
20822*/
20823 __pyx_t_7 = __pyx_v_eN;
20824 __pyx_t_8 = __pyx_v_k;
20825 __pyx_t_9 = -1;
20826 if (__pyx_t_7 < 0) {
20827 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
20828 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
20829 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
20830 if (__pyx_t_8 < 0) {
20831 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
20832 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
20833 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
20834 if (unlikely(__pyx_t_9 != -1)) {
20835 __Pyx_RaiseBufferIndexError(__pyx_t_9);
20836 __PYX_ERR(0, 748, __pyx_L1_error)
20837 }
20838 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
20839
20840 /* "subsurfaceTransportFunctions.pyx":749
20841 * for k in range(dm.shape[1]):
20842 * vol_e += dV[eN,k]
20843 * omega_e += dV[eN,k]*dm[eN,k] # <<<<<<<<<<<<<<
20844 * for k in range(df.shape[1]):
20845 * for I in range(df.shape[2]):
20846*/
20847 __pyx_t_8 = __pyx_v_eN;
20848 __pyx_t_7 = __pyx_v_k;
20849 __pyx_t_9 = -1;
20850 if (__pyx_t_8 < 0) {
20851 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
20852 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
20853 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
20854 if (__pyx_t_7 < 0) {
20855 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
20856 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
20857 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
20858 if (unlikely(__pyx_t_9 != -1)) {
20859 __Pyx_RaiseBufferIndexError(__pyx_t_9);
20860 __PYX_ERR(0, 749, __pyx_L1_error)
20861 }
20862 __pyx_t_10 = __pyx_v_eN;
20863 __pyx_t_11 = __pyx_v_k;
20864 __pyx_t_9 = -1;
20865 if (__pyx_t_10 < 0) {
20866 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
20867 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
20868 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
20869 if (__pyx_t_11 < 0) {
20870 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
20871 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
20872 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
20873 if (unlikely(__pyx_t_9 != -1)) {
20874 __Pyx_RaiseBufferIndexError(__pyx_t_9);
20875 __PYX_ERR(0, 749, __pyx_L1_error)
20876 }
20877 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
20878 }
20879
20880
20881 /* "subsurfaceTransportFunctions.pyx":750
20882 * vol_e += dV[eN,k]
20883 * omega_e += dV[eN,k]*dm[eN,k]
20884 * for k in range(df.shape[1]): # <<<<<<<<<<<<<<
20885 * for I in range(df.shape[2]):
20886 * characteristic_velocity[eN,k,I] = df[eN,k,I]*vol_e/(omega_e+1.0e-12)
20887*/
20888
20889 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_df))[1]);
20890 __pyx_t_5 = __pyx_t_4;
20891
20892 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20893 __pyx_v_k = __pyx_t_6;
20894
20895 /* "subsurfaceTransportFunctions.pyx":751
20896 * omega_e += dV[eN,k]*dm[eN,k]
20897 * for k in range(df.shape[1]):
20898 * for I in range(df.shape[2]): # <<<<<<<<<<<<<<
20899 * characteristic_velocity[eN,k,I] = df[eN,k,I]*vol_e/(omega_e+1.0e-12)
20900 *
20901*/
20902
20903 __pyx_t_12 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_df))[2]);
20904 __pyx_t_13 = __pyx_t_12;
20905
20906 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_13; __pyx_t_9+=1) {
20907 __pyx_v_I = __pyx_t_9;
20908
20909 /* "subsurfaceTransportFunctions.pyx":752
20910 * for k in range(df.shape[1]):
20911 * for I in range(df.shape[2]):
20912 * characteristic_velocity[eN,k,I] = df[eN,k,I]*vol_e/(omega_e+1.0e-12) # <<<<<<<<<<<<<<
20913 *
20914 * def computeSimpleCharacteristicVelocityFromVelocityDOFs(numpy.ndarray[DTYPE_t,ndim=1] df_dofs,
20915*/
20916 __pyx_t_11 = __pyx_v_eN;
20917 __pyx_t_10 = __pyx_v_k;
20918 __pyx_t_7 = __pyx_v_I;
20919 __pyx_t_14 = -1;
20920 if (__pyx_t_11 < 0) {
20921 __pyx_t_11 += __pyx_pybuffernd_df.diminfo[0].shape;
20922 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 0;
20923 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_14 = 0;
20924 if (__pyx_t_10 < 0) {
20925 __pyx_t_10 += __pyx_pybuffernd_df.diminfo[1].shape;
20926 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
20927 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_14 = 1;
20928 if (__pyx_t_7 < 0) {
20929 __pyx_t_7 += __pyx_pybuffernd_df.diminfo[2].shape;
20930 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 2;
20931 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_14 = 2;
20932 if (unlikely(__pyx_t_14 != -1)) {
20933 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20934 __PYX_ERR(0, 752, __pyx_L1_error)
20935 }
20936 __pyx_t_15 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
20937
20938 __pyx_t_16 = (__pyx_v_omega_e + 1.0e-12);
20939
20940 if (unlikely(__pyx_t_16 == 0)) {
20941 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
20942 __PYX_ERR(0, 752, __pyx_L1_error)
20943 }
20944 __pyx_t_7 = __pyx_v_eN;
20945 __pyx_t_10 = __pyx_v_k;
20946 __pyx_t_11 = __pyx_v_I;
20947 __pyx_t_14 = -1;
20948 if (__pyx_t_7 < 0) {
20949 __pyx_t_7 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
20950 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
20951 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_14 = 0;
20952 if (__pyx_t_10 < 0) {
20953 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
20954 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
20955 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_14 = 1;
20956 if (__pyx_t_11 < 0) {
20957 __pyx_t_11 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
20958 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
20959 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_14 = 2;
20960 if (unlikely(__pyx_t_14 != -1)) {
20961 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20962 __PYX_ERR(0, 752, __pyx_L1_error)
20963 }
20964 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_15 / ((__pyx_t_28subsurfaceTransportFunctions_DTYPE_t)__pyx_t_16));
20965
20966
20967 }
20968
20969 }
20970
20971 }
20972
20973
20974 /* "subsurfaceTransportFunctions.pyx":733
20975 * flux[eN,ebN] = integral
20976 *
20977 * def computeSimpleCharacteristicVelocityFromElementVelocity(numpy.ndarray[DTYPE_t,ndim=3] df, # <<<<<<<<<<<<<<
20978 * numpy.ndarray[DTYPE_t,ndim=3] characteristic_velocity,
20979 * numpy.ndarray[DTYPE_t,ndim=2] dm,
20980*/
20981
20982 /* function exit code */
20983 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20984 goto __pyx_L0;
20985 __pyx_L1_error:;
20986 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20987 __Pyx_PyThreadState_declare
20988 __Pyx_PyThreadState_assign
20989 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20990 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
20991 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
20992 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
20993 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
20994 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20995 __Pyx_AddTraceback("subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
20996 __pyx_r = NULL;
20997 goto __pyx_L2;
20998 __pyx_L0:;
20999 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
21000 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
21001 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
21002 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
21003 __pyx_L2:;
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017 __Pyx_XGIVEREF(__pyx_r);
21018 __Pyx_RefNannyFinishContext();
21019 return __pyx_r;
21020}
21021
21022/* "subsurfaceTransportFunctions.pyx":754
21023 * characteristic_velocity[eN,k,I] = df[eN,k,I]*vol_e/(omega_e+1.0e-12)
21024 *
21025 * def computeSimpleCharacteristicVelocityFromVelocityDOFs(numpy.ndarray[DTYPE_t,ndim=1] df_dofs, # <<<<<<<<<<<<<<
21026 * numpy.ndarray[DTYPE_t,ndim=1] characteristic_velocity_dofs,
21027 * numpy.ndarray[ITYPE_t,ndim=2] l2g,
21028*/
21029
21030/* Python wrapper */
21031static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self,
21032#if CYTHON_VECTORCALL
21033PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21034#else
21035PyObject *__pyx_args, PyObject *__pyx_kwds
21036#endif
21037); /*proto*/
21038PyDoc_STRVAR(__pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs, "\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ");
21039static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
21040static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self,
21041#if CYTHON_VECTORCALL
21042PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21043#else
21044PyObject *__pyx_args, PyObject *__pyx_kwds
21045#endif
21046) {
21047 PyArrayObject *__pyx_v_df_dofs = 0;
21048 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
21049 PyArrayObject *__pyx_v_l2g = 0;
21050 PyArrayObject *__pyx_v_dm = 0;
21051 PyArrayObject *__pyx_v_dV = 0;
21052 #if !CYTHON_VECTORCALL
21053 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21054 #endif
21055 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21056 PyObject* values[5] = {0,0,0,0,0};
21057 int __pyx_lineno = 0;
21058 const char *__pyx_filename = NULL;
21059 int __pyx_clineno = 0;
21060 PyObject *__pyx_r = 0;
21061 __Pyx_RefNannyDeclarations
21062 __Pyx_RefNannySetupContext("computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
21063 #if !CYTHON_VECTORCALL
21064 #if CYTHON_ASSUME_SAFE_SIZE
21065 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21066 #else
21067 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21068 #endif
21069 #endif
21070 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21071 {
21072 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_df_dofs,&__pyx_mstate_global->__pyx_n_u_characteristic_velocity_dofs,&__pyx_mstate_global->__pyx_n_u_l2g,&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_dV,0};
21073 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21074 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 754, __pyx_L3_error)
21075 if (__pyx_kwds_len > 0) {
21076 switch (__pyx_nargs) {
21077 case 5:
21078 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21079 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 754, __pyx_L3_error)
21080 CYTHON_FALLTHROUGH;
21081 case 4:
21082 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21083 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 754, __pyx_L3_error)
21084 CYTHON_FALLTHROUGH;
21085 case 3:
21086 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21087 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 754, __pyx_L3_error)
21088 CYTHON_FALLTHROUGH;
21089 case 2:
21090 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21091 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 754, __pyx_L3_error)
21092 CYTHON_FALLTHROUGH;
21093 case 1:
21094 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21095 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 754, __pyx_L3_error)
21096 CYTHON_FALLTHROUGH;
21097 case 0: break;
21098 default: goto __pyx_L5_argtuple_error;
21099 }
21100 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21101 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeSimpleCharacteristicVelocityFromVelocityDOFs", 0) < (0)) __PYX_ERR(0, 754, __pyx_L3_error)
21102 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
21103 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, i); __PYX_ERR(0, 754, __pyx_L3_error) }
21104 }
21105 } else if (unlikely(__pyx_nargs != 5)) {
21106 goto __pyx_L5_argtuple_error;
21107 } else {
21108 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21109 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 754, __pyx_L3_error)
21110 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21111 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 754, __pyx_L3_error)
21112 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21113 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 754, __pyx_L3_error)
21114 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21115 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 754, __pyx_L3_error)
21116 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21117 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 754, __pyx_L3_error)
21118 }
21119 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
21120 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
21121 __pyx_v_l2g = ((PyArrayObject *)values[2]);
21122 __pyx_v_dm = ((PyArrayObject *)values[3]);
21123 __pyx_v_dV = ((PyArrayObject *)values[4]);
21124 }
21125 goto __pyx_L6_skip;
21126 __pyx_L5_argtuple_error:;
21127 __Pyx_RaiseArgtupleInvalid("computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 754, __pyx_L3_error)
21128 __pyx_L6_skip:;
21129 goto __pyx_L4_argument_unpacking_done;
21130 __pyx_L3_error:;
21131 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21132 Py_XDECREF(values[__pyx_temp]);
21133 }
21134 __Pyx_AddTraceback("subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
21135 __Pyx_RefNannyFinishContext();
21136 return NULL;
21137 __pyx_L4_argument_unpacking_done:;
21138 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "df_dofs", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
21139 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "characteristic_velocity_dofs", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
21140 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "l2g", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
21141 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
21142 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dV", 0))) __PYX_ERR(0, 758, __pyx_L1_error)
21143 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
21144
21145 /* function exit code */
21146 goto __pyx_L0;
21147 __pyx_L1_error:;
21148 __pyx_r = NULL;
21149 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21150 Py_XDECREF(values[__pyx_temp]);
21151 }
21152 goto __pyx_L7_cleaned_up;
21153 __pyx_L0:;
21154 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21155 Py_XDECREF(values[__pyx_temp]);
21156 }
21157 __pyx_L7_cleaned_up:;
21158 __Pyx_RefNannyFinishContext();
21159 return __pyx_r;
21160}
21161
21162static 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) {
21163 int __pyx_v_eN;
21164 int __pyx_v_k;
21165 int __pyx_v_j;
21166 int __pyx_v_J;
21167 double __pyx_v_omega_e;
21168 double __pyx_v_vol_e;
21169 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
21170 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
21171 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
21172 __Pyx_Buffer __pyx_pybuffer_dV;
21173 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
21174 __Pyx_Buffer __pyx_pybuffer_df_dofs;
21175 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
21176 __Pyx_Buffer __pyx_pybuffer_dm;
21177 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
21178 __Pyx_Buffer __pyx_pybuffer_l2g;
21179 PyObject *__pyx_r = NULL;
21180 __Pyx_RefNannyDeclarations
21181 npy_intp __pyx_t_1;
21182 npy_intp __pyx_t_2;
21183 int __pyx_t_3;
21184 npy_intp __pyx_t_4;
21185 npy_intp __pyx_t_5;
21186 int __pyx_t_6;
21187 Py_ssize_t __pyx_t_7;
21188 Py_ssize_t __pyx_t_8;
21189 int __pyx_t_9;
21190 Py_ssize_t __pyx_t_10;
21191 Py_ssize_t __pyx_t_11;
21192 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_12;
21193 double __pyx_t_13;
21194 int __pyx_lineno = 0;
21195 const char *__pyx_filename = NULL;
21196 int __pyx_clineno = 0;
21197 __Pyx_RefNannySetupContext("computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
21198 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
21199 __pyx_pybuffer_df_dofs.refcount = 0;
21200 __pyx_pybuffernd_df_dofs.data = NULL;
21201 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
21202 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
21203 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
21204 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
21205 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
21206 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
21207 __pyx_pybuffer_l2g.refcount = 0;
21208 __pyx_pybuffernd_l2g.data = NULL;
21209 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
21210 __pyx_pybuffer_dm.pybuffer.buf = NULL;
21211 __pyx_pybuffer_dm.refcount = 0;
21212 __pyx_pybuffernd_dm.data = NULL;
21213 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
21214 __pyx_pybuffer_dV.pybuffer.buf = NULL;
21215 __pyx_pybuffer_dV.refcount = 0;
21216 __pyx_pybuffernd_dV.data = NULL;
21217 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
21218 {
21219 __Pyx_BufFmt_StackElem __pyx_stack[1];
21220 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 754, __pyx_L1_error)
21221 }
21222 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
21223 {
21224 __Pyx_BufFmt_StackElem __pyx_stack[1];
21225 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 754, __pyx_L1_error)
21226 }
21227 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
21228 {
21229 __Pyx_BufFmt_StackElem __pyx_stack[1];
21230 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 754, __pyx_L1_error)
21231 }
21232 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
21233 {
21234 __Pyx_BufFmt_StackElem __pyx_stack[1];
21235 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 754, __pyx_L1_error)
21236 }
21237 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
21238 {
21239 __Pyx_BufFmt_StackElem __pyx_stack[1];
21240 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 754, __pyx_L1_error)
21241 }
21242 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
21243
21244 /* "subsurfaceTransportFunctions.pyx":766
21245 * cdef double omega_e, vol_e
21246 *
21247 * for eN in range(dm.shape[0]): # <<<<<<<<<<<<<<
21248 * omega_e = 0.0
21249 * vol_e = 0.0
21250*/
21251
21252 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_dm))[0]);
21253 __pyx_t_2 = __pyx_t_1;
21254
21255 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21256 __pyx_v_eN = __pyx_t_3;
21257
21258 /* "subsurfaceTransportFunctions.pyx":767
21259 *
21260 * for eN in range(dm.shape[0]):
21261 * omega_e = 0.0 # <<<<<<<<<<<<<<
21262 * vol_e = 0.0
21263 * for k in range(dm.shape[1]):
21264*/
21265 __pyx_v_omega_e = 0.0;
21266
21267 /* "subsurfaceTransportFunctions.pyx":768
21268 * for eN in range(dm.shape[0]):
21269 * omega_e = 0.0
21270 * vol_e = 0.0 # <<<<<<<<<<<<<<
21271 * for k in range(dm.shape[1]):
21272 * vol_e += dV[eN,k]
21273*/
21274 __pyx_v_vol_e = 0.0;
21275
21276 /* "subsurfaceTransportFunctions.pyx":769
21277 * omega_e = 0.0
21278 * vol_e = 0.0
21279 * for k in range(dm.shape[1]): # <<<<<<<<<<<<<<
21280 * vol_e += dV[eN,k]
21281 * omega_e += dV[eN,k]*dm[eN,k]
21282*/
21283
21284 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_dm))[1]);
21285 __pyx_t_5 = __pyx_t_4;
21286
21287 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21288 __pyx_v_k = __pyx_t_6;
21289
21290 /* "subsurfaceTransportFunctions.pyx":770
21291 * vol_e = 0.0
21292 * for k in range(dm.shape[1]):
21293 * vol_e += dV[eN,k] # <<<<<<<<<<<<<<
21294 * omega_e += dV[eN,k]*dm[eN,k]
21295 * for j in range(l2g.shape[1]):
21296*/
21297 __pyx_t_7 = __pyx_v_eN;
21298 __pyx_t_8 = __pyx_v_k;
21299 __pyx_t_9 = -1;
21300 if (__pyx_t_7 < 0) {
21301 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
21302 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
21303 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
21304 if (__pyx_t_8 < 0) {
21305 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
21306 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
21307 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
21308 if (unlikely(__pyx_t_9 != -1)) {
21309 __Pyx_RaiseBufferIndexError(__pyx_t_9);
21310 __PYX_ERR(0, 770, __pyx_L1_error)
21311 }
21312 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
21313
21314 /* "subsurfaceTransportFunctions.pyx":771
21315 * for k in range(dm.shape[1]):
21316 * vol_e += dV[eN,k]
21317 * omega_e += dV[eN,k]*dm[eN,k] # <<<<<<<<<<<<<<
21318 * for j in range(l2g.shape[1]):
21319 * J = l2g[eN,j]
21320*/
21321 __pyx_t_8 = __pyx_v_eN;
21322 __pyx_t_7 = __pyx_v_k;
21323 __pyx_t_9 = -1;
21324 if (__pyx_t_8 < 0) {
21325 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
21326 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
21327 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
21328 if (__pyx_t_7 < 0) {
21329 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
21330 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
21331 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
21332 if (unlikely(__pyx_t_9 != -1)) {
21333 __Pyx_RaiseBufferIndexError(__pyx_t_9);
21334 __PYX_ERR(0, 771, __pyx_L1_error)
21335 }
21336 __pyx_t_10 = __pyx_v_eN;
21337 __pyx_t_11 = __pyx_v_k;
21338 __pyx_t_9 = -1;
21339 if (__pyx_t_10 < 0) {
21340 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
21341 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
21342 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
21343 if (__pyx_t_11 < 0) {
21344 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
21345 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
21346 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
21347 if (unlikely(__pyx_t_9 != -1)) {
21348 __Pyx_RaiseBufferIndexError(__pyx_t_9);
21349 __PYX_ERR(0, 771, __pyx_L1_error)
21350 }
21351 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
21352 }
21353
21354
21355 /* "subsurfaceTransportFunctions.pyx":772
21356 * vol_e += dV[eN,k]
21357 * omega_e += dV[eN,k]*dm[eN,k]
21358 * for j in range(l2g.shape[1]): # <<<<<<<<<<<<<<
21359 * J = l2g[eN,j]
21360 * characteristic_velocity_dofs[J] = df_dofs[J]*vol_e/(omega_e+1.0e-12)
21361*/
21362
21363 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_l2g))[1]);
21364 __pyx_t_5 = __pyx_t_4;
21365
21366 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21367 __pyx_v_j = __pyx_t_6;
21368
21369 /* "subsurfaceTransportFunctions.pyx":773
21370 * omega_e += dV[eN,k]*dm[eN,k]
21371 * for j in range(l2g.shape[1]):
21372 * J = l2g[eN,j] # <<<<<<<<<<<<<<
21373 * characteristic_velocity_dofs[J] = df_dofs[J]*vol_e/(omega_e+1.0e-12)
21374 *
21375*/
21376 __pyx_t_11 = __pyx_v_eN;
21377 __pyx_t_10 = __pyx_v_j;
21378 __pyx_t_9 = -1;
21379 if (__pyx_t_11 < 0) {
21380 __pyx_t_11 += __pyx_pybuffernd_l2g.diminfo[0].shape;
21381 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
21382 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_9 = 0;
21383 if (__pyx_t_10 < 0) {
21384 __pyx_t_10 += __pyx_pybuffernd_l2g.diminfo[1].shape;
21385 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
21386 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_9 = 1;
21387 if (unlikely(__pyx_t_9 != -1)) {
21388 __Pyx_RaiseBufferIndexError(__pyx_t_9);
21389 __PYX_ERR(0, 773, __pyx_L1_error)
21390 }
21391 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_l2g.diminfo[1].strides));
21392
21393 /* "subsurfaceTransportFunctions.pyx":774
21394 * for j in range(l2g.shape[1]):
21395 * J = l2g[eN,j]
21396 * characteristic_velocity_dofs[J] = df_dofs[J]*vol_e/(omega_e+1.0e-12) # <<<<<<<<<<<<<<
21397 *
21398 * #problem specific velocity evaluation
21399*/
21400 __pyx_t_10 = __pyx_v_J;
21401 __pyx_t_9 = -1;
21402 if (__pyx_t_10 < 0) {
21403 __pyx_t_10 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
21404 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
21405 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
21406 if (unlikely(__pyx_t_9 != -1)) {
21407 __Pyx_RaiseBufferIndexError(__pyx_t_9);
21408 __PYX_ERR(0, 774, __pyx_L1_error)
21409 }
21410 __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
21411
21412 __pyx_t_13 = (__pyx_v_omega_e + 1.0e-12);
21413
21414 if (unlikely(__pyx_t_13 == 0)) {
21415 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
21416 __PYX_ERR(0, 774, __pyx_L1_error)
21417 }
21418 __pyx_t_10 = __pyx_v_J;
21419 __pyx_t_9 = -1;
21420 if (__pyx_t_10 < 0) {
21421 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
21422 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
21423 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
21424 if (unlikely(__pyx_t_9 != -1)) {
21425 __Pyx_RaiseBufferIndexError(__pyx_t_9);
21426 __PYX_ERR(0, 774, __pyx_L1_error)
21427 }
21428 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_12 / ((__pyx_t_28subsurfaceTransportFunctions_DTYPE_t)__pyx_t_13));
21429
21430
21431 }
21432
21433 }
21434
21435
21436 /* "subsurfaceTransportFunctions.pyx":754
21437 * characteristic_velocity[eN,k,I] = df[eN,k,I]*vol_e/(omega_e+1.0e-12)
21438 *
21439 * def computeSimpleCharacteristicVelocityFromVelocityDOFs(numpy.ndarray[DTYPE_t,ndim=1] df_dofs, # <<<<<<<<<<<<<<
21440 * numpy.ndarray[DTYPE_t,ndim=1] characteristic_velocity_dofs,
21441 * numpy.ndarray[ITYPE_t,ndim=2] l2g,
21442*/
21443
21444 /* function exit code */
21445 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21446 goto __pyx_L0;
21447 __pyx_L1_error:;
21448 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
21449 __Pyx_PyThreadState_declare
21450 __Pyx_PyThreadState_assign
21451 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
21452 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
21453 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
21454 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
21455 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
21456 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
21457 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
21458 __Pyx_AddTraceback("subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
21459 __pyx_r = NULL;
21460 goto __pyx_L2;
21461 __pyx_L0:;
21462 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
21463 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
21464 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
21465 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
21466 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
21467 __pyx_L2:;
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484 __Pyx_XGIVEREF(__pyx_r);
21485 __Pyx_RefNannyFinishContext();
21486 return __pyx_r;
21487}
21488
21489/* "subsurfaceTransportFunctions.pyx":777
21490 *
21491 * #problem specific velocity evaluation
21492 * def rotatingGaussianElementVelocityEval3(int transient, # <<<<<<<<<<<<<<
21493 * double t,
21494 * double tForReversal,
21495*/
21496
21497/* Python wrapper */
21498static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self,
21499#if CYTHON_VECTORCALL
21500PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21501#else
21502PyObject *__pyx_args, PyObject *__pyx_kwds
21503#endif
21504); /*proto*/
21505static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {"rotatingGaussianElementVelocityEval3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21506static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self,
21507#if CYTHON_VECTORCALL
21508PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21509#else
21510PyObject *__pyx_args, PyObject *__pyx_kwds
21511#endif
21512) {
21513 int __pyx_v_transient;
21514 double __pyx_v_t;
21515 double __pyx_v_tForReversal;
21516 double __pyx_v_clock;
21517 double __pyx_v_xc;
21518 double __pyx_v_yc;
21519 PyArrayObject *__pyx_v_x = 0;
21520 PyArrayObject *__pyx_v_v = 0;
21521 double __pyx_v_zvelocity;
21522 #if !CYTHON_VECTORCALL
21523 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21524 #endif
21525 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21526 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
21527 int __pyx_lineno = 0;
21528 const char *__pyx_filename = NULL;
21529 int __pyx_clineno = 0;
21530 PyObject *__pyx_r = 0;
21531 __Pyx_RefNannyDeclarations
21532 __Pyx_RefNannySetupContext("rotatingGaussianElementVelocityEval3 (wrapper)", 0);
21533 #if !CYTHON_VECTORCALL
21534 #if CYTHON_ASSUME_SAFE_SIZE
21535 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21536 #else
21537 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21538 #endif
21539 #endif
21540 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21541 {
21542 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_transient,&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_tForReversal,&__pyx_mstate_global->__pyx_n_u_clock,&__pyx_mstate_global->__pyx_n_u_xc,&__pyx_mstate_global->__pyx_n_u_yc,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_zvelocity,0};
21543 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21544 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 777, __pyx_L3_error)
21545 if (__pyx_kwds_len > 0) {
21546 switch (__pyx_nargs) {
21547 case 9:
21548 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21549 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 777, __pyx_L3_error)
21550 CYTHON_FALLTHROUGH;
21551 case 8:
21552 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21553 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 777, __pyx_L3_error)
21554 CYTHON_FALLTHROUGH;
21555 case 7:
21556 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21557 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 777, __pyx_L3_error)
21558 CYTHON_FALLTHROUGH;
21559 case 6:
21560 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21561 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 777, __pyx_L3_error)
21562 CYTHON_FALLTHROUGH;
21563 case 5:
21564 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21565 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 777, __pyx_L3_error)
21566 CYTHON_FALLTHROUGH;
21567 case 4:
21568 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21569 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 777, __pyx_L3_error)
21570 CYTHON_FALLTHROUGH;
21571 case 3:
21572 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21573 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 777, __pyx_L3_error)
21574 CYTHON_FALLTHROUGH;
21575 case 2:
21576 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21577 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 777, __pyx_L3_error)
21578 CYTHON_FALLTHROUGH;
21579 case 1:
21580 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21581 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 777, __pyx_L3_error)
21582 CYTHON_FALLTHROUGH;
21583 case 0: break;
21584 default: goto __pyx_L5_argtuple_error;
21585 }
21586 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21587 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "rotatingGaussianElementVelocityEval3", 0) < (0)) __PYX_ERR(0, 777, __pyx_L3_error)
21588 for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
21589 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("rotatingGaussianElementVelocityEval3", 0, 8, 9, i); __PYX_ERR(0, 777, __pyx_L3_error) }
21590 }
21591 } else {
21592 switch (__pyx_nargs) {
21593 case 9:
21594 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21595 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 777, __pyx_L3_error)
21596 CYTHON_FALLTHROUGH;
21597 case 8:
21598 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21599 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 777, __pyx_L3_error)
21600 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21601 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 777, __pyx_L3_error)
21602 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21603 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 777, __pyx_L3_error)
21604 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21605 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 777, __pyx_L3_error)
21606 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21607 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 777, __pyx_L3_error)
21608 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21609 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 777, __pyx_L3_error)
21610 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21611 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 777, __pyx_L3_error)
21612 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21613 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 777, __pyx_L3_error)
21614 break;
21615 default: goto __pyx_L5_argtuple_error;
21616 }
21617 }
21618 __pyx_v_transient = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_transient == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
21619 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error)
21620 __pyx_v_tForReversal = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_tForReversal == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error)
21621 __pyx_v_clock = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_clock == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
21622 __pyx_v_xc = __Pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_xc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error)
21623 __pyx_v_yc = __Pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L3_error)
21624 __pyx_v_x = ((PyArrayObject *)values[6]);
21625 __pyx_v_v = ((PyArrayObject *)values[7]);
21626 if (values[8]) {
21627 __pyx_v_zvelocity = __Pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_zvelocity == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 784, __pyx_L3_error)
21628 } else {
21629 __pyx_v_zvelocity = ((double)((double)0.0));
21630 }
21631 }
21632 goto __pyx_L6_skip;
21633 __pyx_L5_argtuple_error:;
21634 __Pyx_RaiseArgtupleInvalid("rotatingGaussianElementVelocityEval3", 0, 8, 9, __pyx_nargs); __PYX_ERR(0, 777, __pyx_L3_error)
21635 __pyx_L6_skip:;
21636 goto __pyx_L4_argument_unpacking_done;
21637 __pyx_L3_error:;
21638 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21639 Py_XDECREF(values[__pyx_temp]);
21640 }
21641 __Pyx_AddTraceback("subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
21642 __Pyx_RefNannyFinishContext();
21643 return NULL;
21644 __pyx_L4_argument_unpacking_done:;
21645 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 782, __pyx_L1_error)
21646 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 783, __pyx_L1_error)
21647 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
21648
21649 /* function exit code */
21650 goto __pyx_L0;
21651 __pyx_L1_error:;
21652 __pyx_r = NULL;
21653 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21654 Py_XDECREF(values[__pyx_temp]);
21655 }
21656 goto __pyx_L7_cleaned_up;
21657 __pyx_L0:;
21658 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21659 Py_XDECREF(values[__pyx_temp]);
21660 }
21661 __pyx_L7_cleaned_up:;
21662
21663
21664
21665
21666
21667
21668
21669 __Pyx_RefNannyFinishContext();
21670 return __pyx_r;
21671}
21672
21673static 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) {
21674 int __pyx_v_eN;
21675 int __pyx_v_k;
21676 double __pyx_v_pi;
21677 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
21678 __Pyx_Buffer __pyx_pybuffer_v;
21679 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
21680 __Pyx_Buffer __pyx_pybuffer_x;
21681 PyObject *__pyx_r = NULL;
21682 __Pyx_RefNannyDeclarations
21683 int __pyx_t_1;
21684 npy_intp __pyx_t_2;
21685 npy_intp __pyx_t_3;
21686 int __pyx_t_4;
21687 npy_intp __pyx_t_5;
21688 npy_intp __pyx_t_6;
21689 int __pyx_t_7;
21690 Py_ssize_t __pyx_t_8;
21691 Py_ssize_t __pyx_t_9;
21692 Py_ssize_t __pyx_t_10;
21693 int __pyx_t_11;
21694 Py_ssize_t __pyx_t_12;
21695 Py_ssize_t __pyx_t_13;
21696 Py_ssize_t __pyx_t_14;
21697 PyObject *__pyx_t_15 = NULL;
21698 PyObject *__pyx_t_16 = NULL;
21699 PyObject *__pyx_t_17 = NULL;
21700 double __pyx_t_18;
21701 double __pyx_t_19;
21702 PyObject *__pyx_t_20 = NULL;
21703 int __pyx_lineno = 0;
21704 const char *__pyx_filename = NULL;
21705 int __pyx_clineno = 0;
21706 __Pyx_RefNannySetupContext("rotatingGaussianElementVelocityEval3", 0);
21707 __pyx_pybuffer_x.pybuffer.buf = NULL;
21708 __pyx_pybuffer_x.refcount = 0;
21709 __pyx_pybuffernd_x.data = NULL;
21710 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
21711 __pyx_pybuffer_v.pybuffer.buf = NULL;
21712 __pyx_pybuffer_v.refcount = 0;
21713 __pyx_pybuffernd_v.data = NULL;
21714 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
21715 {
21716 __Pyx_BufFmt_StackElem __pyx_stack[1];
21717 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, 777, __pyx_L1_error)
21718 }
21719 __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];
21720 {
21721 __Pyx_BufFmt_StackElem __pyx_stack[1];
21722 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 777, __pyx_L1_error)
21723 }
21724 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
21725
21726 /* "subsurfaceTransportFunctions.pyx":787
21727 * cdef int eN,k
21728 * cdef double pi
21729 * pi = M_PI # <<<<<<<<<<<<<<
21730 * if v.shape[2] == 3:
21731 * if transient == 1:
21732*/
21733 __pyx_v_pi = M_PI;
21734
21735 /* "subsurfaceTransportFunctions.pyx":788
21736 * cdef double pi
21737 * pi = M_PI
21738 * if v.shape[2] == 3: # <<<<<<<<<<<<<<
21739 * if transient == 1:
21740 * for eN in range(x.shape[0]):
21741*/
21742 __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_v))[2]) == 3);
21743
21744 if (__pyx_t_1) {
21745
21746
21747 /* "subsurfaceTransportFunctions.pyx":789
21748 * pi = M_PI
21749 * if v.shape[2] == 3:
21750 * if transient == 1: # <<<<<<<<<<<<<<
21751 * for eN in range(x.shape[0]):
21752 * for k in range(x.shape[1]):
21753*/
21754 __pyx_t_1 = (__pyx_v_transient == 1);
21755
21756 if (__pyx_t_1) {
21757
21758
21759 /* "subsurfaceTransportFunctions.pyx":790
21760 * if v.shape[2] == 3:
21761 * if transient == 1:
21762 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
21763 * for k in range(x.shape[1]):
21764 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
21765*/
21766
21767 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
21768 __pyx_t_3 = __pyx_t_2;
21769
21770 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21771 __pyx_v_eN = __pyx_t_4;
21772
21773 /* "subsurfaceTransportFunctions.pyx":791
21774 * if transient == 1:
21775 * for eN in range(x.shape[0]):
21776 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
21777 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
21778 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
21779*/
21780
21781 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
21782 __pyx_t_6 = __pyx_t_5;
21783
21784 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
21785 __pyx_v_k = __pyx_t_7;
21786
21787 /* "subsurfaceTransportFunctions.pyx":792
21788 * for eN in range(x.shape[0]):
21789 * for k in range(x.shape[1]):
21790 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc) # <<<<<<<<<<<<<<
21791 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
21792 * v[eN,k,2]=zvelocity
21793*/
21794 __pyx_t_8 = __pyx_v_eN;
21795 __pyx_t_9 = __pyx_v_k;
21796 __pyx_t_10 = 1;
21797 __pyx_t_11 = -1;
21798 if (__pyx_t_8 < 0) {
21799 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
21800 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
21801 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
21802 if (__pyx_t_9 < 0) {
21803 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
21804 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
21805 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
21806 if (__pyx_t_10 < 0) {
21807 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
21808 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
21809 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
21810 if (unlikely(__pyx_t_11 != -1)) {
21811 __Pyx_RaiseBufferIndexError(__pyx_t_11);
21812 __PYX_ERR(0, 792, __pyx_L1_error)
21813 }
21814 __pyx_t_12 = __pyx_v_eN;
21815 __pyx_t_13 = __pyx_v_k;
21816 __pyx_t_14 = 0;
21817 __pyx_t_11 = -1;
21818 if (__pyx_t_12 < 0) {
21819 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
21820 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
21821 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
21822 if (__pyx_t_13 < 0) {
21823 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
21824 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
21825 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
21826 if (__pyx_t_14 < 0) {
21827 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
21828 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
21829 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
21830 if (unlikely(__pyx_t_11 != -1)) {
21831 __Pyx_RaiseBufferIndexError(__pyx_t_11);
21832 __PYX_ERR(0, 792, __pyx_L1_error)
21833 }
21834 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
21835
21836 /* "subsurfaceTransportFunctions.pyx":793
21837 * for k in range(x.shape[1]):
21838 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
21839 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0]) # <<<<<<<<<<<<<<
21840 * v[eN,k,2]=zvelocity
21841 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
21842*/
21843 __pyx_t_10 = __pyx_v_eN;
21844 __pyx_t_9 = __pyx_v_k;
21845 __pyx_t_8 = 0;
21846 __pyx_t_11 = -1;
21847 if (__pyx_t_10 < 0) {
21848 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
21849 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
21850 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
21851 if (__pyx_t_9 < 0) {
21852 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
21853 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
21854 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
21855 if (__pyx_t_8 < 0) {
21856 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
21857 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
21858 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
21859 if (unlikely(__pyx_t_11 != -1)) {
21860 __Pyx_RaiseBufferIndexError(__pyx_t_11);
21861 __PYX_ERR(0, 793, __pyx_L1_error)
21862 }
21863 __pyx_t_14 = __pyx_v_eN;
21864 __pyx_t_13 = __pyx_v_k;
21865 __pyx_t_12 = 1;
21866 __pyx_t_11 = -1;
21867 if (__pyx_t_14 < 0) {
21868 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
21869 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
21870 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
21871 if (__pyx_t_13 < 0) {
21872 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
21873 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
21874 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
21875 if (__pyx_t_12 < 0) {
21876 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
21877 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
21878 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
21879 if (unlikely(__pyx_t_11 != -1)) {
21880 __Pyx_RaiseBufferIndexError(__pyx_t_11);
21881 __PYX_ERR(0, 793, __pyx_L1_error)
21882 }
21883 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
21884
21885 /* "subsurfaceTransportFunctions.pyx":794
21886 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
21887 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
21888 * v[eN,k,2]=zvelocity # <<<<<<<<<<<<<<
21889 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
21890 * else:
21891*/
21892 __pyx_t_8 = __pyx_v_eN;
21893 __pyx_t_9 = __pyx_v_k;
21894 __pyx_t_10 = 2;
21895 __pyx_t_11 = -1;
21896 if (__pyx_t_8 < 0) {
21897 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
21898 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
21899 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
21900 if (__pyx_t_9 < 0) {
21901 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
21902 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
21903 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
21904 if (__pyx_t_10 < 0) {
21905 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
21906 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
21907 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
21908 if (unlikely(__pyx_t_11 != -1)) {
21909 __Pyx_RaiseBufferIndexError(__pyx_t_11);
21910 __PYX_ERR(0, 794, __pyx_L1_error)
21911 }
21912 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
21913
21914 /* "subsurfaceTransportFunctions.pyx":795
21915 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
21916 * v[eN,k,2]=zvelocity
21917 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock # <<<<<<<<<<<<<<
21918 * else:
21919 * for eN in range(x.shape[0]):
21920*/
21921 __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 795, __pyx_L1_error)
21922 __Pyx_GOTREF(__pyx_t_15);
21923 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 795, __pyx_L1_error)
21924 __Pyx_GOTREF(__pyx_t_16);
21925 __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 795, __pyx_L1_error)
21926 __Pyx_GOTREF(__pyx_t_17);
21927 __Pyx_GIVEREF(__pyx_t_15);
21928 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15) != (0)) __PYX_ERR(0, 795, __pyx_L1_error);
21929 __Pyx_GIVEREF(__pyx_t_16);
21930 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 795, __pyx_L1_error);
21931 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
21932 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
21933 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 795, __pyx_L1_error);
21934 __pyx_t_15 = 0;
21935 __pyx_t_16 = 0;
21936 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 795, __pyx_L1_error)
21937 __Pyx_GOTREF(__pyx_t_16);
21938 __pyx_t_18 = (__pyx_v_tForReversal - __pyx_v_t);
21939
21940 __pyx_t_19 = (__pyx_v_tForReversal - 0.0);
21941
21942 if (unlikely(__pyx_t_19 == 0)) {
21943 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
21944 __PYX_ERR(0, 795, __pyx_L1_error)
21945 }
21946 __pyx_t_15 = PyFloat_FromDouble(((__pyx_t_18 / __pyx_t_19) * __pyx_v_clock)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 795, __pyx_L1_error)
21947 __Pyx_GOTREF(__pyx_t_15);
21948
21949
21950 __pyx_t_20 = __Pyx_PyNumber_InPlaceMultiply_object_float(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 795, __pyx_L1_error)
21951 __Pyx_GOTREF(__pyx_t_20);
21952 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
21953 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
21954 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0))) __PYX_ERR(0, 795, __pyx_L1_error)
21955 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
21956 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
21957 }
21958
21959 }
21960
21961
21962 /* "subsurfaceTransportFunctions.pyx":789
21963 * pi = M_PI
21964 * if v.shape[2] == 3:
21965 * if transient == 1: # <<<<<<<<<<<<<<
21966 * for eN in range(x.shape[0]):
21967 * for k in range(x.shape[1]):
21968*/
21969 goto __pyx_L4;
21970 }
21971
21972 /* "subsurfaceTransportFunctions.pyx":797
21973 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
21974 * else:
21975 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
21976 * for k in range(x.shape[1]):
21977 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
21978*/
21979 /*else*/ {
21980
21981 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
21982 __pyx_t_3 = __pyx_t_2;
21983
21984 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21985 __pyx_v_eN = __pyx_t_4;
21986
21987 /* "subsurfaceTransportFunctions.pyx":798
21988 * else:
21989 * for eN in range(x.shape[0]):
21990 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
21991 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
21992 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
21993*/
21994
21995 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
21996 __pyx_t_6 = __pyx_t_5;
21997
21998 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
21999 __pyx_v_k = __pyx_t_7;
22000
22001 /* "subsurfaceTransportFunctions.pyx":799
22002 * for eN in range(x.shape[0]):
22003 * for k in range(x.shape[1]):
22004 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc) # <<<<<<<<<<<<<<
22005 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
22006 * v[eN,k,2]=zvelocity
22007*/
22008 __pyx_t_10 = __pyx_v_eN;
22009 __pyx_t_9 = __pyx_v_k;
22010 __pyx_t_8 = 1;
22011 __pyx_t_11 = -1;
22012 if (__pyx_t_10 < 0) {
22013 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
22014 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
22015 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
22016 if (__pyx_t_9 < 0) {
22017 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
22018 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
22019 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
22020 if (__pyx_t_8 < 0) {
22021 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
22022 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
22023 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
22024 if (unlikely(__pyx_t_11 != -1)) {
22025 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22026 __PYX_ERR(0, 799, __pyx_L1_error)
22027 }
22028 __pyx_t_12 = __pyx_v_eN;
22029 __pyx_t_13 = __pyx_v_k;
22030 __pyx_t_14 = 0;
22031 __pyx_t_11 = -1;
22032 if (__pyx_t_12 < 0) {
22033 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
22034 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
22035 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
22036 if (__pyx_t_13 < 0) {
22037 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
22038 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
22039 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
22040 if (__pyx_t_14 < 0) {
22041 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
22042 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
22043 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
22044 if (unlikely(__pyx_t_11 != -1)) {
22045 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22046 __PYX_ERR(0, 799, __pyx_L1_error)
22047 }
22048 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
22049
22050 /* "subsurfaceTransportFunctions.pyx":800
22051 * for k in range(x.shape[1]):
22052 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22053 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0]) # <<<<<<<<<<<<<<
22054 * v[eN,k,2]=zvelocity
22055 * else:
22056*/
22057 __pyx_t_8 = __pyx_v_eN;
22058 __pyx_t_9 = __pyx_v_k;
22059 __pyx_t_10 = 0;
22060 __pyx_t_11 = -1;
22061 if (__pyx_t_8 < 0) {
22062 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
22063 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
22064 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
22065 if (__pyx_t_9 < 0) {
22066 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
22067 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
22068 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
22069 if (__pyx_t_10 < 0) {
22070 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
22071 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
22072 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
22073 if (unlikely(__pyx_t_11 != -1)) {
22074 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22075 __PYX_ERR(0, 800, __pyx_L1_error)
22076 }
22077 __pyx_t_14 = __pyx_v_eN;
22078 __pyx_t_13 = __pyx_v_k;
22079 __pyx_t_12 = 1;
22080 __pyx_t_11 = -1;
22081 if (__pyx_t_14 < 0) {
22082 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
22083 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
22084 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
22085 if (__pyx_t_13 < 0) {
22086 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
22087 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
22088 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
22089 if (__pyx_t_12 < 0) {
22090 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
22091 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
22092 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
22093 if (unlikely(__pyx_t_11 != -1)) {
22094 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22095 __PYX_ERR(0, 800, __pyx_L1_error)
22096 }
22097 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
22098
22099 /* "subsurfaceTransportFunctions.pyx":801
22100 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22101 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
22102 * v[eN,k,2]=zvelocity # <<<<<<<<<<<<<<
22103 * else:
22104 * assert v.shape[2] == 2
22105*/
22106 __pyx_t_10 = __pyx_v_eN;
22107 __pyx_t_9 = __pyx_v_k;
22108 __pyx_t_8 = 2;
22109 __pyx_t_11 = -1;
22110 if (__pyx_t_10 < 0) {
22111 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
22112 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
22113 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
22114 if (__pyx_t_9 < 0) {
22115 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
22116 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
22117 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
22118 if (__pyx_t_8 < 0) {
22119 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
22120 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
22121 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
22122 if (unlikely(__pyx_t_11 != -1)) {
22123 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22124 __PYX_ERR(0, 801, __pyx_L1_error)
22125 }
22126 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
22127 }
22128
22129 }
22130
22131 }
22132 __pyx_L4:;
22133
22134 /* "subsurfaceTransportFunctions.pyx":788
22135 * cdef double pi
22136 * pi = M_PI
22137 * if v.shape[2] == 3: # <<<<<<<<<<<<<<
22138 * if transient == 1:
22139 * for eN in range(x.shape[0]):
22140*/
22141 goto __pyx_L3;
22142 }
22143
22144 /* "subsurfaceTransportFunctions.pyx":803
22145 * v[eN,k,2]=zvelocity
22146 * else:
22147 * assert v.shape[2] == 2 # <<<<<<<<<<<<<<
22148 * if transient == 1:
22149 * for eN in range(x.shape[0]):
22150*/
22151 /*else*/ {
22152 #ifndef CYTHON_WITHOUT_ASSERTIONS
22153 if (unlikely(__pyx_assertions_enabled())) {
22154 __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_v))[2]) == 2);
22155
22156 if (unlikely(!__pyx_t_1)) {
22157 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22158 __PYX_ERR(0, 803, __pyx_L1_error)
22159 }
22160
22161 }
22162 #else
22163 if ((1)); else __PYX_ERR(0, 803, __pyx_L1_error)
22164 #endif
22165
22166 /* "subsurfaceTransportFunctions.pyx":804
22167 * else:
22168 * assert v.shape[2] == 2
22169 * if transient == 1: # <<<<<<<<<<<<<<
22170 * for eN in range(x.shape[0]):
22171 * for k in range(x.shape[1]):
22172*/
22173 __pyx_t_1 = (__pyx_v_transient == 1);
22174
22175 if (__pyx_t_1) {
22176
22177
22178 /* "subsurfaceTransportFunctions.pyx":805
22179 * assert v.shape[2] == 2
22180 * if transient == 1:
22181 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
22182 * for k in range(x.shape[1]):
22183 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22184*/
22185
22186 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
22187 __pyx_t_3 = __pyx_t_2;
22188
22189 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22190 __pyx_v_eN = __pyx_t_4;
22191
22192 /* "subsurfaceTransportFunctions.pyx":806
22193 * if transient == 1:
22194 * for eN in range(x.shape[0]):
22195 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
22196 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22197 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
22198*/
22199
22200 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
22201 __pyx_t_6 = __pyx_t_5;
22202
22203 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
22204 __pyx_v_k = __pyx_t_7;
22205
22206 /* "subsurfaceTransportFunctions.pyx":807
22207 * for eN in range(x.shape[0]):
22208 * for k in range(x.shape[1]):
22209 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc) # <<<<<<<<<<<<<<
22210 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
22211 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
22212*/
22213 __pyx_t_8 = __pyx_v_eN;
22214 __pyx_t_9 = __pyx_v_k;
22215 __pyx_t_10 = 1;
22216 __pyx_t_11 = -1;
22217 if (__pyx_t_8 < 0) {
22218 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
22219 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
22220 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
22221 if (__pyx_t_9 < 0) {
22222 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
22223 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
22224 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
22225 if (__pyx_t_10 < 0) {
22226 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
22227 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
22228 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
22229 if (unlikely(__pyx_t_11 != -1)) {
22230 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22231 __PYX_ERR(0, 807, __pyx_L1_error)
22232 }
22233 __pyx_t_12 = __pyx_v_eN;
22234 __pyx_t_13 = __pyx_v_k;
22235 __pyx_t_14 = 0;
22236 __pyx_t_11 = -1;
22237 if (__pyx_t_12 < 0) {
22238 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
22239 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
22240 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
22241 if (__pyx_t_13 < 0) {
22242 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
22243 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
22244 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
22245 if (__pyx_t_14 < 0) {
22246 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
22247 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
22248 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
22249 if (unlikely(__pyx_t_11 != -1)) {
22250 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22251 __PYX_ERR(0, 807, __pyx_L1_error)
22252 }
22253 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
22254
22255 /* "subsurfaceTransportFunctions.pyx":808
22256 * for k in range(x.shape[1]):
22257 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22258 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0]) # <<<<<<<<<<<<<<
22259 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
22260 * else:
22261*/
22262 __pyx_t_10 = __pyx_v_eN;
22263 __pyx_t_9 = __pyx_v_k;
22264 __pyx_t_8 = 0;
22265 __pyx_t_11 = -1;
22266 if (__pyx_t_10 < 0) {
22267 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
22268 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
22269 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
22270 if (__pyx_t_9 < 0) {
22271 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
22272 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
22273 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
22274 if (__pyx_t_8 < 0) {
22275 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
22276 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
22277 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
22278 if (unlikely(__pyx_t_11 != -1)) {
22279 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22280 __PYX_ERR(0, 808, __pyx_L1_error)
22281 }
22282 __pyx_t_14 = __pyx_v_eN;
22283 __pyx_t_13 = __pyx_v_k;
22284 __pyx_t_12 = 1;
22285 __pyx_t_11 = -1;
22286 if (__pyx_t_14 < 0) {
22287 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
22288 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
22289 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
22290 if (__pyx_t_13 < 0) {
22291 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
22292 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
22293 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
22294 if (__pyx_t_12 < 0) {
22295 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
22296 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
22297 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
22298 if (unlikely(__pyx_t_11 != -1)) {
22299 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22300 __PYX_ERR(0, 808, __pyx_L1_error)
22301 }
22302 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
22303
22304 /* "subsurfaceTransportFunctions.pyx":809
22305 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22306 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
22307 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock # <<<<<<<<<<<<<<
22308 * else:
22309 * for eN in range(x.shape[0]):
22310*/
22311 __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 809, __pyx_L1_error)
22312 __Pyx_GOTREF(__pyx_t_17);
22313 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 809, __pyx_L1_error)
22314 __Pyx_GOTREF(__pyx_t_20);
22315 __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 809, __pyx_L1_error)
22316 __Pyx_GOTREF(__pyx_t_15);
22317 __Pyx_GIVEREF(__pyx_t_17);
22318 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_17) != (0)) __PYX_ERR(0, 809, __pyx_L1_error);
22319 __Pyx_GIVEREF(__pyx_t_20);
22320 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_20) != (0)) __PYX_ERR(0, 809, __pyx_L1_error);
22321 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
22322 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
22323 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 809, __pyx_L1_error);
22324 __pyx_t_17 = 0;
22325 __pyx_t_20 = 0;
22326 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_15); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 809, __pyx_L1_error)
22327 __Pyx_GOTREF(__pyx_t_20);
22328 __pyx_t_19 = (__pyx_v_tForReversal - __pyx_v_t);
22329
22330 __pyx_t_18 = (__pyx_v_tForReversal - 0.0);
22331
22332 if (unlikely(__pyx_t_18 == 0)) {
22333 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
22334 __PYX_ERR(0, 809, __pyx_L1_error)
22335 }
22336 __pyx_t_17 = PyFloat_FromDouble(((__pyx_t_19 / __pyx_t_18) * __pyx_v_clock)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 809, __pyx_L1_error)
22337 __Pyx_GOTREF(__pyx_t_17);
22338
22339
22340 __pyx_t_16 = __Pyx_PyNumber_InPlaceMultiply_object_float(__pyx_t_20, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 809, __pyx_L1_error)
22341 __Pyx_GOTREF(__pyx_t_16);
22342 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
22343 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
22344 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_15, __pyx_t_16) < 0))) __PYX_ERR(0, 809, __pyx_L1_error)
22345 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22346 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22347 }
22348
22349 }
22350
22351
22352 /* "subsurfaceTransportFunctions.pyx":804
22353 * else:
22354 * assert v.shape[2] == 2
22355 * if transient == 1: # <<<<<<<<<<<<<<
22356 * for eN in range(x.shape[0]):
22357 * for k in range(x.shape[1]):
22358*/
22359 goto __pyx_L13;
22360 }
22361
22362 /* "subsurfaceTransportFunctions.pyx":811
22363 * v[eN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
22364 * else:
22365 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
22366 * for k in range(x.shape[1]):
22367 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22368*/
22369 /*else*/ {
22370
22371 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
22372 __pyx_t_3 = __pyx_t_2;
22373
22374 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22375 __pyx_v_eN = __pyx_t_4;
22376
22377 /* "subsurfaceTransportFunctions.pyx":812
22378 * else:
22379 * for eN in range(x.shape[0]):
22380 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
22381 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22382 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
22383*/
22384
22385 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
22386 __pyx_t_6 = __pyx_t_5;
22387
22388 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
22389 __pyx_v_k = __pyx_t_7;
22390
22391 /* "subsurfaceTransportFunctions.pyx":813
22392 * for eN in range(x.shape[0]):
22393 * for k in range(x.shape[1]):
22394 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc) # <<<<<<<<<<<<<<
22395 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
22396 *
22397*/
22398 __pyx_t_8 = __pyx_v_eN;
22399 __pyx_t_9 = __pyx_v_k;
22400 __pyx_t_10 = 1;
22401 __pyx_t_11 = -1;
22402 if (__pyx_t_8 < 0) {
22403 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
22404 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
22405 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
22406 if (__pyx_t_9 < 0) {
22407 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
22408 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
22409 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
22410 if (__pyx_t_10 < 0) {
22411 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
22412 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
22413 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
22414 if (unlikely(__pyx_t_11 != -1)) {
22415 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22416 __PYX_ERR(0, 813, __pyx_L1_error)
22417 }
22418 __pyx_t_12 = __pyx_v_eN;
22419 __pyx_t_13 = __pyx_v_k;
22420 __pyx_t_14 = 0;
22421 __pyx_t_11 = -1;
22422 if (__pyx_t_12 < 0) {
22423 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
22424 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
22425 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
22426 if (__pyx_t_13 < 0) {
22427 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
22428 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
22429 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
22430 if (__pyx_t_14 < 0) {
22431 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
22432 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
22433 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
22434 if (unlikely(__pyx_t_11 != -1)) {
22435 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22436 __PYX_ERR(0, 813, __pyx_L1_error)
22437 }
22438 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
22439
22440 /* "subsurfaceTransportFunctions.pyx":814
22441 * for k in range(x.shape[1]):
22442 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
22443 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0]) # <<<<<<<<<<<<<<
22444 *
22445 *
22446*/
22447 __pyx_t_10 = __pyx_v_eN;
22448 __pyx_t_9 = __pyx_v_k;
22449 __pyx_t_8 = 0;
22450 __pyx_t_11 = -1;
22451 if (__pyx_t_10 < 0) {
22452 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
22453 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
22454 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
22455 if (__pyx_t_9 < 0) {
22456 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
22457 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
22458 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
22459 if (__pyx_t_8 < 0) {
22460 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
22461 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
22462 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
22463 if (unlikely(__pyx_t_11 != -1)) {
22464 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22465 __PYX_ERR(0, 814, __pyx_L1_error)
22466 }
22467 __pyx_t_14 = __pyx_v_eN;
22468 __pyx_t_13 = __pyx_v_k;
22469 __pyx_t_12 = 1;
22470 __pyx_t_11 = -1;
22471 if (__pyx_t_14 < 0) {
22472 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
22473 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
22474 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
22475 if (__pyx_t_13 < 0) {
22476 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
22477 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
22478 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
22479 if (__pyx_t_12 < 0) {
22480 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
22481 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
22482 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
22483 if (unlikely(__pyx_t_11 != -1)) {
22484 __Pyx_RaiseBufferIndexError(__pyx_t_11);
22485 __PYX_ERR(0, 814, __pyx_L1_error)
22486 }
22487 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
22488 }
22489
22490 }
22491
22492 }
22493 __pyx_L13:;
22494 }
22495 __pyx_L3:;
22496
22497 /* "subsurfaceTransportFunctions.pyx":777
22498 *
22499 * #problem specific velocity evaluation
22500 * def rotatingGaussianElementVelocityEval3(int transient, # <<<<<<<<<<<<<<
22501 * double t,
22502 * double tForReversal,
22503*/
22504
22505 /* function exit code */
22506 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22507 goto __pyx_L0;
22508 __pyx_L1_error:;
22509 __Pyx_XDECREF(__pyx_t_15);
22510 __Pyx_XDECREF(__pyx_t_16);
22511 __Pyx_XDECREF(__pyx_t_17);
22512 __Pyx_XDECREF(__pyx_t_20);
22513 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
22514 __Pyx_PyThreadState_declare
22515 __Pyx_PyThreadState_assign
22516 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
22517 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
22518 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
22519 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
22520 __Pyx_AddTraceback("subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
22521 __pyx_r = NULL;
22522 goto __pyx_L2;
22523 __pyx_L0:;
22524 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
22525 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
22526 __pyx_L2:;
22527
22528
22529
22530
22531
22532
22533
22534 __Pyx_XGIVEREF(__pyx_r);
22535 __Pyx_RefNannyFinishContext();
22536 return __pyx_r;
22537}
22538
22539/* "subsurfaceTransportFunctions.pyx":817
22540 *
22541 *
22542 * def rotatingGaussianElementVelocityEval4(int transient, # <<<<<<<<<<<<<<
22543 * double t,
22544 * double tForReversal,
22545*/
22546
22547/* Python wrapper */
22548static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self,
22549#if CYTHON_VECTORCALL
22550PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22551#else
22552PyObject *__pyx_args, PyObject *__pyx_kwds
22553#endif
22554); /*proto*/
22555static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {"rotatingGaussianElementVelocityEval4", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22556static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self,
22557#if CYTHON_VECTORCALL
22558PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22559#else
22560PyObject *__pyx_args, PyObject *__pyx_kwds
22561#endif
22562) {
22563 int __pyx_v_transient;
22564 double __pyx_v_t;
22565 double __pyx_v_tForReversal;
22566 double __pyx_v_clock;
22567 double __pyx_v_xc;
22568 double __pyx_v_yc;
22569 PyArrayObject *__pyx_v_x = 0;
22570 PyArrayObject *__pyx_v_v = 0;
22571 double __pyx_v_zvelocity;
22572 #if !CYTHON_VECTORCALL
22573 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22574 #endif
22575 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22576 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
22577 int __pyx_lineno = 0;
22578 const char *__pyx_filename = NULL;
22579 int __pyx_clineno = 0;
22580 PyObject *__pyx_r = 0;
22581 __Pyx_RefNannyDeclarations
22582 __Pyx_RefNannySetupContext("rotatingGaussianElementVelocityEval4 (wrapper)", 0);
22583 #if !CYTHON_VECTORCALL
22584 #if CYTHON_ASSUME_SAFE_SIZE
22585 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22586 #else
22587 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22588 #endif
22589 #endif
22590 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22591 {
22592 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_transient,&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_tForReversal,&__pyx_mstate_global->__pyx_n_u_clock,&__pyx_mstate_global->__pyx_n_u_xc,&__pyx_mstate_global->__pyx_n_u_yc,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_zvelocity,0};
22593 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22594 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 817, __pyx_L3_error)
22595 if (__pyx_kwds_len > 0) {
22596 switch (__pyx_nargs) {
22597 case 9:
22598 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
22599 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 817, __pyx_L3_error)
22600 CYTHON_FALLTHROUGH;
22601 case 8:
22602 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
22603 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 817, __pyx_L3_error)
22604 CYTHON_FALLTHROUGH;
22605 case 7:
22606 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
22607 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 817, __pyx_L3_error)
22608 CYTHON_FALLTHROUGH;
22609 case 6:
22610 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
22611 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 817, __pyx_L3_error)
22612 CYTHON_FALLTHROUGH;
22613 case 5:
22614 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22615 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 817, __pyx_L3_error)
22616 CYTHON_FALLTHROUGH;
22617 case 4:
22618 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22619 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 817, __pyx_L3_error)
22620 CYTHON_FALLTHROUGH;
22621 case 3:
22622 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22623 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 817, __pyx_L3_error)
22624 CYTHON_FALLTHROUGH;
22625 case 2:
22626 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22627 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 817, __pyx_L3_error)
22628 CYTHON_FALLTHROUGH;
22629 case 1:
22630 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22631 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 817, __pyx_L3_error)
22632 CYTHON_FALLTHROUGH;
22633 case 0: break;
22634 default: goto __pyx_L5_argtuple_error;
22635 }
22636 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22637 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "rotatingGaussianElementVelocityEval4", 0) < (0)) __PYX_ERR(0, 817, __pyx_L3_error)
22638 for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
22639 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("rotatingGaussianElementVelocityEval4", 0, 8, 9, i); __PYX_ERR(0, 817, __pyx_L3_error) }
22640 }
22641 } else {
22642 switch (__pyx_nargs) {
22643 case 9:
22644 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
22645 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 817, __pyx_L3_error)
22646 CYTHON_FALLTHROUGH;
22647 case 8:
22648 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
22649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 817, __pyx_L3_error)
22650 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
22651 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 817, __pyx_L3_error)
22652 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
22653 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 817, __pyx_L3_error)
22654 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22655 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 817, __pyx_L3_error)
22656 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22657 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 817, __pyx_L3_error)
22658 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22659 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 817, __pyx_L3_error)
22660 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22661 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 817, __pyx_L3_error)
22662 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 817, __pyx_L3_error)
22664 break;
22665 default: goto __pyx_L5_argtuple_error;
22666 }
22667 }
22668 __pyx_v_transient = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_transient == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
22669 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
22670 __pyx_v_tForReversal = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_tForReversal == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
22671 __pyx_v_clock = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_clock == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
22672 __pyx_v_xc = __Pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_xc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error)
22673 __pyx_v_yc = __Pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error)
22674 __pyx_v_x = ((PyArrayObject *)values[6]);
22675 __pyx_v_v = ((PyArrayObject *)values[7]);
22676 if (values[8]) {
22677 __pyx_v_zvelocity = __Pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_zvelocity == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L3_error)
22678 } else {
22679 __pyx_v_zvelocity = ((double)((double)0.0));
22680 }
22681 }
22682 goto __pyx_L6_skip;
22683 __pyx_L5_argtuple_error:;
22684 __Pyx_RaiseArgtupleInvalid("rotatingGaussianElementVelocityEval4", 0, 8, 9, __pyx_nargs); __PYX_ERR(0, 817, __pyx_L3_error)
22685 __pyx_L6_skip:;
22686 goto __pyx_L4_argument_unpacking_done;
22687 __pyx_L3_error:;
22688 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22689 Py_XDECREF(values[__pyx_temp]);
22690 }
22691 __Pyx_AddTraceback("subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
22692 __Pyx_RefNannyFinishContext();
22693 return NULL;
22694 __pyx_L4_argument_unpacking_done:;
22695 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 822, __pyx_L1_error)
22696 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 823, __pyx_L1_error)
22697 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
22698
22699 /* function exit code */
22700 goto __pyx_L0;
22701 __pyx_L1_error:;
22702 __pyx_r = NULL;
22703 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22704 Py_XDECREF(values[__pyx_temp]);
22705 }
22706 goto __pyx_L7_cleaned_up;
22707 __pyx_L0:;
22708 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22709 Py_XDECREF(values[__pyx_temp]);
22710 }
22711 __pyx_L7_cleaned_up:;
22712
22713
22714
22715
22716
22717
22718
22719 __Pyx_RefNannyFinishContext();
22720 return __pyx_r;
22721}
22722
22723static 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) {
22724 int __pyx_v_eN;
22725 int __pyx_v_ebN;
22726 int __pyx_v_k;
22727 double __pyx_v_pi;
22728 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
22729 __Pyx_Buffer __pyx_pybuffer_v;
22730 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
22731 __Pyx_Buffer __pyx_pybuffer_x;
22732 PyObject *__pyx_r = NULL;
22733 __Pyx_RefNannyDeclarations
22734 int __pyx_t_1;
22735 npy_intp __pyx_t_2;
22736 npy_intp __pyx_t_3;
22737 int __pyx_t_4;
22738 npy_intp __pyx_t_5;
22739 npy_intp __pyx_t_6;
22740 int __pyx_t_7;
22741 npy_intp __pyx_t_8;
22742 npy_intp __pyx_t_9;
22743 int __pyx_t_10;
22744 Py_ssize_t __pyx_t_11;
22745 Py_ssize_t __pyx_t_12;
22746 Py_ssize_t __pyx_t_13;
22747 Py_ssize_t __pyx_t_14;
22748 int __pyx_t_15;
22749 Py_ssize_t __pyx_t_16;
22750 Py_ssize_t __pyx_t_17;
22751 Py_ssize_t __pyx_t_18;
22752 Py_ssize_t __pyx_t_19;
22753 PyObject *__pyx_t_20 = NULL;
22754 PyObject *__pyx_t_21 = NULL;
22755 PyObject *__pyx_t_22 = NULL;
22756 PyObject *__pyx_t_23 = NULL;
22757 double __pyx_t_24;
22758 double __pyx_t_25;
22759 int __pyx_lineno = 0;
22760 const char *__pyx_filename = NULL;
22761 int __pyx_clineno = 0;
22762 __Pyx_RefNannySetupContext("rotatingGaussianElementVelocityEval4", 0);
22763 __pyx_pybuffer_x.pybuffer.buf = NULL;
22764 __pyx_pybuffer_x.refcount = 0;
22765 __pyx_pybuffernd_x.data = NULL;
22766 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
22767 __pyx_pybuffer_v.pybuffer.buf = NULL;
22768 __pyx_pybuffer_v.refcount = 0;
22769 __pyx_pybuffernd_v.data = NULL;
22770 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
22771 {
22772 __Pyx_BufFmt_StackElem __pyx_stack[1];
22773 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, 817, __pyx_L1_error)
22774 }
22775 __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];
22776 {
22777 __Pyx_BufFmt_StackElem __pyx_stack[1];
22778 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 817, __pyx_L1_error)
22779 }
22780 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
22781
22782 /* "subsurfaceTransportFunctions.pyx":827
22783 * cdef int eN,ebN,k
22784 * cdef double pi
22785 * pi = M_PI # <<<<<<<<<<<<<<
22786 * if v.shape[v.ndim-1] == 3:
22787 * if transient == 1:
22788*/
22789 __pyx_v_pi = M_PI;
22790
22791 /* "subsurfaceTransportFunctions.pyx":828
22792 * cdef double pi
22793 * pi = M_PI
22794 * if v.shape[v.ndim-1] == 3: # <<<<<<<<<<<<<<
22795 * if transient == 1:
22796 * for eN in range(x.shape[0]):
22797*/
22798 __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_v))[(__pyx_f_5numpy_7ndarray_4ndim___get__(((PyArrayObject *)__pyx_v_v)) - 1)]) == 3);
22799
22800 if (__pyx_t_1) {
22801
22802
22803 /* "subsurfaceTransportFunctions.pyx":829
22804 * pi = M_PI
22805 * if v.shape[v.ndim-1] == 3:
22806 * if transient == 1: # <<<<<<<<<<<<<<
22807 * for eN in range(x.shape[0]):
22808 * for ebN in range(x.shape[1]):
22809*/
22810 __pyx_t_1 = (__pyx_v_transient == 1);
22811
22812 if (__pyx_t_1) {
22813
22814
22815 /* "subsurfaceTransportFunctions.pyx":830
22816 * if v.shape[v.ndim-1] == 3:
22817 * if transient == 1:
22818 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
22819 * for ebN in range(x.shape[1]):
22820 * for k in range(x.shape[2]):
22821*/
22822
22823 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
22824 __pyx_t_3 = __pyx_t_2;
22825
22826 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22827 __pyx_v_eN = __pyx_t_4;
22828
22829 /* "subsurfaceTransportFunctions.pyx":831
22830 * if transient == 1:
22831 * for eN in range(x.shape[0]):
22832 * for ebN in range(x.shape[1]): # <<<<<<<<<<<<<<
22833 * for k in range(x.shape[2]):
22834 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
22835*/
22836
22837 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
22838 __pyx_t_6 = __pyx_t_5;
22839
22840 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
22841 __pyx_v_ebN = __pyx_t_7;
22842
22843 /* "subsurfaceTransportFunctions.pyx":832
22844 * for eN in range(x.shape[0]):
22845 * for ebN in range(x.shape[1]):
22846 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
22847 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
22848 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
22849*/
22850
22851 __pyx_t_8 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
22852 __pyx_t_9 = __pyx_t_8;
22853
22854 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
22855 __pyx_v_k = __pyx_t_10;
22856
22857 /* "subsurfaceTransportFunctions.pyx":833
22858 * for ebN in range(x.shape[1]):
22859 * for k in range(x.shape[2]):
22860 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc) # <<<<<<<<<<<<<<
22861 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
22862 * v[eN,ebN,k,2]=zvelocity
22863*/
22864 __pyx_t_11 = __pyx_v_eN;
22865 __pyx_t_12 = __pyx_v_ebN;
22866 __pyx_t_13 = __pyx_v_k;
22867 __pyx_t_14 = 1;
22868 __pyx_t_15 = -1;
22869 if (__pyx_t_11 < 0) {
22870 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
22871 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
22872 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
22873 if (__pyx_t_12 < 0) {
22874 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
22875 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
22876 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
22877 if (__pyx_t_13 < 0) {
22878 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
22879 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
22880 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
22881 if (__pyx_t_14 < 0) {
22882 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
22883 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
22884 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
22885 if (unlikely(__pyx_t_15 != -1)) {
22886 __Pyx_RaiseBufferIndexError(__pyx_t_15);
22887 __PYX_ERR(0, 833, __pyx_L1_error)
22888 }
22889 __pyx_t_16 = __pyx_v_eN;
22890 __pyx_t_17 = __pyx_v_ebN;
22891 __pyx_t_18 = __pyx_v_k;
22892 __pyx_t_19 = 0;
22893 __pyx_t_15 = -1;
22894 if (__pyx_t_16 < 0) {
22895 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
22896 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
22897 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
22898 if (__pyx_t_17 < 0) {
22899 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
22900 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
22901 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
22902 if (__pyx_t_18 < 0) {
22903 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
22904 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
22905 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
22906 if (__pyx_t_19 < 0) {
22907 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
22908 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
22909 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
22910 if (unlikely(__pyx_t_15 != -1)) {
22911 __Pyx_RaiseBufferIndexError(__pyx_t_15);
22912 __PYX_ERR(0, 833, __pyx_L1_error)
22913 }
22914 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
22915
22916 /* "subsurfaceTransportFunctions.pyx":834
22917 * for k in range(x.shape[2]):
22918 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
22919 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0]) # <<<<<<<<<<<<<<
22920 * v[eN,ebN,k,2]=zvelocity
22921 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
22922*/
22923 __pyx_t_14 = __pyx_v_eN;
22924 __pyx_t_13 = __pyx_v_ebN;
22925 __pyx_t_12 = __pyx_v_k;
22926 __pyx_t_11 = 0;
22927 __pyx_t_15 = -1;
22928 if (__pyx_t_14 < 0) {
22929 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
22930 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
22931 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
22932 if (__pyx_t_13 < 0) {
22933 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
22934 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
22935 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
22936 if (__pyx_t_12 < 0) {
22937 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
22938 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
22939 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
22940 if (__pyx_t_11 < 0) {
22941 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
22942 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
22943 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
22944 if (unlikely(__pyx_t_15 != -1)) {
22945 __Pyx_RaiseBufferIndexError(__pyx_t_15);
22946 __PYX_ERR(0, 834, __pyx_L1_error)
22947 }
22948 __pyx_t_19 = __pyx_v_eN;
22949 __pyx_t_18 = __pyx_v_ebN;
22950 __pyx_t_17 = __pyx_v_k;
22951 __pyx_t_16 = 1;
22952 __pyx_t_15 = -1;
22953 if (__pyx_t_19 < 0) {
22954 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
22955 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
22956 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
22957 if (__pyx_t_18 < 0) {
22958 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
22959 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
22960 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
22961 if (__pyx_t_17 < 0) {
22962 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
22963 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
22964 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
22965 if (__pyx_t_16 < 0) {
22966 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
22967 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
22968 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
22969 if (unlikely(__pyx_t_15 != -1)) {
22970 __Pyx_RaiseBufferIndexError(__pyx_t_15);
22971 __PYX_ERR(0, 834, __pyx_L1_error)
22972 }
22973 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
22974
22975 /* "subsurfaceTransportFunctions.pyx":835
22976 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
22977 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
22978 * v[eN,ebN,k,2]=zvelocity # <<<<<<<<<<<<<<
22979 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
22980 * else:
22981*/
22982 __pyx_t_11 = __pyx_v_eN;
22983 __pyx_t_12 = __pyx_v_ebN;
22984 __pyx_t_13 = __pyx_v_k;
22985 __pyx_t_14 = 2;
22986 __pyx_t_15 = -1;
22987 if (__pyx_t_11 < 0) {
22988 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
22989 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
22990 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
22991 if (__pyx_t_12 < 0) {
22992 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
22993 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
22994 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
22995 if (__pyx_t_13 < 0) {
22996 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
22997 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
22998 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
22999 if (__pyx_t_14 < 0) {
23000 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
23001 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
23002 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23003 if (unlikely(__pyx_t_15 != -1)) {
23004 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23005 __PYX_ERR(0, 835, __pyx_L1_error)
23006 }
23007 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
23008
23009 /* "subsurfaceTransportFunctions.pyx":836
23010 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23011 * v[eN,ebN,k,2]=zvelocity
23012 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock # <<<<<<<<<<<<<<
23013 * else:
23014 * for eN in range(x.shape[0]):
23015*/
23016 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 836, __pyx_L1_error)
23017 __Pyx_GOTREF(__pyx_t_20);
23018 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 836, __pyx_L1_error)
23019 __Pyx_GOTREF(__pyx_t_21);
23020 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 836, __pyx_L1_error)
23021 __Pyx_GOTREF(__pyx_t_22);
23022 __pyx_t_23 = PyTuple_New(4); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 836, __pyx_L1_error)
23023 __Pyx_GOTREF(__pyx_t_23);
23024 __Pyx_GIVEREF(__pyx_t_20);
23025 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20) != (0)) __PYX_ERR(0, 836, __pyx_L1_error);
23026 __Pyx_GIVEREF(__pyx_t_21);
23027 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21) != (0)) __PYX_ERR(0, 836, __pyx_L1_error);
23028 __Pyx_GIVEREF(__pyx_t_22);
23029 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22) != (0)) __PYX_ERR(0, 836, __pyx_L1_error);
23030 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
23031 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
23032 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 836, __pyx_L1_error);
23033 __pyx_t_20 = 0;
23034 __pyx_t_21 = 0;
23035 __pyx_t_22 = 0;
23036 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 836, __pyx_L1_error)
23037 __Pyx_GOTREF(__pyx_t_22);
23038 __pyx_t_24 = (__pyx_v_tForReversal - __pyx_v_t);
23039
23040 __pyx_t_25 = (__pyx_v_tForReversal - 0.0);
23041
23042 if (unlikely(__pyx_t_25 == 0)) {
23043 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
23044 __PYX_ERR(0, 836, __pyx_L1_error)
23045 }
23046 __pyx_t_21 = PyFloat_FromDouble(((__pyx_t_24 / __pyx_t_25) * __pyx_v_clock)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 836, __pyx_L1_error)
23047 __Pyx_GOTREF(__pyx_t_21);
23048
23049
23050 __pyx_t_20 = __Pyx_PyNumber_InPlaceMultiply_object_float(__pyx_t_22, __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 836, __pyx_L1_error)
23051 __Pyx_GOTREF(__pyx_t_20);
23052 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
23053 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
23054 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0))) __PYX_ERR(0, 836, __pyx_L1_error)
23055 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
23056 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
23057 }
23058
23059 }
23060
23061 }
23062
23063
23064 /* "subsurfaceTransportFunctions.pyx":829
23065 * pi = M_PI
23066 * if v.shape[v.ndim-1] == 3:
23067 * if transient == 1: # <<<<<<<<<<<<<<
23068 * for eN in range(x.shape[0]):
23069 * for ebN in range(x.shape[1]):
23070*/
23071 goto __pyx_L4;
23072 }
23073
23074 /* "subsurfaceTransportFunctions.pyx":838
23075 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
23076 * else:
23077 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
23078 * for ebN in range(x.shape[1]):
23079 * for k in range(x.shape[2]):
23080*/
23081 /*else*/ {
23082
23083 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
23084 __pyx_t_3 = __pyx_t_2;
23085
23086 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23087 __pyx_v_eN = __pyx_t_4;
23088
23089 /* "subsurfaceTransportFunctions.pyx":839
23090 * else:
23091 * for eN in range(x.shape[0]):
23092 * for ebN in range(x.shape[1]): # <<<<<<<<<<<<<<
23093 * for k in range(x.shape[2]):
23094 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23095*/
23096
23097 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
23098 __pyx_t_6 = __pyx_t_5;
23099
23100 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
23101 __pyx_v_ebN = __pyx_t_7;
23102
23103 /* "subsurfaceTransportFunctions.pyx":840
23104 * for eN in range(x.shape[0]):
23105 * for ebN in range(x.shape[1]):
23106 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
23107 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23108 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23109*/
23110
23111 __pyx_t_8 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
23112 __pyx_t_9 = __pyx_t_8;
23113
23114 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
23115 __pyx_v_k = __pyx_t_10;
23116
23117 /* "subsurfaceTransportFunctions.pyx":841
23118 * for ebN in range(x.shape[1]):
23119 * for k in range(x.shape[2]):
23120 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc) # <<<<<<<<<<<<<<
23121 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23122 * v[eN,ebN,k,2]=zvelocity
23123*/
23124 __pyx_t_14 = __pyx_v_eN;
23125 __pyx_t_13 = __pyx_v_ebN;
23126 __pyx_t_12 = __pyx_v_k;
23127 __pyx_t_11 = 1;
23128 __pyx_t_15 = -1;
23129 if (__pyx_t_14 < 0) {
23130 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
23131 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23132 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
23133 if (__pyx_t_13 < 0) {
23134 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
23135 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
23136 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
23137 if (__pyx_t_12 < 0) {
23138 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
23139 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
23140 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
23141 if (__pyx_t_11 < 0) {
23142 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
23143 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
23144 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
23145 if (unlikely(__pyx_t_15 != -1)) {
23146 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23147 __PYX_ERR(0, 841, __pyx_L1_error)
23148 }
23149 __pyx_t_16 = __pyx_v_eN;
23150 __pyx_t_17 = __pyx_v_ebN;
23151 __pyx_t_18 = __pyx_v_k;
23152 __pyx_t_19 = 0;
23153 __pyx_t_15 = -1;
23154 if (__pyx_t_16 < 0) {
23155 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
23156 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
23157 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
23158 if (__pyx_t_17 < 0) {
23159 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
23160 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
23161 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
23162 if (__pyx_t_18 < 0) {
23163 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
23164 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
23165 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
23166 if (__pyx_t_19 < 0) {
23167 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
23168 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
23169 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23170 if (unlikely(__pyx_t_15 != -1)) {
23171 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23172 __PYX_ERR(0, 841, __pyx_L1_error)
23173 }
23174 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
23175
23176 /* "subsurfaceTransportFunctions.pyx":842
23177 * for k in range(x.shape[2]):
23178 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23179 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0]) # <<<<<<<<<<<<<<
23180 * v[eN,ebN,k,2]=zvelocity
23181 * else:
23182*/
23183 __pyx_t_11 = __pyx_v_eN;
23184 __pyx_t_12 = __pyx_v_ebN;
23185 __pyx_t_13 = __pyx_v_k;
23186 __pyx_t_14 = 0;
23187 __pyx_t_15 = -1;
23188 if (__pyx_t_11 < 0) {
23189 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
23190 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
23191 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
23192 if (__pyx_t_12 < 0) {
23193 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
23194 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
23195 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
23196 if (__pyx_t_13 < 0) {
23197 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
23198 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
23199 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
23200 if (__pyx_t_14 < 0) {
23201 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
23202 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
23203 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
23204 if (unlikely(__pyx_t_15 != -1)) {
23205 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23206 __PYX_ERR(0, 842, __pyx_L1_error)
23207 }
23208 __pyx_t_19 = __pyx_v_eN;
23209 __pyx_t_18 = __pyx_v_ebN;
23210 __pyx_t_17 = __pyx_v_k;
23211 __pyx_t_16 = 1;
23212 __pyx_t_15 = -1;
23213 if (__pyx_t_19 < 0) {
23214 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
23215 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
23216 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
23217 if (__pyx_t_18 < 0) {
23218 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
23219 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
23220 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
23221 if (__pyx_t_17 < 0) {
23222 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
23223 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
23224 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
23225 if (__pyx_t_16 < 0) {
23226 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
23227 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
23228 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23229 if (unlikely(__pyx_t_15 != -1)) {
23230 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23231 __PYX_ERR(0, 842, __pyx_L1_error)
23232 }
23233 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
23234
23235 /* "subsurfaceTransportFunctions.pyx":843
23236 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23237 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23238 * v[eN,ebN,k,2]=zvelocity # <<<<<<<<<<<<<<
23239 * else:
23240 * assert v.shape[v.ndim-1] == 2
23241*/
23242 __pyx_t_14 = __pyx_v_eN;
23243 __pyx_t_13 = __pyx_v_ebN;
23244 __pyx_t_12 = __pyx_v_k;
23245 __pyx_t_11 = 2;
23246 __pyx_t_15 = -1;
23247 if (__pyx_t_14 < 0) {
23248 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
23249 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23250 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
23251 if (__pyx_t_13 < 0) {
23252 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
23253 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
23254 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
23255 if (__pyx_t_12 < 0) {
23256 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
23257 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
23258 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
23259 if (__pyx_t_11 < 0) {
23260 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
23261 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
23262 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23263 if (unlikely(__pyx_t_15 != -1)) {
23264 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23265 __PYX_ERR(0, 843, __pyx_L1_error)
23266 }
23267 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
23268 }
23269
23270 }
23271
23272 }
23273
23274 }
23275 __pyx_L4:;
23276
23277 /* "subsurfaceTransportFunctions.pyx":828
23278 * cdef double pi
23279 * pi = M_PI
23280 * if v.shape[v.ndim-1] == 3: # <<<<<<<<<<<<<<
23281 * if transient == 1:
23282 * for eN in range(x.shape[0]):
23283*/
23284 goto __pyx_L3;
23285 }
23286
23287 /* "subsurfaceTransportFunctions.pyx":845
23288 * v[eN,ebN,k,2]=zvelocity
23289 * else:
23290 * assert v.shape[v.ndim-1] == 2 # <<<<<<<<<<<<<<
23291 * if transient == 1:
23292 * for eN in range(x.shape[0]):
23293*/
23294 /*else*/ {
23295 #ifndef CYTHON_WITHOUT_ASSERTIONS
23296 if (unlikely(__pyx_assertions_enabled())) {
23297 __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_v))[(__pyx_f_5numpy_7ndarray_4ndim___get__(((PyArrayObject *)__pyx_v_v)) - 1)]) == 2);
23298
23299 if (unlikely(!__pyx_t_1)) {
23300 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
23301 __PYX_ERR(0, 845, __pyx_L1_error)
23302 }
23303
23304 }
23305 #else
23306 if ((1)); else __PYX_ERR(0, 845, __pyx_L1_error)
23307 #endif
23308
23309 /* "subsurfaceTransportFunctions.pyx":846
23310 * else:
23311 * assert v.shape[v.ndim-1] == 2
23312 * if transient == 1: # <<<<<<<<<<<<<<
23313 * for eN in range(x.shape[0]):
23314 * for ebN in range(x.shape[1]):
23315*/
23316 __pyx_t_1 = (__pyx_v_transient == 1);
23317
23318 if (__pyx_t_1) {
23319
23320
23321 /* "subsurfaceTransportFunctions.pyx":847
23322 * assert v.shape[v.ndim-1] == 2
23323 * if transient == 1:
23324 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
23325 * for ebN in range(x.shape[1]):
23326 * for k in range(x.shape[2]):
23327*/
23328
23329 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
23330 __pyx_t_3 = __pyx_t_2;
23331
23332 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23333 __pyx_v_eN = __pyx_t_4;
23334
23335 /* "subsurfaceTransportFunctions.pyx":848
23336 * if transient == 1:
23337 * for eN in range(x.shape[0]):
23338 * for ebN in range(x.shape[1]): # <<<<<<<<<<<<<<
23339 * for k in range(x.shape[2]):
23340 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23341*/
23342
23343 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
23344 __pyx_t_6 = __pyx_t_5;
23345
23346 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
23347 __pyx_v_ebN = __pyx_t_7;
23348
23349 /* "subsurfaceTransportFunctions.pyx":849
23350 * for eN in range(x.shape[0]):
23351 * for ebN in range(x.shape[1]):
23352 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
23353 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23354 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23355*/
23356
23357 __pyx_t_8 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
23358 __pyx_t_9 = __pyx_t_8;
23359
23360 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
23361 __pyx_v_k = __pyx_t_10;
23362
23363 /* "subsurfaceTransportFunctions.pyx":850
23364 * for ebN in range(x.shape[1]):
23365 * for k in range(x.shape[2]):
23366 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc) # <<<<<<<<<<<<<<
23367 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23368 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
23369*/
23370 __pyx_t_11 = __pyx_v_eN;
23371 __pyx_t_12 = __pyx_v_ebN;
23372 __pyx_t_13 = __pyx_v_k;
23373 __pyx_t_14 = 1;
23374 __pyx_t_15 = -1;
23375 if (__pyx_t_11 < 0) {
23376 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
23377 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
23378 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
23379 if (__pyx_t_12 < 0) {
23380 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
23381 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
23382 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
23383 if (__pyx_t_13 < 0) {
23384 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
23385 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
23386 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
23387 if (__pyx_t_14 < 0) {
23388 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
23389 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
23390 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
23391 if (unlikely(__pyx_t_15 != -1)) {
23392 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23393 __PYX_ERR(0, 850, __pyx_L1_error)
23394 }
23395 __pyx_t_16 = __pyx_v_eN;
23396 __pyx_t_17 = __pyx_v_ebN;
23397 __pyx_t_18 = __pyx_v_k;
23398 __pyx_t_19 = 0;
23399 __pyx_t_15 = -1;
23400 if (__pyx_t_16 < 0) {
23401 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
23402 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
23403 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
23404 if (__pyx_t_17 < 0) {
23405 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
23406 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
23407 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
23408 if (__pyx_t_18 < 0) {
23409 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
23410 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
23411 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
23412 if (__pyx_t_19 < 0) {
23413 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
23414 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
23415 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23416 if (unlikely(__pyx_t_15 != -1)) {
23417 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23418 __PYX_ERR(0, 850, __pyx_L1_error)
23419 }
23420 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
23421
23422 /* "subsurfaceTransportFunctions.pyx":851
23423 * for k in range(x.shape[2]):
23424 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23425 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0]) # <<<<<<<<<<<<<<
23426 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
23427 * else:
23428*/
23429 __pyx_t_14 = __pyx_v_eN;
23430 __pyx_t_13 = __pyx_v_ebN;
23431 __pyx_t_12 = __pyx_v_k;
23432 __pyx_t_11 = 0;
23433 __pyx_t_15 = -1;
23434 if (__pyx_t_14 < 0) {
23435 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
23436 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23437 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
23438 if (__pyx_t_13 < 0) {
23439 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
23440 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
23441 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
23442 if (__pyx_t_12 < 0) {
23443 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
23444 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
23445 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
23446 if (__pyx_t_11 < 0) {
23447 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
23448 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
23449 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
23450 if (unlikely(__pyx_t_15 != -1)) {
23451 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23452 __PYX_ERR(0, 851, __pyx_L1_error)
23453 }
23454 __pyx_t_19 = __pyx_v_eN;
23455 __pyx_t_18 = __pyx_v_ebN;
23456 __pyx_t_17 = __pyx_v_k;
23457 __pyx_t_16 = 1;
23458 __pyx_t_15 = -1;
23459 if (__pyx_t_19 < 0) {
23460 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
23461 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
23462 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
23463 if (__pyx_t_18 < 0) {
23464 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
23465 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
23466 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
23467 if (__pyx_t_17 < 0) {
23468 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
23469 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
23470 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
23471 if (__pyx_t_16 < 0) {
23472 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
23473 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
23474 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23475 if (unlikely(__pyx_t_15 != -1)) {
23476 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23477 __PYX_ERR(0, 851, __pyx_L1_error)
23478 }
23479 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
23480
23481 /* "subsurfaceTransportFunctions.pyx":852
23482 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23483 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23484 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock # <<<<<<<<<<<<<<
23485 * else:
23486 * for eN in range(x.shape[0]):
23487*/
23488 __pyx_t_23 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 852, __pyx_L1_error)
23489 __Pyx_GOTREF(__pyx_t_23);
23490 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 852, __pyx_L1_error)
23491 __Pyx_GOTREF(__pyx_t_20);
23492 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 852, __pyx_L1_error)
23493 __Pyx_GOTREF(__pyx_t_21);
23494 __pyx_t_22 = PyTuple_New(4); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 852, __pyx_L1_error)
23495 __Pyx_GOTREF(__pyx_t_22);
23496 __Pyx_GIVEREF(__pyx_t_23);
23497 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23) != (0)) __PYX_ERR(0, 852, __pyx_L1_error);
23498 __Pyx_GIVEREF(__pyx_t_20);
23499 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20) != (0)) __PYX_ERR(0, 852, __pyx_L1_error);
23500 __Pyx_GIVEREF(__pyx_t_21);
23501 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_21) != (0)) __PYX_ERR(0, 852, __pyx_L1_error);
23502 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
23503 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
23504 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 852, __pyx_L1_error);
23505 __pyx_t_23 = 0;
23506 __pyx_t_20 = 0;
23507 __pyx_t_21 = 0;
23508 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_22); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 852, __pyx_L1_error)
23509 __Pyx_GOTREF(__pyx_t_21);
23510 __pyx_t_25 = (__pyx_v_tForReversal - __pyx_v_t);
23511
23512 __pyx_t_24 = (__pyx_v_tForReversal - 0.0);
23513
23514 if (unlikely(__pyx_t_24 == 0)) {
23515 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
23516 __PYX_ERR(0, 852, __pyx_L1_error)
23517 }
23518 __pyx_t_20 = PyFloat_FromDouble(((__pyx_t_25 / __pyx_t_24) * __pyx_v_clock)); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 852, __pyx_L1_error)
23519 __Pyx_GOTREF(__pyx_t_20);
23520
23521
23522 __pyx_t_23 = __Pyx_PyNumber_InPlaceMultiply_object_float(__pyx_t_21, __pyx_t_20); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 852, __pyx_L1_error)
23523 __Pyx_GOTREF(__pyx_t_23);
23524 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
23525 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
23526 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_22, __pyx_t_23) < 0))) __PYX_ERR(0, 852, __pyx_L1_error)
23527 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
23528 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
23529 }
23530
23531 }
23532
23533 }
23534
23535
23536 /* "subsurfaceTransportFunctions.pyx":846
23537 * else:
23538 * assert v.shape[v.ndim-1] == 2
23539 * if transient == 1: # <<<<<<<<<<<<<<
23540 * for eN in range(x.shape[0]):
23541 * for ebN in range(x.shape[1]):
23542*/
23543 goto __pyx_L17;
23544 }
23545
23546 /* "subsurfaceTransportFunctions.pyx":854
23547 * v[eN,ebN,k,:]*=(tForReversal-t)/(tForReversal-0.0)*clock
23548 * else:
23549 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
23550 * for ebN in range(x.shape[1]):
23551 * for k in range(x.shape[2]):
23552*/
23553 /*else*/ {
23554
23555 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
23556 __pyx_t_3 = __pyx_t_2;
23557
23558 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23559 __pyx_v_eN = __pyx_t_4;
23560
23561 /* "subsurfaceTransportFunctions.pyx":855
23562 * else:
23563 * for eN in range(x.shape[0]):
23564 * for ebN in range(x.shape[1]): # <<<<<<<<<<<<<<
23565 * for k in range(x.shape[2]):
23566 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23567*/
23568
23569 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
23570 __pyx_t_6 = __pyx_t_5;
23571
23572 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
23573 __pyx_v_ebN = __pyx_t_7;
23574
23575 /* "subsurfaceTransportFunctions.pyx":856
23576 * for eN in range(x.shape[0]):
23577 * for ebN in range(x.shape[1]):
23578 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
23579 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23580 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23581*/
23582
23583 __pyx_t_8 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
23584 __pyx_t_9 = __pyx_t_8;
23585
23586 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
23587 __pyx_v_k = __pyx_t_10;
23588
23589 /* "subsurfaceTransportFunctions.pyx":857
23590 * for ebN in range(x.shape[1]):
23591 * for k in range(x.shape[2]):
23592 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc) # <<<<<<<<<<<<<<
23593 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23594 *
23595*/
23596 __pyx_t_11 = __pyx_v_eN;
23597 __pyx_t_12 = __pyx_v_ebN;
23598 __pyx_t_13 = __pyx_v_k;
23599 __pyx_t_14 = 1;
23600 __pyx_t_15 = -1;
23601 if (__pyx_t_11 < 0) {
23602 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
23603 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
23604 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
23605 if (__pyx_t_12 < 0) {
23606 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
23607 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
23608 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
23609 if (__pyx_t_13 < 0) {
23610 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
23611 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
23612 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
23613 if (__pyx_t_14 < 0) {
23614 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
23615 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
23616 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
23617 if (unlikely(__pyx_t_15 != -1)) {
23618 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23619 __PYX_ERR(0, 857, __pyx_L1_error)
23620 }
23621 __pyx_t_16 = __pyx_v_eN;
23622 __pyx_t_17 = __pyx_v_ebN;
23623 __pyx_t_18 = __pyx_v_k;
23624 __pyx_t_19 = 0;
23625 __pyx_t_15 = -1;
23626 if (__pyx_t_16 < 0) {
23627 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
23628 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
23629 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
23630 if (__pyx_t_17 < 0) {
23631 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
23632 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
23633 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
23634 if (__pyx_t_18 < 0) {
23635 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
23636 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
23637 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
23638 if (__pyx_t_19 < 0) {
23639 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
23640 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
23641 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23642 if (unlikely(__pyx_t_15 != -1)) {
23643 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23644 __PYX_ERR(0, 857, __pyx_L1_error)
23645 }
23646 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
23647
23648 /* "subsurfaceTransportFunctions.pyx":858
23649 * for k in range(x.shape[2]):
23650 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
23651 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0]) # <<<<<<<<<<<<<<
23652 *
23653 * def helicalElementVelocityEval3(int transient,
23654*/
23655 __pyx_t_14 = __pyx_v_eN;
23656 __pyx_t_13 = __pyx_v_ebN;
23657 __pyx_t_12 = __pyx_v_k;
23658 __pyx_t_11 = 0;
23659 __pyx_t_15 = -1;
23660 if (__pyx_t_14 < 0) {
23661 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
23662 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
23663 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
23664 if (__pyx_t_13 < 0) {
23665 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
23666 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
23667 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
23668 if (__pyx_t_12 < 0) {
23669 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
23670 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
23671 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
23672 if (__pyx_t_11 < 0) {
23673 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
23674 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
23675 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
23676 if (unlikely(__pyx_t_15 != -1)) {
23677 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23678 __PYX_ERR(0, 858, __pyx_L1_error)
23679 }
23680 __pyx_t_19 = __pyx_v_eN;
23681 __pyx_t_18 = __pyx_v_ebN;
23682 __pyx_t_17 = __pyx_v_k;
23683 __pyx_t_16 = 1;
23684 __pyx_t_15 = -1;
23685 if (__pyx_t_19 < 0) {
23686 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
23687 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
23688 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
23689 if (__pyx_t_18 < 0) {
23690 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
23691 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
23692 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
23693 if (__pyx_t_17 < 0) {
23694 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
23695 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
23696 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
23697 if (__pyx_t_16 < 0) {
23698 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
23699 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
23700 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
23701 if (unlikely(__pyx_t_15 != -1)) {
23702 __Pyx_RaiseBufferIndexError(__pyx_t_15);
23703 __PYX_ERR(0, 858, __pyx_L1_error)
23704 }
23705 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
23706 }
23707
23708 }
23709
23710 }
23711
23712 }
23713 __pyx_L17:;
23714 }
23715 __pyx_L3:;
23716
23717 /* "subsurfaceTransportFunctions.pyx":817
23718 *
23719 *
23720 * def rotatingGaussianElementVelocityEval4(int transient, # <<<<<<<<<<<<<<
23721 * double t,
23722 * double tForReversal,
23723*/
23724
23725 /* function exit code */
23726 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23727 goto __pyx_L0;
23728 __pyx_L1_error:;
23729 __Pyx_XDECREF(__pyx_t_20);
23730 __Pyx_XDECREF(__pyx_t_21);
23731 __Pyx_XDECREF(__pyx_t_22);
23732 __Pyx_XDECREF(__pyx_t_23);
23733 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
23734 __Pyx_PyThreadState_declare
23735 __Pyx_PyThreadState_assign
23736 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
23737 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
23738 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
23739 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
23740 __Pyx_AddTraceback("subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
23741 __pyx_r = NULL;
23742 goto __pyx_L2;
23743 __pyx_L0:;
23744 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
23745 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
23746 __pyx_L2:;
23747
23748
23749
23750
23751
23752
23753
23754
23755 __Pyx_XGIVEREF(__pyx_r);
23756 __Pyx_RefNannyFinishContext();
23757 return __pyx_r;
23758}
23759
23760/* "subsurfaceTransportFunctions.pyx":860
23761 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
23762 *
23763 * def helicalElementVelocityEval3(int transient, # <<<<<<<<<<<<<<
23764 * double t,
23765 * double tForReversal,
23766*/
23767
23768/* Python wrapper */
23769static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self,
23770#if CYTHON_VECTORCALL
23771PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23772#else
23773PyObject *__pyx_args, PyObject *__pyx_kwds
23774#endif
23775); /*proto*/
23776static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {"helicalElementVelocityEval3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
23777static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self,
23778#if CYTHON_VECTORCALL
23779PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23780#else
23781PyObject *__pyx_args, PyObject *__pyx_kwds
23782#endif
23783) {
23784 int __pyx_v_transient;
23785 double __pyx_v_t;
23786 double __pyx_v_tForReversal;
23787 double __pyx_v_clock;
23788 double __pyx_v_zVelocity;
23789 double __pyx_v_xc;
23790 double __pyx_v_yc;
23791 PyArrayObject *__pyx_v_x = 0;
23792 PyArrayObject *__pyx_v_v = 0;
23793 #if !CYTHON_VECTORCALL
23794 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23795 #endif
23796 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23797 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
23798 int __pyx_lineno = 0;
23799 const char *__pyx_filename = NULL;
23800 int __pyx_clineno = 0;
23801 PyObject *__pyx_r = 0;
23802 __Pyx_RefNannyDeclarations
23803 __Pyx_RefNannySetupContext("helicalElementVelocityEval3 (wrapper)", 0);
23804 #if !CYTHON_VECTORCALL
23805 #if CYTHON_ASSUME_SAFE_SIZE
23806 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23807 #else
23808 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23809 #endif
23810 #endif
23811 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23812 {
23813 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_transient,&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_tForReversal,&__pyx_mstate_global->__pyx_n_u_clock,&__pyx_mstate_global->__pyx_n_u_zVelocity,&__pyx_mstate_global->__pyx_n_u_xc,&__pyx_mstate_global->__pyx_n_u_yc,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,0};
23814 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23815 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 860, __pyx_L3_error)
23816 if (__pyx_kwds_len > 0) {
23817 switch (__pyx_nargs) {
23818 case 9:
23819 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
23820 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 860, __pyx_L3_error)
23821 CYTHON_FALLTHROUGH;
23822 case 8:
23823 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
23824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 860, __pyx_L3_error)
23825 CYTHON_FALLTHROUGH;
23826 case 7:
23827 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
23828 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 860, __pyx_L3_error)
23829 CYTHON_FALLTHROUGH;
23830 case 6:
23831 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
23832 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 860, __pyx_L3_error)
23833 CYTHON_FALLTHROUGH;
23834 case 5:
23835 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23836 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 860, __pyx_L3_error)
23837 CYTHON_FALLTHROUGH;
23838 case 4:
23839 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23840 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 860, __pyx_L3_error)
23841 CYTHON_FALLTHROUGH;
23842 case 3:
23843 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23844 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 860, __pyx_L3_error)
23845 CYTHON_FALLTHROUGH;
23846 case 2:
23847 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23848 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 860, __pyx_L3_error)
23849 CYTHON_FALLTHROUGH;
23850 case 1:
23851 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23852 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 860, __pyx_L3_error)
23853 CYTHON_FALLTHROUGH;
23854 case 0: break;
23855 default: goto __pyx_L5_argtuple_error;
23856 }
23857 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23858 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "helicalElementVelocityEval3", 0) < (0)) __PYX_ERR(0, 860, __pyx_L3_error)
23859 for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
23860 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("helicalElementVelocityEval3", 1, 9, 9, i); __PYX_ERR(0, 860, __pyx_L3_error) }
23861 }
23862 } else if (unlikely(__pyx_nargs != 9)) {
23863 goto __pyx_L5_argtuple_error;
23864 } else {
23865 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23866 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 860, __pyx_L3_error)
23867 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23868 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 860, __pyx_L3_error)
23869 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23870 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 860, __pyx_L3_error)
23871 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23872 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 860, __pyx_L3_error)
23873 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23874 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 860, __pyx_L3_error)
23875 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
23876 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 860, __pyx_L3_error)
23877 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
23878 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 860, __pyx_L3_error)
23879 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
23880 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 860, __pyx_L3_error)
23881 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
23882 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 860, __pyx_L3_error)
23883 }
23884 __pyx_v_transient = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_transient == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L3_error)
23885 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
23886 __pyx_v_tForReversal = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_tForReversal == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
23887 __pyx_v_clock = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_clock == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
23888 __pyx_v_zVelocity = __Pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_zVelocity == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
23889 __pyx_v_xc = __Pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_xc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L3_error)
23890 __pyx_v_yc = __Pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_yc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L3_error)
23891 __pyx_v_x = ((PyArrayObject *)values[7]);
23892 __pyx_v_v = ((PyArrayObject *)values[8]);
23893 }
23894 goto __pyx_L6_skip;
23895 __pyx_L5_argtuple_error:;
23896 __Pyx_RaiseArgtupleInvalid("helicalElementVelocityEval3", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 860, __pyx_L3_error)
23897 __pyx_L6_skip:;
23898 goto __pyx_L4_argument_unpacking_done;
23899 __pyx_L3_error:;
23900 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23901 Py_XDECREF(values[__pyx_temp]);
23902 }
23903 __Pyx_AddTraceback("subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
23904 __Pyx_RefNannyFinishContext();
23905 return NULL;
23906 __pyx_L4_argument_unpacking_done:;
23907 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
23908 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 867, __pyx_L1_error)
23909 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
23910
23911 /* function exit code */
23912 goto __pyx_L0;
23913 __pyx_L1_error:;
23914 __pyx_r = NULL;
23915 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23916 Py_XDECREF(values[__pyx_temp]);
23917 }
23918 goto __pyx_L7_cleaned_up;
23919 __pyx_L0:;
23920 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23921 Py_XDECREF(values[__pyx_temp]);
23922 }
23923 __pyx_L7_cleaned_up:;
23924
23925
23926
23927
23928
23929
23930
23931 __Pyx_RefNannyFinishContext();
23932 return __pyx_r;
23933}
23934
23935static 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) {
23936 int __pyx_v_eN;
23937 int __pyx_v_k;
23938 double __pyx_v_pi;
23939 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
23940 __Pyx_Buffer __pyx_pybuffer_v;
23941 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
23942 __Pyx_Buffer __pyx_pybuffer_x;
23943 PyObject *__pyx_r = NULL;
23944 __Pyx_RefNannyDeclarations
23945 int __pyx_t_1;
23946 npy_intp __pyx_t_2;
23947 npy_intp __pyx_t_3;
23948 int __pyx_t_4;
23949 npy_intp __pyx_t_5;
23950 npy_intp __pyx_t_6;
23951 int __pyx_t_7;
23952 Py_ssize_t __pyx_t_8;
23953 Py_ssize_t __pyx_t_9;
23954 Py_ssize_t __pyx_t_10;
23955 int __pyx_t_11;
23956 Py_ssize_t __pyx_t_12;
23957 Py_ssize_t __pyx_t_13;
23958 Py_ssize_t __pyx_t_14;
23959 PyObject *__pyx_t_15 = NULL;
23960 PyObject *__pyx_t_16 = NULL;
23961 PyObject *__pyx_t_17 = NULL;
23962 double __pyx_t_18;
23963 double __pyx_t_19;
23964 PyObject *__pyx_t_20 = NULL;
23965 int __pyx_lineno = 0;
23966 const char *__pyx_filename = NULL;
23967 int __pyx_clineno = 0;
23968 __Pyx_RefNannySetupContext("helicalElementVelocityEval3", 0);
23969 __pyx_pybuffer_x.pybuffer.buf = NULL;
23970 __pyx_pybuffer_x.refcount = 0;
23971 __pyx_pybuffernd_x.data = NULL;
23972 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
23973 __pyx_pybuffer_v.pybuffer.buf = NULL;
23974 __pyx_pybuffer_v.refcount = 0;
23975 __pyx_pybuffernd_v.data = NULL;
23976 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
23977 {
23978 __Pyx_BufFmt_StackElem __pyx_stack[1];
23979 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, 860, __pyx_L1_error)
23980 }
23981 __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];
23982 {
23983 __Pyx_BufFmt_StackElem __pyx_stack[1];
23984 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 860, __pyx_L1_error)
23985 }
23986 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
23987
23988 /* "subsurfaceTransportFunctions.pyx":870
23989 * cdef int eN,k
23990 * cdef double pi
23991 * pi = M_PI # <<<<<<<<<<<<<<
23992 * if transient == 1:
23993 * for eN in range(x.shape[0]):
23994*/
23995 __pyx_v_pi = M_PI;
23996
23997 /* "subsurfaceTransportFunctions.pyx":871
23998 * cdef double pi
23999 * pi = M_PI
24000 * if transient == 1: # <<<<<<<<<<<<<<
24001 * for eN in range(x.shape[0]):
24002 * for k in range(x.shape[1]):
24003*/
24004 __pyx_t_1 = (__pyx_v_transient == 1);
24005
24006 if (__pyx_t_1) {
24007
24008
24009 /* "subsurfaceTransportFunctions.pyx":872
24010 * pi = M_PI
24011 * if transient == 1:
24012 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
24013 * for k in range(x.shape[1]):
24014 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24015*/
24016
24017 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
24018 __pyx_t_3 = __pyx_t_2;
24019
24020 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24021 __pyx_v_eN = __pyx_t_4;
24022
24023 /* "subsurfaceTransportFunctions.pyx":873
24024 * if transient == 1:
24025 * for eN in range(x.shape[0]):
24026 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
24027 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24028 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
24029*/
24030
24031 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
24032 __pyx_t_6 = __pyx_t_5;
24033
24034 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
24035 __pyx_v_k = __pyx_t_7;
24036
24037 /* "subsurfaceTransportFunctions.pyx":874
24038 * for eN in range(x.shape[0]):
24039 * for k in range(x.shape[1]):
24040 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc) # <<<<<<<<<<<<<<
24041 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
24042 * v[eN,k,2]=zVelocity
24043*/
24044 __pyx_t_8 = __pyx_v_eN;
24045 __pyx_t_9 = __pyx_v_k;
24046 __pyx_t_10 = 1;
24047 __pyx_t_11 = -1;
24048 if (__pyx_t_8 < 0) {
24049 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
24050 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
24051 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
24052 if (__pyx_t_9 < 0) {
24053 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
24054 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
24055 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
24056 if (__pyx_t_10 < 0) {
24057 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
24058 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
24059 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
24060 if (unlikely(__pyx_t_11 != -1)) {
24061 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24062 __PYX_ERR(0, 874, __pyx_L1_error)
24063 }
24064 __pyx_t_12 = __pyx_v_eN;
24065 __pyx_t_13 = __pyx_v_k;
24066 __pyx_t_14 = 0;
24067 __pyx_t_11 = -1;
24068 if (__pyx_t_12 < 0) {
24069 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
24070 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
24071 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
24072 if (__pyx_t_13 < 0) {
24073 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
24074 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
24075 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
24076 if (__pyx_t_14 < 0) {
24077 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
24078 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
24079 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
24080 if (unlikely(__pyx_t_11 != -1)) {
24081 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24082 __PYX_ERR(0, 874, __pyx_L1_error)
24083 }
24084 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
24085
24086 /* "subsurfaceTransportFunctions.pyx":875
24087 * for k in range(x.shape[1]):
24088 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24089 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0]) # <<<<<<<<<<<<<<
24090 * v[eN,k,2]=zVelocity
24091 * v[eN,k,:]*=clock*cos(pi*t/(tForReversal*2.0))
24092*/
24093 __pyx_t_10 = __pyx_v_eN;
24094 __pyx_t_9 = __pyx_v_k;
24095 __pyx_t_8 = 0;
24096 __pyx_t_11 = -1;
24097 if (__pyx_t_10 < 0) {
24098 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
24099 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
24100 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
24101 if (__pyx_t_9 < 0) {
24102 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
24103 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
24104 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
24105 if (__pyx_t_8 < 0) {
24106 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
24107 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
24108 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
24109 if (unlikely(__pyx_t_11 != -1)) {
24110 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24111 __PYX_ERR(0, 875, __pyx_L1_error)
24112 }
24113 __pyx_t_14 = __pyx_v_eN;
24114 __pyx_t_13 = __pyx_v_k;
24115 __pyx_t_12 = 1;
24116 __pyx_t_11 = -1;
24117 if (__pyx_t_14 < 0) {
24118 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
24119 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
24120 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
24121 if (__pyx_t_13 < 0) {
24122 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
24123 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
24124 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
24125 if (__pyx_t_12 < 0) {
24126 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
24127 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
24128 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
24129 if (unlikely(__pyx_t_11 != -1)) {
24130 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24131 __PYX_ERR(0, 875, __pyx_L1_error)
24132 }
24133 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
24134
24135 /* "subsurfaceTransportFunctions.pyx":876
24136 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24137 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
24138 * v[eN,k,2]=zVelocity # <<<<<<<<<<<<<<
24139 * v[eN,k,:]*=clock*cos(pi*t/(tForReversal*2.0))
24140 * else:
24141*/
24142 __pyx_t_8 = __pyx_v_eN;
24143 __pyx_t_9 = __pyx_v_k;
24144 __pyx_t_10 = 2;
24145 __pyx_t_11 = -1;
24146 if (__pyx_t_8 < 0) {
24147 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
24148 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
24149 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
24150 if (__pyx_t_9 < 0) {
24151 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
24152 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
24153 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
24154 if (__pyx_t_10 < 0) {
24155 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
24156 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
24157 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
24158 if (unlikely(__pyx_t_11 != -1)) {
24159 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24160 __PYX_ERR(0, 876, __pyx_L1_error)
24161 }
24162 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
24163
24164 /* "subsurfaceTransportFunctions.pyx":877
24165 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
24166 * v[eN,k,2]=zVelocity
24167 * v[eN,k,:]*=clock*cos(pi*t/(tForReversal*2.0)) # <<<<<<<<<<<<<<
24168 * else:
24169 * for eN in range(x.shape[0]):
24170*/
24171 __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 877, __pyx_L1_error)
24172 __Pyx_GOTREF(__pyx_t_15);
24173 __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 877, __pyx_L1_error)
24174 __Pyx_GOTREF(__pyx_t_16);
24175 __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 877, __pyx_L1_error)
24176 __Pyx_GOTREF(__pyx_t_17);
24177 __Pyx_GIVEREF(__pyx_t_15);
24178 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15) != (0)) __PYX_ERR(0, 877, __pyx_L1_error);
24179 __Pyx_GIVEREF(__pyx_t_16);
24180 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 877, __pyx_L1_error);
24181 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
24182 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
24183 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 877, __pyx_L1_error);
24184 __pyx_t_15 = 0;
24185 __pyx_t_16 = 0;
24186 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 877, __pyx_L1_error)
24187 __Pyx_GOTREF(__pyx_t_16);
24188 __pyx_t_18 = (__pyx_v_pi * __pyx_v_t);
24189
24190 __pyx_t_19 = (__pyx_v_tForReversal * 2.0);
24191
24192 if (unlikely(__pyx_t_19 == 0)) {
24193 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
24194 __PYX_ERR(0, 877, __pyx_L1_error)
24195 }
24196 __pyx_t_15 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_18 / __pyx_t_19)))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 877, __pyx_L1_error)
24197 __Pyx_GOTREF(__pyx_t_15);
24198
24199
24200 __pyx_t_20 = __Pyx_PyNumber_InPlaceMultiply_object_float(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 877, __pyx_L1_error)
24201 __Pyx_GOTREF(__pyx_t_20);
24202 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
24203 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24204 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0))) __PYX_ERR(0, 877, __pyx_L1_error)
24205 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
24206 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24207 }
24208
24209 }
24210
24211
24212 /* "subsurfaceTransportFunctions.pyx":871
24213 * cdef double pi
24214 * pi = M_PI
24215 * if transient == 1: # <<<<<<<<<<<<<<
24216 * for eN in range(x.shape[0]):
24217 * for k in range(x.shape[1]):
24218*/
24219 goto __pyx_L3;
24220 }
24221
24222 /* "subsurfaceTransportFunctions.pyx":879
24223 * v[eN,k,:]*=clock*cos(pi*t/(tForReversal*2.0))
24224 * else:
24225 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
24226 * for k in range(x.shape[1]):
24227 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24228*/
24229 /*else*/ {
24230
24231 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
24232 __pyx_t_3 = __pyx_t_2;
24233
24234 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24235 __pyx_v_eN = __pyx_t_4;
24236
24237 /* "subsurfaceTransportFunctions.pyx":880
24238 * else:
24239 * for eN in range(x.shape[0]):
24240 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
24241 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24242 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
24243*/
24244
24245 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
24246 __pyx_t_6 = __pyx_t_5;
24247
24248 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
24249 __pyx_v_k = __pyx_t_7;
24250
24251 /* "subsurfaceTransportFunctions.pyx":881
24252 * for eN in range(x.shape[0]):
24253 * for k in range(x.shape[1]):
24254 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc) # <<<<<<<<<<<<<<
24255 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
24256 * v[eN,k,2]=zVelocity
24257*/
24258 __pyx_t_10 = __pyx_v_eN;
24259 __pyx_t_9 = __pyx_v_k;
24260 __pyx_t_8 = 1;
24261 __pyx_t_11 = -1;
24262 if (__pyx_t_10 < 0) {
24263 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
24264 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
24265 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
24266 if (__pyx_t_9 < 0) {
24267 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
24268 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
24269 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
24270 if (__pyx_t_8 < 0) {
24271 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
24272 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
24273 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
24274 if (unlikely(__pyx_t_11 != -1)) {
24275 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24276 __PYX_ERR(0, 881, __pyx_L1_error)
24277 }
24278 __pyx_t_12 = __pyx_v_eN;
24279 __pyx_t_13 = __pyx_v_k;
24280 __pyx_t_14 = 0;
24281 __pyx_t_11 = -1;
24282 if (__pyx_t_12 < 0) {
24283 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
24284 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
24285 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
24286 if (__pyx_t_13 < 0) {
24287 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
24288 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
24289 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
24290 if (__pyx_t_14 < 0) {
24291 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
24292 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
24293 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
24294 if (unlikely(__pyx_t_11 != -1)) {
24295 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24296 __PYX_ERR(0, 881, __pyx_L1_error)
24297 }
24298 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
24299
24300 /* "subsurfaceTransportFunctions.pyx":882
24301 * for k in range(x.shape[1]):
24302 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24303 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0]) # <<<<<<<<<<<<<<
24304 * v[eN,k,2]=zVelocity
24305 *
24306*/
24307 __pyx_t_8 = __pyx_v_eN;
24308 __pyx_t_9 = __pyx_v_k;
24309 __pyx_t_10 = 0;
24310 __pyx_t_11 = -1;
24311 if (__pyx_t_8 < 0) {
24312 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
24313 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
24314 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
24315 if (__pyx_t_9 < 0) {
24316 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
24317 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
24318 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
24319 if (__pyx_t_10 < 0) {
24320 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
24321 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
24322 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
24323 if (unlikely(__pyx_t_11 != -1)) {
24324 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24325 __PYX_ERR(0, 882, __pyx_L1_error)
24326 }
24327 __pyx_t_14 = __pyx_v_eN;
24328 __pyx_t_13 = __pyx_v_k;
24329 __pyx_t_12 = 1;
24330 __pyx_t_11 = -1;
24331 if (__pyx_t_14 < 0) {
24332 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
24333 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
24334 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
24335 if (__pyx_t_13 < 0) {
24336 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
24337 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
24338 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
24339 if (__pyx_t_12 < 0) {
24340 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
24341 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
24342 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
24343 if (unlikely(__pyx_t_11 != -1)) {
24344 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24345 __PYX_ERR(0, 882, __pyx_L1_error)
24346 }
24347 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
24348
24349 /* "subsurfaceTransportFunctions.pyx":883
24350 * v[eN,k,0]=2.0*pi*(x[eN,k,1]-xc)
24351 * v[eN,k,1]=2.0*pi*(yc-x[eN,k,0])
24352 * v[eN,k,2]=zVelocity # <<<<<<<<<<<<<<
24353 *
24354 * def helicalElementVelocityEval4(int transient,
24355*/
24356 __pyx_t_10 = __pyx_v_eN;
24357 __pyx_t_9 = __pyx_v_k;
24358 __pyx_t_8 = 2;
24359 __pyx_t_11 = -1;
24360 if (__pyx_t_10 < 0) {
24361 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
24362 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
24363 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
24364 if (__pyx_t_9 < 0) {
24365 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
24366 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
24367 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
24368 if (__pyx_t_8 < 0) {
24369 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
24370 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
24371 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
24372 if (unlikely(__pyx_t_11 != -1)) {
24373 __Pyx_RaiseBufferIndexError(__pyx_t_11);
24374 __PYX_ERR(0, 883, __pyx_L1_error)
24375 }
24376 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
24377 }
24378
24379 }
24380
24381 }
24382 __pyx_L3:;
24383
24384 /* "subsurfaceTransportFunctions.pyx":860
24385 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
24386 *
24387 * def helicalElementVelocityEval3(int transient, # <<<<<<<<<<<<<<
24388 * double t,
24389 * double tForReversal,
24390*/
24391
24392 /* function exit code */
24393 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24394 goto __pyx_L0;
24395 __pyx_L1_error:;
24396 __Pyx_XDECREF(__pyx_t_15);
24397 __Pyx_XDECREF(__pyx_t_16);
24398 __Pyx_XDECREF(__pyx_t_17);
24399 __Pyx_XDECREF(__pyx_t_20);
24400 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
24401 __Pyx_PyThreadState_declare
24402 __Pyx_PyThreadState_assign
24403 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
24404 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
24405 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
24406 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
24407 __Pyx_AddTraceback("subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
24408 __pyx_r = NULL;
24409 goto __pyx_L2;
24410 __pyx_L0:;
24411 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
24412 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
24413 __pyx_L2:;
24414
24415
24416
24417
24418
24419
24420
24421 __Pyx_XGIVEREF(__pyx_r);
24422 __Pyx_RefNannyFinishContext();
24423 return __pyx_r;
24424}
24425
24426/* "subsurfaceTransportFunctions.pyx":885
24427 * v[eN,k,2]=zVelocity
24428 *
24429 * def helicalElementVelocityEval4(int transient, # <<<<<<<<<<<<<<
24430 * double t,
24431 * double tForReversal,
24432*/
24433
24434/* Python wrapper */
24435static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self,
24436#if CYTHON_VECTORCALL
24437PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24438#else
24439PyObject *__pyx_args, PyObject *__pyx_kwds
24440#endif
24441); /*proto*/
24442static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {"helicalElementVelocityEval4", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24443static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self,
24444#if CYTHON_VECTORCALL
24445PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24446#else
24447PyObject *__pyx_args, PyObject *__pyx_kwds
24448#endif
24449) {
24450 int __pyx_v_transient;
24451 double __pyx_v_t;
24452 double __pyx_v_tForReversal;
24453 double __pyx_v_clock;
24454 double __pyx_v_zVelocity;
24455 double __pyx_v_xc;
24456 double __pyx_v_yc;
24457 PyArrayObject *__pyx_v_x = 0;
24458 PyArrayObject *__pyx_v_v = 0;
24459 #if !CYTHON_VECTORCALL
24460 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24461 #endif
24462 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24463 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
24464 int __pyx_lineno = 0;
24465 const char *__pyx_filename = NULL;
24466 int __pyx_clineno = 0;
24467 PyObject *__pyx_r = 0;
24468 __Pyx_RefNannyDeclarations
24469 __Pyx_RefNannySetupContext("helicalElementVelocityEval4 (wrapper)", 0);
24470 #if !CYTHON_VECTORCALL
24471 #if CYTHON_ASSUME_SAFE_SIZE
24472 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24473 #else
24474 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24475 #endif
24476 #endif
24477 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24478 {
24479 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_transient,&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_tForReversal,&__pyx_mstate_global->__pyx_n_u_clock,&__pyx_mstate_global->__pyx_n_u_zVelocity,&__pyx_mstate_global->__pyx_n_u_xc,&__pyx_mstate_global->__pyx_n_u_yc,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,0};
24480 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24481 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 885, __pyx_L3_error)
24482 if (__pyx_kwds_len > 0) {
24483 switch (__pyx_nargs) {
24484 case 9:
24485 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
24486 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 885, __pyx_L3_error)
24487 CYTHON_FALLTHROUGH;
24488 case 8:
24489 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
24490 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 885, __pyx_L3_error)
24491 CYTHON_FALLTHROUGH;
24492 case 7:
24493 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
24494 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 885, __pyx_L3_error)
24495 CYTHON_FALLTHROUGH;
24496 case 6:
24497 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24498 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 885, __pyx_L3_error)
24499 CYTHON_FALLTHROUGH;
24500 case 5:
24501 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24502 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 885, __pyx_L3_error)
24503 CYTHON_FALLTHROUGH;
24504 case 4:
24505 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24506 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 885, __pyx_L3_error)
24507 CYTHON_FALLTHROUGH;
24508 case 3:
24509 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24510 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 885, __pyx_L3_error)
24511 CYTHON_FALLTHROUGH;
24512 case 2:
24513 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24514 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 885, __pyx_L3_error)
24515 CYTHON_FALLTHROUGH;
24516 case 1:
24517 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24518 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 885, __pyx_L3_error)
24519 CYTHON_FALLTHROUGH;
24520 case 0: break;
24521 default: goto __pyx_L5_argtuple_error;
24522 }
24523 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24524 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "helicalElementVelocityEval4", 0) < (0)) __PYX_ERR(0, 885, __pyx_L3_error)
24525 for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
24526 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("helicalElementVelocityEval4", 1, 9, 9, i); __PYX_ERR(0, 885, __pyx_L3_error) }
24527 }
24528 } else if (unlikely(__pyx_nargs != 9)) {
24529 goto __pyx_L5_argtuple_error;
24530 } else {
24531 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24532 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 885, __pyx_L3_error)
24533 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24534 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 885, __pyx_L3_error)
24535 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24536 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 885, __pyx_L3_error)
24537 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24538 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 885, __pyx_L3_error)
24539 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24540 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 885, __pyx_L3_error)
24541 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24542 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 885, __pyx_L3_error)
24543 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
24544 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 885, __pyx_L3_error)
24545 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
24546 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 885, __pyx_L3_error)
24547 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
24548 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 885, __pyx_L3_error)
24549 }
24550 __pyx_v_transient = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_transient == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error)
24551 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error)
24552 __pyx_v_tForReversal = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_tForReversal == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error)
24553 __pyx_v_clock = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_clock == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
24554 __pyx_v_zVelocity = __Pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_zVelocity == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
24555 __pyx_v_xc = __Pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_xc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error)
24556 __pyx_v_yc = __Pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_yc == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error)
24557 __pyx_v_x = ((PyArrayObject *)values[7]);
24558 __pyx_v_v = ((PyArrayObject *)values[8]);
24559 }
24560 goto __pyx_L6_skip;
24561 __pyx_L5_argtuple_error:;
24562 __Pyx_RaiseArgtupleInvalid("helicalElementVelocityEval4", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 885, __pyx_L3_error)
24563 __pyx_L6_skip:;
24564 goto __pyx_L4_argument_unpacking_done;
24565 __pyx_L3_error:;
24566 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24567 Py_XDECREF(values[__pyx_temp]);
24568 }
24569 __Pyx_AddTraceback("subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
24570 __Pyx_RefNannyFinishContext();
24571 return NULL;
24572 __pyx_L4_argument_unpacking_done:;
24573 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
24574 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 892, __pyx_L1_error)
24575 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
24576
24577 /* function exit code */
24578 goto __pyx_L0;
24579 __pyx_L1_error:;
24580 __pyx_r = NULL;
24581 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24582 Py_XDECREF(values[__pyx_temp]);
24583 }
24584 goto __pyx_L7_cleaned_up;
24585 __pyx_L0:;
24586 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24587 Py_XDECREF(values[__pyx_temp]);
24588 }
24589 __pyx_L7_cleaned_up:;
24590
24591
24592
24593
24594
24595
24596
24597 __Pyx_RefNannyFinishContext();
24598 return __pyx_r;
24599}
24600
24601static 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) {
24602 int __pyx_v_eN;
24603 int __pyx_v_ebN;
24604 int __pyx_v_k;
24605 double __pyx_v_pi;
24606 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
24607 __Pyx_Buffer __pyx_pybuffer_v;
24608 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
24609 __Pyx_Buffer __pyx_pybuffer_x;
24610 PyObject *__pyx_r = NULL;
24611 __Pyx_RefNannyDeclarations
24612 int __pyx_t_1;
24613 npy_intp __pyx_t_2;
24614 npy_intp __pyx_t_3;
24615 int __pyx_t_4;
24616 npy_intp __pyx_t_5;
24617 npy_intp __pyx_t_6;
24618 int __pyx_t_7;
24619 npy_intp __pyx_t_8;
24620 npy_intp __pyx_t_9;
24621 int __pyx_t_10;
24622 Py_ssize_t __pyx_t_11;
24623 Py_ssize_t __pyx_t_12;
24624 Py_ssize_t __pyx_t_13;
24625 Py_ssize_t __pyx_t_14;
24626 int __pyx_t_15;
24627 Py_ssize_t __pyx_t_16;
24628 Py_ssize_t __pyx_t_17;
24629 Py_ssize_t __pyx_t_18;
24630 Py_ssize_t __pyx_t_19;
24631 PyObject *__pyx_t_20 = NULL;
24632 PyObject *__pyx_t_21 = NULL;
24633 PyObject *__pyx_t_22 = NULL;
24634 PyObject *__pyx_t_23 = NULL;
24635 double __pyx_t_24;
24636 double __pyx_t_25;
24637 int __pyx_lineno = 0;
24638 const char *__pyx_filename = NULL;
24639 int __pyx_clineno = 0;
24640 __Pyx_RefNannySetupContext("helicalElementVelocityEval4", 0);
24641 __pyx_pybuffer_x.pybuffer.buf = NULL;
24642 __pyx_pybuffer_x.refcount = 0;
24643 __pyx_pybuffernd_x.data = NULL;
24644 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
24645 __pyx_pybuffer_v.pybuffer.buf = NULL;
24646 __pyx_pybuffer_v.refcount = 0;
24647 __pyx_pybuffernd_v.data = NULL;
24648 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
24649 {
24650 __Pyx_BufFmt_StackElem __pyx_stack[1];
24651 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, 885, __pyx_L1_error)
24652 }
24653 __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];
24654 {
24655 __Pyx_BufFmt_StackElem __pyx_stack[1];
24656 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 885, __pyx_L1_error)
24657 }
24658 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
24659
24660 /* "subsurfaceTransportFunctions.pyx":895
24661 * cdef int eN,ebN,k
24662 * cdef double pi
24663 * pi = M_PI # <<<<<<<<<<<<<<
24664 * if transient == 1:
24665 * for eN in range(x.shape[0]):
24666*/
24667 __pyx_v_pi = M_PI;
24668
24669 /* "subsurfaceTransportFunctions.pyx":896
24670 * cdef double pi
24671 * pi = M_PI
24672 * if transient == 1: # <<<<<<<<<<<<<<
24673 * for eN in range(x.shape[0]):
24674 * for ebN in range(x.shape[1]):
24675*/
24676 __pyx_t_1 = (__pyx_v_transient == 1);
24677
24678 if (__pyx_t_1) {
24679
24680
24681 /* "subsurfaceTransportFunctions.pyx":897
24682 * pi = M_PI
24683 * if transient == 1:
24684 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
24685 * for ebN in range(x.shape[1]):
24686 * for k in range(x.shape[2]):
24687*/
24688
24689 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
24690 __pyx_t_3 = __pyx_t_2;
24691
24692 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24693 __pyx_v_eN = __pyx_t_4;
24694
24695 /* "subsurfaceTransportFunctions.pyx":898
24696 * if transient == 1:
24697 * for eN in range(x.shape[0]):
24698 * for ebN in range(x.shape[1]): # <<<<<<<<<<<<<<
24699 * for k in range(x.shape[2]):
24700 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
24701*/
24702
24703 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
24704 __pyx_t_6 = __pyx_t_5;
24705
24706 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
24707 __pyx_v_ebN = __pyx_t_7;
24708
24709 /* "subsurfaceTransportFunctions.pyx":899
24710 * for eN in range(x.shape[0]):
24711 * for ebN in range(x.shape[1]):
24712 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
24713 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
24714 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
24715*/
24716
24717 __pyx_t_8 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
24718 __pyx_t_9 = __pyx_t_8;
24719
24720 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
24721 __pyx_v_k = __pyx_t_10;
24722
24723 /* "subsurfaceTransportFunctions.pyx":900
24724 * for ebN in range(x.shape[1]):
24725 * for k in range(x.shape[2]):
24726 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc) # <<<<<<<<<<<<<<
24727 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
24728 * v[eN,ebN,k,2]=zVelocity
24729*/
24730 __pyx_t_11 = __pyx_v_eN;
24731 __pyx_t_12 = __pyx_v_ebN;
24732 __pyx_t_13 = __pyx_v_k;
24733 __pyx_t_14 = 1;
24734 __pyx_t_15 = -1;
24735 if (__pyx_t_11 < 0) {
24736 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
24737 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
24738 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
24739 if (__pyx_t_12 < 0) {
24740 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
24741 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
24742 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
24743 if (__pyx_t_13 < 0) {
24744 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
24745 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
24746 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
24747 if (__pyx_t_14 < 0) {
24748 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
24749 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
24750 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
24751 if (unlikely(__pyx_t_15 != -1)) {
24752 __Pyx_RaiseBufferIndexError(__pyx_t_15);
24753 __PYX_ERR(0, 900, __pyx_L1_error)
24754 }
24755 __pyx_t_16 = __pyx_v_eN;
24756 __pyx_t_17 = __pyx_v_ebN;
24757 __pyx_t_18 = __pyx_v_k;
24758 __pyx_t_19 = 0;
24759 __pyx_t_15 = -1;
24760 if (__pyx_t_16 < 0) {
24761 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
24762 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
24763 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
24764 if (__pyx_t_17 < 0) {
24765 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
24766 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
24767 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
24768 if (__pyx_t_18 < 0) {
24769 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
24770 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
24771 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
24772 if (__pyx_t_19 < 0) {
24773 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
24774 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
24775 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
24776 if (unlikely(__pyx_t_15 != -1)) {
24777 __Pyx_RaiseBufferIndexError(__pyx_t_15);
24778 __PYX_ERR(0, 900, __pyx_L1_error)
24779 }
24780 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
24781
24782 /* "subsurfaceTransportFunctions.pyx":901
24783 * for k in range(x.shape[2]):
24784 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
24785 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0]) # <<<<<<<<<<<<<<
24786 * v[eN,ebN,k,2]=zVelocity
24787 * v[eN,ebN,k,:]*=clock*cos(pi*t/(tForReversal*2.0))
24788*/
24789 __pyx_t_14 = __pyx_v_eN;
24790 __pyx_t_13 = __pyx_v_ebN;
24791 __pyx_t_12 = __pyx_v_k;
24792 __pyx_t_11 = 0;
24793 __pyx_t_15 = -1;
24794 if (__pyx_t_14 < 0) {
24795 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
24796 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24797 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
24798 if (__pyx_t_13 < 0) {
24799 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
24800 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
24801 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
24802 if (__pyx_t_12 < 0) {
24803 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
24804 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
24805 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
24806 if (__pyx_t_11 < 0) {
24807 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
24808 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
24809 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
24810 if (unlikely(__pyx_t_15 != -1)) {
24811 __Pyx_RaiseBufferIndexError(__pyx_t_15);
24812 __PYX_ERR(0, 901, __pyx_L1_error)
24813 }
24814 __pyx_t_19 = __pyx_v_eN;
24815 __pyx_t_18 = __pyx_v_ebN;
24816 __pyx_t_17 = __pyx_v_k;
24817 __pyx_t_16 = 1;
24818 __pyx_t_15 = -1;
24819 if (__pyx_t_19 < 0) {
24820 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
24821 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
24822 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
24823 if (__pyx_t_18 < 0) {
24824 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
24825 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
24826 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
24827 if (__pyx_t_17 < 0) {
24828 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
24829 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
24830 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
24831 if (__pyx_t_16 < 0) {
24832 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
24833 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
24834 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
24835 if (unlikely(__pyx_t_15 != -1)) {
24836 __Pyx_RaiseBufferIndexError(__pyx_t_15);
24837 __PYX_ERR(0, 901, __pyx_L1_error)
24838 }
24839 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
24840
24841 /* "subsurfaceTransportFunctions.pyx":902
24842 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
24843 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
24844 * v[eN,ebN,k,2]=zVelocity # <<<<<<<<<<<<<<
24845 * v[eN,ebN,k,:]*=clock*cos(pi*t/(tForReversal*2.0))
24846 * else:
24847*/
24848 __pyx_t_11 = __pyx_v_eN;
24849 __pyx_t_12 = __pyx_v_ebN;
24850 __pyx_t_13 = __pyx_v_k;
24851 __pyx_t_14 = 2;
24852 __pyx_t_15 = -1;
24853 if (__pyx_t_11 < 0) {
24854 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
24855 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
24856 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
24857 if (__pyx_t_12 < 0) {
24858 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
24859 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
24860 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
24861 if (__pyx_t_13 < 0) {
24862 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
24863 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
24864 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
24865 if (__pyx_t_14 < 0) {
24866 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
24867 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
24868 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
24869 if (unlikely(__pyx_t_15 != -1)) {
24870 __Pyx_RaiseBufferIndexError(__pyx_t_15);
24871 __PYX_ERR(0, 902, __pyx_L1_error)
24872 }
24873 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
24874
24875 /* "subsurfaceTransportFunctions.pyx":903
24876 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
24877 * v[eN,ebN,k,2]=zVelocity
24878 * v[eN,ebN,k,:]*=clock*cos(pi*t/(tForReversal*2.0)) # <<<<<<<<<<<<<<
24879 * else:
24880 * for eN in range(x.shape[0]):
24881*/
24882 __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 903, __pyx_L1_error)
24883 __Pyx_GOTREF(__pyx_t_20);
24884 __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_ebN); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 903, __pyx_L1_error)
24885 __Pyx_GOTREF(__pyx_t_21);
24886 __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_k); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 903, __pyx_L1_error)
24887 __Pyx_GOTREF(__pyx_t_22);
24888 __pyx_t_23 = PyTuple_New(4); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 903, __pyx_L1_error)
24889 __Pyx_GOTREF(__pyx_t_23);
24890 __Pyx_GIVEREF(__pyx_t_20);
24891 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20) != (0)) __PYX_ERR(0, 903, __pyx_L1_error);
24892 __Pyx_GIVEREF(__pyx_t_21);
24893 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21) != (0)) __PYX_ERR(0, 903, __pyx_L1_error);
24894 __Pyx_GIVEREF(__pyx_t_22);
24895 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22) != (0)) __PYX_ERR(0, 903, __pyx_L1_error);
24896 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
24897 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
24898 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 903, __pyx_L1_error);
24899 __pyx_t_20 = 0;
24900 __pyx_t_21 = 0;
24901 __pyx_t_22 = 0;
24902 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 903, __pyx_L1_error)
24903 __Pyx_GOTREF(__pyx_t_22);
24904 __pyx_t_24 = (__pyx_v_pi * __pyx_v_t);
24905
24906 __pyx_t_25 = (__pyx_v_tForReversal * 2.0);
24907
24908 if (unlikely(__pyx_t_25 == 0)) {
24909 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
24910 __PYX_ERR(0, 903, __pyx_L1_error)
24911 }
24912 __pyx_t_21 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_24 / __pyx_t_25)))); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 903, __pyx_L1_error)
24913 __Pyx_GOTREF(__pyx_t_21);
24914
24915
24916 __pyx_t_20 = __Pyx_PyNumber_InPlaceMultiply_object_float(__pyx_t_22, __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 903, __pyx_L1_error)
24917 __Pyx_GOTREF(__pyx_t_20);
24918 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
24919 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
24920 if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0))) __PYX_ERR(0, 903, __pyx_L1_error)
24921 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
24922 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
24923 }
24924
24925 }
24926
24927 }
24928
24929
24930 /* "subsurfaceTransportFunctions.pyx":896
24931 * cdef double pi
24932 * pi = M_PI
24933 * if transient == 1: # <<<<<<<<<<<<<<
24934 * for eN in range(x.shape[0]):
24935 * for ebN in range(x.shape[1]):
24936*/
24937 goto __pyx_L3;
24938 }
24939
24940 /* "subsurfaceTransportFunctions.pyx":905
24941 * v[eN,ebN,k,:]*=clock*cos(pi*t/(tForReversal*2.0))
24942 * else:
24943 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
24944 * for ebN in range(x.shape[1]):
24945 * for k in range(x.shape[2]):
24946*/
24947 /*else*/ {
24948
24949 __pyx_t_2 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
24950 __pyx_t_3 = __pyx_t_2;
24951
24952 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24953 __pyx_v_eN = __pyx_t_4;
24954
24955 /* "subsurfaceTransportFunctions.pyx":906
24956 * else:
24957 * for eN in range(x.shape[0]):
24958 * for ebN in range(x.shape[1]): # <<<<<<<<<<<<<<
24959 * for k in range(x.shape[2]):
24960 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
24961*/
24962
24963 __pyx_t_5 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
24964 __pyx_t_6 = __pyx_t_5;
24965
24966 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
24967 __pyx_v_ebN = __pyx_t_7;
24968
24969 /* "subsurfaceTransportFunctions.pyx":907
24970 * for eN in range(x.shape[0]):
24971 * for ebN in range(x.shape[1]):
24972 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
24973 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
24974 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
24975*/
24976
24977 __pyx_t_8 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
24978 __pyx_t_9 = __pyx_t_8;
24979
24980 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
24981 __pyx_v_k = __pyx_t_10;
24982
24983 /* "subsurfaceTransportFunctions.pyx":908
24984 * for ebN in range(x.shape[1]):
24985 * for k in range(x.shape[2]):
24986 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc) # <<<<<<<<<<<<<<
24987 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
24988 * v[eN,ebN,k,2]=zVelocity
24989*/
24990 __pyx_t_14 = __pyx_v_eN;
24991 __pyx_t_13 = __pyx_v_ebN;
24992 __pyx_t_12 = __pyx_v_k;
24993 __pyx_t_11 = 1;
24994 __pyx_t_15 = -1;
24995 if (__pyx_t_14 < 0) {
24996 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
24997 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
24998 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
24999 if (__pyx_t_13 < 0) {
25000 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
25001 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
25002 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
25003 if (__pyx_t_12 < 0) {
25004 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
25005 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
25006 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
25007 if (__pyx_t_11 < 0) {
25008 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
25009 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
25010 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
25011 if (unlikely(__pyx_t_15 != -1)) {
25012 __Pyx_RaiseBufferIndexError(__pyx_t_15);
25013 __PYX_ERR(0, 908, __pyx_L1_error)
25014 }
25015 __pyx_t_16 = __pyx_v_eN;
25016 __pyx_t_17 = __pyx_v_ebN;
25017 __pyx_t_18 = __pyx_v_k;
25018 __pyx_t_19 = 0;
25019 __pyx_t_15 = -1;
25020 if (__pyx_t_16 < 0) {
25021 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
25022 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
25023 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
25024 if (__pyx_t_17 < 0) {
25025 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
25026 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
25027 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
25028 if (__pyx_t_18 < 0) {
25029 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
25030 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
25031 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
25032 if (__pyx_t_19 < 0) {
25033 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
25034 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
25035 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
25036 if (unlikely(__pyx_t_15 != -1)) {
25037 __Pyx_RaiseBufferIndexError(__pyx_t_15);
25038 __PYX_ERR(0, 908, __pyx_L1_error)
25039 }
25040 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
25041
25042 /* "subsurfaceTransportFunctions.pyx":909
25043 * for k in range(x.shape[2]):
25044 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
25045 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0]) # <<<<<<<<<<<<<<
25046 * v[eN,ebN,k,2]=zVelocity
25047 *
25048*/
25049 __pyx_t_11 = __pyx_v_eN;
25050 __pyx_t_12 = __pyx_v_ebN;
25051 __pyx_t_13 = __pyx_v_k;
25052 __pyx_t_14 = 0;
25053 __pyx_t_15 = -1;
25054 if (__pyx_t_11 < 0) {
25055 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
25056 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
25057 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
25058 if (__pyx_t_12 < 0) {
25059 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
25060 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
25061 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
25062 if (__pyx_t_13 < 0) {
25063 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
25064 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
25065 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
25066 if (__pyx_t_14 < 0) {
25067 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
25068 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
25069 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
25070 if (unlikely(__pyx_t_15 != -1)) {
25071 __Pyx_RaiseBufferIndexError(__pyx_t_15);
25072 __PYX_ERR(0, 909, __pyx_L1_error)
25073 }
25074 __pyx_t_19 = __pyx_v_eN;
25075 __pyx_t_18 = __pyx_v_ebN;
25076 __pyx_t_17 = __pyx_v_k;
25077 __pyx_t_16 = 1;
25078 __pyx_t_15 = -1;
25079 if (__pyx_t_19 < 0) {
25080 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
25081 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
25082 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
25083 if (__pyx_t_18 < 0) {
25084 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
25085 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
25086 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
25087 if (__pyx_t_17 < 0) {
25088 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
25089 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
25090 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
25091 if (__pyx_t_16 < 0) {
25092 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
25093 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
25094 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
25095 if (unlikely(__pyx_t_15 != -1)) {
25096 __Pyx_RaiseBufferIndexError(__pyx_t_15);
25097 __PYX_ERR(0, 909, __pyx_L1_error)
25098 }
25099 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
25100
25101 /* "subsurfaceTransportFunctions.pyx":910
25102 * v[eN,ebN,k,0]=2.0*pi*(x[eN,ebN,k,1]-xc)
25103 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
25104 * v[eN,ebN,k,2]=zVelocity # <<<<<<<<<<<<<<
25105 *
25106 * def vortexElementVelocityEval3(double t,
25107*/
25108 __pyx_t_14 = __pyx_v_eN;
25109 __pyx_t_13 = __pyx_v_ebN;
25110 __pyx_t_12 = __pyx_v_k;
25111 __pyx_t_11 = 2;
25112 __pyx_t_15 = -1;
25113 if (__pyx_t_14 < 0) {
25114 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
25115 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
25116 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
25117 if (__pyx_t_13 < 0) {
25118 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
25119 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
25120 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
25121 if (__pyx_t_12 < 0) {
25122 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
25123 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
25124 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
25125 if (__pyx_t_11 < 0) {
25126 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
25127 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
25128 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
25129 if (unlikely(__pyx_t_15 != -1)) {
25130 __Pyx_RaiseBufferIndexError(__pyx_t_15);
25131 __PYX_ERR(0, 910, __pyx_L1_error)
25132 }
25133 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
25134 }
25135
25136 }
25137
25138 }
25139
25140 }
25141 __pyx_L3:;
25142
25143 /* "subsurfaceTransportFunctions.pyx":885
25144 * v[eN,k,2]=zVelocity
25145 *
25146 * def helicalElementVelocityEval4(int transient, # <<<<<<<<<<<<<<
25147 * double t,
25148 * double tForReversal,
25149*/
25150
25151 /* function exit code */
25152 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25153 goto __pyx_L0;
25154 __pyx_L1_error:;
25155 __Pyx_XDECREF(__pyx_t_20);
25156 __Pyx_XDECREF(__pyx_t_21);
25157 __Pyx_XDECREF(__pyx_t_22);
25158 __Pyx_XDECREF(__pyx_t_23);
25159 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
25160 __Pyx_PyThreadState_declare
25161 __Pyx_PyThreadState_assign
25162 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
25163 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
25164 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
25165 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
25166 __Pyx_AddTraceback("subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
25167 __pyx_r = NULL;
25168 goto __pyx_L2;
25169 __pyx_L0:;
25170 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
25171 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
25172 __pyx_L2:;
25173
25174
25175
25176
25177
25178
25179
25180
25181 __Pyx_XGIVEREF(__pyx_r);
25182 __Pyx_RefNannyFinishContext();
25183 return __pyx_r;
25184}
25185
25186/* "subsurfaceTransportFunctions.pyx":912
25187 * v[eN,ebN,k,2]=zVelocity
25188 *
25189 * def vortexElementVelocityEval3(double t, # <<<<<<<<<<<<<<
25190 * numpy.ndarray[DTYPE_t,ndim=3] x,
25191 * numpy.ndarray[DTYPE_t,ndim=3] v):
25192*/
25193
25194/* Python wrapper */
25195static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self,
25196#if CYTHON_VECTORCALL
25197PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25198#else
25199PyObject *__pyx_args, PyObject *__pyx_kwds
25200#endif
25201); /*proto*/
25202static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {"vortexElementVelocityEval3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
25203static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self,
25204#if CYTHON_VECTORCALL
25205PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25206#else
25207PyObject *__pyx_args, PyObject *__pyx_kwds
25208#endif
25209) {
25210 double __pyx_v_t;
25211 PyArrayObject *__pyx_v_x = 0;
25212 PyArrayObject *__pyx_v_v = 0;
25213 #if !CYTHON_VECTORCALL
25214 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25215 #endif
25216 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
25217 PyObject* values[3] = {0,0,0};
25218 int __pyx_lineno = 0;
25219 const char *__pyx_filename = NULL;
25220 int __pyx_clineno = 0;
25221 PyObject *__pyx_r = 0;
25222 __Pyx_RefNannyDeclarations
25223 __Pyx_RefNannySetupContext("vortexElementVelocityEval3 (wrapper)", 0);
25224 #if !CYTHON_VECTORCALL
25225 #if CYTHON_ASSUME_SAFE_SIZE
25226 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25227 #else
25228 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
25229 #endif
25230 #endif
25231 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25232 {
25233 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,0};
25234 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25235 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 912, __pyx_L3_error)
25236 if (__pyx_kwds_len > 0) {
25237 switch (__pyx_nargs) {
25238 case 3:
25239 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25240 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 912, __pyx_L3_error)
25241 CYTHON_FALLTHROUGH;
25242 case 2:
25243 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25244 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 912, __pyx_L3_error)
25245 CYTHON_FALLTHROUGH;
25246 case 1:
25247 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25248 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 912, __pyx_L3_error)
25249 CYTHON_FALLTHROUGH;
25250 case 0: break;
25251 default: goto __pyx_L5_argtuple_error;
25252 }
25253 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25254 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "vortexElementVelocityEval3", 0) < (0)) __PYX_ERR(0, 912, __pyx_L3_error)
25255 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
25256 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("vortexElementVelocityEval3", 1, 3, 3, i); __PYX_ERR(0, 912, __pyx_L3_error) }
25257 }
25258 } else if (unlikely(__pyx_nargs != 3)) {
25259 goto __pyx_L5_argtuple_error;
25260 } else {
25261 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25262 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 912, __pyx_L3_error)
25263 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25264 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 912, __pyx_L3_error)
25265 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25266 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 912, __pyx_L3_error)
25267 }
25268 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 912, __pyx_L3_error)
25269 __pyx_v_x = ((PyArrayObject *)values[1]);
25270 __pyx_v_v = ((PyArrayObject *)values[2]);
25271 }
25272 goto __pyx_L6_skip;
25273 __pyx_L5_argtuple_error:;
25274 __Pyx_RaiseArgtupleInvalid("vortexElementVelocityEval3", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 912, __pyx_L3_error)
25275 __pyx_L6_skip:;
25276 goto __pyx_L4_argument_unpacking_done;
25277 __pyx_L3_error:;
25278 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25279 Py_XDECREF(values[__pyx_temp]);
25280 }
25281 __Pyx_AddTraceback("subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
25282 __Pyx_RefNannyFinishContext();
25283 return NULL;
25284 __pyx_L4_argument_unpacking_done:;
25285 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
25286 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 914, __pyx_L1_error)
25287 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
25288
25289 /* function exit code */
25290 goto __pyx_L0;
25291 __pyx_L1_error:;
25292 __pyx_r = NULL;
25293 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25294 Py_XDECREF(values[__pyx_temp]);
25295 }
25296 goto __pyx_L7_cleaned_up;
25297 __pyx_L0:;
25298 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25299 Py_XDECREF(values[__pyx_temp]);
25300 }
25301 __pyx_L7_cleaned_up:;
25302
25303 __Pyx_RefNannyFinishContext();
25304 return __pyx_r;
25305}
25306
25307static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
25308 int __pyx_v_eN;
25309 int __pyx_v_k;
25310 double __pyx_v_pi;
25311 double __pyx_v_one8;
25312 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
25313 __Pyx_Buffer __pyx_pybuffer_v;
25314 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
25315 __Pyx_Buffer __pyx_pybuffer_x;
25316 PyObject *__pyx_r = NULL;
25317 __Pyx_RefNannyDeclarations
25318 npy_intp __pyx_t_1;
25319 npy_intp __pyx_t_2;
25320 int __pyx_t_3;
25321 npy_intp __pyx_t_4;
25322 npy_intp __pyx_t_5;
25323 int __pyx_t_6;
25324 Py_ssize_t __pyx_t_7;
25325 Py_ssize_t __pyx_t_8;
25326 Py_ssize_t __pyx_t_9;
25327 int __pyx_t_10;
25328 Py_ssize_t __pyx_t_11;
25329 Py_ssize_t __pyx_t_12;
25330 Py_ssize_t __pyx_t_13;
25331 Py_ssize_t __pyx_t_14;
25332 Py_ssize_t __pyx_t_15;
25333 Py_ssize_t __pyx_t_16;
25334 Py_ssize_t __pyx_t_17;
25335 Py_ssize_t __pyx_t_18;
25336 Py_ssize_t __pyx_t_19;
25337 int __pyx_lineno = 0;
25338 const char *__pyx_filename = NULL;
25339 int __pyx_clineno = 0;
25340 __Pyx_RefNannySetupContext("vortexElementVelocityEval3", 0);
25341 __pyx_pybuffer_x.pybuffer.buf = NULL;
25342 __pyx_pybuffer_x.refcount = 0;
25343 __pyx_pybuffernd_x.data = NULL;
25344 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
25345 __pyx_pybuffer_v.pybuffer.buf = NULL;
25346 __pyx_pybuffer_v.refcount = 0;
25347 __pyx_pybuffernd_v.data = NULL;
25348 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
25349 {
25350 __Pyx_BufFmt_StackElem __pyx_stack[1];
25351 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, 912, __pyx_L1_error)
25352 }
25353 __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];
25354 {
25355 __Pyx_BufFmt_StackElem __pyx_stack[1];
25356 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 912, __pyx_L1_error)
25357 }
25358 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
25359
25360 /* "subsurfaceTransportFunctions.pyx":917
25361 * cdef int eN,k
25362 * cdef double pi,one8
25363 * pi = M_PI # <<<<<<<<<<<<<<
25364 * one8 = 1.0/8.0
25365 * for eN in range(x.shape[0]):
25366*/
25367 __pyx_v_pi = M_PI;
25368
25369 /* "subsurfaceTransportFunctions.pyx":918
25370 * cdef double pi,one8
25371 * pi = M_PI
25372 * one8 = 1.0/8.0 # <<<<<<<<<<<<<<
25373 * for eN in range(x.shape[0]):
25374 * for k in range(x.shape[1]):
25375*/
25376 __pyx_v_one8 = (1.0 / 8.0);
25377
25378 /* "subsurfaceTransportFunctions.pyx":919
25379 * pi = M_PI
25380 * one8 = 1.0/8.0
25381 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
25382 * for k in range(x.shape[1]):
25383 * v[eN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,k,1])*sin(pi*x[eN,k,0])*sin(pi*x[eN,k,0]);
25384*/
25385
25386 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
25387 __pyx_t_2 = __pyx_t_1;
25388
25389 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
25390 __pyx_v_eN = __pyx_t_3;
25391
25392 /* "subsurfaceTransportFunctions.pyx":920
25393 * one8 = 1.0/8.0
25394 * for eN in range(x.shape[0]):
25395 * for k in range(x.shape[1]): # <<<<<<<<<<<<<<
25396 * v[eN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,k,1])*sin(pi*x[eN,k,0])*sin(pi*x[eN,k,0]);
25397 * v[eN,k,1]=-cos(pi*one8*t)*sin(2.0*pi*x[eN,k,0])*sin(pi*x[eN,k,1])*sin(pi*x[eN,k,1]);
25398*/
25399
25400 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
25401 __pyx_t_5 = __pyx_t_4;
25402
25403 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25404 __pyx_v_k = __pyx_t_6;
25405
25406 /* "subsurfaceTransportFunctions.pyx":921
25407 * for eN in range(x.shape[0]):
25408 * for k in range(x.shape[1]):
25409 * v[eN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,k,1])*sin(pi*x[eN,k,0])*sin(pi*x[eN,k,0]); # <<<<<<<<<<<<<<
25410 * v[eN,k,1]=-cos(pi*one8*t)*sin(2.0*pi*x[eN,k,0])*sin(pi*x[eN,k,1])*sin(pi*x[eN,k,1]);
25411 *
25412*/
25413 __pyx_t_7 = __pyx_v_eN;
25414 __pyx_t_8 = __pyx_v_k;
25415 __pyx_t_9 = 1;
25416 __pyx_t_10 = -1;
25417 if (__pyx_t_7 < 0) {
25418 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
25419 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 0;
25420 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
25421 if (__pyx_t_8 < 0) {
25422 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
25423 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
25424 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
25425 if (__pyx_t_9 < 0) {
25426 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
25427 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 2;
25428 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
25429 if (unlikely(__pyx_t_10 != -1)) {
25430 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25431 __PYX_ERR(0, 921, __pyx_L1_error)
25432 }
25433 __pyx_t_11 = __pyx_v_eN;
25434 __pyx_t_12 = __pyx_v_k;
25435 __pyx_t_13 = 0;
25436 __pyx_t_10 = -1;
25437 if (__pyx_t_11 < 0) {
25438 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
25439 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
25440 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
25441 if (__pyx_t_12 < 0) {
25442 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
25443 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
25444 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
25445 if (__pyx_t_13 < 0) {
25446 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
25447 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 2;
25448 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
25449 if (unlikely(__pyx_t_10 != -1)) {
25450 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25451 __PYX_ERR(0, 921, __pyx_L1_error)
25452 }
25453 __pyx_t_14 = __pyx_v_eN;
25454 __pyx_t_15 = __pyx_v_k;
25455 __pyx_t_16 = 0;
25456 __pyx_t_10 = -1;
25457 if (__pyx_t_14 < 0) {
25458 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
25459 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
25460 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
25461 if (__pyx_t_15 < 0) {
25462 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
25463 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
25464 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
25465 if (__pyx_t_16 < 0) {
25466 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
25467 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 2;
25468 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
25469 if (unlikely(__pyx_t_10 != -1)) {
25470 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25471 __PYX_ERR(0, 921, __pyx_L1_error)
25472 }
25473 __pyx_t_17 = __pyx_v_eN;
25474 __pyx_t_18 = __pyx_v_k;
25475 __pyx_t_19 = 0;
25476 __pyx_t_10 = -1;
25477 if (__pyx_t_17 < 0) {
25478 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[0].shape;
25479 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
25480 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
25481 if (__pyx_t_18 < 0) {
25482 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
25483 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
25484 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
25485 if (__pyx_t_19 < 0) {
25486 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[2].shape;
25487 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 2;
25488 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
25489 if (unlikely(__pyx_t_10 != -1)) {
25490 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25491 __PYX_ERR(0, 921, __pyx_L1_error)
25492 }
25493 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides)))));
25494
25495 /* "subsurfaceTransportFunctions.pyx":922
25496 * for k in range(x.shape[1]):
25497 * v[eN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,k,1])*sin(pi*x[eN,k,0])*sin(pi*x[eN,k,0]);
25498 * v[eN,k,1]=-cos(pi*one8*t)*sin(2.0*pi*x[eN,k,0])*sin(pi*x[eN,k,1])*sin(pi*x[eN,k,1]); # <<<<<<<<<<<<<<
25499 *
25500 *
25501*/
25502 __pyx_t_16 = __pyx_v_eN;
25503 __pyx_t_15 = __pyx_v_k;
25504 __pyx_t_14 = 0;
25505 __pyx_t_10 = -1;
25506 if (__pyx_t_16 < 0) {
25507 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape;
25508 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
25509 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
25510 if (__pyx_t_15 < 0) {
25511 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
25512 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
25513 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
25514 if (__pyx_t_14 < 0) {
25515 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
25516 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 2;
25517 } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
25518 if (unlikely(__pyx_t_10 != -1)) {
25519 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25520 __PYX_ERR(0, 922, __pyx_L1_error)
25521 }
25522 __pyx_t_13 = __pyx_v_eN;
25523 __pyx_t_12 = __pyx_v_k;
25524 __pyx_t_11 = 1;
25525 __pyx_t_10 = -1;
25526 if (__pyx_t_13 < 0) {
25527 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
25528 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
25529 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
25530 if (__pyx_t_12 < 0) {
25531 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
25532 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
25533 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
25534 if (__pyx_t_11 < 0) {
25535 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
25536 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 2;
25537 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
25538 if (unlikely(__pyx_t_10 != -1)) {
25539 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25540 __PYX_ERR(0, 922, __pyx_L1_error)
25541 }
25542 __pyx_t_9 = __pyx_v_eN;
25543 __pyx_t_8 = __pyx_v_k;
25544 __pyx_t_7 = 1;
25545 __pyx_t_10 = -1;
25546 if (__pyx_t_9 < 0) {
25547 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[0].shape;
25548 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
25549 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
25550 if (__pyx_t_8 < 0) {
25551 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
25552 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
25553 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
25554 if (__pyx_t_7 < 0) {
25555 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[2].shape;
25556 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 2;
25557 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
25558 if (unlikely(__pyx_t_10 != -1)) {
25559 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25560 __PYX_ERR(0, 922, __pyx_L1_error)
25561 }
25562 __pyx_t_19 = __pyx_v_eN;
25563 __pyx_t_18 = __pyx_v_k;
25564 __pyx_t_17 = 1;
25565 __pyx_t_10 = -1;
25566 if (__pyx_t_19 < 0) {
25567 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
25568 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
25569 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
25570 if (__pyx_t_18 < 0) {
25571 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
25572 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
25573 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
25574 if (__pyx_t_17 < 0) {
25575 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
25576 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 2;
25577 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
25578 if (unlikely(__pyx_t_10 != -1)) {
25579 __Pyx_RaiseBufferIndexError(__pyx_t_10);
25580 __PYX_ERR(0, 922, __pyx_L1_error)
25581 }
25582 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[2].strides)))));
25583 }
25584
25585 }
25586
25587
25588 /* "subsurfaceTransportFunctions.pyx":912
25589 * v[eN,ebN,k,2]=zVelocity
25590 *
25591 * def vortexElementVelocityEval3(double t, # <<<<<<<<<<<<<<
25592 * numpy.ndarray[DTYPE_t,ndim=3] x,
25593 * numpy.ndarray[DTYPE_t,ndim=3] v):
25594*/
25595
25596 /* function exit code */
25597 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25598 goto __pyx_L0;
25599 __pyx_L1_error:;
25600 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
25601 __Pyx_PyThreadState_declare
25602 __Pyx_PyThreadState_assign
25603 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
25604 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
25605 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
25606 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
25607 __Pyx_AddTraceback("subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
25608 __pyx_r = NULL;
25609 goto __pyx_L2;
25610 __pyx_L0:;
25611 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
25612 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
25613 __pyx_L2:;
25614
25615
25616
25617
25618
25619
25620
25621
25622 __Pyx_XGIVEREF(__pyx_r);
25623 __Pyx_RefNannyFinishContext();
25624 return __pyx_r;
25625}
25626
25627/* "subsurfaceTransportFunctions.pyx":925
25628 *
25629 *
25630 * def vortexElementVelocityEval4(double t, # <<<<<<<<<<<<<<
25631 * numpy.ndarray[DTYPE_t,ndim=4] x,
25632 * numpy.ndarray[DTYPE_t,ndim=4] v):
25633*/
25634
25635/* Python wrapper */
25636static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self,
25637#if CYTHON_VECTORCALL
25638PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25639#else
25640PyObject *__pyx_args, PyObject *__pyx_kwds
25641#endif
25642); /*proto*/
25643static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {"vortexElementVelocityEval4", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
25644static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self,
25645#if CYTHON_VECTORCALL
25646PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25647#else
25648PyObject *__pyx_args, PyObject *__pyx_kwds
25649#endif
25650) {
25651 double __pyx_v_t;
25652 PyArrayObject *__pyx_v_x = 0;
25653 PyArrayObject *__pyx_v_v = 0;
25654 #if !CYTHON_VECTORCALL
25655 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25656 #endif
25657 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
25658 PyObject* values[3] = {0,0,0};
25659 int __pyx_lineno = 0;
25660 const char *__pyx_filename = NULL;
25661 int __pyx_clineno = 0;
25662 PyObject *__pyx_r = 0;
25663 __Pyx_RefNannyDeclarations
25664 __Pyx_RefNannySetupContext("vortexElementVelocityEval4 (wrapper)", 0);
25665 #if !CYTHON_VECTORCALL
25666 #if CYTHON_ASSUME_SAFE_SIZE
25667 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25668 #else
25669 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
25670 #endif
25671 #endif
25672 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25673 {
25674 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,0};
25675 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25676 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 925, __pyx_L3_error)
25677 if (__pyx_kwds_len > 0) {
25678 switch (__pyx_nargs) {
25679 case 3:
25680 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25681 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 925, __pyx_L3_error)
25682 CYTHON_FALLTHROUGH;
25683 case 2:
25684 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25685 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 925, __pyx_L3_error)
25686 CYTHON_FALLTHROUGH;
25687 case 1:
25688 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25689 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 925, __pyx_L3_error)
25690 CYTHON_FALLTHROUGH;
25691 case 0: break;
25692 default: goto __pyx_L5_argtuple_error;
25693 }
25694 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25695 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "vortexElementVelocityEval4", 0) < (0)) __PYX_ERR(0, 925, __pyx_L3_error)
25696 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
25697 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("vortexElementVelocityEval4", 1, 3, 3, i); __PYX_ERR(0, 925, __pyx_L3_error) }
25698 }
25699 } else if (unlikely(__pyx_nargs != 3)) {
25700 goto __pyx_L5_argtuple_error;
25701 } else {
25702 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25703 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 925, __pyx_L3_error)
25704 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25705 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 925, __pyx_L3_error)
25706 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25707 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 925, __pyx_L3_error)
25708 }
25709 __pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 925, __pyx_L3_error)
25710 __pyx_v_x = ((PyArrayObject *)values[1]);
25711 __pyx_v_v = ((PyArrayObject *)values[2]);
25712 }
25713 goto __pyx_L6_skip;
25714 __pyx_L5_argtuple_error:;
25715 __Pyx_RaiseArgtupleInvalid("vortexElementVelocityEval4", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 925, __pyx_L3_error)
25716 __pyx_L6_skip:;
25717 goto __pyx_L4_argument_unpacking_done;
25718 __pyx_L3_error:;
25719 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25720 Py_XDECREF(values[__pyx_temp]);
25721 }
25722 __Pyx_AddTraceback("subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
25723 __Pyx_RefNannyFinishContext();
25724 return NULL;
25725 __pyx_L4_argument_unpacking_done:;
25726 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
25727 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 927, __pyx_L1_error)
25728 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
25729
25730 /* function exit code */
25731 goto __pyx_L0;
25732 __pyx_L1_error:;
25733 __pyx_r = NULL;
25734 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25735 Py_XDECREF(values[__pyx_temp]);
25736 }
25737 goto __pyx_L7_cleaned_up;
25738 __pyx_L0:;
25739 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25740 Py_XDECREF(values[__pyx_temp]);
25741 }
25742 __pyx_L7_cleaned_up:;
25743
25744 __Pyx_RefNannyFinishContext();
25745 return __pyx_r;
25746}
25747
25748static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
25749 int __pyx_v_eN;
25750 int __pyx_v_k;
25751 int __pyx_v_ebN;
25752 double __pyx_v_pi;
25753 double __pyx_v_one8;
25754 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
25755 __Pyx_Buffer __pyx_pybuffer_v;
25756 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
25757 __Pyx_Buffer __pyx_pybuffer_x;
25758 PyObject *__pyx_r = NULL;
25759 __Pyx_RefNannyDeclarations
25760 npy_intp __pyx_t_1;
25761 npy_intp __pyx_t_2;
25762 int __pyx_t_3;
25763 npy_intp __pyx_t_4;
25764 npy_intp __pyx_t_5;
25765 int __pyx_t_6;
25766 npy_intp __pyx_t_7;
25767 npy_intp __pyx_t_8;
25768 int __pyx_t_9;
25769 Py_ssize_t __pyx_t_10;
25770 Py_ssize_t __pyx_t_11;
25771 Py_ssize_t __pyx_t_12;
25772 Py_ssize_t __pyx_t_13;
25773 int __pyx_t_14;
25774 Py_ssize_t __pyx_t_15;
25775 Py_ssize_t __pyx_t_16;
25776 Py_ssize_t __pyx_t_17;
25777 Py_ssize_t __pyx_t_18;
25778 Py_ssize_t __pyx_t_19;
25779 Py_ssize_t __pyx_t_20;
25780 Py_ssize_t __pyx_t_21;
25781 Py_ssize_t __pyx_t_22;
25782 Py_ssize_t __pyx_t_23;
25783 Py_ssize_t __pyx_t_24;
25784 Py_ssize_t __pyx_t_25;
25785 Py_ssize_t __pyx_t_26;
25786 int __pyx_lineno = 0;
25787 const char *__pyx_filename = NULL;
25788 int __pyx_clineno = 0;
25789 __Pyx_RefNannySetupContext("vortexElementVelocityEval4", 0);
25790 __pyx_pybuffer_x.pybuffer.buf = NULL;
25791 __pyx_pybuffer_x.refcount = 0;
25792 __pyx_pybuffernd_x.data = NULL;
25793 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
25794 __pyx_pybuffer_v.pybuffer.buf = NULL;
25795 __pyx_pybuffer_v.refcount = 0;
25796 __pyx_pybuffernd_v.data = NULL;
25797 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
25798 {
25799 __Pyx_BufFmt_StackElem __pyx_stack[1];
25800 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, 925, __pyx_L1_error)
25801 }
25802 __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];
25803 {
25804 __Pyx_BufFmt_StackElem __pyx_stack[1];
25805 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 925, __pyx_L1_error)
25806 }
25807 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
25808
25809 /* "subsurfaceTransportFunctions.pyx":930
25810 * cdef int eN,k,ebN
25811 * cdef double pi,one8
25812 * pi = M_PI # <<<<<<<<<<<<<<
25813 * one8 = 1.0/8.0
25814 * for eN in range(x.shape[0]):
25815*/
25816 __pyx_v_pi = M_PI;
25817
25818 /* "subsurfaceTransportFunctions.pyx":931
25819 * cdef double pi,one8
25820 * pi = M_PI
25821 * one8 = 1.0/8.0 # <<<<<<<<<<<<<<
25822 * for eN in range(x.shape[0]):
25823 * for ebN in range(x.shape[1]):
25824*/
25825 __pyx_v_one8 = (1.0 / 8.0);
25826
25827 /* "subsurfaceTransportFunctions.pyx":932
25828 * pi = M_PI
25829 * one8 = 1.0/8.0
25830 * for eN in range(x.shape[0]): # <<<<<<<<<<<<<<
25831 * for ebN in range(x.shape[1]):
25832 * for k in range(x.shape[2]):
25833*/
25834
25835 __pyx_t_1 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[0]);
25836 __pyx_t_2 = __pyx_t_1;
25837
25838 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
25839 __pyx_v_eN = __pyx_t_3;
25840
25841 /* "subsurfaceTransportFunctions.pyx":933
25842 * one8 = 1.0/8.0
25843 * for eN in range(x.shape[0]):
25844 * for ebN in range(x.shape[1]): # <<<<<<<<<<<<<<
25845 * for k in range(x.shape[2]):
25846 * v[eN,ebN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,ebN,k,1])*sin(pi*x[eN,ebN,k,0])*sin(pi*x[eN,ebN,k,0]);
25847*/
25848
25849 __pyx_t_4 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[1]);
25850 __pyx_t_5 = __pyx_t_4;
25851
25852 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25853 __pyx_v_ebN = __pyx_t_6;
25854
25855 /* "subsurfaceTransportFunctions.pyx":934
25856 * for eN in range(x.shape[0]):
25857 * for ebN in range(x.shape[1]):
25858 * for k in range(x.shape[2]): # <<<<<<<<<<<<<<
25859 * v[eN,ebN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,ebN,k,1])*sin(pi*x[eN,ebN,k,0])*sin(pi*x[eN,ebN,k,0]);
25860 * v[eN,ebN,k,1]=-cos(pi*one8*t)*sin(2.0*pi*x[eN,ebN,k,0])*sin(pi*x[eN,ebN,k,1])*sin(pi*x[eN,ebN,k,1]);
25861*/
25862
25863 __pyx_t_7 = (__pyx_f_5numpy_7ndarray_5shape___get__(((PyArrayObject *)__pyx_v_x))[2]);
25864 __pyx_t_8 = __pyx_t_7;
25865
25866 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
25867 __pyx_v_k = __pyx_t_9;
25868
25869 /* "subsurfaceTransportFunctions.pyx":935
25870 * for ebN in range(x.shape[1]):
25871 * for k in range(x.shape[2]):
25872 * v[eN,ebN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,ebN,k,1])*sin(pi*x[eN,ebN,k,0])*sin(pi*x[eN,ebN,k,0]); # <<<<<<<<<<<<<<
25873 * v[eN,ebN,k,1]=-cos(pi*one8*t)*sin(2.0*pi*x[eN,ebN,k,0])*sin(pi*x[eN,ebN,k,1])*sin(pi*x[eN,ebN,k,1]);
25874 *
25875*/
25876 __pyx_t_10 = __pyx_v_eN;
25877 __pyx_t_11 = __pyx_v_ebN;
25878 __pyx_t_12 = __pyx_v_k;
25879 __pyx_t_13 = 1;
25880 __pyx_t_14 = -1;
25881 if (__pyx_t_10 < 0) {
25882 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
25883 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 0;
25884 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
25885 if (__pyx_t_11 < 0) {
25886 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[1].shape;
25887 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 1;
25888 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
25889 if (__pyx_t_12 < 0) {
25890 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
25891 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 2;
25892 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
25893 if (__pyx_t_13 < 0) {
25894 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[3].shape;
25895 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 3;
25896 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
25897 if (unlikely(__pyx_t_14 != -1)) {
25898 __Pyx_RaiseBufferIndexError(__pyx_t_14);
25899 __PYX_ERR(0, 935, __pyx_L1_error)
25900 }
25901 __pyx_t_15 = __pyx_v_eN;
25902 __pyx_t_16 = __pyx_v_ebN;
25903 __pyx_t_17 = __pyx_v_k;
25904 __pyx_t_18 = 0;
25905 __pyx_t_14 = -1;
25906 if (__pyx_t_15 < 0) {
25907 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
25908 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
25909 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
25910 if (__pyx_t_16 < 0) {
25911 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
25912 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
25913 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
25914 if (__pyx_t_17 < 0) {
25915 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
25916 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 2;
25917 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
25918 if (__pyx_t_18 < 0) {
25919 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[3].shape;
25920 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 3;
25921 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
25922 if (unlikely(__pyx_t_14 != -1)) {
25923 __Pyx_RaiseBufferIndexError(__pyx_t_14);
25924 __PYX_ERR(0, 935, __pyx_L1_error)
25925 }
25926 __pyx_t_19 = __pyx_v_eN;
25927 __pyx_t_20 = __pyx_v_ebN;
25928 __pyx_t_21 = __pyx_v_k;
25929 __pyx_t_22 = 0;
25930 __pyx_t_14 = -1;
25931 if (__pyx_t_19 < 0) {
25932 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape;
25933 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0;
25934 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
25935 if (__pyx_t_20 < 0) {
25936 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[1].shape;
25937 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 1;
25938 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
25939 if (__pyx_t_21 < 0) {
25940 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[2].shape;
25941 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
25942 } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
25943 if (__pyx_t_22 < 0) {
25944 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[3].shape;
25945 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 3;
25946 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
25947 if (unlikely(__pyx_t_14 != -1)) {
25948 __Pyx_RaiseBufferIndexError(__pyx_t_14);
25949 __PYX_ERR(0, 935, __pyx_L1_error)
25950 }
25951 __pyx_t_23 = __pyx_v_eN;
25952 __pyx_t_24 = __pyx_v_ebN;
25953 __pyx_t_25 = __pyx_v_k;
25954 __pyx_t_26 = 0;
25955 __pyx_t_14 = -1;
25956 if (__pyx_t_23 < 0) {
25957 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
25958 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
25959 } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
25960 if (__pyx_t_24 < 0) {
25961 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[1].shape;
25962 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
25963 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
25964 if (__pyx_t_25 < 0) {
25965 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[2].shape;
25966 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
25967 } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
25968 if (__pyx_t_26 < 0) {
25969 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[3].shape;
25970 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 3;
25971 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
25972 if (unlikely(__pyx_t_14 != -1)) {
25973 __Pyx_RaiseBufferIndexError(__pyx_t_14);
25974 __PYX_ERR(0, 935, __pyx_L1_error)
25975 }
25976 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[3].strides)))));
25977
25978 /* "subsurfaceTransportFunctions.pyx":936
25979 * for k in range(x.shape[2]):
25980 * v[eN,ebN,k,0]= cos(pi*one8*t)*sin(2.0*pi*x[eN,ebN,k,1])*sin(pi*x[eN,ebN,k,0])*sin(pi*x[eN,ebN,k,0]);
25981 * v[eN,ebN,k,1]=-cos(pi*one8*t)*sin(2.0*pi*x[eN,ebN,k,0])*sin(pi*x[eN,ebN,k,1])*sin(pi*x[eN,ebN,k,1]); # <<<<<<<<<<<<<<
25982 *
25983 *
25984*/
25985 __pyx_t_22 = __pyx_v_eN;
25986 __pyx_t_21 = __pyx_v_ebN;
25987 __pyx_t_20 = __pyx_v_k;
25988 __pyx_t_19 = 0;
25989 __pyx_t_14 = -1;
25990 if (__pyx_t_22 < 0) {
25991 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[0].shape;
25992 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 0;
25993 } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
25994 if (__pyx_t_21 < 0) {
25995 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
25996 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 1;
25997 } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
25998 if (__pyx_t_20 < 0) {
25999 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[2].shape;
26000 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 2;
26001 } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
26002 if (__pyx_t_19 < 0) {
26003 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[3].shape;
26004 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 3;
26005 } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
26006 if (unlikely(__pyx_t_14 != -1)) {
26007 __Pyx_RaiseBufferIndexError(__pyx_t_14);
26008 __PYX_ERR(0, 936, __pyx_L1_error)
26009 }
26010 __pyx_t_18 = __pyx_v_eN;
26011 __pyx_t_17 = __pyx_v_ebN;
26012 __pyx_t_16 = __pyx_v_k;
26013 __pyx_t_15 = 1;
26014 __pyx_t_14 = -1;
26015 if (__pyx_t_18 < 0) {
26016 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[0].shape;
26017 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 0;
26018 } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
26019 if (__pyx_t_17 < 0) {
26020 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[1].shape;
26021 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 1;
26022 } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
26023 if (__pyx_t_16 < 0) {
26024 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
26025 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 2;
26026 } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
26027 if (__pyx_t_15 < 0) {
26028 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[3].shape;
26029 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 3;
26030 } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
26031 if (unlikely(__pyx_t_14 != -1)) {
26032 __Pyx_RaiseBufferIndexError(__pyx_t_14);
26033 __PYX_ERR(0, 936, __pyx_L1_error)
26034 }
26035 __pyx_t_13 = __pyx_v_eN;
26036 __pyx_t_12 = __pyx_v_ebN;
26037 __pyx_t_11 = __pyx_v_k;
26038 __pyx_t_10 = 1;
26039 __pyx_t_14 = -1;
26040 if (__pyx_t_13 < 0) {
26041 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
26042 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
26043 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
26044 if (__pyx_t_12 < 0) {
26045 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
26046 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 1;
26047 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
26048 if (__pyx_t_11 < 0) {
26049 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
26050 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
26051 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
26052 if (__pyx_t_10 < 0) {
26053 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[3].shape;
26054 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 3;
26055 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
26056 if (unlikely(__pyx_t_14 != -1)) {
26057 __Pyx_RaiseBufferIndexError(__pyx_t_14);
26058 __PYX_ERR(0, 936, __pyx_L1_error)
26059 }
26060 __pyx_t_26 = __pyx_v_eN;
26061 __pyx_t_25 = __pyx_v_ebN;
26062 __pyx_t_24 = __pyx_v_k;
26063 __pyx_t_23 = 1;
26064 __pyx_t_14 = -1;
26065 if (__pyx_t_26 < 0) {
26066 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[0].shape;
26067 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0;
26068 } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
26069 if (__pyx_t_25 < 0) {
26070 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
26071 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 1;
26072 } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
26073 if (__pyx_t_24 < 0) {
26074 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[2].shape;
26075 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 2;
26076 } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
26077 if (__pyx_t_23 < 0) {
26078 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[3].shape;
26079 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 3;
26080 } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
26081 if (unlikely(__pyx_t_14 != -1)) {
26082 __Pyx_RaiseBufferIndexError(__pyx_t_14);
26083 __PYX_ERR(0, 936, __pyx_L1_error)
26084 }
26085 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[3].strides)))));
26086 }
26087
26088 }
26089
26090 }
26091
26092
26093 /* "subsurfaceTransportFunctions.pyx":925
26094 *
26095 *
26096 * def vortexElementVelocityEval4(double t, # <<<<<<<<<<<<<<
26097 * numpy.ndarray[DTYPE_t,ndim=4] x,
26098 * numpy.ndarray[DTYPE_t,ndim=4] v):
26099*/
26100
26101 /* function exit code */
26102 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26103 goto __pyx_L0;
26104 __pyx_L1_error:;
26105 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
26106 __Pyx_PyThreadState_declare
26107 __Pyx_PyThreadState_assign
26108 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
26109 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
26110 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
26111 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
26112 __Pyx_AddTraceback("subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
26113 __pyx_r = NULL;
26114 goto __pyx_L2;
26115 __pyx_L0:;
26116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
26117 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
26118 __pyx_L2:;
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128 __Pyx_XGIVEREF(__pyx_r);
26129 __Pyx_RefNannyFinishContext();
26130 return __pyx_r;
26131}
26132/* #### Code section: module_exttypes ### */
26133
26134static PyMethodDef __pyx_methods[] = {
26135 {0, 0, 0, 0}
26136};
26137/* #### Code section: initfunc_declarations ### */
26138static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
26139static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
26140static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
26141static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
26142static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
26143static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26144static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26145static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26146static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26147static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26148static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26149static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
26150/* #### Code section: init_module ### */
26151
26152static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
26153 __Pyx_RefNannyDeclarations
26154 CYTHON_UNUSED_VAR(__pyx_mstate);
26155 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
26156 /*--- Global init code ---*/
26157 __Pyx_RefNannyFinishContext();
26158 return 0;
26159}
26160
26161static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
26162 __Pyx_RefNannyDeclarations
26163 CYTHON_UNUSED_VAR(__pyx_mstate);
26164 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
26165 /*--- Variable export code ---*/
26166 __Pyx_RefNannyFinishContext();
26167 return 0;
26168}
26169
26170static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
26171 __Pyx_RefNannyDeclarations
26172 CYTHON_UNUSED_VAR(__pyx_mstate);
26173 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
26174 /*--- Function export code ---*/
26175 __Pyx_RefNannyFinishContext();
26176 return 0;
26177}
26178
26179static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
26180 __Pyx_RefNannyDeclarations
26181 PyObject *__pyx_t_1 = NULL;
26182 int __pyx_lineno = 0;
26183 const char *__pyx_filename = NULL;
26184 int __pyx_clineno = 0;
26185 CYTHON_UNUSED_VAR(__pyx_mstate);
26186 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
26187 /*--- Type import code ---*/
26188 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
26189 __Pyx_GOTREF(__pyx_t_1);
26190 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
26191 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26192 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
26193 #elif CYTHON_COMPILING_IN_LIMITED_API
26194 0, 0,
26195 #else
26196 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
26197 #endif
26198 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
26199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26200 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
26201 __Pyx_GOTREF(__pyx_t_1);
26202 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
26203 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26204 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26205 #elif CYTHON_COMPILING_IN_LIMITED_API
26206 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26207 #else
26208 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26209 #endif
26210 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
26211 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
26212 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26213 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26214 #elif CYTHON_COMPILING_IN_LIMITED_API
26215 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26216 #else
26217 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26218 #endif
26219 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
26220 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
26221 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26222 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26223 #elif CYTHON_COMPILING_IN_LIMITED_API
26224 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26225 #else
26226 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26227 #endif
26228 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
26229 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
26230 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26231 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26232 #elif CYTHON_COMPILING_IN_LIMITED_API
26233 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26234 #else
26235 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26236 #endif
26237 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
26238 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
26239 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26240 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26241 #elif CYTHON_COMPILING_IN_LIMITED_API
26242 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26243 #else
26244 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26245 #endif
26246 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
26247 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
26248 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26249 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26250 #elif CYTHON_COMPILING_IN_LIMITED_API
26251 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26252 #else
26253 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26254 #endif
26255 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
26256 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
26257 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26258 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26259 #elif CYTHON_COMPILING_IN_LIMITED_API
26260 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26261 #else
26262 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26263 #endif
26264 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
26265 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
26266 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26267 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26268 #elif CYTHON_COMPILING_IN_LIMITED_API
26269 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26270 #else
26271 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26272 #endif
26273 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
26274 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
26275 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26276 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26277 #elif CYTHON_COMPILING_IN_LIMITED_API
26278 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26279 #else
26280 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26281 #endif
26282 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
26283 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
26284 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26285 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26286 #elif CYTHON_COMPILING_IN_LIMITED_API
26287 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26288 #else
26289 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26290 #endif
26291 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
26292 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
26293 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26294 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26295 #elif CYTHON_COMPILING_IN_LIMITED_API
26296 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26297 #else
26298 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26299 #endif
26300 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
26301 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
26302 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26303 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26304 #elif CYTHON_COMPILING_IN_LIMITED_API
26305 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26306 #else
26307 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26308 #endif
26309 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
26310 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
26311 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26312 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26313 #elif CYTHON_COMPILING_IN_LIMITED_API
26314 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26315 #else
26316 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26317 #endif
26318 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
26319 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
26320 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26321 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26322 #elif CYTHON_COMPILING_IN_LIMITED_API
26323 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26324 #else
26325 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26326 #endif
26327 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
26328 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
26329 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26330 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26331 #elif CYTHON_COMPILING_IN_LIMITED_API
26332 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26333 #else
26334 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26335 #endif
26336 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
26337 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26338 __Pyx_RefNannyFinishContext();
26339 return 0;
26340 __pyx_L1_error:;
26341 __Pyx_XDECREF(__pyx_t_1);
26342 __Pyx_RefNannyFinishContext();
26343 return -1;
26344}
26345
26346static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
26347 __Pyx_RefNannyDeclarations
26348 CYTHON_UNUSED_VAR(__pyx_mstate);
26349 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
26350 /*--- Variable import code ---*/
26351 __Pyx_RefNannyFinishContext();
26352 return 0;
26353}
26354
26355static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
26356 __Pyx_RefNannyDeclarations
26357 CYTHON_UNUSED_VAR(__pyx_mstate);
26358 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
26359 /*--- Function import code ---*/
26360 __Pyx_RefNannyFinishContext();
26361 return 0;
26362}
26363
26364#if CYTHON_PEP489_MULTI_PHASE_INIT
26365static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
26366static int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject* module); /*proto*/
26367static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26368 {Py_mod_create, (void*)__pyx_pymod_create},
26369 {Py_mod_exec, (void*)__pyx_pymod_exec_subsurfaceTransportFunctions},
26370 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26371 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
26372 #endif
26373 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
26374 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
26375 #endif
26376 {0, NULL}
26377};
26378#endif
26379
26380#ifdef __cplusplus
26381namespace {
26382 struct PyModuleDef __pyx_moduledef =
26383 #else
26384 static struct PyModuleDef __pyx_moduledef =
26385 #endif
26386 {
26387 PyModuleDef_HEAD_INIT,
26388 "subsurfaceTransportFunctions",
26389 0, /* m_doc */
26390 #if CYTHON_USE_MODULE_STATE
26391 sizeof(__pyx_mstatetype), /* m_size */
26392 #else
26393 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
26394 #endif
26395 __pyx_methods /* m_methods */,
26396 #if CYTHON_PEP489_MULTI_PHASE_INIT
26397 __pyx_moduledef_slots, /* m_slots */
26398 #else
26399 NULL, /* m_reload */
26400 #endif
26401 #if CYTHON_USE_MODULE_STATE
26402 __pyx_m_traverse, /* m_traverse */
26403 __pyx_m_clear, /* m_clear */
26404 NULL /* m_free */
26405 #else
26406 NULL, /* m_traverse */
26407 NULL, /* m_clear */
26408 NULL /* m_free */
26409 #endif
26410 };
26411 #ifdef __cplusplus
26412} /* anonymous namespace */
26413#endif
26414
26415/* PyModInitFuncType */
26416#ifndef CYTHON_NO_PYINIT_EXPORT
26417 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
26418#else
26419 #ifdef __cplusplus
26420 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
26421 #else
26422 #define __Pyx_PyMODINIT_FUNC PyObject *
26423 #endif
26424#endif
26425
26426__Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void) CYTHON_SMALL_CODE; /*proto*/
26427__Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)
26428#if CYTHON_PEP489_MULTI_PHASE_INIT
26429{
26430 return PyModuleDef_Init(&__pyx_moduledef);
26431}
26432/* ModuleCreationPEP489 */
26433#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
26434 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
26435static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
26436 {
26437 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
26438 if (!module) {
26439 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
26440 goto bad; // BaseException
26441 }
26442 PyErr_Clear(); // just try the 3.8-3.12 version
26443 module = PyImport_ImportModule("_xxsubinterpreters");
26444 if (!module) goto bad;
26445 }
26446 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
26447 Py_DECREF(module);
26448 if (!current) goto bad;
26449 if (PyTuple_Check(current)) {
26450 PyObject *new_current = PySequence_GetItem(current, 0);
26451 Py_DECREF(current);
26452 current = new_current;
26453 if (!new_current) goto bad;
26454 }
26455 long long as_c_int = PyLong_AsLongLong(current);
26456 Py_DECREF(current);
26457 return as_c_int;
26458 }
26459 bad:
26460 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
26461 return -1;
26462}
26463#endif
26464#if !CYTHON_USE_MODULE_STATE
26465static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
26466 static PY_INT64_T main_interpreter_id = -1;
26467#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
26468 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
26469#elif CYTHON_COMPILING_IN_GRAAL
26470 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
26471#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
26472 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
26473 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
26474#elif CYTHON_COMPILING_IN_LIMITED_API
26475 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
26476#else
26477 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
26478#endif
26479 if (unlikely(current_id == -1)) {
26480 return -1;
26481 }
26482 if (main_interpreter_id == -1) {
26483 main_interpreter_id = current_id;
26484 return 0;
26485 } else if (unlikely(main_interpreter_id != current_id)) {
26486 PyErr_SetString(
26487 PyExc_ImportError,
26488 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
26489 return -1;
26490 }
26491 return 0;
26492}
26493#endif
26494static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
26495{
26496 PyObject *value = PyObject_GetAttrString(spec, from_name);
26497 int result = 0;
26498 if (likely(value)) {
26499 if (allow_none || value != Py_None) {
26500 result = PyDict_SetItemString(moddict, to_name, value);
26501 }
26502 Py_DECREF(value);
26503 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
26504 PyErr_Clear();
26505 } else {
26506 result = -1;
26507 }
26508 return result;
26509}
26510static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
26511 PyObject *module = NULL, *moddict, *modname;
26512 CYTHON_UNUSED_VAR(def);
26513 #if !CYTHON_USE_MODULE_STATE
26514 if (__Pyx_check_single_interpreter())
26515 return NULL;
26516 #endif
26517 if (__pyx_m)
26518 return __Pyx_NewRef(__pyx_m);
26519 modname = PyObject_GetAttrString(spec, "name");
26520 if (unlikely(!modname)) goto bad;
26521 module = PyModule_NewObject(modname);
26522 Py_DECREF(modname);
26523 if (unlikely(!module)) goto bad;
26524 moddict = PyModule_GetDict(module);
26525 if (unlikely(!moddict)) goto bad;
26526 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
26527 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
26528 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
26529 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
26530 return module;
26531bad:
26532 Py_XDECREF(module);
26533 return NULL;
26534}
26535
26536
26537static CYTHON_SMALL_CODE int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject *__pyx_pyinit_module)
26538#endif
26539{
26540 int stringtab_initialized = 0;
26541 #if CYTHON_USE_MODULE_STATE
26542 int pystate_addmodule_run = 0;
26543 #endif
26544 __pyx_mstatetype *__pyx_mstate = NULL;
26545 PyObject *__pyx_t_1 = NULL;
26546 PyObject *__pyx_t_2 = NULL;
26547 PyObject *__pyx_t_3 = NULL;
26548 int __pyx_lineno = 0;
26549 const char *__pyx_filename = NULL;
26550 int __pyx_clineno = 0;
26551 __Pyx_RefNannyDeclarations
26552 #if CYTHON_PEP489_MULTI_PHASE_INIT
26553 if (__pyx_m) {
26554 if (__pyx_m == __pyx_pyinit_module) return 0;
26555 PyErr_SetString(PyExc_RuntimeError, "Module 'subsurfaceTransportFunctions' has already been imported. Re-initialisation is not supported.");
26556 return -1;
26557 }
26558 #else
26559 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
26560 #endif
26561 /*--- Module creation code ---*/
26562 #if CYTHON_PEP489_MULTI_PHASE_INIT
26563 __pyx_t_1 = __pyx_pyinit_module;
26564 Py_INCREF(__pyx_t_1);
26565 #else
26566 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26567 #endif
26568 #if CYTHON_USE_MODULE_STATE
26569 {
26570 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
26571 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "subsurfaceTransportFunctions" pseudovariable */
26572 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
26573 pystate_addmodule_run = 1;
26574 }
26575 #else
26576 __pyx_m = __pyx_t_1;
26577 #endif
26578 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26579 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
26580 #endif
26581 __pyx_mstate = __pyx_mstate_global;
26582 CYTHON_UNUSED_VAR(__pyx_t_1);
26583 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
26584 Py_INCREF(__pyx_mstate->__pyx_d);
26585 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
26586 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
26587 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26588 /* ImportRefnannyAPI */
26589 #if CYTHON_REFNANNY
26590 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
26591 if (!__Pyx_RefNanny) {
26592 if (PyErr_ExceptionMatches(PyExc_Exception)) {
26593 PyErr_Clear();
26594 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
26595 }
26596 if (!__Pyx_RefNanny)
26597 Py_FatalError("failed to import 'refnanny' module");
26598 }
26599 #endif
26600
26601__Pyx_RefNannySetupContext("PyInit_subsurfaceTransportFunctions", 0);
26602 __Pyx_init_runtime_version();
26603 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26604 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
26605 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
26606 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
26607 /*--- Library function declarations ---*/
26608 /*--- Initialize various global constants etc. ---*/
26609 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26610 stringtab_initialized = 1;
26611 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26612 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
26613 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26614 }
26615 {
26616 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
26617 if (!PyDict_GetItemString(modules, "subsurfaceTransportFunctions")) {
26618 if (unlikely((PyDict_SetItemString(modules, "subsurfaceTransportFunctions", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
26619 }
26620 }
26621 /*--- Builtin init code ---*/
26622 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26623 /*--- Constants init code ---*/
26624 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26625 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26626 /*--- Global type/function init code ---*/
26627 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
26628 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
26629 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
26630 /*--- Type init code ---*/
26631 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
26632 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
26633 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
26634 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
26635 /*--- Execution code ---*/
26636
26637 /* "subsurfaceTransportFunctions.pyx":2
26638 * # cython: language_level=3
26639 * import numpy # <<<<<<<<<<<<<<
26640 * cimport numpy
26641 * cdef extern from "math.h":
26642*/
26643 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
26644 __pyx_t_2 = __pyx_t_1;
26645 __Pyx_GOTREF(__pyx_t_2);
26646 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_numpy, __pyx_t_2) < (0)) __PYX_ERR(0, 2, __pyx_L1_error)
26647 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26648
26649 /* "subsurfaceTransportFunctions.pyx":19
26650 * ctypedef int ITYPE_t
26651 *
26652 * def setExteriorElementBoundaryTypes(int nExteriorElementBoundaries_global, # <<<<<<<<<<<<<<
26653 * numpy.ndarray[ITYPE_t,ndim=1] exteriorElementBoundariesArray,
26654 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryElementsArray,
26655*/
26656 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, 0, __pyx_mstate_global->__pyx_n_u_setExteriorElementBoundaryTypes, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
26657 __Pyx_GOTREF(__pyx_t_2);
26658 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26659 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26660 #endif
26661 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setExteriorElementBoundaryTypes, __pyx_t_2) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
26662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26663
26664 /* "subsurfaceTransportFunctions.pyx":30
26665 * exteriorElementBoundaryMaterialTypes[ebNE] = elementMaterialTypes[eN]
26666 *
26667 * def setElementBoundariesArray(int nElementBoundaries_global, # <<<<<<<<<<<<<<
26668 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryElementsArray,
26669 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
26670*/
26671 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, 0, __pyx_mstate_global->__pyx_n_u_setElementBoundariesArray, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
26672 __Pyx_GOTREF(__pyx_t_2);
26673 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26674 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26675 #endif
26676 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setElementBoundariesArray, __pyx_t_2) < (0)) __PYX_ERR(0, 30, __pyx_L1_error)
26677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26678
26679 /* "subsurfaceTransportFunctions.pyx":44
26680 *
26681 * ###
26682 * def setScalarMaterialFunctionOverElements(numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes, # <<<<<<<<<<<<<<
26683 * numpy.ndarray[DTYPE_t,ndim=2] q_vals,
26684 * dict material_functions):
26685*/
26686 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, 0, __pyx_mstate_global->__pyx_n_u_setScalarMaterialFunctionOverEle, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
26687 __Pyx_GOTREF(__pyx_t_2);
26688 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26689 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26690 #endif
26691 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setScalarMaterialFunctionOverEle, __pyx_t_2) < (0)) __PYX_ERR(0, 44, __pyx_L1_error)
26692 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26693
26694 /* "subsurfaceTransportFunctions.pyx":57
26695 * q_vals[eN,k] = material_functions[material]
26696 *
26697 * def setVectorMaterialFunctionOverElements(numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes, # <<<<<<<<<<<<<<
26698 * numpy.ndarray[DTYPE_t,ndim=3] q_vals,
26699 * dict material_functions):
26700*/
26701 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, 0, __pyx_mstate_global->__pyx_n_u_setVectorMaterialFunctionOverEle, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
26702 __Pyx_GOTREF(__pyx_t_2);
26703 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26704 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26705 #endif
26706 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setVectorMaterialFunctionOverEle, __pyx_t_2) < (0)) __PYX_ERR(0, 57, __pyx_L1_error)
26707 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26708
26709 /* "subsurfaceTransportFunctions.pyx":70
26710 *
26711 *
26712 * def setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray, # <<<<<<<<<<<<<<
26713 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
26714 * numpy.ndarray[DTYPE_t,ndim=3] ebq_vals,
26715*/
26716 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, 0, __pyx_mstate_global->__pyx_n_u_setScalarMaterialFunctionOverEle_2, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
26717 __Pyx_GOTREF(__pyx_t_2);
26718 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26719 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26720 #endif
26721 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setScalarMaterialFunctionOverEle_2, __pyx_t_2) < (0)) __PYX_ERR(0, 70, __pyx_L1_error)
26722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26723
26724 /* "subsurfaceTransportFunctions.pyx":92
26725 * material_functions[material_right])
26726 *
26727 * def setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
26728 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
26729 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
26730*/
26731 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, 0, __pyx_mstate_global->__pyx_n_u_setSparseTensorMaterialFunctionO, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
26732 __Pyx_GOTREF(__pyx_t_2);
26733 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26734 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26735 #endif
26736 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setSparseTensorMaterialFunctionO, __pyx_t_2) < (0)) __PYX_ERR(0, 92, __pyx_L1_error)
26737 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26738
26739 /* "subsurfaceTransportFunctions.pyx":119
26740 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
26741 *
26742 * def setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray, # <<<<<<<<<<<<<<
26743 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
26744 * numpy.ndarray[DTYPE_t,ndim=2] ebq_global_vals,
26745*/
26746 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, 0, __pyx_mstate_global->__pyx_n_u_setScalarMaterialFunctionOverGlo, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
26747 __Pyx_GOTREF(__pyx_t_2);
26748 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26749 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26750 #endif
26751 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setScalarMaterialFunctionOverGlo, __pyx_t_2) < (0)) __PYX_ERR(0, 119, __pyx_L1_error)
26752 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26753
26754 /* "subsurfaceTransportFunctions.pyx":140
26755 *
26756 *
26757 * def setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
26758 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
26759 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
26760*/
26761 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, 0, __pyx_mstate_global->__pyx_n_u_setSparseTensorMaterialFunctionO_2, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
26762 __Pyx_GOTREF(__pyx_t_2);
26763 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26764 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26765 #endif
26766 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setSparseTensorMaterialFunctionO_2, __pyx_t_2) < (0)) __PYX_ERR(0, 140, __pyx_L1_error)
26767 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26768
26769 /* "subsurfaceTransportFunctions.pyx":166
26770 *
26771 * ###
26772 * def evaluateScalarMaterialFunctionOverElements(double t, # <<<<<<<<<<<<<<
26773 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
26774 * numpy.ndarray[DTYPE_t,ndim=3] x,
26775*/
26776 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, 0, __pyx_mstate_global->__pyx_n_u_evaluateScalarMaterialFunctionOv, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
26777 __Pyx_GOTREF(__pyx_t_2);
26778 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26779 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26780 #endif
26781 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_evaluateScalarMaterialFunctionOv, __pyx_t_2) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
26782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26783
26784 /* "subsurfaceTransportFunctions.pyx":181
26785 * q_vals[eN,k] = material_functions[material](x[eN,k],t)
26786 *
26787 * def evaluateVectorMaterialFunctionOverElements(double t, # <<<<<<<<<<<<<<
26788 * numpy.ndarray[ITYPE_t,ndim=1] elementMaterialTypes,
26789 * numpy.ndarray[DTYPE_t,ndim=3] x,
26790*/
26791 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, 0, __pyx_mstate_global->__pyx_n_u_evaluateVectorMaterialFunctionOv, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
26792 __Pyx_GOTREF(__pyx_t_2);
26793 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26794 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26795 #endif
26796 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_evaluateVectorMaterialFunctionOv, __pyx_t_2) < (0)) __PYX_ERR(0, 181, __pyx_L1_error)
26797 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26798
26799 /* "subsurfaceTransportFunctions.pyx":196
26800 *
26801 *
26802 * def evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(double t, # <<<<<<<<<<<<<<
26803 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
26804 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
26805*/
26806 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, 0, __pyx_mstate_global->__pyx_n_u_evaluateScalarMaterialFunctionOv_2, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
26807 __Pyx_GOTREF(__pyx_t_2);
26808 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26809 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26810 #endif
26811 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_evaluateScalarMaterialFunctionOv_2, __pyx_t_2) < (0)) __PYX_ERR(0, 196, __pyx_L1_error)
26812 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26813
26814 /* "subsurfaceTransportFunctions.pyx":220
26815 * material_functions[material_right](x[eN,ebN_local,k],t))
26816 *
26817 * def evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
26818 * double t,
26819 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
26820*/
26821 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, 0, __pyx_mstate_global->__pyx_n_u_evaluateSparseTensorMaterialFunc, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
26822 __Pyx_GOTREF(__pyx_t_2);
26823 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26824 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26825 #endif
26826 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_evaluateSparseTensorMaterialFunc, __pyx_t_2) < (0)) __PYX_ERR(0, 220, __pyx_L1_error)
26827 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26828
26829 /* "subsurfaceTransportFunctions.pyx":249
26830 * ebq_vals[eN,ebN_local,k,I*nd+J] = numer/denom
26831 *
26832 * def evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(double t, # <<<<<<<<<<<<<<
26833 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
26834 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundaryTypes,
26835*/
26836 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, 0, __pyx_mstate_global->__pyx_n_u_evaluateScalarMaterialFunctionOv_3, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
26837 __Pyx_GOTREF(__pyx_t_2);
26838 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26839 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26840 #endif
26841 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_evaluateScalarMaterialFunctionOv_3, __pyx_t_2) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
26842 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26843
26844 /* "subsurfaceTransportFunctions.pyx":272
26845 *
26846 *
26847 * def evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(int nd, # <<<<<<<<<<<<<<
26848 * double t,
26849 * numpy.ndarray[ITYPE_t,ndim=2] elementBoundariesArray,
26850*/
26851 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, 0, __pyx_mstate_global->__pyx_n_u_evaluateSparseTensorMaterialFunc_2, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
26852 __Pyx_GOTREF(__pyx_t_2);
26853 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26854 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26855 #endif
26856 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_evaluateSparseTensorMaterialFunc_2, __pyx_t_2) < (0)) __PYX_ERR(0, 272, __pyx_L1_error)
26857 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26858
26859 /* "subsurfaceTransportFunctions.pyx":302
26860 *
26861 * ##################################################
26862 * def RE_NCP1_evaluateElementCoefficients_Linear(double rho, # <<<<<<<<<<<<<<
26863 * numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities
26864 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
26865*/
26866 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, 0, __pyx_mstate_global->__pyx_n_u_RE_NCP1_evaluateElementCoefficie, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
26867 __Pyx_GOTREF(__pyx_t_2);
26868 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26869 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26870 #endif
26871 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RE_NCP1_evaluateElementCoefficie, __pyx_t_2) < (0)) __PYX_ERR(0, 302, __pyx_L1_error)
26872 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26873
26874 /* "subsurfaceTransportFunctions.pyx":360
26875 *
26876 *
26877 * def RE_NCP1_evaluateElementCoefficients_VGM(double rho, # <<<<<<<<<<<<<<
26878 * double beta,
26879 * numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities
26880*/
26881 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, 0, __pyx_mstate_global->__pyx_n_u_RE_NCP1_evaluateElementCoefficie_2, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
26882 __Pyx_GOTREF(__pyx_t_2);
26883 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26884 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26885 #endif
26886 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_2) < (0)) __PYX_ERR(0, 360, __pyx_L1_error)
26887 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26888
26889 /* "subsurfaceTransportFunctions.pyx":487
26890 * #eN for upwind
26891 *
26892 * def RE_NCP1_getElementResidual(numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities # <<<<<<<<<<<<<<
26893 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
26894 * numpy.ndarray[ITYPE_t,ndim=1] colind,
26895*/
26896 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, 0, __pyx_mstate_global->__pyx_n_u_RE_NCP1_getElementResidual, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error)
26897 __Pyx_GOTREF(__pyx_t_2);
26898 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26899 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26900 #endif
26901 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RE_NCP1_getElementResidual, __pyx_t_2) < (0)) __PYX_ERR(0, 487, __pyx_L1_error)
26902 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26903
26904 /* "subsurfaceTransportFunctions.pyx":575
26905 * #i
26906 * #eN
26907 * def RE_NCP1_getElementJacobian(numpy.ndarray[DTYPE_t,ndim=1] gravity,#physical quantities # <<<<<<<<<<<<<<
26908 * numpy.ndarray[ITYPE_t,ndim=1] rowptr,
26909 * numpy.ndarray[ITYPE_t,ndim=1] colind,
26910*/
26911 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, 0, __pyx_mstate_global->__pyx_n_u_RE_NCP1_getElementJacobian, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
26912 __Pyx_GOTREF(__pyx_t_2);
26913 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26914 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26915 #endif
26916 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RE_NCP1_getElementJacobian, __pyx_t_2) < (0)) __PYX_ERR(0, 575, __pyx_L1_error)
26917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26918
26919 /* "subsurfaceTransportFunctions.pyx":674
26920 * ##################################################
26921 *
26922 * def updateMass_weakAvg(numpy.ndarray[DTYPE_t,ndim=2] mt, # <<<<<<<<<<<<<<
26923 * numpy.ndarray[DTYPE_t,ndim=3] w,
26924 * numpy.ndarray[DTYPE_t,ndim=2] dV,
26925*/
26926 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, 0, __pyx_mstate_global->__pyx_n_u_updateMass_weakAvg, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
26927 __Pyx_GOTREF(__pyx_t_2);
26928 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26929 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26930 #endif
26931 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_updateMass_weakAvg, __pyx_t_2) < (0)) __PYX_ERR(0, 674, __pyx_L1_error)
26932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26933
26934 /* "subsurfaceTransportFunctions.pyx":693
26935 * #cek hack, seems like cython needed some help figuring out that the rvalue was a float
26936 * weak_residual[eN,i] += float(mt_avg*w[eN,k,i]*dV[eN,k])
26937 * def updateMassJacobian_weakAvg(numpy.ndarray[DTYPE_t,ndim=2] dmt, # <<<<<<<<<<<<<<
26938 * numpy.ndarray[DTYPE_t,ndim=3] w,
26939 * numpy.ndarray[DTYPE_t,ndim=3] v,
26940*/
26941 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, 0, __pyx_mstate_global->__pyx_n_u_updateMassJacobian_weakAvg, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
26942 __Pyx_GOTREF(__pyx_t_2);
26943 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26944 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26945 #endif
26946 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_updateMassJacobian_weakAvg, __pyx_t_2) < (0)) __PYX_ERR(0, 693, __pyx_L1_error)
26947 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26948
26949 /* "subsurfaceTransportFunctions.pyx":718
26950 * #ELLAM
26951 * ########################################################################
26952 * def calculateNormalFlux(numpy.ndarray[DTYPE_t,ndim=4] v, # <<<<<<<<<<<<<<
26953 * numpy.ndarray[DTYPE_t,ndim=4] n,
26954 * numpy.ndarray[DTYPE_t,ndim=3] dS,
26955*/
26956 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, 0, __pyx_mstate_global->__pyx_n_u_calculateNormalFlux, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
26957 __Pyx_GOTREF(__pyx_t_2);
26958 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26959 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26960 #endif
26961 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNormalFlux, __pyx_t_2) < (0)) __PYX_ERR(0, 718, __pyx_L1_error)
26962 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26963
26964 /* "subsurfaceTransportFunctions.pyx":733
26965 * flux[eN,ebN] = integral
26966 *
26967 * def computeSimpleCharacteristicVelocityFromElementVelocity(numpy.ndarray[DTYPE_t,ndim=3] df, # <<<<<<<<<<<<<<
26968 * numpy.ndarray[DTYPE_t,ndim=3] characteristic_velocity,
26969 * numpy.ndarray[DTYPE_t,ndim=2] dm,
26970*/
26971 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, 0, __pyx_mstate_global->__pyx_n_u_computeSimpleCharacteristicVeloc, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error)
26972 __Pyx_GOTREF(__pyx_t_2);
26973 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26974 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26975 #endif
26976 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_computeSimpleCharacteristicVeloc, __pyx_t_2) < (0)) __PYX_ERR(0, 733, __pyx_L1_error)
26977 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26978
26979 /* "subsurfaceTransportFunctions.pyx":754
26980 * characteristic_velocity[eN,k,I] = df[eN,k,I]*vol_e/(omega_e+1.0e-12)
26981 *
26982 * def computeSimpleCharacteristicVelocityFromVelocityDOFs(numpy.ndarray[DTYPE_t,ndim=1] df_dofs, # <<<<<<<<<<<<<<
26983 * numpy.ndarray[DTYPE_t,ndim=1] characteristic_velocity_dofs,
26984 * numpy.ndarray[ITYPE_t,ndim=2] l2g,
26985*/
26986 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, 0, __pyx_mstate_global->__pyx_n_u_computeSimpleCharacteristicVeloc_2, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
26987 __Pyx_GOTREF(__pyx_t_2);
26988 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26989 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
26990 #endif
26991 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_computeSimpleCharacteristicVeloc_2, __pyx_t_2) < (0)) __PYX_ERR(0, 754, __pyx_L1_error)
26992 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26993
26994 /* "subsurfaceTransportFunctions.pyx":784
26995 * numpy.ndarray[DTYPE_t,ndim=3] x,
26996 * numpy.ndarray[DTYPE_t,ndim=3] v,
26997 * double zvelocity=0.0): # <<<<<<<<<<<<<<
26998 * cdef int eN,k
26999 * cdef double pi
27000*/
27001 __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
27002 __Pyx_GOTREF(__pyx_t_2);
27003
27004 /* "subsurfaceTransportFunctions.pyx":777
27005 *
27006 * #problem specific velocity evaluation
27007 * def rotatingGaussianElementVelocityEval3(int transient, # <<<<<<<<<<<<<<
27008 * double t,
27009 * double tForReversal,
27010*/
27011 {
27012 PyObject* __pyx_temp[1] = {__pyx_t_2};
27013 __pyx_t_3 = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error)
27014 __Pyx_GOTREF(__pyx_t_3);
27015 }
27016 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27017 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, 0, __pyx_mstate_global->__pyx_n_u_rotatingGaussianElementVelocityE, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
27018 __Pyx_GOTREF(__pyx_t_2);
27019 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27020 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
27021 #endif
27022 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3);
27023 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27024 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_rotatingGaussianElementVelocityE, __pyx_t_2) < (0)) __PYX_ERR(0, 777, __pyx_L1_error)
27025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27026
27027 /* "subsurfaceTransportFunctions.pyx":824
27028 * numpy.ndarray[DTYPE_t,ndim=4] x,
27029 * numpy.ndarray[DTYPE_t,ndim=4] v,
27030 * double zvelocity=0.0): # <<<<<<<<<<<<<<
27031 * cdef int eN,ebN,k
27032 * cdef double pi
27033*/
27034 __pyx_t_2 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error)
27035 __Pyx_GOTREF(__pyx_t_2);
27036
27037 /* "subsurfaceTransportFunctions.pyx":817
27038 *
27039 *
27040 * def rotatingGaussianElementVelocityEval4(int transient, # <<<<<<<<<<<<<<
27041 * double t,
27042 * double tForReversal,
27043*/
27044 {
27045 PyObject* __pyx_temp[1] = {__pyx_t_2};
27046 __pyx_t_3 = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
27047 __Pyx_GOTREF(__pyx_t_3);
27048 }
27049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27050 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, 0, __pyx_mstate_global->__pyx_n_u_rotatingGaussianElementVelocityE_2, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
27051 __Pyx_GOTREF(__pyx_t_2);
27052 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27053 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
27054 #endif
27055 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3);
27056 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27057 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_rotatingGaussianElementVelocityE_2, __pyx_t_2) < (0)) __PYX_ERR(0, 817, __pyx_L1_error)
27058 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27059
27060 /* "subsurfaceTransportFunctions.pyx":860
27061 * v[eN,ebN,k,1]=2.0*pi*(yc-x[eN,ebN,k,0])
27062 *
27063 * def helicalElementVelocityEval3(int transient, # <<<<<<<<<<<<<<
27064 * double t,
27065 * double tForReversal,
27066*/
27067 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, 0, __pyx_mstate_global->__pyx_n_u_helicalElementVelocityEval3, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error)
27068 __Pyx_GOTREF(__pyx_t_2);
27069 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27070 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
27071 #endif
27072 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_helicalElementVelocityEval3, __pyx_t_2) < (0)) __PYX_ERR(0, 860, __pyx_L1_error)
27073 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27074
27075 /* "subsurfaceTransportFunctions.pyx":885
27076 * v[eN,k,2]=zVelocity
27077 *
27078 * def helicalElementVelocityEval4(int transient, # <<<<<<<<<<<<<<
27079 * double t,
27080 * double tForReversal,
27081*/
27082 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, 0, __pyx_mstate_global->__pyx_n_u_helicalElementVelocityEval4, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
27083 __Pyx_GOTREF(__pyx_t_2);
27084 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27085 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
27086 #endif
27087 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_helicalElementVelocityEval4, __pyx_t_2) < (0)) __PYX_ERR(0, 885, __pyx_L1_error)
27088 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27089
27090 /* "subsurfaceTransportFunctions.pyx":912
27091 * v[eN,ebN,k,2]=zVelocity
27092 *
27093 * def vortexElementVelocityEval3(double t, # <<<<<<<<<<<<<<
27094 * numpy.ndarray[DTYPE_t,ndim=3] x,
27095 * numpy.ndarray[DTYPE_t,ndim=3] v):
27096*/
27097 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, 0, __pyx_mstate_global->__pyx_n_u_vortexElementVelocityEval3, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
27098 __Pyx_GOTREF(__pyx_t_2);
27099 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27100 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
27101 #endif
27102 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_vortexElementVelocityEval3, __pyx_t_2) < (0)) __PYX_ERR(0, 912, __pyx_L1_error)
27103 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27104
27105 /* "subsurfaceTransportFunctions.pyx":925
27106 *
27107 *
27108 * def vortexElementVelocityEval4(double t, # <<<<<<<<<<<<<<
27109 * numpy.ndarray[DTYPE_t,ndim=4] x,
27110 * numpy.ndarray[DTYPE_t,ndim=4] v):
27111*/
27112 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, 0, __pyx_mstate_global->__pyx_n_u_vortexElementVelocityEval4, NULL, __pyx_mstate_global->__pyx_n_u_subsurfaceTransportFunctions, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error)
27113 __Pyx_GOTREF(__pyx_t_2);
27114 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27115 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
27116 #endif
27117 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_vortexElementVelocityEval4, __pyx_t_2) < (0)) __PYX_ERR(0, 925, __pyx_L1_error)
27118 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27119
27120 /* "subsurfaceTransportFunctions.pyx":1
27121 * # cython: language_level=3 # <<<<<<<<<<<<<<
27122 * import numpy
27123 * cimport numpy
27124*/
27125 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27126 __Pyx_GOTREF(__pyx_t_2);
27127 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27128 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27129
27130 /*--- Wrapped vars code ---*/
27131
27132 goto __pyx_L0;
27133 __pyx_L1_error:;
27134 __Pyx_XDECREF(__pyx_t_2);
27135 __Pyx_XDECREF(__pyx_t_3);
27136 if (__pyx_m) {
27137 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
27138 __Pyx_AddTraceback("init subsurfaceTransportFunctions", __pyx_clineno, __pyx_lineno, __pyx_filename);
27139 }
27140 #if !CYTHON_USE_MODULE_STATE
27141 Py_CLEAR(__pyx_m);
27142 #else
27143 Py_DECREF(__pyx_m);
27144 if (pystate_addmodule_run) {
27145 PyObject *tp, *value, *tb;
27146 __Pyx_PyErr_FetchException(&tp, &value, &tb);
27147 __Pyx_State_RemoveModule(&__pyx_moduledef);
27148 __Pyx_PyErr_RestoreException(tp, value, tb);
27149 }
27150 #endif
27151 } else if (!PyErr_Occurred()) {
27152 PyErr_SetString(PyExc_ImportError, "init subsurfaceTransportFunctions");
27153 }
27154 __pyx_L0:;
27155 __Pyx_RefNannyFinishContext();
27156 #if CYTHON_PEP489_MULTI_PHASE_INIT
27157 return (__pyx_m != NULL) ? 0 : -1;
27158 #else
27159 return __pyx_m;
27160 #endif
27161}
27162/* #### Code section: pystring_table ### */
27163/* #### Code section: cached_builtins ### */
27164
27165static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
27166 CYTHON_UNUSED_VAR(__pyx_mstate);
27167
27168 /* Cached unbound methods */
27169 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
27170 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
27171 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
27172 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
27173 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
27174 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
27175 return 0;
27176}
27177/* #### Code section: cached_constants ### */
27178
27179static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
27180 __Pyx_RefNannyDeclarations
27181 int __pyx_lineno = 0;
27182 const char *__pyx_filename = NULL;
27183 int __pyx_clineno = 0;
27184 CYTHON_UNUSED_VAR(__pyx_mstate);
27185 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
27186
27187 /* "subsurfaceTransportFunctions.pyx":67
27188 * material = elementMaterialTypes[eN]
27189 * for k in range(q_vals.shape[1]):
27190 * q_vals[eN,k,:] = material_functions[material].flat # <<<<<<<<<<<<<<
27191 *
27192 *
27193*/
27194 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 67, __pyx_L1_error)
27195 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
27196 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
27197 #if CYTHON_IMMORTAL_CONSTANTS
27198 {
27199 PyObject **table = __pyx_mstate->__pyx_slice;
27200 for (Py_ssize_t i=0; i<1; ++i) {
27201 #if PY_VERSION_HEX >= 0x030F0000
27202 PyUnstable_SetImmortal(table[i]);
27203 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27204 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
27205 #if PY_VERSION_HEX < 0x030E0000
27206 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
27207 #else
27208 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
27209 #endif
27210 {
27211 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
27212 }
27213 #else
27214 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
27215 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
27216 #endif
27217 }
27218 }
27219 #endif
27220 __Pyx_RefNannyFinishContext();
27221 return 0;
27222 __pyx_L1_error:;
27223 __Pyx_RefNannyFinishContext();
27224 return -1;
27225}
27226/* #### Code section: init_constants ### */
27227
27228static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
27229 int __pyx_lineno = 0;
27230 const char *__pyx_filename = NULL;
27231 int __pyx_clineno = 0;
27232 CYTHON_UNUSED_VAR(__pyx_mstate);
27233 {
27234 const struct { const unsigned int length: 8; } str_length_index[] = {{1},{179},{8},{39},{34},{40},{10},{11},{13},{11},{1},{1},{3},{3},{42},{39},{26},{26},{20},{12},{17},{8},{8},{10},{8},{12},{8},{13},{5},{4},{6},{4},{5},{18},{4},{19},{23},{28},{18},{5},{6},{54},{51},{1},{2},{2},{5},{2},{7},{6},{2},{3},{8},{3},{5},{2},{7},{11},{8},{3},{4},{9},{15},{8},{23},{22},{28},{28},{20},{15},{20},{21},{15},{69},{42},{75},{73},{79},{42},{30},{36},{4},{4},{4},{7},{27},{27},{1},{2},{8},{5},{1},{22},{1},{2},{5},{7},{3},{1},{5},{10},{8},{18},{13},{14},{2},{6},{1},{10},{17},{18},{26},{25},{16},{33},{6},{7},{2},{3},{5},{5},{7},{4},{15},{5},{7},{9},{9},{6},{8},{2},{6},{3},{4},{1},{6},{6},{5},{4},{7},{5},{6},{8},{8},{8},{4},{7},{3},{6},{4},{3},{3},{6},{3},{3},{4},{4},{36},{36},{6},{4},{25},{31},{64},{37},{70},{68},{74},{37},{10},{5},{9},{28},{3},{1},{12},{6},{6},{7},{6},{19},{9},{5},{4},{3},{5},{6},{26},{18},{10},{1},{4},{5},{6},{3},{9},{5},{6},{26},{26},{1},{13},{6},{1},{2},{2},{9},{5},{9}};
27235 const struct { const unsigned int length: 10; } bytes_length_index[] = {{244},{293},{96},{51},{129},{66},{662},{542},{64},{139},{78},{183},{275},{331},{76},{147},{133},{123},{91},{165},{222},{120},{191},{400},{289},{365},{760},{463},{441}};
27236 #ifndef CYTHON_COMPRESS_STRINGS
27237 #define CYTHON_COMPRESS_STRINGS 90
27238 #endif
27239 #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (3849 bytes) */
27240static const char cstring[] = "(\265/\375`\244&\375w\000\372\206\360\034H\360\216\314\003\314\300\322\212\244\014r\047H\032\260!E\322\200\r)\222.[\272\352-\010I\311\202+\034\205\266a?\257>\260\341k@\273\000\007\026\000\2445\013\005\0262\217* \347\222:t\"\245\244\341\374\202M\253Y;\001\231\001\262\001\312\0014\017\256\370^Ip\355Zy\225Z\217\300m\222k\361T\321S\347;\304u\031Z\316\300T\266K\r\256Vd\333s\216\312h\343.\301\225\275\262M\224\306E\217\2120\336\024M\221\307\210\2438\212&zn\021&\272D\261\263H\250L\224\263`\251]\272\266Wk&\032\212(Z\2061\241\226m\017\226a\037Q\021\304y2D\313\275\202!\351;\251\271\246\2057\265d\225\332\344\350J\251\206\245\016\265\337\262~\202\222\341\211\353Z\323j\245\256\251\344>A\275\262A=[5\350U\264\223\276o\237\232\372,U\021=Im\216\346\366$\270Ap\274\355\025Pu\303\261\200`\251U\221\354\273ujR\206\206\032\204\337\263\021)0\256\367I\212\000;\031\222\343\270\321\224?\267\271\313\325\366Z-\365\272A\022Kj\005\\\265z,\004\010\2255\246\275FuU\212\3545\025\310c!T7\\\355\244\207\247\312\352\247\346\257\035\352\221\253}BWy\215\346\265\251z\216\326L\262$\365(\302i\316\265j\236l\216\206\340\t\256f\252\347\006EQ\237\354^j\326^IN\212\"\223\331I\202\047Jz\355\321\363\324&\"\277\273\350\3344\337uM\204z\221\270\367)RQ\234hT\021\235\364]\303y\321I\372\222Te\242\021\025\365\335\273.C\231\332E\335\207\033fs\221xj\021\n\006\024\t,+\026\321\311\267\017I\356\273\010Wn\257\371\226\221\345\026E\235\024\235(\315\343R\"\257i^\264=\272\322!o\346m\3201g\310\t\220G2\352\344{\274/\367\344\226\220`\177\362\371\237\215Y#\307\221\321\315\362\2270\037f\374c\370C\331\227\351\257U|\025)~\n\024\037\305\211\017\3730\226\357\322\235t$O\227\312)\231$kdY\\\022wX\303\037|\202G`\017\034\222\274\236\227\227\270\036\227\233Z\317\266\330\020\033\016\350\2303\037mf\301\000\2169mu\313\321\254\007k\2429a\342\233\210\375\330\353\277\\\337\325\372\255\357s\235\326\231t#]\227[2\211\354\2213r\032\267\342S\014\2123\261\013.\301\0328}\365\373\275\245w\364vW\273&w\344zn\332\242xm\312\246\330\r+\313\231r\243\\\000\216\371kO""\355\310~\354\211Us\013r\00183\251\035\265,\226\304\216\330\226\334\nCC3\353\334\227#\311\005\320\314\231\034\307\006@\200\030\031\030\353\212\216\362\275bE\210\013o7\233\r\345\266\327\rjV\211\256}\227\326\231.Y F\250\240\n\003\252\252Jz[\255\245\253t\222\346c\256V\251\373nq\224\345\275\251v\320\363T\323\272/U=n\321\243:\3675\033\312QzWu\312\354\344f\351\246\202)\230\332V\025\024G0\365\275k\223\307\200\360[\004\323\023L\323\032Z\023y\215\254\221\264Z\2114\342\014k`WK\026\014\373D\267\211\362\275\342<\305\263\264\303s\307f\353\351<\315\0214U*^\233\346\254T\256lYL\014\007c\364\266\20100\275$QL+\332\252\371l\034G\364\206\372p\303N\324D\373\271_\273s]K\351{\246O\333\014:\r\226h}Q\367i,\210[@\270 \337\177O\177Z\3762\346\307\274\374\027\227\357\242\362\371\010\207\222\350\247\265_;\377i~3\304\227\311\237\354\302B\311\027\205\264\204\204\346\320\270\377.\361K\264\374\226\0163\361\213\372\353\224\243`&\351Rlx\360\275\327\345f\270\252\321}\341\t\371!,\027$\315\034(|\331k\002\321\231-\270\030>8D\001\301G\360\202>\377\346\321\216\370 \022\213K\361\276\360\356\005\256\020\r\017\024\014\2023\036/\047\361H#:\244s\004>dWLB\356\312\027\265[\316\007\217`\017\226\275%\037\211j\264bc\273\023L\202Y|\350\214+k\271\245t$\3740\200\371\310bTJ{9#mH\307\374iRa\311\344:\345:8\246\320I\036\221\373)6\305\243\330\213S\270\265z\270\026R\026$\300\216\201\213\2023k\217\355p\350\026\365\371@\355\327Js\005`l\351#\341\300\337\235\235\216\2778$\342\035I\335\rm\212\347\363\206\237\026\250\rYT\206\355\234X\320\310\355mj\217\234\335\356\223O\362FN\343\r<\202{!\203\2027\260\313+\301\037\370%sQ\232R\353A\237Y\273\237\273\266:\003T`\376\306Ve5\264H\216C\323\2724\014\016\047\006\204\007\236\230cB\202?cM\237\216\371\344\222\\X\273\256r\035\033s\346M]\023\320\007m\354\034\047\323\202p\3708\025\223\342\217\0146\245^R\312\335\270\256\366t\240\300Lb\265-\235\216\331\343f\\\006\255\247\002\013;\261\241\215\r\000\002#\235G\247R\341\227\330\230\323\027\345\301\367\236\336\010\004>\201\215Yg\260\033\035\251\254eV\351""\267\274\2417\333\267\251_\025\277\310\362S\335\315$\256\034\002\202\271/@\260\221\302\251\225ol\346\227\227\377\362\375\227\216$D>\305\233\017\330\202\3118\342h\035J\267\371\240\202\275\253\207\307\266\0313 \2567\264\206\354<\251\003*\230\273\"\330\211\214\014\260\236\324\211\r\331`h\230\200|\220\315\234`\263\313\310 \02263\003\270\345=\311p\265\tJ6\016\264\264k;\020\232/\260\240\316N\304\346\255`\262K\240\032\340Etk\333\001\330\210\341\301\301\017Q\331\326\316\227\210$\0351^,\t\353a=\253\216=\000\005\005\324\261\2333;\023 \231\307\037.\017\\\023\252\235\007\346\257\206\206+j\275\031\037 \255\201\316\256\345\253\264d\020W\230\332\352M\206\366c\371,\036~\032\243\230\244o\212\245\240\263;A8\360A:\273\022wD\205\363v\264\032K\361\330\204\006h2<\005\246x\003\210\002\001_\300\206dc\016\265&\254\230\221a\231\221\2544\"\003\316\252\244\355\036]F\347\032_\037\256\215\307\007C \031\265\"\241\005-\213\224\340\047\350\230Z\026\271\002\257\217\316f9\244\t\"_$E\223a\225t~\207\023c\316\310*\030\234\001S\330\354,\260\240MH\006\000\013\037>\264\370-V\374\025\376\207?L\351F\264\207\027,>\213\333\277\331\276m\375\253\372\325\361\263|YI5\002z)Rx//\261\330\353\345}\237\227\222\342\241P\336\351\224\341\337_1\362^<\027\027\317\204\t\257D\t\017\006\363\\.OE\305c\261\274\325\312S\251\274\224\227\312x\000\000bt\3769\370A\227\357\242A\247\321#+XU\205\346\032\372Q\332\247\315\376l\365K_\354\"D~2\345k\031\225\"\210\271\276\017\203\217\250b2\235\311\230\031\221\021I\222\222\2441b \014F\242(\217\204=~2\262\236#A\242\010A\204\210\210\214\210\210H \201$\221\202\244 I\007\360s\263\325\334\255\335\323\265.\275\353\320\235O\203\017=V\256\265\375bx\204\0235\t\023V\365\364\301yu\236c\251\267\214{3TC\366y\274\273\026\177&\325\021\367x\356T\353z\346F\200\315\244\231\007\304\277\022;\235\335\010B\277\355\203\204\234\241\325\272\305V\241\361\3003E\016\311\300\266^\220n\275\303@t\r\031c\255Rr\"\225\206\337:\026\0011\350k\254\355=\227\306\316\371\362\301\313E\365\207\344;\361\365Bk\301\360\356(yI\241R\026""\"\300H\033D(s\217\215\330\234\r\225\2178\307\336a\377t\331\336\265\366\310\376\254\347\330l\047\334.{\356\371\013\243\306\3411\276\036\216\"\230K }\031\303\245s\301\005p\314\305\037\334\276\300\370Ml\253\243\363\253\340Y\335\005\322\257\230\262\231\317*,\305\023JF}\034<n?6\014\263\242\263wGJ\311E\303\235\377\302\277\366\003<<\201i\005\304\035\212[\220\222\306#\257;\311#\306\362>[_\247\204\330\001\333\3650\332\334\204\327\342\017\364$\002M\316X\313\037\nOCPah\000sR\263\245\231\340\3434\177K\241\301\013\336\375\212\213\367X\007*9-$ \251\026t\360\006\010\203\200a\206i\003,c\206\014\237I\357\337\225\200\207z\374\301\220V\234\255\274\374\2669\024m\215]ab\265t\024\370\343/mo<_\177\264g\230\nr\2545\205\205\237\025Y\323\230\202\026)E.\251\325\336<\025\274@Q`\034O\337\226\255\331\337\016\372\232\240\320\227P\0271C\345\306\300\r\\\314\332J\310\321\235\336`\354\3238\277\013\034j\242\265\300\344c\311\323=$\325\326\372\237Z!G\321\251T\033\346\206Um\354l-\252\371\027\211v\251B\244\006\361\270C\tY\202\227\027\222>\210\000j\022\033B[)\346V\245%l\\/T\241\014\266;\350\204\353A\357\313\302h}\"5\345\311I\277\024\240G\221\260\213\257\021\024t\026m\024\006\342\314\315\226\340\\\245\317.d%F@\024\370L\370\2124\321[\024{\032\371R\034F%\245\303\235w{R\0202r\261\312\005\0031\265\035h]\256\353\216\205>\324\204\227R\200\371\337\r\265\333\253\3117\200Eky\230\277)KX\263 \230\005\243\"\260\274\324\002&\204\353D\317L\207\327\251/$)\265\342q\250\254:p(l\004\230e\003\225\262o\024D\254\000Vt:\332\252g\n\242\201\007\375\262h\030[\240v\205h\331\206X@\2231\021\316\331\233\006i*SS\202\337OF\220\303\362[\275>\001R\030\252\240^\255\220\204\005\262\254\346\277\272\002\204&\255&U\332>\2365\300\346p\264o\227\357v=\211\373\033\253\030\247\000\006{\004\263|\250 Kr\007#\322-\222 \370\226\366\244\222G\317\260[/\347Y\034~\325\2503\017\207\374\274\322\306\244\345\346\356\032\2635\225\252\254\267&x\277\005i\255\240\364\333\324\321\305\215\216n+.}\255\366\010\273\333\266\203i~4\2422;\322\362_;\267\207\004]\256\303""\"\203\252x\351\274o\250\265\214\233\264\330#/+R\032\343\266\272xK\226\307\031\020xTs\211\302x\353\222s[4M\203\361~\376\233?*\275\344\215\355\355\005a\"Q\374`\2607\330C\047\016U\310eZ\304\0337%\0029:\004]\217\253\243<\023\021\304\202A\006\372\376\307\256\362\205\254\010*\220FZ\300\342\203\267\340\230\206\020\335&B\261\010Md7\netK?\322\266\007\3255\005\343+\311\326\31243\370\026 !{\3600\227\210\332K-\2011\264C\314\322N\312\202\200]R:\261\270\031\377\013\227A]\245\274\271\266\220+\320)~#\327\261\365\254\344\266-Hy\235q\256`YX\245k\023\271\003v\035_\267grz\206WC\0267\211\220\000\216)*\3307\307o\374b\353\342!\3050\334\3425\2265Z\220\263\377\3259\216\3006Gt\036I]\000\000\360#\177\221\021\242\2321\206\032G\260\264\232\014\260.\263\305)9^\360\002\251\264\020\272\306\370\202\0204\220\360\346\276&\352\330\020\177\241\010q/?\331\220LD|g\224w|b\010X-N\334\223\217\017\314\371\236&\251\032&\343\316\306\2278\244\206V}\201\232\030:\036K\026OO\306\272e\007k\242.\233\344\203\207\320 \276P\255\316\3201\352\303\226\034\236\355\241\347\\p\202#$q\nO\203-\207\215h\260\271\267\235\230\322do\370b\372\325C\007\312\360\361y\246T/Gl\201\201\225\203\274\n\026\202c\017Q\020\254H\010\266\2770b\005\312\033n:@\251\250\302\017\177\004\262\236\301A\206\013N\233Qb\274\221%-\215\341@8\202\342f\352k\032YH\\:\007\203h*2p\225\022,!\351\200\2563\020\300n\016\010?\365\245W4M\361}M\353\2773jw\337+\361\255\007\307F\303\032\223\205a\264&\031\273@\323\225\3534%\334B\016\264\215p\310\215?M_\350\301\255#\240\376&\312\036s\032.\211\277W\306\220\200\231Y\365G\n\033\207\264\305\301GWr\354\345\371\016\005\003\033\344>\025\200\314\206\340\343E\004[E\302m\343\241\252\004\2124\030wjN\027jg\325\344_\372F\270Ge\002\n^\024\265b7T\365\314\254\352Z\031\354T\300\345\276Q\034u\214=.G\371I\343\006\300\036K\361\006\375\211v\275\337:\262c\001b\241\306\022]$\220\031,\277\314,VJqX\210\037\342\2007M\237\211!z\260b\366\370L8u@>D\231\301\241B\244\010\206\330\264&)th\334Sk8\004\351zv\020\364\240n\375\337\367\367\342\025\356\005D1\223""\267H\251\200\362\371a\273\314\236\254\265\237IZ\340\225\023\244F\272;\372A\352re\010\330\257WLq4h\"\321\250\200\321?`\357\253\024\t\321\254>8Z\341qk\357k\275\275i\030\"\217\006F\313\330\000\305d\337\n\2579r\247\313\325\370F\244\023\264\376\363\246F\307@\346\272\331j\300oQ\004o\272\266/\341(\207\337\351\021\2357\001\000\375\231\013\205*\352\240\216\201i\3132\021\317!\010f\031@d\256c\304\344\324\003\326S$jB\316\355\322w\332\315\0009\270\032\230\201A6v\336\227\201\270d\244U\352\220*\314\333D\301\200a*\205\177\234u\365\206o!Cc-\305\271P\260\234\212\177\253\\\340\232\313\324KTT\245+K\267\207\364\372b\004!I\256\353\364\361|5wH{&\362\264\3249\201\276\351\260&u\177\026\333:\230\256\334(zP\215*\2267V\026U\342\3732\013\026\361\327=d\203\350\201i\216\343\345\224N\306\332^\323\007\0062\312\023&\306\217\336$\003\202)\245\005oz\253J\251\212\037CC\272\316a+\272\244\250\302\327\350\356\237O\313e\304\267v\315?\263@\337\307I^\247R2\002\020\224\233\236\205\316Z\253q lA\024\032\252\212O[\025*\337\0277\345\212\037\202\275\276\200V}r\032]\177c\322\210g]\250\\\252\302\005\377v\034F\027\306\301\260EY\250P\020R\004\264\240UKH}\326\006";
27241 PyObject *data = __Pyx_DecompressString(cstring, 3849, 3);
27242 #define __Pyx_DecompressString_LZSS_UNUSED
27243 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
27244 const char* const bytes = __Pyx_PyBytes_AsString(data);
27245 #if !CYTHON_ASSUME_SAFE_MACROS
27246 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
27247 #endif
27248 #elif (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (3862 bytes) */
27249static const char cstring[] = "x\332\315Y\313[\333V\372\216\215!\220\222\006s\tL.}\314%\3417\355\224\326@\323v\236>35\346R\322\206\301\230K2I\2439\266epbK\266$\033\310\323\231\351\322K/\265\324RK/\275\364\322\313\263\324\322\177B\377\204y\277#\t\343\304\244t:\351\257\t\350HG\347\362]\336\357;\357\047\376\272\245\032r\3048bF$~j\034\251J$\247G2r>\227\2225f\310\371\323\210nh\271\264!k4H\211l\257m\177\274\374\305r\204)\231\210&\277\220\323\206\036\321\313\251t\236\351\272\254G\324l$U\316\345\215\234\0221N\213\262\276\020\331\314FN\325rD\221\345L\304P#E\214;?\3018\222\225\210.\033t\023\231g\212\242\032\314\310\251\212\204\3519\345p>\222\311i\330$W\221i\366:\313\353\362\002\313d$\214\223\225r\241x\272 \245UM^(\224\261)\3234v\032\311\262\\\336\335,W(\252\232q~X\271\300\214\2437F\0245\254V\326?\201\\zY\313\262\264\274\2531E\247W\353e%M\362\350\013\305\323\223\325o\0174i\265\250\347\342\253\372\n\363o!\271\301\016\274\207\312Y\377\346C\214\376\366@\337Y\223\266\342\333QI\256\260|\031&]\313\313\005Y1\342\252\234\315\346\3229\334\352\322w9Ef\332eF\356o<\362\207\035\312\2067\342!K\253\251\034S\336|\263#\353\271L\231\345%i\373\364\004\277\253p\245\264%\237\340EV\222<s\313\022\376\t\207\320\314\234!\027\250#\013\315\251-\260\234\"Z5S\316\213\241\n+\210\266\204\205\375{C\326\r49\235\354\254\226\rRHb\225C&\311[LR\344\034\356\312E\226/\0361\246\237*\351\234\272p6PO\301\200i\226O\227\363\020fK\325\n,\277\236/\237\244\217\230\306\010z9\335\310\245\245\212\234W\3239\343\364\202n)\243f\365t\036\353I\020\330\300\0209\305\322/\323x\3732\255\242?\223V\013\305\262!\047\341\364\274\034\357Ze\337[d]S\013\236\351\374\256K\316\362\357W\377\266\256g2\311\314~FV\324B&\233\311\n\3012/5\350\237)d\n\006~^\220i2\252\221\321\216\324\202\274%oIy9\013\325\205\241\216R@\352\226\244\341\316\220S[\370Y\303\257\204\345Y^N\225\244\303\274\232\202G+\024\013x\024\255+2\260w\232F+kz\214B\301\357V\313J\206i9\271W\357\251\247n\317w\217\030\251\312\362\273\024\313\257\275;\337\347\003\320{\3545m\313\323\254k\037\037\236>\342\223P\221i\376t?""\366\376V\221\265\265\327U\221p5\216\n\300k:\206\367\354P\276\364\"\372\317\217\334\0206\376%\233\026\231\246\313\273\262\242\253\227\224\037H*\250\312/^\350\"\311.Xn\037\311S}\2731N\350\235\372\246\204\256\243z\276\355\006F\026\310\316\"t\263\210\331C\215U\020\005G8A\322gb\372\261\261\006\241\226.~\265\234\303?\240\027k\344)\013\351/^x\270\222\216e\366R\322<\264\274|\231B4\311[\270P\274\344\027\017\013H\353\233\253\342\"\272\n\236x~+\222\231H\343g=\024pg\017\"\326\n\370Oq\251(\261\312\341\001\301\325P\020\315nj\363\000\353v\2109~\317\233\256\270\370\215\033\272\376\213\316\363E.\360\007\000\024\210kq]T2\212\362\ng\232\254\211\203\r\371\203\222\254\252\310_\340w;_\326\245b\232\016!E4\347\357%\345Q\324\277Y,\036\345`B\272\222\301\212\271\"\234\242e\212j\221\316\256RI\202\013\224\222\224\221\215\207\270\276\324p)\320/\016\tj\214\222\224\025\003\340\253\214T\366\332\212\327\036\227$\232!R^I\302<w\032\315Bw\331\315Y%\351\004\331\017?\213\224\0045q\356+\207\033\254\254\353\360x/\344\\b\314\262\246\036\027\r\215Ng\375\354\020|\r\322\364\2427\252\005\232\361\372W\245\241\313\314\177\373&\227N>\264\312\257\315;\227X\343\222)\007+\375|\266\301\240\214\234e`k\372\021\203\265K\232!\to\275\205z\351\345\202a\254\253\332\216\214\205t\226\027\204kG\\\223\356\325}80\216r\272\267\321\246\276W<\306\231o\320jD\235\312t\014\227\001\371\262\364\242,!g\224\005\360q&C\332G\300\347\303\363\271\006\031\240\363\246\323C+\256\347\331a\205h\036\375.R\232\225\365\212\232\307\317:#\355q\003\006\247\346\021\241\025h!\237\364\202\362\205o\226\217\273R\335\261HC\047\047\351\323\364+\177\330+YS\365W>\355\3711\360\323\265+\241\241j\300\351\273V\235\255&\252\314\351\273\372c\245\272W\233\256Ek\353\346\264\031u\006\256U\357U\313\265X-Q\313\23213\341\014]\253NW\227\252\251Z\250\026\257\225\314 F-\233%+hM[K\026\263t{\332^\264\0236\263K\365\276\372b=\331\0104\306\032\261\306N\243\324\0144\303\315\331\346NSoM\267\226Z\254\245\361\304\016\337I\362\344.\337=\340\007O\370\223\277w\226\357\203\010\357`\203K""\352<_\233\2501\354>`2\263\344\014]\307\373{x\014\2307!J\300\031\276\216\231\351\332xm\247f\230K\030\243Yak\016\322iv\330\236\205t\351z\270>S\217\325\023uV\327\033s\215T\263\257\031m\306\233\245V\020\262E[\261V\222oC\252}\276OR\361\277\177\317\277\177\316\237\377\203\377\203q\226\342\2514Ogy\366\005\177\221\347\371\302\371\355tH\370\3167\024F\352\037\252^u=\357\014\216\362\321\005X\334\250G\273\357\347\254\230\265kO\360\205\225\346t\263\307\363{\325/\311\211\316\360\377\331\001{\334\336\343\213\353M\326,a\375aZ\177\260\326\017\\1g\360}\376\376\237\354\230\235\020w\037\302\303\313v\311\031\244\256\307\374\263\315V\2705\215)\357_\t\r\376\254\247\306k1r\327~\35538+l\336\267\002V\330\031\036\301F{4\303\\\007\214\242\316\215\333\270\215\231I+d\305\205\t\247\355\250\035\207NK\365\024\3604\332\2106\342\r\003\032\014\271\226\2374\003B\000\310<P\225\305\366\356\312\203c|l\336*\331\001gp\270\272&D\251\230\373V\324\2129\303\243\020t\251v\310\357~\002\250\0165\302b\205\017?\372i\300\303\337\300\217\014\352\000\201\302\312I\263\217\024\032\252\336\302$\326S\207\253\2652\205\240\231\205\225\023\316\2151\274\357\307#3+V\302b\316\350\230\010\031\303\\\204b}\220a\305J\301\354\204\217\335\372(B\005\330\350=((\364\217\331\311z\250\276\362\372\240@\347\361s\353O\360\274\206\305\276B\264\205\232\261f\242\375;\022\264=@\336\312\212d%\303\301qS\267\246\177o&\375\275\331\360\"T\246kc\010\245\267\032\357\265\230\032\251\0050g\245\2266\307 \371\216HQ\224\263\275-{\r\030\245H\201>i{\264{@\330\177\3300\277Bx\005\355\031\373;\004\346x#\321`\355\337Z\226\016\256.\021\244\357H\220\377\047;\000\035#\377M\326\223\371\355\217\351\220\306\374\321N\332^\254\355S\336u\006nTK\336\305\247\027;X\001\350v\206\3060*\001qF1r\005p\247\020\036\032\251\005\305\262\314\031\200\300\235Y\337[\367\t\364\355k\2238\001\372\314\007\326\004\216\304\3129v\260S/5\202\215\351\306R\303\025\345L\225\230\047J\017U\374\263\344\215\004\216u\350\\\320\2333\315\030V\033\357(\266\344\221\243\201\341j\254#]\322?\224\316\211\377""\006\235z\203ZL\322y\351;r\311\217\377\333\210\341\204\231\026\336\211C\336\276.\022\224p\206\247L\314\235\361\234;`\037\201\007\224\0045Z\001\027\0104G]6\340\212\355\005\372\013\"Y$\322}\367\034\366]p\001\333\031\205\006\210\006sF\370\245\204\204\262h\355\010\323\365\030\220\"\240x\322t\r`\376\303M\221\340\220\266=\304\355X?\324\243\365X\373\267\226\347\222&9\250\255a\251i`\014\313\\\030i\253\340\253\263\236R\213\224\250\301W\347\354T=X\237\256_0H\210|\226\270_\033\224\350<\016\230\262\347{7\203\257\330y\002d\373w$\2540\345\177\021b^\266\310\t\304\206\033\263\215d\223\370\326\315\036\231C\204\377\373U\326#s\214#\2151\"\310\235\333\031\221\323\010\032\321\036\023|\\\005\375\3649+\014\254\331\0230B\240>\206\343\221\330\340\004\002\350*\2104\2114\365nDJv\n\215\2440(H\354=xD\266?\207/\3500\227\033\213\215\003\"\013\020\342V\307\306\337x\036\205e\037\231\023X\343\304M\177\260,\037%\322=f#\047\337\341w>\205B\343\224\047\316\337\373\270\370\302z@\034\330\031A\022\3019\360\020\373.\331)\376)\261\370\277\240\206r\304]\324\337\332-\013$k]\034!\203S|\212\230\372n=\334}\357;\373\337VVp\373a\"\335\253V\277\225\264\203\374\303\257P\263=oE\035qCZ}\320\0039\276V%k\000\350,\3752\255|\264_\244\325\271\312\0205P\206gP\000\035\272\252\376\325\177\267\307\367\036\363\307\250\217d.g\273\205\374\037\233~\034!+Tu\306\247\300\364\366\304\332S\021\302\t\237{\200l\376\257f\242\231\242j\216\177\353\326n\005^P\270R\344\305\022\306\361\310\"\220\362\027\024\3003\310\363\032\337|\312\237>\343\317^\362\227(\3500\254\304K:\327\rZ1`\215Y\017\005\302\335\222q\257q\217jg_\273\253]\347\323\317z\367,\224{y\027eg\242\225\341;0#\254\374\330u\266$zY\313\340IT\243\007\335\373\376rT\235\271\273\313\206w\300\376K\347\215\262\322d|\303-}s<\347W\326\343\360\tU\263\377\002\241\242\222y\221\257\221\240\374\361!?<\342G\030\006+\253\\-:\343\224\034V\317r/\263\313\3655\242\004\020\177\346\235!\367R\240@A\335\352k\375Y \025\332\301\361\300\207\304%\324\366\032\327\364\237\256\\1\002\361 \232xp\225\232\325\340\0325k""\301uj\326\203\233\324l\006\223\324$\203\373\324\354\007\037S\3638\370\204\232\047\301\247\324<\r>\013v!mZp\212W<\341~Wp\277\260\000t\300&\241\022S\264@\214f\306\202+\324\254\004\273\305\330\240f#\230\240&\021\334\245f\327\337\377\200\232\003\177\377g\324<\013>\247\346yP\n\276\035\3063\277\006\306\227\202\023i\276\n\243/\002\310)\276\355\246\022J\021<[\346\345\n\257\034\363\343\023~\362\003\377\341\337\220\370\353\327\324?3\177\027\374\230(\007\021\273\255pk\246\025\247\217Wi\236FZ\242\270\345\206\273\356+\376\352\237\374\237\356\242\236i\275E=g~C\3157\360\351\333\000\373\340J\377\224wD\205\306j\017\210*\264C\237\326\373\353\373 \270\253\315\200s\341\003\312\304\016\326\235\301\021>2\047\370)\354\270\356r4\262`\2406I\205\022\331\214\340Oo7\334B\305\031\276\305o}\"Xk\224F\016\210B=\346\214\334\024\364e\327\345+7\252?\320G.g\344.\277\033\205{Ez\\7\357\t\3667~\013\336\371\334\232\025%J\330\376\310\r\234\263\205&\204\317i\347\020$K\"\344nz$yWP\213D#\213c4\331\n\264\302\356\256\2729\007\222\275&\262\360y\357\373\357d7\020\335\355\007\004I\272/@G$I\010\263dfP\207\364\301\314k\350\236\305i}\350mC\347\332v\200L\326\017\302\231\251\315\233\343\024\304\316 j\037\210L\033\314z\205S\350=\376\336\007 \370\223\34412\363WT\2644J\364%\356\003\360\257\240[\352\274\305\001\036\220\211T\221\047\372E\275\020&k\226\300ja~\314\275>.\346A\317\220[\333\212l\203\216\t\221\2706@\361\016\334\264z\003\361\003\306B\247g\377\331g\210\221;\276O\301\347\006\250\374\240\256M\361E\242s3c\315\021\313n\217L\022\365\341\267?\242\357\r\355\221\017\004\201]G\t\033\207G\310\202\363\215\321\306r\243\304\277\336\346\333\t\234\310\336\014\363Kw\263)3$\202\0273\231YF\337\276W\364T`\342\014\310\357\2270\361\036\202e\223\357Q\376i\217\374\301\234D^\270\t\341\372\355\0351\014\342D\254\253\350\270jk\365p\033B\256\n\256\007\234<\021\241=BF\017[\037B\353\247 {7\033Zs\014\313>q\017(\242\000m\254\020p\272/\355\3411\252\035\204\264\313nQ2V[v\361\357q\332N?}\203\361\007^\207\002\262\250s\206]\352\274FA\021\256\205k""\263\265]r\207\373e\264\343`\000\222\372\301\256\2012\3017\374\2569\310o\020v\332\242k\007\365\024\3516\305\377\3705}\t\377i\360\n\350\244\027wmO\214cDUW\010\236\205\332-\340\333\360\n\214\353\256\341\374\256U\000\357.\325\223mt\315\243\016\370\314\016\271\237f\277\243\243\274=2V\373\234x\2553~[\004\375\261EE\325\016p\177\233\022\313\240\007\3769\327&\027\201\377.@\356\236\225~N\202\006\375\013\366^\375\276\373\305\303\t}\354=L6\003\355\320\335NP8\241I>9O3\257\376x\214\272\016y\235\276\003\237\177\242?%\004H\2263\313\206k\177\360|\342\006\3654u\335\242hhw\202\211B\346\216P\252\002\364E\355UQ\027\300y\267\317u\306]c\322\330\260\377\335\256}>cM\211\322\265\"2\326\270\235\304\032\223\356_-^;\341\003\270\315\212\254\025\022\031\373X|\314\247l\020\236\350\214s\253\224\212\275\017\030\255z_\253\277\0219-\324Zi1Zh\300\013\265i0\336\254\367W\001\260\304y\361\341\340A\375&\n\255\020\230\030\312\254\346\024\216\233\331\326.O\270\274\007\3077\330\203{\224\201\047y\354\007\356|\346\272\323\t!/\376\266>\205\276\377#\307\302\220\010\t\337\265\203\276k5d\214\212\027\227\361z\351\335\371q\260\313\217\347\030\335\035\020\276{^J\325\2059\304\307&\347\316G\002^\032<V\301\221\222\001\361X\002\337;i\225\3706\030\207\313\270\\\252\007\242\000\257\2715\001\310>\350\002q\220\377\000\037\202\342\256";
27250 PyObject *data = __Pyx_DecompressString(cstring, 3862, 1);
27251 #define __Pyx_DecompressString_LZSS_UNUSED
27252 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
27253 const char* const bytes = __Pyx_PyBytes_AsString(data);
27254 #if !CYTHON_ASSUME_SAFE_MACROS
27255 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
27256 #endif
27257 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (5144 bytes) */
27258static const char cstring[] = "\377?Note th\377at Cytho\377n is del\377iberatel\377y strict\373er!\001n PEP\377-484 and\377 rejects\377 subclas\377ses of b\377uiltin t\377ypes. If\377 you nee?d to p%\000%\t\377then set\376\200\000e \047anno\177tation_<\000\377ing\047 dir\366b\000iv\242\000o Fa\377lse.add_\376%\000enumpy.\377_core.mu\376r\000array f\367ailg\003impo\373rt\033\tumathv\021\016pr\202 us/\306\000\377surfaceT\357rans9\001Fun\375c\214\001s.pyxD\377KWr_Dpsi\237CDsBa\003\005\300\000tkaW\021\004v\017\006IJ+\000\377KWsRE_NC\377P1_evalu\376\320 Element\377Coeffici\376\010\000s_Linea\335r\006!VGMI\005ge\375tE\004Jacobi\373an\010\017Resid\377ual__Pyx\372\001\000D\310@_Next\337Ref__\350$e_\327___\275B_Q\000it\313em\r\001f\367\000\025\001ma{in\003\002odul&\002\227nam.\002qV\000\004\005t\267estD\000is\213Ao\375u\376@ea_avg\377a_eNa_ne\375i\007\000upalph\377aasyncio\371.\265@#\003sbeta\277calcul\360`N\377ormalFlu\277xchara\367ai\377stic_vel\337ocity\000\024_d_ofscl\307 _\256\000\375t7\000ebackc\3562\000kco\025\000dco\277mputeS\224`l\353eCP\nVU\004Fro\341m\232D\013\005\017$:\005DOF\377sddSdVde\177nomdfdf\224\002\377dkr_updm\327dmt\000\000j\227!do\377tdrhomeN\177eN_left\004\000\336\245!hbor\017\000ri\277ghtebN\000\000E\372\004\000_\372\000alebq\237_glob\317@\314`s\370\013\001\003\002\316cBaryc^\331`ersA\207\205\001e\020\004\377oundarie\362\002\021y\211\204\004\007\022Mate\237rialT\310\206\001@\013y\020\010\t\371ej\004#\021N\200`\326\001\215\n4\227\204\005\224\205\005S\203`arn\005\364\205\005_OverE\273\r_\316\000\257thme\227`A\035\000a+ge\034&sM\037G\337\"I)\377parseTen\373so\231\200$harmo\207nic\256\r*\034\202\0258\024Vwectu\032sex\340A\321o\320/\275c\t\022y\214jf_\377upflatfl\377uxgravit\377yhelical\276\274\205\014Eval3\001\0274\177iiiinteA\000\335l\202\210\001sjj\322\210\004_w\337eak_r\306\210\004kk\377bkr_eNkr\376\324\207\002l2gmmat\223ID\000\002\347\207\002m\261\204\004\000\005_\301f\277\212\005\t\006\355\205\001\026\006\347\205\002mt\373mt\257\210\001nnAvg\375W\253\204\001tnDOF_\020\326\210\002""\304\205\004\013\003\217\205\001_\n\005\210\204\017\000\0272\265\206\003n\353\205\005\304\206\004nE\3535\031\005\277Spacen\001\0022\377ndnnznum\273er\373\214\002ome\341\211\001o\367ne8\001\000Plus\227_pc\231\214\001n\002\002\000\t_\367nM1\025\004M2ph\317i_eN\002\001\231\212\001pi}p\255@rdpop\333\214\001\377qq_alinq\337_detJ\003\000kr\272\010\000m\000\001ass\007\001t\347q_f\034\002\355@d_u\353q_\003\002v\001\004wq_\254.\001\356\210\002q_5\000m2\002m\3603\000F\000+\000\270\210\001q_xr\277horho2\201\211\001r\376\363\216\002ngGauss\347ian\246q\001 4ro\257wptr\232\216\001s\226\215\006Bp\362\210\013\025\001\300\204\023\342\210\002set\312\207:\002\034!sH\032\324\207&\247\001\270\207=! \314\207$\367set\314\207\037setd\377efaultsh\377apesqrt_\366\251Bub\342\221\026sumt\377tForReve\257rsal\354\221\002R\362\221\002S|\000\003\007\003Wthis\330\221\004\377IsUpwind\351t\305\222\001\341\221\001u\234\217\001u_e\377Nu_ju_l2\373gu\221\220\002updat\277eMassJ\340\207\tA\303vg\020\007\371\207\002\r\002N\001Fl\247agv\343\222\001\347\222\0012\321\222\001eosvol\000\000Fa\350\211\001\266\t\000_e\016\000um\003\000r\267tex\361\210\021vo\003\0244\365w\336\210\nw\202\210\002xxcy\373cz\234\220\005zeros\375z\206\221\005\200\001\360\n\000\004\377\t\210\001\330\003\n\210#\377\210Q\210a\330\003\007\200\377v\210U\220!\2201\220\377F\230!\2301\330\006\n\377\210%\210u\220A\220Q\377\220f\230A\230Q\330\t\377\n\210!\2103\210b\220\177\004\220C\220q\230\002#\000\3774\230q\240\002\240!\240\3773\240a\240s\250!\250\3772\250Q\250a\250q\260\377\003\2602\260S\270\001\270\377\023\270A\270R\270q\300\377\001\300\021\300#\300R\300\377s\310!\3103\310a\310\377r\320QR\320RS\320\377ST\320TW\320WY\027\320YZU\007\003\200\000\016P\315\200$\337\047\220\025\220a\334\000\006\230\277a\230q\330\t\r\221 %\356\353\000\001\230\026\351\000\001\330\014\375\r\253 c\220\024\220R\220\367t\2303!\000r\240\021\240}$\374\000r\250\021\250#\374\000\377c\260\021\260\"\260A\260\377Q\260a\260s\270$\270\377b\300\003\3001\300C\300\367q\310\002\372""\0001\310A\310wS\320P\364\000V\320V\363\001\377\320Z]\320]^\320^\377`\320`a\320ab\320\377bc\320cf\320fj\277\320jl\320lmc\tsx\223@\020^\224b\005\t\210\007\364C\277\330\010\022\320\022.\320@t\373\2601\000\t\330\010$\240A\377\240T\250\025\320.B\300\367!\3001\000\r\330\010\013\210\3759\242a\330\014(\250\001\250\377\024\250U\3202F\300a\333\300q\366`\014\000]\000\010\220\375\005\325`a\330\010\016\320\016_,\250A\250Q\005\002*\300`\3374\250q\330\010\017\001X\320\3775I\310\021\310!\200\001\237\360\016\000\004\010\214\204\017\233L\024\373\220A\253AV\2205\230\001\377\230\021\230&\240\001\240\021\327\330\014\020f\000U\314\204\001\230F\377\240!\2401\330\017\033\230\3771\230A\230S\240\004\240\373C\240\260A!\2501\250C\377\250t\2603\260b\270\001\377\270\022\2701\270C\270t:\317\000\t\343C\027\230\001|\002\221 \347\006\210e\230\205\002T\003\010\023\320\377\023\047\240q\250\001\330\010\367\014\210E\260bv\230V\240\3771\240A\330\014\022\220!\377\2203\220g\320\035/\250\337q\260\t\270\021\276\002*+\373\360\006\355\205\004\006\200a\200v\334\362\205\001\333\205\002S\230\003\353\205\001\t\210u\0322\000a\257\022\007\220u\377\205\001{\230f\363 Q\330\017\023\341\000\377\005\230Q\230a\230v\240\277Q\240a\330\022\023\256\205\002t\353\2302\326\000\003\201\000B\240b|\364 \215\204\001T\260\022\2602\211\204\001\366\017\023\002\250\374\001A\250S\260\257\004\260B\260;\014\001O\0077\277\240,\250a\250rJ\000<\377\270q\300\004\300A\300Q\317\340\t\r\210\334.2t\340\006\352\223\206\001f\250\210\002e\336@C\230s\217\240!\330\006\305\200\213\264\200\215\376uco\220\023\220A\237;\005\220\307\205\n\367\020\220\0011\000B\220c\230?\023\230A\230R\230\220\211\001\221\213\001[b\250\333b\330\017\017\017\022\246\205\001\377\240Q\240c\250\022\2501\372\025\t\021&\005G\230<\240q\376>\000\"\250L\270\001\270\024\017\270Q\270a\336r0Y\316g\202\206 |\276\200T\221\200t\200\001\360\020\000\303\2100\357e\320\033-\202\217\001\200\001\360\335\022\255\212\0072\220V\364\211\001\330\006\347\017\210q\000\002\325\217\007R\220v\376\307\210""\001\330\t\023\2202\220Q\376\301`\022\2301\230B\230a\336\276\206\002\t\020\220\002\310\211\002a\330\271\006\343`\213\220\007]\240&\336\210\001\340\377\n\027\220q\230\003\2306\277\240\025\240a\240v\364\217\010R\377\260q\270\002\270!\2703\223\270a\206\002\270\212\006A\204\004\256\212\020q\341\230\360\216\003\260\212\016E\000\224\213\001s\300\"\277\300A\200\001\360\024\206\214\0073^\226\221\004\006\014\210A\251\221\007SB\004\240\263\t\276\221\016\312\217\016\310\000\247\214\0073\345\212\005\033\177\2302\230Q\230c\240\256\205\001\337C\240q\250\003\331\221\nQ\330\177\014\030\230\001\330\014\"\201\222\002\177b\250\006\250h\260a\370\000\376\370\221\001B\270b\300\001\300\022\370\371\217\003\261\003\356\222\002\006\200j\220\003\305\220\335\222\002&\202\216\003\373%\327\220\024\022\220\1773\220c\230\021\230\"\223B\177q\240\003\2402\240R\367\214\002\204\210\221\004\025\tb\365\215\001\207\004\247\221\006>\001a\272\265\221\005\026\311\214\002S\240\001\317\002A\376H\000|\2601\260A\340\006\363\n\210#j\354\200$W\220E\230w\021\230!\341`\021\240!\277\217\020~\370\210\003D\230\002\230#\230\317\003\3752\222\216\001\240s\250$\250b\037\260\002\260!\260\330\210\006\027\013\276\"\351\250\236\216\005\026\014Q\256\211\005D\230\006\237\230e\2401\240\370A\251\216\003B\003\250l\215\204\001\23326t\220\205\002\260\2050\247\207\004\375i\255\204\002\021\270#\270S\300r\354\221\001\026\247\207\020\372\206\002\016\210a\247\207\020\377\024\220B\220a\220s\230\227!\330\t\003\005\"\204\214\002\247\204\0011\324\330\207\020\316\226\005\002\237\223\005#\334\"r\250}\025\257@\001\260\023\260B\211\223\002\377\025\270b\300\007\300q\310r\377\222\001\030=S\241\207\006\r\210S\301\215\002\377A\330\t%\240Q\240e\363\2507\266`\266\222\001e\2702\270\275W\355\221\001\200\001\360\032\210\212\007H\376\312\224\004\010\014\210M\230\025\230\367a\230x\371\210\003\330\014\022\320\375\022\361\225\001\023\250A\330\014\034\377\320\0340\260\001\260\024\260\371Q\000\t\215\225\0078\2406\250\021\377\250!\330\020\030\230\001\230\367""\023\230Ju\0003\250b\320}0\322\226\001>\320QR\330\005\002\2711s\005\221\227\003_\240F\263\223\001\330\357\010\030\320\030\271\226\001T\260\021\\\000\t\207\225\007\177\240f\327\226\002\014\361\225\001\377D\240\005\240S\250\002\320\377*<\270A\270^\3101\375\330\004\002Q\200\001\360\036\000\374\213\212\017\316\005q\240\006\240a\240\305q\250\200+1\346\226\004\276\025\360\233\010a\320\377ad\320df\320fg\372\345\003?\217\234\005U\320UX\320\377Xb\320be\320ef\334\227\013\254\201L\024\220E\274Bq\330\277\024\030\230\005\230U\243\230\002\030\377 \240\003\2401\320$6\377\260a\260~\300Q\300b\366\273\233\001\320K\247\233\003m\320mn\377\320np\320pq\330\030\377 \320 2\260!\260>\377\300\021\300\"\300C\300r\377\320I[\320[\\\320\\\277k\320kl\320l$\000q\277\320qs\320st\047\000\240\237\001\240\023\240J\335\204\002\236\234\003U\023\270%\231\236\001\373%\007\342\236\n\275^\245\215\006\376\312Q\310A\310Q\310d\320\275R\304 W\320WX\347C_\376\021\002a\310t\320SV\320cVWj\013\244\203/\323\232\006\330\020\271(\337\034\230C\230q\211)B\300wa\320G\346\235\003i\320i\322\235\005\357\024\034\320\034\326\234\001~\270Q\356\237\236\0022\320E\245\001\320Xg\377\320gh\320hj\320j~\343 o\320op\330\024\231\207\001\373D\250\364\211\005a\250u\260E\227\270\021\270\225\234\001\"\341\203V\360\202\"a\277\300q\310\003\310:\245\204\002Z\373\320Z\366@]\320]_\320\377_`\320`r\320rs\177\360\000\000t\001C\002\004\000wC\002D\003\001D\002E\n\001wE\002F\021\001F\002I\030\001wI\002S\037\001S\002V&\001wV\002X-\001X\002Y4\001\367Y\002[;\001[\002\\\002:\335j!\316\240\002z\320Q\303\240\003\275\242\003\316\362`^\320^\222\204\001v\000r\001\335Au\001A\002B|\001B\002\272y\013G\221\001G\002Q\230\001Q\253\002T\237\001Tx\005W\255\001W\272x\005\\\273\001\\\002^\302\001^\007\002_\002\251\204\033\213B\217\2045\252\203\"\366\001\375D\362 2\310Q\310b\320\371P\300\244\003\237\207\001\320fu\320u\377v\320vw\320wx\320_x|\320|\177\374 @\360\014\352\366&\330\363ia\316\235\002C\300r\277\310\021\310\"\310C\232\245\001c\337\320cd\320d\264\206\001\320t~R""\003z\320z}\320}O\003(\324$\324D\306DH\345AH\321@\225\204\031\3576\000\005\030\351\225\004\004\023\220\3756\324\220\001\340\0040\260\005\260\377V\2701\270D\300\001\330\354\000\n\016\t\360\006\233\212\010\330\010\020k\320\020\377\242\001Q\372\240\001F\220\235\245\002\016\351\241\001\001\220\027\312\240\001\377\205\001\265\212\001\230\241\001}G\213\242\003\330\014\032\320\032\214\241\001\267\003\2601\223\242\001\006\220\245\236\001A\377\330\020\026\220a\220v\230\273T\240\330\221\002\017\210|\322\245\001\330\377\020\035\320\0351\260\021\260\335!\327\206\001F\230%\367\245\002\024\032\277\230!\2307\240#\262\233\002\021[\250+\321\214\001\020\220@\006\025\245\250\002\377C\230q\240\004\240A\240\337S\250\001\250\026\204\250\004T\270\376\327\217\001Q\270f\300A\300S\357\310\001\310\021p\003s\230$\217\230f\240E\374\214\002\237\243\007\022\007e\363\2401u\007\203\214\001s\250&\260\335\001\222\001\2601\330\210\0023\230\377d\240&\250\003\2501\250\377E\260\021\260#\260Q\260\263g\270a\003\324\214\001P\001\347\244\001\005\377\210Q\210d\220\047\230\024>\326\212\001\330\010\017\210q\260\000\252\220\001\375#\250\243\004\004\013\320\013\036\230\247c\240\027\252\235\001\343!<\261\230\001\270\377q\360\n\000\005\036\230S\003\240\002\345\230\003\3468\371\243\003\241\215\001\205B\227\243\001\351c\371\244\001h\001\003\214\245\001\360\006\000\277\r\024\2201\220A\215\245\001\004\371\220\246\236\001\316\224\0011\230A\330\014}\025\226\232\002G\2402\240W\247\216\003\207\017\210u\314\221\001\220\217\001\341\243\001\356\243\003\020\275\034\314E\240q\250\006\341\252\001\330\362\020\000I\372\243\002\000\006\020\"\240$\356\366\243\001\340\020\027\212\222\001\320\033+\177\2501\250A\340\020\036\274\224\002\177F\250\"\250C\250q\275\"\377\047\270\022\2704\270q\320\377@P\320PQ\320QR\366+\004\2309\334\244\002\020\030\230\004\374\356\253\0027\000a\230u\240A\240\375V\324\253\004v\260Q\260d\270\377!\2709\300A\300U\310\337\"\310I\320U\306\213\001\340\020\377\031\230\027\240\001\240\026\240\277q\250\005\250R\250#""\001a\377\330\020 \240\007\240q\250\277\007\250r\260\021\340\276\000D\036\216\247\002\020\025\220Y\327\252\002\224\000\243 \377\240*\250A\250[\270\001\377\270\026\270r\300\023\300A\367\300Y\310\234\214\002T\320TU\305\340?\000\001C\001\000\002\004\003\340\014\331\023\243\246\001\352\223\001\2304\215\253\003\023\220\3514\236\253\001\360\246\005e\016\0071\220C\276 \006\r\250Q\250e\343\230\002\014\376\252\241\003E\230\021\330\014\021\220\337\021\220#\220T\335\227\001\360\014v\324\205\013\220\005\023\002#\230Q\343`\366\270\250\001\010\020\014\004$\230a\230\365t\347\247\001\340\016\002R\220u\230\336\330\001\030\320)@\347\255\001\360\010\217\000\t\r\210\361\205\004\254\001\203\001ws\230a\365\205\013\342\205\006\032\230%I\002\352\331\233\001\r\246\247\002\020\013\005D\250\001\353\250\035\314\233\001\340\020\000\047\240\022\377\2405\250\004\250A\250X\367\3205L\335\216\001\340\020\023\220\3277\230\"\303`\024\323\251\001C\230\373w\240\351\235\001R\001\000\005\033\277\230!\340\004\010\210\367\204\003$9\220\217\"\345\204\025\035\230S\337\222\004\214\210\005~\277\000\005.\250U\260&\364\242\003\367\330\004-\006\004\027\300\001\340\373\004\035\213\205\007\330\004\027\320\027\377\047\240q\330\004\007\200w?\210c\220\021\330\010\204\253\001\002\t\354\250\260\0012\000\010\210\272\252\003A\330\010\247\021\220\031\265\260\004\317\206\003!\017\001\032\252\224\253\001\340\303\252\006q\257\205\001\034\306\247\002v\336\373`1\250D\260\224\227\001A\340\346\307\224\002C\230\017\003\313\204\001\003\2601\366\333\205\001\021\220\236\252\004\340\020\024\220\364\251\210\006\323\225\001\026\241\252\002c\250\024\250\037S\260\001\260\027\221\261\003\246\220\n\371\225\001\365\025\330\252\002S\335 B\250a\250\375w\271\257\002!\360\006\000\021\025\374\225\223\007\240\230\003v\250V\2601\260\365D\247\254\004H\317\210\002\004\310B\310qa\274\223\001\246\233\003\234\226\0013\250f\200\260\004\367q\330\030\246\254\001\003\2506\260\177\026\260q\270\004\270A\343\231\001\377\300\030\310\021\310#\310T\373\320Q\362""\220\003\\\320\\]\320\335]\305\214\003i\320i\367\220\004\200\001\373\360\\\311C\330\004\026\220an\346\201k#\2401\222\202D\360\006\217\205\001\336\241\211\004\360\010\000\r\325Cr\240\271\026\260\243\002\224\206\001C\260q\356\201W\010|\273J\334\226\010\034\230F\240%\314\211\004\265s\353\204\002\021\351\243\001\330\034\267\211\001C\373\250r\257@v\270Q\270d\377\300!\3003\300a\300x\177\310q\320PS\320S\257\265\003~\345\222\003d\320de\320e\216\227\003?q\320qu\320u\200\220\001";
27259 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 5144, 10148);
27260 #define __Pyx_DecompressString_UNUSED
27261 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
27262 const char* const bytes = __Pyx_PyBytes_AsString(data);
27263 #if !CYTHON_ASSUME_SAFE_MACROS
27264 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
27265 #endif
27266 #else /* compression: none (10148 bytes) */
27267static const char bytes[] = "?Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.add_notenumpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/subsurfaceTransportFunctions.pyxDKWr_DpsiCDsBar_DpsiCDthetaW_DpsiCDvBar_DpsiCIJKWrKWsRE_NCP1_evaluateElementCoefficients_LinearRE_NCP1_evaluateElementCoefficients_VGMRE_NCP1_getElementJacobianRE_NCP1_getElementResidual__Pyx_PyDict_NextRef__annotate____class_getitem____func____main____module____name____qualname____test___is_coroutinea_avga_eNa_neiga_upalphaasyncio.coroutinesbetacalculateNormalFluxcharacteristic_velocitycharacteristic_velocity_dofscline_in_tracebackclockcolindcomputeSimpleCharacteristicVelocityFromElementVelocitycomputeSimpleCharacteristicVelocityFromVelocityDOFsddSdVdenomdfdf_dofsdkr_updmdmtdmtj_avgdotdrhomeNeN_lefteN_neighboreN_rightebNebNEebN_localebq_global_valsebq_valselementBarycentersArrayelementBoundariesArrayelementBoundaryElementsArrayelementBoundaryMaterialTypeselementBoundaryTypeselementJacobianelementMaterialTypeselementNeighborsArrayelementResidualevaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverageevaluateScalarMaterialFunctionOverElementsevaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverageevaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverageevaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverageevaluateVectorMaterialFunctionOverElementsexteriorElementBoundariesArrayexteriorElementBoundaryMaterialTypesf_upflatfluxgravityhelicalElementVelocityEval3helicalElementVelocityEval4iiiintegralitemsjjacobian_weak_residualkkbkr_eNkr_neigl2gmmatIDmatID_neigmaterialmaterial_functionsmaterial_leftmaterial_rightmtmt_avgnnAvgWeightnDOF_test_elementnDOF_trial_elementnElementBoundaries_elementnElementBoundaries_globalnElements_globalnExteriorElementBoundaries_globalnSpacenSpace2ndnnznumernumpyomega_eon""e8onePlus_pcBar_npcBarpcBar_npcBar_nM1pcBar_nM2phi_eNphi_neigpipicardpoppsiCqq_alinq_detJq_dkrq_dmq_dmassq_dmtq_flinq_grad_uq_grad_vq_grad_wq_krq_kr_upq_mq_massq_mtq_rq_uq_valsq_xrhorho2rhomrotatingGaussianElementVelocityEval3rotatingGaussianElementVelocityEval4rowptrsBarsetElementBoundariesArraysetExteriorElementBoundaryTypessetScalarMaterialFunctionOverElementBoundaries_arithmeticAveragesetScalarMaterialFunctionOverElementssetScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAveragesetSparseTensorMaterialFunctionOverElementBoundaries_harmonicAveragesetSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAveragesetVectorMaterialFunctionOverElementssetdefaultshapesqrt_sBarsubsurfaceTransportFunctionssumttForReversalthetaRthetaSthetaSRthetaWthisElementIsUpwindtransientu_dofu_eNu_ju_l2gu_neigupdateMassJacobian_weakAvgupdateMass_weakAvgupwindFlagvvBarvBar2valuesvolvolFactorvol_evolumevortexElementVelocityEval3vortexElementVelocityEval4wweak_residualweightxxcyczVelocityzeroszvelocity\200\001\360\n\000\004\t\210\001\330\003\n\210#\210Q\210a\330\003\007\200v\210U\220!\2201\220F\230!\2301\330\006\n\210%\210u\220A\220Q\220f\230A\230Q\330\t\n\210!\2103\210b\220\004\220C\220q\230\002\230!\2304\230q\240\002\240!\2403\240a\240s\250!\2502\250Q\250a\250q\260\003\2602\260S\270\001\270\023\270A\270R\270q\300\001\300\021\300#\300R\300s\310!\3103\310a\310r\320QR\320RS\320ST\320TW\320WY\320YZ\330\t\n\210!\2103\210b\220\003\2201\220C\220q\230\002\230!\2304\230q\240\002\240!\2403\240a\240s\250!\2502\250Q\250a\250q\260\003\2602\260S\270\001\270\023\270A\270R\270q\300\001\300\021\300#\300R\300s\310!\3103\310a\310r\320QR\320RS\320ST\320TW\320WY\320YZ\200\001\360\n\000\004\t\210\001\330\003\n\210#\210Q\210a\330\003\007\200v\210U\220!\2201\220F\230!\2301\330\006\n\210\047\220\025\220a\220q\230\006\230a\230q\330\t\r\210U\220%\220q\230\001\230\026\230q\240\001\330\014\r\210Q\210c\220\024\220R\220t\2303\230a\230r\240\021\240$\240a\240r\250\021\250#\250Q\250c\260\021\260""\"\260A\260Q\260a\260s\270$\270b\300\003\3001\300C\300q\310\002\310!\3101\310A\310S\320PT\320TV\320VY\320YZ\320Z]\320]^\320^`\320`a\320ab\320bc\320cf\320fj\320jl\320lm\330\014\r\210Q\210c\220\024\220R\220s\230!\2303\230a\230r\240\021\240$\240a\240r\250\021\250#\250Q\250c\260\021\260\"\260A\260Q\260a\260s\270$\270b\300\003\3001\300C\300q\310\002\310!\3101\310A\310S\320PT\320TV\320VY\320YZ\320Z]\320]^\320^`\320`a\320ab\320bc\320cf\320fj\320jl\320lm\200\001\360\n\000\005\t\210\007\210u\220A\220Q\330\010\022\320\022.\250a\250t\2601\330\010\022\320\022.\250a\250t\2601\330\010$\240A\240T\250\025\320.B\300!\3001\330\010$\240A\240T\250\025\320.B\300!\3001\330\010\013\2109\220C\220q\330\014(\250\001\250\024\250U\3202F\300a\300q\200\001\360\014\000\005\t\210\010\220\005\220Q\220a\330\010\016\320\016,\250A\250Q\330\010\016\320\016*\250!\2504\250q\330\010,\250A\250X\3205I\310\021\310!\200\001\360\016\000\004\010\200v\210U\220!\2201\220F\230!\2301\330\006\n\210\047\220\025\220a\220q\230\006\230a\230q\330\t\024\220A\330\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\017\033\2301\230A\230S\240\004\240C\240r\250\021\250!\2501\250C\250t\2603\260b\270\001\270\022\2701\270C\270t\3001\330\t\r\210Q\210c\220\027\230\001\200\001\360\016\000\005\t\210\006\210e\2201\220F\230&\240\001\240\021\330\010\023\320\023\047\240q\250\001\330\010\014\210E\220\025\220a\220v\230V\2401\240A\330\014\022\220!\2203\220g\320\035/\250q\260\t\270\021\200\001\360\016\000*+\360\006\000\004\t\210\001\330\003\006\200a\200v\210Q\210a\210u\220A\220S\230\003\2301\330\006\t\210\032\2203\220a\330\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\007\220u\230A\230Q\230f\240A\240Q\330\017\023\2205\230\005\230Q\230a\230v\240Q\240a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\001\250\021\250#\250T\260\022\2602\260Q\260a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\002\250!\2501\250A\250S\260\004\260B\260a\330""\022\023\2201\220C\220t\2302\230S\240\001\330\022\023\2201\220C\220t\2307\240,\250a\250r\260\022\260<\270q\300\004\300A\300Q\340\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\007\220u\230A\230Q\230f\240A\240Q\330\017\023\2205\230\005\230Q\230a\230v\240Q\240a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\001\250\021\250#\250T\260\022\2602\260Q\260a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\002\250!\2501\250A\250S\260\004\260B\260a\330\022\023\2201\220C\220t\2302\230S\240\001\340\006\r\210Q\210f\220A\220Q\220e\2301\230C\230s\240!\330\006\t\210\032\2203\220a\330\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\007\220u\230A\230Q\230f\240A\240Q\330\017\023\2205\230\005\230Q\230a\230v\240Q\240a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\001\250\021\250#\250T\260\022\2602\260Q\260a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\002\250!\2501\250A\250S\260\004\260B\260a\330\022\023\2201\220C\220t\2307\240,\250a\250r\260\022\260<\270q\300\004\300A\300Q\340\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\007\220u\230A\230Q\230f\240A\240Q\330\017\023\2205\230\005\230Q\230a\230v\240Q\240a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\001\250\021\250#\250T\260\022\2602\260Q\260a\330\022\023\2201\220C\220t\2302\230S\240\003\2401\240B\240b\250\002\250!\2501\250A\250S\260\004\260B\260a\200\001\360\016\000*+\360\006\000\004\t\210\001\330\003\006\200a\200v\210Q\210c\220\023\220A\330\006\t\210\032\2203\220a\330\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\021\240!\2403\240b\250\002\250!\2501\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\022\2401\240A\240Q\240c\250\022\2501\330\017\020\220\001\220\023\220B\220c\230\021\330\017\020\220\001\220\023\220G\230<\240q\250\002\250\"\250L\270\001\270\024""\270Q\270a\340\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\021\240!\2403\240b\250\002\250!\2501\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\022\2401\240A\240Q\240c\250\022\2501\330\017\020\220\001\220\023\220B\220c\230\021\340\006\r\210Q\210f\220A\220S\230\003\2301\330\006\t\210\032\2203\220a\330\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\021\240!\2403\240b\250\002\250!\2501\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\022\2401\240A\240Q\240c\250\022\2501\330\017\020\220\001\220\023\220G\230<\240q\250\002\250\"\250L\270\001\270\024\270Q\270a\340\t\r\210V\2205\230\001\230\021\230&\240\001\240\021\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\021\240!\2403\240b\250\002\250!\2501\330\017\020\220\001\220\023\220B\220c\230\023\230A\230R\230r\240\022\2401\240A\240Q\240c\250\022\2501\200\001\360\020\000\005\t\210\006\210e\2201\220F\230&\240\001\240\021\330\010\023\320\023\047\240q\250\001\330\010\014\210E\220\025\220a\220v\230V\2401\240A\330\014\022\220!\2203\220e\320\033-\250Q\250a\200\001\360\022\000\004\010\200v\210U\220!\2202\220V\2301\230A\330\006\017\210q\330\006\017\210q\330\006\n\210%\210u\220A\220R\220v\230Q\230a\330\t\023\2202\220Q\220c\230\022\2301\230B\230a\230s\240!\330\t\020\220\002\220!\2203\220a\330\006\020\220\001\330\006\n\210%\210u\220A\220]\240&\250\001\250\021\340\n\027\220q\230\003\2306\240\025\240a\240v\250Q\250a\250q\260\003\2602\260R\260q\270\002\270!\2703\270a\200\001\360\022\000\005\t\210\006\210e\2201\220A\220V\2301\230A\330\010\023\320\023\047\240q\250\001\330\010\014\210E\220\025\220a\220q\230\006\230a\230q\330\014\022\220!\2203\220g\320\035/\250q\260\t\270\021\270!\2701\270C\270s\300\"\300A""\200\001\360\024\000\004\010\200v\210U\220!\2203\220f\230A\230Q\330\006\014\210A\330\006\n\210%\210u\220A\220S\230\006\230a\230q\330\t\020\220\002\220!\2203\220a\330\006\n\210%\210u\220A\220Q\220f\230A\230Q\330\t\r\210U\220%\220q\230\001\230\026\230q\240\001\330\014\027\220q\330\014\020\220\005\220U\230!\2303\230f\240A\240Q\330\017\033\2302\230Q\230c\240\022\2401\240C\240q\250\003\2502\250Q\250a\250q\260\003\2602\260Q\330\014\030\230\001\330\014\"\240!\2403\240b\250\006\250h\260a\260q\270\001\270\023\270B\270b\300\001\300\022\3001\300C\300q\200\001\360\024\000\004\t\210\001\330\003\006\200j\220\003\2201\330\006\n\210&\220\005\220Q\220a\220v\230Q\230a\330\t\r\210U\220%\220q\230\001\230\026\230q\240\001\330\014\r\210Q\210c\220\022\2203\220c\230\021\230\"\230B\230a\230q\240\003\2402\240R\240q\250\001\330\014\r\210Q\210c\220\022\2203\220c\230\021\230\"\230B\230b\240\001\240\021\240!\2403\240b\250\001\330\014\r\210Q\210c\220\022\2203\220a\330\014\r\210Q\210c\220\026\220u\230A\230S\240\001\240\022\2401\240A\240R\240|\2601\260A\340\006\n\210&\220\005\220Q\220a\220v\230Q\230a\330\t\r\210U\220%\220q\230\001\230\026\230q\240\001\330\014\r\210Q\210c\220\022\2203\220c\230\021\230\"\230B\230a\230q\240\003\2402\240R\240q\250\001\330\014\r\210Q\210c\220\022\2203\220c\230\021\230\"\230B\230b\240\001\240\021\240!\2403\240b\250\001\330\014\r\210Q\210c\220\022\2203\220a\200\001\360\024\000\004\t\210\001\330\003\006\200j\220\003\2201\330\006\n\210&\220\005\220Q\220a\220v\230Q\230a\330\t\r\210W\220E\230\021\230!\2306\240\021\240!\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\017\020\220\001\220\023\220D\230\002\230#\230S\240\001\240\022\2402\240Q\240a\240s\250$\250b\260\002\260!\2601\330\017\020\220\001\220\023\220D\230\002\230#\230S\240\001\240\022\2402\240R\240q\250\001\250\021\250#\250T\260\022\2601\330\017\020\220\001\220\023\220D\230\002\230#\230Q\330\017\020\220\001\220\023\220D\230\006\230e\2401\240C\240q\250\002\250!\2501\250B\250l\270!\2701\340\006\n\210&\220\005\220Q""\220a\220v\230Q\230a\330\t\r\210W\220E\230\021\230!\2306\240\021\240!\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\017\020\220\001\220\023\220D\230\002\230#\230S\240\001\240\022\2402\240Q\240a\240s\250$\250b\260\002\260!\2601\330\017\020\220\001\220\023\220D\230\002\230#\230S\240\001\240\022\2402\240R\240q\250\001\250\021\250#\250T\260\022\2601\330\017\020\220\001\220\023\220D\230\002\230#\230Q\200\001\360\024\000\005\t\210\006\210e\2201\220A\220V\2301\230A\330\010\023\320\023\047\240q\250\001\330\010\014\210E\220\025\220a\220q\230\006\230a\230q\330\014\022\220!\2203\220e\320\033-\250Q\250i\260q\270\001\270\021\270#\270S\300\001\200\001\360\026\000\004\010\200v\210U\220!\2202\220V\2301\230A\330\006\020\220\001\330\006\016\210a\330\006\n\210%\210u\220A\220R\220v\230Q\230a\330\t\024\220B\220a\220s\230!\330\t\024\220B\220a\220s\230\"\230A\230R\230q\240\003\2401\330\006\n\210%\210u\220A\220R\220v\230Q\230a\330\t\r\210U\220%\220q\230\002\230&\240\001\240\021\330\014#\2401\240C\240r\250\025\250b\260\001\260\023\260B\260b\270\001\270\025\270b\300\007\300q\310\001\200\001\360\030\000\004\010\200v\210U\220!\2202\220V\2301\230A\330\006\020\220\001\330\006\016\210a\330\006\n\210%\210u\220A\220R\220v\230Q\230a\330\t\024\220B\220a\220s\230!\330\t\024\220B\220a\220s\230\"\230A\230R\230q\240\003\2401\330\006\n\210%\210u\220A\220S\230\006\230a\230q\330\t\r\210S\220\001\220\023\220A\330\t%\240Q\240e\2507\260!\2602\260Q\260e\2702\270W\300A\300Q\200\001\360\032\000\005\t\210\006\210e\2201\220H\230F\240!\2401\330\010\014\210M\230\025\230a\230x\240v\250Q\250a\330\014\022\320\022(\250\001\250\023\250A\330\014\034\320\0340\260\001\260\024\260Q\330\014\034\320\0340\260\001\260\024\260Q\330\014\020\220\005\220U\230!\2308\2406\250\021\250!\330\020\030\230\001\230\023\230J\240e\2503\250b\3200B\300!\300>\320QR\3300B\300!\3001\200\001\360\032\000\005\t\210\007\210u\220A\220_\240F\250!\2501\330\010\030\320\030,\250A\250T\260\021\330\010\030\320\030,\250A\250T\260\021\330\010\014\210E""\220\025\220a\220\177\240f\250A\250Q\330\014\033\2301\230D\240\005\240S\250\002\320*<\270A\270^\3101\330*<\270A\270Q\200\001\360\036\000\005\t\210\006\210e\2201\220A\220V\2301\230A\330\010\014\210M\230\025\230a\230q\240\006\240a\240q\330\014\022\320\022(\250\001\250\023\250A\330\014\034\320\0340\260\001\260\024\260Q\330\014\034\320\0340\260\001\260\024\260Q\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\020\030\230\001\230\023\230J\240e\2503\250b\3200B\300!\300>\320QR\320RS\320ST\320TW\320Wa\320ad\320df\320fg\3300B\300!\300?\320RS\320ST\320TU\320UX\320Xb\320be\320ef\200\001\360\036\000\005\t\210\006\210e\2201\220H\230F\240!\2401\330\010\014\210M\230\025\230a\230x\240v\250Q\250a\330\014\022\320\022(\250\001\250\023\250A\330\014\034\320\0340\260\001\260\024\260Q\330\014\034\320\0340\260\001\260\024\260Q\330\014\020\220\005\220U\230!\2308\2406\250\021\250!\330\020\024\220E\230\025\230a\230q\330\024\030\230\005\230U\240!\2401\330\030 \240\003\2401\320$6\260a\260~\300Q\300b\310\002\310!\320K]\320]^\320^m\320mn\320np\320pq\330\030 \320 2\260!\260>\300\021\300\"\300C\300r\320I[\320[\\\320\\k\320kl\320ln\320nq\320qs\320st\330\030 \240\001\240\023\240J\250b\260\001\260\021\260\"\260A\260U\270%\270q\300\001\200\001\360\036\000\005\t\210\007\210u\220A\220Q\220f\230A\230Q\330\010\030\320\030,\250A\250T\260\021\330\010\030\320\030,\250A\250T\260\021\330\010\014\210E\220\025\220a\220q\230\006\230a\230q\330\014\033\2301\230D\240\005\240S\250\002\320*<\270A\270^\3101\310A\310Q\310d\320RU\320UW\320WX\330*<\270A\270_\310A\310Q\310a\310t\320SV\320VW\200\001\360\036\000\005\t\210\007\210u\220A\220_\240F\250!\2501\330\010\030\320\030,\250A\250T\260\021\330\010\030\320\030,\250A\250T\260\021\330\010\014\210E\220\025\220a\220\177\240f\250A\250Q\330\014\020\220\005\220U\230!\2301\330\020\024\220E\230\025\230a\230q\330\024\034\230C\230q\320 2\260!\260>\300\021\300\"\300B\300a\320GY\320YZ\320Zi\320ij\320jl\320lm\330\024\034\320\034.\250a\250~\270Q\270b\300\003\3002\320EW\320WX\320Xg""\320gh\320hj\320jm\320mo\320op\330\024#\2401\240D\250\002\250!\2501\250B\250a\250u\260E\270\021\270!\200\001\360\"\000\005\t\210\006\210e\2201\220A\220V\2301\230A\330\010\014\210M\230\025\230a\230q\240\006\240a\240q\330\014\022\320\022(\250\001\250\023\250A\330\014\034\320\0340\260\001\260\024\260Q\330\014\034\320\0340\260\001\260\024\260Q\330\014\020\220\005\220U\230!\2301\230F\240!\2401\330\020\024\220E\230\025\230a\230q\330\024\030\230\005\230U\240!\2401\330\030 \240\003\2401\320$6\260a\260~\300Q\300a\300q\310\003\310:\320UX\320XZ\320Z[\320[]\320]_\320_`\320`r\320rs\360\000\000t\001C\002\360\000\000C\002D\002\360\000\000D\002E\002\360\000\000E\002F\002\360\000\000F\002I\002\360\000\000I\002S\002\360\000\000S\002V\002\360\000\000V\002X\002\360\000\000X\002Y\002\360\000\000Y\002[\002\360\000\000[\002\\\002\330\030 \320 2\260!\260>\300\021\300!\3001\300C\300z\320QT\320TV\320VW\320WY\320Y\\\320\\^\320^p\320pq\360\000\000r\001A\002\360\000\000A\002B\002\360\000\000B\002C\002\360\000\000C\002D\002\360\000\000D\002G\002\360\000\000G\002Q\002\360\000\000Q\002T\002\360\000\000T\002V\002\360\000\000V\002W\002\360\000\000W\002Y\002\360\000\000Y\002\\\002\360\000\000\\\002^\002\360\000\000^\002_\002\330\030 \240\001\240\023\240J\250b\260\001\260\021\260\"\260A\260U\270%\270q\300\001\200\001\360\"\000\005\t\210\007\210u\220A\220Q\220f\230A\230Q\330\010\030\320\030,\250A\250T\260\021\330\010\030\320\030,\250A\250T\260\021\330\010\014\210E\220\025\220a\220q\230\006\230a\230q\330\014\020\220\005\220U\230!\2301\330\020\024\220E\230\025\230a\230q\330\024\034\230C\230q\320 2\260!\260>\300\021\300!\3001\300D\310\003\3102\310Q\310b\320PR\320RS\320Se\320ef\320fu\320uv\320vw\320wx\320x|\320|\177\360\000\000@\002B\002\360\000\000B\002C\002\360\000\000C\002E\002\360\000\000E\002F\002\330\024\034\320\034.\250a\250~\270Q\270a\270q\300\004\300C\300r\310\021\310\"\310C\310r\320Qc\320cd\320ds\320st\320tu\320uv\320vz\320z}\320}\177\360\000\000@\002A\002\360\000\000A\002C\002\360\000\000C\002F""\002\360\000\000F\002H\002\360\000\000H\002I\002\330\024#\2401\240D\250\002\250!\2501\250B\250a\250u\260E\270\021\270!\200\001\3606\000\005\030\220v\230Q\230a\330\004\023\2206\230\021\230!\340\0040\260\005\260V\2701\270D\300\001\330\0040\260\005\260V\2701\270D\300\001\330\0040\260\005\260V\2701\270D\300\001\360\006\000\005\t\210\006\210e\2201\220A\330\010\020\320\020$\240A\240Q\330\010\014\210F\220%\220q\230\001\330\014\020\220\001\220\027\230\003\2301\230C\230q\240\006\240a\330\010\014\210G\2205\230\001\230\021\330\014\032\320\032/\250q\260\003\2601\330\014\020\220\006\220e\2301\230A\330\020\026\220a\220v\230T\240\021\240!\330\014\017\210|\2303\230a\330\020\035\320\0351\260\021\260!\330\020\024\220F\230%\230q\240\001\330\024\032\230!\2307\240#\240Q\240c\250\021\250+\260Q\330\014\020\220\006\220e\2301\230A\330\020\025\220Q\220f\230C\230q\240\004\240A\240S\250\001\250\026\250q\260\003\2602\260T\270\021\270#\270Q\270f\300A\300S\310\001\310\021\330\020\026\220a\220s\230$\230f\240E\250\021\250!\330\014\020\220\005\220U\230!\2301\330\020\026\220a\220s\230$\230e\2401\330\020\024\220F\230%\230q\240\006\240a\240s\250&\260\001\260\021\260!\2601\330\024\032\230!\2303\230d\240&\250\003\2501\250E\260\021\260#\260Q\260g\270Q\270f\300A\300Q\200\001\360P\001\000\005\t\210\005\210Q\210d\220\047\230\024\230U\240!\330\010\017\210q\220\006\220a\220s\230#\230V\2401\240A\330\004\013\320\013\036\230c\240\027\250\002\250!\360\006\000\005<\2703\270a\270q\360\n\000\005\036\230S\240\002\240&\250\001\250\021\360\006\000\005\t\210\006\210e\2201\220A\330\010\020\320\020$\240A\240Q\330\010\014\210E\220\025\220a\220q\330\014\022\220%\220q\230\005\230Q\230c\240\021\330\014\017\210q\220\003\2205\230\001\360\006\000\r\024\2201\220A\330\014\020\220\004\220B\220c\230\021\230!\2301\230A\330\014\025\220V\2301\230G\2402\240W\250A\250Q\330\014\017\210u\220B\220a\330\020\030\230\005\230Q\230f\240A\240Q\330\020\034\230C\230q\240\006\240a\240q\250\006\250a\250q\330\020\034\230I\240Q\240a\330\020\034\230I""\240Q\240a\330\020\"\240$\240b\250\001\340\020\027\220s\230!\320\033+\2501\250A\340\020\036\230e\2401\240F\250\"\250C\250q\260\001\260\021\260\047\270\022\2704\270q\320@P\320PQ\320QR\340\020\027\220s\230!\2309\240A\240Q\330\020\030\230\004\230A\230Q\330\020\036\230a\230u\240A\240V\2502\250Q\250a\250v\260Q\260d\270!\2709\300A\300U\310\"\310I\320UV\320VW\340\020\031\230\027\240\001\240\026\240q\250\005\250R\250v\260Q\260a\330\020 \240\007\240q\250\007\250r\260\021\340\020\034\230D\240\001\240\021\330\020\025\220Y\230a\230q\330\020\036\230c\240\021\240*\250A\250[\270\001\270\026\270r\300\023\300A\300Y\310a\310t\320ST\320TU\340\020 \240\001\330\020 \240\001\330\020 \240\001\330\020 \240\001\340\014\023\2203\220a\220s\230!\2304\230q\240\001\330\014\023\2204\220q\230\001\330\014\022\220!\2203\220e\2304\230q\240\001\330\014\023\2201\220C\220s\230!\2304\230q\240\r\250Q\250e\2601\260A\340\014\020\220\001\220\023\220E\230\021\330\014\021\220\021\220#\220T\230\021\230!\360\014\000\005\t\210\006\210e\2201\220A\330\010\020\220\005\220T\230\021\230#\230Q\230d\240!\2401\330\010\020\220\005\220T\230\021\230$\230a\230t\2401\240A\340\010\020\220\005\220R\220u\230D\240\001\240\030\320)@\300\001\300\021\360\010\000\t\r\210G\2205\230\001\230\021\340\014\023\2201\220C\220w\230a\330\014\032\320\032/\250q\260\003\2601\330\014\017\210|\2303\230a\330\020\032\230%\230t\2401\240C\240q\250\r\260Q\260a\330\020\032\230%\230t\2401\240D\250\001\250\035\260a\260q\340\020\032\230\047\240\022\2405\250\004\250A\250X\3205L\310A\310Q\340\020\023\2207\230\"\230A\330\024\033\2301\230C\230w\240a\200\001\360R\001\000\005\033\230!\340\004\010\210\005\210Q\210d\220$\220e\2304\230q\330\010\017\210q\220\006\220a\220s\230#\230V\2401\240A\330\004\013\320\013\035\230S\240\006\240a\240q\330\004\023\2206\230\021\230!\360\010\000\005.\250U\260&\270\001\270\024\270Q\330\004-\250U\260&\270\001\270\027\300\001\340\004\035\230S\240\002\240&\250\001\250\021\330\004\027\320\027\047\240q\330\004\007\200w\210c\220\021\330""\010\024\220A\330\004\007\200w\210c\220\021\330\010\024\220C\220q\230\001\340\004\010\210\006\210e\2201\220A\330\010\021\220\031\230!\2304\230q\240\006\240a\240s\250!\330\010\021\220\032\2301\230A\340\010\014\210E\220\025\220a\220q\360\006\000\r\034\2301\230C\230v\240V\2501\250D\260\001\260\023\260A\340\014\033\2301\230C\230v\240V\2501\250C\250q\260\003\2601\360\006\000\r\021\220\007\220u\230A\230Q\340\020\024\220F\230%\230q\240\001\330\024\030\230\001\230\026\230v\240Q\240c\250\024\250S\260\001\260\027\270\001\270\023\270A\330\020\024\220E\230\025\230a\230q\330\024\030\230\001\230\025\230f\240A\240S\250\004\250B\250a\250w\260a\260s\270!\360\006\000\021\025\220E\230\025\230a\230q\330\024#\2401\240C\240v\250V\2601\260D\270\001\270\022\2701\270H\300A\300S\310\004\310B\310a\330\024\030\230\006\230e\2401\240F\250!\2503\250f\260A\260Q\260a\260q\330\030\047\240q\250\003\2506\260\026\260q\270\004\270A\270S\300\001\300\030\310\021\310#\310T\320QW\320WX\320X\\\320\\]\320]e\320ef\320fi\320im\320mo\320op\200\001\360\\\001\000\005\033\230!\330\004\026\220a\340\004\010\210\005\210Q\210d\220$\220e\2304\230q\330\010\017\210q\220\006\220a\220s\230#\230V\2401\240A\330\004\013\320\013\035\230S\240\006\240a\240q\330\004\023\2206\230\021\230!\360\010\000\005.\250U\260&\270\001\270\024\270Q\330\004-\250U\260&\270\001\270\027\300\001\340\004\035\230S\240\002\240&\250\001\250\021\330\004\027\320\027\047\240q\330\004#\2401\330\004\007\200w\210c\220\021\330\010\024\220A\330\004\007\200w\210c\220\021\330\010\024\220C\220q\230\001\340\004\010\210\006\210e\2201\220A\330\010\021\220\031\230!\2304\230q\240\006\240a\240s\250!\330\010\021\220\032\2301\230A\360\006\000\t\r\210E\220\025\220a\220q\360\010\000\r\034\2301\230C\230r\240\026\240v\250Q\250e\2601\260C\260q\360\006\000\r\021\220\007\220u\230A\230Q\340\020\024\220F\230%\230q\240\001\330\024\030\230\001\230\026\230v\240Q\240c\250\024\250S\260\001\260\027\270\001\270\023\270A\330\020\024\220E\230\025\230a\230q\330\024\030\230\001\230\025\230f""\240A\240S\250\004\250B\250a\250w\260a\260s\270!\360\010\000\021\025\220E\230\025\230a\230q\330\024\030\230\005\230U\240!\2401\330\030\034\230F\240%\240q\250\006\250a\250s\260&\270\001\270\021\270!\2701\330\034+\2501\250C\250r\260\026\260v\270Q\270d\300!\3003\300a\300x\310q\320PS\320SW\320WY\320Y_\320_`\320`d\320de\320em\320mn\320nq\320qu\320uw\320wx";
27268 PyObject *data = NULL;
27269 #define __Pyx_DecompressString_UNUSED
27270 #define __Pyx_DecompressString_LZSS_UNUSED
27271 #endif
27272 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
27273 Py_ssize_t pos = 0;
27274 for (int i = 0; i < 209; i++) {
27275 Py_ssize_t bytes_length = str_length_index[i].length;
27276 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
27277 if (likely(string) && i >= 6) PyUnicode_InternInPlace(&string);
27278 if (unlikely(!string)) {
27279 Py_XDECREF(data);
27280 __PYX_ERR(0, 1, __pyx_L1_error)
27281 }
27282 stringtab[i] = string;
27283 pos += bytes_length;
27284 }
27285 for (int i = 209; i < 238; i++) {
27286 Py_ssize_t bytes_length = bytes_length_index[i-209].length;
27287 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
27288 stringtab[i] = string;
27289 pos += bytes_length;
27290 if (unlikely(!string)) {
27291 Py_XDECREF(data);
27292 __PYX_ERR(0, 1, __pyx_L1_error)
27293 }
27294 }
27295 Py_XDECREF(data);
27296 for (Py_ssize_t i = 0; i < 238; i++) {
27297 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
27298 __PYX_ERR(0, 1, __pyx_L1_error)
27299 }
27300 }
27301 #if CYTHON_IMMORTAL_CONSTANTS
27302 {
27303 PyObject **table = stringtab + 209;
27304 for (Py_ssize_t i=0; i<29; ++i) {
27305 #if PY_VERSION_HEX >= 0x030F0000
27306 PyUnstable_SetImmortal(table[i]);
27307 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27308 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
27309 #if PY_VERSION_HEX < 0x030E0000
27310 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
27311 #else
27312 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
27313 #endif
27314 {
27315 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
27316 }
27317 #else
27318 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
27319 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
27320 #endif
27321 }
27322 }
27323 #endif
27324 }
27325 {
27326 PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
27327 double const c_constants[] = {0.0,0.5,2.0,1.0e-20};
27328 for (int i = 0; i < 4; i++) {
27329 numbertab[i] = PyFloat_FromDouble(c_constants[i]);
27330 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
27331 }
27332 }
27333 #if CYTHON_IMMORTAL_CONSTANTS
27334 {
27335 PyObject **table = __pyx_mstate->__pyx_number_tab;
27336 for (Py_ssize_t i=0; i<4; ++i) {
27337 #if PY_VERSION_HEX >= 0x030F0000
27338 PyUnstable_SetImmortal(table[i]);
27339 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27340 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
27341 #if PY_VERSION_HEX < 0x030E0000
27342 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
27343 #else
27344 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
27345 #endif
27346 {
27347 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
27348 }
27349 #else
27350 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
27351 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
27352 #endif
27353 }
27354 }
27355 #endif
27356 return 0;
27357 __pyx_L1_error:;
27358 return -1;
27359}
27360/* #### Code section: init_codeobjects ### */
27361#ifdef __cplusplus
27362namespace {
27363#endif
27364typedef struct {
27365 unsigned int argcount : 5;
27366 unsigned int num_posonly_args : 1;
27367 unsigned int num_kwonly_args : 1;
27368 unsigned int nlocals : 6;
27369 unsigned int flags : 10;
27370 unsigned int first_line : 10;
27371} __Pyx_PyCode_New_function_description;
27372#ifdef __cplusplus
27373} /* anonymous namespace */
27374#endif
27375/* NewCodeObj.proto */
27376static PyObject* __Pyx_PyCode_New(
27377 const __Pyx_PyCode_New_function_description descr,
27378 PyObject * const *varnames,
27379 PyObject *filename,
27380 PyObject *funcname,
27381 PyObject *line_table,
27382 PyObject *tuple_dedup_map
27383);
27384
27385
27386static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
27387 PyObject* tuple_dedup_map = PyDict_New();
27388 if (unlikely(!tuple_dedup_map)) return -1;
27389 {
27390 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 19};
27391 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nExteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_exteriorElementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryElementsArray, __pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_exteriorElementBoundaryMaterialT, __pyx_mstate->__pyx_n_u_ebNE, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_eN};
27392 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setExteriorElementBoundaryTypes, __pyx_mstate->__pyx_kp_b_iso88591_Qa_AQ_4q_AX5I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
27393 }
27394 {
27395 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30};
27396 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nElementBoundaries_global, __pyx_mstate->__pyx_n_u_elementBoundaryElementsArray, __pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_elementBoundaryMaterialTypes, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_eN_left, __pyx_mstate->__pyx_n_u_eN_right};
27397 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setElementBoundariesArray, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_at1_at1_AT_B_1_AT_B_1_9Cq_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
27398 }
27399 {
27400 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44};
27401 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_q_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material};
27402 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setScalarMaterialFunctionOverEle, __pyx_mstate->__pyx_kp_b_iso88591_e1F_q_E_avV1A_3e_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
27403 }
27404 {
27405 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 57};
27406 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_q_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material};
27407 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setVectorMaterialFunctionOverEle, __pyx_mstate->__pyx_kp_b_iso88591_e1F_q_E_avV1A_3g_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
27408 }
27409 {
27410 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 70};
27411 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_ebq_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_ebN_local, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right};
27412 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setScalarMaterialFunctionOverEle_2, __pyx_mstate->__pyx_kp_b_iso88591_e1HF_1_M_axvQa_A_0_Q_0_Q_U_86_J, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
27413 }
27414 {
27415 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92};
27416 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nd, __pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_ebq_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_ebN_local, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_numer, __pyx_mstate->__pyx_n_u_denom};
27417 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setSparseTensorMaterialFunctionO, __pyx_mstate->__pyx_kp_b_iso88591_e1HF_1_M_axvQa_A_0_Q_0_Q_U_86_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
27418 }
27419 {
27420 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 119};
27421 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_ebq_global_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right, __pyx_mstate->__pyx_n_u_k};
27422 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setScalarMaterialFunctionOverGlo, __pyx_mstate->__pyx_kp_b_iso88591_uA_F_1_AT_AT_E_a_fAQ_1D_S_A_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
27423 }
27424 {
27425 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 140};
27426 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nd, __pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_ebq_global_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_numer, __pyx_mstate->__pyx_n_u_denom};
27427 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_setSparseTensorMaterialFunctionO_2, __pyx_mstate->__pyx_kp_b_iso88591_uA_F_1_AT_AT_E_a_fAQ_U_1_E_aq_C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
27428 }
27429 {
27430 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
27431 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_q_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material};
27432 __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_evaluateScalarMaterialFunctionOv, __pyx_mstate->__pyx_kp_b_iso88591_e1AV1A_q_E_aq_aq_3e_Qiq_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
27433 }
27434 {
27435 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 181};
27436 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_q_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material};
27437 __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_evaluateVectorMaterialFunctionOv, __pyx_mstate->__pyx_kp_b_iso88591_e1AV1A_q_E_aq_aq_3g_q_1Cs_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
27438 }
27439 {
27440 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 196};
27441 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_ebq_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_ebN_local, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right};
27442 __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_evaluateScalarMaterialFunctionOv_2, __pyx_mstate->__pyx_kp_b_iso88591_e1AV1A_M_aq_aq_A_0_Q_0_Q_U_1F_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
27443 }
27444 {
27445 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 220};
27446 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nd, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_ebq_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_ebN_local, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_numer, __pyx_mstate->__pyx_n_u_denom};
27447 __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_evaluateSparseTensorMaterialFunc, __pyx_mstate->__pyx_kp_b_iso88591_e1AV1A_M_aq_aq_A_0_Q_0_Q_U_1F_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
27448 }
27449 {
27450 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 249};
27451 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_ebq_global_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right, __pyx_mstate->__pyx_n_u_k};
27452 __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_evaluateScalarMaterialFunctionOv_3, __pyx_mstate->__pyx_kp_b_iso88591_uAQfAQ_AT_AT_E_aq_aq_1D_S_A_1AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
27453 }
27454 {
27455 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 272};
27456 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nd, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_elementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryTypes, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_ebq_global_vals, __pyx_mstate->__pyx_n_u_material_functions, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_material_left, __pyx_mstate->__pyx_n_u_material_right, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_numer, __pyx_mstate->__pyx_n_u_denom};
27457 __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_evaluateSparseTensorMaterialFunc_2, __pyx_mstate->__pyx_kp_b_iso88591_uAQfAQ_AT_AT_E_aq_aq_U_1_E_aq_C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
27458 }
27459 {
27460 const __Pyx_PyCode_New_function_description descr = {12, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 302};
27461 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_rho, __pyx_mstate->__pyx_n_u_gravity, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_KWs, __pyx_mstate->__pyx_n_u_nSpace, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_q_flin, __pyx_mstate->__pyx_n_u_q_alin, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_eN_neighbor, __pyx_mstate->__pyx_n_u_ii, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_matID, __pyx_mstate->__pyx_n_u_matID_neig, __pyx_mstate->__pyx_n_u_nSpace2, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_a_eN, __pyx_mstate->__pyx_n_u_a_neig, __pyx_mstate->__pyx_n_u_a_avg};
27462 __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_RE_NCP1_evaluateElementCoefficie, __pyx_mstate->__pyx_kp_b_iso88591_6_vQa_6_0_V1D_0_V1D_0_V1D_e1A_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
27463 }
27464 {
27465 const __Pyx_PyCode_New_function_description descr = {24, 0, 0, 61, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 360};
27466 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_rho, __pyx_mstate->__pyx_n_u_beta, __pyx_mstate->__pyx_n_u_gravity, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_thetaR, __pyx_mstate->__pyx_n_u_thetaSR, __pyx_mstate->__pyx_n_u_nSpace, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_elementBarycentersArray, __pyx_mstate->__pyx_n_u_elementMaterialTypes, __pyx_mstate->__pyx_n_u_nDOF_trial_element, __pyx_mstate->__pyx_n_u_u_l2g, __pyx_mstate->__pyx_n_u_u_dof, __pyx_mstate->__pyx_n_u_q_x, __pyx_mstate->__pyx_n_u_q_u, __pyx_mstate->__pyx_n_u_q_mass, __pyx_mstate->__pyx_n_u_q_dmass, __pyx_mstate->__pyx_n_u_q_r, __pyx_mstate->__pyx_n_u_q_kr, __pyx_mstate->__pyx_n_u_q_dkr, __pyx_mstate->__pyx_n_u_q_kr_up, __pyx_mstate->__pyx_n_u_q, __pyx_mstate->__pyx_n_u_psiC, __pyx_mstate->__pyx_n_u_pcBar, __pyx_mstate->__pyx_n_u_pcBar_n, __pyx_mstate->__pyx_n_u_pcBar_nM1, __pyx_mstate->__pyx_n_u_pcBar_nM2, __pyx_mstate->__pyx_n_u_onePlus_pcBar_n, __pyx_mstate->__pyx_n_u_sBar, __pyx_mstate->__pyx_n_u_sqrt_sBar, __pyx_mstate->__pyx_n_u_DsBar_DpsiC, __pyx_mstate->__pyx_n_u_thetaW, __pyx_mstate->__pyx_n_u_DthetaW_DpsiC, __pyx_mstate->__pyx_n_u_vBar, __pyx_mstate->__pyx_n_u_vBar2, __pyx_mstate->__pyx_n_u_DvBar_DpsiC, __pyx_mstate->__pyx_n_u_KWr, __pyx_mstate->__pyx_n_u_DKWr_DpsiC, __pyx_mstate->__pyx_n_u_rho2, __pyx_mstate->__pyx_n_u_thetaS, __pyx_mstate->__pyx_n_u_rhom, __pyx_mstate->__pyx_n_u_drhom, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_u_j, __pyx_mstate->__pyx_n_u_u_eN, __pyx_mstate->__pyx_n_u_u_neig, __pyx_mstate->__pyx_n_u_kr_eN, __pyx_mstate->__pyx_n_u_kr_neig, __pyx_mstate->__pyx_n_u_phi_eN, __pyx_mstate->__pyx_n_u_phi_neig, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_eN_neighbor, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_ii, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_matID, __pyx_mstate->__pyx_n_u_nAvgWeight};
27467 __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_RE_NCP1_evaluateElementCoefficie_2, __pyx_mstate->__pyx_kp_b_iso88591_P_Qd_U_q_as_V1A_c_3aq_S_e1A_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
27468 }
27469 {
27470 const __Pyx_PyCode_New_function_description descr = {21, 0, 0, 42, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 487};
27471 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_gravity, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_nSpace, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_elementBarycentersArray, __pyx_mstate->__pyx_n_u_nDOF_test_element, __pyx_mstate->__pyx_n_u_q_u, __pyx_mstate->__pyx_n_u_q_grad_u, __pyx_mstate->__pyx_n_u_q_grad_w, __pyx_mstate->__pyx_n_u_q_detJ, __pyx_mstate->__pyx_n_u_q_m, __pyx_mstate->__pyx_n_u_q_mt, __pyx_mstate->__pyx_n_u_q_r, __pyx_mstate->__pyx_n_u_q_kr, __pyx_mstate->__pyx_n_u_q_kr_up, __pyx_mstate->__pyx_n_u_q_flin, __pyx_mstate->__pyx_n_u_q_alin, __pyx_mstate->__pyx_n_u_elementResidual, __pyx_mstate->__pyx_n_u_upwindFlag, __pyx_mstate->__pyx_n_u_q, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_u_eN, __pyx_mstate->__pyx_n_u_kr_eN, __pyx_mstate->__pyx_n_u_phi_eN, __pyx_mstate->__pyx_n_u_u_neig, __pyx_mstate->__pyx_n_u_kr_neig, __pyx_mstate->__pyx_n_u_phi_neig, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_eN_neighbor, __pyx_mstate->__pyx_n_u_ii, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_a_up, __pyx_mstate->__pyx_n_u_f_up, __pyx_mstate->__pyx_n_u_nAvgWeight, __pyx_mstate->__pyx_n_u_weight, __pyx_mstate->__pyx_n_u_volFactor, __pyx_mstate->__pyx_n_u_volume};
27472 __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_RE_NCP1_getElementResidual, __pyx_mstate->__pyx_kp_b_iso88591_R_Qd_e4q_q_as_V1A_S_aq_6_U_Q_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
27473 }
27474 {
27475 const __Pyx_PyCode_New_function_description descr = {26, 0, 0, 51, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 575};
27476 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_gravity, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_nSpace, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_elementBarycentersArray, __pyx_mstate->__pyx_n_u_nDOF_test_element, __pyx_mstate->__pyx_n_u_nDOF_trial_element, __pyx_mstate->__pyx_n_u_q_u, __pyx_mstate->__pyx_n_u_q_grad_u, __pyx_mstate->__pyx_n_u_q_grad_w, __pyx_mstate->__pyx_n_u_q_grad_v, __pyx_mstate->__pyx_n_u_q_detJ, __pyx_mstate->__pyx_n_u_q_m, __pyx_mstate->__pyx_n_u_q_dm, __pyx_mstate->__pyx_n_u_q_mt, __pyx_mstate->__pyx_n_u_q_dmt, __pyx_mstate->__pyx_n_u_q_r, __pyx_mstate->__pyx_n_u_q_kr, __pyx_mstate->__pyx_n_u_q_dkr, __pyx_mstate->__pyx_n_u_q_kr_up, __pyx_mstate->__pyx_n_u_q_flin, __pyx_mstate->__pyx_n_u_q_alin, __pyx_mstate->__pyx_n_u_elementJacobian, __pyx_mstate->__pyx_n_u_upwindFlag, __pyx_mstate->__pyx_n_u_picard, __pyx_mstate->__pyx_n_u_q, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_u_eN, __pyx_mstate->__pyx_n_u_kr_eN, __pyx_mstate->__pyx_n_u_phi_eN, __pyx_mstate->__pyx_n_u_u_neig, __pyx_mstate->__pyx_n_u_kr_neig, __pyx_mstate->__pyx_n_u_phi_neig, __pyx_mstate->__pyx_n_u_dkr_up, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_eN_neighbor, __pyx_mstate->__pyx_n_u_ii, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_a_up, __pyx_mstate->__pyx_n_u_f_up, __pyx_mstate->__pyx_n_u_nAvgWeight, __pyx_mstate->__pyx_n_u_weight, __pyx_mstate->__pyx_n_u_volFactor, __pyx_mstate->__pyx_n_u_thisElementIsUpwind, __pyx_mstate->__pyx_n_u_volume, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_j};
27477 __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_RE_NCP1_getElementJacobian, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_e4q_q_as_V1A_S_aq_6_U_Q_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
27478 }
27479 {
27480 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 674};
27481 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_mt, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_dV, __pyx_mstate->__pyx_n_u_weak_residual, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_mt_avg, __pyx_mstate->__pyx_n_u_vol};
27482 __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_updateMass_weakAvg, __pyx_mstate->__pyx_kp_b_iso88591_vU_2V1A_q_q_uARvQa_2Qc_1Bas_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
27483 }
27484 {
27485 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693};
27486 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_dmt, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_dV, __pyx_mstate->__pyx_n_u_jacobian_weak_residual, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_dmtj_avg, __pyx_mstate->__pyx_n_u_vol};
27487 __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_updateMassJacobian_weakAvg, __pyx_mstate->__pyx_kp_b_iso88591_vU_3fAQ_A_uAS_aq_3a_uAQfAQ_U_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
27488 }
27489 {
27490 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 718};
27491 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_dS, __pyx_mstate->__pyx_n_u_flux, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_kb, __pyx_mstate->__pyx_n_u_integral, __pyx_mstate->__pyx_n_u_I};
27492 __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_calculateNormalFlux, __pyx_mstate->__pyx_kp_b_iso88591_vU_1F_1_aq_aq_A_V5_U_1F_1_1AS_C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
27493 }
27494 {
27495 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 733};
27496 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_characteristic_velocity, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_dV, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_omega_e, __pyx_mstate->__pyx_n_u_vol_e};
27497 __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_computeSimpleCharacteristicVeloc, __pyx_mstate->__pyx_kp_b_iso88591_vU_2V1A_a_uARvQa_Bas_Bas_ARq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
27498 }
27499 {
27500 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 754};
27501 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df_dofs, __pyx_mstate->__pyx_n_u_characteristic_velocity_dofs, __pyx_mstate->__pyx_n_u_l2g, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_dV, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_omega_e, __pyx_mstate->__pyx_n_u_vol_e};
27502 __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_computeSimpleCharacteristicVeloc_2, __pyx_mstate->__pyx_kp_b_iso88591_vU_2V1A_a_uARvQa_Bas_Bas_ARq_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
27503 }
27504 {
27505 const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 777};
27506 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_transient, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_tForReversal, __pyx_mstate->__pyx_n_u_clock, __pyx_mstate->__pyx_n_u_xc, __pyx_mstate->__pyx_n_u_yc, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_zvelocity, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_pi};
27507 __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_rotatingGaussianElementVelocityE, __pyx_mstate->__pyx_kp_b_iso88591_avQc_A_3a_V5_U_1F_1_Bc_ARr_3b_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
27508 }
27509 {
27510 const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 817};
27511 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_transient, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_tForReversal, __pyx_mstate->__pyx_n_u_clock, __pyx_mstate->__pyx_n_u_xc, __pyx_mstate->__pyx_n_u_yc, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_zvelocity, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_pi};
27512 __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_rotatingGaussianElementVelocityE_2, __pyx_mstate->__pyx_kp_b_iso88591_avQauAS_1_3a_V5_uAQfAQ_5_QavQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
27513 }
27514 {
27515 const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 860};
27516 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_transient, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_tForReversal, __pyx_mstate->__pyx_n_u_clock, __pyx_mstate->__pyx_n_u_zVelocity, __pyx_mstate->__pyx_n_u_xc, __pyx_mstate->__pyx_n_u_yc, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_pi};
27517 __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_helicalElementVelocityEval3, __pyx_mstate->__pyx_kp_b_iso88591_j_1_QavQa_U_q_q_Qc_3c_Baq_2Rq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
27518 }
27519 {
27520 const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 885};
27521 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_transient, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_tForReversal, __pyx_mstate->__pyx_n_u_clock, __pyx_mstate->__pyx_n_u_zVelocity, __pyx_mstate->__pyx_n_u_xc, __pyx_mstate->__pyx_n_u_yc, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_pi};
27522 __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_helicalElementVelocityEval4, __pyx_mstate->__pyx_kp_b_iso88591_j_1_QavQa_WE_6_U_1F_1_D_S_2Qas, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
27523 }
27524 {
27525 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 912};
27526 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_pi, __pyx_mstate->__pyx_n_u_one8};
27527 __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_vortexElementVelocityEval3, __pyx_mstate->__pyx_kp_b_iso88591_Qa_vU_1F_1_uAQfAQ_3b_Cq_4q_3as, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
27528 }
27529 {
27530 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 925};
27531 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_pi, __pyx_mstate->__pyx_n_u_one8};
27532 __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_subsurfaceTransportFunct, __pyx_mstate->__pyx_n_u_vortexElementVelocityEval4, __pyx_mstate->__pyx_kp_b_iso88591_Qa_vU_1F_1_aq_aq_U_q_q_Qc_Rt3ar, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
27533 }
27534 Py_DECREF(tuple_dedup_map);
27535 return 0;
27536 bad:
27537 Py_DECREF(tuple_dedup_map);
27538 return -1;
27539}
27540/* #### Code section: init_globals ### */
27541
27542static int __Pyx_InitGlobals(void) {
27543 int __pyx_lineno = 0;
27544 const char *__pyx_filename = NULL;
27545 int __pyx_clineno = 0;
27546 /* PythonCompatibility.init */
27547 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
27548
27549 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27550
27551 /* PyFrozenDict.init */
27552 #if CYTHON_COMPILING_IN_LIMITED_API
27553 {
27554 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
27555 if (likely(builtins)) {
27556 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
27557 if (likely(type_name)) {
27558 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
27559 Py_DECREF(type_name);
27560 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
27561 PyErr_Clear();
27562 frozendict_type = (PyObject*) &PyDict_Type;
27563 Py_INCREF(frozendict_type);
27564 }
27565 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
27566 }
27567 }
27568 } // error handling follows
27569 #endif
27570
27571 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27572
27573 /* AssertionsEnabled.init */
27574 if (likely(__Pyx_init_assertions_enabled() == 0)); else
27575
27576 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27577
27578 /* NumpyImportArray.init */
27579 /*
27580 * Cython has automatically inserted a call to _import_array since
27581 * you didn't include one when you cimported numpy. To disable this
27582 * add the line
27583 * <void>numpy._import_array
27584 */
27585 #ifdef NPY_FEATURE_VERSION
27586 #ifndef NO_IMPORT_ARRAY
27587 if (unlikely(_import_array() == -1)) {
27588 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
27589 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
27590 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
27591 }
27592 #endif
27593 #endif
27594
27595 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27596
27597 /* CommonTypesMetaclass.init */
27598 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
27599
27600 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27601
27602 /* CachedMethodType.init */
27603 #if CYTHON_COMPILING_IN_LIMITED_API
27604 {
27605 PyObject *typesModule=NULL;
27606 typesModule = PyImport_ImportModule("types");
27607 if (typesModule) {
27608 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
27609 Py_DECREF(typesModule);
27610 }
27611 } // error handling follows
27612 #endif
27613
27614 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27615
27616 return 0;
27617 __pyx_L1_error:;
27618 return -1;
27619}
27620/* #### Code section: init_after_shared_utility ### */
27621
27622static int __Pyx_InitAfterSharedUtility(void) {
27623 int __pyx_lineno = 0;
27624 const char *__pyx_filename = NULL;
27625 int __pyx_clineno = 0;
27626 /* CythonFunctionPerModule.init */
27627 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
27628
27629 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27630
27631 return 0;
27632 __pyx_L1_error:;
27633 return -1;
27634}
27635/* #### Code section: cleanup_globals ### */
27636/* #### Code section: cleanup_module ### */
27637/* #### Code section: main_method ### */
27638/* #### Code section: utility_code_pragmas ### */
27639#ifdef _MSC_VER
27640#pragma warning( push )
27641/* Warning 4127: conditional expression is constant
27642 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
27643 * compile-time, so this warning is not useful
27644 */
27645#pragma warning( disable : 4127 )
27646#endif
27647
27648
27649
27650/* #### Code section: utility_code_def ### */
27651
27652/* --- Runtime support code --- */
27653/* Refnanny */
27654#if CYTHON_REFNANNY
27655static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
27656 PyObject *m = NULL, *p = NULL;
27657 void *r = NULL;
27658 m = PyImport_ImportModule(modname);
27659 if (!m) goto end;
27660 p = PyObject_GetAttrString(m, "RefNannyAPI");
27661 if (!p) goto end;
27662 r = PyLong_AsVoidPtr(p);
27663end:
27664 Py_XDECREF(p);
27665 Py_XDECREF(m);
27666 return (__Pyx_RefNannyAPIStruct *)r;
27667}
27668#endif
27669
27670/* GetTopmostException (used by SaveResetException) */
27671#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
27672static _PyErr_StackItem *
27673__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
27674{
27675 _PyErr_StackItem *exc_info = tstate->exc_info;
27676 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
27677 exc_info->previous_item != NULL)
27678 {
27679 exc_info = exc_info->previous_item;
27680 }
27681 return exc_info;
27682}
27683#endif
27684
27685/* SaveResetException */
27686#if CYTHON_FAST_THREAD_STATE
27687static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27688 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
27689 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
27690 PyObject *exc_value = exc_info->exc_value;
27691 if (exc_value == NULL || exc_value == Py_None) {
27692 *value = NULL;
27693 *type = NULL;
27694 *tb = NULL;
27695 } else {
27696 *value = exc_value;
27697 Py_INCREF(*value);
27698 *type = (PyObject*) Py_TYPE(exc_value);
27699 Py_INCREF(*type);
27700 *tb = PyException_GetTraceback(exc_value);
27701 }
27702 #elif CYTHON_USE_EXC_INFO_STACK
27703 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
27704 *type = exc_info->exc_type;
27705 *value = exc_info->exc_value;
27706 *tb = exc_info->exc_traceback;
27707 Py_XINCREF(*type);
27708 Py_XINCREF(*value);
27709 Py_XINCREF(*tb);
27710 #else
27711 *type = tstate->exc_type;
27712 *value = tstate->exc_value;
27713 *tb = tstate->exc_traceback;
27714 Py_XINCREF(*type);
27715 Py_XINCREF(*value);
27716 Py_XINCREF(*tb);
27717 #endif
27718}
27719static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
27720 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
27721 _PyErr_StackItem *exc_info = tstate->exc_info;
27722 PyObject *tmp_value = exc_info->exc_value;
27723 exc_info->exc_value = value;
27724 Py_XDECREF(tmp_value);
27725 Py_XDECREF(type);
27726 Py_XDECREF(tb);
27727 #else
27728 PyObject *tmp_type, *tmp_value, *tmp_tb;
27729 #if CYTHON_USE_EXC_INFO_STACK
27730 _PyErr_StackItem *exc_info = tstate->exc_info;
27731 tmp_type = exc_info->exc_type;
27732 tmp_value = exc_info->exc_value;
27733 tmp_tb = exc_info->exc_traceback;
27734 exc_info->exc_type = type;
27735 exc_info->exc_value = value;
27736 exc_info->exc_traceback = tb;
27737 #else
27738 tmp_type = tstate->exc_type;
27739 tmp_value = tstate->exc_value;
27740 tmp_tb = tstate->exc_traceback;
27741 tstate->exc_type = type;
27742 tstate->exc_value = value;
27743 tstate->exc_traceback = tb;
27744 #endif
27745 Py_XDECREF(tmp_type);
27746 Py_XDECREF(tmp_value);
27747 Py_XDECREF(tmp_tb);
27748 #endif
27749}
27750#endif
27751
27752/* FastTypeChecks (used by PyException_Check) */
27753#if CYTHON_COMPILING_IN_CPYTHON
27754static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
27755 while (a) {
27756 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
27757 if (a == b)
27758 return 1;
27759 }
27760 return b == &PyBaseObject_Type;
27761}
27762static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
27763 PyObject *mro;
27764 if (a == b) return 1;
27765 mro = a->tp_mro;
27766 if (likely(mro)) {
27767 Py_ssize_t i, n;
27768 n = PyTuple_GET_SIZE(mro);
27769 for (i = 0; i < n; i++) {
27770 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
27771 return 1;
27772 }
27773 return 0;
27774 }
27775 return __Pyx_InBases(a, b);
27776}
27777static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
27778 PyObject *mro;
27779 if (cls == a || cls == b) return 1;
27780 mro = cls->tp_mro;
27781 if (likely(mro)) {
27782 Py_ssize_t i, n;
27783 n = PyTuple_GET_SIZE(mro);
27784 for (i = 0; i < n; i++) {
27785 PyObject *base = PyTuple_GET_ITEM(mro, i);
27786 if (base == (PyObject *)a || base == (PyObject *)b)
27787 return 1;
27788 }
27789 return 0;
27790 }
27791 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
27792}
27793#endif
27794
27795/* PyErrFetchRestore (used by GivenExceptionMatches) */
27796#if CYTHON_FAST_THREAD_STATE
27797static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
27798#if PY_VERSION_HEX >= 0x030C00A6
27799 PyObject *tmp_value;
27800 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
27801 if (value) {
27802 #if CYTHON_COMPILING_IN_CPYTHON
27803 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
27804 #endif
27805 PyException_SetTraceback(value, tb);
27806 }
27807 tmp_value = tstate->current_exception;
27808 tstate->current_exception = value;
27809 Py_XDECREF(tmp_value);
27810 Py_XDECREF(type);
27811 Py_XDECREF(tb);
27812#else
27813 PyObject *tmp_type, *tmp_value, *tmp_tb;
27814 tmp_type = tstate->curexc_type;
27815 tmp_value = tstate->curexc_value;
27816 tmp_tb = tstate->curexc_traceback;
27817 tstate->curexc_type = type;
27818 tstate->curexc_value = value;
27819 tstate->curexc_traceback = tb;
27820 Py_XDECREF(tmp_type);
27821 Py_XDECREF(tmp_value);
27822 Py_XDECREF(tmp_tb);
27823#endif
27824}
27825static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27826#if PY_VERSION_HEX >= 0x030C00A6
27827 PyObject* exc_value;
27828 exc_value = tstate->current_exception;
27829 tstate->current_exception = 0;
27830 *value = exc_value;
27831 *type = NULL;
27832 *tb = NULL;
27833 if (exc_value) {
27834 *type = (PyObject*) Py_TYPE(exc_value);
27835 Py_INCREF(*type);
27836 #if CYTHON_COMPILING_IN_CPYTHON
27837 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
27838 Py_XINCREF(*tb);
27839 #else
27840 *tb = PyException_GetTraceback(exc_value);
27841 #endif
27842 }
27843#else
27844 *type = tstate->curexc_type;
27845 *value = tstate->curexc_value;
27846 *tb = tstate->curexc_traceback;
27847 tstate->curexc_type = 0;
27848 tstate->curexc_value = 0;
27849 tstate->curexc_traceback = 0;
27850#endif
27851}
27852#endif
27853
27854/* GivenExceptionMatches (used by PyErrExceptionMatches) */
27855#if CYTHON_COMPILING_IN_CPYTHON
27856static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
27857 if (exc_type1) {
27858 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
27859 } else {
27860 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
27861 }
27862}
27863static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27864 Py_ssize_t i, n;
27865 assert(PyExceptionClass_Check(exc_type));
27866 n = PyTuple_GET_SIZE(tuple);
27867 for (i=0; i<n; i++) {
27868 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
27869 }
27870 for (i=0; i<n; i++) {
27871 PyObject *t = PyTuple_GET_ITEM(tuple, i);
27872 if (likely(PyExceptionClass_Check(t))) {
27873 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
27874 } else {
27875 }
27876 }
27877 return 0;
27878}
27879static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
27880 if (likely(err == exc_type)) return 1;
27881 if (likely(PyExceptionClass_Check(err))) {
27882 if (likely(PyExceptionClass_Check(exc_type))) {
27883 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
27884 } else if (likely(PyTuple_Check(exc_type))) {
27885 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
27886 } else {
27887 }
27888 }
27889 return PyErr_GivenExceptionMatches(err, exc_type);
27890}
27891static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
27892 assert(PyExceptionClass_Check(exc_type1));
27893 assert(PyExceptionClass_Check(exc_type2));
27894 if (likely(err == exc_type1 || err == exc_type2)) return 1;
27895 if (likely(PyExceptionClass_Check(err))) {
27896 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
27897 }
27898 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
27899}
27900#endif
27901
27902/* PyErrExceptionMatches */
27903#if CYTHON_FAST_THREAD_STATE
27904static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27905 Py_ssize_t i, n;
27906 n = PyTuple_GET_SIZE(tuple);
27907 for (i=0; i<n; i++) {
27908 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
27909 }
27910 for (i=0; i<n; i++) {
27911 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
27912 }
27913 return 0;
27914}
27915static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
27916 int result;
27917 PyObject *exc_type;
27918#if PY_VERSION_HEX >= 0x030C00A6
27919 PyObject *current_exception = tstate->current_exception;
27920 if (unlikely(!current_exception)) return 0;
27921 exc_type = (PyObject*) Py_TYPE(current_exception);
27922 if (exc_type == err) return 1;
27923#else
27924 exc_type = tstate->curexc_type;
27925 if (exc_type == err) return 1;
27926 if (unlikely(!exc_type)) return 0;
27927#endif
27928 #if CYTHON_AVOID_BORROWED_REFS
27929 Py_INCREF(exc_type);
27930 #endif
27931 if (unlikely(PyTuple_Check(err))) {
27932 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
27933 } else {
27934 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
27935 }
27936 #if CYTHON_AVOID_BORROWED_REFS
27937 Py_DECREF(exc_type);
27938 #endif
27939 return result;
27940}
27941#endif
27942
27943/* GetException */
27944#if CYTHON_FAST_THREAD_STATE
27945static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
27946#else
27947static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
27948#endif
27949{
27950 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
27951#if CYTHON_FAST_THREAD_STATE
27952 PyObject *tmp_type, *tmp_value, *tmp_tb;
27953 #if PY_VERSION_HEX >= 0x030C0000
27954 local_value = tstate->current_exception;
27955 tstate->current_exception = 0;
27956 #else
27957 local_type = tstate->curexc_type;
27958 local_value = tstate->curexc_value;
27959 local_tb = tstate->curexc_traceback;
27960 tstate->curexc_type = 0;
27961 tstate->curexc_value = 0;
27962 tstate->curexc_traceback = 0;
27963 #endif
27964#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
27965 local_value = PyErr_GetRaisedException();
27966#else
27967 PyErr_Fetch(&local_type, &local_value, &local_tb);
27968#endif
27969#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
27970 if (likely(local_value)) {
27971 local_type = (PyObject*) Py_TYPE(local_value);
27972 Py_INCREF(local_type);
27973 local_tb = PyException_GetTraceback(local_value);
27974 }
27975#else
27976 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
27977#if CYTHON_FAST_THREAD_STATE
27978 if (unlikely(tstate->curexc_type))
27979#else
27980 if (unlikely(PyErr_Occurred()))
27981#endif
27982 goto bad;
27983 if (local_tb) {
27984 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
27985 goto bad;
27986 }
27987#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
27988 Py_XINCREF(local_tb);
27989 Py_XINCREF(local_type);
27990 Py_XINCREF(local_value);
27991 *type = local_type;
27992 *value = local_value;
27993 *tb = local_tb;
27994#if CYTHON_FAST_THREAD_STATE
27995 #if CYTHON_USE_EXC_INFO_STACK
27996 {
27997 _PyErr_StackItem *exc_info = tstate->exc_info;
27998 #if PY_VERSION_HEX >= 0x030B00a4
27999 tmp_value = exc_info->exc_value;
28000 exc_info->exc_value = local_value;
28001 tmp_type = NULL;
28002 tmp_tb = NULL;
28003 Py_XDECREF(local_type);
28004 Py_XDECREF(local_tb);
28005 #else
28006 tmp_type = exc_info->exc_type;
28007 tmp_value = exc_info->exc_value;
28008 tmp_tb = exc_info->exc_traceback;
28009 exc_info->exc_type = local_type;
28010 exc_info->exc_value = local_value;
28011 exc_info->exc_traceback = local_tb;
28012 #endif
28013 }
28014 #else
28015 tmp_type = tstate->exc_type;
28016 tmp_value = tstate->exc_value;
28017 tmp_tb = tstate->exc_traceback;
28018 tstate->exc_type = local_type;
28019 tstate->exc_value = local_value;
28020 tstate->exc_traceback = local_tb;
28021 #endif
28022 Py_XDECREF(tmp_type);
28023 Py_XDECREF(tmp_value);
28024 Py_XDECREF(tmp_tb);
28025#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
28026 PyErr_SetHandledException(local_value);
28027 Py_XDECREF(local_value);
28028 Py_XDECREF(local_type);
28029 Py_XDECREF(local_tb);
28030#else
28031 PyErr_SetExcInfo(local_type, local_value, local_tb);
28032#endif
28033 return 0;
28034#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
28035bad:
28036 *type = 0;
28037 *value = 0;
28038 *tb = 0;
28039 Py_XDECREF(local_type);
28040 Py_XDECREF(local_value);
28041 Py_XDECREF(local_tb);
28042 return -1;
28043#endif
28044}
28045
28046/* PyObjectCall (used by PyObjectFastCall) */
28047#if CYTHON_COMPILING_IN_CPYTHON
28048static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28049 PyObject *result;
28050 ternaryfunc call = Py_TYPE(func)->tp_call;
28051 if (unlikely(!call))
28052 return PyObject_Call(func, arg, kw);
28053 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28054 return NULL;
28055 result = (*call)(func, arg, kw);
28056 Py_LeaveRecursiveCall();
28057 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28058 PyErr_SetString(
28059 PyExc_SystemError,
28060 "NULL result without error in PyObject_Call");
28061 }
28062 return result;
28063}
28064#endif
28065
28066/* PyObjectCallMethO (used by PyObjectFastCall) */
28067#if CYTHON_COMPILING_IN_CPYTHON
28068static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28069 PyObject *self, *result;
28070 PyCFunction cfunc;
28071 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
28072 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
28073 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28074 return NULL;
28075 result = cfunc(self, arg);
28076 Py_LeaveRecursiveCall();
28077 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28078 PyErr_SetString(
28079 PyExc_SystemError,
28080 "NULL result without error in PyObject_Call");
28081 }
28082 return result;
28083}
28084#endif
28085
28086/* PyObjectFastCall */
28087#if CYTHON_COMPILING_IN_LIMITED_API
28088static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
28089 PyObject *argstuple;
28090 PyObject *result = 0;
28091 size_t i;
28092 argstuple = PyTuple_New((Py_ssize_t)nargs);
28093 if (unlikely(!argstuple)) return NULL;
28094 for (i = 0; i < nargs; i++) {
28095 Py_INCREF(args[i]);
28096 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
28097 }
28098 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
28099 bad:
28100 Py_DECREF(argstuple);
28101 return result;
28102}
28103#endif
28104#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
28105 #if CYTHON_COMPILING_IN_CPYTHON
28106static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
28107 PyTypeObject *tp = Py_TYPE(callable);
28108 #if defined(__Pyx_CyFunction_USED)
28109 if (__Pyx_CyFunction_CheckExact(callable)) {
28110 return __Pyx_CyFunction_func_vectorcall(callable);
28111 }
28112 #endif
28113 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
28114 return NULL;
28115 }
28116 assert(PyCallable_Check(callable));
28117 Py_ssize_t offset = tp->tp_vectorcall_offset;
28118 assert(offset > 0);
28119 vectorcallfunc ptr;
28120 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
28121 return ptr;
28122}
28123 #else
28124 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
28125 #endif
28126#endif
28127static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
28128 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
28129#if CYTHON_COMPILING_IN_CPYTHON
28130 if (nargs == 0 && kwargs == NULL) {
28131 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
28132 return __Pyx_PyObject_CallMethO(func, NULL);
28133 }
28134 else if (nargs == 1 && kwargs == NULL) {
28135 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
28136 return __Pyx_PyObject_CallMethO(func, args[0]);
28137 }
28138#endif
28139 if (kwargs == NULL) {
28140 #if CYTHON_VECTORCALL
28141 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
28142 return PyObject_Vectorcall(func, args, nargsf, NULL);
28143 #else
28144 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
28145 if (f) {
28146 return f(func, args, nargsf, NULL);
28147 }
28148 #endif
28149 #endif
28150 }
28151 if (nargs == 0) {
28152 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
28153 }
28154 #if CYTHON_COMPILING_IN_LIMITED_API
28155 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
28156 #elif CYTHON_COMPILING_IN_PYPY
28157 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
28158 #else
28159 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
28160 #endif
28161}
28162
28163/* RaiseException */
28164static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28165 PyObject* owned_instance = NULL;
28166 if (tb == Py_None) {
28167 tb = 0;
28168 } else if (tb && !PyTraceBack_Check(tb)) {
28169 PyErr_SetString(PyExc_TypeError,
28170 "raise: arg 3 must be a traceback or None");
28171 goto bad;
28172 }
28173 if (value == Py_None)
28174 value = 0;
28175 if (PyExceptionInstance_Check(type)) {
28176 if (value) {
28177 PyErr_SetString(PyExc_TypeError,
28178 "instance exception may not have a separate value");
28179 goto bad;
28180 }
28181 value = type;
28182 type = (PyObject*) Py_TYPE(value);
28183 } else if (PyExceptionClass_Check(type)) {
28184 PyObject *instance_class = NULL;
28185 if (value && PyExceptionInstance_Check(value)) {
28186 instance_class = (PyObject*) Py_TYPE(value);
28187 if (instance_class != type) {
28188 int is_subclass = PyObject_IsSubclass(instance_class, type);
28189 if (!is_subclass) {
28190 instance_class = NULL;
28191 } else if (unlikely(is_subclass == -1)) {
28192 goto bad;
28193 } else {
28194 type = instance_class;
28195 }
28196 }
28197 }
28198 if (!instance_class) {
28199 PyObject *args;
28200 if (!value)
28201 args = PyTuple_New(0);
28202 else if (PyTuple_Check(value)) {
28203 Py_INCREF(value);
28204 args = value;
28205 } else
28206 args = PyTuple_Pack(1, value);
28207 if (!args)
28208 goto bad;
28209 owned_instance = PyObject_Call(type, args, NULL);
28210 Py_DECREF(args);
28211 if (!owned_instance)
28212 goto bad;
28213 value = owned_instance;
28214 if (!PyExceptionInstance_Check(value)) {
28215 PyErr_Format(PyExc_TypeError,
28216 "calling %R should have returned an instance of "
28217 "BaseException, not %R",
28218 type, Py_TYPE(value));
28219 goto bad;
28220 }
28221 }
28222 } else {
28223 PyErr_SetString(PyExc_TypeError,
28224 "raise: exception class must be a subclass of BaseException");
28225 goto bad;
28226 }
28227 if (cause) {
28228 PyObject *fixed_cause;
28229 if (cause == Py_None) {
28230 fixed_cause = NULL;
28231 } else if (PyExceptionClass_Check(cause)) {
28232 fixed_cause = PyObject_CallObject(cause, NULL);
28233 if (fixed_cause == NULL)
28234 goto bad;
28235 } else if (PyExceptionInstance_Check(cause)) {
28236 fixed_cause = cause;
28237 Py_INCREF(fixed_cause);
28238 } else {
28239 PyErr_SetString(PyExc_TypeError,
28240 "exception causes must derive from "
28241 "BaseException");
28242 goto bad;
28243 }
28244 PyException_SetCause(value, fixed_cause);
28245 }
28246 PyErr_SetObject(type, value);
28247 if (tb) {
28248#if PY_VERSION_HEX >= 0x030C00A6
28249 PyException_SetTraceback(value, tb);
28250#elif CYTHON_FAST_THREAD_STATE
28251 PyThreadState *tstate = __Pyx_PyThreadState_Current;
28252 PyObject* tmp_tb = tstate->curexc_traceback;
28253 if (tb != tmp_tb) {
28254 Py_INCREF(tb);
28255 tstate->curexc_traceback = tb;
28256 Py_XDECREF(tmp_tb);
28257 }
28258#else
28259 PyObject *tmp_type, *tmp_value, *tmp_tb;
28260 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
28261 Py_INCREF(tb);
28262 PyErr_Restore(tmp_type, tmp_value, tb);
28263 Py_XDECREF(tmp_tb);
28264#endif
28265 }
28266bad:
28267 Py_XDECREF(owned_instance);
28268 return;
28269}
28270
28271/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
28272#if CYTHON_COMPILING_IN_CPYTHON
28273static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28274 PyObject *v;
28275 Py_ssize_t i;
28276 for (i = 0; i < length; i++) {
28277 v = dest[i] = src[i];
28278 Py_INCREF(v);
28279 }
28280}
28281#endif
28282
28283/* TupleOrListFromArrayImpl (used by TupleFromArray) */
28284#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
28285CYTHON_UNUSED static PyObject *
28286__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
28287 if (n <= 0) {
28288 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
28289 }
28290 PyObject *res = PyTuple_New(n);
28291 if (unlikely(res == NULL)) return NULL;
28292 #if CYTHON_COMPILING_IN_CPYTHON
28293 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
28294 #else
28295 Py_ssize_t i;
28296 for (i = 0; i < n; i++) {
28297 Py_INCREF(src[i]);
28298 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
28299 Py_DECREF(res);
28300 return NULL;
28301 }
28302 }
28303 #endif
28304 return res;
28305}
28306#endif
28307
28308/* PyObjectCompare (used by UnicodeEquals) */
28309#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28310#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28311static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
28312 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
28313 int result = PyUnicode_Equal(s1, s2);
28314 #if !CYTHON_COMPILING_IN_CPYTHON
28315 if (unlikely(result == -1)) return -1;
28316 #endif
28317 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
28318 #else
28319 int result = PyUnicode_Compare(s1, s2);
28320 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
28321 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
28322 #endif
28323__pyx_return_true:
28324 return 1;
28325__pyx_return_false:
28326 return 0;
28327}
28328#endif
28329static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
28330 CYTHON_UNUSED_VAR(pyop);
28331 if (unlikely(op1 == Py_None)) {
28332 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
28333 }
28334 if (unlikely(op2 == Py_None)) {
28335 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
28336 }
28337
28338 if (likely(op1 != Py_None)) {
28339 if (op1 == op2) goto __pyx_return_true;
28340 if (likely(op2 != Py_None)) {
28341 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
28342 }
28343 goto __pyx_richcmp;
28344 }
28345
28346 if ((0)) goto __pyx_richcmp;
28347 if ((0)) goto __pyx_return_true;
28348 if ((0)) goto __pyx_return_false;
28349__pyx_richcmp:
28350 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
28351__pyx_return_true:
28352 return 1;
28353__pyx_return_false:
28354 return 0;
28355}
28356
28357/* fastcall */
28358#if CYTHON_VECTORCALL
28359static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
28360{
28361 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
28362 #if !CYTHON_ASSUME_SAFE_SIZE
28363 if (unlikely(n == -1)) return NULL;
28364 #endif
28365 for (i = 0; i < n; i++)
28366 {
28367 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28368 #if !CYTHON_ASSUME_SAFE_MACROS
28369 if (unlikely(!namei)) return NULL;
28370 #endif
28371 if (s == namei) return kwvalues[i];
28372 }
28373 for (i = 0; i < n; i++)
28374 {
28375 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28376 #if !CYTHON_ASSUME_SAFE_MACROS
28377 if (unlikely(!namei)) return NULL;
28378 #endif
28379 int eq = __Pyx_PyUnicode_Equals(s, namei);
28380 if (unlikely(eq != 0)) {
28381 if (unlikely(eq < 0)) return NULL;
28382 return kwvalues[i];
28383 }
28384 }
28385 return NULL;
28386}
28387#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
28388CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
28389 Py_ssize_t i, nkwargs;
28390 PyObject *dict;
28391#if !CYTHON_ASSUME_SAFE_SIZE
28392 nkwargs = PyTuple_Size(kwnames);
28393 if (unlikely(nkwargs < 0)) return NULL;
28394#else
28395 nkwargs = PyTuple_GET_SIZE(kwnames);
28396#endif
28397 dict = PyDict_New();
28398 if (unlikely(!dict))
28399 return NULL;
28400 for (i=0; i<nkwargs; i++) {
28401#if !CYTHON_ASSUME_SAFE_MACROS
28402 PyObject *key = PyTuple_GetItem(kwnames, i);
28403 if (!key) goto bad;
28404#else
28405 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
28406#endif
28407 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
28408 goto bad;
28409 }
28410 return dict;
28411bad:
28412 Py_DECREF(dict);
28413 return NULL;
28414}
28415#endif
28416#endif
28417
28418/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
28419static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28420 PyObject *args[2] = {NULL, arg};
28421 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
28422}
28423
28424/* IgnoreException (used by UnpackUnboundCMethod_impl) */
28425static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
28426 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
28427 PyErr_Clear();
28428 return 1;
28429 }
28430 return 0;
28431}
28432
28433/* PyObjectGetAttrStr (used by UnpackUnboundCMethod_impl) */
28434#if CYTHON_USE_TYPE_SLOTS
28435static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28436 PyTypeObject* tp = Py_TYPE(obj);
28437 if (likely(tp->tp_getattro))
28438 return tp->tp_getattro(obj, attr_name);
28439 return PyObject_GetAttr(obj, attr_name);
28440}
28441#endif
28442
28443/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
28444#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
28445static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
28446 PyObject *result;
28447 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
28448 if (unlikely(!selfless_args)) return NULL;
28449 result = PyObject_Call(method, selfless_args, kwargs);
28450 Py_DECREF(selfless_args);
28451 return result;
28452}
28453#else
28454static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
28455 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
28456}
28457#endif
28458static PyMethodDef __Pyx_UnboundCMethod_Def = {
28459 "CythonUnboundCMethod",
28460 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
28461#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
28462 METH_VARARGS | METH_KEYWORDS,
28463#else
28464 METH_FASTCALL | METH_KEYWORDS,
28465#endif
28466 NULL
28467};
28468static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
28469 PyObject *method, *result=NULL;
28470 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
28471 if (unlikely(!method))
28472 return -1;
28473 result = method;
28474#if CYTHON_COMPILING_IN_CPYTHON
28475 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
28476 {
28477 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
28478 target->func = descr->d_method->ml_meth;
28479 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
28480 } else
28481#endif
28482#if CYTHON_COMPILING_IN_PYPY
28483#else
28484 if (PyCFunction_Check(method))
28485#endif
28486 {
28487 PyObject *self;
28488 int self_found;
28489#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
28490 self = PyObject_GetAttrString(method, "__self__");
28491 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
28492 return -1;
28493 }
28494#else
28495 self = PyCFunction_GET_SELF(method);
28496#endif
28497 self_found = (self && self != Py_None);
28498#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
28499 Py_XDECREF(self);
28500#endif
28501 if (self_found) {
28502 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
28503 if (unlikely(!unbound_method)) return -1;
28504 Py_DECREF(method);
28505 result = unbound_method;
28506 }
28507 }
28508#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28509 if (unlikely(target->method)) {
28510 Py_DECREF(result);
28511 } else
28512#endif
28513 target->method = result;
28514 return 0;
28515}
28516
28517/* CallUnboundCMethod0 */
28518#if CYTHON_COMPILING_IN_CPYTHON
28519static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
28520 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
28521 if (likely(was_initialized == 2 && cfunc->func)) {
28522 if (likely(cfunc->flag == METH_NOARGS))
28523 return __Pyx_CallCFunction(cfunc, self, NULL);
28524 if (likely(cfunc->flag == METH_FASTCALL))
28525 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
28526 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
28527 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
28528 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
28529 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
28530 if (cfunc->flag == METH_VARARGS)
28531 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
28532 return __Pyx__CallUnboundCMethod0(cfunc, self);
28533 }
28534#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28535 else if (unlikely(was_initialized == 1)) {
28536 __Pyx_CachedCFunction tmp_cfunc = {
28537#ifndef __cplusplus
28538 0
28539#endif
28540 };
28541 tmp_cfunc.type = cfunc->type;
28542 tmp_cfunc.method_name = cfunc->method_name;
28543 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
28544 }
28545#endif
28546 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
28547 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
28548 return result;
28549}
28550#endif
28551static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
28552 PyObject *result;
28553 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
28554 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
28555 return result;
28556}
28557
28558/* py_dict_items (used by OwnedDictNext) */
28559static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
28560 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
28561}
28562
28563/* py_dict_values (used by OwnedDictNext) */
28564static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
28565 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
28566}
28567
28568/* OwnedDictNext (used by ParseKeywordsImpl) */
28569#if CYTHON_AVOID_BORROWED_REFS
28570static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
28571 PyObject *next = NULL;
28572 if (!*ppos) {
28573 if (pvalue) {
28574 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
28575 if (unlikely(!dictview)) goto bad;
28576 *ppos = PyObject_GetIter(dictview);
28577 Py_DECREF(dictview);
28578 } else {
28579 *ppos = PyObject_GetIter(p);
28580 }
28581 if (unlikely(!*ppos)) goto bad;
28582 }
28583 next = PyIter_Next(*ppos);
28584 if (!next) {
28585 if (PyErr_Occurred()) goto bad;
28586 return 0;
28587 }
28588 if (pkey && pvalue) {
28589 *pkey = __Pyx_PySequence_ITEM(next, 0);
28590 if (unlikely(*pkey)) goto bad;
28591 *pvalue = __Pyx_PySequence_ITEM(next, 1);
28592 if (unlikely(*pvalue)) goto bad;
28593 Py_DECREF(next);
28594 } else if (pkey) {
28595 *pkey = next;
28596 } else {
28597 assert(pvalue);
28598 *pvalue = next;
28599 }
28600 return 1;
28601 bad:
28602 Py_XDECREF(next);
28603#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
28604 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
28605#else
28606 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
28607#endif
28608 if (pkey) *pkey = NULL;
28609 if (pvalue) *pvalue = NULL;
28610 return 0;
28611}
28612#else // !CYTHON_AVOID_BORROWED_REFS
28613static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
28614 int result = PyDict_Next(p, ppos, pkey, pvalue);
28615 if (likely(result == 1)) {
28616 if (pkey) Py_INCREF(*pkey);
28617 if (pvalue) Py_INCREF(*pvalue);
28618 }
28619 return result;
28620}
28621#endif
28622
28623/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
28624static void __Pyx_RaiseDoubleKeywordsError(
28625 const char* func_name,
28626 PyObject* kw_name)
28627{
28628 PyErr_Format(PyExc_TypeError,
28629 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28630}
28631
28632/* CallUnboundCMethod2 */
28633#if CYTHON_COMPILING_IN_CPYTHON
28634static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
28635 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
28636 if (likely(was_initialized == 2 && cfunc->func)) {
28637 PyObject *args[2] = {arg1, arg2};
28638 if (cfunc->flag == METH_FASTCALL) {
28639 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
28640 }
28641 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
28642 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
28643 }
28644#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28645 else if (unlikely(was_initialized == 1)) {
28646 __Pyx_CachedCFunction tmp_cfunc = {
28647#ifndef __cplusplus
28648 0
28649#endif
28650 };
28651 tmp_cfunc.type = cfunc->type;
28652 tmp_cfunc.method_name = cfunc->method_name;
28653 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
28654 }
28655#endif
28656 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
28657 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
28658 return result;
28659}
28660#endif
28661static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
28662 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
28663#if CYTHON_COMPILING_IN_CPYTHON
28664 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
28665 PyObject *result = NULL;
28666 PyObject *args = PyTuple_New(2);
28667 if (unlikely(!args)) return NULL;
28668 Py_INCREF(arg1);
28669 PyTuple_SET_ITEM(args, 0, arg1);
28670 Py_INCREF(arg2);
28671 PyTuple_SET_ITEM(args, 1, arg2);
28672 if (cfunc->flag & METH_KEYWORDS)
28673 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
28674 else
28675 result = __Pyx_CallCFunction(cfunc, self, args);
28676 Py_DECREF(args);
28677 return result;
28678 }
28679#endif
28680 {
28681 PyObject *args[4] = {NULL, self, arg1, arg2};
28682 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
28683 }
28684}
28685
28686/* ParseKeywordsImpl (used by ParseKeywords) */
28687static int __Pyx_ValidateDuplicatePosArgs(
28688 PyObject *kwds,
28689 PyObject ** const argnames[],
28690 PyObject ** const *first_kw_arg,
28691 const char* function_name)
28692{
28693 PyObject ** const *name = argnames;
28694 while (name != first_kw_arg) {
28695 PyObject *key = **name;
28696 int found = PyDict_Contains(kwds, key);
28697 if (unlikely(found)) {
28698 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
28699 goto bad;
28700 }
28701 name++;
28702 }
28703 return 0;
28704bad:
28705 return -1;
28706}
28707#if CYTHON_USE_UNICODE_INTERNALS
28708static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
28709 int kind;
28710 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
28711 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
28712 kind = PyUnicode_KIND(s1);
28713 if (kind != PyUnicode_KIND(s2)) return 0;
28714 const void *data1 = PyUnicode_DATA(s1);
28715 const void *data2 = PyUnicode_DATA(s2);
28716 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
28717}
28718#endif
28719static int __Pyx_MatchKeywordArg_str(
28720 PyObject *key,
28721 PyObject ** const argnames[],
28722 PyObject ** const *first_kw_arg,
28723 size_t *index_found,
28724 const char *function_name)
28725{
28726 PyObject ** const *name;
28727 #if CYTHON_USE_UNICODE_INTERNALS
28728 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
28729 if (unlikely(key_hash == -1)) {
28730 key_hash = PyObject_Hash(key);
28731 if (unlikely(key_hash == -1))
28732 goto bad;
28733 }
28734 #endif
28735 name = first_kw_arg;
28736 while (*name) {
28737 PyObject *name_str = **name;
28738 #if CYTHON_USE_UNICODE_INTERNALS
28739 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
28740 *index_found = (size_t) (name - argnames);
28741 return 1;
28742 }
28743 #else
28744 #if CYTHON_ASSUME_SAFE_SIZE
28745 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
28746 #endif
28747 {
28748 int cmp = PyUnicode_Compare(name_str, key);
28749 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28750 if (cmp == 0) {
28751 *index_found = (size_t) (name - argnames);
28752 return 1;
28753 }
28754 }
28755 #endif
28756 name++;
28757 }
28758 name = argnames;
28759 while (name != first_kw_arg) {
28760 PyObject *name_str = **name;
28761 #if CYTHON_USE_UNICODE_INTERNALS
28762 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
28763 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
28764 goto arg_passed_twice;
28765 }
28766 #else
28767 #if CYTHON_ASSUME_SAFE_SIZE
28768 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
28769 #endif
28770 {
28771 if (unlikely(name_str == key)) goto arg_passed_twice;
28772 int cmp = PyUnicode_Compare(name_str, key);
28773 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28774 if (cmp == 0) goto arg_passed_twice;
28775 }
28776 #endif
28777 name++;
28778 }
28779 return 0;
28780arg_passed_twice:
28781 __Pyx_RaiseDoubleKeywordsError(function_name, key);
28782 goto bad;
28783bad:
28784 return -1;
28785}
28786static int __Pyx_MatchKeywordArg_nostr(
28787 PyObject *key,
28788 PyObject ** const argnames[],
28789 PyObject ** const *first_kw_arg,
28790 size_t *index_found,
28791 const char *function_name)
28792{
28793 PyObject ** const *name;
28794 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
28795 name = first_kw_arg;
28796 while (*name) {
28797 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
28798 if (cmp == 1) {
28799 *index_found = (size_t) (name - argnames);
28800 return 1;
28801 }
28802 if (unlikely(cmp == -1)) goto bad;
28803 name++;
28804 }
28805 name = argnames;
28806 while (name != first_kw_arg) {
28807 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
28808 if (unlikely(cmp != 0)) {
28809 if (cmp == 1) goto arg_passed_twice;
28810 else goto bad;
28811 }
28812 name++;
28813 }
28814 return 0;
28815arg_passed_twice:
28816 __Pyx_RaiseDoubleKeywordsError(function_name, key);
28817 goto bad;
28818invalid_keyword_type:
28819 PyErr_Format(PyExc_TypeError,
28820 "%.200s() keywords must be strings", function_name);
28821 goto bad;
28822bad:
28823 return -1;
28824}
28825static CYTHON_INLINE int __Pyx_MatchKeywordArg(
28826 PyObject *key,
28827 PyObject ** const argnames[],
28828 PyObject ** const *first_kw_arg,
28829 size_t *index_found,
28830 const char *function_name)
28831{
28832 return likely(PyUnicode_CheckExact(key)) ?
28833 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
28834 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
28835}
28836static void __Pyx_RejectUnknownKeyword(
28837 PyObject *kwds,
28838 PyObject ** const argnames[],
28839 PyObject ** const *first_kw_arg,
28840 const char *function_name)
28841{
28842 #if CYTHON_AVOID_BORROWED_REFS
28843 PyObject *pos = NULL;
28844 #else
28845 Py_ssize_t pos = 0;
28846 #endif
28847 PyObject *key = NULL;
28848 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
28849 #if CYTHON_AVOID_BORROWED_REFS
28850 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
28851 #else
28852 (void) __Pyx_PyDict_NextRef;
28853 while (PyDict_Next(kwds, &pos, &key, NULL))
28854 #endif
28855 {
28856 PyObject** const *name = first_kw_arg;
28857 while (*name && (**name != key)) name++;
28858 if (!*name) {
28859 size_t index_found = 0;
28860 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
28861 if (cmp != 1) {
28862 if (cmp == 0) {
28863 PyErr_Format(PyExc_TypeError,
28864 "%s() got an unexpected keyword argument '%U'",
28865 function_name, key);
28866 }
28867 #if CYTHON_AVOID_BORROWED_REFS
28868 Py_DECREF(key);
28869 #endif
28870 break;
28871 }
28872 }
28873 #if CYTHON_AVOID_BORROWED_REFS
28874 Py_DECREF(key);
28875 #endif
28876 }
28877 __Pyx_END_CRITICAL_SECTION();
28878 #if CYTHON_AVOID_BORROWED_REFS
28879 Py_XDECREF(pos);
28880 #endif
28881 assert(PyErr_Occurred());
28882}
28883static int __Pyx_ParseKeywordDict(
28884 PyObject *kwds,
28885 PyObject ** const argnames[],
28886 PyObject *values[],
28887 Py_ssize_t num_pos_args,
28888 Py_ssize_t num_kwargs,
28889 const char* function_name,
28890 int ignore_unknown_kwargs)
28891{
28892 PyObject** const *name;
28893 PyObject** const *first_kw_arg = argnames + num_pos_args;
28894 Py_ssize_t extracted = 0;
28895#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
28896 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
28897#endif
28898 name = first_kw_arg;
28899 while (*name && num_kwargs > extracted) {
28900 PyObject * key = **name;
28901 PyObject *value;
28902 int found = 0;
28903 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
28904 found = PyDict_GetItemRef(kwds, key, &value);
28905 #else
28906 value = PyDict_GetItemWithError(kwds, key);
28907 if (value) {
28908 Py_INCREF(value);
28909 found = 1;
28910 } else {
28911 if (unlikely(PyErr_Occurred())) goto bad;
28912 }
28913 #endif
28914 if (found) {
28915 if (unlikely(found < 0)) goto bad;
28916 values[name-argnames] = value;
28917 extracted++;
28918 }
28919 name++;
28920 }
28921 if (num_kwargs > extracted) {
28922 if (ignore_unknown_kwargs) {
28923 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
28924 goto bad;
28925 } else {
28926 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
28927 goto bad;
28928 }
28929 }
28930 return 0;
28931bad:
28932 return -1;
28933}
28934static int __Pyx_ParseKeywordDictToDict(
28935 PyObject *kwds,
28936 PyObject ** const argnames[],
28937 PyObject *kwds2,
28938 PyObject *values[],
28939 Py_ssize_t num_pos_args,
28940 const char* function_name)
28941{
28942 PyObject** const *name;
28943 PyObject** const *first_kw_arg = argnames + num_pos_args;
28944 Py_ssize_t len;
28945#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
28946 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
28947#endif
28948 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
28949 name = first_kw_arg;
28950 while (*name) {
28951 PyObject *key = **name;
28952 PyObject *value;
28953#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
28954 int found = PyDict_Pop(kwds2, key, &value);
28955 if (found) {
28956 if (unlikely(found < 0)) goto bad;
28957 values[name-argnames] = value;
28958 }
28959#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
28960 int found = PyDict_GetItemRef(kwds2, key, &value);
28961 if (found) {
28962 if (unlikely(found < 0)) goto bad;
28963 values[name-argnames] = value;
28964 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
28965 }
28966#else
28967 #if CYTHON_COMPILING_IN_CPYTHON
28968 value = _PyDict_Pop(kwds2, key, kwds2);
28969 #else
28970 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
28971 #endif
28972 if (value == kwds2) {
28973 Py_DECREF(value);
28974 } else {
28975 if (unlikely(!value)) goto bad;
28976 values[name-argnames] = value;
28977 }
28978#endif
28979 name++;
28980 }
28981 len = PyDict_Size(kwds2);
28982 if (len > 0) {
28983 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
28984 } else if (unlikely(len == -1)) {
28985 goto bad;
28986 }
28987 return 0;
28988bad:
28989 return -1;
28990}
28991static int __Pyx_ParseKeywordsTuple(
28992 PyObject *kwds,
28993 PyObject * const *kwvalues,
28994 PyObject ** const argnames[],
28995 PyObject *kwds2,
28996 PyObject *values[],
28997 Py_ssize_t num_pos_args,
28998 Py_ssize_t num_kwargs,
28999 const char* function_name,
29000 int ignore_unknown_kwargs)
29001{
29002 PyObject *key = NULL;
29003 PyObject** const * name;
29004 PyObject** const *first_kw_arg = argnames + num_pos_args;
29005 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
29006#if CYTHON_AVOID_BORROWED_REFS
29007 key = __Pyx_PySequence_ITEM(kwds, pos);
29008#else
29009 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
29010#endif
29011#if !CYTHON_ASSUME_SAFE_MACROS
29012 if (unlikely(!key)) goto bad;
29013#endif
29014 name = first_kw_arg;
29015 while (*name && (**name != key)) name++;
29016 if (*name) {
29017 PyObject *value = kwvalues[pos];
29018 values[name-argnames] = __Pyx_NewRef(value);
29019 } else {
29020 size_t index_found = 0;
29021 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
29022 if (cmp == 1) {
29023 PyObject *value = kwvalues[pos];
29024 values[index_found] = __Pyx_NewRef(value);
29025 } else {
29026 if (unlikely(cmp == -1)) goto bad;
29027 if (kwds2) {
29028 PyObject *value = kwvalues[pos];
29029 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
29030 } else if (!ignore_unknown_kwargs) {
29031 goto invalid_keyword;
29032 }
29033 }
29034 }
29035 #if CYTHON_AVOID_BORROWED_REFS
29036 Py_DECREF(key);
29037 key = NULL;
29038 #endif
29039 }
29040 return 0;
29041invalid_keyword:
29042 PyErr_Format(PyExc_TypeError,
29043 "%s() got an unexpected keyword argument '%U'",
29044 function_name, key);
29045 goto bad;
29046bad:
29047 #if CYTHON_AVOID_BORROWED_REFS
29048 Py_XDECREF(key);
29049 #endif
29050 return -1;
29051}
29052
29053/* ParseKeywords */
29054static int __Pyx_ParseKeywords(
29055 PyObject *kwds,
29056 PyObject * const *kwvalues,
29057 PyObject ** const argnames[],
29058 PyObject *kwds2,
29059 PyObject *values[],
29060 Py_ssize_t num_pos_args,
29061 Py_ssize_t num_kwargs,
29062 const char* function_name,
29063 int ignore_unknown_kwargs)
29064{
29065 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
29066 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29067 else if (kwds2)
29068 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
29069 else
29070 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29071}
29072
29073/* RaiseArgTupleInvalid */
29074static void __Pyx_RaiseArgtupleInvalid(
29075 const char* func_name,
29076 int exact,
29077 Py_ssize_t num_min,
29078 Py_ssize_t num_max,
29079 Py_ssize_t num_found)
29080{
29081 Py_ssize_t num_expected;
29082 const char *more_or_less;
29083 if (num_found < num_min) {
29084 num_expected = num_min;
29085 more_or_less = "at least";
29086 } else {
29087 num_expected = num_max;
29088 more_or_less = "at most";
29089 }
29090 if (exact) {
29091 more_or_less = "exactly";
29092 }
29093 PyErr_Format(PyExc_TypeError,
29094 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
29095 func_name, more_or_less, num_expected,
29096 (num_expected == 1) ? "" : "s", num_found);
29097}
29098
29099/* ArgTypeTestError (used by ArgTypeTest) */
29100static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
29101{
29102 __Pyx_TypeName type_name;
29103 __Pyx_TypeName obj_type_name;
29104 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
29105 int from_annotation_subclass = 0;
29106 if (unlikely(!type)) {
29107 PyErr_SetString(PyExc_SystemError, "Missing type object");
29108 return;
29109 } else if (exact == 2) {
29110 if (__Pyx_TypeCheck(obj, type)) {
29111 from_annotation_subclass = 1;
29112 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
29113 }
29114 }
29115 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
29116 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29117 if (unlikely(!type_name)) return;
29118 #endif
29119 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
29120 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29121 if (unlikely(!obj_type_name)) goto obj_type_name_failed;
29122 #endif
29123 PyErr_Format(PyExc_TypeError,
29124 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")"
29125#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29126 "%s%U"
29127#endif
29128 , name, type_name, obj_type_name
29129#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29130 , (from_annotation_subclass ? ". " : ""), extra_info
29131#endif
29132 );
29133#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
29134 if (exact == 2 && from_annotation_subclass) {
29135 PyObject *res;
29136 PyObject *vargs[2];
29137 vargs[0] = PyErr_GetRaisedException();
29138 vargs[1] = extra_info;
29139 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
29140 Py_XDECREF(res);
29141 PyErr_SetRaisedException(vargs[0]);
29142 }
29143#endif
29144 __Pyx_DECREF_TypeName(obj_type_name);
29145#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29146obj_type_name_failed:
29147#endif
29148 __Pyx_DECREF_TypeName(type_name);
29149 return;
29150}
29151
29152/* ArgTypeTest */
29153static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
29154 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
29155 return 1;
29156 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
29157 return 1;
29158 __Pyx_ArgTypeError(obj, type, name, exact);
29159 return 0;
29160}
29161
29162/* IsLittleEndian (used by BufferFormatCheck) */
29163static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
29164{
29165 union {
29166 uint32_t u32;
29167 uint8_t u8[4];
29168 } S;
29169 S.u32 = 0x01020304;
29170 return S.u8[0] == 4;
29171}
29172
29173/* BufferFormatCheck (used by BufferGetAndValidate) */
29174static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
29175 __Pyx_BufFmt_StackElem* stack,
29176 const __Pyx_TypeInfo* type) {
29177 stack[0].field = &ctx->root;
29178 stack[0].parent_offset = 0;
29179 ctx->root.type = type;
29180 ctx->root.name = "buffer dtype";
29181 ctx->root.offset = 0;
29182 ctx->head = stack;
29183 ctx->head->field = &ctx->root;
29184 ctx->fmt_offset = 0;
29185 ctx->head->parent_offset = 0;
29186 ctx->new_packmode = '@';
29187 ctx->enc_packmode = '@';
29188 ctx->new_count = 1;
29189 ctx->enc_count = 0;
29190 ctx->enc_type = 0;
29191 ctx->is_complex = 0;
29192 ctx->is_valid_array = 0;
29193 ctx->struct_alignment = 0;
29194 while (type->typegroup == 'S') {
29195 ++ctx->head;
29196 ctx->head->field = type->fields;
29197 ctx->head->parent_offset = 0;
29198 type = type->fields->type;
29199 }
29200}
29201static int __Pyx_BufFmt_ParseNumber(const char** ts) {
29202 int count;
29203 const char* t = *ts;
29204 if (*t < '0' || *t > '9') {
29205 return -1;
29206 } else {
29207 count = *t++ - '0';
29208 while (*t >= '0' && *t <= '9') {
29209 count *= 10;
29210 count += *t++ - '0';
29211 }
29212 }
29213 *ts = t;
29214 return count;
29215}
29216static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
29217 int number = __Pyx_BufFmt_ParseNumber(ts);
29218 if (number == -1)
29219 PyErr_Format(PyExc_ValueError,\
29220 "Does not understand character buffer dtype format string ('%c')", **ts);
29221 return number;
29222}
29223static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
29224 PyErr_Format(PyExc_ValueError,
29225 "Unexpected format string character: '%c'", ch);
29226}
29227static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
29228 switch (ch) {
29229 case '?': return "'bool'";
29230 case 'c': return "'char'";
29231 case 'b': return "'signed char'";
29232 case 'B': return "'unsigned char'";
29233 case 'h': return "'short'";
29234 case 'H': return "'unsigned short'";
29235 case 'i': return "'int'";
29236 case 'I': return "'unsigned int'";
29237 case 'l': return "'long'";
29238 case 'L': return "'unsigned long'";
29239 case 'q': return "'long long'";
29240 case 'Q': return "'unsigned long long'";
29241 case 'f': return (is_complex ? "'complex float'" : "'float'");
29242 case 'd': return (is_complex ? "'complex double'" : "'double'");
29243 case 'g': return (is_complex ? "'complex long double'" : "'long double'");
29244 case 'T': return "a struct";
29245 case 'O': return "Python object";
29246 case 'P': return "a pointer";
29247 case 's': case 'p': return "a string";
29248 case 0: return "end";
29249 default: return "unparsable format string";
29250 }
29251}
29252static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
29253 switch (ch) {
29254 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29255 case 'h': case 'H': return 2;
29256 case 'i': case 'I': case 'l': case 'L': return 4;
29257 case 'q': case 'Q': return 8;
29258 case 'f': return (is_complex ? 8 : 4);
29259 case 'd': return (is_complex ? 16 : 8);
29260 case 'g': {
29261 PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
29262 return 0;
29263 }
29264 case 'O': case 'P': return sizeof(void*);
29265 default:
29266 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29267 return 0;
29268 }
29269}
29270static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
29271 switch (ch) {
29272 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29273 case 'h': case 'H': return sizeof(short);
29274 case 'i': case 'I': return sizeof(int);
29275 case 'l': case 'L': return sizeof(long);
29276 case 'q': case 'Q': return sizeof(PY_LONG_LONG);
29277 case 'f': return sizeof(float) * (is_complex ? 2 : 1);
29278 case 'd': return sizeof(double) * (is_complex ? 2 : 1);
29279 case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
29280 case 'O': case 'P': return sizeof(void*);
29281 default: {
29282 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29283 return 0;
29284 }
29285 }
29286}
29287typedef struct { char c; short x; } __Pyx_st_short;
29288typedef struct { char c; int x; } __Pyx_st_int;
29289typedef struct { char c; long x; } __Pyx_st_long;
29290typedef struct { char c; float x; } __Pyx_st_float;
29291typedef struct { char c; double x; } __Pyx_st_double;
29292typedef struct { char c; long double x; } __Pyx_st_longdouble;
29293typedef struct { char c; void *x; } __Pyx_st_void_p;
29294typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
29295static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
29296 CYTHON_UNUSED_VAR(is_complex);
29297 switch (ch) {
29298 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29299 case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
29300 case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
29301 case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
29302 case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
29303 case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
29304 case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
29305 case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
29306 case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
29307 default:
29308 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29309 return 0;
29310 }
29311}
29312/* These are for computing the padding at the end of the struct to align
29313 on the first member of the struct. This will probably the same as above,
29314 but we don't have any guarantees.
29315 */
29316typedef struct { short x; char c; } __Pyx_pad_short;
29317typedef struct { int x; char c; } __Pyx_pad_int;
29318typedef struct { long x; char c; } __Pyx_pad_long;
29319typedef struct { float x; char c; } __Pyx_pad_float;
29320typedef struct { double x; char c; } __Pyx_pad_double;
29321typedef struct { long double x; char c; } __Pyx_pad_longdouble;
29322typedef struct { void *x; char c; } __Pyx_pad_void_p;
29323typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
29324static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
29325 CYTHON_UNUSED_VAR(is_complex);
29326 switch (ch) {
29327 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29328 case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
29329 case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
29330 case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
29331 case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
29332 case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
29333 case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
29334 case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
29335 case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
29336 default:
29337 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29338 return 0;
29339 }
29340}
29341static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
29342 switch (ch) {
29343 case 'c':
29344 return 'H';
29345 case 'b': case 'h': case 'i':
29346 case 'l': case 'q': case 's': case 'p':
29347 return 'I';
29348 case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
29349 return 'U';
29350 case 'f': case 'd': case 'g':
29351 return (is_complex ? 'C' : 'R');
29352 case 'O':
29353 return 'O';
29354 case 'P':
29355 return 'P';
29356 default: {
29357 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29358 return 0;
29359 }
29360 }
29361}
29362static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
29363 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
29364 const char* expected;
29365 const char* quote;
29366 if (ctx->head == NULL) {
29367 expected = "end";
29368 quote = "";
29369 } else {
29370 expected = ctx->head->field->type->name;
29371 quote = "'";
29372 }
29373 PyErr_Format(PyExc_ValueError,
29374 "Buffer dtype mismatch, expected %s%s%s but got %s",
29375 quote, expected, quote,
29376 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
29377 } else {
29378 const __Pyx_StructField* field = ctx->head->field;
29379 const __Pyx_StructField* parent = (ctx->head - 1)->field;
29380 PyErr_Format(PyExc_ValueError,
29381 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
29382 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
29383 parent->type->name, field->name);
29384 }
29385}
29386static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
29387 char group;
29388 size_t size, offset, arraysize = 1;
29389 if (ctx->enc_type == 0) return 0;
29390 if (ctx->head->field->type->arraysize[0]) {
29391 int i, ndim = 0;
29392 if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
29393 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
29394 ndim = 1;
29395 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
29396 PyErr_Format(PyExc_ValueError,
29397 "Expected a dimension of size %zu, got %zu",
29398 ctx->head->field->type->arraysize[0], ctx->enc_count);
29399 return -1;
29400 }
29401 }
29402 if (!ctx->is_valid_array) {
29403 PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
29404 ctx->head->field->type->ndim, ndim);
29405 return -1;
29406 }
29407 for (i = 0; i < ctx->head->field->type->ndim; i++) {
29408 arraysize *= ctx->head->field->type->arraysize[i];
29409 }
29410 ctx->is_valid_array = 0;
29411 ctx->enc_count = 1;
29412 }
29413 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
29414 do {
29415 const __Pyx_StructField* field = ctx->head->field;
29416 const __Pyx_TypeInfo* type = field->type;
29417 if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
29418 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
29419 } else {
29420 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
29421 }
29422 if (ctx->enc_packmode == '@') {
29423 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
29424 size_t align_mod_offset;
29425 if (align_at == 0) return -1;
29426 align_mod_offset = ctx->fmt_offset % align_at;
29427 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
29428 if (ctx->struct_alignment == 0)
29429 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
29430 ctx->is_complex);
29431 }
29432 if (type->size != size || type->typegroup != group) {
29433 if (type->typegroup == 'C' && type->fields != NULL) {
29434 size_t parent_offset = ctx->head->parent_offset + field->offset;
29435 ++ctx->head;
29436 ctx->head->field = type->fields;
29437 ctx->head->parent_offset = parent_offset;
29438 continue;
29439 }
29440 if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
29441 } else {
29442 __Pyx_BufFmt_RaiseExpected(ctx);
29443 return -1;
29444 }
29445 }
29446 offset = ctx->head->parent_offset + field->offset;
29447 if (ctx->fmt_offset != offset) {
29448 PyErr_Format(PyExc_ValueError,
29449 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
29450 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
29451 return -1;
29452 }
29453 ctx->fmt_offset += size;
29454 if (arraysize)
29455 ctx->fmt_offset += (arraysize - 1) * size;
29456 --ctx->enc_count;
29457 while (1) {
29458 if (field == &ctx->root) {
29459 ctx->head = NULL;
29460 if (ctx->enc_count != 0) {
29461 __Pyx_BufFmt_RaiseExpected(ctx);
29462 return -1;
29463 }
29464 break;
29465 }
29466 ctx->head->field = ++field;
29467 if (field->type == NULL) {
29468 --ctx->head;
29469 field = ctx->head->field;
29470 continue;
29471 } else if (field->type->typegroup == 'S') {
29472 size_t parent_offset = ctx->head->parent_offset + field->offset;
29473 if (field->type->fields->type == NULL) continue;
29474 field = field->type->fields;
29475 ++ctx->head;
29476 ctx->head->field = field;
29477 ctx->head->parent_offset = parent_offset;
29478 break;
29479 } else {
29480 break;
29481 }
29482 }
29483 } while (ctx->enc_count);
29484 ctx->enc_type = 0;
29485 ctx->is_complex = 0;
29486 return 0;
29487}
29488static int
29489__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
29490{
29491 const char *ts = *tsp;
29492 int i = 0, number, ndim;
29493 ++ts;
29494 if (ctx->new_count != 1) {
29495 PyErr_SetString(PyExc_ValueError,
29496 "Cannot handle repeated arrays in format string");
29497 return -1;
29498 }
29499 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
29500 ndim = ctx->head->field->type->ndim;
29501 while (*ts && *ts != ')') {
29502 switch (*ts) {
29503 case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
29504 default: break;
29505 }
29506 number = __Pyx_BufFmt_ExpectNumber(&ts);
29507 if (number == -1) return -1;
29508 if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
29509 PyErr_Format(PyExc_ValueError,
29510 "Expected a dimension of size %zu, got %d",
29511 ctx->head->field->type->arraysize[i], number);
29512 return -1;
29513 }
29514 if (*ts != ',' && *ts != ')') {
29515 PyErr_Format(PyExc_ValueError,
29516 "Expected a comma in format string, got '%c'", *ts);
29517 return -1;
29518 }
29519 if (*ts == ',') ts++;
29520 i++;
29521 }
29522 if (i != ndim) {
29523 PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
29524 ctx->head->field->type->ndim, i);
29525 return -1;
29526 }
29527 if (!*ts) {
29528 PyErr_SetString(PyExc_ValueError,
29529 "Unexpected end of format string, expected ')'");
29530 return -1;
29531 }
29532 ctx->is_valid_array = 1;
29533 ctx->new_count = 1;
29534 *tsp = ++ts;
29535 return 0;
29536}
29537static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
29538 int got_Z = 0;
29539 while (1) {
29540 switch(*ts) {
29541 case 0:
29542 if (ctx->enc_type != 0 && ctx->head == NULL) {
29543 __Pyx_BufFmt_RaiseExpected(ctx);
29544 return NULL;
29545 }
29546 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29547 if (ctx->head != NULL) {
29548 __Pyx_BufFmt_RaiseExpected(ctx);
29549 return NULL;
29550 }
29551 return ts;
29552 case ' ':
29553 case '\r':
29554 case '\n':
29555 ++ts;
29556 break;
29557 case '<':
29558 if (!__Pyx_Is_Little_Endian()) {
29559 PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
29560 return NULL;
29561 }
29562 ctx->new_packmode = '=';
29563 ++ts;
29564 break;
29565 case '>':
29566 case '!':
29567 if (__Pyx_Is_Little_Endian()) {
29568 PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
29569 return NULL;
29570 }
29571 ctx->new_packmode = '=';
29572 ++ts;
29573 break;
29574 case '=':
29575 case '@':
29576 case '^':
29577 ctx->new_packmode = *ts++;
29578 break;
29579 case 'T':
29580 {
29581 const char* ts_after_sub;
29582 size_t i, struct_count = ctx->new_count;
29583 size_t struct_alignment = ctx->struct_alignment;
29584 ctx->new_count = 1;
29585 ++ts;
29586 if (*ts != '\x7B') {
29587 PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '\x7B' after 'T'");
29588 return NULL;
29589 }
29590 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29591 ctx->enc_type = 0;
29592 ctx->enc_count = 0;
29593 ctx->struct_alignment = 0;
29594 ++ts;
29595 ts_after_sub = ts;
29596 for (i = 0; i != struct_count; ++i) {
29597 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
29598 if (!ts_after_sub) return NULL;
29599 }
29600 ts = ts_after_sub;
29601 if (struct_alignment) ctx->struct_alignment = struct_alignment;
29602 }
29603 break;
29604 case '\x7D':
29605 {
29606 size_t alignment = ctx->struct_alignment;
29607 ++ts;
29608 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29609 ctx->enc_type = 0;
29610 if (alignment && ctx->fmt_offset % alignment) {
29611 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
29612 }
29613 }
29614 return ts;
29615 case 'x':
29616 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29617 ctx->fmt_offset += ctx->new_count;
29618 ctx->new_count = 1;
29619 ctx->enc_count = 0;
29620 ctx->enc_type = 0;
29621 ctx->enc_packmode = ctx->new_packmode;
29622 ++ts;
29623 break;
29624 case 'Z':
29625 got_Z = 1;
29626 ++ts;
29627 if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
29628 __Pyx_BufFmt_RaiseUnexpectedChar('Z');
29629 return NULL;
29630 }
29631 CYTHON_FALLTHROUGH;
29632 case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
29633 case 'l': case 'L': case 'q': case 'Q':
29634 case 'f': case 'd': case 'g':
29635 case 'O': case 'p':
29636 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
29637 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
29638 ctx->enc_count += ctx->new_count;
29639 ctx->new_count = 1;
29640 got_Z = 0;
29641 ++ts;
29642 break;
29643 }
29644 CYTHON_FALLTHROUGH;
29645 case 's':
29646 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29647 ctx->enc_count = ctx->new_count;
29648 ctx->enc_packmode = ctx->new_packmode;
29649 ctx->enc_type = *ts;
29650 ctx->is_complex = got_Z;
29651 ++ts;
29652 ctx->new_count = 1;
29653 got_Z = 0;
29654 break;
29655 case ':':
29656 ++ts;
29657 while(*ts != ':') ++ts;
29658 ++ts;
29659 break;
29660 case '(':
29661 if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
29662 break;
29663 default:
29664 {
29665 int number = __Pyx_BufFmt_ExpectNumber(&ts);
29666 if (number == -1) return NULL;
29667 ctx->new_count = (size_t)number;
29668 }
29669 }
29670 }
29671}
29672
29673/* BufferGetAndValidate */
29674static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
29675 if (unlikely(info->buf == NULL)) return;
29676 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
29677 PyBuffer_Release(info);
29678}
29679static void __Pyx_ZeroBuffer(Py_buffer* buf) {
29680 buf->buf = NULL;
29681 buf->obj = NULL;
29682 buf->strides = __Pyx_zeros;
29683 buf->shape = __Pyx_zeros;
29684 buf->suboffsets = __Pyx_minusones;
29685}
29686static int __Pyx__GetBufferAndValidate(
29687 Py_buffer* buf, PyObject* obj, const __Pyx_TypeInfo* dtype, int flags,
29688 int nd, int cast, __Pyx_BufFmt_StackElem* stack)
29689{
29690 buf->buf = NULL;
29691 if (unlikely(PyObject_GetBuffer(obj, buf, flags) == -1)) {
29692 __Pyx_ZeroBuffer(buf);
29693 return -1;
29694 }
29695 if (unlikely(buf->ndim != nd)) {
29696 PyErr_Format(PyExc_ValueError,
29697 "Buffer has wrong number of dimensions (expected %d, got %d)",
29698 nd, buf->ndim);
29699 goto fail;
29700 }
29701 if (!cast) {
29702 __Pyx_BufFmt_Context ctx;
29703 __Pyx_BufFmt_Init(&ctx, stack, dtype);
29704 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
29705 }
29706 if (unlikely((size_t)buf->itemsize != dtype->size)) {
29707 PyErr_Format(PyExc_ValueError,
29708 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
29709 buf->itemsize, (buf->itemsize > 1) ? "s" : "",
29710 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
29711 goto fail;
29712 }
29713 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
29714 return 0;
29715fail:;
29716 __Pyx_SafeReleaseBuffer(buf);
29717 return -1;
29718}
29719
29720/* BufferIndexError */
29721static void __Pyx_RaiseBufferIndexError(int axis) {
29722 PyErr_Format(PyExc_IndexError,
29723 "Out of bounds on buffer access (axis %d)", axis);
29724}
29725
29726/* PyFrozenDict (used by DictGetItem) */
29727#if CYTHON_COMPILING_IN_LIMITED_API
29728static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
29729 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
29730}
29731#endif
29732
29733/* DictGetItem */
29734#if !CYTHON_COMPILING_IN_PYPY
29735static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
29736 PyObject *value;
29737 if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
29738 if (unlikely(PyTuple_Check(key))) {
29739 PyObject* args = PyTuple_Pack(1, key);
29740 if (likely(args)) {
29741 PyErr_SetObject(PyExc_KeyError, args);
29742 Py_DECREF(args);
29743 }
29744 } else {
29745 PyErr_SetObject(PyExc_KeyError, key);
29746 }
29747 }
29748 return value;
29749}
29750#endif
29751
29752/* FormatTypeName (used by RaiseErrorWithObjectTypes) */
29753#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29754static __Pyx_TypeName
29755__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
29756{
29757 PyObject *module = NULL, *name = NULL, *result = NULL;
29758 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
29759 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
29760 __pyx_mstate_global->__pyx_n_u_qualname);
29761 #else
29762 name = PyType_GetQualName(tp);
29763 #endif
29764 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
29765 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
29766 __pyx_mstate_global->__pyx_n_u_module);
29767 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
29768 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
29769 result = name;
29770 name = NULL;
29771 goto done;
29772 }
29773 result = PyUnicode_FromFormat("%U.%U", module, name);
29774 if (unlikely(result == NULL)) goto bad;
29775 done:
29776 Py_XDECREF(name);
29777 Py_XDECREF(module);
29778 return result;
29779 bad:
29780 PyErr_Clear();
29781 if (name) {
29782 result = name;
29783 name = NULL;
29784 } else {
29785 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
29786 }
29787 goto done;
29788}
29789#endif
29790
29791/* RaiseErrorWithObjectTypes (used by PyNumberBinop) */
29792static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
29793 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
29794 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29795 if (unlikely(!type_name1)) return;
29796 #endif
29797 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
29798 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29799 if (unlikely(!type_name2)) goto type2_failed;
29800 #endif
29801 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
29802 __Pyx_DECREF_TypeName(type_name2);
29803#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29804type2_failed:
29805#endif
29806 __Pyx_DECREF_TypeName(type_name1);
29807}
29808
29809/* PyNumberBinop */
29810#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
29811#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
29812#ifndef __Pyx_DEFINED_BinopTypeError
29813#define __Pyx_DEFINED_BinopTypeError
29814static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
29815 char opname[4] = {op[0], op[1], 0, 0};
29816 if (inplace) {
29817 opname[op[1] ? 2 : 1] = '=';
29818 }
29819 __Pyx_RaiseErrorWithObjectTypes1(
29820 PyExc_TypeError,
29821 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
29822 opname, op1, op2);
29823}
29824#endif
29825#endif
29826#ifndef __Pyx_DEFINED_PyNumber_Add_xfloat_object
29827#define __Pyx_DEFINED_PyNumber_Add_xfloat_object
29828static PyObject* __Pyx_PyNumber_Add_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
29829 if (PyLong_CheckExact(op2)) {
29830 double int_op2;
29831 #if CYTHON_USE_PYLONG_INTERNALS
29832 if (__Pyx_PyLong_IsCompact(op2)) {
29833 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
29834 if (compact_op2 == 0) return __Pyx_NewRef(op1);
29835 int_op2 = (double) compact_op2;
29836 } else
29837 #endif
29838 {
29839 int_op2 = PyLong_AsDouble(op2);
29840 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
29841 #if !CYTHON_USE_PYLONG_INTERNALS
29842 if (int_op2 == 0.) return __Pyx_NewRef(op1);
29843 #endif
29844 }
29845 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
29846 #if !CYTHON_ASSUME_SAFE_MACROS
29847 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
29848 #endif
29849 return PyFloat_FromDouble(float_op1 + int_op2);
29850 }
29851 if (PyLong_Check(op2)) {
29852 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_add, binaryfunc);
29853 if (likely(slot_func)) {
29854 return slot_func(op1, op2);
29855 }
29856 }
29857 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
29858 {
29859 PyTypeObject *type_op2 = Py_TYPE(op2);
29860 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
29861 if (likely(slot_func)) {
29862 PyObject *result = slot_func(op1, op2);
29863 if (likely(result != Py_NotImplemented)) {
29864 return result;
29865 }
29866 Py_DECREF(result);
29867 }
29868 __Pyx_BinopTypeError(op1, op2, "+", inplace);
29869 return NULL;
29870 }
29871 #else
29872 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
29873 #endif
29874}
29875#endif
29876#ifndef __Pyx_DEFINED_PyNumber_Add_xint_object
29877#define __Pyx_DEFINED_PyNumber_Add_xint_object
29878static PyObject* __Pyx_PyNumber_Add_xint_object(PyObject *op1, PyObject *op2, int inplace) {
29879 if (PyFloat_CheckExact(op2)) {
29880 double int_op1;
29881 #if CYTHON_USE_PYLONG_INTERNALS
29882 if (__Pyx_PyLong_IsCompact(op1)) {
29883 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
29884 if (compact_op1 == 0) return __Pyx_NewRef(op2);
29885 int_op1 = (double) compact_op1;
29886 } else
29887 #endif
29888 {
29889 int_op1 = PyLong_AsDouble(op1);
29890 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
29891 #if !CYTHON_USE_PYLONG_INTERNALS
29892 if (int_op1 == 0.) return __Pyx_NewRef(op2);
29893 #endif
29894 }
29895 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
29896 #if !CYTHON_ASSUME_SAFE_MACROS
29897 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
29898 #endif
29899 return PyFloat_FromDouble(int_op1 + float_op2);
29900 }
29901 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
29902 {
29903 PyTypeObject *type_op2 = Py_TYPE(op2);
29904 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
29905 if (likely(slot_func)) {
29906 PyObject *result = slot_func(op1, op2);
29907 if (likely(result != Py_NotImplemented)) {
29908 return result;
29909 }
29910 Py_DECREF(result);
29911 }
29912 __Pyx_BinopTypeError(op1, op2, "+", inplace);
29913 return NULL;
29914 }
29915 #else
29916 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
29917 #endif
29918}
29919#endif
29920static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2, int inplace) {
29921 if (PyFloat_CheckExact(op1)) {
29922 if (PyFloat_CheckExact(op2)) {
29923 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
29924 #if !CYTHON_ASSUME_SAFE_MACROS
29925 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
29926 #endif
29927 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
29928 #if !CYTHON_ASSUME_SAFE_MACROS
29929 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
29930 #endif
29931 return PyFloat_FromDouble(float_op1 + float_op2);
29932 }
29933 return __Pyx_PyNumber_Add_xfloat_object(op1, op2, inplace);
29934 }
29935 if (PyLong_CheckExact(op1)) {
29936 if (PyLong_CheckExact(op2)) {
29937 #if CYTHON_USE_PYLONG_INTERNALS
29938 if (__Pyx_PyLong_IsCompact(op1)) {
29939 Py_ssize_t int_op1 = __Pyx_PyLong_CompactValue(op1);
29940 if (int_op1 == 0) return __Pyx_NewRef(op2);
29941 if (__Pyx_PyLong_IsCompact(op2)) {
29942 Py_ssize_t int_op2 = __Pyx_PyLong_CompactValue(op2);
29943 if (int_op2 == 0) return __Pyx_NewRef(op1);
29944 return PyLong_FromSsize_t(int_op1 + int_op2);
29945 }
29946 }
29947 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op1);
29948 #endif
29949 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_add, binaryfunc);
29950 if (likely(slot_func)) {
29951 return slot_func(op1, op2);
29952 }
29953 }
29954 return __Pyx_PyNumber_Add_xint_object(op1, op2, inplace);
29955 }
29956 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
29957}
29958#endif
29959
29960/* PyNumberBinop */
29961#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
29962#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
29963#ifndef __Pyx_DEFINED_BinopTypeError
29964#define __Pyx_DEFINED_BinopTypeError
29965static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
29966 char opname[4] = {op[0], op[1], 0, 0};
29967 if (inplace) {
29968 opname[op[1] ? 2 : 1] = '=';
29969 }
29970 __Pyx_RaiseErrorWithObjectTypes1(
29971 PyExc_TypeError,
29972 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
29973 opname, op1, op2);
29974}
29975#endif
29976#endif
29977#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
29978#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
29979static PyObject* __Pyx_PyNumber_Multiply_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
29980 if (PyLong_CheckExact(op2)) {
29981 double int_op2;
29982 #if CYTHON_USE_PYLONG_INTERNALS
29983 if (__Pyx_PyLong_IsCompact(op2)) {
29984 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
29985 int_op2 = (double) compact_op2;
29986 } else
29987 #endif
29988 {
29989 int_op2 = PyLong_AsDouble(op2);
29990 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
29991 }
29992 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
29993 #if !CYTHON_ASSUME_SAFE_MACROS
29994 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
29995 #endif
29996 if (float_op1 == 0.) return __Pyx_NewRef(op1);
29997 return PyFloat_FromDouble(float_op1 * int_op2);
29998 }
29999 if (PyLong_Check(op2)) {
30000 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_multiply, binaryfunc);
30001 if (likely(slot_func)) {
30002 return slot_func(op1, op2);
30003 }
30004 }
30005 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30006 {
30007 PyTypeObject *type_op2 = Py_TYPE(op2);
30008 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
30009 if (likely(slot_func)) {
30010 PyObject *result = slot_func(op1, op2);
30011 if (likely(result != Py_NotImplemented)) {
30012 return result;
30013 }
30014 Py_DECREF(result);
30015 }
30016 __Pyx_BinopTypeError(op1, op2, "*", inplace);
30017 return NULL;
30018 }
30019 #else
30020 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30021 #endif
30022}
30023#endif
30024static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_float_object(PyObject *op1, PyObject *op2, int inplace) {
30025 if (likely(op1 != Py_None)) {
30026 if (likely(PyFloat_CheckExact(op2))) {
30027 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
30028 #if !CYTHON_ASSUME_SAFE_MACROS
30029 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
30030 #endif
30031 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
30032 #if !CYTHON_ASSUME_SAFE_MACROS
30033 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
30034 #endif
30035 return PyFloat_FromDouble(float_op1 * float_op2);
30036 }
30037 return __Pyx_PyNumber_Multiply_xfloat_object(op1, op2, inplace);
30038 }
30039 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30040}
30041#endif
30042
30043/* GettItemInt_wraparound (used by GetItemInt) */
30044#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30045static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
30046 assert(*i < 0);
30047 if (likely(sm->sq_length)) {
30048 Py_ssize_t l = sm->sq_length(o);
30049 if (likely(l >= 0)) {
30050 *i += l;
30051 } else {
30052 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30053 return -1;
30054 PyErr_Clear();
30055 }
30056 }
30057 return 0;
30058}
30059#endif
30060
30061/* GetItemInt */
30062static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
30063 PyObject *r;
30064 if (unlikely(!j)) return NULL;
30065 r = PyObject_GetItem(o, j);
30066 Py_DECREF(j);
30067 return r;
30068}
30069static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
30070 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
30071}
30072static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
30073 int wraparound, int boundscheck, int unsafe_shared) {
30074 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30075#if CYTHON_AVOID_BORROWED_REFS
30076 CYTHON_UNUSED_VAR(boundscheck);
30077 Py_ssize_t wrapped_i = i;
30078 if (wraparound & unlikely(i < 0)) {
30079 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
30080 #if !CYTHON_ASSUME_SAFE_SIZE
30081 if (unlikely(size < 0)) return NULL;
30082 #endif
30083 wrapped_i += size;
30084 }
30085 return __Pyx_PyList_GetItemRef(o, wrapped_i);
30086#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30087 Py_ssize_t wrapped_i = i;
30088 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
30089 if (wraparound & unlikely(i < 0)) {
30090 wrapped_i += size;
30091 }
30092 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
30093 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
30094 }
30095 return __Pyx_GetItemInt_Generic_size(o, i);
30096#else
30097 (void)wraparound;
30098 (void)boundscheck;
30099 return PySequence_GetItem(o, i);
30100#endif
30101}
30102static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
30103 int wraparound, int boundscheck, int unsafe_shared) {
30104 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30105#if CYTHON_AVOID_BORROWED_REFS
30106 CYTHON_UNUSED_VAR(boundscheck);
30107 Py_ssize_t wrapped_i = i;
30108 if (wraparound & unlikely(i < 0)) {
30109 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
30110 #if !CYTHON_ASSUME_SAFE_SIZE
30111 if (unlikely(size < 0)) return NULL;
30112 #endif
30113 wrapped_i += size;
30114 }
30115 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
30116 return PySequence_ITEM(o, wrapped_i);
30117 #else
30118 if (unlikely(wrapped_i < 0)) {
30119 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
30120 return NULL;
30121 }
30122 return PySequence_GetItem(o, wrapped_i);
30123 #endif
30124#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30125 Py_ssize_t wrapped_i = i;
30126 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
30127 if (wraparound & unlikely(i < 0)) {
30128 wrapped_i += size;
30129 }
30130 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
30131 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
30132 }
30133 return __Pyx_GetItemInt_Generic_size(o, i);
30134#else
30135 (void)wraparound;
30136 (void)boundscheck;
30137 return PySequence_GetItem(o, i);
30138#endif
30139}
30140#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30141static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
30142 PyObject *r, *key = PyLong_FromSsize_t(i);
30143 if (unlikely(!key)) return NULL;
30144 r = getitem(o, key);
30145 Py_DECREF(key);
30146 return r;
30147}
30148#endif
30149static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
30150 int wraparound, int boundscheck, int unsafe_shared) {
30151 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30152#if CYTHON_ASSUME_SAFE_SIZE
30153 if (PyList_CheckExact(o)) {
30154 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
30155 } else
30156 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30157 if (PyTuple_CheckExact(o)) {
30158 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
30159 } else
30160 #endif
30161#else
30162 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
30163 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
30164 } else
30165#endif
30166#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30167 if (PyDict_CheckExact(o)) {
30168 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
30169 #if defined(PyFrozenDict_CheckExact)
30170 } else if (PyFrozenDict_CheckExact(o)) {
30171 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
30172 #endif
30173 } else
30174 {
30175 PyTypeObject *obj_type = Py_TYPE(o);
30176 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
30177 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
30178 PyMappingMethods *mm = obj_type->tp_as_mapping;
30179 if (mm && mm->mp_subscript)
30180 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
30181 }
30182 PySequenceMethods *sm = obj_type->tp_as_sequence;
30183 if (likely(sm && sm->sq_item)) {
30184 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
30185 return NULL;
30186 return sm->sq_item(o, i);
30187 }
30188 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
30189 PyMappingMethods *mm = obj_type->tp_as_mapping;
30190 if (likely(mm && mm->mp_subscript))
30191 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
30192 }
30193 }
30194#else
30195 if (!PyMapping_Check(o)) {
30196 return PySequence_GetItem(o, i);
30197 }
30198#endif
30199 (void)wraparound;
30200 (void)boundscheck;
30201 return __Pyx_GetItemInt_Generic_size(o, i);
30202}
30203
30204/* PyObjectGetAttrStrNoError (used by ObjectGetItem) */
30205#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
30206static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
30207 __Pyx_PyThreadState_declare
30208 __Pyx_PyThreadState_assign
30209 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30210 __Pyx_PyErr_Clear();
30211}
30212#endif
30213static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
30214 PyObject *result;
30215#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30216 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
30217 return result;
30218#else
30219#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
30220 PyTypeObject* tp = Py_TYPE(obj);
30221 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
30222 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
30223 }
30224#endif
30225 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
30226 if (unlikely(!result)) {
30227 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
30228 }
30229 return result;
30230#endif
30231}
30232
30233/* RaiseErrorWithObjectType (used by ObjectGetItem) */
30234static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
30235 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
30236 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30237 if (unlikely(!type_name)) return;
30238 #endif
30239 PyErr_Format(exc_type, message, type_name);
30240 __Pyx_DECREF_TypeName(type_name);
30241}
30242
30243/* ObjectGetItem */
30244#if CYTHON_USE_TYPE_SLOTS
30245static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
30246 PyObject *runerr = NULL;
30247 Py_ssize_t key_value;
30248 key_value = __Pyx_PyIndex_AsSsize_t(index);
30249 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
30250 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
30251 }
30252 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
30253 PyErr_Clear();
30254 __Pyx_RaiseErrorWithObjectType(
30255 PyExc_IndexError,
30256 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
30257 index);
30258 }
30259 return NULL;
30260}
30261static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
30262 if (likely(PyType_Check(obj))) {
30263 if ((PyTypeObject*)obj == &PyType_Type) {
30264 return Py_GenericAlias(obj, key);
30265 }
30266 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
30267 if (!meth) {
30268 if (PyErr_Occurred()) {
30269 return NULL;
30270 }
30271 } else {
30272 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
30273 Py_DECREF(meth);
30274 return result;
30275 }
30276 }
30277 __Pyx_RaiseTypeErrorWithObjectType(
30278 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
30279 return NULL;
30280}
30281static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
30282 PyTypeObject *tp = Py_TYPE(obj);
30283 PyMappingMethods *mm = tp->tp_as_mapping;
30284 PySequenceMethods *sm = tp->tp_as_sequence;
30285 if (likely(mm && mm->mp_subscript)) {
30286 return mm->mp_subscript(obj, key);
30287 }
30288 if (likely(sm && sm->sq_item)) {
30289 return __Pyx_PyObject_GetIndex(obj, key);
30290 }
30291 return __Pyx_PyObject_GetItem_Slow(obj, key);
30292}
30293#endif
30294
30295/* PyNumberBinop */
30296#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
30297#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30298#ifndef __Pyx_DEFINED_BinopTypeError
30299#define __Pyx_DEFINED_BinopTypeError
30300static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
30301 char opname[4] = {op[0], op[1], 0, 0};
30302 if (inplace) {
30303 opname[op[1] ? 2 : 1] = '=';
30304 }
30305 __Pyx_RaiseErrorWithObjectTypes1(
30306 PyExc_TypeError,
30307 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
30308 opname, op1, op2);
30309}
30310#endif
30311#endif
30312#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
30313#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
30314static PyObject* __Pyx_PyNumber_Multiply_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
30315 if (PyLong_CheckExact(op2)) {
30316 double int_op2;
30317 #if CYTHON_USE_PYLONG_INTERNALS
30318 if (__Pyx_PyLong_IsCompact(op2)) {
30319 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
30320 int_op2 = (double) compact_op2;
30321 } else
30322 #endif
30323 {
30324 int_op2 = PyLong_AsDouble(op2);
30325 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
30326 }
30327 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
30328 #if !CYTHON_ASSUME_SAFE_MACROS
30329 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
30330 #endif
30331 if (float_op1 == 0.) return __Pyx_NewRef(op1);
30332 return PyFloat_FromDouble(float_op1 * int_op2);
30333 }
30334 if (PyLong_Check(op2)) {
30335 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_multiply, binaryfunc);
30336 if (likely(slot_func)) {
30337 return slot_func(op1, op2);
30338 }
30339 }
30340 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30341 {
30342 PyTypeObject *type_op2 = Py_TYPE(op2);
30343 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
30344 if (likely(slot_func)) {
30345 PyObject *result = slot_func(op1, op2);
30346 if (likely(result != Py_NotImplemented)) {
30347 return result;
30348 }
30349 Py_DECREF(result);
30350 }
30351 __Pyx_BinopTypeError(op1, op2, "*", inplace);
30352 return NULL;
30353 }
30354 #else
30355 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30356 #endif
30357}
30358#endif
30359#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_object
30360#define __Pyx_DEFINED_PyNumber_Multiply_xint_object
30361static PyObject* __Pyx_PyNumber_Multiply_xint_object(PyObject *op1, PyObject *op2, int inplace) {
30362 if (PyFloat_CheckExact(op2)) {
30363 double int_op1;
30364 #if CYTHON_USE_PYLONG_INTERNALS
30365 if (__Pyx_PyLong_IsCompact(op1)) {
30366 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
30367 int_op1 = (double) compact_op1;
30368 } else
30369 #endif
30370 {
30371 int_op1 = PyLong_AsDouble(op1);
30372 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
30373 }
30374 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
30375 #if !CYTHON_ASSUME_SAFE_MACROS
30376 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
30377 #endif
30378 return PyFloat_FromDouble(int_op1 * float_op2);
30379 }
30380 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30381 {
30382 PyTypeObject *type_op2 = Py_TYPE(op2);
30383 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
30384 if (likely(slot_func)) {
30385 PyObject *result = slot_func(op1, op2);
30386 if (likely(result != Py_NotImplemented)) {
30387 return result;
30388 }
30389 Py_DECREF(result);
30390 }
30391 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
30392 if (likely(repeat_func)) {
30393 Py_ssize_t count;
30394 #if CYTHON_USE_PYLONG_INTERNALS
30395 if (__Pyx_PyLong_IsCompact(op1)) {
30396 count = __Pyx_PyLong_CompactValue(op1);
30397 } else
30398 #endif
30399 {
30400 count = PyLong_AsSsize_t(op1);
30401 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
30402 }
30403 return repeat_func(op2, count);
30404 }
30405 __Pyx_BinopTypeError(op1, op2, "*", inplace);
30406 return NULL;
30407 }
30408 #else
30409 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30410 #endif
30411}
30412#endif
30413static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_object(PyObject *op1, PyObject *op2, int inplace) {
30414 if (PyFloat_CheckExact(op1)) {
30415 if (PyFloat_CheckExact(op2)) {
30416 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
30417 #if !CYTHON_ASSUME_SAFE_MACROS
30418 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
30419 #endif
30420 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
30421 #if !CYTHON_ASSUME_SAFE_MACROS
30422 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
30423 #endif
30424 return PyFloat_FromDouble(float_op1 * float_op2);
30425 }
30426 return __Pyx_PyNumber_Multiply_xfloat_object(op1, op2, inplace);
30427 }
30428 if (PyLong_CheckExact(op1)) {
30429 if (PyLong_CheckExact(op2)) {
30430 #if CYTHON_USE_PYLONG_INTERNALS
30431 if (__Pyx_PyLong_IsCompact(op1)) {
30432 long long int_op1 = (long long) __Pyx_PyLong_CompactValue(op1);
30433 if (int_op1 == 0) return __Pyx_NewRef(op1);
30434 if (__Pyx_PyLong_IsCompact(op2)) {
30435 long long int_op2 = (long long) __Pyx_PyLong_CompactValue(op2);
30436 if (int_op2 == 0) return __Pyx_NewRef(op2);
30437 return PyLong_FromLongLong(int_op1 * int_op2);
30438 }
30439 }
30440 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op2);
30441 #endif
30442 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
30443 if (likely(slot_func)) {
30444 return slot_func(op1, op2);
30445 }
30446 }
30447 return __Pyx_PyNumber_Multiply_xint_object(op1, op2, inplace);
30448 }
30449 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30450}
30451#endif
30452
30453/* PyFloatBinop */
30454#if !CYTHON_COMPILING_IN_PYPY
30455static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
30456 const double b = floatval;
30457 double a;
30458 CYTHON_UNUSED_VAR(inplace);
30459 CYTHON_UNUSED_VAR(zerodivision_check);
30460 if (likely(PyFloat_CheckExact(op1))) {
30461 a = __Pyx_PyFloat_AS_DOUBLE(op1);
30462
30463 } else
30464 if (likely(PyLong_CheckExact(op1))) {
30465 #if CYTHON_USE_PYLONG_INTERNALS
30466 if (__Pyx_PyLong_IsZero(op1)) {
30467 a = 0.0;
30468
30469 goto digits_done;
30470 } else if (__Pyx_PyLong_IsCompact(op1)) {
30471 a = (double) __Pyx_PyLong_CompactValue(op1);
30472 goto digits_done;
30473 } else {
30474 const digit* digits = __Pyx_PyLong_Digits(op1);
30475 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
30476 if (size <= 2 && (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53)))) {
30477 a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30478 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
30479 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
30480 goto digits_done;
30481 }
30482 }
30483 if (size <= 3 && (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53)))) {
30484 a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30485 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
30486 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
30487 goto digits_done;
30488 }
30489 }
30490 if (size <= 4 && (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53)))) {
30491 a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30492 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
30493 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
30494 goto digits_done;
30495 }
30496 }
30497 }
30498 #endif
30499 a = PyLong_AsDouble(op1);
30500 if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
30501 } else {
30502 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30503 }
30504#if CYTHON_USE_PYLONG_INTERNALS
30505digits_done:;
30506#endif
30507 double result;
30508 result = a + b;
30509 return PyFloat_FromDouble(result);
30510}
30511#endif
30512
30513/* GetBuiltinName (used by GetModuleGlobalName) */
30514static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
30515 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
30516 if (unlikely(!result) && !PyErr_Occurred()) {
30517 PyErr_Format(PyExc_NameError,
30518 "name '%U' is not defined", name);
30519 }
30520 return result;
30521}
30522
30523/* PyDictVersioning (used by GetModuleGlobalName) */
30524#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
30525static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
30526 PyObject *dict = Py_TYPE(obj)->tp_dict;
30527 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
30528}
30529static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
30530 PyObject **dictptr = NULL;
30531 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
30532 if (offset) {
30533#if CYTHON_COMPILING_IN_CPYTHON
30534 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
30535#else
30536 dictptr = _PyObject_GetDictPtr(obj);
30537#endif
30538 }
30539 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
30540}
30541static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
30542 PyObject *dict = Py_TYPE(obj)->tp_dict;
30543 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
30544 return 0;
30545 return obj_dict_version == __Pyx_get_object_dict_version(obj);
30546}
30547#endif
30548
30549/* GetModuleGlobalName */
30550#if CYTHON_USE_DICT_VERSIONS
30551static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
30552#else
30553static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
30554#endif
30555{
30556 PyObject *result;
30557#if CYTHON_COMPILING_IN_LIMITED_API
30558 if (unlikely(!__pyx_m)) {
30559 if (!PyErr_Occurred())
30560 PyErr_SetNone(PyExc_NameError);
30561 return NULL;
30562 }
30563 result = PyObject_GetAttr(__pyx_m, name);
30564 if (likely(result)) {
30565 return result;
30566 }
30567 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30568 return NULL; // BaseException
30569 }
30570#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
30571 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
30572 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30573 return NULL; // BaseException
30574 }
30575 }
30576 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
30577 if (likely(result)) {
30578 return result;
30579 }
30580#else
30581 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
30582 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
30583 if (likely(result)) {
30584 return __Pyx_NewRef(result);
30585 }
30586 PyObject *exc = PyErr_Occurred();
30587 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
30588 return NULL; // BaseException
30589 }
30590#endif
30591 return __Pyx_GetBuiltinName(name);
30592}
30593
30594/* ExtTypeTest */
30595static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
30596 if (unlikely(!type)) {
30597 PyErr_SetString(PyExc_SystemError, "Missing type object");
30598 return 0;
30599 }
30600 if (likely(__Pyx_TypeCheck(obj, type)))
30601 return 1;
30602 __Pyx_RaiseTypeErrorWithTypes(
30603 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
30604 Py_TYPE(obj), type);
30605 return 0;
30606}
30607
30608/* PyObjectCompare */
30609#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolEq
30610#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolEq
30611static int __Pyx_PyObject_CompareFloatIntBoolEq(PyObject *op1, PyObject *op2) {
30612 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
30613 #if !CYTHON_ASSUME_SAFE_MACROS
30614 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
30615 #endif
30616 #if CYTHON_USE_PYLONG_INTERNALS
30617 if (__Pyx_PyLong_IsCompact(op2)) {
30618 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
30619 if (float_op1 == ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
30620 }
30621 if (unlikely(!isfinite(float_op1))) {
30622 if (float_op1 == 0.0) goto __pyx_return_true; else goto __pyx_return_false;
30623 } else {
30624 int sign2 = __Pyx_PyLong_Sign(op2);
30625 if (float_op1 >= 0.) {
30626 if (sign2 < 0) goto __pyx_return_false;
30627 if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
30628 } else {
30629 if (sign2 > 0) goto __pyx_return_false;
30630 if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
30631 }
30632 }
30633 #else
30634 if (unlikely(!isfinite(float_op1))) {
30635 if (float_op1 == 0.0) goto __pyx_return_true; else goto __pyx_return_false;
30636 } else {
30637 int overflow2;
30638 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
30639 if (likely(!overflow2)) {
30640 if ((long long) iop2 >= (1LL << 53)) {
30641 overflow2 = 1;
30642 } else if ((long long) iop2 <= - (1LL << 53)) {
30643 overflow2 = -1;
30644 } else {
30645 if (float_op1 == ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
30646 }
30647 }
30648 if (overflow2 > 0) {
30649 if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_false;
30650 } else {
30651 if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_false;
30652 }
30653 }
30654 #endif
30655 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30656__pyx_return_true:
30657 return 1;
30658__pyx_return_false:
30659 return 0;
30660}
30661#endif
30662#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolEq
30663#define __Pyx_DEFINED_PyObject_CompareIntIntBoolEq
30664static int __Pyx_PyObject_CompareIntIntBoolEq(PyObject *op1, PyObject *op2) {
30665#if CYTHON_USE_PYLONG_INTERNALS
30666 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
30667 if (cmp == 0) {
30668 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
30669 if (size > 0) {
30670 const digit* digits1 = __Pyx_PyLong_Digits(op1);
30671 const digit* digits2 = __Pyx_PyLong_Digits(op2);
30672 if (size == 1) {
30673 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
30674 } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
30675 cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
30676 } else {
30677 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
30678 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
30679 }
30680 }
30681 }
30682 if (cmp == 0) goto __pyx_return_true;
30683 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
30684 }
30685 goto __pyx_return_false;
30686#else
30687 int overflow1, overflow2;
30688 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
30689 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
30690 if (likely(!(overflow1 | overflow2))) {
30691 if (iop1 == iop2) goto __pyx_return_true; else goto __pyx_return_false;
30692 } else if (overflow1 != overflow2) {
30693 if (overflow1 == overflow2) goto __pyx_return_true; else goto __pyx_return_false;
30694 } else {
30695 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30696 }
30697#endif
30698__pyx_return_true:
30699 return 1;
30700__pyx_return_false:
30701 return 0;
30702}
30703#endif
30704static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_int(PyObject *op1, PyObject *op2, int pyop) {
30705 CYTHON_UNUSED_VAR(pyop);
30706 if (unlikely(op2 == Py_None)) {
30707 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
30708 }
30709 if (op1 == op2) goto __pyx_return_true;
30710 if (PyFloat_CheckExact(op1)) {
30711 if (likely(op2 != Py_None)) {
30712 return __Pyx_PyObject_CompareFloatIntBoolEq(op1, op2);
30713 }
30714 goto __pyx_richcmp;
30715 }
30716 if (likely(PyLong_CheckExact(op1))) {
30717 if (op1 == op2) goto __pyx_return_true;
30718 if (likely(op2 != Py_None)) {
30719 return __Pyx_PyObject_CompareIntIntBoolEq(op1, op2);
30720 }
30721 goto __pyx_richcmp;
30722 }
30723 if ((0)) goto __pyx_richcmp;
30724 if ((0)) goto __pyx_return_true;
30725 if ((0)) goto __pyx_return_false;
30726__pyx_richcmp:
30727 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30728__pyx_return_true:
30729 return 1;
30730__pyx_return_false:
30731 return 0;
30732}
30733
30734/* PyNumberBinop */
30735#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
30736#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30737#ifndef __Pyx_DEFINED_BinopTypeError
30738#define __Pyx_DEFINED_BinopTypeError
30739static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
30740 char opname[4] = {op[0], op[1], 0, 0};
30741 if (inplace) {
30742 opname[op[1] ? 2 : 1] = '=';
30743 }
30744 __Pyx_RaiseErrorWithObjectTypes1(
30745 PyExc_TypeError,
30746 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
30747 opname, op1, op2);
30748}
30749#endif
30750#endif
30751#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_float
30752#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_float
30753static PyObject* __Pyx_PyNumber_Multiply_xfloat_float(PyObject *op1, PyObject *op2, int inplace) {
30754 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30755 {
30756 PyTypeObject *type_op2 = Py_TYPE(op2);
30757 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
30758 if (likely(slot_func)) {
30759 PyObject *result = slot_func(op1, op2);
30760 if (likely(result != Py_NotImplemented)) {
30761 return result;
30762 }
30763 Py_DECREF(result);
30764 }
30765 __Pyx_BinopTypeError(op1, op2, "*", inplace);
30766 return NULL;
30767 }
30768 #else
30769 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30770 #endif
30771}
30772#endif
30773#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_float
30774#define __Pyx_DEFINED_PyNumber_Multiply_xint_float
30775static PyObject* __Pyx_PyNumber_Multiply_xint_float(PyObject *op1, PyObject *op2, int inplace) {
30776 if (likely(op2 != Py_None)) {
30777 double int_op1;
30778 #if CYTHON_USE_PYLONG_INTERNALS
30779 if (__Pyx_PyLong_IsCompact(op1)) {
30780 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
30781 int_op1 = (double) compact_op1;
30782 } else
30783 #endif
30784 {
30785 int_op1 = PyLong_AsDouble(op1);
30786 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
30787 }
30788 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
30789 #if !CYTHON_ASSUME_SAFE_MACROS
30790 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
30791 #endif
30792 return PyFloat_FromDouble(int_op1 * float_op2);
30793 }
30794 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30795 {
30796 PyTypeObject *type_op2 = Py_TYPE(op2);
30797 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
30798 if (likely(slot_func)) {
30799 PyObject *result = slot_func(op1, op2);
30800 if (likely(result != Py_NotImplemented)) {
30801 return result;
30802 }
30803 Py_DECREF(result);
30804 }
30805 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
30806 if (likely(repeat_func)) {
30807 Py_ssize_t count;
30808 #if CYTHON_USE_PYLONG_INTERNALS
30809 if (__Pyx_PyLong_IsCompact(op1)) {
30810 count = __Pyx_PyLong_CompactValue(op1);
30811 } else
30812 #endif
30813 {
30814 count = PyLong_AsSsize_t(op1);
30815 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
30816 }
30817 return repeat_func(op2, count);
30818 }
30819 __Pyx_BinopTypeError(op1, op2, "*", inplace);
30820 return NULL;
30821 }
30822 #else
30823 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30824 #endif
30825}
30826#endif
30827static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_float(PyObject *op1, PyObject *op2, int inplace) {
30828 if (likely(PyFloat_CheckExact(op1))) {
30829 if (likely(op2 != Py_None)) {
30830 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
30831 #if !CYTHON_ASSUME_SAFE_MACROS
30832 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
30833 #endif
30834 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
30835 #if !CYTHON_ASSUME_SAFE_MACROS
30836 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
30837 #endif
30838 return PyFloat_FromDouble(float_op1 * float_op2);
30839 }
30840 return __Pyx_PyNumber_Multiply_xfloat_float(op1, op2, inplace);
30841 }
30842 if (PyLong_CheckExact(op1)) {
30843 return __Pyx_PyNumber_Multiply_xint_float(op1, op2, inplace);
30844 }
30845 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
30846}
30847#endif
30848
30849/* PyNumberBinop */
30850#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
30851#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30852#ifndef __Pyx_DEFINED_BinopTypeError
30853#define __Pyx_DEFINED_BinopTypeError
30854static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
30855 char opname[4] = {op[0], op[1], 0, 0};
30856 if (inplace) {
30857 opname[op[1] ? 2 : 1] = '=';
30858 }
30859 __Pyx_RaiseErrorWithObjectTypes1(
30860 PyExc_TypeError,
30861 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
30862 opname, op1, op2);
30863}
30864#endif
30865#endif
30866#ifndef __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
30867#define __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
30868static PyObject* __Pyx_PyNumber_Subtract_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
30869 if (PyLong_CheckExact(op2)) {
30870 double int_op2;
30871 #if CYTHON_USE_PYLONG_INTERNALS
30872 if (__Pyx_PyLong_IsCompact(op2)) {
30873 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
30874 if (compact_op2 == 0) return __Pyx_NewRef(op1);
30875 int_op2 = (double) compact_op2;
30876 } else
30877 #endif
30878 {
30879 int_op2 = PyLong_AsDouble(op2);
30880 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
30881 #if !CYTHON_USE_PYLONG_INTERNALS
30882 if (int_op2 == 0.) return __Pyx_NewRef(op1);
30883 #endif
30884 }
30885 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
30886 #if !CYTHON_ASSUME_SAFE_MACROS
30887 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
30888 #endif
30889 return PyFloat_FromDouble(float_op1 - int_op2);
30890 }
30891 if (PyLong_Check(op2)) {
30892 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_subtract, binaryfunc);
30893 if (likely(slot_func)) {
30894 return slot_func(op1, op2);
30895 }
30896 }
30897 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30898 {
30899 PyTypeObject *type_op2 = Py_TYPE(op2);
30900 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_subtract, binaryfunc);
30901 if (likely(slot_func)) {
30902 PyObject *result = slot_func(op1, op2);
30903 if (likely(result != Py_NotImplemented)) {
30904 return result;
30905 }
30906 Py_DECREF(result);
30907 }
30908 __Pyx_BinopTypeError(op1, op2, "-", inplace);
30909 return NULL;
30910 }
30911 #else
30912 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
30913 #endif
30914}
30915#endif
30916static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_float_object(PyObject *op1, PyObject *op2, int inplace) {
30917 if (likely(op1 != Py_None)) {
30918 if (likely(PyFloat_CheckExact(op2))) {
30919 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
30920 #if !CYTHON_ASSUME_SAFE_MACROS
30921 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
30922 #endif
30923 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
30924 #if !CYTHON_ASSUME_SAFE_MACROS
30925 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
30926 #endif
30927 return PyFloat_FromDouble(float_op1 - float_op2);
30928 }
30929 return __Pyx_PyNumber_Subtract_xfloat_object(op1, op2, inplace);
30930 }
30931 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
30932}
30933#endif
30934
30935/* PyNumberBinop */
30936#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
30937#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30938#ifndef __Pyx_DEFINED_BinopTypeError
30939#define __Pyx_DEFINED_BinopTypeError
30940static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
30941 char opname[4] = {op[0], op[1], 0, 0};
30942 if (inplace) {
30943 opname[op[1] ? 2 : 1] = '=';
30944 }
30945 __Pyx_RaiseErrorWithObjectTypes1(
30946 PyExc_TypeError,
30947 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
30948 opname, op1, op2);
30949}
30950#endif
30951#endif
30952#ifndef __Pyx_DEFINED_PyNumber_Add_xfloat_float
30953#define __Pyx_DEFINED_PyNumber_Add_xfloat_float
30954static PyObject* __Pyx_PyNumber_Add_xfloat_float(PyObject *op1, PyObject *op2, int inplace) {
30955 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
30956 {
30957 PyTypeObject *type_op2 = Py_TYPE(op2);
30958 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
30959 if (likely(slot_func)) {
30960 PyObject *result = slot_func(op1, op2);
30961 if (likely(result != Py_NotImplemented)) {
30962 return result;
30963 }
30964 Py_DECREF(result);
30965 }
30966 __Pyx_BinopTypeError(op1, op2, "+", inplace);
30967 return NULL;
30968 }
30969 #else
30970 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
30971 #endif
30972}
30973#endif
30974#ifndef __Pyx_DEFINED_PyNumber_Add_xint_float
30975#define __Pyx_DEFINED_PyNumber_Add_xint_float
30976static PyObject* __Pyx_PyNumber_Add_xint_float(PyObject *op1, PyObject *op2, int inplace) {
30977 if (likely(op2 != Py_None)) {
30978 double int_op1;
30979 #if CYTHON_USE_PYLONG_INTERNALS
30980 if (__Pyx_PyLong_IsCompact(op1)) {
30981 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
30982 if (compact_op1 == 0) return __Pyx_NewRef(op2);
30983 int_op1 = (double) compact_op1;
30984 } else
30985 #endif
30986 {
30987 int_op1 = PyLong_AsDouble(op1);
30988 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
30989 #if !CYTHON_USE_PYLONG_INTERNALS
30990 if (int_op1 == 0.) return __Pyx_NewRef(op2);
30991 #endif
30992 }
30993 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
30994 #if !CYTHON_ASSUME_SAFE_MACROS
30995 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
30996 #endif
30997 return PyFloat_FromDouble(int_op1 + float_op2);
30998 }
30999 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31000 {
31001 PyTypeObject *type_op2 = Py_TYPE(op2);
31002 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
31003 if (likely(slot_func)) {
31004 PyObject *result = slot_func(op1, op2);
31005 if (likely(result != Py_NotImplemented)) {
31006 return result;
31007 }
31008 Py_DECREF(result);
31009 }
31010 __Pyx_BinopTypeError(op1, op2, "+", inplace);
31011 return NULL;
31012 }
31013 #else
31014 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31015 #endif
31016}
31017#endif
31018static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_float(PyObject *op1, PyObject *op2, int inplace) {
31019 if (likely(PyFloat_CheckExact(op1))) {
31020 if (likely(op2 != Py_None)) {
31021 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
31022 #if !CYTHON_ASSUME_SAFE_MACROS
31023 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
31024 #endif
31025 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31026 #if !CYTHON_ASSUME_SAFE_MACROS
31027 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
31028 #endif
31029 return PyFloat_FromDouble(float_op1 + float_op2);
31030 }
31031 return __Pyx_PyNumber_Add_xfloat_float(op1, op2, inplace);
31032 }
31033 if (PyLong_CheckExact(op1)) {
31034 return __Pyx_PyNumber_Add_xint_float(op1, op2, inplace);
31035 }
31036 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31037}
31038#endif
31039
31040/* pybytes_as_double (used by pyobject_as_double) */
31041static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
31042 PyObject *float_value = PyFloat_FromString(obj);
31043 if (likely(float_value)) {
31044 double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
31045 Py_DECREF(float_value);
31046 return value;
31047 }
31048 return (double)-1;
31049}
31050static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
31051 int last_was_punctuation = 1;
31052 int parse_error_found = 0;
31053 Py_ssize_t i;
31054 for (i=0; i < length; i++) {
31055 char chr = start[i];
31056 int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
31057 *buffer = chr;
31058 buffer += (chr != '_');
31059 parse_error_found |= last_was_punctuation & is_punctuation;
31060 last_was_punctuation = is_punctuation;
31061 }
31062 parse_error_found |= last_was_punctuation;
31063 *buffer = '\0';
31064 return unlikely(parse_error_found) ? NULL : buffer;
31065}
31066static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
31067 int matches = 1;
31068 char sign = start[0];
31069 int is_signed = (sign == '+') | (sign == '-');
31070 start += is_signed;
31071 length -= is_signed;
31072 switch (start[0]) {
31073 #ifdef Py_NAN
31074 case 'n':
31075 case 'N':
31076 if (unlikely(length != 3)) goto parse_failure;
31077 matches &= (start[1] == 'a' || start[1] == 'A');
31078 matches &= (start[2] == 'n' || start[2] == 'N');
31079 if (unlikely(!matches)) goto parse_failure;
31080 return (sign == '-') ? -Py_NAN : Py_NAN;
31081 #endif
31082 case 'i':
31083 case 'I':
31084 if (unlikely(length < 3)) goto parse_failure;
31085 matches &= (start[1] == 'n' || start[1] == 'N');
31086 matches &= (start[2] == 'f' || start[2] == 'F');
31087 if (likely(length == 3 && matches))
31088 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
31089 if (unlikely(length != 8)) goto parse_failure;
31090 matches &= (start[3] == 'i' || start[3] == 'I');
31091 matches &= (start[4] == 'n' || start[4] == 'N');
31092 matches &= (start[5] == 'i' || start[5] == 'I');
31093 matches &= (start[6] == 't' || start[6] == 'T');
31094 matches &= (start[7] == 'y' || start[7] == 'Y');
31095 if (unlikely(!matches)) goto parse_failure;
31096 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
31097 case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
31098 break;
31099 default:
31100 goto parse_failure;
31101 }
31102 return 0.0;
31103parse_failure:
31104 return -1.0;
31105}
31106static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
31107 return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
31108}
31109CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
31110 double value;
31111 Py_ssize_t i, digits;
31112 const char *last = start + length;
31113 char *end;
31114 int valid_parse;
31115 while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
31116 start++;
31117 while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
31118 last--;
31119 length = last - start;
31120 if (unlikely(length <= 0)) goto fallback;
31121 value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
31122 if (value != 0.0) {
31123 if (unlikely(value == -1.0)) goto fallback;
31124 return value;
31125 }
31126 digits = 0;
31127 for (i=0; i < length; digits += start[i++] != '_');
31128 if (likely(digits == length)) {
31129 value = PyOS_string_to_double(start, &end, NULL);
31130 valid_parse = (end == last);
31131 } else if (digits < 40) {
31132 char number[40];
31133 last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
31134 if (unlikely(!last)) goto fallback;
31135 value = PyOS_string_to_double(number, &end, NULL);
31136 valid_parse = (end == last);
31137 } else {
31138 char *number = (char*) PyMem_Malloc(((size_t) digits + 1) * sizeof(char));
31139 if (unlikely(!number)) goto fallback;
31140 last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
31141 if (unlikely(!last)) {
31142 PyMem_Free(number);
31143 goto fallback;
31144 }
31145 value = PyOS_string_to_double(number, &end, NULL);
31146 valid_parse = (end == last);
31147 PyMem_Free(number);
31148 }
31149 if (likely(valid_parse) || (value == (double)-1 && PyErr_Occurred())) {
31150 return value;
31151 }
31152fallback:
31153 return __Pyx_SlowPyString_AsDouble(obj);
31154}
31155
31156/* pyobject_as_double */
31157static double __Pyx__PyObject_AsDouble(PyObject* obj) {
31158 if (PyUnicode_CheckExact(obj)) {
31159 return __Pyx_PyUnicode_AsDouble(obj);
31160 } else if (PyBytes_CheckExact(obj)) {
31161 return __Pyx_PyBytes_AsDouble(obj);
31162 } else if (PyByteArray_CheckExact(obj)) {
31163 return __Pyx_PyByteArray_AsDouble(obj);
31164 } else {
31165 PyObject* float_value;
31166#if !CYTHON_USE_TYPE_SLOTS
31167 float_value = PyNumber_Float(obj); if ((0)) goto bad;
31168 (void)__Pyx_PyObject_CallOneArg;
31169#else
31170 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
31171 if (likely(nb) && likely(nb->nb_float)) {
31172 float_value = nb->nb_float(obj);
31173 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
31174 __Pyx_RaiseTypeErrorWithObjectType(
31175 "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
31176 float_value);
31177 Py_DECREF(float_value);
31178 goto bad;
31179 }
31180 } else {
31181 float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
31182 }
31183#endif
31184 if (likely(float_value)) {
31185 double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
31186 Py_DECREF(float_value);
31187 return value;
31188 }
31189 }
31190bad:
31191 return (double)-1;
31192}
31193
31194/* TypeImport */
31195#ifndef __PYX_HAVE_RT_ImportType_3_3_0
31196#define __PYX_HAVE_RT_ImportType_3_3_0
31197static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
31198 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
31199{
31200 PyObject *result = 0;
31201 Py_ssize_t basicsize;
31202 Py_ssize_t itemsize;
31203#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
31204 PyObject *py_basicsize;
31205 PyObject *py_itemsize;
31206#endif
31207 result = PyObject_GetAttrString(module, class_name);
31208 if (!result)
31209 goto bad;
31210 if (!PyType_Check(result)) {
31211 PyErr_Format(PyExc_TypeError,
31212 "%.200s.%.200s is not a type object",
31213 module_name, class_name);
31214 goto bad;
31215 }
31216#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
31217 basicsize = ((PyTypeObject *)result)->tp_basicsize;
31218 itemsize = ((PyTypeObject *)result)->tp_itemsize;
31219#else
31220 if (size == 0) {
31221 return (PyTypeObject *)result;
31222 }
31223 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
31224 if (!py_basicsize)
31225 goto bad;
31226 basicsize = PyLong_AsSsize_t(py_basicsize);
31227 Py_DECREF(py_basicsize);
31228 py_basicsize = 0;
31229 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
31230 goto bad;
31231 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
31232 if (!py_itemsize)
31233 goto bad;
31234 itemsize = PyLong_AsSsize_t(py_itemsize);
31235 Py_DECREF(py_itemsize);
31236 py_itemsize = 0;
31237 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
31238 goto bad;
31239#endif
31240 if (itemsize) {
31241 if (size % alignment) {
31242 alignment = size % alignment;
31243 }
31244 if (itemsize < (Py_ssize_t)alignment)
31245 itemsize = (Py_ssize_t)alignment;
31246 }
31247 if ((size_t)(basicsize + itemsize) < size) {
31248 PyErr_Format(PyExc_ValueError,
31249 "%.200s.%.200s size changed, may indicate binary incompatibility. "
31250 "Expected %zd from C header, got %zd from PyObject",
31251 module_name, class_name, size, basicsize+itemsize);
31252 goto bad;
31253 }
31254 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
31255 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
31256 PyErr_Format(PyExc_ValueError,
31257 "%.200s.%.200s size changed, may indicate binary incompatibility. "
31258 "Expected %zd from C header, got %zd-%zd from PyObject",
31259 module_name, class_name, size, basicsize, basicsize+itemsize);
31260 goto bad;
31261 }
31262 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
31263 if (PyErr_WarnFormat(NULL, 0,
31264 "%.200s.%.200s size changed, may indicate binary incompatibility. "
31265 "Expected %zd from C header, got %zd from PyObject",
31266 module_name, class_name, size, basicsize) < 0) {
31267 goto bad;
31268 }
31269 }
31270 return (PyTypeObject *)result;
31271bad:
31272 Py_XDECREF(result);
31273 return NULL;
31274}
31275#endif
31276
31277/* HasAttr (used by ImportImpl) */
31278#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31279static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
31280 PyObject *r;
31281 if (unlikely(!PyUnicode_Check(n))) {
31282 PyErr_SetString(PyExc_TypeError,
31283 "hasattr(): attribute name must be string");
31284 return -1;
31285 }
31286 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
31287 if (!r) {
31288 return (unlikely(PyErr_Occurred())) ? -1 : 0;
31289 } else {
31290 Py_DECREF(r);
31291 return 1;
31292 }
31293}
31294#endif
31295
31296/* TupleOrListFromArrayImpl (used by ListFromArray) */
31297CYTHON_UNUSED static PyObject *
31298__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
31299 PyObject *res = PyList_New(n);
31300 if (unlikely(res == NULL)) return NULL;
31301 #if CYTHON_COMPILING_IN_CPYTHON
31302 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
31303 #else
31304 Py_ssize_t i;
31305 for (i = 0; i < n; i++) {
31306 Py_INCREF(src[i]);
31307 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
31308 Py_DECREF(res);
31309 return NULL;
31310 }
31311 }
31312 #endif
31313 return res;
31314}
31315
31316/* ImportImpl (used by Import) */
31317static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
31318 PyObject *imported_module = PyImport_GetModule(qualname);
31319 if (unlikely(!imported_module)) {
31320 *module = NULL;
31321 if (PyErr_Occurred()) {
31322 return -1;
31323 }
31324 return 0;
31325 }
31326 *module = imported_module;
31327 return 1;
31328}
31329static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
31330 PyObject *imported_module;
31331 PyObject *top_level_package_name;
31332 Py_ssize_t i;
31333 int status, module_found;
31334 Py_ssize_t dot_index;
31335 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
31336 if (unlikely(!module_found || module_found == -1)) {
31337 *module = NULL;
31338 return module_found;
31339 }
31340 if (imported_names) {
31341 for (i = 0; i < len_imported_names; i++) {
31342 PyObject *imported_name = imported_names[i];
31343#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31344 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
31345#else
31346 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
31347 if (unlikely(has_imported_attribute == -1)) goto error;
31348#endif
31349 if (!has_imported_attribute) {
31350 goto not_found;
31351 }
31352 }
31353 *module = imported_module;
31354 return 1;
31355 }
31356 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
31357 if (dot_index == -1) {
31358 *module = imported_module;
31359 return 1;
31360 }
31361 if (unlikely(dot_index == -2)) goto error;
31362 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
31363 if (unlikely(!top_level_package_name)) goto error;
31364 Py_DECREF(imported_module);
31365 status = __Pyx__Import_GetModule(top_level_package_name, module);
31366 Py_DECREF(top_level_package_name);
31367 return status;
31368error:
31369 Py_DECREF(imported_module);
31370 *module = NULL;
31371 return -1;
31372not_found:
31373 Py_DECREF(imported_module);
31374 *module = NULL;
31375 return 0;
31376}
31377static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
31378 PyObject *module = 0;
31379 PyObject *empty_dict = 0;
31380 PyObject *from_list = 0;
31381 int module_found;
31382 if (!qualname) {
31383 qualname = name;
31384 }
31385 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
31386 if (likely(module_found == 1)) {
31387 return module;
31388 } else if (unlikely(module_found == -1)) {
31389 return NULL;
31390 }
31391 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
31392 empty_dict = PyFrozenDict_New(NULL);
31393 #else
31394 empty_dict = PyDict_New();
31395 #endif
31396 if (unlikely(!empty_dict))
31397 goto bad;
31398 if (imported_names) {
31399 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
31400 if (unlikely(!from_list))
31401 goto bad;
31402 }
31403 if (level == -1) {
31404 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
31405 if (package_sep != (0)) {
31406 module = PyImport_ImportModuleLevelObject(
31407 name, moddict, empty_dict, from_list, 1);
31408 if (unlikely(!module)) {
31409 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
31410 goto bad;
31411 PyErr_Clear();
31412 }
31413 }
31414 level = 0;
31415 }
31416 if (!module) {
31417 module = PyImport_ImportModuleLevelObject(
31418 name, moddict, empty_dict, from_list, level);
31419 }
31420bad:
31421 Py_XDECREF(from_list);
31422 Py_XDECREF(empty_dict);
31423 return module;
31424}
31425
31426/* Import */
31427static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
31428 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
31429}
31430
31431/* dict_setdefault (used by FetchCommonType) */
31432static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
31433 PyObject* value;
31434#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
31435 PyDict_SetDefaultRef(d, key, default_value, &value);
31436#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31437 PyObject *args[] = {d, key, default_value};
31438 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
31439#elif CYTHON_COMPILING_IN_LIMITED_API
31440 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
31441#else
31442 value = PyDict_SetDefault(d, key, default_value);
31443 if (unlikely(!value)) return NULL;
31444 Py_INCREF(value);
31445#endif
31446 return value;
31447}
31448
31449/* AddModuleRef (used by FetchSharedCythonModule) */
31450#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
31451 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
31452 PyObject *module_dict = PyImport_GetModuleDict();
31453 PyObject *m;
31454 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
31455 return NULL;
31456 }
31457 if (m != NULL && PyModule_Check(m)) {
31458 return m;
31459 }
31460 Py_XDECREF(m);
31461 m = PyModule_NewObject(name);
31462 if (m == NULL)
31463 return NULL;
31464 if (PyDict_CheckExact(module_dict)) {
31465 PyObject *new_m;
31466 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
31467 Py_DECREF(m);
31468 return new_m;
31469 } else {
31470 if (PyObject_SetItem(module_dict, name, m) != 0) {
31471 Py_DECREF(m);
31472 return NULL;
31473 }
31474 return m;
31475 }
31476 }
31477 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
31478 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
31479 return PyImport_AddModuleRef(name);
31480 }
31481 PyObject *py_name = PyUnicode_FromString(name);
31482 if (!py_name) return NULL;
31483 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
31484 Py_DECREF(py_name);
31485 return module;
31486 }
31487#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
31488 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
31489 PyObject *module = PyImport_AddModule(name);
31490 Py_XINCREF(module);
31491 return module;
31492 }
31493#endif
31494
31495/* FetchSharedCythonModule (used by FetchCommonType) */
31496static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
31497 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
31498}
31499
31500/* VerifyCachedType (used by FetchCommonType) */
31501static int __Pyx_VerifyCachedType(PyObject *cached_type,
31502 const char *name,
31503 Py_ssize_t expected_basicsize) {
31504 Py_ssize_t basicsize;
31505 if (!PyType_Check(cached_type)) {
31506 PyErr_Format(PyExc_TypeError,
31507 "Shared Cython type %.200s is not a type object", name);
31508 return -1;
31509 }
31510 if (expected_basicsize == 0) {
31511 return 0; // size is inherited, nothing useful to check
31512 }
31513#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
31514 if (expected_basicsize < 0) {
31515 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
31516 } else
31517#endif
31518 {
31519 #if CYTHON_COMPILING_IN_LIMITED_API
31520 PyObject *py_basicsize;
31521 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
31522 if (unlikely(!py_basicsize)) return -1;
31523 basicsize = PyLong_AsSsize_t(py_basicsize);
31524 Py_DECREF(py_basicsize);
31525 py_basicsize = NULL;
31526 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
31527 #else
31528 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
31529 #endif
31530 }
31531 if ((expected_basicsize >= 0) ?
31532 (basicsize != expected_basicsize) :
31533 (basicsize < -expected_basicsize)) {
31534 PyErr_Format(PyExc_TypeError,
31535 "Shared Cython type %.200s has the wrong size, try recompiling",
31536 name);
31537 return -1;
31538 }
31539 return 0;
31540}
31541
31542/* FetchCommonType (used by CommonTypesMetaclass) */
31543#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
31544static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
31545 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
31546 if (result && metaclass) {
31547 PyObject *old_tp = (PyObject*)Py_TYPE(result);
31548 Py_INCREF((PyObject*)metaclass);
31549 Py_SET_TYPE(result, metaclass);
31550 Py_DECREF(old_tp);
31551 PyType_Modified((PyTypeObject*)result);
31552 }
31553 return result;
31554}
31555#else
31556#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
31557#endif
31558static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
31559 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
31560 int get_item_ref_result;
31561 const char* object_name = strrchr(spec->name, '.');
31562 object_name = object_name ? object_name+1 : spec->name;
31563 py_object_name = PyUnicode_FromString(object_name);
31564 if (!py_object_name) return NULL;
31565 abi_module = __Pyx_FetchSharedCythonABIModule();
31566 if (!abi_module) goto done;
31567 abi_module_dict = PyModule_GetDict(abi_module);
31568 if (!abi_module_dict) goto done;
31569 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
31570 if (get_item_ref_result == 1) {
31571 if (__Pyx_VerifyCachedType(
31572 cached_type,
31573 object_name,
31574 spec->basicsize) < 0) {
31575 goto bad;
31576 }
31577 goto done;
31578 } else if (unlikely(get_item_ref_result == -1)) {
31579 goto bad;
31580 }
31581 cached_type = __Pyx_PyType_FromMetaclass(
31582 metaclass,
31583 CYTHON_USE_MODULE_STATE ? module : abi_module,
31584 spec, bases);
31585 if (unlikely(!cached_type)) goto bad;
31586 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
31587 if (unlikely(new_cached_type != cached_type)) {
31588 if (unlikely(!new_cached_type)) goto bad;
31589 Py_DECREF(cached_type);
31590 cached_type = new_cached_type;
31591 if (__Pyx_VerifyCachedType(
31592 cached_type,
31593 object_name,
31594 spec->basicsize) < 0) {
31595 goto bad;
31596 }
31597 goto done;
31598 } else {
31599 Py_DECREF(new_cached_type);
31600 }
31601done:
31602 Py_XDECREF(abi_module);
31603 Py_DECREF(py_object_name);
31604 assert(cached_type == NULL || PyType_Check(cached_type));
31605 return (PyTypeObject *) cached_type;
31606bad:
31607 Py_XDECREF(cached_type);
31608 cached_type = NULL;
31609 goto done;
31610}
31611
31612/* CommonTypesMetaclass (used by CythonFunctionShared) */
31613static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
31614 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
31615}
31616#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
31617static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
31618 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
31619 return NULL;
31620}
31621static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
31622 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
31623 return -1;
31624}
31625#endif
31626static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
31627 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
31628 {0, 0, 0, 0, 0}
31629};
31630static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
31631 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
31632 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
31633 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
31634 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
31635 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
31636 #endif
31637 {0, 0}
31638};
31639static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
31640 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
31641 0,
31642 0,
31643 Py_TPFLAGS_IMMUTABLETYPE |
31644 Py_TPFLAGS_DISALLOW_INSTANTIATION |
31645 Py_TPFLAGS_DEFAULT,
31646 __pyx_CommonTypesMetaclass_slots
31647};
31648static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
31649 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
31650 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
31651 if (unlikely(!bases)) {
31652 return -1;
31653 }
31654 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
31655 Py_DECREF(bases);
31656 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
31657 return -1;
31658 }
31659 return 0;
31660}
31661
31662/* CythonFunctionPerModule (used by CythonFunctionShared) */
31663#if CYTHON_COMPILING_IN_LIMITED_API
31664static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
31665 if (__Pyx_CyFunction_Check(func)) {
31666 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
31667 } else if (PyCFunction_Check(func)) {
31668 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
31669 }
31670 return 0;
31671}
31672static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
31673 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
31674 int result;
31675 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
31676 if (unlikely(!newFunc)) {
31677 PyErr_Clear(); // It's only an optimization, so don't throw an error
31678 return 0;
31679 }
31680 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
31681 Py_DECREF(newFunc);
31682 return result;
31683 }
31684 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
31685}
31686#else
31687static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
31688 if (PyMethod_Check(func)) {
31689 func = PyMethod_GET_FUNCTION(func);
31690 }
31691 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
31692}
31693#endif
31694static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
31695#if CYTHON_COMPILING_IN_LIMITED_API
31696 __Pyx_Py_XDECREF_SET(
31697 __Pyx__CyFunction_GetClassObj(f),
31698 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
31699#else
31700 __Pyx_Py_XDECREF_SET(
31701 ((PyCMethodObject *) (f))->mm_class,
31702 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
31703#endif
31704}
31705static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
31706 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
31707 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
31708 if (unlikely(!m->defaults))
31709 return NULL;
31710 return m->defaults;
31711}
31712static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
31713 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
31714 m->defaults_tuple = tuple;
31715 Py_INCREF(tuple);
31716}
31717static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
31718 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
31719 m->defaults_kwdict = dict;
31720 Py_INCREF(dict);
31721}
31722static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
31723 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
31724 m->func_annotations = dict;
31725 Py_INCREF(dict);
31726}
31727
31728/* CallTypeTraverse (used by CythonFunctionShared) */
31729#if !CYTHON_USE_TYPE_SPECS
31730#else
31731static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
31732 if (!always_call) {
31733 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
31734 unsigned long flags = PyType_GetFlags(base);
31735 if (flags & Py_TPFLAGS_HEAPTYPE) {
31736 return 0;
31737 }
31738 }
31739 Py_VISIT((PyObject*)Py_TYPE(o));
31740 return 0;
31741}
31742#endif
31743
31744/* PyMethodNew (used by CythonFunctionShared) */
31745#if CYTHON_COMPILING_IN_LIMITED_API
31746static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
31747 PyObject *result;
31748 CYTHON_UNUSED_VAR(typ);
31749 if (!self)
31750 return __Pyx_NewRef(func);
31751 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31752 {
31753 PyObject *args[] = {func, self};
31754 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
31755 }
31756 #else
31757 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
31758 #endif
31759 return result;
31760}
31761#else
31762static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
31763 CYTHON_UNUSED_VAR(typ);
31764 if (!self)
31765 return __Pyx_NewRef(func);
31766 return PyMethod_New(func, self);
31767}
31768#endif
31769
31770/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
31771#if CYTHON_VECTORCALL
31772static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
31773{
31774 PyObject *res = NULL;
31775 PyObject *kwnames;
31776 PyObject **newargs;
31777 PyObject **kwvalues;
31778 Py_ssize_t i;
31779 #if CYTHON_AVOID_BORROWED_REFS
31780 PyObject *pos;
31781 #else
31782 Py_ssize_t pos;
31783 #endif
31784 size_t j;
31785 PyObject *key, *value;
31786 unsigned long keys_are_strings;
31787 #if !CYTHON_ASSUME_SAFE_SIZE
31788 Py_ssize_t nkw = PyDict_Size(kw);
31789 if (unlikely(nkw == -1)) return NULL;
31790 #else
31791 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
31792 #endif
31793 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
31794 if (unlikely(newargs == NULL)) {
31795 PyErr_NoMemory();
31796 return NULL;
31797 }
31798 for (j = 0; j < nargs; j++) newargs[j] = args[j];
31799 kwnames = PyTuple_New(nkw);
31800 if (unlikely(kwnames == NULL)) {
31801 PyMem_Free(newargs);
31802 return NULL;
31803 }
31804 kwvalues = newargs + nargs;
31805 pos = 0;
31806 i = 0;
31807 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
31808 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
31809 keys_are_strings &=
31810 #if CYTHON_COMPILING_IN_LIMITED_API
31811 PyType_GetFlags(Py_TYPE(key));
31812 #else
31813 Py_TYPE(key)->tp_flags;
31814 #endif
31815 #if !CYTHON_ASSUME_SAFE_MACROS
31816 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
31817 #else
31818 PyTuple_SET_ITEM(kwnames, i, key);
31819 #endif
31820 kwvalues[i] = value;
31821 i++;
31822 }
31823 if (unlikely(!keys_are_strings)) {
31824 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
31825 goto cleanup;
31826 }
31827 res = vc(func, newargs, nargs, kwnames);
31828cleanup:
31829 #if CYTHON_AVOID_BORROWED_REFS
31830 Py_DECREF(pos);
31831 #endif
31832 Py_DECREF(kwnames);
31833 for (i = 0; i < nkw; i++)
31834 Py_DECREF(kwvalues[i]);
31835 PyMem_Free(newargs);
31836 return res;
31837}
31838static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
31839{
31840 Py_ssize_t kw_size =
31841 likely(kw == NULL) ?
31842 0 :
31843#if !CYTHON_ASSUME_SAFE_SIZE
31844 PyDict_Size(kw);
31845#else
31846 PyDict_GET_SIZE(kw);
31847#endif
31848 if (kw_size == 0) {
31849 return vc(func, args, nargs, NULL);
31850 }
31851#if !CYTHON_ASSUME_SAFE_SIZE
31852 else if (unlikely(kw_size == -1)) {
31853 return NULL;
31854 }
31855#endif
31856 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
31857}
31858#endif
31859
31860/* CythonFunctionShared (used by CythonFunction) */
31861static PyObject *
31862__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
31863{
31864 if (unlikely(op->func_doc == NULL)) {
31865#if CYTHON_COMPILING_IN_LIMITED_API
31866 const char *doc = op->func_methoddef->ml_doc;
31867#else
31868 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
31869#endif
31870 if (doc) {
31871 op->func_doc = PyUnicode_FromString(doc);
31872 if (unlikely(op->func_doc == NULL))
31873 return NULL;
31874 } else {
31875 Py_INCREF(Py_None);
31876 return Py_None;
31877 }
31878 }
31879 Py_INCREF(op->func_doc);
31880 return op->func_doc;
31881}
31882static PyObject *
31883__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
31884 PyObject *result;
31885 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31886 CYTHON_UNUSED_VAR(closure);
31887 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
31888 result = __Pyx_CyFunction_get_doc_locked(op);
31889 __Pyx_END_CRITICAL_SECTION();
31890 return result;
31891}
31892static int
31893__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
31894{
31895 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31896 CYTHON_UNUSED_VAR(context);
31897 if (value == NULL) {
31898 value = Py_None;
31899 }
31900 Py_INCREF(value);
31901 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
31902 __Pyx_Py_XDECREF_SET(op->func_doc, value);
31903 __Pyx_END_CRITICAL_SECTION();
31904 return 0;
31905}
31906static PyObject *
31907__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
31908{
31909 if (unlikely(op->func_name == NULL)) {
31910#if CYTHON_COMPILING_IN_LIMITED_API
31911 const char *name = op->func_methoddef->ml_name;
31912#else
31913 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
31914#endif
31915 op->func_name = PyUnicode_InternFromString(name);
31916 if (unlikely(op->func_name == NULL))
31917 return NULL;
31918 }
31919 Py_INCREF(op->func_name);
31920 return op->func_name;
31921}
31922static PyObject *
31923__Pyx_CyFunction_get_name(PyObject *op, void *context)
31924{
31925 PyObject *result = NULL;
31926 CYTHON_UNUSED_VAR(context);
31927 __Pyx_BEGIN_CRITICAL_SECTION(op);
31928 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
31929 __Pyx_END_CRITICAL_SECTION();
31930 return result;
31931}
31932static int
31933__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
31934{
31935 CYTHON_UNUSED_VAR(context);
31936 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
31937 PyErr_SetString(PyExc_TypeError,
31938 "__name__ must be set to a string object");
31939 return -1;
31940 }
31941 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31942 Py_INCREF(value);
31943 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
31944 __Pyx_Py_XDECREF_SET(op->func_name, value);
31945 __Pyx_END_CRITICAL_SECTION();
31946 return 0;
31947}
31948static PyObject *
31949__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
31950{
31951 CYTHON_UNUSED_VAR(context);
31952 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31953 PyObject *result;
31954 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
31955 Py_INCREF(op->func_qualname);
31956 result = op->func_qualname;
31957 __Pyx_END_CRITICAL_SECTION();
31958 return result;
31959}
31960static int
31961__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
31962{
31963 CYTHON_UNUSED_VAR(context);
31964 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
31965 PyErr_SetString(PyExc_TypeError,
31966 "__qualname__ must be set to a string object");
31967 return -1;
31968 }
31969 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31970 Py_INCREF(value);
31971 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
31972 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
31973 __Pyx_END_CRITICAL_SECTION();
31974 return 0;
31975}
31976#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
31977static PyObject *
31978__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
31979{
31980 CYTHON_UNUSED_VAR(context);
31981 if (unlikely(op->func_dict == NULL)) {
31982 op->func_dict = PyDict_New();
31983 if (unlikely(op->func_dict == NULL))
31984 return NULL;
31985 }
31986 Py_INCREF(op->func_dict);
31987 return op->func_dict;
31988}
31989#endif
31990static PyObject *
31991__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
31992{
31993 CYTHON_UNUSED_VAR(context);
31994 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31995 Py_INCREF(op->func_globals);
31996 return op->func_globals;
31997}
31998static PyObject *
31999__Pyx_CyFunction_get_closure(PyObject *op, void *context)
32000{
32001 CYTHON_UNUSED_VAR(op);
32002 CYTHON_UNUSED_VAR(context);
32003 Py_INCREF(Py_None);
32004 return Py_None;
32005}
32006static PyObject *
32007__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
32008{
32009 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32010 PyObject* result = (op->func_code) ? op->func_code : Py_None;
32011 CYTHON_UNUSED_VAR(context);
32012 Py_INCREF(result);
32013 return result;
32014}
32015static int
32016__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
32017 int result = 0;
32018 PyObject *res = op->defaults_getter(op_obj);
32019 if (unlikely(!res))
32020 return -1;
32021 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32022 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
32023 Py_INCREF(op->defaults_tuple);
32024 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
32025 Py_INCREF(op->defaults_kwdict);
32026 #else
32027 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
32028 if (unlikely(!op->defaults_tuple)) result = -1;
32029 else {
32030 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
32031 if (unlikely(!op->defaults_kwdict)) result = -1;
32032 }
32033 #endif
32034 Py_DECREF(res);
32035 return result;
32036}
32037static int
32038__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
32039 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32040 CYTHON_UNUSED_VAR(context);
32041 if (!value) {
32042 value = Py_None;
32043 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
32044 PyErr_SetString(PyExc_TypeError,
32045 "__defaults__ must be set to a tuple object");
32046 return -1;
32047 }
32048 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
32049 "currently affect the values used in function calls", 1);
32050 Py_INCREF(value);
32051 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32052 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
32053 __Pyx_END_CRITICAL_SECTION();
32054 return 0;
32055}
32056static PyObject *
32057__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
32058 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32059 PyObject* result = op->defaults_tuple;
32060 if (unlikely(!result)) {
32061 if (op->defaults_getter) {
32062 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
32063 result = op->defaults_tuple;
32064 } else {
32065 result = Py_None;
32066 }
32067 }
32068 Py_INCREF(result);
32069 return result;
32070}
32071static PyObject *
32072__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
32073 PyObject* result = NULL;
32074 CYTHON_UNUSED_VAR(context);
32075 __Pyx_BEGIN_CRITICAL_SECTION(op);
32076 result = __Pyx_CyFunction_get_defaults_locked(op);
32077 __Pyx_END_CRITICAL_SECTION();
32078 return result;
32079}
32080static int
32081__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
32082 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32083 CYTHON_UNUSED_VAR(context);
32084 if (!value) {
32085 value = Py_None;
32086 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
32087 PyErr_SetString(PyExc_TypeError,
32088 "__kwdefaults__ must be set to a dict object");
32089 return -1;
32090 }
32091 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
32092 "currently affect the values used in function calls", 1);
32093 Py_INCREF(value);
32094 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32095 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
32096 __Pyx_END_CRITICAL_SECTION();
32097 return 0;
32098}
32099static PyObject *
32100__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
32101 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32102 PyObject* result = op->defaults_kwdict;
32103 if (unlikely(!result)) {
32104 if (op->defaults_getter) {
32105 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
32106 result = op->defaults_kwdict;
32107 } else {
32108 result = Py_None;
32109 }
32110 }
32111 Py_INCREF(result);
32112 return result;
32113}
32114static PyObject *
32115__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
32116 PyObject* result;
32117 CYTHON_UNUSED_VAR(context);
32118 __Pyx_BEGIN_CRITICAL_SECTION(op);
32119 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
32120 __Pyx_END_CRITICAL_SECTION();
32121 return result;
32122}
32123static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
32124static int
32125__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
32126 CYTHON_UNUSED_VAR(context);
32127 if (!value || value == Py_None) {
32128 value = NULL;
32129 } else if (unlikely(!PyDict_Check(value))) {
32130 PyErr_SetString(PyExc_TypeError,
32131 "__annotations__ must be set to a dict object");
32132 return -1;
32133 }
32134 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32135 Py_XINCREF(value);
32136 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32137 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
32138 __Pyx_END_CRITICAL_SECTION();
32139 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
32140 return 0;
32141}
32142static int
32143__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
32144 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
32145 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
32146#if CYTHON_COMPILING_IN_PYPY
32147 *dict = PyObject_GenericGetDict(op_in, NULL);
32148#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
32149 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
32150#else
32151 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
32152 *dict = likely(dictptr) ? *dictptr : NULL;
32153#endif
32154 return *dict ? 1 : 0;
32155}
32156static int
32157__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
32158 PyObject *dict;
32159 int dict_found;
32160 *annotate = NULL;
32161 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
32162 if (!dict_found) return 0;
32163 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
32164}
32165static int
32166__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
32167 PyObject *dict;
32168 int dict_found;
32169 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
32170 if (!dict_found) return 0;
32171 if (value) {
32172 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
32173 } else {
32174#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
32175 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
32176#else
32177 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
32178 if (result == 1) {
32179 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
32180 }
32181 return result;
32182#endif
32183 }
32184}
32185static int
32186__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
32187 PyObject *dict;
32188 int result;
32189#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
32190 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
32191#else
32192 dict = PyObject_GenericGetDict(op_in, NULL);
32193#endif
32194 if (unlikely(!dict)) return -1;
32195 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
32196 Py_DECREF(dict);
32197 return result;
32198}
32199static PyObject *
32200__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
32201 PyObject* result = op->func_annotations;
32202 if (unlikely(!result)) {
32203 result = PyDict_New();
32204 if (unlikely(!result)) return NULL;
32205 op->func_annotations = result;
32206 }
32207 Py_INCREF(result);
32208 return result;
32209}
32210static PyObject *
32211__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
32212 PyObject *annotate = NULL;
32213 PyObject *result = NULL;
32214 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32215 CYTHON_UNUSED_VAR(context);
32216 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32217 result = __Pyx_XNewRef(op->func_annotations);
32218 __Pyx_END_CRITICAL_SECTION();
32219 if (result) return result;
32220 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
32221 if (!annotate || annotate == Py_None) {
32222 Py_XDECREF(annotate);
32223 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32224 result = __Pyx_CyFunction_get_annotations_locked(op);
32225 __Pyx_END_CRITICAL_SECTION();
32226 return result;
32227 }
32228 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
32229 if (likely(format)) {
32230 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
32231 result = __Pyx_PyObject_CallOneArg(annotate, format);
32232 Py_LeaveRecursiveCall();
32233 Py_DECREF(format);
32234 }
32235 }
32236 Py_DECREF(annotate);
32237 if (unlikely(!result)) return NULL;
32238 if (unlikely(!PyDict_Check(result))) {
32239 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
32240 Py_DECREF(result);
32241 return NULL;
32242 }
32243 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32244 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
32245 __Pyx_END_CRITICAL_SECTION();
32246 return result;
32247}
32248static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
32249 CYTHON_UNUSED_VAR(arg);
32250 if (unlikely(!self)) {
32251 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
32252 return NULL;
32253 }
32254 PyObject *result;
32255 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
32256 return NULL;
32257 }
32258 result = __Pyx_CyFunction_get_annotations(self, NULL);
32259 Py_LeaveRecursiveCall();
32260 return result;
32261}
32262static PyObject *
32263__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
32264static int
32265__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
32266 CYTHON_UNUSED_VAR(context);
32267 if (value == NULL) {
32268 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
32269 return -1;
32270 }
32271 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
32272 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
32273 return -1;
32274 }
32275 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
32276#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
32277 PyCFunction cfunction = PyCFunction_GetFunction(value);
32278 if (unlikely(!cfunction)) return -1;
32279 PyObject *value_self = PyCFunction_GetSelf(value);
32280 if (unlikely(!value_self && PyErr_Occurred())) return -1;
32281#else
32282 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
32283 PyObject *value_self = PyCFunction_GET_SELF(value);
32284#endif
32285 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
32286 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
32287 }
32288 }
32289 if (value != Py_None) {
32290 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32291 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32292 Py_CLEAR(op->func_annotations);
32293 __Pyx_END_CRITICAL_SECTION();
32294 }
32295 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
32296}
32297#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
32298static PyObject *
32299__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
32300 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
32301 if (is_coroutine) {
32302 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
32303 fromlist = PyList_New(1);
32304 if (unlikely(!fromlist)) return NULL;
32305 Py_INCREF(marker);
32306#if CYTHON_ASSUME_SAFE_MACROS
32307 PyList_SET_ITEM(fromlist, 0, marker);
32308#else
32309 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
32310 Py_DECREF(fromlist);
32311 return NULL;
32312 }
32313#endif
32314 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
32315 Py_DECREF(fromlist);
32316 if (unlikely(!module)) {
32317 goto ignore_or_error;
32318 }
32319 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
32320 Py_DECREF(module);
32321 if (likely(is_coroutine_value)) {
32322 return is_coroutine_value;
32323 }
32324ignore_or_error:
32325 if (!__Pyx_IgnoreException(PyExc_Exception)) {
32326 return NULL;
32327 }
32328 }
32329 return __Pyx_PyBool_FromLong(is_coroutine);
32330}
32331static PyObject *
32332__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
32333 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32334 PyObject *result;
32335 CYTHON_UNUSED_VAR(context);
32336 if (op->func_is_coroutine) {
32337 return __Pyx_NewRef(op->func_is_coroutine);
32338 }
32339 result = __Pyx_CyFunction_get_is_coroutine_value(op);
32340 if (unlikely(!result))
32341 return NULL;
32342 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32343 if (op->func_is_coroutine) {
32344 Py_DECREF(result);
32345 result = __Pyx_NewRef(op->func_is_coroutine);
32346 } else {
32347 op->func_is_coroutine = __Pyx_NewRef(result);
32348 }
32349 __Pyx_END_CRITICAL_SECTION();
32350 return result;
32351}
32352#endif
32353static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
32354#if CYTHON_COMPILING_IN_LIMITED_API
32355 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
32356 if (!py_name) return;
32357 PyErr_Format(PyExc_TypeError,
32358 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
32359 py_name, message, size);
32360 Py_DECREF(py_name);
32361#else
32362 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
32363 PyErr_Format(PyExc_TypeError,
32364 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
32365 name, message, size);
32366#endif
32367}
32368static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
32369#if CYTHON_COMPILING_IN_LIMITED_API
32370 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
32371 if (!py_name) return;
32372 PyErr_Format(PyExc_TypeError,
32373 "%.200S() %s",
32374 py_name, message);
32375 Py_DECREF(py_name);
32376#else
32377 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
32378 PyErr_Format(PyExc_TypeError,
32379 "%.200s() %s",
32380 name, message);
32381#endif
32382}
32383#if CYTHON_COMPILING_IN_LIMITED_API
32384static PyObject *
32385__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
32386 CYTHON_UNUSED_VAR(context);
32387 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32388 Py_INCREF(op->func_module);
32389 return op->func_module;
32390}
32391static int
32392__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
32393 CYTHON_UNUSED_VAR(context);
32394 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32395 if (value == NULL) {
32396 value = Py_None;
32397 }
32398 Py_INCREF(value);
32399 PyObject *old = op->func_module;
32400 op->func_module = value;
32401 Py_DECREF(old);
32402 return 0;
32403}
32404#endif
32405static PyGetSetDef __pyx_CyFunction_getsets[] = {
32406 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32407 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32408 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32409 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32410 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
32411#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
32412 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
32413 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
32414#else
32415 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
32416 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
32417#endif
32418 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32419 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32420 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32421 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32422 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32423 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32424 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32425 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32426 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
32427 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
32428 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
32429#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
32430 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
32431#endif
32432#if CYTHON_COMPILING_IN_LIMITED_API
32433 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
32434#endif
32435 {0, 0, 0, 0, 0}
32436};
32437static PyMemberDef __pyx_CyFunction_members[] = {
32438#if !CYTHON_COMPILING_IN_LIMITED_API
32439 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
32440#endif
32441#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
32442 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
32443 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
32444#endif
32445#if CYTHON_VECTORCALL
32446#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
32447 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
32448 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
32449#else
32450 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
32451#endif
32452#if CYTHON_COMPILING_IN_LIMITED_API
32453 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
32454 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
32455#else
32456 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
32457#endif
32458#endif
32459 {0, 0, 0, 0, 0}
32460};
32461static PyObject *
32462__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
32463{
32464 PyObject *result = NULL;
32465 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
32466 CYTHON_UNUSED_VAR(args);
32467 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
32468 Py_INCREF(m->func_qualname);
32469 result = m->func_qualname;
32470 __Pyx_END_CRITICAL_SECTION();
32471 return result;
32472}
32473static PyMethodDef __pyx_CyFunction_methods[] = {
32474 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
32475 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
32476 "on Cython functions."},
32477 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
32478 {0, 0, 0, 0}
32479};
32480static PyObject *
32481__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
32482 PyObject *annotate = NULL;
32483 CYTHON_UNUSED_VAR(context);
32484 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
32485 if (annotate) return annotate;
32486 PyObject *method = PyCFunction_New(
32487 &__pyx_CyFunction_methods[0],
32488 op_in);
32489 return method;
32490}
32491#if CYTHON_COMPILING_IN_LIMITED_API
32492#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
32493#else
32494#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
32495#endif
32496static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
32497 PyMethodDef *ml, int flags, PyObject* qualname,
32498 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32499 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
32500#if !CYTHON_COMPILING_IN_LIMITED_API
32501 PyCFunctionObject *cf = (PyCFunctionObject*) op;
32502#endif
32503 if (unlikely(op == NULL))
32504 return NULL;
32505#if CYTHON_COMPILING_IN_LIMITED_API
32506 op->func_methoddef = ml;
32507 Py_INCREF(module);
32508 op->func_module = module;
32509#endif
32510 op->flags = flags;
32511 __Pyx_CyFunction_weakreflist(op) = NULL;
32512#if !CYTHON_COMPILING_IN_LIMITED_API
32513 cf->m_ml = ml;
32514 cf->m_self = (PyObject *) op;
32515#endif
32516 Py_XINCREF(closure);
32517 op->func_closure = closure;
32518#if !CYTHON_COMPILING_IN_LIMITED_API
32519 Py_XINCREF(module);
32520 cf->m_module = module;
32521#endif
32522#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
32523 op->func_dict = NULL;
32524#endif
32525 op->func_name = NULL;
32526 Py_INCREF(qualname);
32527 op->func_qualname = qualname;
32528 op->func_doc = NULL;
32529#if CYTHON_COMPILING_IN_LIMITED_API
32530 op->func_classobj = NULL;
32531#else
32532 ((PyCMethodObject*)op)->mm_class = NULL;
32533#endif
32534 op->func_globals = globals;
32535 Py_INCREF(op->func_globals);
32536 Py_XINCREF(code);
32537 op->func_code = code;
32538 op->defaults = NULL;
32539 op->defaults_tuple = NULL;
32540 op->defaults_kwdict = NULL;
32541 op->defaults_getter = NULL;
32542 op->func_annotations = NULL;
32543#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
32544 op->func_is_coroutine = NULL;
32545#endif
32546#if CYTHON_VECTORCALL
32547 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
32548 case METH_NOARGS:
32549 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
32550 break;
32551 case METH_O:
32552 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
32553 break;
32554 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
32555 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
32556 break;
32557 case METH_FASTCALL | METH_KEYWORDS:
32558 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
32559 break;
32560 case METH_VARARGS | METH_KEYWORDS:
32561 __Pyx_CyFunction_func_vectorcall(op) = NULL;
32562 break;
32563 default:
32564 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32565 Py_DECREF(op_in);
32566 return NULL;
32567 }
32568#endif
32569 return op_in;
32570}
32571static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
32572{
32573 Py_CLEAR(m->func_closure);
32574#if CYTHON_COMPILING_IN_LIMITED_API
32575 Py_CLEAR(m->func_module);
32576#else
32577 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
32578#endif
32579#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
32580 Py_CLEAR(m->func_dict);
32581#elif PY_VERSION_HEX < 0x030d0000
32582 _PyObject_ClearManagedDict((PyObject*)m);
32583#else
32584 PyObject_ClearManagedDict((PyObject*)m);
32585#endif
32586 Py_CLEAR(m->func_name);
32587 Py_CLEAR(m->func_qualname);
32588 Py_CLEAR(m->func_doc);
32589 Py_CLEAR(m->func_globals);
32590 Py_CLEAR(m->func_code);
32591#if CYTHON_COMPILING_IN_LIMITED_API
32592 Py_CLEAR(m->func_classobj);
32593#else
32594 {
32595 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
32596 ((PyCMethodObject *) (m))->mm_class = NULL;
32597 Py_XDECREF(cls);
32598 }
32599#endif
32600 Py_CLEAR(m->defaults_tuple);
32601 Py_CLEAR(m->defaults_kwdict);
32602 Py_CLEAR(m->func_annotations);
32603#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
32604 Py_CLEAR(m->func_is_coroutine);
32605#endif
32606 Py_CLEAR(m->defaults);
32607 return 0;
32608}
32609static int
32610__Pyx_CyFunction_clear(PyObject *m)
32611{
32612 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
32613}
32614static void __Pyx__CyFunction_dealloc(PyObject *m)
32615{
32616 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
32617 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
32618 PyObject_ClearWeakRefs(m);
32619 __Pyx__CyFunction_clear(cyfunc);
32620 __Pyx_PyHeapTypeObject_GC_Del(m);
32621}
32622static void __Pyx_CyFunction_dealloc(PyObject *m)
32623{
32624 PyObject_GC_UnTrack(m);
32625 __Pyx__CyFunction_dealloc(m);
32626}
32627static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
32628{
32629 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
32630 {
32631 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
32632 if (e) return e;
32633 }
32634 Py_VISIT(m->func_closure);
32635#if CYTHON_COMPILING_IN_LIMITED_API
32636 Py_VISIT(m->func_module);
32637#else
32638 Py_VISIT(((PyCFunctionObject*)m)->m_module);
32639#endif
32640#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
32641 Py_VISIT(m->func_dict);
32642#else
32643 {
32644 int e =
32645#if PY_VERSION_HEX < 0x030d0000
32646 _PyObject_VisitManagedDict
32647#else
32648 PyObject_VisitManagedDict
32649#endif
32650 ((PyObject*)m, visit, arg);
32651 if (e != 0) return e;
32652 }
32653#endif
32654 __Pyx_VISIT_CONST(m->func_name);
32655 __Pyx_VISIT_CONST(m->func_qualname);
32656 Py_VISIT(m->func_doc);
32657 Py_VISIT(m->func_globals);
32658 __Pyx_VISIT_CONST(m->func_code);
32659 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
32660 Py_VISIT(m->defaults_tuple);
32661 Py_VISIT(m->defaults_kwdict);
32662 Py_VISIT(m->func_annotations);
32663#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
32664 Py_VISIT(m->func_is_coroutine);
32665#endif
32666 Py_VISIT(m->defaults);
32667 return 0;
32668}
32669static PyObject*
32670__Pyx_CyFunction_repr(PyObject *op_in)
32671{
32672 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
32673 PyObject *repr;
32674 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
32675 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
32676 op->func_qualname, (void *)op);
32677 __Pyx_END_CRITICAL_SECTION();
32678 return repr;
32679}
32680static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
32681#if CYTHON_COMPILING_IN_LIMITED_API
32682 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
32683 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
32684 int flags = cyfunc->func_methoddef->ml_flags;
32685#else
32686 PyCFunctionObject* f = (PyCFunctionObject*)func;
32687 PyCFunction meth = f->m_ml->ml_meth;
32688 int flags = f->m_ml->ml_flags;
32689#endif
32690 Py_ssize_t size;
32691 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
32692 case METH_VARARGS:
32693 if (likely(kw == NULL || PyDict_Size(kw) == 0))
32694 return (*meth)(self, arg);
32695 break;
32696 case METH_VARARGS | METH_KEYWORDS:
32697 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
32698 case METH_NOARGS:
32699 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32700#if CYTHON_ASSUME_SAFE_SIZE
32701 size = PyTuple_GET_SIZE(arg);
32702#else
32703 size = PyTuple_Size(arg);
32704 if (unlikely(size < 0)) return NULL;
32705#endif
32706 if (likely(size == 0))
32707 return (*meth)(self, NULL);
32708 __Pyx_CyFunction_raise_argument_count_error(
32709 func,
32710 "takes no arguments", size);
32711 return NULL;
32712 }
32713 break;
32714 case METH_O:
32715 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32716#if CYTHON_ASSUME_SAFE_SIZE
32717 size = PyTuple_GET_SIZE(arg);
32718#else
32719 size = PyTuple_Size(arg);
32720 if (unlikely(size < 0)) return NULL;
32721#endif
32722 if (likely(size == 1)) {
32723 PyObject *result, *arg0;
32724 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32725 arg0 = PyTuple_GET_ITEM(arg, 0);
32726 #else
32727 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
32728 #endif
32729 result = (*meth)(self, arg0);
32730 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32731 Py_DECREF(arg0);
32732 #endif
32733 return result;
32734 }
32735 __Pyx_CyFunction_raise_argument_count_error(
32736 func,
32737 "takes exactly one argument", size);
32738 return NULL;
32739 }
32740 break;
32741 default:
32742 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32743 return NULL;
32744 }
32745 __Pyx_CyFunction_raise_type_error(
32746 func, "takes no keyword arguments");
32747 return NULL;
32748}
32749static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
32750 PyObject *result;
32751 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
32752 return result;
32753}
32754static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
32755 PyObject *result;
32756 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
32757#if CYTHON_VECTORCALL
32758 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
32759 if (vc) {
32760#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32761 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
32762#else
32763 (void) &__Pyx_PyVectorcall_FastCallDict;
32764 return PyVectorcall_Call(func, args, kw);
32765#endif
32766 }
32767#endif
32768 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32769 Py_ssize_t argc;
32770 PyObject *new_args;
32771 PyObject *self;
32772#if CYTHON_ASSUME_SAFE_SIZE
32773 argc = PyTuple_GET_SIZE(args);
32774#else
32775 argc = PyTuple_Size(args);
32776 if (unlikely(argc < 0)) return NULL;
32777#endif
32778 new_args = PyTuple_GetSlice(args, 1, argc);
32779 if (unlikely(!new_args))
32780 return NULL;
32781 self = PyTuple_GetItem(args, 0);
32782 if (unlikely(!self)) {
32783 Py_DECREF(new_args);
32784 PyErr_Format(PyExc_TypeError,
32785 "unbound method %.200S() needs an argument",
32786 cyfunc->func_qualname);
32787 return NULL;
32788 }
32789 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
32790 Py_DECREF(new_args);
32791 } else {
32792 result = __Pyx_CyFunction_Call(func, args, kw);
32793 }
32794 return result;
32795}
32796#if CYTHON_VECTORCALL
32797static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
32798{
32799 int ret = 0;
32800 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32801 if (unlikely(nargs < 1)) {
32802 __Pyx_CyFunction_raise_type_error(
32803 func, "needs an argument");
32804 return -1;
32805 }
32806 ret = 1;
32807 }
32808 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
32809 __Pyx_CyFunction_raise_type_error(
32810 func, "takes no keyword arguments");
32811 return -1;
32812 }
32813 return ret;
32814}
32815static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32816{
32817 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
32818 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32819 PyObject *self;
32820#if CYTHON_COMPILING_IN_LIMITED_API
32821 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
32822 if (unlikely(!meth)) return NULL;
32823#else
32824 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
32825#endif
32826 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
32827 case 1:
32828 self = args[0];
32829 args += 1;
32830 nargs -= 1;
32831 break;
32832 case 0:
32833 self = func;
32834 break;
32835 default:
32836 return NULL;
32837 }
32838 if (unlikely(nargs != 0)) {
32839 __Pyx_CyFunction_raise_argument_count_error(
32840 func, "takes no arguments", nargs);
32841 return NULL;
32842 }
32843 return meth(self, NULL);
32844}
32845static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32846{
32847 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
32848 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32849 PyObject *self;
32850#if CYTHON_COMPILING_IN_LIMITED_API
32851 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
32852 if (unlikely(!meth)) return NULL;
32853#else
32854 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
32855#endif
32856 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
32857 case 1:
32858 self = args[0];
32859 args += 1;
32860 nargs -= 1;
32861 break;
32862 case 0:
32863 self = func;
32864 break;
32865 default:
32866 return NULL;
32867 }
32868 if (unlikely(nargs != 1)) {
32869 __Pyx_CyFunction_raise_argument_count_error(
32870 func, "takes exactly one argument", nargs);
32871 return NULL;
32872 }
32873 return meth(self, args[0]);
32874}
32875static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32876{
32877 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
32878 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32879 PyObject *self;
32880#if CYTHON_COMPILING_IN_LIMITED_API
32881 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
32882 if (unlikely(!meth)) return NULL;
32883#else
32884 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
32885#endif
32886 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
32887 case 1:
32888 self = args[0];
32889 args += 1;
32890 nargs -= 1;
32891 break;
32892 case 0:
32893 self = func;
32894 break;
32895 default:
32896 return NULL;
32897 }
32898 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
32899}
32900static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32901{
32902 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
32903 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
32904 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32905 PyObject *self;
32906#if CYTHON_COMPILING_IN_LIMITED_API
32907 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
32908 if (unlikely(!meth)) return NULL;
32909#else
32910 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
32911#endif
32912 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
32913 case 1:
32914 self = args[0];
32915 args += 1;
32916 nargs -= 1;
32917 break;
32918 case 0:
32919 self = func;
32920 break;
32921 default:
32922 return NULL;
32923 }
32924 #if PY_VERSION_HEX < 0x030e00A6
32925 size_t nargs_value = (size_t) nargs;
32926 #else
32927 Py_ssize_t nargs_value = nargs;
32928 #endif
32929 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
32930}
32931#endif
32932static PyType_Slot __pyx_CyFunctionType_slots[] = {
32933 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
32934 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
32935 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
32936 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
32937 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
32938 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
32939 {Py_tp_members, (void *)__pyx_CyFunction_members},
32940 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
32941 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
32942 {0, 0},
32943};
32944static PyType_Spec __pyx_CyFunctionType_spec = {
32945 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
32946 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
32947 0,
32948#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
32949 Py_TPFLAGS_METHOD_DESCRIPTOR |
32950#endif
32951#if CYTHON_VECTORCALL
32952#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
32953 Py_TPFLAGS_HAVE_VECTORCALL |
32954#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
32955 _Py_TPFLAGS_HAVE_VECTORCALL |
32956#endif
32957#endif // CYTHON_VECTORCALL
32958#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
32959 Py_TPFLAGS_MANAGED_DICT |
32960#endif
32961 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
32962 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32963 __pyx_CyFunctionType_slots
32964};
32965static int __pyx_CyFunction_init(PyObject *module) {
32966 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
32967 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
32968 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
32969 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
32970 return -1;
32971 }
32972 return 0;
32973}
32974
32975/* CythonFunction */
32976static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
32977 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32978 (void)&__Pyx_Get_CyFunction_Type;
32979 PyObject *op = __Pyx_CyFunction_Init(
32980 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
32981 ml, flags, qualname, closure, module, globals, code
32982 );
32983 if (likely(op)) {
32984 PyObject_GC_Track(op);
32985 }
32986 return op;
32987}
32988static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
32989 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
32990 Py_INCREF((PyObject*)tp);
32991 return tp;
32992}
32993
32994/* CLineInTraceback (used by AddTraceback) */
32995#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
32996#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
32997#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
32998#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
32999#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
33000#else
33001PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
33002 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
33003 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
33004}
33005#endif
33006static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
33007 PyObject *use_cline = NULL;
33008 PyObject *ptype, *pvalue, *ptraceback;
33009 PyObject *cython_runtime_dict;
33010 CYTHON_MAYBE_UNUSED_VAR(tstate);
33011 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
33012 return c_line;
33013 }
33014 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33015 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
33016 if (likely(cython_runtime_dict)) {
33017 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
33018 use_cline, cython_runtime_dict,
33019 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
33020 }
33021 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
33022 c_line = 0;
33023 }
33024 Py_XDECREF(use_cline);
33025 Py_XDECREF(cython_runtime_dict);
33026 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33027 return c_line;
33028}
33029#endif
33030
33031/* CodeObjectCache (used by AddTraceback) */
33032static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
33033 int start = 0, mid = 0, end = count - 1;
33034 if (end >= 0 && code_line > entries[end].code_line) {
33035 return count;
33036 }
33037 while (start < end) {
33038 mid = start + (end - start) / 2;
33039 if (code_line < entries[mid].code_line) {
33040 end = mid;
33041 } else if (code_line > entries[mid].code_line) {
33042 start = mid + 1;
33043 } else {
33044 return mid;
33045 }
33046 }
33047 if (code_line <= entries[mid].code_line) {
33048 return mid;
33049 } else {
33050 return mid + 1;
33051 }
33052}
33053static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
33054 __Pyx_CachedCodeObjectType* code_object;
33055 int pos;
33056 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
33057 return NULL;
33058 }
33059 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
33060 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
33061 return NULL;
33062 }
33063 code_object = code_cache->entries[pos].code_object;
33064 Py_INCREF(code_object);
33065 return code_object;
33066}
33067static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
33068#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
33069 (void)__pyx__find_code_object;
33070 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
33071#else
33072 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
33073#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
33074 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
33075 if (old_count < 0) {
33076 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
33077 return NULL;
33078 }
33079#endif
33080 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
33081#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
33082 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
33083#endif
33084 return result;
33085#endif
33086}
33087static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
33088{
33089 int pos, i;
33090 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
33091 if (unlikely(!code_line)) {
33092 return;
33093 }
33094 if (unlikely(!entries)) {
33095 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
33096 if (likely(entries)) {
33097 code_cache->entries = entries;
33098 code_cache->max_count = 64;
33099 code_cache->count = 1;
33100 entries[0].code_line = code_line;
33101 entries[0].code_object = code_object;
33102 Py_INCREF(code_object);
33103 }
33104 return;
33105 }
33106 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
33107 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
33108 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
33109 entries[pos].code_object = code_object;
33110 Py_INCREF(code_object);
33111 Py_DECREF(tmp);
33112 return;
33113 }
33114 if (code_cache->count == code_cache->max_count) {
33115 int new_max = code_cache->max_count + 64;
33116 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
33117 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
33118 if (unlikely(!entries)) {
33119 return;
33120 }
33121 code_cache->entries = entries;
33122 code_cache->max_count = new_max;
33123 }
33124 for (i=code_cache->count; i>pos; i--) {
33125 entries[i] = entries[i-1];
33126 }
33127 entries[pos].code_line = code_line;
33128 entries[pos].code_object = code_object;
33129 code_cache->count++;
33130 Py_INCREF(code_object);
33131}
33132static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
33133#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
33134 (void)__pyx__insert_code_object;
33135 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
33136#else
33137 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
33138#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
33139 __pyx_nonatomic_int_type expected = 0;
33140 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
33141 return;
33142 }
33143#endif
33144 __pyx__insert_code_object(code_cache, code_line, code_object);
33145#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
33146 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
33147#endif
33148#endif
33149}
33150
33151/* AddTraceback */
33152#include "compile.h"
33153#include "frameobject.h"
33154#include "traceback.h"
33155#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
33156 #ifndef Py_BUILD_CORE
33157 #define Py_BUILD_CORE 1
33158 #endif
33159 #include "internal/pycore_frame.h"
33160#endif
33161#if CYTHON_COMPILING_IN_LIMITED_API
33162static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
33163 PyObject *firstlineno, PyObject *name) {
33164 PyObject *replace = NULL;
33165 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
33166 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
33167 replace = PyObject_GetAttrString(code, "replace");
33168 if (likely(replace)) {
33169 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
33170 Py_DECREF(replace);
33171 return result;
33172 }
33173 return NULL;
33174}
33175static void __Pyx_AddTraceback(const char *funcname, int c_line,
33176 int py_line, const char *filename) {
33177 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
33178 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
33179 PyObject *exc_type, *exc_value, *exc_traceback;
33180 int success = 0;
33181 if (c_line) {
33182 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
33183 }
33184 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
33185 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
33186 if (!code_object) {
33187 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
33188 if (unlikely(!code_object)) goto bad;
33189 py_py_line = PyLong_FromLong(py_line);
33190 if (unlikely(!py_py_line)) goto bad;
33191 if (c_line) {
33192 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33193 } else {
33194 py_funcname = PyUnicode_FromString(funcname);
33195 }
33196 if (unlikely(!py_funcname)) goto bad;
33197 dict = PyDict_New();
33198 if (unlikely(!dict)) goto bad;
33199 {
33200 PyObject *old_code_object = code_object;
33201 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
33202 Py_DECREF(old_code_object);
33203 }
33204 if (unlikely(!code_object)) goto bad;
33205 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
33206 } else {
33207 dict = PyDict_New();
33208 }
33209 getframe = PySys_GetObject("_getframe");
33210 if (unlikely(!getframe)) goto bad;
33211 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
33212 frame = PyEval_EvalCode(code_object, dict, dict);
33213 if (unlikely(!frame) || frame == Py_None) goto bad;
33214 success = 1;
33215 bad:
33216 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
33217 Py_XDECREF(code_object);
33218 Py_XDECREF(py_py_line);
33219 Py_XDECREF(py_funcname);
33220 Py_XDECREF(dict);
33221 Py_XDECREF(replace);
33222 if (success) {
33223 PyTraceBack_Here(
33224 (struct _frame*)frame);
33225 }
33226 Py_XDECREF(frame);
33227}
33228#else
33229static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
33230 const char *funcname, int c_line,
33231 int py_line, const char *filename) {
33232 PyCodeObject *py_code = NULL;
33233 PyObject *py_funcname = NULL;
33234 if (c_line) {
33235 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33236 if (!py_funcname) goto bad;
33237 funcname = PyUnicode_AsUTF8(py_funcname);
33238 if (!funcname) goto bad;
33239 }
33240 py_code = PyCode_NewEmpty(filename, funcname, py_line);
33241 Py_XDECREF(py_funcname);
33242 return py_code;
33243bad:
33244 Py_XDECREF(py_funcname);
33245 return NULL;
33246}
33247static void __Pyx_AddTraceback(const char *funcname, int c_line,
33248 int py_line, const char *filename) {
33249 PyCodeObject *py_code = 0;
33250 PyFrameObject *py_frame = 0;
33251 PyThreadState *tstate = __Pyx_PyThreadState_Current;
33252 PyObject *ptype, *pvalue, *ptraceback;
33253 if (c_line) {
33254 c_line = __Pyx_CLineForTraceback(tstate, c_line);
33255 }
33256 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
33257 if (!py_code) {
33258 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33259 py_code = __Pyx_CreateCodeObjectForTraceback(
33260 funcname, c_line, py_line, filename);
33261 if (!py_code) {
33262 /* If the code object creation fails, then we should clear the
33263 fetched exception references and propagate the new exception */
33264 Py_XDECREF(ptype);
33265 Py_XDECREF(pvalue);
33266 Py_XDECREF(ptraceback);
33267 goto bad;
33268 }
33269 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33270 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
33271 }
33272 py_frame = PyFrame_New(
33273 tstate, /*PyThreadState *tstate,*/
33274 py_code, /*PyCodeObject *code,*/
33275 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
33276 0 /*PyObject *locals*/
33277 );
33278 if (!py_frame) goto bad;
33279 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
33280 PyTraceBack_Here(py_frame);
33281bad:
33282 Py_XDECREF(py_code);
33283 Py_XDECREF(py_frame);
33284}
33285#endif
33286
33287/* CIntFromPyVerify */
33288#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
33289 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
33290#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
33291 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
33292#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
33293 {\
33294 func_type value = func_value;\
33295 if (sizeof(target_type) < sizeof(func_type)) {\
33296 if (unlikely(value != (func_type) (target_type) value)) {\
33297 func_type zero = 0;\
33298 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
33299 return (target_type) -1;\
33300 if (is_unsigned && unlikely(value < zero))\
33301 goto raise_neg_overflow;\
33302 else\
33303 goto raise_overflow;\
33304 }\
33305 }\
33306 return (target_type) value;\
33307 }
33308
33309/* Declarations */
33310#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33311 #ifdef __cplusplus
33312 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33313 return ::std::complex< float >(x, y);
33314 }
33315 #else
33316 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33317 return x + y*(__pyx_t_float_complex)_Complex_I;
33318 }
33319 #endif
33320#else
33321 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
33322 __pyx_t_float_complex z;
33323 z.real = x;
33324 z.imag = y;
33325 return z;
33326 }
33327#endif
33328
33329/* Arithmetic */
33330#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33331#else
33332 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33333 return (a.real == b.real) && (a.imag == b.imag);
33334 }
33335 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33336 __pyx_t_float_complex z;
33337 z.real = a.real + b.real;
33338 z.imag = a.imag + b.imag;
33339 return z;
33340 }
33341 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33342 __pyx_t_float_complex z;
33343 z.real = a.real - b.real;
33344 z.imag = a.imag - b.imag;
33345 return z;
33346 }
33347 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33348 __pyx_t_float_complex z;
33349 z.real = a.real * b.real - a.imag * b.imag;
33350 z.imag = a.real * b.imag + a.imag * b.real;
33351 return z;
33352 }
33353 #if 1
33354 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33355 if (b.imag == 0) {
33356 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
33357 } else if (fabsf(b.real) >= fabsf(b.imag)) {
33358 if (b.real == 0 && b.imag == 0) {
33359 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
33360 } else {
33361 float r = b.imag / b.real;
33362 float s = (float)(1.0) / (b.real + b.imag * r);
33363 return __pyx_t_float_complex_from_parts(
33364 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
33365 }
33366 } else {
33367 float r = b.real / b.imag;
33368 float s = (float)(1.0) / (b.imag + b.real * r);
33369 return __pyx_t_float_complex_from_parts(
33370 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
33371 }
33372 }
33373 #else
33374 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33375 if (b.imag == 0) {
33376 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
33377 } else {
33378 float denom = b.real * b.real + b.imag * b.imag;
33379 return __pyx_t_float_complex_from_parts(
33380 (a.real * b.real + a.imag * b.imag) / denom,
33381 (a.imag * b.real - a.real * b.imag) / denom);
33382 }
33383 }
33384 #endif
33385 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
33386 __pyx_t_float_complex z;
33387 z.real = -a.real;
33388 z.imag = -a.imag;
33389 return z;
33390 }
33391 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
33392 return (a.real == 0) && (a.imag == 0);
33393 }
33394 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
33395 __pyx_t_float_complex z;
33396 z.real = a.real;
33397 z.imag = -a.imag;
33398 return z;
33399 }
33400 #if 1
33401 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
33402 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
33403 return sqrtf(z.real*z.real + z.imag*z.imag);
33404 #else
33405 return hypotf(z.real, z.imag);
33406 #endif
33407 }
33408 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
33409 __pyx_t_float_complex z;
33410 float r, lnr, theta, z_r, z_theta;
33411 if (b.imag == 0 && b.real == (int)b.real) {
33412 if (b.real < 0) {
33413 float denom = a.real * a.real + a.imag * a.imag;
33414 a.real = a.real / denom;
33415 a.imag = -a.imag / denom;
33416 b.real = -b.real;
33417 }
33418 switch ((int)b.real) {
33419 case 0:
33420 z.real = 1;
33421 z.imag = 0;
33422 return z;
33423 case 1:
33424 return a;
33425 case 2:
33426 return __Pyx_c_prod_float(a, a);
33427 case 3:
33428 z = __Pyx_c_prod_float(a, a);
33429 return __Pyx_c_prod_float(z, a);
33430 case 4:
33431 z = __Pyx_c_prod_float(a, a);
33432 return __Pyx_c_prod_float(z, z);
33433 }
33434 }
33435 if (a.imag == 0) {
33436 if (a.real == 0) {
33437 return a;
33438 } else if ((b.imag == 0) && (a.real >= 0)) {
33439 z.real = powf(a.real, b.real);
33440 z.imag = 0;
33441 return z;
33442 } else if (a.real > 0) {
33443 r = a.real;
33444 theta = 0;
33445 } else {
33446 r = -a.real;
33447 theta = atan2f(0.0, -1.0);
33448 }
33449 } else {
33450 r = __Pyx_c_abs_float(a);
33451 theta = atan2f(a.imag, a.real);
33452 }
33453 lnr = logf(r);
33454 z_r = expf(lnr * b.real - theta * b.imag);
33455 z_theta = theta * b.real + lnr * b.imag;
33456 z.real = z_r * cosf(z_theta);
33457 z.imag = z_r * sinf(z_theta);
33458 return z;
33459 }
33460 #endif
33461#endif
33462
33463/* Declarations */
33464#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33465 #ifdef __cplusplus
33466 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
33467 return ::std::complex< double >(x, y);
33468 }
33469 #else
33470 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
33471 return x + y*(__pyx_t_double_complex)_Complex_I;
33472 }
33473 #endif
33474#else
33475 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
33476 __pyx_t_double_complex z;
33477 z.real = x;
33478 z.imag = y;
33479 return z;
33480 }
33481#endif
33482
33483/* Arithmetic */
33484#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33485#else
33486 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33487 return (a.real == b.real) && (a.imag == b.imag);
33488 }
33489 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33490 __pyx_t_double_complex z;
33491 z.real = a.real + b.real;
33492 z.imag = a.imag + b.imag;
33493 return z;
33494 }
33495 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33496 __pyx_t_double_complex z;
33497 z.real = a.real - b.real;
33498 z.imag = a.imag - b.imag;
33499 return z;
33500 }
33501 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33502 __pyx_t_double_complex z;
33503 z.real = a.real * b.real - a.imag * b.imag;
33504 z.imag = a.real * b.imag + a.imag * b.real;
33505 return z;
33506 }
33507 #if 1
33508 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33509 if (b.imag == 0) {
33510 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
33511 } else if (fabs(b.real) >= fabs(b.imag)) {
33512 if (b.real == 0 && b.imag == 0) {
33513 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
33514 } else {
33515 double r = b.imag / b.real;
33516 double s = (double)(1.0) / (b.real + b.imag * r);
33517 return __pyx_t_double_complex_from_parts(
33518 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
33519 }
33520 } else {
33521 double r = b.real / b.imag;
33522 double s = (double)(1.0) / (b.imag + b.real * r);
33523 return __pyx_t_double_complex_from_parts(
33524 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
33525 }
33526 }
33527 #else
33528 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33529 if (b.imag == 0) {
33530 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
33531 } else {
33532 double denom = b.real * b.real + b.imag * b.imag;
33533 return __pyx_t_double_complex_from_parts(
33534 (a.real * b.real + a.imag * b.imag) / denom,
33535 (a.imag * b.real - a.real * b.imag) / denom);
33536 }
33537 }
33538 #endif
33539 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
33540 __pyx_t_double_complex z;
33541 z.real = -a.real;
33542 z.imag = -a.imag;
33543 return z;
33544 }
33545 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
33546 return (a.real == 0) && (a.imag == 0);
33547 }
33548 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
33549 __pyx_t_double_complex z;
33550 z.real = a.real;
33551 z.imag = -a.imag;
33552 return z;
33553 }
33554 #if 1
33555 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
33556 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
33557 return sqrt(z.real*z.real + z.imag*z.imag);
33558 #else
33559 return hypot(z.real, z.imag);
33560 #endif
33561 }
33562 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
33563 __pyx_t_double_complex z;
33564 double r, lnr, theta, z_r, z_theta;
33565 if (b.imag == 0 && b.real == (int)b.real) {
33566 if (b.real < 0) {
33567 double denom = a.real * a.real + a.imag * a.imag;
33568 a.real = a.real / denom;
33569 a.imag = -a.imag / denom;
33570 b.real = -b.real;
33571 }
33572 switch ((int)b.real) {
33573 case 0:
33574 z.real = 1;
33575 z.imag = 0;
33576 return z;
33577 case 1:
33578 return a;
33579 case 2:
33580 return __Pyx_c_prod_double(a, a);
33581 case 3:
33582 z = __Pyx_c_prod_double(a, a);
33583 return __Pyx_c_prod_double(z, a);
33584 case 4:
33585 z = __Pyx_c_prod_double(a, a);
33586 return __Pyx_c_prod_double(z, z);
33587 }
33588 }
33589 if (a.imag == 0) {
33590 if (a.real == 0) {
33591 return a;
33592 } else if ((b.imag == 0) && (a.real >= 0)) {
33593 z.real = pow(a.real, b.real);
33594 z.imag = 0;
33595 return z;
33596 } else if (a.real > 0) {
33597 r = a.real;
33598 theta = 0;
33599 } else {
33600 r = -a.real;
33601 theta = atan2(0.0, -1.0);
33602 }
33603 } else {
33604 r = __Pyx_c_abs_double(a);
33605 theta = atan2(a.imag, a.real);
33606 }
33607 lnr = log(r);
33608 z_r = exp(lnr * b.real - theta * b.imag);
33609 z_theta = theta * b.real + lnr * b.imag;
33610 z.real = z_r * cos(z_theta);
33611 z.imag = z_r * sin(z_theta);
33612 return z;
33613 }
33614 #endif
33615#endif
33616
33617/* Declarations */
33618#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33619 #ifdef __cplusplus
33620 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
33621 return ::std::complex< long double >(x, y);
33622 }
33623 #else
33624 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
33625 return x + y*(__pyx_t_long_double_complex)_Complex_I;
33626 }
33627 #endif
33628#else
33629 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
33630 __pyx_t_long_double_complex z;
33631 z.real = x;
33632 z.imag = y;
33633 return z;
33634 }
33635#endif
33636
33637/* Arithmetic */
33638#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
33639#else
33640 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
33641 return (a.real == b.real) && (a.imag == b.imag);
33642 }
33643 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
33644 __pyx_t_long_double_complex z;
33645 z.real = a.real + b.real;
33646 z.imag = a.imag + b.imag;
33647 return z;
33648 }
33649 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
33650 __pyx_t_long_double_complex z;
33651 z.real = a.real - b.real;
33652 z.imag = a.imag - b.imag;
33653 return z;
33654 }
33655 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
33656 __pyx_t_long_double_complex z;
33657 z.real = a.real * b.real - a.imag * b.imag;
33658 z.imag = a.real * b.imag + a.imag * b.real;
33659 return z;
33660 }
33661 #if 1
33662 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
33663 if (b.imag == 0) {
33664 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
33665 } else if (fabsl(b.real) >= fabsl(b.imag)) {
33666 if (b.real == 0 && b.imag == 0) {
33667 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
33668 } else {
33669 long double r = b.imag / b.real;
33670 long double s = (long double)(1.0) / (b.real + b.imag * r);
33671 return __pyx_t_long_double_complex_from_parts(
33672 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
33673 }
33674 } else {
33675 long double r = b.real / b.imag;
33676 long double s = (long double)(1.0) / (b.imag + b.real * r);
33677 return __pyx_t_long_double_complex_from_parts(
33678 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
33679 }
33680 }
33681 #else
33682 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
33683 if (b.imag == 0) {
33684 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
33685 } else {
33686 long double denom = b.real * b.real + b.imag * b.imag;
33687 return __pyx_t_long_double_complex_from_parts(
33688 (a.real * b.real + a.imag * b.imag) / denom,
33689 (a.imag * b.real - a.real * b.imag) / denom);
33690 }
33691 }
33692 #endif
33693 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
33694 __pyx_t_long_double_complex z;
33695 z.real = -a.real;
33696 z.imag = -a.imag;
33697 return z;
33698 }
33699 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
33700 return (a.real == 0) && (a.imag == 0);
33701 }
33702 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
33703 __pyx_t_long_double_complex z;
33704 z.real = a.real;
33705 z.imag = -a.imag;
33706 return z;
33707 }
33708 #if 1
33709 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
33710 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
33711 return sqrtl(z.real*z.real + z.imag*z.imag);
33712 #else
33713 return hypotl(z.real, z.imag);
33714 #endif
33715 }
33716 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
33717 __pyx_t_long_double_complex z;
33718 long double r, lnr, theta, z_r, z_theta;
33719 if (b.imag == 0 && b.real == (int)b.real) {
33720 if (b.real < 0) {
33721 long double denom = a.real * a.real + a.imag * a.imag;
33722 a.real = a.real / denom;
33723 a.imag = -a.imag / denom;
33724 b.real = -b.real;
33725 }
33726 switch ((int)b.real) {
33727 case 0:
33728 z.real = 1;
33729 z.imag = 0;
33730 return z;
33731 case 1:
33732 return a;
33733 case 2:
33734 return __Pyx_c_prod_long__double(a, a);
33735 case 3:
33736 z = __Pyx_c_prod_long__double(a, a);
33737 return __Pyx_c_prod_long__double(z, a);
33738 case 4:
33739 z = __Pyx_c_prod_long__double(a, a);
33740 return __Pyx_c_prod_long__double(z, z);
33741 }
33742 }
33743 if (a.imag == 0) {
33744 if (a.real == 0) {
33745 return a;
33746 } else if ((b.imag == 0) && (a.real >= 0)) {
33747 z.real = powl(a.real, b.real);
33748 z.imag = 0;
33749 return z;
33750 } else if (a.real > 0) {
33751 r = a.real;
33752 theta = 0;
33753 } else {
33754 r = -a.real;
33755 theta = atan2l(0.0, -1.0);
33756 }
33757 } else {
33758 r = __Pyx_c_abs_long__double(a);
33759 theta = atan2l(a.imag, a.real);
33760 }
33761 lnr = logl(r);
33762 z_r = expl(lnr * b.real - theta * b.imag);
33763 z_theta = theta * b.real + lnr * b.imag;
33764 z.real = z_r * cosl(z_theta);
33765 z.imag = z_r * sinl(z_theta);
33766 return z;
33767 }
33768 #endif
33769#endif
33770
33771/* CIntFromPy */
33772static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
33773static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
33774 const char* type_name = "int";
33775 PyErr_Format(PyExc_OverflowError,
33776 "can't convert negative value to %.200s", type_name);
33777 return (int) -1;
33778}
33779static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
33780 const char* type_name = "int";
33781 PyErr_Format(PyExc_OverflowError,
33782 "value too large to convert to %.200s", type_name);
33783 return (int) -1;
33784}
33785static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
33786 const int is_unsigned = 1;
33787#if CYTHON_USE_PYLONG_INTERNALS
33788 {
33789 const digit* digits = __Pyx_PyLong_Digits(x);
33790 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33791 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
33792 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33793 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33794 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
33795 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33796 }
33797 } else
33798 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
33799 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33800 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33801 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
33802 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33803 }
33804 } else
33805 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
33806 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33807 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33808 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
33809 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33810 }
33811 } else
33812 {}
33813 }
33814#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33815 if (unlikely(Py_SIZE(x) < 0)) {
33816 goto raise_neg_overflow;
33817 }
33818#else
33819 {
33820 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33821 if (unlikely(result < 0))
33822 return (int) -1;
33823 if (unlikely(result == 1))
33824 goto raise_neg_overflow;
33825 }
33826#endif
33827 if ((sizeof(int) <= sizeof(unsigned long))) {
33828 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
33829 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
33830 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33831 }
33832 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
33833raise_neg_overflow:
33834 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
33835raise_overflow:
33836 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
33837}
33838static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
33839 const int is_unsigned = 0;
33840#if CYTHON_USE_PYLONG_INTERNALS
33841 if (__Pyx_PyLong_IsNeg(x)) {
33842 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33843 const digit* digits = __Pyx_PyLong_Digits(x);
33844 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
33845 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33846 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33847 __PYX_VERIFY_RETURN_INT(int, long, ival)
33848 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
33849 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33850 }
33851 } else
33852 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
33853 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33854 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33855 __PYX_VERIFY_RETURN_INT(int, long, ival)
33856 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
33857 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33858 }
33859 } else
33860 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
33861 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
33862 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33863 __PYX_VERIFY_RETURN_INT(int, long, ival)
33864 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
33865 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33866 }
33867 } else
33868 {}
33869 } else {
33870 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33871 const digit* digits = __Pyx_PyLong_Digits(x);
33872 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
33873 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33874 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33875 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
33876 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33877 }
33878 } else
33879 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
33880 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33881 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33882 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
33883 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33884 }
33885 } else
33886 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
33887 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
33888 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33889 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
33890 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33891 }
33892 } else
33893 {}
33894 }
33895#endif
33896 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
33897 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
33898 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
33899 } else
33900 #endif
33901 if ((sizeof(int) <= sizeof(long))) {
33902 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
33903 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
33904 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
33905 }
33906 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
33907raise_neg_overflow:
33908 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
33909raise_overflow:
33910 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
33911}
33912static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
33913#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33914#pragma GCC diagnostic push
33915#pragma GCC diagnostic ignored "-Wconversion"
33916#endif
33917 const int neg_one = (int) -1, const_zero = (int) 0;
33918#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33919#pragma GCC diagnostic pop
33920#endif
33921 const int is_unsigned = neg_one > const_zero;
33922 int val;
33923 int ret = -1;
33924#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33925 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33926 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33927 if (unlikely(bytes_copied == -1)) {
33928 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
33929 goto raise_overflow;
33930 } else {
33931 ret = 0;
33932 }
33933#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33934 int one = 1; int is_little = (int)*(unsigned char *)&one;
33935 unsigned char *bytes = (unsigned char *)&val;
33936 ret = _PyLong_AsByteArray((PyLongObject *)x,
33937 bytes, sizeof(val),
33938 is_little, !is_unsigned);
33939 if ((0)) goto raise_overflow;
33940#else
33941 PyObject *v;
33942 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33943 int bits, remaining_bits, is_negative = 0;
33944 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
33945 if (likely(PyLong_CheckExact(x))) {
33946 v = __Pyx_NewRef(x);
33947 } else {
33948 v = PyNumber_Long(x);
33949 if (unlikely(!v)) return (int) -1;
33950 assert(PyLong_CheckExact(v));
33951 }
33952 {
33953 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
33954 if (unlikely(result < 0)) {
33955 Py_DECREF(v);
33956 return (int) -1;
33957 }
33958 is_negative = result == 1;
33959 }
33960 if (is_unsigned && unlikely(is_negative)) {
33961 Py_DECREF(v);
33962 PyErr_SetString(PyExc_OverflowError,
33963 "can't convert negative value to int");
33964 return (int) -1;
33965 } else if (is_negative) {
33966 stepval = PyNumber_Invert(v);
33967 Py_DECREF(v);
33968 if (unlikely(!stepval))
33969 return (int) -1;
33970 } else {
33971 stepval = v;
33972 }
33973 v = NULL;
33974 val = (int) 0;
33975 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
33976 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
33977 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
33978 PyObject *tmp, *digit;
33979 long idigit;
33980 digit = PyNumber_And(stepval, mask);
33981 if (unlikely(!digit)) goto done;
33982 idigit = PyLong_AsLong(digit);
33983 Py_DECREF(digit);
33984 if (unlikely(idigit < 0)) goto done;
33985 val |= ((int) idigit) << bits;
33986 tmp = PyNumber_Rshift(stepval, shift);
33987 if (unlikely(!tmp)) goto done;
33988 Py_DECREF(stepval); stepval = tmp;
33989 }
33990 Py_DECREF(shift); shift = NULL;
33991 Py_DECREF(mask); mask = NULL;
33992 {
33993 long idigit = PyLong_AsLong(stepval);
33994 if (unlikely(idigit < 0)) goto done;
33995 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
33996 if (unlikely(idigit >= (1L << remaining_bits)))
33997 goto raise_overflow;
33998 val |= ((int) idigit) << bits;
33999 }
34000 if (!is_unsigned) {
34001 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
34002 goto raise_overflow;
34003 if (is_negative)
34004 val = ~val;
34005 }
34006 ret = 0;
34007done:
34008 Py_XDECREF(shift);
34009 Py_XDECREF(mask);
34010 Py_XDECREF(stepval);
34011#endif
34012 if (unlikely(ret))
34013 return (int) -1;
34014 return val;
34015raise_overflow:
34016 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
34017}
34018static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
34019#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34020#pragma GCC diagnostic push
34021#pragma GCC diagnostic ignored "-Wconversion"
34022#endif
34023 const int neg_one = (int) -1, const_zero = (int) 0;
34024#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34025#pragma GCC diagnostic pop
34026#endif
34027 const int is_unsigned = neg_one > const_zero;
34028 if (is_unsigned) {
34029 #if CYTHON_USE_PYLONG_INTERNALS
34030 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
34031 goto raise_neg_overflow;
34032 } else if (__Pyx_PyLong_IsCompact(x)) {
34033 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
34034 } else
34035 #endif
34036 {
34037 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
34038 }
34039 } else {
34040 #if CYTHON_USE_PYLONG_INTERNALS
34041 if (__Pyx_PyLong_IsCompact(x)) {
34042 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
34043 } else
34044 #endif
34045 {
34046 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
34047 }
34048 }
34049#if CYTHON_USE_PYLONG_INTERNALS
34050raise_neg_overflow:
34051 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
34052raise_overflow:
34053 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
34054#endif
34055}
34056static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
34057 int val;
34058 PyObject *tmp = __Pyx_PyNumber_Long(x);
34059 if (!tmp) return (int) -1;
34060 val = __Pyx_PyLong_As_int(tmp);
34061 Py_DECREF(tmp);
34062 return val;
34063}
34064static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
34065 if (likely(PyLong_Check(x))) {
34066 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
34067 } else {
34068 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
34069 }
34070}
34071
34072/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
34073#if CYTHON_VECTORCALL
34074CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
34075 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
34076#if !CYTHON_ASSUME_SAFE_MACROS
34077 if (unlikely(!key)) return -1;
34078#endif
34079 if (unlikely(!PyUnicode_Check(key))) {
34080 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
34081 return -1;
34082 }
34083 return 0;
34084}
34085#else
34086CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
34087 PyObject *out = PyDict_New();
34088 if (unlikely(!out)) return NULL;
34089 for (Py_ssize_t i=0; i<n; ++i) {
34090 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
34091 Py_DECREF(out);
34092 return NULL;
34093 }
34094 }
34095 return out;
34096}
34097CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
34098 PyObject *key = kwnames[i];
34099 if (unlikely(!PyUnicode_Check(key))) {
34100 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
34101 return -1;
34102 }
34103 return 0;
34104}
34105#endif
34106
34107/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
34108#if !CYTHON_VECTORCALL
34109static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
34110 PyObject *result;
34111 PyObject *obj = PyObject_GetAttr(args[0], name);
34112 if (unlikely(!obj))
34113 return NULL;
34114 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
34115 Py_DECREF(obj);
34116 return result;
34117}
34118#endif
34119
34120/* CIntToPy */
34121static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
34122#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34123#pragma GCC diagnostic push
34124#pragma GCC diagnostic ignored "-Wconversion"
34125#endif
34126 const int neg_one = (int) -1, const_zero = (int) 0;
34127#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34128#pragma GCC diagnostic pop
34129#endif
34130 const int is_unsigned = neg_one > const_zero;
34131 if (is_unsigned) {
34132 if (sizeof(int) < sizeof(long)) {
34133 return PyLong_FromLong((long) value);
34134 } else if (sizeof(int) <= sizeof(unsigned long)) {
34135 return PyLong_FromUnsignedLong((unsigned long) value);
34136#if !CYTHON_COMPILING_IN_PYPY
34137 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
34138 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34139#endif
34140 }
34141 } else {
34142 if (sizeof(int) <= sizeof(long)) {
34143 return PyLong_FromLong((long) value);
34144 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
34145 return PyLong_FromLongLong((PY_LONG_LONG) value);
34146 }
34147 }
34148 {
34149 unsigned char *bytes = (unsigned char *)&value;
34150#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
34151 if (is_unsigned) {
34152 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
34153 } else {
34154 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
34155 }
34156#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
34157 int one = 1; int little = (int)*(unsigned char *)&one;
34158 return _PyLong_FromByteArray(bytes, sizeof(int),
34159 little, !is_unsigned);
34160#else
34161 int one = 1; int little = (int)*(unsigned char *)&one;
34162 PyObject *result = NULL, *kwds = NULL;
34163 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
34164 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
34165 if (!py_bytes) goto limited_bad;
34166 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
34167 if (!from_bytes_str) goto limited_bad;
34168 order_str = PyUnicode_FromString(little ? "little" : "big");
34169 if (!order_str) goto limited_bad;
34170 {
34171 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
34172 if (!is_unsigned) {
34173 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
34174 if (!signed_str) goto limited_bad;
34175#if CYTHON_VECTORCALL
34176 kwds = PyTuple_Pack(1, signed_str);
34177#else
34178 {
34179 PyObject *keys[] = {signed_str};
34180 PyObject *values[] = {Py_True};
34181 kwds = __Pyx_MakeKwargDict(keys, values, 1);
34182 }
34183#endif
34184 Py_DECREF(signed_str);
34185 if (unlikely(!kwds)) goto limited_bad;
34186 }
34187 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
34188 }
34189 limited_bad:
34190 Py_XDECREF(kwds);
34191 Py_XDECREF(order_str);
34192 Py_XDECREF(py_bytes);
34193 Py_XDECREF(from_bytes_str);
34194 return result;
34195#endif
34196 }
34197}
34198
34199/* CIntToPy */
34200static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_intp(npy_intp value) {
34201#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34202#pragma GCC diagnostic push
34203#pragma GCC diagnostic ignored "-Wconversion"
34204#endif
34205 const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
34206#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34207#pragma GCC diagnostic pop
34208#endif
34209 const int is_unsigned = neg_one > const_zero;
34210 if (is_unsigned) {
34211 if (sizeof(npy_intp) < sizeof(long)) {
34212 return PyLong_FromLong((long) value);
34213 } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
34214 return PyLong_FromUnsignedLong((unsigned long) value);
34215#if !CYTHON_COMPILING_IN_PYPY
34216 } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
34217 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34218#endif
34219 }
34220 } else {
34221 if (sizeof(npy_intp) <= sizeof(long)) {
34222 return PyLong_FromLong((long) value);
34223 } else if (sizeof(npy_intp) <= sizeof(PY_LONG_LONG)) {
34224 return PyLong_FromLongLong((PY_LONG_LONG) value);
34225 }
34226 }
34227 {
34228 unsigned char *bytes = (unsigned char *)&value;
34229#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
34230 if (is_unsigned) {
34231 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
34232 } else {
34233 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
34234 }
34235#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
34236 int one = 1; int little = (int)*(unsigned char *)&one;
34237 return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
34238 little, !is_unsigned);
34239#else
34240 int one = 1; int little = (int)*(unsigned char *)&one;
34241 PyObject *result = NULL, *kwds = NULL;
34242 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
34243 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_intp));
34244 if (!py_bytes) goto limited_bad;
34245 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
34246 if (!from_bytes_str) goto limited_bad;
34247 order_str = PyUnicode_FromString(little ? "little" : "big");
34248 if (!order_str) goto limited_bad;
34249 {
34250 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
34251 if (!is_unsigned) {
34252 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
34253 if (!signed_str) goto limited_bad;
34254#if CYTHON_VECTORCALL
34255 kwds = PyTuple_Pack(1, signed_str);
34256#else
34257 {
34258 PyObject *keys[] = {signed_str};
34259 PyObject *values[] = {Py_True};
34260 kwds = __Pyx_MakeKwargDict(keys, values, 1);
34261 }
34262#endif
34263 Py_DECREF(signed_str);
34264 if (unlikely(!kwds)) goto limited_bad;
34265 }
34266 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
34267 }
34268 limited_bad:
34269 Py_XDECREF(kwds);
34270 Py_XDECREF(order_str);
34271 Py_XDECREF(py_bytes);
34272 Py_XDECREF(from_bytes_str);
34273 return result;
34274#endif
34275 }
34276}
34277
34278/* CIntFromPy */
34279static npy_intp __Pyx_LargePyLong___Pyx_PyLong_As_npy_intp(PyObject *x);
34280static npy_intp __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_intp(void) {
34281 const char* type_name = "npy_intp";
34282 PyErr_Format(PyExc_OverflowError,
34283 "can't convert negative value to %.200s", type_name);
34284 return (npy_intp) -1;
34285}
34286static npy_intp __Pyx_raise_overflow___Pyx_PyLong_As_npy_intp(void) {
34287 const char* type_name = "npy_intp";
34288 PyErr_Format(PyExc_OverflowError,
34289 "value too large to convert to %.200s", type_name);
34290 return (npy_intp) -1;
34291}
34292static CYTHON_INLINE npy_intp __Pyx_PyULong___Pyx_PyLong_As_npy_intp(PyObject *x) {
34293 const int is_unsigned = 1;
34294#if CYTHON_USE_PYLONG_INTERNALS
34295 {
34296 const digit* digits = __Pyx_PyLong_Digits(x);
34297 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
34298 if (size == 2 && (8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
34299 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34300 __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34301 } else if ((8 * sizeof(npy_intp) >= 2 * PyLong_SHIFT)) {
34302 return (npy_intp) (((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
34303 }
34304 } else
34305 if (size == 3 && (8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
34306 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34307 __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34308 } else if ((8 * sizeof(npy_intp) >= 3 * PyLong_SHIFT)) {
34309 return (npy_intp) (((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
34310 }
34311 } else
34312 if (size == 4 && (8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
34313 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34314 __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34315 } else if ((8 * sizeof(npy_intp) >= 4 * PyLong_SHIFT)) {
34316 return (npy_intp) (((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
34317 }
34318 } else
34319 {}
34320 }
34321#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
34322 if (unlikely(Py_SIZE(x) < 0)) {
34323 goto raise_neg_overflow;
34324 }
34325#else
34326 {
34327 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34328 if (unlikely(result < 0))
34329 return (npy_intp) -1;
34330 if (unlikely(result == 1))
34331 goto raise_neg_overflow;
34332 }
34333#endif
34334 if ((sizeof(npy_intp) <= sizeof(unsigned long))) {
34335 __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned long, PyLong_AsUnsignedLong(x))
34336 } else if ((sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG))) {
34337 __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34338 }
34339 return __Pyx_LargePyLong___Pyx_PyLong_As_npy_intp(x);
34340raise_neg_overflow:
34341 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_intp();
34342raise_overflow:
34343 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_intp();
34344}
34345static CYTHON_INLINE npy_intp __Pyx_PySLong___Pyx_PyLong_As_npy_intp(PyObject *x) {
34346 const int is_unsigned = 0;
34347#if CYTHON_USE_PYLONG_INTERNALS
34348 if (__Pyx_PyLong_IsNeg(x)) {
34349 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
34350 const digit* digits = __Pyx_PyLong_Digits(x);
34351 if (size == 2 && (8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
34352 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
34353 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34354 __PYX_VERIFY_RETURN_INT(npy_intp, long, ival)
34355 } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
34356 return (npy_intp) (((npy_intp) -1) * (((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
34357 }
34358 } else
34359 if (size == 3 && (8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
34360 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
34361 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34362 __PYX_VERIFY_RETURN_INT(npy_intp, long, ival)
34363 } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
34364 return (npy_intp) (((npy_intp) -1) * (((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
34365 }
34366 } else
34367 if (size == 4 && (8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
34368 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
34369 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34370 __PYX_VERIFY_RETURN_INT(npy_intp, long, ival)
34371 } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
34372 return (npy_intp) (((npy_intp) -1) * (((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
34373 }
34374 } else
34375 {}
34376 } else {
34377 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
34378 const digit* digits = __Pyx_PyLong_Digits(x);
34379 if (size == 2 && (8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
34380 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
34381 __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34382 } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
34383 return (npy_intp) (((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
34384 }
34385 } else
34386 if (size == 3 && (8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
34387 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
34388 __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34389 } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
34390 return (npy_intp) (((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
34391 }
34392 } else
34393 if (size == 4 && (8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
34394 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
34395 __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34396 } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
34397 return (npy_intp) (((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
34398 }
34399 } else
34400 {}
34401 }
34402#endif
34403 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
34404 if ((sizeof(npy_intp) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
34405 __PYX_VERIFY_RETURN_INT_EXC(npy_intp, int, PyLong_AsInt(x))
34406 } else
34407 #endif
34408 if ((sizeof(npy_intp) <= sizeof(long))) {
34409 __PYX_VERIFY_RETURN_INT_EXC(npy_intp, long, PyLong_AsLong(x))
34410 } else if ((sizeof(npy_intp) <= sizeof(PY_LONG_LONG))) {
34411 __PYX_VERIFY_RETURN_INT_EXC(npy_intp, PY_LONG_LONG, PyLong_AsLongLong(x))
34412 }
34413 return __Pyx_LargePyLong___Pyx_PyLong_As_npy_intp(x);
34414raise_neg_overflow:
34415 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_intp();
34416raise_overflow:
34417 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_intp();
34418}
34419static npy_intp __Pyx_LargePyLong___Pyx_PyLong_As_npy_intp(PyObject *x) {
34420#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34421#pragma GCC diagnostic push
34422#pragma GCC diagnostic ignored "-Wconversion"
34423#endif
34424 const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
34425#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34426#pragma GCC diagnostic pop
34427#endif
34428 const int is_unsigned = neg_one > const_zero;
34429 npy_intp val;
34430 int ret = -1;
34431#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
34432 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
34433 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
34434 if (unlikely(bytes_copied == -1)) {
34435 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
34436 goto raise_overflow;
34437 } else {
34438 ret = 0;
34439 }
34440#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
34441 int one = 1; int is_little = (int)*(unsigned char *)&one;
34442 unsigned char *bytes = (unsigned char *)&val;
34443 ret = _PyLong_AsByteArray((PyLongObject *)x,
34444 bytes, sizeof(val),
34445 is_little, !is_unsigned);
34446 if ((0)) goto raise_overflow;
34447#else
34448 PyObject *v;
34449 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
34450 int bits, remaining_bits, is_negative = 0;
34451 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
34452 if (likely(PyLong_CheckExact(x))) {
34453 v = __Pyx_NewRef(x);
34454 } else {
34455 v = PyNumber_Long(x);
34456 if (unlikely(!v)) return (npy_intp) -1;
34457 assert(PyLong_CheckExact(v));
34458 }
34459 {
34460 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
34461 if (unlikely(result < 0)) {
34462 Py_DECREF(v);
34463 return (npy_intp) -1;
34464 }
34465 is_negative = result == 1;
34466 }
34467 if (is_unsigned && unlikely(is_negative)) {
34468 Py_DECREF(v);
34469 PyErr_SetString(PyExc_OverflowError,
34470 "can't convert negative value to npy_intp");
34471 return (npy_intp) -1;
34472 } else if (is_negative) {
34473 stepval = PyNumber_Invert(v);
34474 Py_DECREF(v);
34475 if (unlikely(!stepval))
34476 return (npy_intp) -1;
34477 } else {
34478 stepval = v;
34479 }
34480 v = NULL;
34481 val = (npy_intp) 0;
34482 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
34483 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
34484 for (bits = 0; bits < (int) sizeof(npy_intp) * 8 - chunk_size; bits += chunk_size) {
34485 PyObject *tmp, *digit;
34486 long idigit;
34487 digit = PyNumber_And(stepval, mask);
34488 if (unlikely(!digit)) goto done;
34489 idigit = PyLong_AsLong(digit);
34490 Py_DECREF(digit);
34491 if (unlikely(idigit < 0)) goto done;
34492 val |= ((npy_intp) idigit) << bits;
34493 tmp = PyNumber_Rshift(stepval, shift);
34494 if (unlikely(!tmp)) goto done;
34495 Py_DECREF(stepval); stepval = tmp;
34496 }
34497 Py_DECREF(shift); shift = NULL;
34498 Py_DECREF(mask); mask = NULL;
34499 {
34500 long idigit = PyLong_AsLong(stepval);
34501 if (unlikely(idigit < 0)) goto done;
34502 remaining_bits = ((int) sizeof(npy_intp) * 8) - bits - (is_unsigned ? 0 : 1);
34503 if (unlikely(idigit >= (1L << remaining_bits)))
34504 goto raise_overflow;
34505 val |= ((npy_intp) idigit) << bits;
34506 }
34507 if (!is_unsigned) {
34508 if (unlikely(val & (((npy_intp) 1) << (sizeof(npy_intp) * 8 - 1))))
34509 goto raise_overflow;
34510 if (is_negative)
34511 val = ~val;
34512 }
34513 ret = 0;
34514done:
34515 Py_XDECREF(shift);
34516 Py_XDECREF(mask);
34517 Py_XDECREF(stepval);
34518#endif
34519 if (unlikely(ret))
34520 return (npy_intp) -1;
34521 return val;
34522raise_overflow:
34523 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_intp();
34524}
34525static CYTHON_INLINE npy_intp __Pyx_PyLong___Pyx_PyLong_As_npy_intp(PyObject *x) {
34526#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34527#pragma GCC diagnostic push
34528#pragma GCC diagnostic ignored "-Wconversion"
34529#endif
34530 const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
34531#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34532#pragma GCC diagnostic pop
34533#endif
34534 const int is_unsigned = neg_one > const_zero;
34535 if (is_unsigned) {
34536 #if CYTHON_USE_PYLONG_INTERNALS
34537 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
34538 goto raise_neg_overflow;
34539 } else if (__Pyx_PyLong_IsCompact(x)) {
34540 __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
34541 } else
34542 #endif
34543 {
34544 return __Pyx_PyULong___Pyx_PyLong_As_npy_intp(x);
34545 }
34546 } else {
34547 #if CYTHON_USE_PYLONG_INTERNALS
34548 if (__Pyx_PyLong_IsCompact(x)) {
34549 __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
34550 } else
34551 #endif
34552 {
34553 return __Pyx_PySLong___Pyx_PyLong_As_npy_intp(x);
34554 }
34555 }
34556#if CYTHON_USE_PYLONG_INTERNALS
34557raise_neg_overflow:
34558 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_intp();
34559raise_overflow:
34560 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_intp();
34561#endif
34562}
34563static npy_intp __Pyx_NonPyLong___Pyx_PyLong_As_npy_intp(PyObject *x) {
34564 npy_intp val;
34565 PyObject *tmp = __Pyx_PyNumber_Long(x);
34566 if (!tmp) return (npy_intp) -1;
34567 val = __Pyx_PyLong_As_npy_intp(tmp);
34568 Py_DECREF(tmp);
34569 return val;
34570}
34571static CYTHON_INLINE npy_intp __Pyx_PyLong_As_npy_intp(PyObject *x) {
34572 if (likely(PyLong_Check(x))) {
34573 return __Pyx_PyLong___Pyx_PyLong_As_npy_intp(x);
34574 } else {
34575 return __Pyx_NonPyLong___Pyx_PyLong_As_npy_intp(x);
34576 }
34577}
34578
34579/* CIntToPy */
34580static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
34581#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34582#pragma GCC diagnostic push
34583#pragma GCC diagnostic ignored "-Wconversion"
34584#endif
34585 const long neg_one = (long) -1, const_zero = (long) 0;
34586#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34587#pragma GCC diagnostic pop
34588#endif
34589 const int is_unsigned = neg_one > const_zero;
34590 if (is_unsigned) {
34591 if (sizeof(long) < sizeof(long)) {
34592 return PyLong_FromLong((long) value);
34593 } else if (sizeof(long) <= sizeof(unsigned long)) {
34594 return PyLong_FromUnsignedLong((unsigned long) value);
34595#if !CYTHON_COMPILING_IN_PYPY
34596 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
34597 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
34598#endif
34599 }
34600 } else {
34601 if (sizeof(long) <= sizeof(long)) {
34602 return PyLong_FromLong((long) value);
34603 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
34604 return PyLong_FromLongLong((PY_LONG_LONG) value);
34605 }
34606 }
34607 {
34608 unsigned char *bytes = (unsigned char *)&value;
34609#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
34610 if (is_unsigned) {
34611 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
34612 } else {
34613 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
34614 }
34615#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
34616 int one = 1; int little = (int)*(unsigned char *)&one;
34617 return _PyLong_FromByteArray(bytes, sizeof(long),
34618 little, !is_unsigned);
34619#else
34620 int one = 1; int little = (int)*(unsigned char *)&one;
34621 PyObject *result = NULL, *kwds = NULL;
34622 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
34623 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
34624 if (!py_bytes) goto limited_bad;
34625 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
34626 if (!from_bytes_str) goto limited_bad;
34627 order_str = PyUnicode_FromString(little ? "little" : "big");
34628 if (!order_str) goto limited_bad;
34629 {
34630 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
34631 if (!is_unsigned) {
34632 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
34633 if (!signed_str) goto limited_bad;
34634#if CYTHON_VECTORCALL
34635 kwds = PyTuple_Pack(1, signed_str);
34636#else
34637 {
34638 PyObject *keys[] = {signed_str};
34639 PyObject *values[] = {Py_True};
34640 kwds = __Pyx_MakeKwargDict(keys, values, 1);
34641 }
34642#endif
34643 Py_DECREF(signed_str);
34644 if (unlikely(!kwds)) goto limited_bad;
34645 }
34646 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
34647 }
34648 limited_bad:
34649 Py_XDECREF(kwds);
34650 Py_XDECREF(order_str);
34651 Py_XDECREF(py_bytes);
34652 Py_XDECREF(from_bytes_str);
34653 return result;
34654#endif
34655 }
34656}
34657
34658/* CIntFromPy */
34659static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
34660static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
34661 const char* type_name = "long";
34662 PyErr_Format(PyExc_OverflowError,
34663 "can't convert negative value to %.200s", type_name);
34664 return (long) -1;
34665}
34666static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
34667 const char* type_name = "long";
34668 PyErr_Format(PyExc_OverflowError,
34669 "value too large to convert to %.200s", type_name);
34670 return (long) -1;
34671}
34672static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
34673 const int is_unsigned = 1;
34674#if CYTHON_USE_PYLONG_INTERNALS
34675 {
34676 const digit* digits = __Pyx_PyLong_Digits(x);
34677 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
34678 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
34679 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34680 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34681 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
34682 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
34683 }
34684 } else
34685 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
34686 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34687 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34688 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
34689 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
34690 }
34691 } else
34692 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
34693 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34694 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34695 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
34696 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
34697 }
34698 } else
34699 {}
34700 }
34701#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
34702 if (unlikely(Py_SIZE(x) < 0)) {
34703 goto raise_neg_overflow;
34704 }
34705#else
34706 {
34707 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34708 if (unlikely(result < 0))
34709 return (long) -1;
34710 if (unlikely(result == 1))
34711 goto raise_neg_overflow;
34712 }
34713#endif
34714 if ((sizeof(long) <= sizeof(unsigned long))) {
34715 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
34716 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
34717 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34718 }
34719 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
34720raise_neg_overflow:
34721 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
34722raise_overflow:
34723 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
34724}
34725static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
34726 const int is_unsigned = 0;
34727#if CYTHON_USE_PYLONG_INTERNALS
34728 if (__Pyx_PyLong_IsNeg(x)) {
34729 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
34730 const digit* digits = __Pyx_PyLong_Digits(x);
34731 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
34732 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
34733 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34734 __PYX_VERIFY_RETURN_INT(long, long, ival)
34735 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
34736 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
34737 }
34738 } else
34739 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
34740 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
34741 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34742 __PYX_VERIFY_RETURN_INT(long, long, ival)
34743 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
34744 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
34745 }
34746 } else
34747 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
34748 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
34749 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34750 __PYX_VERIFY_RETURN_INT(long, long, ival)
34751 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
34752 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
34753 }
34754 } else
34755 {}
34756 } else {
34757 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
34758 const digit* digits = __Pyx_PyLong_Digits(x);
34759 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
34760 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
34761 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34762 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
34763 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
34764 }
34765 } else
34766 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
34767 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
34768 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34769 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
34770 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
34771 }
34772 } else
34773 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
34774 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
34775 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34776 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
34777 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
34778 }
34779 } else
34780 {}
34781 }
34782#endif
34783 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
34784 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
34785 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
34786 } else
34787 #endif
34788 if ((sizeof(long) <= sizeof(long))) {
34789 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
34790 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
34791 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
34792 }
34793 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
34794raise_neg_overflow:
34795 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
34796raise_overflow:
34797 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
34798}
34799static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
34800#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34801#pragma GCC diagnostic push
34802#pragma GCC diagnostic ignored "-Wconversion"
34803#endif
34804 const long neg_one = (long) -1, const_zero = (long) 0;
34805#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34806#pragma GCC diagnostic pop
34807#endif
34808 const int is_unsigned = neg_one > const_zero;
34809 long val;
34810 int ret = -1;
34811#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
34812 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
34813 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
34814 if (unlikely(bytes_copied == -1)) {
34815 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
34816 goto raise_overflow;
34817 } else {
34818 ret = 0;
34819 }
34820#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
34821 int one = 1; int is_little = (int)*(unsigned char *)&one;
34822 unsigned char *bytes = (unsigned char *)&val;
34823 ret = _PyLong_AsByteArray((PyLongObject *)x,
34824 bytes, sizeof(val),
34825 is_little, !is_unsigned);
34826 if ((0)) goto raise_overflow;
34827#else
34828 PyObject *v;
34829 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
34830 int bits, remaining_bits, is_negative = 0;
34831 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
34832 if (likely(PyLong_CheckExact(x))) {
34833 v = __Pyx_NewRef(x);
34834 } else {
34835 v = PyNumber_Long(x);
34836 if (unlikely(!v)) return (long) -1;
34837 assert(PyLong_CheckExact(v));
34838 }
34839 {
34840 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
34841 if (unlikely(result < 0)) {
34842 Py_DECREF(v);
34843 return (long) -1;
34844 }
34845 is_negative = result == 1;
34846 }
34847 if (is_unsigned && unlikely(is_negative)) {
34848 Py_DECREF(v);
34849 PyErr_SetString(PyExc_OverflowError,
34850 "can't convert negative value to long");
34851 return (long) -1;
34852 } else if (is_negative) {
34853 stepval = PyNumber_Invert(v);
34854 Py_DECREF(v);
34855 if (unlikely(!stepval))
34856 return (long) -1;
34857 } else {
34858 stepval = v;
34859 }
34860 v = NULL;
34861 val = (long) 0;
34862 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
34863 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
34864 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
34865 PyObject *tmp, *digit;
34866 long idigit;
34867 digit = PyNumber_And(stepval, mask);
34868 if (unlikely(!digit)) goto done;
34869 idigit = PyLong_AsLong(digit);
34870 Py_DECREF(digit);
34871 if (unlikely(idigit < 0)) goto done;
34872 val |= ((long) idigit) << bits;
34873 tmp = PyNumber_Rshift(stepval, shift);
34874 if (unlikely(!tmp)) goto done;
34875 Py_DECREF(stepval); stepval = tmp;
34876 }
34877 Py_DECREF(shift); shift = NULL;
34878 Py_DECREF(mask); mask = NULL;
34879 {
34880 long idigit = PyLong_AsLong(stepval);
34881 if (unlikely(idigit < 0)) goto done;
34882 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
34883 if (unlikely(idigit >= (1L << remaining_bits)))
34884 goto raise_overflow;
34885 val |= ((long) idigit) << bits;
34886 }
34887 if (!is_unsigned) {
34888 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
34889 goto raise_overflow;
34890 if (is_negative)
34891 val = ~val;
34892 }
34893 ret = 0;
34894done:
34895 Py_XDECREF(shift);
34896 Py_XDECREF(mask);
34897 Py_XDECREF(stepval);
34898#endif
34899 if (unlikely(ret))
34900 return (long) -1;
34901 return val;
34902raise_overflow:
34903 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
34904}
34905static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
34906#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34907#pragma GCC diagnostic push
34908#pragma GCC diagnostic ignored "-Wconversion"
34909#endif
34910 const long neg_one = (long) -1, const_zero = (long) 0;
34911#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
34912#pragma GCC diagnostic pop
34913#endif
34914 const int is_unsigned = neg_one > const_zero;
34915 if (is_unsigned) {
34916 #if CYTHON_USE_PYLONG_INTERNALS
34917 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
34918 goto raise_neg_overflow;
34919 } else if (__Pyx_PyLong_IsCompact(x)) {
34920 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
34921 } else
34922 #endif
34923 {
34924 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
34925 }
34926 } else {
34927 #if CYTHON_USE_PYLONG_INTERNALS
34928 if (__Pyx_PyLong_IsCompact(x)) {
34929 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
34930 } else
34931 #endif
34932 {
34933 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
34934 }
34935 }
34936#if CYTHON_USE_PYLONG_INTERNALS
34937raise_neg_overflow:
34938 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
34939raise_overflow:
34940 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
34941#endif
34942}
34943static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
34944 long val;
34945 PyObject *tmp = __Pyx_PyNumber_Long(x);
34946 if (!tmp) return (long) -1;
34947 val = __Pyx_PyLong_As_long(tmp);
34948 Py_DECREF(tmp);
34949 return val;
34950}
34951static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
34952 if (likely(PyLong_Check(x))) {
34953 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
34954 } else {
34955 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
34956 }
34957}
34958
34959/* GetRuntimeVersion */
34960#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
34961void __Pyx_init_runtime_version(void) {
34962 if (__Pyx_cached_runtime_version == 0) {
34963 const char* rt_version = Py_GetVersion();
34964 unsigned long version = 0;
34965 unsigned long factor = 0x01000000UL;
34966 unsigned int digit = 0;
34967 int i = 0;
34968 while (factor) {
34969 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
34970 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
34971 ++i;
34972 }
34973 version += factor * digit;
34974 if (rt_version[i] != '.')
34975 break;
34976 digit = 0;
34977 factor >>= 8;
34978 ++i;
34979 }
34980 __Pyx_cached_runtime_version = version;
34981 }
34982}
34983#endif
34984static unsigned long __Pyx_get_runtime_version(void) {
34985#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
34986 return Py_Version & ~0xFFUL;
34987#else
34988 return __Pyx_cached_runtime_version;
34989#endif
34990}
34991
34992/* CheckBinaryVersion */
34993static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
34994 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
34995 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
34996 return 0;
34997 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
34998 return 1;
34999 {
35000 char message[200];
35001 PyOS_snprintf(message, sizeof(message),
35002 "compile time Python version %d.%d "
35003 "of module '%.100s' "
35004 "%s "
35005 "runtime version %d.%d",
35006 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
35007 __Pyx_MODULE_NAME,
35008 (allow_newer) ? "was newer than" : "does not match",
35009 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
35010 );
35011 return PyErr_WarnEx(NULL, message, 1);
35012 }
35013}
35014
35015/* NewCodeObj */
35016#if CYTHON_COMPILING_IN_LIMITED_API
35017 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
35018 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
35019 PyObject *fv, PyObject *cell, PyObject* fn,
35020 PyObject *name, int fline, PyObject *lnos) {
35021 PyObject *exception_table = NULL;
35022 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
35023 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
35024 PyObject *version_info;
35025 PyObject *py_minor_version = NULL;
35026 #endif
35027 long minor_version = 0;
35028 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
35029 minor_version = 11;
35030 #else
35031 if (!(version_info = PySys_GetObject("version_info"))) goto end;
35032 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
35033 minor_version = PyLong_AsLong(py_minor_version);
35034 Py_DECREF(py_minor_version);
35035 if (minor_version == -1 && PyErr_Occurred()) goto end;
35036 #endif
35037 if (!(types_module = PyImport_ImportModule("types"))) goto end;
35038 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
35039 if (minor_version <= 10) {
35040 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
35041 c, n, v, fn, name, fline, lnos, fv, cell);
35042 } else {
35043 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
35044 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
35045 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
35046 }
35047 end:
35048 Py_XDECREF(code_type);
35049 Py_XDECREF(exception_table);
35050 Py_XDECREF(types_module);
35051 if (!result) {
35052 PyObject *exc_type, *exc_value, *exc_tb;
35053 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
35054 if (PyErr_WarnFormat(
35055 PyExc_RuntimeWarning, 1,
35056 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
35057 exc_value ? exc_value : exc_type) == 0) {
35058 result = Py_None;
35059 Py_INCREF(result);
35060 }
35061 Py_DECREF(exc_type);
35062 Py_XDECREF(exc_value);
35063 Py_XDECREF(exc_tb);
35064 }
35065 return result;
35066 }
35067#elif PY_VERSION_HEX >= 0x030B0000
35068 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
35069 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
35070 PyObject *fv, PyObject *cell, PyObject* fn,
35071 PyObject *name, int fline, PyObject *lnos) {
35072 PyCodeObject *result;
35073 result =
35074 #if PY_VERSION_HEX >= 0x030C0000
35075 PyUnstable_Code_NewWithPosOnlyArgs
35076 #else
35077 PyCode_NewWithPosOnlyArgs
35078 #endif
35079 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
35080 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
35081 if (likely(result))
35082 result->_co_firsttraceable = 0;
35083 #endif
35084 return result;
35085 }
35086#elif !CYTHON_COMPILING_IN_PYPY
35087 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
35088 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
35089#else
35090 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
35091 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
35092#endif
35093static PyObject* __Pyx_PyCode_New(
35094 const __Pyx_PyCode_New_function_description descr,
35095 PyObject * const *varnames,
35096 PyObject *filename,
35097 PyObject *funcname,
35098 PyObject *line_table,
35099 PyObject *tuple_dedup_map
35100) {
35101 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
35102 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
35103 PyObject *varnames_tuple = PyTuple_New(var_count);
35104 if (unlikely(!varnames_tuple)) return NULL;
35105 for (Py_ssize_t i=0; i < var_count; i++) {
35106 Py_INCREF(varnames[i]);
35107 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
35108 }
35109 #if CYTHON_COMPILING_IN_LIMITED_API
35110 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
35111 if (!varnames_tuple_dedup) {
35112 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
35113 varnames_tuple_dedup = varnames_tuple;
35114 }
35115 #else
35116 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
35117 if (unlikely(!varnames_tuple_dedup)) goto done;
35118 #endif
35119 #if CYTHON_AVOID_BORROWED_REFS
35120 Py_INCREF(varnames_tuple_dedup);
35121 #endif
35122 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
35123 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
35124 #if !CYTHON_ASSUME_SAFE_SIZE
35125 if (unlikely(line_table_length == -1)) goto done;
35126 #endif
35127 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
35128 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
35129 if (unlikely(!code_bytes)) goto done;
35130 char* c_code_bytes = PyBytes_AsString(code_bytes);
35131 if (unlikely(!c_code_bytes)) goto done;
35132 memset(c_code_bytes, 0, (size_t) code_len);
35133 }
35134 code_obj = (PyObject*) __Pyx__PyCode_New(
35135 (int) descr.argcount,
35136 (int) descr.num_posonly_args,
35137 (int) descr.num_kwonly_args,
35138 (int) descr.nlocals,
35139 0,
35140 (int) descr.flags,
35141 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
35142 __pyx_mstate_global->__pyx_empty_tuple,
35143 __pyx_mstate_global->__pyx_empty_tuple,
35144 varnames_tuple_dedup,
35145 __pyx_mstate_global->__pyx_empty_tuple,
35146 __pyx_mstate_global->__pyx_empty_tuple,
35147 filename,
35148 funcname,
35149 (int) descr.first_line,
35150 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
35151 );
35152done:
35153 Py_XDECREF(code_bytes);
35154 #if CYTHON_AVOID_BORROWED_REFS
35155 Py_XDECREF(varnames_tuple_dedup);
35156 #endif
35157 Py_DECREF(varnames_tuple);
35158 return code_obj;
35159}
35160
35161/* DecompressString */
35162CYTHON_UNUSED
35163static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
35164#ifdef __Pyx_DecompressString_UNUSED
35165 CYTHON_UNUSED_VAR(s);
35166 CYTHON_UNUSED_VAR(length);
35167 CYTHON_UNUSED_VAR(algo);
35168 return NULL;
35169#else
35170 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
35171 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
35172 PyObject *methodname = PyUnicode_FromString("decompress");
35173 if (unlikely(!methodname)) return NULL;
35174 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
35175 if (algo == 3) {
35176 PyObject *fromlist = Py_BuildValue("[O]", methodname);
35177 if (unlikely(!fromlist)) goto bad;
35178 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
35179 Py_DECREF(fromlist);
35180 } else
35181 #endif
35182 module = PyImport_ImportModule(module_name);
35183 if (unlikely(!module)) goto import_failed;
35184 decompress = PyObject_GetAttr(module, methodname);
35185 if (unlikely(!decompress)) goto import_failed;
35186 {
35187 #ifdef __cplusplus
35188 char *memview_bytes = const_cast<char*>(s);
35189 #else
35190 #if defined(__clang__)
35191 #pragma clang diagnostic push
35192 #pragma clang diagnostic ignored "-Wcast-qual"
35193 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
35194 #pragma GCC diagnostic push
35195 #pragma GCC diagnostic ignored "-Wcast-qual"
35196 #endif
35197 char *memview_bytes = (char*) s;
35198 #if defined(__clang__)
35199 #pragma clang diagnostic pop
35200 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
35201 #pragma GCC diagnostic pop
35202 #endif
35203 #endif
35204 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
35205 int memview_flags = 0x100;
35206 #else
35207 int memview_flags = PyBUF_READ;
35208 #endif
35209 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
35210 }
35211 if (unlikely(!compressed_bytes)) {
35212 Py_DECREF(decompress);
35213 goto bad;
35214 }
35215 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
35216 Py_DECREF(compressed_bytes);
35217 Py_DECREF(decompress);
35218 Py_DECREF(module);
35219 Py_DECREF(methodname);
35220 return decompressed;
35221import_failed:
35222 PyErr_Format(PyExc_ImportError,
35223 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
35224 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
35225 module_name, algo);
35226bad:
35227 Py_XDECREF(module);
35228 Py_DECREF(methodname);
35229 return NULL;
35230#endif
35231}
35232
35233/* DecompressString_LZSS */
35234#ifndef __Pyx_DecompressString_LZSS_UNUSED
35235CYTHON_UNUSED
35236static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
35237 size_t pos = 0, out_pos = 0;
35238 while (1) {
35239 uint32_t flags = src[pos++] | 0xFF00;
35240 while (flags & 0x100) {
35241 if (flags & 1) {
35242 dst[out_pos++] = src[pos++];
35243 } else {
35244 uint32_t lo = src[pos++], hi = src[pos++];
35245 uint32_t end_offset_of_last_occurrence, match_length;
35246 if (!(lo & 0x80)) {
35247 end_offset_of_last_occurrence = lo;
35248 match_length = hi;
35249 } else if (!(hi & 0x80)) {
35250 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
35251 match_length = hi & 0x1F;
35252 } else {
35253 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
35254 match_length = src[pos++];
35255 }
35256 match_length += 3;
35257 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
35258 memcpy(dst + out_pos, dst + ref_pos, match_length);
35259 out_pos += match_length;
35260 }
35261 if (out_pos >= dst_len) return pos;
35262 flags >>= 1;
35263 }
35264 }
35265}
35266#endif
35267static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
35268#ifdef __Pyx_DecompressString_LZSS_UNUSED
35269 CYTHON_UNUSED_VAR(s);
35270 CYTHON_UNUSED_VAR(compressed_length);
35271 CYTHON_UNUSED_VAR(uncompressed_length);
35272 return NULL;
35273#else
35274 PyObject *result;
35275 unsigned char *result_data;
35276 size_t src_length;
35277 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
35278 if (unlikely(!result)) return NULL;
35279 result_data = __Pyx_PyBytes_AsWritableUString(result);
35280 if (unlikely(!result_data)) goto bad;
35281 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
35282 if (unlikely(src_length != compressed_length)) goto decompression_failed;
35283 return result;
35284decompression_failed:
35285 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
35286bad:
35287 Py_DECREF(result);
35288 return NULL;
35289#endif
35290}
35291
35292#include <string.h>
35293static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
35294 size_t len = strlen(s);
35295 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
35296 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
35297 return -1;
35298 }
35299 return (Py_ssize_t) len;
35300}
35301static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
35302 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
35303 if (unlikely(len < 0)) return NULL;
35304 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
35305}
35306static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
35307 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
35308 if (unlikely(len < 0)) return NULL;
35309 return PyByteArray_FromStringAndSize(c_str, len);
35310}
35311static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
35312 Py_ssize_t ignore;
35313 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
35314}
35315#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
35316static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
35317 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
35318#if CYTHON_COMPILING_IN_LIMITED_API
35319 {
35320 const char* result;
35321 Py_ssize_t unicode_length;
35322 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
35323 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
35324 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
35325 #else
35326 result = PyUnicode_AsUTF8AndSize(o, length);
35327 #endif
35328 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
35329 unicode_length = PyUnicode_GetLength(o);
35330 if (unlikely(unicode_length < 0)) return NULL;
35331 if (unlikely(unicode_length != *length)) {
35332 PyUnicode_AsASCIIString(o);
35333 return NULL;
35334 }
35335 #endif
35336 return result;
35337 }
35338#else
35339#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
35340 if (likely(PyUnicode_IS_ASCII(o))) {
35341 *length = PyUnicode_GET_LENGTH(o);
35342 return PyUnicode_AsUTF8(o);
35343 } else {
35344 PyUnicode_AsASCIIString(o);
35345 return NULL;
35346 }
35347#else
35348 return PyUnicode_AsUTF8AndSize(o, length);
35349#endif
35350#endif
35351}
35352#endif
35353static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
35354#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
35355 if (PyUnicode_Check(o)) {
35356 return __Pyx_PyUnicode_AsStringAndSize(o, length);
35357 } else
35358#endif
35359 if (PyByteArray_Check(o)) {
35360#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
35361 *length = PyByteArray_GET_SIZE(o);
35362 return PyByteArray_AS_STRING(o);
35363#else
35364 *length = PyByteArray_Size(o);
35365 if (*length == -1) return NULL;
35366 return PyByteArray_AsString(o);
35367#endif
35368 } else
35369 {
35370 char* result;
35371 int r = PyBytes_AsStringAndSize(o, &result, length);
35372 if (unlikely(r < 0)) {
35373 return NULL;
35374 } else {
35375 return result;
35376 }
35377 }
35378}
35379static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
35380 int is_true = x == Py_True;
35381 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
35382 else return PyObject_IsTrue(x);
35383}
35384static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
35385 int retval;
35386 if (unlikely(!x)) return -1;
35387 retval = __Pyx_PyObject_IsTrue(x);
35388 Py_DECREF(x);
35389 return retval;
35390}
35391static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
35392 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
35393 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
35394 if (unlikely(!result_type_name)) goto bad;
35395 #endif
35396 if (PyLong_Check(result)) {
35397 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
35398 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
35399 "The ability to return an instance of a strict subclass of int is deprecated, "
35400 "and may be removed in a future version of Python.",
35401 result_type_name)) {
35402 __Pyx_DECREF_TypeName(result_type_name);
35403 goto bad;
35404 }
35405 __Pyx_DECREF_TypeName(result_type_name);
35406 return result;
35407 }
35408 PyErr_Format(PyExc_TypeError,
35409 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
35410 result_type_name);
35411 __Pyx_DECREF_TypeName(result_type_name);
35412bad:
35413 Py_DECREF(result);
35414 return NULL;
35415}
35416static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
35417#if CYTHON_USE_TYPE_SLOTS
35418 PyNumberMethods *m;
35419#endif
35420 PyObject *res = NULL;
35421 if (likely(PyLong_Check(x)))
35422 return __Pyx_NewRef(x);
35423#if CYTHON_USE_TYPE_SLOTS
35424 m = Py_TYPE(x)->tp_as_number;
35425 if (likely(m && m->nb_int)) {
35426 res = m->nb_int(x);
35427 }
35428#else
35429 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
35430 res = PyNumber_Long(x);
35431 }
35432#endif
35433 if (likely(res)) {
35434 if (unlikely(!PyLong_CheckExact(res))) {
35435 return __Pyx_PyNumber_LongWrongResultType(res);
35436 }
35437 }
35438 else if (!PyErr_Occurred()) {
35439 PyErr_SetString(PyExc_TypeError,
35440 "an integer is required");
35441 }
35442 return res;
35443}
35444static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
35445 #if CYTHON_USE_PYLONG_INTERNALS
35446 Py_ssize_t ival;
35447 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
35448 const int is_neg = __Pyx_PyLong_IsNeg(b);
35449 const digit* digits = __Pyx_PyLong_Digits(b);
35450 if (size == 0) return 0;
35451 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
35452 if (size == 1) {
35453 ival = (Py_ssize_t) (((size_t)digits[0]));
35454 } else
35455 #endif
35456 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
35457 if (size == 2) {
35458 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
35459 } else
35460 #endif
35461 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
35462 if (size == 3) {
35463 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
35464 } else
35465 #endif
35466 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
35467 if (size == 4) {
35468 ival = (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
35469 } else
35470 #endif
35471 return PyLong_AsSsize_t(b);
35472 return is_neg ? -ival : ival;
35473 #else
35474 return PyLong_AsSsize_t(b);
35475 #endif
35476}
35477static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
35478 if (likely(PyLong_Check(b))) {
35479 return __Pyx_PyLong_AsSsize_t(b);
35480 } else {
35481 Py_ssize_t ival;
35482 PyObject *x = PyNumber_Index(b);
35483 if (unlikely(!x)) return -1;
35484 ival = __Pyx_PyLong_AsSsize_t(x);
35485 Py_DECREF(x);
35486 return ival;
35487 }
35488}
35489static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
35490 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
35491 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
35492 } else {
35493 Py_ssize_t ival;
35494 PyObject *x;
35495 x = PyNumber_Index(o);
35496 if (!x) return -1;
35497 ival = PyLong_AsLong(x);
35498 Py_DECREF(x);
35499 return ival;
35500 }
35501}
35502static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
35503 CYTHON_UNUSED_VAR(b);
35504 return __Pyx_NewRef(Py_None);
35505}
35506static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
35507 return __Pyx_NewRef(b ? Py_True: Py_False);
35508}
35509static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
35510 return PyLong_FromSize_t(ival);
35511}
35512
35513
35514/* MultiPhaseInitModuleState */
35515#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
35516#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35517#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
35518 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
35519#else
35520 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
35521#endif
35522#endif
35523#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
35524#error "Module state with PEP489 requires atomics. Currently that's one of\
35525 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
35526#endif
35527#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35528#define __Pyx_ModuleStateLookup_Lock()
35529#define __Pyx_ModuleStateLookup_Unlock()
35530#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
35531static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
35532#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
35533#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
35534#elif defined(__cplusplus) && __cplusplus >= 201103L
35535#include <mutex>
35536static std::mutex __Pyx_ModuleStateLookup_mutex;
35537#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
35538#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
35539#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
35540#include <threads.h>
35541static mtx_t __Pyx_ModuleStateLookup_mutex;
35542static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
35543static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
35544 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
35545}
35546#define __Pyx_ModuleStateLookup_Lock()\
35547 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
35548 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
35549#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
35550#elif defined(HAVE_PTHREAD_H)
35551#include <pthread.h>
35552static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
35553#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
35554#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
35555#elif defined(_WIN32)
35556#include <Windows.h> // synchapi.h on its own doesn't work
35557static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
35558#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
35559#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
35560#else
35561#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
35562 Requires C standard >= C11, or C++ standard >= C++11,\
35563 or pthreads, or the Windows 32 API, or Python >= 3.13."
35564#endif
35565typedef struct {
35566 int64_t id;
35567 PyObject *module;
35568} __Pyx_InterpreterIdAndModule;
35569typedef struct {
35570 char interpreter_id_as_index;
35571 Py_ssize_t count;
35572 Py_ssize_t allocated;
35573 __Pyx_InterpreterIdAndModule table[1];
35574} __Pyx_ModuleStateLookupData;
35575#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
35576#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35577static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
35578#endif
35579#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35580static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
35581#else
35582static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
35583#endif
35584static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
35585 __Pyx_InterpreterIdAndModule* table,
35586 Py_ssize_t count,
35587 int64_t interpreterId) {
35588 __Pyx_InterpreterIdAndModule* begin = table;
35589 __Pyx_InterpreterIdAndModule* end = begin + count;
35590 if (begin->id == interpreterId) {
35591 return begin;
35592 }
35593 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
35594 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
35595 if (halfway->id == interpreterId) {
35596 return halfway;
35597 }
35598 if (halfway->id < interpreterId) {
35599 begin = halfway;
35600 } else {
35601 end = halfway;
35602 }
35603 }
35604 for (; begin < end; ++begin) {
35605 if (begin->id >= interpreterId) return begin;
35606 }
35607 return begin;
35608}
35609static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
35610 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
35611 if (interpreter_id == -1) return NULL;
35612#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35613 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
35614 {
35615 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
35616 if (likely(data)) {
35617 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
35618 if (likely(data == new_data)) {
35619 goto read_finished;
35620 }
35621 }
35622 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
35623 __Pyx_ModuleStateLookup_Lock();
35624 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
35625 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
35626 __Pyx_ModuleStateLookup_Unlock();
35627 }
35628 read_finished:;
35629#else
35630 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
35631#endif
35632 __Pyx_InterpreterIdAndModule* found = NULL;
35633 if (unlikely(!data)) goto end;
35634 if (data->interpreter_id_as_index) {
35635 if (interpreter_id < data->count) {
35636 found = data->table+interpreter_id;
35637 }
35638 } else {
35639 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
35640 data->table, data->count, interpreter_id);
35641 }
35642 end:
35643 {
35644 PyObject *result=NULL;
35645 if (found && found->id == interpreter_id) {
35646 result = found->module;
35647 }
35648#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35649 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
35650#endif
35651 return result;
35652 }
35653}
35654#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35655static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
35656 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
35657}
35658#else
35659#define __Pyx_ModuleStateLookup_wait_until_no_readers()
35660#endif
35661static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
35662 Py_ssize_t to_allocate = (*old_data)->allocated;
35663 while (to_allocate <= interpreter_id) {
35664 if (to_allocate == 0) to_allocate = 1;
35665 else to_allocate *= 2;
35666 }
35667 __Pyx_ModuleStateLookupData *new_data = *old_data;
35668 if (to_allocate != (*old_data)->allocated) {
35669 new_data = (__Pyx_ModuleStateLookupData *)realloc(
35670 *old_data,
35671 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
35672 if (!new_data) {
35673 PyErr_NoMemory();
35674 return -1;
35675 }
35676 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
35677 new_data->table[i].id = i;
35678 new_data->table[i].module = NULL;
35679 }
35680 new_data->allocated = to_allocate;
35681 }
35682 new_data->table[interpreter_id].module = module;
35683 if (new_data->count < interpreter_id+1) {
35684 new_data->count = interpreter_id+1;
35685 }
35686 *old_data = new_data;
35687 return 0;
35688}
35689static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
35690 __Pyx_InterpreterIdAndModule *read = data->table;
35691 __Pyx_InterpreterIdAndModule *write = data->table;
35692 __Pyx_InterpreterIdAndModule *end = read + data->count;
35693 for (; read<end; ++read) {
35694 if (read->module) {
35695 write->id = read->id;
35696 write->module = read->module;
35697 ++write;
35698 }
35699 }
35700 data->count = write - data->table;
35701 for (; write<end; ++write) {
35702 write->id = 0;
35703 write->module = NULL;
35704 }
35705 data->interpreter_id_as_index = 0;
35706}
35707static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
35708 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
35709 if (interpreter_id == -1) return -1;
35710 int result = 0;
35711 __Pyx_ModuleStateLookup_Lock();
35712#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35713 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
35714 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
35715#else
35716 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
35717#endif
35718 __Pyx_ModuleStateLookupData *new_data = old_data;
35719 if (!new_data) {
35720 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
35721 if (!new_data) {
35722 result = -1;
35723 PyErr_NoMemory();
35724 goto end;
35725 }
35726 new_data->allocated = 1;
35727 new_data->interpreter_id_as_index = 1;
35728 }
35729 __Pyx_ModuleStateLookup_wait_until_no_readers();
35730 if (new_data->interpreter_id_as_index) {
35731 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
35732 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
35733 goto end;
35734 }
35735 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
35736 }
35737 {
35738 Py_ssize_t insert_at = 0;
35739 {
35740 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
35741 new_data->table, new_data->count, interpreter_id);
35742 assert(lower_bound);
35743 insert_at = lower_bound - new_data->table;
35744 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
35745 lower_bound->module = module;
35746 goto end; // already in table, nothing more to do
35747 }
35748 }
35749 if (new_data->count+1 >= new_data->allocated) {
35750 Py_ssize_t to_allocate = (new_data->count+1)*2;
35751 new_data =
35752 (__Pyx_ModuleStateLookupData*)realloc(
35753 new_data,
35754 sizeof(__Pyx_ModuleStateLookupData) +
35755 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
35756 if (!new_data) {
35757 result = -1;
35758 new_data = old_data;
35759 PyErr_NoMemory();
35760 goto end;
35761 }
35762 new_data->allocated = to_allocate;
35763 }
35764 ++new_data->count;
35765 int64_t last_id = interpreter_id;
35766 PyObject *last_module = module;
35767 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
35768 int64_t current_id = new_data->table[i].id;
35769 new_data->table[i].id = last_id;
35770 last_id = current_id;
35771 PyObject *current_module = new_data->table[i].module;
35772 new_data->table[i].module = last_module;
35773 last_module = current_module;
35774 }
35775 }
35776 end:
35777#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35778 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
35779#else
35780 __Pyx_ModuleStateLookup_data = new_data;
35781#endif
35782 __Pyx_ModuleStateLookup_Unlock();
35783 return result;
35784}
35785static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
35786 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
35787 if (interpreter_id == -1) return -1;
35788 __Pyx_ModuleStateLookup_Lock();
35789#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35790 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
35791 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
35792#else
35793 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
35794#endif
35795 if (data->interpreter_id_as_index) {
35796 if (interpreter_id < data->count) {
35797 data->table[interpreter_id].module = NULL;
35798 }
35799 goto done;
35800 }
35801 {
35802 __Pyx_ModuleStateLookup_wait_until_no_readers();
35803 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
35804 data->table, data->count, interpreter_id);
35805 if (!lower_bound) goto done;
35806 if (lower_bound->id != interpreter_id) goto done;
35807 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
35808 for (;lower_bound<end-1; ++lower_bound) {
35809 lower_bound->id = (lower_bound+1)->id;
35810 lower_bound->module = (lower_bound+1)->module;
35811 }
35812 }
35813 --data->count;
35814 if (data->count == 0) {
35815 free(data);
35816 data = NULL;
35817 }
35818 done:
35819#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
35820 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
35821#else
35822 __Pyx_ModuleStateLookup_data = data;
35823#endif
35824 __Pyx_ModuleStateLookup_Unlock();
35825 return 0;
35826}
35827#endif
35828
35829/* #### Code section: utility_code_pragmas_end ### */
35830#ifdef _MSC_VER
35831#pragma warning( pop )
35832#endif
35833
35834
35835
35836/* #### Code section: end ### */
35837#endif /* Py_PYTHON_H */
Int n
Definition Headers.h:28
Double T
Definition Headers.h:87
Double r
Definition Headers.h:83
Int number
Definition Headers.h:33
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
#define sign(x, y)
Definition jf.h:44
#define c(i)
Definition jf.h:21