proteus  1.8.1
C/C++/Fortran libraries
cTwophaseDarcyCoefficients.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__cTwophaseDarcyCoefficients
708 #define __PYX_HAVE_API__cTwophaseDarcyCoefficients
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 #include "densityRelations.h"
722 #include "pskRelations.h"
723 #ifdef _OPENMP
724 #include <omp.h>
725 #endif /* _OPENMP */
726 
727 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
728 #define CYTHON_WITHOUT_ASSERTIONS
729 #endif
730 
731 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
732  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
733 
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
737 #define __PYX_DEFAULT_STRING_ENCODING ""
738 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
739 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
740 #define __Pyx_uchar_cast(c) ((unsigned char)c)
741 #define __Pyx_long_cast(x) ((long)x)
742 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
743  (sizeof(type) < sizeof(Py_ssize_t)) ||\
744  (sizeof(type) > sizeof(Py_ssize_t) &&\
745  likely(v < (type)PY_SSIZE_T_MAX ||\
746  v == (type)PY_SSIZE_T_MAX) &&\
747  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
748  v == (type)PY_SSIZE_T_MIN))) ||\
749  (sizeof(type) == sizeof(Py_ssize_t) &&\
750  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
751  v == (type)PY_SSIZE_T_MAX))) )
752 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
753  return (size_t) i < (size_t) limit;
754 }
755 #if defined (__cplusplus) && __cplusplus >= 201103L
756  #include <cstdlib>
757  #define __Pyx_sst_abs(value) std::abs(value)
758 #elif SIZEOF_INT >= SIZEOF_SIZE_T
759  #define __Pyx_sst_abs(value) abs(value)
760 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
761  #define __Pyx_sst_abs(value) labs(value)
762 #elif defined (_MSC_VER)
763  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
764 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
765  #define __Pyx_sst_abs(value) llabs(value)
766 #elif defined (__GNUC__)
767  #define __Pyx_sst_abs(value) __builtin_llabs(value)
768 #else
769  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
770 #endif
771 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
772 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
773 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
774 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
775 #define __Pyx_PyBytes_FromString PyBytes_FromString
776 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
777 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
778 #if PY_MAJOR_VERSION < 3
779  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
780  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
781 #else
782  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
783  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
784 #endif
785 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
797 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
798 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
799 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
800 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
801 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
802  const Py_UNICODE *u_end = u;
803  while (*u_end++) ;
804  return (size_t)(u_end - u - 1);
805 }
806 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
807 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
808 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
809 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
810 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
811 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
812 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
813 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
814 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
815 #define __Pyx_PySequence_Tuple(obj)\
816  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
817 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
818 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
819 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
820 #if CYTHON_ASSUME_SAFE_MACROS
821 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
822 #else
823 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
824 #endif
825 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
826 #if PY_MAJOR_VERSION >= 3
827 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
828 #else
829 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
830 #endif
831 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
832 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
833 static int __Pyx_sys_getdefaultencoding_not_ascii;
834 static int __Pyx_init_sys_getdefaultencoding_params(void) {
835  PyObject* sys;
836  PyObject* default_encoding = NULL;
837  PyObject* ascii_chars_u = NULL;
838  PyObject* ascii_chars_b = NULL;
839  const char* default_encoding_c;
840  sys = PyImport_ImportModule("sys");
841  if (!sys) goto bad;
842  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
843  Py_DECREF(sys);
844  if (!default_encoding) goto bad;
845  default_encoding_c = PyBytes_AsString(default_encoding);
846  if (!default_encoding_c) goto bad;
847  if (strcmp(default_encoding_c, "ascii") == 0) {
848  __Pyx_sys_getdefaultencoding_not_ascii = 0;
849  } else {
850  char ascii_chars[128];
851  int c;
852  for (c = 0; c < 128; c++) {
853  ascii_chars[c] = c;
854  }
855  __Pyx_sys_getdefaultencoding_not_ascii = 1;
856  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
857  if (!ascii_chars_u) goto bad;
858  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
859  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
860  PyErr_Format(
861  PyExc_ValueError,
862  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
863  default_encoding_c);
864  goto bad;
865  }
866  Py_DECREF(ascii_chars_u);
867  Py_DECREF(ascii_chars_b);
868  }
869  Py_DECREF(default_encoding);
870  return 0;
871 bad:
872  Py_XDECREF(default_encoding);
873  Py_XDECREF(ascii_chars_u);
874  Py_XDECREF(ascii_chars_b);
875  return -1;
876 }
877 #endif
878 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
880 #else
881 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
882 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
883 static char* __PYX_DEFAULT_STRING_ENCODING;
884 static int __Pyx_init_sys_getdefaultencoding_params(void) {
885  PyObject* sys;
886  PyObject* default_encoding = NULL;
887  char* default_encoding_c;
888  sys = PyImport_ImportModule("sys");
889  if (!sys) goto bad;
890  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
891  Py_DECREF(sys);
892  if (!default_encoding) goto bad;
893  default_encoding_c = PyBytes_AsString(default_encoding);
894  if (!default_encoding_c) goto bad;
895  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
896  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
897  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
898  Py_DECREF(default_encoding);
899  return 0;
900 bad:
901  Py_XDECREF(default_encoding);
902  return -1;
903 }
904 #endif
905 #endif
906 
907 
908 /* Test for GCC > 2.95 */
909 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
910  #define likely(x) __builtin_expect(!!(x), 1)
911  #define unlikely(x) __builtin_expect(!!(x), 0)
912 #else /* !__GNUC__ or GCC < 2.95 */
913  #define likely(x) (x)
914  #define unlikely(x) (x)
915 #endif /* __GNUC__ */
916 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
917 
918 static PyObject *__pyx_m = NULL;
919 static PyObject *__pyx_d;
920 static PyObject *__pyx_b;
921 static PyObject *__pyx_cython_runtime = NULL;
922 static PyObject *__pyx_empty_tuple;
923 static PyObject *__pyx_empty_bytes;
924 static PyObject *__pyx_empty_unicode;
925 static int __pyx_lineno;
926 static int __pyx_clineno = 0;
927 static const char * __pyx_cfilenm= __FILE__;
928 static const char *__pyx_filename;
929 
930 /* Header.proto */
931 #if !defined(CYTHON_CCOMPLEX)
932  #if defined(__cplusplus)
933  #define CYTHON_CCOMPLEX 1
934  #elif defined(_Complex_I)
935  #define CYTHON_CCOMPLEX 1
936  #else
937  #define CYTHON_CCOMPLEX 0
938  #endif
939 #endif
940 #if CYTHON_CCOMPLEX
941  #ifdef __cplusplus
942  #include <complex>
943  #else
944  #include <complex.h>
945  #endif
946 #endif
947 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
948  #undef _Complex_I
949  #define _Complex_I 1.0fj
950 #endif
951 
952 
953 static const char *__pyx_f[] = {
954  "proteus/cTwophaseDarcyCoefficients.pyx",
955  "__init__.pxd",
956  "type.pxd",
957 };
958 
959 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
960  * # in Cython to enable them only on the right systems.
961  *
962  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
963  * ctypedef npy_int16 int16_t
964  * ctypedef npy_int32 int32_t
965  */
966 typedef npy_int8 __pyx_t_5numpy_int8_t;
967 
968 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
969  *
970  * ctypedef npy_int8 int8_t
971  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
972  * ctypedef npy_int32 int32_t
973  * ctypedef npy_int64 int64_t
974  */
975 typedef npy_int16 __pyx_t_5numpy_int16_t;
976 
977 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
978  * ctypedef npy_int8 int8_t
979  * ctypedef npy_int16 int16_t
980  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
981  * ctypedef npy_int64 int64_t
982  * #ctypedef npy_int96 int96_t
983  */
984 typedef npy_int32 __pyx_t_5numpy_int32_t;
985 
986 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
987  * ctypedef npy_int16 int16_t
988  * ctypedef npy_int32 int32_t
989  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
990  * #ctypedef npy_int96 int96_t
991  * #ctypedef npy_int128 int128_t
992  */
993 typedef npy_int64 __pyx_t_5numpy_int64_t;
994 
995 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
996  * #ctypedef npy_int128 int128_t
997  *
998  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
999  * ctypedef npy_uint16 uint16_t
1000  * ctypedef npy_uint32 uint32_t
1001  */
1002 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1003 
1004 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1005  *
1006  * ctypedef npy_uint8 uint8_t
1007  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1008  * ctypedef npy_uint32 uint32_t
1009  * ctypedef npy_uint64 uint64_t
1010  */
1011 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1012 
1013 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1014  * ctypedef npy_uint8 uint8_t
1015  * ctypedef npy_uint16 uint16_t
1016  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1017  * ctypedef npy_uint64 uint64_t
1018  * #ctypedef npy_uint96 uint96_t
1019  */
1020 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1021 
1022 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1023  * ctypedef npy_uint16 uint16_t
1024  * ctypedef npy_uint32 uint32_t
1025  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1026  * #ctypedef npy_uint96 uint96_t
1027  * #ctypedef npy_uint128 uint128_t
1028  */
1029 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1030 
1031 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1032  * #ctypedef npy_uint128 uint128_t
1033  *
1034  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1035  * ctypedef npy_float64 float64_t
1036  * #ctypedef npy_float80 float80_t
1037  */
1038 typedef npy_float32 __pyx_t_5numpy_float32_t;
1039 
1040 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1041  *
1042  * ctypedef npy_float32 float32_t
1043  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1044  * #ctypedef npy_float80 float80_t
1045  * #ctypedef npy_float128 float128_t
1046  */
1047 typedef npy_float64 __pyx_t_5numpy_float64_t;
1048 
1049 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1050  * # The int types are mapped a bit surprising --
1051  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1052  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1053  * ctypedef npy_longlong long_t
1054  * ctypedef npy_longlong longlong_t
1055  */
1056 typedef npy_long __pyx_t_5numpy_int_t;
1057 
1058 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1059  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1060  * ctypedef npy_long int_t
1061  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1062  * ctypedef npy_longlong longlong_t
1063  *
1064  */
1065 typedef npy_longlong __pyx_t_5numpy_long_t;
1066 
1067 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1068  * ctypedef npy_long int_t
1069  * ctypedef npy_longlong long_t
1070  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1071  *
1072  * ctypedef npy_ulong uint_t
1073  */
1074 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1075 
1076 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1077  * ctypedef npy_longlong longlong_t
1078  *
1079  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1080  * ctypedef npy_ulonglong ulong_t
1081  * ctypedef npy_ulonglong ulonglong_t
1082  */
1083 typedef npy_ulong __pyx_t_5numpy_uint_t;
1084 
1085 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1086  *
1087  * ctypedef npy_ulong uint_t
1088  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1089  * ctypedef npy_ulonglong ulonglong_t
1090  *
1091  */
1092 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1093 
1094 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1095  * ctypedef npy_ulong uint_t
1096  * ctypedef npy_ulonglong ulong_t
1097  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1098  *
1099  * ctypedef npy_intp intp_t
1100  */
1101 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1102 
1103 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1104  * ctypedef npy_ulonglong ulonglong_t
1105  *
1106  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1107  * ctypedef npy_uintp uintp_t
1108  *
1109  */
1110 typedef npy_intp __pyx_t_5numpy_intp_t;
1111 
1112 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1113  *
1114  * ctypedef npy_intp intp_t
1115  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1116  *
1117  * ctypedef npy_double float_t
1118  */
1119 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1120 
1121 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1122  * ctypedef npy_uintp uintp_t
1123  *
1124  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1125  * ctypedef npy_double double_t
1126  * ctypedef npy_longdouble longdouble_t
1127  */
1128 typedef npy_double __pyx_t_5numpy_float_t;
1129 
1130 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1131  *
1132  * ctypedef npy_double float_t
1133  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1134  * ctypedef npy_longdouble longdouble_t
1135  *
1136  */
1137 typedef npy_double __pyx_t_5numpy_double_t;
1138 
1139 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1140  * ctypedef npy_double float_t
1141  * ctypedef npy_double double_t
1142  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1143  *
1144  * ctypedef npy_cfloat cfloat_t
1145  */
1146 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1147 /* Declarations.proto */
1148 #if CYTHON_CCOMPLEX
1149  #ifdef __cplusplus
1150  typedef ::std::complex< float > __pyx_t_float_complex;
1151  #else
1152  typedef float _Complex __pyx_t_float_complex;
1153  #endif
1154 #else
1155  typedef struct { float real, imag; } __pyx_t_float_complex;
1156 #endif
1157 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1158 
1159 /* Declarations.proto */
1160 #if CYTHON_CCOMPLEX
1161  #ifdef __cplusplus
1162  typedef ::std::complex< double > __pyx_t_double_complex;
1163  #else
1164  typedef double _Complex __pyx_t_double_complex;
1165  #endif
1166 #else
1167  typedef struct { double real, imag; } __pyx_t_double_complex;
1168 #endif
1169 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1170 
1171 
1172 /*--- Type declarations ---*/
1173 
1174 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1175  * ctypedef npy_longdouble longdouble_t
1176  *
1177  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1178  * ctypedef npy_cdouble cdouble_t
1179  * ctypedef npy_clongdouble clongdouble_t
1180  */
1181 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1182 
1183 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1184  *
1185  * ctypedef npy_cfloat cfloat_t
1186  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1187  * ctypedef npy_clongdouble clongdouble_t
1188  *
1189  */
1190 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1191 
1192 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1193  * ctypedef npy_cfloat cfloat_t
1194  * ctypedef npy_cdouble cdouble_t
1195  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1196  *
1197  * ctypedef npy_cdouble complex_t
1198  */
1199 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1200 
1201 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1202  * ctypedef npy_clongdouble clongdouble_t
1203  *
1204  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1205  *
1206  * cdef inline object PyArray_MultiIterNew1(a):
1207  */
1208 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1209 
1210 /* --- Runtime support code (head) --- */
1211 /* Refnanny.proto */
1212 #ifndef CYTHON_REFNANNY
1213  #define CYTHON_REFNANNY 0
1214 #endif
1215 #if CYTHON_REFNANNY
1216  typedef struct {
1217  void (*INCREF)(void*, PyObject*, int);
1218  void (*DECREF)(void*, PyObject*, int);
1219  void (*GOTREF)(void*, PyObject*, int);
1220  void (*GIVEREF)(void*, PyObject*, int);
1221  void* (*SetupContext)(const char*, int, const char*);
1222  void (*FinishContext)(void**);
1223  } __Pyx_RefNannyAPIStruct;
1224  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1225  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1226  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1227 #ifdef WITH_THREAD
1228  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1229  if (acquire_gil) {\
1230  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1231  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1232  PyGILState_Release(__pyx_gilstate_save);\
1233  } else {\
1234  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1235  }
1236 #else
1237  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1238  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1239 #endif
1240  #define __Pyx_RefNannyFinishContext()\
1241  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1242  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1243  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1244  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1245  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1246  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1247  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1248  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1249  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1250 #else
1251  #define __Pyx_RefNannyDeclarations
1252  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1253  #define __Pyx_RefNannyFinishContext()
1254  #define __Pyx_INCREF(r) Py_INCREF(r)
1255  #define __Pyx_DECREF(r) Py_DECREF(r)
1256  #define __Pyx_GOTREF(r)
1257  #define __Pyx_GIVEREF(r)
1258  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1259  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1260  #define __Pyx_XGOTREF(r)
1261  #define __Pyx_XGIVEREF(r)
1262 #endif
1263 #define __Pyx_XDECREF_SET(r, v) do {\
1264  PyObject *tmp = (PyObject *) r;\
1265  r = v; __Pyx_XDECREF(tmp);\
1266  } while (0)
1267 #define __Pyx_DECREF_SET(r, v) do {\
1268  PyObject *tmp = (PyObject *) r;\
1269  r = v; __Pyx_DECREF(tmp);\
1270  } while (0)
1271 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1272 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1273 
1274 /* RaiseArgTupleInvalid.proto */
1275 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1276  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1277 
1278 /* RaiseDoubleKeywords.proto */
1279 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1280 
1281 /* ParseKeywords.proto */
1282 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1283  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1284  const char* function_name);
1285 
1286 /* ArgTypeTest.proto */
1287 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1288  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1289  __Pyx__ArgTypeTest(obj, type, name, exact))
1290 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1291 
1292 /* PyObjectGetAttrStr.proto */
1293 #if CYTHON_USE_TYPE_SLOTS
1294 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1295 #else
1296 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1297 #endif
1298 
1299 /* GetItemInt.proto */
1300 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1301  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1302  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1303  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1304  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1305 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1306  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1307  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1308  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1309 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1310  int wraparound, int boundscheck);
1311 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1312  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1313  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1314  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1315 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1316  int wraparound, int boundscheck);
1317 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1318 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1319  int is_list, int wraparound, int boundscheck);
1320 
1321 /* PyFunctionFastCall.proto */
1322 #if CYTHON_FAST_PYCALL
1323 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1324  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1325 #if 1 || PY_VERSION_HEX < 0x030600B1
1326 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1327 #else
1328 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1329 #endif
1330 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1331  (sizeof(char [1 - 2*!(cond)]) - 1)
1332 #ifndef Py_MEMBER_SIZE
1333 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1334 #endif
1335 #if CYTHON_FAST_PYCALL
1336  static size_t __pyx_pyframe_localsplus_offset = 0;
1337  #include "frameobject.h"
1338 #if PY_VERSION_HEX >= 0x030b00a6
1339  #ifndef Py_BUILD_CORE
1340  #define Py_BUILD_CORE 1
1341  #endif
1342  #include "internal/pycore_frame.h"
1343 #endif
1344  #define __Pxy_PyFrame_Initialize_Offsets()\
1345  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1346  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1347  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1348  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1349 #endif // CYTHON_FAST_PYCALL
1350 #endif
1351 
1352 /* PyCFunctionFastCall.proto */
1353 #if CYTHON_FAST_PYCCALL
1354 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1355 #else
1356 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1357 #endif
1358 
1359 /* PyObjectCall.proto */
1360 #if CYTHON_COMPILING_IN_CPYTHON
1361 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1362 #else
1363 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1364 #endif
1365 
1366 /* GetBuiltinName.proto */
1367 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1368 
1369 /* GetTopmostException.proto */
1370 #if CYTHON_USE_EXC_INFO_STACK
1371 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1372 #endif
1373 
1374 /* PyThreadStateGet.proto */
1375 #if CYTHON_FAST_THREAD_STATE
1376 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1377 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1378 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1379 #else
1380 #define __Pyx_PyThreadState_declare
1381 #define __Pyx_PyThreadState_assign
1382 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1383 #endif
1384 
1385 /* SaveResetException.proto */
1386 #if CYTHON_FAST_THREAD_STATE
1387 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1388 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1389 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1390 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1391 #else
1392 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1393 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1394 #endif
1395 
1396 /* PyErrExceptionMatches.proto */
1397 #if CYTHON_FAST_THREAD_STATE
1398 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1399 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1400 #else
1401 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1402 #endif
1403 
1404 /* GetException.proto */
1405 #if CYTHON_FAST_THREAD_STATE
1406 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1407 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1408 #else
1409 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1410 #endif
1411 
1412 /* PyErrFetchRestore.proto */
1413 #if CYTHON_FAST_THREAD_STATE
1414 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1415 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1416 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1417 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1418 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1419 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1420 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1421 #if CYTHON_COMPILING_IN_CPYTHON
1422 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1423 #else
1424 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1425 #endif
1426 #else
1427 #define __Pyx_PyErr_Clear() PyErr_Clear()
1428 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1429 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1430 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1431 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1432 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1433 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1434 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1435 #endif
1436 
1437 /* RaiseException.proto */
1438 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1439 
1440 /* TypeImport.proto */
1441 #ifndef __PYX_HAVE_RT_ImportType_proto
1442 #define __PYX_HAVE_RT_ImportType_proto
1443 enum __Pyx_ImportType_CheckSize {
1444  __Pyx_ImportType_CheckSize_Error = 0,
1445  __Pyx_ImportType_CheckSize_Warn = 1,
1446  __Pyx_ImportType_CheckSize_Ignore = 2
1447 };
1448 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1449 #endif
1450 
1451 /* Import.proto */
1452 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1453 
1454 /* PyDictVersioning.proto */
1455 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1456 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1457 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1458 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1459  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1460  (cache_var) = (value);
1461 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1462  static PY_UINT64_T __pyx_dict_version = 0;\
1463  static PyObject *__pyx_dict_cached_value = NULL;\
1464  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1465  (VAR) = __pyx_dict_cached_value;\
1466  } else {\
1467  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1468  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1469  }\
1470 }
1471 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1472 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1473 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1474 #else
1475 #define __PYX_GET_DICT_VERSION(dict) (0)
1476 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1477 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1478 #endif
1479 
1480 /* CLineInTraceback.proto */
1481 #ifdef CYTHON_CLINE_IN_TRACEBACK
1482 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1483 #else
1484 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1485 #endif
1486 
1487 /* CodeObjectCache.proto */
1488 typedef struct {
1489  PyCodeObject* code_object;
1490  int code_line;
1491 } __Pyx_CodeObjectCacheEntry;
1492 struct __Pyx_CodeObjectCache {
1493  int count;
1494  int max_count;
1495  __Pyx_CodeObjectCacheEntry* entries;
1496 };
1497 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1498 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1499 static PyCodeObject *__pyx_find_code_object(int code_line);
1500 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1501 
1502 /* AddTraceback.proto */
1503 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1504  int py_line, const char *filename);
1505 
1506 /* GCCDiagnostics.proto */
1507 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1508 #define __Pyx_HAS_GCC_DIAGNOSTIC
1509 #endif
1510 
1511 /* RealImag.proto */
1512 #if CYTHON_CCOMPLEX
1513  #ifdef __cplusplus
1514  #define __Pyx_CREAL(z) ((z).real())
1515  #define __Pyx_CIMAG(z) ((z).imag())
1516  #else
1517  #define __Pyx_CREAL(z) (__real__(z))
1518  #define __Pyx_CIMAG(z) (__imag__(z))
1519  #endif
1520 #else
1521  #define __Pyx_CREAL(z) ((z).real)
1522  #define __Pyx_CIMAG(z) ((z).imag)
1523 #endif
1524 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1525  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1526  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1527  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1528 #else
1529  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1530  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1531 #endif
1532 
1533 /* Arithmetic.proto */
1534 #if CYTHON_CCOMPLEX
1535  #define __Pyx_c_eq_float(a, b) ((a)==(b))
1536  #define __Pyx_c_sum_float(a, b) ((a)+(b))
1537  #define __Pyx_c_diff_float(a, b) ((a)-(b))
1538  #define __Pyx_c_prod_float(a, b) ((a)*(b))
1539  #define __Pyx_c_quot_float(a, b) ((a)/(b))
1540  #define __Pyx_c_neg_float(a) (-(a))
1541  #ifdef __cplusplus
1542  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1543  #define __Pyx_c_conj_float(z) (::std::conj(z))
1544  #if 1
1545  #define __Pyx_c_abs_float(z) (::std::abs(z))
1546  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1547  #endif
1548  #else
1549  #define __Pyx_c_is_zero_float(z) ((z)==0)
1550  #define __Pyx_c_conj_float(z) (conjf(z))
1551  #if 1
1552  #define __Pyx_c_abs_float(z) (cabsf(z))
1553  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1554  #endif
1555  #endif
1556 #else
1557  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1558  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1559  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1560  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1561  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1562  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1563  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1564  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1565  #if 1
1566  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1567  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1568  #endif
1569 #endif
1570 
1571 /* Arithmetic.proto */
1572 #if CYTHON_CCOMPLEX
1573  #define __Pyx_c_eq_double(a, b) ((a)==(b))
1574  #define __Pyx_c_sum_double(a, b) ((a)+(b))
1575  #define __Pyx_c_diff_double(a, b) ((a)-(b))
1576  #define __Pyx_c_prod_double(a, b) ((a)*(b))
1577  #define __Pyx_c_quot_double(a, b) ((a)/(b))
1578  #define __Pyx_c_neg_double(a) (-(a))
1579  #ifdef __cplusplus
1580  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1581  #define __Pyx_c_conj_double(z) (::std::conj(z))
1582  #if 1
1583  #define __Pyx_c_abs_double(z) (::std::abs(z))
1584  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1585  #endif
1586  #else
1587  #define __Pyx_c_is_zero_double(z) ((z)==0)
1588  #define __Pyx_c_conj_double(z) (conj(z))
1589  #if 1
1590  #define __Pyx_c_abs_double(z) (cabs(z))
1591  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1592  #endif
1593  #endif
1594 #else
1595  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1596  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1597  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1598  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1599  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1600  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1601  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1602  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1603  #if 1
1604  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1605  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1606  #endif
1607 #endif
1608 
1609 /* CIntFromPy.proto */
1610 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1611 
1612 /* CIntToPy.proto */
1613 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1614 
1615 /* CIntToPy.proto */
1616 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1617 
1618 /* CIntFromPy.proto */
1619 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1620 
1621 /* FastTypeChecks.proto */
1622 #if CYTHON_COMPILING_IN_CPYTHON
1623 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1624 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1625 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1626 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1627 #else
1628 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1629 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1630 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1631 #endif
1632 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1633 
1634 /* CheckBinaryVersion.proto */
1635 static int __Pyx_check_binary_version(void);
1636 
1637 /* InitStrings.proto */
1638 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1639 
1640 
1641 /* Module declarations from 'cpython.buffer' */
1642 
1643 /* Module declarations from 'libc.string' */
1644 
1645 /* Module declarations from 'libc.stdio' */
1646 
1647 /* Module declarations from '__builtin__' */
1648 
1649 /* Module declarations from 'cpython.type' */
1650 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1651 
1652 /* Module declarations from 'cpython' */
1653 
1654 /* Module declarations from 'cpython.object' */
1655 
1656 /* Module declarations from 'cpython.ref' */
1657 
1658 /* Module declarations from 'cpython.mem' */
1659 
1660 /* Module declarations from 'numpy' */
1661 
1662 /* Module declarations from 'numpy' */
1663 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1664 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1665 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1666 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1667 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1668 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1669 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1670 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1671 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1672 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1673 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1674 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1675 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1676 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1677 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1678 
1679 /* Module declarations from 'twophaseDarcyCoefficients' */
1680 
1681 /* Module declarations from 'cTwophaseDarcyCoefficients' */
1682 #define __Pyx_MODULE_NAME "cTwophaseDarcyCoefficients"
1683 extern int __pyx_module_is_main_cTwophaseDarcyCoefficients;
1684 int __pyx_module_is_main_cTwophaseDarcyCoefficients = 0;
1685 
1686 /* Implementation of 'cTwophaseDarcyCoefficients' */
1687 static PyObject *__pyx_builtin_ImportError;
1688 static const char __pyx_k_a[] = "a";
1689 static const char __pyx_k_b[] = "b";
1690 static const char __pyx_k_f[] = "f";
1691 static const char __pyx_k_g[] = "g";
1692 static const char __pyx_k_m[] = "m";
1693 static const char __pyx_k_u[] = "u";
1694 static const char __pyx_k_x[] = "x";
1695 static const char __pyx_k_an[] = "an";
1696 static const char __pyx_k_aw[] = "aw";
1697 static const char __pyx_k_da[] = "da";
1698 static const char __pyx_k_df[] = "df";
1699 static const char __pyx_k_dm[] = "dm";
1700 static const char __pyx_k_fn[] = "fn";
1701 static const char __pyx_k_fw[] = "fw";
1702 static const char __pyx_k_mn[] = "mn";
1703 static const char __pyx_k_mw[] = "mw";
1704 static const char __pyx_k_np[] = "np";
1705 static const char __pyx_k_qt[] = "qt";
1706 static const char __pyx_k_sw[] = "sw";
1707 static const char __pyx_k_dan[] = "dan";
1708 static const char __pyx_k_daw[] = "daw";
1709 static const char __pyx_k_dmn[] = "dmn";
1710 static const char __pyx_k_dmw[] = "dmw";
1711 static const char __pyx_k_mun[] = "mun";
1712 static const char __pyx_k_muw[] = "muw";
1713 static const char __pyx_k_phi[] = "phi";
1714 static const char __pyx_k_Kbar[] = "Kbar";
1715 static const char __pyx_k_dphi[] = "dphi";
1716 static const char __pyx_k_main[] = "__main__";
1717 static const char __pyx_k_name[] = "__name__";
1718 static const char __pyx_k_psic[] = "psic";
1719 static const char __pyx_k_psin[] = "psin";
1720 static const char __pyx_k_psiw[] = "psiw";
1721 static const char __pyx_k_size[] = "size";
1722 static const char __pyx_k_test[] = "__test__";
1723 static const char __pyx_k_dpsin[] = "dpsin";
1724 static const char __pyx_k_numpy[] = "numpy";
1725 static const char __pyx_k_omega[] = "omega";
1726 static const char __pyx_k_colind[] = "colind";
1727 static const char __pyx_k_domain[] = "domain";
1728 static const char __pyx_k_format[] = "format";
1729 static const char __pyx_k_import[] = "__import__";
1730 static const char __pyx_k_nknots[] = "nknots";
1731 static const char __pyx_k_rowptr[] = "rowptr";
1732 static const char __pyx_k_dfn_dsw[] = "dfn_dsw";
1733 static const char __pyx_k_dfw_dsw[] = "dfw_dsw";
1734 static const char __pyx_k_matType[] = "matType";
1735 static const char __pyx_k_calcFlag[] = "calcFlag";
1736 static const char __pyx_k_nSimplex[] = "nSimplex";
1737 static const char __pyx_k_phi_psin[] = "phi_psin";
1738 static const char __pyx_k_phi_psiw[] = "phi_psiw";
1739 static const char __pyx_k_dan_dpsic[] = "dan_dpsic";
1740 static const char __pyx_k_dan_dpsiw[] = "dan_dpsiw";
1741 static const char __pyx_k_daw_dpsic[] = "daw_dpsic";
1742 static const char __pyx_k_daw_dpsiw[] = "daw_dpsiw";
1743 static const char __pyx_k_dfn_dpsiw[] = "dfn_dpsiw";
1744 static const char __pyx_k_dfw_dpsiw[] = "dfw_dpsiw";
1745 static const char __pyx_k_dmn_dpsic[] = "dmn_dpsic";
1746 static const char __pyx_k_dmn_dpsiw[] = "dmn_dpsiw";
1747 static const char __pyx_k_dmw_dpsic[] = "dmw_dpsic";
1748 static const char __pyx_k_dmw_dpsiw[] = "dmw_dpsiw";
1749 static const char __pyx_k_grad_psic[] = "grad_psic";
1750 static const char __pyx_k_iwork_psk[] = "iwork_psk";
1751 static const char __pyx_k_rwork_psk[] = "rwork_psk";
1752 static const char __pyx_k_startIndex[] = "startIndex";
1753 static const char __pyx_k_vol_frac_n[] = "vol_frac_n";
1754 static const char __pyx_k_vol_frac_w[] = "vol_frac_w";
1755 static const char __pyx_k_ImportError[] = "ImportError";
1756 static const char __pyx_k_dpsin_dpsiw[] = "dpsin_dpsiw";
1757 static const char __pyx_k_splineTable[] = "splineTable";
1758 static const char __pyx_k_pskModelFlag[] = "pskModelFlag";
1759 static const char __pyx_k_dphi_psin_dsw[] = "dphi_psin_dsw";
1760 static const char __pyx_k_rwork_psk_tol[] = "rwork_psk_tol";
1761 static const char __pyx_k_density_n_flag[] = "density_n_flag";
1762 static const char __pyx_k_density_w_flag[] = "density_w_flag";
1763 static const char __pyx_k_dphi_psin_dpsic[] = "dphi_psin_dpsic";
1764 static const char __pyx_k_dphi_psin_dpsiw[] = "dphi_psin_dpsiw";
1765 static const char __pyx_k_dphi_psiw_dpsiw[] = "dphi_psiw_dpsiw";
1766 static const char __pyx_k_rwork_density_n[] = "rwork_density_n";
1767 static const char __pyx_k_rwork_density_w[] = "rwork_density_w";
1768 static const char __pyx_k_advectionScaling[] = "advectionScaling";
1769 static const char __pyx_k_nPointsPerSimplex[] = "nPointsPerSimplex";
1770 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1771 static const char __pyx_k_compressibilityFlag[] = "compressibilityFlag";
1772 static const char __pyx_k_generateSplineTables[] = "generateSplineTables";
1773 static const char __pyx_k_twophaseDarcy_vol_frac[] = "twophaseDarcy_vol_frac";
1774 static const char __pyx_k_capillaryDiffusionScaling[] = "capillaryDiffusionScaling";
1775 static const char __pyx_k_cTwophaseDarcyCoefficients[] = "cTwophaseDarcyCoefficients";
1776 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1777 static const char __pyx_k_twophaseDarcy_fc_sd_het_matType[] = "twophaseDarcy_fc_sd_het_matType";
1778 static const char __pyx_k_configuration_density_w_flag_0_a[] = "configuration density_w_flag= {0} and density_n_flag= {1} not found ";
1779 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1780 static const char __pyx_k_proteus_cTwophaseDarcyCoefficien[] = "proteus/cTwophaseDarcyCoefficients.pyx";
1781 static const char __pyx_k_twophaseDarcy_compressibleN_spli[] = "twophaseDarcy_compressibleN_split_sd_pressure_het_matType";
1782 static const char __pyx_k_twophaseDarcy_fc_pp_sd_het_matTy[] = "twophaseDarcy_fc_pp_sd_het_matType";
1783 static const char __pyx_k_twophaseDarcy_incompressible_spl[] = "twophaseDarcy_incompressible_split_sd_pressure_het_matType";
1784 static const char __pyx_k_twophaseDarcy_slightCompressible[] = "twophaseDarcy_slightCompressible_split_sd_pressure_het_matType";
1785 static const char __pyx_k_twophaseDarcy_fc_sd_het_matType_2[] = "twophaseDarcy_fc_sd_het_matType_nonPotentialForm";
1786 static const char __pyx_k_twophaseDarcy_compressibleN_spli_2[] = "twophaseDarcy_compressibleN_split_sd_saturation_het_matType";
1787 static const char __pyx_k_twophaseDarcy_incompressible_spl_2[] = "twophaseDarcy_incompressible_split_sd_saturation_het_matType";
1788 static const char __pyx_k_twophaseDarcy_incompressible_spl_3[] = "twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType";
1789 static const char __pyx_k_twophaseDarcy_slightCompressible_2[] = "twophaseDarcy_slightCompressible_split_sd_saturation_het_matType";
1790 static PyObject *__pyx_n_s_ImportError;
1791 static PyObject *__pyx_n_s_Kbar;
1792 static PyObject *__pyx_n_s_a;
1793 static PyObject *__pyx_n_s_advectionScaling;
1794 static PyObject *__pyx_n_s_an;
1795 static PyObject *__pyx_n_s_aw;
1796 static PyObject *__pyx_n_s_b;
1797 static PyObject *__pyx_n_s_cTwophaseDarcyCoefficients;
1798 static PyObject *__pyx_n_s_calcFlag;
1799 static PyObject *__pyx_n_s_capillaryDiffusionScaling;
1800 static PyObject *__pyx_n_s_cline_in_traceback;
1801 static PyObject *__pyx_n_s_colind;
1802 static PyObject *__pyx_n_s_compressibilityFlag;
1803 static PyObject *__pyx_kp_s_configuration_density_w_flag_0_a;
1804 static PyObject *__pyx_n_s_da;
1805 static PyObject *__pyx_n_s_dan;
1806 static PyObject *__pyx_n_s_dan_dpsic;
1807 static PyObject *__pyx_n_s_dan_dpsiw;
1808 static PyObject *__pyx_n_s_daw;
1809 static PyObject *__pyx_n_s_daw_dpsic;
1810 static PyObject *__pyx_n_s_daw_dpsiw;
1811 static PyObject *__pyx_n_s_density_n_flag;
1812 static PyObject *__pyx_n_s_density_w_flag;
1813 static PyObject *__pyx_n_s_df;
1814 static PyObject *__pyx_n_s_dfn_dpsiw;
1815 static PyObject *__pyx_n_s_dfn_dsw;
1816 static PyObject *__pyx_n_s_dfw_dpsiw;
1817 static PyObject *__pyx_n_s_dfw_dsw;
1818 static PyObject *__pyx_n_s_dm;
1819 static PyObject *__pyx_n_s_dmn;
1820 static PyObject *__pyx_n_s_dmn_dpsic;
1821 static PyObject *__pyx_n_s_dmn_dpsiw;
1822 static PyObject *__pyx_n_s_dmw;
1823 static PyObject *__pyx_n_s_dmw_dpsic;
1824 static PyObject *__pyx_n_s_dmw_dpsiw;
1825 static PyObject *__pyx_n_s_domain;
1826 static PyObject *__pyx_n_s_dphi;
1827 static PyObject *__pyx_n_s_dphi_psin_dpsic;
1828 static PyObject *__pyx_n_s_dphi_psin_dpsiw;
1829 static PyObject *__pyx_n_s_dphi_psin_dsw;
1830 static PyObject *__pyx_n_s_dphi_psiw_dpsiw;
1831 static PyObject *__pyx_n_s_dpsin;
1832 static PyObject *__pyx_n_s_dpsin_dpsiw;
1833 static PyObject *__pyx_n_s_f;
1834 static PyObject *__pyx_n_s_fn;
1835 static PyObject *__pyx_n_s_format;
1836 static PyObject *__pyx_n_s_fw;
1837 static PyObject *__pyx_n_s_g;
1838 static PyObject *__pyx_n_s_generateSplineTables;
1839 static PyObject *__pyx_n_s_grad_psic;
1840 static PyObject *__pyx_n_s_import;
1841 static PyObject *__pyx_n_s_iwork_psk;
1842 static PyObject *__pyx_n_s_m;
1843 static PyObject *__pyx_n_s_main;
1844 static PyObject *__pyx_n_s_matType;
1845 static PyObject *__pyx_n_s_mn;
1846 static PyObject *__pyx_n_s_mun;
1847 static PyObject *__pyx_n_s_muw;
1848 static PyObject *__pyx_n_s_mw;
1849 static PyObject *__pyx_n_s_nPointsPerSimplex;
1850 static PyObject *__pyx_n_s_nSimplex;
1851 static PyObject *__pyx_n_s_name;
1852 static PyObject *__pyx_n_s_nknots;
1853 static PyObject *__pyx_n_s_np;
1854 static PyObject *__pyx_n_s_numpy;
1855 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1856 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1857 static PyObject *__pyx_n_s_omega;
1858 static PyObject *__pyx_n_s_phi;
1859 static PyObject *__pyx_n_s_phi_psin;
1860 static PyObject *__pyx_n_s_phi_psiw;
1861 static PyObject *__pyx_kp_s_proteus_cTwophaseDarcyCoefficien;
1862 static PyObject *__pyx_n_s_psic;
1863 static PyObject *__pyx_n_s_psin;
1864 static PyObject *__pyx_n_s_psiw;
1865 static PyObject *__pyx_n_s_pskModelFlag;
1866 static PyObject *__pyx_n_s_qt;
1867 static PyObject *__pyx_n_s_rowptr;
1868 static PyObject *__pyx_n_s_rwork_density_n;
1869 static PyObject *__pyx_n_s_rwork_density_w;
1870 static PyObject *__pyx_n_s_rwork_psk;
1871 static PyObject *__pyx_n_s_rwork_psk_tol;
1872 static PyObject *__pyx_n_s_size;
1873 static PyObject *__pyx_n_s_splineTable;
1874 static PyObject *__pyx_n_s_startIndex;
1875 static PyObject *__pyx_n_s_sw;
1876 static PyObject *__pyx_n_s_test;
1877 static PyObject *__pyx_n_s_twophaseDarcy_compressibleN_spli;
1878 static PyObject *__pyx_n_s_twophaseDarcy_compressibleN_spli_2;
1879 static PyObject *__pyx_n_s_twophaseDarcy_fc_pp_sd_het_matTy;
1880 static PyObject *__pyx_n_s_twophaseDarcy_fc_sd_het_matType;
1881 static PyObject *__pyx_n_s_twophaseDarcy_fc_sd_het_matType_2;
1882 static PyObject *__pyx_n_s_twophaseDarcy_incompressible_spl;
1883 static PyObject *__pyx_n_s_twophaseDarcy_incompressible_spl_2;
1884 static PyObject *__pyx_n_s_twophaseDarcy_incompressible_spl_3;
1885 static PyObject *__pyx_n_s_twophaseDarcy_slightCompressible;
1886 static PyObject *__pyx_n_s_twophaseDarcy_slightCompressible_2;
1887 static PyObject *__pyx_n_s_twophaseDarcy_vol_frac;
1888 static PyObject *__pyx_n_s_u;
1889 static PyObject *__pyx_n_s_vol_frac_n;
1890 static PyObject *__pyx_n_s_vol_frac_w;
1891 static PyObject *__pyx_n_s_x;
1892 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_twophaseDarcy_fc_sd_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, 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_iwork_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_x, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_mw, PyArrayObject *__pyx_v_dmw, PyArrayObject *__pyx_v_dmw_dpsiw, PyArrayObject *__pyx_v_mn, PyArrayObject *__pyx_v_dmn, PyArrayObject *__pyx_v_dmn_dpsiw, PyArrayObject *__pyx_v_psin, PyArrayObject *__pyx_v_dpsin, PyArrayObject *__pyx_v_dpsin_dpsiw, PyArrayObject *__pyx_v_phi_psiw, PyArrayObject *__pyx_v_dphi_psiw_dpsiw, PyArrayObject *__pyx_v_phi_psin, PyArrayObject *__pyx_v_dphi_psin_dpsiw, PyArrayObject *__pyx_v_dphi_psin_dsw, PyArrayObject *__pyx_v_aw, PyArrayObject *__pyx_v_daw, PyArrayObject *__pyx_v_daw_dpsiw, PyArrayObject *__pyx_v_an, PyArrayObject *__pyx_v_dan, PyArrayObject *__pyx_v_dan_dpsiw); /* proto */
1893 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_2twophaseDarcy_fc_sd_het_matType_nonPotentialForm(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, 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_iwork_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_x, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_mw, PyArrayObject *__pyx_v_dmw, PyArrayObject *__pyx_v_dmw_dpsiw, PyArrayObject *__pyx_v_mn, PyArrayObject *__pyx_v_dmn, PyArrayObject *__pyx_v_dmn_dpsiw, PyArrayObject *__pyx_v_psin, PyArrayObject *__pyx_v_dpsin, PyArrayObject *__pyx_v_dpsin_dpsiw, PyArrayObject *__pyx_v_phi_psiw, PyArrayObject *__pyx_v_dphi_psiw_dpsiw, PyArrayObject *__pyx_v_phi_psin, PyArrayObject *__pyx_v_dphi_psin_dpsiw, PyArrayObject *__pyx_v_dphi_psin_dsw, PyArrayObject *__pyx_v_fw, PyArrayObject *__pyx_v_dfw_dsw, PyArrayObject *__pyx_v_dfw_dpsiw, PyArrayObject *__pyx_v_fn, PyArrayObject *__pyx_v_dfn_dsw, PyArrayObject *__pyx_v_dfn_dpsiw, PyArrayObject *__pyx_v_aw, PyArrayObject *__pyx_v_daw, PyArrayObject *__pyx_v_daw_dpsiw, PyArrayObject *__pyx_v_an, PyArrayObject *__pyx_v_dan, PyArrayObject *__pyx_v_dan_dpsiw, int __pyx_v_compressibilityFlag); /* proto */
1894 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_4twophaseDarcy_fc_pp_sd_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, 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_iwork_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_x, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_psic, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_mw, PyArrayObject *__pyx_v_dmw_dpsiw, PyArrayObject *__pyx_v_dmw_dpsic, PyArrayObject *__pyx_v_mn, PyArrayObject *__pyx_v_dmn_dpsiw, PyArrayObject *__pyx_v_dmn_dpsic, PyArrayObject *__pyx_v_phi_psiw, PyArrayObject *__pyx_v_dphi_psiw_dpsiw, PyArrayObject *__pyx_v_phi_psin, PyArrayObject *__pyx_v_dphi_psin_dpsiw, PyArrayObject *__pyx_v_dphi_psin_dpsic, PyArrayObject *__pyx_v_aw, PyArrayObject *__pyx_v_daw_dpsiw, PyArrayObject *__pyx_v_daw_dpsic, PyArrayObject *__pyx_v_an, PyArrayObject *__pyx_v_dan_dpsiw, PyArrayObject *__pyx_v_dan_dpsic); /* proto */
1895 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_6twophaseDarcy_incompressible_split_sd_pressure_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, PyArrayObject *__pyx_v_capillaryDiffusionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_sw, PyArrayObject *__pyx_v_grad_psic, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a); /* proto */
1896 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_8twophaseDarcy_incompressible_split_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, CYTHON_UNUSED int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da); /* proto */
1897 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_10twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, CYTHON_UNUSED int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da); /* proto */
1898 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_12twophaseDarcy_slightCompressible_split_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da); /* proto */
1899 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_14twophaseDarcy_compressibleN_split_sd_pressure_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_sw, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_psin, PyArrayObject *__pyx_v_grad_psic, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a); /* proto */
1900 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_16twophaseDarcy_compressibleN_split_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da); /* proto */
1901 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_18twophaseDarcy_vol_frac(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_matType, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_vol_frac_w, PyArrayObject *__pyx_v_vol_frac_n); /* proto */
1902 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_20generateSplineTables(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_startIndex, int __pyx_v_calcFlag, PyArrayObject *__pyx_v_domain, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_psk, PyArrayObject *__pyx_v_rwork_psk_tol, PyArrayObject *__pyx_v_splineTable); /* proto */
1903 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_22twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da); /* proto */
1904 static PyObject *__pyx_tuple_;
1905 static PyObject *__pyx_tuple__2;
1906 static PyObject *__pyx_tuple__3;
1907 static PyObject *__pyx_tuple__5;
1908 static PyObject *__pyx_tuple__7;
1909 static PyObject *__pyx_tuple__9;
1910 static PyObject *__pyx_tuple__11;
1911 static PyObject *__pyx_tuple__13;
1912 static PyObject *__pyx_tuple__15;
1913 static PyObject *__pyx_tuple__17;
1914 static PyObject *__pyx_tuple__19;
1915 static PyObject *__pyx_tuple__21;
1916 static PyObject *__pyx_tuple__23;
1917 static PyObject *__pyx_tuple__25;
1918 static PyObject *__pyx_codeobj__4;
1919 static PyObject *__pyx_codeobj__6;
1920 static PyObject *__pyx_codeobj__8;
1921 static PyObject *__pyx_codeobj__10;
1922 static PyObject *__pyx_codeobj__12;
1923 static PyObject *__pyx_codeobj__14;
1924 static PyObject *__pyx_codeobj__16;
1925 static PyObject *__pyx_codeobj__18;
1926 static PyObject *__pyx_codeobj__20;
1927 static PyObject *__pyx_codeobj__22;
1928 static PyObject *__pyx_codeobj__24;
1929 static PyObject *__pyx_codeobj__26;
1930 /* Late includes */
1931 
1932 /* "cTwophaseDarcyCoefficients.pyx":32
1933  * pass
1934  *
1935  * def twophaseDarcy_fc_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
1936  * int density_w_flag,
1937  * int density_n_flag,
1938  */
1939 
1940 /* Python wrapper */
1941 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_1twophaseDarcy_fc_sd_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1942 static char __pyx_doc_26cTwophaseDarcyCoefficients_twophaseDarcy_fc_sd_het_matType[] = "Evaluate the coefficients of the fully coupled formulation of\n (slightly) compressible, two-phase Darcy flow for a heterogeneous\n medium, sparse diffusion rep. for het\n\n ";
1943 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_1twophaseDarcy_fc_sd_het_matType = {"twophaseDarcy_fc_sd_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_1twophaseDarcy_fc_sd_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_twophaseDarcy_fc_sd_het_matType};
1944 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_1twophaseDarcy_fc_sd_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1945  int __pyx_v_pskModelFlag;
1946  int __pyx_v_density_w_flag;
1947  int __pyx_v_density_n_flag;
1948  PyArrayObject *__pyx_v_rowptr = 0;
1949  PyArrayObject *__pyx_v_colind = 0;
1950  PyArrayObject *__pyx_v_matType = 0;
1951  double __pyx_v_muw;
1952  double __pyx_v_mun;
1953  PyArrayObject *__pyx_v_omega = 0;
1954  PyArrayObject *__pyx_v_Kbar = 0;
1955  double __pyx_v_b;
1956  PyArrayObject *__pyx_v_rwork_psk = 0;
1957  PyArrayObject *__pyx_v_iwork_psk = 0;
1958  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
1959  PyArrayObject *__pyx_v_rwork_density_w = 0;
1960  PyArrayObject *__pyx_v_rwork_density_n = 0;
1961  PyArrayObject *__pyx_v_g = 0;
1962  PyArrayObject *__pyx_v_x = 0;
1963  PyArrayObject *__pyx_v_sw = 0;
1964  PyArrayObject *__pyx_v_psiw = 0;
1965  PyArrayObject *__pyx_v_mw = 0;
1966  PyArrayObject *__pyx_v_dmw = 0;
1967  PyArrayObject *__pyx_v_dmw_dpsiw = 0;
1968  PyArrayObject *__pyx_v_mn = 0;
1969  PyArrayObject *__pyx_v_dmn = 0;
1970  PyArrayObject *__pyx_v_dmn_dpsiw = 0;
1971  PyArrayObject *__pyx_v_psin = 0;
1972  PyArrayObject *__pyx_v_dpsin = 0;
1973  PyArrayObject *__pyx_v_dpsin_dpsiw = 0;
1974  PyArrayObject *__pyx_v_phi_psiw = 0;
1975  PyArrayObject *__pyx_v_dphi_psiw_dpsiw = 0;
1976  PyArrayObject *__pyx_v_phi_psin = 0;
1977  PyArrayObject *__pyx_v_dphi_psin_dpsiw = 0;
1978  PyArrayObject *__pyx_v_dphi_psin_dsw = 0;
1979  PyArrayObject *__pyx_v_aw = 0;
1980  PyArrayObject *__pyx_v_daw = 0;
1981  PyArrayObject *__pyx_v_daw_dpsiw = 0;
1982  PyArrayObject *__pyx_v_an = 0;
1983  PyArrayObject *__pyx_v_dan = 0;
1984  PyArrayObject *__pyx_v_dan_dpsiw = 0;
1985  int __pyx_lineno = 0;
1986  const char *__pyx_filename = NULL;
1987  int __pyx_clineno = 0;
1988  PyObject *__pyx_r = 0;
1989  __Pyx_RefNannyDeclarations
1990  __Pyx_RefNannySetupContext("twophaseDarcy_fc_sd_het_matType (wrapper)", 0);
1991  {
1992  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__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_iwork_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_x,&__pyx_n_s_sw,&__pyx_n_s_psiw,&__pyx_n_s_mw,&__pyx_n_s_dmw,&__pyx_n_s_dmw_dpsiw,&__pyx_n_s_mn,&__pyx_n_s_dmn,&__pyx_n_s_dmn_dpsiw,&__pyx_n_s_psin,&__pyx_n_s_dpsin,&__pyx_n_s_dpsin_dpsiw,&__pyx_n_s_phi_psiw,&__pyx_n_s_dphi_psiw_dpsiw,&__pyx_n_s_phi_psin,&__pyx_n_s_dphi_psin_dpsiw,&__pyx_n_s_dphi_psin_dsw,&__pyx_n_s_aw,&__pyx_n_s_daw,&__pyx_n_s_daw_dpsiw,&__pyx_n_s_an,&__pyx_n_s_dan,&__pyx_n_s_dan_dpsiw,0};
1993  PyObject* values[40] = {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,0,0,0,0,0};
1994  if (unlikely(__pyx_kwds)) {
1995  Py_ssize_t kw_args;
1996  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1997  switch (pos_args) {
1998  case 40: values[39] = PyTuple_GET_ITEM(__pyx_args, 39);
1999  CYTHON_FALLTHROUGH;
2000  case 39: values[38] = PyTuple_GET_ITEM(__pyx_args, 38);
2001  CYTHON_FALLTHROUGH;
2002  case 38: values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
2003  CYTHON_FALLTHROUGH;
2004  case 37: values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
2005  CYTHON_FALLTHROUGH;
2006  case 36: values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
2007  CYTHON_FALLTHROUGH;
2008  case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
2009  CYTHON_FALLTHROUGH;
2010  case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
2011  CYTHON_FALLTHROUGH;
2012  case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
2013  CYTHON_FALLTHROUGH;
2014  case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
2015  CYTHON_FALLTHROUGH;
2016  case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
2017  CYTHON_FALLTHROUGH;
2018  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
2019  CYTHON_FALLTHROUGH;
2020  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
2021  CYTHON_FALLTHROUGH;
2022  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
2023  CYTHON_FALLTHROUGH;
2024  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
2025  CYTHON_FALLTHROUGH;
2026  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
2027  CYTHON_FALLTHROUGH;
2028  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
2029  CYTHON_FALLTHROUGH;
2030  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
2031  CYTHON_FALLTHROUGH;
2032  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
2033  CYTHON_FALLTHROUGH;
2034  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
2035  CYTHON_FALLTHROUGH;
2036  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
2037  CYTHON_FALLTHROUGH;
2038  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
2039  CYTHON_FALLTHROUGH;
2040  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
2041  CYTHON_FALLTHROUGH;
2042  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
2043  CYTHON_FALLTHROUGH;
2044  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
2045  CYTHON_FALLTHROUGH;
2046  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
2047  CYTHON_FALLTHROUGH;
2048  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2049  CYTHON_FALLTHROUGH;
2050  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2051  CYTHON_FALLTHROUGH;
2052  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2053  CYTHON_FALLTHROUGH;
2054  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2055  CYTHON_FALLTHROUGH;
2056  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2057  CYTHON_FALLTHROUGH;
2058  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2059  CYTHON_FALLTHROUGH;
2060  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2061  CYTHON_FALLTHROUGH;
2062  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2063  CYTHON_FALLTHROUGH;
2064  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2065  CYTHON_FALLTHROUGH;
2066  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2067  CYTHON_FALLTHROUGH;
2068  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2069  CYTHON_FALLTHROUGH;
2070  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2071  CYTHON_FALLTHROUGH;
2072  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2073  CYTHON_FALLTHROUGH;
2074  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2075  CYTHON_FALLTHROUGH;
2076  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2077  CYTHON_FALLTHROUGH;
2078  case 0: break;
2079  default: goto __pyx_L5_argtuple_error;
2080  }
2081  kw_args = PyDict_Size(__pyx_kwds);
2082  switch (pos_args) {
2083  case 0:
2084  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
2085  else goto __pyx_L5_argtuple_error;
2086  CYTHON_FALLTHROUGH;
2087  case 1:
2088  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
2089  else {
2090  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 1); __PYX_ERR(0, 32, __pyx_L3_error)
2091  }
2092  CYTHON_FALLTHROUGH;
2093  case 2:
2094  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
2095  else {
2096  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 2); __PYX_ERR(0, 32, __pyx_L3_error)
2097  }
2098  CYTHON_FALLTHROUGH;
2099  case 3:
2100  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2101  else {
2102  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 3); __PYX_ERR(0, 32, __pyx_L3_error)
2103  }
2104  CYTHON_FALLTHROUGH;
2105  case 4:
2106  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2107  else {
2108  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 4); __PYX_ERR(0, 32, __pyx_L3_error)
2109  }
2110  CYTHON_FALLTHROUGH;
2111  case 5:
2112  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
2113  else {
2114  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 5); __PYX_ERR(0, 32, __pyx_L3_error)
2115  }
2116  CYTHON_FALLTHROUGH;
2117  case 6:
2118  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
2119  else {
2120  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 6); __PYX_ERR(0, 32, __pyx_L3_error)
2121  }
2122  CYTHON_FALLTHROUGH;
2123  case 7:
2124  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
2125  else {
2126  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 7); __PYX_ERR(0, 32, __pyx_L3_error)
2127  }
2128  CYTHON_FALLTHROUGH;
2129  case 8:
2130  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
2131  else {
2132  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 8); __PYX_ERR(0, 32, __pyx_L3_error)
2133  }
2134  CYTHON_FALLTHROUGH;
2135  case 9:
2136  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
2137  else {
2138  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 9); __PYX_ERR(0, 32, __pyx_L3_error)
2139  }
2140  CYTHON_FALLTHROUGH;
2141  case 10:
2142  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
2143  else {
2144  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 10); __PYX_ERR(0, 32, __pyx_L3_error)
2145  }
2146  CYTHON_FALLTHROUGH;
2147  case 11:
2148  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
2149  else {
2150  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 11); __PYX_ERR(0, 32, __pyx_L3_error)
2151  }
2152  CYTHON_FALLTHROUGH;
2153  case 12:
2154  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
2155  else {
2156  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 12); __PYX_ERR(0, 32, __pyx_L3_error)
2157  }
2158  CYTHON_FALLTHROUGH;
2159  case 13:
2160  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
2161  else {
2162  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 13); __PYX_ERR(0, 32, __pyx_L3_error)
2163  }
2164  CYTHON_FALLTHROUGH;
2165  case 14:
2166  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
2167  else {
2168  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 14); __PYX_ERR(0, 32, __pyx_L3_error)
2169  }
2170  CYTHON_FALLTHROUGH;
2171  case 15:
2172  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
2173  else {
2174  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 15); __PYX_ERR(0, 32, __pyx_L3_error)
2175  }
2176  CYTHON_FALLTHROUGH;
2177  case 16:
2178  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
2179  else {
2180  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 16); __PYX_ERR(0, 32, __pyx_L3_error)
2181  }
2182  CYTHON_FALLTHROUGH;
2183  case 17:
2184  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
2185  else {
2186  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 17); __PYX_ERR(0, 32, __pyx_L3_error)
2187  }
2188  CYTHON_FALLTHROUGH;
2189  case 18:
2190  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
2191  else {
2192  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 18); __PYX_ERR(0, 32, __pyx_L3_error)
2193  }
2194  CYTHON_FALLTHROUGH;
2195  case 19:
2196  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
2197  else {
2198  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 19); __PYX_ERR(0, 32, __pyx_L3_error)
2199  }
2200  CYTHON_FALLTHROUGH;
2201  case 20:
2202  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mw)) != 0)) kw_args--;
2203  else {
2204  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 20); __PYX_ERR(0, 32, __pyx_L3_error)
2205  }
2206  CYTHON_FALLTHROUGH;
2207  case 21:
2208  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmw)) != 0)) kw_args--;
2209  else {
2210  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 21); __PYX_ERR(0, 32, __pyx_L3_error)
2211  }
2212  CYTHON_FALLTHROUGH;
2213  case 22:
2214  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmw_dpsiw)) != 0)) kw_args--;
2215  else {
2216  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 22); __PYX_ERR(0, 32, __pyx_L3_error)
2217  }
2218  CYTHON_FALLTHROUGH;
2219  case 23:
2220  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mn)) != 0)) kw_args--;
2221  else {
2222  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 23); __PYX_ERR(0, 32, __pyx_L3_error)
2223  }
2224  CYTHON_FALLTHROUGH;
2225  case 24:
2226  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmn)) != 0)) kw_args--;
2227  else {
2228  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 24); __PYX_ERR(0, 32, __pyx_L3_error)
2229  }
2230  CYTHON_FALLTHROUGH;
2231  case 25:
2232  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmn_dpsiw)) != 0)) kw_args--;
2233  else {
2234  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 25); __PYX_ERR(0, 32, __pyx_L3_error)
2235  }
2236  CYTHON_FALLTHROUGH;
2237  case 26:
2238  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psin)) != 0)) kw_args--;
2239  else {
2240  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 26); __PYX_ERR(0, 32, __pyx_L3_error)
2241  }
2242  CYTHON_FALLTHROUGH;
2243  case 27:
2244  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpsin)) != 0)) kw_args--;
2245  else {
2246  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 27); __PYX_ERR(0, 32, __pyx_L3_error)
2247  }
2248  CYTHON_FALLTHROUGH;
2249  case 28:
2250  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpsin_dpsiw)) != 0)) kw_args--;
2251  else {
2252  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 28); __PYX_ERR(0, 32, __pyx_L3_error)
2253  }
2254  CYTHON_FALLTHROUGH;
2255  case 29:
2256  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_psiw)) != 0)) kw_args--;
2257  else {
2258  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 29); __PYX_ERR(0, 32, __pyx_L3_error)
2259  }
2260  CYTHON_FALLTHROUGH;
2261  case 30:
2262  if (likely((values[30] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psiw_dpsiw)) != 0)) kw_args--;
2263  else {
2264  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 30); __PYX_ERR(0, 32, __pyx_L3_error)
2265  }
2266  CYTHON_FALLTHROUGH;
2267  case 31:
2268  if (likely((values[31] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_psin)) != 0)) kw_args--;
2269  else {
2270  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 31); __PYX_ERR(0, 32, __pyx_L3_error)
2271  }
2272  CYTHON_FALLTHROUGH;
2273  case 32:
2274  if (likely((values[32] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psin_dpsiw)) != 0)) kw_args--;
2275  else {
2276  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 32); __PYX_ERR(0, 32, __pyx_L3_error)
2277  }
2278  CYTHON_FALLTHROUGH;
2279  case 33:
2280  if (likely((values[33] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psin_dsw)) != 0)) kw_args--;
2281  else {
2282  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 33); __PYX_ERR(0, 32, __pyx_L3_error)
2283  }
2284  CYTHON_FALLTHROUGH;
2285  case 34:
2286  if (likely((values[34] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aw)) != 0)) kw_args--;
2287  else {
2288  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 34); __PYX_ERR(0, 32, __pyx_L3_error)
2289  }
2290  CYTHON_FALLTHROUGH;
2291  case 35:
2292  if (likely((values[35] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_daw)) != 0)) kw_args--;
2293  else {
2294  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 35); __PYX_ERR(0, 32, __pyx_L3_error)
2295  }
2296  CYTHON_FALLTHROUGH;
2297  case 36:
2298  if (likely((values[36] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_daw_dpsiw)) != 0)) kw_args--;
2299  else {
2300  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 36); __PYX_ERR(0, 32, __pyx_L3_error)
2301  }
2302  CYTHON_FALLTHROUGH;
2303  case 37:
2304  if (likely((values[37] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_an)) != 0)) kw_args--;
2305  else {
2306  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 37); __PYX_ERR(0, 32, __pyx_L3_error)
2307  }
2308  CYTHON_FALLTHROUGH;
2309  case 38:
2310  if (likely((values[38] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dan)) != 0)) kw_args--;
2311  else {
2312  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 38); __PYX_ERR(0, 32, __pyx_L3_error)
2313  }
2314  CYTHON_FALLTHROUGH;
2315  case 39:
2316  if (likely((values[39] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dan_dpsiw)) != 0)) kw_args--;
2317  else {
2318  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, 39); __PYX_ERR(0, 32, __pyx_L3_error)
2319  }
2320  }
2321  if (unlikely(kw_args > 0)) {
2322  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_fc_sd_het_matType") < 0)) __PYX_ERR(0, 32, __pyx_L3_error)
2323  }
2324  } else if (PyTuple_GET_SIZE(__pyx_args) != 40) {
2325  goto __pyx_L5_argtuple_error;
2326  } else {
2327  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2328  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2329  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2330  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2331  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2332  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2333  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2334  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2335  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2336  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2337  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2338  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2339  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2340  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2341  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2342  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
2343  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
2344  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
2345  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
2346  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
2347  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
2348  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
2349  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
2350  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
2351  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
2352  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
2353  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
2354  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
2355  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
2356  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
2357  values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
2358  values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
2359  values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
2360  values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
2361  values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
2362  values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
2363  values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
2364  values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
2365  values[38] = PyTuple_GET_ITEM(__pyx_args, 38);
2366  values[39] = PyTuple_GET_ITEM(__pyx_args, 39);
2367  }
2368  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error)
2369  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error)
2370  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error)
2371  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
2372  __pyx_v_colind = ((PyArrayObject *)values[4]);
2373  __pyx_v_matType = ((PyArrayObject *)values[5]);
2374  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error)
2375  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error)
2376  __pyx_v_omega = ((PyArrayObject *)values[8]);
2377  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
2378  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L3_error)
2379  __pyx_v_rwork_psk = ((PyArrayObject *)values[11]);
2380  __pyx_v_iwork_psk = ((PyArrayObject *)values[12]);
2381  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[13]);
2382  __pyx_v_rwork_density_w = ((PyArrayObject *)values[14]);
2383  __pyx_v_rwork_density_n = ((PyArrayObject *)values[15]);
2384  __pyx_v_g = ((PyArrayObject *)values[16]);
2385  __pyx_v_x = ((PyArrayObject *)values[17]);
2386  __pyx_v_sw = ((PyArrayObject *)values[18]);
2387  __pyx_v_psiw = ((PyArrayObject *)values[19]);
2388  __pyx_v_mw = ((PyArrayObject *)values[20]);
2389  __pyx_v_dmw = ((PyArrayObject *)values[21]);
2390  __pyx_v_dmw_dpsiw = ((PyArrayObject *)values[22]);
2391  __pyx_v_mn = ((PyArrayObject *)values[23]);
2392  __pyx_v_dmn = ((PyArrayObject *)values[24]);
2393  __pyx_v_dmn_dpsiw = ((PyArrayObject *)values[25]);
2394  __pyx_v_psin = ((PyArrayObject *)values[26]);
2395  __pyx_v_dpsin = ((PyArrayObject *)values[27]);
2396  __pyx_v_dpsin_dpsiw = ((PyArrayObject *)values[28]);
2397  __pyx_v_phi_psiw = ((PyArrayObject *)values[29]);
2398  __pyx_v_dphi_psiw_dpsiw = ((PyArrayObject *)values[30]);
2399  __pyx_v_phi_psin = ((PyArrayObject *)values[31]);
2400  __pyx_v_dphi_psin_dpsiw = ((PyArrayObject *)values[32]);
2401  __pyx_v_dphi_psin_dsw = ((PyArrayObject *)values[33]);
2402  __pyx_v_aw = ((PyArrayObject *)values[34]);
2403  __pyx_v_daw = ((PyArrayObject *)values[35]);
2404  __pyx_v_daw_dpsiw = ((PyArrayObject *)values[36]);
2405  __pyx_v_an = ((PyArrayObject *)values[37]);
2406  __pyx_v_dan = ((PyArrayObject *)values[38]);
2407  __pyx_v_dan_dpsiw = ((PyArrayObject *)values[39]);
2408  }
2409  goto __pyx_L4_argument_unpacking_done;
2410  __pyx_L5_argtuple_error:;
2411  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType", 1, 40, 40, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 32, __pyx_L3_error)
2412  __pyx_L3_error:;
2413  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_fc_sd_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
2414  __Pyx_RefNannyFinishContext();
2415  return NULL;
2416  __pyx_L4_argument_unpacking_done:;
2417  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
2418  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
2419  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 37, __pyx_L1_error)
2420  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 40, __pyx_L1_error)
2421  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 41, __pyx_L1_error)
2422  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
2423  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
2424  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 45, __pyx_L1_error)
2425  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 46, __pyx_L1_error)
2426  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 47, __pyx_L1_error)
2427  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 48, __pyx_L1_error)
2428  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 49, __pyx_L1_error)
2429  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 50, __pyx_L1_error)
2430  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
2431  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mw), __pyx_ptype_5numpy_ndarray, 1, "mw", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
2432  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmw), __pyx_ptype_5numpy_ndarray, 1, "dmw", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
2433  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dmw_dpsiw", 0))) __PYX_ERR(0, 54, __pyx_L1_error)
2434  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mn), __pyx_ptype_5numpy_ndarray, 1, "mn", 0))) __PYX_ERR(0, 55, __pyx_L1_error)
2435  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmn), __pyx_ptype_5numpy_ndarray, 1, "dmn", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
2436  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmn_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dmn_dpsiw", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
2437  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psin), __pyx_ptype_5numpy_ndarray, 1, "psin", 0))) __PYX_ERR(0, 58, __pyx_L1_error)
2438  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpsin), __pyx_ptype_5numpy_ndarray, 1, "dpsin", 0))) __PYX_ERR(0, 59, __pyx_L1_error)
2439  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpsin_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dpsin_dpsiw", 0))) __PYX_ERR(0, 60, __pyx_L1_error)
2440  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_psiw), __pyx_ptype_5numpy_ndarray, 1, "phi_psiw", 0))) __PYX_ERR(0, 61, __pyx_L1_error)
2441  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psiw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psiw_dpsiw", 0))) __PYX_ERR(0, 62, __pyx_L1_error)
2442  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_psin), __pyx_ptype_5numpy_ndarray, 1, "phi_psin", 0))) __PYX_ERR(0, 63, __pyx_L1_error)
2443  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psin_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psin_dpsiw", 0))) __PYX_ERR(0, 64, __pyx_L1_error)
2444  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psin_dsw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psin_dsw", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
2445  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aw), __pyx_ptype_5numpy_ndarray, 1, "aw", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
2446  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_daw), __pyx_ptype_5numpy_ndarray, 1, "daw", 0))) __PYX_ERR(0, 67, __pyx_L1_error)
2447  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_daw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "daw_dpsiw", 0))) __PYX_ERR(0, 68, __pyx_L1_error)
2448  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_an), __pyx_ptype_5numpy_ndarray, 1, "an", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
2449  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dan), __pyx_ptype_5numpy_ndarray, 1, "dan", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
2450  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dan_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dan_dpsiw", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
2451  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_twophaseDarcy_fc_sd_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_x, __pyx_v_sw, __pyx_v_psiw, __pyx_v_mw, __pyx_v_dmw, __pyx_v_dmw_dpsiw, __pyx_v_mn, __pyx_v_dmn, __pyx_v_dmn_dpsiw, __pyx_v_psin, __pyx_v_dpsin, __pyx_v_dpsin_dpsiw, __pyx_v_phi_psiw, __pyx_v_dphi_psiw_dpsiw, __pyx_v_phi_psin, __pyx_v_dphi_psin_dpsiw, __pyx_v_dphi_psin_dsw, __pyx_v_aw, __pyx_v_daw, __pyx_v_daw_dpsiw, __pyx_v_an, __pyx_v_dan, __pyx_v_dan_dpsiw);
2452 
2453  /* function exit code */
2454  goto __pyx_L0;
2455  __pyx_L1_error:;
2456  __pyx_r = NULL;
2457  __pyx_L0:;
2458  __Pyx_RefNannyFinishContext();
2459  return __pyx_r;
2460 }
2461 
2462 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_twophaseDarcy_fc_sd_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, 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_iwork_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_x, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_mw, PyArrayObject *__pyx_v_dmw, PyArrayObject *__pyx_v_dmw_dpsiw, PyArrayObject *__pyx_v_mn, PyArrayObject *__pyx_v_dmn, PyArrayObject *__pyx_v_dmn_dpsiw, PyArrayObject *__pyx_v_psin, PyArrayObject *__pyx_v_dpsin, PyArrayObject *__pyx_v_dpsin_dpsiw, PyArrayObject *__pyx_v_phi_psiw, PyArrayObject *__pyx_v_dphi_psiw_dpsiw, PyArrayObject *__pyx_v_phi_psin, PyArrayObject *__pyx_v_dphi_psin_dpsiw, PyArrayObject *__pyx_v_dphi_psin_dsw, PyArrayObject *__pyx_v_aw, PyArrayObject *__pyx_v_daw, PyArrayObject *__pyx_v_daw_dpsiw, PyArrayObject *__pyx_v_an, PyArrayObject *__pyx_v_dan, PyArrayObject *__pyx_v_dan_dpsiw) {
2463  int __pyx_v_nPointsPerSimplex;
2464  int __pyx_v_nSimplex;
2465  PyObject *__pyx_r = NULL;
2466  __Pyx_RefNannyDeclarations
2467  PyObject *__pyx_t_1 = NULL;
2468  PyObject *__pyx_t_2 = NULL;
2469  PyObject *__pyx_t_3 = NULL;
2470  int __pyx_t_4;
2471  PyObject *__pyx_t_5 = NULL;
2472  PyObject *__pyx_t_6 = NULL;
2473  PyObject *__pyx_t_7 = NULL;
2474  int __pyx_lineno = 0;
2475  const char *__pyx_filename = NULL;
2476  int __pyx_clineno = 0;
2477  __Pyx_RefNannySetupContext("twophaseDarcy_fc_sd_het_matType", 0);
2478 
2479  /* "cTwophaseDarcyCoefficients.pyx":77
2480  *
2481  * """
2482  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
2483  * cdef int nSimplex=sw.size/nPointsPerSimplex
2484  * #while debugging allow only one option
2485  */
2486  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
2487 
2488  /* "cTwophaseDarcyCoefficients.pyx":78
2489  * """
2490  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
2491  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
2492  * #while debugging allow only one option
2493  * #exponential for wetting phase
2494  */
2495  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
2496  __Pyx_GOTREF(__pyx_t_1);
2497  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
2498  __Pyx_GOTREF(__pyx_t_2);
2499  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
2500  __Pyx_GOTREF(__pyx_t_3);
2501  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2502  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2503  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
2504  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2505  __pyx_v_nSimplex = __pyx_t_4;
2506 
2507  /* "cTwophaseDarcyCoefficients.pyx":81
2508  * #while debugging allow only one option
2509  * #exponential for wetting phase
2510  * assert density_w_flag == 1 # <<<<<<<<<<<<<<
2511  * if density_n_flag == 1: #nonwetting exponential
2512  * if pskModelFlag == 0:
2513  */
2514  #ifndef CYTHON_WITHOUT_ASSERTIONS
2515  if (unlikely(!Py_OptimizeFlag)) {
2516  if (unlikely(!((__pyx_v_density_w_flag == 1) != 0))) {
2517  PyErr_SetNone(PyExc_AssertionError);
2518  __PYX_ERR(0, 81, __pyx_L1_error)
2519  }
2520  }
2521  #endif
2522 
2523  /* "cTwophaseDarcyCoefficients.pyx":82
2524  * #exponential for wetting phase
2525  * assert density_w_flag == 1
2526  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
2527  * if pskModelFlag == 0:
2528  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
2529  */
2530  switch (__pyx_v_density_n_flag) {
2531  case 1:
2532 
2533  /* "cTwophaseDarcyCoefficients.pyx":83
2534  * assert density_w_flag == 1
2535  * if density_n_flag == 1: #nonwetting exponential
2536  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
2537  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
2538  * nPointsPerSimplex,
2539  */
2540  switch (__pyx_v_pskModelFlag) {
2541  case 0:
2542 
2543  /* "cTwophaseDarcyCoefficients.pyx":84
2544  * if density_n_flag == 1: #nonwetting exponential
2545  * if pskModelFlag == 0:
2546  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
2547  * nPointsPerSimplex,
2548  * g.shape[0],
2549  */
2550  (void)(twophaseDarcy_fc_sd_het_matType<SimplePSK,ExponentialDensity,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2551 
2552  /* "cTwophaseDarcyCoefficients.pyx":83
2553  * assert density_w_flag == 1
2554  * if density_n_flag == 1: #nonwetting exponential
2555  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
2556  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
2557  * nPointsPerSimplex,
2558  */
2559  break;
2560  case 1:
2561 
2562  /* "cTwophaseDarcyCoefficients.pyx":126
2563  * <double*>(dan_dpsiw.data))
2564  * elif pskModelFlag == 1:
2565  * tpdc.twophaseDarcy_fc_sd_het_matType[VGM,ExponentialDensity,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
2566  * nPointsPerSimplex,
2567  * g.shape[0],
2568  */
2569  (void)(twophaseDarcy_fc_sd_het_matType<VGM,ExponentialDensity,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2570 
2571  /* "cTwophaseDarcyCoefficients.pyx":125
2572  * <double*>(dan.data),
2573  * <double*>(dan_dpsiw.data))
2574  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
2575  * tpdc.twophaseDarcy_fc_sd_het_matType[VGM,ExponentialDensity,ExponentialDensity](nSimplex,
2576  * nPointsPerSimplex,
2577  */
2578  break;
2579  case 5:
2580 
2581  /* "cTwophaseDarcyCoefficients.pyx":171
2582  * nPointsPerSimplex,
2583  * g.shape[0],
2584  * iwork_psk[1], # <<<<<<<<<<<<<<
2585  * <int*>(rowptr.data),
2586  * <int*>(colind.data),
2587  */
2588  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_iwork_psk), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
2589  __Pyx_GOTREF(__pyx_t_3);
2590  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error)
2591  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2592 
2593  /* "cTwophaseDarcyCoefficients.pyx":168
2594  * <double*>(dan_dpsiw.data))
2595  * elif pskModelFlag == 5:
2596  * tpdc.twophaseDarcy_fc_sd_het_matType[PskSpline,ExponentialDensity,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
2597  * nPointsPerSimplex,
2598  * g.shape[0],
2599  */
2600  (void)(twophaseDarcy_fc_sd_het_matType<PskSpline,ExponentialDensity,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), __pyx_t_4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2601 
2602  /* "cTwophaseDarcyCoefficients.pyx":167
2603  * <double*>(dan.data),
2604  * <double*>(dan_dpsiw.data))
2605  * elif pskModelFlag == 5: # <<<<<<<<<<<<<<
2606  * tpdc.twophaseDarcy_fc_sd_het_matType[PskSpline,ExponentialDensity,ExponentialDensity](nSimplex,
2607  * nPointsPerSimplex,
2608  */
2609  break;
2610  default:
2611 
2612  /* "cTwophaseDarcyCoefficients.pyx":210
2613  * <double*>(dan_dpsiw.data))
2614  * else:
2615  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
2616  * nPointsPerSimplex,
2617  * g.shape[0],
2618  */
2619  (void)(twophaseDarcy_fc_sd_het_matType<SimplePSK,ExponentialDensity,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2620  break;
2621  }
2622 
2623  /* "cTwophaseDarcyCoefficients.pyx":82
2624  * #exponential for wetting phase
2625  * assert density_w_flag == 1
2626  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
2627  * if pskModelFlag == 0:
2628  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
2629  */
2630  break;
2631  case 2:
2632 
2633  /* "cTwophaseDarcyCoefficients.pyx":252
2634  * <double*>(dan_dpsiw.data))
2635  * elif density_n_flag == 2:#nonwetting IdealGas
2636  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
2637  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex,
2638  * nPointsPerSimplex,
2639  */
2640  switch (__pyx_v_pskModelFlag) {
2641  case 0:
2642 
2643  /* "cTwophaseDarcyCoefficients.pyx":253
2644  * elif density_n_flag == 2:#nonwetting IdealGas
2645  * if pskModelFlag == 0:
2646  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
2647  * nPointsPerSimplex,
2648  * g.shape[0],
2649  */
2650  (void)(twophaseDarcy_fc_sd_het_matType<SimplePSK,ExponentialDensity,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2651 
2652  /* "cTwophaseDarcyCoefficients.pyx":252
2653  * <double*>(dan_dpsiw.data))
2654  * elif density_n_flag == 2:#nonwetting IdealGas
2655  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
2656  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex,
2657  * nPointsPerSimplex,
2658  */
2659  break;
2660  case 1:
2661 
2662  /* "cTwophaseDarcyCoefficients.pyx":295
2663  * <double*>(dan_dpsiw.data))
2664  * elif pskModelFlag == 1:
2665  * tpdc.twophaseDarcy_fc_sd_het_matType[VGM,ExponentialDensity,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
2666  * nPointsPerSimplex,
2667  * g.shape[0],
2668  */
2669  (void)(twophaseDarcy_fc_sd_het_matType<VGM,ExponentialDensity,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2670 
2671  /* "cTwophaseDarcyCoefficients.pyx":294
2672  * <double*>(dan.data),
2673  * <double*>(dan_dpsiw.data))
2674  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
2675  * tpdc.twophaseDarcy_fc_sd_het_matType[VGM,ExponentialDensity,IdealGasDensity](nSimplex,
2676  * nPointsPerSimplex,
2677  */
2678  break;
2679  case 5:
2680 
2681  /* "cTwophaseDarcyCoefficients.pyx":340
2682  * nPointsPerSimplex,
2683  * g.shape[0],
2684  * iwork_psk[1], # <<<<<<<<<<<<<<
2685  * <int*>(rowptr.data),
2686  * <int*>(colind.data),
2687  */
2688  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_iwork_psk), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
2689  __Pyx_GOTREF(__pyx_t_3);
2690  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
2691  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2692 
2693  /* "cTwophaseDarcyCoefficients.pyx":337
2694  * <double*>(dan_dpsiw.data))
2695  * elif pskModelFlag == 5:
2696  * tpdc.twophaseDarcy_fc_sd_het_matType[PskSpline,ExponentialDensity,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
2697  * nPointsPerSimplex,
2698  * g.shape[0],
2699  */
2700  (void)(twophaseDarcy_fc_sd_het_matType<PskSpline,ExponentialDensity,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), __pyx_t_4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2701 
2702  /* "cTwophaseDarcyCoefficients.pyx":336
2703  * <double*>(dan.data),
2704  * <double*>(dan_dpsiw.data))
2705  * elif pskModelFlag == 5: # <<<<<<<<<<<<<<
2706  * tpdc.twophaseDarcy_fc_sd_het_matType[PskSpline,ExponentialDensity,IdealGasDensity](nSimplex,
2707  * nPointsPerSimplex,
2708  */
2709  break;
2710  default:
2711 
2712  /* "cTwophaseDarcyCoefficients.pyx":379
2713  * <double*>(dan_dpsiw.data))
2714  * else:
2715  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
2716  * nPointsPerSimplex,
2717  * g.shape[0],
2718  */
2719  (void)(twophaseDarcy_fc_sd_het_matType<SimplePSK,ExponentialDensity,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
2720  break;
2721  }
2722 
2723  /* "cTwophaseDarcyCoefficients.pyx":251
2724  * <double*>(dan.data),
2725  * <double*>(dan_dpsiw.data))
2726  * elif density_n_flag == 2:#nonwetting IdealGas # <<<<<<<<<<<<<<
2727  * if pskModelFlag == 0:
2728  * tpdc.twophaseDarcy_fc_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex,
2729  */
2730  break;
2731  default:
2732 
2733  /* "cTwophaseDarcyCoefficients.pyx":421
2734  * <double*>(dan_dpsiw.data))
2735  * else:
2736  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag) # <<<<<<<<<<<<<<
2737  *
2738  * def twophaseDarcy_fc_sd_het_matType_nonPotentialForm(int pskModelFlag,
2739  */
2740  #ifndef CYTHON_WITHOUT_ASSERTIONS
2741  if (unlikely(!Py_OptimizeFlag)) {
2742  if (unlikely(!0)) {
2743  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_configuration_density_w_flag_0_a, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
2744  __Pyx_GOTREF(__pyx_t_2);
2745  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_density_w_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
2746  __Pyx_GOTREF(__pyx_t_1);
2747  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_density_n_flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
2748  __Pyx_GOTREF(__pyx_t_5);
2749  __pyx_t_6 = NULL;
2750  __pyx_t_4 = 0;
2751  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2752  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
2753  if (likely(__pyx_t_6)) {
2754  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2755  __Pyx_INCREF(__pyx_t_6);
2756  __Pyx_INCREF(function);
2757  __Pyx_DECREF_SET(__pyx_t_2, function);
2758  __pyx_t_4 = 1;
2759  }
2760  }
2761  #if CYTHON_FAST_PYCALL
2762  if (PyFunction_Check(__pyx_t_2)) {
2763  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
2764  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
2765  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2766  __Pyx_GOTREF(__pyx_t_3);
2767  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2768  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2769  } else
2770  #endif
2771  #if CYTHON_FAST_PYCCALL
2772  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
2773  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
2774  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
2775  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2776  __Pyx_GOTREF(__pyx_t_3);
2777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2778  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2779  } else
2780  #endif
2781  {
2782  __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error)
2783  __Pyx_GOTREF(__pyx_t_7);
2784  if (__pyx_t_6) {
2785  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
2786  }
2787  __Pyx_GIVEREF(__pyx_t_1);
2788  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_1);
2789  __Pyx_GIVEREF(__pyx_t_5);
2790  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_5);
2791  __pyx_t_1 = 0;
2792  __pyx_t_5 = 0;
2793  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
2794  __Pyx_GOTREF(__pyx_t_3);
2795  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2796  }
2797  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2798  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
2799  __Pyx_GOTREF(__pyx_t_2);
2800  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2801  PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
2802  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2803  __PYX_ERR(0, 421, __pyx_L1_error)
2804  }
2805  }
2806  #endif
2807  break;
2808  }
2809 
2810  /* "cTwophaseDarcyCoefficients.pyx":32
2811  * pass
2812  *
2813  * def twophaseDarcy_fc_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
2814  * int density_w_flag,
2815  * int density_n_flag,
2816  */
2817 
2818  /* function exit code */
2819  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2820  goto __pyx_L0;
2821  __pyx_L1_error:;
2822  __Pyx_XDECREF(__pyx_t_1);
2823  __Pyx_XDECREF(__pyx_t_2);
2824  __Pyx_XDECREF(__pyx_t_3);
2825  __Pyx_XDECREF(__pyx_t_5);
2826  __Pyx_XDECREF(__pyx_t_6);
2827  __Pyx_XDECREF(__pyx_t_7);
2828  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_fc_sd_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
2829  __pyx_r = NULL;
2830  __pyx_L0:;
2831  __Pyx_XGIVEREF(__pyx_r);
2832  __Pyx_RefNannyFinishContext();
2833  return __pyx_r;
2834 }
2835 
2836 /* "cTwophaseDarcyCoefficients.pyx":423
2837  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
2838  *
2839  * def twophaseDarcy_fc_sd_het_matType_nonPotentialForm(int pskModelFlag, # <<<<<<<<<<<<<<
2840  * int density_w_flag,
2841  * int density_n_flag,
2842  */
2843 
2844 /* Python wrapper */
2845 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_3twophaseDarcy_fc_sd_het_matType_nonPotentialForm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2846 static char __pyx_doc_26cTwophaseDarcyCoefficients_2twophaseDarcy_fc_sd_het_matType_nonPotentialForm[] = "\"Evaluate the coefficients of the fully coupled formulation of\n (slightly) compressible, two-phase Darcy flow for a heterogeneous\n medium, sparse diffusion rep. for het\n\n ";
2847 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_3twophaseDarcy_fc_sd_het_matType_nonPotentialForm = {"twophaseDarcy_fc_sd_het_matType_nonPotentialForm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_3twophaseDarcy_fc_sd_het_matType_nonPotentialForm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_2twophaseDarcy_fc_sd_het_matType_nonPotentialForm};
2848 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_3twophaseDarcy_fc_sd_het_matType_nonPotentialForm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2849  int __pyx_v_pskModelFlag;
2850  int __pyx_v_density_w_flag;
2851  int __pyx_v_density_n_flag;
2852  PyArrayObject *__pyx_v_rowptr = 0;
2853  PyArrayObject *__pyx_v_colind = 0;
2854  PyArrayObject *__pyx_v_matType = 0;
2855  double __pyx_v_muw;
2856  double __pyx_v_mun;
2857  PyArrayObject *__pyx_v_omega = 0;
2858  PyArrayObject *__pyx_v_Kbar = 0;
2859  double __pyx_v_b;
2860  PyArrayObject *__pyx_v_rwork_psk = 0;
2861  PyArrayObject *__pyx_v_iwork_psk = 0;
2862  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
2863  PyArrayObject *__pyx_v_rwork_density_w = 0;
2864  PyArrayObject *__pyx_v_rwork_density_n = 0;
2865  PyArrayObject *__pyx_v_g = 0;
2866  PyArrayObject *__pyx_v_x = 0;
2867  PyArrayObject *__pyx_v_sw = 0;
2868  PyArrayObject *__pyx_v_psiw = 0;
2869  PyArrayObject *__pyx_v_mw = 0;
2870  PyArrayObject *__pyx_v_dmw = 0;
2871  PyArrayObject *__pyx_v_dmw_dpsiw = 0;
2872  PyArrayObject *__pyx_v_mn = 0;
2873  PyArrayObject *__pyx_v_dmn = 0;
2874  PyArrayObject *__pyx_v_dmn_dpsiw = 0;
2875  PyArrayObject *__pyx_v_psin = 0;
2876  PyArrayObject *__pyx_v_dpsin = 0;
2877  PyArrayObject *__pyx_v_dpsin_dpsiw = 0;
2878  PyArrayObject *__pyx_v_phi_psiw = 0;
2879  PyArrayObject *__pyx_v_dphi_psiw_dpsiw = 0;
2880  PyArrayObject *__pyx_v_phi_psin = 0;
2881  PyArrayObject *__pyx_v_dphi_psin_dpsiw = 0;
2882  PyArrayObject *__pyx_v_dphi_psin_dsw = 0;
2883  PyArrayObject *__pyx_v_fw = 0;
2884  PyArrayObject *__pyx_v_dfw_dsw = 0;
2885  PyArrayObject *__pyx_v_dfw_dpsiw = 0;
2886  PyArrayObject *__pyx_v_fn = 0;
2887  PyArrayObject *__pyx_v_dfn_dsw = 0;
2888  PyArrayObject *__pyx_v_dfn_dpsiw = 0;
2889  PyArrayObject *__pyx_v_aw = 0;
2890  PyArrayObject *__pyx_v_daw = 0;
2891  PyArrayObject *__pyx_v_daw_dpsiw = 0;
2892  PyArrayObject *__pyx_v_an = 0;
2893  PyArrayObject *__pyx_v_dan = 0;
2894  PyArrayObject *__pyx_v_dan_dpsiw = 0;
2895  int __pyx_v_compressibilityFlag;
2896  int __pyx_lineno = 0;
2897  const char *__pyx_filename = NULL;
2898  int __pyx_clineno = 0;
2899  PyObject *__pyx_r = 0;
2900  __Pyx_RefNannyDeclarations
2901  __Pyx_RefNannySetupContext("twophaseDarcy_fc_sd_het_matType_nonPotentialForm (wrapper)", 0);
2902  {
2903  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__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_iwork_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_x,&__pyx_n_s_sw,&__pyx_n_s_psiw,&__pyx_n_s_mw,&__pyx_n_s_dmw,&__pyx_n_s_dmw_dpsiw,&__pyx_n_s_mn,&__pyx_n_s_dmn,&__pyx_n_s_dmn_dpsiw,&__pyx_n_s_psin,&__pyx_n_s_dpsin,&__pyx_n_s_dpsin_dpsiw,&__pyx_n_s_phi_psiw,&__pyx_n_s_dphi_psiw_dpsiw,&__pyx_n_s_phi_psin,&__pyx_n_s_dphi_psin_dpsiw,&__pyx_n_s_dphi_psin_dsw,&__pyx_n_s_fw,&__pyx_n_s_dfw_dsw,&__pyx_n_s_dfw_dpsiw,&__pyx_n_s_fn,&__pyx_n_s_dfn_dsw,&__pyx_n_s_dfn_dpsiw,&__pyx_n_s_aw,&__pyx_n_s_daw,&__pyx_n_s_daw_dpsiw,&__pyx_n_s_an,&__pyx_n_s_dan,&__pyx_n_s_dan_dpsiw,&__pyx_n_s_compressibilityFlag,0};
2904  PyObject* values[47] = {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,0,0,0,0,0,0,0,0,0,0,0,0};
2905  if (unlikely(__pyx_kwds)) {
2906  Py_ssize_t kw_args;
2907  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2908  switch (pos_args) {
2909  case 47: values[46] = PyTuple_GET_ITEM(__pyx_args, 46);
2910  CYTHON_FALLTHROUGH;
2911  case 46: values[45] = PyTuple_GET_ITEM(__pyx_args, 45);
2912  CYTHON_FALLTHROUGH;
2913  case 45: values[44] = PyTuple_GET_ITEM(__pyx_args, 44);
2914  CYTHON_FALLTHROUGH;
2915  case 44: values[43] = PyTuple_GET_ITEM(__pyx_args, 43);
2916  CYTHON_FALLTHROUGH;
2917  case 43: values[42] = PyTuple_GET_ITEM(__pyx_args, 42);
2918  CYTHON_FALLTHROUGH;
2919  case 42: values[41] = PyTuple_GET_ITEM(__pyx_args, 41);
2920  CYTHON_FALLTHROUGH;
2921  case 41: values[40] = PyTuple_GET_ITEM(__pyx_args, 40);
2922  CYTHON_FALLTHROUGH;
2923  case 40: values[39] = PyTuple_GET_ITEM(__pyx_args, 39);
2924  CYTHON_FALLTHROUGH;
2925  case 39: values[38] = PyTuple_GET_ITEM(__pyx_args, 38);
2926  CYTHON_FALLTHROUGH;
2927  case 38: values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
2928  CYTHON_FALLTHROUGH;
2929  case 37: values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
2930  CYTHON_FALLTHROUGH;
2931  case 36: values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
2932  CYTHON_FALLTHROUGH;
2933  case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
2934  CYTHON_FALLTHROUGH;
2935  case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
2936  CYTHON_FALLTHROUGH;
2937  case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
2938  CYTHON_FALLTHROUGH;
2939  case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
2940  CYTHON_FALLTHROUGH;
2941  case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
2942  CYTHON_FALLTHROUGH;
2943  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
2944  CYTHON_FALLTHROUGH;
2945  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
2946  CYTHON_FALLTHROUGH;
2947  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
2948  CYTHON_FALLTHROUGH;
2949  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
2950  CYTHON_FALLTHROUGH;
2951  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
2952  CYTHON_FALLTHROUGH;
2953  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
2954  CYTHON_FALLTHROUGH;
2955  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
2956  CYTHON_FALLTHROUGH;
2957  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
2958  CYTHON_FALLTHROUGH;
2959  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
2960  CYTHON_FALLTHROUGH;
2961  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
2962  CYTHON_FALLTHROUGH;
2963  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
2964  CYTHON_FALLTHROUGH;
2965  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
2966  CYTHON_FALLTHROUGH;
2967  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
2968  CYTHON_FALLTHROUGH;
2969  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
2970  CYTHON_FALLTHROUGH;
2971  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
2972  CYTHON_FALLTHROUGH;
2973  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2974  CYTHON_FALLTHROUGH;
2975  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2976  CYTHON_FALLTHROUGH;
2977  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2978  CYTHON_FALLTHROUGH;
2979  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2980  CYTHON_FALLTHROUGH;
2981  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2982  CYTHON_FALLTHROUGH;
2983  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2984  CYTHON_FALLTHROUGH;
2985  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2986  CYTHON_FALLTHROUGH;
2987  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2988  CYTHON_FALLTHROUGH;
2989  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2990  CYTHON_FALLTHROUGH;
2991  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2992  CYTHON_FALLTHROUGH;
2993  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2994  CYTHON_FALLTHROUGH;
2995  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2996  CYTHON_FALLTHROUGH;
2997  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2998  CYTHON_FALLTHROUGH;
2999  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3000  CYTHON_FALLTHROUGH;
3001  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3002  CYTHON_FALLTHROUGH;
3003  case 0: break;
3004  default: goto __pyx_L5_argtuple_error;
3005  }
3006  kw_args = PyDict_Size(__pyx_kwds);
3007  switch (pos_args) {
3008  case 0:
3009  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
3010  else goto __pyx_L5_argtuple_error;
3011  CYTHON_FALLTHROUGH;
3012  case 1:
3013  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
3014  else {
3015  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 1); __PYX_ERR(0, 423, __pyx_L3_error)
3016  }
3017  CYTHON_FALLTHROUGH;
3018  case 2:
3019  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
3020  else {
3021  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 2); __PYX_ERR(0, 423, __pyx_L3_error)
3022  }
3023  CYTHON_FALLTHROUGH;
3024  case 3:
3025  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
3026  else {
3027  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 3); __PYX_ERR(0, 423, __pyx_L3_error)
3028  }
3029  CYTHON_FALLTHROUGH;
3030  case 4:
3031  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
3032  else {
3033  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 4); __PYX_ERR(0, 423, __pyx_L3_error)
3034  }
3035  CYTHON_FALLTHROUGH;
3036  case 5:
3037  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
3038  else {
3039  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 5); __PYX_ERR(0, 423, __pyx_L3_error)
3040  }
3041  CYTHON_FALLTHROUGH;
3042  case 6:
3043  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
3044  else {
3045  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 6); __PYX_ERR(0, 423, __pyx_L3_error)
3046  }
3047  CYTHON_FALLTHROUGH;
3048  case 7:
3049  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
3050  else {
3051  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 7); __PYX_ERR(0, 423, __pyx_L3_error)
3052  }
3053  CYTHON_FALLTHROUGH;
3054  case 8:
3055  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
3056  else {
3057  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 8); __PYX_ERR(0, 423, __pyx_L3_error)
3058  }
3059  CYTHON_FALLTHROUGH;
3060  case 9:
3061  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
3062  else {
3063  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 9); __PYX_ERR(0, 423, __pyx_L3_error)
3064  }
3065  CYTHON_FALLTHROUGH;
3066  case 10:
3067  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
3068  else {
3069  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 10); __PYX_ERR(0, 423, __pyx_L3_error)
3070  }
3071  CYTHON_FALLTHROUGH;
3072  case 11:
3073  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
3074  else {
3075  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 11); __PYX_ERR(0, 423, __pyx_L3_error)
3076  }
3077  CYTHON_FALLTHROUGH;
3078  case 12:
3079  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
3080  else {
3081  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 12); __PYX_ERR(0, 423, __pyx_L3_error)
3082  }
3083  CYTHON_FALLTHROUGH;
3084  case 13:
3085  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
3086  else {
3087  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 13); __PYX_ERR(0, 423, __pyx_L3_error)
3088  }
3089  CYTHON_FALLTHROUGH;
3090  case 14:
3091  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
3092  else {
3093  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 14); __PYX_ERR(0, 423, __pyx_L3_error)
3094  }
3095  CYTHON_FALLTHROUGH;
3096  case 15:
3097  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
3098  else {
3099  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 15); __PYX_ERR(0, 423, __pyx_L3_error)
3100  }
3101  CYTHON_FALLTHROUGH;
3102  case 16:
3103  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
3104  else {
3105  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 16); __PYX_ERR(0, 423, __pyx_L3_error)
3106  }
3107  CYTHON_FALLTHROUGH;
3108  case 17:
3109  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3110  else {
3111  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 17); __PYX_ERR(0, 423, __pyx_L3_error)
3112  }
3113  CYTHON_FALLTHROUGH;
3114  case 18:
3115  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
3116  else {
3117  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 18); __PYX_ERR(0, 423, __pyx_L3_error)
3118  }
3119  CYTHON_FALLTHROUGH;
3120  case 19:
3121  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
3122  else {
3123  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 19); __PYX_ERR(0, 423, __pyx_L3_error)
3124  }
3125  CYTHON_FALLTHROUGH;
3126  case 20:
3127  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mw)) != 0)) kw_args--;
3128  else {
3129  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 20); __PYX_ERR(0, 423, __pyx_L3_error)
3130  }
3131  CYTHON_FALLTHROUGH;
3132  case 21:
3133  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmw)) != 0)) kw_args--;
3134  else {
3135  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 21); __PYX_ERR(0, 423, __pyx_L3_error)
3136  }
3137  CYTHON_FALLTHROUGH;
3138  case 22:
3139  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmw_dpsiw)) != 0)) kw_args--;
3140  else {
3141  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 22); __PYX_ERR(0, 423, __pyx_L3_error)
3142  }
3143  CYTHON_FALLTHROUGH;
3144  case 23:
3145  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mn)) != 0)) kw_args--;
3146  else {
3147  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 23); __PYX_ERR(0, 423, __pyx_L3_error)
3148  }
3149  CYTHON_FALLTHROUGH;
3150  case 24:
3151  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmn)) != 0)) kw_args--;
3152  else {
3153  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 24); __PYX_ERR(0, 423, __pyx_L3_error)
3154  }
3155  CYTHON_FALLTHROUGH;
3156  case 25:
3157  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmn_dpsiw)) != 0)) kw_args--;
3158  else {
3159  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 25); __PYX_ERR(0, 423, __pyx_L3_error)
3160  }
3161  CYTHON_FALLTHROUGH;
3162  case 26:
3163  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psin)) != 0)) kw_args--;
3164  else {
3165  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 26); __PYX_ERR(0, 423, __pyx_L3_error)
3166  }
3167  CYTHON_FALLTHROUGH;
3168  case 27:
3169  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpsin)) != 0)) kw_args--;
3170  else {
3171  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 27); __PYX_ERR(0, 423, __pyx_L3_error)
3172  }
3173  CYTHON_FALLTHROUGH;
3174  case 28:
3175  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpsin_dpsiw)) != 0)) kw_args--;
3176  else {
3177  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 28); __PYX_ERR(0, 423, __pyx_L3_error)
3178  }
3179  CYTHON_FALLTHROUGH;
3180  case 29:
3181  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_psiw)) != 0)) kw_args--;
3182  else {
3183  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 29); __PYX_ERR(0, 423, __pyx_L3_error)
3184  }
3185  CYTHON_FALLTHROUGH;
3186  case 30:
3187  if (likely((values[30] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psiw_dpsiw)) != 0)) kw_args--;
3188  else {
3189  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 30); __PYX_ERR(0, 423, __pyx_L3_error)
3190  }
3191  CYTHON_FALLTHROUGH;
3192  case 31:
3193  if (likely((values[31] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_psin)) != 0)) kw_args--;
3194  else {
3195  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 31); __PYX_ERR(0, 423, __pyx_L3_error)
3196  }
3197  CYTHON_FALLTHROUGH;
3198  case 32:
3199  if (likely((values[32] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psin_dpsiw)) != 0)) kw_args--;
3200  else {
3201  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 32); __PYX_ERR(0, 423, __pyx_L3_error)
3202  }
3203  CYTHON_FALLTHROUGH;
3204  case 33:
3205  if (likely((values[33] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psin_dsw)) != 0)) kw_args--;
3206  else {
3207  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 33); __PYX_ERR(0, 423, __pyx_L3_error)
3208  }
3209  CYTHON_FALLTHROUGH;
3210  case 34:
3211  if (likely((values[34] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fw)) != 0)) kw_args--;
3212  else {
3213  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 34); __PYX_ERR(0, 423, __pyx_L3_error)
3214  }
3215  CYTHON_FALLTHROUGH;
3216  case 35:
3217  if (likely((values[35] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dfw_dsw)) != 0)) kw_args--;
3218  else {
3219  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 35); __PYX_ERR(0, 423, __pyx_L3_error)
3220  }
3221  CYTHON_FALLTHROUGH;
3222  case 36:
3223  if (likely((values[36] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dfw_dpsiw)) != 0)) kw_args--;
3224  else {
3225  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 36); __PYX_ERR(0, 423, __pyx_L3_error)
3226  }
3227  CYTHON_FALLTHROUGH;
3228  case 37:
3229  if (likely((values[37] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--;
3230  else {
3231  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 37); __PYX_ERR(0, 423, __pyx_L3_error)
3232  }
3233  CYTHON_FALLTHROUGH;
3234  case 38:
3235  if (likely((values[38] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dfn_dsw)) != 0)) kw_args--;
3236  else {
3237  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 38); __PYX_ERR(0, 423, __pyx_L3_error)
3238  }
3239  CYTHON_FALLTHROUGH;
3240  case 39:
3241  if (likely((values[39] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dfn_dpsiw)) != 0)) kw_args--;
3242  else {
3243  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 39); __PYX_ERR(0, 423, __pyx_L3_error)
3244  }
3245  CYTHON_FALLTHROUGH;
3246  case 40:
3247  if (likely((values[40] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aw)) != 0)) kw_args--;
3248  else {
3249  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 40); __PYX_ERR(0, 423, __pyx_L3_error)
3250  }
3251  CYTHON_FALLTHROUGH;
3252  case 41:
3253  if (likely((values[41] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_daw)) != 0)) kw_args--;
3254  else {
3255  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 41); __PYX_ERR(0, 423, __pyx_L3_error)
3256  }
3257  CYTHON_FALLTHROUGH;
3258  case 42:
3259  if (likely((values[42] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_daw_dpsiw)) != 0)) kw_args--;
3260  else {
3261  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 42); __PYX_ERR(0, 423, __pyx_L3_error)
3262  }
3263  CYTHON_FALLTHROUGH;
3264  case 43:
3265  if (likely((values[43] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_an)) != 0)) kw_args--;
3266  else {
3267  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 43); __PYX_ERR(0, 423, __pyx_L3_error)
3268  }
3269  CYTHON_FALLTHROUGH;
3270  case 44:
3271  if (likely((values[44] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dan)) != 0)) kw_args--;
3272  else {
3273  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 44); __PYX_ERR(0, 423, __pyx_L3_error)
3274  }
3275  CYTHON_FALLTHROUGH;
3276  case 45:
3277  if (likely((values[45] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dan_dpsiw)) != 0)) kw_args--;
3278  else {
3279  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 45); __PYX_ERR(0, 423, __pyx_L3_error)
3280  }
3281  CYTHON_FALLTHROUGH;
3282  case 46:
3283  if (likely((values[46] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compressibilityFlag)) != 0)) kw_args--;
3284  else {
3285  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, 46); __PYX_ERR(0, 423, __pyx_L3_error)
3286  }
3287  }
3288  if (unlikely(kw_args > 0)) {
3289  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_fc_sd_het_matType_nonPotentialForm") < 0)) __PYX_ERR(0, 423, __pyx_L3_error)
3290  }
3291  } else if (PyTuple_GET_SIZE(__pyx_args) != 47) {
3292  goto __pyx_L5_argtuple_error;
3293  } else {
3294  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3295  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3296  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3297  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3298  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3299  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3300  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3301  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3302  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3303  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3304  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3305  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3306  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3307  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3308  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3309  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3310  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3311  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3312  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3313  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3314  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
3315  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
3316  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
3317  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
3318  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
3319  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
3320  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
3321  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
3322  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
3323  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
3324  values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
3325  values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
3326  values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
3327  values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
3328  values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
3329  values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
3330  values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
3331  values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
3332  values[38] = PyTuple_GET_ITEM(__pyx_args, 38);
3333  values[39] = PyTuple_GET_ITEM(__pyx_args, 39);
3334  values[40] = PyTuple_GET_ITEM(__pyx_args, 40);
3335  values[41] = PyTuple_GET_ITEM(__pyx_args, 41);
3336  values[42] = PyTuple_GET_ITEM(__pyx_args, 42);
3337  values[43] = PyTuple_GET_ITEM(__pyx_args, 43);
3338  values[44] = PyTuple_GET_ITEM(__pyx_args, 44);
3339  values[45] = PyTuple_GET_ITEM(__pyx_args, 45);
3340  values[46] = PyTuple_GET_ITEM(__pyx_args, 46);
3341  }
3342  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L3_error)
3343  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error)
3344  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error)
3345  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
3346  __pyx_v_colind = ((PyArrayObject *)values[4]);
3347  __pyx_v_matType = ((PyArrayObject *)values[5]);
3348  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error)
3349  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L3_error)
3350  __pyx_v_omega = ((PyArrayObject *)values[8]);
3351  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
3352  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error)
3353  __pyx_v_rwork_psk = ((PyArrayObject *)values[11]);
3354  __pyx_v_iwork_psk = ((PyArrayObject *)values[12]);
3355  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[13]);
3356  __pyx_v_rwork_density_w = ((PyArrayObject *)values[14]);
3357  __pyx_v_rwork_density_n = ((PyArrayObject *)values[15]);
3358  __pyx_v_g = ((PyArrayObject *)values[16]);
3359  __pyx_v_x = ((PyArrayObject *)values[17]);
3360  __pyx_v_sw = ((PyArrayObject *)values[18]);
3361  __pyx_v_psiw = ((PyArrayObject *)values[19]);
3362  __pyx_v_mw = ((PyArrayObject *)values[20]);
3363  __pyx_v_dmw = ((PyArrayObject *)values[21]);
3364  __pyx_v_dmw_dpsiw = ((PyArrayObject *)values[22]);
3365  __pyx_v_mn = ((PyArrayObject *)values[23]);
3366  __pyx_v_dmn = ((PyArrayObject *)values[24]);
3367  __pyx_v_dmn_dpsiw = ((PyArrayObject *)values[25]);
3368  __pyx_v_psin = ((PyArrayObject *)values[26]);
3369  __pyx_v_dpsin = ((PyArrayObject *)values[27]);
3370  __pyx_v_dpsin_dpsiw = ((PyArrayObject *)values[28]);
3371  __pyx_v_phi_psiw = ((PyArrayObject *)values[29]);
3372  __pyx_v_dphi_psiw_dpsiw = ((PyArrayObject *)values[30]);
3373  __pyx_v_phi_psin = ((PyArrayObject *)values[31]);
3374  __pyx_v_dphi_psin_dpsiw = ((PyArrayObject *)values[32]);
3375  __pyx_v_dphi_psin_dsw = ((PyArrayObject *)values[33]);
3376  __pyx_v_fw = ((PyArrayObject *)values[34]);
3377  __pyx_v_dfw_dsw = ((PyArrayObject *)values[35]);
3378  __pyx_v_dfw_dpsiw = ((PyArrayObject *)values[36]);
3379  __pyx_v_fn = ((PyArrayObject *)values[37]);
3380  __pyx_v_dfn_dsw = ((PyArrayObject *)values[38]);
3381  __pyx_v_dfn_dpsiw = ((PyArrayObject *)values[39]);
3382  __pyx_v_aw = ((PyArrayObject *)values[40]);
3383  __pyx_v_daw = ((PyArrayObject *)values[41]);
3384  __pyx_v_daw_dpsiw = ((PyArrayObject *)values[42]);
3385  __pyx_v_an = ((PyArrayObject *)values[43]);
3386  __pyx_v_dan = ((PyArrayObject *)values[44]);
3387  __pyx_v_dan_dpsiw = ((PyArrayObject *)values[45]);
3388  __pyx_v_compressibilityFlag = __Pyx_PyInt_As_int(values[46]); if (unlikely((__pyx_v_compressibilityFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L3_error)
3389  }
3390  goto __pyx_L4_argument_unpacking_done;
3391  __pyx_L5_argtuple_error:;
3392  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 1, 47, 47, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 423, __pyx_L3_error)
3393  __pyx_L3_error:;
3394  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_fc_sd_het_matType_nonPotentialForm", __pyx_clineno, __pyx_lineno, __pyx_filename);
3395  __Pyx_RefNannyFinishContext();
3396  return NULL;
3397  __pyx_L4_argument_unpacking_done:;
3398  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 426, __pyx_L1_error)
3399  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 427, __pyx_L1_error)
3400  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 428, __pyx_L1_error)
3401  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 431, __pyx_L1_error)
3402  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 432, __pyx_L1_error)
3403  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 434, __pyx_L1_error)
3404  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 435, __pyx_L1_error)
3405  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 436, __pyx_L1_error)
3406  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 437, __pyx_L1_error)
3407  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 438, __pyx_L1_error)
3408  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 439, __pyx_L1_error)
3409  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 440, __pyx_L1_error)
3410  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 441, __pyx_L1_error)
3411  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 442, __pyx_L1_error)
3412  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mw), __pyx_ptype_5numpy_ndarray, 1, "mw", 0))) __PYX_ERR(0, 443, __pyx_L1_error)
3413  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmw), __pyx_ptype_5numpy_ndarray, 1, "dmw", 0))) __PYX_ERR(0, 444, __pyx_L1_error)
3414  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dmw_dpsiw", 0))) __PYX_ERR(0, 445, __pyx_L1_error)
3415  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mn), __pyx_ptype_5numpy_ndarray, 1, "mn", 0))) __PYX_ERR(0, 446, __pyx_L1_error)
3416  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmn), __pyx_ptype_5numpy_ndarray, 1, "dmn", 0))) __PYX_ERR(0, 447, __pyx_L1_error)
3417  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmn_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dmn_dpsiw", 0))) __PYX_ERR(0, 448, __pyx_L1_error)
3418  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psin), __pyx_ptype_5numpy_ndarray, 1, "psin", 0))) __PYX_ERR(0, 449, __pyx_L1_error)
3419  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpsin), __pyx_ptype_5numpy_ndarray, 1, "dpsin", 0))) __PYX_ERR(0, 450, __pyx_L1_error)
3420  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpsin_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dpsin_dpsiw", 0))) __PYX_ERR(0, 451, __pyx_L1_error)
3421  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_psiw), __pyx_ptype_5numpy_ndarray, 1, "phi_psiw", 0))) __PYX_ERR(0, 452, __pyx_L1_error)
3422  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psiw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psiw_dpsiw", 0))) __PYX_ERR(0, 453, __pyx_L1_error)
3423  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_psin), __pyx_ptype_5numpy_ndarray, 1, "phi_psin", 0))) __PYX_ERR(0, 454, __pyx_L1_error)
3424  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psin_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psin_dpsiw", 0))) __PYX_ERR(0, 455, __pyx_L1_error)
3425  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psin_dsw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psin_dsw", 0))) __PYX_ERR(0, 456, __pyx_L1_error)
3426  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fw), __pyx_ptype_5numpy_ndarray, 1, "fw", 0))) __PYX_ERR(0, 457, __pyx_L1_error)
3427  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dfw_dsw), __pyx_ptype_5numpy_ndarray, 1, "dfw_dsw", 0))) __PYX_ERR(0, 458, __pyx_L1_error)
3428  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dfw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dfw_dpsiw", 0))) __PYX_ERR(0, 459, __pyx_L1_error)
3429  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fn), __pyx_ptype_5numpy_ndarray, 1, "fn", 0))) __PYX_ERR(0, 460, __pyx_L1_error)
3430  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dfn_dsw), __pyx_ptype_5numpy_ndarray, 1, "dfn_dsw", 0))) __PYX_ERR(0, 461, __pyx_L1_error)
3431  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dfn_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dfn_dpsiw", 0))) __PYX_ERR(0, 462, __pyx_L1_error)
3432  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aw), __pyx_ptype_5numpy_ndarray, 1, "aw", 0))) __PYX_ERR(0, 463, __pyx_L1_error)
3433  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_daw), __pyx_ptype_5numpy_ndarray, 1, "daw", 0))) __PYX_ERR(0, 464, __pyx_L1_error)
3434  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_daw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "daw_dpsiw", 0))) __PYX_ERR(0, 465, __pyx_L1_error)
3435  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_an), __pyx_ptype_5numpy_ndarray, 1, "an", 0))) __PYX_ERR(0, 466, __pyx_L1_error)
3436  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dan), __pyx_ptype_5numpy_ndarray, 1, "dan", 0))) __PYX_ERR(0, 467, __pyx_L1_error)
3437  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dan_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dan_dpsiw", 0))) __PYX_ERR(0, 468, __pyx_L1_error)
3438  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_2twophaseDarcy_fc_sd_het_matType_nonPotentialForm(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_x, __pyx_v_sw, __pyx_v_psiw, __pyx_v_mw, __pyx_v_dmw, __pyx_v_dmw_dpsiw, __pyx_v_mn, __pyx_v_dmn, __pyx_v_dmn_dpsiw, __pyx_v_psin, __pyx_v_dpsin, __pyx_v_dpsin_dpsiw, __pyx_v_phi_psiw, __pyx_v_dphi_psiw_dpsiw, __pyx_v_phi_psin, __pyx_v_dphi_psin_dpsiw, __pyx_v_dphi_psin_dsw, __pyx_v_fw, __pyx_v_dfw_dsw, __pyx_v_dfw_dpsiw, __pyx_v_fn, __pyx_v_dfn_dsw, __pyx_v_dfn_dpsiw, __pyx_v_aw, __pyx_v_daw, __pyx_v_daw_dpsiw, __pyx_v_an, __pyx_v_dan, __pyx_v_dan_dpsiw, __pyx_v_compressibilityFlag);
3439 
3440  /* function exit code */
3441  goto __pyx_L0;
3442  __pyx_L1_error:;
3443  __pyx_r = NULL;
3444  __pyx_L0:;
3445  __Pyx_RefNannyFinishContext();
3446  return __pyx_r;
3447 }
3448 
3449 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_2twophaseDarcy_fc_sd_het_matType_nonPotentialForm(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, 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_iwork_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_x, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_mw, PyArrayObject *__pyx_v_dmw, PyArrayObject *__pyx_v_dmw_dpsiw, PyArrayObject *__pyx_v_mn, PyArrayObject *__pyx_v_dmn, PyArrayObject *__pyx_v_dmn_dpsiw, PyArrayObject *__pyx_v_psin, PyArrayObject *__pyx_v_dpsin, PyArrayObject *__pyx_v_dpsin_dpsiw, PyArrayObject *__pyx_v_phi_psiw, PyArrayObject *__pyx_v_dphi_psiw_dpsiw, PyArrayObject *__pyx_v_phi_psin, PyArrayObject *__pyx_v_dphi_psin_dpsiw, PyArrayObject *__pyx_v_dphi_psin_dsw, PyArrayObject *__pyx_v_fw, PyArrayObject *__pyx_v_dfw_dsw, PyArrayObject *__pyx_v_dfw_dpsiw, PyArrayObject *__pyx_v_fn, PyArrayObject *__pyx_v_dfn_dsw, PyArrayObject *__pyx_v_dfn_dpsiw, PyArrayObject *__pyx_v_aw, PyArrayObject *__pyx_v_daw, PyArrayObject *__pyx_v_daw_dpsiw, PyArrayObject *__pyx_v_an, PyArrayObject *__pyx_v_dan, PyArrayObject *__pyx_v_dan_dpsiw, int __pyx_v_compressibilityFlag) {
3450  int __pyx_v_nPointsPerSimplex;
3451  int __pyx_v_nSimplex;
3452  PyObject *__pyx_r = NULL;
3453  __Pyx_RefNannyDeclarations
3454  PyObject *__pyx_t_1 = NULL;
3455  PyObject *__pyx_t_2 = NULL;
3456  PyObject *__pyx_t_3 = NULL;
3457  int __pyx_t_4;
3458  int __pyx_t_5;
3459  PyObject *__pyx_t_6 = NULL;
3460  PyObject *__pyx_t_7 = NULL;
3461  PyObject *__pyx_t_8 = NULL;
3462  int __pyx_lineno = 0;
3463  const char *__pyx_filename = NULL;
3464  int __pyx_clineno = 0;
3465  __Pyx_RefNannySetupContext("twophaseDarcy_fc_sd_het_matType_nonPotentialForm", 0);
3466 
3467  /* "cTwophaseDarcyCoefficients.pyx":475
3468  *
3469  * """
3470  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
3471  * cdef int nSimplex=sw.size/nPointsPerSimplex
3472  * assert density_w_flag == 1
3473  */
3474  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
3475 
3476  /* "cTwophaseDarcyCoefficients.pyx":476
3477  * """
3478  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
3479  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
3480  * assert density_w_flag == 1
3481  * if density_n_flag == 1:#nonwetting exponential
3482  */
3483  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
3484  __Pyx_GOTREF(__pyx_t_1);
3485  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error)
3486  __Pyx_GOTREF(__pyx_t_2);
3487  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error)
3488  __Pyx_GOTREF(__pyx_t_3);
3489  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3490  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3491  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error)
3492  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3493  __pyx_v_nSimplex = __pyx_t_4;
3494 
3495  /* "cTwophaseDarcyCoefficients.pyx":477
3496  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
3497  * cdef int nSimplex=sw.size/nPointsPerSimplex
3498  * assert density_w_flag == 1 # <<<<<<<<<<<<<<
3499  * if density_n_flag == 1:#nonwetting exponential
3500  * if pskModelFlag == 0:
3501  */
3502  #ifndef CYTHON_WITHOUT_ASSERTIONS
3503  if (unlikely(!Py_OptimizeFlag)) {
3504  if (unlikely(!((__pyx_v_density_w_flag == 1) != 0))) {
3505  PyErr_SetNone(PyExc_AssertionError);
3506  __PYX_ERR(0, 477, __pyx_L1_error)
3507  }
3508  }
3509  #endif
3510 
3511  /* "cTwophaseDarcyCoefficients.pyx":478
3512  * cdef int nSimplex=sw.size/nPointsPerSimplex
3513  * assert density_w_flag == 1
3514  * if density_n_flag == 1:#nonwetting exponential # <<<<<<<<<<<<<<
3515  * if pskModelFlag == 0:
3516  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[SimplePSK,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex,
3517  */
3518  switch (__pyx_v_density_n_flag) {
3519  case 1:
3520 
3521  /* "cTwophaseDarcyCoefficients.pyx":479
3522  * assert density_w_flag == 1
3523  * if density_n_flag == 1:#nonwetting exponential
3524  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
3525  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[SimplePSK,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex,
3526  * nPointsPerSimplex,
3527  */
3528  switch (__pyx_v_pskModelFlag) {
3529  case 0:
3530 
3531  /* "cTwophaseDarcyCoefficients.pyx":480
3532  * if density_n_flag == 1:#nonwetting exponential
3533  * if pskModelFlag == 0:
3534  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[SimplePSK,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex, # <<<<<<<<<<<<<<
3535  * nPointsPerSimplex,
3536  * g.shape[0],
3537  */
3538  (void)(twophaseDarcy_fc_sd_het_matType_nonPotentialForm<SimplePSK,ExponentialDensity,ExponentialDensity>(__pyx_v_compressibilityFlag, __pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_fw->data), ((double *)__pyx_v_dfw_dsw->data), ((double *)__pyx_v_dfw_dpsiw->data), ((double *)__pyx_v_fn->data), ((double *)__pyx_v_dfn_dsw->data), ((double *)__pyx_v_dfn_dpsiw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
3539 
3540  /* "cTwophaseDarcyCoefficients.pyx":479
3541  * assert density_w_flag == 1
3542  * if density_n_flag == 1:#nonwetting exponential
3543  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
3544  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[SimplePSK,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex,
3545  * nPointsPerSimplex,
3546  */
3547  break;
3548  case 1:
3549 
3550  /* "cTwophaseDarcyCoefficients.pyx":528
3551  * <double*>(dan_dpsiw.data))
3552  * elif pskModelFlag == 1:
3553  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[VGM,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex, # <<<<<<<<<<<<<<
3554  * nPointsPerSimplex,
3555  * g.shape[0],
3556  */
3557  (void)(twophaseDarcy_fc_sd_het_matType_nonPotentialForm<VGM,ExponentialDensity,ExponentialDensity>(__pyx_v_compressibilityFlag, __pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_fw->data), ((double *)__pyx_v_dfw_dsw->data), ((double *)__pyx_v_dfw_dpsiw->data), ((double *)__pyx_v_fn->data), ((double *)__pyx_v_dfn_dsw->data), ((double *)__pyx_v_dfn_dpsiw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
3558 
3559  /* "cTwophaseDarcyCoefficients.pyx":527
3560  * <double*>(dan.data),
3561  * <double*>(dan_dpsiw.data))
3562  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
3563  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[VGM,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex,
3564  * nPointsPerSimplex,
3565  */
3566  break;
3567  default:
3568 
3569  /* "cTwophaseDarcyCoefficients.pyx":576
3570  * <double*>(dan_dpsiw.data))
3571  * else:
3572  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[SimplePSK,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex, # <<<<<<<<<<<<<<
3573  * nPointsPerSimplex,
3574  * g.shape[0],
3575  */
3576  (void)(twophaseDarcy_fc_sd_het_matType_nonPotentialForm<SimplePSK,ExponentialDensity,ExponentialDensity>(__pyx_v_compressibilityFlag, __pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_fw->data), ((double *)__pyx_v_dfw_dsw->data), ((double *)__pyx_v_dfw_dpsiw->data), ((double *)__pyx_v_fn->data), ((double *)__pyx_v_dfn_dsw->data), ((double *)__pyx_v_dfn_dpsiw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
3577  break;
3578  }
3579 
3580  /* "cTwophaseDarcyCoefficients.pyx":478
3581  * cdef int nSimplex=sw.size/nPointsPerSimplex
3582  * assert density_w_flag == 1
3583  * if density_n_flag == 1:#nonwetting exponential # <<<<<<<<<<<<<<
3584  * if pskModelFlag == 0:
3585  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[SimplePSK,ExponentialDensity,ExponentialDensity](compressibilityFlag,nSimplex,
3586  */
3587  break;
3588  case 2:
3589 
3590  /* "cTwophaseDarcyCoefficients.pyx":624
3591  * <double*>(dan_dpsiw.data))
3592  * elif density_n_flag == 2:#nonwetting IdealGas
3593  * if pskModelFlag == 1: # <<<<<<<<<<<<<<
3594  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[VGM,ExponentialDensity,IdealGasDensity](compressibilityFlag,nSimplex,
3595  * nPointsPerSimplex,
3596  */
3597  __pyx_t_5 = ((__pyx_v_pskModelFlag == 1) != 0);
3598  if (__pyx_t_5) {
3599 
3600  /* "cTwophaseDarcyCoefficients.pyx":625
3601  * elif density_n_flag == 2:#nonwetting IdealGas
3602  * if pskModelFlag == 1:
3603  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[VGM,ExponentialDensity,IdealGasDensity](compressibilityFlag,nSimplex, # <<<<<<<<<<<<<<
3604  * nPointsPerSimplex,
3605  * g.shape[0],
3606  */
3607  (void)(twophaseDarcy_fc_sd_het_matType_nonPotentialForm<VGM,ExponentialDensity,IdealGasDensity>(__pyx_v_compressibilityFlag, __pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_fw->data), ((double *)__pyx_v_dfw_dsw->data), ((double *)__pyx_v_dfw_dpsiw->data), ((double *)__pyx_v_fn->data), ((double *)__pyx_v_dfn_dsw->data), ((double *)__pyx_v_dfn_dpsiw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
3608 
3609  /* "cTwophaseDarcyCoefficients.pyx":624
3610  * <double*>(dan_dpsiw.data))
3611  * elif density_n_flag == 2:#nonwetting IdealGas
3612  * if pskModelFlag == 1: # <<<<<<<<<<<<<<
3613  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[VGM,ExponentialDensity,IdealGasDensity](compressibilityFlag,nSimplex,
3614  * nPointsPerSimplex,
3615  */
3616  goto __pyx_L3;
3617  }
3618 
3619  /* "cTwophaseDarcyCoefficients.pyx":673
3620  * <double*>(dan_dpsiw.data))
3621  * else:
3622  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[SimplePSK,ExponentialDensity,IdealGasDensity](compressibilityFlag,nSimplex, # <<<<<<<<<<<<<<
3623  * nPointsPerSimplex,
3624  * g.shape[0],
3625  */
3626  /*else*/ {
3627 
3628  /* "cTwophaseDarcyCoefficients.pyx":719
3629  * <double*>(an.data),
3630  * <double*>(dan.data),
3631  * <double*>(dan_dpsiw.data)) # <<<<<<<<<<<<<<
3632  * else:
3633  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
3634  */
3635  (void)(twophaseDarcy_fc_sd_het_matType_nonPotentialForm<SimplePSK,ExponentialDensity,IdealGasDensity>(__pyx_v_compressibilityFlag, __pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_dpsin->data), ((double *)__pyx_v_dpsin_dpsiw->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dsw->data), ((double *)__pyx_v_fw->data), ((double *)__pyx_v_dfw_dsw->data), ((double *)__pyx_v_dfw_dpsiw->data), ((double *)__pyx_v_fn->data), ((double *)__pyx_v_dfn_dsw->data), ((double *)__pyx_v_dfn_dpsiw->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan->data), ((double *)__pyx_v_dan_dpsiw->data)));
3636  }
3637  __pyx_L3:;
3638 
3639  /* "cTwophaseDarcyCoefficients.pyx":623
3640  * <double*>(dan.data),
3641  * <double*>(dan_dpsiw.data))
3642  * elif density_n_flag == 2:#nonwetting IdealGas # <<<<<<<<<<<<<<
3643  * if pskModelFlag == 1:
3644  * tpdc.twophaseDarcy_fc_sd_het_matType_nonPotentialForm[VGM,ExponentialDensity,IdealGasDensity](compressibilityFlag,nSimplex,
3645  */
3646  break;
3647  default:
3648 
3649  /* "cTwophaseDarcyCoefficients.pyx":721
3650  * <double*>(dan_dpsiw.data))
3651  * else:
3652  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag) # <<<<<<<<<<<<<<
3653  *
3654  * def twophaseDarcy_fc_pp_sd_het_matType(int pskModelFlag,
3655  */
3656  #ifndef CYTHON_WITHOUT_ASSERTIONS
3657  if (unlikely(!Py_OptimizeFlag)) {
3658  if (unlikely(!0)) {
3659  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_configuration_density_w_flag_0_a, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
3660  __Pyx_GOTREF(__pyx_t_2);
3661  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_density_w_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
3662  __Pyx_GOTREF(__pyx_t_1);
3663  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_density_n_flag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 721, __pyx_L1_error)
3664  __Pyx_GOTREF(__pyx_t_6);
3665  __pyx_t_7 = NULL;
3666  __pyx_t_4 = 0;
3667  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3668  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
3669  if (likely(__pyx_t_7)) {
3670  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3671  __Pyx_INCREF(__pyx_t_7);
3672  __Pyx_INCREF(function);
3673  __Pyx_DECREF_SET(__pyx_t_2, function);
3674  __pyx_t_4 = 1;
3675  }
3676  }
3677  #if CYTHON_FAST_PYCALL
3678  if (PyFunction_Check(__pyx_t_2)) {
3679  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6};
3680  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
3681  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3682  __Pyx_GOTREF(__pyx_t_3);
3683  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3684  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3685  } else
3686  #endif
3687  #if CYTHON_FAST_PYCCALL
3688  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3689  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6};
3690  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
3691  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3692  __Pyx_GOTREF(__pyx_t_3);
3693  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3694  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3695  } else
3696  #endif
3697  {
3698  __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 721, __pyx_L1_error)
3699  __Pyx_GOTREF(__pyx_t_8);
3700  if (__pyx_t_7) {
3701  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
3702  }
3703  __Pyx_GIVEREF(__pyx_t_1);
3704  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_t_1);
3705  __Pyx_GIVEREF(__pyx_t_6);
3706  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_t_6);
3707  __pyx_t_1 = 0;
3708  __pyx_t_6 = 0;
3709  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
3710  __Pyx_GOTREF(__pyx_t_3);
3711  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3712  }
3713  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3714  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
3715  __Pyx_GOTREF(__pyx_t_2);
3716  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3717  PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
3718  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3719  __PYX_ERR(0, 721, __pyx_L1_error)
3720  }
3721  }
3722  #endif
3723  break;
3724  }
3725 
3726  /* "cTwophaseDarcyCoefficients.pyx":423
3727  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
3728  *
3729  * def twophaseDarcy_fc_sd_het_matType_nonPotentialForm(int pskModelFlag, # <<<<<<<<<<<<<<
3730  * int density_w_flag,
3731  * int density_n_flag,
3732  */
3733 
3734  /* function exit code */
3735  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3736  goto __pyx_L0;
3737  __pyx_L1_error:;
3738  __Pyx_XDECREF(__pyx_t_1);
3739  __Pyx_XDECREF(__pyx_t_2);
3740  __Pyx_XDECREF(__pyx_t_3);
3741  __Pyx_XDECREF(__pyx_t_6);
3742  __Pyx_XDECREF(__pyx_t_7);
3743  __Pyx_XDECREF(__pyx_t_8);
3744  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_fc_sd_het_matType_nonPotentialForm", __pyx_clineno, __pyx_lineno, __pyx_filename);
3745  __pyx_r = NULL;
3746  __pyx_L0:;
3747  __Pyx_XGIVEREF(__pyx_r);
3748  __Pyx_RefNannyFinishContext();
3749  return __pyx_r;
3750 }
3751 
3752 /* "cTwophaseDarcyCoefficients.pyx":723
3753  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
3754  *
3755  * def twophaseDarcy_fc_pp_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
3756  * int density_w_flag,
3757  * int density_n_flag,
3758  */
3759 
3760 /* Python wrapper */
3761 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_5twophaseDarcy_fc_pp_sd_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3762 static char __pyx_doc_26cTwophaseDarcyCoefficients_4twophaseDarcy_fc_pp_sd_het_matType[] = "Evaluate the coefficients of the fully coupled formulation of\n (slightly) compressible, two-phase Darcy flow for a heterogeneous\n medium, pressure-pressure sparse diffusion rep. for het\n\n ";
3763 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_5twophaseDarcy_fc_pp_sd_het_matType = {"twophaseDarcy_fc_pp_sd_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_5twophaseDarcy_fc_pp_sd_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_4twophaseDarcy_fc_pp_sd_het_matType};
3764 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_5twophaseDarcy_fc_pp_sd_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3765  int __pyx_v_pskModelFlag;
3766  int __pyx_v_density_w_flag;
3767  int __pyx_v_density_n_flag;
3768  PyArrayObject *__pyx_v_rowptr = 0;
3769  PyArrayObject *__pyx_v_colind = 0;
3770  PyArrayObject *__pyx_v_matType = 0;
3771  double __pyx_v_muw;
3772  double __pyx_v_mun;
3773  PyArrayObject *__pyx_v_omega = 0;
3774  PyArrayObject *__pyx_v_Kbar = 0;
3775  double __pyx_v_b;
3776  PyArrayObject *__pyx_v_rwork_psk = 0;
3777  PyArrayObject *__pyx_v_iwork_psk = 0;
3778  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
3779  PyArrayObject *__pyx_v_rwork_density_w = 0;
3780  PyArrayObject *__pyx_v_rwork_density_n = 0;
3781  PyArrayObject *__pyx_v_g = 0;
3782  PyArrayObject *__pyx_v_x = 0;
3783  PyArrayObject *__pyx_v_psiw = 0;
3784  PyArrayObject *__pyx_v_psic = 0;
3785  PyArrayObject *__pyx_v_sw = 0;
3786  PyArrayObject *__pyx_v_mw = 0;
3787  PyArrayObject *__pyx_v_dmw_dpsiw = 0;
3788  PyArrayObject *__pyx_v_dmw_dpsic = 0;
3789  PyArrayObject *__pyx_v_mn = 0;
3790  PyArrayObject *__pyx_v_dmn_dpsiw = 0;
3791  PyArrayObject *__pyx_v_dmn_dpsic = 0;
3792  PyArrayObject *__pyx_v_phi_psiw = 0;
3793  PyArrayObject *__pyx_v_dphi_psiw_dpsiw = 0;
3794  PyArrayObject *__pyx_v_phi_psin = 0;
3795  PyArrayObject *__pyx_v_dphi_psin_dpsiw = 0;
3796  PyArrayObject *__pyx_v_dphi_psin_dpsic = 0;
3797  PyArrayObject *__pyx_v_aw = 0;
3798  PyArrayObject *__pyx_v_daw_dpsiw = 0;
3799  PyArrayObject *__pyx_v_daw_dpsic = 0;
3800  PyArrayObject *__pyx_v_an = 0;
3801  PyArrayObject *__pyx_v_dan_dpsiw = 0;
3802  PyArrayObject *__pyx_v_dan_dpsic = 0;
3803  int __pyx_lineno = 0;
3804  const char *__pyx_filename = NULL;
3805  int __pyx_clineno = 0;
3806  PyObject *__pyx_r = 0;
3807  __Pyx_RefNannyDeclarations
3808  __Pyx_RefNannySetupContext("twophaseDarcy_fc_pp_sd_het_matType (wrapper)", 0);
3809  {
3810  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__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_iwork_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_x,&__pyx_n_s_psiw,&__pyx_n_s_psic,&__pyx_n_s_sw,&__pyx_n_s_mw,&__pyx_n_s_dmw_dpsiw,&__pyx_n_s_dmw_dpsic,&__pyx_n_s_mn,&__pyx_n_s_dmn_dpsiw,&__pyx_n_s_dmn_dpsic,&__pyx_n_s_phi_psiw,&__pyx_n_s_dphi_psiw_dpsiw,&__pyx_n_s_phi_psin,&__pyx_n_s_dphi_psin_dpsiw,&__pyx_n_s_dphi_psin_dpsic,&__pyx_n_s_aw,&__pyx_n_s_daw_dpsiw,&__pyx_n_s_daw_dpsic,&__pyx_n_s_an,&__pyx_n_s_dan_dpsiw,&__pyx_n_s_dan_dpsic,0};
3811  PyObject* values[38] = {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,0,0,0};
3812  if (unlikely(__pyx_kwds)) {
3813  Py_ssize_t kw_args;
3814  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3815  switch (pos_args) {
3816  case 38: values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
3817  CYTHON_FALLTHROUGH;
3818  case 37: values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
3819  CYTHON_FALLTHROUGH;
3820  case 36: values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
3821  CYTHON_FALLTHROUGH;
3822  case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
3823  CYTHON_FALLTHROUGH;
3824  case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
3825  CYTHON_FALLTHROUGH;
3826  case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
3827  CYTHON_FALLTHROUGH;
3828  case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
3829  CYTHON_FALLTHROUGH;
3830  case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
3831  CYTHON_FALLTHROUGH;
3832  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
3833  CYTHON_FALLTHROUGH;
3834  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
3835  CYTHON_FALLTHROUGH;
3836  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
3837  CYTHON_FALLTHROUGH;
3838  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
3839  CYTHON_FALLTHROUGH;
3840  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
3841  CYTHON_FALLTHROUGH;
3842  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
3843  CYTHON_FALLTHROUGH;
3844  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
3845  CYTHON_FALLTHROUGH;
3846  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
3847  CYTHON_FALLTHROUGH;
3848  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
3849  CYTHON_FALLTHROUGH;
3850  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
3851  CYTHON_FALLTHROUGH;
3852  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3853  CYTHON_FALLTHROUGH;
3854  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3855  CYTHON_FALLTHROUGH;
3856  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3857  CYTHON_FALLTHROUGH;
3858  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3859  CYTHON_FALLTHROUGH;
3860  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3861  CYTHON_FALLTHROUGH;
3862  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3863  CYTHON_FALLTHROUGH;
3864  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3865  CYTHON_FALLTHROUGH;
3866  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3867  CYTHON_FALLTHROUGH;
3868  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3869  CYTHON_FALLTHROUGH;
3870  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3871  CYTHON_FALLTHROUGH;
3872  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3873  CYTHON_FALLTHROUGH;
3874  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3875  CYTHON_FALLTHROUGH;
3876  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3877  CYTHON_FALLTHROUGH;
3878  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3879  CYTHON_FALLTHROUGH;
3880  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3881  CYTHON_FALLTHROUGH;
3882  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3883  CYTHON_FALLTHROUGH;
3884  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3885  CYTHON_FALLTHROUGH;
3886  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3887  CYTHON_FALLTHROUGH;
3888  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3889  CYTHON_FALLTHROUGH;
3890  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3891  CYTHON_FALLTHROUGH;
3892  case 0: break;
3893  default: goto __pyx_L5_argtuple_error;
3894  }
3895  kw_args = PyDict_Size(__pyx_kwds);
3896  switch (pos_args) {
3897  case 0:
3898  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
3899  else goto __pyx_L5_argtuple_error;
3900  CYTHON_FALLTHROUGH;
3901  case 1:
3902  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
3903  else {
3904  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 1); __PYX_ERR(0, 723, __pyx_L3_error)
3905  }
3906  CYTHON_FALLTHROUGH;
3907  case 2:
3908  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
3909  else {
3910  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 2); __PYX_ERR(0, 723, __pyx_L3_error)
3911  }
3912  CYTHON_FALLTHROUGH;
3913  case 3:
3914  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
3915  else {
3916  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 3); __PYX_ERR(0, 723, __pyx_L3_error)
3917  }
3918  CYTHON_FALLTHROUGH;
3919  case 4:
3920  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
3921  else {
3922  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 4); __PYX_ERR(0, 723, __pyx_L3_error)
3923  }
3924  CYTHON_FALLTHROUGH;
3925  case 5:
3926  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
3927  else {
3928  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 5); __PYX_ERR(0, 723, __pyx_L3_error)
3929  }
3930  CYTHON_FALLTHROUGH;
3931  case 6:
3932  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
3933  else {
3934  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 6); __PYX_ERR(0, 723, __pyx_L3_error)
3935  }
3936  CYTHON_FALLTHROUGH;
3937  case 7:
3938  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
3939  else {
3940  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 7); __PYX_ERR(0, 723, __pyx_L3_error)
3941  }
3942  CYTHON_FALLTHROUGH;
3943  case 8:
3944  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
3945  else {
3946  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 8); __PYX_ERR(0, 723, __pyx_L3_error)
3947  }
3948  CYTHON_FALLTHROUGH;
3949  case 9:
3950  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
3951  else {
3952  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 9); __PYX_ERR(0, 723, __pyx_L3_error)
3953  }
3954  CYTHON_FALLTHROUGH;
3955  case 10:
3956  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
3957  else {
3958  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 10); __PYX_ERR(0, 723, __pyx_L3_error)
3959  }
3960  CYTHON_FALLTHROUGH;
3961  case 11:
3962  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
3963  else {
3964  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 11); __PYX_ERR(0, 723, __pyx_L3_error)
3965  }
3966  CYTHON_FALLTHROUGH;
3967  case 12:
3968  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
3969  else {
3970  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 12); __PYX_ERR(0, 723, __pyx_L3_error)
3971  }
3972  CYTHON_FALLTHROUGH;
3973  case 13:
3974  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
3975  else {
3976  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 13); __PYX_ERR(0, 723, __pyx_L3_error)
3977  }
3978  CYTHON_FALLTHROUGH;
3979  case 14:
3980  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
3981  else {
3982  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 14); __PYX_ERR(0, 723, __pyx_L3_error)
3983  }
3984  CYTHON_FALLTHROUGH;
3985  case 15:
3986  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
3987  else {
3988  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 15); __PYX_ERR(0, 723, __pyx_L3_error)
3989  }
3990  CYTHON_FALLTHROUGH;
3991  case 16:
3992  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
3993  else {
3994  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 16); __PYX_ERR(0, 723, __pyx_L3_error)
3995  }
3996  CYTHON_FALLTHROUGH;
3997  case 17:
3998  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3999  else {
4000  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 17); __PYX_ERR(0, 723, __pyx_L3_error)
4001  }
4002  CYTHON_FALLTHROUGH;
4003  case 18:
4004  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
4005  else {
4006  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 18); __PYX_ERR(0, 723, __pyx_L3_error)
4007  }
4008  CYTHON_FALLTHROUGH;
4009  case 19:
4010  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psic)) != 0)) kw_args--;
4011  else {
4012  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 19); __PYX_ERR(0, 723, __pyx_L3_error)
4013  }
4014  CYTHON_FALLTHROUGH;
4015  case 20:
4016  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
4017  else {
4018  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 20); __PYX_ERR(0, 723, __pyx_L3_error)
4019  }
4020  CYTHON_FALLTHROUGH;
4021  case 21:
4022  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mw)) != 0)) kw_args--;
4023  else {
4024  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 21); __PYX_ERR(0, 723, __pyx_L3_error)
4025  }
4026  CYTHON_FALLTHROUGH;
4027  case 22:
4028  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmw_dpsiw)) != 0)) kw_args--;
4029  else {
4030  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 22); __PYX_ERR(0, 723, __pyx_L3_error)
4031  }
4032  CYTHON_FALLTHROUGH;
4033  case 23:
4034  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmw_dpsic)) != 0)) kw_args--;
4035  else {
4036  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 23); __PYX_ERR(0, 723, __pyx_L3_error)
4037  }
4038  CYTHON_FALLTHROUGH;
4039  case 24:
4040  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mn)) != 0)) kw_args--;
4041  else {
4042  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 24); __PYX_ERR(0, 723, __pyx_L3_error)
4043  }
4044  CYTHON_FALLTHROUGH;
4045  case 25:
4046  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmn_dpsiw)) != 0)) kw_args--;
4047  else {
4048  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 25); __PYX_ERR(0, 723, __pyx_L3_error)
4049  }
4050  CYTHON_FALLTHROUGH;
4051  case 26:
4052  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmn_dpsic)) != 0)) kw_args--;
4053  else {
4054  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 26); __PYX_ERR(0, 723, __pyx_L3_error)
4055  }
4056  CYTHON_FALLTHROUGH;
4057  case 27:
4058  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_psiw)) != 0)) kw_args--;
4059  else {
4060  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 27); __PYX_ERR(0, 723, __pyx_L3_error)
4061  }
4062  CYTHON_FALLTHROUGH;
4063  case 28:
4064  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psiw_dpsiw)) != 0)) kw_args--;
4065  else {
4066  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 28); __PYX_ERR(0, 723, __pyx_L3_error)
4067  }
4068  CYTHON_FALLTHROUGH;
4069  case 29:
4070  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_psin)) != 0)) kw_args--;
4071  else {
4072  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 29); __PYX_ERR(0, 723, __pyx_L3_error)
4073  }
4074  CYTHON_FALLTHROUGH;
4075  case 30:
4076  if (likely((values[30] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psin_dpsiw)) != 0)) kw_args--;
4077  else {
4078  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 30); __PYX_ERR(0, 723, __pyx_L3_error)
4079  }
4080  CYTHON_FALLTHROUGH;
4081  case 31:
4082  if (likely((values[31] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi_psin_dpsic)) != 0)) kw_args--;
4083  else {
4084  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 31); __PYX_ERR(0, 723, __pyx_L3_error)
4085  }
4086  CYTHON_FALLTHROUGH;
4087  case 32:
4088  if (likely((values[32] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aw)) != 0)) kw_args--;
4089  else {
4090  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 32); __PYX_ERR(0, 723, __pyx_L3_error)
4091  }
4092  CYTHON_FALLTHROUGH;
4093  case 33:
4094  if (likely((values[33] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_daw_dpsiw)) != 0)) kw_args--;
4095  else {
4096  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 33); __PYX_ERR(0, 723, __pyx_L3_error)
4097  }
4098  CYTHON_FALLTHROUGH;
4099  case 34:
4100  if (likely((values[34] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_daw_dpsic)) != 0)) kw_args--;
4101  else {
4102  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 34); __PYX_ERR(0, 723, __pyx_L3_error)
4103  }
4104  CYTHON_FALLTHROUGH;
4105  case 35:
4106  if (likely((values[35] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_an)) != 0)) kw_args--;
4107  else {
4108  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 35); __PYX_ERR(0, 723, __pyx_L3_error)
4109  }
4110  CYTHON_FALLTHROUGH;
4111  case 36:
4112  if (likely((values[36] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dan_dpsiw)) != 0)) kw_args--;
4113  else {
4114  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 36); __PYX_ERR(0, 723, __pyx_L3_error)
4115  }
4116  CYTHON_FALLTHROUGH;
4117  case 37:
4118  if (likely((values[37] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dan_dpsic)) != 0)) kw_args--;
4119  else {
4120  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, 37); __PYX_ERR(0, 723, __pyx_L3_error)
4121  }
4122  }
4123  if (unlikely(kw_args > 0)) {
4124  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_fc_pp_sd_het_matType") < 0)) __PYX_ERR(0, 723, __pyx_L3_error)
4125  }
4126  } else if (PyTuple_GET_SIZE(__pyx_args) != 38) {
4127  goto __pyx_L5_argtuple_error;
4128  } else {
4129  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4130  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4131  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4132  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4133  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4134  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4135  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4136  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4137  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4138  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4139  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4140  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4141  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4142  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4143  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4144  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4145  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4146  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4147  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4148  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4149  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
4150  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
4151  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
4152  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
4153  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
4154  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
4155  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
4156  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
4157  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
4158  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
4159  values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
4160  values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
4161  values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
4162  values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
4163  values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
4164  values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
4165  values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
4166  values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
4167  }
4168  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error)
4169  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L3_error)
4170  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 725, __pyx_L3_error)
4171  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
4172  __pyx_v_colind = ((PyArrayObject *)values[4]);
4173  __pyx_v_matType = ((PyArrayObject *)values[5]);
4174  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L3_error)
4175  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L3_error)
4176  __pyx_v_omega = ((PyArrayObject *)values[8]);
4177  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
4178  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
4179  __pyx_v_rwork_psk = ((PyArrayObject *)values[11]);
4180  __pyx_v_iwork_psk = ((PyArrayObject *)values[12]);
4181  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[13]);
4182  __pyx_v_rwork_density_w = ((PyArrayObject *)values[14]);
4183  __pyx_v_rwork_density_n = ((PyArrayObject *)values[15]);
4184  __pyx_v_g = ((PyArrayObject *)values[16]);
4185  __pyx_v_x = ((PyArrayObject *)values[17]);
4186  __pyx_v_psiw = ((PyArrayObject *)values[18]);
4187  __pyx_v_psic = ((PyArrayObject *)values[19]);
4188  __pyx_v_sw = ((PyArrayObject *)values[20]);
4189  __pyx_v_mw = ((PyArrayObject *)values[21]);
4190  __pyx_v_dmw_dpsiw = ((PyArrayObject *)values[22]);
4191  __pyx_v_dmw_dpsic = ((PyArrayObject *)values[23]);
4192  __pyx_v_mn = ((PyArrayObject *)values[24]);
4193  __pyx_v_dmn_dpsiw = ((PyArrayObject *)values[25]);
4194  __pyx_v_dmn_dpsic = ((PyArrayObject *)values[26]);
4195  __pyx_v_phi_psiw = ((PyArrayObject *)values[27]);
4196  __pyx_v_dphi_psiw_dpsiw = ((PyArrayObject *)values[28]);
4197  __pyx_v_phi_psin = ((PyArrayObject *)values[29]);
4198  __pyx_v_dphi_psin_dpsiw = ((PyArrayObject *)values[30]);
4199  __pyx_v_dphi_psin_dpsic = ((PyArrayObject *)values[31]);
4200  __pyx_v_aw = ((PyArrayObject *)values[32]);
4201  __pyx_v_daw_dpsiw = ((PyArrayObject *)values[33]);
4202  __pyx_v_daw_dpsic = ((PyArrayObject *)values[34]);
4203  __pyx_v_an = ((PyArrayObject *)values[35]);
4204  __pyx_v_dan_dpsiw = ((PyArrayObject *)values[36]);
4205  __pyx_v_dan_dpsic = ((PyArrayObject *)values[37]);
4206  }
4207  goto __pyx_L4_argument_unpacking_done;
4208  __pyx_L5_argtuple_error:;
4209  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_fc_pp_sd_het_matType", 1, 38, 38, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 723, __pyx_L3_error)
4210  __pyx_L3_error:;
4211  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_fc_pp_sd_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
4212  __Pyx_RefNannyFinishContext();
4213  return NULL;
4214  __pyx_L4_argument_unpacking_done:;
4215  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 726, __pyx_L1_error)
4216  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 727, __pyx_L1_error)
4217  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 728, __pyx_L1_error)
4218  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 731, __pyx_L1_error)
4219  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
4220  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
4221  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
4222  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 736, __pyx_L1_error)
4223  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 737, __pyx_L1_error)
4224  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 738, __pyx_L1_error)
4225  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 739, __pyx_L1_error)
4226  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 740, __pyx_L1_error)
4227  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 741, __pyx_L1_error)
4228  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psic), __pyx_ptype_5numpy_ndarray, 1, "psic", 0))) __PYX_ERR(0, 742, __pyx_L1_error)
4229  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 743, __pyx_L1_error)
4230  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mw), __pyx_ptype_5numpy_ndarray, 1, "mw", 0))) __PYX_ERR(0, 744, __pyx_L1_error)
4231  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dmw_dpsiw", 0))) __PYX_ERR(0, 745, __pyx_L1_error)
4232  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmw_dpsic), __pyx_ptype_5numpy_ndarray, 1, "dmw_dpsic", 0))) __PYX_ERR(0, 746, __pyx_L1_error)
4233  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mn), __pyx_ptype_5numpy_ndarray, 1, "mn", 0))) __PYX_ERR(0, 747, __pyx_L1_error)
4234  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmn_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dmn_dpsiw", 0))) __PYX_ERR(0, 748, __pyx_L1_error)
4235  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmn_dpsic), __pyx_ptype_5numpy_ndarray, 1, "dmn_dpsic", 0))) __PYX_ERR(0, 749, __pyx_L1_error)
4236  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_psiw), __pyx_ptype_5numpy_ndarray, 1, "phi_psiw", 0))) __PYX_ERR(0, 750, __pyx_L1_error)
4237  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psiw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psiw_dpsiw", 0))) __PYX_ERR(0, 751, __pyx_L1_error)
4238  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_psin), __pyx_ptype_5numpy_ndarray, 1, "phi_psin", 0))) __PYX_ERR(0, 752, __pyx_L1_error)
4239  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psin_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dphi_psin_dpsiw", 0))) __PYX_ERR(0, 753, __pyx_L1_error)
4240  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi_psin_dpsic), __pyx_ptype_5numpy_ndarray, 1, "dphi_psin_dpsic", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
4241  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aw), __pyx_ptype_5numpy_ndarray, 1, "aw", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
4242  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_daw_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "daw_dpsiw", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
4243  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_daw_dpsic), __pyx_ptype_5numpy_ndarray, 1, "daw_dpsic", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
4244  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_an), __pyx_ptype_5numpy_ndarray, 1, "an", 0))) __PYX_ERR(0, 758, __pyx_L1_error)
4245  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dan_dpsiw), __pyx_ptype_5numpy_ndarray, 1, "dan_dpsiw", 0))) __PYX_ERR(0, 759, __pyx_L1_error)
4246  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dan_dpsic), __pyx_ptype_5numpy_ndarray, 1, "dan_dpsic", 0))) __PYX_ERR(0, 760, __pyx_L1_error)
4247  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_4twophaseDarcy_fc_pp_sd_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_x, __pyx_v_psiw, __pyx_v_psic, __pyx_v_sw, __pyx_v_mw, __pyx_v_dmw_dpsiw, __pyx_v_dmw_dpsic, __pyx_v_mn, __pyx_v_dmn_dpsiw, __pyx_v_dmn_dpsic, __pyx_v_phi_psiw, __pyx_v_dphi_psiw_dpsiw, __pyx_v_phi_psin, __pyx_v_dphi_psin_dpsiw, __pyx_v_dphi_psin_dpsic, __pyx_v_aw, __pyx_v_daw_dpsiw, __pyx_v_daw_dpsic, __pyx_v_an, __pyx_v_dan_dpsiw, __pyx_v_dan_dpsic);
4248 
4249  /* function exit code */
4250  goto __pyx_L0;
4251  __pyx_L1_error:;
4252  __pyx_r = NULL;
4253  __pyx_L0:;
4254  __Pyx_RefNannyFinishContext();
4255  return __pyx_r;
4256 }
4257 
4258 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_4twophaseDarcy_fc_pp_sd_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, 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_iwork_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_x, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_psic, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_mw, PyArrayObject *__pyx_v_dmw_dpsiw, PyArrayObject *__pyx_v_dmw_dpsic, PyArrayObject *__pyx_v_mn, PyArrayObject *__pyx_v_dmn_dpsiw, PyArrayObject *__pyx_v_dmn_dpsic, PyArrayObject *__pyx_v_phi_psiw, PyArrayObject *__pyx_v_dphi_psiw_dpsiw, PyArrayObject *__pyx_v_phi_psin, PyArrayObject *__pyx_v_dphi_psin_dpsiw, PyArrayObject *__pyx_v_dphi_psin_dpsic, PyArrayObject *__pyx_v_aw, PyArrayObject *__pyx_v_daw_dpsiw, PyArrayObject *__pyx_v_daw_dpsic, PyArrayObject *__pyx_v_an, PyArrayObject *__pyx_v_dan_dpsiw, PyArrayObject *__pyx_v_dan_dpsic) {
4259  int __pyx_v_nPointsPerSimplex;
4260  int __pyx_v_nSimplex;
4261  PyObject *__pyx_r = NULL;
4262  __Pyx_RefNannyDeclarations
4263  PyObject *__pyx_t_1 = NULL;
4264  PyObject *__pyx_t_2 = NULL;
4265  PyObject *__pyx_t_3 = NULL;
4266  int __pyx_t_4;
4267  PyObject *__pyx_t_5 = NULL;
4268  PyObject *__pyx_t_6 = NULL;
4269  PyObject *__pyx_t_7 = NULL;
4270  int __pyx_lineno = 0;
4271  const char *__pyx_filename = NULL;
4272  int __pyx_clineno = 0;
4273  __Pyx_RefNannySetupContext("twophaseDarcy_fc_pp_sd_het_matType", 0);
4274 
4275  /* "cTwophaseDarcyCoefficients.pyx":766
4276  *
4277  * """
4278  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
4279  * cdef int nSimplex=sw.size/nPointsPerSimplex
4280  * #while debugging allow only one option
4281  */
4282  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
4283 
4284  /* "cTwophaseDarcyCoefficients.pyx":767
4285  * """
4286  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
4287  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
4288  * #while debugging allow only one option
4289  * #exponential for wetting phase
4290  */
4291  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
4292  __Pyx_GOTREF(__pyx_t_1);
4293  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
4294  __Pyx_GOTREF(__pyx_t_2);
4295  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
4296  __Pyx_GOTREF(__pyx_t_3);
4297  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4298  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4299  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 767, __pyx_L1_error)
4300  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4301  __pyx_v_nSimplex = __pyx_t_4;
4302 
4303  /* "cTwophaseDarcyCoefficients.pyx":770
4304  * #while debugging allow only one option
4305  * #exponential for wetting phase
4306  * assert density_w_flag == 1 # <<<<<<<<<<<<<<
4307  * if density_n_flag == 1: #nonwetting exponential
4308  * if pskModelFlag == 0:
4309  */
4310  #ifndef CYTHON_WITHOUT_ASSERTIONS
4311  if (unlikely(!Py_OptimizeFlag)) {
4312  if (unlikely(!((__pyx_v_density_w_flag == 1) != 0))) {
4313  PyErr_SetNone(PyExc_AssertionError);
4314  __PYX_ERR(0, 770, __pyx_L1_error)
4315  }
4316  }
4317  #endif
4318 
4319  /* "cTwophaseDarcyCoefficients.pyx":771
4320  * #exponential for wetting phase
4321  * assert density_w_flag == 1
4322  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
4323  * if pskModelFlag == 0:
4324  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
4325  */
4326  switch (__pyx_v_density_n_flag) {
4327  case 1:
4328 
4329  /* "cTwophaseDarcyCoefficients.pyx":772
4330  * assert density_w_flag == 1
4331  * if density_n_flag == 1: #nonwetting exponential
4332  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
4333  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
4334  * nPointsPerSimplex,
4335  */
4336  switch (__pyx_v_pskModelFlag) {
4337  case 0:
4338 
4339  /* "cTwophaseDarcyCoefficients.pyx":773
4340  * if density_n_flag == 1: #nonwetting exponential
4341  * if pskModelFlag == 0:
4342  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
4343  * nPointsPerSimplex,
4344  * g.shape[0],
4345  */
4346  (void)(twophaseDarcy_fc_pp_sd_het_matType<SimplePSK,ExponentialDensity,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psic->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_dmw_dpsic->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_dmn_dpsic->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dpsic->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_daw_dpsic->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan_dpsiw->data), ((double *)__pyx_v_dan_dpsic->data)));
4347 
4348  /* "cTwophaseDarcyCoefficients.pyx":772
4349  * assert density_w_flag == 1
4350  * if density_n_flag == 1: #nonwetting exponential
4351  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
4352  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
4353  * nPointsPerSimplex,
4354  */
4355  break;
4356  case 1:
4357 
4358  /* "cTwophaseDarcyCoefficients.pyx":813
4359  * <double*>(dan_dpsic.data))
4360  * elif pskModelFlag == 1:
4361  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[VGM,ExponentialDensity,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
4362  * nPointsPerSimplex,
4363  * g.shape[0],
4364  */
4365  (void)(twophaseDarcy_fc_pp_sd_het_matType<VGM,ExponentialDensity,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psic->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_dmw_dpsic->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_dmn_dpsic->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dpsic->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_daw_dpsic->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan_dpsiw->data), ((double *)__pyx_v_dan_dpsic->data)));
4366 
4367  /* "cTwophaseDarcyCoefficients.pyx":812
4368  * <double*>(dan_dpsiw.data),
4369  * <double*>(dan_dpsic.data))
4370  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
4371  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[VGM,ExponentialDensity,ExponentialDensity](nSimplex,
4372  * nPointsPerSimplex,
4373  */
4374  break;
4375  default:
4376 
4377  /* "cTwophaseDarcyCoefficients.pyx":853
4378  * <double*>(dan_dpsic.data))
4379  * else:
4380  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
4381  * nPointsPerSimplex,
4382  * g.shape[0],
4383  */
4384  (void)(twophaseDarcy_fc_pp_sd_het_matType<SimplePSK,ExponentialDensity,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psic->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_dmw_dpsic->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_dmn_dpsic->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dpsic->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_daw_dpsic->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan_dpsiw->data), ((double *)__pyx_v_dan_dpsic->data)));
4385  break;
4386  }
4387 
4388  /* "cTwophaseDarcyCoefficients.pyx":771
4389  * #exponential for wetting phase
4390  * assert density_w_flag == 1
4391  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
4392  * if pskModelFlag == 0:
4393  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,ExponentialDensity](nSimplex,
4394  */
4395  break;
4396  case 2:
4397 
4398  /* "cTwophaseDarcyCoefficients.pyx":893
4399  * <double*>(dan_dpsic.data))
4400  * elif density_n_flag == 2: #nonwetting IdealGas
4401  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
4402  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex,
4403  * nPointsPerSimplex,
4404  */
4405  switch (__pyx_v_pskModelFlag) {
4406  case 0:
4407 
4408  /* "cTwophaseDarcyCoefficients.pyx":894
4409  * elif density_n_flag == 2: #nonwetting IdealGas
4410  * if pskModelFlag == 0:
4411  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
4412  * nPointsPerSimplex,
4413  * g.shape[0],
4414  */
4415  (void)(twophaseDarcy_fc_pp_sd_het_matType<SimplePSK,ExponentialDensity,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psic->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_dmw_dpsic->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_dmn_dpsic->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dpsic->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_daw_dpsic->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan_dpsiw->data), ((double *)__pyx_v_dan_dpsic->data)));
4416 
4417  /* "cTwophaseDarcyCoefficients.pyx":893
4418  * <double*>(dan_dpsic.data))
4419  * elif density_n_flag == 2: #nonwetting IdealGas
4420  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
4421  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex,
4422  * nPointsPerSimplex,
4423  */
4424  break;
4425  case 1:
4426 
4427  /* "cTwophaseDarcyCoefficients.pyx":934
4428  * <double*>(dan_dpsic.data))
4429  * elif pskModelFlag == 1:
4430  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[VGM,ExponentialDensity,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
4431  * nPointsPerSimplex,
4432  * g.shape[0],
4433  */
4434  (void)(twophaseDarcy_fc_pp_sd_het_matType<VGM,ExponentialDensity,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psic->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_dmw_dpsic->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_dmn_dpsic->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dpsic->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_daw_dpsic->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan_dpsiw->data), ((double *)__pyx_v_dan_dpsic->data)));
4435 
4436  /* "cTwophaseDarcyCoefficients.pyx":933
4437  * <double*>(dan_dpsiw.data),
4438  * <double*>(dan_dpsic.data))
4439  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
4440  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[VGM,ExponentialDensity,IdealGasDensity](nSimplex,
4441  * nPointsPerSimplex,
4442  */
4443  break;
4444  default:
4445 
4446  /* "cTwophaseDarcyCoefficients.pyx":974
4447  * <double*>(dan_dpsic.data))
4448  * else:
4449  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
4450  * nPointsPerSimplex,
4451  * g.shape[0],
4452  */
4453  (void)(twophaseDarcy_fc_pp_sd_het_matType<SimplePSK,ExponentialDensity,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->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), ((int *)__pyx_v_iwork_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_x->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psic->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_mw->data), ((double *)__pyx_v_dmw_dpsiw->data), ((double *)__pyx_v_dmw_dpsic->data), ((double *)__pyx_v_mn->data), ((double *)__pyx_v_dmn_dpsiw->data), ((double *)__pyx_v_dmn_dpsic->data), ((double *)__pyx_v_phi_psiw->data), ((double *)__pyx_v_dphi_psiw_dpsiw->data), ((double *)__pyx_v_phi_psin->data), ((double *)__pyx_v_dphi_psin_dpsiw->data), ((double *)__pyx_v_dphi_psin_dpsic->data), ((double *)__pyx_v_aw->data), ((double *)__pyx_v_daw_dpsiw->data), ((double *)__pyx_v_daw_dpsic->data), ((double *)__pyx_v_an->data), ((double *)__pyx_v_dan_dpsiw->data), ((double *)__pyx_v_dan_dpsic->data)));
4454  break;
4455  }
4456 
4457  /* "cTwophaseDarcyCoefficients.pyx":892
4458  * <double*>(dan_dpsiw.data),
4459  * <double*>(dan_dpsic.data))
4460  * elif density_n_flag == 2: #nonwetting IdealGas # <<<<<<<<<<<<<<
4461  * if pskModelFlag == 0:
4462  * tpdc.twophaseDarcy_fc_pp_sd_het_matType[SimplePSK,ExponentialDensity,IdealGasDensity](nSimplex,
4463  */
4464  break;
4465  default:
4466 
4467  /* "cTwophaseDarcyCoefficients.pyx":1014
4468  * <double*>(dan_dpsic.data))
4469  * else:
4470  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag) # <<<<<<<<<<<<<<
4471  *
4472  * def twophaseDarcy_incompressible_split_sd_pressure_het_matType(int pskModelFlag,
4473  */
4474  #ifndef CYTHON_WITHOUT_ASSERTIONS
4475  if (unlikely(!Py_OptimizeFlag)) {
4476  if (unlikely(!0)) {
4477  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_configuration_density_w_flag_0_a, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
4478  __Pyx_GOTREF(__pyx_t_2);
4479  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_density_w_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
4480  __Pyx_GOTREF(__pyx_t_1);
4481  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_density_n_flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __pyx_L1_error)
4482  __Pyx_GOTREF(__pyx_t_5);
4483  __pyx_t_6 = NULL;
4484  __pyx_t_4 = 0;
4485  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4486  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
4487  if (likely(__pyx_t_6)) {
4488  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4489  __Pyx_INCREF(__pyx_t_6);
4490  __Pyx_INCREF(function);
4491  __Pyx_DECREF_SET(__pyx_t_2, function);
4492  __pyx_t_4 = 1;
4493  }
4494  }
4495  #if CYTHON_FAST_PYCALL
4496  if (PyFunction_Check(__pyx_t_2)) {
4497  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
4498  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error)
4499  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4500  __Pyx_GOTREF(__pyx_t_3);
4501  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4502  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4503  } else
4504  #endif
4505  #if CYTHON_FAST_PYCCALL
4506  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
4507  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
4508  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error)
4509  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4510  __Pyx_GOTREF(__pyx_t_3);
4511  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4512  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4513  } else
4514  #endif
4515  {
4516  __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1014, __pyx_L1_error)
4517  __Pyx_GOTREF(__pyx_t_7);
4518  if (__pyx_t_6) {
4519  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
4520  }
4521  __Pyx_GIVEREF(__pyx_t_1);
4522  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_1);
4523  __Pyx_GIVEREF(__pyx_t_5);
4524  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_5);
4525  __pyx_t_1 = 0;
4526  __pyx_t_5 = 0;
4527  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error)
4528  __Pyx_GOTREF(__pyx_t_3);
4529  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4530  }
4531  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4532  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
4533  __Pyx_GOTREF(__pyx_t_2);
4534  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4535  PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
4536  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4537  __PYX_ERR(0, 1014, __pyx_L1_error)
4538  }
4539  }
4540  #endif
4541  break;
4542  }
4543 
4544  /* "cTwophaseDarcyCoefficients.pyx":723
4545  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
4546  *
4547  * def twophaseDarcy_fc_pp_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
4548  * int density_w_flag,
4549  * int density_n_flag,
4550  */
4551 
4552  /* function exit code */
4553  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4554  goto __pyx_L0;
4555  __pyx_L1_error:;
4556  __Pyx_XDECREF(__pyx_t_1);
4557  __Pyx_XDECREF(__pyx_t_2);
4558  __Pyx_XDECREF(__pyx_t_3);
4559  __Pyx_XDECREF(__pyx_t_5);
4560  __Pyx_XDECREF(__pyx_t_6);
4561  __Pyx_XDECREF(__pyx_t_7);
4562  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_fc_pp_sd_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
4563  __pyx_r = NULL;
4564  __pyx_L0:;
4565  __Pyx_XGIVEREF(__pyx_r);
4566  __Pyx_RefNannyFinishContext();
4567  return __pyx_r;
4568 }
4569 
4570 /* "cTwophaseDarcyCoefficients.pyx":1016
4571  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
4572  *
4573  * def twophaseDarcy_incompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
4574  * np.ndarray rowptr,
4575  * np.ndarray colind,
4576  */
4577 
4578 /* Python wrapper */
4579 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_7twophaseDarcy_incompressible_split_sd_pressure_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4580 static char __pyx_doc_26cTwophaseDarcyCoefficients_6twophaseDarcy_incompressible_split_sd_pressure_het_matType[] = "Evaluate the pressure coefficients\n\nUse the split fractional flow formulation of incompressible, two-phase\nDarcy flow for a heterogeneous medium, sparse diffusion rep het\n\n ";
4581 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_7twophaseDarcy_incompressible_split_sd_pressure_het_matType = {"twophaseDarcy_incompressible_split_sd_pressure_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_7twophaseDarcy_incompressible_split_sd_pressure_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_6twophaseDarcy_incompressible_split_sd_pressure_het_matType};
4582 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_7twophaseDarcy_incompressible_split_sd_pressure_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4583  int __pyx_v_pskModelFlag;
4584  PyArrayObject *__pyx_v_rowptr = 0;
4585  PyArrayObject *__pyx_v_colind = 0;
4586  PyArrayObject *__pyx_v_matType = 0;
4587  double __pyx_v_muw;
4588  double __pyx_v_mun;
4589  PyArrayObject *__pyx_v_omega = 0;
4590  PyArrayObject *__pyx_v_Kbar = 0;
4591  double __pyx_v_b;
4592  PyArrayObject *__pyx_v_capillaryDiffusionScaling = 0;
4593  PyArrayObject *__pyx_v_rwork_psk = 0;
4594  PyArrayObject *__pyx_v_iwork_psk = 0;
4595  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
4596  PyArrayObject *__pyx_v_rwork_density_w = 0;
4597  PyArrayObject *__pyx_v_rwork_density_n = 0;
4598  PyArrayObject *__pyx_v_g = 0;
4599  PyArrayObject *__pyx_v_sw = 0;
4600  PyArrayObject *__pyx_v_grad_psic = 0;
4601  PyArrayObject *__pyx_v_f = 0;
4602  PyArrayObject *__pyx_v_a = 0;
4603  int __pyx_lineno = 0;
4604  const char *__pyx_filename = NULL;
4605  int __pyx_clineno = 0;
4606  PyObject *__pyx_r = 0;
4607  __Pyx_RefNannyDeclarations
4608  __Pyx_RefNannySetupContext("twophaseDarcy_incompressible_split_sd_pressure_het_matType (wrapper)", 0);
4609  {
4610  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_capillaryDiffusionScaling,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_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_sw,&__pyx_n_s_grad_psic,&__pyx_n_s_f,&__pyx_n_s_a,0};
4611  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4612  if (unlikely(__pyx_kwds)) {
4613  Py_ssize_t kw_args;
4614  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4615  switch (pos_args) {
4616  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4617  CYTHON_FALLTHROUGH;
4618  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4619  CYTHON_FALLTHROUGH;
4620  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4621  CYTHON_FALLTHROUGH;
4622  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4623  CYTHON_FALLTHROUGH;
4624  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4625  CYTHON_FALLTHROUGH;
4626  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4627  CYTHON_FALLTHROUGH;
4628  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4629  CYTHON_FALLTHROUGH;
4630  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4631  CYTHON_FALLTHROUGH;
4632  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4633  CYTHON_FALLTHROUGH;
4634  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4635  CYTHON_FALLTHROUGH;
4636  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4637  CYTHON_FALLTHROUGH;
4638  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4639  CYTHON_FALLTHROUGH;
4640  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4641  CYTHON_FALLTHROUGH;
4642  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4643  CYTHON_FALLTHROUGH;
4644  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4645  CYTHON_FALLTHROUGH;
4646  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4647  CYTHON_FALLTHROUGH;
4648  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4649  CYTHON_FALLTHROUGH;
4650  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4651  CYTHON_FALLTHROUGH;
4652  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4653  CYTHON_FALLTHROUGH;
4654  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4655  CYTHON_FALLTHROUGH;
4656  case 0: break;
4657  default: goto __pyx_L5_argtuple_error;
4658  }
4659  kw_args = PyDict_Size(__pyx_kwds);
4660  switch (pos_args) {
4661  case 0:
4662  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
4663  else goto __pyx_L5_argtuple_error;
4664  CYTHON_FALLTHROUGH;
4665  case 1:
4666  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4667  else {
4668  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 1); __PYX_ERR(0, 1016, __pyx_L3_error)
4669  }
4670  CYTHON_FALLTHROUGH;
4671  case 2:
4672  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4673  else {
4674  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 2); __PYX_ERR(0, 1016, __pyx_L3_error)
4675  }
4676  CYTHON_FALLTHROUGH;
4677  case 3:
4678  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
4679  else {
4680  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 3); __PYX_ERR(0, 1016, __pyx_L3_error)
4681  }
4682  CYTHON_FALLTHROUGH;
4683  case 4:
4684  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
4685  else {
4686  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 4); __PYX_ERR(0, 1016, __pyx_L3_error)
4687  }
4688  CYTHON_FALLTHROUGH;
4689  case 5:
4690  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
4691  else {
4692  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 5); __PYX_ERR(0, 1016, __pyx_L3_error)
4693  }
4694  CYTHON_FALLTHROUGH;
4695  case 6:
4696  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
4697  else {
4698  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 6); __PYX_ERR(0, 1016, __pyx_L3_error)
4699  }
4700  CYTHON_FALLTHROUGH;
4701  case 7:
4702  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
4703  else {
4704  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 7); __PYX_ERR(0, 1016, __pyx_L3_error)
4705  }
4706  CYTHON_FALLTHROUGH;
4707  case 8:
4708  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
4709  else {
4710  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 8); __PYX_ERR(0, 1016, __pyx_L3_error)
4711  }
4712  CYTHON_FALLTHROUGH;
4713  case 9:
4714  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
4715  else {
4716  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 9); __PYX_ERR(0, 1016, __pyx_L3_error)
4717  }
4718  CYTHON_FALLTHROUGH;
4719  case 10:
4720  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
4721  else {
4722  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 10); __PYX_ERR(0, 1016, __pyx_L3_error)
4723  }
4724  CYTHON_FALLTHROUGH;
4725  case 11:
4726  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
4727  else {
4728  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 11); __PYX_ERR(0, 1016, __pyx_L3_error)
4729  }
4730  CYTHON_FALLTHROUGH;
4731  case 12:
4732  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
4733  else {
4734  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 12); __PYX_ERR(0, 1016, __pyx_L3_error)
4735  }
4736  CYTHON_FALLTHROUGH;
4737  case 13:
4738  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
4739  else {
4740  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 13); __PYX_ERR(0, 1016, __pyx_L3_error)
4741  }
4742  CYTHON_FALLTHROUGH;
4743  case 14:
4744  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
4745  else {
4746  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 14); __PYX_ERR(0, 1016, __pyx_L3_error)
4747  }
4748  CYTHON_FALLTHROUGH;
4749  case 15:
4750  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
4751  else {
4752  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 15); __PYX_ERR(0, 1016, __pyx_L3_error)
4753  }
4754  CYTHON_FALLTHROUGH;
4755  case 16:
4756  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
4757  else {
4758  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 16); __PYX_ERR(0, 1016, __pyx_L3_error)
4759  }
4760  CYTHON_FALLTHROUGH;
4761  case 17:
4762  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_psic)) != 0)) kw_args--;
4763  else {
4764  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 17); __PYX_ERR(0, 1016, __pyx_L3_error)
4765  }
4766  CYTHON_FALLTHROUGH;
4767  case 18:
4768  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
4769  else {
4770  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 18); __PYX_ERR(0, 1016, __pyx_L3_error)
4771  }
4772  CYTHON_FALLTHROUGH;
4773  case 19:
4774  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
4775  else {
4776  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, 19); __PYX_ERR(0, 1016, __pyx_L3_error)
4777  }
4778  }
4779  if (unlikely(kw_args > 0)) {
4780  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_incompressible_split_sd_pressure_het_matType") < 0)) __PYX_ERR(0, 1016, __pyx_L3_error)
4781  }
4782  } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
4783  goto __pyx_L5_argtuple_error;
4784  } else {
4785  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4786  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4787  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4788  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4789  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4790  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4791  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4792  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4793  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4794  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4795  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4796  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4797  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4798  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4799  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4800  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4801  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4802  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4803  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4804  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4805  }
4806  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1016, __pyx_L3_error)
4807  __pyx_v_rowptr = ((PyArrayObject *)values[1]);
4808  __pyx_v_colind = ((PyArrayObject *)values[2]);
4809  __pyx_v_matType = ((PyArrayObject *)values[3]);
4810  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1020, __pyx_L3_error)
4811  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error)
4812  __pyx_v_omega = ((PyArrayObject *)values[6]);
4813  __pyx_v_Kbar = ((PyArrayObject *)values[7]);
4814  __pyx_v_b = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L3_error)
4815  __pyx_v_capillaryDiffusionScaling = ((PyArrayObject *)values[9]);
4816  __pyx_v_rwork_psk = ((PyArrayObject *)values[10]);
4817  __pyx_v_iwork_psk = ((PyArrayObject *)values[11]);
4818  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[12]);
4819  __pyx_v_rwork_density_w = ((PyArrayObject *)values[13]);
4820  __pyx_v_rwork_density_n = ((PyArrayObject *)values[14]);
4821  __pyx_v_g = ((PyArrayObject *)values[15]);
4822  __pyx_v_sw = ((PyArrayObject *)values[16]);
4823  __pyx_v_grad_psic = ((PyArrayObject *)values[17]);
4824  __pyx_v_f = ((PyArrayObject *)values[18]);
4825  __pyx_v_a = ((PyArrayObject *)values[19]);
4826  }
4827  goto __pyx_L4_argument_unpacking_done;
4828  __pyx_L5_argtuple_error:;
4829  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1016, __pyx_L3_error)
4830  __pyx_L3_error:;
4831  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_incompressible_split_sd_pressure_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
4832  __Pyx_RefNannyFinishContext();
4833  return NULL;
4834  __pyx_L4_argument_unpacking_done:;
4835  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1017, __pyx_L1_error)
4836  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1018, __pyx_L1_error)
4837  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1019, __pyx_L1_error)
4838  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1022, __pyx_L1_error)
4839  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 1023, __pyx_L1_error)
4840  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_capillaryDiffusionScaling), __pyx_ptype_5numpy_ndarray, 1, "capillaryDiffusionScaling", 0))) __PYX_ERR(0, 1025, __pyx_L1_error)
4841  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1026, __pyx_L1_error)
4842  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1027, __pyx_L1_error)
4843  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1028, __pyx_L1_error)
4844  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 1029, __pyx_L1_error)
4845  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 1030, __pyx_L1_error)
4846  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 1031, __pyx_L1_error)
4847  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1032, __pyx_L1_error)
4848  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_psic), __pyx_ptype_5numpy_ndarray, 1, "grad_psic", 0))) __PYX_ERR(0, 1033, __pyx_L1_error)
4849  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1034, __pyx_L1_error)
4850  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
4851  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_6twophaseDarcy_incompressible_split_sd_pressure_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_sw, __pyx_v_grad_psic, __pyx_v_f, __pyx_v_a);
4852 
4853  /* function exit code */
4854  goto __pyx_L0;
4855  __pyx_L1_error:;
4856  __pyx_r = NULL;
4857  __pyx_L0:;
4858  __Pyx_RefNannyFinishContext();
4859  return __pyx_r;
4860 }
4861 
4862 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_6twophaseDarcy_incompressible_split_sd_pressure_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, PyArrayObject *__pyx_v_capillaryDiffusionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_sw, PyArrayObject *__pyx_v_grad_psic, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a) {
4863  int __pyx_v_nPointsPerSimplex;
4864  int __pyx_v_nSimplex;
4865  PyObject *__pyx_r = NULL;
4866  __Pyx_RefNannyDeclarations
4867  PyObject *__pyx_t_1 = NULL;
4868  PyObject *__pyx_t_2 = NULL;
4869  PyObject *__pyx_t_3 = NULL;
4870  int __pyx_t_4;
4871  double __pyx_t_5;
4872  int __pyx_lineno = 0;
4873  const char *__pyx_filename = NULL;
4874  int __pyx_clineno = 0;
4875  __Pyx_RefNannySetupContext("twophaseDarcy_incompressible_split_sd_pressure_het_matType", 0);
4876 
4877  /* "cTwophaseDarcyCoefficients.pyx":1042
4878  *
4879  * """
4880  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
4881  * cdef int nSimplex=sw.size/nPointsPerSimplex
4882  * if pskModelFlag == 0:
4883  */
4884  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
4885 
4886  /* "cTwophaseDarcyCoefficients.pyx":1043
4887  * """
4888  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
4889  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
4890  * if pskModelFlag == 0:
4891  * tpdc.twophaseDarcy_incompressible_split_sd_pressure_het_matType[SimplePSK](nSimplex,
4892  */
4893  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error)
4894  __Pyx_GOTREF(__pyx_t_1);
4895  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
4896  __Pyx_GOTREF(__pyx_t_2);
4897  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1043, __pyx_L1_error)
4898  __Pyx_GOTREF(__pyx_t_3);
4899  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4900  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4901  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1043, __pyx_L1_error)
4902  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4903  __pyx_v_nSimplex = __pyx_t_4;
4904 
4905  /* "cTwophaseDarcyCoefficients.pyx":1044
4906  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
4907  * cdef int nSimplex=sw.size/nPointsPerSimplex
4908  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
4909  * tpdc.twophaseDarcy_incompressible_split_sd_pressure_het_matType[SimplePSK](nSimplex,
4910  * nPointsPerSimplex,
4911  */
4912  switch (__pyx_v_pskModelFlag) {
4913  case 0:
4914 
4915  /* "cTwophaseDarcyCoefficients.pyx":1057
4916  * <double*>(Kbar.data),
4917  * b,
4918  * capillaryDiffusionScaling, # <<<<<<<<<<<<<<
4919  * <double*>(rwork_psk.data),
4920  * <int*>(iwork_psk.data),
4921  */
4922  __pyx_t_5 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_capillaryDiffusionScaling)); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1057, __pyx_L1_error)
4923 
4924  /* "cTwophaseDarcyCoefficients.pyx":1045
4925  * cdef int nSimplex=sw.size/nPointsPerSimplex
4926  * if pskModelFlag == 0:
4927  * tpdc.twophaseDarcy_incompressible_split_sd_pressure_het_matType[SimplePSK](nSimplex, # <<<<<<<<<<<<<<
4928  * nPointsPerSimplex,
4929  * g.shape[0],
4930  */
4931  (void)(twophaseDarcy_incompressible_split_sd_pressure_het_matType<SimplePSK>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_t_5, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
4932 
4933  /* "cTwophaseDarcyCoefficients.pyx":1044
4934  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
4935  * cdef int nSimplex=sw.size/nPointsPerSimplex
4936  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
4937  * tpdc.twophaseDarcy_incompressible_split_sd_pressure_het_matType[SimplePSK](nSimplex,
4938  * nPointsPerSimplex,
4939  */
4940  break;
4941  case 1:
4942 
4943  /* "cTwophaseDarcyCoefficients.pyx":1080
4944  * <double*>(Kbar.data),
4945  * b,
4946  * capillaryDiffusionScaling, # <<<<<<<<<<<<<<
4947  * <double*>(rwork_psk.data),
4948  * <int*>(iwork_psk.data),
4949  */
4950  __pyx_t_5 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_capillaryDiffusionScaling)); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error)
4951 
4952  /* "cTwophaseDarcyCoefficients.pyx":1068
4953  * <double*>(a.data))
4954  * elif pskModelFlag == 1:
4955  * tpdc.twophaseDarcy_incompressible_split_sd_pressure_het_matType[VGM](nSimplex, # <<<<<<<<<<<<<<
4956  * nPointsPerSimplex,
4957  * g.shape[0],
4958  */
4959  (void)(twophaseDarcy_incompressible_split_sd_pressure_het_matType<VGM>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_t_5, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
4960 
4961  /* "cTwophaseDarcyCoefficients.pyx":1067
4962  * <double*>(f.data),
4963  * <double*>(a.data))
4964  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
4965  * tpdc.twophaseDarcy_incompressible_split_sd_pressure_het_matType[VGM](nSimplex,
4966  * nPointsPerSimplex,
4967  */
4968  break;
4969  default:
4970 
4971  /* "cTwophaseDarcyCoefficients.pyx":1104
4972  * <double*>(Kbar.data),
4973  * b,
4974  * capillaryDiffusionScaling, # <<<<<<<<<<<<<<
4975  * <double*>(rwork_psk.data),
4976  * <int*>(iwork_psk.data),
4977  */
4978  __pyx_t_5 = __pyx_PyFloat_AsDouble(((PyObject *)__pyx_v_capillaryDiffusionScaling)); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1104, __pyx_L1_error)
4979 
4980  /* "cTwophaseDarcyCoefficients.pyx":1092
4981  * <double*>(a.data))
4982  * else:
4983  * tpdc.twophaseDarcy_incompressible_split_sd_pressure_het_matType[SimplePSK](nSimplex, # <<<<<<<<<<<<<<
4984  * nPointsPerSimplex,
4985  * g.shape[0],
4986  */
4987  (void)(twophaseDarcy_incompressible_split_sd_pressure_het_matType<SimplePSK>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_t_5, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
4988  break;
4989  }
4990 
4991  /* "cTwophaseDarcyCoefficients.pyx":1016
4992  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
4993  *
4994  * def twophaseDarcy_incompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
4995  * np.ndarray rowptr,
4996  * np.ndarray colind,
4997  */
4998 
4999  /* function exit code */
5000  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5001  goto __pyx_L0;
5002  __pyx_L1_error:;
5003  __Pyx_XDECREF(__pyx_t_1);
5004  __Pyx_XDECREF(__pyx_t_2);
5005  __Pyx_XDECREF(__pyx_t_3);
5006  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_incompressible_split_sd_pressure_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
5007  __pyx_r = NULL;
5008  __pyx_L0:;
5009  __Pyx_XGIVEREF(__pyx_r);
5010  __Pyx_RefNannyFinishContext();
5011  return __pyx_r;
5012 }
5013 
5014 /* "cTwophaseDarcyCoefficients.pyx":1116
5015  * <double*>(a.data))
5016  *
5017  * def twophaseDarcy_incompressible_split_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
5018  * int density_w_flag,
5019  * int density_n_flag,
5020  */
5021 
5022 /* Python wrapper */
5023 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_9twophaseDarcy_incompressible_split_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5024 static char __pyx_doc_26cTwophaseDarcyCoefficients_8twophaseDarcy_incompressible_split_sd_saturation_het_matType[] = "Evaluate the saturation coefficients\n\nUse the split fractional flow formulation of incompressible, two-phase\nDarcy flow for a heterogeneous medium, sparse diffusion rep het\n ";
5025 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_9twophaseDarcy_incompressible_split_sd_saturation_het_matType = {"twophaseDarcy_incompressible_split_sd_saturation_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_9twophaseDarcy_incompressible_split_sd_saturation_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_8twophaseDarcy_incompressible_split_sd_saturation_het_matType};
5026 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_9twophaseDarcy_incompressible_split_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5027  int __pyx_v_pskModelFlag;
5028  int __pyx_v_density_w_flag;
5029  CYTHON_UNUSED int __pyx_v_density_n_flag;
5030  PyArrayObject *__pyx_v_rowptr = 0;
5031  PyArrayObject *__pyx_v_colind = 0;
5032  PyArrayObject *__pyx_v_matType = 0;
5033  double __pyx_v_muw;
5034  double __pyx_v_mun;
5035  PyArrayObject *__pyx_v_omega = 0;
5036  PyArrayObject *__pyx_v_Kbar = 0;
5037  double __pyx_v_b;
5038  double __pyx_v_capillaryDiffusionScaling;
5039  double __pyx_v_advectionScaling;
5040  PyArrayObject *__pyx_v_rwork_psk = 0;
5041  PyArrayObject *__pyx_v_iwork_psk = 0;
5042  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
5043  PyArrayObject *__pyx_v_rwork_density_w = 0;
5044  PyArrayObject *__pyx_v_rwork_density_n = 0;
5045  PyArrayObject *__pyx_v_g = 0;
5046  PyArrayObject *__pyx_v_qt = 0;
5047  PyArrayObject *__pyx_v_psiw = 0;
5048  PyArrayObject *__pyx_v_sw = 0;
5049  PyArrayObject *__pyx_v_m = 0;
5050  PyArrayObject *__pyx_v_dm = 0;
5051  PyArrayObject *__pyx_v_phi = 0;
5052  PyArrayObject *__pyx_v_dphi = 0;
5053  PyArrayObject *__pyx_v_f = 0;
5054  PyArrayObject *__pyx_v_df = 0;
5055  PyArrayObject *__pyx_v_a = 0;
5056  PyArrayObject *__pyx_v_da = 0;
5057  int __pyx_lineno = 0;
5058  const char *__pyx_filename = NULL;
5059  int __pyx_clineno = 0;
5060  PyObject *__pyx_r = 0;
5061  __Pyx_RefNannyDeclarations
5062  __Pyx_RefNannySetupContext("twophaseDarcy_incompressible_split_sd_saturation_het_matType (wrapper)", 0);
5063  {
5064  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_capillaryDiffusionScaling,&__pyx_n_s_advectionScaling,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_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_qt,&__pyx_n_s_psiw,&__pyx_n_s_sw,&__pyx_n_s_m,&__pyx_n_s_dm,&__pyx_n_s_phi,&__pyx_n_s_dphi,&__pyx_n_s_f,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,0};
5065  PyObject* values[30] = {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};
5066  if (unlikely(__pyx_kwds)) {
5067  Py_ssize_t kw_args;
5068  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5069  switch (pos_args) {
5070  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
5071  CYTHON_FALLTHROUGH;
5072  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
5073  CYTHON_FALLTHROUGH;
5074  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5075  CYTHON_FALLTHROUGH;
5076  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5077  CYTHON_FALLTHROUGH;
5078  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5079  CYTHON_FALLTHROUGH;
5080  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5081  CYTHON_FALLTHROUGH;
5082  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5083  CYTHON_FALLTHROUGH;
5084  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5085  CYTHON_FALLTHROUGH;
5086  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5087  CYTHON_FALLTHROUGH;
5088  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5089  CYTHON_FALLTHROUGH;
5090  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5091  CYTHON_FALLTHROUGH;
5092  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5093  CYTHON_FALLTHROUGH;
5094  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5095  CYTHON_FALLTHROUGH;
5096  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5097  CYTHON_FALLTHROUGH;
5098  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5099  CYTHON_FALLTHROUGH;
5100  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5101  CYTHON_FALLTHROUGH;
5102  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5103  CYTHON_FALLTHROUGH;
5104  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5105  CYTHON_FALLTHROUGH;
5106  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5107  CYTHON_FALLTHROUGH;
5108  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5109  CYTHON_FALLTHROUGH;
5110  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5111  CYTHON_FALLTHROUGH;
5112  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5113  CYTHON_FALLTHROUGH;
5114  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5115  CYTHON_FALLTHROUGH;
5116  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5117  CYTHON_FALLTHROUGH;
5118  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5119  CYTHON_FALLTHROUGH;
5120  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5121  CYTHON_FALLTHROUGH;
5122  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5123  CYTHON_FALLTHROUGH;
5124  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5125  CYTHON_FALLTHROUGH;
5126  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5127  CYTHON_FALLTHROUGH;
5128  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5129  CYTHON_FALLTHROUGH;
5130  case 0: break;
5131  default: goto __pyx_L5_argtuple_error;
5132  }
5133  kw_args = PyDict_Size(__pyx_kwds);
5134  switch (pos_args) {
5135  case 0:
5136  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
5137  else goto __pyx_L5_argtuple_error;
5138  CYTHON_FALLTHROUGH;
5139  case 1:
5140  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
5141  else {
5142  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 1); __PYX_ERR(0, 1116, __pyx_L3_error)
5143  }
5144  CYTHON_FALLTHROUGH;
5145  case 2:
5146  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
5147  else {
5148  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 2); __PYX_ERR(0, 1116, __pyx_L3_error)
5149  }
5150  CYTHON_FALLTHROUGH;
5151  case 3:
5152  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
5153  else {
5154  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 3); __PYX_ERR(0, 1116, __pyx_L3_error)
5155  }
5156  CYTHON_FALLTHROUGH;
5157  case 4:
5158  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
5159  else {
5160  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 4); __PYX_ERR(0, 1116, __pyx_L3_error)
5161  }
5162  CYTHON_FALLTHROUGH;
5163  case 5:
5164  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
5165  else {
5166  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 5); __PYX_ERR(0, 1116, __pyx_L3_error)
5167  }
5168  CYTHON_FALLTHROUGH;
5169  case 6:
5170  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
5171  else {
5172  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 6); __PYX_ERR(0, 1116, __pyx_L3_error)
5173  }
5174  CYTHON_FALLTHROUGH;
5175  case 7:
5176  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
5177  else {
5178  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 7); __PYX_ERR(0, 1116, __pyx_L3_error)
5179  }
5180  CYTHON_FALLTHROUGH;
5181  case 8:
5182  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
5183  else {
5184  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 8); __PYX_ERR(0, 1116, __pyx_L3_error)
5185  }
5186  CYTHON_FALLTHROUGH;
5187  case 9:
5188  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
5189  else {
5190  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 9); __PYX_ERR(0, 1116, __pyx_L3_error)
5191  }
5192  CYTHON_FALLTHROUGH;
5193  case 10:
5194  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
5195  else {
5196  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 10); __PYX_ERR(0, 1116, __pyx_L3_error)
5197  }
5198  CYTHON_FALLTHROUGH;
5199  case 11:
5200  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
5201  else {
5202  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 11); __PYX_ERR(0, 1116, __pyx_L3_error)
5203  }
5204  CYTHON_FALLTHROUGH;
5205  case 12:
5206  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_advectionScaling)) != 0)) kw_args--;
5207  else {
5208  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 12); __PYX_ERR(0, 1116, __pyx_L3_error)
5209  }
5210  CYTHON_FALLTHROUGH;
5211  case 13:
5212  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
5213  else {
5214  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 13); __PYX_ERR(0, 1116, __pyx_L3_error)
5215  }
5216  CYTHON_FALLTHROUGH;
5217  case 14:
5218  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
5219  else {
5220  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 14); __PYX_ERR(0, 1116, __pyx_L3_error)
5221  }
5222  CYTHON_FALLTHROUGH;
5223  case 15:
5224  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
5225  else {
5226  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 15); __PYX_ERR(0, 1116, __pyx_L3_error)
5227  }
5228  CYTHON_FALLTHROUGH;
5229  case 16:
5230  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
5231  else {
5232  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 16); __PYX_ERR(0, 1116, __pyx_L3_error)
5233  }
5234  CYTHON_FALLTHROUGH;
5235  case 17:
5236  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
5237  else {
5238  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 17); __PYX_ERR(0, 1116, __pyx_L3_error)
5239  }
5240  CYTHON_FALLTHROUGH;
5241  case 18:
5242  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
5243  else {
5244  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 18); __PYX_ERR(0, 1116, __pyx_L3_error)
5245  }
5246  CYTHON_FALLTHROUGH;
5247  case 19:
5248  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qt)) != 0)) kw_args--;
5249  else {
5250  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 19); __PYX_ERR(0, 1116, __pyx_L3_error)
5251  }
5252  CYTHON_FALLTHROUGH;
5253  case 20:
5254  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
5255  else {
5256  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 20); __PYX_ERR(0, 1116, __pyx_L3_error)
5257  }
5258  CYTHON_FALLTHROUGH;
5259  case 21:
5260  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
5261  else {
5262  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 21); __PYX_ERR(0, 1116, __pyx_L3_error)
5263  }
5264  CYTHON_FALLTHROUGH;
5265  case 22:
5266  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
5267  else {
5268  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 22); __PYX_ERR(0, 1116, __pyx_L3_error)
5269  }
5270  CYTHON_FALLTHROUGH;
5271  case 23:
5272  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
5273  else {
5274  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 23); __PYX_ERR(0, 1116, __pyx_L3_error)
5275  }
5276  CYTHON_FALLTHROUGH;
5277  case 24:
5278  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
5279  else {
5280  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 24); __PYX_ERR(0, 1116, __pyx_L3_error)
5281  }
5282  CYTHON_FALLTHROUGH;
5283  case 25:
5284  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
5285  else {
5286  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 25); __PYX_ERR(0, 1116, __pyx_L3_error)
5287  }
5288  CYTHON_FALLTHROUGH;
5289  case 26:
5290  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
5291  else {
5292  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 26); __PYX_ERR(0, 1116, __pyx_L3_error)
5293  }
5294  CYTHON_FALLTHROUGH;
5295  case 27:
5296  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
5297  else {
5298  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 27); __PYX_ERR(0, 1116, __pyx_L3_error)
5299  }
5300  CYTHON_FALLTHROUGH;
5301  case 28:
5302  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5303  else {
5304  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 28); __PYX_ERR(0, 1116, __pyx_L3_error)
5305  }
5306  CYTHON_FALLTHROUGH;
5307  case 29:
5308  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
5309  else {
5310  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, 29); __PYX_ERR(0, 1116, __pyx_L3_error)
5311  }
5312  }
5313  if (unlikely(kw_args > 0)) {
5314  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_incompressible_split_sd_saturation_het_matType") < 0)) __PYX_ERR(0, 1116, __pyx_L3_error)
5315  }
5316  } else if (PyTuple_GET_SIZE(__pyx_args) != 30) {
5317  goto __pyx_L5_argtuple_error;
5318  } else {
5319  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5320  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5321  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5322  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5323  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5324  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5325  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5326  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5327  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5328  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5329  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5330  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5331  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5332  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5333  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5334  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5335  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5336  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5337  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5338  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5339  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5340  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5341  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5342  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5343  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5344  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5345  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5346  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5347  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
5348  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
5349  }
5350  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L3_error)
5351  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L3_error)
5352  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L3_error)
5353  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
5354  __pyx_v_colind = ((PyArrayObject *)values[4]);
5355  __pyx_v_matType = ((PyArrayObject *)values[5]);
5356  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L3_error)
5357  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1123, __pyx_L3_error)
5358  __pyx_v_omega = ((PyArrayObject *)values[8]);
5359  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
5360  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L3_error)
5361  __pyx_v_capillaryDiffusionScaling = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_capillaryDiffusionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L3_error)
5362  __pyx_v_advectionScaling = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_advectionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L3_error)
5363  __pyx_v_rwork_psk = ((PyArrayObject *)values[13]);
5364  __pyx_v_iwork_psk = ((PyArrayObject *)values[14]);
5365  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[15]);
5366  __pyx_v_rwork_density_w = ((PyArrayObject *)values[16]);
5367  __pyx_v_rwork_density_n = ((PyArrayObject *)values[17]);
5368  __pyx_v_g = ((PyArrayObject *)values[18]);
5369  __pyx_v_qt = ((PyArrayObject *)values[19]);
5370  __pyx_v_psiw = ((PyArrayObject *)values[20]);
5371  __pyx_v_sw = ((PyArrayObject *)values[21]);
5372  __pyx_v_m = ((PyArrayObject *)values[22]);
5373  __pyx_v_dm = ((PyArrayObject *)values[23]);
5374  __pyx_v_phi = ((PyArrayObject *)values[24]);
5375  __pyx_v_dphi = ((PyArrayObject *)values[25]);
5376  __pyx_v_f = ((PyArrayObject *)values[26]);
5377  __pyx_v_df = ((PyArrayObject *)values[27]);
5378  __pyx_v_a = ((PyArrayObject *)values[28]);
5379  __pyx_v_da = ((PyArrayObject *)values[29]);
5380  }
5381  goto __pyx_L4_argument_unpacking_done;
5382  __pyx_L5_argtuple_error:;
5383  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 1, 30, 30, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1116, __pyx_L3_error)
5384  __pyx_L3_error:;
5385  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_incompressible_split_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
5386  __Pyx_RefNannyFinishContext();
5387  return NULL;
5388  __pyx_L4_argument_unpacking_done:;
5389  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1119, __pyx_L1_error)
5390  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1120, __pyx_L1_error)
5391  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1121, __pyx_L1_error)
5392  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1124, __pyx_L1_error)
5393  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 1125, __pyx_L1_error)
5394  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1129, __pyx_L1_error)
5395  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1130, __pyx_L1_error)
5396  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1131, __pyx_L1_error)
5397  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 1132, __pyx_L1_error)
5398  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 1133, __pyx_L1_error)
5399  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 1134, __pyx_L1_error)
5400  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qt), __pyx_ptype_5numpy_ndarray, 1, "qt", 0))) __PYX_ERR(0, 1135, __pyx_L1_error)
5401  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 1136, __pyx_L1_error)
5402  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1137, __pyx_L1_error)
5403  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 1138, __pyx_L1_error)
5404  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1139, __pyx_L1_error)
5405  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi), __pyx_ptype_5numpy_ndarray, 1, "phi", 0))) __PYX_ERR(0, 1140, __pyx_L1_error)
5406  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 1141, __pyx_L1_error)
5407  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1142, __pyx_L1_error)
5408  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
5409  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1144, __pyx_L1_error)
5410  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 1145, __pyx_L1_error)
5411  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_8twophaseDarcy_incompressible_split_sd_saturation_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_qt, __pyx_v_psiw, __pyx_v_sw, __pyx_v_m, __pyx_v_dm, __pyx_v_phi, __pyx_v_dphi, __pyx_v_f, __pyx_v_df, __pyx_v_a, __pyx_v_da);
5412 
5413  /* function exit code */
5414  goto __pyx_L0;
5415  __pyx_L1_error:;
5416  __pyx_r = NULL;
5417  __pyx_L0:;
5418  __Pyx_RefNannyFinishContext();
5419  return __pyx_r;
5420 }
5421 
5422 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_8twophaseDarcy_incompressible_split_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, CYTHON_UNUSED int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da) {
5423  int __pyx_v_nPointsPerSimplex;
5424  int __pyx_v_nSimplex;
5425  PyObject *__pyx_r = NULL;
5426  __Pyx_RefNannyDeclarations
5427  PyObject *__pyx_t_1 = NULL;
5428  PyObject *__pyx_t_2 = NULL;
5429  PyObject *__pyx_t_3 = NULL;
5430  int __pyx_t_4;
5431  int __pyx_lineno = 0;
5432  const char *__pyx_filename = NULL;
5433  int __pyx_clineno = 0;
5434  __Pyx_RefNannySetupContext("twophaseDarcy_incompressible_split_sd_saturation_het_matType", 0);
5435 
5436  /* "cTwophaseDarcyCoefficients.pyx":1151
5437  * Darcy flow for a heterogeneous medium, sparse diffusion rep het
5438  * """
5439  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
5440  * cdef int nSimplex=sw.size/nPointsPerSimplex
5441  * #while debugging allow only one option
5442  */
5443  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
5444 
5445  /* "cTwophaseDarcyCoefficients.pyx":1152
5446  * """
5447  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
5448  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
5449  * #while debugging allow only one option
5450  * #exponential for wetting phase
5451  */
5452  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
5453  __Pyx_GOTREF(__pyx_t_1);
5454  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error)
5455  __Pyx_GOTREF(__pyx_t_2);
5456  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1152, __pyx_L1_error)
5457  __Pyx_GOTREF(__pyx_t_3);
5458  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5459  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5460  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1152, __pyx_L1_error)
5461  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5462  __pyx_v_nSimplex = __pyx_t_4;
5463 
5464  /* "cTwophaseDarcyCoefficients.pyx":1155
5465  * #while debugging allow only one option
5466  * #exponential for wetting phase
5467  * assert density_w_flag == 1 # <<<<<<<<<<<<<<
5468  * #for slight compressible, non-wetting phase density psk doesn't matter
5469  * if pskModelFlag == 0:
5470  */
5471  #ifndef CYTHON_WITHOUT_ASSERTIONS
5472  if (unlikely(!Py_OptimizeFlag)) {
5473  if (unlikely(!((__pyx_v_density_w_flag == 1) != 0))) {
5474  PyErr_SetNone(PyExc_AssertionError);
5475  __PYX_ERR(0, 1155, __pyx_L1_error)
5476  }
5477  }
5478  #endif
5479 
5480  /* "cTwophaseDarcyCoefficients.pyx":1157
5481  * assert density_w_flag == 1
5482  * #for slight compressible, non-wetting phase density psk doesn't matter
5483  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
5484  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
5485  * nPointsPerSimplex,
5486  */
5487  switch (__pyx_v_pskModelFlag) {
5488  case 0:
5489 
5490  /* "cTwophaseDarcyCoefficients.pyx":1158
5491  * #for slight compressible, non-wetting phase density psk doesn't matter
5492  * if pskModelFlag == 0:
5493  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
5494  * nPointsPerSimplex,
5495  * g.shape[0],
5496  */
5497  (void)(twophaseDarcy_slightCompressible_split_sd_saturation_het_matType<SimplePSK,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
5498 
5499  /* "cTwophaseDarcyCoefficients.pyx":1157
5500  * assert density_w_flag == 1
5501  * #for slight compressible, non-wetting phase density psk doesn't matter
5502  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
5503  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
5504  * nPointsPerSimplex,
5505  */
5506  break;
5507  case 1:
5508 
5509  /* "cTwophaseDarcyCoefficients.pyx":1189
5510  * <double*>(da.data))
5511  * elif pskModelFlag == 1:
5512  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
5513  * nPointsPerSimplex,
5514  * g.shape[0],
5515  */
5516  (void)(twophaseDarcy_slightCompressible_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
5517 
5518  /* "cTwophaseDarcyCoefficients.pyx":1188
5519  * <double*>(a.data),
5520  * <double*>(da.data))
5521  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
5522  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex,
5523  * nPointsPerSimplex,
5524  */
5525  break;
5526  default:
5527 
5528  /* "cTwophaseDarcyCoefficients.pyx":1221
5529  * <double*>(da.data))
5530  * else:
5531  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
5532  * nPointsPerSimplex,
5533  * g.shape[0],
5534  */
5535  (void)(twophaseDarcy_slightCompressible_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
5536  break;
5537  }
5538 
5539  /* "cTwophaseDarcyCoefficients.pyx":1116
5540  * <double*>(a.data))
5541  *
5542  * def twophaseDarcy_incompressible_split_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
5543  * int density_w_flag,
5544  * int density_n_flag,
5545  */
5546 
5547  /* function exit code */
5548  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5549  goto __pyx_L0;
5550  __pyx_L1_error:;
5551  __Pyx_XDECREF(__pyx_t_1);
5552  __Pyx_XDECREF(__pyx_t_2);
5553  __Pyx_XDECREF(__pyx_t_3);
5554  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_incompressible_split_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
5555  __pyx_r = NULL;
5556  __pyx_L0:;
5557  __Pyx_XGIVEREF(__pyx_r);
5558  __Pyx_RefNannyFinishContext();
5559  return __pyx_r;
5560 }
5561 
5562 /* "cTwophaseDarcyCoefficients.pyx":1253
5563  * <double*>(da.data))
5564  *
5565  * def twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
5566  * int density_w_flag,
5567  * int density_n_flag,
5568  */
5569 
5570 /* Python wrapper */
5571 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_11twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5572 static char __pyx_doc_26cTwophaseDarcyCoefficients_10twophaseDarcy_slightCompressible_split_sd_pressure_het_matType[] = "Evaluate the pressure coefficients\n\nUse the split fractional flow formulation of slight compressible,\ntwo-phase Darcy flow for a heterogeneous medium, sparse diffusion rep\nhet\n\n ";
5573 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_11twophaseDarcy_slightCompressible_split_sd_pressure_het_matType = {"twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_11twophaseDarcy_slightCompressible_split_sd_pressure_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_10twophaseDarcy_slightCompressible_split_sd_pressure_het_matType};
5574 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_11twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5575  int __pyx_v_pskModelFlag;
5576  int __pyx_v_density_w_flag;
5577  CYTHON_UNUSED int __pyx_v_density_n_flag;
5578  PyArrayObject *__pyx_v_rowptr = 0;
5579  PyArrayObject *__pyx_v_colind = 0;
5580  PyArrayObject *__pyx_v_matType = 0;
5581  double __pyx_v_muw;
5582  double __pyx_v_mun;
5583  PyArrayObject *__pyx_v_omega = 0;
5584  PyArrayObject *__pyx_v_Kbar = 0;
5585  double __pyx_v_b;
5586  double __pyx_v_capillaryDiffusionScaling;
5587  double __pyx_v_advectionScaling;
5588  PyArrayObject *__pyx_v_rwork_psk = 0;
5589  PyArrayObject *__pyx_v_iwork_psk = 0;
5590  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
5591  PyArrayObject *__pyx_v_rwork_density_w = 0;
5592  PyArrayObject *__pyx_v_rwork_density_n = 0;
5593  PyArrayObject *__pyx_v_g = 0;
5594  PyArrayObject *__pyx_v_qt = 0;
5595  PyArrayObject *__pyx_v_psiw = 0;
5596  PyArrayObject *__pyx_v_sw = 0;
5597  PyArrayObject *__pyx_v_m = 0;
5598  PyArrayObject *__pyx_v_dm = 0;
5599  PyArrayObject *__pyx_v_phi = 0;
5600  PyArrayObject *__pyx_v_dphi = 0;
5601  PyArrayObject *__pyx_v_f = 0;
5602  PyArrayObject *__pyx_v_df = 0;
5603  PyArrayObject *__pyx_v_a = 0;
5604  PyArrayObject *__pyx_v_da = 0;
5605  int __pyx_lineno = 0;
5606  const char *__pyx_filename = NULL;
5607  int __pyx_clineno = 0;
5608  PyObject *__pyx_r = 0;
5609  __Pyx_RefNannyDeclarations
5610  __Pyx_RefNannySetupContext("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType (wrapper)", 0);
5611  {
5612  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_capillaryDiffusionScaling,&__pyx_n_s_advectionScaling,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_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_qt,&__pyx_n_s_psiw,&__pyx_n_s_sw,&__pyx_n_s_m,&__pyx_n_s_dm,&__pyx_n_s_phi,&__pyx_n_s_dphi,&__pyx_n_s_f,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,0};
5613  PyObject* values[30] = {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};
5614  if (unlikely(__pyx_kwds)) {
5615  Py_ssize_t kw_args;
5616  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5617  switch (pos_args) {
5618  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
5619  CYTHON_FALLTHROUGH;
5620  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
5621  CYTHON_FALLTHROUGH;
5622  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5623  CYTHON_FALLTHROUGH;
5624  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5625  CYTHON_FALLTHROUGH;
5626  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5627  CYTHON_FALLTHROUGH;
5628  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5629  CYTHON_FALLTHROUGH;
5630  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5631  CYTHON_FALLTHROUGH;
5632  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5633  CYTHON_FALLTHROUGH;
5634  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5635  CYTHON_FALLTHROUGH;
5636  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5637  CYTHON_FALLTHROUGH;
5638  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5639  CYTHON_FALLTHROUGH;
5640  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5641  CYTHON_FALLTHROUGH;
5642  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5643  CYTHON_FALLTHROUGH;
5644  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5645  CYTHON_FALLTHROUGH;
5646  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5647  CYTHON_FALLTHROUGH;
5648  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5649  CYTHON_FALLTHROUGH;
5650  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5651  CYTHON_FALLTHROUGH;
5652  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5653  CYTHON_FALLTHROUGH;
5654  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5655  CYTHON_FALLTHROUGH;
5656  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5657  CYTHON_FALLTHROUGH;
5658  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5659  CYTHON_FALLTHROUGH;
5660  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5661  CYTHON_FALLTHROUGH;
5662  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5663  CYTHON_FALLTHROUGH;
5664  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5665  CYTHON_FALLTHROUGH;
5666  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5667  CYTHON_FALLTHROUGH;
5668  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5669  CYTHON_FALLTHROUGH;
5670  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5671  CYTHON_FALLTHROUGH;
5672  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5673  CYTHON_FALLTHROUGH;
5674  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5675  CYTHON_FALLTHROUGH;
5676  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5677  CYTHON_FALLTHROUGH;
5678  case 0: break;
5679  default: goto __pyx_L5_argtuple_error;
5680  }
5681  kw_args = PyDict_Size(__pyx_kwds);
5682  switch (pos_args) {
5683  case 0:
5684  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
5685  else goto __pyx_L5_argtuple_error;
5686  CYTHON_FALLTHROUGH;
5687  case 1:
5688  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
5689  else {
5690  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 1); __PYX_ERR(0, 1253, __pyx_L3_error)
5691  }
5692  CYTHON_FALLTHROUGH;
5693  case 2:
5694  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
5695  else {
5696  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 2); __PYX_ERR(0, 1253, __pyx_L3_error)
5697  }
5698  CYTHON_FALLTHROUGH;
5699  case 3:
5700  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
5701  else {
5702  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 3); __PYX_ERR(0, 1253, __pyx_L3_error)
5703  }
5704  CYTHON_FALLTHROUGH;
5705  case 4:
5706  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
5707  else {
5708  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 4); __PYX_ERR(0, 1253, __pyx_L3_error)
5709  }
5710  CYTHON_FALLTHROUGH;
5711  case 5:
5712  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
5713  else {
5714  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 5); __PYX_ERR(0, 1253, __pyx_L3_error)
5715  }
5716  CYTHON_FALLTHROUGH;
5717  case 6:
5718  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
5719  else {
5720  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 6); __PYX_ERR(0, 1253, __pyx_L3_error)
5721  }
5722  CYTHON_FALLTHROUGH;
5723  case 7:
5724  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
5725  else {
5726  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 7); __PYX_ERR(0, 1253, __pyx_L3_error)
5727  }
5728  CYTHON_FALLTHROUGH;
5729  case 8:
5730  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
5731  else {
5732  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 8); __PYX_ERR(0, 1253, __pyx_L3_error)
5733  }
5734  CYTHON_FALLTHROUGH;
5735  case 9:
5736  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
5737  else {
5738  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 9); __PYX_ERR(0, 1253, __pyx_L3_error)
5739  }
5740  CYTHON_FALLTHROUGH;
5741  case 10:
5742  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
5743  else {
5744  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 10); __PYX_ERR(0, 1253, __pyx_L3_error)
5745  }
5746  CYTHON_FALLTHROUGH;
5747  case 11:
5748  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
5749  else {
5750  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 11); __PYX_ERR(0, 1253, __pyx_L3_error)
5751  }
5752  CYTHON_FALLTHROUGH;
5753  case 12:
5754  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_advectionScaling)) != 0)) kw_args--;
5755  else {
5756  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 12); __PYX_ERR(0, 1253, __pyx_L3_error)
5757  }
5758  CYTHON_FALLTHROUGH;
5759  case 13:
5760  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
5761  else {
5762  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 13); __PYX_ERR(0, 1253, __pyx_L3_error)
5763  }
5764  CYTHON_FALLTHROUGH;
5765  case 14:
5766  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
5767  else {
5768  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 14); __PYX_ERR(0, 1253, __pyx_L3_error)
5769  }
5770  CYTHON_FALLTHROUGH;
5771  case 15:
5772  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
5773  else {
5774  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 15); __PYX_ERR(0, 1253, __pyx_L3_error)
5775  }
5776  CYTHON_FALLTHROUGH;
5777  case 16:
5778  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
5779  else {
5780  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 16); __PYX_ERR(0, 1253, __pyx_L3_error)
5781  }
5782  CYTHON_FALLTHROUGH;
5783  case 17:
5784  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
5785  else {
5786  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 17); __PYX_ERR(0, 1253, __pyx_L3_error)
5787  }
5788  CYTHON_FALLTHROUGH;
5789  case 18:
5790  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
5791  else {
5792  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 18); __PYX_ERR(0, 1253, __pyx_L3_error)
5793  }
5794  CYTHON_FALLTHROUGH;
5795  case 19:
5796  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qt)) != 0)) kw_args--;
5797  else {
5798  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 19); __PYX_ERR(0, 1253, __pyx_L3_error)
5799  }
5800  CYTHON_FALLTHROUGH;
5801  case 20:
5802  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
5803  else {
5804  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 20); __PYX_ERR(0, 1253, __pyx_L3_error)
5805  }
5806  CYTHON_FALLTHROUGH;
5807  case 21:
5808  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
5809  else {
5810  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 21); __PYX_ERR(0, 1253, __pyx_L3_error)
5811  }
5812  CYTHON_FALLTHROUGH;
5813  case 22:
5814  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
5815  else {
5816  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 22); __PYX_ERR(0, 1253, __pyx_L3_error)
5817  }
5818  CYTHON_FALLTHROUGH;
5819  case 23:
5820  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
5821  else {
5822  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 23); __PYX_ERR(0, 1253, __pyx_L3_error)
5823  }
5824  CYTHON_FALLTHROUGH;
5825  case 24:
5826  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
5827  else {
5828  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 24); __PYX_ERR(0, 1253, __pyx_L3_error)
5829  }
5830  CYTHON_FALLTHROUGH;
5831  case 25:
5832  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
5833  else {
5834  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 25); __PYX_ERR(0, 1253, __pyx_L3_error)
5835  }
5836  CYTHON_FALLTHROUGH;
5837  case 26:
5838  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
5839  else {
5840  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 26); __PYX_ERR(0, 1253, __pyx_L3_error)
5841  }
5842  CYTHON_FALLTHROUGH;
5843  case 27:
5844  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
5845  else {
5846  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 27); __PYX_ERR(0, 1253, __pyx_L3_error)
5847  }
5848  CYTHON_FALLTHROUGH;
5849  case 28:
5850  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5851  else {
5852  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 28); __PYX_ERR(0, 1253, __pyx_L3_error)
5853  }
5854  CYTHON_FALLTHROUGH;
5855  case 29:
5856  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
5857  else {
5858  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, 29); __PYX_ERR(0, 1253, __pyx_L3_error)
5859  }
5860  }
5861  if (unlikely(kw_args > 0)) {
5862  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_slightCompressible_split_sd_pressure_het_matType") < 0)) __PYX_ERR(0, 1253, __pyx_L3_error)
5863  }
5864  } else if (PyTuple_GET_SIZE(__pyx_args) != 30) {
5865  goto __pyx_L5_argtuple_error;
5866  } else {
5867  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5868  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5869  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5870  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5871  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5872  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5873  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5874  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5875  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5876  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5877  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5878  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5879  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5880  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5881  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5882  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5883  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5884  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5885  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5886  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5887  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5888  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5889  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5890  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5891  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5892  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5893  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5894  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5895  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
5896  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
5897  }
5898  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1253, __pyx_L3_error)
5899  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1254, __pyx_L3_error)
5900  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1255, __pyx_L3_error)
5901  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
5902  __pyx_v_colind = ((PyArrayObject *)values[4]);
5903  __pyx_v_matType = ((PyArrayObject *)values[5]);
5904  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L3_error)
5905  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1260, __pyx_L3_error)
5906  __pyx_v_omega = ((PyArrayObject *)values[8]);
5907  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
5908  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L3_error)
5909  __pyx_v_capillaryDiffusionScaling = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_capillaryDiffusionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L3_error)
5910  __pyx_v_advectionScaling = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_advectionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1265, __pyx_L3_error)
5911  __pyx_v_rwork_psk = ((PyArrayObject *)values[13]);
5912  __pyx_v_iwork_psk = ((PyArrayObject *)values[14]);
5913  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[15]);
5914  __pyx_v_rwork_density_w = ((PyArrayObject *)values[16]);
5915  __pyx_v_rwork_density_n = ((PyArrayObject *)values[17]);
5916  __pyx_v_g = ((PyArrayObject *)values[18]);
5917  __pyx_v_qt = ((PyArrayObject *)values[19]);
5918  __pyx_v_psiw = ((PyArrayObject *)values[20]);
5919  __pyx_v_sw = ((PyArrayObject *)values[21]);
5920  __pyx_v_m = ((PyArrayObject *)values[22]);
5921  __pyx_v_dm = ((PyArrayObject *)values[23]);
5922  __pyx_v_phi = ((PyArrayObject *)values[24]);
5923  __pyx_v_dphi = ((PyArrayObject *)values[25]);
5924  __pyx_v_f = ((PyArrayObject *)values[26]);
5925  __pyx_v_df = ((PyArrayObject *)values[27]);
5926  __pyx_v_a = ((PyArrayObject *)values[28]);
5927  __pyx_v_da = ((PyArrayObject *)values[29]);
5928  }
5929  goto __pyx_L4_argument_unpacking_done;
5930  __pyx_L5_argtuple_error:;
5931  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 1, 30, 30, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1253, __pyx_L3_error)
5932  __pyx_L3_error:;
5933  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
5934  __Pyx_RefNannyFinishContext();
5935  return NULL;
5936  __pyx_L4_argument_unpacking_done:;
5937  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1256, __pyx_L1_error)
5938  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1257, __pyx_L1_error)
5939  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1258, __pyx_L1_error)
5940  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1261, __pyx_L1_error)
5941  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 1262, __pyx_L1_error)
5942  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1266, __pyx_L1_error)
5943  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1267, __pyx_L1_error)
5944  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1268, __pyx_L1_error)
5945  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 1269, __pyx_L1_error)
5946  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 1270, __pyx_L1_error)
5947  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 1271, __pyx_L1_error)
5948  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qt), __pyx_ptype_5numpy_ndarray, 1, "qt", 0))) __PYX_ERR(0, 1272, __pyx_L1_error)
5949  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 1273, __pyx_L1_error)
5950  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1274, __pyx_L1_error)
5951  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 1275, __pyx_L1_error)
5952  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1276, __pyx_L1_error)
5953  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi), __pyx_ptype_5numpy_ndarray, 1, "phi", 0))) __PYX_ERR(0, 1277, __pyx_L1_error)
5954  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 1278, __pyx_L1_error)
5955  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1279, __pyx_L1_error)
5956  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 1280, __pyx_L1_error)
5957  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1281, __pyx_L1_error)
5958  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 1282, __pyx_L1_error)
5959  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_10twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_qt, __pyx_v_psiw, __pyx_v_sw, __pyx_v_m, __pyx_v_dm, __pyx_v_phi, __pyx_v_dphi, __pyx_v_f, __pyx_v_df, __pyx_v_a, __pyx_v_da);
5960 
5961  /* function exit code */
5962  goto __pyx_L0;
5963  __pyx_L1_error:;
5964  __pyx_r = NULL;
5965  __pyx_L0:;
5966  __Pyx_RefNannyFinishContext();
5967  return __pyx_r;
5968 }
5969 
5970 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_10twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, CYTHON_UNUSED int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da) {
5971  int __pyx_v_nPointsPerSimplex;
5972  int __pyx_v_nSimplex;
5973  PyObject *__pyx_r = NULL;
5974  __Pyx_RefNannyDeclarations
5975  PyObject *__pyx_t_1 = NULL;
5976  PyObject *__pyx_t_2 = NULL;
5977  PyObject *__pyx_t_3 = NULL;
5978  int __pyx_t_4;
5979  int __pyx_lineno = 0;
5980  const char *__pyx_filename = NULL;
5981  int __pyx_clineno = 0;
5982  __Pyx_RefNannySetupContext("twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", 0);
5983 
5984  /* "cTwophaseDarcyCoefficients.pyx":1290
5985  *
5986  * """
5987  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
5988  * cdef int nSimplex=sw.size/nPointsPerSimplex
5989  * #while debugging allow only one option
5990  */
5991  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
5992 
5993  /* "cTwophaseDarcyCoefficients.pyx":1291
5994  * """
5995  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
5996  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
5997  * #while debugging allow only one option
5998  * #exponential for wetting phase
5999  */
6000  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error)
6001  __Pyx_GOTREF(__pyx_t_1);
6002  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
6003  __Pyx_GOTREF(__pyx_t_2);
6004  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
6005  __Pyx_GOTREF(__pyx_t_3);
6006  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6007  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6008  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L1_error)
6009  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6010  __pyx_v_nSimplex = __pyx_t_4;
6011 
6012  /* "cTwophaseDarcyCoefficients.pyx":1294
6013  * #while debugging allow only one option
6014  * #exponential for wetting phase
6015  * assert density_w_flag == 1 # <<<<<<<<<<<<<<
6016  * #for slight compressible, non-wetting phase density psk doesn't matter
6017  * if pskModelFlag == 0:
6018  */
6019  #ifndef CYTHON_WITHOUT_ASSERTIONS
6020  if (unlikely(!Py_OptimizeFlag)) {
6021  if (unlikely(!((__pyx_v_density_w_flag == 1) != 0))) {
6022  PyErr_SetNone(PyExc_AssertionError);
6023  __PYX_ERR(0, 1294, __pyx_L1_error)
6024  }
6025  }
6026  #endif
6027 
6028  /* "cTwophaseDarcyCoefficients.pyx":1296
6029  * assert density_w_flag == 1
6030  * #for slight compressible, non-wetting phase density psk doesn't matter
6031  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
6032  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
6033  * nPointsPerSimplex,
6034  */
6035  switch (__pyx_v_pskModelFlag) {
6036  case 0:
6037 
6038  /* "cTwophaseDarcyCoefficients.pyx":1297
6039  * #for slight compressible, non-wetting phase density psk doesn't matter
6040  * if pskModelFlag == 0:
6041  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
6042  * nPointsPerSimplex,
6043  * g.shape[0],
6044  */
6045  (void)(twophaseDarcy_slightCompressible_split_sd_saturation_het_matType<SimplePSK,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6046 
6047  /* "cTwophaseDarcyCoefficients.pyx":1296
6048  * assert density_w_flag == 1
6049  * #for slight compressible, non-wetting phase density psk doesn't matter
6050  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
6051  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
6052  * nPointsPerSimplex,
6053  */
6054  break;
6055  case 1:
6056 
6057  /* "cTwophaseDarcyCoefficients.pyx":1326
6058  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6059  * elif pskModelFlag == 1:
6060  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
6061  * nPointsPerSimplex,
6062  * g.shape[0],
6063  */
6064  (void)(twophaseDarcy_slightCompressible_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6065 
6066  /* "cTwophaseDarcyCoefficients.pyx":1325
6067  * <double*>(dphi.data), <double*>(f.data),
6068  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6069  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
6070  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex,
6071  * nPointsPerSimplex,
6072  */
6073  break;
6074  default:
6075 
6076  /* "cTwophaseDarcyCoefficients.pyx":1347
6077  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6078  * else:
6079  * tpdc.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
6080  * nPointsPerSimplex,
6081  * g.shape[0],
6082  */
6083  (void)(twophaseDarcy_slightCompressible_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6084  break;
6085  }
6086 
6087  /* "cTwophaseDarcyCoefficients.pyx":1253
6088  * <double*>(da.data))
6089  *
6090  * def twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
6091  * int density_w_flag,
6092  * int density_n_flag,
6093  */
6094 
6095  /* function exit code */
6096  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6097  goto __pyx_L0;
6098  __pyx_L1_error:;
6099  __Pyx_XDECREF(__pyx_t_1);
6100  __Pyx_XDECREF(__pyx_t_2);
6101  __Pyx_XDECREF(__pyx_t_3);
6102  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_slightCompressible_split_sd_pressure_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
6103  __pyx_r = NULL;
6104  __pyx_L0:;
6105  __Pyx_XGIVEREF(__pyx_r);
6106  __Pyx_RefNannyFinishContext();
6107  return __pyx_r;
6108 }
6109 
6110 /* "cTwophaseDarcyCoefficients.pyx":1367
6111  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6112  *
6113  * def twophaseDarcy_slightCompressible_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
6114  * int density_w_flag,
6115  * int density_n_flag,
6116  */
6117 
6118 /* Python wrapper */
6119 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_13twophaseDarcy_slightCompressible_split_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6120 static char __pyx_doc_26cTwophaseDarcyCoefficients_12twophaseDarcy_slightCompressible_split_sd_saturation_het_matType[] = "Evaluate the saturation coefficients\n\nUse the split fractional flow formulation of slight compressible,\ntwo-phase Darcy flow for a heterogeneous medium, sparse diffusion rep\nhet\n\n ";
6121 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_13twophaseDarcy_slightCompressible_split_sd_saturation_het_matType = {"twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_13twophaseDarcy_slightCompressible_split_sd_saturation_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_12twophaseDarcy_slightCompressible_split_sd_saturation_het_matType};
6122 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_13twophaseDarcy_slightCompressible_split_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6123  int __pyx_v_pskModelFlag;
6124  int __pyx_v_density_w_flag;
6125  int __pyx_v_density_n_flag;
6126  PyArrayObject *__pyx_v_rowptr = 0;
6127  PyArrayObject *__pyx_v_colind = 0;
6128  PyArrayObject *__pyx_v_matType = 0;
6129  double __pyx_v_muw;
6130  double __pyx_v_mun;
6131  PyArrayObject *__pyx_v_omega = 0;
6132  PyArrayObject *__pyx_v_Kbar = 0;
6133  double __pyx_v_b;
6134  double __pyx_v_capillaryDiffusionScaling;
6135  double __pyx_v_advectionScaling;
6136  PyArrayObject *__pyx_v_rwork_psk = 0;
6137  PyArrayObject *__pyx_v_iwork_psk = 0;
6138  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
6139  PyArrayObject *__pyx_v_rwork_density_w = 0;
6140  PyArrayObject *__pyx_v_rwork_density_n = 0;
6141  PyArrayObject *__pyx_v_g = 0;
6142  PyArrayObject *__pyx_v_qt = 0;
6143  PyArrayObject *__pyx_v_psiw = 0;
6144  PyArrayObject *__pyx_v_sw = 0;
6145  PyArrayObject *__pyx_v_m = 0;
6146  PyArrayObject *__pyx_v_dm = 0;
6147  PyArrayObject *__pyx_v_phi = 0;
6148  PyArrayObject *__pyx_v_dphi = 0;
6149  PyArrayObject *__pyx_v_f = 0;
6150  PyArrayObject *__pyx_v_df = 0;
6151  PyArrayObject *__pyx_v_a = 0;
6152  PyArrayObject *__pyx_v_da = 0;
6153  int __pyx_lineno = 0;
6154  const char *__pyx_filename = NULL;
6155  int __pyx_clineno = 0;
6156  PyObject *__pyx_r = 0;
6157  __Pyx_RefNannyDeclarations
6158  __Pyx_RefNannySetupContext("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType (wrapper)", 0);
6159  {
6160  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_capillaryDiffusionScaling,&__pyx_n_s_advectionScaling,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_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_qt,&__pyx_n_s_psiw,&__pyx_n_s_sw,&__pyx_n_s_m,&__pyx_n_s_dm,&__pyx_n_s_phi,&__pyx_n_s_dphi,&__pyx_n_s_f,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,0};
6161  PyObject* values[30] = {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};
6162  if (unlikely(__pyx_kwds)) {
6163  Py_ssize_t kw_args;
6164  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6165  switch (pos_args) {
6166  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
6167  CYTHON_FALLTHROUGH;
6168  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
6169  CYTHON_FALLTHROUGH;
6170  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
6171  CYTHON_FALLTHROUGH;
6172  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
6173  CYTHON_FALLTHROUGH;
6174  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
6175  CYTHON_FALLTHROUGH;
6176  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
6177  CYTHON_FALLTHROUGH;
6178  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
6179  CYTHON_FALLTHROUGH;
6180  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
6181  CYTHON_FALLTHROUGH;
6182  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
6183  CYTHON_FALLTHROUGH;
6184  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
6185  CYTHON_FALLTHROUGH;
6186  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
6187  CYTHON_FALLTHROUGH;
6188  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
6189  CYTHON_FALLTHROUGH;
6190  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
6191  CYTHON_FALLTHROUGH;
6192  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
6193  CYTHON_FALLTHROUGH;
6194  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6195  CYTHON_FALLTHROUGH;
6196  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6197  CYTHON_FALLTHROUGH;
6198  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6199  CYTHON_FALLTHROUGH;
6200  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6201  CYTHON_FALLTHROUGH;
6202  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6203  CYTHON_FALLTHROUGH;
6204  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6205  CYTHON_FALLTHROUGH;
6206  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6207  CYTHON_FALLTHROUGH;
6208  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6209  CYTHON_FALLTHROUGH;
6210  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6211  CYTHON_FALLTHROUGH;
6212  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6213  CYTHON_FALLTHROUGH;
6214  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6215  CYTHON_FALLTHROUGH;
6216  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6217  CYTHON_FALLTHROUGH;
6218  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6219  CYTHON_FALLTHROUGH;
6220  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6221  CYTHON_FALLTHROUGH;
6222  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6223  CYTHON_FALLTHROUGH;
6224  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6225  CYTHON_FALLTHROUGH;
6226  case 0: break;
6227  default: goto __pyx_L5_argtuple_error;
6228  }
6229  kw_args = PyDict_Size(__pyx_kwds);
6230  switch (pos_args) {
6231  case 0:
6232  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
6233  else goto __pyx_L5_argtuple_error;
6234  CYTHON_FALLTHROUGH;
6235  case 1:
6236  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
6237  else {
6238  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 1); __PYX_ERR(0, 1367, __pyx_L3_error)
6239  }
6240  CYTHON_FALLTHROUGH;
6241  case 2:
6242  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
6243  else {
6244  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 2); __PYX_ERR(0, 1367, __pyx_L3_error)
6245  }
6246  CYTHON_FALLTHROUGH;
6247  case 3:
6248  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
6249  else {
6250  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 3); __PYX_ERR(0, 1367, __pyx_L3_error)
6251  }
6252  CYTHON_FALLTHROUGH;
6253  case 4:
6254  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
6255  else {
6256  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 4); __PYX_ERR(0, 1367, __pyx_L3_error)
6257  }
6258  CYTHON_FALLTHROUGH;
6259  case 5:
6260  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
6261  else {
6262  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 5); __PYX_ERR(0, 1367, __pyx_L3_error)
6263  }
6264  CYTHON_FALLTHROUGH;
6265  case 6:
6266  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
6267  else {
6268  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 6); __PYX_ERR(0, 1367, __pyx_L3_error)
6269  }
6270  CYTHON_FALLTHROUGH;
6271  case 7:
6272  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
6273  else {
6274  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 7); __PYX_ERR(0, 1367, __pyx_L3_error)
6275  }
6276  CYTHON_FALLTHROUGH;
6277  case 8:
6278  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
6279  else {
6280  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 8); __PYX_ERR(0, 1367, __pyx_L3_error)
6281  }
6282  CYTHON_FALLTHROUGH;
6283  case 9:
6284  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
6285  else {
6286  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 9); __PYX_ERR(0, 1367, __pyx_L3_error)
6287  }
6288  CYTHON_FALLTHROUGH;
6289  case 10:
6290  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
6291  else {
6292  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 10); __PYX_ERR(0, 1367, __pyx_L3_error)
6293  }
6294  CYTHON_FALLTHROUGH;
6295  case 11:
6296  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
6297  else {
6298  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 11); __PYX_ERR(0, 1367, __pyx_L3_error)
6299  }
6300  CYTHON_FALLTHROUGH;
6301  case 12:
6302  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_advectionScaling)) != 0)) kw_args--;
6303  else {
6304  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 12); __PYX_ERR(0, 1367, __pyx_L3_error)
6305  }
6306  CYTHON_FALLTHROUGH;
6307  case 13:
6308  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
6309  else {
6310  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 13); __PYX_ERR(0, 1367, __pyx_L3_error)
6311  }
6312  CYTHON_FALLTHROUGH;
6313  case 14:
6314  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
6315  else {
6316  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 14); __PYX_ERR(0, 1367, __pyx_L3_error)
6317  }
6318  CYTHON_FALLTHROUGH;
6319  case 15:
6320  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
6321  else {
6322  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 15); __PYX_ERR(0, 1367, __pyx_L3_error)
6323  }
6324  CYTHON_FALLTHROUGH;
6325  case 16:
6326  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
6327  else {
6328  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 16); __PYX_ERR(0, 1367, __pyx_L3_error)
6329  }
6330  CYTHON_FALLTHROUGH;
6331  case 17:
6332  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
6333  else {
6334  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 17); __PYX_ERR(0, 1367, __pyx_L3_error)
6335  }
6336  CYTHON_FALLTHROUGH;
6337  case 18:
6338  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
6339  else {
6340  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 18); __PYX_ERR(0, 1367, __pyx_L3_error)
6341  }
6342  CYTHON_FALLTHROUGH;
6343  case 19:
6344  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qt)) != 0)) kw_args--;
6345  else {
6346  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 19); __PYX_ERR(0, 1367, __pyx_L3_error)
6347  }
6348  CYTHON_FALLTHROUGH;
6349  case 20:
6350  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
6351  else {
6352  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 20); __PYX_ERR(0, 1367, __pyx_L3_error)
6353  }
6354  CYTHON_FALLTHROUGH;
6355  case 21:
6356  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
6357  else {
6358  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 21); __PYX_ERR(0, 1367, __pyx_L3_error)
6359  }
6360  CYTHON_FALLTHROUGH;
6361  case 22:
6362  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
6363  else {
6364  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 22); __PYX_ERR(0, 1367, __pyx_L3_error)
6365  }
6366  CYTHON_FALLTHROUGH;
6367  case 23:
6368  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
6369  else {
6370  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 23); __PYX_ERR(0, 1367, __pyx_L3_error)
6371  }
6372  CYTHON_FALLTHROUGH;
6373  case 24:
6374  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
6375  else {
6376  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 24); __PYX_ERR(0, 1367, __pyx_L3_error)
6377  }
6378  CYTHON_FALLTHROUGH;
6379  case 25:
6380  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
6381  else {
6382  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 25); __PYX_ERR(0, 1367, __pyx_L3_error)
6383  }
6384  CYTHON_FALLTHROUGH;
6385  case 26:
6386  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6387  else {
6388  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 26); __PYX_ERR(0, 1367, __pyx_L3_error)
6389  }
6390  CYTHON_FALLTHROUGH;
6391  case 27:
6392  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
6393  else {
6394  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 27); __PYX_ERR(0, 1367, __pyx_L3_error)
6395  }
6396  CYTHON_FALLTHROUGH;
6397  case 28:
6398  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6399  else {
6400  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 28); __PYX_ERR(0, 1367, __pyx_L3_error)
6401  }
6402  CYTHON_FALLTHROUGH;
6403  case 29:
6404  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
6405  else {
6406  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, 29); __PYX_ERR(0, 1367, __pyx_L3_error)
6407  }
6408  }
6409  if (unlikely(kw_args > 0)) {
6410  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_slightCompressible_split_sd_saturation_het_matType") < 0)) __PYX_ERR(0, 1367, __pyx_L3_error)
6411  }
6412  } else if (PyTuple_GET_SIZE(__pyx_args) != 30) {
6413  goto __pyx_L5_argtuple_error;
6414  } else {
6415  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6416  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6417  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6418  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6419  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6420  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6421  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6422  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6423  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6424  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6425  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6426  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6427  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6428  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6429  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6430  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6431  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
6432  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
6433  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
6434  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
6435  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
6436  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
6437  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
6438  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
6439  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
6440  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
6441  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
6442  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
6443  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
6444  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
6445  }
6446  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1367, __pyx_L3_error)
6447  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1368, __pyx_L3_error)
6448  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1369, __pyx_L3_error)
6449  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
6450  __pyx_v_colind = ((PyArrayObject *)values[4]);
6451  __pyx_v_matType = ((PyArrayObject *)values[5]);
6452  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L3_error)
6453  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1374, __pyx_L3_error)
6454  __pyx_v_omega = ((PyArrayObject *)values[8]);
6455  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
6456  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L3_error)
6457  __pyx_v_capillaryDiffusionScaling = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_capillaryDiffusionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L3_error)
6458  __pyx_v_advectionScaling = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_advectionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1379, __pyx_L3_error)
6459  __pyx_v_rwork_psk = ((PyArrayObject *)values[13]);
6460  __pyx_v_iwork_psk = ((PyArrayObject *)values[14]);
6461  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[15]);
6462  __pyx_v_rwork_density_w = ((PyArrayObject *)values[16]);
6463  __pyx_v_rwork_density_n = ((PyArrayObject *)values[17]);
6464  __pyx_v_g = ((PyArrayObject *)values[18]);
6465  __pyx_v_qt = ((PyArrayObject *)values[19]);
6466  __pyx_v_psiw = ((PyArrayObject *)values[20]);
6467  __pyx_v_sw = ((PyArrayObject *)values[21]);
6468  __pyx_v_m = ((PyArrayObject *)values[22]);
6469  __pyx_v_dm = ((PyArrayObject *)values[23]);
6470  __pyx_v_phi = ((PyArrayObject *)values[24]);
6471  __pyx_v_dphi = ((PyArrayObject *)values[25]);
6472  __pyx_v_f = ((PyArrayObject *)values[26]);
6473  __pyx_v_df = ((PyArrayObject *)values[27]);
6474  __pyx_v_a = ((PyArrayObject *)values[28]);
6475  __pyx_v_da = ((PyArrayObject *)values[29]);
6476  }
6477  goto __pyx_L4_argument_unpacking_done;
6478  __pyx_L5_argtuple_error:;
6479  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 1, 30, 30, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1367, __pyx_L3_error)
6480  __pyx_L3_error:;
6481  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
6482  __Pyx_RefNannyFinishContext();
6483  return NULL;
6484  __pyx_L4_argument_unpacking_done:;
6485  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1370, __pyx_L1_error)
6486  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1371, __pyx_L1_error)
6487  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1372, __pyx_L1_error)
6488  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1375, __pyx_L1_error)
6489  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 1376, __pyx_L1_error)
6490  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1380, __pyx_L1_error)
6491  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1381, __pyx_L1_error)
6492  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1382, __pyx_L1_error)
6493  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 1383, __pyx_L1_error)
6494  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 1384, __pyx_L1_error)
6495  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6496  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qt), __pyx_ptype_5numpy_ndarray, 1, "qt", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6497  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6498  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6499  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6500  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6501  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi), __pyx_ptype_5numpy_ndarray, 1, "phi", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6502  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 1385, __pyx_L1_error)
6503  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1386, __pyx_L1_error)
6504  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 1386, __pyx_L1_error)
6505  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1386, __pyx_L1_error)
6506  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 1386, __pyx_L1_error)
6507  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_12twophaseDarcy_slightCompressible_split_sd_saturation_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_qt, __pyx_v_psiw, __pyx_v_sw, __pyx_v_m, __pyx_v_dm, __pyx_v_phi, __pyx_v_dphi, __pyx_v_f, __pyx_v_df, __pyx_v_a, __pyx_v_da);
6508 
6509  /* function exit code */
6510  goto __pyx_L0;
6511  __pyx_L1_error:;
6512  __pyx_r = NULL;
6513  __pyx_L0:;
6514  __Pyx_RefNannyFinishContext();
6515  return __pyx_r;
6516 }
6517 
6518 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_12twophaseDarcy_slightCompressible_split_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da) {
6519  int __pyx_v_nPointsPerSimplex;
6520  int __pyx_v_nSimplex;
6521  PyObject *__pyx_r = NULL;
6522  __Pyx_RefNannyDeclarations
6523  PyObject *__pyx_t_1 = NULL;
6524  PyObject *__pyx_t_2 = NULL;
6525  PyObject *__pyx_t_3 = NULL;
6526  int __pyx_t_4;
6527  PyObject *__pyx_t_5 = NULL;
6528  PyObject *__pyx_t_6 = NULL;
6529  PyObject *__pyx_t_7 = NULL;
6530  int __pyx_lineno = 0;
6531  const char *__pyx_filename = NULL;
6532  int __pyx_clineno = 0;
6533  __Pyx_RefNannySetupContext("twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", 0);
6534 
6535  /* "cTwophaseDarcyCoefficients.pyx":1394
6536  *
6537  * """
6538  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
6539  * cdef int nSimplex=sw.size/nPointsPerSimplex
6540  * if density_n_flag == 1: #nonwetting exponential
6541  */
6542  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
6543 
6544  /* "cTwophaseDarcyCoefficients.pyx":1395
6545  * """
6546  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
6547  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
6548  * if density_n_flag == 1: #nonwetting exponential
6549  * if pskModelFlag == 0:
6550  */
6551  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
6552  __Pyx_GOTREF(__pyx_t_1);
6553  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __pyx_L1_error)
6554  __Pyx_GOTREF(__pyx_t_2);
6555  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1395, __pyx_L1_error)
6556  __Pyx_GOTREF(__pyx_t_3);
6557  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6558  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6559  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L1_error)
6560  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6561  __pyx_v_nSimplex = __pyx_t_4;
6562 
6563  /* "cTwophaseDarcyCoefficients.pyx":1396
6564  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
6565  * cdef int nSimplex=sw.size/nPointsPerSimplex
6566  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
6567  * if pskModelFlag == 0:
6568  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
6569  */
6570  switch (__pyx_v_density_n_flag) {
6571  case 1:
6572 
6573  /* "cTwophaseDarcyCoefficients.pyx":1397
6574  * cdef int nSimplex=sw.size/nPointsPerSimplex
6575  * if density_n_flag == 1: #nonwetting exponential
6576  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
6577  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
6578  * nPointsPerSimplex,
6579  */
6580  switch (__pyx_v_pskModelFlag) {
6581  case 0:
6582 
6583  /* "cTwophaseDarcyCoefficients.pyx":1398
6584  * if density_n_flag == 1: #nonwetting exponential
6585  * if pskModelFlag == 0:
6586  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
6587  * nPointsPerSimplex,
6588  * g.shape[0],
6589  */
6590  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<SimplePSK,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6591 
6592  /* "cTwophaseDarcyCoefficients.pyx":1397
6593  * cdef int nSimplex=sw.size/nPointsPerSimplex
6594  * if density_n_flag == 1: #nonwetting exponential
6595  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
6596  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
6597  * nPointsPerSimplex,
6598  */
6599  break;
6600  case 1:
6601 
6602  /* "cTwophaseDarcyCoefficients.pyx":1419
6603  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6604  * elif pskModelFlag == 1:
6605  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
6606  * nPointsPerSimplex,
6607  * g.shape[0],
6608  */
6609  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6610 
6611  /* "cTwophaseDarcyCoefficients.pyx":1418
6612  * <double*>(m.data), <double*>(dm.data), <double*>(phi.data), <double*>(dphi.data), <double*>(f.data),
6613  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6614  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
6615  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex,
6616  * nPointsPerSimplex,
6617  */
6618  break;
6619  default:
6620 
6621  /* "cTwophaseDarcyCoefficients.pyx":1440
6622  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6623  * else:
6624  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
6625  * nPointsPerSimplex,
6626  * g.shape[0],
6627  */
6628  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6629  break;
6630  }
6631 
6632  /* "cTwophaseDarcyCoefficients.pyx":1396
6633  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
6634  * cdef int nSimplex=sw.size/nPointsPerSimplex
6635  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
6636  * if pskModelFlag == 0:
6637  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
6638  */
6639  break;
6640  case 2:
6641 
6642  /* "cTwophaseDarcyCoefficients.pyx":1462
6643  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6644  * elif density_n_flag == 2:#nonwetting IdealGas
6645  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
6646  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex,
6647  * nPointsPerSimplex,
6648  */
6649  switch (__pyx_v_pskModelFlag) {
6650  case 0:
6651 
6652  /* "cTwophaseDarcyCoefficients.pyx":1463
6653  * elif density_n_flag == 2:#nonwetting IdealGas
6654  * if pskModelFlag == 0:
6655  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
6656  * nPointsPerSimplex,
6657  * g.shape[0],
6658  */
6659  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<SimplePSK,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6660 
6661  /* "cTwophaseDarcyCoefficients.pyx":1462
6662  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6663  * elif density_n_flag == 2:#nonwetting IdealGas
6664  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
6665  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex,
6666  * nPointsPerSimplex,
6667  */
6668  break;
6669  case 1:
6670 
6671  /* "cTwophaseDarcyCoefficients.pyx":1484
6672  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6673  * elif pskModelFlag == 1:
6674  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
6675  * nPointsPerSimplex,
6676  * g.shape[0],
6677  */
6678  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6679 
6680  /* "cTwophaseDarcyCoefficients.pyx":1483
6681  * <double*>(m.data), <double*>(dm.data), <double*>(phi.data), <double*>(dphi.data), <double*>(f.data),
6682  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6683  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
6684  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,IdealGasDensity](nSimplex,
6685  * nPointsPerSimplex,
6686  */
6687  break;
6688  default:
6689 
6690  /* "cTwophaseDarcyCoefficients.pyx":1505
6691  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6692  * else:
6693  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
6694  * nPointsPerSimplex,
6695  * g.shape[0],
6696  */
6697  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
6698  break;
6699  }
6700 
6701  /* "cTwophaseDarcyCoefficients.pyx":1461
6702  * <double*>(m.data), <double*>(dm.data), <double*>(phi.data), <double*>(dphi.data), <double*>(f.data),
6703  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6704  * elif density_n_flag == 2:#nonwetting IdealGas # <<<<<<<<<<<<<<
6705  * if pskModelFlag == 0:
6706  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex,
6707  */
6708  break;
6709  default:
6710 
6711  /* "cTwophaseDarcyCoefficients.pyx":1526
6712  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6713  * else:
6714  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag) # <<<<<<<<<<<<<<
6715  *
6716  * def twophaseDarcy_compressibleN_split_sd_pressure_het_matType( int pskModelFlag,
6717  */
6718  #ifndef CYTHON_WITHOUT_ASSERTIONS
6719  if (unlikely(!Py_OptimizeFlag)) {
6720  if (unlikely(!0)) {
6721  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_configuration_density_w_flag_0_a, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
6722  __Pyx_GOTREF(__pyx_t_2);
6723  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_density_w_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error)
6724  __Pyx_GOTREF(__pyx_t_1);
6725  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_density_n_flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L1_error)
6726  __Pyx_GOTREF(__pyx_t_5);
6727  __pyx_t_6 = NULL;
6728  __pyx_t_4 = 0;
6729  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6730  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
6731  if (likely(__pyx_t_6)) {
6732  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6733  __Pyx_INCREF(__pyx_t_6);
6734  __Pyx_INCREF(function);
6735  __Pyx_DECREF_SET(__pyx_t_2, function);
6736  __pyx_t_4 = 1;
6737  }
6738  }
6739  #if CYTHON_FAST_PYCALL
6740  if (PyFunction_Check(__pyx_t_2)) {
6741  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
6742  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
6743  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6744  __Pyx_GOTREF(__pyx_t_3);
6745  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6746  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6747  } else
6748  #endif
6749  #if CYTHON_FAST_PYCCALL
6750  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
6751  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
6752  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
6753  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6754  __Pyx_GOTREF(__pyx_t_3);
6755  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6756  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6757  } else
6758  #endif
6759  {
6760  __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1526, __pyx_L1_error)
6761  __Pyx_GOTREF(__pyx_t_7);
6762  if (__pyx_t_6) {
6763  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
6764  }
6765  __Pyx_GIVEREF(__pyx_t_1);
6766  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_1);
6767  __Pyx_GIVEREF(__pyx_t_5);
6768  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_5);
6769  __pyx_t_1 = 0;
6770  __pyx_t_5 = 0;
6771  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
6772  __Pyx_GOTREF(__pyx_t_3);
6773  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6774  }
6775  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6776  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
6777  __Pyx_GOTREF(__pyx_t_2);
6778  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6779  PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
6780  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6781  __PYX_ERR(0, 1526, __pyx_L1_error)
6782  }
6783  }
6784  #endif
6785  break;
6786  }
6787 
6788  /* "cTwophaseDarcyCoefficients.pyx":1367
6789  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
6790  *
6791  * def twophaseDarcy_slightCompressible_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
6792  * int density_w_flag,
6793  * int density_n_flag,
6794  */
6795 
6796  /* function exit code */
6797  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6798  goto __pyx_L0;
6799  __pyx_L1_error:;
6800  __Pyx_XDECREF(__pyx_t_1);
6801  __Pyx_XDECREF(__pyx_t_2);
6802  __Pyx_XDECREF(__pyx_t_3);
6803  __Pyx_XDECREF(__pyx_t_5);
6804  __Pyx_XDECREF(__pyx_t_6);
6805  __Pyx_XDECREF(__pyx_t_7);
6806  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_slightCompressible_split_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
6807  __pyx_r = NULL;
6808  __pyx_L0:;
6809  __Pyx_XGIVEREF(__pyx_r);
6810  __Pyx_RefNannyFinishContext();
6811  return __pyx_r;
6812 }
6813 
6814 /* "cTwophaseDarcyCoefficients.pyx":1528
6815  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
6816  *
6817  * def twophaseDarcy_compressibleN_split_sd_pressure_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
6818  * int density_w_flag,
6819  * int density_n_flag,
6820  */
6821 
6822 /* Python wrapper */
6823 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_15twophaseDarcy_compressibleN_split_sd_pressure_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6824 static char __pyx_doc_26cTwophaseDarcyCoefficients_14twophaseDarcy_compressibleN_split_sd_pressure_het_matType[] = "Evaluate the pressure coefficients\n\nUse the split fractional flow formulation of compressible non-wetting\nphase, two-phase Darcy flow for a heterogeneous medium, sparse\ndiffusion rep het\n\n ";
6825 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_15twophaseDarcy_compressibleN_split_sd_pressure_het_matType = {"twophaseDarcy_compressibleN_split_sd_pressure_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_15twophaseDarcy_compressibleN_split_sd_pressure_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_14twophaseDarcy_compressibleN_split_sd_pressure_het_matType};
6826 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_15twophaseDarcy_compressibleN_split_sd_pressure_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6827  int __pyx_v_pskModelFlag;
6828  int __pyx_v_density_w_flag;
6829  int __pyx_v_density_n_flag;
6830  PyArrayObject *__pyx_v_rowptr = 0;
6831  PyArrayObject *__pyx_v_colind = 0;
6832  PyArrayObject *__pyx_v_matType = 0;
6833  double __pyx_v_muw;
6834  double __pyx_v_mun;
6835  PyArrayObject *__pyx_v_omega = 0;
6836  PyArrayObject *__pyx_v_Kbar = 0;
6837  double __pyx_v_b;
6838  double __pyx_v_capillaryDiffusionScaling;
6839  PyArrayObject *__pyx_v_rwork_psk = 0;
6840  PyArrayObject *__pyx_v_iwork_psk = 0;
6841  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
6842  PyArrayObject *__pyx_v_rwork_density_w = 0;
6843  PyArrayObject *__pyx_v_rwork_density_n = 0;
6844  PyArrayObject *__pyx_v_g = 0;
6845  PyArrayObject *__pyx_v_sw = 0;
6846  PyArrayObject *__pyx_v_psiw = 0;
6847  PyArrayObject *__pyx_v_psin = 0;
6848  PyArrayObject *__pyx_v_grad_psic = 0;
6849  PyArrayObject *__pyx_v_m = 0;
6850  PyArrayObject *__pyx_v_dm = 0;
6851  PyArrayObject *__pyx_v_f = 0;
6852  PyArrayObject *__pyx_v_a = 0;
6853  int __pyx_lineno = 0;
6854  const char *__pyx_filename = NULL;
6855  int __pyx_clineno = 0;
6856  PyObject *__pyx_r = 0;
6857  __Pyx_RefNannyDeclarations
6858  __Pyx_RefNannySetupContext("twophaseDarcy_compressibleN_split_sd_pressure_het_matType (wrapper)", 0);
6859  {
6860  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_capillaryDiffusionScaling,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_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_sw,&__pyx_n_s_psiw,&__pyx_n_s_psin,&__pyx_n_s_grad_psic,&__pyx_n_s_m,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,0};
6861  PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6862  if (unlikely(__pyx_kwds)) {
6863  Py_ssize_t kw_args;
6864  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6865  switch (pos_args) {
6866  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
6867  CYTHON_FALLTHROUGH;
6868  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
6869  CYTHON_FALLTHROUGH;
6870  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
6871  CYTHON_FALLTHROUGH;
6872  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
6873  CYTHON_FALLTHROUGH;
6874  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
6875  CYTHON_FALLTHROUGH;
6876  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
6877  CYTHON_FALLTHROUGH;
6878  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
6879  CYTHON_FALLTHROUGH;
6880  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
6881  CYTHON_FALLTHROUGH;
6882  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
6883  CYTHON_FALLTHROUGH;
6884  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
6885  CYTHON_FALLTHROUGH;
6886  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6887  CYTHON_FALLTHROUGH;
6888  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6889  CYTHON_FALLTHROUGH;
6890  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6891  CYTHON_FALLTHROUGH;
6892  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6893  CYTHON_FALLTHROUGH;
6894  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6895  CYTHON_FALLTHROUGH;
6896  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6897  CYTHON_FALLTHROUGH;
6898  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6899  CYTHON_FALLTHROUGH;
6900  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6901  CYTHON_FALLTHROUGH;
6902  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6903  CYTHON_FALLTHROUGH;
6904  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6905  CYTHON_FALLTHROUGH;
6906  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6907  CYTHON_FALLTHROUGH;
6908  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6909  CYTHON_FALLTHROUGH;
6910  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6911  CYTHON_FALLTHROUGH;
6912  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6913  CYTHON_FALLTHROUGH;
6914  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6915  CYTHON_FALLTHROUGH;
6916  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6917  CYTHON_FALLTHROUGH;
6918  case 0: break;
6919  default: goto __pyx_L5_argtuple_error;
6920  }
6921  kw_args = PyDict_Size(__pyx_kwds);
6922  switch (pos_args) {
6923  case 0:
6924  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
6925  else goto __pyx_L5_argtuple_error;
6926  CYTHON_FALLTHROUGH;
6927  case 1:
6928  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
6929  else {
6930  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 1); __PYX_ERR(0, 1528, __pyx_L3_error)
6931  }
6932  CYTHON_FALLTHROUGH;
6933  case 2:
6934  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
6935  else {
6936  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 2); __PYX_ERR(0, 1528, __pyx_L3_error)
6937  }
6938  CYTHON_FALLTHROUGH;
6939  case 3:
6940  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
6941  else {
6942  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 3); __PYX_ERR(0, 1528, __pyx_L3_error)
6943  }
6944  CYTHON_FALLTHROUGH;
6945  case 4:
6946  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
6947  else {
6948  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 4); __PYX_ERR(0, 1528, __pyx_L3_error)
6949  }
6950  CYTHON_FALLTHROUGH;
6951  case 5:
6952  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
6953  else {
6954  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 5); __PYX_ERR(0, 1528, __pyx_L3_error)
6955  }
6956  CYTHON_FALLTHROUGH;
6957  case 6:
6958  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
6959  else {
6960  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 6); __PYX_ERR(0, 1528, __pyx_L3_error)
6961  }
6962  CYTHON_FALLTHROUGH;
6963  case 7:
6964  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
6965  else {
6966  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 7); __PYX_ERR(0, 1528, __pyx_L3_error)
6967  }
6968  CYTHON_FALLTHROUGH;
6969  case 8:
6970  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
6971  else {
6972  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 8); __PYX_ERR(0, 1528, __pyx_L3_error)
6973  }
6974  CYTHON_FALLTHROUGH;
6975  case 9:
6976  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
6977  else {
6978  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 9); __PYX_ERR(0, 1528, __pyx_L3_error)
6979  }
6980  CYTHON_FALLTHROUGH;
6981  case 10:
6982  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
6983  else {
6984  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 10); __PYX_ERR(0, 1528, __pyx_L3_error)
6985  }
6986  CYTHON_FALLTHROUGH;
6987  case 11:
6988  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
6989  else {
6990  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 11); __PYX_ERR(0, 1528, __pyx_L3_error)
6991  }
6992  CYTHON_FALLTHROUGH;
6993  case 12:
6994  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
6995  else {
6996  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 12); __PYX_ERR(0, 1528, __pyx_L3_error)
6997  }
6998  CYTHON_FALLTHROUGH;
6999  case 13:
7000  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
7001  else {
7002  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 13); __PYX_ERR(0, 1528, __pyx_L3_error)
7003  }
7004  CYTHON_FALLTHROUGH;
7005  case 14:
7006  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
7007  else {
7008  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 14); __PYX_ERR(0, 1528, __pyx_L3_error)
7009  }
7010  CYTHON_FALLTHROUGH;
7011  case 15:
7012  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
7013  else {
7014  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 15); __PYX_ERR(0, 1528, __pyx_L3_error)
7015  }
7016  CYTHON_FALLTHROUGH;
7017  case 16:
7018  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
7019  else {
7020  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 16); __PYX_ERR(0, 1528, __pyx_L3_error)
7021  }
7022  CYTHON_FALLTHROUGH;
7023  case 17:
7024  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
7025  else {
7026  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 17); __PYX_ERR(0, 1528, __pyx_L3_error)
7027  }
7028  CYTHON_FALLTHROUGH;
7029  case 18:
7030  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
7031  else {
7032  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 18); __PYX_ERR(0, 1528, __pyx_L3_error)
7033  }
7034  CYTHON_FALLTHROUGH;
7035  case 19:
7036  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
7037  else {
7038  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 19); __PYX_ERR(0, 1528, __pyx_L3_error)
7039  }
7040  CYTHON_FALLTHROUGH;
7041  case 20:
7042  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psin)) != 0)) kw_args--;
7043  else {
7044  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 20); __PYX_ERR(0, 1528, __pyx_L3_error)
7045  }
7046  CYTHON_FALLTHROUGH;
7047  case 21:
7048  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_psic)) != 0)) kw_args--;
7049  else {
7050  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 21); __PYX_ERR(0, 1528, __pyx_L3_error)
7051  }
7052  CYTHON_FALLTHROUGH;
7053  case 22:
7054  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
7055  else {
7056  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 22); __PYX_ERR(0, 1528, __pyx_L3_error)
7057  }
7058  CYTHON_FALLTHROUGH;
7059  case 23:
7060  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
7061  else {
7062  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 23); __PYX_ERR(0, 1528, __pyx_L3_error)
7063  }
7064  CYTHON_FALLTHROUGH;
7065  case 24:
7066  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
7067  else {
7068  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 24); __PYX_ERR(0, 1528, __pyx_L3_error)
7069  }
7070  CYTHON_FALLTHROUGH;
7071  case 25:
7072  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
7073  else {
7074  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, 25); __PYX_ERR(0, 1528, __pyx_L3_error)
7075  }
7076  }
7077  if (unlikely(kw_args > 0)) {
7078  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_compressibleN_split_sd_pressure_het_matType") < 0)) __PYX_ERR(0, 1528, __pyx_L3_error)
7079  }
7080  } else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
7081  goto __pyx_L5_argtuple_error;
7082  } else {
7083  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7084  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7085  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7086  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7087  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7088  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7089  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7090  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7091  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7092  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7093  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7094  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7095  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
7096  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
7097  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
7098  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
7099  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
7100  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
7101  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
7102  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
7103  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
7104  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
7105  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
7106  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
7107  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
7108  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
7109  }
7110  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1528, __pyx_L3_error)
7111  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L3_error)
7112  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1530, __pyx_L3_error)
7113  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
7114  __pyx_v_colind = ((PyArrayObject *)values[4]);
7115  __pyx_v_matType = ((PyArrayObject *)values[5]);
7116  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1534, __pyx_L3_error)
7117  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L3_error)
7118  __pyx_v_omega = ((PyArrayObject *)values[8]);
7119  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
7120  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1538, __pyx_L3_error)
7121  __pyx_v_capillaryDiffusionScaling = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_capillaryDiffusionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1539, __pyx_L3_error)
7122  __pyx_v_rwork_psk = ((PyArrayObject *)values[12]);
7123  __pyx_v_iwork_psk = ((PyArrayObject *)values[13]);
7124  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[14]);
7125  __pyx_v_rwork_density_w = ((PyArrayObject *)values[15]);
7126  __pyx_v_rwork_density_n = ((PyArrayObject *)values[16]);
7127  __pyx_v_g = ((PyArrayObject *)values[17]);
7128  __pyx_v_sw = ((PyArrayObject *)values[18]);
7129  __pyx_v_psiw = ((PyArrayObject *)values[19]);
7130  __pyx_v_psin = ((PyArrayObject *)values[20]);
7131  __pyx_v_grad_psic = ((PyArrayObject *)values[21]);
7132  __pyx_v_m = ((PyArrayObject *)values[22]);
7133  __pyx_v_dm = ((PyArrayObject *)values[23]);
7134  __pyx_v_f = ((PyArrayObject *)values[24]);
7135  __pyx_v_a = ((PyArrayObject *)values[25]);
7136  }
7137  goto __pyx_L4_argument_unpacking_done;
7138  __pyx_L5_argtuple_error:;
7139  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1528, __pyx_L3_error)
7140  __pyx_L3_error:;
7141  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_compressibleN_split_sd_pressure_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
7142  __Pyx_RefNannyFinishContext();
7143  return NULL;
7144  __pyx_L4_argument_unpacking_done:;
7145  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1531, __pyx_L1_error)
7146  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1532, __pyx_L1_error)
7147  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1533, __pyx_L1_error)
7148  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1536, __pyx_L1_error)
7149  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 1537, __pyx_L1_error)
7150  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1540, __pyx_L1_error)
7151  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1541, __pyx_L1_error)
7152  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1542, __pyx_L1_error)
7153  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 1543, __pyx_L1_error)
7154  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 1544, __pyx_L1_error)
7155  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7156  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7157  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7158  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psin), __pyx_ptype_5numpy_ndarray, 1, "psin", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7159  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_psic), __pyx_ptype_5numpy_ndarray, 1, "grad_psic", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7160  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7161  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7162  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7163  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1545, __pyx_L1_error)
7164  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_14twophaseDarcy_compressibleN_split_sd_pressure_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_sw, __pyx_v_psiw, __pyx_v_psin, __pyx_v_grad_psic, __pyx_v_m, __pyx_v_dm, __pyx_v_f, __pyx_v_a);
7165 
7166  /* function exit code */
7167  goto __pyx_L0;
7168  __pyx_L1_error:;
7169  __pyx_r = NULL;
7170  __pyx_L0:;
7171  __Pyx_RefNannyFinishContext();
7172  return __pyx_r;
7173 }
7174 
7175 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_14twophaseDarcy_compressibleN_split_sd_pressure_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_sw, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_psin, PyArrayObject *__pyx_v_grad_psic, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a) {
7176  int __pyx_v_nPointsPerSimplex;
7177  int __pyx_v_nSimplex;
7178  PyObject *__pyx_r = NULL;
7179  __Pyx_RefNannyDeclarations
7180  PyObject *__pyx_t_1 = NULL;
7181  PyObject *__pyx_t_2 = NULL;
7182  PyObject *__pyx_t_3 = NULL;
7183  int __pyx_t_4;
7184  PyObject *__pyx_t_5 = NULL;
7185  PyObject *__pyx_t_6 = NULL;
7186  PyObject *__pyx_t_7 = NULL;
7187  int __pyx_lineno = 0;
7188  const char *__pyx_filename = NULL;
7189  int __pyx_clineno = 0;
7190  __Pyx_RefNannySetupContext("twophaseDarcy_compressibleN_split_sd_pressure_het_matType", 0);
7191 
7192  /* "cTwophaseDarcyCoefficients.pyx":1553
7193  *
7194  * """
7195  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
7196  * cdef int nSimplex=sw.size/nPointsPerSimplex
7197  * if density_n_flag == 1: #nonwetting exponential
7198  */
7199  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
7200 
7201  /* "cTwophaseDarcyCoefficients.pyx":1554
7202  * """
7203  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
7204  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
7205  * if density_n_flag == 1: #nonwetting exponential
7206  * if pskModelFlag == 0:
7207  */
7208  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1554, __pyx_L1_error)
7209  __Pyx_GOTREF(__pyx_t_1);
7210  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1554, __pyx_L1_error)
7211  __Pyx_GOTREF(__pyx_t_2);
7212  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1554, __pyx_L1_error)
7213  __Pyx_GOTREF(__pyx_t_3);
7214  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7215  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7216  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1554, __pyx_L1_error)
7217  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7218  __pyx_v_nSimplex = __pyx_t_4;
7219 
7220  /* "cTwophaseDarcyCoefficients.pyx":1555
7221  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
7222  * cdef int nSimplex=sw.size/nPointsPerSimplex
7223  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
7224  * if pskModelFlag == 0:
7225  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7226  */
7227  switch (__pyx_v_density_n_flag) {
7228  case 1:
7229 
7230  /* "cTwophaseDarcyCoefficients.pyx":1556
7231  * cdef int nSimplex=sw.size/nPointsPerSimplex
7232  * if density_n_flag == 1: #nonwetting exponential
7233  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
7234  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7235  * nPointsPerSimplex,
7236  */
7237  switch (__pyx_v_pskModelFlag) {
7238  case 0:
7239 
7240  /* "cTwophaseDarcyCoefficients.pyx":1557
7241  * if density_n_flag == 1: #nonwetting exponential
7242  * if pskModelFlag == 0:
7243  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
7244  * nPointsPerSimplex,
7245  * g.shape[0],
7246  */
7247  (void)(twophaseDarcy_compressibleN_split_sd_pressure_het_matType<SimplePSK,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
7248 
7249  /* "cTwophaseDarcyCoefficients.pyx":1556
7250  * cdef int nSimplex=sw.size/nPointsPerSimplex
7251  * if density_n_flag == 1: #nonwetting exponential
7252  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
7253  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7254  * nPointsPerSimplex,
7255  */
7256  break;
7257  case 1:
7258 
7259  /* "cTwophaseDarcyCoefficients.pyx":1577
7260  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7261  * elif pskModelFlag == 1:
7262  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
7263  * nPointsPerSimplex,
7264  * g.shape[0],
7265  */
7266  (void)(twophaseDarcy_compressibleN_split_sd_pressure_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
7267 
7268  /* "cTwophaseDarcyCoefficients.pyx":1576
7269  * <double*>(g.data), <double*>(sw.data), <double*>(psiw.data), <double*>(psin.data), <double*>(grad_psic.data),
7270  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7271  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
7272  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[VGM,ExponentialDensity](nSimplex,
7273  * nPointsPerSimplex,
7274  */
7275  break;
7276  default:
7277 
7278  /* "cTwophaseDarcyCoefficients.pyx":1597
7279  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7280  * else:
7281  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
7282  * nPointsPerSimplex,
7283  * g.shape[0],
7284  */
7285  (void)(twophaseDarcy_compressibleN_split_sd_pressure_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
7286  break;
7287  }
7288 
7289  /* "cTwophaseDarcyCoefficients.pyx":1555
7290  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
7291  * cdef int nSimplex=sw.size/nPointsPerSimplex
7292  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
7293  * if pskModelFlag == 0:
7294  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7295  */
7296  break;
7297  case 2:
7298 
7299  /* "cTwophaseDarcyCoefficients.pyx":1618
7300  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7301  * elif density_n_flag == 2: #nonwetting IdealGas
7302  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
7303  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,IdealGasDensity](nSimplex,
7304  * nPointsPerSimplex,
7305  */
7306  switch (__pyx_v_pskModelFlag) {
7307  case 0:
7308 
7309  /* "cTwophaseDarcyCoefficients.pyx":1619
7310  * elif density_n_flag == 2: #nonwetting IdealGas
7311  * if pskModelFlag == 0:
7312  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
7313  * nPointsPerSimplex,
7314  * g.shape[0],
7315  */
7316  (void)(twophaseDarcy_compressibleN_split_sd_pressure_het_matType<SimplePSK,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
7317 
7318  /* "cTwophaseDarcyCoefficients.pyx":1618
7319  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7320  * elif density_n_flag == 2: #nonwetting IdealGas
7321  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
7322  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,IdealGasDensity](nSimplex,
7323  * nPointsPerSimplex,
7324  */
7325  break;
7326  case 1:
7327 
7328  /* "cTwophaseDarcyCoefficients.pyx":1640
7329  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7330  * elif pskModelFlag == 1:
7331  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[VGM,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
7332  * nPointsPerSimplex,
7333  * g.shape[0],
7334  */
7335  (void)(twophaseDarcy_compressibleN_split_sd_pressure_het_matType<VGM,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
7336 
7337  /* "cTwophaseDarcyCoefficients.pyx":1639
7338  * <double*>(g.data), <double*>(sw.data), <double*>(psiw.data), <double*>(psin.data), <double*>(grad_psic.data),
7339  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7340  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
7341  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[VGM,IdealGasDensity](nSimplex,
7342  * nPointsPerSimplex,
7343  */
7344  break;
7345  default:
7346 
7347  /* "cTwophaseDarcyCoefficients.pyx":1661
7348  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7349  * else:
7350  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[VGM,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
7351  * nPointsPerSimplex,
7352  * g.shape[0],
7353  */
7354  (void)(twophaseDarcy_compressibleN_split_sd_pressure_het_matType<VGM,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_sw->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_psin->data), ((double *)__pyx_v_grad_psic->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data)));
7355  break;
7356  }
7357 
7358  /* "cTwophaseDarcyCoefficients.pyx":1617
7359  * <double*>(g.data), <double*>(sw.data), <double*>(psiw.data), <double*>(psin.data), <double*>(grad_psic.data),
7360  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7361  * elif density_n_flag == 2: #nonwetting IdealGas # <<<<<<<<<<<<<<
7362  * if pskModelFlag == 0:
7363  * tpdc.twophaseDarcy_compressibleN_split_sd_pressure_het_matType[SimplePSK,IdealGasDensity](nSimplex,
7364  */
7365  break;
7366  default:
7367 
7368  /* "cTwophaseDarcyCoefficients.pyx":1682
7369  * <double*>(m.data), <double*>(dm.data), <double*>(f.data), <double*>(a.data))
7370  * else:
7371  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag) # <<<<<<<<<<<<<<
7372  *
7373  * def twophaseDarcy_compressibleN_split_sd_saturation_het_matType( int pskModelFlag,
7374  */
7375  #ifndef CYTHON_WITHOUT_ASSERTIONS
7376  if (unlikely(!Py_OptimizeFlag)) {
7377  if (unlikely(!0)) {
7378  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_configuration_density_w_flag_0_a, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
7379  __Pyx_GOTREF(__pyx_t_2);
7380  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_density_w_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
7381  __Pyx_GOTREF(__pyx_t_1);
7382  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_density_n_flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error)
7383  __Pyx_GOTREF(__pyx_t_5);
7384  __pyx_t_6 = NULL;
7385  __pyx_t_4 = 0;
7386  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7387  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
7388  if (likely(__pyx_t_6)) {
7389  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7390  __Pyx_INCREF(__pyx_t_6);
7391  __Pyx_INCREF(function);
7392  __Pyx_DECREF_SET(__pyx_t_2, function);
7393  __pyx_t_4 = 1;
7394  }
7395  }
7396  #if CYTHON_FAST_PYCALL
7397  if (PyFunction_Check(__pyx_t_2)) {
7398  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
7399  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1682, __pyx_L1_error)
7400  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7401  __Pyx_GOTREF(__pyx_t_3);
7402  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7403  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7404  } else
7405  #endif
7406  #if CYTHON_FAST_PYCCALL
7407  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
7408  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
7409  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1682, __pyx_L1_error)
7410  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7411  __Pyx_GOTREF(__pyx_t_3);
7412  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7413  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7414  } else
7415  #endif
7416  {
7417  __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error)
7418  __Pyx_GOTREF(__pyx_t_7);
7419  if (__pyx_t_6) {
7420  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
7421  }
7422  __Pyx_GIVEREF(__pyx_t_1);
7423  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_1);
7424  __Pyx_GIVEREF(__pyx_t_5);
7425  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_5);
7426  __pyx_t_1 = 0;
7427  __pyx_t_5 = 0;
7428  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1682, __pyx_L1_error)
7429  __Pyx_GOTREF(__pyx_t_3);
7430  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7431  }
7432  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7433  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
7434  __Pyx_GOTREF(__pyx_t_2);
7435  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7436  PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
7437  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7438  __PYX_ERR(0, 1682, __pyx_L1_error)
7439  }
7440  }
7441  #endif
7442  break;
7443  }
7444 
7445  /* "cTwophaseDarcyCoefficients.pyx":1528
7446  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
7447  *
7448  * def twophaseDarcy_compressibleN_split_sd_pressure_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
7449  * int density_w_flag,
7450  * int density_n_flag,
7451  */
7452 
7453  /* function exit code */
7454  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7455  goto __pyx_L0;
7456  __pyx_L1_error:;
7457  __Pyx_XDECREF(__pyx_t_1);
7458  __Pyx_XDECREF(__pyx_t_2);
7459  __Pyx_XDECREF(__pyx_t_3);
7460  __Pyx_XDECREF(__pyx_t_5);
7461  __Pyx_XDECREF(__pyx_t_6);
7462  __Pyx_XDECREF(__pyx_t_7);
7463  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_compressibleN_split_sd_pressure_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
7464  __pyx_r = NULL;
7465  __pyx_L0:;
7466  __Pyx_XGIVEREF(__pyx_r);
7467  __Pyx_RefNannyFinishContext();
7468  return __pyx_r;
7469 }
7470 
7471 /* "cTwophaseDarcyCoefficients.pyx":1684
7472  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
7473  *
7474  * def twophaseDarcy_compressibleN_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
7475  * int density_w_flag,
7476  * int density_n_flag,
7477  */
7478 
7479 /* Python wrapper */
7480 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_17twophaseDarcy_compressibleN_split_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7481 static char __pyx_doc_26cTwophaseDarcyCoefficients_16twophaseDarcy_compressibleN_split_sd_saturation_het_matType[] = "Evaluate the saturation coefficients\n\nUse the split fractional flow formulation of compressible non-wetting\nphase, two-phase Darcy flow for a heterogeneous medium, sparse\ndiffusion rep het\n\n ";
7482 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_17twophaseDarcy_compressibleN_split_sd_saturation_het_matType = {"twophaseDarcy_compressibleN_split_sd_saturation_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_17twophaseDarcy_compressibleN_split_sd_saturation_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_16twophaseDarcy_compressibleN_split_sd_saturation_het_matType};
7483 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_17twophaseDarcy_compressibleN_split_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7484  int __pyx_v_pskModelFlag;
7485  int __pyx_v_density_w_flag;
7486  int __pyx_v_density_n_flag;
7487  PyArrayObject *__pyx_v_rowptr = 0;
7488  PyArrayObject *__pyx_v_colind = 0;
7489  PyArrayObject *__pyx_v_matType = 0;
7490  double __pyx_v_muw;
7491  double __pyx_v_mun;
7492  PyArrayObject *__pyx_v_omega = 0;
7493  PyArrayObject *__pyx_v_Kbar = 0;
7494  double __pyx_v_b;
7495  double __pyx_v_capillaryDiffusionScaling;
7496  double __pyx_v_advectionScaling;
7497  PyArrayObject *__pyx_v_rwork_psk = 0;
7498  PyArrayObject *__pyx_v_iwork_psk = 0;
7499  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
7500  PyArrayObject *__pyx_v_rwork_density_w = 0;
7501  PyArrayObject *__pyx_v_rwork_density_n = 0;
7502  PyArrayObject *__pyx_v_g = 0;
7503  PyArrayObject *__pyx_v_qt = 0;
7504  PyArrayObject *__pyx_v_psiw = 0;
7505  PyArrayObject *__pyx_v_sw = 0;
7506  PyArrayObject *__pyx_v_m = 0;
7507  PyArrayObject *__pyx_v_dm = 0;
7508  PyArrayObject *__pyx_v_phi = 0;
7509  PyArrayObject *__pyx_v_dphi = 0;
7510  PyArrayObject *__pyx_v_f = 0;
7511  PyArrayObject *__pyx_v_df = 0;
7512  PyArrayObject *__pyx_v_a = 0;
7513  PyArrayObject *__pyx_v_da = 0;
7514  int __pyx_lineno = 0;
7515  const char *__pyx_filename = NULL;
7516  int __pyx_clineno = 0;
7517  PyObject *__pyx_r = 0;
7518  __Pyx_RefNannyDeclarations
7519  __Pyx_RefNannySetupContext("twophaseDarcy_compressibleN_split_sd_saturation_het_matType (wrapper)", 0);
7520  {
7521  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_density_w_flag,&__pyx_n_s_density_n_flag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_capillaryDiffusionScaling,&__pyx_n_s_advectionScaling,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_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_qt,&__pyx_n_s_psiw,&__pyx_n_s_sw,&__pyx_n_s_m,&__pyx_n_s_dm,&__pyx_n_s_phi,&__pyx_n_s_dphi,&__pyx_n_s_f,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,0};
7522  PyObject* values[30] = {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};
7523  if (unlikely(__pyx_kwds)) {
7524  Py_ssize_t kw_args;
7525  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7526  switch (pos_args) {
7527  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
7528  CYTHON_FALLTHROUGH;
7529  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
7530  CYTHON_FALLTHROUGH;
7531  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
7532  CYTHON_FALLTHROUGH;
7533  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
7534  CYTHON_FALLTHROUGH;
7535  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
7536  CYTHON_FALLTHROUGH;
7537  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
7538  CYTHON_FALLTHROUGH;
7539  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
7540  CYTHON_FALLTHROUGH;
7541  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
7542  CYTHON_FALLTHROUGH;
7543  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
7544  CYTHON_FALLTHROUGH;
7545  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
7546  CYTHON_FALLTHROUGH;
7547  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
7548  CYTHON_FALLTHROUGH;
7549  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
7550  CYTHON_FALLTHROUGH;
7551  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
7552  CYTHON_FALLTHROUGH;
7553  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
7554  CYTHON_FALLTHROUGH;
7555  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
7556  CYTHON_FALLTHROUGH;
7557  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
7558  CYTHON_FALLTHROUGH;
7559  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
7560  CYTHON_FALLTHROUGH;
7561  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
7562  CYTHON_FALLTHROUGH;
7563  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7564  CYTHON_FALLTHROUGH;
7565  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7566  CYTHON_FALLTHROUGH;
7567  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7568  CYTHON_FALLTHROUGH;
7569  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7570  CYTHON_FALLTHROUGH;
7571  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7572  CYTHON_FALLTHROUGH;
7573  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7574  CYTHON_FALLTHROUGH;
7575  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7576  CYTHON_FALLTHROUGH;
7577  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7578  CYTHON_FALLTHROUGH;
7579  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7580  CYTHON_FALLTHROUGH;
7581  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7582  CYTHON_FALLTHROUGH;
7583  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7584  CYTHON_FALLTHROUGH;
7585  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7586  CYTHON_FALLTHROUGH;
7587  case 0: break;
7588  default: goto __pyx_L5_argtuple_error;
7589  }
7590  kw_args = PyDict_Size(__pyx_kwds);
7591  switch (pos_args) {
7592  case 0:
7593  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
7594  else goto __pyx_L5_argtuple_error;
7595  CYTHON_FALLTHROUGH;
7596  case 1:
7597  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_w_flag)) != 0)) kw_args--;
7598  else {
7599  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 1); __PYX_ERR(0, 1684, __pyx_L3_error)
7600  }
7601  CYTHON_FALLTHROUGH;
7602  case 2:
7603  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_density_n_flag)) != 0)) kw_args--;
7604  else {
7605  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 2); __PYX_ERR(0, 1684, __pyx_L3_error)
7606  }
7607  CYTHON_FALLTHROUGH;
7608  case 3:
7609  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
7610  else {
7611  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 3); __PYX_ERR(0, 1684, __pyx_L3_error)
7612  }
7613  CYTHON_FALLTHROUGH;
7614  case 4:
7615  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
7616  else {
7617  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 4); __PYX_ERR(0, 1684, __pyx_L3_error)
7618  }
7619  CYTHON_FALLTHROUGH;
7620  case 5:
7621  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
7622  else {
7623  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 5); __PYX_ERR(0, 1684, __pyx_L3_error)
7624  }
7625  CYTHON_FALLTHROUGH;
7626  case 6:
7627  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
7628  else {
7629  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 6); __PYX_ERR(0, 1684, __pyx_L3_error)
7630  }
7631  CYTHON_FALLTHROUGH;
7632  case 7:
7633  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
7634  else {
7635  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 7); __PYX_ERR(0, 1684, __pyx_L3_error)
7636  }
7637  CYTHON_FALLTHROUGH;
7638  case 8:
7639  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
7640  else {
7641  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 8); __PYX_ERR(0, 1684, __pyx_L3_error)
7642  }
7643  CYTHON_FALLTHROUGH;
7644  case 9:
7645  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
7646  else {
7647  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 9); __PYX_ERR(0, 1684, __pyx_L3_error)
7648  }
7649  CYTHON_FALLTHROUGH;
7650  case 10:
7651  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
7652  else {
7653  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 10); __PYX_ERR(0, 1684, __pyx_L3_error)
7654  }
7655  CYTHON_FALLTHROUGH;
7656  case 11:
7657  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
7658  else {
7659  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 11); __PYX_ERR(0, 1684, __pyx_L3_error)
7660  }
7661  CYTHON_FALLTHROUGH;
7662  case 12:
7663  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_advectionScaling)) != 0)) kw_args--;
7664  else {
7665  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 12); __PYX_ERR(0, 1684, __pyx_L3_error)
7666  }
7667  CYTHON_FALLTHROUGH;
7668  case 13:
7669  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
7670  else {
7671  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 13); __PYX_ERR(0, 1684, __pyx_L3_error)
7672  }
7673  CYTHON_FALLTHROUGH;
7674  case 14:
7675  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
7676  else {
7677  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 14); __PYX_ERR(0, 1684, __pyx_L3_error)
7678  }
7679  CYTHON_FALLTHROUGH;
7680  case 15:
7681  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
7682  else {
7683  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 15); __PYX_ERR(0, 1684, __pyx_L3_error)
7684  }
7685  CYTHON_FALLTHROUGH;
7686  case 16:
7687  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
7688  else {
7689  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 16); __PYX_ERR(0, 1684, __pyx_L3_error)
7690  }
7691  CYTHON_FALLTHROUGH;
7692  case 17:
7693  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
7694  else {
7695  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 17); __PYX_ERR(0, 1684, __pyx_L3_error)
7696  }
7697  CYTHON_FALLTHROUGH;
7698  case 18:
7699  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
7700  else {
7701  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 18); __PYX_ERR(0, 1684, __pyx_L3_error)
7702  }
7703  CYTHON_FALLTHROUGH;
7704  case 19:
7705  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qt)) != 0)) kw_args--;
7706  else {
7707  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 19); __PYX_ERR(0, 1684, __pyx_L3_error)
7708  }
7709  CYTHON_FALLTHROUGH;
7710  case 20:
7711  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psiw)) != 0)) kw_args--;
7712  else {
7713  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 20); __PYX_ERR(0, 1684, __pyx_L3_error)
7714  }
7715  CYTHON_FALLTHROUGH;
7716  case 21:
7717  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
7718  else {
7719  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 21); __PYX_ERR(0, 1684, __pyx_L3_error)
7720  }
7721  CYTHON_FALLTHROUGH;
7722  case 22:
7723  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
7724  else {
7725  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 22); __PYX_ERR(0, 1684, __pyx_L3_error)
7726  }
7727  CYTHON_FALLTHROUGH;
7728  case 23:
7729  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
7730  else {
7731  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 23); __PYX_ERR(0, 1684, __pyx_L3_error)
7732  }
7733  CYTHON_FALLTHROUGH;
7734  case 24:
7735  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
7736  else {
7737  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 24); __PYX_ERR(0, 1684, __pyx_L3_error)
7738  }
7739  CYTHON_FALLTHROUGH;
7740  case 25:
7741  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
7742  else {
7743  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 25); __PYX_ERR(0, 1684, __pyx_L3_error)
7744  }
7745  CYTHON_FALLTHROUGH;
7746  case 26:
7747  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
7748  else {
7749  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 26); __PYX_ERR(0, 1684, __pyx_L3_error)
7750  }
7751  CYTHON_FALLTHROUGH;
7752  case 27:
7753  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
7754  else {
7755  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 27); __PYX_ERR(0, 1684, __pyx_L3_error)
7756  }
7757  CYTHON_FALLTHROUGH;
7758  case 28:
7759  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
7760  else {
7761  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 28); __PYX_ERR(0, 1684, __pyx_L3_error)
7762  }
7763  CYTHON_FALLTHROUGH;
7764  case 29:
7765  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
7766  else {
7767  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, 29); __PYX_ERR(0, 1684, __pyx_L3_error)
7768  }
7769  }
7770  if (unlikely(kw_args > 0)) {
7771  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_compressibleN_split_sd_saturation_het_matType") < 0)) __PYX_ERR(0, 1684, __pyx_L3_error)
7772  }
7773  } else if (PyTuple_GET_SIZE(__pyx_args) != 30) {
7774  goto __pyx_L5_argtuple_error;
7775  } else {
7776  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7777  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7778  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7779  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7780  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7781  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7782  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7783  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7784  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7785  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7786  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7787  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7788  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
7789  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
7790  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
7791  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
7792  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
7793  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
7794  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
7795  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
7796  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
7797  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
7798  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
7799  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
7800  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
7801  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
7802  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
7803  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
7804  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
7805  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
7806  }
7807  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error)
7808  __pyx_v_density_w_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_density_w_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1685, __pyx_L3_error)
7809  __pyx_v_density_n_flag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_density_n_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1686, __pyx_L3_error)
7810  __pyx_v_rowptr = ((PyArrayObject *)values[3]);
7811  __pyx_v_colind = ((PyArrayObject *)values[4]);
7812  __pyx_v_matType = ((PyArrayObject *)values[5]);
7813  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1690, __pyx_L3_error)
7814  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1691, __pyx_L3_error)
7815  __pyx_v_omega = ((PyArrayObject *)values[8]);
7816  __pyx_v_Kbar = ((PyArrayObject *)values[9]);
7817  __pyx_v_b = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1694, __pyx_L3_error)
7818  __pyx_v_capillaryDiffusionScaling = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_capillaryDiffusionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1695, __pyx_L3_error)
7819  __pyx_v_advectionScaling = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_advectionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1696, __pyx_L3_error)
7820  __pyx_v_rwork_psk = ((PyArrayObject *)values[13]);
7821  __pyx_v_iwork_psk = ((PyArrayObject *)values[14]);
7822  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[15]);
7823  __pyx_v_rwork_density_w = ((PyArrayObject *)values[16]);
7824  __pyx_v_rwork_density_n = ((PyArrayObject *)values[17]);
7825  __pyx_v_g = ((PyArrayObject *)values[18]);
7826  __pyx_v_qt = ((PyArrayObject *)values[19]);
7827  __pyx_v_psiw = ((PyArrayObject *)values[20]);
7828  __pyx_v_sw = ((PyArrayObject *)values[21]);
7829  __pyx_v_m = ((PyArrayObject *)values[22]);
7830  __pyx_v_dm = ((PyArrayObject *)values[23]);
7831  __pyx_v_phi = ((PyArrayObject *)values[24]);
7832  __pyx_v_dphi = ((PyArrayObject *)values[25]);
7833  __pyx_v_f = ((PyArrayObject *)values[26]);
7834  __pyx_v_df = ((PyArrayObject *)values[27]);
7835  __pyx_v_a = ((PyArrayObject *)values[28]);
7836  __pyx_v_da = ((PyArrayObject *)values[29]);
7837  }
7838  goto __pyx_L4_argument_unpacking_done;
7839  __pyx_L5_argtuple_error:;
7840  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 1, 30, 30, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1684, __pyx_L3_error)
7841  __pyx_L3_error:;
7842  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_compressibleN_split_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
7843  __Pyx_RefNannyFinishContext();
7844  return NULL;
7845  __pyx_L4_argument_unpacking_done:;
7846  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1687, __pyx_L1_error)
7847  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1688, __pyx_L1_error)
7848  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1689, __pyx_L1_error)
7849  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1692, __pyx_L1_error)
7850  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 1693, __pyx_L1_error)
7851  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1697, __pyx_L1_error)
7852  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1698, __pyx_L1_error)
7853  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1699, __pyx_L1_error)
7854  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 1700, __pyx_L1_error)
7855  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 1701, __pyx_L1_error)
7856  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7857  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qt), __pyx_ptype_5numpy_ndarray, 1, "qt", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7858  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_psiw), __pyx_ptype_5numpy_ndarray, 1, "psiw", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7859  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7860  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7861  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7862  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi), __pyx_ptype_5numpy_ndarray, 1, "phi", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7863  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
7864  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1703, __pyx_L1_error)
7865  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 1703, __pyx_L1_error)
7866  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1703, __pyx_L1_error)
7867  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 1703, __pyx_L1_error)
7868  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_16twophaseDarcy_compressibleN_split_sd_saturation_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_density_w_flag, __pyx_v_density_n_flag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_qt, __pyx_v_psiw, __pyx_v_sw, __pyx_v_m, __pyx_v_dm, __pyx_v_phi, __pyx_v_dphi, __pyx_v_f, __pyx_v_df, __pyx_v_a, __pyx_v_da);
7869 
7870  /* function exit code */
7871  goto __pyx_L0;
7872  __pyx_L1_error:;
7873  __pyx_r = NULL;
7874  __pyx_L0:;
7875  __Pyx_RefNannyFinishContext();
7876  return __pyx_r;
7877 }
7878 
7879 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_16twophaseDarcy_compressibleN_split_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_density_w_flag, int __pyx_v_density_n_flag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_psiw, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da) {
7880  int __pyx_v_nPointsPerSimplex;
7881  int __pyx_v_nSimplex;
7882  PyObject *__pyx_r = NULL;
7883  __Pyx_RefNannyDeclarations
7884  PyObject *__pyx_t_1 = NULL;
7885  PyObject *__pyx_t_2 = NULL;
7886  PyObject *__pyx_t_3 = NULL;
7887  int __pyx_t_4;
7888  PyObject *__pyx_t_5 = NULL;
7889  PyObject *__pyx_t_6 = NULL;
7890  PyObject *__pyx_t_7 = NULL;
7891  int __pyx_lineno = 0;
7892  const char *__pyx_filename = NULL;
7893  int __pyx_clineno = 0;
7894  __Pyx_RefNannySetupContext("twophaseDarcy_compressibleN_split_sd_saturation_het_matType", 0);
7895 
7896  /* "cTwophaseDarcyCoefficients.pyx":1711
7897  *
7898  * """
7899  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
7900  * cdef int nSimplex=sw.size/nPointsPerSimplex
7901  * if density_n_flag == 1: #nonwetting exponential
7902  */
7903  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
7904 
7905  /* "cTwophaseDarcyCoefficients.pyx":1712
7906  * """
7907  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
7908  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
7909  * if density_n_flag == 1: #nonwetting exponential
7910  * if pskModelFlag == 0:
7911  */
7912  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error)
7913  __Pyx_GOTREF(__pyx_t_1);
7914  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1712, __pyx_L1_error)
7915  __Pyx_GOTREF(__pyx_t_2);
7916  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error)
7917  __Pyx_GOTREF(__pyx_t_3);
7918  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7919  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7920  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L1_error)
7921  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7922  __pyx_v_nSimplex = __pyx_t_4;
7923 
7924  /* "cTwophaseDarcyCoefficients.pyx":1713
7925  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
7926  * cdef int nSimplex=sw.size/nPointsPerSimplex
7927  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
7928  * if pskModelFlag == 0:
7929  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7930  */
7931  switch (__pyx_v_density_n_flag) {
7932  case 1:
7933 
7934  /* "cTwophaseDarcyCoefficients.pyx":1714
7935  * cdef int nSimplex=sw.size/nPointsPerSimplex
7936  * if density_n_flag == 1: #nonwetting exponential
7937  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
7938  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7939  * nPointsPerSimplex,
7940  */
7941  switch (__pyx_v_pskModelFlag) {
7942  case 0:
7943 
7944  /* "cTwophaseDarcyCoefficients.pyx":1715
7945  * if density_n_flag == 1: #nonwetting exponential
7946  * if pskModelFlag == 0:
7947  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
7948  * nPointsPerSimplex,
7949  * g.shape[0],
7950  */
7951  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<SimplePSK,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
7952 
7953  /* "cTwophaseDarcyCoefficients.pyx":1714
7954  * cdef int nSimplex=sw.size/nPointsPerSimplex
7955  * if density_n_flag == 1: #nonwetting exponential
7956  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
7957  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7958  * nPointsPerSimplex,
7959  */
7960  break;
7961  case 1:
7962 
7963  /* "cTwophaseDarcyCoefficients.pyx":1736
7964  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
7965  * elif pskModelFlag == 1:
7966  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
7967  * nPointsPerSimplex,
7968  * g.shape[0],
7969  */
7970  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
7971 
7972  /* "cTwophaseDarcyCoefficients.pyx":1735
7973  * <double*>(m.data), <double*>(dm.data), <double*>(phi.data), <double*>(dphi.data), <double*>(f.data),
7974  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
7975  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
7976  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex,
7977  * nPointsPerSimplex,
7978  */
7979  break;
7980  default:
7981 
7982  /* "cTwophaseDarcyCoefficients.pyx":1757
7983  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
7984  * else:
7985  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,ExponentialDensity](nSimplex, # <<<<<<<<<<<<<<
7986  * nPointsPerSimplex,
7987  * g.shape[0],
7988  */
7989  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,ExponentialDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
7990  break;
7991  }
7992 
7993  /* "cTwophaseDarcyCoefficients.pyx":1713
7994  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
7995  * cdef int nSimplex=sw.size/nPointsPerSimplex
7996  * if density_n_flag == 1: #nonwetting exponential # <<<<<<<<<<<<<<
7997  * if pskModelFlag == 0:
7998  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,ExponentialDensity](nSimplex,
7999  */
8000  break;
8001  case 2:
8002 
8003  /* "cTwophaseDarcyCoefficients.pyx":1779
8004  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
8005  * elif density_n_flag == 2:#nonwetting IdealGas
8006  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
8007  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex,
8008  * nPointsPerSimplex,
8009  */
8010  switch (__pyx_v_pskModelFlag) {
8011  case 0:
8012 
8013  /* "cTwophaseDarcyCoefficients.pyx":1780
8014  * elif density_n_flag == 2:#nonwetting IdealGas
8015  * if pskModelFlag == 0:
8016  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
8017  * nPointsPerSimplex,
8018  * g.shape[0],
8019  */
8020  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<SimplePSK,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
8021 
8022  /* "cTwophaseDarcyCoefficients.pyx":1779
8023  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
8024  * elif density_n_flag == 2:#nonwetting IdealGas
8025  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
8026  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex,
8027  * nPointsPerSimplex,
8028  */
8029  break;
8030  case 1:
8031 
8032  /* "cTwophaseDarcyCoefficients.pyx":1801
8033  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
8034  * elif pskModelFlag == 1:
8035  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
8036  * nPointsPerSimplex,
8037  * g.shape[0],
8038  */
8039  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
8040 
8041  /* "cTwophaseDarcyCoefficients.pyx":1800
8042  * <double*>(m.data), <double*>(dm.data), <double*>(phi.data), <double*>(dphi.data), <double*>(f.data),
8043  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
8044  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
8045  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,IdealGasDensity](nSimplex,
8046  * nPointsPerSimplex,
8047  */
8048  break;
8049  default:
8050 
8051  /* "cTwophaseDarcyCoefficients.pyx":1822
8052  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
8053  * else:
8054  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[VGM,IdealGasDensity](nSimplex, # <<<<<<<<<<<<<<
8055  * nPointsPerSimplex,
8056  * g.shape[0],
8057  */
8058  (void)(twophaseDarcy_compressibleN_split_sd_saturation_het_matType<VGM,IdealGasDensity>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_psiw->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
8059  break;
8060  }
8061 
8062  /* "cTwophaseDarcyCoefficients.pyx":1778
8063  * <double*>(m.data), <double*>(dm.data), <double*>(phi.data), <double*>(dphi.data), <double*>(f.data),
8064  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
8065  * elif density_n_flag == 2:#nonwetting IdealGas # <<<<<<<<<<<<<<
8066  * if pskModelFlag == 0:
8067  * tpdc.twophaseDarcy_compressibleN_split_sd_saturation_het_matType[SimplePSK,IdealGasDensity](nSimplex,
8068  */
8069  break;
8070  default:
8071 
8072  /* "cTwophaseDarcyCoefficients.pyx":1843
8073  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
8074  * else:
8075  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag) # <<<<<<<<<<<<<<
8076  *
8077  * def twophaseDarcy_vol_frac( np.ndarray matType,
8078  */
8079  #ifndef CYTHON_WITHOUT_ASSERTIONS
8080  if (unlikely(!Py_OptimizeFlag)) {
8081  if (unlikely(!0)) {
8082  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_configuration_density_w_flag_0_a, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1843, __pyx_L1_error)
8083  __Pyx_GOTREF(__pyx_t_2);
8084  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_density_w_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1843, __pyx_L1_error)
8085  __Pyx_GOTREF(__pyx_t_1);
8086  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_density_n_flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1843, __pyx_L1_error)
8087  __Pyx_GOTREF(__pyx_t_5);
8088  __pyx_t_6 = NULL;
8089  __pyx_t_4 = 0;
8090  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8091  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
8092  if (likely(__pyx_t_6)) {
8093  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8094  __Pyx_INCREF(__pyx_t_6);
8095  __Pyx_INCREF(function);
8096  __Pyx_DECREF_SET(__pyx_t_2, function);
8097  __pyx_t_4 = 1;
8098  }
8099  }
8100  #if CYTHON_FAST_PYCALL
8101  if (PyFunction_Check(__pyx_t_2)) {
8102  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
8103  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1843, __pyx_L1_error)
8104  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8105  __Pyx_GOTREF(__pyx_t_3);
8106  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8107  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8108  } else
8109  #endif
8110  #if CYTHON_FAST_PYCCALL
8111  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
8112  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_5};
8113  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1843, __pyx_L1_error)
8114  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8115  __Pyx_GOTREF(__pyx_t_3);
8116  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8117  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8118  } else
8119  #endif
8120  {
8121  __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1843, __pyx_L1_error)
8122  __Pyx_GOTREF(__pyx_t_7);
8123  if (__pyx_t_6) {
8124  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
8125  }
8126  __Pyx_GIVEREF(__pyx_t_1);
8127  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_1);
8128  __Pyx_GIVEREF(__pyx_t_5);
8129  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_5);
8130  __pyx_t_1 = 0;
8131  __pyx_t_5 = 0;
8132  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1843, __pyx_L1_error)
8133  __Pyx_GOTREF(__pyx_t_3);
8134  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8135  }
8136  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8137  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1843, __pyx_L1_error)
8138  __Pyx_GOTREF(__pyx_t_2);
8139  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8140  PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
8141  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8142  __PYX_ERR(0, 1843, __pyx_L1_error)
8143  }
8144  }
8145  #endif
8146  break;
8147  }
8148 
8149  /* "cTwophaseDarcyCoefficients.pyx":1684
8150  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
8151  *
8152  * def twophaseDarcy_compressibleN_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
8153  * int density_w_flag,
8154  * int density_n_flag,
8155  */
8156 
8157  /* function exit code */
8158  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8159  goto __pyx_L0;
8160  __pyx_L1_error:;
8161  __Pyx_XDECREF(__pyx_t_1);
8162  __Pyx_XDECREF(__pyx_t_2);
8163  __Pyx_XDECREF(__pyx_t_3);
8164  __Pyx_XDECREF(__pyx_t_5);
8165  __Pyx_XDECREF(__pyx_t_6);
8166  __Pyx_XDECREF(__pyx_t_7);
8167  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_compressibleN_split_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
8168  __pyx_r = NULL;
8169  __pyx_L0:;
8170  __Pyx_XGIVEREF(__pyx_r);
8171  __Pyx_RefNannyFinishContext();
8172  return __pyx_r;
8173 }
8174 
8175 /* "cTwophaseDarcyCoefficients.pyx":1845
8176  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
8177  *
8178  * def twophaseDarcy_vol_frac( np.ndarray matType, # <<<<<<<<<<<<<<
8179  * np.ndarray omega,
8180  * np.ndarray sw,
8181  */
8182 
8183 /* Python wrapper */
8184 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_19twophaseDarcy_vol_frac(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8185 static char __pyx_doc_26cTwophaseDarcyCoefficients_18twophaseDarcy_vol_frac[] = "compute phase volume fractions\n\nUse point-vals for sw and zoned material types for porosity (omega)\n\n ";
8186 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_19twophaseDarcy_vol_frac = {"twophaseDarcy_vol_frac", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_19twophaseDarcy_vol_frac, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_18twophaseDarcy_vol_frac};
8187 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_19twophaseDarcy_vol_frac(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8188  PyArrayObject *__pyx_v_matType = 0;
8189  PyArrayObject *__pyx_v_omega = 0;
8190  PyArrayObject *__pyx_v_sw = 0;
8191  PyArrayObject *__pyx_v_vol_frac_w = 0;
8192  PyArrayObject *__pyx_v_vol_frac_n = 0;
8193  int __pyx_lineno = 0;
8194  const char *__pyx_filename = NULL;
8195  int __pyx_clineno = 0;
8196  PyObject *__pyx_r = 0;
8197  __Pyx_RefNannyDeclarations
8198  __Pyx_RefNannySetupContext("twophaseDarcy_vol_frac (wrapper)", 0);
8199  {
8200  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_matType,&__pyx_n_s_omega,&__pyx_n_s_sw,&__pyx_n_s_vol_frac_w,&__pyx_n_s_vol_frac_n,0};
8201  PyObject* values[5] = {0,0,0,0,0};
8202  if (unlikely(__pyx_kwds)) {
8203  Py_ssize_t kw_args;
8204  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8205  switch (pos_args) {
8206  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8207  CYTHON_FALLTHROUGH;
8208  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8209  CYTHON_FALLTHROUGH;
8210  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8211  CYTHON_FALLTHROUGH;
8212  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8213  CYTHON_FALLTHROUGH;
8214  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8215  CYTHON_FALLTHROUGH;
8216  case 0: break;
8217  default: goto __pyx_L5_argtuple_error;
8218  }
8219  kw_args = PyDict_Size(__pyx_kwds);
8220  switch (pos_args) {
8221  case 0:
8222  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
8223  else goto __pyx_L5_argtuple_error;
8224  CYTHON_FALLTHROUGH;
8225  case 1:
8226  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
8227  else {
8228  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_vol_frac", 1, 5, 5, 1); __PYX_ERR(0, 1845, __pyx_L3_error)
8229  }
8230  CYTHON_FALLTHROUGH;
8231  case 2:
8232  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
8233  else {
8234  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_vol_frac", 1, 5, 5, 2); __PYX_ERR(0, 1845, __pyx_L3_error)
8235  }
8236  CYTHON_FALLTHROUGH;
8237  case 3:
8238  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vol_frac_w)) != 0)) kw_args--;
8239  else {
8240  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_vol_frac", 1, 5, 5, 3); __PYX_ERR(0, 1845, __pyx_L3_error)
8241  }
8242  CYTHON_FALLTHROUGH;
8243  case 4:
8244  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vol_frac_n)) != 0)) kw_args--;
8245  else {
8246  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_vol_frac", 1, 5, 5, 4); __PYX_ERR(0, 1845, __pyx_L3_error)
8247  }
8248  }
8249  if (unlikely(kw_args > 0)) {
8250  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_vol_frac") < 0)) __PYX_ERR(0, 1845, __pyx_L3_error)
8251  }
8252  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
8253  goto __pyx_L5_argtuple_error;
8254  } else {
8255  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8256  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8257  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8258  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8259  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8260  }
8261  __pyx_v_matType = ((PyArrayObject *)values[0]);
8262  __pyx_v_omega = ((PyArrayObject *)values[1]);
8263  __pyx_v_sw = ((PyArrayObject *)values[2]);
8264  __pyx_v_vol_frac_w = ((PyArrayObject *)values[3]);
8265  __pyx_v_vol_frac_n = ((PyArrayObject *)values[4]);
8266  }
8267  goto __pyx_L4_argument_unpacking_done;
8268  __pyx_L5_argtuple_error:;
8269  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_vol_frac", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1845, __pyx_L3_error)
8270  __pyx_L3_error:;
8271  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_vol_frac", __pyx_clineno, __pyx_lineno, __pyx_filename);
8272  __Pyx_RefNannyFinishContext();
8273  return NULL;
8274  __pyx_L4_argument_unpacking_done:;
8275  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1845, __pyx_L1_error)
8276  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1846, __pyx_L1_error)
8277  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1847, __pyx_L1_error)
8278  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vol_frac_w), __pyx_ptype_5numpy_ndarray, 1, "vol_frac_w", 0))) __PYX_ERR(0, 1848, __pyx_L1_error)
8279  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vol_frac_n), __pyx_ptype_5numpy_ndarray, 1, "vol_frac_n", 0))) __PYX_ERR(0, 1849, __pyx_L1_error)
8280  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_18twophaseDarcy_vol_frac(__pyx_self, __pyx_v_matType, __pyx_v_omega, __pyx_v_sw, __pyx_v_vol_frac_w, __pyx_v_vol_frac_n);
8281 
8282  /* function exit code */
8283  goto __pyx_L0;
8284  __pyx_L1_error:;
8285  __pyx_r = NULL;
8286  __pyx_L0:;
8287  __Pyx_RefNannyFinishContext();
8288  return __pyx_r;
8289 }
8290 
8291 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_18twophaseDarcy_vol_frac(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_matType, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_vol_frac_w, PyArrayObject *__pyx_v_vol_frac_n) {
8292  int __pyx_v_nPointsPerSimplex;
8293  int __pyx_v_nSimplex;
8294  PyObject *__pyx_r = NULL;
8295  __Pyx_RefNannyDeclarations
8296  PyObject *__pyx_t_1 = NULL;
8297  PyObject *__pyx_t_2 = NULL;
8298  PyObject *__pyx_t_3 = NULL;
8299  int __pyx_t_4;
8300  int __pyx_lineno = 0;
8301  const char *__pyx_filename = NULL;
8302  int __pyx_clineno = 0;
8303  __Pyx_RefNannySetupContext("twophaseDarcy_vol_frac", 0);
8304 
8305  /* "cTwophaseDarcyCoefficients.pyx":1855
8306  *
8307  * """
8308  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
8309  * cdef int nSimplex=sw.size/nPointsPerSimplex
8310  * tpdc.twophaseDarcy_vol_frac(nSimplex,
8311  */
8312  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
8313 
8314  /* "cTwophaseDarcyCoefficients.pyx":1856
8315  * """
8316  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
8317  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
8318  * tpdc.twophaseDarcy_vol_frac(nSimplex,
8319  * nPointsPerSimplex,
8320  */
8321  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1856, __pyx_L1_error)
8322  __Pyx_GOTREF(__pyx_t_1);
8323  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
8324  __Pyx_GOTREF(__pyx_t_2);
8325  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1856, __pyx_L1_error)
8326  __Pyx_GOTREF(__pyx_t_3);
8327  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8328  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8329  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1856, __pyx_L1_error)
8330  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8331  __pyx_v_nSimplex = __pyx_t_4;
8332 
8333  /* "cTwophaseDarcyCoefficients.pyx":1857
8334  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
8335  * cdef int nSimplex=sw.size/nPointsPerSimplex
8336  * tpdc.twophaseDarcy_vol_frac(nSimplex, # <<<<<<<<<<<<<<
8337  * nPointsPerSimplex,
8338  * <int*>(matType.data),
8339  */
8340  (void)(twophaseDarcy_vol_frac(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, ((int *)__pyx_v_matType->data), ((double *)__pyx_v_omega->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_vol_frac_w->data), ((double *)__pyx_v_vol_frac_n->data)));
8341 
8342  /* "cTwophaseDarcyCoefficients.pyx":1845
8343  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
8344  *
8345  * def twophaseDarcy_vol_frac( np.ndarray matType, # <<<<<<<<<<<<<<
8346  * np.ndarray omega,
8347  * np.ndarray sw,
8348  */
8349 
8350  /* function exit code */
8351  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8352  goto __pyx_L0;
8353  __pyx_L1_error:;
8354  __Pyx_XDECREF(__pyx_t_1);
8355  __Pyx_XDECREF(__pyx_t_2);
8356  __Pyx_XDECREF(__pyx_t_3);
8357  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_vol_frac", __pyx_clineno, __pyx_lineno, __pyx_filename);
8358  __pyx_r = NULL;
8359  __pyx_L0:;
8360  __Pyx_XGIVEREF(__pyx_r);
8361  __Pyx_RefNannyFinishContext();
8362  return __pyx_r;
8363 }
8364 
8365 /* "cTwophaseDarcyCoefficients.pyx":1865
8366  * <double*>(vol_frac_n.data))
8367  *
8368  * def generateSplineTables(int pskModelFlag, # <<<<<<<<<<<<<<
8369  * int startIndex, #where to insert into splineTable
8370  * int calcFlag, #f(Sw) or f(psic)
8371  */
8372 
8373 /* Python wrapper */
8374 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_21generateSplineTables(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8375 static char __pyx_doc_26cTwophaseDarcyCoefficients_20generateSplineTables[] = "generate spline table look up arrays";
8376 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_21generateSplineTables = {"generateSplineTables", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_21generateSplineTables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_20generateSplineTables};
8377 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_21generateSplineTables(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8378  int __pyx_v_pskModelFlag;
8379  int __pyx_v_startIndex;
8380  int __pyx_v_calcFlag;
8381  PyArrayObject *__pyx_v_domain = 0;
8382  PyArrayObject *__pyx_v_rwork_psk = 0;
8383  PyArrayObject *__pyx_v_iwork_psk = 0;
8384  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
8385  PyArrayObject *__pyx_v_splineTable = 0;
8386  int __pyx_lineno = 0;
8387  const char *__pyx_filename = NULL;
8388  int __pyx_clineno = 0;
8389  PyObject *__pyx_r = 0;
8390  __Pyx_RefNannyDeclarations
8391  __Pyx_RefNannySetupContext("generateSplineTables (wrapper)", 0);
8392  {
8393  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_startIndex,&__pyx_n_s_calcFlag,&__pyx_n_s_domain,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_psk,&__pyx_n_s_rwork_psk_tol,&__pyx_n_s_splineTable,0};
8394  PyObject* values[8] = {0,0,0,0,0,0,0,0};
8395  if (unlikely(__pyx_kwds)) {
8396  Py_ssize_t kw_args;
8397  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8398  switch (pos_args) {
8399  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8400  CYTHON_FALLTHROUGH;
8401  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8402  CYTHON_FALLTHROUGH;
8403  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8404  CYTHON_FALLTHROUGH;
8405  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8406  CYTHON_FALLTHROUGH;
8407  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8408  CYTHON_FALLTHROUGH;
8409  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8410  CYTHON_FALLTHROUGH;
8411  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8412  CYTHON_FALLTHROUGH;
8413  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8414  CYTHON_FALLTHROUGH;
8415  case 0: break;
8416  default: goto __pyx_L5_argtuple_error;
8417  }
8418  kw_args = PyDict_Size(__pyx_kwds);
8419  switch (pos_args) {
8420  case 0:
8421  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
8422  else goto __pyx_L5_argtuple_error;
8423  CYTHON_FALLTHROUGH;
8424  case 1:
8425  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_startIndex)) != 0)) kw_args--;
8426  else {
8427  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, 1); __PYX_ERR(0, 1865, __pyx_L3_error)
8428  }
8429  CYTHON_FALLTHROUGH;
8430  case 2:
8431  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calcFlag)) != 0)) kw_args--;
8432  else {
8433  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, 2); __PYX_ERR(0, 1865, __pyx_L3_error)
8434  }
8435  CYTHON_FALLTHROUGH;
8436  case 3:
8437  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain)) != 0)) kw_args--;
8438  else {
8439  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, 3); __PYX_ERR(0, 1865, __pyx_L3_error)
8440  }
8441  CYTHON_FALLTHROUGH;
8442  case 4:
8443  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
8444  else {
8445  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, 4); __PYX_ERR(0, 1865, __pyx_L3_error)
8446  }
8447  CYTHON_FALLTHROUGH;
8448  case 5:
8449  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
8450  else {
8451  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, 5); __PYX_ERR(0, 1865, __pyx_L3_error)
8452  }
8453  CYTHON_FALLTHROUGH;
8454  case 6:
8455  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
8456  else {
8457  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, 6); __PYX_ERR(0, 1865, __pyx_L3_error)
8458  }
8459  CYTHON_FALLTHROUGH;
8460  case 7:
8461  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_splineTable)) != 0)) kw_args--;
8462  else {
8463  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, 7); __PYX_ERR(0, 1865, __pyx_L3_error)
8464  }
8465  }
8466  if (unlikely(kw_args > 0)) {
8467  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generateSplineTables") < 0)) __PYX_ERR(0, 1865, __pyx_L3_error)
8468  }
8469  } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
8470  goto __pyx_L5_argtuple_error;
8471  } else {
8472  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8473  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8474  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8475  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8476  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8477  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8478  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8479  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8480  }
8481  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1865, __pyx_L3_error)
8482  __pyx_v_startIndex = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_startIndex == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1866, __pyx_L3_error)
8483  __pyx_v_calcFlag = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_calcFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L3_error)
8484  __pyx_v_domain = ((PyArrayObject *)values[3]);
8485  __pyx_v_rwork_psk = ((PyArrayObject *)values[4]);
8486  __pyx_v_iwork_psk = ((PyArrayObject *)values[5]);
8487  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[6]);
8488  __pyx_v_splineTable = ((PyArrayObject *)values[7]);
8489  }
8490  goto __pyx_L4_argument_unpacking_done;
8491  __pyx_L5_argtuple_error:;
8492  __Pyx_RaiseArgtupleInvalid("generateSplineTables", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1865, __pyx_L3_error)
8493  __pyx_L3_error:;
8494  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.generateSplineTables", __pyx_clineno, __pyx_lineno, __pyx_filename);
8495  __Pyx_RefNannyFinishContext();
8496  return NULL;
8497  __pyx_L4_argument_unpacking_done:;
8498  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domain), __pyx_ptype_5numpy_ndarray, 1, "domain", 0))) __PYX_ERR(0, 1868, __pyx_L1_error)
8499  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1869, __pyx_L1_error)
8500  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1870, __pyx_L1_error)
8501  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1871, __pyx_L1_error)
8502  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splineTable), __pyx_ptype_5numpy_ndarray, 1, "splineTable", 0))) __PYX_ERR(0, 1872, __pyx_L1_error)
8503  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_20generateSplineTables(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_startIndex, __pyx_v_calcFlag, __pyx_v_domain, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_splineTable);
8504 
8505  /* function exit code */
8506  goto __pyx_L0;
8507  __pyx_L1_error:;
8508  __pyx_r = NULL;
8509  __pyx_L0:;
8510  __Pyx_RefNannyFinishContext();
8511  return __pyx_r;
8512 }
8513 
8514 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_20generateSplineTables(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, int __pyx_v_startIndex, int __pyx_v_calcFlag, PyArrayObject *__pyx_v_domain, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_psk, PyArrayObject *__pyx_v_rwork_psk_tol, PyArrayObject *__pyx_v_splineTable) {
8515  npy_intp __pyx_v_nknots;
8516  PyObject *__pyx_r = NULL;
8517  __Pyx_RefNannyDeclarations
8518  __Pyx_RefNannySetupContext("generateSplineTables", 0);
8519 
8520  /* "cTwophaseDarcyCoefficients.pyx":1874
8521  * np.ndarray splineTable):
8522  * """generate spline table look up arrays"""
8523  * nknots = domain.shape[0] # <<<<<<<<<<<<<<
8524  * if pskModelFlag == 0:
8525  * tpdc.generateSplineTables[SimplePSK](nknots,
8526  */
8527  __pyx_v_nknots = (__pyx_v_domain->dimensions[0]);
8528 
8529  /* "cTwophaseDarcyCoefficients.pyx":1875
8530  * """generate spline table look up arrays"""
8531  * nknots = domain.shape[0]
8532  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
8533  * tpdc.generateSplineTables[SimplePSK](nknots,
8534  * startIndex,
8535  */
8536  switch (__pyx_v_pskModelFlag) {
8537  case 0:
8538 
8539  /* "cTwophaseDarcyCoefficients.pyx":1876
8540  * nknots = domain.shape[0]
8541  * if pskModelFlag == 0:
8542  * tpdc.generateSplineTables[SimplePSK](nknots, # <<<<<<<<<<<<<<
8543  * startIndex,
8544  * calcFlag,
8545  */
8546  generateSplineTables<SimplePSK>(__pyx_v_nknots, __pyx_v_startIndex, __pyx_v_calcFlag, ((double *)__pyx_v_domain->data), ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_psk->data), ((double *)__pyx_v_rwork_psk_tol->data), ((double *)__pyx_v_splineTable->data));
8547 
8548  /* "cTwophaseDarcyCoefficients.pyx":1875
8549  * """generate spline table look up arrays"""
8550  * nknots = domain.shape[0]
8551  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
8552  * tpdc.generateSplineTables[SimplePSK](nknots,
8553  * startIndex,
8554  */
8555  break;
8556  case 1:
8557 
8558  /* "cTwophaseDarcyCoefficients.pyx":1885
8559  * <double*>(splineTable.data))
8560  * elif pskModelFlag == 1:
8561  * tpdc.generateSplineTables[VGM](nknots, # <<<<<<<<<<<<<<
8562  * startIndex,
8563  * calcFlag,
8564  */
8565  generateSplineTables<VGM>(__pyx_v_nknots, __pyx_v_startIndex, __pyx_v_calcFlag, ((double *)__pyx_v_domain->data), ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_psk->data), ((double *)__pyx_v_rwork_psk_tol->data), ((double *)__pyx_v_splineTable->data));
8566 
8567  /* "cTwophaseDarcyCoefficients.pyx":1884
8568  * <double*>(rwork_psk_tol.data),
8569  * <double*>(splineTable.data))
8570  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
8571  * tpdc.generateSplineTables[VGM](nknots,
8572  * startIndex,
8573  */
8574  break;
8575  case 2:
8576 
8577  /* "cTwophaseDarcyCoefficients.pyx":1894
8578  * <double*>(splineTable.data))
8579  * elif pskModelFlag == 2:
8580  * tpdc.generateSplineTables[VGB](nknots, # <<<<<<<<<<<<<<
8581  * startIndex,
8582  * calcFlag,
8583  */
8584  generateSplineTables<VGB>(__pyx_v_nknots, __pyx_v_startIndex, __pyx_v_calcFlag, ((double *)__pyx_v_domain->data), ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_psk->data), ((double *)__pyx_v_rwork_psk_tol->data), ((double *)__pyx_v_splineTable->data));
8585 
8586  /* "cTwophaseDarcyCoefficients.pyx":1893
8587  * <double*>(rwork_psk_tol.data),
8588  * <double*>(splineTable.data))
8589  * elif pskModelFlag == 2: # <<<<<<<<<<<<<<
8590  * tpdc.generateSplineTables[VGB](nknots,
8591  * startIndex,
8592  */
8593  break;
8594  case 3:
8595 
8596  /* "cTwophaseDarcyCoefficients.pyx":1903
8597  * <double*>(splineTable.data))
8598  * elif pskModelFlag == 3:
8599  * tpdc.generateSplineTables[BCM](nknots, # <<<<<<<<<<<<<<
8600  * startIndex,
8601  * calcFlag,
8602  */
8603  generateSplineTables<BCM>(__pyx_v_nknots, __pyx_v_startIndex, __pyx_v_calcFlag, ((double *)__pyx_v_domain->data), ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_psk->data), ((double *)__pyx_v_rwork_psk_tol->data), ((double *)__pyx_v_splineTable->data));
8604 
8605  /* "cTwophaseDarcyCoefficients.pyx":1902
8606  * <double*>(rwork_psk_tol.data),
8607  * <double*>(splineTable.data))
8608  * elif pskModelFlag == 3: # <<<<<<<<<<<<<<
8609  * tpdc.generateSplineTables[BCM](nknots,
8610  * startIndex,
8611  */
8612  break;
8613  case 4:
8614 
8615  /* "cTwophaseDarcyCoefficients.pyx":1912
8616  * <double*>(splineTable.data))
8617  * elif pskModelFlag == 4:
8618  * tpdc.generateSplineTables[BCB](nknots, # <<<<<<<<<<<<<<
8619  * startIndex,
8620  * calcFlag,
8621  */
8622  generateSplineTables<BCB>(__pyx_v_nknots, __pyx_v_startIndex, __pyx_v_calcFlag, ((double *)__pyx_v_domain->data), ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_psk->data), ((double *)__pyx_v_rwork_psk_tol->data), ((double *)__pyx_v_splineTable->data));
8623 
8624  /* "cTwophaseDarcyCoefficients.pyx":1911
8625  * <double*>(rwork_psk_tol.data),
8626  * <double*>(splineTable.data))
8627  * elif pskModelFlag == 4: # <<<<<<<<<<<<<<
8628  * tpdc.generateSplineTables[BCB](nknots,
8629  * startIndex,
8630  */
8631  break;
8632  default:
8633 
8634  /* "cTwophaseDarcyCoefficients.pyx":1921
8635  * <double*>(splineTable.data))
8636  * else:
8637  * tpdc.generateSplineTables[VGM](nknots, # <<<<<<<<<<<<<<
8638  * startIndex,
8639  * calcFlag,
8640  */
8641  generateSplineTables<VGM>(__pyx_v_nknots, __pyx_v_startIndex, __pyx_v_calcFlag, ((double *)__pyx_v_domain->data), ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_psk->data), ((double *)__pyx_v_rwork_psk_tol->data), ((double *)__pyx_v_splineTable->data));
8642  break;
8643  }
8644 
8645  /* "cTwophaseDarcyCoefficients.pyx":1865
8646  * <double*>(vol_frac_n.data))
8647  *
8648  * def generateSplineTables(int pskModelFlag, # <<<<<<<<<<<<<<
8649  * int startIndex, #where to insert into splineTable
8650  * int calcFlag, #f(Sw) or f(psic)
8651  */
8652 
8653  /* function exit code */
8654  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8655  __Pyx_XGIVEREF(__pyx_r);
8656  __Pyx_RefNannyFinishContext();
8657  return __pyx_r;
8658 }
8659 
8660 /* "cTwophaseDarcyCoefficients.pyx":1930
8661  * <double*>(splineTable.data))
8662  *
8663  * def twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
8664  * np.ndarray rowptr,
8665  * np.ndarray colind,
8666  */
8667 
8668 /* Python wrapper */
8669 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_23twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8670 static char __pyx_doc_26cTwophaseDarcyCoefficients_22twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[] = "Evaluate the saturation coefficients\n\nUse the split fractional flow formulation of incompressible, two-phase\nDarcy flow for a heterogeneous medium, sparse diffusion rep het\ncapillary pressure is primary variable\n\n ";
8671 static PyMethodDef __pyx_mdef_26cTwophaseDarcyCoefficients_23twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType = {"twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_26cTwophaseDarcyCoefficients_23twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_26cTwophaseDarcyCoefficients_22twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType};
8672 static PyObject *__pyx_pw_26cTwophaseDarcyCoefficients_23twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8673  int __pyx_v_pskModelFlag;
8674  PyArrayObject *__pyx_v_rowptr = 0;
8675  PyArrayObject *__pyx_v_colind = 0;
8676  PyArrayObject *__pyx_v_matType = 0;
8677  double __pyx_v_muw;
8678  double __pyx_v_mun;
8679  PyArrayObject *__pyx_v_omega = 0;
8680  PyArrayObject *__pyx_v_Kbar = 0;
8681  double __pyx_v_b;
8682  double __pyx_v_capillaryDiffusionScaling;
8683  double __pyx_v_advectionScaling;
8684  PyArrayObject *__pyx_v_rwork_psk = 0;
8685  PyArrayObject *__pyx_v_iwork_psk = 0;
8686  PyArrayObject *__pyx_v_rwork_psk_tol = 0;
8687  PyArrayObject *__pyx_v_rwork_density_w = 0;
8688  PyArrayObject *__pyx_v_rwork_density_n = 0;
8689  PyArrayObject *__pyx_v_g = 0;
8690  PyArrayObject *__pyx_v_qt = 0;
8691  PyArrayObject *__pyx_v_u = 0;
8692  PyArrayObject *__pyx_v_sw = 0;
8693  PyArrayObject *__pyx_v_m = 0;
8694  PyArrayObject *__pyx_v_dm = 0;
8695  PyArrayObject *__pyx_v_phi = 0;
8696  PyArrayObject *__pyx_v_dphi = 0;
8697  PyArrayObject *__pyx_v_f = 0;
8698  PyArrayObject *__pyx_v_df = 0;
8699  PyArrayObject *__pyx_v_a = 0;
8700  PyArrayObject *__pyx_v_da = 0;
8701  int __pyx_lineno = 0;
8702  const char *__pyx_filename = NULL;
8703  int __pyx_clineno = 0;
8704  PyObject *__pyx_r = 0;
8705  __Pyx_RefNannyDeclarations
8706  __Pyx_RefNannySetupContext("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType (wrapper)", 0);
8707  {
8708  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pskModelFlag,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_matType,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_capillaryDiffusionScaling,&__pyx_n_s_advectionScaling,&__pyx_n_s_rwork_psk,&__pyx_n_s_iwork_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_qt,&__pyx_n_s_u,&__pyx_n_s_sw,&__pyx_n_s_m,&__pyx_n_s_dm,&__pyx_n_s_phi,&__pyx_n_s_dphi,&__pyx_n_s_f,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,0};
8709  PyObject* values[28] = {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};
8710  if (unlikely(__pyx_kwds)) {
8711  Py_ssize_t kw_args;
8712  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8713  switch (pos_args) {
8714  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
8715  CYTHON_FALLTHROUGH;
8716  case 1:
8717  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8718  else {
8719  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 1); __PYX_ERR(0, 1930, __pyx_L3_error)
8720  }
8721  CYTHON_FALLTHROUGH;
8722  case 2:
8723  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8724  else {
8725  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 2); __PYX_ERR(0, 1930, __pyx_L3_error)
8726  }
8727  CYTHON_FALLTHROUGH;
8728  case 3:
8729  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
8730  else {
8731  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 3); __PYX_ERR(0, 1930, __pyx_L3_error)
8732  }
8733  CYTHON_FALLTHROUGH;
8734  case 4:
8735  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
8736  else {
8737  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 4); __PYX_ERR(0, 1930, __pyx_L3_error)
8738  }
8739  CYTHON_FALLTHROUGH;
8740  case 5:
8741  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
8742  else {
8743  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 5); __PYX_ERR(0, 1930, __pyx_L3_error)
8744  }
8745  CYTHON_FALLTHROUGH;
8746  case 6:
8747  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
8748  else {
8749  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 6); __PYX_ERR(0, 1930, __pyx_L3_error)
8750  }
8751  CYTHON_FALLTHROUGH;
8752  case 7:
8753  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
8754  else {
8755  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 7); __PYX_ERR(0, 1930, __pyx_L3_error)
8756  }
8757  CYTHON_FALLTHROUGH;
8758  case 8:
8759  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
8760  else {
8761  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 8); __PYX_ERR(0, 1930, __pyx_L3_error)
8762  }
8763  CYTHON_FALLTHROUGH;
8764  case 9:
8765  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
8766  else {
8767  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 9); __PYX_ERR(0, 1930, __pyx_L3_error)
8768  }
8769  CYTHON_FALLTHROUGH;
8770  case 0: break;
8771  default: goto __pyx_L5_argtuple_error;
8772  }
8773  kw_args = PyDict_Size(__pyx_kwds);
8774  switch (pos_args) {
8775  case 0:
8776  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
8777  else goto __pyx_L5_argtuple_error;
8778  CYTHON_FALLTHROUGH;
8779  case 1:
8780  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8781  else {
8782  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 1); __PYX_ERR(0, 1930, __pyx_L3_error)
8783  }
8784  CYTHON_FALLTHROUGH;
8785  case 2:
8786  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8787  else {
8788  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 2); __PYX_ERR(0, 1930, __pyx_L3_error)
8789  }
8790  CYTHON_FALLTHROUGH;
8791  case 3:
8792  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matType)) != 0)) kw_args--;
8793  else {
8794  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 3); __PYX_ERR(0, 1930, __pyx_L3_error)
8795  }
8796  CYTHON_FALLTHROUGH;
8797  case 4:
8798  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
8799  else {
8800  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 4); __PYX_ERR(0, 1930, __pyx_L3_error)
8801  }
8802  CYTHON_FALLTHROUGH;
8803  case 5:
8804  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
8805  else {
8806  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 5); __PYX_ERR(0, 1930, __pyx_L3_error)
8807  }
8808  CYTHON_FALLTHROUGH;
8809  case 6:
8810  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
8811  else {
8812  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 6); __PYX_ERR(0, 1930, __pyx_L3_error)
8813  }
8814  CYTHON_FALLTHROUGH;
8815  case 7:
8816  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
8817  else {
8818  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 7); __PYX_ERR(0, 1930, __pyx_L3_error)
8819  }
8820  CYTHON_FALLTHROUGH;
8821  case 8:
8822  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
8823  else {
8824  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 8); __PYX_ERR(0, 1930, __pyx_L3_error)
8825  }
8826  CYTHON_FALLTHROUGH;
8827  case 9:
8828  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_capillaryDiffusionScaling)) != 0)) kw_args--;
8829  else {
8830  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 9); __PYX_ERR(0, 1930, __pyx_L3_error)
8831  }
8832  CYTHON_FALLTHROUGH;
8833  case 10:
8834  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_advectionScaling)) != 0)) kw_args--;
8835  else {
8836  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 10); __PYX_ERR(0, 1930, __pyx_L3_error)
8837  }
8838  CYTHON_FALLTHROUGH;
8839  case 11:
8840  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
8841  else {
8842  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 11); __PYX_ERR(0, 1930, __pyx_L3_error)
8843  }
8844  CYTHON_FALLTHROUGH;
8845  case 12:
8846  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iwork_psk)) != 0)) kw_args--;
8847  else {
8848  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 12); __PYX_ERR(0, 1930, __pyx_L3_error)
8849  }
8850  CYTHON_FALLTHROUGH;
8851  case 13:
8852  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
8853  else {
8854  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 13); __PYX_ERR(0, 1930, __pyx_L3_error)
8855  }
8856  CYTHON_FALLTHROUGH;
8857  case 14:
8858  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
8859  else {
8860  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 14); __PYX_ERR(0, 1930, __pyx_L3_error)
8861  }
8862  CYTHON_FALLTHROUGH;
8863  case 15:
8864  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
8865  else {
8866  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 15); __PYX_ERR(0, 1930, __pyx_L3_error)
8867  }
8868  CYTHON_FALLTHROUGH;
8869  case 16:
8870  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
8871  else {
8872  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 16); __PYX_ERR(0, 1930, __pyx_L3_error)
8873  }
8874  CYTHON_FALLTHROUGH;
8875  case 17:
8876  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qt)) != 0)) kw_args--;
8877  else {
8878  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 17); __PYX_ERR(0, 1930, __pyx_L3_error)
8879  }
8880  CYTHON_FALLTHROUGH;
8881  case 18:
8882  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--;
8883  else {
8884  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 18); __PYX_ERR(0, 1930, __pyx_L3_error)
8885  }
8886  CYTHON_FALLTHROUGH;
8887  case 19:
8888  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
8889  else {
8890  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 19); __PYX_ERR(0, 1930, __pyx_L3_error)
8891  }
8892  CYTHON_FALLTHROUGH;
8893  case 20:
8894  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
8895  else {
8896  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 20); __PYX_ERR(0, 1930, __pyx_L3_error)
8897  }
8898  CYTHON_FALLTHROUGH;
8899  case 21:
8900  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
8901  else {
8902  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 21); __PYX_ERR(0, 1930, __pyx_L3_error)
8903  }
8904  CYTHON_FALLTHROUGH;
8905  case 22:
8906  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
8907  else {
8908  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 22); __PYX_ERR(0, 1930, __pyx_L3_error)
8909  }
8910  CYTHON_FALLTHROUGH;
8911  case 23:
8912  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
8913  else {
8914  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 23); __PYX_ERR(0, 1930, __pyx_L3_error)
8915  }
8916  CYTHON_FALLTHROUGH;
8917  case 24:
8918  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
8919  else {
8920  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 24); __PYX_ERR(0, 1930, __pyx_L3_error)
8921  }
8922  CYTHON_FALLTHROUGH;
8923  case 25:
8924  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
8925  else {
8926  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 25); __PYX_ERR(0, 1930, __pyx_L3_error)
8927  }
8928  CYTHON_FALLTHROUGH;
8929  case 26:
8930  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
8931  else {
8932  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 26); __PYX_ERR(0, 1930, __pyx_L3_error)
8933  }
8934  CYTHON_FALLTHROUGH;
8935  case 27:
8936  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
8937  else {
8938  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, 27); __PYX_ERR(0, 1930, __pyx_L3_error)
8939  }
8940  }
8941  if (unlikely(kw_args > 0)) {
8942  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType") < 0)) __PYX_ERR(0, 1930, __pyx_L3_error)
8943  }
8944  } else if (PyTuple_GET_SIZE(__pyx_args) != 28) {
8945  goto __pyx_L5_argtuple_error;
8946  } else {
8947  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8948  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8949  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8950  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8951  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8952  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8953  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8954  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8955  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8956  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8957  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8958  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8959  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8960  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8961  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8962  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8963  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8964  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8965  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8966  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8967  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
8968  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
8969  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
8970  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
8971  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
8972  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
8973  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
8974  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
8975  }
8976  __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pskModelFlag == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L3_error)
8977  __pyx_v_rowptr = ((PyArrayObject *)values[1]);
8978  __pyx_v_colind = ((PyArrayObject *)values[2]);
8979  __pyx_v_matType = ((PyArrayObject *)values[3]);
8980  __pyx_v_muw = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_muw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1934, __pyx_L3_error)
8981  __pyx_v_mun = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_mun == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
8982  __pyx_v_omega = ((PyArrayObject *)values[6]);
8983  __pyx_v_Kbar = ((PyArrayObject *)values[7]);
8984  __pyx_v_b = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1938, __pyx_L3_error)
8985  __pyx_v_capillaryDiffusionScaling = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_capillaryDiffusionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1939, __pyx_L3_error)
8986  __pyx_v_advectionScaling = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_advectionScaling == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1940, __pyx_L3_error)
8987  __pyx_v_rwork_psk = ((PyArrayObject *)values[11]);
8988  __pyx_v_iwork_psk = ((PyArrayObject *)values[12]);
8989  __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[13]);
8990  __pyx_v_rwork_density_w = ((PyArrayObject *)values[14]);
8991  __pyx_v_rwork_density_n = ((PyArrayObject *)values[15]);
8992  __pyx_v_g = ((PyArrayObject *)values[16]);
8993  __pyx_v_qt = ((PyArrayObject *)values[17]);
8994  __pyx_v_u = ((PyArrayObject *)values[18]);
8995  __pyx_v_sw = ((PyArrayObject *)values[19]);
8996  __pyx_v_m = ((PyArrayObject *)values[20]);
8997  __pyx_v_dm = ((PyArrayObject *)values[21]);
8998  __pyx_v_phi = ((PyArrayObject *)values[22]);
8999  __pyx_v_dphi = ((PyArrayObject *)values[23]);
9000  __pyx_v_f = ((PyArrayObject *)values[24]);
9001  __pyx_v_df = ((PyArrayObject *)values[25]);
9002  __pyx_v_a = ((PyArrayObject *)values[26]);
9003  __pyx_v_da = ((PyArrayObject *)values[27]);
9004  }
9005  goto __pyx_L4_argument_unpacking_done;
9006  __pyx_L5_argtuple_error:;
9007  __Pyx_RaiseArgtupleInvalid("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 1, 28, 28, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1930, __pyx_L3_error)
9008  __pyx_L3_error:;
9009  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
9010  __Pyx_RefNannyFinishContext();
9011  return NULL;
9012  __pyx_L4_argument_unpacking_done:;
9013  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1931, __pyx_L1_error)
9014  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1932, __pyx_L1_error)
9015  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matType), __pyx_ptype_5numpy_ndarray, 1, "matType", 0))) __PYX_ERR(0, 1933, __pyx_L1_error)
9016  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1, "omega", 0))) __PYX_ERR(0, 1936, __pyx_L1_error)
9017  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1, "Kbar", 0))) __PYX_ERR(0, 1937, __pyx_L1_error)
9018  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk", 0))) __PYX_ERR(0, 1941, __pyx_L1_error)
9019  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iwork_psk), __pyx_ptype_5numpy_ndarray, 1, "iwork_psk", 0))) __PYX_ERR(0, 1942, __pyx_L1_error)
9020  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1, "rwork_psk_tol", 0))) __PYX_ERR(0, 1943, __pyx_L1_error)
9021  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_w", 0))) __PYX_ERR(0, 1944, __pyx_L1_error)
9022  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1, "rwork_density_n", 0))) __PYX_ERR(0, 1945, __pyx_L1_error)
9023  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9024  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qt), __pyx_ptype_5numpy_ndarray, 1, "qt", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9025  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_5numpy_ndarray, 1, "u", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9026  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_ptype_5numpy_ndarray, 1, "sw", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9027  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9028  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9029  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi), __pyx_ptype_5numpy_ndarray, 1, "phi", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9030  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 1946, __pyx_L1_error)
9031  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1947, __pyx_L1_error)
9032  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 1947, __pyx_L1_error)
9033  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1947, __pyx_L1_error)
9034  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 1947, __pyx_L1_error)
9035  __pyx_r = __pyx_pf_26cTwophaseDarcyCoefficients_22twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(__pyx_self, __pyx_v_pskModelFlag, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_matType, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, __pyx_v_rwork_psk, __pyx_v_iwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_qt, __pyx_v_u, __pyx_v_sw, __pyx_v_m, __pyx_v_dm, __pyx_v_phi, __pyx_v_dphi, __pyx_v_f, __pyx_v_df, __pyx_v_a, __pyx_v_da);
9036 
9037  /* function exit code */
9038  goto __pyx_L0;
9039  __pyx_L1_error:;
9040  __pyx_r = NULL;
9041  __pyx_L0:;
9042  __Pyx_RefNannyFinishContext();
9043  return __pyx_r;
9044 }
9045 
9046 static PyObject *__pyx_pf_26cTwophaseDarcyCoefficients_22twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_pskModelFlag, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_matType, double __pyx_v_muw, double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar, double __pyx_v_b, double __pyx_v_capillaryDiffusionScaling, double __pyx_v_advectionScaling, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_iwork_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_qt, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_sw, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da) {
9047  int __pyx_v_nPointsPerSimplex;
9048  int __pyx_v_nSimplex;
9049  PyObject *__pyx_r = NULL;
9050  __Pyx_RefNannyDeclarations
9051  PyObject *__pyx_t_1 = NULL;
9052  PyObject *__pyx_t_2 = NULL;
9053  PyObject *__pyx_t_3 = NULL;
9054  int __pyx_t_4;
9055  int __pyx_lineno = 0;
9056  const char *__pyx_filename = NULL;
9057  int __pyx_clineno = 0;
9058  __Pyx_RefNannySetupContext("twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", 0);
9059 
9060  /* "cTwophaseDarcyCoefficients.pyx":1955
9061  *
9062  * """
9063  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1] # <<<<<<<<<<<<<<
9064  * cdef int nSimplex=sw.size/nPointsPerSimplex
9065  * if pskModelFlag == 0:
9066  */
9067  __pyx_v_nPointsPerSimplex = (__pyx_v_sw->dimensions[(__pyx_v_sw->nd - 1)]);
9068 
9069  /* "cTwophaseDarcyCoefficients.pyx":1956
9070  * """
9071  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
9072  * cdef int nSimplex=sw.size/nPointsPerSimplex # <<<<<<<<<<<<<<
9073  * if pskModelFlag == 0:
9074  * tpdc.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[SimplePSK](nSimplex,
9075  */
9076  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sw), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1956, __pyx_L1_error)
9077  __Pyx_GOTREF(__pyx_t_1);
9078  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nPointsPerSimplex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1956, __pyx_L1_error)
9079  __Pyx_GOTREF(__pyx_t_2);
9080  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1956, __pyx_L1_error)
9081  __Pyx_GOTREF(__pyx_t_3);
9082  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9083  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9084  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L1_error)
9085  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9086  __pyx_v_nSimplex = __pyx_t_4;
9087 
9088  /* "cTwophaseDarcyCoefficients.pyx":1957
9089  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
9090  * cdef int nSimplex=sw.size/nPointsPerSimplex
9091  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
9092  * tpdc.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[SimplePSK](nSimplex,
9093  * nPointsPerSimplex,
9094  */
9095  switch (__pyx_v_pskModelFlag) {
9096  case 0:
9097 
9098  /* "cTwophaseDarcyCoefficients.pyx":1958
9099  * cdef int nSimplex=sw.size/nPointsPerSimplex
9100  * if pskModelFlag == 0:
9101  * tpdc.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[SimplePSK](nSimplex, # <<<<<<<<<<<<<<
9102  * nPointsPerSimplex,
9103  * g.shape[0],
9104  */
9105  (void)(twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType<SimplePSK>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_u->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
9106 
9107  /* "cTwophaseDarcyCoefficients.pyx":1957
9108  * cdef int nPointsPerSimplex=sw.shape[sw.ndim-1]
9109  * cdef int nSimplex=sw.size/nPointsPerSimplex
9110  * if pskModelFlag == 0: # <<<<<<<<<<<<<<
9111  * tpdc.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[SimplePSK](nSimplex,
9112  * nPointsPerSimplex,
9113  */
9114  break;
9115  case 1:
9116 
9117  /* "cTwophaseDarcyCoefficients.pyx":1979
9118  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
9119  * elif pskModelFlag == 1:
9120  * tpdc.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[VGM](nSimplex, # <<<<<<<<<<<<<<
9121  * nPointsPerSimplex,
9122  * g.shape[0],
9123  */
9124  (void)(twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType<VGM>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 4, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_u->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
9125 
9126  /* "cTwophaseDarcyCoefficients.pyx":1978
9127  * <double*>(dm.data), <double*>(phi.data), <double*>(dphi.data), <double*>(f.data),
9128  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
9129  * elif pskModelFlag == 1: # <<<<<<<<<<<<<<
9130  * tpdc.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[VGM](nSimplex,
9131  * nPointsPerSimplex,
9132  */
9133  break;
9134  default:
9135 
9136  /* "cTwophaseDarcyCoefficients.pyx":2000
9137  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
9138  * else:
9139  * tpdc.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType[SimplePSK](nSimplex, # <<<<<<<<<<<<<<
9140  * nPointsPerSimplex,
9141  * g.shape[0],
9142  */
9143  (void)(twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType<SimplePSK>(__pyx_v_nSimplex, __pyx_v_nPointsPerSimplex, (__pyx_v_g->dimensions[0]), 2, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((int *)__pyx_v_matType->data), __pyx_v_muw, __pyx_v_mun, ((double *)__pyx_v_omega->data), ((double *)__pyx_v_Kbar->data), __pyx_v_b, __pyx_v_capillaryDiffusionScaling, __pyx_v_advectionScaling, ((double *)__pyx_v_rwork_psk->data), ((int *)__pyx_v_iwork_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_qt->data), ((double *)__pyx_v_u->data), ((double *)__pyx_v_sw->data), ((double *)__pyx_v_m->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data)));
9144  break;
9145  }
9146 
9147  /* "cTwophaseDarcyCoefficients.pyx":1930
9148  * <double*>(splineTable.data))
9149  *
9150  * def twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
9151  * np.ndarray rowptr,
9152  * np.ndarray colind,
9153  */
9154 
9155  /* function exit code */
9156  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9157  goto __pyx_L0;
9158  __pyx_L1_error:;
9159  __Pyx_XDECREF(__pyx_t_1);
9160  __Pyx_XDECREF(__pyx_t_2);
9161  __Pyx_XDECREF(__pyx_t_3);
9162  __Pyx_AddTraceback("cTwophaseDarcyCoefficients.twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType", __pyx_clineno, __pyx_lineno, __pyx_filename);
9163  __pyx_r = NULL;
9164  __pyx_L0:;
9165  __Pyx_XGIVEREF(__pyx_r);
9166  __Pyx_RefNannyFinishContext();
9167  return __pyx_r;
9168 }
9169 
9170 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
9171  * ctypedef npy_cdouble complex_t
9172  *
9173  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
9174  * return PyArray_MultiIterNew(1, <void*>a)
9175  *
9176  */
9177 
9178 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
9179  PyObject *__pyx_r = NULL;
9180  __Pyx_RefNannyDeclarations
9181  PyObject *__pyx_t_1 = NULL;
9182  int __pyx_lineno = 0;
9183  const char *__pyx_filename = NULL;
9184  int __pyx_clineno = 0;
9185  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
9186 
9187  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
9188  *
9189  * cdef inline object PyArray_MultiIterNew1(a):
9190  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
9191  *
9192  * cdef inline object PyArray_MultiIterNew2(a, b):
9193  */
9194  __Pyx_XDECREF(__pyx_r);
9195  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
9196  __Pyx_GOTREF(__pyx_t_1);
9197  __pyx_r = __pyx_t_1;
9198  __pyx_t_1 = 0;
9199  goto __pyx_L0;
9200 
9201  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
9202  * ctypedef npy_cdouble complex_t
9203  *
9204  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
9205  * return PyArray_MultiIterNew(1, <void*>a)
9206  *
9207  */
9208 
9209  /* function exit code */
9210  __pyx_L1_error:;
9211  __Pyx_XDECREF(__pyx_t_1);
9212  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9213  __pyx_r = 0;
9214  __pyx_L0:;
9215  __Pyx_XGIVEREF(__pyx_r);
9216  __Pyx_RefNannyFinishContext();
9217  return __pyx_r;
9218 }
9219 
9220 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
9221  * return PyArray_MultiIterNew(1, <void*>a)
9222  *
9223  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
9224  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
9225  *
9226  */
9227 
9228 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
9229  PyObject *__pyx_r = NULL;
9230  __Pyx_RefNannyDeclarations
9231  PyObject *__pyx_t_1 = NULL;
9232  int __pyx_lineno = 0;
9233  const char *__pyx_filename = NULL;
9234  int __pyx_clineno = 0;
9235  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
9236 
9237  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
9238  *
9239  * cdef inline object PyArray_MultiIterNew2(a, b):
9240  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
9241  *
9242  * cdef inline object PyArray_MultiIterNew3(a, b, c):
9243  */
9244  __Pyx_XDECREF(__pyx_r);
9245  __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)
9246  __Pyx_GOTREF(__pyx_t_1);
9247  __pyx_r = __pyx_t_1;
9248  __pyx_t_1 = 0;
9249  goto __pyx_L0;
9250 
9251  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
9252  * return PyArray_MultiIterNew(1, <void*>a)
9253  *
9254  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
9255  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
9256  *
9257  */
9258 
9259  /* function exit code */
9260  __pyx_L1_error:;
9261  __Pyx_XDECREF(__pyx_t_1);
9262  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
9263  __pyx_r = 0;
9264  __pyx_L0:;
9265  __Pyx_XGIVEREF(__pyx_r);
9266  __Pyx_RefNannyFinishContext();
9267  return __pyx_r;
9268 }
9269 
9270 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
9271  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
9272  *
9273  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
9274  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
9275  *
9276  */
9277 
9278 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
9279  PyObject *__pyx_r = NULL;
9280  __Pyx_RefNannyDeclarations
9281  PyObject *__pyx_t_1 = NULL;
9282  int __pyx_lineno = 0;
9283  const char *__pyx_filename = NULL;
9284  int __pyx_clineno = 0;
9285  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
9286 
9287  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
9288  *
9289  * cdef inline object PyArray_MultiIterNew3(a, b, c):
9290  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
9291  *
9292  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
9293  */
9294  __Pyx_XDECREF(__pyx_r);
9295  __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)
9296  __Pyx_GOTREF(__pyx_t_1);
9297  __pyx_r = __pyx_t_1;
9298  __pyx_t_1 = 0;
9299  goto __pyx_L0;
9300 
9301  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
9302  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
9303  *
9304  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
9305  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
9306  *
9307  */
9308 
9309  /* function exit code */
9310  __pyx_L1_error:;
9311  __Pyx_XDECREF(__pyx_t_1);
9312  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
9313  __pyx_r = 0;
9314  __pyx_L0:;
9315  __Pyx_XGIVEREF(__pyx_r);
9316  __Pyx_RefNannyFinishContext();
9317  return __pyx_r;
9318 }
9319 
9320 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
9321  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
9322  *
9323  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
9324  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
9325  *
9326  */
9327 
9328 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) {
9329  PyObject *__pyx_r = NULL;
9330  __Pyx_RefNannyDeclarations
9331  PyObject *__pyx_t_1 = NULL;
9332  int __pyx_lineno = 0;
9333  const char *__pyx_filename = NULL;
9334  int __pyx_clineno = 0;
9335  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
9336 
9337  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
9338  *
9339  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
9340  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
9341  *
9342  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
9343  */
9344  __Pyx_XDECREF(__pyx_r);
9345  __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)
9346  __Pyx_GOTREF(__pyx_t_1);
9347  __pyx_r = __pyx_t_1;
9348  __pyx_t_1 = 0;
9349  goto __pyx_L0;
9350 
9351  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
9352  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
9353  *
9354  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
9355  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
9356  *
9357  */
9358 
9359  /* function exit code */
9360  __pyx_L1_error:;
9361  __Pyx_XDECREF(__pyx_t_1);
9362  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
9363  __pyx_r = 0;
9364  __pyx_L0:;
9365  __Pyx_XGIVEREF(__pyx_r);
9366  __Pyx_RefNannyFinishContext();
9367  return __pyx_r;
9368 }
9369 
9370 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
9371  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
9372  *
9373  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
9374  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
9375  *
9376  */
9377 
9378 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) {
9379  PyObject *__pyx_r = NULL;
9380  __Pyx_RefNannyDeclarations
9381  PyObject *__pyx_t_1 = NULL;
9382  int __pyx_lineno = 0;
9383  const char *__pyx_filename = NULL;
9384  int __pyx_clineno = 0;
9385  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
9386 
9387  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
9388  *
9389  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
9390  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
9391  *
9392  * cdef inline tuple PyDataType_SHAPE(dtype d):
9393  */
9394  __Pyx_XDECREF(__pyx_r);
9395  __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)
9396  __Pyx_GOTREF(__pyx_t_1);
9397  __pyx_r = __pyx_t_1;
9398  __pyx_t_1 = 0;
9399  goto __pyx_L0;
9400 
9401  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
9402  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
9403  *
9404  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
9405  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
9406  *
9407  */
9408 
9409  /* function exit code */
9410  __pyx_L1_error:;
9411  __Pyx_XDECREF(__pyx_t_1);
9412  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
9413  __pyx_r = 0;
9414  __pyx_L0:;
9415  __Pyx_XGIVEREF(__pyx_r);
9416  __Pyx_RefNannyFinishContext();
9417  return __pyx_r;
9418 }
9419 
9420 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
9421  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
9422  *
9423  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
9424  * if PyDataType_HASSUBARRAY(d):
9425  * return <tuple>d.subarray.shape
9426  */
9427 
9428 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
9429  PyObject *__pyx_r = NULL;
9430  __Pyx_RefNannyDeclarations
9431  int __pyx_t_1;
9432  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
9433 
9434  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
9435  *
9436  * cdef inline tuple PyDataType_SHAPE(dtype d):
9437  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
9438  * return <tuple>d.subarray.shape
9439  * else:
9440  */
9441  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
9442  if (__pyx_t_1) {
9443 
9444  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
9445  * cdef inline tuple PyDataType_SHAPE(dtype d):
9446  * if PyDataType_HASSUBARRAY(d):
9447  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
9448  * else:
9449  * return ()
9450  */
9451  __Pyx_XDECREF(__pyx_r);
9452  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
9453  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
9454  goto __pyx_L0;
9455 
9456  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
9457  *
9458  * cdef inline tuple PyDataType_SHAPE(dtype d):
9459  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
9460  * return <tuple>d.subarray.shape
9461  * else:
9462  */
9463  }
9464 
9465  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
9466  * return <tuple>d.subarray.shape
9467  * else:
9468  * return () # <<<<<<<<<<<<<<
9469  *
9470  *
9471  */
9472  /*else*/ {
9473  __Pyx_XDECREF(__pyx_r);
9474  __Pyx_INCREF(__pyx_empty_tuple);
9475  __pyx_r = __pyx_empty_tuple;
9476  goto __pyx_L0;
9477  }
9478 
9479  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
9480  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
9481  *
9482  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
9483  * if PyDataType_HASSUBARRAY(d):
9484  * return <tuple>d.subarray.shape
9485  */
9486 
9487  /* function exit code */
9488  __pyx_L0:;
9489  __Pyx_XGIVEREF(__pyx_r);
9490  __Pyx_RefNannyFinishContext();
9491  return __pyx_r;
9492 }
9493 
9494 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
9495  * int _import_umath() except -1
9496  *
9497  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
9498  * Py_INCREF(base) # important to do this before stealing the reference below!
9499  * PyArray_SetBaseObject(arr, base)
9500  */
9501 
9502 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
9503  __Pyx_RefNannyDeclarations
9504  __Pyx_RefNannySetupContext("set_array_base", 0);
9505 
9506  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
9507  *
9508  * cdef inline void set_array_base(ndarray arr, object base):
9509  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
9510  * PyArray_SetBaseObject(arr, base)
9511  *
9512  */
9513  Py_INCREF(__pyx_v_base);
9514 
9515  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
9516  * cdef inline void set_array_base(ndarray arr, object base):
9517  * Py_INCREF(base) # important to do this before stealing the reference below!
9518  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
9519  *
9520  * cdef inline object get_array_base(ndarray arr):
9521  */
9522  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
9523 
9524  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
9525  * int _import_umath() except -1
9526  *
9527  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
9528  * Py_INCREF(base) # important to do this before stealing the reference below!
9529  * PyArray_SetBaseObject(arr, base)
9530  */
9531 
9532  /* function exit code */
9533  __Pyx_RefNannyFinishContext();
9534 }
9535 
9536 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
9537  * PyArray_SetBaseObject(arr, base)
9538  *
9539  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
9540  * base = PyArray_BASE(arr)
9541  * if base is NULL:
9542  */
9543 
9544 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
9545  PyObject *__pyx_v_base;
9546  PyObject *__pyx_r = NULL;
9547  __Pyx_RefNannyDeclarations
9548  int __pyx_t_1;
9549  __Pyx_RefNannySetupContext("get_array_base", 0);
9550 
9551  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
9552  *
9553  * cdef inline object get_array_base(ndarray arr):
9554  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
9555  * if base is NULL:
9556  * return None
9557  */
9558  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
9559 
9560  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
9561  * cdef inline object get_array_base(ndarray arr):
9562  * base = PyArray_BASE(arr)
9563  * if base is NULL: # <<<<<<<<<<<<<<
9564  * return None
9565  * return <object>base
9566  */
9567  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
9568  if (__pyx_t_1) {
9569 
9570  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
9571  * base = PyArray_BASE(arr)
9572  * if base is NULL:
9573  * return None # <<<<<<<<<<<<<<
9574  * return <object>base
9575  *
9576  */
9577  __Pyx_XDECREF(__pyx_r);
9578  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9579  goto __pyx_L0;
9580 
9581  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
9582  * cdef inline object get_array_base(ndarray arr):
9583  * base = PyArray_BASE(arr)
9584  * if base is NULL: # <<<<<<<<<<<<<<
9585  * return None
9586  * return <object>base
9587  */
9588  }
9589 
9590  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
9591  * if base is NULL:
9592  * return None
9593  * return <object>base # <<<<<<<<<<<<<<
9594  *
9595  * # Versions of the import_* functions which are more suitable for
9596  */
9597  __Pyx_XDECREF(__pyx_r);
9598  __Pyx_INCREF(((PyObject *)__pyx_v_base));
9599  __pyx_r = ((PyObject *)__pyx_v_base);
9600  goto __pyx_L0;
9601 
9602  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
9603  * PyArray_SetBaseObject(arr, base)
9604  *
9605  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
9606  * base = PyArray_BASE(arr)
9607  * if base is NULL:
9608  */
9609 
9610  /* function exit code */
9611  __pyx_L0:;
9612  __Pyx_XGIVEREF(__pyx_r);
9613  __Pyx_RefNannyFinishContext();
9614  return __pyx_r;
9615 }
9616 
9617 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
9618  * # Versions of the import_* functions which are more suitable for
9619  * # Cython code.
9620  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
9621  * try:
9622  * __pyx_import_array()
9623  */
9624 
9625 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
9626  int __pyx_r;
9627  __Pyx_RefNannyDeclarations
9628  PyObject *__pyx_t_1 = NULL;
9629  PyObject *__pyx_t_2 = NULL;
9630  PyObject *__pyx_t_3 = NULL;
9631  int __pyx_t_4;
9632  PyObject *__pyx_t_5 = NULL;
9633  PyObject *__pyx_t_6 = NULL;
9634  PyObject *__pyx_t_7 = NULL;
9635  PyObject *__pyx_t_8 = NULL;
9636  int __pyx_lineno = 0;
9637  const char *__pyx_filename = NULL;
9638  int __pyx_clineno = 0;
9639  __Pyx_RefNannySetupContext("import_array", 0);
9640 
9641  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
9642  * # Cython code.
9643  * cdef inline int import_array() except -1:
9644  * try: # <<<<<<<<<<<<<<
9645  * __pyx_import_array()
9646  * except Exception:
9647  */
9648  {
9649  __Pyx_PyThreadState_declare
9650  __Pyx_PyThreadState_assign
9651  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9652  __Pyx_XGOTREF(__pyx_t_1);
9653  __Pyx_XGOTREF(__pyx_t_2);
9654  __Pyx_XGOTREF(__pyx_t_3);
9655  /*try:*/ {
9656 
9657  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
9658  * cdef inline int import_array() except -1:
9659  * try:
9660  * __pyx_import_array() # <<<<<<<<<<<<<<
9661  * except Exception:
9662  * raise ImportError("numpy.core.multiarray failed to import")
9663  */
9664  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
9665 
9666  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
9667  * # Cython code.
9668  * cdef inline int import_array() except -1:
9669  * try: # <<<<<<<<<<<<<<
9670  * __pyx_import_array()
9671  * except Exception:
9672  */
9673  }
9674  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9675  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9676  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9677  goto __pyx_L8_try_end;
9678  __pyx_L3_error:;
9679 
9680  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
9681  * try:
9682  * __pyx_import_array()
9683  * except Exception: # <<<<<<<<<<<<<<
9684  * raise ImportError("numpy.core.multiarray failed to import")
9685  *
9686  */
9687  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9688  if (__pyx_t_4) {
9689  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
9690  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
9691  __Pyx_GOTREF(__pyx_t_5);
9692  __Pyx_GOTREF(__pyx_t_6);
9693  __Pyx_GOTREF(__pyx_t_7);
9694 
9695  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
9696  * __pyx_import_array()
9697  * except Exception:
9698  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
9699  *
9700  * cdef inline int import_umath() except -1:
9701  */
9702  __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)
9703  __Pyx_GOTREF(__pyx_t_8);
9704  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9705  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9706  __PYX_ERR(1, 945, __pyx_L5_except_error)
9707  }
9708  goto __pyx_L5_except_error;
9709  __pyx_L5_except_error:;
9710 
9711  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
9712  * # Cython code.
9713  * cdef inline int import_array() except -1:
9714  * try: # <<<<<<<<<<<<<<
9715  * __pyx_import_array()
9716  * except Exception:
9717  */
9718  __Pyx_XGIVEREF(__pyx_t_1);
9719  __Pyx_XGIVEREF(__pyx_t_2);
9720  __Pyx_XGIVEREF(__pyx_t_3);
9721  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9722  goto __pyx_L1_error;
9723  __pyx_L8_try_end:;
9724  }
9725 
9726  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
9727  * # Versions of the import_* functions which are more suitable for
9728  * # Cython code.
9729  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
9730  * try:
9731  * __pyx_import_array()
9732  */
9733 
9734  /* function exit code */
9735  __pyx_r = 0;
9736  goto __pyx_L0;
9737  __pyx_L1_error:;
9738  __Pyx_XDECREF(__pyx_t_5);
9739  __Pyx_XDECREF(__pyx_t_6);
9740  __Pyx_XDECREF(__pyx_t_7);
9741  __Pyx_XDECREF(__pyx_t_8);
9742  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
9743  __pyx_r = -1;
9744  __pyx_L0:;
9745  __Pyx_RefNannyFinishContext();
9746  return __pyx_r;
9747 }
9748 
9749 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
9750  * raise ImportError("numpy.core.multiarray failed to import")
9751  *
9752  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
9753  * try:
9754  * _import_umath()
9755  */
9756 
9757 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
9758  int __pyx_r;
9759  __Pyx_RefNannyDeclarations
9760  PyObject *__pyx_t_1 = NULL;
9761  PyObject *__pyx_t_2 = NULL;
9762  PyObject *__pyx_t_3 = NULL;
9763  int __pyx_t_4;
9764  PyObject *__pyx_t_5 = NULL;
9765  PyObject *__pyx_t_6 = NULL;
9766  PyObject *__pyx_t_7 = NULL;
9767  PyObject *__pyx_t_8 = NULL;
9768  int __pyx_lineno = 0;
9769  const char *__pyx_filename = NULL;
9770  int __pyx_clineno = 0;
9771  __Pyx_RefNannySetupContext("import_umath", 0);
9772 
9773  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
9774  *
9775  * cdef inline int import_umath() except -1:
9776  * try: # <<<<<<<<<<<<<<
9777  * _import_umath()
9778  * except Exception:
9779  */
9780  {
9781  __Pyx_PyThreadState_declare
9782  __Pyx_PyThreadState_assign
9783  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9784  __Pyx_XGOTREF(__pyx_t_1);
9785  __Pyx_XGOTREF(__pyx_t_2);
9786  __Pyx_XGOTREF(__pyx_t_3);
9787  /*try:*/ {
9788 
9789  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
9790  * cdef inline int import_umath() except -1:
9791  * try:
9792  * _import_umath() # <<<<<<<<<<<<<<
9793  * except Exception:
9794  * raise ImportError("numpy.core.umath failed to import")
9795  */
9796  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
9797 
9798  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
9799  *
9800  * cdef inline int import_umath() except -1:
9801  * try: # <<<<<<<<<<<<<<
9802  * _import_umath()
9803  * except Exception:
9804  */
9805  }
9806  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9807  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9808  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9809  goto __pyx_L8_try_end;
9810  __pyx_L3_error:;
9811 
9812  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
9813  * try:
9814  * _import_umath()
9815  * except Exception: # <<<<<<<<<<<<<<
9816  * raise ImportError("numpy.core.umath failed to import")
9817  *
9818  */
9819  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9820  if (__pyx_t_4) {
9821  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9822  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
9823  __Pyx_GOTREF(__pyx_t_5);
9824  __Pyx_GOTREF(__pyx_t_6);
9825  __Pyx_GOTREF(__pyx_t_7);
9826 
9827  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
9828  * _import_umath()
9829  * except Exception:
9830  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
9831  *
9832  * cdef inline int import_ufunc() except -1:
9833  */
9834  __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)
9835  __Pyx_GOTREF(__pyx_t_8);
9836  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9837  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9838  __PYX_ERR(1, 951, __pyx_L5_except_error)
9839  }
9840  goto __pyx_L5_except_error;
9841  __pyx_L5_except_error:;
9842 
9843  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
9844  *
9845  * cdef inline int import_umath() except -1:
9846  * try: # <<<<<<<<<<<<<<
9847  * _import_umath()
9848  * except Exception:
9849  */
9850  __Pyx_XGIVEREF(__pyx_t_1);
9851  __Pyx_XGIVEREF(__pyx_t_2);
9852  __Pyx_XGIVEREF(__pyx_t_3);
9853  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9854  goto __pyx_L1_error;
9855  __pyx_L8_try_end:;
9856  }
9857 
9858  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
9859  * raise ImportError("numpy.core.multiarray failed to import")
9860  *
9861  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
9862  * try:
9863  * _import_umath()
9864  */
9865 
9866  /* function exit code */
9867  __pyx_r = 0;
9868  goto __pyx_L0;
9869  __pyx_L1_error:;
9870  __Pyx_XDECREF(__pyx_t_5);
9871  __Pyx_XDECREF(__pyx_t_6);
9872  __Pyx_XDECREF(__pyx_t_7);
9873  __Pyx_XDECREF(__pyx_t_8);
9874  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9875  __pyx_r = -1;
9876  __pyx_L0:;
9877  __Pyx_RefNannyFinishContext();
9878  return __pyx_r;
9879 }
9880 
9881 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
9882  * raise ImportError("numpy.core.umath failed to import")
9883  *
9884  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
9885  * try:
9886  * _import_umath()
9887  */
9888 
9889 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
9890  int __pyx_r;
9891  __Pyx_RefNannyDeclarations
9892  PyObject *__pyx_t_1 = NULL;
9893  PyObject *__pyx_t_2 = NULL;
9894  PyObject *__pyx_t_3 = NULL;
9895  int __pyx_t_4;
9896  PyObject *__pyx_t_5 = NULL;
9897  PyObject *__pyx_t_6 = NULL;
9898  PyObject *__pyx_t_7 = NULL;
9899  PyObject *__pyx_t_8 = NULL;
9900  int __pyx_lineno = 0;
9901  const char *__pyx_filename = NULL;
9902  int __pyx_clineno = 0;
9903  __Pyx_RefNannySetupContext("import_ufunc", 0);
9904 
9905  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
9906  *
9907  * cdef inline int import_ufunc() except -1:
9908  * try: # <<<<<<<<<<<<<<
9909  * _import_umath()
9910  * except Exception:
9911  */
9912  {
9913  __Pyx_PyThreadState_declare
9914  __Pyx_PyThreadState_assign
9915  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9916  __Pyx_XGOTREF(__pyx_t_1);
9917  __Pyx_XGOTREF(__pyx_t_2);
9918  __Pyx_XGOTREF(__pyx_t_3);
9919  /*try:*/ {
9920 
9921  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
9922  * cdef inline int import_ufunc() except -1:
9923  * try:
9924  * _import_umath() # <<<<<<<<<<<<<<
9925  * except Exception:
9926  * raise ImportError("numpy.core.umath failed to import")
9927  */
9928  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
9929 
9930  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
9931  *
9932  * cdef inline int import_ufunc() except -1:
9933  * try: # <<<<<<<<<<<<<<
9934  * _import_umath()
9935  * except Exception:
9936  */
9937  }
9938  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9939  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9940  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9941  goto __pyx_L8_try_end;
9942  __pyx_L3_error:;
9943 
9944  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
9945  * try:
9946  * _import_umath()
9947  * except Exception: # <<<<<<<<<<<<<<
9948  * raise ImportError("numpy.core.umath failed to import")
9949  *
9950  */
9951  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9952  if (__pyx_t_4) {
9953  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9954  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
9955  __Pyx_GOTREF(__pyx_t_5);
9956  __Pyx_GOTREF(__pyx_t_6);
9957  __Pyx_GOTREF(__pyx_t_7);
9958 
9959  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
9960  * _import_umath()
9961  * except Exception:
9962  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
9963  *
9964  * cdef extern from *:
9965  */
9966  __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)
9967  __Pyx_GOTREF(__pyx_t_8);
9968  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9969  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9970  __PYX_ERR(1, 957, __pyx_L5_except_error)
9971  }
9972  goto __pyx_L5_except_error;
9973  __pyx_L5_except_error:;
9974 
9975  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
9976  *
9977  * cdef inline int import_ufunc() except -1:
9978  * try: # <<<<<<<<<<<<<<
9979  * _import_umath()
9980  * except Exception:
9981  */
9982  __Pyx_XGIVEREF(__pyx_t_1);
9983  __Pyx_XGIVEREF(__pyx_t_2);
9984  __Pyx_XGIVEREF(__pyx_t_3);
9985  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9986  goto __pyx_L1_error;
9987  __pyx_L8_try_end:;
9988  }
9989 
9990  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
9991  * raise ImportError("numpy.core.umath failed to import")
9992  *
9993  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
9994  * try:
9995  * _import_umath()
9996  */
9997 
9998  /* function exit code */
9999  __pyx_r = 0;
10000  goto __pyx_L0;
10001  __pyx_L1_error:;
10002  __Pyx_XDECREF(__pyx_t_5);
10003  __Pyx_XDECREF(__pyx_t_6);
10004  __Pyx_XDECREF(__pyx_t_7);
10005  __Pyx_XDECREF(__pyx_t_8);
10006  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
10007  __pyx_r = -1;
10008  __pyx_L0:;
10009  __Pyx_RefNannyFinishContext();
10010  return __pyx_r;
10011 }
10012 
10013 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
10014  *
10015  *
10016  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
10017  * """
10018  * Cython equivalent of `isinstance(obj, np.timedelta64)`
10019  */
10020 
10021 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
10022  int __pyx_r;
10023  __Pyx_RefNannyDeclarations
10024  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
10025 
10026  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
10027  * bool
10028  * """
10029  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
10030  *
10031  *
10032  */
10033  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
10034  goto __pyx_L0;
10035 
10036  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
10037  *
10038  *
10039  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
10040  * """
10041  * Cython equivalent of `isinstance(obj, np.timedelta64)`
10042  */
10043 
10044  /* function exit code */
10045  __pyx_L0:;
10046  __Pyx_RefNannyFinishContext();
10047  return __pyx_r;
10048 }
10049 
10050 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
10051  *
10052  *
10053  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
10054  * """
10055  * Cython equivalent of `isinstance(obj, np.datetime64)`
10056  */
10057 
10058 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
10059  int __pyx_r;
10060  __Pyx_RefNannyDeclarations
10061  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
10062 
10063  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
10064  * bool
10065  * """
10066  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
10067  *
10068  *
10069  */
10070  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
10071  goto __pyx_L0;
10072 
10073  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
10074  *
10075  *
10076  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
10077  * """
10078  * Cython equivalent of `isinstance(obj, np.datetime64)`
10079  */
10080 
10081  /* function exit code */
10082  __pyx_L0:;
10083  __Pyx_RefNannyFinishContext();
10084  return __pyx_r;
10085 }
10086 
10087 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
10088  *
10089  *
10090  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
10091  * """
10092  * returns the int64 value underlying scalar numpy datetime64 object
10093  */
10094 
10095 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
10096  npy_datetime __pyx_r;
10097 
10098  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
10099  * also needed. That can be found using `get_datetime64_unit`.
10100  * """
10101  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
10102  *
10103  *
10104  */
10105  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
10106  goto __pyx_L0;
10107 
10108  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
10109  *
10110  *
10111  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
10112  * """
10113  * returns the int64 value underlying scalar numpy datetime64 object
10114  */
10115 
10116  /* function exit code */
10117  __pyx_L0:;
10118  return __pyx_r;
10119 }
10120 
10121 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
10122  *
10123  *
10124  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
10125  * """
10126  * returns the int64 value underlying scalar numpy timedelta64 object
10127  */
10128 
10129 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
10130  npy_timedelta __pyx_r;
10131 
10132  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
10133  * returns the int64 value underlying scalar numpy timedelta64 object
10134  * """
10135  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
10136  *
10137  *
10138  */
10139  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
10140  goto __pyx_L0;
10141 
10142  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
10143  *
10144  *
10145  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
10146  * """
10147  * returns the int64 value underlying scalar numpy timedelta64 object
10148  */
10149 
10150  /* function exit code */
10151  __pyx_L0:;
10152  return __pyx_r;
10153 }
10154 
10155 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
10156  *
10157  *
10158  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
10159  * """
10160  * returns the unit part of the dtype for a numpy datetime64 object.
10161  */
10162 
10163 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
10164  NPY_DATETIMEUNIT __pyx_r;
10165 
10166  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
10167  * returns the unit part of the dtype for a numpy datetime64 object.
10168  * """
10169  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
10170  */
10171  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
10172  goto __pyx_L0;
10173 
10174  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
10175  *
10176  *
10177  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
10178  * """
10179  * returns the unit part of the dtype for a numpy datetime64 object.
10180  */
10181 
10182  /* function exit code */
10183  __pyx_L0:;
10184  return __pyx_r;
10185 }
10186 
10187 static PyMethodDef __pyx_methods[] = {
10188  {0, 0, 0, 0}
10189 };
10190 
10191 #if PY_MAJOR_VERSION >= 3
10192 #if CYTHON_PEP489_MULTI_PHASE_INIT
10193 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
10194 static int __pyx_pymod_exec_cTwophaseDarcyCoefficients(PyObject* module); /*proto*/
10195 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
10196  {Py_mod_create, (void*)__pyx_pymod_create},
10197  {Py_mod_exec, (void*)__pyx_pymod_exec_cTwophaseDarcyCoefficients},
10198  {0, NULL}
10199 };
10200 #endif
10201 
10202 static struct PyModuleDef __pyx_moduledef = {
10203  PyModuleDef_HEAD_INIT,
10204  "cTwophaseDarcyCoefficients",
10205  0, /* m_doc */
10206  #if CYTHON_PEP489_MULTI_PHASE_INIT
10207  0, /* m_size */
10208  #else
10209  -1, /* m_size */
10210  #endif
10211  __pyx_methods /* m_methods */,
10212  #if CYTHON_PEP489_MULTI_PHASE_INIT
10213  __pyx_moduledef_slots, /* m_slots */
10214  #else
10215  NULL, /* m_reload */
10216  #endif
10217  NULL, /* m_traverse */
10218  NULL, /* m_clear */
10219  NULL /* m_free */
10220 };
10221 #endif
10222 #ifndef CYTHON_SMALL_CODE
10223 #if defined(__clang__)
10224  #define CYTHON_SMALL_CODE
10225 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
10226  #define CYTHON_SMALL_CODE __attribute__((cold))
10227 #else
10228  #define CYTHON_SMALL_CODE
10229 #endif
10230 #endif
10231 
10232 static __Pyx_StringTabEntry __pyx_string_tab[] = {
10233  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
10234  {&__pyx_n_s_Kbar, __pyx_k_Kbar, sizeof(__pyx_k_Kbar), 0, 0, 1, 1},
10235  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
10236  {&__pyx_n_s_advectionScaling, __pyx_k_advectionScaling, sizeof(__pyx_k_advectionScaling), 0, 0, 1, 1},
10237  {&__pyx_n_s_an, __pyx_k_an, sizeof(__pyx_k_an), 0, 0, 1, 1},
10238  {&__pyx_n_s_aw, __pyx_k_aw, sizeof(__pyx_k_aw), 0, 0, 1, 1},
10239  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
10240  {&__pyx_n_s_cTwophaseDarcyCoefficients, __pyx_k_cTwophaseDarcyCoefficients, sizeof(__pyx_k_cTwophaseDarcyCoefficients), 0, 0, 1, 1},
10241  {&__pyx_n_s_calcFlag, __pyx_k_calcFlag, sizeof(__pyx_k_calcFlag), 0, 0, 1, 1},
10242  {&__pyx_n_s_capillaryDiffusionScaling, __pyx_k_capillaryDiffusionScaling, sizeof(__pyx_k_capillaryDiffusionScaling), 0, 0, 1, 1},
10243  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
10244  {&__pyx_n_s_colind, __pyx_k_colind, sizeof(__pyx_k_colind), 0, 0, 1, 1},
10245  {&__pyx_n_s_compressibilityFlag, __pyx_k_compressibilityFlag, sizeof(__pyx_k_compressibilityFlag), 0, 0, 1, 1},
10246  {&__pyx_kp_s_configuration_density_w_flag_0_a, __pyx_k_configuration_density_w_flag_0_a, sizeof(__pyx_k_configuration_density_w_flag_0_a), 0, 0, 1, 0},
10247  {&__pyx_n_s_da, __pyx_k_da, sizeof(__pyx_k_da), 0, 0, 1, 1},
10248  {&__pyx_n_s_dan, __pyx_k_dan, sizeof(__pyx_k_dan), 0, 0, 1, 1},
10249  {&__pyx_n_s_dan_dpsic, __pyx_k_dan_dpsic, sizeof(__pyx_k_dan_dpsic), 0, 0, 1, 1},
10250  {&__pyx_n_s_dan_dpsiw, __pyx_k_dan_dpsiw, sizeof(__pyx_k_dan_dpsiw), 0, 0, 1, 1},
10251  {&__pyx_n_s_daw, __pyx_k_daw, sizeof(__pyx_k_daw), 0, 0, 1, 1},
10252  {&__pyx_n_s_daw_dpsic, __pyx_k_daw_dpsic, sizeof(__pyx_k_daw_dpsic), 0, 0, 1, 1},
10253  {&__pyx_n_s_daw_dpsiw, __pyx_k_daw_dpsiw, sizeof(__pyx_k_daw_dpsiw), 0, 0, 1, 1},
10254  {&__pyx_n_s_density_n_flag, __pyx_k_density_n_flag, sizeof(__pyx_k_density_n_flag), 0, 0, 1, 1},
10255  {&__pyx_n_s_density_w_flag, __pyx_k_density_w_flag, sizeof(__pyx_k_density_w_flag), 0, 0, 1, 1},
10256  {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
10257  {&__pyx_n_s_dfn_dpsiw, __pyx_k_dfn_dpsiw, sizeof(__pyx_k_dfn_dpsiw), 0, 0, 1, 1},
10258  {&__pyx_n_s_dfn_dsw, __pyx_k_dfn_dsw, sizeof(__pyx_k_dfn_dsw), 0, 0, 1, 1},
10259  {&__pyx_n_s_dfw_dpsiw, __pyx_k_dfw_dpsiw, sizeof(__pyx_k_dfw_dpsiw), 0, 0, 1, 1},
10260  {&__pyx_n_s_dfw_dsw, __pyx_k_dfw_dsw, sizeof(__pyx_k_dfw_dsw), 0, 0, 1, 1},
10261  {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1},
10262  {&__pyx_n_s_dmn, __pyx_k_dmn, sizeof(__pyx_k_dmn), 0, 0, 1, 1},
10263  {&__pyx_n_s_dmn_dpsic, __pyx_k_dmn_dpsic, sizeof(__pyx_k_dmn_dpsic), 0, 0, 1, 1},
10264  {&__pyx_n_s_dmn_dpsiw, __pyx_k_dmn_dpsiw, sizeof(__pyx_k_dmn_dpsiw), 0, 0, 1, 1},
10265  {&__pyx_n_s_dmw, __pyx_k_dmw, sizeof(__pyx_k_dmw), 0, 0, 1, 1},
10266  {&__pyx_n_s_dmw_dpsic, __pyx_k_dmw_dpsic, sizeof(__pyx_k_dmw_dpsic), 0, 0, 1, 1},
10267  {&__pyx_n_s_dmw_dpsiw, __pyx_k_dmw_dpsiw, sizeof(__pyx_k_dmw_dpsiw), 0, 0, 1, 1},
10268  {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1},
10269  {&__pyx_n_s_dphi, __pyx_k_dphi, sizeof(__pyx_k_dphi), 0, 0, 1, 1},
10270  {&__pyx_n_s_dphi_psin_dpsic, __pyx_k_dphi_psin_dpsic, sizeof(__pyx_k_dphi_psin_dpsic), 0, 0, 1, 1},
10271  {&__pyx_n_s_dphi_psin_dpsiw, __pyx_k_dphi_psin_dpsiw, sizeof(__pyx_k_dphi_psin_dpsiw), 0, 0, 1, 1},
10272  {&__pyx_n_s_dphi_psin_dsw, __pyx_k_dphi_psin_dsw, sizeof(__pyx_k_dphi_psin_dsw), 0, 0, 1, 1},
10273  {&__pyx_n_s_dphi_psiw_dpsiw, __pyx_k_dphi_psiw_dpsiw, sizeof(__pyx_k_dphi_psiw_dpsiw), 0, 0, 1, 1},
10274  {&__pyx_n_s_dpsin, __pyx_k_dpsin, sizeof(__pyx_k_dpsin), 0, 0, 1, 1},
10275  {&__pyx_n_s_dpsin_dpsiw, __pyx_k_dpsin_dpsiw, sizeof(__pyx_k_dpsin_dpsiw), 0, 0, 1, 1},
10276  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
10277  {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1},
10278  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
10279  {&__pyx_n_s_fw, __pyx_k_fw, sizeof(__pyx_k_fw), 0, 0, 1, 1},
10280  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
10281  {&__pyx_n_s_generateSplineTables, __pyx_k_generateSplineTables, sizeof(__pyx_k_generateSplineTables), 0, 0, 1, 1},
10282  {&__pyx_n_s_grad_psic, __pyx_k_grad_psic, sizeof(__pyx_k_grad_psic), 0, 0, 1, 1},
10283  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
10284  {&__pyx_n_s_iwork_psk, __pyx_k_iwork_psk, sizeof(__pyx_k_iwork_psk), 0, 0, 1, 1},
10285  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
10286  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
10287  {&__pyx_n_s_matType, __pyx_k_matType, sizeof(__pyx_k_matType), 0, 0, 1, 1},
10288  {&__pyx_n_s_mn, __pyx_k_mn, sizeof(__pyx_k_mn), 0, 0, 1, 1},
10289  {&__pyx_n_s_mun, __pyx_k_mun, sizeof(__pyx_k_mun), 0, 0, 1, 1},
10290  {&__pyx_n_s_muw, __pyx_k_muw, sizeof(__pyx_k_muw), 0, 0, 1, 1},
10291  {&__pyx_n_s_mw, __pyx_k_mw, sizeof(__pyx_k_mw), 0, 0, 1, 1},
10292  {&__pyx_n_s_nPointsPerSimplex, __pyx_k_nPointsPerSimplex, sizeof(__pyx_k_nPointsPerSimplex), 0, 0, 1, 1},
10293  {&__pyx_n_s_nSimplex, __pyx_k_nSimplex, sizeof(__pyx_k_nSimplex), 0, 0, 1, 1},
10294  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
10295  {&__pyx_n_s_nknots, __pyx_k_nknots, sizeof(__pyx_k_nknots), 0, 0, 1, 1},
10296  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
10297  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
10298  {&__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},
10299  {&__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},
10300  {&__pyx_n_s_omega, __pyx_k_omega, sizeof(__pyx_k_omega), 0, 0, 1, 1},
10301  {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1},
10302  {&__pyx_n_s_phi_psin, __pyx_k_phi_psin, sizeof(__pyx_k_phi_psin), 0, 0, 1, 1},
10303  {&__pyx_n_s_phi_psiw, __pyx_k_phi_psiw, sizeof(__pyx_k_phi_psiw), 0, 0, 1, 1},
10304  {&__pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_k_proteus_cTwophaseDarcyCoefficien, sizeof(__pyx_k_proteus_cTwophaseDarcyCoefficien), 0, 0, 1, 0},
10305  {&__pyx_n_s_psic, __pyx_k_psic, sizeof(__pyx_k_psic), 0, 0, 1, 1},
10306  {&__pyx_n_s_psin, __pyx_k_psin, sizeof(__pyx_k_psin), 0, 0, 1, 1},
10307  {&__pyx_n_s_psiw, __pyx_k_psiw, sizeof(__pyx_k_psiw), 0, 0, 1, 1},
10308  {&__pyx_n_s_pskModelFlag, __pyx_k_pskModelFlag, sizeof(__pyx_k_pskModelFlag), 0, 0, 1, 1},
10309  {&__pyx_n_s_qt, __pyx_k_qt, sizeof(__pyx_k_qt), 0, 0, 1, 1},
10310  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
10311  {&__pyx_n_s_rwork_density_n, __pyx_k_rwork_density_n, sizeof(__pyx_k_rwork_density_n), 0, 0, 1, 1},
10312  {&__pyx_n_s_rwork_density_w, __pyx_k_rwork_density_w, sizeof(__pyx_k_rwork_density_w), 0, 0, 1, 1},
10313  {&__pyx_n_s_rwork_psk, __pyx_k_rwork_psk, sizeof(__pyx_k_rwork_psk), 0, 0, 1, 1},
10314  {&__pyx_n_s_rwork_psk_tol, __pyx_k_rwork_psk_tol, sizeof(__pyx_k_rwork_psk_tol), 0, 0, 1, 1},
10315  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
10316  {&__pyx_n_s_splineTable, __pyx_k_splineTable, sizeof(__pyx_k_splineTable), 0, 0, 1, 1},
10317  {&__pyx_n_s_startIndex, __pyx_k_startIndex, sizeof(__pyx_k_startIndex), 0, 0, 1, 1},
10318  {&__pyx_n_s_sw, __pyx_k_sw, sizeof(__pyx_k_sw), 0, 0, 1, 1},
10319  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
10320  {&__pyx_n_s_twophaseDarcy_compressibleN_spli, __pyx_k_twophaseDarcy_compressibleN_spli, sizeof(__pyx_k_twophaseDarcy_compressibleN_spli), 0, 0, 1, 1},
10321  {&__pyx_n_s_twophaseDarcy_compressibleN_spli_2, __pyx_k_twophaseDarcy_compressibleN_spli_2, sizeof(__pyx_k_twophaseDarcy_compressibleN_spli_2), 0, 0, 1, 1},
10322  {&__pyx_n_s_twophaseDarcy_fc_pp_sd_het_matTy, __pyx_k_twophaseDarcy_fc_pp_sd_het_matTy, sizeof(__pyx_k_twophaseDarcy_fc_pp_sd_het_matTy), 0, 0, 1, 1},
10323  {&__pyx_n_s_twophaseDarcy_fc_sd_het_matType, __pyx_k_twophaseDarcy_fc_sd_het_matType, sizeof(__pyx_k_twophaseDarcy_fc_sd_het_matType), 0, 0, 1, 1},
10324  {&__pyx_n_s_twophaseDarcy_fc_sd_het_matType_2, __pyx_k_twophaseDarcy_fc_sd_het_matType_2, sizeof(__pyx_k_twophaseDarcy_fc_sd_het_matType_2), 0, 0, 1, 1},
10325  {&__pyx_n_s_twophaseDarcy_incompressible_spl, __pyx_k_twophaseDarcy_incompressible_spl, sizeof(__pyx_k_twophaseDarcy_incompressible_spl), 0, 0, 1, 1},
10326  {&__pyx_n_s_twophaseDarcy_incompressible_spl_2, __pyx_k_twophaseDarcy_incompressible_spl_2, sizeof(__pyx_k_twophaseDarcy_incompressible_spl_2), 0, 0, 1, 1},
10327  {&__pyx_n_s_twophaseDarcy_incompressible_spl_3, __pyx_k_twophaseDarcy_incompressible_spl_3, sizeof(__pyx_k_twophaseDarcy_incompressible_spl_3), 0, 0, 1, 1},
10328  {&__pyx_n_s_twophaseDarcy_slightCompressible, __pyx_k_twophaseDarcy_slightCompressible, sizeof(__pyx_k_twophaseDarcy_slightCompressible), 0, 0, 1, 1},
10329  {&__pyx_n_s_twophaseDarcy_slightCompressible_2, __pyx_k_twophaseDarcy_slightCompressible_2, sizeof(__pyx_k_twophaseDarcy_slightCompressible_2), 0, 0, 1, 1},
10330  {&__pyx_n_s_twophaseDarcy_vol_frac, __pyx_k_twophaseDarcy_vol_frac, sizeof(__pyx_k_twophaseDarcy_vol_frac), 0, 0, 1, 1},
10331  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
10332  {&__pyx_n_s_vol_frac_n, __pyx_k_vol_frac_n, sizeof(__pyx_k_vol_frac_n), 0, 0, 1, 1},
10333  {&__pyx_n_s_vol_frac_w, __pyx_k_vol_frac_w, sizeof(__pyx_k_vol_frac_w), 0, 0, 1, 1},
10334  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
10335  {0, 0, 0, 0, 0, 0, 0}
10336 };
10337 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
10338  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
10339  return 0;
10340  __pyx_L1_error:;
10341  return -1;
10342 }
10343 
10344 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
10345  __Pyx_RefNannyDeclarations
10346  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
10347 
10348  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
10349  * __pyx_import_array()
10350  * except Exception:
10351  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
10352  *
10353  * cdef inline int import_umath() except -1:
10354  */
10355  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
10356  __Pyx_GOTREF(__pyx_tuple_);
10357  __Pyx_GIVEREF(__pyx_tuple_);
10358 
10359  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
10360  * _import_umath()
10361  * except Exception:
10362  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
10363  *
10364  * cdef inline int import_ufunc() except -1:
10365  */
10366  __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)
10367  __Pyx_GOTREF(__pyx_tuple__2);
10368  __Pyx_GIVEREF(__pyx_tuple__2);
10369 
10370  /* "cTwophaseDarcyCoefficients.pyx":32
10371  * pass
10372  *
10373  * def twophaseDarcy_fc_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10374  * int density_w_flag,
10375  * int density_n_flag,
10376  */
10377  __pyx_tuple__3 = PyTuple_Pack(42, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __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_iwork_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_x, __pyx_n_s_sw, __pyx_n_s_psiw, __pyx_n_s_mw, __pyx_n_s_dmw, __pyx_n_s_dmw_dpsiw, __pyx_n_s_mn, __pyx_n_s_dmn, __pyx_n_s_dmn_dpsiw, __pyx_n_s_psin, __pyx_n_s_dpsin, __pyx_n_s_dpsin_dpsiw, __pyx_n_s_phi_psiw, __pyx_n_s_dphi_psiw_dpsiw, __pyx_n_s_phi_psin, __pyx_n_s_dphi_psin_dpsiw, __pyx_n_s_dphi_psin_dsw, __pyx_n_s_aw, __pyx_n_s_daw, __pyx_n_s_daw_dpsiw, __pyx_n_s_an, __pyx_n_s_dan, __pyx_n_s_dan_dpsiw, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 32, __pyx_L1_error)
10378  __Pyx_GOTREF(__pyx_tuple__3);
10379  __Pyx_GIVEREF(__pyx_tuple__3);
10380  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(40, 0, 42, 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_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_fc_sd_het_matType, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 32, __pyx_L1_error)
10381 
10382  /* "cTwophaseDarcyCoefficients.pyx":423
10383  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10384  *
10385  * def twophaseDarcy_fc_sd_het_matType_nonPotentialForm(int pskModelFlag, # <<<<<<<<<<<<<<
10386  * int density_w_flag,
10387  * int density_n_flag,
10388  */
10389  __pyx_tuple__5 = PyTuple_Pack(49, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __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_iwork_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_x, __pyx_n_s_sw, __pyx_n_s_psiw, __pyx_n_s_mw, __pyx_n_s_dmw, __pyx_n_s_dmw_dpsiw, __pyx_n_s_mn, __pyx_n_s_dmn, __pyx_n_s_dmn_dpsiw, __pyx_n_s_psin, __pyx_n_s_dpsin, __pyx_n_s_dpsin_dpsiw, __pyx_n_s_phi_psiw, __pyx_n_s_dphi_psiw_dpsiw, __pyx_n_s_phi_psin, __pyx_n_s_dphi_psin_dpsiw, __pyx_n_s_dphi_psin_dsw, __pyx_n_s_fw, __pyx_n_s_dfw_dsw, __pyx_n_s_dfw_dpsiw, __pyx_n_s_fn, __pyx_n_s_dfn_dsw, __pyx_n_s_dfn_dpsiw, __pyx_n_s_aw, __pyx_n_s_daw, __pyx_n_s_daw_dpsiw, __pyx_n_s_an, __pyx_n_s_dan, __pyx_n_s_dan_dpsiw, __pyx_n_s_compressibilityFlag, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 423, __pyx_L1_error)
10390  __Pyx_GOTREF(__pyx_tuple__5);
10391  __Pyx_GIVEREF(__pyx_tuple__5);
10392  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(47, 0, 49, 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_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_fc_sd_het_matType_2, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 423, __pyx_L1_error)
10393 
10394  /* "cTwophaseDarcyCoefficients.pyx":723
10395  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10396  *
10397  * def twophaseDarcy_fc_pp_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10398  * int density_w_flag,
10399  * int density_n_flag,
10400  */
10401  __pyx_tuple__7 = PyTuple_Pack(40, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __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_iwork_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_x, __pyx_n_s_psiw, __pyx_n_s_psic, __pyx_n_s_sw, __pyx_n_s_mw, __pyx_n_s_dmw_dpsiw, __pyx_n_s_dmw_dpsic, __pyx_n_s_mn, __pyx_n_s_dmn_dpsiw, __pyx_n_s_dmn_dpsic, __pyx_n_s_phi_psiw, __pyx_n_s_dphi_psiw_dpsiw, __pyx_n_s_phi_psin, __pyx_n_s_dphi_psin_dpsiw, __pyx_n_s_dphi_psin_dpsic, __pyx_n_s_aw, __pyx_n_s_daw_dpsiw, __pyx_n_s_daw_dpsic, __pyx_n_s_an, __pyx_n_s_dan_dpsiw, __pyx_n_s_dan_dpsic, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 723, __pyx_L1_error)
10402  __Pyx_GOTREF(__pyx_tuple__7);
10403  __Pyx_GIVEREF(__pyx_tuple__7);
10404  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(38, 0, 40, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_fc_pp_sd_het_matTy, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 723, __pyx_L1_error)
10405 
10406  /* "cTwophaseDarcyCoefficients.pyx":1016
10407  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10408  *
10409  * def twophaseDarcy_incompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10410  * np.ndarray rowptr,
10411  * np.ndarray colind,
10412  */
10413  __pyx_tuple__9 = PyTuple_Pack(22, __pyx_n_s_pskModelFlag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_capillaryDiffusionScaling, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_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_sw, __pyx_n_s_grad_psic, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1016, __pyx_L1_error)
10414  __Pyx_GOTREF(__pyx_tuple__9);
10415  __Pyx_GIVEREF(__pyx_tuple__9);
10416  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(20, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_incompressible_spl, 1016, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 1016, __pyx_L1_error)
10417 
10418  /* "cTwophaseDarcyCoefficients.pyx":1116
10419  * <double*>(a.data))
10420  *
10421  * def twophaseDarcy_incompressible_split_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10422  * int density_w_flag,
10423  * int density_n_flag,
10424  */
10425  __pyx_tuple__11 = PyTuple_Pack(32, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_capillaryDiffusionScaling, __pyx_n_s_advectionScaling, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_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_qt, __pyx_n_s_psiw, __pyx_n_s_sw, __pyx_n_s_m, __pyx_n_s_dm, __pyx_n_s_phi, __pyx_n_s_dphi, __pyx_n_s_f, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1116, __pyx_L1_error)
10426  __Pyx_GOTREF(__pyx_tuple__11);
10427  __Pyx_GIVEREF(__pyx_tuple__11);
10428  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(30, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_incompressible_spl_2, 1116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 1116, __pyx_L1_error)
10429 
10430  /* "cTwophaseDarcyCoefficients.pyx":1253
10431  * <double*>(da.data))
10432  *
10433  * def twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10434  * int density_w_flag,
10435  * int density_n_flag,
10436  */
10437  __pyx_tuple__13 = PyTuple_Pack(32, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_capillaryDiffusionScaling, __pyx_n_s_advectionScaling, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_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_qt, __pyx_n_s_psiw, __pyx_n_s_sw, __pyx_n_s_m, __pyx_n_s_dm, __pyx_n_s_phi, __pyx_n_s_dphi, __pyx_n_s_f, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1253, __pyx_L1_error)
10438  __Pyx_GOTREF(__pyx_tuple__13);
10439  __Pyx_GIVEREF(__pyx_tuple__13);
10440  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(30, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_slightCompressible, 1253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1253, __pyx_L1_error)
10441 
10442  /* "cTwophaseDarcyCoefficients.pyx":1367
10443  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
10444  *
10445  * def twophaseDarcy_slightCompressible_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
10446  * int density_w_flag,
10447  * int density_n_flag,
10448  */
10449  __pyx_tuple__15 = PyTuple_Pack(32, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_capillaryDiffusionScaling, __pyx_n_s_advectionScaling, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_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_qt, __pyx_n_s_psiw, __pyx_n_s_sw, __pyx_n_s_m, __pyx_n_s_dm, __pyx_n_s_phi, __pyx_n_s_dphi, __pyx_n_s_f, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1367, __pyx_L1_error)
10450  __Pyx_GOTREF(__pyx_tuple__15);
10451  __Pyx_GIVEREF(__pyx_tuple__15);
10452  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(30, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_slightCompressible_2, 1367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 1367, __pyx_L1_error)
10453 
10454  /* "cTwophaseDarcyCoefficients.pyx":1528
10455  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10456  *
10457  * def twophaseDarcy_compressibleN_split_sd_pressure_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
10458  * int density_w_flag,
10459  * int density_n_flag,
10460  */
10461  __pyx_tuple__17 = PyTuple_Pack(28, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_capillaryDiffusionScaling, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_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_sw, __pyx_n_s_psiw, __pyx_n_s_psin, __pyx_n_s_grad_psic, __pyx_n_s_m, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1528, __pyx_L1_error)
10462  __Pyx_GOTREF(__pyx_tuple__17);
10463  __Pyx_GIVEREF(__pyx_tuple__17);
10464  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(26, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_compressibleN_spli, 1528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1528, __pyx_L1_error)
10465 
10466  /* "cTwophaseDarcyCoefficients.pyx":1684
10467  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10468  *
10469  * def twophaseDarcy_compressibleN_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
10470  * int density_w_flag,
10471  * int density_n_flag,
10472  */
10473  __pyx_tuple__19 = PyTuple_Pack(32, __pyx_n_s_pskModelFlag, __pyx_n_s_density_w_flag, __pyx_n_s_density_n_flag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_capillaryDiffusionScaling, __pyx_n_s_advectionScaling, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_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_qt, __pyx_n_s_psiw, __pyx_n_s_sw, __pyx_n_s_m, __pyx_n_s_dm, __pyx_n_s_phi, __pyx_n_s_dphi, __pyx_n_s_f, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1684, __pyx_L1_error)
10474  __Pyx_GOTREF(__pyx_tuple__19);
10475  __Pyx_GIVEREF(__pyx_tuple__19);
10476  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(30, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_compressibleN_spli_2, 1684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 1684, __pyx_L1_error)
10477 
10478  /* "cTwophaseDarcyCoefficients.pyx":1845
10479  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10480  *
10481  * def twophaseDarcy_vol_frac( np.ndarray matType, # <<<<<<<<<<<<<<
10482  * np.ndarray omega,
10483  * np.ndarray sw,
10484  */
10485  __pyx_tuple__21 = PyTuple_Pack(7, __pyx_n_s_matType, __pyx_n_s_omega, __pyx_n_s_sw, __pyx_n_s_vol_frac_w, __pyx_n_s_vol_frac_n, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1845, __pyx_L1_error)
10486  __Pyx_GOTREF(__pyx_tuple__21);
10487  __Pyx_GIVEREF(__pyx_tuple__21);
10488  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_vol_frac, 1845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 1845, __pyx_L1_error)
10489 
10490  /* "cTwophaseDarcyCoefficients.pyx":1865
10491  * <double*>(vol_frac_n.data))
10492  *
10493  * def generateSplineTables(int pskModelFlag, # <<<<<<<<<<<<<<
10494  * int startIndex, #where to insert into splineTable
10495  * int calcFlag, #f(Sw) or f(psic)
10496  */
10497  __pyx_tuple__23 = PyTuple_Pack(9, __pyx_n_s_pskModelFlag, __pyx_n_s_startIndex, __pyx_n_s_calcFlag, __pyx_n_s_domain, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_psk, __pyx_n_s_rwork_psk_tol, __pyx_n_s_splineTable, __pyx_n_s_nknots); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1865, __pyx_L1_error)
10498  __Pyx_GOTREF(__pyx_tuple__23);
10499  __Pyx_GIVEREF(__pyx_tuple__23);
10500  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_generateSplineTables, 1865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 1865, __pyx_L1_error)
10501 
10502  /* "cTwophaseDarcyCoefficients.pyx":1930
10503  * <double*>(splineTable.data))
10504  *
10505  * def twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10506  * np.ndarray rowptr,
10507  * np.ndarray colind,
10508  */
10509  __pyx_tuple__25 = PyTuple_Pack(30, __pyx_n_s_pskModelFlag, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_matType, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_capillaryDiffusionScaling, __pyx_n_s_advectionScaling, __pyx_n_s_rwork_psk, __pyx_n_s_iwork_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_qt, __pyx_n_s_u, __pyx_n_s_sw, __pyx_n_s_m, __pyx_n_s_dm, __pyx_n_s_phi, __pyx_n_s_dphi, __pyx_n_s_f, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_nPointsPerSimplex, __pyx_n_s_nSimplex); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1930, __pyx_L1_error)
10510  __Pyx_GOTREF(__pyx_tuple__25);
10511  __Pyx_GIVEREF(__pyx_tuple__25);
10512  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(28, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cTwophaseDarcyCoefficien, __pyx_n_s_twophaseDarcy_incompressible_spl_3, 1930, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 1930, __pyx_L1_error)
10513  __Pyx_RefNannyFinishContext();
10514  return 0;
10515  __pyx_L1_error:;
10516  __Pyx_RefNannyFinishContext();
10517  return -1;
10518 }
10519 
10520 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
10521  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
10522  return 0;
10523  __pyx_L1_error:;
10524  return -1;
10525 }
10526 
10527 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
10528 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
10529 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
10530 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
10531 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
10532 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
10533 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
10534 
10535 static int __Pyx_modinit_global_init_code(void) {
10536  __Pyx_RefNannyDeclarations
10537  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
10538  /*--- Global init code ---*/
10539  __Pyx_RefNannyFinishContext();
10540  return 0;
10541 }
10542 
10543 static int __Pyx_modinit_variable_export_code(void) {
10544  __Pyx_RefNannyDeclarations
10545  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
10546  /*--- Variable export code ---*/
10547  __Pyx_RefNannyFinishContext();
10548  return 0;
10549 }
10550 
10551 static int __Pyx_modinit_function_export_code(void) {
10552  __Pyx_RefNannyDeclarations
10553  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
10554  /*--- Function export code ---*/
10555  __Pyx_RefNannyFinishContext();
10556  return 0;
10557 }
10558 
10559 static int __Pyx_modinit_type_init_code(void) {
10560  __Pyx_RefNannyDeclarations
10561  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
10562  /*--- Type init code ---*/
10563  __Pyx_RefNannyFinishContext();
10564  return 0;
10565 }
10566 
10567 static int __Pyx_modinit_type_import_code(void) {
10568  __Pyx_RefNannyDeclarations
10569  PyObject *__pyx_t_1 = NULL;
10570  int __pyx_lineno = 0;
10571  const char *__pyx_filename = NULL;
10572  int __pyx_clineno = 0;
10573  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
10574  /*--- Type import code ---*/
10575  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
10576  __Pyx_GOTREF(__pyx_t_1);
10577  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
10578  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
10579  sizeof(PyTypeObject),
10580  #else
10581  sizeof(PyHeapTypeObject),
10582  #endif
10583  __Pyx_ImportType_CheckSize_Warn);
10584  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
10585  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10586  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
10587  __Pyx_GOTREF(__pyx_t_1);
10588  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
10589  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
10590  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
10591  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
10592  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
10593  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
10594  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
10595  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
10596  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10597  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
10598  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10599  if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
10600  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10601  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
10602  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10603  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
10604  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10605  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
10606  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10607  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
10608  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10609  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
10610  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10611  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
10612  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10613  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
10614  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
10615  if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
10616  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
10617  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
10618  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10619  __Pyx_RefNannyFinishContext();
10620  return 0;
10621  __pyx_L1_error:;
10622  __Pyx_XDECREF(__pyx_t_1);
10623  __Pyx_RefNannyFinishContext();
10624  return -1;
10625 }
10626 
10627 static int __Pyx_modinit_variable_import_code(void) {
10628  __Pyx_RefNannyDeclarations
10629  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
10630  /*--- Variable import code ---*/
10631  __Pyx_RefNannyFinishContext();
10632  return 0;
10633 }
10634 
10635 static int __Pyx_modinit_function_import_code(void) {
10636  __Pyx_RefNannyDeclarations
10637  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
10638  /*--- Function import code ---*/
10639  __Pyx_RefNannyFinishContext();
10640  return 0;
10641 }
10642 
10643 
10644 #ifndef CYTHON_NO_PYINIT_EXPORT
10645 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
10646 #elif PY_MAJOR_VERSION < 3
10647 #ifdef __cplusplus
10648 #define __Pyx_PyMODINIT_FUNC extern "C" void
10649 #else
10650 #define __Pyx_PyMODINIT_FUNC void
10651 #endif
10652 #else
10653 #ifdef __cplusplus
10654 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
10655 #else
10656 #define __Pyx_PyMODINIT_FUNC PyObject *
10657 #endif
10658 #endif
10659 
10660 
10661 #if PY_MAJOR_VERSION < 3
10662 __Pyx_PyMODINIT_FUNC initcTwophaseDarcyCoefficients(void) CYTHON_SMALL_CODE; /*proto*/
10663 __Pyx_PyMODINIT_FUNC initcTwophaseDarcyCoefficients(void)
10664 #else
10665 __Pyx_PyMODINIT_FUNC PyInit_cTwophaseDarcyCoefficients(void) CYTHON_SMALL_CODE; /*proto*/
10666 __Pyx_PyMODINIT_FUNC PyInit_cTwophaseDarcyCoefficients(void)
10667 #if CYTHON_PEP489_MULTI_PHASE_INIT
10668 {
10669  return PyModuleDef_Init(&__pyx_moduledef);
10670 }
10671 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
10672  #if PY_VERSION_HEX >= 0x030700A1
10673  static PY_INT64_T main_interpreter_id = -1;
10674  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
10675  if (main_interpreter_id == -1) {
10676  main_interpreter_id = current_id;
10677  return (unlikely(current_id == -1)) ? -1 : 0;
10678  } else if (unlikely(main_interpreter_id != current_id))
10679  #else
10680  static PyInterpreterState *main_interpreter = NULL;
10681  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
10682  if (!main_interpreter) {
10683  main_interpreter = current_interpreter;
10684  } else if (unlikely(main_interpreter != current_interpreter))
10685  #endif
10686  {
10687  PyErr_SetString(
10688  PyExc_ImportError,
10689  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
10690  return -1;
10691  }
10692  return 0;
10693 }
10694 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) {
10695  PyObject *value = PyObject_GetAttrString(spec, from_name);
10696  int result = 0;
10697  if (likely(value)) {
10698  if (allow_none || value != Py_None) {
10699  result = PyDict_SetItemString(moddict, to_name, value);
10700  }
10701  Py_DECREF(value);
10702  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
10703  PyErr_Clear();
10704  } else {
10705  result = -1;
10706  }
10707  return result;
10708 }
10709 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
10710  PyObject *module = NULL, *moddict, *modname;
10711  if (__Pyx_check_single_interpreter())
10712  return NULL;
10713  if (__pyx_m)
10714  return __Pyx_NewRef(__pyx_m);
10715  modname = PyObject_GetAttrString(spec, "name");
10716  if (unlikely(!modname)) goto bad;
10717  module = PyModule_NewObject(modname);
10718  Py_DECREF(modname);
10719  if (unlikely(!module)) goto bad;
10720  moddict = PyModule_GetDict(module);
10721  if (unlikely(!moddict)) goto bad;
10722  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
10723  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
10724  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
10725  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
10726  return module;
10727 bad:
10728  Py_XDECREF(module);
10729  return NULL;
10730 }
10731 
10732 
10733 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cTwophaseDarcyCoefficients(PyObject *__pyx_pyinit_module)
10734 #endif
10735 #endif
10736 {
10737  PyObject *__pyx_t_1 = NULL;
10738  int __pyx_lineno = 0;
10739  const char *__pyx_filename = NULL;
10740  int __pyx_clineno = 0;
10741  __Pyx_RefNannyDeclarations
10742  #if CYTHON_PEP489_MULTI_PHASE_INIT
10743  if (__pyx_m) {
10744  if (__pyx_m == __pyx_pyinit_module) return 0;
10745  PyErr_SetString(PyExc_RuntimeError, "Module 'cTwophaseDarcyCoefficients' has already been imported. Re-initialisation is not supported.");
10746  return -1;
10747  }
10748  #elif PY_MAJOR_VERSION >= 3
10749  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
10750  #endif
10751  #if CYTHON_REFNANNY
10752 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
10753 if (!__Pyx_RefNanny) {
10754  PyErr_Clear();
10755  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
10756  if (!__Pyx_RefNanny)
10757  Py_FatalError("failed to import 'refnanny' module");
10758 }
10759 #endif
10760  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cTwophaseDarcyCoefficients(void)", 0);
10761  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10762  #ifdef __Pxy_PyFrame_Initialize_Offsets
10763  __Pxy_PyFrame_Initialize_Offsets();
10764  #endif
10765  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
10766  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
10767  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
10768  #ifdef __Pyx_CyFunction_USED
10769  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10770  #endif
10771  #ifdef __Pyx_FusedFunction_USED
10772  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10773  #endif
10774  #ifdef __Pyx_Coroutine_USED
10775  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10776  #endif
10777  #ifdef __Pyx_Generator_USED
10778  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10779  #endif
10780  #ifdef __Pyx_AsyncGen_USED
10781  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10782  #endif
10783  #ifdef __Pyx_StopAsyncIteration_USED
10784  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10785  #endif
10786  /*--- Library function declarations ---*/
10787  /*--- Threads initialization code ---*/
10788  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
10789  PyEval_InitThreads();
10790  #endif
10791  /*--- Module creation code ---*/
10792  #if CYTHON_PEP489_MULTI_PHASE_INIT
10793  __pyx_m = __pyx_pyinit_module;
10794  Py_INCREF(__pyx_m);
10795  #else
10796  #if PY_MAJOR_VERSION < 3
10797  __pyx_m = Py_InitModule4("cTwophaseDarcyCoefficients", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
10798  #else
10799  __pyx_m = PyModule_Create(&__pyx_moduledef);
10800  #endif
10801  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
10802  #endif
10803  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
10804  Py_INCREF(__pyx_d);
10805  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
10806  Py_INCREF(__pyx_b);
10807  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
10808  Py_INCREF(__pyx_cython_runtime);
10809  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
10810  /*--- Initialize various global constants etc. ---*/
10811  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10812  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
10813  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10814  #endif
10815  if (__pyx_module_is_main_cTwophaseDarcyCoefficients) {
10816  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10817  }
10818  #if PY_MAJOR_VERSION >= 3
10819  {
10820  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
10821  if (!PyDict_GetItemString(modules, "cTwophaseDarcyCoefficients")) {
10822  if (unlikely(PyDict_SetItemString(modules, "cTwophaseDarcyCoefficients", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
10823  }
10824  }
10825  #endif
10826  /*--- Builtin init code ---*/
10827  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10828  /*--- Constants init code ---*/
10829  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10830  /*--- Global type/function init code ---*/
10831  (void)__Pyx_modinit_global_init_code();
10832  (void)__Pyx_modinit_variable_export_code();
10833  (void)__Pyx_modinit_function_export_code();
10834  (void)__Pyx_modinit_type_init_code();
10835  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
10836  (void)__Pyx_modinit_variable_import_code();
10837  (void)__Pyx_modinit_function_import_code();
10838  /*--- Execution code ---*/
10839  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
10840  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10841  #endif
10842 
10843  /* "cTwophaseDarcyCoefficients.pyx":2
10844  * # A type of -*- python -*- file
10845  * import numpy as np # <<<<<<<<<<<<<<
10846  * cimport numpy as np
10847  * cimport twophaseDarcyCoefficients as tpdc
10848  */
10849  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
10850  __Pyx_GOTREF(__pyx_t_1);
10851  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
10852  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10853 
10854  /* "cTwophaseDarcyCoefficients.pyx":32
10855  * pass
10856  *
10857  * def twophaseDarcy_fc_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10858  * int density_w_flag,
10859  * int density_n_flag,
10860  */
10861  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_1twophaseDarcy_fc_sd_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
10862  __Pyx_GOTREF(__pyx_t_1);
10863  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_fc_sd_het_matType, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
10864  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10865 
10866  /* "cTwophaseDarcyCoefficients.pyx":423
10867  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10868  *
10869  * def twophaseDarcy_fc_sd_het_matType_nonPotentialForm(int pskModelFlag, # <<<<<<<<<<<<<<
10870  * int density_w_flag,
10871  * int density_n_flag,
10872  */
10873  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_3twophaseDarcy_fc_sd_het_matType_nonPotentialForm, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
10874  __Pyx_GOTREF(__pyx_t_1);
10875  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_fc_sd_het_matType_2, __pyx_t_1) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
10876  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10877 
10878  /* "cTwophaseDarcyCoefficients.pyx":723
10879  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10880  *
10881  * def twophaseDarcy_fc_pp_sd_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10882  * int density_w_flag,
10883  * int density_n_flag,
10884  */
10885  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_5twophaseDarcy_fc_pp_sd_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error)
10886  __Pyx_GOTREF(__pyx_t_1);
10887  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_fc_pp_sd_het_matTy, __pyx_t_1) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
10888  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10889 
10890  /* "cTwophaseDarcyCoefficients.pyx":1016
10891  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10892  *
10893  * def twophaseDarcy_incompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10894  * np.ndarray rowptr,
10895  * np.ndarray colind,
10896  */
10897  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_7twophaseDarcy_incompressible_split_sd_pressure_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
10898  __Pyx_GOTREF(__pyx_t_1);
10899  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_incompressible_spl, __pyx_t_1) < 0) __PYX_ERR(0, 1016, __pyx_L1_error)
10900  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10901 
10902  /* "cTwophaseDarcyCoefficients.pyx":1116
10903  * <double*>(a.data))
10904  *
10905  * def twophaseDarcy_incompressible_split_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10906  * int density_w_flag,
10907  * int density_n_flag,
10908  */
10909  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_9twophaseDarcy_incompressible_split_sd_saturation_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error)
10910  __Pyx_GOTREF(__pyx_t_1);
10911  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_incompressible_spl_2, __pyx_t_1) < 0) __PYX_ERR(0, 1116, __pyx_L1_error)
10912  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10913 
10914  /* "cTwophaseDarcyCoefficients.pyx":1253
10915  * <double*>(da.data))
10916  *
10917  * def twophaseDarcy_slightCompressible_split_sd_pressure_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10918  * int density_w_flag,
10919  * int density_n_flag,
10920  */
10921  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_11twophaseDarcy_slightCompressible_split_sd_pressure_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
10922  __Pyx_GOTREF(__pyx_t_1);
10923  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_slightCompressible, __pyx_t_1) < 0) __PYX_ERR(0, 1253, __pyx_L1_error)
10924  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10925 
10926  /* "cTwophaseDarcyCoefficients.pyx":1367
10927  * <double*>(df.data), <double*>(a.data), <double*>(da.data))
10928  *
10929  * def twophaseDarcy_slightCompressible_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
10930  * int density_w_flag,
10931  * int density_n_flag,
10932  */
10933  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_13twophaseDarcy_slightCompressible_split_sd_saturation_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error)
10934  __Pyx_GOTREF(__pyx_t_1);
10935  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_slightCompressible_2, __pyx_t_1) < 0) __PYX_ERR(0, 1367, __pyx_L1_error)
10936  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10937 
10938  /* "cTwophaseDarcyCoefficients.pyx":1528
10939  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10940  *
10941  * def twophaseDarcy_compressibleN_split_sd_pressure_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
10942  * int density_w_flag,
10943  * int density_n_flag,
10944  */
10945  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_15twophaseDarcy_compressibleN_split_sd_pressure_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
10946  __Pyx_GOTREF(__pyx_t_1);
10947  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_compressibleN_spli, __pyx_t_1) < 0) __PYX_ERR(0, 1528, __pyx_L1_error)
10948  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10949 
10950  /* "cTwophaseDarcyCoefficients.pyx":1684
10951  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10952  *
10953  * def twophaseDarcy_compressibleN_split_sd_saturation_het_matType( int pskModelFlag, # <<<<<<<<<<<<<<
10954  * int density_w_flag,
10955  * int density_n_flag,
10956  */
10957  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_17twophaseDarcy_compressibleN_split_sd_saturation_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error)
10958  __Pyx_GOTREF(__pyx_t_1);
10959  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_compressibleN_spli_2, __pyx_t_1) < 0) __PYX_ERR(0, 1684, __pyx_L1_error)
10960  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10961 
10962  /* "cTwophaseDarcyCoefficients.pyx":1845
10963  * assert False, "configuration density_w_flag= {0} and density_n_flag= {1} not found ".format(density_w_flag, density_n_flag)
10964  *
10965  * def twophaseDarcy_vol_frac( np.ndarray matType, # <<<<<<<<<<<<<<
10966  * np.ndarray omega,
10967  * np.ndarray sw,
10968  */
10969  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_19twophaseDarcy_vol_frac, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1845, __pyx_L1_error)
10970  __Pyx_GOTREF(__pyx_t_1);
10971  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_vol_frac, __pyx_t_1) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
10972  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10973 
10974  /* "cTwophaseDarcyCoefficients.pyx":1865
10975  * <double*>(vol_frac_n.data))
10976  *
10977  * def generateSplineTables(int pskModelFlag, # <<<<<<<<<<<<<<
10978  * int startIndex, #where to insert into splineTable
10979  * int calcFlag, #f(Sw) or f(psic)
10980  */
10981  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_21generateSplineTables, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1865, __pyx_L1_error)
10982  __Pyx_GOTREF(__pyx_t_1);
10983  if (PyDict_SetItem(__pyx_d, __pyx_n_s_generateSplineTables, __pyx_t_1) < 0) __PYX_ERR(0, 1865, __pyx_L1_error)
10984  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10985 
10986  /* "cTwophaseDarcyCoefficients.pyx":1930
10987  * <double*>(splineTable.data))
10988  *
10989  * def twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType(int pskModelFlag, # <<<<<<<<<<<<<<
10990  * np.ndarray rowptr,
10991  * np.ndarray colind,
10992  */
10993  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_26cTwophaseDarcyCoefficients_23twophaseDarcy_incompressible_split_pp_sd_saturation_het_matType, NULL, __pyx_n_s_cTwophaseDarcyCoefficients); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1930, __pyx_L1_error)
10994  __Pyx_GOTREF(__pyx_t_1);
10995  if (PyDict_SetItem(__pyx_d, __pyx_n_s_twophaseDarcy_incompressible_spl_3, __pyx_t_1) < 0) __PYX_ERR(0, 1930, __pyx_L1_error)
10996  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10997 
10998  /* "cTwophaseDarcyCoefficients.pyx":1
10999  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
11000  * import numpy as np
11001  * cimport numpy as np
11002  */
11003  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
11004  __Pyx_GOTREF(__pyx_t_1);
11005  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11006  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11007 
11008  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
11009  *
11010  *
11011  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
11012  * """
11013  * returns the unit part of the dtype for a numpy datetime64 object.
11014  */
11015 
11016  /*--- Wrapped vars code ---*/
11017 
11018  goto __pyx_L0;
11019  __pyx_L1_error:;
11020  __Pyx_XDECREF(__pyx_t_1);
11021  if (__pyx_m) {
11022  if (__pyx_d) {
11023  __Pyx_AddTraceback("init cTwophaseDarcyCoefficients", __pyx_clineno, __pyx_lineno, __pyx_filename);
11024  }
11025  Py_CLEAR(__pyx_m);
11026  } else if (!PyErr_Occurred()) {
11027  PyErr_SetString(PyExc_ImportError, "init cTwophaseDarcyCoefficients");
11028  }
11029  __pyx_L0:;
11030  __Pyx_RefNannyFinishContext();
11031  #if CYTHON_PEP489_MULTI_PHASE_INIT
11032  return (__pyx_m != NULL) ? 0 : -1;
11033  #elif PY_MAJOR_VERSION >= 3
11034  return __pyx_m;
11035  #else
11036  return;
11037  #endif
11038 }
11039 
11040 /* --- Runtime support code --- */
11041 /* Refnanny */
11042 #if CYTHON_REFNANNY
11043 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
11044  PyObject *m = NULL, *p = NULL;
11045  void *r = NULL;
11046  m = PyImport_ImportModule(modname);
11047  if (!m) goto end;
11048  p = PyObject_GetAttrString(m, "RefNannyAPI");
11049  if (!p) goto end;
11050  r = PyLong_AsVoidPtr(p);
11051 end:
11052  Py_XDECREF(p);
11053  Py_XDECREF(m);
11054  return (__Pyx_RefNannyAPIStruct *)r;
11055 }
11056 #endif
11057 
11058 /* RaiseArgTupleInvalid */
11059 static void __Pyx_RaiseArgtupleInvalid(
11060  const char* func_name,
11061  int exact,
11062  Py_ssize_t num_min,
11063  Py_ssize_t num_max,
11064  Py_ssize_t num_found)
11065 {
11066  Py_ssize_t num_expected;
11067  const char *more_or_less;
11068  if (num_found < num_min) {
11069  num_expected = num_min;
11070  more_or_less = "at least";
11071  } else {
11072  num_expected = num_max;
11073  more_or_less = "at most";
11074  }
11075  if (exact) {
11076  more_or_less = "exactly";
11077  }
11078  PyErr_Format(PyExc_TypeError,
11079  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
11080  func_name, more_or_less, num_expected,
11081  (num_expected == 1) ? "" : "s", num_found);
11082 }
11083 
11084 /* RaiseDoubleKeywords */
11085 static void __Pyx_RaiseDoubleKeywordsError(
11086  const char* func_name,
11087  PyObject* kw_name)
11088 {
11089  PyErr_Format(PyExc_TypeError,
11090  #if PY_MAJOR_VERSION >= 3
11091  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
11092  #else
11093  "%s() got multiple values for keyword argument '%s'", func_name,
11094  PyString_AsString(kw_name));
11095  #endif
11096 }
11097 
11098 /* ParseKeywords */
11099 static int __Pyx_ParseOptionalKeywords(
11100  PyObject *kwds,
11101  PyObject **argnames[],
11102  PyObject *kwds2,
11103  PyObject *values[],
11104  Py_ssize_t num_pos_args,
11105  const char* function_name)
11106 {
11107  PyObject *key = 0, *value = 0;
11108  Py_ssize_t pos = 0;
11109  PyObject*** name;
11110  PyObject*** first_kw_arg = argnames + num_pos_args;
11111  while (PyDict_Next(kwds, &pos, &key, &value)) {
11112  name = first_kw_arg;
11113  while (*name && (**name != key)) name++;
11114  if (*name) {
11115  values[name-argnames] = value;
11116  continue;
11117  }
11118  name = first_kw_arg;
11119  #if PY_MAJOR_VERSION < 3
11120  if (likely(PyString_Check(key))) {
11121  while (*name) {
11122  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
11123  && _PyString_Eq(**name, key)) {
11124  values[name-argnames] = value;
11125  break;
11126  }
11127  name++;
11128  }
11129  if (*name) continue;
11130  else {
11131  PyObject*** argname = argnames;
11132  while (argname != first_kw_arg) {
11133  if ((**argname == key) || (
11134  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
11135  && _PyString_Eq(**argname, key))) {
11136  goto arg_passed_twice;
11137  }
11138  argname++;
11139  }
11140  }
11141  } else
11142  #endif
11143  if (likely(PyUnicode_Check(key))) {
11144  while (*name) {
11145  int cmp = (**name == key) ? 0 :
11146  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
11147  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
11148  #endif
11149  PyUnicode_Compare(**name, key);
11150  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
11151  if (cmp == 0) {
11152  values[name-argnames] = value;
11153  break;
11154  }
11155  name++;
11156  }
11157  if (*name) continue;
11158  else {
11159  PyObject*** argname = argnames;
11160  while (argname != first_kw_arg) {
11161  int cmp = (**argname == key) ? 0 :
11162  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
11163  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
11164  #endif
11165  PyUnicode_Compare(**argname, key);
11166  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
11167  if (cmp == 0) goto arg_passed_twice;
11168  argname++;
11169  }
11170  }
11171  } else
11172  goto invalid_keyword_type;
11173  if (kwds2) {
11174  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
11175  } else {
11176  goto invalid_keyword;
11177  }
11178  }
11179  return 0;
11180 arg_passed_twice:
11181  __Pyx_RaiseDoubleKeywordsError(function_name, key);
11182  goto bad;
11183 invalid_keyword_type:
11184  PyErr_Format(PyExc_TypeError,
11185  "%.200s() keywords must be strings", function_name);
11186  goto bad;
11187 invalid_keyword:
11188  PyErr_Format(PyExc_TypeError,
11189  #if PY_MAJOR_VERSION < 3
11190  "%.200s() got an unexpected keyword argument '%.200s'",
11191  function_name, PyString_AsString(key));
11192  #else
11193  "%s() got an unexpected keyword argument '%U'",
11194  function_name, key);
11195  #endif
11196 bad:
11197  return -1;
11198 }
11199 
11200 /* ArgTypeTest */
11201 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
11202 {
11203  if (unlikely(!type)) {
11204  PyErr_SetString(PyExc_SystemError, "Missing type object");
11205  return 0;
11206  }
11207  else if (exact) {
11208  #if PY_MAJOR_VERSION == 2
11209  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
11210  #endif
11211  }
11212  else {
11213  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
11214  }
11215  PyErr_Format(PyExc_TypeError,
11216  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
11217  name, type->tp_name, Py_TYPE(obj)->tp_name);
11218  return 0;
11219 }
11220 
11221 /* PyObjectGetAttrStr */
11222 #if CYTHON_USE_TYPE_SLOTS
11223 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
11224  PyTypeObject* tp = Py_TYPE(obj);
11225  if (likely(tp->tp_getattro))
11226  return tp->tp_getattro(obj, attr_name);
11227 #if PY_MAJOR_VERSION < 3
11228  if (likely(tp->tp_getattr))
11229  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
11230 #endif
11231  return PyObject_GetAttr(obj, attr_name);
11232 }
11233 #endif
11234 
11235 /* GetItemInt */
11236 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
11237  PyObject *r;
11238  if (!j) return NULL;
11239  r = PyObject_GetItem(o, j);
11240  Py_DECREF(j);
11241  return r;
11242 }
11243 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
11244  CYTHON_NCP_UNUSED int wraparound,
11245  CYTHON_NCP_UNUSED int boundscheck) {
11246 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11247  Py_ssize_t wrapped_i = i;
11248  if (wraparound & unlikely(i < 0)) {
11249  wrapped_i += PyList_GET_SIZE(o);
11250  }
11251  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
11252  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
11253  Py_INCREF(r);
11254  return r;
11255  }
11256  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
11257 #else
11258  return PySequence_GetItem(o, i);
11259 #endif
11260 }
11261 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
11262  CYTHON_NCP_UNUSED int wraparound,
11263  CYTHON_NCP_UNUSED int boundscheck) {
11264 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11265  Py_ssize_t wrapped_i = i;
11266  if (wraparound & unlikely(i < 0)) {
11267  wrapped_i += PyTuple_GET_SIZE(o);
11268  }
11269  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
11270  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
11271  Py_INCREF(r);
11272  return r;
11273  }
11274  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
11275 #else
11276  return PySequence_GetItem(o, i);
11277 #endif
11278 }
11279 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
11280  CYTHON_NCP_UNUSED int wraparound,
11281  CYTHON_NCP_UNUSED int boundscheck) {
11282 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
11283  if (is_list || PyList_CheckExact(o)) {
11284  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
11285  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
11286  PyObject *r = PyList_GET_ITEM(o, n);
11287  Py_INCREF(r);
11288  return r;
11289  }
11290  }
11291  else if (PyTuple_CheckExact(o)) {
11292  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
11293  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
11294  PyObject *r = PyTuple_GET_ITEM(o, n);
11295  Py_INCREF(r);
11296  return r;
11297  }
11298  } else {
11299  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
11300  if (likely(m && m->sq_item)) {
11301  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
11302  Py_ssize_t l = m->sq_length(o);
11303  if (likely(l >= 0)) {
11304  i += l;
11305  } else {
11306  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
11307  return NULL;
11308  PyErr_Clear();
11309  }
11310  }
11311  return m->sq_item(o, i);
11312  }
11313  }
11314 #else
11315  if (is_list || PySequence_Check(o)) {
11316  return PySequence_GetItem(o, i);
11317  }
11318 #endif
11319  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
11320 }
11321 
11322 /* PyFunctionFastCall */
11323 #if CYTHON_FAST_PYCALL
11324 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
11325  PyObject *globals) {
11326  PyFrameObject *f;
11327  PyThreadState *tstate = __Pyx_PyThreadState_Current;
11328  PyObject **fastlocals;
11329  Py_ssize_t i;
11330  PyObject *result;
11331  assert(globals != NULL);
11332  /* XXX Perhaps we should create a specialized
11333  PyFrame_New() that doesn't take locals, but does
11334  take builtins without sanity checking them.
11335  */
11336  assert(tstate != NULL);
11337  f = PyFrame_New(tstate, co, globals, NULL);
11338  if (f == NULL) {
11339  return NULL;
11340  }
11341  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
11342  for (i = 0; i < na; i++) {
11343  Py_INCREF(*args);
11344  fastlocals[i] = *args++;
11345  }
11346  result = PyEval_EvalFrameEx(f,0);
11347  ++tstate->recursion_depth;
11348  Py_DECREF(f);
11349  --tstate->recursion_depth;
11350  return result;
11351 }
11352 #if 1 || PY_VERSION_HEX < 0x030600B1
11353 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
11354  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
11355  PyObject *globals = PyFunction_GET_GLOBALS(func);
11356  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
11357  PyObject *closure;
11358 #if PY_MAJOR_VERSION >= 3
11359  PyObject *kwdefs;
11360 #endif
11361  PyObject *kwtuple, **k;
11362  PyObject **d;
11363  Py_ssize_t nd;
11364  Py_ssize_t nk;
11365  PyObject *result;
11366  assert(kwargs == NULL || PyDict_Check(kwargs));
11367  nk = kwargs ? PyDict_Size(kwargs) : 0;
11368  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
11369  return NULL;
11370  }
11371  if (
11372 #if PY_MAJOR_VERSION >= 3
11373  co->co_kwonlyargcount == 0 &&
11374 #endif
11375  likely(kwargs == NULL || nk == 0) &&
11376  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
11377  if (argdefs == NULL && co->co_argcount == nargs) {
11378  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
11379  goto done;
11380  }
11381  else if (nargs == 0 && argdefs != NULL
11382  && co->co_argcount == Py_SIZE(argdefs)) {
11383  /* function called with no arguments, but all parameters have
11384  a default value: use default values as arguments .*/
11385  args = &PyTuple_GET_ITEM(argdefs, 0);
11386  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
11387  goto done;
11388  }
11389  }
11390  if (kwargs != NULL) {
11391  Py_ssize_t pos, i;
11392  kwtuple = PyTuple_New(2 * nk);
11393  if (kwtuple == NULL) {
11394  result = NULL;
11395  goto done;
11396  }
11397  k = &PyTuple_GET_ITEM(kwtuple, 0);
11398  pos = i = 0;
11399  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
11400  Py_INCREF(k[i]);
11401  Py_INCREF(k[i+1]);
11402  i += 2;
11403  }
11404  nk = i / 2;
11405  }
11406  else {
11407  kwtuple = NULL;
11408  k = NULL;
11409  }
11410  closure = PyFunction_GET_CLOSURE(func);
11411 #if PY_MAJOR_VERSION >= 3
11412  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
11413 #endif
11414  if (argdefs != NULL) {
11415  d = &PyTuple_GET_ITEM(argdefs, 0);
11416  nd = Py_SIZE(argdefs);
11417  }
11418  else {
11419  d = NULL;
11420  nd = 0;
11421  }
11422 #if PY_MAJOR_VERSION >= 3
11423  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
11424  args, (int)nargs,
11425  k, (int)nk,
11426  d, (int)nd, kwdefs, closure);
11427 #else
11428  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
11429  args, (int)nargs,
11430  k, (int)nk,
11431  d, (int)nd, closure);
11432 #endif
11433  Py_XDECREF(kwtuple);
11434 done:
11435  Py_LeaveRecursiveCall();
11436  return result;
11437 }
11438 #endif
11439 #endif
11440 
11441 /* PyCFunctionFastCall */
11442 #if CYTHON_FAST_PYCCALL
11443 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
11444  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
11445  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
11446  PyObject *self = PyCFunction_GET_SELF(func);
11447  int flags = PyCFunction_GET_FLAGS(func);
11448  assert(PyCFunction_Check(func));
11449  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
11450  assert(nargs >= 0);
11451  assert(nargs == 0 || args != NULL);
11452  /* _PyCFunction_FastCallDict() must not be called with an exception set,
11453  because it may clear it (directly or indirectly) and so the
11454  caller loses its exception */
11455  assert(!PyErr_Occurred());
11456  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
11457  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
11458  } else {
11459  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
11460  }
11461 }
11462 #endif
11463 
11464 /* PyObjectCall */
11465 #if CYTHON_COMPILING_IN_CPYTHON
11466 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
11467  PyObject *result;
11468  ternaryfunc call = Py_TYPE(func)->tp_call;
11469  if (unlikely(!call))
11470  return PyObject_Call(func, arg, kw);
11471  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
11472  return NULL;
11473  result = (*call)(func, arg, kw);
11474  Py_LeaveRecursiveCall();
11475  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
11476  PyErr_SetString(
11477  PyExc_SystemError,
11478  "NULL result without error in PyObject_Call");
11479  }
11480  return result;
11481 }
11482 #endif
11483 
11484 /* GetBuiltinName */
11485 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
11486  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
11487  if (unlikely(!result)) {
11488  PyErr_Format(PyExc_NameError,
11489 #if PY_MAJOR_VERSION >= 3
11490  "name '%U' is not defined", name);
11491 #else
11492  "name '%.200s' is not defined", PyString_AS_STRING(name));
11493 #endif
11494  }
11495  return result;
11496 }
11497 
11498 /* GetTopmostException */
11499 #if CYTHON_USE_EXC_INFO_STACK
11500 static _PyErr_StackItem *
11501 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11502 {
11503  _PyErr_StackItem *exc_info = tstate->exc_info;
11504  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
11505  exc_info->previous_item != NULL)
11506  {
11507  exc_info = exc_info->previous_item;
11508  }
11509  return exc_info;
11510 }
11511 #endif
11512 
11513 /* SaveResetException */
11514 #if CYTHON_FAST_THREAD_STATE
11515 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11516  #if CYTHON_USE_EXC_INFO_STACK
11517  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11518  *type = exc_info->exc_type;
11519  *value = exc_info->exc_value;
11520  *tb = exc_info->exc_traceback;
11521  #else
11522  *type = tstate->exc_type;
11523  *value = tstate->exc_value;
11524  *tb = tstate->exc_traceback;
11525  #endif
11526  Py_XINCREF(*type);
11527  Py_XINCREF(*value);
11528  Py_XINCREF(*tb);
11529 }
11530 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11531  PyObject *tmp_type, *tmp_value, *tmp_tb;
11532  #if CYTHON_USE_EXC_INFO_STACK
11533  _PyErr_StackItem *exc_info = tstate->exc_info;
11534  tmp_type = exc_info->exc_type;
11535  tmp_value = exc_info->exc_value;
11536  tmp_tb = exc_info->exc_traceback;
11537  exc_info->exc_type = type;
11538  exc_info->exc_value = value;
11539  exc_info->exc_traceback = tb;
11540  #else
11541  tmp_type = tstate->exc_type;
11542  tmp_value = tstate->exc_value;
11543  tmp_tb = tstate->exc_traceback;
11544  tstate->exc_type = type;
11545  tstate->exc_value = value;
11546  tstate->exc_traceback = tb;
11547  #endif
11548  Py_XDECREF(tmp_type);
11549  Py_XDECREF(tmp_value);
11550  Py_XDECREF(tmp_tb);
11551 }
11552 #endif
11553 
11554 /* PyErrExceptionMatches */
11555 #if CYTHON_FAST_THREAD_STATE
11556 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11557  Py_ssize_t i, n;
11558  n = PyTuple_GET_SIZE(tuple);
11559 #if PY_MAJOR_VERSION >= 3
11560  for (i=0; i<n; i++) {
11561  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11562  }
11563 #endif
11564  for (i=0; i<n; i++) {
11565  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
11566  }
11567  return 0;
11568 }
11569 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
11570  PyObject *exc_type = tstate->curexc_type;
11571  if (exc_type == err) return 1;
11572  if (unlikely(!exc_type)) return 0;
11573  if (unlikely(PyTuple_Check(err)))
11574  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
11575  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
11576 }
11577 #endif
11578 
11579 /* GetException */
11580 #if CYTHON_FAST_THREAD_STATE
11581 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
11582 #else
11583 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
11584 #endif
11585 {
11586  PyObject *local_type, *local_value, *local_tb;
11587 #if CYTHON_FAST_THREAD_STATE
11588  PyObject *tmp_type, *tmp_value, *tmp_tb;
11589  local_type = tstate->curexc_type;
11590  local_value = tstate->curexc_value;
11591  local_tb = tstate->curexc_traceback;
11592  tstate->curexc_type = 0;
11593  tstate->curexc_value = 0;
11594  tstate->curexc_traceback = 0;
11595 #else
11596  PyErr_Fetch(&local_type, &local_value, &local_tb);
11597 #endif
11598  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
11599 #if CYTHON_FAST_THREAD_STATE
11600  if (unlikely(tstate->curexc_type))
11601 #else
11602  if (unlikely(PyErr_Occurred()))
11603 #endif
11604  goto bad;
11605  #if PY_MAJOR_VERSION >= 3
11606  if (local_tb) {
11607  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
11608  goto bad;
11609  }
11610  #endif
11611  Py_XINCREF(local_tb);
11612  Py_XINCREF(local_type);
11613  Py_XINCREF(local_value);
11614  *type = local_type;
11615  *value = local_value;
11616  *tb = local_tb;
11617 #if CYTHON_FAST_THREAD_STATE
11618  #if CYTHON_USE_EXC_INFO_STACK
11619  {
11620  _PyErr_StackItem *exc_info = tstate->exc_info;
11621  tmp_type = exc_info->exc_type;
11622  tmp_value = exc_info->exc_value;
11623  tmp_tb = exc_info->exc_traceback;
11624  exc_info->exc_type = local_type;
11625  exc_info->exc_value = local_value;
11626  exc_info->exc_traceback = local_tb;
11627  }
11628  #else
11629  tmp_type = tstate->exc_type;
11630  tmp_value = tstate->exc_value;
11631  tmp_tb = tstate->exc_traceback;
11632  tstate->exc_type = local_type;
11633  tstate->exc_value = local_value;
11634  tstate->exc_traceback = local_tb;
11635  #endif
11636  Py_XDECREF(tmp_type);
11637  Py_XDECREF(tmp_value);
11638  Py_XDECREF(tmp_tb);
11639 #else
11640  PyErr_SetExcInfo(local_type, local_value, local_tb);
11641 #endif
11642  return 0;
11643 bad:
11644  *type = 0;
11645  *value = 0;
11646  *tb = 0;
11647  Py_XDECREF(local_type);
11648  Py_XDECREF(local_value);
11649  Py_XDECREF(local_tb);
11650  return -1;
11651 }
11652 
11653 /* PyErrFetchRestore */
11654 #if CYTHON_FAST_THREAD_STATE
11655 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11656  PyObject *tmp_type, *tmp_value, *tmp_tb;
11657  tmp_type = tstate->curexc_type;
11658  tmp_value = tstate->curexc_value;
11659  tmp_tb = tstate->curexc_traceback;
11660  tstate->curexc_type = type;
11661  tstate->curexc_value = value;
11662  tstate->curexc_traceback = tb;
11663  Py_XDECREF(tmp_type);
11664  Py_XDECREF(tmp_value);
11665  Py_XDECREF(tmp_tb);
11666 }
11667 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11668  *type = tstate->curexc_type;
11669  *value = tstate->curexc_value;
11670  *tb = tstate->curexc_traceback;
11671  tstate->curexc_type = 0;
11672  tstate->curexc_value = 0;
11673  tstate->curexc_traceback = 0;
11674 }
11675 #endif
11676 
11677 /* RaiseException */
11678 #if PY_MAJOR_VERSION < 3
11679 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
11680  CYTHON_UNUSED PyObject *cause) {
11681  __Pyx_PyThreadState_declare
11682  Py_XINCREF(type);
11683  if (!value || value == Py_None)
11684  value = NULL;
11685  else
11686  Py_INCREF(value);
11687  if (!tb || tb == Py_None)
11688  tb = NULL;
11689  else {
11690  Py_INCREF(tb);
11691  if (!PyTraceBack_Check(tb)) {
11692  PyErr_SetString(PyExc_TypeError,
11693  "raise: arg 3 must be a traceback or None");
11694  goto raise_error;
11695  }
11696  }
11697  if (PyType_Check(type)) {
11698 #if CYTHON_COMPILING_IN_PYPY
11699  if (!value) {
11700  Py_INCREF(Py_None);
11701  value = Py_None;
11702  }
11703 #endif
11704  PyErr_NormalizeException(&type, &value, &tb);
11705  } else {
11706  if (value) {
11707  PyErr_SetString(PyExc_TypeError,
11708  "instance exception may not have a separate value");
11709  goto raise_error;
11710  }
11711  value = type;
11712  type = (PyObject*) Py_TYPE(type);
11713  Py_INCREF(type);
11714  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
11715  PyErr_SetString(PyExc_TypeError,
11716  "raise: exception class must be a subclass of BaseException");
11717  goto raise_error;
11718  }
11719  }
11720  __Pyx_PyThreadState_assign
11721  __Pyx_ErrRestore(type, value, tb);
11722  return;
11723 raise_error:
11724  Py_XDECREF(value);
11725  Py_XDECREF(type);
11726  Py_XDECREF(tb);
11727  return;
11728 }
11729 #else
11730 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11731  PyObject* owned_instance = NULL;
11732  if (tb == Py_None) {
11733  tb = 0;
11734  } else if (tb && !PyTraceBack_Check(tb)) {
11735  PyErr_SetString(PyExc_TypeError,
11736  "raise: arg 3 must be a traceback or None");
11737  goto bad;
11738  }
11739  if (value == Py_None)
11740  value = 0;
11741  if (PyExceptionInstance_Check(type)) {
11742  if (value) {
11743  PyErr_SetString(PyExc_TypeError,
11744  "instance exception may not have a separate value");
11745  goto bad;
11746  }
11747  value = type;
11748  type = (PyObject*) Py_TYPE(value);
11749  } else if (PyExceptionClass_Check(type)) {
11750  PyObject *instance_class = NULL;
11751  if (value && PyExceptionInstance_Check(value)) {
11752  instance_class = (PyObject*) Py_TYPE(value);
11753  if (instance_class != type) {
11754  int is_subclass = PyObject_IsSubclass(instance_class, type);
11755  if (!is_subclass) {
11756  instance_class = NULL;
11757  } else if (unlikely(is_subclass == -1)) {
11758  goto bad;
11759  } else {
11760  type = instance_class;
11761  }
11762  }
11763  }
11764  if (!instance_class) {
11765  PyObject *args;
11766  if (!value)
11767  args = PyTuple_New(0);
11768  else if (PyTuple_Check(value)) {
11769  Py_INCREF(value);
11770  args = value;
11771  } else
11772  args = PyTuple_Pack(1, value);
11773  if (!args)
11774  goto bad;
11775  owned_instance = PyObject_Call(type, args, NULL);
11776  Py_DECREF(args);
11777  if (!owned_instance)
11778  goto bad;
11779  value = owned_instance;
11780  if (!PyExceptionInstance_Check(value)) {
11781  PyErr_Format(PyExc_TypeError,
11782  "calling %R should have returned an instance of "
11783  "BaseException, not %R",
11784  type, Py_TYPE(value));
11785  goto bad;
11786  }
11787  }
11788  } else {
11789  PyErr_SetString(PyExc_TypeError,
11790  "raise: exception class must be a subclass of BaseException");
11791  goto bad;
11792  }
11793  if (cause) {
11794  PyObject *fixed_cause;
11795  if (cause == Py_None) {
11796  fixed_cause = NULL;
11797  } else if (PyExceptionClass_Check(cause)) {
11798  fixed_cause = PyObject_CallObject(cause, NULL);
11799  if (fixed_cause == NULL)
11800  goto bad;
11801  } else if (PyExceptionInstance_Check(cause)) {
11802  fixed_cause = cause;
11803  Py_INCREF(fixed_cause);
11804  } else {
11805  PyErr_SetString(PyExc_TypeError,
11806  "exception causes must derive from "
11807  "BaseException");
11808  goto bad;
11809  }
11810  PyException_SetCause(value, fixed_cause);
11811  }
11812  PyErr_SetObject(type, value);
11813  if (tb) {
11814 #if CYTHON_COMPILING_IN_PYPY
11815  PyObject *tmp_type, *tmp_value, *tmp_tb;
11816  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
11817  Py_INCREF(tb);
11818  PyErr_Restore(tmp_type, tmp_value, tb);
11819  Py_XDECREF(tmp_tb);
11820 #else
11821  PyThreadState *tstate = __Pyx_PyThreadState_Current;
11822  PyObject* tmp_tb = tstate->curexc_traceback;
11823  if (tb != tmp_tb) {
11824  Py_INCREF(tb);
11825  tstate->curexc_traceback = tb;
11826  Py_XDECREF(tmp_tb);
11827  }
11828 #endif
11829  }
11830 bad:
11831  Py_XDECREF(owned_instance);
11832  return;
11833 }
11834 #endif
11835 
11836 /* TypeImport */
11837 #ifndef __PYX_HAVE_RT_ImportType
11838 #define __PYX_HAVE_RT_ImportType
11839 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
11840  size_t size, enum __Pyx_ImportType_CheckSize check_size)
11841 {
11842  PyObject *result = 0;
11843  char warning[200];
11844  Py_ssize_t basicsize;
11845 #ifdef Py_LIMITED_API
11846  PyObject *py_basicsize;
11847 #endif
11848  result = PyObject_GetAttrString(module, class_name);
11849  if (!result)
11850  goto bad;
11851  if (!PyType_Check(result)) {
11852  PyErr_Format(PyExc_TypeError,
11853  "%.200s.%.200s is not a type object",
11854  module_name, class_name);
11855  goto bad;
11856  }
11857 #ifndef Py_LIMITED_API
11858  basicsize = ((PyTypeObject *)result)->tp_basicsize;
11859 #else
11860  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
11861  if (!py_basicsize)
11862  goto bad;
11863  basicsize = PyLong_AsSsize_t(py_basicsize);
11864  Py_DECREF(py_basicsize);
11865  py_basicsize = 0;
11866  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
11867  goto bad;
11868 #endif
11869  if ((size_t)basicsize < size) {
11870  PyErr_Format(PyExc_ValueError,
11871  "%.200s.%.200s size changed, may indicate binary incompatibility. "
11872  "Expected %zd from C header, got %zd from PyObject",
11873  module_name, class_name, size, basicsize);
11874  goto bad;
11875  }
11876  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
11877  PyErr_Format(PyExc_ValueError,
11878  "%.200s.%.200s size changed, may indicate binary incompatibility. "
11879  "Expected %zd from C header, got %zd from PyObject",
11880  module_name, class_name, size, basicsize);
11881  goto bad;
11882  }
11883  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
11884  PyOS_snprintf(warning, sizeof(warning),
11885  "%s.%s size changed, may indicate binary incompatibility. "
11886  "Expected %zd from C header, got %zd from PyObject",
11887  module_name, class_name, size, basicsize);
11888  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
11889  }
11890  return (PyTypeObject *)result;
11891 bad:
11892  Py_XDECREF(result);
11893  return NULL;
11894 }
11895 #endif
11896 
11897 /* Import */
11898 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
11899  PyObject *empty_list = 0;
11900  PyObject *module = 0;
11901  PyObject *global_dict = 0;
11902  PyObject *empty_dict = 0;
11903  PyObject *list;
11904  #if PY_MAJOR_VERSION < 3
11905  PyObject *py_import;
11906  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
11907  if (!py_import)
11908  goto bad;
11909  #endif
11910  if (from_list)
11911  list = from_list;
11912  else {
11913  empty_list = PyList_New(0);
11914  if (!empty_list)
11915  goto bad;
11916  list = empty_list;
11917  }
11918  global_dict = PyModule_GetDict(__pyx_m);
11919  if (!global_dict)
11920  goto bad;
11921  empty_dict = PyDict_New();
11922  if (!empty_dict)
11923  goto bad;
11924  {
11925  #if PY_MAJOR_VERSION >= 3
11926  if (level == -1) {
11927  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
11928  module = PyImport_ImportModuleLevelObject(
11929  name, global_dict, empty_dict, list, 1);
11930  if (!module) {
11931  if (!PyErr_ExceptionMatches(PyExc_ImportError))
11932  goto bad;
11933  PyErr_Clear();
11934  }
11935  }
11936  level = 0;
11937  }
11938  #endif
11939  if (!module) {
11940  #if PY_MAJOR_VERSION < 3
11941  PyObject *py_level = PyInt_FromLong(level);
11942  if (!py_level)
11943  goto bad;
11944  module = PyObject_CallFunctionObjArgs(py_import,
11945  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
11946  Py_DECREF(py_level);
11947  #else
11948  module = PyImport_ImportModuleLevelObject(
11949  name, global_dict, empty_dict, list, level);
11950  #endif
11951  }
11952  }
11953 bad:
11954  #if PY_MAJOR_VERSION < 3
11955  Py_XDECREF(py_import);
11956  #endif
11957  Py_XDECREF(empty_list);
11958  Py_XDECREF(empty_dict);
11959  return module;
11960 }
11961 
11962 /* PyDictVersioning */
11963 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
11964 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
11965  PyObject *dict = Py_TYPE(obj)->tp_dict;
11966  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
11967 }
11968 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
11969  PyObject **dictptr = NULL;
11970  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
11971  if (offset) {
11972 #if CYTHON_COMPILING_IN_CPYTHON
11973  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
11974 #else
11975  dictptr = _PyObject_GetDictPtr(obj);
11976 #endif
11977  }
11978  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
11979 }
11980 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
11981  PyObject *dict = Py_TYPE(obj)->tp_dict;
11982  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
11983  return 0;
11984  return obj_dict_version == __Pyx_get_object_dict_version(obj);
11985 }
11986 #endif
11987 
11988 /* CLineInTraceback */
11989 #ifndef CYTHON_CLINE_IN_TRACEBACK
11990 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
11991  PyObject *use_cline;
11992  PyObject *ptype, *pvalue, *ptraceback;
11993 #if CYTHON_COMPILING_IN_CPYTHON
11994  PyObject **cython_runtime_dict;
11995 #endif
11996  if (unlikely(!__pyx_cython_runtime)) {
11997  return c_line;
11998  }
11999  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
12000 #if CYTHON_COMPILING_IN_CPYTHON
12001  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
12002  if (likely(cython_runtime_dict)) {
12003  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
12004  use_cline, *cython_runtime_dict,
12005  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
12006  } else
12007 #endif
12008  {
12009  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
12010  if (use_cline_obj) {
12011  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
12012  Py_DECREF(use_cline_obj);
12013  } else {
12014  PyErr_Clear();
12015  use_cline = NULL;
12016  }
12017  }
12018  if (!use_cline) {
12019  c_line = 0;
12020  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
12021  }
12022  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
12023  c_line = 0;
12024  }
12025  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
12026  return c_line;
12027 }
12028 #endif
12029 
12030 /* CodeObjectCache */
12031 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
12032  int start = 0, mid = 0, end = count - 1;
12033  if (end >= 0 && code_line > entries[end].code_line) {
12034  return count;
12035  }
12036  while (start < end) {
12037  mid = start + (end - start) / 2;
12038  if (code_line < entries[mid].code_line) {
12039  end = mid;
12040  } else if (code_line > entries[mid].code_line) {
12041  start = mid + 1;
12042  } else {
12043  return mid;
12044  }
12045  }
12046  if (code_line <= entries[mid].code_line) {
12047  return mid;
12048  } else {
12049  return mid + 1;
12050  }
12051 }
12052 static PyCodeObject *__pyx_find_code_object(int code_line) {
12053  PyCodeObject* code_object;
12054  int pos;
12055  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
12056  return NULL;
12057  }
12058  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
12059  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
12060  return NULL;
12061  }
12062  code_object = __pyx_code_cache.entries[pos].code_object;
12063  Py_INCREF(code_object);
12064  return code_object;
12065 }
12066 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
12067  int pos, i;
12068  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
12069  if (unlikely(!code_line)) {
12070  return;
12071  }
12072  if (unlikely(!entries)) {
12073  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
12074  if (likely(entries)) {
12075  __pyx_code_cache.entries = entries;
12076  __pyx_code_cache.max_count = 64;
12077  __pyx_code_cache.count = 1;
12078  entries[0].code_line = code_line;
12079  entries[0].code_object = code_object;
12080  Py_INCREF(code_object);
12081  }
12082  return;
12083  }
12084  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
12085  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
12086  PyCodeObject* tmp = entries[pos].code_object;
12087  entries[pos].code_object = code_object;
12088  Py_DECREF(tmp);
12089  return;
12090  }
12091  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
12092  int new_max = __pyx_code_cache.max_count + 64;
12093  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
12094  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
12095  if (unlikely(!entries)) {
12096  return;
12097  }
12098  __pyx_code_cache.entries = entries;
12099  __pyx_code_cache.max_count = new_max;
12100  }
12101  for (i=__pyx_code_cache.count; i>pos; i--) {
12102  entries[i] = entries[i-1];
12103  }
12104  entries[pos].code_line = code_line;
12105  entries[pos].code_object = code_object;
12106  __pyx_code_cache.count++;
12107  Py_INCREF(code_object);
12108 }
12109 
12110 /* AddTraceback */
12111 #include "compile.h"
12112 #include "frameobject.h"
12113 #include "traceback.h"
12114 #if PY_VERSION_HEX >= 0x030b00a6
12115  #ifndef Py_BUILD_CORE
12116  #define Py_BUILD_CORE 1
12117  #endif
12118  #include "internal/pycore_frame.h"
12119 #endif
12120 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
12121  const char *funcname, int c_line,
12122  int py_line, const char *filename) {
12123  PyCodeObject *py_code = NULL;
12124  PyObject *py_funcname = NULL;
12125  #if PY_MAJOR_VERSION < 3
12126  PyObject *py_srcfile = NULL;
12127  py_srcfile = PyString_FromString(filename);
12128  if (!py_srcfile) goto bad;
12129  #endif
12130  if (c_line) {
12131  #if PY_MAJOR_VERSION < 3
12132  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12133  if (!py_funcname) goto bad;
12134  #else
12135  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12136  if (!py_funcname) goto bad;
12137  funcname = PyUnicode_AsUTF8(py_funcname);
12138  if (!funcname) goto bad;
12139  #endif
12140  }
12141  else {
12142  #if PY_MAJOR_VERSION < 3
12143  py_funcname = PyString_FromString(funcname);
12144  if (!py_funcname) goto bad;
12145  #endif
12146  }
12147  #if PY_MAJOR_VERSION < 3
12148  py_code = __Pyx_PyCode_New(
12149  0,
12150  0,
12151  0,
12152  0,
12153  0,
12154  __pyx_empty_bytes, /*PyObject *code,*/
12155  __pyx_empty_tuple, /*PyObject *consts,*/
12156  __pyx_empty_tuple, /*PyObject *names,*/
12157  __pyx_empty_tuple, /*PyObject *varnames,*/
12158  __pyx_empty_tuple, /*PyObject *freevars,*/
12159  __pyx_empty_tuple, /*PyObject *cellvars,*/
12160  py_srcfile, /*PyObject *filename,*/
12161  py_funcname, /*PyObject *name,*/
12162  py_line,
12163  __pyx_empty_bytes /*PyObject *lnotab*/
12164  );
12165  Py_DECREF(py_srcfile);
12166  #else
12167  py_code = PyCode_NewEmpty(filename, funcname, py_line);
12168  #endif
12169  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
12170  return py_code;
12171 bad:
12172  Py_XDECREF(py_funcname);
12173  #if PY_MAJOR_VERSION < 3
12174  Py_XDECREF(py_srcfile);
12175  #endif
12176  return NULL;
12177 }
12178 static void __Pyx_AddTraceback(const char *funcname, int c_line,
12179  int py_line, const char *filename) {
12180  PyCodeObject *py_code = 0;
12181  PyFrameObject *py_frame = 0;
12182  PyThreadState *tstate = __Pyx_PyThreadState_Current;
12183  PyObject *ptype, *pvalue, *ptraceback;
12184  if (c_line) {
12185  c_line = __Pyx_CLineForTraceback(tstate, c_line);
12186  }
12187  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
12188  if (!py_code) {
12189  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
12190  py_code = __Pyx_CreateCodeObjectForTraceback(
12191  funcname, c_line, py_line, filename);
12192  if (!py_code) {
12193  /* If the code object creation fails, then we should clear the
12194  fetched exception references and propagate the new exception */
12195  Py_XDECREF(ptype);
12196  Py_XDECREF(pvalue);
12197  Py_XDECREF(ptraceback);
12198  goto bad;
12199  }
12200  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
12201  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
12202  }
12203  py_frame = PyFrame_New(
12204  tstate, /*PyThreadState *tstate,*/
12205  py_code, /*PyCodeObject *code,*/
12206  __pyx_d, /*PyObject *globals,*/
12207  0 /*PyObject *locals*/
12208  );
12209  if (!py_frame) goto bad;
12210  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
12211  PyTraceBack_Here(py_frame);
12212 bad:
12213  Py_XDECREF(py_code);
12214  Py_XDECREF(py_frame);
12215 }
12216 
12217 /* CIntFromPyVerify */
12218 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
12219  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
12220 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
12221  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
12222 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
12223  {\
12224  func_type value = func_value;\
12225  if (sizeof(target_type) < sizeof(func_type)) {\
12226  if (unlikely(value != (func_type) (target_type) value)) {\
12227  func_type zero = 0;\
12228  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
12229  return (target_type) -1;\
12230  if (is_unsigned && unlikely(value < zero))\
12231  goto raise_neg_overflow;\
12232  else\
12233  goto raise_overflow;\
12234  }\
12235  }\
12236  return (target_type) value;\
12237  }
12238 
12239 /* Declarations */
12240 #if CYTHON_CCOMPLEX
12241  #ifdef __cplusplus
12242  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12243  return ::std::complex< float >(x, y);
12244  }
12245  #else
12246  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12247  return x + y*(__pyx_t_float_complex)_Complex_I;
12248  }
12249  #endif
12250 #else
12251  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12252  __pyx_t_float_complex z;
12253  z.real = x;
12254  z.imag = y;
12255  return z;
12256  }
12257 #endif
12258 
12259 /* Arithmetic */
12260 #if CYTHON_CCOMPLEX
12261 #else
12262  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12263  return (a.real == b.real) && (a.imag == b.imag);
12264  }
12265  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12266  __pyx_t_float_complex z;
12267  z.real = a.real + b.real;
12268  z.imag = a.imag + b.imag;
12269  return z;
12270  }
12271  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12272  __pyx_t_float_complex z;
12273  z.real = a.real - b.real;
12274  z.imag = a.imag - b.imag;
12275  return z;
12276  }
12277  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12278  __pyx_t_float_complex z;
12279  z.real = a.real * b.real - a.imag * b.imag;
12280  z.imag = a.real * b.imag + a.imag * b.real;
12281  return z;
12282  }
12283  #if 1
12284  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12285  if (b.imag == 0) {
12286  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
12287  } else if (fabsf(b.real) >= fabsf(b.imag)) {
12288  if (b.real == 0 && b.imag == 0) {
12289  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
12290  } else {
12291  float r = b.imag / b.real;
12292  float s = (float)(1.0) / (b.real + b.imag * r);
12293  return __pyx_t_float_complex_from_parts(
12294  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
12295  }
12296  } else {
12297  float r = b.real / b.imag;
12298  float s = (float)(1.0) / (b.imag + b.real * r);
12299  return __pyx_t_float_complex_from_parts(
12300  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
12301  }
12302  }
12303  #else
12304  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12305  if (b.imag == 0) {
12306  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
12307  } else {
12308  float denom = b.real * b.real + b.imag * b.imag;
12309  return __pyx_t_float_complex_from_parts(
12310  (a.real * b.real + a.imag * b.imag) / denom,
12311  (a.imag * b.real - a.real * b.imag) / denom);
12312  }
12313  }
12314  #endif
12315  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
12316  __pyx_t_float_complex z;
12317  z.real = -a.real;
12318  z.imag = -a.imag;
12319  return z;
12320  }
12321  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
12322  return (a.real == 0) && (a.imag == 0);
12323  }
12324  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
12325  __pyx_t_float_complex z;
12326  z.real = a.real;
12327  z.imag = -a.imag;
12328  return z;
12329  }
12330  #if 1
12331  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
12332  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12333  return sqrtf(z.real*z.real + z.imag*z.imag);
12334  #else
12335  return hypotf(z.real, z.imag);
12336  #endif
12337  }
12338  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12339  __pyx_t_float_complex z;
12340  float r, lnr, theta, z_r, z_theta;
12341  if (b.imag == 0 && b.real == (int)b.real) {
12342  if (b.real < 0) {
12343  float denom = a.real * a.real + a.imag * a.imag;
12344  a.real = a.real / denom;
12345  a.imag = -a.imag / denom;
12346  b.real = -b.real;
12347  }
12348  switch ((int)b.real) {
12349  case 0:
12350  z.real = 1;
12351  z.imag = 0;
12352  return z;
12353  case 1:
12354  return a;
12355  case 2:
12356  return __Pyx_c_prod_float(a, a);
12357  case 3:
12358  z = __Pyx_c_prod_float(a, a);
12359  return __Pyx_c_prod_float(z, a);
12360  case 4:
12361  z = __Pyx_c_prod_float(a, a);
12362  return __Pyx_c_prod_float(z, z);
12363  }
12364  }
12365  if (a.imag == 0) {
12366  if (a.real == 0) {
12367  return a;
12368  } else if (b.imag == 0) {
12369  z.real = powf(a.real, b.real);
12370  z.imag = 0;
12371  return z;
12372  } else if (a.real > 0) {
12373  r = a.real;
12374  theta = 0;
12375  } else {
12376  r = -a.real;
12377  theta = atan2f(0.0, -1.0);
12378  }
12379  } else {
12380  r = __Pyx_c_abs_float(a);
12381  theta = atan2f(a.imag, a.real);
12382  }
12383  lnr = logf(r);
12384  z_r = expf(lnr * b.real - theta * b.imag);
12385  z_theta = theta * b.real + lnr * b.imag;
12386  z.real = z_r * cosf(z_theta);
12387  z.imag = z_r * sinf(z_theta);
12388  return z;
12389  }
12390  #endif
12391 #endif
12392 
12393 /* Declarations */
12394 #if CYTHON_CCOMPLEX
12395  #ifdef __cplusplus
12396  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12397  return ::std::complex< double >(x, y);
12398  }
12399  #else
12400  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12401  return x + y*(__pyx_t_double_complex)_Complex_I;
12402  }
12403  #endif
12404 #else
12405  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12406  __pyx_t_double_complex z;
12407  z.real = x;
12408  z.imag = y;
12409  return z;
12410  }
12411 #endif
12412 
12413 /* Arithmetic */
12414 #if CYTHON_CCOMPLEX
12415 #else
12416  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12417  return (a.real == b.real) && (a.imag == b.imag);
12418  }
12419  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12420  __pyx_t_double_complex z;
12421  z.real = a.real + b.real;
12422  z.imag = a.imag + b.imag;
12423  return z;
12424  }
12425  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12426  __pyx_t_double_complex z;
12427  z.real = a.real - b.real;
12428  z.imag = a.imag - b.imag;
12429  return z;
12430  }
12431  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12432  __pyx_t_double_complex z;
12433  z.real = a.real * b.real - a.imag * b.imag;
12434  z.imag = a.real * b.imag + a.imag * b.real;
12435  return z;
12436  }
12437  #if 1
12438  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12439  if (b.imag == 0) {
12440  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12441  } else if (fabs(b.real) >= fabs(b.imag)) {
12442  if (b.real == 0 && b.imag == 0) {
12443  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
12444  } else {
12445  double r = b.imag / b.real;
12446  double s = (double)(1.0) / (b.real + b.imag * r);
12447  return __pyx_t_double_complex_from_parts(
12448  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
12449  }
12450  } else {
12451  double r = b.real / b.imag;
12452  double s = (double)(1.0) / (b.imag + b.real * r);
12453  return __pyx_t_double_complex_from_parts(
12454  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
12455  }
12456  }
12457  #else
12458  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12459  if (b.imag == 0) {
12460  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12461  } else {
12462  double denom = b.real * b.real + b.imag * b.imag;
12463  return __pyx_t_double_complex_from_parts(
12464  (a.real * b.real + a.imag * b.imag) / denom,
12465  (a.imag * b.real - a.real * b.imag) / denom);
12466  }
12467  }
12468  #endif
12469  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
12470  __pyx_t_double_complex z;
12471  z.real = -a.real;
12472  z.imag = -a.imag;
12473  return z;
12474  }
12475  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
12476  return (a.real == 0) && (a.imag == 0);
12477  }
12478  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
12479  __pyx_t_double_complex z;
12480  z.real = a.real;
12481  z.imag = -a.imag;
12482  return z;
12483  }
12484  #if 1
12485  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
12486  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12487  return sqrt(z.real*z.real + z.imag*z.imag);
12488  #else
12489  return hypot(z.real, z.imag);
12490  #endif
12491  }
12492  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12493  __pyx_t_double_complex z;
12494  double r, lnr, theta, z_r, z_theta;
12495  if (b.imag == 0 && b.real == (int)b.real) {
12496  if (b.real < 0) {
12497  double denom = a.real * a.real + a.imag * a.imag;
12498  a.real = a.real / denom;
12499  a.imag = -a.imag / denom;
12500  b.real = -b.real;
12501  }
12502  switch ((int)b.real) {
12503  case 0:
12504  z.real = 1;
12505  z.imag = 0;
12506  return z;
12507  case 1:
12508  return a;
12509  case 2:
12510  return __Pyx_c_prod_double(a, a);
12511  case 3:
12512  z = __Pyx_c_prod_double(a, a);
12513  return __Pyx_c_prod_double(z, a);
12514  case 4:
12515  z = __Pyx_c_prod_double(a, a);
12516  return __Pyx_c_prod_double(z, z);
12517  }
12518  }
12519  if (a.imag == 0) {
12520  if (a.real == 0) {
12521  return a;
12522  } else if (b.imag == 0) {
12523  z.real = pow(a.real, b.real);
12524  z.imag = 0;
12525  return z;
12526  } else if (a.real > 0) {
12527  r = a.real;
12528  theta = 0;
12529  } else {
12530  r = -a.real;
12531  theta = atan2(0.0, -1.0);
12532  }
12533  } else {
12534  r = __Pyx_c_abs_double(a);
12535  theta = atan2(a.imag, a.real);
12536  }
12537  lnr = log(r);
12538  z_r = exp(lnr * b.real - theta * b.imag);
12539  z_theta = theta * b.real + lnr * b.imag;
12540  z.real = z_r * cos(z_theta);
12541  z.imag = z_r * sin(z_theta);
12542  return z;
12543  }
12544  #endif
12545 #endif
12546 
12547 /* CIntFromPy */
12548 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
12549 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12550 #pragma GCC diagnostic push
12551 #pragma GCC diagnostic ignored "-Wconversion"
12552 #endif
12553  const int neg_one = (int) -1, const_zero = (int) 0;
12554 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12555 #pragma GCC diagnostic pop
12556 #endif
12557  const int is_unsigned = neg_one > const_zero;
12558 #if PY_MAJOR_VERSION < 3
12559  if (likely(PyInt_Check(x))) {
12560  if (sizeof(int) < sizeof(long)) {
12561  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
12562  } else {
12563  long val = PyInt_AS_LONG(x);
12564  if (is_unsigned && unlikely(val < 0)) {
12565  goto raise_neg_overflow;
12566  }
12567  return (int) val;
12568  }
12569  } else
12570 #endif
12571  if (likely(PyLong_Check(x))) {
12572  if (is_unsigned) {
12573 #if CYTHON_USE_PYLONG_INTERNALS
12574  const digit* digits = ((PyLongObject*)x)->ob_digit;
12575  switch (Py_SIZE(x)) {
12576  case 0: return (int) 0;
12577  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
12578  case 2:
12579  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
12580  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12581  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12582  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
12583  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12584  }
12585  }
12586  break;
12587  case 3:
12588  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
12589  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12590  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12591  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
12592  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12593  }
12594  }
12595  break;
12596  case 4:
12597  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
12598  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12599  __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])))
12600  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
12601  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12602  }
12603  }
12604  break;
12605  }
12606 #endif
12607 #if CYTHON_COMPILING_IN_CPYTHON
12608  if (unlikely(Py_SIZE(x) < 0)) {
12609  goto raise_neg_overflow;
12610  }
12611 #else
12612  {
12613  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12614  if (unlikely(result < 0))
12615  return (int) -1;
12616  if (unlikely(result == 1))
12617  goto raise_neg_overflow;
12618  }
12619 #endif
12620  if (sizeof(int) <= sizeof(unsigned long)) {
12621  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
12622 #ifdef HAVE_LONG_LONG
12623  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
12624  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12625 #endif
12626  }
12627  } else {
12628 #if CYTHON_USE_PYLONG_INTERNALS
12629  const digit* digits = ((PyLongObject*)x)->ob_digit;
12630  switch (Py_SIZE(x)) {
12631  case 0: return (int) 0;
12632  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
12633  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
12634  case -2:
12635  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
12636  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12637  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12638  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
12639  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12640  }
12641  }
12642  break;
12643  case 2:
12644  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
12645  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12646  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12647  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
12648  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12649  }
12650  }
12651  break;
12652  case -3:
12653  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
12654  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12655  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12656  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
12657  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12658  }
12659  }
12660  break;
12661  case 3:
12662  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
12663  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12664  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12665  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
12666  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12667  }
12668  }
12669  break;
12670  case -4:
12671  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
12672  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12673  __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])))
12674  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
12675  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12676  }
12677  }
12678  break;
12679  case 4:
12680  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
12681  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12682  __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])))
12683  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
12684  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12685  }
12686  }
12687  break;
12688  }
12689 #endif
12690  if (sizeof(int) <= sizeof(long)) {
12691  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
12692 #ifdef HAVE_LONG_LONG
12693  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
12694  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
12695 #endif
12696  }
12697  }
12698  {
12699 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12700  PyErr_SetString(PyExc_RuntimeError,
12701  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12702 #else
12703  int val;
12704  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12705  #if PY_MAJOR_VERSION < 3
12706  if (likely(v) && !PyLong_Check(v)) {
12707  PyObject *tmp = v;
12708  v = PyNumber_Long(tmp);
12709  Py_DECREF(tmp);
12710  }
12711  #endif
12712  if (likely(v)) {
12713  int one = 1; int is_little = (int)*(unsigned char *)&one;
12714  unsigned char *bytes = (unsigned char *)&val;
12715  int ret = _PyLong_AsByteArray((PyLongObject *)v,
12716  bytes, sizeof(val),
12717  is_little, !is_unsigned);
12718  Py_DECREF(v);
12719  if (likely(!ret))
12720  return val;
12721  }
12722 #endif
12723  return (int) -1;
12724  }
12725  } else {
12726  int val;
12727  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12728  if (!tmp) return (int) -1;
12729  val = __Pyx_PyInt_As_int(tmp);
12730  Py_DECREF(tmp);
12731  return val;
12732  }
12733 raise_overflow:
12734  PyErr_SetString(PyExc_OverflowError,
12735  "value too large to convert to int");
12736  return (int) -1;
12737 raise_neg_overflow:
12738  PyErr_SetString(PyExc_OverflowError,
12739  "can't convert negative value to int");
12740  return (int) -1;
12741 }
12742 
12743 /* CIntToPy */
12744 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
12745 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12746 #pragma GCC diagnostic push
12747 #pragma GCC diagnostic ignored "-Wconversion"
12748 #endif
12749  const int neg_one = (int) -1, const_zero = (int) 0;
12750 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12751 #pragma GCC diagnostic pop
12752 #endif
12753  const int is_unsigned = neg_one > const_zero;
12754  if (is_unsigned) {
12755  if (sizeof(int) < sizeof(long)) {
12756  return PyInt_FromLong((long) value);
12757  } else if (sizeof(int) <= sizeof(unsigned long)) {
12758  return PyLong_FromUnsignedLong((unsigned long) value);
12759 #ifdef HAVE_LONG_LONG
12760  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
12761  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
12762 #endif
12763  }
12764  } else {
12765  if (sizeof(int) <= sizeof(long)) {
12766  return PyInt_FromLong((long) value);
12767 #ifdef HAVE_LONG_LONG
12768  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
12769  return PyLong_FromLongLong((PY_LONG_LONG) value);
12770 #endif
12771  }
12772  }
12773  {
12774  int one = 1; int little = (int)*(unsigned char *)&one;
12775  unsigned char *bytes = (unsigned char *)&value;
12776  return _PyLong_FromByteArray(bytes, sizeof(int),
12777  little, !is_unsigned);
12778  }
12779 }
12780 
12781 /* CIntToPy */
12782 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
12783 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12784 #pragma GCC diagnostic push
12785 #pragma GCC diagnostic ignored "-Wconversion"
12786 #endif
12787  const long neg_one = (long) -1, const_zero = (long) 0;
12788 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12789 #pragma GCC diagnostic pop
12790 #endif
12791  const int is_unsigned = neg_one > const_zero;
12792  if (is_unsigned) {
12793  if (sizeof(long) < sizeof(long)) {
12794  return PyInt_FromLong((long) value);
12795  } else if (sizeof(long) <= sizeof(unsigned long)) {
12796  return PyLong_FromUnsignedLong((unsigned long) value);
12797 #ifdef HAVE_LONG_LONG
12798  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
12799  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
12800 #endif
12801  }
12802  } else {
12803  if (sizeof(long) <= sizeof(long)) {
12804  return PyInt_FromLong((long) value);
12805 #ifdef HAVE_LONG_LONG
12806  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
12807  return PyLong_FromLongLong((PY_LONG_LONG) value);
12808 #endif
12809  }
12810  }
12811  {
12812  int one = 1; int little = (int)*(unsigned char *)&one;
12813  unsigned char *bytes = (unsigned char *)&value;
12814  return _PyLong_FromByteArray(bytes, sizeof(long),
12815  little, !is_unsigned);
12816  }
12817 }
12818 
12819 /* CIntFromPy */
12820 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
12821 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12822 #pragma GCC diagnostic push
12823 #pragma GCC diagnostic ignored "-Wconversion"
12824 #endif
12825  const long neg_one = (long) -1, const_zero = (long) 0;
12826 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12827 #pragma GCC diagnostic pop
12828 #endif
12829  const int is_unsigned = neg_one > const_zero;
12830 #if PY_MAJOR_VERSION < 3
12831  if (likely(PyInt_Check(x))) {
12832  if (sizeof(long) < sizeof(long)) {
12833  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
12834  } else {
12835  long val = PyInt_AS_LONG(x);
12836  if (is_unsigned && unlikely(val < 0)) {
12837  goto raise_neg_overflow;
12838  }
12839  return (long) val;
12840  }
12841  } else
12842 #endif
12843  if (likely(PyLong_Check(x))) {
12844  if (is_unsigned) {
12845 #if CYTHON_USE_PYLONG_INTERNALS
12846  const digit* digits = ((PyLongObject*)x)->ob_digit;
12847  switch (Py_SIZE(x)) {
12848  case 0: return (long) 0;
12849  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
12850  case 2:
12851  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
12852  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12853  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12854  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
12855  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12856  }
12857  }
12858  break;
12859  case 3:
12860  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
12861  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12862  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12863  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
12864  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12865  }
12866  }
12867  break;
12868  case 4:
12869  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
12870  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12871  __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])))
12872  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
12873  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12874  }
12875  }
12876  break;
12877  }
12878 #endif
12879 #if CYTHON_COMPILING_IN_CPYTHON
12880  if (unlikely(Py_SIZE(x) < 0)) {
12881  goto raise_neg_overflow;
12882  }
12883 #else
12884  {
12885  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12886  if (unlikely(result < 0))
12887  return (long) -1;
12888  if (unlikely(result == 1))
12889  goto raise_neg_overflow;
12890  }
12891 #endif
12892  if (sizeof(long) <= sizeof(unsigned long)) {
12893  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
12894 #ifdef HAVE_LONG_LONG
12895  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
12896  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12897 #endif
12898  }
12899  } else {
12900 #if CYTHON_USE_PYLONG_INTERNALS
12901  const digit* digits = ((PyLongObject*)x)->ob_digit;
12902  switch (Py_SIZE(x)) {
12903  case 0: return (long) 0;
12904  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
12905  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
12906  case -2:
12907  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
12908  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12909  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12910  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12911  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12912  }
12913  }
12914  break;
12915  case 2:
12916  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
12917  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12918  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12919  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12920  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12921  }
12922  }
12923  break;
12924  case -3:
12925  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12926  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12927  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12928  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12929  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12930  }
12931  }
12932  break;
12933  case 3:
12934  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
12935  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12936  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12937  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12938  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12939  }
12940  }
12941  break;
12942  case -4:
12943  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12944  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12945  __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])))
12946  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
12947  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12948  }
12949  }
12950  break;
12951  case 4:
12952  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
12953  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12954  __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])))
12955  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
12956  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12957  }
12958  }
12959  break;
12960  }
12961 #endif
12962  if (sizeof(long) <= sizeof(long)) {
12963  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
12964 #ifdef HAVE_LONG_LONG
12965  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
12966  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
12967 #endif
12968  }
12969  }
12970  {
12971 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12972  PyErr_SetString(PyExc_RuntimeError,
12973  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12974 #else
12975  long val;
12976  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12977  #if PY_MAJOR_VERSION < 3
12978  if (likely(v) && !PyLong_Check(v)) {
12979  PyObject *tmp = v;
12980  v = PyNumber_Long(tmp);
12981  Py_DECREF(tmp);
12982  }
12983  #endif
12984  if (likely(v)) {
12985  int one = 1; int is_little = (int)*(unsigned char *)&one;
12986  unsigned char *bytes = (unsigned char *)&val;
12987  int ret = _PyLong_AsByteArray((PyLongObject *)v,
12988  bytes, sizeof(val),
12989  is_little, !is_unsigned);
12990  Py_DECREF(v);
12991  if (likely(!ret))
12992  return val;
12993  }
12994 #endif
12995  return (long) -1;
12996  }
12997  } else {
12998  long val;
12999  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13000  if (!tmp) return (long) -1;
13001  val = __Pyx_PyInt_As_long(tmp);
13002  Py_DECREF(tmp);
13003  return val;
13004  }
13005 raise_overflow:
13006  PyErr_SetString(PyExc_OverflowError,
13007  "value too large to convert to long");
13008  return (long) -1;
13009 raise_neg_overflow:
13010  PyErr_SetString(PyExc_OverflowError,
13011  "can't convert negative value to long");
13012  return (long) -1;
13013 }
13014 
13015 /* FastTypeChecks */
13016 #if CYTHON_COMPILING_IN_CPYTHON
13017 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
13018  while (a) {
13019  a = a->tp_base;
13020  if (a == b)
13021  return 1;
13022  }
13023  return b == &PyBaseObject_Type;
13024 }
13025 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
13026  PyObject *mro;
13027  if (a == b) return 1;
13028  mro = a->tp_mro;
13029  if (likely(mro)) {
13030  Py_ssize_t i, n;
13031  n = PyTuple_GET_SIZE(mro);
13032  for (i = 0; i < n; i++) {
13033  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
13034  return 1;
13035  }
13036  return 0;
13037  }
13038  return __Pyx_InBases(a, b);
13039 }
13040 #if PY_MAJOR_VERSION == 2
13041 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
13042  PyObject *exception, *value, *tb;
13043  int res;
13044  __Pyx_PyThreadState_declare
13045  __Pyx_PyThreadState_assign
13046  __Pyx_ErrFetch(&exception, &value, &tb);
13047  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
13048  if (unlikely(res == -1)) {
13049  PyErr_WriteUnraisable(err);
13050  res = 0;
13051  }
13052  if (!res) {
13053  res = PyObject_IsSubclass(err, exc_type2);
13054  if (unlikely(res == -1)) {
13055  PyErr_WriteUnraisable(err);
13056  res = 0;
13057  }
13058  }
13059  __Pyx_ErrRestore(exception, value, tb);
13060  return res;
13061 }
13062 #else
13063 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
13064  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
13065  if (!res) {
13066  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
13067  }
13068  return res;
13069 }
13070 #endif
13071 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
13072  Py_ssize_t i, n;
13073  assert(PyExceptionClass_Check(exc_type));
13074  n = PyTuple_GET_SIZE(tuple);
13075 #if PY_MAJOR_VERSION >= 3
13076  for (i=0; i<n; i++) {
13077  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
13078  }
13079 #endif
13080  for (i=0; i<n; i++) {
13081  PyObject *t = PyTuple_GET_ITEM(tuple, i);
13082  #if PY_MAJOR_VERSION < 3
13083  if (likely(exc_type == t)) return 1;
13084  #endif
13085  if (likely(PyExceptionClass_Check(t))) {
13086  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
13087  } else {
13088  }
13089  }
13090  return 0;
13091 }
13092 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
13093  if (likely(err == exc_type)) return 1;
13094  if (likely(PyExceptionClass_Check(err))) {
13095  if (likely(PyExceptionClass_Check(exc_type))) {
13096  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
13097  } else if (likely(PyTuple_Check(exc_type))) {
13098  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
13099  } else {
13100  }
13101  }
13102  return PyErr_GivenExceptionMatches(err, exc_type);
13103 }
13104 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
13105  assert(PyExceptionClass_Check(exc_type1));
13106  assert(PyExceptionClass_Check(exc_type2));
13107  if (likely(err == exc_type1 || err == exc_type2)) return 1;
13108  if (likely(PyExceptionClass_Check(err))) {
13109  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
13110  }
13111  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
13112 }
13113 #endif
13114 
13115 /* CheckBinaryVersion */
13116 static int __Pyx_check_binary_version(void) {
13117  char ctversion[5];
13118  int same=1, i, found_dot;
13119  const char* rt_from_call = Py_GetVersion();
13120  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
13121  found_dot = 0;
13122  for (i = 0; i < 4; i++) {
13123  if (!ctversion[i]) {
13124  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
13125  break;
13126  }
13127  if (rt_from_call[i] != ctversion[i]) {
13128  same = 0;
13129  break;
13130  }
13131  }
13132  if (!same) {
13133  char rtversion[5] = {'\0'};
13134  char message[200];
13135  for (i=0; i<4; ++i) {
13136  if (rt_from_call[i] == '.') {
13137  if (found_dot) break;
13138  found_dot = 1;
13139  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
13140  break;
13141  }
13142  rtversion[i] = rt_from_call[i];
13143  }
13144  PyOS_snprintf(message, sizeof(message),
13145  "compiletime version %s of module '%.100s' "
13146  "does not match runtime version %s",
13147  ctversion, __Pyx_MODULE_NAME, rtversion);
13148  return PyErr_WarnEx(NULL, message, 1);
13149  }
13150  return 0;
13151 }
13152 
13153 /* InitStrings */
13154 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
13155  while (t->p) {
13156  #if PY_MAJOR_VERSION < 3
13157  if (t->is_unicode) {
13158  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
13159  } else if (t->intern) {
13160  *t->p = PyString_InternFromString(t->s);
13161  } else {
13162  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
13163  }
13164  #else
13165  if (t->is_unicode | t->is_str) {
13166  if (t->intern) {
13167  *t->p = PyUnicode_InternFromString(t->s);
13168  } else if (t->encoding) {
13169  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
13170  } else {
13171  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
13172  }
13173  } else {
13174  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
13175  }
13176  #endif
13177  if (!*t->p)
13178  return -1;
13179  if (PyObject_Hash(*t->p) == -1)
13180  return -1;
13181  ++t;
13182  }
13183  return 0;
13184 }
13185 
13186 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
13187  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
13188 }
13189 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
13190  Py_ssize_t ignore;
13191  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
13192 }
13193 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13194 #if !CYTHON_PEP393_ENABLED
13195 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13196  char* defenc_c;
13197  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
13198  if (!defenc) return NULL;
13199  defenc_c = PyBytes_AS_STRING(defenc);
13200 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13201  {
13202  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
13203  char* c;
13204  for (c = defenc_c; c < end; c++) {
13205  if ((unsigned char) (*c) >= 128) {
13206  PyUnicode_AsASCIIString(o);
13207  return NULL;
13208  }
13209  }
13210  }
13211 #endif
13212  *length = PyBytes_GET_SIZE(defenc);
13213  return defenc_c;
13214 }
13215 #else
13216 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13217  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
13218 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13219  if (likely(PyUnicode_IS_ASCII(o))) {
13220  *length = PyUnicode_GET_LENGTH(o);
13221  return PyUnicode_AsUTF8(o);
13222  } else {
13223  PyUnicode_AsASCIIString(o);
13224  return NULL;
13225  }
13226 #else
13227  return PyUnicode_AsUTF8AndSize(o, length);
13228 #endif
13229 }
13230 #endif
13231 #endif
13232 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13233 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13234  if (
13235 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13236  __Pyx_sys_getdefaultencoding_not_ascii &&
13237 #endif
13238  PyUnicode_Check(o)) {
13239  return __Pyx_PyUnicode_AsStringAndSize(o, length);
13240  } else
13241 #endif
13242 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
13243  if (PyByteArray_Check(o)) {
13244  *length = PyByteArray_GET_SIZE(o);
13245  return PyByteArray_AS_STRING(o);
13246  } else
13247 #endif
13248  {
13249  char* result;
13250  int r = PyBytes_AsStringAndSize(o, &result, length);
13251  if (unlikely(r < 0)) {
13252  return NULL;
13253  } else {
13254  return result;
13255  }
13256  }
13257 }
13258 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
13259  int is_true = x == Py_True;
13260  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
13261  else return PyObject_IsTrue(x);
13262 }
13263 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13264  int retval;
13265  if (unlikely(!x)) return -1;
13266  retval = __Pyx_PyObject_IsTrue(x);
13267  Py_DECREF(x);
13268  return retval;
13269 }
13270 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
13271 #if PY_MAJOR_VERSION >= 3
13272  if (PyLong_Check(result)) {
13273  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
13274  "__int__ returned non-int (type %.200s). "
13275  "The ability to return an instance of a strict subclass of int "
13276  "is deprecated, and may be removed in a future version of Python.",
13277  Py_TYPE(result)->tp_name)) {
13278  Py_DECREF(result);
13279  return NULL;
13280  }
13281  return result;
13282  }
13283 #endif
13284  PyErr_Format(PyExc_TypeError,
13285  "__%.4s__ returned non-%.4s (type %.200s)",
13286  type_name, type_name, Py_TYPE(result)->tp_name);
13287  Py_DECREF(result);
13288  return NULL;
13289 }
13290 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
13291 #if CYTHON_USE_TYPE_SLOTS
13292  PyNumberMethods *m;
13293 #endif
13294  const char *name = NULL;
13295  PyObject *res = NULL;
13296 #if PY_MAJOR_VERSION < 3
13297  if (likely(PyInt_Check(x) || PyLong_Check(x)))
13298 #else
13299  if (likely(PyLong_Check(x)))
13300 #endif
13301  return __Pyx_NewRef(x);
13302 #if CYTHON_USE_TYPE_SLOTS
13303  m = Py_TYPE(x)->tp_as_number;
13304  #if PY_MAJOR_VERSION < 3
13305  if (m && m->nb_int) {
13306  name = "int";
13307  res = m->nb_int(x);
13308  }
13309  else if (m && m->nb_long) {
13310  name = "long";
13311  res = m->nb_long(x);
13312  }
13313  #else
13314  if (likely(m && m->nb_int)) {
13315  name = "int";
13316  res = m->nb_int(x);
13317  }
13318  #endif
13319 #else
13320  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13321  res = PyNumber_Int(x);
13322  }
13323 #endif
13324  if (likely(res)) {
13325 #if PY_MAJOR_VERSION < 3
13326  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
13327 #else
13328  if (unlikely(!PyLong_CheckExact(res))) {
13329 #endif
13330  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
13331  }
13332  }
13333  else if (!PyErr_Occurred()) {
13334  PyErr_SetString(PyExc_TypeError,
13335  "an integer is required");
13336  }
13337  return res;
13338 }
13339 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
13340  Py_ssize_t ival;
13341  PyObject *x;
13342 #if PY_MAJOR_VERSION < 3
13343  if (likely(PyInt_CheckExact(b))) {
13344  if (sizeof(Py_ssize_t) >= sizeof(long))
13345  return PyInt_AS_LONG(b);
13346  else
13347  return PyInt_AsSsize_t(b);
13348  }
13349 #endif
13350  if (likely(PyLong_CheckExact(b))) {
13351  #if CYTHON_USE_PYLONG_INTERNALS
13352  const digit* digits = ((PyLongObject*)b)->ob_digit;
13353  const Py_ssize_t size = Py_SIZE(b);
13354  if (likely(__Pyx_sst_abs(size) <= 1)) {
13355  ival = likely(size) ? digits[0] : 0;
13356  if (size == -1) ival = -ival;
13357  return ival;
13358  } else {
13359  switch (size) {
13360  case 2:
13361  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13362  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13363  }
13364  break;
13365  case -2:
13366  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13367  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13368  }
13369  break;
13370  case 3:
13371  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13372  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13373  }
13374  break;
13375  case -3:
13376  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13377  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13378  }
13379  break;
13380  case 4:
13381  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13382  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]));
13383  }
13384  break;
13385  case -4:
13386  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13387  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]));
13388  }
13389  break;
13390  }
13391  }
13392  #endif
13393  return PyLong_AsSsize_t(b);
13394  }
13395  x = PyNumber_Index(b);
13396  if (!x) return -1;
13397  ival = PyInt_AsSsize_t(x);
13398  Py_DECREF(x);
13399  return ival;
13400 }
13401 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
13402  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
13403  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
13404 #if PY_MAJOR_VERSION < 3
13405  } else if (likely(PyInt_CheckExact(o))) {
13406  return PyInt_AS_LONG(o);
13407 #endif
13408  } else {
13409  Py_ssize_t ival;
13410  PyObject *x;
13411  x = PyNumber_Index(o);
13412  if (!x) return -1;
13413  ival = PyInt_AsLong(x);
13414  Py_DECREF(x);
13415  return ival;
13416  }
13417 }
13418 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
13419  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
13420 }
13421 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
13422  return PyInt_FromSize_t(ival);
13423 }
13424 
13425 
13426 #endif /* Py_PYTHON_H */
densityRelations.h
twophaseDarcyCoefficients.h
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
n
Int n
Definition: Headers.h:28
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
pskRelations.h
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
twophaseDarcy_vol_frac
int twophaseDarcy_vol_frac(int nSimplex, int nPointsPerSimplex, const int *materialTypes, const double *omega, const double *sw, double *vol_frac_w, double *vol_frac_n)
Definition: twophaseDarcyCoefficients.h:293