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_arg