proteus  1.8.1
C/C++/Fortran libraries
cSubsurfaceTransportCoefficients.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.30 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89  #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
90  #endif
91 #elif defined(PYSTON_VERSION)
92  #define CYTHON_COMPILING_IN_PYPY 0
93  #define CYTHON_COMPILING_IN_PYSTON 1
94  #define CYTHON_COMPILING_IN_CPYTHON 0
95  #ifndef CYTHON_USE_TYPE_SLOTS
96  #define CYTHON_USE_TYPE_SLOTS 1
97  #endif
98  #undef CYTHON_USE_PYTYPE_LOOKUP
99  #define CYTHON_USE_PYTYPE_LOOKUP 0
100  #undef CYTHON_USE_ASYNC_SLOTS
101  #define CYTHON_USE_ASYNC_SLOTS 0
102  #undef CYTHON_USE_PYLIST_INTERNALS
103  #define CYTHON_USE_PYLIST_INTERNALS 0
104  #ifndef CYTHON_USE_UNICODE_INTERNALS
105  #define CYTHON_USE_UNICODE_INTERNALS 1
106  #endif
107  #undef CYTHON_USE_UNICODE_WRITER
108  #define CYTHON_USE_UNICODE_WRITER 0
109  #undef CYTHON_USE_PYLONG_INTERNALS
110  #define CYTHON_USE_PYLONG_INTERNALS 0
111  #ifndef CYTHON_AVOID_BORROWED_REFS
112  #define CYTHON_AVOID_BORROWED_REFS 0
113  #endif
114  #ifndef CYTHON_ASSUME_SAFE_MACROS
115  #define CYTHON_ASSUME_SAFE_MACROS 1
116  #endif
117  #ifndef CYTHON_UNPACK_METHODS
118  #define CYTHON_UNPACK_METHODS 1
119  #endif
120  #undef CYTHON_FAST_THREAD_STATE
121  #define CYTHON_FAST_THREAD_STATE 0
122  #undef CYTHON_FAST_PYCALL
123  #define CYTHON_FAST_PYCALL 0
124  #undef CYTHON_PEP489_MULTI_PHASE_INIT
125  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126  #undef CYTHON_USE_TP_FINALIZE
127  #define CYTHON_USE_TP_FINALIZE 0
128  #undef CYTHON_USE_DICT_VERSIONS
129  #define CYTHON_USE_DICT_VERSIONS 0
130  #undef CYTHON_USE_EXC_INFO_STACK
131  #define CYTHON_USE_EXC_INFO_STACK 0
132  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
134  #endif
135 #else
136  #define CYTHON_COMPILING_IN_PYPY 0
137  #define CYTHON_COMPILING_IN_PYSTON 0
138  #define CYTHON_COMPILING_IN_CPYTHON 1
139  #ifndef CYTHON_USE_TYPE_SLOTS
140  #define CYTHON_USE_TYPE_SLOTS 1
141  #endif
142  #if PY_VERSION_HEX < 0x02070000
143  #undef CYTHON_USE_PYTYPE_LOOKUP
144  #define CYTHON_USE_PYTYPE_LOOKUP 0
145  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146  #define CYTHON_USE_PYTYPE_LOOKUP 1
147  #endif
148  #if PY_MAJOR_VERSION < 3
149  #undef CYTHON_USE_ASYNC_SLOTS
150  #define CYTHON_USE_ASYNC_SLOTS 0
151  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152  #define CYTHON_USE_ASYNC_SLOTS 1
153  #endif
154  #if PY_VERSION_HEX < 0x02070000
155  #undef CYTHON_USE_PYLONG_INTERNALS
156  #define CYTHON_USE_PYLONG_INTERNALS 0
157  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158  #define CYTHON_USE_PYLONG_INTERNALS 1
159  #endif
160  #ifndef CYTHON_USE_PYLIST_INTERNALS
161  #define CYTHON_USE_PYLIST_INTERNALS 1
162  #endif
163  #ifndef CYTHON_USE_UNICODE_INTERNALS
164  #define CYTHON_USE_UNICODE_INTERNALS 1
165  #endif
166  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167  #undef CYTHON_USE_UNICODE_WRITER
168  #define CYTHON_USE_UNICODE_WRITER 0
169  #elif !defined(CYTHON_USE_UNICODE_WRITER)
170  #define CYTHON_USE_UNICODE_WRITER 1
171  #endif
172  #ifndef CYTHON_AVOID_BORROWED_REFS
173  #define CYTHON_AVOID_BORROWED_REFS 0
174  #endif
175  #ifndef CYTHON_ASSUME_SAFE_MACROS
176  #define CYTHON_ASSUME_SAFE_MACROS 1
177  #endif
178  #ifndef CYTHON_UNPACK_METHODS
179  #define CYTHON_UNPACK_METHODS 1
180  #endif
181  #if PY_VERSION_HEX >= 0x030B00A4
182  #undef CYTHON_FAST_THREAD_STATE
183  #define CYTHON_FAST_THREAD_STATE 0
184  #elif !defined(CYTHON_FAST_THREAD_STATE)
185  #define CYTHON_FAST_THREAD_STATE 1
186  #endif
187  #ifndef CYTHON_FAST_PYCALL
188  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
189  #endif
190  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
192  #endif
193  #ifndef CYTHON_USE_TP_FINALIZE
194  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
195  #endif
196  #ifndef CYTHON_USE_DICT_VERSIONS
197  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
198  #endif
199  #if PY_VERSION_HEX >= 0x030B00A4
200  #undef CYTHON_USE_EXC_INFO_STACK
201  #define CYTHON_USE_EXC_INFO_STACK 0
202  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
204  #endif
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
207  #endif
208 #endif
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
211 #endif
212 #if CYTHON_USE_PYLONG_INTERNALS
213  #if PY_MAJOR_VERSION < 3
214  #include "longintrepr.h"
215  #endif
216  #undef SHIFT
217  #undef BASE
218  #undef MASK
219  #ifdef SIZEOF_VOID_P
220  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221  #endif
222 #endif
223 #ifndef __has_attribute
224  #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227  #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230  #if defined(__GNUC__)
231  #define CYTHON_RESTRICT __restrict__
232  #elif defined(_MSC_VER) && _MSC_VER >= 1400
233  #define CYTHON_RESTRICT __restrict
234  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235  #define CYTHON_RESTRICT restrict
236  #else
237  #define CYTHON_RESTRICT
238  #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
244 # else
245 # define CYTHON_UNUSED
246 # endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 # define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 # else
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 # endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
263 # else
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269  #ifndef _MSC_STDINT_H_
270  #if _MSC_VER < 1300
271  typedef unsigned char uint8_t;
272  typedef unsigned int uint32_t;
273  #else
274  typedef unsigned __int8 uint8_t;
275  typedef unsigned __int32 uint32_t;
276  #endif
277  #endif
278 #else
279  #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282  #if defined(__cplusplus) && __cplusplus >= 201103L
283  #if __has_cpp_attribute(fallthrough)
284  #define CYTHON_FALLTHROUGH [[fallthrough]]
285  #elif __has_cpp_attribute(clang::fallthrough)
286  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287  #elif __has_cpp_attribute(gnu::fallthrough)
288  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289  #endif
290  #endif
291  #ifndef CYTHON_FALLTHROUGH
292  #if __has_attribute(fallthrough)
293  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294  #else
295  #define CYTHON_FALLTHROUGH
296  #endif
297  #endif
298  #if defined(__clang__ ) && defined(__apple_build_version__)
299  #if __apple_build_version__ < 7000000
300  #undef CYTHON_FALLTHROUGH
301  #define CYTHON_FALLTHROUGH
302  #endif
303  #endif
304 #endif
305 
306 #ifndef __cplusplus
307  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
308 #endif
309 #ifndef CYTHON_INLINE
310  #if defined(__clang__)
311  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312  #else
313  #define CYTHON_INLINE inline
314  #endif
315 #endif
316 template<typename T>
317 void __Pyx_call_destructor(T& x) {
318  x.~T();
319 }
320 template<typename T>
321 class __Pyx_FakeReference {
322  public:
323  __Pyx_FakeReference() : ptr(NULL) { }
324  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
325  T *operator->() { return ptr; }
326  T *operator&() { return ptr; }
327  operator T&() { return *ptr; }
328  template<typename U> bool operator ==(U other) { return *ptr == other; }
329  template<typename U> bool operator !=(U other) { return *ptr != other; }
330  private:
331  T *ptr;
332 };
333 
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335  #define Py_OptimizeFlag 0
336 #endif
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343  #define __Pyx_DefaultClassType PyClass_Type
344 #else
345  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346  #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
349  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
350  PyObject *fv, PyObject *cell, PyObject* fn,
351  PyObject *name, int fline, PyObject *lnos) {
352  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354  const char *fn_cstr=NULL;
355  const char *name_cstr=NULL;
356  PyCodeObject* co=NULL;
357  PyObject *type, *value, *traceback;
358  PyErr_Fetch(&type, &value, &traceback);
359  if (!(kwds=PyDict_New())) goto end;
360  if (!(argcount=PyLong_FromLong(a))) goto end;
361  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
362  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
363  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
364  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
365  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
366  if (!(nlocals=PyLong_FromLong(l))) goto end;
367  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
368  if (!(stacksize=PyLong_FromLong(s))) goto end;
369  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
370  if (!(flags=PyLong_FromLong(f))) goto end;
371  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
372  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
373  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
374  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
375  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
376  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
377  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
378  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
379  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
380  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
381  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
382  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
383  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
384  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
385  Py_XDECREF((PyObject*)co);
386  co = (PyCodeObject*)call_result;
387  call_result = NULL;
388  if (0) {
389  cleanup_code_too:
390  Py_XDECREF((PyObject*)co);
391  co = NULL;
392  }
393  end:
394  Py_XDECREF(kwds);
395  Py_XDECREF(argcount);
396  Py_XDECREF(posonlyargcount);
397  Py_XDECREF(kwonlyargcount);
398  Py_XDECREF(nlocals);
399  Py_XDECREF(stacksize);
400  Py_XDECREF(replace);
401  Py_XDECREF(call_result);
402  Py_XDECREF(empty);
403  if (type) {
404  PyErr_Restore(type, value, traceback);
405  }
406  return co;
407  }
408 #else
409  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
411 #endif
412  #define __Pyx_DefaultClassType PyType_Type
413 #endif
414 #ifndef Py_TPFLAGS_CHECKTYPES
415  #define Py_TPFLAGS_CHECKTYPES 0
416 #endif
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418  #define Py_TPFLAGS_HAVE_INDEX 0
419 #endif
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
422 #endif
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424  #define Py_TPFLAGS_HAVE_FINALIZE 0
425 #endif
426 #ifndef METH_STACKLESS
427  #define METH_STACKLESS 0
428 #endif
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430  #ifndef METH_FASTCALL
431  #define METH_FASTCALL 0x80
432  #endif
433  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
434  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
435  Py_ssize_t nargs, PyObject *kwnames);
436 #else
437  #define __Pyx_PyCFunctionFast _PyCFunctionFast
438  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
439 #endif
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
443 #else
444 #define __Pyx_PyFastCFunction_Check(func) 0
445 #endif
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447  #define PyObject_Malloc(s) PyMem_Malloc(s)
448  #define PyObject_Free(p) PyMem_Free(p)
449  #define PyObject_Realloc(p) PyMem_Realloc(p)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454  #define PyMem_RawFree(p) PyMem_Free(p)
455 #endif
456 #if CYTHON_COMPILING_IN_PYSTON
457  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
459 #else
460  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
462 #endif
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464  #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468  #define __Pyx_PyThreadState_Current PyThreadState_GET()
469 #else
470  #define __Pyx_PyThreadState_Current _PyThreadState_Current
471 #endif
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
477  *key = PyThread_create_key();
478  return 0;
479 }
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
481  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
482  *key = Py_tss_NEEDS_INIT;
483  return key;
484 }
485 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
486  PyObject_Free(key);
487 }
488 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
489  return *key != Py_tss_NEEDS_INIT;
490 }
491 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
492  PyThread_delete_key(*key);
493  *key = Py_tss_NEEDS_INIT;
494 }
495 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
496  return PyThread_set_key_value(*key, value);
497 }
498 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
499  return PyThread_get_key_value(*key);
500 }
501 #endif
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
504 #else
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
506 #endif
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
510 #else
511  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
513 #endif
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
516 #else
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
518 #endif
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520  #define CYTHON_PEP393_ENABLED 1
521  #if defined(PyUnicode_IS_READY)
522  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523  0 : _PyUnicode_Ready((PyObject *)(op)))
524  #else
525  #define __Pyx_PyUnicode_READY(op) (0)
526  #endif
527  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
537  #else
538  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
539  #endif
540  #else
541  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
542  #endif
543 #else
544  #define CYTHON_PEP393_ENABLED 0
545  #define PyUnicode_1BYTE_KIND 1
546  #define PyUnicode_2BYTE_KIND 2
547  #define PyUnicode_4BYTE_KIND 4
548  #define __Pyx_PyUnicode_READY(op) (0)
549  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY
559  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
561 #else
562  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
565 #endif
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
568 #endif
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
571 #endif
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
574 #endif
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
579 #else
580  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
581 #endif
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583  #define PyObject_ASCII(o) PyObject_Repr(o)
584 #endif
585 #if PY_MAJOR_VERSION >= 3
586  #define PyBaseString_Type PyUnicode_Type
587  #define PyStringObject PyUnicodeObject
588  #define PyString_Type PyUnicode_Type
589  #define PyString_Check PyUnicode_Check
590  #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592  #define PyObject_Unicode PyObject_Str
593 #endif
594 #endif
595 #if PY_MAJOR_VERSION >= 3
596  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
598 #else
599  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
601 #endif
602 #ifndef PySet_CheckExact
603  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
604 #endif
605 #if PY_VERSION_HEX >= 0x030900A4
606  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
608 #else
609  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
611 #endif
612 #if CYTHON_ASSUME_SAFE_MACROS
613  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
614 #else
615  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
616 #endif
617 #if PY_MAJOR_VERSION >= 3
618  #define PyIntObject PyLongObject
619  #define PyInt_Type PyLong_Type
620  #define PyInt_Check(op) PyLong_Check(op)
621  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622  #define PyInt_FromString PyLong_FromString
623  #define PyInt_FromUnicode PyLong_FromUnicode
624  #define PyInt_FromLong PyLong_FromLong
625  #define PyInt_FromSize_t PyLong_FromSize_t
626  #define PyInt_FromSsize_t PyLong_FromSsize_t
627  #define PyInt_AsLong PyLong_AsLong
628  #define PyInt_AS_LONG PyLong_AS_LONG
629  #define PyInt_AsSsize_t PyLong_AsSsize_t
630  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632  #define PyNumber_Int PyNumber_Long
633 #endif
634 #if PY_MAJOR_VERSION >= 3
635  #define PyBoolObject PyLongObject
636 #endif
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638  #ifndef PyUnicode_InternFromString
639  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
640  #endif
641 #endif
642 #if PY_VERSION_HEX < 0x030200A4
643  typedef long Py_hash_t;
644  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
646 #else
647  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
649 #endif
650 #if PY_MAJOR_VERSION >= 3
651  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
652 #else
653  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
654 #endif
655 #if CYTHON_USE_ASYNC_SLOTS
656  #if PY_VERSION_HEX >= 0x030500B1
657  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
659  #else
660  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
661  #endif
662 #else
663  #define __Pyx_PyType_AsAsync(obj) NULL
664 #endif
665 #ifndef __Pyx_PyAsyncMethodsStruct
666  typedef struct {
667  unaryfunc am_await;
668  unaryfunc am_aiter;
669  unaryfunc am_anext;
670  } __Pyx_PyAsyncMethodsStruct;
671 #endif
672 
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674  #if !defined(_USE_MATH_DEFINES)
675  #define _USE_MATH_DEFINES
676  #endif
677 #endif
678 #include <math.h>
679 #ifdef NAN
680 #define __PYX_NAN() ((float) NAN)
681 #else
682 static CYTHON_INLINE float __PYX_NAN() {
683  float value;
684  memset(&value, 0xFF, sizeof(value));
685  return value;
686 }
687 #endif
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
690 #else
691 #define __Pyx_truncl truncl
692 #endif
693 
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
698 
699 #ifndef __PYX_EXTERN_C
700  #ifdef __cplusplus
701  #define __PYX_EXTERN_C extern "C"
702  #else
703  #define __PYX_EXTERN_C extern
704  #endif
705 #endif
706 
707 #define __PYX_HAVE__cSubsurfaceTransportCoefficients
708 #define __PYX_HAVE_API__cSubsurfaceTransportCoefficients
709 /* Early includes */
710 #include <string.h>
711 #include <stdio.h>
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
717 
718  /* NumPy API declarations from "numpy/__init__.pxd" */
719 
721 #ifdef _OPENMP
722 #include <omp.h>
723 #endif /* _OPENMP */
724 
725 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
726 #define CYTHON_WITHOUT_ASSERTIONS
727 #endif
728 
729 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
730  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
731 
732 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
733 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
735 #define __PYX_DEFAULT_STRING_ENCODING ""
736 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
737 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
738 #define __Pyx_uchar_cast(c) ((unsigned char)c)
739 #define __Pyx_long_cast(x) ((long)x)
740 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
741  (sizeof(type) < sizeof(Py_ssize_t)) ||\
742  (sizeof(type) > sizeof(Py_ssize_t) &&\
743  likely(v < (type)PY_SSIZE_T_MAX ||\
744  v == (type)PY_SSIZE_T_MAX) &&\
745  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
746  v == (type)PY_SSIZE_T_MIN))) ||\
747  (sizeof(type) == sizeof(Py_ssize_t) &&\
748  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
749  v == (type)PY_SSIZE_T_MAX))) )
750 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
751  return (size_t) i < (size_t) limit;
752 }
753 #if defined (__cplusplus) && __cplusplus >= 201103L
754  #include <cstdlib>
755  #define __Pyx_sst_abs(value) std::abs(value)
756 #elif SIZEOF_INT >= SIZEOF_SIZE_T
757  #define __Pyx_sst_abs(value) abs(value)
758 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
759  #define __Pyx_sst_abs(value) labs(value)
760 #elif defined (_MSC_VER)
761  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
762 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
763  #define __Pyx_sst_abs(value) llabs(value)
764 #elif defined (__GNUC__)
765  #define __Pyx_sst_abs(value) __builtin_llabs(value)
766 #else
767  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
768 #endif
769 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
770 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
771 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
772 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
773 #define __Pyx_PyBytes_FromString PyBytes_FromString
774 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
775 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
776 #if PY_MAJOR_VERSION < 3
777  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
778  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
779 #else
780  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
781  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
782 #endif
783 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
784 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
785 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
790 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
791 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
795 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
796 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
797 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
798 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
799 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
800  const Py_UNICODE *u_end = u;
801  while (*u_end++) ;
802  return (size_t)(u_end - u - 1);
803 }
804 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
805 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
806 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
807 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
808 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
809 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
810 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
811 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
812 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
813 #define __Pyx_PySequence_Tuple(obj)\
814  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
815 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
816 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
817 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
818 #if CYTHON_ASSUME_SAFE_MACROS
819 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
820 #else
821 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
822 #endif
823 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
824 #if PY_MAJOR_VERSION >= 3
825 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
826 #else
827 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
828 #endif
829 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
830 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
831 static int __Pyx_sys_getdefaultencoding_not_ascii;
832 static int __Pyx_init_sys_getdefaultencoding_params(void) {
833  PyObject* sys;
834  PyObject* default_encoding = NULL;
835  PyObject* ascii_chars_u = NULL;
836  PyObject* ascii_chars_b = NULL;
837  const char* default_encoding_c;
838  sys = PyImport_ImportModule("sys");
839  if (!sys) goto bad;
840  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
841  Py_DECREF(sys);
842  if (!default_encoding) goto bad;
843  default_encoding_c = PyBytes_AsString(default_encoding);
844  if (!default_encoding_c) goto bad;
845  if (strcmp(default_encoding_c, "ascii") == 0) {
846  __Pyx_sys_getdefaultencoding_not_ascii = 0;
847  } else {
848  char ascii_chars[128];
849  int c;
850  for (c = 0; c < 128; c++) {
851  ascii_chars[c] = c;
852  }
853  __Pyx_sys_getdefaultencoding_not_ascii = 1;
854  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
855  if (!ascii_chars_u) goto bad;
856  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
857  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
858  PyErr_Format(
859  PyExc_ValueError,
860  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
861  default_encoding_c);
862  goto bad;
863  }
864  Py_DECREF(ascii_chars_u);
865  Py_DECREF(ascii_chars_b);
866  }
867  Py_DECREF(default_encoding);
868  return 0;
869 bad:
870  Py_XDECREF(default_encoding);
871  Py_XDECREF(ascii_chars_u);
872  Py_XDECREF(ascii_chars_b);
873  return -1;
874 }
875 #endif
876 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
877 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
878 #else
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
880 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
881 static char* __PYX_DEFAULT_STRING_ENCODING;
882 static int __Pyx_init_sys_getdefaultencoding_params(void) {
883  PyObject* sys;
884  PyObject* default_encoding = NULL;
885  char* default_encoding_c;
886  sys = PyImport_ImportModule("sys");
887  if (!sys) goto bad;
888  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
889  Py_DECREF(sys);
890  if (!default_encoding) goto bad;
891  default_encoding_c = PyBytes_AsString(default_encoding);
892  if (!default_encoding_c) goto bad;
893  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
894  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
895  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
896  Py_DECREF(default_encoding);
897  return 0;
898 bad:
899  Py_XDECREF(default_encoding);
900  return -1;
901 }
902 #endif
903 #endif
904 
905 
906 /* Test for GCC > 2.95 */
907 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
908  #define likely(x) __builtin_expect(!!(x), 1)
909  #define unlikely(x) __builtin_expect(!!(x), 0)
910 #else /* !__GNUC__ or GCC < 2.95 */
911  #define likely(x) (x)
912  #define unlikely(x) (x)
913 #endif /* __GNUC__ */
914 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
915 
916 static PyObject *__pyx_m = NULL;
917 static PyObject *__pyx_d;
918 static PyObject *__pyx_b;
919 static PyObject *__pyx_cython_runtime = NULL;
920 static PyObject *__pyx_empty_tuple;
921 static PyObject *__pyx_empty_bytes;
922 static PyObject *__pyx_empty_unicode;
923 static int __pyx_lineno;
924 static int __pyx_clineno = 0;
925 static const char * __pyx_cfilenm= __FILE__;
926 static const char *__pyx_filename;
927 
928 /* Header.proto */
929 #if !defined(CYTHON_CCOMPLEX)
930  #if defined(__cplusplus)
931  #define CYTHON_CCOMPLEX 1
932  #elif defined(_Complex_I)
933  #define CYTHON_CCOMPLEX 1
934  #else
935  #define CYTHON_CCOMPLEX 0
936  #endif
937 #endif
938 #if CYTHON_CCOMPLEX
939  #ifdef __cplusplus
940  #include <complex>
941  #else
942  #include <complex.h>
943  #endif
944 #endif
945 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
946  #undef _Complex_I
947  #define _Complex_I 1.0fj
948 #endif
949 
950 
951 static const char *__pyx_f[] = {
952  "proteus/cSubsurfaceTransportCoefficients.pyx",
953  "__init__.pxd",
954  "type.pxd",
955 };
956 
957 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
958  * # in Cython to enable them only on the right systems.
959  *
960  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
961  * ctypedef npy_int16 int16_t
962  * ctypedef npy_int32 int32_t
963  */
964 typedef npy_int8 __pyx_t_5numpy_int8_t;
965 
966 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
967  *
968  * ctypedef npy_int8 int8_t
969  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
970  * ctypedef npy_int32 int32_t
971  * ctypedef npy_int64 int64_t
972  */
973 typedef npy_int16 __pyx_t_5numpy_int16_t;
974 
975 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
976  * ctypedef npy_int8 int8_t
977  * ctypedef npy_int16 int16_t
978  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
979  * ctypedef npy_int64 int64_t
980  * #ctypedef npy_int96 int96_t
981  */
982 typedef npy_int32 __pyx_t_5numpy_int32_t;
983 
984 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
985  * ctypedef npy_int16 int16_t
986  * ctypedef npy_int32 int32_t
987  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
988  * #ctypedef npy_int96 int96_t
989  * #ctypedef npy_int128 int128_t
990  */
991 typedef npy_int64 __pyx_t_5numpy_int64_t;
992 
993 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
994  * #ctypedef npy_int128 int128_t
995  *
996  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
997  * ctypedef npy_uint16 uint16_t
998  * ctypedef npy_uint32 uint32_t
999  */
1000 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1001 
1002 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1003  *
1004  * ctypedef npy_uint8 uint8_t
1005  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1006  * ctypedef npy_uint32 uint32_t
1007  * ctypedef npy_uint64 uint64_t
1008  */
1009 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1010 
1011 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1012  * ctypedef npy_uint8 uint8_t
1013  * ctypedef npy_uint16 uint16_t
1014  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1015  * ctypedef npy_uint64 uint64_t
1016  * #ctypedef npy_uint96 uint96_t
1017  */
1018 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1019 
1020 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1021  * ctypedef npy_uint16 uint16_t
1022  * ctypedef npy_uint32 uint32_t
1023  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1024  * #ctypedef npy_uint96 uint96_t
1025  * #ctypedef npy_uint128 uint128_t
1026  */
1027 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1028 
1029 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1030  * #ctypedef npy_uint128 uint128_t
1031  *
1032  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1033  * ctypedef npy_float64 float64_t
1034  * #ctypedef npy_float80 float80_t
1035  */
1036 typedef npy_float32 __pyx_t_5numpy_float32_t;
1037 
1038 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1039  *
1040  * ctypedef npy_float32 float32_t
1041  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1042  * #ctypedef npy_float80 float80_t
1043  * #ctypedef npy_float128 float128_t
1044  */
1045 typedef npy_float64 __pyx_t_5numpy_float64_t;
1046 
1047 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1048  * # The int types are mapped a bit surprising --
1049  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1050  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1051  * ctypedef npy_longlong long_t
1052  * ctypedef npy_longlong longlong_t
1053  */
1054 typedef npy_long __pyx_t_5numpy_int_t;
1055 
1056 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1057  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1058  * ctypedef npy_long int_t
1059  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1060  * ctypedef npy_longlong longlong_t
1061  *
1062  */
1063 typedef npy_longlong __pyx_t_5numpy_long_t;
1064 
1065 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1066  * ctypedef npy_long int_t
1067  * ctypedef npy_longlong long_t
1068  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1069  *
1070  * ctypedef npy_ulong uint_t
1071  */
1072 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1073 
1074 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1075  * ctypedef npy_longlong longlong_t
1076  *
1077  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1078  * ctypedef npy_ulonglong ulong_t
1079  * ctypedef npy_ulonglong ulonglong_t
1080  */
1081 typedef npy_ulong __pyx_t_5numpy_uint_t;
1082 
1083 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1084  *
1085  * ctypedef npy_ulong uint_t
1086  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1087  * ctypedef npy_ulonglong ulonglong_t
1088  *
1089  */
1090 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1091 
1092 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1093  * ctypedef npy_ulong uint_t
1094  * ctypedef npy_ulonglong ulong_t
1095  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1096  *
1097  * ctypedef npy_intp intp_t
1098  */
1099 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1100 
1101 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1102  * ctypedef npy_ulonglong ulonglong_t
1103  *
1104  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1105  * ctypedef npy_uintp uintp_t
1106  *
1107  */
1108 typedef npy_intp __pyx_t_5numpy_intp_t;
1109 
1110 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1111  *
1112  * ctypedef npy_intp intp_t
1113  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1114  *
1115  * ctypedef npy_double float_t
1116  */
1117 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1118 
1119 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1120  * ctypedef npy_uintp uintp_t
1121  *
1122  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1123  * ctypedef npy_double double_t
1124  * ctypedef npy_longdouble longdouble_t
1125  */
1126 typedef npy_double __pyx_t_5numpy_float_t;
1127 
1128 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1129  *
1130  * ctypedef npy_double float_t
1131  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1132  * ctypedef npy_longdouble longdouble_t
1133  *
1134  */
1135 typedef npy_double __pyx_t_5numpy_double_t;
1136 
1137 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1138  * ctypedef npy_double float_t
1139  * ctypedef npy_double double_t
1140  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1141  *
1142  * ctypedef npy_cfloat cfloat_t
1143  */
1144 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1145 /* Declarations.proto */
1146 #if CYTHON_CCOMPLEX
1147  #ifdef __cplusplus
1148  typedef ::std::complex< float > __pyx_t_float_complex;
1149  #else
1150  typedef float _Complex __pyx_t_float_complex;
1151  #endif
1152 #else
1153  typedef struct { float real, imag; } __pyx_t_float_complex;
1154 #endif
1155 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1156 
1157 /* Declarations.proto */
1158 #if CYTHON_CCOMPLEX
1159  #ifdef __cplusplus
1160  typedef ::std::complex< double > __pyx_t_double_complex;
1161  #else
1162  typedef double _Complex __pyx_t_double_complex;
1163  #endif
1164 #else
1165  typedef struct { double real, imag; } __pyx_t_double_complex;
1166 #endif
1167 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1168 
1169 
1170 /*--- Type declarations ---*/
1171 
1172 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1173  * ctypedef npy_longdouble longdouble_t
1174  *
1175  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1176  * ctypedef npy_cdouble cdouble_t
1177  * ctypedef npy_clongdouble clongdouble_t
1178  */
1179 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1180 
1181 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1182  *
1183  * ctypedef npy_cfloat cfloat_t
1184  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1185  * ctypedef npy_clongdouble clongdouble_t
1186  *
1187  */
1188 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1189 
1190 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1191  * ctypedef npy_cfloat cfloat_t
1192  * ctypedef npy_cdouble cdouble_t
1193  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1194  *
1195  * ctypedef npy_cdouble complex_t
1196  */
1197 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1198 
1199 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1200  * ctypedef npy_clongdouble clongdouble_t
1201  *
1202  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1203  *
1204  * cdef inline object PyArray_MultiIterNew1(a):
1205  */
1206 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1207 
1208 /* --- Runtime support code (head) --- */
1209 /* Refnanny.proto */
1210 #ifndef CYTHON_REFNANNY
1211  #define CYTHON_REFNANNY 0
1212 #endif
1213 #if CYTHON_REFNANNY
1214  typedef struct {
1215  void (*INCREF)(void*, PyObject*, int);
1216  void (*DECREF)(void*, PyObject*, int);
1217  void (*GOTREF)(void*, PyObject*, int);
1218  void (*GIVEREF)(void*, PyObject*, int);
1219  void* (*SetupContext)(const char*, int, const char*);
1220  void (*FinishContext)(void**);
1221  } __Pyx_RefNannyAPIStruct;
1222  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1223  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1224  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1225 #ifdef WITH_THREAD
1226  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1227  if (acquire_gil) {\
1228  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1229  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1230  PyGILState_Release(__pyx_gilstate_save);\
1231  } else {\
1232  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1233  }
1234 #else
1235  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1236  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1237 #endif
1238  #define __Pyx_RefNannyFinishContext()\
1239  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1240  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1241  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1242  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1243  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1244  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1245  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1246  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1247  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1248 #else
1249  #define __Pyx_RefNannyDeclarations
1250  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1251  #define __Pyx_RefNannyFinishContext()
1252  #define __Pyx_INCREF(r) Py_INCREF(r)
1253  #define __Pyx_DECREF(r) Py_DECREF(r)
1254  #define __Pyx_GOTREF(r)
1255  #define __Pyx_GIVEREF(r)
1256  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1257  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1258  #define __Pyx_XGOTREF(r)
1259  #define __Pyx_XGIVEREF(r)
1260 #endif
1261 #define __Pyx_XDECREF_SET(r, v) do {\
1262  PyObject *tmp = (PyObject *) r;\
1263  r = v; __Pyx_XDECREF(tmp);\
1264  } while (0)
1265 #define __Pyx_DECREF_SET(r, v) do {\
1266  PyObject *tmp = (PyObject *) r;\
1267  r = v; __Pyx_DECREF(tmp);\
1268  } while (0)
1269 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1270 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1271 
1272 /* RaiseArgTupleInvalid.proto */
1273 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1274  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1275 
1276 /* RaiseDoubleKeywords.proto */
1277 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1278 
1279 /* ParseKeywords.proto */
1280 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1281  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1282  const char* function_name);
1283 
1284 /* ArgTypeTest.proto */
1285 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1286  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1287  __Pyx__ArgTypeTest(obj, type, name, exact))
1288 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1289 
1290 /* PyObjectGetAttrStr.proto */
1291 #if CYTHON_USE_TYPE_SLOTS
1292 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1293 #else
1294 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1295 #endif
1296 
1297 /* GetBuiltinName.proto */
1298 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1299 
1300 /* GetTopmostException.proto */
1301 #if CYTHON_USE_EXC_INFO_STACK
1302 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1303 #endif
1304 
1305 /* PyThreadStateGet.proto */
1306 #if CYTHON_FAST_THREAD_STATE
1307 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1308 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1309 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1310 #else
1311 #define __Pyx_PyThreadState_declare
1312 #define __Pyx_PyThreadState_assign
1313 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1314 #endif
1315 
1316 /* SaveResetException.proto */
1317 #if CYTHON_FAST_THREAD_STATE
1318 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1319 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1320 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1321 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1322 #else
1323 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1324 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1325 #endif
1326 
1327 /* PyErrExceptionMatches.proto */
1328 #if CYTHON_FAST_THREAD_STATE
1329 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1330 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1331 #else
1332 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1333 #endif
1334 
1335 /* GetException.proto */
1336 #if CYTHON_FAST_THREAD_STATE
1337 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1338 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1339 #else
1340 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1341 #endif
1342 
1343 /* PyObjectCall.proto */
1344 #if CYTHON_COMPILING_IN_CPYTHON
1345 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1346 #else
1347 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1348 #endif
1349 
1350 /* PyErrFetchRestore.proto */
1351 #if CYTHON_FAST_THREAD_STATE
1352 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1353 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1354 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1355 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1356 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1357 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1358 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1359 #if CYTHON_COMPILING_IN_CPYTHON
1360 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1361 #else
1362 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1363 #endif
1364 #else
1365 #define __Pyx_PyErr_Clear() PyErr_Clear()
1366 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1367 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1368 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1369 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1370 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1371 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1372 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1373 #endif
1374 
1375 /* RaiseException.proto */
1376 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1377 
1378 /* TypeImport.proto */
1379 #ifndef __PYX_HAVE_RT_ImportType_proto
1380 #define __PYX_HAVE_RT_ImportType_proto
1381 enum __Pyx_ImportType_CheckSize {
1382  __Pyx_ImportType_CheckSize_Error = 0,
1383  __Pyx_ImportType_CheckSize_Warn = 1,
1384  __Pyx_ImportType_CheckSize_Ignore = 2
1385 };
1386 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1387 #endif
1388 
1389 /* Import.proto */
1390 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1391 
1392 /* PyDictVersioning.proto */
1393 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1394 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1395 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1396 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1397  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1398  (cache_var) = (value);
1399 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1400  static PY_UINT64_T __pyx_dict_version = 0;\
1401  static PyObject *__pyx_dict_cached_value = NULL;\
1402  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1403  (VAR) = __pyx_dict_cached_value;\
1404  } else {\
1405  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1406  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1407  }\
1408 }
1409 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1410 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1411 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1412 #else
1413 #define __PYX_GET_DICT_VERSION(dict) (0)
1414 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1415 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1416 #endif
1417 
1418 /* CLineInTraceback.proto */
1419 #ifdef CYTHON_CLINE_IN_TRACEBACK
1420 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1421 #else
1422 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1423 #endif
1424 
1425 /* CodeObjectCache.proto */
1426 typedef struct {
1427  PyCodeObject* code_object;
1428  int code_line;
1429 } __Pyx_CodeObjectCacheEntry;
1430 struct __Pyx_CodeObjectCache {
1431  int count;
1432  int max_count;
1433  __Pyx_CodeObjectCacheEntry* entries;
1434 };
1435 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1436 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1437 static PyCodeObject *__pyx_find_code_object(int code_line);
1438 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1439 
1440 /* AddTraceback.proto */
1441 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1442  int py_line, const char *filename);
1443 
1444 /* GCCDiagnostics.proto */
1445 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1446 #define __Pyx_HAS_GCC_DIAGNOSTIC
1447 #endif
1448 
1449 /* RealImag.proto */
1450 #if CYTHON_CCOMPLEX
1451  #ifdef __cplusplus
1452  #define __Pyx_CREAL(z) ((z).real())
1453  #define __Pyx_CIMAG(z) ((z).imag())
1454  #else
1455  #define __Pyx_CREAL(z) (__real__(z))
1456  #define __Pyx_CIMAG(z) (__imag__(z))
1457  #endif
1458 #else
1459  #define __Pyx_CREAL(z) ((z).real)
1460  #define __Pyx_CIMAG(z) ((z).imag)
1461 #endif
1462 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1463  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1464  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1465  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1466 #else
1467  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1468  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1469 #endif
1470 
1471 /* Arithmetic.proto */
1472 #if CYTHON_CCOMPLEX
1473  #define __Pyx_c_eq_float(a, b) ((a)==(b))
1474  #define __Pyx_c_sum_float(a, b) ((a)+(b))
1475  #define __Pyx_c_diff_float(a, b) ((a)-(b))
1476  #define __Pyx_c_prod_float(a, b) ((a)*(b))
1477  #define __Pyx_c_quot_float(a, b) ((a)/(b))
1478  #define __Pyx_c_neg_float(a) (-(a))
1479  #ifdef __cplusplus
1480  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1481  #define __Pyx_c_conj_float(z) (::std::conj(z))
1482  #if 1
1483  #define __Pyx_c_abs_float(z) (::std::abs(z))
1484  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1485  #endif
1486  #else
1487  #define __Pyx_c_is_zero_float(z) ((z)==0)
1488  #define __Pyx_c_conj_float(z) (conjf(z))
1489  #if 1
1490  #define __Pyx_c_abs_float(z) (cabsf(z))
1491  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1492  #endif
1493  #endif
1494 #else
1495  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1496  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1497  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1498  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1499  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1500  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1501  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1502  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1503  #if 1
1504  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1505  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1506  #endif
1507 #endif
1508 
1509 /* Arithmetic.proto */
1510 #if CYTHON_CCOMPLEX
1511  #define __Pyx_c_eq_double(a, b) ((a)==(b))
1512  #define __Pyx_c_sum_double(a, b) ((a)+(b))
1513  #define __Pyx_c_diff_double(a, b) ((a)-(b))
1514  #define __Pyx_c_prod_double(a, b) ((a)*(b))
1515  #define __Pyx_c_quot_double(a, b) ((a)/(b))
1516  #define __Pyx_c_neg_double(a) (-(a))
1517  #ifdef __cplusplus
1518  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1519  #define __Pyx_c_conj_double(z) (::std::conj(z))
1520  #if 1
1521  #define __Pyx_c_abs_double(z) (::std::abs(z))
1522  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1523  #endif
1524  #else
1525  #define __Pyx_c_is_zero_double(z) ((z)==0)
1526  #define __Pyx_c_conj_double(z) (conj(z))
1527  #if 1
1528  #define __Pyx_c_abs_double(z) (cabs(z))
1529  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1530  #endif
1531  #endif
1532 #else
1533  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1534  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1535  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1536  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1537  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1538  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1539  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1540  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1541  #if 1
1542  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1543  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1544  #endif
1545 #endif
1546 
1547 /* CIntFromPy.proto */
1548 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1549 
1550 /* CIntToPy.proto */
1551 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1552 
1553 /* CIntToPy.proto */
1554 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1555 
1556 /* CIntFromPy.proto */
1557 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1558 
1559 /* FastTypeChecks.proto */
1560 #if CYTHON_COMPILING_IN_CPYTHON
1561 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1562 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1563 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1564 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1565 #else
1566 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1567 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1568 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1569 #endif
1570 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1571 
1572 /* CheckBinaryVersion.proto */
1573 static int __Pyx_check_binary_version(void);
1574 
1575 /* InitStrings.proto */
1576 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1577 
1578 
1579 /* Module declarations from 'cpython.buffer' */
1580 
1581 /* Module declarations from 'libc.string' */
1582 
1583 /* Module declarations from 'libc.stdio' */
1584 
1585 /* Module declarations from '__builtin__' */
1586 
1587 /* Module declarations from 'cpython.type' */
1588 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1589 
1590 /* Module declarations from 'cpython' */
1591 
1592 /* Module declarations from 'cpython.object' */
1593 
1594 /* Module declarations from 'cpython.ref' */
1595 
1596 /* Module declarations from 'cpython.mem' */
1597 
1598 /* Module declarations from 'numpy' */
1599 
1600 /* Module declarations from 'numpy' */
1601 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1602 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1603 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1604 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1605 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1606 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1607 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1608 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1609 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1610 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1611 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1612 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1613 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1614 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1615 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1616 
1617 /* Module declarations from 'SubsurfaceTransportCoefficients' */
1618 
1619 /* Module declarations from 'cSubsurfaceTransportCoefficients' */
1620 #define __Pyx_MODULE_NAME "cSubsurfaceTransportCoefficients"
1621 extern int __pyx_module_is_main_cSubsurfaceTransportCoefficients;
1622 int __pyx_module_is_main_cSubsurfaceTransportCoefficients = 0;
1623 
1624 /* Implementation of 'cSubsurfaceTransportCoefficients' */
1625 static PyObject *__pyx_builtin_ImportError;
1626 static const char __pyx_k_b[] = "b";
1627 static const char __pyx_k_g[] = "g";
1628 static const char __pyx_k_n[] = "n";
1629 static const char __pyx_k_x[] = "x";
1630 static const char __pyx_k_y[] = "y";
1631 static const char __pyx_k_dy[] = "dy";
1632 static const char __pyx_k_np[] = "np";
1633 static const char __pyx_k_xv[] = "xv";
1634 static const char __pyx_k_yv[] = "yv";
1635 static const char __pyx_k_mun[] = "mun";
1636 static const char __pyx_k_muw[] = "muw";
1637 static const char __pyx_k_q_u[] = "q_u";
1638 static const char __pyx_k_Kbar[] = "Kbar";
1639 static const char __pyx_k_bc_u[] = "bc_u";
1640 static const char __pyx_k_flux[] = "flux";
1641 static const char __pyx_k_main[] = "__main__";
1642 static const char __pyx_k_name[] = "__name__";
1643 static const char __pyx_k_q_dV[] = "q_dV";
1644 static const char __pyx_k_test[] = "__test__";
1645 static const char __pyx_k_numpy[] = "numpy";
1646 static const char __pyx_k_omega[] = "omega";
1647 static const char __pyx_k_start[] = "start";
1648 static const char __pyx_k_colind[] = "colind";
1649 static const char __pyx_k_failed[] = "failed";
1650 static const char __pyx_k_import[] = "__import__";
1651 static const char __pyx_k_nSpace[] = "nSpace";
1652 static const char __pyx_k_rowptr[] = "rowptr";
1653 static const char __pyx_k_nParams[] = "nParams";
1654 static const char __pyx_k_rwork_psk[] = "rwork_psk";
1655 static const char __pyx_k_ImportError[] = "ImportError";
1656 static const char __pyx_k_pskModelFlag[] = "pskModelFlag";
1657 static const char __pyx_k_q_lambda_bar[] = "q_lambda_bar";
1658 static const char __pyx_k_safetyFactor[] = "safetyFactor";
1659 static const char __pyx_k_ebq_global_qt[] = "ebq_global_qt";
1660 static const char __pyx_k_isDOFBoundary[] = "isDOFBoundary";
1661 static const char __pyx_k_materialTypes[] = "materialTypes";
1662 static const char __pyx_k_rwork_psk_tol[] = "rwork_psk_tol";
1663 static const char __pyx_k_rwork_density_n[] = "rwork_density_n";
1664 static const char __pyx_k_rwork_density_w[] = "rwork_density_w";
1665 static const char __pyx_k_nElements_global[] = "nElements_global";
1666 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1667 static const char __pyx_k_elementBoundaryElements[] = "elementBoundaryElements";
1668 static const char __pyx_k_exteriorElementBoundaries[] = "exteriorElementBoundaries";
1669 static const char __pyx_k_interiorElementBoundaries[] = "interiorElementBoundaries";
1670 static const char __pyx_k_nQuadraturePoints_element[] = "nQuadraturePoints_element";
1671 static const char __pyx_k_nElementBoundaries_element[] = "nElementBoundaries_element";
1672 static const char __pyx_k_piecewiseLinearTableLookup[] = "piecewiseLinearTableLookup";
1673 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1674 static const char __pyx_k_cSubsurfaceTransportCoefficients[] = "cSubsurfaceTransportCoefficients";
1675 static const char __pyx_k_calculateRusanovFluxSaturationEq[] = "calculateRusanovFluxSaturationEquationIncomp_PWC";
1676 static const char __pyx_k_elementBoundaryLocalElementBound[] = "elementBoundaryLocalElementBoundaries";
1677 static const char __pyx_k_nExteriorElementBoundaries_globa[] = "nExteriorElementBoundaries_global";
1678 static const char __pyx_k_nInteriorElementBoundaries_globa[] = "nInteriorElementBoundaries_global";
1679 static const char __pyx_k_nQuadraturePoints_elementBoundar[] = "nQuadraturePoints_elementBoundary";
1680 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1681 static const char __pyx_k_proteus_cSubsurfaceTransportCoef[] = "proteus/cSubsurfaceTransportCoefficients.pyx";
1682 static PyObject *__pyx_n_s_ImportError;
1683 static PyObject *__pyx_n_s_Kbar;
1684 static PyObject *__pyx_n_s_b;
1685 static PyObject *__pyx_n_s_bc_u;
1686 static PyObject *__pyx_n_s_cSubsurfaceTransportCoefficients;
1687 static PyObject *__pyx_n_s_calculateRusanovFluxSaturationEq;
1688 static PyObject *__pyx_n_s_cline_in_traceback;
1689 static PyObject *__pyx_n_s_colind;
1690 static PyObject *__pyx_n_s_dy;
1691 static PyObject *__pyx_n_s_ebq_global_qt;
1692 static PyObject *__pyx_n_s_elementBoundaryElements;
1693 static PyObject *__pyx_n_s_elementBoundaryLocalElementBound;
1694 static PyObject *__pyx_n_s_exteriorElementBoundaries;
1695 static PyObject *__pyx_n_s_failed;
1696 static PyObject *__pyx_n_s_flux;
1697 static PyObject *__pyx_n_s_g;
1698 static PyObject *__pyx_n_s_import;
1699 static PyObject *__pyx_n_s_interiorElementBoundaries;
1700 static PyObject *__pyx_n_s_isDOFBoundary;
1701 static PyObject *__pyx_n_s_main;
1702 static PyObject *__pyx_n_s_materialTypes;
1703 static PyObject *__pyx_n_s_mun;
1704 static PyObject *__pyx_n_s_muw;
1705 static PyObject *__pyx_n_s_n;
1706 static PyObject *__pyx_n_s_nElementBoundaries_element;
1707 static PyObject *__pyx_n_s_nElements_global;
1708 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
1709 static PyObject *__pyx_n_s_nInteriorElementBoundaries_globa;
1710 static PyObject *__pyx_n_s_nParams;
1711 static PyObject *__pyx_n_s_nQuadraturePoints_element;
1712 static PyObject *__pyx_n_s_nQuadraturePoints_elementBoundar;
1713 static PyObject *__pyx_n_s_nSpace;
1714 static PyObject *__pyx_n_s_name;
1715 static PyObject *__pyx_n_s_np;
1716 static PyObject *__pyx_n_s_numpy;
1717 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1718 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1719 static PyObject *__pyx_n_s_omega;
1720 static PyObject *__pyx_n_s_piecewiseLinearTableLookup;
1721 static PyObject *__pyx_kp_s_proteus_cSubsurfaceTransportCoef;
1722 static PyObject *__pyx_n_s_pskModelFlag;
1723 static PyObject *__pyx_n_s_q_dV;
1724 static PyObject *__pyx_n_s_q_lambda_bar;
1725 static PyObject *__pyx_n_s_q_u;
1726 static PyObject *__pyx_n_s_rowptr;
1727 static PyObject *__pyx_n_s_rwork_density_n;
1728 static PyObject *__pyx_n_s_rwork_density_w;
1729 static PyObject *__pyx_n_s_rwork_psk;
1730 static PyObject *__pyx_n_s_rwork_psk_tol;
1731 static PyObject *__pyx_n_s_safetyFactor;
1732 static PyObject *__pyx_n_s_start;
1733 static PyObject *__pyx_n_s_test;
1734 static PyObject *__pyx_n_s_x;
1735 static PyObject *__pyx_n_s_xv;
1736 static PyObject *__pyx_n_s_y;
1737 static PyObject *__pyx_n_s_yv;
1738 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_calculateRusanovFluxSaturationEquationIncomp_PWC(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_safetyFactor, int __pyx_v_nSpace, int __pyx_v_pskModelFlag, int __pyx_v_nParams, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_materialTypes, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_rwork_psk_tol, PyArrayObject *__pyx_v_rwork_density_w, PyArrayObject *__pyx_v_rwork_density_n, PyArrayObject *__pyx_v_g, PyArrayObject *__pyx_v_ebq_global_qt, PyArrayObject *__pyx_v_q_lambda_bar, int __pyx_v_nElements_global, int __pyx_v_nElementBoundaries_element, int __pyx_v_nInteriorElementBoundaries_global, int __pyx_v_nExteriorElementBoundaries_global, int __pyx_v_nQuadraturePoints_element, int __pyx_v_nQuadraturePoints_elementBoundary, PyArrayObject *__pyx_v_interiorElementBoundaries, PyArrayObject *__pyx_v_exteriorElementBoundaries, PyArrayObject *__pyx_v_elementBoundaryElements, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundaries, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_dV, PyArrayObject *__pyx_v_isDOFBoundary, PyArrayObject *__pyx_v_bc_u, PyArrayObject *__pyx_v_flux); /* proto */
1739 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_2piecewiseLinearTableLookup(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, PyArrayObject *__pyx_v_xv, PyArrayObject *__pyx_v_yv, int __pyx_v_start); /* proto */
1740 static PyObject *__pyx_tuple_;
1741 static PyObject *__pyx_tuple__2;
1742 static PyObject *__pyx_tuple__3;
1743 static PyObject *__pyx_tuple__5;
1744 static PyObject *__pyx_codeobj__4;
1745 static PyObject *__pyx_codeobj__6;
1746 /* Late includes */
1747 
1748 /* "cSubsurfaceTransportCoefficients.pyx":6
1749  * cimport SubsurfaceTransportCoefficients as cppsstc
1750  *
1751  * def calculateRusanovFluxSaturationEquationIncomp_PWC( # <<<<<<<<<<<<<<
1752  * double safetyFactor,
1753  * int nSpace,
1754  */
1755 
1756 /* Python wrapper */
1757 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1758 static PyMethodDef __pyx_mdef_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC = {"calculateRusanovFluxSaturationEquationIncomp_PWC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC, METH_VARARGS|METH_KEYWORDS, 0};
1759 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1760  double __pyx_v_safetyFactor;
1761  int __pyx_v_nSpace;
1762  int __pyx_v_pskModelFlag;
1763  int __pyx_v_nParams;
1764  PyArrayObject *__pyx_v_rowptr = 0;
1765  PyArrayObject *__pyx_v_colind = 0;
1766  PyArrayObject *__pyx_v_materialTypes = 0;
1767  double __pyx_v_muw;
1768  double __pyx_v_mun;
1769  PyArrayObject *__pyx_v_omega = 0;
1770  PyArrayObject *__pyx_v_Kbar = 0;
1771  double __pyx_v_b;
1772  PyArrayObject *__pyx_v_rwork_psk = 0;
1773  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
1774  PyArrayObject *__pyx_v_rwork_density_w = 0;
1775  PyArrayObject *__pyx_v_rwork_density_n = 0;
1776  PyArrayObject *__pyx_v_g = 0;
1777  PyArrayObject *__pyx_v_ebq_global_qt = 0;
1778  PyArrayObject *__pyx_v_q_lambda_bar = 0;
1779  int __pyx_v_nElements_global;
1780  int __pyx_v_nElementBoundaries_element;
1781  int __pyx_v_nInteriorElementBoundaries_global;
1782  int __pyx_v_nExteriorElementBoundaries_global;
1783  int __pyx_v_nQuadraturePoints_element;
1784  int __pyx_v_nQuadraturePoints_elementBoundary;
1785  PyArrayObject *__pyx_v_interiorElementBoundaries = 0;
1786  PyArrayObject *__pyx_v_exteriorElementBoundaries = 0;
1787  PyArrayObject *__pyx_v_elementBoundaryElements = 0;
1788  PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundaries = 0;
1789  PyArrayObject *__pyx_v_n = 0;
1790  PyArrayObject *__pyx_v_q_u = 0;
1791  PyArrayObject *__pyx_v_q_dV = 0;
1792  PyArrayObject *__pyx_v_isDOFBoundary = 0;
1793  PyArrayObject *__pyx_v_bc_u = 0;
1794  PyArrayObject *__pyx_v_flux = 0;
1795  int __pyx_lineno = 0;
1796  const char *__pyx_filename = NULL;
1797  int __pyx_clineno = 0;
1798  PyObject *__pyx_r = 0;
1799  __Pyx_RefNannyDeclarations
1800  __Pyx_RefNannySetupContext("calculateRusanovFluxSaturationEquationIncomp_PWC (wrapper)", 0);
1801  {
1802  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_safetyFactor,&__pyx_n_s_nSpace,&__pyx_n_s_pskModelFlag,&__pyx_n_s_nParams,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_materialTypes,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_rwork_psk,&__pyx_n_s_rwork_psk_tol,&__pyx_n_s_rwork_density_w,&__pyx_n_s_rwork_density_n,&__pyx_n_s_g,&__pyx_n_s_ebq_global_qt,&__pyx_n_s_q_lambda_bar,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_nInteriorElementBoundaries_globa,&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_nQuadraturePoints_element,&__pyx_n_s_nQuadraturePoints_elementBoundar,&__pyx_n_s_interiorElementBoundaries,&__pyx_n_s_exteriorElementBoundaries,&__pyx_n_s_elementBoundaryElements,&__pyx_n_s_elementBoundaryLocalElementBound,&__pyx_n_s_n,&__pyx_n_s_q_u,&__pyx_n_s_q_dV,&__pyx_n_s_isDOFBoundary,&__pyx_n_s_bc_u,&__pyx_n_s_flux,0};
1803  PyObject* values[35] = {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,0,0,0,0,0,0,0,0,0};
1804  if (unlikely(__pyx_kwds)) {
1805  Py_ssize_t kw_args;
1806  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1807  switch (pos_args) {
1808  case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
1809  CYTHON_FALLTHROUGH;
1810  case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
1811  CYTHON_FALLTHROUGH;
1812  case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
1813  CYTHON_FALLTHROUGH;
1814  case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
1815  CYTHON_FALLTHROUGH;
1816  case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
1817  CYTHON_FALLTHROUGH;
1818  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
1819  CYTHON_FALLTHROUGH;
1820  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
1821  CYTHON_FALLTHROUGH;
1822  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
1823  CYTHON_FALLTHROUGH;
1824  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
1825  CYTHON_FALLTHROUGH;
1826  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
1827  CYTHON_FALLTHROUGH;
1828  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
1829  CYTHON_FALLTHROUGH;
1830  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
1831  CYTHON_FALLTHROUGH;
1832  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
1833  CYTHON_FALLTHROUGH;
1834  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
1835  CYTHON_FALLTHROUGH;
1836  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
1837  CYTHON_FALLTHROUGH;
1838  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
1839  CYTHON_FALLTHROUGH;
1840  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
1841  CYTHON_FALLTHROUGH;
1842  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
1843  CYTHON_FALLTHROUGH;
1844  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
1845  CYTHON_FALLTHROUGH;
1846  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
1847  CYTHON_FALLTHROUGH;
1848  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
1849  CYTHON_FALLTHROUGH;
1850  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
1851  CYTHON_FALLTHROUGH;
1852  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
1853  CYTHON_FALLTHROUGH;
1854  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
1855  CYTHON_FALLTHROUGH;
1856  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
1857  CYTHON_FALLTHROUGH;
1858  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
1859  CYTHON_FALLTHROUGH;
1860  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
1861  CYTHON_FALLTHROUGH;
1862  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
1863  CYTHON_FALLTHROUGH;
1864  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1865  CYTHON_FALLTHROUGH;
1866  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1867  CYTHON_FALLTHROUGH;
1868  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1869  CYTHON_FALLTHROUGH;
1870  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1871  CYTHON_FALLTHROUGH;
1872  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1873  CYTHON_FALLTHROUGH;
1874  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1875  CYTHON_FALLTHROUGH;
1876  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1877  CYTHON_FALLTHROUGH;
1878  case 0: break;
1879  default: goto __pyx_L5_argtuple_error;
1880  }
1881  kw_args = PyDict_Size(__pyx_kwds);
1882  switch (pos_args) {
1883  case 0:
1884  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safetyFactor)) != 0)) kw_args--;
1885  else goto __pyx_L5_argtuple_error;
1886  CYTHON_FALLTHROUGH;
1887  case 1:
1888  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
1889  else {
1890  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 1); __PYX_ERR(0, 6, __pyx_L3_error)
1891  }
1892  CYTHON_FALLTHROUGH;
1893  case 2:
1894  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
1895  else {
1896  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 2); __PYX_ERR(0, 6, __pyx_L3_error)
1897  }
1898  CYTHON_FALLTHROUGH;
1899  case 3:
1900  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nParams)) != 0)) kw_args--;
1901  else {
1902  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 3); __PYX_ERR(0, 6, __pyx_L3_error)
1903  }
1904  CYTHON_FALLTHROUGH;
1905  case 4:
1906  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
1907  else {
1908  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 4); __PYX_ERR(0, 6, __pyx_L3_error)
1909  }
1910  CYTHON_FALLTHROUGH;
1911  case 5:
1912  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
1913  else {
1914  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 5); __PYX_ERR(0, 6, __pyx_L3_error)
1915  }
1916  CYTHON_FALLTHROUGH;
1917  case 6:
1918  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_materialTypes)) != 0)) kw_args--;
1919  else {
1920  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 6); __PYX_ERR(0, 6, __pyx_L3_error)
1921  }
1922  CYTHON_FALLTHROUGH;
1923  case 7:
1924  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
1925  else {
1926  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 7); __PYX_ERR(0, 6, __pyx_L3_error)
1927  }
1928  CYTHON_FALLTHROUGH;
1929  case 8:
1930  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
1931  else {
1932  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 8); __PYX_ERR(0, 6, __pyx_L3_error)
1933  }
1934  CYTHON_FALLTHROUGH;
1935  case 9:
1936  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
1937  else {
1938  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 9); __PYX_ERR(0, 6, __pyx_L3_error)
1939  }
1940  CYTHON_FALLTHROUGH;
1941  case 10:
1942  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
1943  else {
1944  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 10); __PYX_ERR(0, 6, __pyx_L3_error)
1945  }
1946  CYTHON_FALLTHROUGH;
1947  case 11:
1948  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
1949  else {
1950  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 11); __PYX_ERR(0, 6, __pyx_L3_error)
1951  }
1952  CYTHON_FALLTHROUGH;
1953  case 12:
1954  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
1955  else {
1956  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 12); __PYX_ERR(0, 6, __pyx_L3_error)
1957  }
1958  CYTHON_FALLTHROUGH;
1959  case 13:
1960  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
1961  else {
1962  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 13); __PYX_ERR(0, 6, __pyx_L3_error)
1963  }
1964  CYTHON_FALLTHROUGH;
1965  case 14:
1966  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
1967  else {
1968  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 14); __PYX_ERR(0, 6, __pyx_L3_error)
1969  }
1970  CYTHON_FALLTHROUGH;
1971  case 15:
1972  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
1973  else {
1974  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 15); __PYX_ERR(0, 6, __pyx_L3_error)
1975  }
1976  CYTHON_FALLTHROUGH;
1977  case 16:
1978  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
1979  else {
1980  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 16); __PYX_ERR(0, 6, __pyx_L3_error)
1981  }
1982  CYTHON_FALLTHROUGH;
1983  case 17:
1984  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_qt)) != 0)) kw_args--;
1985  else {
1986  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 17); __PYX_ERR(0, 6, __pyx_L3_error)
1987  }
1988  CYTHON_FALLTHROUGH;
1989  case 18:
1990  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_lambda_bar)) != 0)) kw_args--;
1991  else {
1992  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 18); __PYX_ERR(0, 6, __pyx_L3_error)
1993  }
1994  CYTHON_FALLTHROUGH;
1995  case 19:
1996  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
1997  else {
1998  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 19); __PYX_ERR(0, 6, __pyx_L3_error)
1999  }
2000  CYTHON_FALLTHROUGH;
2001  case 20:
2002  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
2003  else {
2004  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 20); __PYX_ERR(0, 6, __pyx_L3_error)
2005  }
2006  CYTHON_FALLTHROUGH;
2007  case 21:
2008  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nInteriorElementBoundaries_globa)) != 0)) kw_args--;
2009  else {
2010  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 21); __PYX_ERR(0, 6, __pyx_L3_error)
2011  }
2012  CYTHON_FALLTHROUGH;
2013  case 22:
2014  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2015  else {
2016  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 22); __PYX_ERR(0, 6, __pyx_L3_error)
2017  }
2018  CYTHON_FALLTHROUGH;
2019  case 23:
2020  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nQuadraturePoints_element)) != 0)) kw_args--;
2021  else {
2022  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 23); __PYX_ERR(0, 6, __pyx_L3_error)
2023  }
2024  CYTHON_FALLTHROUGH;
2025  case 24:
2026  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nQuadraturePoints_elementBoundar)) != 0)) kw_args--;
2027  else {
2028  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 24); __PYX_ERR(0, 6, __pyx_L3_error)
2029  }
2030  CYTHON_FALLTHROUGH;
2031  case 25:
2032  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interiorElementBoundaries)) != 0)) kw_args--;
2033  else {
2034  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 25); __PYX_ERR(0, 6, __pyx_L3_error)
2035  }
2036  CYTHON_FALLTHROUGH;
2037  case 26:
2038  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundaries)) != 0)) kw_args--;
2039  else {
2040  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 26); __PYX_ERR(0, 6, __pyx_L3_error)
2041  }
2042  CYTHON_FALLTHROUGH;
2043  case 27:
2044  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElements)) != 0)) kw_args--;
2045  else {
2046  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 27); __PYX_ERR(0, 6, __pyx_L3_error)
2047  }
2048  CYTHON_FALLTHROUGH;
2049  case 28:
2050  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryLocalElementBound)) != 0)) kw_args--;
2051  else {
2052  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 28); __PYX_ERR(0, 6, __pyx_L3_error)
2053  }
2054  CYTHON_FALLTHROUGH;
2055  case 29:
2056  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
2057  else {
2058  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 29); __PYX_ERR(0, 6, __pyx_L3_error)
2059  }
2060  CYTHON_FALLTHROUGH;
2061  case 30:
2062  if (likely((values[30] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
2063  else {
2064  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 30); __PYX_ERR(0, 6, __pyx_L3_error)
2065  }
2066  CYTHON_FALLTHROUGH;
2067  case 31:
2068  if (likely((values[31] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dV)) != 0)) kw_args--;
2069  else {
2070  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 31); __PYX_ERR(0, 6, __pyx_L3_error)
2071  }
2072  CYTHON_FALLTHROUGH;
2073  case 32:
2074  if (likely((values[32] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isDOFBoundary)) != 0)) kw_args--;
2075  else {
2076  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 32); __PYX_ERR(0, 6, __pyx_L3_error)
2077  }
2078  CYTHON_FALLTHROUGH;
2079  case 33:
2080  if (likely((values[33] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bc_u)) != 0)) kw_args--;
2081  else {
2082  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 33); __PYX_ERR(0, 6, __pyx_L3_error)
2083  }
2084  CYTHON_FALLTHROUGH;
2085  case 34:
2086  if (likely((values[34] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
2087  else {
2088  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 34); __PYX_ERR(0, 6, __pyx_L3_error)
2089  }
2090  }
2091  if (unlikely(kw_args > 0)) {
2092  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateRusanovFluxSaturationEquationIncomp_PWC") < 0)) __PYX_ERR(0, 6, __pyx_L3_error)
2093  }
2094  } else if (PyTuple_GET_SIZE(__pyx_args) != 35) {
2095  goto __pyx_L5_argtuple_error;
2096  } else {
2097  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2098  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2099  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2100  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2101  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2102  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2103  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2104  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2105  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2106  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2107  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2108  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2109  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2110  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2111  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2112  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
2113  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
2114  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
2115  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
2116  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
2117  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
2118  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
2119  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
2120  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
2121  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
2122  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
2123  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
2124  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
2125  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
2126  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
2127  values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
2128  values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
2129  values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
2130  values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
2131  values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
2132  }
2133  __pyx_v_safetyFactor = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_safetyFactor == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L3_error)
2134  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8, __pyx_L3_error)
2135  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9, __pyx_L3_error)
2136  __pyx_v_nParams = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nParams == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error)
2137  __pyx_v_rowptr = ((PyArrayObject *)values[4]);
2138  __pyx_v_colind = ((PyArrayObject *)values[5]);
2139  __pyx_v_materialTypes = ((PyArrayObject *)values[6]);
2140  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
2141  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error)
2142  __pyx_v_omega = ((PyArrayObject *)values[9]);
2143  __pyx_v_Kbar = ((PyArrayObject *)values[10]);
2144  __pyx_v_b = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2145  __pyx_v_rwork_psk = ((PyArrayObject *)values[12]);
2146  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[13]);
2147  __pyx_v_rwork_density_w = ((PyArrayObject *)values[14]);
2148  __pyx_v_rwork_density_n = ((PyArrayObject *)values[15]);
2149  __pyx_v_g = ((PyArrayObject *)values[16]);
2150  __pyx_v_ebq_global_qt = ((PyArrayObject *)values[17]);
2151  __pyx_v_q_lambda_bar = ((PyArrayObject *)values[18]);
2152  __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[19]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error)
2153  __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[20]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
2154  __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[21]); if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
2155  __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[22]); if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2156  __pyx_v_nQuadraturePoints_element = __Pyx_PyInt_As_int(values[23]); if (unlikely((__pyx_v_nQuadraturePoints_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error)
2157  __pyx_v_nQuadraturePoints_elementBoundary = __Pyx_PyInt_As_int(values[24]); if (unlikely((__pyx_v_nQuadraturePoints_elementBoundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
2158  __pyx_v_interiorElementBoundaries = ((PyArrayObject *)values[25]);
2159  __pyx_v_exteriorElementBoundaries = ((PyArrayObject *)values[26]);
2160  __pyx_v_elementBoundaryElements = ((PyArrayObject *)values[27]);
2161  __pyx_v_elementBoundaryLocalElementBoundaries = ((PyArrayObject *)values[28]);
2162  __pyx_v_n = ((PyArrayObject *)values[29]);
2163  __pyx_v_q_u = ((PyArrayObject *)values[30]);
2164  __pyx_v_q_dV = ((PyArrayObject *)values[31]);
2165  __pyx_v_isDOFBoundary = ((PyArrayObject *)values[32]);
2166  __pyx_v_bc_u = ((PyArrayObject *)values[33]);
2167  __pyx_v_flux = ((PyArrayObject *)values[34]);
2168  }
2169  goto __pyx_L4_argument_unpacking_done;
2170  __pyx_L5_argtuple_error:;
2171  __Pyx_RaiseArgtupleInvalid("calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6, __pyx_L3_error)
2172  __pyx_L3_error:;
2173  __Pyx_AddTraceback("cSubsurfaceTransportCoefficients.calculateRusanovFluxSaturationEquationIncomp_PWC", __pyx_clineno, __pyx_lineno, __pyx_filename);
2174  __Pyx_RefNannyFinishContext();
2175  return NULL;
2176  __pyx_L4_argument_unpacking_done:;
2177  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 11, __pyx_L1_error)
2178  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 12, __pyx_L1_error)
2179  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_materialTypes), __pyx_ptype_5numpy_ndarray, 1, "materialTypes", 0))) __PYX_ERR(0, 13, __pyx_L1_error)
2180  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 16, __pyx_L1_error)
2181  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 17, __pyx_L1_error)
2182  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2183  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2184  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2185  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2186  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 23, __pyx_L1_error)
2187  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_qt), __pyx_ptype_5numpy_ndarray, 1, "ebq_global_qt", 0))) __PYX_ERR(0, 24, __pyx_L1_error)
2188  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_lambda_bar), __pyx_ptype_5numpy_ndarray, 1, "q_lambda_bar", 0))) __PYX_ERR(0, 25, __pyx_L1_error)
2189  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundaries), __pyx_ptype_5numpy_ndarray, 1, "interiorElementBoundaries", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2190  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaries), __pyx_ptype_5numpy_ndarray, 1, "exteriorElementBoundaries", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
2191  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElements), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryElements", 0))) __PYX_ERR(0, 34, __pyx_L1_error)
2192  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundaries), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryLocalElementBoundaries", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
2193  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1, "n", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
2194  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1, "q_u", 0))) __PYX_ERR(0, 37, __pyx_L1_error)
2195  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dV), __pyx_ptype_5numpy_ndarray, 1, "q_dV", 0))) __PYX_ERR(0, 38, __pyx_L1_error)
2196  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isDOFBoundary), __pyx_ptype_5numpy_ndarray, 1, "isDOFBoundary", 0))) __PYX_ERR(0, 39, __pyx_L1_error)
2197  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bc_u), __pyx_ptype_5numpy_ndarray, 1, "bc_u", 0))) __PYX_ERR(0, 40, __pyx_L1_error)
2198  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1, "flux", 0))) __PYX_ERR(0, 41, __pyx_L1_error)
2199  __pyx_r = __pyx_pf_32cSubsurfaceTransportCoefficients_calculateRusanovFluxSaturationEquationIncomp_PWC(__pyx_self, __pyx_v_safetyFactor, __pyx_v_nSpace, __pyx_v_pskModelFlag, __pyx_v_nParams, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_materialTypes, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_rwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_ebq_global_qt, __pyx_v_q_lambda_bar, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_nQuadraturePoints_element, __pyx_v_nQuadraturePoints_elementBoundary, __pyx_v_interiorElementBoundaries, __pyx_v_exteriorElementBoundaries, __pyx_v_elementBoundaryElements, __pyx_v_elementBoundaryLocalElementBoundaries, __pyx_v_n, __pyx_v_q_u, __pyx_v_q_dV, __pyx_v_isDOFBoundary, __pyx_v_bc_u, __pyx_v_flux);
2200 
2201  /* function exit code */
2202  goto __pyx_L0;
2203  __pyx_L1_error:;
2204  __pyx_r = NULL;
2205  __pyx_L0:;
2206  __Pyx_RefNannyFinishContext();
2207  return __pyx_r;
2208 }
2209 
2210 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_calculateRusanovFluxSaturationEquationIncomp_PWC(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_safetyFactor, int __pyx_v_nSpace, int __pyx_v_pskModelFlag, int __pyx_v_nParams, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_materialTypes, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_rwork_psk_tol, PyArrayObject *__pyx_v_rwork_density_w, PyArrayObject *__pyx_v_rwork_density_n, PyArrayObject *__pyx_v_g, PyArrayObject *__pyx_v_ebq_global_qt, PyArrayObject *__pyx_v_q_lambda_bar, int __pyx_v_nElements_global, int __pyx_v_nElementBoundaries_element, int __pyx_v_nInteriorElementBoundaries_global, int __pyx_v_nExteriorElementBoundaries_global, int __pyx_v_nQuadraturePoints_element, int __pyx_v_nQuadraturePoints_elementBoundary, PyArrayObject *__pyx_v_interiorElementBoundaries, PyArrayObject *__pyx_v_exteriorElementBoundaries, PyArrayObject *__pyx_v_elementBoundaryElements, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundaries, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_dV, PyArrayObject *__pyx_v_isDOFBoundary, PyArrayObject *__pyx_v_bc_u, PyArrayObject *__pyx_v_flux) {
2211  int __pyx_v_failed;
2212  PyObject *__pyx_r = NULL;
2213  __Pyx_RefNannyDeclarations
2214  int __pyx_lineno = 0;
2215  const char *__pyx_filename = NULL;
2216  int __pyx_clineno = 0;
2217  __Pyx_RefNannySetupContext("calculateRusanovFluxSaturationEquationIncomp_PWC", 0);
2218 
2219  /* "cSubsurfaceTransportCoefficients.pyx":42
2220  * np.ndarray bc_u,
2221  * np.ndarray flux):
2222  * cdef int failed = cppsstc.calculateRusanovFluxSaturationEquationIncomp_PWC( # <<<<<<<<<<<<<<
2223  * safetyFactor,
2224  * nSpace,
2225  */
2226  __pyx_v_failed = calculateRusanovFluxSaturationEquationIncomp_PWC(__pyx_v_safetyFactor, __pyx_v_nSpace, __pyx_v_pskModelFlag, __pyx_v_nParams, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_materialTypes->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, ((double *)__pyx_v_rwork_psk->data), ((double *)__pyx_v_rwork_psk_tol->data), ((double *)__pyx_v_rwork_density_w->data), ((double *)__pyx_v_rwork_density_n->data), ((double *)__pyx_v_g->data), ((double *)__pyx_v_ebq_global_qt->data), ((double *)__pyx_v_q_lambda_bar->data), __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_nQuadraturePoints_element, __pyx_v_nQuadraturePoints_elementBoundary, ((int *)__pyx_v_interiorElementBoundaries->data), ((int *)__pyx_v_exteriorElementBoundaries->data), ((int *)__pyx_v_elementBoundaryElements->data), ((int *)__pyx_v_elementBoundaryLocalElementBoundaries->data), ((double *)__pyx_v_n->data), ((double *)__pyx_v_q_u->data), ((double *)__pyx_v_q_dV->data), ((int *)__pyx_v_isDOFBoundary->data), ((double *)__pyx_v_bc_u->data), ((double *)__pyx_v_flux->data));
2227 
2228  /* "cSubsurfaceTransportCoefficients.pyx":78
2229  * <double*>(bc_u.data),
2230  * <double*>(flux.data))
2231  * assert failed==0 # <<<<<<<<<<<<<<
2232  *
2233  * def piecewiseLinearTableLookup(double x,
2234  */
2235  #ifndef CYTHON_WITHOUT_ASSERTIONS
2236  if (unlikely(!Py_OptimizeFlag)) {
2237  if (unlikely(!((__pyx_v_failed == 0) != 0))) {
2238  PyErr_SetNone(PyExc_AssertionError);
2239  __PYX_ERR(0, 78, __pyx_L1_error)
2240  }
2241  }
2242  #endif
2243 
2244  /* "cSubsurfaceTransportCoefficients.pyx":6
2245  * cimport SubsurfaceTransportCoefficients as cppsstc
2246  *
2247  * def calculateRusanovFluxSaturationEquationIncomp_PWC( # <<<<<<<<<<<<<<
2248  * double safetyFactor,
2249  * int nSpace,
2250  */
2251 
2252  /* function exit code */
2253  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2254  goto __pyx_L0;
2255  __pyx_L1_error:;
2256  __Pyx_AddTraceback("cSubsurfaceTransportCoefficients.calculateRusanovFluxSaturationEquationIncomp_PWC", __pyx_clineno, __pyx_lineno, __pyx_filename);
2257  __pyx_r = NULL;
2258  __pyx_L0:;
2259  __Pyx_XGIVEREF(__pyx_r);
2260  __Pyx_RefNannyFinishContext();
2261  return __pyx_r;
2262 }
2263 
2264 /* "cSubsurfaceTransportCoefficients.pyx":80
2265  * assert failed==0
2266  *
2267  * def piecewiseLinearTableLookup(double x, # <<<<<<<<<<<<<<
2268  * np.ndarray xv,
2269  * np.ndarray yv,
2270  */
2271 
2272 /* Python wrapper */
2273 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2274 static PyMethodDef __pyx_mdef_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup = {"piecewiseLinearTableLookup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup, METH_VARARGS|METH_KEYWORDS, 0};
2275 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2276  double __pyx_v_x;
2277  PyArrayObject *__pyx_v_xv = 0;
2278  PyArrayObject *__pyx_v_yv = 0;
2279  int __pyx_v_start;
2280  int __pyx_lineno = 0;
2281  const char *__pyx_filename = NULL;
2282  int __pyx_clineno = 0;
2283  PyObject *__pyx_r = 0;
2284  __Pyx_RefNannyDeclarations
2285  __Pyx_RefNannySetupContext("piecewiseLinearTableLookup (wrapper)", 0);
2286  {
2287  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xv,&__pyx_n_s_yv,&__pyx_n_s_start,0};
2288  PyObject* values[4] = {0,0,0,0};
2289  if (unlikely(__pyx_kwds)) {
2290  Py_ssize_t kw_args;
2291  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2292  switch (pos_args) {
2293  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2294  CYTHON_FALLTHROUGH;
2295  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2296  CYTHON_FALLTHROUGH;
2297  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2298  CYTHON_FALLTHROUGH;
2299  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2300  CYTHON_FALLTHROUGH;
2301  case 0: break;
2302  default: goto __pyx_L5_argtuple_error;
2303  }
2304  kw_args = PyDict_Size(__pyx_kwds);
2305  switch (pos_args) {
2306  case 0:
2307  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
2308  else goto __pyx_L5_argtuple_error;
2309  CYTHON_FALLTHROUGH;
2310  case 1:
2311  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xv)) != 0)) kw_args--;
2312  else {
2313  __Pyx_RaiseArgtupleInvalid("piecewiseLinearTableLookup", 0, 3, 4, 1); __PYX_ERR(0, 80, __pyx_L3_error)
2314  }
2315  CYTHON_FALLTHROUGH;
2316  case 2:
2317  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yv)) != 0)) kw_args--;
2318  else {
2319  __Pyx_RaiseArgtupleInvalid("piecewiseLinearTableLookup", 0, 3, 4, 2); __PYX_ERR(0, 80, __pyx_L3_error)
2320  }
2321  CYTHON_FALLTHROUGH;
2322  case 3:
2323  if (kw_args > 0) {
2324  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start);
2325  if (value) { values[3] = value; kw_args--; }
2326  }
2327  }
2328  if (unlikely(kw_args > 0)) {
2329  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "piecewiseLinearTableLookup") < 0)) __PYX_ERR(0, 80, __pyx_L3_error)
2330  }
2331  } else {
2332  switch (PyTuple_GET_SIZE(__pyx_args)) {
2333  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2334  CYTHON_FALLTHROUGH;
2335  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2336  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2337  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2338  break;
2339  default: goto __pyx_L5_argtuple_error;
2340  }
2341  }
2342  __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
2343  __pyx_v_xv = ((PyArrayObject *)values[1]);
2344  __pyx_v_yv = ((PyArrayObject *)values[2]);
2345  if (values[3]) {
2346  __pyx_v_start = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error)
2347  } else {
2348  __pyx_v_start = ((int)0);
2349  }
2350  }
2351  goto __pyx_L4_argument_unpacking_done;
2352  __pyx_L5_argtuple_error:;
2353  __Pyx_RaiseArgtupleInvalid("piecewiseLinearTableLookup", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 80, __pyx_L3_error)
2354  __pyx_L3_error:;
2355  __Pyx_AddTraceback("cSubsurfaceTransportCoefficients.piecewiseLinearTableLookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
2356  __Pyx_RefNannyFinishContext();
2357  return NULL;
2358  __pyx_L4_argument_unpacking_done:;
2359  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xv), __pyx_ptype_5numpy_ndarray, 1, "xv", 0))) __PYX_ERR(0, 81, __pyx_L1_error)
2360  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yv), __pyx_ptype_5numpy_ndarray, 1, "yv", 0))) __PYX_ERR(0, 82, __pyx_L1_error)
2361  __pyx_r = __pyx_pf_32cSubsurfaceTransportCoefficients_2piecewiseLinearTableLookup(__pyx_self, __pyx_v_x, __pyx_v_xv, __pyx_v_yv, __pyx_v_start);
2362 
2363  /* function exit code */
2364  goto __pyx_L0;
2365  __pyx_L1_error:;
2366  __pyx_r = NULL;
2367  __pyx_L0:;
2368  __Pyx_RefNannyFinishContext();
2369  return __pyx_r;
2370 }
2371 
2372 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_2piecewiseLinearTableLookup(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, PyArrayObject *__pyx_v_xv, PyArrayObject *__pyx_v_yv, int __pyx_v_start) {
2373  double __pyx_v_y;
2374  double __pyx_v_dy;
2375  PyObject *__pyx_r = NULL;
2376  __Pyx_RefNannyDeclarations
2377  PyObject *__pyx_t_1 = NULL;
2378  PyObject *__pyx_t_2 = NULL;
2379  PyObject *__pyx_t_3 = NULL;
2380  PyObject *__pyx_t_4 = NULL;
2381  int __pyx_lineno = 0;
2382  const char *__pyx_filename = NULL;
2383  int __pyx_clineno = 0;
2384  __Pyx_RefNannySetupContext("piecewiseLinearTableLookup", 0);
2385 
2386  /* "cSubsurfaceTransportCoefficients.pyx":84
2387  * np.ndarray yv,
2388  * int start=0):
2389  * cdef double y=0 # <<<<<<<<<<<<<<
2390  * cdef double dy=0
2391  * cppsstc.piecewiseLinearTableLookup(x,
2392  */
2393  __pyx_v_y = 0.0;
2394 
2395  /* "cSubsurfaceTransportCoefficients.pyx":85
2396  * int start=0):
2397  * cdef double y=0
2398  * cdef double dy=0 # <<<<<<<<<<<<<<
2399  * cppsstc.piecewiseLinearTableLookup(x,
2400  * xv.shape[0],
2401  */
2402  __pyx_v_dy = 0.0;
2403 
2404  /* "cSubsurfaceTransportCoefficients.pyx":86
2405  * cdef double y=0
2406  * cdef double dy=0
2407  * cppsstc.piecewiseLinearTableLookup(x, # <<<<<<<<<<<<<<
2408  * xv.shape[0],
2409  * &start,
2410  */
2411  piecewiseLinearTableLookup(__pyx_v_x, (__pyx_v_xv->dimensions[0]), (&__pyx_v_start), (&__pyx_v_y), (&__pyx_v_dy), ((double *)__pyx_v_xv->data), ((double *)__pyx_v_yv->data));
2412 
2413  /* "cSubsurfaceTransportCoefficients.pyx":93
2414  * <double*>(xv.data),
2415  * <double*>(yv.data))
2416  * return (y, dy, start) # <<<<<<<<<<<<<<
2417  */
2418  __Pyx_XDECREF(__pyx_r);
2419  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
2420  __Pyx_GOTREF(__pyx_t_1);
2421  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
2422  __Pyx_GOTREF(__pyx_t_2);
2423  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
2424  __Pyx_GOTREF(__pyx_t_3);
2425  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
2426  __Pyx_GOTREF(__pyx_t_4);
2427  __Pyx_GIVEREF(__pyx_t_1);
2428  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
2429  __Pyx_GIVEREF(__pyx_t_2);
2430  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
2431  __Pyx_GIVEREF(__pyx_t_3);
2432  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
2433  __pyx_t_1 = 0;
2434  __pyx_t_2 = 0;
2435  __pyx_t_3 = 0;
2436  __pyx_r = __pyx_t_4;
2437  __pyx_t_4 = 0;
2438  goto __pyx_L0;
2439 
2440  /* "cSubsurfaceTransportCoefficients.pyx":80
2441  * assert failed==0
2442  *
2443  * def piecewiseLinearTableLookup(double x, # <<<<<<<<<<<<<<
2444  * np.ndarray xv,
2445  * np.ndarray yv,
2446  */
2447 
2448  /* function exit code */
2449  __pyx_L1_error:;
2450  __Pyx_XDECREF(__pyx_t_1);
2451  __Pyx_XDECREF(__pyx_t_2);
2452  __Pyx_XDECREF(__pyx_t_3);
2453  __Pyx_XDECREF(__pyx_t_4);
2454  __Pyx_AddTraceback("cSubsurfaceTransportCoefficients.piecewiseLinearTableLookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
2455  __pyx_r = NULL;
2456  __pyx_L0:;
2457  __Pyx_XGIVEREF(__pyx_r);
2458  __Pyx_RefNannyFinishContext();
2459  return __pyx_r;
2460 }
2461 
2462 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
2463  * ctypedef npy_cdouble complex_t
2464  *
2465  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
2466  * return PyArray_MultiIterNew(1, <void*>a)
2467  *
2468  */
2469 
2470 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
2471  PyObject *__pyx_r = NULL;
2472  __Pyx_RefNannyDeclarations
2473  PyObject *__pyx_t_1 = NULL;
2474  int __pyx_lineno = 0;
2475  const char *__pyx_filename = NULL;
2476  int __pyx_clineno = 0;
2477  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
2478 
2479  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
2480  *
2481  * cdef inline object PyArray_MultiIterNew1(a):
2482  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
2483  *
2484  * cdef inline object PyArray_MultiIterNew2(a, b):
2485  */
2486  __Pyx_XDECREF(__pyx_r);
2487  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
2488  __Pyx_GOTREF(__pyx_t_1);
2489  __pyx_r = __pyx_t_1;
2490  __pyx_t_1 = 0;
2491  goto __pyx_L0;
2492 
2493  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
2494  * ctypedef npy_cdouble complex_t
2495  *
2496  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
2497  * return PyArray_MultiIterNew(1, <void*>a)
2498  *
2499  */
2500 
2501  /* function exit code */
2502  __pyx_L1_error:;
2503  __Pyx_XDECREF(__pyx_t_1);
2504  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
2505  __pyx_r = 0;
2506  __pyx_L0:;
2507  __Pyx_XGIVEREF(__pyx_r);
2508  __Pyx_RefNannyFinishContext();
2509  return __pyx_r;
2510 }
2511 
2512 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
2513  * return PyArray_MultiIterNew(1, <void*>a)
2514  *
2515  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
2516  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2517  *
2518  */
2519 
2520 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
2521  PyObject *__pyx_r = NULL;
2522  __Pyx_RefNannyDeclarations
2523  PyObject *__pyx_t_1 = NULL;
2524  int __pyx_lineno = 0;
2525  const char *__pyx_filename = NULL;
2526  int __pyx_clineno = 0;
2527  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
2528 
2529  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
2530  *
2531  * cdef inline object PyArray_MultiIterNew2(a, b):
2532  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
2533  *
2534  * cdef inline object PyArray_MultiIterNew3(a, b, c):
2535  */
2536  __Pyx_XDECREF(__pyx_r);
2537  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
2538  __Pyx_GOTREF(__pyx_t_1);
2539  __pyx_r = __pyx_t_1;
2540  __pyx_t_1 = 0;
2541  goto __pyx_L0;
2542 
2543  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
2544  * return PyArray_MultiIterNew(1, <void*>a)
2545  *
2546  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
2547  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2548  *
2549  */
2550 
2551  /* function exit code */
2552  __pyx_L1_error:;
2553  __Pyx_XDECREF(__pyx_t_1);
2554  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
2555  __pyx_r = 0;
2556  __pyx_L0:;
2557  __Pyx_XGIVEREF(__pyx_r);
2558  __Pyx_RefNannyFinishContext();
2559  return __pyx_r;
2560 }
2561 
2562 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
2563  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2564  *
2565  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
2566  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2567  *
2568  */
2569 
2570 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
2571  PyObject *__pyx_r = NULL;
2572  __Pyx_RefNannyDeclarations
2573  PyObject *__pyx_t_1 = NULL;
2574  int __pyx_lineno = 0;
2575  const char *__pyx_filename = NULL;
2576  int __pyx_clineno = 0;
2577  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
2578 
2579  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
2580  *
2581  * cdef inline object PyArray_MultiIterNew3(a, b, c):
2582  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
2583  *
2584  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
2585  */
2586  __Pyx_XDECREF(__pyx_r);
2587  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
2588  __Pyx_GOTREF(__pyx_t_1);
2589  __pyx_r = __pyx_t_1;
2590  __pyx_t_1 = 0;
2591  goto __pyx_L0;
2592 
2593  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
2594  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2595  *
2596  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
2597  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2598  *
2599  */
2600 
2601  /* function exit code */
2602  __pyx_L1_error:;
2603  __Pyx_XDECREF(__pyx_t_1);
2604  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
2605  __pyx_r = 0;
2606  __pyx_L0:;
2607  __Pyx_XGIVEREF(__pyx_r);
2608  __Pyx_RefNannyFinishContext();
2609  return __pyx_r;
2610 }
2611 
2612 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
2613  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2614  *
2615  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
2616  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2617  *
2618  */
2619 
2620 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
2621  PyObject *__pyx_r = NULL;
2622  __Pyx_RefNannyDeclarations
2623  PyObject *__pyx_t_1 = NULL;
2624  int __pyx_lineno = 0;
2625  const char *__pyx_filename = NULL;
2626  int __pyx_clineno = 0;
2627  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
2628 
2629  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
2630  *
2631  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
2632  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
2633  *
2634  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
2635  */
2636  __Pyx_XDECREF(__pyx_r);
2637  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
2638  __Pyx_GOTREF(__pyx_t_1);
2639  __pyx_r = __pyx_t_1;
2640  __pyx_t_1 = 0;
2641  goto __pyx_L0;
2642 
2643  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
2644  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2645  *
2646  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
2647  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2648  *
2649  */
2650 
2651  /* function exit code */
2652  __pyx_L1_error:;
2653  __Pyx_XDECREF(__pyx_t_1);
2654  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
2655  __pyx_r = 0;
2656  __pyx_L0:;
2657  __Pyx_XGIVEREF(__pyx_r);
2658  __Pyx_RefNannyFinishContext();
2659  return __pyx_r;
2660 }
2661 
2662 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
2663  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2664  *
2665  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
2666  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2667  *
2668  */
2669 
2670 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
2671  PyObject *__pyx_r = NULL;
2672  __Pyx_RefNannyDeclarations
2673  PyObject *__pyx_t_1 = NULL;
2674  int __pyx_lineno = 0;
2675  const char *__pyx_filename = NULL;
2676  int __pyx_clineno = 0;
2677  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
2678 
2679  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
2680  *
2681  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
2682  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
2683  *
2684  * cdef inline tuple PyDataType_SHAPE(dtype d):
2685  */
2686  __Pyx_XDECREF(__pyx_r);
2687  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
2688  __Pyx_GOTREF(__pyx_t_1);
2689  __pyx_r = __pyx_t_1;
2690  __pyx_t_1 = 0;
2691  goto __pyx_L0;
2692 
2693  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
2694  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2695  *
2696  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
2697  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2698  *
2699  */
2700 
2701  /* function exit code */
2702  __pyx_L1_error:;
2703  __Pyx_XDECREF(__pyx_t_1);
2704  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
2705  __pyx_r = 0;
2706  __pyx_L0:;
2707  __Pyx_XGIVEREF(__pyx_r);
2708  __Pyx_RefNannyFinishContext();
2709  return __pyx_r;
2710 }
2711 
2712 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
2713  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2714  *
2715  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
2716  * if PyDataType_HASSUBARRAY(d):
2717  * return <tuple>d.subarray.shape
2718  */
2719 
2720 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
2721  PyObject *__pyx_r = NULL;
2722  __Pyx_RefNannyDeclarations
2723  int __pyx_t_1;
2724  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
2725 
2726  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
2727  *
2728  * cdef inline tuple PyDataType_SHAPE(dtype d):
2729  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
2730  * return <tuple>d.subarray.shape
2731  * else:
2732  */
2733  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
2734  if (__pyx_t_1) {
2735 
2736  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
2737  * cdef inline tuple PyDataType_SHAPE(dtype d):
2738  * if PyDataType_HASSUBARRAY(d):
2739  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
2740  * else:
2741  * return ()
2742  */
2743  __Pyx_XDECREF(__pyx_r);
2744  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
2745  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
2746  goto __pyx_L0;
2747 
2748  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
2749  *
2750  * cdef inline tuple PyDataType_SHAPE(dtype d):
2751  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
2752  * return <tuple>d.subarray.shape
2753  * else:
2754  */
2755  }
2756 
2757  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
2758  * return <tuple>d.subarray.shape
2759  * else:
2760  * return () # <<<<<<<<<<<<<<
2761  *
2762  *
2763  */
2764  /*else*/ {
2765  __Pyx_XDECREF(__pyx_r);
2766  __Pyx_INCREF(__pyx_empty_tuple);
2767  __pyx_r = __pyx_empty_tuple;
2768  goto __pyx_L0;
2769  }
2770 
2771  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
2772  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2773  *
2774  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
2775  * if PyDataType_HASSUBARRAY(d):
2776  * return <tuple>d.subarray.shape
2777  */
2778 
2779  /* function exit code */
2780  __pyx_L0:;
2781  __Pyx_XGIVEREF(__pyx_r);
2782  __Pyx_RefNannyFinishContext();
2783  return __pyx_r;
2784 }
2785 
2786 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
2787  * int _import_umath() except -1
2788  *
2789  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
2790  * Py_INCREF(base) # important to do this before stealing the reference below!
2791  * PyArray_SetBaseObject(arr, base)
2792  */
2793 
2794 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
2795  __Pyx_RefNannyDeclarations
2796  __Pyx_RefNannySetupContext("set_array_base", 0);
2797 
2798  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
2799  *
2800  * cdef inline void set_array_base(ndarray arr, object base):
2801  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
2802  * PyArray_SetBaseObject(arr, base)
2803  *
2804  */
2805  Py_INCREF(__pyx_v_base);
2806 
2807  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
2808  * cdef inline void set_array_base(ndarray arr, object base):
2809  * Py_INCREF(base) # important to do this before stealing the reference below!
2810  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
2811  *
2812  * cdef inline object get_array_base(ndarray arr):
2813  */
2814  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
2815 
2816  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
2817  * int _import_umath() except -1
2818  *
2819  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
2820  * Py_INCREF(base) # important to do this before stealing the reference below!
2821  * PyArray_SetBaseObject(arr, base)
2822  */
2823 
2824  /* function exit code */
2825  __Pyx_RefNannyFinishContext();
2826 }
2827 
2828 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
2829  * PyArray_SetBaseObject(arr, base)
2830  *
2831  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
2832  * base = PyArray_BASE(arr)
2833  * if base is NULL:
2834  */
2835 
2836 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
2837  PyObject *__pyx_v_base;
2838  PyObject *__pyx_r = NULL;
2839  __Pyx_RefNannyDeclarations
2840  int __pyx_t_1;
2841  __Pyx_RefNannySetupContext("get_array_base", 0);
2842 
2843  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
2844  *
2845  * cdef inline object get_array_base(ndarray arr):
2846  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
2847  * if base is NULL:
2848  * return None
2849  */
2850  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
2851 
2852  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
2853  * cdef inline object get_array_base(ndarray arr):
2854  * base = PyArray_BASE(arr)
2855  * if base is NULL: # <<<<<<<<<<<<<<
2856  * return None
2857  * return <object>base
2858  */
2859  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
2860  if (__pyx_t_1) {
2861 
2862  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
2863  * base = PyArray_BASE(arr)
2864  * if base is NULL:
2865  * return None # <<<<<<<<<<<<<<
2866  * return <object>base
2867  *
2868  */
2869  __Pyx_XDECREF(__pyx_r);
2870  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2871  goto __pyx_L0;
2872 
2873  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
2874  * cdef inline object get_array_base(ndarray arr):
2875  * base = PyArray_BASE(arr)
2876  * if base is NULL: # <<<<<<<<<<<<<<
2877  * return None
2878  * return <object>base
2879  */
2880  }
2881 
2882  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
2883  * if base is NULL:
2884  * return None
2885  * return <object>base # <<<<<<<<<<<<<<
2886  *
2887  * # Versions of the import_* functions which are more suitable for
2888  */
2889  __Pyx_XDECREF(__pyx_r);
2890  __Pyx_INCREF(((PyObject *)__pyx_v_base));
2891  __pyx_r = ((PyObject *)__pyx_v_base);
2892  goto __pyx_L0;
2893 
2894  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
2895  * PyArray_SetBaseObject(arr, base)
2896  *
2897  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
2898  * base = PyArray_BASE(arr)
2899  * if base is NULL:
2900  */
2901 
2902  /* function exit code */
2903  __pyx_L0:;
2904  __Pyx_XGIVEREF(__pyx_r);
2905  __Pyx_RefNannyFinishContext();
2906  return __pyx_r;
2907 }
2908 
2909 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
2910  * # Versions of the import_* functions which are more suitable for
2911  * # Cython code.
2912  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
2913  * try:
2914  * __pyx_import_array()
2915  */
2916 
2917 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
2918  int __pyx_r;
2919  __Pyx_RefNannyDeclarations
2920  PyObject *__pyx_t_1 = NULL;
2921  PyObject *__pyx_t_2 = NULL;
2922  PyObject *__pyx_t_3 = NULL;
2923  int __pyx_t_4;
2924  PyObject *__pyx_t_5 = NULL;
2925  PyObject *__pyx_t_6 = NULL;
2926  PyObject *__pyx_t_7 = NULL;
2927  PyObject *__pyx_t_8 = NULL;
2928  int __pyx_lineno = 0;
2929  const char *__pyx_filename = NULL;
2930  int __pyx_clineno = 0;
2931  __Pyx_RefNannySetupContext("import_array", 0);
2932 
2933  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
2934  * # Cython code.
2935  * cdef inline int import_array() except -1:
2936  * try: # <<<<<<<<<<<<<<
2937  * __pyx_import_array()
2938  * except Exception:
2939  */
2940  {
2941  __Pyx_PyThreadState_declare
2942  __Pyx_PyThreadState_assign
2943  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
2944  __Pyx_XGOTREF(__pyx_t_1);
2945  __Pyx_XGOTREF(__pyx_t_2);
2946  __Pyx_XGOTREF(__pyx_t_3);
2947  /*try:*/ {
2948 
2949  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
2950  * cdef inline int import_array() except -1:
2951  * try:
2952  * __pyx_import_array() # <<<<<<<<<<<<<<
2953  * except Exception:
2954  * raise ImportError("numpy.core.multiarray failed to import")
2955  */
2956  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
2957 
2958  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
2959  * # Cython code.
2960  * cdef inline int import_array() except -1:
2961  * try: # <<<<<<<<<<<<<<
2962  * __pyx_import_array()
2963  * except Exception:
2964  */
2965  }
2966  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2967  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2968  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2969  goto __pyx_L8_try_end;
2970  __pyx_L3_error:;
2971 
2972  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
2973  * try:
2974  * __pyx_import_array()
2975  * except Exception: # <<<<<<<<<<<<<<
2976  * raise ImportError("numpy.core.multiarray failed to import")
2977  *
2978  */
2979  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
2980  if (__pyx_t_4) {
2981  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
2982  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
2983  __Pyx_GOTREF(__pyx_t_5);
2984  __Pyx_GOTREF(__pyx_t_6);
2985  __Pyx_GOTREF(__pyx_t_7);
2986 
2987  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
2988  * __pyx_import_array()
2989  * except Exception:
2990  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
2991  *
2992  * cdef inline int import_umath() except -1:
2993  */
2994  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
2995  __Pyx_GOTREF(__pyx_t_8);
2996  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
2997  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2998  __PYX_ERR(1, 945, __pyx_L5_except_error)
2999  }
3000  goto __pyx_L5_except_error;
3001  __pyx_L5_except_error:;
3002 
3003  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
3004  * # Cython code.
3005  * cdef inline int import_array() except -1:
3006  * try: # <<<<<<<<<<<<<<
3007  * __pyx_import_array()
3008  * except Exception:
3009  */
3010  __Pyx_XGIVEREF(__pyx_t_1);
3011  __Pyx_XGIVEREF(__pyx_t_2);
3012  __Pyx_XGIVEREF(__pyx_t_3);
3013  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3014  goto __pyx_L1_error;
3015  __pyx_L8_try_end:;
3016  }
3017 
3018  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
3019  * # Versions of the import_* functions which are more suitable for
3020  * # Cython code.
3021  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
3022  * try:
3023  * __pyx_import_array()
3024  */
3025 
3026  /* function exit code */
3027  __pyx_r = 0;
3028  goto __pyx_L0;
3029  __pyx_L1_error:;
3030  __Pyx_XDECREF(__pyx_t_5);
3031  __Pyx_XDECREF(__pyx_t_6);
3032  __Pyx_XDECREF(__pyx_t_7);
3033  __Pyx_XDECREF(__pyx_t_8);
3034  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
3035  __pyx_r = -1;
3036  __pyx_L0:;
3037  __Pyx_RefNannyFinishContext();
3038  return __pyx_r;
3039 }
3040 
3041 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
3042  * raise ImportError("numpy.core.multiarray failed to import")
3043  *
3044  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
3045  * try:
3046  * _import_umath()
3047  */
3048 
3049 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
3050  int __pyx_r;
3051  __Pyx_RefNannyDeclarations
3052  PyObject *__pyx_t_1 = NULL;
3053  PyObject *__pyx_t_2 = NULL;
3054  PyObject *__pyx_t_3 = NULL;
3055  int __pyx_t_4;
3056  PyObject *__pyx_t_5 = NULL;
3057  PyObject *__pyx_t_6 = NULL;
3058  PyObject *__pyx_t_7 = NULL;
3059  PyObject *__pyx_t_8 = NULL;
3060  int __pyx_lineno = 0;
3061  const char *__pyx_filename = NULL;
3062  int __pyx_clineno = 0;
3063  __Pyx_RefNannySetupContext("import_umath", 0);
3064 
3065  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
3066  *
3067  * cdef inline int import_umath() except -1:
3068  * try: # <<<<<<<<<<<<<<
3069  * _import_umath()
3070  * except Exception:
3071  */
3072  {
3073  __Pyx_PyThreadState_declare
3074  __Pyx_PyThreadState_assign
3075  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3076  __Pyx_XGOTREF(__pyx_t_1);
3077  __Pyx_XGOTREF(__pyx_t_2);
3078  __Pyx_XGOTREF(__pyx_t_3);
3079  /*try:*/ {
3080 
3081  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
3082  * cdef inline int import_umath() except -1:
3083  * try:
3084  * _import_umath() # <<<<<<<<<<<<<<
3085  * except Exception:
3086  * raise ImportError("numpy.core.umath failed to import")
3087  */
3088  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
3089 
3090  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
3091  *
3092  * cdef inline int import_umath() except -1:
3093  * try: # <<<<<<<<<<<<<<
3094  * _import_umath()
3095  * except Exception:
3096  */
3097  }
3098  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3099  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3100  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3101  goto __pyx_L8_try_end;
3102  __pyx_L3_error:;
3103 
3104  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
3105  * try:
3106  * _import_umath()
3107  * except Exception: # <<<<<<<<<<<<<<
3108  * raise ImportError("numpy.core.umath failed to import")
3109  *
3110  */
3111  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3112  if (__pyx_t_4) {
3113  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
3114  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
3115  __Pyx_GOTREF(__pyx_t_5);
3116  __Pyx_GOTREF(__pyx_t_6);
3117  __Pyx_GOTREF(__pyx_t_7);
3118 
3119  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
3120  * _import_umath()
3121  * except Exception:
3122  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
3123  *
3124  * cdef inline int import_ufunc() except -1:
3125  */
3126  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
3127  __Pyx_GOTREF(__pyx_t_8);
3128  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3129  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3130  __PYX_ERR(1, 951, __pyx_L5_except_error)
3131  }
3132  goto __pyx_L5_except_error;
3133  __pyx_L5_except_error:;
3134 
3135  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
3136  *
3137  * cdef inline int import_umath() except -1:
3138  * try: # <<<<<<<<<<<<<<
3139  * _import_umath()
3140  * except Exception:
3141  */
3142  __Pyx_XGIVEREF(__pyx_t_1);
3143  __Pyx_XGIVEREF(__pyx_t_2);
3144  __Pyx_XGIVEREF(__pyx_t_3);
3145  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3146  goto __pyx_L1_error;
3147  __pyx_L8_try_end:;
3148  }
3149 
3150  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
3151  * raise ImportError("numpy.core.multiarray failed to import")
3152  *
3153  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
3154  * try:
3155  * _import_umath()
3156  */
3157 
3158  /* function exit code */
3159  __pyx_r = 0;
3160  goto __pyx_L0;
3161  __pyx_L1_error:;
3162  __Pyx_XDECREF(__pyx_t_5);
3163  __Pyx_XDECREF(__pyx_t_6);
3164  __Pyx_XDECREF(__pyx_t_7);
3165  __Pyx_XDECREF(__pyx_t_8);
3166  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
3167  __pyx_r = -1;
3168  __pyx_L0:;
3169  __Pyx_RefNannyFinishContext();
3170  return __pyx_r;
3171 }
3172 
3173 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
3174  * raise ImportError("numpy.core.umath failed to import")
3175  *
3176  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
3177  * try:
3178  * _import_umath()
3179  */
3180 
3181 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
3182  int __pyx_r;
3183  __Pyx_RefNannyDeclarations
3184  PyObject *__pyx_t_1 = NULL;
3185  PyObject *__pyx_t_2 = NULL;
3186  PyObject *__pyx_t_3 = NULL;
3187  int __pyx_t_4;
3188  PyObject *__pyx_t_5 = NULL;
3189  PyObject *__pyx_t_6 = NULL;
3190  PyObject *__pyx_t_7 = NULL;
3191  PyObject *__pyx_t_8 = NULL;
3192  int __pyx_lineno = 0;
3193  const char *__pyx_filename = NULL;
3194  int __pyx_clineno = 0;
3195  __Pyx_RefNannySetupContext("import_ufunc", 0);
3196 
3197  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3198  *
3199  * cdef inline int import_ufunc() except -1:
3200  * try: # <<<<<<<<<<<<<<
3201  * _import_umath()
3202  * except Exception:
3203  */
3204  {
3205  __Pyx_PyThreadState_declare
3206  __Pyx_PyThreadState_assign
3207  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3208  __Pyx_XGOTREF(__pyx_t_1);
3209  __Pyx_XGOTREF(__pyx_t_2);
3210  __Pyx_XGOTREF(__pyx_t_3);
3211  /*try:*/ {
3212 
3213  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
3214  * cdef inline int import_ufunc() except -1:
3215  * try:
3216  * _import_umath() # <<<<<<<<<<<<<<
3217  * except Exception:
3218  * raise ImportError("numpy.core.umath failed to import")
3219  */
3220  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
3221 
3222  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3223  *
3224  * cdef inline int import_ufunc() except -1:
3225  * try: # <<<<<<<<<<<<<<
3226  * _import_umath()
3227  * except Exception:
3228  */
3229  }
3230  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3231  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3232  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3233  goto __pyx_L8_try_end;
3234  __pyx_L3_error:;
3235 
3236  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
3237  * try:
3238  * _import_umath()
3239  * except Exception: # <<<<<<<<<<<<<<
3240  * raise ImportError("numpy.core.umath failed to import")
3241  *
3242  */
3243  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3244  if (__pyx_t_4) {
3245  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3246  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
3247  __Pyx_GOTREF(__pyx_t_5);
3248  __Pyx_GOTREF(__pyx_t_6);
3249  __Pyx_GOTREF(__pyx_t_7);
3250 
3251  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
3252  * _import_umath()
3253  * except Exception:
3254  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
3255  *
3256  * cdef extern from *:
3257  */
3258  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
3259  __Pyx_GOTREF(__pyx_t_8);
3260  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3261  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3262  __PYX_ERR(1, 957, __pyx_L5_except_error)
3263  }
3264  goto __pyx_L5_except_error;
3265  __pyx_L5_except_error:;
3266 
3267  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3268  *
3269  * cdef inline int import_ufunc() except -1:
3270  * try: # <<<<<<<<<<<<<<
3271  * _import_umath()
3272  * except Exception:
3273  */
3274  __Pyx_XGIVEREF(__pyx_t_1);
3275  __Pyx_XGIVEREF(__pyx_t_2);
3276  __Pyx_XGIVEREF(__pyx_t_3);
3277  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3278  goto __pyx_L1_error;
3279  __pyx_L8_try_end:;
3280  }
3281 
3282  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
3283  * raise ImportError("numpy.core.umath failed to import")
3284  *
3285  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
3286  * try:
3287  * _import_umath()
3288  */
3289 
3290  /* function exit code */
3291  __pyx_r = 0;
3292  goto __pyx_L0;
3293  __pyx_L1_error:;
3294  __Pyx_XDECREF(__pyx_t_5);
3295  __Pyx_XDECREF(__pyx_t_6);
3296  __Pyx_XDECREF(__pyx_t_7);
3297  __Pyx_XDECREF(__pyx_t_8);
3298  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3299  __pyx_r = -1;
3300  __pyx_L0:;
3301  __Pyx_RefNannyFinishContext();
3302  return __pyx_r;
3303 }
3304 
3305 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
3306  *
3307  *
3308  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
3309  * """
3310  * Cython equivalent of `isinstance(obj, np.timedelta64)`
3311  */
3312 
3313 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
3314  int __pyx_r;
3315  __Pyx_RefNannyDeclarations
3316  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
3317 
3318  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
3319  * bool
3320  * """
3321  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
3322  *
3323  *
3324  */
3325  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
3326  goto __pyx_L0;
3327 
3328  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
3329  *
3330  *
3331  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
3332  * """
3333  * Cython equivalent of `isinstance(obj, np.timedelta64)`
3334  */
3335 
3336  /* function exit code */
3337  __pyx_L0:;
3338  __Pyx_RefNannyFinishContext();
3339  return __pyx_r;
3340 }
3341 
3342 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
3343  *
3344  *
3345  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
3346  * """
3347  * Cython equivalent of `isinstance(obj, np.datetime64)`
3348  */
3349 
3350 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
3351  int __pyx_r;
3352  __Pyx_RefNannyDeclarations
3353  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
3354 
3355  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
3356  * bool
3357  * """
3358  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
3359  *
3360  *
3361  */
3362  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
3363  goto __pyx_L0;
3364 
3365  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
3366  *
3367  *
3368  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
3369  * """
3370  * Cython equivalent of `isinstance(obj, np.datetime64)`
3371  */
3372 
3373  /* function exit code */
3374  __pyx_L0:;
3375  __Pyx_RefNannyFinishContext();
3376  return __pyx_r;
3377 }
3378 
3379 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
3380  *
3381  *
3382  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
3383  * """
3384  * returns the int64 value underlying scalar numpy datetime64 object
3385  */
3386 
3387 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
3388  npy_datetime __pyx_r;
3389 
3390  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
3391  * also needed. That can be found using `get_datetime64_unit`.
3392  * """
3393  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
3394  *
3395  *
3396  */
3397  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
3398  goto __pyx_L0;
3399 
3400  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
3401  *
3402  *
3403  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
3404  * """
3405  * returns the int64 value underlying scalar numpy datetime64 object
3406  */
3407 
3408  /* function exit code */
3409  __pyx_L0:;
3410  return __pyx_r;
3411 }
3412 
3413 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
3414  *
3415  *
3416  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
3417  * """
3418  * returns the int64 value underlying scalar numpy timedelta64 object
3419  */
3420 
3421 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
3422  npy_timedelta __pyx_r;
3423 
3424  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
3425  * returns the int64 value underlying scalar numpy timedelta64 object
3426  * """
3427  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
3428  *
3429  *
3430  */
3431  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
3432  goto __pyx_L0;
3433 
3434  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
3435  *
3436  *
3437  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
3438  * """
3439  * returns the int64 value underlying scalar numpy timedelta64 object
3440  */
3441 
3442  /* function exit code */
3443  __pyx_L0:;
3444  return __pyx_r;
3445 }
3446 
3447 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
3448  *
3449  *
3450  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
3451  * """
3452  * returns the unit part of the dtype for a numpy datetime64 object.
3453  */
3454 
3455 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
3456  NPY_DATETIMEUNIT __pyx_r;
3457 
3458  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
3459  * returns the unit part of the dtype for a numpy datetime64 object.
3460  * """
3461  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
3462  */
3463  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
3464  goto __pyx_L0;
3465 
3466  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
3467  *
3468  *
3469  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
3470  * """
3471  * returns the unit part of the dtype for a numpy datetime64 object.
3472  */
3473 
3474  /* function exit code */
3475  __pyx_L0:;
3476  return __pyx_r;
3477 }
3478 
3479 static PyMethodDef __pyx_methods[] = {
3480  {0, 0, 0, 0}
3481 };
3482 
3483 #if PY_MAJOR_VERSION >= 3
3484 #if CYTHON_PEP489_MULTI_PHASE_INIT
3485 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3486 static int __pyx_pymod_exec_cSubsurfaceTransportCoefficients(PyObject* module); /*proto*/
3487 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3488  {Py_mod_create, (void*)__pyx_pymod_create},
3489  {Py_mod_exec, (void*)__pyx_pymod_exec_cSubsurfaceTransportCoefficients},
3490  {0, NULL}
3491 };
3492 #endif
3493 
3494 static struct PyModuleDef __pyx_moduledef = {
3495  PyModuleDef_HEAD_INIT,
3496  "cSubsurfaceTransportCoefficients",
3497  0, /* m_doc */
3498  #if CYTHON_PEP489_MULTI_PHASE_INIT
3499  0, /* m_size */
3500  #else
3501  -1, /* m_size */
3502  #endif
3503  __pyx_methods /* m_methods */,
3504  #if CYTHON_PEP489_MULTI_PHASE_INIT
3505  __pyx_moduledef_slots, /* m_slots */
3506  #else
3507  NULL, /* m_reload */
3508  #endif
3509  NULL, /* m_traverse */
3510  NULL, /* m_clear */
3511  NULL /* m_free */
3512 };
3513 #endif
3514 #ifndef CYTHON_SMALL_CODE
3515 #if defined(__clang__)
3516  #define CYTHON_SMALL_CODE
3517 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3518  #define CYTHON_SMALL_CODE __attribute__((cold))
3519 #else
3520  #define CYTHON_SMALL_CODE
3521 #endif
3522 #endif
3523 
3524 static __Pyx_StringTabEntry __pyx_string_tab[] = {
3525  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
3526  {&__pyx_n_s_Kbar, __pyx_k_Kbar, sizeof(__pyx_k_Kbar), 0, 0, 1, 1},
3527  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
3528  {&__pyx_n_s_bc_u, __pyx_k_bc_u, sizeof(__pyx_k_bc_u), 0, 0, 1, 1},
3529  {&__pyx_n_s_cSubsurfaceTransportCoefficients, __pyx_k_cSubsurfaceTransportCoefficients, sizeof(__pyx_k_cSubsurfaceTransportCoefficients), 0, 0, 1, 1},
3530  {&__pyx_n_s_calculateRusanovFluxSaturationEq, __pyx_k_calculateRusanovFluxSaturationEq, sizeof(__pyx_k_calculateRusanovFluxSaturationEq), 0, 0, 1, 1},
3531  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3532  {&__pyx_n_s_colind, __pyx_k_colind, sizeof(__pyx_k_colind), 0, 0, 1, 1},
3533  {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1},
3534  {&__pyx_n_s_ebq_global_qt, __pyx_k_ebq_global_qt, sizeof(__pyx_k_ebq_global_qt), 0, 0, 1, 1},
3535  {&__pyx_n_s_elementBoundaryElements, __pyx_k_elementBoundaryElements, sizeof(__pyx_k_elementBoundaryElements), 0, 0, 1, 1},
3536  {&__pyx_n_s_elementBoundaryLocalElementBound, __pyx_k_elementBoundaryLocalElementBound, sizeof(__pyx_k_elementBoundaryLocalElementBound), 0, 0, 1, 1},
3537  {&__pyx_n_s_exteriorElementBoundaries, __pyx_k_exteriorElementBoundaries, sizeof(__pyx_k_exteriorElementBoundaries), 0, 0, 1, 1},
3538  {&__pyx_n_s_failed, __pyx_k_failed, sizeof(__pyx_k_failed), 0, 0, 1, 1},
3539  {&__pyx_n_s_flux, __pyx_k_flux, sizeof(__pyx_k_flux), 0, 0, 1, 1},
3540  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
3541  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
3542  {&__pyx_n_s_interiorElementBoundaries, __pyx_k_interiorElementBoundaries, sizeof(__pyx_k_interiorElementBoundaries), 0, 0, 1, 1},
3543  {&__pyx_n_s_isDOFBoundary, __pyx_k_isDOFBoundary, sizeof(__pyx_k_isDOFBoundary), 0, 0, 1, 1},
3544  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
3545  {&__pyx_n_s_materialTypes, __pyx_k_materialTypes, sizeof(__pyx_k_materialTypes), 0, 0, 1, 1},
3546  {&__pyx_n_s_mun, __pyx_k_mun, sizeof(__pyx_k_mun), 0, 0, 1, 1},
3547  {&__pyx_n_s_muw, __pyx_k_muw, sizeof(__pyx_k_muw), 0, 0, 1, 1},
3548  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
3549  {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element, sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
3550  {&__pyx_n_s_nElements_global, __pyx_k_nElements_global, sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
3551  {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa, sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
3552  {&__pyx_n_s_nInteriorElementBoundaries_globa, __pyx_k_nInteriorElementBoundaries_globa, sizeof(__pyx_k_nInteriorElementBoundaries_globa), 0, 0, 1, 1},
3553  {&__pyx_n_s_nParams, __pyx_k_nParams, sizeof(__pyx_k_nParams), 0, 0, 1, 1},
3554  {&__pyx_n_s_nQuadraturePoints_element, __pyx_k_nQuadraturePoints_element, sizeof(__pyx_k_nQuadraturePoints_element), 0, 0, 1, 1},
3555  {&__pyx_n_s_nQuadraturePoints_elementBoundar, __pyx_k_nQuadraturePoints_elementBoundar, sizeof(__pyx_k_nQuadraturePoints_elementBoundar), 0, 0, 1, 1},
3556  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
3557  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
3558  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
3559  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
3560  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
3561  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
3562  {&__pyx_n_s_omega, __pyx_k_omega, sizeof(__pyx_k_omega), 0, 0, 1, 1},
3563  {&__pyx_n_s_piecewiseLinearTableLookup, __pyx_k_piecewiseLinearTableLookup, sizeof(__pyx_k_piecewiseLinearTableLookup), 0, 0, 1, 1},
3564  {&__pyx_kp_s_proteus_cSubsurfaceTransportCoef, __pyx_k_proteus_cSubsurfaceTransportCoef, sizeof(__pyx_k_proteus_cSubsurfaceTransportCoef), 0, 0, 1, 0},
3565  {&__pyx_n_s_pskModelFlag, __pyx_k_pskModelFlag, sizeof(__pyx_k_pskModelFlag), 0, 0, 1, 1},
3566  {&__pyx_n_s_q_dV, __pyx_k_q_dV, sizeof(__pyx_k_q_dV), 0, 0, 1, 1},
3567  {&__pyx_n_s_q_lambda_bar, __pyx_k_q_lambda_bar, sizeof(__pyx_k_q_lambda_bar), 0, 0, 1, 1},
3568  {&__pyx_n_s_q_u, __pyx_k_q_u, sizeof(__pyx_k_q_u), 0, 0, 1, 1},
3569  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
3570  {&__pyx_n_s_rwork_density_n, __pyx_k_rwork_density_n, sizeof(__pyx_k_rwork_density_n), 0, 0, 1, 1},
3571  {&__pyx_n_s_rwork_density_w, __pyx_k_rwork_density_w, sizeof(__pyx_k_rwork_density_w), 0, 0, 1, 1},
3572  {&__pyx_n_s_rwork_psk, __pyx_k_rwork_psk, sizeof(__pyx_k_rwork_psk), 0, 0, 1, 1},
3573  {&__pyx_n_s_rwork_psk_tol, __pyx_k_rwork_psk_tol, sizeof(__pyx_k_rwork_psk_tol), 0, 0, 1, 1},
3574  {&__pyx_n_s_safetyFactor, __pyx_k_safetyFactor, sizeof(__pyx_k_safetyFactor), 0, 0, 1, 1},
3575  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
3576  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
3577  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
3578  {&__pyx_n_s_xv, __pyx_k_xv, sizeof(__pyx_k_xv), 0, 0, 1, 1},
3579  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
3580  {&__pyx_n_s_yv, __pyx_k_yv, sizeof(__pyx_k_yv), 0, 0, 1, 1},
3581  {0, 0, 0, 0, 0, 0, 0}
3582 };
3583 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
3584  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
3585  return 0;
3586  __pyx_L1_error:;
3587  return -1;
3588 }
3589 
3590 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
3591  __Pyx_RefNannyDeclarations
3592  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
3593 
3594  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
3595  * __pyx_import_array()
3596  * except Exception:
3597  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
3598  *
3599  * cdef inline int import_umath() except -1:
3600  */
3601  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
3602  __Pyx_GOTREF(__pyx_tuple_);
3603  __Pyx_GIVEREF(__pyx_tuple_);
3604 
3605  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
3606  * _import_umath()
3607  * except Exception:
3608  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
3609  *
3610  * cdef inline int import_ufunc() except -1:
3611  */
3612  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
3613  __Pyx_GOTREF(__pyx_tuple__2);
3614  __Pyx_GIVEREF(__pyx_tuple__2);
3615 
3616  /* "cSubsurfaceTransportCoefficients.pyx":6
3617  * cimport SubsurfaceTransportCoefficients as cppsstc
3618  *
3619  * def calculateRusanovFluxSaturationEquationIncomp_PWC( # <<<<<<<<<<<<<<
3620  * double safetyFactor,
3621  * int nSpace,
3622  */
3623  __pyx_tuple__3 = PyTuple_Pack(36, __pyx_n_s_safetyFactor, __pyx_n_s_nSpace, __pyx_n_s_pskModelFlag, __pyx_n_s_nParams, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_materialTypes, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_rwork_psk, __pyx_n_s_rwork_psk_tol, __pyx_n_s_rwork_density_w, __pyx_n_s_rwork_density_n, __pyx_n_s_g, __pyx_n_s_ebq_global_qt, __pyx_n_s_q_lambda_bar, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_nInteriorElementBoundaries_globa, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_nQuadraturePoints_element, __pyx_n_s_nQuadraturePoints_elementBoundar, __pyx_n_s_interiorElementBoundaries, __pyx_n_s_exteriorElementBoundaries, __pyx_n_s_elementBoundaryElements, __pyx_n_s_elementBoundaryLocalElementBound, __pyx_n_s_n, __pyx_n_s_q_u, __pyx_n_s_q_dV, __pyx_n_s_isDOFBoundary, __pyx_n_s_bc_u, __pyx_n_s_flux, __pyx_n_s_failed); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 6, __pyx_L1_error)
3624  __Pyx_GOTREF(__pyx_tuple__3);
3625  __Pyx_GIVEREF(__pyx_tuple__3);
3626  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(35, 0, 36, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cSubsurfaceTransportCoef, __pyx_n_s_calculateRusanovFluxSaturationEq, 6, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 6, __pyx_L1_error)
3627 
3628  /* "cSubsurfaceTransportCoefficients.pyx":80
3629  * assert failed==0
3630  *
3631  * def piecewiseLinearTableLookup(double x, # <<<<<<<<<<<<<<
3632  * np.ndarray xv,
3633  * np.ndarray yv,
3634  */
3635  __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_xv, __pyx_n_s_yv, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_dy); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 80, __pyx_L1_error)
3636  __Pyx_GOTREF(__pyx_tuple__5);
3637  __Pyx_GIVEREF(__pyx_tuple__5);
3638  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cSubsurfaceTransportCoef, __pyx_n_s_piecewiseLinearTableLookup, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 80, __pyx_L1_error)
3639  __Pyx_RefNannyFinishContext();
3640  return 0;
3641  __pyx_L1_error:;
3642  __Pyx_RefNannyFinishContext();
3643  return -1;
3644 }
3645 
3646 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
3647  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3648  return 0;
3649  __pyx_L1_error:;
3650  return -1;
3651 }
3652 
3653 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
3654 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
3655 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
3656 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
3657 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
3658 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
3659 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
3660 
3661 static int __Pyx_modinit_global_init_code(void) {
3662  __Pyx_RefNannyDeclarations
3663  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3664  /*--- Global init code ---*/
3665  __Pyx_RefNannyFinishContext();
3666  return 0;
3667 }
3668 
3669 static int __Pyx_modinit_variable_export_code(void) {
3670  __Pyx_RefNannyDeclarations
3671  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3672  /*--- Variable export code ---*/
3673  __Pyx_RefNannyFinishContext();
3674  return 0;
3675 }
3676 
3677 static int __Pyx_modinit_function_export_code(void) {
3678  __Pyx_RefNannyDeclarations
3679  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3680  /*--- Function export code ---*/
3681  __Pyx_RefNannyFinishContext();
3682  return 0;
3683 }
3684 
3685 static int __Pyx_modinit_type_init_code(void) {
3686  __Pyx_RefNannyDeclarations
3687  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3688  /*--- Type init code ---*/
3689  __Pyx_RefNannyFinishContext();
3690  return 0;
3691 }
3692 
3693 static int __Pyx_modinit_type_import_code(void) {
3694  __Pyx_RefNannyDeclarations
3695  PyObject *__pyx_t_1 = NULL;
3696  int __pyx_lineno = 0;
3697  const char *__pyx_filename = NULL;
3698  int __pyx_clineno = 0;
3699  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3700  /*--- Type import code ---*/
3701  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
3702  __Pyx_GOTREF(__pyx_t_1);
3703  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
3704  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
3705  sizeof(PyTypeObject),
3706  #else
3707  sizeof(PyHeapTypeObject),
3708  #endif
3709  __Pyx_ImportType_CheckSize_Warn);
3710  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
3711  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3712  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
3713  __Pyx_GOTREF(__pyx_t_1);
3714  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
3715  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
3716  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
3717  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
3718  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
3719  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
3720  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
3721  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
3722  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3723  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
3724  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3725  if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
3726  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3727  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
3728  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3729  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
3730  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3731  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
3732  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3733  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
3734  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3735  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
3736  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3737  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
3738  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3739  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
3740  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3741  if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
3742  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
3743  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
3744  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3745  __Pyx_RefNannyFinishContext();
3746  return 0;
3747  __pyx_L1_error:;
3748  __Pyx_XDECREF(__pyx_t_1);
3749  __Pyx_RefNannyFinishContext();
3750  return -1;
3751 }
3752 
3753 static int __Pyx_modinit_variable_import_code(void) {
3754  __Pyx_RefNannyDeclarations
3755  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3756  /*--- Variable import code ---*/
3757  __Pyx_RefNannyFinishContext();
3758  return 0;
3759 }
3760 
3761 static int __Pyx_modinit_function_import_code(void) {
3762  __Pyx_RefNannyDeclarations
3763  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3764  /*--- Function import code ---*/
3765  __Pyx_RefNannyFinishContext();
3766  return 0;
3767 }
3768 
3769 
3770 #ifndef CYTHON_NO_PYINIT_EXPORT
3771 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3772 #elif PY_MAJOR_VERSION < 3
3773 #ifdef __cplusplus
3774 #define __Pyx_PyMODINIT_FUNC extern "C" void
3775 #else
3776 #define __Pyx_PyMODINIT_FUNC void
3777 #endif
3778 #else
3779 #ifdef __cplusplus
3780 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
3781 #else
3782 #define __Pyx_PyMODINIT_FUNC PyObject *
3783 #endif
3784 #endif
3785 
3786 
3787 #if PY_MAJOR_VERSION < 3
3788 __Pyx_PyMODINIT_FUNC initcSubsurfaceTransportCoefficients(void) CYTHON_SMALL_CODE; /*proto*/
3789 __Pyx_PyMODINIT_FUNC initcSubsurfaceTransportCoefficients(void)
3790 #else
3791 __Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(void) CYTHON_SMALL_CODE; /*proto*/
3792 __Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(void)
3793 #if CYTHON_PEP489_MULTI_PHASE_INIT
3794 {
3795  return PyModuleDef_Init(&__pyx_moduledef);
3796 }
3797 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
3798  #if PY_VERSION_HEX >= 0x030700A1
3799  static PY_INT64_T main_interpreter_id = -1;
3800  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
3801  if (main_interpreter_id == -1) {
3802  main_interpreter_id = current_id;
3803  return (unlikely(current_id == -1)) ? -1 : 0;
3804  } else if (unlikely(main_interpreter_id != current_id))
3805  #else
3806  static PyInterpreterState *main_interpreter = NULL;
3807  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
3808  if (!main_interpreter) {
3809  main_interpreter = current_interpreter;
3810  } else if (unlikely(main_interpreter != current_interpreter))
3811  #endif
3812  {
3813  PyErr_SetString(
3814  PyExc_ImportError,
3815  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
3816  return -1;
3817  }
3818  return 0;
3819 }
3820 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
3821  PyObject *value = PyObject_GetAttrString(spec, from_name);
3822  int result = 0;
3823  if (likely(value)) {
3824  if (allow_none || value != Py_None) {
3825  result = PyDict_SetItemString(moddict, to_name, value);
3826  }
3827  Py_DECREF(value);
3828  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3829  PyErr_Clear();
3830  } else {
3831  result = -1;
3832  }
3833  return result;
3834 }
3835 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3836  PyObject *module = NULL, *moddict, *modname;
3837  if (__Pyx_check_single_interpreter())
3838  return NULL;
3839  if (__pyx_m)
3840  return __Pyx_NewRef(__pyx_m);
3841  modname = PyObject_GetAttrString(spec, "name");
3842  if (unlikely(!modname)) goto bad;
3843  module = PyModule_NewObject(modname);
3844  Py_DECREF(modname);
3845  if (unlikely(!module)) goto bad;
3846  moddict = PyModule_GetDict(module);
3847  if (unlikely(!moddict)) goto bad;
3848  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
3849  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
3850  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
3851  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
3852  return module;
3853 bad:
3854  Py_XDECREF(module);
3855  return NULL;
3856 }
3857 
3858 
3859 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cSubsurfaceTransportCoefficients(PyObject *__pyx_pyinit_module)
3860 #endif
3861 #endif
3862 {
3863  PyObject *__pyx_t_1 = NULL;
3864  int __pyx_lineno = 0;
3865  const char *__pyx_filename = NULL;
3866  int __pyx_clineno = 0;
3867  __Pyx_RefNannyDeclarations
3868  #if CYTHON_PEP489_MULTI_PHASE_INIT
3869  if (__pyx_m) {
3870  if (__pyx_m == __pyx_pyinit_module) return 0;
3871  PyErr_SetString(PyExc_RuntimeError, "Module 'cSubsurfaceTransportCoefficients' has already been imported. Re-initialisation is not supported.");
3872  return -1;
3873  }
3874  #elif PY_MAJOR_VERSION >= 3
3875  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3876  #endif
3877  #if CYTHON_REFNANNY
3878 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3879 if (!__Pyx_RefNanny) {
3880  PyErr_Clear();
3881  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3882  if (!__Pyx_RefNanny)
3883  Py_FatalError("failed to import 'refnanny' module");
3884 }
3885 #endif
3886  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(void)", 0);
3887  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3888  #ifdef __Pxy_PyFrame_Initialize_Offsets
3889  __Pxy_PyFrame_Initialize_Offsets();
3890  #endif
3891  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3892  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3893  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3894  #ifdef __Pyx_CyFunction_USED
3895  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3896  #endif
3897  #ifdef __Pyx_FusedFunction_USED
3898  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3899  #endif
3900  #ifdef __Pyx_Coroutine_USED
3901  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3902  #endif
3903  #ifdef __Pyx_Generator_USED
3904  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3905  #endif
3906  #ifdef __Pyx_AsyncGen_USED
3907  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3908  #endif
3909  #ifdef __Pyx_StopAsyncIteration_USED
3910  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3911  #endif
3912  /*--- Library function declarations ---*/
3913  /*--- Threads initialization code ---*/
3914  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3915  PyEval_InitThreads();
3916  #endif
3917  /*--- Module creation code ---*/
3918  #if CYTHON_PEP489_MULTI_PHASE_INIT
3919  __pyx_m = __pyx_pyinit_module;
3920  Py_INCREF(__pyx_m);
3921  #else
3922  #if PY_MAJOR_VERSION < 3
3923  __pyx_m = Py_InitModule4("cSubsurfaceTransportCoefficients", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
3924  #else
3925  __pyx_m = PyModule_Create(&__pyx_moduledef);
3926  #endif
3927  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3928  #endif
3929  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3930  Py_INCREF(__pyx_d);
3931  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3932  Py_INCREF(__pyx_b);
3933  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3934  Py_INCREF(__pyx_cython_runtime);
3935  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3936  /*--- Initialize various global constants etc. ---*/
3937  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3938  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3939  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3940  #endif
3941  if (__pyx_module_is_main_cSubsurfaceTransportCoefficients) {
3942  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3943  }
3944  #if PY_MAJOR_VERSION >= 3
3945  {
3946  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3947  if (!PyDict_GetItemString(modules, "cSubsurfaceTransportCoefficients")) {
3948  if (unlikely(PyDict_SetItemString(modules, "cSubsurfaceTransportCoefficients", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3949  }
3950  }
3951  #endif
3952  /*--- Builtin init code ---*/
3953  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3954  /*--- Constants init code ---*/
3955  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3956  /*--- Global type/function init code ---*/
3957  (void)__Pyx_modinit_global_init_code();
3958  (void)__Pyx_modinit_variable_export_code();
3959  (void)__Pyx_modinit_function_export_code();
3960  (void)__Pyx_modinit_type_init_code();
3961  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3962  (void)__Pyx_modinit_variable_import_code();
3963  (void)__Pyx_modinit_function_import_code();
3964  /*--- Execution code ---*/
3965  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3966  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3967  #endif
3968 
3969  /* "cSubsurfaceTransportCoefficients.pyx":2
3970  * # A type of -*- python -*- file
3971  * import numpy as np # <<<<<<<<<<<<<<
3972  * cimport numpy as np
3973  * cimport SubsurfaceTransportCoefficients as cppsstc
3974  */
3975  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3976  __Pyx_GOTREF(__pyx_t_1);
3977  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
3978  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3979 
3980  /* "cSubsurfaceTransportCoefficients.pyx":6
3981  * cimport SubsurfaceTransportCoefficients as cppsstc
3982  *
3983  * def calculateRusanovFluxSaturationEquationIncomp_PWC( # <<<<<<<<<<<<<<
3984  * double safetyFactor,
3985  * int nSpace,
3986  */
3987  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC, NULL, __pyx_n_s_cSubsurfaceTransportCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
3988  __Pyx_GOTREF(__pyx_t_1);
3989  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateRusanovFluxSaturationEq, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
3990  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3991 
3992  /* "cSubsurfaceTransportCoefficients.pyx":80
3993  * assert failed==0
3994  *
3995  * def piecewiseLinearTableLookup(double x, # <<<<<<<<<<<<<<
3996  * np.ndarray xv,
3997  * np.ndarray yv,
3998  */
3999  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup, NULL, __pyx_n_s_cSubsurfaceTransportCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
4000  __Pyx_GOTREF(__pyx_t_1);
4001  if (PyDict_SetItem(__pyx_d, __pyx_n_s_piecewiseLinearTableLookup, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
4002  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4003 
4004  /* "cSubsurfaceTransportCoefficients.pyx":1
4005  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
4006  * import numpy as np
4007  * cimport numpy as np
4008  */
4009  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
4010  __Pyx_GOTREF(__pyx_t_1);
4011  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4012  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4013 
4014  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
4015  *
4016  *
4017  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
4018  * """
4019  * returns the unit part of the dtype for a numpy datetime64 object.
4020  */
4021 
4022  /*--- Wrapped vars code ---*/
4023 
4024  goto __pyx_L0;
4025  __pyx_L1_error:;
4026  __Pyx_XDECREF(__pyx_t_1);
4027  if (__pyx_m) {
4028  if (__pyx_d) {
4029  __Pyx_AddTraceback("init cSubsurfaceTransportCoefficients", __pyx_clineno, __pyx_lineno, __pyx_filename);
4030  }
4031  Py_CLEAR(__pyx_m);
4032  } else if (!PyErr_Occurred()) {
4033  PyErr_SetString(PyExc_ImportError, "init cSubsurfaceTransportCoefficients");
4034  }
4035  __pyx_L0:;
4036  __Pyx_RefNannyFinishContext();
4037  #if CYTHON_PEP489_MULTI_PHASE_INIT
4038  return (__pyx_m != NULL) ? 0 : -1;
4039  #elif PY_MAJOR_VERSION >= 3
4040  return __pyx_m;
4041  #else
4042  return;
4043  #endif
4044 }
4045 
4046 /* --- Runtime support code --- */
4047 /* Refnanny */
4048 #if CYTHON_REFNANNY
4049 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
4050  PyObject *m = NULL, *p = NULL;
4051  void *r = NULL;
4052  m = PyImport_ImportModule(modname);
4053  if (!m) goto end;
4054  p = PyObject_GetAttrString(m, "RefNannyAPI");
4055  if (!p) goto end;
4056  r = PyLong_AsVoidPtr(p);
4057 end:
4058  Py_XDECREF(p);
4059  Py_XDECREF(m);
4060  return (__Pyx_RefNannyAPIStruct *)r;
4061 }
4062 #endif
4063 
4064 /* RaiseArgTupleInvalid */
4065 static void __Pyx_RaiseArgtupleInvalid(
4066  const char* func_name,
4067  int exact,
4068  Py_ssize_t num_min,
4069  Py_ssize_t num_max,
4070  Py_ssize_t num_found)
4071 {
4072  Py_ssize_t num_expected;
4073  const char *more_or_less;
4074  if (num_found < num_min) {
4075  num_expected = num_min;
4076  more_or_less = "at least";
4077  } else {
4078  num_expected = num_max;
4079  more_or_less = "at most";
4080  }
4081  if (exact) {
4082  more_or_less = "exactly";
4083  }
4084  PyErr_Format(PyExc_TypeError,
4085  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
4086  func_name, more_or_less, num_expected,
4087  (num_expected == 1) ? "" : "s", num_found);
4088 }
4089 
4090 /* RaiseDoubleKeywords */
4091 static void __Pyx_RaiseDoubleKeywordsError(
4092  const char* func_name,
4093  PyObject* kw_name)
4094 {
4095  PyErr_Format(PyExc_TypeError,
4096  #if PY_MAJOR_VERSION >= 3
4097  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
4098  #else
4099  "%s() got multiple values for keyword argument '%s'", func_name,
4100  PyString_AsString(kw_name));
4101  #endif
4102 }
4103 
4104 /* ParseKeywords */
4105 static int __Pyx_ParseOptionalKeywords(
4106  PyObject *kwds,
4107  PyObject **argnames[],
4108  PyObject *kwds2,
4109  PyObject *values[],
4110  Py_ssize_t num_pos_args,
4111  const char* function_name)
4112 {
4113  PyObject *key = 0, *value = 0;
4114  Py_ssize_t pos = 0;
4115  PyObject*** name;
4116  PyObject*** first_kw_arg = argnames + num_pos_args;
4117  while (PyDict_Next(kwds, &pos, &key, &value)) {
4118  name = first_kw_arg;
4119  while (*name && (**name != key)) name++;
4120  if (*name) {
4121  values[name-argnames] = value;
4122  continue;
4123  }
4124  name = first_kw_arg;
4125  #if PY_MAJOR_VERSION < 3
4126  if (likely(PyString_Check(key))) {
4127  while (*name) {
4128  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
4129  && _PyString_Eq(**name, key)) {
4130  values[name-argnames] = value;
4131  break;
4132  }
4133  name++;
4134  }
4135  if (*name) continue;
4136  else {
4137  PyObject*** argname = argnames;
4138  while (argname != first_kw_arg) {
4139  if ((**argname == key) || (
4140  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
4141  && _PyString_Eq(**argname, key))) {
4142  goto arg_passed_twice;
4143  }
4144  argname++;
4145  }
4146  }
4147  } else
4148  #endif
4149  if (likely(PyUnicode_Check(key))) {
4150  while (*name) {
4151  int cmp = (**name == key) ? 0 :
4152  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4153  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4154  #endif
4155  PyUnicode_Compare(**name, key);
4156  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4157  if (cmp == 0) {
4158  values[name-argnames] = value;
4159  break;
4160  }
4161  name++;
4162  }
4163  if (*name) continue;
4164  else {
4165  PyObject*** argname = argnames;
4166  while (argname != first_kw_arg) {
4167  int cmp = (**argname == key) ? 0 :
4168  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4169  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4170  #endif
4171  PyUnicode_Compare(**argname, key);
4172  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4173  if (cmp == 0) goto arg_passed_twice;
4174  argname++;
4175  }
4176  }
4177  } else
4178  goto invalid_keyword_type;
4179  if (kwds2) {
4180  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
4181  } else {
4182  goto invalid_keyword;
4183  }
4184  }
4185  return 0;
4186 arg_passed_twice:
4187  __Pyx_RaiseDoubleKeywordsError(function_name, key);
4188  goto bad;
4189 invalid_keyword_type:
4190  PyErr_Format(PyExc_TypeError,
4191  "%.200s() keywords must be strings", function_name);
4192  goto bad;
4193 invalid_keyword:
4194  PyErr_Format(PyExc_TypeError,
4195  #if PY_MAJOR_VERSION < 3
4196  "%.200s() got an unexpected keyword argument '%.200s'",
4197  function_name, PyString_AsString(key));
4198  #else
4199  "%s() got an unexpected keyword argument '%U'",
4200  function_name, key);
4201  #endif
4202 bad:
4203  return -1;
4204 }
4205 
4206 /* ArgTypeTest */
4207 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
4208 {
4209  if (unlikely(!type)) {
4210  PyErr_SetString(PyExc_SystemError, "Missing type object");
4211  return 0;
4212  }
4213  else if (exact) {
4214  #if PY_MAJOR_VERSION == 2
4215  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
4216  #endif
4217  }
4218  else {
4219  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
4220  }
4221  PyErr_Format(PyExc_TypeError,
4222  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
4223  name, type->tp_name, Py_TYPE(obj)->tp_name);
4224  return 0;
4225 }
4226 
4227 /* PyObjectGetAttrStr */
4228 #if CYTHON_USE_TYPE_SLOTS
4229 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4230  PyTypeObject* tp = Py_TYPE(obj);
4231  if (likely(tp->tp_getattro))
4232  return tp->tp_getattro(obj, attr_name);
4233 #if PY_MAJOR_VERSION < 3
4234  if (likely(tp->tp_getattr))
4235  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4236 #endif
4237  return PyObject_GetAttr(obj, attr_name);
4238 }
4239 #endif
4240 
4241 /* GetBuiltinName */
4242 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
4243  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
4244  if (unlikely(!result)) {
4245  PyErr_Format(PyExc_NameError,
4246 #if PY_MAJOR_VERSION >= 3
4247  "name '%U' is not defined", name);
4248 #else
4249  "name '%.200s' is not defined", PyString_AS_STRING(name));
4250 #endif
4251  }
4252  return result;
4253 }
4254 
4255 /* GetTopmostException */
4256 #if CYTHON_USE_EXC_INFO_STACK
4257 static _PyErr_StackItem *
4258 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
4259 {
4260  _PyErr_StackItem *exc_info = tstate->exc_info;
4261  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
4262  exc_info->previous_item != NULL)
4263  {
4264  exc_info = exc_info->previous_item;
4265  }
4266  return exc_info;
4267 }
4268 #endif
4269 
4270 /* SaveResetException */
4271 #if CYTHON_FAST_THREAD_STATE
4272 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4273  #if CYTHON_USE_EXC_INFO_STACK
4274  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
4275  *type = exc_info->exc_type;
4276  *value = exc_info->exc_value;
4277  *tb = exc_info->exc_traceback;
4278  #else
4279  *type = tstate->exc_type;
4280  *value = tstate->exc_value;
4281  *tb = tstate->exc_traceback;
4282  #endif
4283  Py_XINCREF(*type);
4284  Py_XINCREF(*value);
4285  Py_XINCREF(*tb);
4286 }
4287 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4288  PyObject *tmp_type, *tmp_value, *tmp_tb;
4289  #if CYTHON_USE_EXC_INFO_STACK
4290  _PyErr_StackItem *exc_info = tstate->exc_info;
4291  tmp_type = exc_info->exc_type;
4292  tmp_value = exc_info->exc_value;
4293  tmp_tb = exc_info->exc_traceback;
4294  exc_info->exc_type = type;
4295  exc_info->exc_value = value;
4296  exc_info->exc_traceback = tb;
4297  #else
4298  tmp_type = tstate->exc_type;
4299  tmp_value = tstate->exc_value;
4300  tmp_tb = tstate->exc_traceback;
4301  tstate->exc_type = type;
4302  tstate->exc_value = value;
4303  tstate->exc_traceback = tb;
4304  #endif
4305  Py_XDECREF(tmp_type);
4306  Py_XDECREF(tmp_value);
4307  Py_XDECREF(tmp_tb);
4308 }
4309 #endif
4310 
4311 /* PyErrExceptionMatches */
4312 #if CYTHON_FAST_THREAD_STATE
4313 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4314  Py_ssize_t i, n;
4315  n = PyTuple_GET_SIZE(tuple);
4316 #if PY_MAJOR_VERSION >= 3
4317  for (i=0; i<n; i++) {
4318  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
4319  }
4320 #endif
4321  for (i=0; i<n; i++) {
4322  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
4323  }
4324  return 0;
4325 }
4326 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
4327  PyObject *exc_type = tstate->curexc_type;
4328  if (exc_type == err) return 1;
4329  if (unlikely(!exc_type)) return 0;
4330  if (unlikely(PyTuple_Check(err)))
4331  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
4332  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
4333 }
4334 #endif
4335 
4336 /* GetException */
4337 #if CYTHON_FAST_THREAD_STATE
4338 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
4339 #else
4340 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
4341 #endif
4342 {
4343  PyObject *local_type, *local_value, *local_tb;
4344 #if CYTHON_FAST_THREAD_STATE
4345  PyObject *tmp_type, *tmp_value, *tmp_tb;
4346  local_type = tstate->curexc_type;
4347  local_value = tstate->curexc_value;
4348  local_tb = tstate->curexc_traceback;
4349  tstate->curexc_type = 0;
4350  tstate->curexc_value = 0;
4351  tstate->curexc_traceback = 0;
4352 #else
4353  PyErr_Fetch(&local_type, &local_value, &local_tb);
4354 #endif
4355  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
4356 #if CYTHON_FAST_THREAD_STATE
4357  if (unlikely(tstate->curexc_type))
4358 #else
4359  if (unlikely(PyErr_Occurred()))
4360 #endif
4361  goto bad;
4362  #if PY_MAJOR_VERSION >= 3
4363  if (local_tb) {
4364  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
4365  goto bad;
4366  }
4367  #endif
4368  Py_XINCREF(local_tb);
4369  Py_XINCREF(local_type);
4370  Py_XINCREF(local_value);
4371  *type = local_type;
4372  *value = local_value;
4373  *tb = local_tb;
4374 #if CYTHON_FAST_THREAD_STATE
4375  #if CYTHON_USE_EXC_INFO_STACK
4376  {
4377  _PyErr_StackItem *exc_info = tstate->exc_info;
4378  tmp_type = exc_info->exc_type;
4379  tmp_value = exc_info->exc_value;
4380  tmp_tb = exc_info->exc_traceback;
4381  exc_info->exc_type = local_type;
4382  exc_info->exc_value = local_value;
4383  exc_info->exc_traceback = local_tb;
4384  }
4385  #else
4386  tmp_type = tstate->exc_type;
4387  tmp_value = tstate->exc_value;
4388  tmp_tb = tstate->exc_traceback;
4389  tstate->exc_type = local_type;
4390  tstate->exc_value = local_value;
4391  tstate->exc_traceback = local_tb;
4392  #endif
4393  Py_XDECREF(tmp_type);
4394  Py_XDECREF(tmp_value);
4395  Py_XDECREF(tmp_tb);
4396 #else
4397  PyErr_SetExcInfo(local_type, local_value, local_tb);
4398 #endif
4399  return 0;
4400 bad:
4401  *type = 0;
4402  *value = 0;
4403  *tb = 0;
4404  Py_XDECREF(local_type);
4405  Py_XDECREF(local_value);
4406  Py_XDECREF(local_tb);
4407  return -1;
4408 }
4409 
4410 /* PyObjectCall */
4411 #if CYTHON_COMPILING_IN_CPYTHON
4412 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
4413  PyObject *result;
4414  ternaryfunc call = Py_TYPE(func)->tp_call;
4415  if (unlikely(!call))
4416  return PyObject_Call(func, arg, kw);
4417  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4418  return NULL;
4419  result = (*call)(func, arg, kw);
4420  Py_LeaveRecursiveCall();
4421  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4422  PyErr_SetString(
4423  PyExc_SystemError,
4424  "NULL result without error in PyObject_Call");
4425  }
4426  return result;
4427 }
4428 #endif
4429 
4430 /* PyErrFetchRestore */
4431 #if CYTHON_FAST_THREAD_STATE
4432 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4433  PyObject *tmp_type, *tmp_value, *tmp_tb;
4434  tmp_type = tstate->curexc_type;
4435  tmp_value = tstate->curexc_value;
4436  tmp_tb = tstate->curexc_traceback;
4437  tstate->curexc_type = type;
4438  tstate->curexc_value = value;
4439  tstate->curexc_traceback = tb;
4440  Py_XDECREF(tmp_type);
4441  Py_XDECREF(tmp_value);
4442  Py_XDECREF(tmp_tb);
4443 }
4444 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4445  *type = tstate->curexc_type;
4446  *value = tstate->curexc_value;
4447  *tb = tstate->curexc_traceback;
4448  tstate->curexc_type = 0;
4449  tstate->curexc_value = 0;
4450  tstate->curexc_traceback = 0;
4451 }
4452 #endif
4453 
4454 /* RaiseException */
4455 #if PY_MAJOR_VERSION < 3
4456 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
4457  CYTHON_UNUSED PyObject *cause) {
4458  __Pyx_PyThreadState_declare
4459  Py_XINCREF(type);
4460  if (!value || value == Py_None)
4461  value = NULL;
4462  else
4463  Py_INCREF(value);
4464  if (!tb || tb == Py_None)
4465  tb = NULL;
4466  else {
4467  Py_INCREF(tb);
4468  if (!PyTraceBack_Check(tb)) {
4469  PyErr_SetString(PyExc_TypeError,
4470  "raise: arg 3 must be a traceback or None");
4471  goto raise_error;
4472  }
4473  }
4474  if (PyType_Check(type)) {
4475 #if CYTHON_COMPILING_IN_PYPY
4476  if (!value) {
4477  Py_INCREF(Py_None);
4478  value = Py_None;
4479  }
4480 #endif
4481  PyErr_NormalizeException(&type, &value, &tb);
4482  } else {
4483  if (value) {
4484  PyErr_SetString(PyExc_TypeError,
4485  "instance exception may not have a separate value");
4486  goto raise_error;
4487  }
4488  value = type;
4489  type = (PyObject*) Py_TYPE(type);
4490  Py_INCREF(type);
4491  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
4492  PyErr_SetString(PyExc_TypeError,
4493  "raise: exception class must be a subclass of BaseException");
4494  goto raise_error;
4495  }
4496  }
4497  __Pyx_PyThreadState_assign
4498  __Pyx_ErrRestore(type, value, tb);
4499  return;
4500 raise_error:
4501  Py_XDECREF(value);
4502  Py_XDECREF(type);
4503  Py_XDECREF(tb);
4504  return;
4505 }
4506 #else
4507 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4508  PyObject* owned_instance = NULL;
4509  if (tb == Py_None) {
4510  tb = 0;
4511  } else if (tb && !PyTraceBack_Check(tb)) {
4512  PyErr_SetString(PyExc_TypeError,
4513  "raise: arg 3 must be a traceback or None");
4514  goto bad;
4515  }
4516  if (value == Py_None)
4517  value = 0;
4518  if (PyExceptionInstance_Check(type)) {
4519  if (value) {
4520  PyErr_SetString(PyExc_TypeError,
4521  "instance exception may not have a separate value");
4522  goto bad;
4523  }
4524  value = type;
4525  type = (PyObject*) Py_TYPE(value);
4526  } else if (PyExceptionClass_Check(type)) {
4527  PyObject *instance_class = NULL;
4528  if (value && PyExceptionInstance_Check(value)) {
4529  instance_class = (PyObject*) Py_TYPE(value);
4530  if (instance_class != type) {
4531  int is_subclass = PyObject_IsSubclass(instance_class, type);
4532  if (!is_subclass) {
4533  instance_class = NULL;
4534  } else if (unlikely(is_subclass == -1)) {
4535  goto bad;
4536  } else {
4537  type = instance_class;
4538  }
4539  }
4540  }
4541  if (!instance_class) {
4542  PyObject *args;
4543  if (!value)
4544  args = PyTuple_New(0);
4545  else if (PyTuple_Check(value)) {
4546  Py_INCREF(value);
4547  args = value;
4548  } else
4549  args = PyTuple_Pack(1, value);
4550  if (!args)
4551  goto bad;
4552  owned_instance = PyObject_Call(type, args, NULL);
4553  Py_DECREF(args);
4554  if (!owned_instance)
4555  goto bad;
4556  value = owned_instance;
4557  if (!PyExceptionInstance_Check(value)) {
4558  PyErr_Format(PyExc_TypeError,
4559  "calling %R should have returned an instance of "
4560  "BaseException, not %R",
4561  type, Py_TYPE(value));
4562  goto bad;
4563  }
4564  }
4565  } else {
4566  PyErr_SetString(PyExc_TypeError,
4567  "raise: exception class must be a subclass of BaseException");
4568  goto bad;
4569  }
4570  if (cause) {
4571  PyObject *fixed_cause;
4572  if (cause == Py_None) {
4573  fixed_cause = NULL;
4574  } else if (PyExceptionClass_Check(cause)) {
4575  fixed_cause = PyObject_CallObject(cause, NULL);
4576  if (fixed_cause == NULL)
4577  goto bad;
4578  } else if (PyExceptionInstance_Check(cause)) {
4579  fixed_cause = cause;
4580  Py_INCREF(fixed_cause);
4581  } else {
4582  PyErr_SetString(PyExc_TypeError,
4583  "exception causes must derive from "
4584  "BaseException");
4585  goto bad;
4586  }
4587  PyException_SetCause(value, fixed_cause);
4588  }
4589  PyErr_SetObject(type, value);
4590  if (tb) {
4591 #if CYTHON_COMPILING_IN_PYPY
4592  PyObject *tmp_type, *tmp_value, *tmp_tb;
4593  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
4594  Py_INCREF(tb);
4595  PyErr_Restore(tmp_type, tmp_value, tb);
4596  Py_XDECREF(tmp_tb);
4597 #else
4598  PyThreadState *tstate = __Pyx_PyThreadState_Current;
4599  PyObject* tmp_tb = tstate->curexc_traceback;
4600  if (tb != tmp_tb) {
4601  Py_INCREF(tb);
4602  tstate->curexc_traceback = tb;
4603  Py_XDECREF(tmp_tb);
4604  }
4605 #endif
4606  }
4607 bad:
4608  Py_XDECREF(owned_instance);
4609  return;
4610 }
4611 #endif
4612 
4613 /* TypeImport */
4614 #ifndef __PYX_HAVE_RT_ImportType
4615 #define __PYX_HAVE_RT_ImportType
4616 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
4617  size_t size, enum __Pyx_ImportType_CheckSize check_size)
4618 {
4619  PyObject *result = 0;
4620  char warning[200];
4621  Py_ssize_t basicsize;
4622 #ifdef Py_LIMITED_API
4623  PyObject *py_basicsize;
4624 #endif
4625  result = PyObject_GetAttrString(module, class_name);
4626  if (!result)
4627  goto bad;
4628  if (!PyType_Check(result)) {
4629  PyErr_Format(PyExc_TypeError,
4630  "%.200s.%.200s is not a type object",
4631  module_name, class_name);
4632  goto bad;
4633  }
4634 #ifndef Py_LIMITED_API
4635  basicsize = ((PyTypeObject *)result)->tp_basicsize;
4636 #else
4637  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
4638  if (!py_basicsize)
4639  goto bad;
4640  basicsize = PyLong_AsSsize_t(py_basicsize);
4641  Py_DECREF(py_basicsize);
4642  py_basicsize = 0;
4643  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
4644  goto bad;
4645 #endif
4646  if ((size_t)basicsize < size) {
4647  PyErr_Format(PyExc_ValueError,
4648  "%.200s.%.200s size changed, may indicate binary incompatibility. "
4649  "Expected %zd from C header, got %zd from PyObject",
4650  module_name, class_name, size, basicsize);
4651  goto bad;
4652  }
4653  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
4654  PyErr_Format(PyExc_ValueError,
4655  "%.200s.%.200s size changed, may indicate binary incompatibility. "
4656  "Expected %zd from C header, got %zd from PyObject",
4657  module_name, class_name, size, basicsize);
4658  goto bad;
4659  }
4660  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
4661  PyOS_snprintf(warning, sizeof(warning),
4662  "%s.%s size changed, may indicate binary incompatibility. "
4663  "Expected %zd from C header, got %zd from PyObject",
4664  module_name, class_name, size, basicsize);
4665  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
4666  }
4667  return (PyTypeObject *)result;
4668 bad:
4669  Py_XDECREF(result);
4670  return NULL;
4671 }
4672 #endif
4673 
4674 /* Import */
4675 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
4676  PyObject *empty_list = 0;
4677  PyObject *module = 0;
4678  PyObject *global_dict = 0;
4679  PyObject *empty_dict = 0;
4680  PyObject *list;
4681  #if PY_MAJOR_VERSION < 3
4682  PyObject *py_import;
4683  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
4684  if (!py_import)
4685  goto bad;
4686  #endif
4687  if (from_list)
4688  list = from_list;
4689  else {
4690  empty_list = PyList_New(0);
4691  if (!empty_list)
4692  goto bad;
4693  list = empty_list;
4694  }
4695  global_dict = PyModule_GetDict(__pyx_m);
4696  if (!global_dict)
4697  goto bad;
4698  empty_dict = PyDict_New();
4699  if (!empty_dict)
4700  goto bad;
4701  {
4702  #if PY_MAJOR_VERSION >= 3
4703  if (level == -1) {
4704  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
4705  module = PyImport_ImportModuleLevelObject(
4706  name, global_dict, empty_dict, list, 1);
4707  if (!module) {
4708  if (!PyErr_ExceptionMatches(PyExc_ImportError))
4709  goto bad;
4710  PyErr_Clear();
4711  }
4712  }
4713  level = 0;
4714  }
4715  #endif
4716  if (!module) {
4717  #if PY_MAJOR_VERSION < 3
4718  PyObject *py_level = PyInt_FromLong(level);
4719  if (!py_level)
4720  goto bad;
4721  module = PyObject_CallFunctionObjArgs(py_import,
4722  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
4723  Py_DECREF(py_level);
4724  #else
4725  module = PyImport_ImportModuleLevelObject(
4726  name, global_dict, empty_dict, list, level);
4727  #endif
4728  }
4729  }
4730 bad:
4731  #if PY_MAJOR_VERSION < 3
4732  Py_XDECREF(py_import);
4733  #endif
4734  Py_XDECREF(empty_list);
4735  Py_XDECREF(empty_dict);
4736  return module;
4737 }
4738 
4739 /* PyDictVersioning */
4740 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
4741 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
4742  PyObject *dict = Py_TYPE(obj)->tp_dict;
4743  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
4744 }
4745 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
4746  PyObject **dictptr = NULL;
4747  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
4748  if (offset) {
4749 #if CYTHON_COMPILING_IN_CPYTHON
4750  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
4751 #else
4752  dictptr = _PyObject_GetDictPtr(obj);
4753 #endif
4754  }
4755  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
4756 }
4757 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
4758  PyObject *dict = Py_TYPE(obj)->tp_dict;
4759  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
4760  return 0;
4761  return obj_dict_version == __Pyx_get_object_dict_version(obj);
4762 }
4763 #endif
4764 
4765 /* CLineInTraceback */
4766 #ifndef CYTHON_CLINE_IN_TRACEBACK
4767 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
4768  PyObject *use_cline;
4769  PyObject *ptype, *pvalue, *ptraceback;
4770 #if CYTHON_COMPILING_IN_CPYTHON
4771  PyObject **cython_runtime_dict;
4772 #endif
4773  if (unlikely(!__pyx_cython_runtime)) {
4774  return c_line;
4775  }
4776  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4777 #if CYTHON_COMPILING_IN_CPYTHON
4778  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4779  if (likely(cython_runtime_dict)) {
4780  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
4781  use_cline, *cython_runtime_dict,
4782  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
4783  } else
4784 #endif
4785  {
4786  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4787  if (use_cline_obj) {
4788  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4789  Py_DECREF(use_cline_obj);
4790  } else {
4791  PyErr_Clear();
4792  use_cline = NULL;
4793  }
4794  }
4795  if (!use_cline) {
4796  c_line = 0;
4797  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4798  }
4799  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
4800  c_line = 0;
4801  }
4802  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4803  return c_line;
4804 }
4805 #endif
4806 
4807 /* CodeObjectCache */
4808 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4809  int start = 0, mid = 0, end = count - 1;
4810  if (end >= 0 && code_line > entries[end].code_line) {
4811  return count;
4812  }
4813  while (start < end) {
4814  mid = start + (end - start) / 2;
4815  if (code_line < entries[mid].code_line) {
4816  end = mid;
4817  } else if (code_line > entries[mid].code_line) {
4818  start = mid + 1;
4819  } else {
4820  return mid;
4821  }
4822  }
4823  if (code_line <= entries[mid].code_line) {
4824  return mid;
4825  } else {
4826  return mid + 1;
4827  }
4828 }
4829 static PyCodeObject *__pyx_find_code_object(int code_line) {
4830  PyCodeObject* code_object;
4831  int pos;
4832  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
4833  return NULL;
4834  }
4835  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4836  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
4837  return NULL;
4838  }
4839  code_object = __pyx_code_cache.entries[pos].code_object;
4840  Py_INCREF(code_object);
4841  return code_object;
4842 }
4843 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
4844  int pos, i;
4845  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
4846  if (unlikely(!code_line)) {
4847  return;
4848  }
4849  if (unlikely(!entries)) {
4850  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
4851  if (likely(entries)) {
4852  __pyx_code_cache.entries = entries;
4853  __pyx_code_cache.max_count = 64;
4854  __pyx_code_cache.count = 1;
4855  entries[0].code_line = code_line;
4856  entries[0].code_object = code_object;
4857  Py_INCREF(code_object);
4858  }
4859  return;
4860  }
4861  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4862  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
4863  PyCodeObject* tmp = entries[pos].code_object;
4864  entries[pos].code_object = code_object;
4865  Py_DECREF(tmp);
4866  return;
4867  }
4868  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
4869  int new_max = __pyx_code_cache.max_count + 64;
4870  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
4871  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
4872  if (unlikely(!entries)) {
4873  return;
4874  }
4875  __pyx_code_cache.entries = entries;
4876  __pyx_code_cache.max_count = new_max;
4877  }
4878  for (i=__pyx_code_cache.count; i>pos; i--) {
4879  entries[i] = entries[i-1];
4880  }
4881  entries[pos].code_line = code_line;
4882  entries[pos].code_object = code_object;
4883  __pyx_code_cache.count++;
4884  Py_INCREF(code_object);
4885 }
4886 
4887 /* AddTraceback */
4888 #include "compile.h"
4889 #include "frameobject.h"
4890 #include "traceback.h"
4891 #if PY_VERSION_HEX >= 0x030b00a6
4892  #ifndef Py_BUILD_CORE
4893  #define Py_BUILD_CORE 1
4894  #endif
4895  #include "internal/pycore_frame.h"
4896 #endif
4897 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
4898  const char *funcname, int c_line,
4899  int py_line, const char *filename) {
4900  PyCodeObject *py_code = NULL;
4901  PyObject *py_funcname = NULL;
4902  #if PY_MAJOR_VERSION < 3
4903  PyObject *py_srcfile = NULL;
4904  py_srcfile = PyString_FromString(filename);
4905  if (!py_srcfile) goto bad;
4906  #endif
4907  if (c_line) {
4908  #if PY_MAJOR_VERSION < 3
4909  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4910  if (!py_funcname) goto bad;
4911  #else
4912  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4913  if (!py_funcname) goto bad;
4914  funcname = PyUnicode_AsUTF8(py_funcname);
4915  if (!funcname) goto bad;
4916  #endif
4917  }
4918  else {
4919  #if PY_MAJOR_VERSION < 3
4920  py_funcname = PyString_FromString(funcname);
4921  if (!py_funcname) goto bad;
4922  #endif
4923  }
4924  #if PY_MAJOR_VERSION < 3
4925  py_code = __Pyx_PyCode_New(
4926  0,
4927  0,
4928  0,
4929  0,
4930  0,
4931  __pyx_empty_bytes, /*PyObject *code,*/
4932  __pyx_empty_tuple, /*PyObject *consts,*/
4933  __pyx_empty_tuple, /*PyObject *names,*/
4934  __pyx_empty_tuple, /*PyObject *varnames,*/
4935  __pyx_empty_tuple, /*PyObject *freevars,*/
4936  __pyx_empty_tuple, /*PyObject *cellvars,*/
4937  py_srcfile, /*PyObject *filename,*/
4938  py_funcname, /*PyObject *name,*/
4939  py_line,
4940  __pyx_empty_bytes /*PyObject *lnotab*/
4941  );
4942  Py_DECREF(py_srcfile);
4943  #else
4944  py_code = PyCode_NewEmpty(filename, funcname, py_line);
4945  #endif
4946  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
4947  return py_code;
4948 bad:
4949  Py_XDECREF(py_funcname);
4950  #if PY_MAJOR_VERSION < 3
4951  Py_XDECREF(py_srcfile);
4952  #endif
4953  return NULL;
4954 }
4955 static void __Pyx_AddTraceback(const char *funcname, int c_line,
4956  int py_line, const char *filename) {
4957  PyCodeObject *py_code = 0;
4958  PyFrameObject *py_frame = 0;
4959  PyThreadState *tstate = __Pyx_PyThreadState_Current;
4960  PyObject *ptype, *pvalue, *ptraceback;
4961  if (c_line) {
4962  c_line = __Pyx_CLineForTraceback(tstate, c_line);
4963  }
4964  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
4965  if (!py_code) {
4966  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4967  py_code = __Pyx_CreateCodeObjectForTraceback(
4968  funcname, c_line, py_line, filename);
4969  if (!py_code) {
4970  /* If the code object creation fails, then we should clear the
4971  fetched exception references and propagate the new exception */
4972  Py_XDECREF(ptype);
4973  Py_XDECREF(pvalue);
4974  Py_XDECREF(ptraceback);
4975  goto bad;
4976  }
4977  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4978  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
4979  }
4980  py_frame = PyFrame_New(
4981  tstate, /*PyThreadState *tstate,*/
4982  py_code, /*PyCodeObject *code,*/
4983  __pyx_d, /*PyObject *globals,*/
4984  0 /*PyObject *locals*/
4985  );
4986  if (!py_frame) goto bad;
4987  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
4988  PyTraceBack_Here(py_frame);
4989 bad:
4990  Py_XDECREF(py_code);
4991  Py_XDECREF(py_frame);
4992 }
4993 
4994 /* CIntFromPyVerify */
4995 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
4996  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
4997 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
4998  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
4999 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
5000  {\
5001  func_type value = func_value;\
5002  if (sizeof(target_type) < sizeof(func_type)) {\
5003  if (unlikely(value != (func_type) (target_type) value)) {\
5004  func_type zero = 0;\
5005  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
5006  return (target_type) -1;\
5007  if (is_unsigned && unlikely(value < zero))\
5008  goto raise_neg_overflow;\
5009  else\
5010  goto raise_overflow;\
5011  }\
5012  }\
5013  return (target_type) value;\
5014  }
5015 
5016 /* Declarations */
5017 #if CYTHON_CCOMPLEX
5018  #ifdef __cplusplus
5019  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
5020  return ::std::complex< float >(x, y);
5021  }
5022  #else
5023  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
5024  return x + y*(__pyx_t_float_complex)_Complex_I;
5025  }
5026  #endif
5027 #else
5028  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
5029  __pyx_t_float_complex z;
5030  z.real = x;
5031  z.imag = y;
5032  return z;
5033  }
5034 #endif
5035 
5036 /* Arithmetic */
5037 #if CYTHON_CCOMPLEX
5038 #else
5039  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5040  return (a.real == b.real) && (a.imag == b.imag);
5041  }
5042  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5043  __pyx_t_float_complex z;
5044  z.real = a.real + b.real;
5045  z.imag = a.imag + b.imag;
5046  return z;
5047  }
5048  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5049  __pyx_t_float_complex z;
5050  z.real = a.real - b.real;
5051  z.imag = a.imag - b.imag;
5052  return z;
5053  }
5054  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5055  __pyx_t_float_complex z;
5056  z.real = a.real * b.real - a.imag * b.imag;
5057  z.imag = a.real * b.imag + a.imag * b.real;
5058  return z;
5059  }
5060  #if 1
5061  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5062  if (b.imag == 0) {
5063  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
5064  } else if (fabsf(b.real) >= fabsf(b.imag)) {
5065  if (b.real == 0 && b.imag == 0) {
5066  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
5067  } else {
5068  float r = b.imag / b.real;
5069  float s = (float)(1.0) / (b.real + b.imag * r);
5070  return __pyx_t_float_complex_from_parts(
5071  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
5072  }
5073  } else {
5074  float r = b.real / b.imag;
5075  float s = (float)(1.0) / (b.imag + b.real * r);
5076  return __pyx_t_float_complex_from_parts(
5077  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
5078  }
5079  }
5080  #else
5081  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5082  if (b.imag == 0) {
5083  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
5084  } else {
5085  float denom = b.real * b.real + b.imag * b.imag;
5086  return __pyx_t_float_complex_from_parts(
5087  (a.real * b.real + a.imag * b.imag) / denom,
5088  (a.imag * b.real - a.real * b.imag) / denom);
5089  }
5090  }
5091  #endif
5092  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
5093  __pyx_t_float_complex z;
5094  z.real = -a.real;
5095  z.imag = -a.imag;
5096  return z;
5097  }
5098  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
5099  return (a.real == 0) && (a.imag == 0);
5100  }
5101  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
5102  __pyx_t_float_complex z;
5103  z.real = a.real;
5104  z.imag = -a.imag;
5105  return z;
5106  }
5107  #if 1
5108  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
5109  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
5110  return sqrtf(z.real*z.real + z.imag*z.imag);
5111  #else
5112  return hypotf(z.real, z.imag);
5113  #endif
5114  }
5115  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5116  __pyx_t_float_complex z;
5117  float r, lnr, theta, z_r, z_theta;
5118  if (b.imag == 0 && b.real == (int)b.real) {
5119  if (b.real < 0) {
5120  float denom = a.real * a.real + a.imag * a.imag;
5121  a.real = a.real / denom;
5122  a.imag = -a.imag / denom;
5123  b.real = -b.real;
5124  }
5125  switch ((int)b.real) {
5126  case 0:
5127  z.real = 1;
5128  z.imag = 0;
5129  return z;
5130  case 1:
5131  return a;
5132  case 2:
5133  return __Pyx_c_prod_float(a, a);
5134  case 3:
5135  z = __Pyx_c_prod_float(a, a);
5136  return __Pyx_c_prod_float(z, a);
5137  case 4:
5138  z = __Pyx_c_prod_float(a, a);
5139  return __Pyx_c_prod_float(z, z);
5140  }
5141  }
5142  if (a.imag == 0) {
5143  if (a.real == 0) {
5144  return a;
5145  } else if (b.imag == 0) {
5146  z.real = powf(a.real, b.real);
5147  z.imag = 0;
5148  return z;
5149  } else if (a.real > 0) {
5150  r = a.real;
5151  theta = 0;
5152  } else {
5153  r = -a.real;
5154  theta = atan2f(0.0, -1.0);
5155  }
5156  } else {
5157  r = __Pyx_c_abs_float(a);
5158  theta = atan2f(a.imag, a.real);
5159  }
5160  lnr = logf(r);
5161  z_r = expf(lnr * b.real - theta * b.imag);
5162  z_theta = theta * b.real + lnr * b.imag;
5163  z.real = z_r * cosf(z_theta);
5164  z.imag = z_r * sinf(z_theta);
5165  return z;
5166  }
5167  #endif
5168 #endif
5169 
5170 /* Declarations */
5171 #if CYTHON_CCOMPLEX
5172  #ifdef __cplusplus
5173  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
5174  return ::std::complex< double >(x, y);
5175  }
5176  #else
5177  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
5178  return x + y*(__pyx_t_double_complex)_Complex_I;
5179  }
5180  #endif
5181 #else
5182  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
5183  __pyx_t_double_complex z;
5184  z.real = x;
5185  z.imag = y;
5186  return z;
5187  }
5188 #endif
5189 
5190 /* Arithmetic */
5191 #if CYTHON_CCOMPLEX
5192 #else
5193  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5194  return (a.real == b.real) && (a.imag == b.imag);
5195  }
5196  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5197  __pyx_t_double_complex z;
5198  z.real = a.real + b.real;
5199  z.imag = a.imag + b.imag;
5200  return z;
5201  }
5202  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5203  __pyx_t_double_complex z;
5204  z.real = a.real - b.real;
5205  z.imag = a.imag - b.imag;
5206  return z;
5207  }
5208  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5209  __pyx_t_double_complex z;
5210  z.real = a.real * b.real - a.imag * b.imag;
5211  z.imag = a.real * b.imag + a.imag * b.real;
5212  return z;
5213  }
5214  #if 1
5215  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5216  if (b.imag == 0) {
5217  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
5218  } else if (fabs(b.real) >= fabs(b.imag)) {
5219  if (b.real == 0 && b.imag == 0) {
5220  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
5221  } else {
5222  double r = b.imag / b.real;
5223  double s = (double)(1.0) / (b.real + b.imag * r);
5224  return __pyx_t_double_complex_from_parts(
5225  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
5226  }
5227  } else {
5228  double r = b.real / b.imag;
5229  double s = (double)(1.0) / (b.imag + b.real * r);
5230  return __pyx_t_double_complex_from_parts(
5231  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
5232  }
5233  }
5234  #else
5235  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5236  if (b.imag == 0) {
5237  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
5238  } else {
5239  double denom = b.real * b.real + b.imag * b.imag;
5240  return __pyx_t_double_complex_from_parts(
5241  (a.real * b.real + a.imag * b.imag) / denom,
5242  (a.imag * b.real - a.real * b.imag) / denom);
5243  }
5244  }
5245  #endif
5246  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
5247  __pyx_t_double_complex z;
5248  z.real = -a.real;
5249  z.imag = -a.imag;
5250  return z;
5251  }
5252  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
5253  return (a.real == 0) && (a.imag == 0);
5254  }
5255  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
5256  __pyx_t_double_complex z;
5257  z.real = a.real;
5258  z.imag = -a.imag;
5259  return z;
5260  }
5261  #if 1
5262  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
5263  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
5264  return sqrt(z.real*z.real + z.imag*z.imag);
5265  #else
5266  return hypot(z.real, z.imag);
5267  #endif
5268  }
5269  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5270  __pyx_t_double_complex z;
5271  double r, lnr, theta, z_r, z_theta;
5272  if (b.imag == 0 && b.real == (int)b.real) {
5273  if (b.real < 0) {
5274  double denom = a.real * a.real + a.imag * a.imag;
5275  a.real = a.real / denom;
5276  a.imag = -a.imag / denom;
5277  b.real = -b.real;
5278  }
5279  switch ((int)b.real) {
5280  case 0:
5281  z.real = 1;
5282  z.imag = 0;
5283  return z;
5284  case 1:
5285  return a;
5286  case 2:
5287  return __Pyx_c_prod_double(a, a);
5288  case 3:
5289  z = __Pyx_c_prod_double(a, a);
5290  return __Pyx_c_prod_double(z, a);
5291  case 4:
5292  z = __Pyx_c_prod_double(a, a);
5293  return __Pyx_c_prod_double(z, z);
5294  }
5295  }
5296  if (a.imag == 0) {
5297  if (a.real == 0) {
5298  return a;
5299  } else if (b.imag == 0) {
5300  z.real = pow(a.real, b.real);
5301  z.imag = 0;
5302  return z;
5303  } else if (a.real > 0) {
5304  r = a.real;
5305  theta = 0;
5306  } else {
5307  r = -a.real;
5308  theta = atan2(0.0, -1.0);
5309  }
5310  } else {
5311  r = __Pyx_c_abs_double(a);
5312  theta = atan2(a.imag, a.real);
5313  }
5314  lnr = log(r);
5315  z_r = exp(lnr * b.real - theta * b.imag);
5316  z_theta = theta * b.real + lnr * b.imag;
5317  z.real = z_r * cos(z_theta);
5318  z.imag = z_r * sin(z_theta);
5319  return z;
5320  }
5321  #endif
5322 #endif
5323 
5324 /* CIntFromPy */
5325 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
5326 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5327 #pragma GCC diagnostic push
5328 #pragma GCC diagnostic ignored "-Wconversion"
5329 #endif
5330  const int neg_one = (int) -1, const_zero = (int) 0;
5331 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5332 #pragma GCC diagnostic pop
5333 #endif
5334  const int is_unsigned = neg_one > const_zero;
5335 #if PY_MAJOR_VERSION < 3
5336  if (likely(PyInt_Check(x))) {
5337  if (sizeof(int) < sizeof(long)) {
5338  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
5339  } else {
5340  long val = PyInt_AS_LONG(x);
5341  if (is_unsigned && unlikely(val < 0)) {
5342  goto raise_neg_overflow;
5343  }
5344  return (int) val;
5345  }
5346  } else
5347 #endif
5348  if (likely(PyLong_Check(x))) {
5349  if (is_unsigned) {
5350 #if CYTHON_USE_PYLONG_INTERNALS
5351  const digit* digits = ((PyLongObject*)x)->ob_digit;
5352  switch (Py_SIZE(x)) {
5353  case 0: return (int) 0;
5354  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
5355  case 2:
5356  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
5357  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5358  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5359  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
5360  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5361  }
5362  }
5363  break;
5364  case 3:
5365  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
5366  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5367  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5368  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
5369  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5370  }
5371  }
5372  break;
5373  case 4:
5374  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
5375  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5376  __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])))
5377  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
5378  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5379  }
5380  }
5381  break;
5382  }
5383 #endif
5384 #if CYTHON_COMPILING_IN_CPYTHON
5385  if (unlikely(Py_SIZE(x) < 0)) {
5386  goto raise_neg_overflow;
5387  }
5388 #else
5389  {
5390  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5391  if (unlikely(result < 0))
5392  return (int) -1;
5393  if (unlikely(result == 1))
5394  goto raise_neg_overflow;
5395  }
5396 #endif
5397  if (sizeof(int) <= sizeof(unsigned long)) {
5398  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
5399 #ifdef HAVE_LONG_LONG
5400  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
5401  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5402 #endif
5403  }
5404  } else {
5405 #if CYTHON_USE_PYLONG_INTERNALS
5406  const digit* digits = ((PyLongObject*)x)->ob_digit;
5407  switch (Py_SIZE(x)) {
5408  case 0: return (int) 0;
5409  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
5410  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
5411  case -2:
5412  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
5413  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5414  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5415  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5416  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5417  }
5418  }
5419  break;
5420  case 2:
5421  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
5422  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5423  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5424  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5425  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5426  }
5427  }
5428  break;
5429  case -3:
5430  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5431  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5432  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5433  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5434  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5435  }
5436  }
5437  break;
5438  case 3:
5439  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
5440  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5441  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5442  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5443  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5444  }
5445  }
5446  break;
5447  case -4:
5448  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5449  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5450  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5451  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5452  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5453  }
5454  }
5455  break;
5456  case 4:
5457  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
5458  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5459  __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])))
5460  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5461  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5462  }
5463  }
5464  break;
5465  }
5466 #endif
5467  if (sizeof(int) <= sizeof(long)) {
5468  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
5469 #ifdef HAVE_LONG_LONG
5470  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
5471  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
5472 #endif
5473  }
5474  }
5475  {
5476 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5477  PyErr_SetString(PyExc_RuntimeError,
5478  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5479 #else
5480  int val;
5481  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
5482  #if PY_MAJOR_VERSION < 3
5483  if (likely(v) && !PyLong_Check(v)) {
5484  PyObject *tmp = v;
5485  v = PyNumber_Long(tmp);
5486  Py_DECREF(tmp);
5487  }
5488  #endif
5489  if (likely(v)) {
5490  int one = 1; int is_little = (int)*(unsigned char *)&one;
5491  unsigned char *bytes = (unsigned char *)&val;
5492  int ret = _PyLong_AsByteArray((PyLongObject *)v,
5493  bytes, sizeof(val),
5494  is_little, !is_unsigned);
5495  Py_DECREF(v);
5496  if (likely(!ret))
5497  return val;
5498  }
5499 #endif
5500  return (int) -1;
5501  }
5502  } else {
5503  int val;
5504  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5505  if (!tmp) return (int) -1;
5506  val = __Pyx_PyInt_As_int(tmp);
5507  Py_DECREF(tmp);
5508  return val;
5509  }
5510 raise_overflow:
5511  PyErr_SetString(PyExc_OverflowError,
5512  "value too large to convert to int");
5513  return (int) -1;
5514 raise_neg_overflow:
5515  PyErr_SetString(PyExc_OverflowError,
5516  "can't convert negative value to int");
5517  return (int) -1;
5518 }
5519 
5520 /* CIntToPy */
5521 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
5522 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5523 #pragma GCC diagnostic push
5524 #pragma GCC diagnostic ignored "-Wconversion"
5525 #endif
5526  const int neg_one = (int) -1, const_zero = (int) 0;
5527 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5528 #pragma GCC diagnostic pop
5529 #endif
5530  const int is_unsigned = neg_one > const_zero;
5531  if (is_unsigned) {
5532  if (sizeof(int) < sizeof(long)) {
5533  return PyInt_FromLong((long) value);
5534  } else if (sizeof(int) <= sizeof(unsigned long)) {
5535  return PyLong_FromUnsignedLong((unsigned long) value);
5536 #ifdef HAVE_LONG_LONG
5537  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
5538  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
5539 #endif
5540  }
5541  } else {
5542  if (sizeof(int) <= sizeof(long)) {
5543  return PyInt_FromLong((long) value);
5544 #ifdef HAVE_LONG_LONG
5545  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
5546  return PyLong_FromLongLong((PY_LONG_LONG) value);
5547 #endif
5548  }
5549  }
5550  {
5551  int one = 1; int little = (int)*(unsigned char *)&one;
5552  unsigned char *bytes = (unsigned char *)&value;
5553  return _PyLong_FromByteArray(bytes, sizeof(int),
5554  little, !is_unsigned);
5555  }
5556 }
5557 
5558 /* CIntToPy */
5559 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5560 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5561 #pragma GCC diagnostic push
5562 #pragma GCC diagnostic ignored "-Wconversion"
5563 #endif
5564  const long neg_one = (long) -1, const_zero = (long) 0;
5565 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5566 #pragma GCC diagnostic pop
5567 #endif
5568  const int is_unsigned = neg_one > const_zero;
5569  if (is_unsigned) {
5570  if (sizeof(long) < sizeof(long)) {
5571  return PyInt_FromLong((long) value);
5572  } else if (sizeof(long) <= sizeof(unsigned long)) {
5573  return PyLong_FromUnsignedLong((unsigned long) value);
5574 #ifdef HAVE_LONG_LONG
5575  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
5576  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
5577 #endif
5578  }
5579  } else {
5580  if (sizeof(long) <= sizeof(long)) {
5581  return PyInt_FromLong((long) value);
5582 #ifdef HAVE_LONG_LONG
5583  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
5584  return PyLong_FromLongLong((PY_LONG_LONG) value);
5585 #endif
5586  }
5587  }
5588  {
5589  int one = 1; int little = (int)*(unsigned char *)&one;
5590  unsigned char *bytes = (unsigned char *)&value;
5591  return _PyLong_FromByteArray(bytes, sizeof(long),
5592  little, !is_unsigned);
5593  }
5594 }
5595 
5596 /* CIntFromPy */
5597 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5598 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5599 #pragma GCC diagnostic push
5600 #pragma GCC diagnostic ignored "-Wconversion"
5601 #endif
5602  const long neg_one = (long) -1, const_zero = (long) 0;
5603 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5604 #pragma GCC diagnostic pop
5605 #endif
5606  const int is_unsigned = neg_one > const_zero;
5607 #if PY_MAJOR_VERSION < 3
5608  if (likely(PyInt_Check(x))) {
5609  if (sizeof(long) < sizeof(long)) {
5610  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
5611  } else {
5612  long val = PyInt_AS_LONG(x);
5613  if (is_unsigned && unlikely(val < 0)) {
5614  goto raise_neg_overflow;
5615  }
5616  return (long) val;
5617  }
5618  } else
5619 #endif
5620  if (likely(PyLong_Check(x))) {
5621  if (is_unsigned) {
5622 #if CYTHON_USE_PYLONG_INTERNALS
5623  const digit* digits = ((PyLongObject*)x)->ob_digit;
5624  switch (Py_SIZE(x)) {
5625  case 0: return (long) 0;
5626  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
5627  case 2:
5628  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
5629  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5630  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5631  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
5632  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5633  }
5634  }
5635  break;
5636  case 3:
5637  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
5638  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5639  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5640  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
5641  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5642  }
5643  }
5644  break;
5645  case 4:
5646  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
5647  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5648  __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])))
5649  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
5650  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5651  }
5652  }
5653  break;
5654  }
5655 #endif
5656 #if CYTHON_COMPILING_IN_CPYTHON
5657  if (unlikely(Py_SIZE(x) < 0)) {
5658  goto raise_neg_overflow;
5659  }
5660 #else
5661  {
5662  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5663  if (unlikely(result < 0))
5664  return (long) -1;
5665  if (unlikely(result == 1))
5666  goto raise_neg_overflow;
5667  }
5668 #endif
5669  if (sizeof(long) <= sizeof(unsigned long)) {
5670  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
5671 #ifdef HAVE_LONG_LONG
5672  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
5673  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5674 #endif
5675  }
5676  } else {
5677 #if CYTHON_USE_PYLONG_INTERNALS
5678  const digit* digits = ((PyLongObject*)x)->ob_digit;
5679  switch (Py_SIZE(x)) {
5680  case 0: return (long) 0;
5681  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
5682  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
5683  case -2:
5684  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
5685  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5686  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5687  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5688  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5689  }
5690  }
5691  break;
5692  case 2:
5693  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
5694  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5695  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5696  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5697  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5698  }
5699  }
5700  break;
5701  case -3:
5702  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5703  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5704  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5705  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5706  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5707  }
5708  }
5709  break;
5710  case 3:
5711  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
5712  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5713  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5714  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5715  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5716  }
5717  }
5718  break;
5719  case -4:
5720  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5721  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5722  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5723  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
5724  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5725  }
5726  }
5727  break;
5728  case 4:
5729  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
5730  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5731  __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])))
5732  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
5733  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5734  }
5735  }
5736  break;
5737  }
5738 #endif
5739  if (sizeof(long) <= sizeof(long)) {
5740  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
5741 #ifdef HAVE_LONG_LONG
5742  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
5743  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
5744 #endif
5745  }
5746  }
5747  {
5748 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5749  PyErr_SetString(PyExc_RuntimeError,
5750  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5751 #else
5752  long val;
5753  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
5754  #if PY_MAJOR_VERSION < 3
5755  if (likely(v) && !PyLong_Check(v)) {
5756  PyObject *tmp = v;
5757  v = PyNumber_Long(tmp);
5758  Py_DECREF(tmp);
5759  }
5760  #endif
5761  if (likely(v)) {
5762  int one = 1; int is_little = (int)*(unsigned char *)&one;
5763  unsigned char *bytes = (unsigned char *)&val;
5764  int ret = _PyLong_AsByteArray((PyLongObject *)v,
5765  bytes, sizeof(val),
5766  is_little, !is_unsigned);
5767  Py_DECREF(v);
5768  if (likely(!ret))
5769  return val;
5770  }
5771 #endif
5772  return (long) -1;
5773  }
5774  } else {
5775  long val;
5776  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5777  if (!tmp) return (long) -1;
5778  val = __Pyx_PyInt_As_long(tmp);
5779  Py_DECREF(tmp);
5780  return val;
5781  }
5782 raise_overflow:
5783  PyErr_SetString(PyExc_OverflowError,
5784  "value too large to convert to long");
5785  return (long) -1;
5786 raise_neg_overflow:
5787  PyErr_SetString(PyExc_OverflowError,
5788  "can't convert negative value to long");
5789  return (long) -1;
5790 }
5791 
5792 /* FastTypeChecks */
5793 #if CYTHON_COMPILING_IN_CPYTHON
5794 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
5795  while (a) {
5796  a = a->tp_base;
5797  if (a == b)
5798  return 1;
5799  }
5800  return b == &PyBaseObject_Type;
5801 }
5802 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
5803  PyObject *mro;
5804  if (a == b) return 1;
5805  mro = a->tp_mro;
5806  if (likely(mro)) {
5807  Py_ssize_t i, n;
5808  n = PyTuple_GET_SIZE(mro);
5809  for (i = 0; i < n; i++) {
5810  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
5811  return 1;
5812  }
5813  return 0;
5814  }
5815  return __Pyx_InBases(a, b);
5816 }
5817 #if PY_MAJOR_VERSION == 2
5818 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
5819  PyObject *exception, *value, *tb;
5820  int res;
5821  __Pyx_PyThreadState_declare
5822  __Pyx_PyThreadState_assign
5823  __Pyx_ErrFetch(&exception, &value, &tb);
5824  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
5825  if (unlikely(res == -1)) {
5826  PyErr_WriteUnraisable(err);
5827  res = 0;
5828  }
5829  if (!res) {
5830  res = PyObject_IsSubclass(err, exc_type2);
5831  if (unlikely(res == -1)) {
5832  PyErr_WriteUnraisable(err);
5833  res = 0;
5834  }
5835  }
5836  __Pyx_ErrRestore(exception, value, tb);
5837  return res;
5838 }
5839 #else
5840 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
5841  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
5842  if (!res) {
5843  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
5844  }
5845  return res;
5846 }
5847 #endif
5848 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5849  Py_ssize_t i, n;
5850  assert(PyExceptionClass_Check(exc_type));
5851  n = PyTuple_GET_SIZE(tuple);
5852 #if PY_MAJOR_VERSION >= 3
5853  for (i=0; i<n; i++) {
5854  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5855  }
5856 #endif
5857  for (i=0; i<n; i++) {
5858  PyObject *t = PyTuple_GET_ITEM(tuple, i);
5859  #if PY_MAJOR_VERSION < 3
5860  if (likely(exc_type == t)) return 1;
5861  #endif
5862  if (likely(PyExceptionClass_Check(t))) {
5863  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
5864  } else {
5865  }
5866  }
5867  return 0;
5868 }
5869 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
5870  if (likely(err == exc_type)) return 1;
5871  if (likely(PyExceptionClass_Check(err))) {
5872  if (likely(PyExceptionClass_Check(exc_type))) {
5873  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
5874  } else if (likely(PyTuple_Check(exc_type))) {
5875  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
5876  } else {
5877  }
5878  }
5879  return PyErr_GivenExceptionMatches(err, exc_type);
5880 }
5881 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
5882  assert(PyExceptionClass_Check(exc_type1));
5883  assert(PyExceptionClass_Check(exc_type2));
5884  if (likely(err == exc_type1 || err == exc_type2)) return 1;
5885  if (likely(PyExceptionClass_Check(err))) {
5886  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
5887  }
5888  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
5889 }
5890 #endif
5891 
5892 /* CheckBinaryVersion */
5893 static int __Pyx_check_binary_version(void) {
5894  char ctversion[5];
5895  int same=1, i, found_dot;
5896  const char* rt_from_call = Py_GetVersion();
5897  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
5898  found_dot = 0;
5899  for (i = 0; i < 4; i++) {
5900  if (!ctversion[i]) {
5901  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
5902  break;
5903  }
5904  if (rt_from_call[i] != ctversion[i]) {
5905  same = 0;
5906  break;
5907  }
5908  }
5909  if (!same) {
5910  char rtversion[5] = {'\0'};
5911  char message[200];
5912  for (i=0; i<4; ++i) {
5913  if (rt_from_call[i] == '.') {
5914  if (found_dot) break;
5915  found_dot = 1;
5916  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
5917  break;
5918  }
5919  rtversion[i] = rt_from_call[i];
5920  }
5921  PyOS_snprintf(message, sizeof(message),
5922  "compiletime version %s of module '%.100s' "
5923  "does not match runtime version %s",
5924  ctversion, __Pyx_MODULE_NAME, rtversion);
5925  return PyErr_WarnEx(NULL, message, 1);
5926  }
5927  return 0;
5928 }
5929 
5930 /* InitStrings */
5931 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5932  while (t->p) {
5933  #if PY_MAJOR_VERSION < 3
5934  if (t->is_unicode) {
5935  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
5936  } else if (t->intern) {
5937  *t->p = PyString_InternFromString(t->s);
5938  } else {
5939  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
5940  }
5941  #else
5942  if (t->is_unicode | t->is_str) {
5943  if (t->intern) {
5944  *t->p = PyUnicode_InternFromString(t->s);
5945  } else if (t->encoding) {
5946  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
5947  } else {
5948  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
5949  }
5950  } else {
5951  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
5952  }
5953  #endif
5954  if (!*t->p)
5955  return -1;
5956  if (PyObject_Hash(*t->p) == -1)
5957  return -1;
5958  ++t;
5959  }
5960  return 0;
5961 }
5962 
5963 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
5964  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
5965 }
5966 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
5967  Py_ssize_t ignore;
5968  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
5969 }
5970 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5971 #if !CYTHON_PEP393_ENABLED
5972 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5973  char* defenc_c;
5974  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5975  if (!defenc) return NULL;
5976  defenc_c = PyBytes_AS_STRING(defenc);
5977 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5978  {
5979  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5980  char* c;
5981  for (c = defenc_c; c < end; c++) {
5982  if ((unsigned char) (*c) >= 128) {
5983  PyUnicode_AsASCIIString(o);
5984  return NULL;
5985  }
5986  }
5987  }
5988 #endif
5989  *length = PyBytes_GET_SIZE(defenc);
5990  return defenc_c;
5991 }
5992 #else
5993 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5994  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
5995 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5996  if (likely(PyUnicode_IS_ASCII(o))) {
5997  *length = PyUnicode_GET_LENGTH(o);
5998  return PyUnicode_AsUTF8(o);
5999  } else {
6000  PyUnicode_AsASCIIString(o);
6001  return NULL;
6002  }
6003 #else
6004  return PyUnicode_AsUTF8AndSize(o, length);
6005 #endif
6006 }
6007 #endif
6008 #endif
6009 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6010 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6011  if (
6012 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6013  __Pyx_sys_getdefaultencoding_not_ascii &&
6014 #endif
6015  PyUnicode_Check(o)) {
6016  return __Pyx_PyUnicode_AsStringAndSize(o, length);
6017  } else
6018 #endif
6019 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
6020  if (PyByteArray_Check(o)) {
6021  *length = PyByteArray_GET_SIZE(o);
6022  return PyByteArray_AS_STRING(o);
6023  } else
6024 #endif
6025  {
6026  char* result;
6027  int r = PyBytes_AsStringAndSize(o, &result, length);
6028  if (unlikely(r < 0)) {
6029  return NULL;
6030  } else {
6031  return result;
6032  }
6033  }
6034 }
6035 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
6036  int is_true = x == Py_True;
6037  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
6038  else return PyObject_IsTrue(x);
6039 }
6040 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
6041  int retval;
6042  if (unlikely(!x)) return -1;
6043  retval = __Pyx_PyObject_IsTrue(x);
6044  Py_DECREF(x);
6045  return retval;
6046 }
6047 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
6048 #if PY_MAJOR_VERSION >= 3
6049  if (PyLong_Check(result)) {
6050  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6051  "__int__ returned non-int (type %.200s). "
6052  "The ability to return an instance of a strict subclass of int "
6053  "is deprecated, and may be removed in a future version of Python.",
6054  Py_TYPE(result)->tp_name)) {
6055  Py_DECREF(result);
6056  return NULL;
6057  }
6058  return result;
6059  }
6060 #endif
6061  PyErr_Format(PyExc_TypeError,
6062  "__%.4s__ returned non-%.4s (type %.200s)",
6063  type_name, type_name, Py_TYPE(result)->tp_name);
6064  Py_DECREF(result);
6065  return NULL;
6066 }
6067 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
6068 #if CYTHON_USE_TYPE_SLOTS
6069  PyNumberMethods *m;
6070 #endif
6071  const char *name = NULL;
6072  PyObject *res = NULL;
6073 #if PY_MAJOR_VERSION < 3
6074  if (likely(PyInt_Check(x) || PyLong_Check(x)))
6075 #else
6076  if (likely(PyLong_Check(x)))
6077 #endif
6078  return __Pyx_NewRef(x);
6079 #if CYTHON_USE_TYPE_SLOTS
6080  m = Py_TYPE(x)->tp_as_number;
6081  #if PY_MAJOR_VERSION < 3
6082  if (m && m->nb_int) {
6083  name = "int";
6084  res = m->nb_int(x);
6085  }
6086  else if (m && m->nb_long) {
6087  name = "long";
6088  res = m->nb_long(x);
6089  }
6090  #else
6091  if (likely(m && m->nb_int)) {
6092  name = "int";
6093  res = m->nb_int(x);
6094  }
6095  #endif
6096 #else
6097  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6098  res = PyNumber_Int(x);
6099  }
6100 #endif
6101  if (likely(res)) {
6102 #if PY_MAJOR_VERSION < 3
6103  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6104 #else
6105  if (unlikely(!PyLong_CheckExact(res))) {
6106 #endif
6107  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
6108  }
6109  }
6110  else if (!PyErr_Occurred()) {
6111  PyErr_SetString(PyExc_TypeError,
6112  "an integer is required");
6113  }
6114  return res;
6115 }
6116 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
6117  Py_ssize_t ival;
6118  PyObject *x;
6119 #if PY_MAJOR_VERSION < 3
6120  if (likely(PyInt_CheckExact(b))) {
6121  if (sizeof(Py_ssize_t) >= sizeof(long))
6122  return PyInt_AS_LONG(b);
6123  else
6124  return PyInt_AsSsize_t(b);
6125  }
6126 #endif
6127  if (likely(PyLong_CheckExact(b))) {
6128  #if CYTHON_USE_PYLONG_INTERNALS
6129  const digit* digits = ((PyLongObject*)b)->ob_digit;
6130  const Py_ssize_t size = Py_SIZE(b);
6131  if (likely(__Pyx_sst_abs(size) <= 1)) {
6132  ival = likely(size) ? digits[0] : 0;
6133  if (size == -1) ival = -ival;
6134  return ival;
6135  } else {
6136  switch (size) {
6137  case 2:
6138  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
6139  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6140  }
6141  break;
6142  case -2:
6143  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
6144  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6145  }
6146  break;
6147  case 3:
6148  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
6149  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6150  }
6151  break;
6152  case -3:
6153  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
6154  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6155  }
6156  break;
6157  case 4:
6158  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
6159  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6160  }
6161  break;
6162  case -4:
6163  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
6164  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6165  }
6166  break;
6167  }
6168  }
6169  #endif
6170  return PyLong_AsSsize_t(b);
6171  }
6172  x = PyNumber_Index(b);
6173  if (!x) return -1;
6174  ival = PyInt_AsSsize_t(x);
6175  Py_DECREF(x);
6176  return ival;
6177 }
6178 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
6179  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
6180  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
6181 #if PY_MAJOR_VERSION < 3
6182  } else if (likely(PyInt_CheckExact(o))) {
6183  return PyInt_AS_LONG(o);
6184 #endif
6185  } else {
6186  Py_ssize_t ival;
6187  PyObject *x;
6188  x = PyNumber_Index(o);
6189  if (!x) return -1;
6190  ival = PyInt_AsLong(x);
6191  Py_DECREF(x);
6192  return ival;
6193  }
6194 }
6195 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
6196  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
6197 }
6198 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
6199  return PyInt_FromSize_t(ival);
6200 }
6201 
6202 
6203 #endif /* Py_PYTHON_H */
SubsurfaceTransportCoefficients.h
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
n
Int n
Definition: Headers.h:28
calculateRusanovFluxSaturationEquationIncomp_PWC
int calculateRusanovFluxSaturationEquationIncomp_PWC(double safetyFactor, int nSpace, int pskModelFlag, int nParams, const int *rowptr, const int *colind, const int *materialTypes, double muw, double mun, const double *omega, const double *Kbar, double b, const double *rwork_psk, const double *rwork_psk_tol, const double *rwork_density_w, const double *rwork_density_n, const double *g, const double *ebq_global_qt, const double *q_lambda_bar, int nElements_global, int nElementBoundaries_element, int nInteriorElementBoundaries_global, int nExteriorElementBoundaries_global, int nQuadraturePoints_element, int nQuadraturePoints_elementBoundary, const int *interiorElementBoundariesArray, const int *exteriorElementBoundariesArray, const int *elementBoundaryElementsArray, const int *elementBoundaryLocalElementBoundariesArray, const double *n, const double *q_u, const double *dV, const int *isDOFBoundary, const double *bc_u, double *flux)
Definition: SubsurfaceTransportCoefficients.cpp:345
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
piecewiseLinearTableLookup
void piecewiseLinearTableLookup(double x, int nv, int *start, double *y, double *dy, const double *xv, const double *yv)
Definition: SubsurfaceTransportCoefficients.cpp:62