proteus  1.8.1
C/C++/Fortran libraries
csubgridError.c
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 CYTHON_INLINE
307  #if defined(__clang__)
308  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309  #elif defined(__GNUC__)
310  #define CYTHON_INLINE __inline__
311  #elif defined(_MSC_VER)
312  #define CYTHON_INLINE __inline
313  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314  #define CYTHON_INLINE inline
315  #else
316  #define CYTHON_INLINE
317  #endif
318 #endif
319 
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321  #define Py_OptimizeFlag 0
322 #endif
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329  #define __Pyx_DefaultClassType PyClass_Type
330 #else
331  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332  #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
335  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
336  PyObject *fv, PyObject *cell, PyObject* fn,
337  PyObject *name, int fline, PyObject *lnos) {
338  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340  const char *fn_cstr=NULL;
341  const char *name_cstr=NULL;
342  PyCodeObject* co=NULL;
343  PyObject *type, *value, *traceback;
344  PyErr_Fetch(&type, &value, &traceback);
345  if (!(kwds=PyDict_New())) goto end;
346  if (!(argcount=PyLong_FromLong(a))) goto end;
347  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
348  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
349  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
350  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
351  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
352  if (!(nlocals=PyLong_FromLong(l))) goto end;
353  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
354  if (!(stacksize=PyLong_FromLong(s))) goto end;
355  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
356  if (!(flags=PyLong_FromLong(f))) goto end;
357  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
358  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
359  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
360  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
361  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
362  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
363  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
364  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
365  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
366  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
367  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
368  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
369  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
370  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
371  Py_XDECREF((PyObject*)co);
372  co = (PyCodeObject*)call_result;
373  call_result = NULL;
374  if (0) {
375  cleanup_code_too:
376  Py_XDECREF((PyObject*)co);
377  co = NULL;
378  }
379  end:
380  Py_XDECREF(kwds);
381  Py_XDECREF(argcount);
382  Py_XDECREF(posonlyargcount);
383  Py_XDECREF(kwonlyargcount);
384  Py_XDECREF(nlocals);
385  Py_XDECREF(stacksize);
386  Py_XDECREF(replace);
387  Py_XDECREF(call_result);
388  Py_XDECREF(empty);
389  if (type) {
390  PyErr_Restore(type, value, traceback);
391  }
392  return co;
393  }
394 #else
395  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
397 #endif
398  #define __Pyx_DefaultClassType PyType_Type
399 #endif
400 #ifndef Py_TPFLAGS_CHECKTYPES
401  #define Py_TPFLAGS_CHECKTYPES 0
402 #endif
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404  #define Py_TPFLAGS_HAVE_INDEX 0
405 #endif
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
408 #endif
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410  #define Py_TPFLAGS_HAVE_FINALIZE 0
411 #endif
412 #ifndef METH_STACKLESS
413  #define METH_STACKLESS 0
414 #endif
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416  #ifndef METH_FASTCALL
417  #define METH_FASTCALL 0x80
418  #endif
419  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
420  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
421  Py_ssize_t nargs, PyObject *kwnames);
422 #else
423  #define __Pyx_PyCFunctionFast _PyCFunctionFast
424  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
425 #endif
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
429 #else
430 #define __Pyx_PyFastCFunction_Check(func) 0
431 #endif
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433  #define PyObject_Malloc(s) PyMem_Malloc(s)
434  #define PyObject_Free(p) PyMem_Free(p)
435  #define PyObject_Realloc(p) PyMem_Realloc(p)
436 #endif
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440  #define PyMem_RawFree(p) PyMem_Free(p)
441 #endif
442 #if CYTHON_COMPILING_IN_PYSTON
443  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
445 #else
446  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
448 #endif
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450  #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454  #define __Pyx_PyThreadState_Current PyThreadState_GET()
455 #else
456  #define __Pyx_PyThreadState_Current _PyThreadState_Current
457 #endif
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
463  *key = PyThread_create_key();
464  return 0;
465 }
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
467  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
468  *key = Py_tss_NEEDS_INIT;
469  return key;
470 }
471 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
472  PyObject_Free(key);
473 }
474 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
475  return *key != Py_tss_NEEDS_INIT;
476 }
477 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
478  PyThread_delete_key(*key);
479  *key = Py_tss_NEEDS_INIT;
480 }
481 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
482  return PyThread_set_key_value(*key, value);
483 }
484 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
485  return PyThread_get_key_value(*key);
486 }
487 #endif
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
490 #else
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
492 #endif
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
496 #else
497  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
499 #endif
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
502 #else
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
504 #endif
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506  #define CYTHON_PEP393_ENABLED 1
507  #if defined(PyUnicode_IS_READY)
508  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509  0 : _PyUnicode_Ready((PyObject *)(op)))
510  #else
511  #define __Pyx_PyUnicode_READY(op) (0)
512  #endif
513  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
523  #else
524  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
525  #endif
526  #else
527  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
528  #endif
529 #else
530  #define CYTHON_PEP393_ENABLED 0
531  #define PyUnicode_1BYTE_KIND 1
532  #define PyUnicode_2BYTE_KIND 2
533  #define PyUnicode_4BYTE_KIND 4
534  #define __Pyx_PyUnicode_READY(op) (0)
535  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
543 #endif
544 #if CYTHON_COMPILING_IN_PYPY
545  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
547 #else
548  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
551 #endif
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
554 #endif
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
560 #endif
561 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
565 #else
566  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
567 #endif
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569  #define PyObject_ASCII(o) PyObject_Repr(o)
570 #endif
571 #if PY_MAJOR_VERSION >= 3
572  #define PyBaseString_Type PyUnicode_Type
573  #define PyStringObject PyUnicodeObject
574  #define PyString_Type PyUnicode_Type
575  #define PyString_Check PyUnicode_Check
576  #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578  #define PyObject_Unicode PyObject_Str
579 #endif
580 #endif
581 #if PY_MAJOR_VERSION >= 3
582  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
584 #else
585  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
587 #endif
588 #ifndef PySet_CheckExact
589  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
590 #endif
591 #if PY_VERSION_HEX >= 0x030900A4
592  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
594 #else
595  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
597 #endif
598 #if CYTHON_ASSUME_SAFE_MACROS
599  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
600 #else
601  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
602 #endif
603 #if PY_MAJOR_VERSION >= 3
604  #define PyIntObject PyLongObject
605  #define PyInt_Type PyLong_Type
606  #define PyInt_Check(op) PyLong_Check(op)
607  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608  #define PyInt_FromString PyLong_FromString
609  #define PyInt_FromUnicode PyLong_FromUnicode
610  #define PyInt_FromLong PyLong_FromLong
611  #define PyInt_FromSize_t PyLong_FromSize_t
612  #define PyInt_FromSsize_t PyLong_FromSsize_t
613  #define PyInt_AsLong PyLong_AsLong
614  #define PyInt_AS_LONG PyLong_AS_LONG
615  #define PyInt_AsSsize_t PyLong_AsSsize_t
616  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618  #define PyNumber_Int PyNumber_Long
619 #endif
620 #if PY_MAJOR_VERSION >= 3
621  #define PyBoolObject PyLongObject
622 #endif
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624  #ifndef PyUnicode_InternFromString
625  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
626  #endif
627 #endif
628 #if PY_VERSION_HEX < 0x030200A4
629  typedef long Py_hash_t;
630  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
632 #else
633  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
635 #endif
636 #if PY_MAJOR_VERSION >= 3
637  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
638 #else
639  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
640 #endif
641 #if CYTHON_USE_ASYNC_SLOTS
642  #if PY_VERSION_HEX >= 0x030500B1
643  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
645  #else
646  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
647  #endif
648 #else
649  #define __Pyx_PyType_AsAsync(obj) NULL
650 #endif
651 #ifndef __Pyx_PyAsyncMethodsStruct
652  typedef struct {
653  unaryfunc am_await;
654  unaryfunc am_aiter;
655  unaryfunc am_anext;
656  } __Pyx_PyAsyncMethodsStruct;
657 #endif
658 
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660  #if !defined(_USE_MATH_DEFINES)
661  #define _USE_MATH_DEFINES
662  #endif
663 #endif
664 #include <math.h>
665 #ifdef NAN
666 #define __PYX_NAN() ((float) NAN)
667 #else
668 static CYTHON_INLINE float __PYX_NAN() {
669  float value;
670  memset(&value, 0xFF, sizeof(value));
671  return value;
672 }
673 #endif
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
676 #else
677 #define __Pyx_truncl truncl
678 #endif
679 
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
684 
685 #ifndef __PYX_EXTERN_C
686  #ifdef __cplusplus
687  #define __PYX_EXTERN_C extern "C"
688  #else
689  #define __PYX_EXTERN_C extern
690  #endif
691 #endif
692 
693 #define __PYX_HAVE__csubgridError
694 #define __PYX_HAVE_API__csubgridError
695 /* Early includes */
696 #include <string.h>
697 #include <stdio.h>
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
703 
704  /* NumPy API declarations from "numpy/__init__.pxd" */
705 
706 #include "subgridError.h"
707 #ifdef _OPENMP
708 #include <omp.h>
709 #endif /* _OPENMP */
710 
711 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
712 #define CYTHON_WITHOUT_ASSERTIONS
713 #endif
714 
715 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
716  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
717 
718 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
719 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
720 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
721 #define __PYX_DEFAULT_STRING_ENCODING ""
722 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
723 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
724 #define __Pyx_uchar_cast(c) ((unsigned char)c)
725 #define __Pyx_long_cast(x) ((long)x)
726 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
727  (sizeof(type) < sizeof(Py_ssize_t)) ||\
728  (sizeof(type) > sizeof(Py_ssize_t) &&\
729  likely(v < (type)PY_SSIZE_T_MAX ||\
730  v == (type)PY_SSIZE_T_MAX) &&\
731  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
732  v == (type)PY_SSIZE_T_MIN))) ||\
733  (sizeof(type) == sizeof(Py_ssize_t) &&\
734  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
735  v == (type)PY_SSIZE_T_MAX))) )
736 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
737  return (size_t) i < (size_t) limit;
738 }
739 #if defined (__cplusplus) && __cplusplus >= 201103L
740  #include <cstdlib>
741  #define __Pyx_sst_abs(value) std::abs(value)
742 #elif SIZEOF_INT >= SIZEOF_SIZE_T
743  #define __Pyx_sst_abs(value) abs(value)
744 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
745  #define __Pyx_sst_abs(value) labs(value)
746 #elif defined (_MSC_VER)
747  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
748 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
749  #define __Pyx_sst_abs(value) llabs(value)
750 #elif defined (__GNUC__)
751  #define __Pyx_sst_abs(value) __builtin_llabs(value)
752 #else
753  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
754 #endif
755 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
756 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
757 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
758 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
759 #define __Pyx_PyBytes_FromString PyBytes_FromString
760 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
761 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
762 #if PY_MAJOR_VERSION < 3
763  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
764  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
765 #else
766  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
767  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
768 #endif
769 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
770 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
771 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
772 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
773 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
776 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
777 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
778 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
779 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
781 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
782 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
783 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
784 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
785 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
786  const Py_UNICODE *u_end = u;
787  while (*u_end++) ;
788  return (size_t)(u_end - u - 1);
789 }
790 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
791 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
792 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
793 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
794 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
795 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
796 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
797 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
798 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
799 #define __Pyx_PySequence_Tuple(obj)\
800  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
801 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
802 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
803 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
804 #if CYTHON_ASSUME_SAFE_MACROS
805 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
806 #else
807 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
808 #endif
809 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
810 #if PY_MAJOR_VERSION >= 3
811 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
812 #else
813 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
814 #endif
815 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
816 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
817 static int __Pyx_sys_getdefaultencoding_not_ascii;
818 static int __Pyx_init_sys_getdefaultencoding_params(void) {
819  PyObject* sys;
820  PyObject* default_encoding = NULL;
821  PyObject* ascii_chars_u = NULL;
822  PyObject* ascii_chars_b = NULL;
823  const char* default_encoding_c;
824  sys = PyImport_ImportModule("sys");
825  if (!sys) goto bad;
826  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
827  Py_DECREF(sys);
828  if (!default_encoding) goto bad;
829  default_encoding_c = PyBytes_AsString(default_encoding);
830  if (!default_encoding_c) goto bad;
831  if (strcmp(default_encoding_c, "ascii") == 0) {
832  __Pyx_sys_getdefaultencoding_not_ascii = 0;
833  } else {
834  char ascii_chars[128];
835  int c;
836  for (c = 0; c < 128; c++) {
837  ascii_chars[c] = c;
838  }
839  __Pyx_sys_getdefaultencoding_not_ascii = 1;
840  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
841  if (!ascii_chars_u) goto bad;
842  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
843  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
844  PyErr_Format(
845  PyExc_ValueError,
846  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
847  default_encoding_c);
848  goto bad;
849  }
850  Py_DECREF(ascii_chars_u);
851  Py_DECREF(ascii_chars_b);
852  }
853  Py_DECREF(default_encoding);
854  return 0;
855 bad:
856  Py_XDECREF(default_encoding);
857  Py_XDECREF(ascii_chars_u);
858  Py_XDECREF(ascii_chars_b);
859  return -1;
860 }
861 #endif
862 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
863 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
864 #else
865 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
867 static char* __PYX_DEFAULT_STRING_ENCODING;
868 static int __Pyx_init_sys_getdefaultencoding_params(void) {
869  PyObject* sys;
870  PyObject* default_encoding = NULL;
871  char* default_encoding_c;
872  sys = PyImport_ImportModule("sys");
873  if (!sys) goto bad;
874  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
875  Py_DECREF(sys);
876  if (!default_encoding) goto bad;
877  default_encoding_c = PyBytes_AsString(default_encoding);
878  if (!default_encoding_c) goto bad;
879  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
880  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
881  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
882  Py_DECREF(default_encoding);
883  return 0;
884 bad:
885  Py_XDECREF(default_encoding);
886  return -1;
887 }
888 #endif
889 #endif
890 
891 
892 /* Test for GCC > 2.95 */
893 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
894  #define likely(x) __builtin_expect(!!(x), 1)
895  #define unlikely(x) __builtin_expect(!!(x), 0)
896 #else /* !__GNUC__ or GCC < 2.95 */
897  #define likely(x) (x)
898  #define unlikely(x) (x)
899 #endif /* __GNUC__ */
900 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
901 
902 static PyObject *__pyx_m = NULL;
903 static PyObject *__pyx_d;
904 static PyObject *__pyx_b;
905 static PyObject *__pyx_cython_runtime = NULL;
906 static PyObject *__pyx_empty_tuple;
907 static PyObject *__pyx_empty_bytes;
908 static PyObject *__pyx_empty_unicode;
909 static int __pyx_lineno;
910 static int __pyx_clineno = 0;
911 static const char * __pyx_cfilenm= __FILE__;
912 static const char *__pyx_filename;
913 
914 /* Header.proto */
915 #if !defined(CYTHON_CCOMPLEX)
916  #if defined(__cplusplus)
917  #define CYTHON_CCOMPLEX 1
918  #elif defined(_Complex_I)
919  #define CYTHON_CCOMPLEX 1
920  #else
921  #define CYTHON_CCOMPLEX 0
922  #endif
923 #endif
924 #if CYTHON_CCOMPLEX
925  #ifdef __cplusplus
926  #include <complex>
927  #else
928  #include <complex.h>
929  #endif
930 #endif
931 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
932  #undef _Complex_I
933  #define _Complex_I 1.0fj
934 #endif
935 
936 
937 static const char *__pyx_f[] = {
938  "proteus/csubgridError.pyx",
939  "__init__.pxd",
940  "type.pxd",
941 };
942 
943 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
944  * # in Cython to enable them only on the right systems.
945  *
946  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
947  * ctypedef npy_int16 int16_t
948  * ctypedef npy_int32 int32_t
949  */
950 typedef npy_int8 __pyx_t_5numpy_int8_t;
951 
952 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
953  *
954  * ctypedef npy_int8 int8_t
955  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
956  * ctypedef npy_int32 int32_t
957  * ctypedef npy_int64 int64_t
958  */
959 typedef npy_int16 __pyx_t_5numpy_int16_t;
960 
961 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
962  * ctypedef npy_int8 int8_t
963  * ctypedef npy_int16 int16_t
964  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
965  * ctypedef npy_int64 int64_t
966  * #ctypedef npy_int96 int96_t
967  */
968 typedef npy_int32 __pyx_t_5numpy_int32_t;
969 
970 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
971  * ctypedef npy_int16 int16_t
972  * ctypedef npy_int32 int32_t
973  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
974  * #ctypedef npy_int96 int96_t
975  * #ctypedef npy_int128 int128_t
976  */
977 typedef npy_int64 __pyx_t_5numpy_int64_t;
978 
979 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
980  * #ctypedef npy_int128 int128_t
981  *
982  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
983  * ctypedef npy_uint16 uint16_t
984  * ctypedef npy_uint32 uint32_t
985  */
986 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
987 
988 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
989  *
990  * ctypedef npy_uint8 uint8_t
991  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
992  * ctypedef npy_uint32 uint32_t
993  * ctypedef npy_uint64 uint64_t
994  */
995 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
996 
997 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
998  * ctypedef npy_uint8 uint8_t
999  * ctypedef npy_uint16 uint16_t
1000  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1001  * ctypedef npy_uint64 uint64_t
1002  * #ctypedef npy_uint96 uint96_t
1003  */
1004 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1005 
1006 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1007  * ctypedef npy_uint16 uint16_t
1008  * ctypedef npy_uint32 uint32_t
1009  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1010  * #ctypedef npy_uint96 uint96_t
1011  * #ctypedef npy_uint128 uint128_t
1012  */
1013 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1014 
1015 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1016  * #ctypedef npy_uint128 uint128_t
1017  *
1018  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1019  * ctypedef npy_float64 float64_t
1020  * #ctypedef npy_float80 float80_t
1021  */
1022 typedef npy_float32 __pyx_t_5numpy_float32_t;
1023 
1024 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1025  *
1026  * ctypedef npy_float32 float32_t
1027  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1028  * #ctypedef npy_float80 float80_t
1029  * #ctypedef npy_float128 float128_t
1030  */
1031 typedef npy_float64 __pyx_t_5numpy_float64_t;
1032 
1033 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1034  * # The int types are mapped a bit surprising --
1035  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1036  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1037  * ctypedef npy_longlong long_t
1038  * ctypedef npy_longlong longlong_t
1039  */
1040 typedef npy_long __pyx_t_5numpy_int_t;
1041 
1042 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1043  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1044  * ctypedef npy_long int_t
1045  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1046  * ctypedef npy_longlong longlong_t
1047  *
1048  */
1049 typedef npy_longlong __pyx_t_5numpy_long_t;
1050 
1051 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1052  * ctypedef npy_long int_t
1053  * ctypedef npy_longlong long_t
1054  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1055  *
1056  * ctypedef npy_ulong uint_t
1057  */
1058 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1059 
1060 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1061  * ctypedef npy_longlong longlong_t
1062  *
1063  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1064  * ctypedef npy_ulonglong ulong_t
1065  * ctypedef npy_ulonglong ulonglong_t
1066  */
1067 typedef npy_ulong __pyx_t_5numpy_uint_t;
1068 
1069 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1070  *
1071  * ctypedef npy_ulong uint_t
1072  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1073  * ctypedef npy_ulonglong ulonglong_t
1074  *
1075  */
1076 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1077 
1078 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1079  * ctypedef npy_ulong uint_t
1080  * ctypedef npy_ulonglong ulong_t
1081  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1082  *
1083  * ctypedef npy_intp intp_t
1084  */
1085 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1086 
1087 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1088  * ctypedef npy_ulonglong ulonglong_t
1089  *
1090  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1091  * ctypedef npy_uintp uintp_t
1092  *
1093  */
1094 typedef npy_intp __pyx_t_5numpy_intp_t;
1095 
1096 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1097  *
1098  * ctypedef npy_intp intp_t
1099  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1100  *
1101  * ctypedef npy_double float_t
1102  */
1103 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1104 
1105 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1106  * ctypedef npy_uintp uintp_t
1107  *
1108  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1109  * ctypedef npy_double double_t
1110  * ctypedef npy_longdouble longdouble_t
1111  */
1112 typedef npy_double __pyx_t_5numpy_float_t;
1113 
1114 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1115  *
1116  * ctypedef npy_double float_t
1117  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1118  * ctypedef npy_longdouble longdouble_t
1119  *
1120  */
1121 typedef npy_double __pyx_t_5numpy_double_t;
1122 
1123 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1124  * ctypedef npy_double float_t
1125  * ctypedef npy_double double_t
1126  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1127  *
1128  * ctypedef npy_cfloat cfloat_t
1129  */
1130 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1131 /* Declarations.proto */
1132 #if CYTHON_CCOMPLEX
1133  #ifdef __cplusplus
1134  typedef ::std::complex< float > __pyx_t_float_complex;
1135  #else
1136  typedef float _Complex __pyx_t_float_complex;
1137  #endif
1138 #else
1139  typedef struct { float real, imag; } __pyx_t_float_complex;
1140 #endif
1141 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1142 
1143 /* Declarations.proto */
1144 #if CYTHON_CCOMPLEX
1145  #ifdef __cplusplus
1146  typedef ::std::complex< double > __pyx_t_double_complex;
1147  #else
1148  typedef double _Complex __pyx_t_double_complex;
1149  #endif
1150 #else
1151  typedef struct { double real, imag; } __pyx_t_double_complex;
1152 #endif
1153 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1154 
1155 
1156 /*--- Type declarations ---*/
1157 
1158 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1159  * ctypedef npy_longdouble longdouble_t
1160  *
1161  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1162  * ctypedef npy_cdouble cdouble_t
1163  * ctypedef npy_clongdouble clongdouble_t
1164  */
1165 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1166 
1167 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1168  *
1169  * ctypedef npy_cfloat cfloat_t
1170  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1171  * ctypedef npy_clongdouble clongdouble_t
1172  *
1173  */
1174 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1175 
1176 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1177  * ctypedef npy_cfloat cfloat_t
1178  * ctypedef npy_cdouble cdouble_t
1179  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1180  *
1181  * ctypedef npy_cdouble complex_t
1182  */
1183 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1184 
1185 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1186  * ctypedef npy_clongdouble clongdouble_t
1187  *
1188  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1189  *
1190  * cdef inline object PyArray_MultiIterNew1(a):
1191  */
1192 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1193 
1194 /* --- Runtime support code (head) --- */
1195 /* Refnanny.proto */
1196 #ifndef CYTHON_REFNANNY
1197  #define CYTHON_REFNANNY 0
1198 #endif
1199 #if CYTHON_REFNANNY
1200  typedef struct {
1201  void (*INCREF)(void*, PyObject*, int);
1202  void (*DECREF)(void*, PyObject*, int);
1203  void (*GOTREF)(void*, PyObject*, int);
1204  void (*GIVEREF)(void*, PyObject*, int);
1205  void* (*SetupContext)(const char*, int, const char*);
1206  void (*FinishContext)(void**);
1207  } __Pyx_RefNannyAPIStruct;
1208  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1209  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1210  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1211 #ifdef WITH_THREAD
1212  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1213  if (acquire_gil) {\
1214  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1215  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1216  PyGILState_Release(__pyx_gilstate_save);\
1217  } else {\
1218  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1219  }
1220 #else
1221  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1222  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1223 #endif
1224  #define __Pyx_RefNannyFinishContext()\
1225  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1226  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1227  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1228  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1229  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1230  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1231  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1232  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1233  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1234 #else
1235  #define __Pyx_RefNannyDeclarations
1236  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1237  #define __Pyx_RefNannyFinishContext()
1238  #define __Pyx_INCREF(r) Py_INCREF(r)
1239  #define __Pyx_DECREF(r) Py_DECREF(r)
1240  #define __Pyx_GOTREF(r)
1241  #define __Pyx_GIVEREF(r)
1242  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1243  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1244  #define __Pyx_XGOTREF(r)
1245  #define __Pyx_XGIVEREF(r)
1246 #endif
1247 #define __Pyx_XDECREF_SET(r, v) do {\
1248  PyObject *tmp = (PyObject *) r;\
1249  r = v; __Pyx_XDECREF(tmp);\
1250  } while (0)
1251 #define __Pyx_DECREF_SET(r, v) do {\
1252  PyObject *tmp = (PyObject *) r;\
1253  r = v; __Pyx_DECREF(tmp);\
1254  } while (0)
1255 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1256 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1257 
1258 /* RaiseArgTupleInvalid.proto */
1259 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1260  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1261 
1262 /* RaiseDoubleKeywords.proto */
1263 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1264 
1265 /* ParseKeywords.proto */
1266 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1267  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1268  const char* function_name);
1269 
1270 /* ArgTypeTest.proto */
1271 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1272  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1273  __Pyx__ArgTypeTest(obj, type, name, exact))
1274 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1275 
1276 /* PyObjectGetAttrStr.proto */
1277 #if CYTHON_USE_TYPE_SLOTS
1278 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1279 #else
1280 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1281 #endif
1282 
1283 /* GetBuiltinName.proto */
1284 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1285 
1286 /* GetTopmostException.proto */
1287 #if CYTHON_USE_EXC_INFO_STACK
1288 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1289 #endif
1290 
1291 /* PyThreadStateGet.proto */
1292 #if CYTHON_FAST_THREAD_STATE
1293 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1294 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1295 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1296 #else
1297 #define __Pyx_PyThreadState_declare
1298 #define __Pyx_PyThreadState_assign
1299 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1300 #endif
1301 
1302 /* SaveResetException.proto */
1303 #if CYTHON_FAST_THREAD_STATE
1304 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1305 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1306 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1307 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1308 #else
1309 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1310 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1311 #endif
1312 
1313 /* PyErrExceptionMatches.proto */
1314 #if CYTHON_FAST_THREAD_STATE
1315 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1316 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1317 #else
1318 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1319 #endif
1320 
1321 /* GetException.proto */
1322 #if CYTHON_FAST_THREAD_STATE
1323 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1324 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1325 #else
1326 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1327 #endif
1328 
1329 /* PyObjectCall.proto */
1330 #if CYTHON_COMPILING_IN_CPYTHON
1331 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1332 #else
1333 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1334 #endif
1335 
1336 /* PyErrFetchRestore.proto */
1337 #if CYTHON_FAST_THREAD_STATE
1338 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1339 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1340 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1341 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1342 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1343 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1344 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1345 #if CYTHON_COMPILING_IN_CPYTHON
1346 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1347 #else
1348 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1349 #endif
1350 #else
1351 #define __Pyx_PyErr_Clear() PyErr_Clear()
1352 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1353 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1354 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1355 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1356 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1357 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1358 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1359 #endif
1360 
1361 /* RaiseException.proto */
1362 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1363 
1364 /* TypeImport.proto */
1365 #ifndef __PYX_HAVE_RT_ImportType_proto
1366 #define __PYX_HAVE_RT_ImportType_proto
1367 enum __Pyx_ImportType_CheckSize {
1368  __Pyx_ImportType_CheckSize_Error = 0,
1369  __Pyx_ImportType_CheckSize_Warn = 1,
1370  __Pyx_ImportType_CheckSize_Ignore = 2
1371 };
1372 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1373 #endif
1374 
1375 /* Import.proto */
1376 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1377 
1378 /* PyDictVersioning.proto */
1379 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1380 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1381 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1382 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1383  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1384  (cache_var) = (value);
1385 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1386  static PY_UINT64_T __pyx_dict_version = 0;\
1387  static PyObject *__pyx_dict_cached_value = NULL;\
1388  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1389  (VAR) = __pyx_dict_cached_value;\
1390  } else {\
1391  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1392  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1393  }\
1394 }
1395 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1396 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1397 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1398 #else
1399 #define __PYX_GET_DICT_VERSION(dict) (0)
1400 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1401 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1402 #endif
1403 
1404 /* CLineInTraceback.proto */
1405 #ifdef CYTHON_CLINE_IN_TRACEBACK
1406 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1407 #else
1408 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1409 #endif
1410 
1411 /* CodeObjectCache.proto */
1412 typedef struct {
1413  PyCodeObject* code_object;
1414  int code_line;
1415 } __Pyx_CodeObjectCacheEntry;
1416 struct __Pyx_CodeObjectCache {
1417  int count;
1418  int max_count;
1419  __Pyx_CodeObjectCacheEntry* entries;
1420 };
1421 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1422 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1423 static PyCodeObject *__pyx_find_code_object(int code_line);
1424 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1425 
1426 /* AddTraceback.proto */
1427 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1428  int py_line, const char *filename);
1429 
1430 /* GCCDiagnostics.proto */
1431 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1432 #define __Pyx_HAS_GCC_DIAGNOSTIC
1433 #endif
1434 
1435 /* RealImag.proto */
1436 #if CYTHON_CCOMPLEX
1437  #ifdef __cplusplus
1438  #define __Pyx_CREAL(z) ((z).real())
1439  #define __Pyx_CIMAG(z) ((z).imag())
1440  #else
1441  #define __Pyx_CREAL(z) (__real__(z))
1442  #define __Pyx_CIMAG(z) (__imag__(z))
1443  #endif
1444 #else
1445  #define __Pyx_CREAL(z) ((z).real)
1446  #define __Pyx_CIMAG(z) ((z).imag)
1447 #endif
1448 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1449  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1450  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1451  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1452 #else
1453  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1454  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1455 #endif
1456 
1457 /* Arithmetic.proto */
1458 #if CYTHON_CCOMPLEX
1459  #define __Pyx_c_eq_float(a, b) ((a)==(b))
1460  #define __Pyx_c_sum_float(a, b) ((a)+(b))
1461  #define __Pyx_c_diff_float(a, b) ((a)-(b))
1462  #define __Pyx_c_prod_float(a, b) ((a)*(b))
1463  #define __Pyx_c_quot_float(a, b) ((a)/(b))
1464  #define __Pyx_c_neg_float(a) (-(a))
1465  #ifdef __cplusplus
1466  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1467  #define __Pyx_c_conj_float(z) (::std::conj(z))
1468  #if 1
1469  #define __Pyx_c_abs_float(z) (::std::abs(z))
1470  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1471  #endif
1472  #else
1473  #define __Pyx_c_is_zero_float(z) ((z)==0)
1474  #define __Pyx_c_conj_float(z) (conjf(z))
1475  #if 1
1476  #define __Pyx_c_abs_float(z) (cabsf(z))
1477  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1478  #endif
1479  #endif
1480 #else
1481  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1482  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1483  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1484  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1485  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1486  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1487  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1488  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1489  #if 1
1490  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1491  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1492  #endif
1493 #endif
1494 
1495 /* Arithmetic.proto */
1496 #if CYTHON_CCOMPLEX
1497  #define __Pyx_c_eq_double(a, b) ((a)==(b))
1498  #define __Pyx_c_sum_double(a, b) ((a)+(b))
1499  #define __Pyx_c_diff_double(a, b) ((a)-(b))
1500  #define __Pyx_c_prod_double(a, b) ((a)*(b))
1501  #define __Pyx_c_quot_double(a, b) ((a)/(b))
1502  #define __Pyx_c_neg_double(a) (-(a))
1503  #ifdef __cplusplus
1504  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1505  #define __Pyx_c_conj_double(z) (::std::conj(z))
1506  #if 1
1507  #define __Pyx_c_abs_double(z) (::std::abs(z))
1508  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1509  #endif
1510  #else
1511  #define __Pyx_c_is_zero_double(z) ((z)==0)
1512  #define __Pyx_c_conj_double(z) (conj(z))
1513  #if 1
1514  #define __Pyx_c_abs_double(z) (cabs(z))
1515  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1516  #endif
1517  #endif
1518 #else
1519  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1520  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1521  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1522  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1523  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1524  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1525  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1526  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1527  #if 1
1528  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1529  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1530  #endif
1531 #endif
1532 
1533 /* CIntFromPy.proto */
1534 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
1535 
1536 /* CIntFromPy.proto */
1537 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1538 
1539 /* CIntToPy.proto */
1540 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1541 
1542 /* CIntFromPy.proto */
1543 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1544 
1545 /* FastTypeChecks.proto */
1546 #if CYTHON_COMPILING_IN_CPYTHON
1547 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1548 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1549 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1550 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1551 #else
1552 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1553 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1554 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1555 #endif
1556 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1557 
1558 /* CheckBinaryVersion.proto */
1559 static int __Pyx_check_binary_version(void);
1560 
1561 /* InitStrings.proto */
1562 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1563 
1564 
1565 /* Module declarations from 'cpython.buffer' */
1566 
1567 /* Module declarations from 'libc.string' */
1568 
1569 /* Module declarations from 'libc.stdio' */
1570 
1571 /* Module declarations from '__builtin__' */
1572 
1573 /* Module declarations from 'cpython.type' */
1574 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1575 
1576 /* Module declarations from 'cpython' */
1577 
1578 /* Module declarations from 'cpython.object' */
1579 
1580 /* Module declarations from 'cpython.ref' */
1581 
1582 /* Module declarations from 'cpython.mem' */
1583 
1584 /* Module declarations from 'numpy' */
1585 
1586 /* Module declarations from 'numpy' */
1587 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1588 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1589 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1590 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1591 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1592 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1593 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1594 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1595 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1596 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1597 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1598 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1599 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1600 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1601 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1602 
1603 /* Module declarations from 'csubgridError' */
1604 #define __Pyx_MODULE_NAME "csubgridError"
1605 extern int __pyx_module_is_main_csubgridError;
1606 int __pyx_module_is_main_csubgridError = 0;
1607 
1608 /* Implementation of 'csubgridError' */
1609 static PyObject *__pyx_builtin_ImportError;
1610 static const char __pyx_k_a[] = "a";
1611 static const char __pyx_k_f[] = "f";
1612 static const char __pyx_k_g[] = "g";
1613 static const char __pyx_k_h[] = "h";
1614 static const char __pyx_k_u[] = "u";
1615 static const char __pyx_k_v[] = "v";
1616 static const char __pyx_k_dH[] = "dH";
1617 static const char __pyx_k_da[] = "da";
1618 static const char __pyx_k_df[] = "df";
1619 static const char __pyx_k_dm[] = "dm";
1620 static const char __pyx_k_dr[] = "dr";
1621 static const char __pyx_k_dt[] = "dt";
1622 static const char __pyx_k_hu[] = "hu";
1623 static const char __pyx_k_hv[] = "hv";
1624 static const char __pyx_k_np[] = "np";
1625 static const char __pyx_k_pe[] = "pe";
1626 static const char __pyx_k_cfl[] = "cfl";
1627 static const char __pyx_k_dmt[] = "dmt";
1628 static const char __pyx_k_tau[] = "tau";
1629 static const char __pyx_k_dphi[] = "dphi";
1630 static const char __pyx_k_main[] = "__main__";
1631 static const char __pyx_k_name[] = "__name__";
1632 static const char __pyx_k_tau0[] = "tau0";
1633 static const char __pyx_k_tau1[] = "tau1";
1634 static const char __pyx_k_test[] = "__test__";
1635 static const char __pyx_k_cfl_1[] = "cfl_1";
1636 static const char __pyx_k_cfl_2[] = "cfl_2";
1637 static const char __pyx_k_cfl_3[] = "cfl_3";
1638 static const char __pyx_k_numpy[] = "numpy";
1639 static const char __pyx_k_colind[] = "colind";
1640 static const char __pyx_k_import[] = "__import__";
1641 static const char __pyx_k_nSpace[] = "nSpace";
1642 static const char __pyx_k_rowptr[] = "rowptr";
1643 static const char __pyx_k_hFactor[] = "hFactor";
1644 static const char __pyx_k_grad_phi[] = "grad_phi";
1645 static const char __pyx_k_inverseJ[] = "inverseJ";
1646 static const char __pyx_k_ImportError[] = "ImportError";
1647 static const char __pyx_k_pdeResidual[] = "pdeResidual";
1648 static const char __pyx_k_dpdeResidual[] = "dpdeResidual";
1649 static const char __pyx_k_pdeResidualP[] = "pdeResidualP";
1650 static const char __pyx_k_pdeResidualU[] = "pdeResidualU";
1651 static const char __pyx_k_pdeResidualV[] = "pdeResidualV";
1652 static const char __pyx_k_pdeResidualW[] = "pdeResidualW";
1653 static const char __pyx_k_subgridError[] = "subgridError";
1654 static const char __pyx_k_tau_gradient[] = "tau_gradient";
1655 static const char __pyx_k_csubgridError[] = "csubgridError";
1656 static const char __pyx_k_dsubgridError[] = "dsubgridError";
1657 static const char __pyx_k_stabilization[] = "stabilization";
1658 static const char __pyx_k_subgridErrorP[] = "subgridErrorP";
1659 static const char __pyx_k_subgridErrorU[] = "subgridErrorU";
1660 static const char __pyx_k_subgridErrorV[] = "subgridErrorV";
1661 static const char __pyx_k_subgridErrorW[] = "subgridErrorW";
1662 static const char __pyx_k_elementDiameter[] = "elementDiameter";
1663 static const char __pyx_k_dpdeResidualP_du[] = "dpdeResidualP_du";
1664 static const char __pyx_k_dpdeResidualP_dv[] = "dpdeResidualP_dv";
1665 static const char __pyx_k_dpdeResidualP_dw[] = "dpdeResidualP_dw";
1666 static const char __pyx_k_dpdeResidualU_dp[] = "dpdeResidualU_dp";
1667 static const char __pyx_k_dpdeResidualU_du[] = "dpdeResidualU_du";
1668 static const char __pyx_k_dpdeResidualU_dv[] = "dpdeResidualU_dv";
1669 static const char __pyx_k_dpdeResidualU_dw[] = "dpdeResidualU_dw";
1670 static const char __pyx_k_dpdeResidualV_dp[] = "dpdeResidualV_dp";
1671 static const char __pyx_k_dpdeResidualV_du[] = "dpdeResidualV_du";
1672 static const char __pyx_k_dpdeResidualV_dv[] = "dpdeResidualV_dv";
1673 static const char __pyx_k_dpdeResidualV_dw[] = "dpdeResidualV_dw";
1674 static const char __pyx_k_dpdeResidualW_dp[] = "dpdeResidualW_dp";
1675 static const char __pyx_k_dpdeResidualW_du[] = "dpdeResidualW_du";
1676 static const char __pyx_k_dpdeResidualW_dv[] = "dpdeResidualW_dv";
1677 static const char __pyx_k_dpdeResidualW_dw[] = "dpdeResidualW_dw";
1678 static const char __pyx_k_grad_pdeResidual[] = "grad_pdeResidual";
1679 static const char __pyx_k_dsubgridErrorP_dp[] = "dsubgridErrorP_dp";
1680 static const char __pyx_k_dsubgridErrorP_du[] = "dsubgridErrorP_du";
1681 static const char __pyx_k_dsubgridErrorP_dv[] = "dsubgridErrorP_dv";
1682 static const char __pyx_k_dsubgridErrorP_dw[] = "dsubgridErrorP_dw";
1683 static const char __pyx_k_dsubgridErrorU_dp[] = "dsubgridErrorU_dp";
1684 static const char __pyx_k_dsubgridErrorU_du[] = "dsubgridErrorU_du";
1685 static const char __pyx_k_dsubgridErrorU_dv[] = "dsubgridErrorU_dv";
1686 static const char __pyx_k_dsubgridErrorU_dw[] = "dsubgridErrorU_dw";
1687 static const char __pyx_k_dsubgridErrorV_dp[] = "dsubgridErrorV_dp";
1688 static const char __pyx_k_dsubgridErrorV_du[] = "dsubgridErrorV_du";
1689 static const char __pyx_k_dsubgridErrorV_dv[] = "dsubgridErrorV_dv";
1690 static const char __pyx_k_dsubgridErrorV_dw[] = "dsubgridErrorV_dw";
1691 static const char __pyx_k_dsubgridErrorW_dp[] = "dsubgridErrorW_dp";
1692 static const char __pyx_k_dsubgridErrorW_du[] = "dsubgridErrorW_du";
1693 static const char __pyx_k_dsubgridErrorW_dv[] = "dsubgridErrorW_dv";
1694 static const char __pyx_k_dsubgridErrorW_dw[] = "dsubgridErrorW_dw";
1695 static const char __pyx_k_grad_subgridError[] = "grad_subgridError";
1696 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1697 static const char __pyx_k_proteus_csubgridError_pyx[] = "proteus/csubgridError.pyx";
1698 static const char __pyx_k_calculateSubgridError_A_tau[] = "calculateSubgridError_A_tau";
1699 static const char __pyx_k_calculateSubgridError_HJ_tau[] = "calculateSubgridError_HJ_tau";
1700 static const char __pyx_k_calculateSubgridError_tauRes[] = "calculateSubgridError_tauRes";
1701 static const char __pyx_k_calculateSubgridError_ADR_tau[] = "calculateSubgridError_ADR_tau";
1702 static const char __pyx_k_calculateSubgridErrorStokes2D_1[] = "calculateSubgridErrorStokes2D_1";
1703 static const char __pyx_k_calculateSubgridErrorStokes_GLS[] = "calculateSubgridErrorStokes_GLS_tau";
1704 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1705 static const char __pyx_k_calculateSubgridErrorGradient_ta[] = "calculateSubgridErrorGradient_tauRes";
1706 static const char __pyx_k_calculateSubgridErrorNavierStoke[] = "calculateSubgridErrorNavierStokes2D_GLS_tau";
1707 static const char __pyx_k_calculateSubgridErrorShallowWate[] = "calculateSubgridErrorShallowWater1D";
1708 static const char __pyx_k_calculateSubgridErrorStokes2D_GL[] = "calculateSubgridErrorStokes2D_GLS_velocity";
1709 static const char __pyx_k_calculateSubgridErrorStokes3D_GL[] = "calculateSubgridErrorStokes3D_GLS_velocity";
1710 static const char __pyx_k_calculateSubgridError_ADR_Sangal[] = "calculateSubgridError_ADR_Sangalli_tau_sd";
1711 static const char __pyx_k_calculateSubgridError_ADR_generi[] = "calculateSubgridError_ADR_generic_tau";
1712 static const char __pyx_k_calculateSubgridError_ADR_tau_sd[] = "calculateSubgridError_ADR_tau_sd";
1713 static const char __pyx_k_calculateSubgridError_Harari_tau[] = "calculateSubgridError_Harari_tau_sd";
1714 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1715 static const char __pyx_k_calculateSubgridErrorStokes2D_1_2[] = "calculateSubgridErrorStokes2D_1_sd";
1716 static const char __pyx_k_calculateSubgridErrorStokes_GLS_2[] = "calculateSubgridErrorStokes_GLS_tau_sd";
1717 static const char __pyx_k_calculateSubgridErrorNavierStoke_2[] = "calculateSubgridErrorNavierStokes2D_GLS_tau_sd";
1718 static const char __pyx_k_calculateSubgridErrorNavierStoke_3[] = "calculateSubgridErrorNavierStokes2D_generic_tau";
1719 static const char __pyx_k_calculateSubgridErrorNavierStoke_4[] = "calculateSubgridErrorNavierStokes2D_generic_tau_sd";
1720 static const char __pyx_k_calculateSubgridErrorNavierStoke_5[] = "calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau";
1721 static const char __pyx_k_calculateSubgridErrorNavierStoke_6[] = "calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd";
1722 static const char __pyx_k_calculateSubgridErrorNavierStoke_7[] = "calculateSubgridErrorNavierStokes2D_GLS_tauRes";
1723 static const char __pyx_k_calculateSubgridErrorNavierStoke_8[] = "calculateSubgridErrorNavierStokes3D_GLS_tauRes";
1724 static const char __pyx_k_calculateSubgridErrorNavierStoke_9[] = "calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure";
1725 static const char __pyx_k_calculateSubgridErrorShallowWate_2[] = "calculateSubgridErrorShallowWater2D";
1726 static const char __pyx_k_calculateSubgridErrorStokes2D_GL_2[] = "calculateSubgridErrorStokes2D_GLS_velocity_sd";
1727 static const char __pyx_k_calculateSubgridErrorStokes2D_GL_3[] = "calculateSubgridErrorStokes2D_GLS_velocity_pressure";
1728 static const char __pyx_k_calculateSubgridErrorStokes2D_GL_4[] = "calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd";
1729 static const char __pyx_k_calculateSubgridErrorStokes2D_GL_5[] = "calculateSubgridErrorStokes2D_GLS_tauRes";
1730 static const char __pyx_k_calculateSubgridErrorStokes3D_GL_2[] = "calculateSubgridErrorStokes3D_GLS_velocity_sd";
1731 static const char __pyx_k_calculateSubgridErrorStokes3D_GL_3[] = "calculateSubgridErrorStokes3D_GLS_velocity_pressure";
1732 static const char __pyx_k_calculateSubgridErrorStokes3D_GL_4[] = "calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd";
1733 static const char __pyx_k_calculateSubgridErrorStokes3D_GL_5[] = "calculateSubgridErrorStokes3D_GLS_tauRes";
1734 static const char __pyx_k_calculateSubgridError_ADR_generi_2[] = "calculateSubgridError_ADR_generic_tau_sd";
1735 static const char __pyx_k_calculateSubgridErrorNavierStoke_10[] = "calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd";
1736 static PyObject *__pyx_n_s_ImportError;
1737 static PyObject *__pyx_n_s_a;
1738 static PyObject *__pyx_n_s_calculateSubgridErrorGradient_ta;
1739 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke;
1740 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_10;
1741 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_2;
1742 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_3;
1743 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_4;
1744 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_5;
1745 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_6;
1746 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_7;
1747 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_8;
1748 static PyObject *__pyx_n_s_calculateSubgridErrorNavierStoke_9;
1749 static PyObject *__pyx_n_s_calculateSubgridErrorShallowWate;
1750 static PyObject *__pyx_n_s_calculateSubgridErrorShallowWate_2;
1751 static PyObject *__pyx_n_s_calculateSubgridErrorStokes2D_1;
1752 static PyObject *__pyx_n_s_calculateSubgridErrorStokes2D_1_2;
1753 static PyObject *__pyx_n_s_calculateSubgridErrorStokes2D_GL;
1754 static PyObject *__pyx_n_s_calculateSubgridErrorStokes2D_GL_2;
1755 static PyObject *__pyx_n_s_calculateSubgridErrorStokes2D_GL_3;
1756 static PyObject *__pyx_n_s_calculateSubgridErrorStokes2D_GL_4;
1757 static PyObject *__pyx_n_s_calculateSubgridErrorStokes2D_GL_5;
1758 static PyObject *__pyx_n_s_calculateSubgridErrorStokes3D_GL;
1759 static PyObject *__pyx_n_s_calculateSubgridErrorStokes3D_GL_2;
1760 static PyObject *__pyx_n_s_calculateSubgridErrorStokes3D_GL_3;
1761 static PyObject *__pyx_n_s_calculateSubgridErrorStokes3D_GL_4;
1762 static PyObject *__pyx_n_s_calculateSubgridErrorStokes3D_GL_5;
1763 static PyObject *__pyx_n_s_calculateSubgridErrorStokes_GLS;
1764 static PyObject *__pyx_n_s_calculateSubgridErrorStokes_GLS_2;
1765 static PyObject *__pyx_n_s_calculateSubgridError_ADR_Sangal;
1766 static PyObject *__pyx_n_s_calculateSubgridError_ADR_generi;
1767 static PyObject *__pyx_n_s_calculateSubgridError_ADR_generi_2;
1768 static PyObject *__pyx_n_s_calculateSubgridError_ADR_tau;
1769 static PyObject *__pyx_n_s_calculateSubgridError_ADR_tau_sd;
1770 static PyObject *__pyx_n_s_calculateSubgridError_A_tau;
1771 static PyObject *__pyx_n_s_calculateSubgridError_HJ_tau;
1772 static PyObject *__pyx_n_s_calculateSubgridError_Harari_tau;
1773 static PyObject *__pyx_n_s_calculateSubgridError_tauRes;
1774 static PyObject *__pyx_n_s_cfl;
1775 static PyObject *__pyx_n_s_cfl_1;
1776 static PyObject *__pyx_n_s_cfl_2;
1777 static PyObject *__pyx_n_s_cfl_3;
1778 static PyObject *__pyx_n_s_cline_in_traceback;
1779 static PyObject *__pyx_n_s_colind;
1780 static PyObject *__pyx_n_s_csubgridError;
1781 static PyObject *__pyx_n_s_dH;
1782 static PyObject *__pyx_n_s_da;
1783 static PyObject *__pyx_n_s_df;
1784 static PyObject *__pyx_n_s_dm;
1785 static PyObject *__pyx_n_s_dmt;
1786 static PyObject *__pyx_n_s_dpdeResidual;
1787 static PyObject *__pyx_n_s_dpdeResidualP_du;
1788 static PyObject *__pyx_n_s_dpdeResidualP_dv;
1789 static PyObject *__pyx_n_s_dpdeResidualP_dw;
1790 static PyObject *__pyx_n_s_dpdeResidualU_dp;
1791 static PyObject *__pyx_n_s_dpdeResidualU_du;
1792 static PyObject *__pyx_n_s_dpdeResidualU_dv;
1793 static PyObject *__pyx_n_s_dpdeResidualU_dw;
1794 static PyObject *__pyx_n_s_dpdeResidualV_dp;
1795 static PyObject *__pyx_n_s_dpdeResidualV_du;
1796 static PyObject *__pyx_n_s_dpdeResidualV_dv;
1797 static PyObject *__pyx_n_s_dpdeResidualV_dw;
1798 static PyObject *__pyx_n_s_dpdeResidualW_dp;
1799 static PyObject *__pyx_n_s_dpdeResidualW_du;
1800 static PyObject *__pyx_n_s_dpdeResidualW_dv;
1801 static PyObject *__pyx_n_s_dpdeResidualW_dw;
1802 static PyObject *__pyx_n_s_dphi;
1803 static PyObject *__pyx_n_s_dr;
1804 static PyObject *__pyx_n_s_dsubgridError;
1805 static PyObject *__pyx_n_s_dsubgridErrorP_dp;
1806 static PyObject *__pyx_n_s_dsubgridErrorP_du;
1807 static PyObject *__pyx_n_s_dsubgridErrorP_dv;
1808 static PyObject *__pyx_n_s_dsubgridErrorP_dw;
1809 static PyObject *__pyx_n_s_dsubgridErrorU_dp;
1810 static PyObject *__pyx_n_s_dsubgridErrorU_du;
1811 static PyObject *__pyx_n_s_dsubgridErrorU_dv;
1812 static PyObject *__pyx_n_s_dsubgridErrorU_dw;
1813 static PyObject *__pyx_n_s_dsubgridErrorV_dp;
1814 static PyObject *__pyx_n_s_dsubgridErrorV_du;
1815 static PyObject *__pyx_n_s_dsubgridErrorV_dv;
1816 static PyObject *__pyx_n_s_dsubgridErrorV_dw;
1817 static PyObject *__pyx_n_s_dsubgridErrorW_dp;
1818 static PyObject *__pyx_n_s_dsubgridErrorW_du;
1819 static PyObject *__pyx_n_s_dsubgridErrorW_dv;
1820 static PyObject *__pyx_n_s_dsubgridErrorW_dw;
1821 static PyObject *__pyx_n_s_dt;
1822 static PyObject *__pyx_n_s_elementDiameter;
1823 static PyObject *__pyx_n_s_f;
1824 static PyObject *__pyx_n_s_g;
1825 static PyObject *__pyx_n_s_grad_pdeResidual;
1826 static PyObject *__pyx_n_s_grad_phi;
1827 static PyObject *__pyx_n_s_grad_subgridError;
1828 static PyObject *__pyx_n_s_h;
1829 static PyObject *__pyx_n_s_hFactor;
1830 static PyObject *__pyx_n_s_hu;
1831 static PyObject *__pyx_n_s_hv;
1832 static PyObject *__pyx_n_s_import;
1833 static PyObject *__pyx_n_s_inverseJ;
1834 static PyObject *__pyx_n_s_main;
1835 static PyObject *__pyx_n_s_nSpace;
1836 static PyObject *__pyx_n_s_name;
1837 static PyObject *__pyx_n_s_np;
1838 static PyObject *__pyx_n_s_numpy;
1839 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1840 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1841 static PyObject *__pyx_n_s_pdeResidual;
1842 static PyObject *__pyx_n_s_pdeResidualP;
1843 static PyObject *__pyx_n_s_pdeResidualU;
1844 static PyObject *__pyx_n_s_pdeResidualV;
1845 static PyObject *__pyx_n_s_pdeResidualW;
1846 static PyObject *__pyx_n_s_pe;
1847 static PyObject *__pyx_kp_s_proteus_csubgridError_pyx;
1848 static PyObject *__pyx_n_s_rowptr;
1849 static PyObject *__pyx_n_s_stabilization;
1850 static PyObject *__pyx_n_s_subgridError;
1851 static PyObject *__pyx_n_s_subgridErrorP;
1852 static PyObject *__pyx_n_s_subgridErrorU;
1853 static PyObject *__pyx_n_s_subgridErrorV;
1854 static PyObject *__pyx_n_s_subgridErrorW;
1855 static PyObject *__pyx_n_s_tau;
1856 static PyObject *__pyx_n_s_tau0;
1857 static PyObject *__pyx_n_s_tau1;
1858 static PyObject *__pyx_n_s_tau_gradient;
1859 static PyObject *__pyx_n_s_test;
1860 static PyObject *__pyx_n_s_u;
1861 static PyObject *__pyx_n_s_v;
1862 static PyObject *__pyx_pf_13csubgridError_calculateSubgridError_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau, PyArrayObject *__pyx_v_pdeResidual, PyArrayObject *__pyx_v_dpdeResidual, PyArrayObject *__pyx_v_subgridError, PyArrayObject *__pyx_v_dsubgridError); /* proto */
1863 static PyObject *__pyx_pf_13csubgridError_2calculateSubgridError_ADR_generic_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau); /* proto */
1864 static PyObject *__pyx_pf_13csubgridError_4calculateSubgridError_ADR_generic_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau); /* proto */
1865 static PyObject *__pyx_pf_13csubgridError_6calculateSubgridError_ADR_tau(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau); /* proto */
1866 static PyObject *__pyx_pf_13csubgridError_8calculateSubgridError_ADR_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau); /* proto */
1867 static PyObject *__pyx_pf_13csubgridError_10calculateSubgridError_A_tau(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau); /* proto */
1868 static PyObject *__pyx_pf_13csubgridError_12calculateSubgridError_HJ_tau(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau); /* proto */
1869 static PyObject *__pyx_pf_13csubgridError_14calculateSubgridErrorStokes2D_GLS_velocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1870 static PyObject *__pyx_pf_13csubgridError_16calculateSubgridErrorStokes2D_GLS_velocity_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1871 static PyObject *__pyx_pf_13csubgridError_18calculateSubgridErrorStokes3D_GLS_velocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1872 static PyObject *__pyx_pf_13csubgridError_20calculateSubgridErrorStokes3D_GLS_velocity_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1873 static PyObject *__pyx_pf_13csubgridError_22calculateSubgridErrorStokes2D_GLS_velocity_pressure(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1874 static PyObject *__pyx_pf_13csubgridError_24calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1875 static PyObject *__pyx_pf_13csubgridError_26calculateSubgridErrorStokes3D_GLS_velocity_pressure(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1876 static PyObject *__pyx_pf_13csubgridError_28calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1877 static PyObject *__pyx_pf_13csubgridError_30calculateSubgridErrorNavierStokes2D_GLS_tau(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_hFactor, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl); /* proto */
1878 static PyObject *__pyx_pf_13csubgridError_32calculateSubgridErrorNavierStokes2D_GLS_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_hFactor, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl); /* proto */
1879 static PyObject *__pyx_pf_13csubgridError_34calculateSubgridErrorNavierStokes2D_generic_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl); /* proto */
1880 static PyObject *__pyx_pf_13csubgridError_36calculateSubgridErrorNavierStokes2D_generic_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl); /* proto */
1881 static PyObject *__pyx_pf_13csubgridError_38calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl); /* proto */
1882 static PyObject *__pyx_pf_13csubgridError_40calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl); /* proto */
1883 static PyObject *__pyx_pf_13csubgridError_42calculateSubgridErrorNavierStokes2D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_dpdeResidualU_dv, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_du, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1884 static PyObject *__pyx_pf_13csubgridError_44calculateSubgridErrorStokes_GLS_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1); /* proto */
1885 static PyObject *__pyx_pf_13csubgridError_46calculateSubgridErrorStokes_GLS_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1); /* proto */
1886 static PyObject *__pyx_pf_13csubgridError_48calculateSubgridErrorStokes2D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1887 static PyObject *__pyx_pf_13csubgridError_50calculateSubgridErrorStokes3D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1888 static PyObject *__pyx_pf_13csubgridError_52calculateSubgridErrorNavierStokes3D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_dpdeResidualU_dv, PyArrayObject *__pyx_v_dpdeResidualU_dw, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_du, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_dpdeResidualV_dw, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_du, PyArrayObject *__pyx_v_dpdeResidualW_dv, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_dsubgridErrorU_dw, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_dsubgridErrorV_dw, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_du, PyArrayObject *__pyx_v_dsubgridErrorW_dv, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1889 static PyObject *__pyx_pf_13csubgridError_54calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1890 static PyObject *__pyx_pf_13csubgridError_56calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw); /* proto */
1891 static PyObject *__pyx_pf_13csubgridError_58calculateSubgridErrorStokes2D_1(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_dp, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1892 static PyObject *__pyx_pf_13csubgridError_60calculateSubgridErrorStokes2D_1_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_dp, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv); /* proto */
1893 static PyObject *__pyx_pf_13csubgridError_62calculateSubgridErrorShallowWater1D(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_g, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_h, PyArrayObject *__pyx_v_hu, PyArrayObject *__pyx_v_cfl_1, PyArrayObject *__pyx_v_cfl_2); /* proto */
1894 static PyObject *__pyx_pf_13csubgridError_64calculateSubgridErrorShallowWater2D(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_g, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_h, PyArrayObject *__pyx_v_hu, PyArrayObject *__pyx_v_hv, PyArrayObject *__pyx_v_cfl_1, PyArrayObject *__pyx_v_cfl_2, PyArrayObject *__pyx_v_cfl_3); /* proto */
1895 static PyObject *__pyx_pf_13csubgridError_66calculateSubgridError_Harari_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_nSpace, double __pyx_v_dt, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau); /* proto */
1896 static PyObject *__pyx_pf_13csubgridError_68calculateSubgridErrorGradient_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau_gradient, PyArrayObject *__pyx_v_grad_pdeResidual, PyArrayObject *__pyx_v_grad_subgridError); /* proto */
1897 static PyObject *__pyx_pf_13csubgridError_70calculateSubgridError_ADR_Sangalli_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau, PyArrayObject *__pyx_v_tau_gradient); /* proto */
1898 static PyObject *__pyx_tuple_;
1899 static PyObject *__pyx_tuple__2;
1900 static PyObject *__pyx_tuple__3;
1901 static PyObject *__pyx_tuple__5;
1902 static PyObject *__pyx_tuple__7;
1903 static PyObject *__pyx_tuple__9;
1904 static PyObject *__pyx_tuple__11;
1905 static PyObject *__pyx_tuple__13;
1906 static PyObject *__pyx_tuple__15;
1907 static PyObject *__pyx_tuple__17;
1908 static PyObject *__pyx_tuple__19;
1909 static PyObject *__pyx_tuple__21;
1910 static PyObject *__pyx_tuple__23;
1911 static PyObject *__pyx_tuple__25;
1912 static PyObject *__pyx_tuple__27;
1913 static PyObject *__pyx_tuple__29;
1914 static PyObject *__pyx_tuple__31;
1915 static PyObject *__pyx_tuple__33;
1916 static PyObject *__pyx_tuple__35;
1917 static PyObject *__pyx_tuple__37;
1918 static PyObject *__pyx_tuple__39;
1919 static PyObject *__pyx_tuple__41;
1920 static PyObject *__pyx_tuple__43;
1921 static PyObject *__pyx_tuple__45;
1922 static PyObject *__pyx_tuple__47;
1923 static PyObject *__pyx_tuple__49;
1924 static PyObject *__pyx_tuple__51;
1925 static PyObject *__pyx_tuple__53;
1926 static PyObject *__pyx_tuple__55;
1927 static PyObject *__pyx_tuple__57;
1928 static PyObject *__pyx_tuple__59;
1929 static PyObject *__pyx_tuple__61;
1930 static PyObject *__pyx_tuple__63;
1931 static PyObject *__pyx_tuple__65;
1932 static PyObject *__pyx_tuple__67;
1933 static PyObject *__pyx_tuple__69;
1934 static PyObject *__pyx_tuple__71;
1935 static PyObject *__pyx_tuple__73;
1936 static PyObject *__pyx_codeobj__4;
1937 static PyObject *__pyx_codeobj__6;
1938 static PyObject *__pyx_codeobj__8;
1939 static PyObject *__pyx_codeobj__10;
1940 static PyObject *__pyx_codeobj__12;
1941 static PyObject *__pyx_codeobj__14;
1942 static PyObject *__pyx_codeobj__16;
1943 static PyObject *__pyx_codeobj__18;
1944 static PyObject *__pyx_codeobj__20;
1945 static PyObject *__pyx_codeobj__22;
1946 static PyObject *__pyx_codeobj__24;
1947 static PyObject *__pyx_codeobj__26;
1948 static PyObject *__pyx_codeobj__28;
1949 static PyObject *__pyx_codeobj__30;
1950 static PyObject *__pyx_codeobj__32;
1951 static PyObject *__pyx_codeobj__34;
1952 static PyObject *__pyx_codeobj__36;
1953 static PyObject *__pyx_codeobj__38;
1954 static PyObject *__pyx_codeobj__40;
1955 static PyObject *__pyx_codeobj__42;
1956 static PyObject *__pyx_codeobj__44;
1957 static PyObject *__pyx_codeobj__46;
1958 static PyObject *__pyx_codeobj__48;
1959 static PyObject *__pyx_codeobj__50;
1960 static PyObject *__pyx_codeobj__52;
1961 static PyObject *__pyx_codeobj__54;
1962 static PyObject *__pyx_codeobj__56;
1963 static PyObject *__pyx_codeobj__58;
1964 static PyObject *__pyx_codeobj__60;
1965 static PyObject *__pyx_codeobj__62;
1966 static PyObject *__pyx_codeobj__64;
1967 static PyObject *__pyx_codeobj__66;
1968 static PyObject *__pyx_codeobj__68;
1969 static PyObject *__pyx_codeobj__70;
1970 static PyObject *__pyx_codeobj__72;
1971 static PyObject *__pyx_codeobj__74;
1972 /* Late includes */
1973 
1974 /* "csubgridError.pyx":670
1975  * double* tau,
1976  * double* tau_gradient)
1977  * def calculateSubgridError_tauRes(np.ndarray tau, # <<<<<<<<<<<<<<
1978  * np.ndarray pdeResidual,
1979  * np.ndarray dpdeResidual,
1980  */
1981 
1982 /* Python wrapper */
1983 static PyObject *__pyx_pw_13csubgridError_1calculateSubgridError_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1984 static PyMethodDef __pyx_mdef_13csubgridError_1calculateSubgridError_tauRes = {"calculateSubgridError_tauRes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_1calculateSubgridError_tauRes, METH_VARARGS|METH_KEYWORDS, 0};
1985 static PyObject *__pyx_pw_13csubgridError_1calculateSubgridError_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1986  PyArrayObject *__pyx_v_tau = 0;
1987  PyArrayObject *__pyx_v_pdeResidual = 0;
1988  PyArrayObject *__pyx_v_dpdeResidual = 0;
1989  PyArrayObject *__pyx_v_subgridError = 0;
1990  PyArrayObject *__pyx_v_dsubgridError = 0;
1991  int __pyx_lineno = 0;
1992  const char *__pyx_filename = NULL;
1993  int __pyx_clineno = 0;
1994  PyObject *__pyx_r = 0;
1995  __Pyx_RefNannyDeclarations
1996  __Pyx_RefNannySetupContext("calculateSubgridError_tauRes (wrapper)", 0);
1997  {
1998  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tau,&__pyx_n_s_pdeResidual,&__pyx_n_s_dpdeResidual,&__pyx_n_s_subgridError,&__pyx_n_s_dsubgridError,0};
1999  PyObject* values[5] = {0,0,0,0,0};
2000  if (unlikely(__pyx_kwds)) {
2001  Py_ssize_t kw_args;
2002  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2003  switch (pos_args) {
2004  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2005  CYTHON_FALLTHROUGH;
2006  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2007  CYTHON_FALLTHROUGH;
2008  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2009  CYTHON_FALLTHROUGH;
2010  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2011  CYTHON_FALLTHROUGH;
2012  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2013  CYTHON_FALLTHROUGH;
2014  case 0: break;
2015  default: goto __pyx_L5_argtuple_error;
2016  }
2017  kw_args = PyDict_Size(__pyx_kwds);
2018  switch (pos_args) {
2019  case 0:
2020  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
2021  else goto __pyx_L5_argtuple_error;
2022  CYTHON_FALLTHROUGH;
2023  case 1:
2024  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidual)) != 0)) kw_args--;
2025  else {
2026  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_tauRes", 1, 5, 5, 1); __PYX_ERR(0, 670, __pyx_L3_error)
2027  }
2028  CYTHON_FALLTHROUGH;
2029  case 2:
2030  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidual)) != 0)) kw_args--;
2031  else {
2032  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_tauRes", 1, 5, 5, 2); __PYX_ERR(0, 670, __pyx_L3_error)
2033  }
2034  CYTHON_FALLTHROUGH;
2035  case 3:
2036  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridError)) != 0)) kw_args--;
2037  else {
2038  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_tauRes", 1, 5, 5, 3); __PYX_ERR(0, 670, __pyx_L3_error)
2039  }
2040  CYTHON_FALLTHROUGH;
2041  case 4:
2042  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridError)) != 0)) kw_args--;
2043  else {
2044  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_tauRes", 1, 5, 5, 4); __PYX_ERR(0, 670, __pyx_L3_error)
2045  }
2046  }
2047  if (unlikely(kw_args > 0)) {
2048  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_tauRes") < 0)) __PYX_ERR(0, 670, __pyx_L3_error)
2049  }
2050  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2051  goto __pyx_L5_argtuple_error;
2052  } else {
2053  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2054  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2055  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2056  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2057  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2058  }
2059  __pyx_v_tau = ((PyArrayObject *)values[0]);
2060  __pyx_v_pdeResidual = ((PyArrayObject *)values[1]);
2061  __pyx_v_dpdeResidual = ((PyArrayObject *)values[2]);
2062  __pyx_v_subgridError = ((PyArrayObject *)values[3]);
2063  __pyx_v_dsubgridError = ((PyArrayObject *)values[4]);
2064  }
2065  goto __pyx_L4_argument_unpacking_done;
2066  __pyx_L5_argtuple_error:;
2067  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_tauRes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 670, __pyx_L3_error)
2068  __pyx_L3_error:;
2069  __Pyx_AddTraceback("csubgridError.calculateSubgridError_tauRes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2070  __Pyx_RefNannyFinishContext();
2071  return NULL;
2072  __pyx_L4_argument_unpacking_done:;
2073  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 670, __pyx_L1_error)
2074  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidual), __pyx_ptype_5numpy_ndarray, 1, "pdeResidual", 0))) __PYX_ERR(0, 671, __pyx_L1_error)
2075  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidual), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidual", 0))) __PYX_ERR(0, 672, __pyx_L1_error)
2076  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridError), __pyx_ptype_5numpy_ndarray, 1, "subgridError", 0))) __PYX_ERR(0, 673, __pyx_L1_error)
2077  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridError), __pyx_ptype_5numpy_ndarray, 1, "dsubgridError", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
2078  __pyx_r = __pyx_pf_13csubgridError_calculateSubgridError_tauRes(__pyx_self, __pyx_v_tau, __pyx_v_pdeResidual, __pyx_v_dpdeResidual, __pyx_v_subgridError, __pyx_v_dsubgridError);
2079 
2080  /* function exit code */
2081  goto __pyx_L0;
2082  __pyx_L1_error:;
2083  __pyx_r = NULL;
2084  __pyx_L0:;
2085  __Pyx_RefNannyFinishContext();
2086  return __pyx_r;
2087 }
2088 
2089 static PyObject *__pyx_pf_13csubgridError_calculateSubgridError_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau, PyArrayObject *__pyx_v_pdeResidual, PyArrayObject *__pyx_v_dpdeResidual, PyArrayObject *__pyx_v_subgridError, PyArrayObject *__pyx_v_dsubgridError) {
2090  PyObject *__pyx_r = NULL;
2091  __Pyx_RefNannyDeclarations
2092  __Pyx_RefNannySetupContext("calculateSubgridError_tauRes", 0);
2093 
2094  /* "csubgridError.pyx":675
2095  * np.ndarray subgridError,
2096  * np.ndarray dsubgridError):
2097  * ccalculateSubgridError_tauRes(dsubgridError.shape[0], # <<<<<<<<<<<<<<
2098  * dsubgridError.shape[1],
2099  * dsubgridError.shape[2],
2100  */
2101  calculateSubgridError_tauRes((__pyx_v_dsubgridError->dimensions[0]), (__pyx_v_dsubgridError->dimensions[1]), (__pyx_v_dsubgridError->dimensions[2]), ((double *)__pyx_v_tau->data), ((double *)__pyx_v_pdeResidual->data), ((double *)__pyx_v_dpdeResidual->data), ((double *)__pyx_v_subgridError->data), ((double *)__pyx_v_dsubgridError->data));
2102 
2103  /* "csubgridError.pyx":670
2104  * double* tau,
2105  * double* tau_gradient)
2106  * def calculateSubgridError_tauRes(np.ndarray tau, # <<<<<<<<<<<<<<
2107  * np.ndarray pdeResidual,
2108  * np.ndarray dpdeResidual,
2109  */
2110 
2111  /* function exit code */
2112  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2113  __Pyx_XGIVEREF(__pyx_r);
2114  __Pyx_RefNannyFinishContext();
2115  return __pyx_r;
2116 }
2117 
2118 /* "csubgridError.pyx":683
2119  * <double*> subgridError.data,
2120  * <double*> dsubgridError.data)
2121  * def calculateSubgridError_ADR_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
2122  * np.ndarray dmt,
2123  * np.ndarray df,
2124  */
2125 
2126 /* Python wrapper */
2127 static PyObject *__pyx_pw_13csubgridError_3calculateSubgridError_ADR_generic_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2128 static PyMethodDef __pyx_mdef_13csubgridError_3calculateSubgridError_ADR_generic_tau = {"calculateSubgridError_ADR_generic_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_3calculateSubgridError_ADR_generic_tau, METH_VARARGS|METH_KEYWORDS, 0};
2129 static PyObject *__pyx_pw_13csubgridError_3calculateSubgridError_ADR_generic_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2130  PyArrayObject *__pyx_v_inverseJ = 0;
2131  PyArrayObject *__pyx_v_dmt = 0;
2132  PyArrayObject *__pyx_v_df = 0;
2133  PyArrayObject *__pyx_v_a = 0;
2134  PyArrayObject *__pyx_v_da = 0;
2135  PyArrayObject *__pyx_v_grad_phi = 0;
2136  PyArrayObject *__pyx_v_dphi = 0;
2137  PyArrayObject *__pyx_v_dr = 0;
2138  PyArrayObject *__pyx_v_pe = 0;
2139  PyArrayObject *__pyx_v_cfl = 0;
2140  PyArrayObject *__pyx_v_tau = 0;
2141  int __pyx_lineno = 0;
2142  const char *__pyx_filename = NULL;
2143  int __pyx_clineno = 0;
2144  PyObject *__pyx_r = 0;
2145  __Pyx_RefNannyDeclarations
2146  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_generic_tau (wrapper)", 0);
2147  {
2148  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inverseJ,&__pyx_n_s_dmt,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,&__pyx_n_s_grad_phi,&__pyx_n_s_dphi,&__pyx_n_s_dr,&__pyx_n_s_pe,&__pyx_n_s_cfl,&__pyx_n_s_tau,0};
2149  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
2150  if (unlikely(__pyx_kwds)) {
2151  Py_ssize_t kw_args;
2152  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2153  switch (pos_args) {
2154  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2155  CYTHON_FALLTHROUGH;
2156  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2157  CYTHON_FALLTHROUGH;
2158  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2159  CYTHON_FALLTHROUGH;
2160  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2161  CYTHON_FALLTHROUGH;
2162  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2163  CYTHON_FALLTHROUGH;
2164  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2165  CYTHON_FALLTHROUGH;
2166  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2167  CYTHON_FALLTHROUGH;
2168  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2169  CYTHON_FALLTHROUGH;
2170  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2171  CYTHON_FALLTHROUGH;
2172  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2173  CYTHON_FALLTHROUGH;
2174  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2175  CYTHON_FALLTHROUGH;
2176  case 0: break;
2177  default: goto __pyx_L5_argtuple_error;
2178  }
2179  kw_args = PyDict_Size(__pyx_kwds);
2180  switch (pos_args) {
2181  case 0:
2182  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inverseJ)) != 0)) kw_args--;
2183  else goto __pyx_L5_argtuple_error;
2184  CYTHON_FALLTHROUGH;
2185  case 1:
2186  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
2187  else {
2188  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 1); __PYX_ERR(0, 683, __pyx_L3_error)
2189  }
2190  CYTHON_FALLTHROUGH;
2191  case 2:
2192  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
2193  else {
2194  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 2); __PYX_ERR(0, 683, __pyx_L3_error)
2195  }
2196  CYTHON_FALLTHROUGH;
2197  case 3:
2198  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
2199  else {
2200  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 3); __PYX_ERR(0, 683, __pyx_L3_error)
2201  }
2202  CYTHON_FALLTHROUGH;
2203  case 4:
2204  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
2205  else {
2206  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 4); __PYX_ERR(0, 683, __pyx_L3_error)
2207  }
2208  CYTHON_FALLTHROUGH;
2209  case 5:
2210  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_phi)) != 0)) kw_args--;
2211  else {
2212  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 5); __PYX_ERR(0, 683, __pyx_L3_error)
2213  }
2214  CYTHON_FALLTHROUGH;
2215  case 6:
2216  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
2217  else {
2218  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 6); __PYX_ERR(0, 683, __pyx_L3_error)
2219  }
2220  CYTHON_FALLTHROUGH;
2221  case 7:
2222  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dr)) != 0)) kw_args--;
2223  else {
2224  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 7); __PYX_ERR(0, 683, __pyx_L3_error)
2225  }
2226  CYTHON_FALLTHROUGH;
2227  case 8:
2228  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pe)) != 0)) kw_args--;
2229  else {
2230  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 8); __PYX_ERR(0, 683, __pyx_L3_error)
2231  }
2232  CYTHON_FALLTHROUGH;
2233  case 9:
2234  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
2235  else {
2236  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 9); __PYX_ERR(0, 683, __pyx_L3_error)
2237  }
2238  CYTHON_FALLTHROUGH;
2239  case 10:
2240  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
2241  else {
2242  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, 10); __PYX_ERR(0, 683, __pyx_L3_error)
2243  }
2244  }
2245  if (unlikely(kw_args > 0)) {
2246  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_ADR_generic_tau") < 0)) __PYX_ERR(0, 683, __pyx_L3_error)
2247  }
2248  } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
2249  goto __pyx_L5_argtuple_error;
2250  } else {
2251  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2252  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2253  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2254  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2255  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2256  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2257  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2258  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2259  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2260  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2261  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2262  }
2263  __pyx_v_inverseJ = ((PyArrayObject *)values[0]);
2264  __pyx_v_dmt = ((PyArrayObject *)values[1]);
2265  __pyx_v_df = ((PyArrayObject *)values[2]);
2266  __pyx_v_a = ((PyArrayObject *)values[3]);
2267  __pyx_v_da = ((PyArrayObject *)values[4]);
2268  __pyx_v_grad_phi = ((PyArrayObject *)values[5]);
2269  __pyx_v_dphi = ((PyArrayObject *)values[6]);
2270  __pyx_v_dr = ((PyArrayObject *)values[7]);
2271  __pyx_v_pe = ((PyArrayObject *)values[8]);
2272  __pyx_v_cfl = ((PyArrayObject *)values[9]);
2273  __pyx_v_tau = ((PyArrayObject *)values[10]);
2274  }
2275  goto __pyx_L4_argument_unpacking_done;
2276  __pyx_L5_argtuple_error:;
2277  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 683, __pyx_L3_error)
2278  __pyx_L3_error:;
2279  __Pyx_AddTraceback("csubgridError.calculateSubgridError_ADR_generic_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
2280  __Pyx_RefNannyFinishContext();
2281  return NULL;
2282  __pyx_L4_argument_unpacking_done:;
2283  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inverseJ), __pyx_ptype_5numpy_ndarray, 1, "inverseJ", 0))) __PYX_ERR(0, 683, __pyx_L1_error)
2284  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 684, __pyx_L1_error)
2285  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 685, __pyx_L1_error)
2286  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 686, __pyx_L1_error)
2287  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 687, __pyx_L1_error)
2288  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_phi), __pyx_ptype_5numpy_ndarray, 1, "grad_phi", 0))) __PYX_ERR(0, 688, __pyx_L1_error)
2289  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 689, __pyx_L1_error)
2290  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dr), __pyx_ptype_5numpy_ndarray, 1, "dr", 0))) __PYX_ERR(0, 690, __pyx_L1_error)
2291  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pe), __pyx_ptype_5numpy_ndarray, 1, "pe", 0))) __PYX_ERR(0, 691, __pyx_L1_error)
2292  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
2293  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
2294  __pyx_r = __pyx_pf_13csubgridError_2calculateSubgridError_ADR_generic_tau(__pyx_self, __pyx_v_inverseJ, __pyx_v_dmt, __pyx_v_df, __pyx_v_a, __pyx_v_da, __pyx_v_grad_phi, __pyx_v_dphi, __pyx_v_dr, __pyx_v_pe, __pyx_v_cfl, __pyx_v_tau);
2295 
2296  /* function exit code */
2297  goto __pyx_L0;
2298  __pyx_L1_error:;
2299  __pyx_r = NULL;
2300  __pyx_L0:;
2301  __Pyx_RefNannyFinishContext();
2302  return __pyx_r;
2303 }
2304 
2305 static PyObject *__pyx_pf_13csubgridError_2calculateSubgridError_ADR_generic_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau) {
2306  PyObject *__pyx_r = NULL;
2307  __Pyx_RefNannyDeclarations
2308  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_generic_tau", 0);
2309 
2310  /* "csubgridError.pyx":694
2311  * np.ndarray cfl,
2312  * np.ndarray tau):
2313  * ccalculateSubgridError_ADR_generic_tau(df.shape[0], # <<<<<<<<<<<<<<
2314  * df.shape[1],
2315  * df.shape[2],
2316  */
2317  calculateSubgridError_ADR_generic_tau((__pyx_v_df->dimensions[0]), (__pyx_v_df->dimensions[1]), (__pyx_v_df->dimensions[2]), ((double *)__pyx_v_inverseJ->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data), ((double *)__pyx_v_grad_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_dr->data), ((double *)__pyx_v_pe->data), ((double *)__pyx_v_cfl->data), ((double *)__pyx_v_tau->data));
2318 
2319  /* "csubgridError.pyx":683
2320  * <double*> subgridError.data,
2321  * <double*> dsubgridError.data)
2322  * def calculateSubgridError_ADR_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
2323  * np.ndarray dmt,
2324  * np.ndarray df,
2325  */
2326 
2327  /* function exit code */
2328  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2329  __Pyx_XGIVEREF(__pyx_r);
2330  __Pyx_RefNannyFinishContext();
2331  return __pyx_r;
2332 }
2333 
2334 /* "csubgridError.pyx":708
2335  * <double*> cfl.data,
2336  * <double*> tau.data)
2337  * def calculateSubgridError_ADR_generic_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
2338  * np.ndarray colind,
2339  * np.ndarray inverseJ,
2340  */
2341 
2342 /* Python wrapper */
2343 static PyObject *__pyx_pw_13csubgridError_5calculateSubgridError_ADR_generic_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2344 static PyMethodDef __pyx_mdef_13csubgridError_5calculateSubgridError_ADR_generic_tau_sd = {"calculateSubgridError_ADR_generic_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_5calculateSubgridError_ADR_generic_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
2345 static PyObject *__pyx_pw_13csubgridError_5calculateSubgridError_ADR_generic_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2346  PyArrayObject *__pyx_v_rowptr = 0;
2347  PyArrayObject *__pyx_v_colind = 0;
2348  PyArrayObject *__pyx_v_inverseJ = 0;
2349  PyArrayObject *__pyx_v_dmt = 0;
2350  PyArrayObject *__pyx_v_df = 0;
2351  PyArrayObject *__pyx_v_a = 0;
2352  PyArrayObject *__pyx_v_da = 0;
2353  PyArrayObject *__pyx_v_grad_phi = 0;
2354  PyArrayObject *__pyx_v_dphi = 0;
2355  PyArrayObject *__pyx_v_dr = 0;
2356  PyArrayObject *__pyx_v_pe = 0;
2357  PyArrayObject *__pyx_v_cfl = 0;
2358  PyArrayObject *__pyx_v_tau = 0;
2359  int __pyx_lineno = 0;
2360  const char *__pyx_filename = NULL;
2361  int __pyx_clineno = 0;
2362  PyObject *__pyx_r = 0;
2363  __Pyx_RefNannyDeclarations
2364  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_generic_tau_sd (wrapper)", 0);
2365  {
2366  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_inverseJ,&__pyx_n_s_dmt,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,&__pyx_n_s_grad_phi,&__pyx_n_s_dphi,&__pyx_n_s_dr,&__pyx_n_s_pe,&__pyx_n_s_cfl,&__pyx_n_s_tau,0};
2367  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
2368  if (unlikely(__pyx_kwds)) {
2369  Py_ssize_t kw_args;
2370  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2371  switch (pos_args) {
2372  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2373  CYTHON_FALLTHROUGH;
2374  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2375  CYTHON_FALLTHROUGH;
2376  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2377  CYTHON_FALLTHROUGH;
2378  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2379  CYTHON_FALLTHROUGH;
2380  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2381  CYTHON_FALLTHROUGH;
2382  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2383  CYTHON_FALLTHROUGH;
2384  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2385  CYTHON_FALLTHROUGH;
2386  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2387  CYTHON_FALLTHROUGH;
2388  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2389  CYTHON_FALLTHROUGH;
2390  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2391  CYTHON_FALLTHROUGH;
2392  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2393  CYTHON_FALLTHROUGH;
2394  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2395  CYTHON_FALLTHROUGH;
2396  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2397  CYTHON_FALLTHROUGH;
2398  case 0: break;
2399  default: goto __pyx_L5_argtuple_error;
2400  }
2401  kw_args = PyDict_Size(__pyx_kwds);
2402  switch (pos_args) {
2403  case 0:
2404  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2405  else goto __pyx_L5_argtuple_error;
2406  CYTHON_FALLTHROUGH;
2407  case 1:
2408  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2409  else {
2410  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 1); __PYX_ERR(0, 708, __pyx_L3_error)
2411  }
2412  CYTHON_FALLTHROUGH;
2413  case 2:
2414  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inverseJ)) != 0)) kw_args--;
2415  else {
2416  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 2); __PYX_ERR(0, 708, __pyx_L3_error)
2417  }
2418  CYTHON_FALLTHROUGH;
2419  case 3:
2420  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
2421  else {
2422  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 3); __PYX_ERR(0, 708, __pyx_L3_error)
2423  }
2424  CYTHON_FALLTHROUGH;
2425  case 4:
2426  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
2427  else {
2428  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 4); __PYX_ERR(0, 708, __pyx_L3_error)
2429  }
2430  CYTHON_FALLTHROUGH;
2431  case 5:
2432  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
2433  else {
2434  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 5); __PYX_ERR(0, 708, __pyx_L3_error)
2435  }
2436  CYTHON_FALLTHROUGH;
2437  case 6:
2438  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
2439  else {
2440  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 6); __PYX_ERR(0, 708, __pyx_L3_error)
2441  }
2442  CYTHON_FALLTHROUGH;
2443  case 7:
2444  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_phi)) != 0)) kw_args--;
2445  else {
2446  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 7); __PYX_ERR(0, 708, __pyx_L3_error)
2447  }
2448  CYTHON_FALLTHROUGH;
2449  case 8:
2450  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
2451  else {
2452  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 8); __PYX_ERR(0, 708, __pyx_L3_error)
2453  }
2454  CYTHON_FALLTHROUGH;
2455  case 9:
2456  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dr)) != 0)) kw_args--;
2457  else {
2458  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 9); __PYX_ERR(0, 708, __pyx_L3_error)
2459  }
2460  CYTHON_FALLTHROUGH;
2461  case 10:
2462  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pe)) != 0)) kw_args--;
2463  else {
2464  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 10); __PYX_ERR(0, 708, __pyx_L3_error)
2465  }
2466  CYTHON_FALLTHROUGH;
2467  case 11:
2468  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
2469  else {
2470  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 11); __PYX_ERR(0, 708, __pyx_L3_error)
2471  }
2472  CYTHON_FALLTHROUGH;
2473  case 12:
2474  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
2475  else {
2476  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, 12); __PYX_ERR(0, 708, __pyx_L3_error)
2477  }
2478  }
2479  if (unlikely(kw_args > 0)) {
2480  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_ADR_generic_tau_sd") < 0)) __PYX_ERR(0, 708, __pyx_L3_error)
2481  }
2482  } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
2483  goto __pyx_L5_argtuple_error;
2484  } else {
2485  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2486  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2487  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2488  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2489  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2490  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2491  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2492  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2493  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2494  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2495  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2496  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2497  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2498  }
2499  __pyx_v_rowptr = ((PyArrayObject *)values[0]);
2500  __pyx_v_colind = ((PyArrayObject *)values[1]);
2501  __pyx_v_inverseJ = ((PyArrayObject *)values[2]);
2502  __pyx_v_dmt = ((PyArrayObject *)values[3]);
2503  __pyx_v_df = ((PyArrayObject *)values[4]);
2504  __pyx_v_a = ((PyArrayObject *)values[5]);
2505  __pyx_v_da = ((PyArrayObject *)values[6]);
2506  __pyx_v_grad_phi = ((PyArrayObject *)values[7]);
2507  __pyx_v_dphi = ((PyArrayObject *)values[8]);
2508  __pyx_v_dr = ((PyArrayObject *)values[9]);
2509  __pyx_v_pe = ((PyArrayObject *)values[10]);
2510  __pyx_v_cfl = ((PyArrayObject *)values[11]);
2511  __pyx_v_tau = ((PyArrayObject *)values[12]);
2512  }
2513  goto __pyx_L4_argument_unpacking_done;
2514  __pyx_L5_argtuple_error:;
2515  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_generic_tau_sd", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 708, __pyx_L3_error)
2516  __pyx_L3_error:;
2517  __Pyx_AddTraceback("csubgridError.calculateSubgridError_ADR_generic_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
2518  __Pyx_RefNannyFinishContext();
2519  return NULL;
2520  __pyx_L4_argument_unpacking_done:;
2521  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 708, __pyx_L1_error)
2522  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 709, __pyx_L1_error)
2523  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inverseJ), __pyx_ptype_5numpy_ndarray, 1, "inverseJ", 0))) __PYX_ERR(0, 710, __pyx_L1_error)
2524  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 711, __pyx_L1_error)
2525  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 712, __pyx_L1_error)
2526  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 713, __pyx_L1_error)
2527  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 714, __pyx_L1_error)
2528  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_phi), __pyx_ptype_5numpy_ndarray, 1, "grad_phi", 0))) __PYX_ERR(0, 715, __pyx_L1_error)
2529  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 716, __pyx_L1_error)
2530  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dr), __pyx_ptype_5numpy_ndarray, 1, "dr", 0))) __PYX_ERR(0, 717, __pyx_L1_error)
2531  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pe), __pyx_ptype_5numpy_ndarray, 1, "pe", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
2532  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
2533  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
2534  __pyx_r = __pyx_pf_13csubgridError_4calculateSubgridError_ADR_generic_tau_sd(__pyx_self, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_inverseJ, __pyx_v_dmt, __pyx_v_df, __pyx_v_a, __pyx_v_da, __pyx_v_grad_phi, __pyx_v_dphi, __pyx_v_dr, __pyx_v_pe, __pyx_v_cfl, __pyx_v_tau);
2535 
2536  /* function exit code */
2537  goto __pyx_L0;
2538  __pyx_L1_error:;
2539  __pyx_r = NULL;
2540  __pyx_L0:;
2541  __Pyx_RefNannyFinishContext();
2542  return __pyx_r;
2543 }
2544 
2545 static PyObject *__pyx_pf_13csubgridError_4calculateSubgridError_ADR_generic_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau) {
2546  PyObject *__pyx_r = NULL;
2547  __Pyx_RefNannyDeclarations
2548  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_generic_tau_sd", 0);
2549 
2550  /* "csubgridError.pyx":721
2551  * np.ndarray cfl,
2552  * np.ndarray tau):
2553  * ccalculateSubgridError_ADR_generic_tau_sd(df.shape[0], # <<<<<<<<<<<<<<
2554  * df.shape[1],
2555  * df.shape[2],
2556  */
2557  calculateSubgridError_ADR_generic_tau_sd((__pyx_v_df->dimensions[0]), (__pyx_v_df->dimensions[1]), (__pyx_v_df->dimensions[2]), ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((double *)__pyx_v_inverseJ->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data), ((double *)__pyx_v_grad_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_dr->data), ((double *)__pyx_v_pe->data), ((double *)__pyx_v_cfl->data), ((double *)__pyx_v_tau->data));
2558 
2559  /* "csubgridError.pyx":708
2560  * <double*> cfl.data,
2561  * <double*> tau.data)
2562  * def calculateSubgridError_ADR_generic_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
2563  * np.ndarray colind,
2564  * np.ndarray inverseJ,
2565  */
2566 
2567  /* function exit code */
2568  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2569  __Pyx_XGIVEREF(__pyx_r);
2570  __Pyx_RefNannyFinishContext();
2571  return __pyx_r;
2572 }
2573 
2574 /* "csubgridError.pyx":737
2575  * <double*> cfl.data,
2576  * <double*> tau.data)
2577  * def calculateSubgridError_ADR_tau(char stabilization, # <<<<<<<<<<<<<<
2578  * np.ndarray elementDiameter,
2579  * np.ndarray dmt,
2580  */
2581 
2582 /* Python wrapper */
2583 static PyObject *__pyx_pw_13csubgridError_7calculateSubgridError_ADR_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2584 static PyMethodDef __pyx_mdef_13csubgridError_7calculateSubgridError_ADR_tau = {"calculateSubgridError_ADR_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_7calculateSubgridError_ADR_tau, METH_VARARGS|METH_KEYWORDS, 0};
2585 static PyObject *__pyx_pw_13csubgridError_7calculateSubgridError_ADR_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2586  char __pyx_v_stabilization;
2587  PyArrayObject *__pyx_v_elementDiameter = 0;
2588  PyArrayObject *__pyx_v_dmt = 0;
2589  PyArrayObject *__pyx_v_df = 0;
2590  PyArrayObject *__pyx_v_a = 0;
2591  PyArrayObject *__pyx_v_da = 0;
2592  PyArrayObject *__pyx_v_grad_phi = 0;
2593  PyArrayObject *__pyx_v_dphi = 0;
2594  PyArrayObject *__pyx_v_dr = 0;
2595  PyArrayObject *__pyx_v_pe = 0;
2596  PyArrayObject *__pyx_v_cfl = 0;
2597  PyArrayObject *__pyx_v_tau = 0;
2598  int __pyx_lineno = 0;
2599  const char *__pyx_filename = NULL;
2600  int __pyx_clineno = 0;
2601  PyObject *__pyx_r = 0;
2602  __Pyx_RefNannyDeclarations
2603  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_tau (wrapper)", 0);
2604  {
2605  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stabilization,&__pyx_n_s_elementDiameter,&__pyx_n_s_dmt,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,&__pyx_n_s_grad_phi,&__pyx_n_s_dphi,&__pyx_n_s_dr,&__pyx_n_s_pe,&__pyx_n_s_cfl,&__pyx_n_s_tau,0};
2606  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
2607  if (unlikely(__pyx_kwds)) {
2608  Py_ssize_t kw_args;
2609  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2610  switch (pos_args) {
2611  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2612  CYTHON_FALLTHROUGH;
2613  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2614  CYTHON_FALLTHROUGH;
2615  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2616  CYTHON_FALLTHROUGH;
2617  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2618  CYTHON_FALLTHROUGH;
2619  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2620  CYTHON_FALLTHROUGH;
2621  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2622  CYTHON_FALLTHROUGH;
2623  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2624  CYTHON_FALLTHROUGH;
2625  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2626  CYTHON_FALLTHROUGH;
2627  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2628  CYTHON_FALLTHROUGH;
2629  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2630  CYTHON_FALLTHROUGH;
2631  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2632  CYTHON_FALLTHROUGH;
2633  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2634  CYTHON_FALLTHROUGH;
2635  case 0: break;
2636  default: goto __pyx_L5_argtuple_error;
2637  }
2638  kw_args = PyDict_Size(__pyx_kwds);
2639  switch (pos_args) {
2640  case 0:
2641  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stabilization)) != 0)) kw_args--;
2642  else goto __pyx_L5_argtuple_error;
2643  CYTHON_FALLTHROUGH;
2644  case 1:
2645  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
2646  else {
2647  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 1); __PYX_ERR(0, 737, __pyx_L3_error)
2648  }
2649  CYTHON_FALLTHROUGH;
2650  case 2:
2651  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
2652  else {
2653  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 2); __PYX_ERR(0, 737, __pyx_L3_error)
2654  }
2655  CYTHON_FALLTHROUGH;
2656  case 3:
2657  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
2658  else {
2659  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 3); __PYX_ERR(0, 737, __pyx_L3_error)
2660  }
2661  CYTHON_FALLTHROUGH;
2662  case 4:
2663  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
2664  else {
2665  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 4); __PYX_ERR(0, 737, __pyx_L3_error)
2666  }
2667  CYTHON_FALLTHROUGH;
2668  case 5:
2669  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
2670  else {
2671  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 5); __PYX_ERR(0, 737, __pyx_L3_error)
2672  }
2673  CYTHON_FALLTHROUGH;
2674  case 6:
2675  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_phi)) != 0)) kw_args--;
2676  else {
2677  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 6); __PYX_ERR(0, 737, __pyx_L3_error)
2678  }
2679  CYTHON_FALLTHROUGH;
2680  case 7:
2681  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
2682  else {
2683  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 7); __PYX_ERR(0, 737, __pyx_L3_error)
2684  }
2685  CYTHON_FALLTHROUGH;
2686  case 8:
2687  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dr)) != 0)) kw_args--;
2688  else {
2689  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 8); __PYX_ERR(0, 737, __pyx_L3_error)
2690  }
2691  CYTHON_FALLTHROUGH;
2692  case 9:
2693  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pe)) != 0)) kw_args--;
2694  else {
2695  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 9); __PYX_ERR(0, 737, __pyx_L3_error)
2696  }
2697  CYTHON_FALLTHROUGH;
2698  case 10:
2699  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
2700  else {
2701  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 10); __PYX_ERR(0, 737, __pyx_L3_error)
2702  }
2703  CYTHON_FALLTHROUGH;
2704  case 11:
2705  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
2706  else {
2707  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, 11); __PYX_ERR(0, 737, __pyx_L3_error)
2708  }
2709  }
2710  if (unlikely(kw_args > 0)) {
2711  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_ADR_tau") < 0)) __PYX_ERR(0, 737, __pyx_L3_error)
2712  }
2713  } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
2714  goto __pyx_L5_argtuple_error;
2715  } else {
2716  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2717  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2718  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2719  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2720  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2721  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2722  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2723  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2724  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2725  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2726  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2727  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2728  }
2729  __pyx_v_stabilization = __Pyx_PyInt_As_char(values[0]); if (unlikely((__pyx_v_stabilization == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
2730  __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
2731  __pyx_v_dmt = ((PyArrayObject *)values[2]);
2732  __pyx_v_df = ((PyArrayObject *)values[3]);
2733  __pyx_v_a = ((PyArrayObject *)values[4]);
2734  __pyx_v_da = ((PyArrayObject *)values[5]);
2735  __pyx_v_grad_phi = ((PyArrayObject *)values[6]);
2736  __pyx_v_dphi = ((PyArrayObject *)values[7]);
2737  __pyx_v_dr = ((PyArrayObject *)values[8]);
2738  __pyx_v_pe = ((PyArrayObject *)values[9]);
2739  __pyx_v_cfl = ((PyArrayObject *)values[10]);
2740  __pyx_v_tau = ((PyArrayObject *)values[11]);
2741  }
2742  goto __pyx_L4_argument_unpacking_done;
2743  __pyx_L5_argtuple_error:;
2744  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 737, __pyx_L3_error)
2745  __pyx_L3_error:;
2746  __Pyx_AddTraceback("csubgridError.calculateSubgridError_ADR_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
2747  __Pyx_RefNannyFinishContext();
2748  return NULL;
2749  __pyx_L4_argument_unpacking_done:;
2750  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 738, __pyx_L1_error)
2751  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 739, __pyx_L1_error)
2752  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 740, __pyx_L1_error)
2753  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 741, __pyx_L1_error)
2754  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 742, __pyx_L1_error)
2755  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_phi), __pyx_ptype_5numpy_ndarray, 1, "grad_phi", 0))) __PYX_ERR(0, 743, __pyx_L1_error)
2756  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 744, __pyx_L1_error)
2757  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dr), __pyx_ptype_5numpy_ndarray, 1, "dr", 0))) __PYX_ERR(0, 745, __pyx_L1_error)
2758  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pe), __pyx_ptype_5numpy_ndarray, 1, "pe", 0))) __PYX_ERR(0, 746, __pyx_L1_error)
2759  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 747, __pyx_L1_error)
2760  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 748, __pyx_L1_error)
2761  __pyx_r = __pyx_pf_13csubgridError_6calculateSubgridError_ADR_tau(__pyx_self, __pyx_v_stabilization, __pyx_v_elementDiameter, __pyx_v_dmt, __pyx_v_df, __pyx_v_a, __pyx_v_da, __pyx_v_grad_phi, __pyx_v_dphi, __pyx_v_dr, __pyx_v_pe, __pyx_v_cfl, __pyx_v_tau);
2762 
2763  /* function exit code */
2764  goto __pyx_L0;
2765  __pyx_L1_error:;
2766  __pyx_r = NULL;
2767  __pyx_L0:;
2768  __Pyx_RefNannyFinishContext();
2769  return __pyx_r;
2770 }
2771 
2772 static PyObject *__pyx_pf_13csubgridError_6calculateSubgridError_ADR_tau(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau) {
2773  PyObject *__pyx_r = NULL;
2774  __Pyx_RefNannyDeclarations
2775  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_tau", 0);
2776 
2777  /* "csubgridError.pyx":749
2778  * np.ndarray cfl,
2779  * np.ndarray tau):
2780  * ccalculateSubgridError_ADR_tau(df.shape[0], # <<<<<<<<<<<<<<
2781  * df.shape[1],
2782  * df.shape[2],
2783  */
2784  calculateSubgridError_ADR_tau((__pyx_v_df->dimensions[0]), (__pyx_v_df->dimensions[1]), (__pyx_v_df->dimensions[2]), __pyx_v_stabilization, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data), ((double *)__pyx_v_grad_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_dr->data), ((double *)__pyx_v_pe->data), ((double *)__pyx_v_cfl->data), ((double *)__pyx_v_tau->data));
2785 
2786  /* "csubgridError.pyx":737
2787  * <double*> cfl.data,
2788  * <double*> tau.data)
2789  * def calculateSubgridError_ADR_tau(char stabilization, # <<<<<<<<<<<<<<
2790  * np.ndarray elementDiameter,
2791  * np.ndarray dmt,
2792  */
2793 
2794  /* function exit code */
2795  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2796  __Pyx_XGIVEREF(__pyx_r);
2797  __Pyx_RefNannyFinishContext();
2798  return __pyx_r;
2799 }
2800 
2801 /* "csubgridError.pyx":764
2802  * <double*> cfl.data,
2803  * <double*> tau.data)
2804  * def calculateSubgridError_ADR_tau_sd(char stabilization, # <<<<<<<<<<<<<<
2805  * np.ndarray rowptr,
2806  * np.ndarray colind,
2807  */
2808 
2809 /* Python wrapper */
2810 static PyObject *__pyx_pw_13csubgridError_9calculateSubgridError_ADR_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2811 static PyMethodDef __pyx_mdef_13csubgridError_9calculateSubgridError_ADR_tau_sd = {"calculateSubgridError_ADR_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_9calculateSubgridError_ADR_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
2812 static PyObject *__pyx_pw_13csubgridError_9calculateSubgridError_ADR_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2813  char __pyx_v_stabilization;
2814  PyArrayObject *__pyx_v_rowptr = 0;
2815  PyArrayObject *__pyx_v_colind = 0;
2816  PyArrayObject *__pyx_v_elementDiameter = 0;
2817  PyArrayObject *__pyx_v_dmt = 0;
2818  PyArrayObject *__pyx_v_df = 0;
2819  PyArrayObject *__pyx_v_a = 0;
2820  PyArrayObject *__pyx_v_da = 0;
2821  PyArrayObject *__pyx_v_grad_phi = 0;
2822  PyArrayObject *__pyx_v_dphi = 0;
2823  PyArrayObject *__pyx_v_dr = 0;
2824  PyArrayObject *__pyx_v_pe = 0;
2825  PyArrayObject *__pyx_v_cfl = 0;
2826  PyArrayObject *__pyx_v_tau = 0;
2827  int __pyx_lineno = 0;
2828  const char *__pyx_filename = NULL;
2829  int __pyx_clineno = 0;
2830  PyObject *__pyx_r = 0;
2831  __Pyx_RefNannyDeclarations
2832  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_tau_sd (wrapper)", 0);
2833  {
2834  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stabilization,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_elementDiameter,&__pyx_n_s_dmt,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,&__pyx_n_s_grad_phi,&__pyx_n_s_dphi,&__pyx_n_s_dr,&__pyx_n_s_pe,&__pyx_n_s_cfl,&__pyx_n_s_tau,0};
2835  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
2836  if (unlikely(__pyx_kwds)) {
2837  Py_ssize_t kw_args;
2838  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2839  switch (pos_args) {
2840  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2841  CYTHON_FALLTHROUGH;
2842  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2843  CYTHON_FALLTHROUGH;
2844  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2845  CYTHON_FALLTHROUGH;
2846  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2847  CYTHON_FALLTHROUGH;
2848  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2849  CYTHON_FALLTHROUGH;
2850  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2851  CYTHON_FALLTHROUGH;
2852  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2853  CYTHON_FALLTHROUGH;
2854  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2855  CYTHON_FALLTHROUGH;
2856  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2857  CYTHON_FALLTHROUGH;
2858  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2859  CYTHON_FALLTHROUGH;
2860  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2861  CYTHON_FALLTHROUGH;
2862  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2863  CYTHON_FALLTHROUGH;
2864  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2865  CYTHON_FALLTHROUGH;
2866  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2867  CYTHON_FALLTHROUGH;
2868  case 0: break;
2869  default: goto __pyx_L5_argtuple_error;
2870  }
2871  kw_args = PyDict_Size(__pyx_kwds);
2872  switch (pos_args) {
2873  case 0:
2874  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stabilization)) != 0)) kw_args--;
2875  else goto __pyx_L5_argtuple_error;
2876  CYTHON_FALLTHROUGH;
2877  case 1:
2878  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2879  else {
2880  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 1); __PYX_ERR(0, 764, __pyx_L3_error)
2881  }
2882  CYTHON_FALLTHROUGH;
2883  case 2:
2884  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2885  else {
2886  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 2); __PYX_ERR(0, 764, __pyx_L3_error)
2887  }
2888  CYTHON_FALLTHROUGH;
2889  case 3:
2890  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
2891  else {
2892  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 3); __PYX_ERR(0, 764, __pyx_L3_error)
2893  }
2894  CYTHON_FALLTHROUGH;
2895  case 4:
2896  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
2897  else {
2898  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 4); __PYX_ERR(0, 764, __pyx_L3_error)
2899  }
2900  CYTHON_FALLTHROUGH;
2901  case 5:
2902  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
2903  else {
2904  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 5); __PYX_ERR(0, 764, __pyx_L3_error)
2905  }
2906  CYTHON_FALLTHROUGH;
2907  case 6:
2908  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
2909  else {
2910  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 6); __PYX_ERR(0, 764, __pyx_L3_error)
2911  }
2912  CYTHON_FALLTHROUGH;
2913  case 7:
2914  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
2915  else {
2916  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 7); __PYX_ERR(0, 764, __pyx_L3_error)
2917  }
2918  CYTHON_FALLTHROUGH;
2919  case 8:
2920  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_phi)) != 0)) kw_args--;
2921  else {
2922  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 8); __PYX_ERR(0, 764, __pyx_L3_error)
2923  }
2924  CYTHON_FALLTHROUGH;
2925  case 9:
2926  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
2927  else {
2928  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 9); __PYX_ERR(0, 764, __pyx_L3_error)
2929  }
2930  CYTHON_FALLTHROUGH;
2931  case 10:
2932  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dr)) != 0)) kw_args--;
2933  else {
2934  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 10); __PYX_ERR(0, 764, __pyx_L3_error)
2935  }
2936  CYTHON_FALLTHROUGH;
2937  case 11:
2938  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pe)) != 0)) kw_args--;
2939  else {
2940  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 11); __PYX_ERR(0, 764, __pyx_L3_error)
2941  }
2942  CYTHON_FALLTHROUGH;
2943  case 12:
2944  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
2945  else {
2946  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 12); __PYX_ERR(0, 764, __pyx_L3_error)
2947  }
2948  CYTHON_FALLTHROUGH;
2949  case 13:
2950  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
2951  else {
2952  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, 13); __PYX_ERR(0, 764, __pyx_L3_error)
2953  }
2954  }
2955  if (unlikely(kw_args > 0)) {
2956  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_ADR_tau_sd") < 0)) __PYX_ERR(0, 764, __pyx_L3_error)
2957  }
2958  } else if (PyTuple_GET_SIZE(__pyx_args) != 14) {
2959  goto __pyx_L5_argtuple_error;
2960  } else {
2961  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2962  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2963  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2964  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2965  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2966  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2967  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2968  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2969  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2970  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2971  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2972  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2973  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2974  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2975  }
2976  __pyx_v_stabilization = __Pyx_PyInt_As_char(values[0]); if (unlikely((__pyx_v_stabilization == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L3_error)
2977  __pyx_v_rowptr = ((PyArrayObject *)values[1]);
2978  __pyx_v_colind = ((PyArrayObject *)values[2]);
2979  __pyx_v_elementDiameter = ((PyArrayObject *)values[3]);
2980  __pyx_v_dmt = ((PyArrayObject *)values[4]);
2981  __pyx_v_df = ((PyArrayObject *)values[5]);
2982  __pyx_v_a = ((PyArrayObject *)values[6]);
2983  __pyx_v_da = ((PyArrayObject *)values[7]);
2984  __pyx_v_grad_phi = ((PyArrayObject *)values[8]);
2985  __pyx_v_dphi = ((PyArrayObject *)values[9]);
2986  __pyx_v_dr = ((PyArrayObject *)values[10]);
2987  __pyx_v_pe = ((PyArrayObject *)values[11]);
2988  __pyx_v_cfl = ((PyArrayObject *)values[12]);
2989  __pyx_v_tau = ((PyArrayObject *)values[13]);
2990  }
2991  goto __pyx_L4_argument_unpacking_done;
2992  __pyx_L5_argtuple_error:;
2993  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_tau_sd", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 764, __pyx_L3_error)
2994  __pyx_L3_error:;
2995  __Pyx_AddTraceback("csubgridError.calculateSubgridError_ADR_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
2996  __Pyx_RefNannyFinishContext();
2997  return NULL;
2998  __pyx_L4_argument_unpacking_done:;
2999  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 765, __pyx_L1_error)
3000  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 766, __pyx_L1_error)
3001  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 767, __pyx_L1_error)
3002  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 768, __pyx_L1_error)
3003  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 769, __pyx_L1_error)
3004  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 770, __pyx_L1_error)
3005  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 771, __pyx_L1_error)
3006  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_phi), __pyx_ptype_5numpy_ndarray, 1, "grad_phi", 0))) __PYX_ERR(0, 772, __pyx_L1_error)
3007  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 773, __pyx_L1_error)
3008  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dr), __pyx_ptype_5numpy_ndarray, 1, "dr", 0))) __PYX_ERR(0, 774, __pyx_L1_error)
3009  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pe), __pyx_ptype_5numpy_ndarray, 1, "pe", 0))) __PYX_ERR(0, 775, __pyx_L1_error)
3010  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 776, __pyx_L1_error)
3011  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 777, __pyx_L1_error)
3012  __pyx_r = __pyx_pf_13csubgridError_8calculateSubgridError_ADR_tau_sd(__pyx_self, __pyx_v_stabilization, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_elementDiameter, __pyx_v_dmt, __pyx_v_df, __pyx_v_a, __pyx_v_da, __pyx_v_grad_phi, __pyx_v_dphi, __pyx_v_dr, __pyx_v_pe, __pyx_v_cfl, __pyx_v_tau);
3013 
3014  /* function exit code */
3015  goto __pyx_L0;
3016  __pyx_L1_error:;
3017  __pyx_r = NULL;
3018  __pyx_L0:;
3019  __Pyx_RefNannyFinishContext();
3020  return __pyx_r;
3021 }
3022 
3023 static PyObject *__pyx_pf_13csubgridError_8calculateSubgridError_ADR_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau) {
3024  PyObject *__pyx_r = NULL;
3025  __Pyx_RefNannyDeclarations
3026  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_tau_sd", 0);
3027 
3028  /* "csubgridError.pyx":778
3029  * np.ndarray cfl,
3030  * np.ndarray tau):
3031  * ccalculateSubgridError_ADR_tau_sd(df.shape[0], # <<<<<<<<<<<<<<
3032  * df.shape[1],
3033  * df.shape[2],
3034  */
3035  calculateSubgridError_ADR_tau_sd((__pyx_v_df->dimensions[0]), (__pyx_v_df->dimensions[1]), (__pyx_v_df->dimensions[2]), ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), __pyx_v_stabilization, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data), ((double *)__pyx_v_grad_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_dr->data), ((double *)__pyx_v_pe->data), ((double *)__pyx_v_cfl->data), ((double *)__pyx_v_tau->data));
3036 
3037  /* "csubgridError.pyx":764
3038  * <double*> cfl.data,
3039  * <double*> tau.data)
3040  * def calculateSubgridError_ADR_tau_sd(char stabilization, # <<<<<<<<<<<<<<
3041  * np.ndarray rowptr,
3042  * np.ndarray colind,
3043  */
3044 
3045  /* function exit code */
3046  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3047  __Pyx_XGIVEREF(__pyx_r);
3048  __Pyx_RefNannyFinishContext();
3049  return __pyx_r;
3050 }
3051 
3052 /* "csubgridError.pyx":795
3053  * <double*> cfl.data,
3054  * <double*> tau.data)
3055  * def calculateSubgridError_A_tau(char stabilization, # <<<<<<<<<<<<<<
3056  * np.ndarray elementDiameter,
3057  * np.ndarray dmt,
3058  */
3059 
3060 /* Python wrapper */
3061 static PyObject *__pyx_pw_13csubgridError_11calculateSubgridError_A_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3062 static PyMethodDef __pyx_mdef_13csubgridError_11calculateSubgridError_A_tau = {"calculateSubgridError_A_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_11calculateSubgridError_A_tau, METH_VARARGS|METH_KEYWORDS, 0};
3063 static PyObject *__pyx_pw_13csubgridError_11calculateSubgridError_A_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3064  char __pyx_v_stabilization;
3065  PyArrayObject *__pyx_v_elementDiameter = 0;
3066  PyArrayObject *__pyx_v_dmt = 0;
3067  PyArrayObject *__pyx_v_df = 0;
3068  PyArrayObject *__pyx_v_cfl = 0;
3069  PyArrayObject *__pyx_v_tau = 0;
3070  int __pyx_lineno = 0;
3071  const char *__pyx_filename = NULL;
3072  int __pyx_clineno = 0;
3073  PyObject *__pyx_r = 0;
3074  __Pyx_RefNannyDeclarations
3075  __Pyx_RefNannySetupContext("calculateSubgridError_A_tau (wrapper)", 0);
3076  {
3077  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stabilization,&__pyx_n_s_elementDiameter,&__pyx_n_s_dmt,&__pyx_n_s_df,&__pyx_n_s_cfl,&__pyx_n_s_tau,0};
3078  PyObject* values[6] = {0,0,0,0,0,0};
3079  if (unlikely(__pyx_kwds)) {
3080  Py_ssize_t kw_args;
3081  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3082  switch (pos_args) {
3083  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3084  CYTHON_FALLTHROUGH;
3085  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3086  CYTHON_FALLTHROUGH;
3087  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3088  CYTHON_FALLTHROUGH;
3089  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3090  CYTHON_FALLTHROUGH;
3091  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3092  CYTHON_FALLTHROUGH;
3093  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3094  CYTHON_FALLTHROUGH;
3095  case 0: break;
3096  default: goto __pyx_L5_argtuple_error;
3097  }
3098  kw_args = PyDict_Size(__pyx_kwds);
3099  switch (pos_args) {
3100  case 0:
3101  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stabilization)) != 0)) kw_args--;
3102  else goto __pyx_L5_argtuple_error;
3103  CYTHON_FALLTHROUGH;
3104  case 1:
3105  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
3106  else {
3107  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_A_tau", 1, 6, 6, 1); __PYX_ERR(0, 795, __pyx_L3_error)
3108  }
3109  CYTHON_FALLTHROUGH;
3110  case 2:
3111  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
3112  else {
3113  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_A_tau", 1, 6, 6, 2); __PYX_ERR(0, 795, __pyx_L3_error)
3114  }
3115  CYTHON_FALLTHROUGH;
3116  case 3:
3117  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
3118  else {
3119  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_A_tau", 1, 6, 6, 3); __PYX_ERR(0, 795, __pyx_L3_error)
3120  }
3121  CYTHON_FALLTHROUGH;
3122  case 4:
3123  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
3124  else {
3125  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_A_tau", 1, 6, 6, 4); __PYX_ERR(0, 795, __pyx_L3_error)
3126  }
3127  CYTHON_FALLTHROUGH;
3128  case 5:
3129  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
3130  else {
3131  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_A_tau", 1, 6, 6, 5); __PYX_ERR(0, 795, __pyx_L3_error)
3132  }
3133  }
3134  if (unlikely(kw_args > 0)) {
3135  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_A_tau") < 0)) __PYX_ERR(0, 795, __pyx_L3_error)
3136  }
3137  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
3138  goto __pyx_L5_argtuple_error;
3139  } else {
3140  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3141  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3142  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3143  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3144  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3145  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3146  }
3147  __pyx_v_stabilization = __Pyx_PyInt_As_char(values[0]); if (unlikely((__pyx_v_stabilization == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L3_error)
3148  __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
3149  __pyx_v_dmt = ((PyArrayObject *)values[2]);
3150  __pyx_v_df = ((PyArrayObject *)values[3]);
3151  __pyx_v_cfl = ((PyArrayObject *)values[4]);
3152  __pyx_v_tau = ((PyArrayObject *)values[5]);
3153  }
3154  goto __pyx_L4_argument_unpacking_done;
3155  __pyx_L5_argtuple_error:;
3156  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_A_tau", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 795, __pyx_L3_error)
3157  __pyx_L3_error:;
3158  __Pyx_AddTraceback("csubgridError.calculateSubgridError_A_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
3159  __Pyx_RefNannyFinishContext();
3160  return NULL;
3161  __pyx_L4_argument_unpacking_done:;
3162  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 796, __pyx_L1_error)
3163  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 797, __pyx_L1_error)
3164  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 798, __pyx_L1_error)
3165  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 799, __pyx_L1_error)
3166  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 800, __pyx_L1_error)
3167  __pyx_r = __pyx_pf_13csubgridError_10calculateSubgridError_A_tau(__pyx_self, __pyx_v_stabilization, __pyx_v_elementDiameter, __pyx_v_dmt, __pyx_v_df, __pyx_v_cfl, __pyx_v_tau);
3168 
3169  /* function exit code */
3170  goto __pyx_L0;
3171  __pyx_L1_error:;
3172  __pyx_r = NULL;
3173  __pyx_L0:;
3174  __Pyx_RefNannyFinishContext();
3175  return __pyx_r;
3176 }
3177 
3178 static PyObject *__pyx_pf_13csubgridError_10calculateSubgridError_A_tau(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau) {
3179  PyObject *__pyx_r = NULL;
3180  __Pyx_RefNannyDeclarations
3181  __Pyx_RefNannySetupContext("calculateSubgridError_A_tau", 0);
3182 
3183  /* "csubgridError.pyx":801
3184  * np.ndarray cfl,
3185  * np.ndarray tau):
3186  * ccalculateSubgridError_A_tau(df.shape[0], # <<<<<<<<<<<<<<
3187  * df.shape[1],
3188  * df.shape[2],
3189  */
3190  calculateSubgridError_A_tau((__pyx_v_df->dimensions[0]), (__pyx_v_df->dimensions[1]), (__pyx_v_df->dimensions[2]), __pyx_v_stabilization, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_cfl->data), ((double *)__pyx_v_tau->data));
3191 
3192  /* "csubgridError.pyx":795
3193  * <double*> cfl.data,
3194  * <double*> tau.data)
3195  * def calculateSubgridError_A_tau(char stabilization, # <<<<<<<<<<<<<<
3196  * np.ndarray elementDiameter,
3197  * np.ndarray dmt,
3198  */
3199 
3200  /* function exit code */
3201  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3202  __Pyx_XGIVEREF(__pyx_r);
3203  __Pyx_RefNannyFinishContext();
3204  return __pyx_r;
3205 }
3206 
3207 /* "csubgridError.pyx":810
3208  * <double*> cfl.data,
3209  * <double*> tau.data)
3210  * def calculateSubgridError_HJ_tau(char stabilization, # <<<<<<<<<<<<<<
3211  * np.ndarray elementDiameter,
3212  * np.ndarray dmt,
3213  */
3214 
3215 /* Python wrapper */
3216 static PyObject *__pyx_pw_13csubgridError_13calculateSubgridError_HJ_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3217 static PyMethodDef __pyx_mdef_13csubgridError_13calculateSubgridError_HJ_tau = {"calculateSubgridError_HJ_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_13calculateSubgridError_HJ_tau, METH_VARARGS|METH_KEYWORDS, 0};
3218 static PyObject *__pyx_pw_13csubgridError_13calculateSubgridError_HJ_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3219  char __pyx_v_stabilization;
3220  PyArrayObject *__pyx_v_elementDiameter = 0;
3221  PyArrayObject *__pyx_v_dmt = 0;
3222  PyArrayObject *__pyx_v_dH = 0;
3223  PyArrayObject *__pyx_v_cfl = 0;
3224  PyArrayObject *__pyx_v_tau = 0;
3225  int __pyx_lineno = 0;
3226  const char *__pyx_filename = NULL;
3227  int __pyx_clineno = 0;
3228  PyObject *__pyx_r = 0;
3229  __Pyx_RefNannyDeclarations
3230  __Pyx_RefNannySetupContext("calculateSubgridError_HJ_tau (wrapper)", 0);
3231  {
3232  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stabilization,&__pyx_n_s_elementDiameter,&__pyx_n_s_dmt,&__pyx_n_s_dH,&__pyx_n_s_cfl,&__pyx_n_s_tau,0};
3233  PyObject* values[6] = {0,0,0,0,0,0};
3234  if (unlikely(__pyx_kwds)) {
3235  Py_ssize_t kw_args;
3236  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3237  switch (pos_args) {
3238  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3239  CYTHON_FALLTHROUGH;
3240  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3241  CYTHON_FALLTHROUGH;
3242  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3243  CYTHON_FALLTHROUGH;
3244  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3245  CYTHON_FALLTHROUGH;
3246  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3247  CYTHON_FALLTHROUGH;
3248  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3249  CYTHON_FALLTHROUGH;
3250  case 0: break;
3251  default: goto __pyx_L5_argtuple_error;
3252  }
3253  kw_args = PyDict_Size(__pyx_kwds);
3254  switch (pos_args) {
3255  case 0:
3256  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stabilization)) != 0)) kw_args--;
3257  else goto __pyx_L5_argtuple_error;
3258  CYTHON_FALLTHROUGH;
3259  case 1:
3260  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
3261  else {
3262  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_HJ_tau", 1, 6, 6, 1); __PYX_ERR(0, 810, __pyx_L3_error)
3263  }
3264  CYTHON_FALLTHROUGH;
3265  case 2:
3266  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
3267  else {
3268  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_HJ_tau", 1, 6, 6, 2); __PYX_ERR(0, 810, __pyx_L3_error)
3269  }
3270  CYTHON_FALLTHROUGH;
3271  case 3:
3272  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dH)) != 0)) kw_args--;
3273  else {
3274  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_HJ_tau", 1, 6, 6, 3); __PYX_ERR(0, 810, __pyx_L3_error)
3275  }
3276  CYTHON_FALLTHROUGH;
3277  case 4:
3278  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
3279  else {
3280  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_HJ_tau", 1, 6, 6, 4); __PYX_ERR(0, 810, __pyx_L3_error)
3281  }
3282  CYTHON_FALLTHROUGH;
3283  case 5:
3284  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
3285  else {
3286  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_HJ_tau", 1, 6, 6, 5); __PYX_ERR(0, 810, __pyx_L3_error)
3287  }
3288  }
3289  if (unlikely(kw_args > 0)) {
3290  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_HJ_tau") < 0)) __PYX_ERR(0, 810, __pyx_L3_error)
3291  }
3292  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
3293  goto __pyx_L5_argtuple_error;
3294  } else {
3295  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3296  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3297  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3298  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3299  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3300  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3301  }
3302  __pyx_v_stabilization = __Pyx_PyInt_As_char(values[0]); if (unlikely((__pyx_v_stabilization == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 810, __pyx_L3_error)
3303  __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
3304  __pyx_v_dmt = ((PyArrayObject *)values[2]);
3305  __pyx_v_dH = ((PyArrayObject *)values[3]);
3306  __pyx_v_cfl = ((PyArrayObject *)values[4]);
3307  __pyx_v_tau = ((PyArrayObject *)values[5]);
3308  }
3309  goto __pyx_L4_argument_unpacking_done;
3310  __pyx_L5_argtuple_error:;
3311  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_HJ_tau", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 810, __pyx_L3_error)
3312  __pyx_L3_error:;
3313  __Pyx_AddTraceback("csubgridError.calculateSubgridError_HJ_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
3314  __Pyx_RefNannyFinishContext();
3315  return NULL;
3316  __pyx_L4_argument_unpacking_done:;
3317  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 811, __pyx_L1_error)
3318  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 812, __pyx_L1_error)
3319  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dH), __pyx_ptype_5numpy_ndarray, 1, "dH", 0))) __PYX_ERR(0, 813, __pyx_L1_error)
3320  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 814, __pyx_L1_error)
3321  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 815, __pyx_L1_error)
3322  __pyx_r = __pyx_pf_13csubgridError_12calculateSubgridError_HJ_tau(__pyx_self, __pyx_v_stabilization, __pyx_v_elementDiameter, __pyx_v_dmt, __pyx_v_dH, __pyx_v_cfl, __pyx_v_tau);
3323 
3324  /* function exit code */
3325  goto __pyx_L0;
3326  __pyx_L1_error:;
3327  __pyx_r = NULL;
3328  __pyx_L0:;
3329  __Pyx_RefNannyFinishContext();
3330  return __pyx_r;
3331 }
3332 
3333 static PyObject *__pyx_pf_13csubgridError_12calculateSubgridError_HJ_tau(CYTHON_UNUSED PyObject *__pyx_self, char __pyx_v_stabilization, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau) {
3334  PyObject *__pyx_r = NULL;
3335  __Pyx_RefNannyDeclarations
3336  __Pyx_RefNannySetupContext("calculateSubgridError_HJ_tau", 0);
3337 
3338  /* "csubgridError.pyx":816
3339  * np.ndarray cfl,
3340  * np.ndarray tau):
3341  * ccalculateSubgridError_A_tau(dH.shape[0], # <<<<<<<<<<<<<<
3342  * dH.shape[1],
3343  * dH.shape[2],
3344  */
3345  calculateSubgridError_A_tau((__pyx_v_dH->dimensions[0]), (__pyx_v_dH->dimensions[1]), (__pyx_v_dH->dimensions[2]), __pyx_v_stabilization, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_dH->data), ((double *)__pyx_v_cfl->data), ((double *)__pyx_v_tau->data));
3346 
3347  /* "csubgridError.pyx":810
3348  * <double*> cfl.data,
3349  * <double*> tau.data)
3350  * def calculateSubgridError_HJ_tau(char stabilization, # <<<<<<<<<<<<<<
3351  * np.ndarray elementDiameter,
3352  * np.ndarray dmt,
3353  */
3354 
3355  /* function exit code */
3356  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3357  __Pyx_XGIVEREF(__pyx_r);
3358  __Pyx_RefNannyFinishContext();
3359  return __pyx_r;
3360 }
3361 
3362 /* "csubgridError.pyx":826
3363  * <double*> tau.data)
3364  *
3365  * def calculateSubgridErrorStokes2D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
3366  * np.ndarray a,
3367  * np.ndarray pdeResidualU,
3368  */
3369 
3370 /* Python wrapper */
3371 static PyObject *__pyx_pw_13csubgridError_15calculateSubgridErrorStokes2D_GLS_velocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3372 static PyMethodDef __pyx_mdef_13csubgridError_15calculateSubgridErrorStokes2D_GLS_velocity = {"calculateSubgridErrorStokes2D_GLS_velocity", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_15calculateSubgridErrorStokes2D_GLS_velocity, METH_VARARGS|METH_KEYWORDS, 0};
3373 static PyObject *__pyx_pw_13csubgridError_15calculateSubgridErrorStokes2D_GLS_velocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3374  PyArrayObject *__pyx_v_elementDiameter = 0;
3375  PyArrayObject *__pyx_v_a = 0;
3376  PyArrayObject *__pyx_v_pdeResidualU = 0;
3377  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
3378  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
3379  PyArrayObject *__pyx_v_pdeResidualV = 0;
3380  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
3381  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
3382  PyArrayObject *__pyx_v_subgridErrorU = 0;
3383  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
3384  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
3385  PyArrayObject *__pyx_v_subgridErrorV = 0;
3386  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
3387  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
3388  int __pyx_lineno = 0;
3389  const char *__pyx_filename = NULL;
3390  int __pyx_clineno = 0;
3391  PyObject *__pyx_r = 0;
3392  __Pyx_RefNannyDeclarations
3393  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity (wrapper)", 0);
3394  {
3395  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,0};
3396  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3397  if (unlikely(__pyx_kwds)) {
3398  Py_ssize_t kw_args;
3399  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3400  switch (pos_args) {
3401  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3402  CYTHON_FALLTHROUGH;
3403  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3404  CYTHON_FALLTHROUGH;
3405  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3406  CYTHON_FALLTHROUGH;
3407  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3408  CYTHON_FALLTHROUGH;
3409  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3410  CYTHON_FALLTHROUGH;
3411  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3412  CYTHON_FALLTHROUGH;
3413  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3414  CYTHON_FALLTHROUGH;
3415  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3416  CYTHON_FALLTHROUGH;
3417  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3418  CYTHON_FALLTHROUGH;
3419  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3420  CYTHON_FALLTHROUGH;
3421  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3422  CYTHON_FALLTHROUGH;
3423  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3424  CYTHON_FALLTHROUGH;
3425  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3426  CYTHON_FALLTHROUGH;
3427  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3428  CYTHON_FALLTHROUGH;
3429  case 0: break;
3430  default: goto __pyx_L5_argtuple_error;
3431  }
3432  kw_args = PyDict_Size(__pyx_kwds);
3433  switch (pos_args) {
3434  case 0:
3435  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
3436  else goto __pyx_L5_argtuple_error;
3437  CYTHON_FALLTHROUGH;
3438  case 1:
3439  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
3440  else {
3441  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 1); __PYX_ERR(0, 826, __pyx_L3_error)
3442  }
3443  CYTHON_FALLTHROUGH;
3444  case 2:
3445  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
3446  else {
3447  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 2); __PYX_ERR(0, 826, __pyx_L3_error)
3448  }
3449  CYTHON_FALLTHROUGH;
3450  case 3:
3451  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
3452  else {
3453  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 3); __PYX_ERR(0, 826, __pyx_L3_error)
3454  }
3455  CYTHON_FALLTHROUGH;
3456  case 4:
3457  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
3458  else {
3459  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 4); __PYX_ERR(0, 826, __pyx_L3_error)
3460  }
3461  CYTHON_FALLTHROUGH;
3462  case 5:
3463  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
3464  else {
3465  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 5); __PYX_ERR(0, 826, __pyx_L3_error)
3466  }
3467  CYTHON_FALLTHROUGH;
3468  case 6:
3469  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
3470  else {
3471  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 6); __PYX_ERR(0, 826, __pyx_L3_error)
3472  }
3473  CYTHON_FALLTHROUGH;
3474  case 7:
3475  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
3476  else {
3477  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 7); __PYX_ERR(0, 826, __pyx_L3_error)
3478  }
3479  CYTHON_FALLTHROUGH;
3480  case 8:
3481  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
3482  else {
3483  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 8); __PYX_ERR(0, 826, __pyx_L3_error)
3484  }
3485  CYTHON_FALLTHROUGH;
3486  case 9:
3487  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
3488  else {
3489  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 9); __PYX_ERR(0, 826, __pyx_L3_error)
3490  }
3491  CYTHON_FALLTHROUGH;
3492  case 10:
3493  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
3494  else {
3495  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 10); __PYX_ERR(0, 826, __pyx_L3_error)
3496  }
3497  CYTHON_FALLTHROUGH;
3498  case 11:
3499  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
3500  else {
3501  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 11); __PYX_ERR(0, 826, __pyx_L3_error)
3502  }
3503  CYTHON_FALLTHROUGH;
3504  case 12:
3505  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
3506  else {
3507  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 12); __PYX_ERR(0, 826, __pyx_L3_error)
3508  }
3509  CYTHON_FALLTHROUGH;
3510  case 13:
3511  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
3512  else {
3513  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, 13); __PYX_ERR(0, 826, __pyx_L3_error)
3514  }
3515  }
3516  if (unlikely(kw_args > 0)) {
3517  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes2D_GLS_velocity") < 0)) __PYX_ERR(0, 826, __pyx_L3_error)
3518  }
3519  } else if (PyTuple_GET_SIZE(__pyx_args) != 14) {
3520  goto __pyx_L5_argtuple_error;
3521  } else {
3522  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3523  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3524  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3525  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3526  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3527  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3528  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3529  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3530  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3531  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3532  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3533  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3534  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3535  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3536  }
3537  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
3538  __pyx_v_a = ((PyArrayObject *)values[1]);
3539  __pyx_v_pdeResidualU = ((PyArrayObject *)values[2]);
3540  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[3]);
3541  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[4]);
3542  __pyx_v_pdeResidualV = ((PyArrayObject *)values[5]);
3543  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[6]);
3544  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[7]);
3545  __pyx_v_subgridErrorU = ((PyArrayObject *)values[8]);
3546  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[9]);
3547  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[10]);
3548  __pyx_v_subgridErrorV = ((PyArrayObject *)values[11]);
3549  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[12]);
3550  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[13]);
3551  }
3552  goto __pyx_L4_argument_unpacking_done;
3553  __pyx_L5_argtuple_error:;
3554  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 826, __pyx_L3_error)
3555  __pyx_L3_error:;
3556  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes2D_GLS_velocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
3557  __Pyx_RefNannyFinishContext();
3558  return NULL;
3559  __pyx_L4_argument_unpacking_done:;
3560  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 826, __pyx_L1_error)
3561  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 827, __pyx_L1_error)
3562  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 828, __pyx_L1_error)
3563  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 829, __pyx_L1_error)
3564  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 830, __pyx_L1_error)
3565  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 831, __pyx_L1_error)
3566  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 832, __pyx_L1_error)
3567  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 833, __pyx_L1_error)
3568  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 834, __pyx_L1_error)
3569  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 835, __pyx_L1_error)
3570  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 836, __pyx_L1_error)
3571  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 837, __pyx_L1_error)
3572  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 838, __pyx_L1_error)
3573  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 839, __pyx_L1_error)
3574  __pyx_r = __pyx_pf_13csubgridError_14calculateSubgridErrorStokes2D_GLS_velocity(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv);
3575 
3576  /* function exit code */
3577  goto __pyx_L0;
3578  __pyx_L1_error:;
3579  __pyx_r = NULL;
3580  __pyx_L0:;
3581  __Pyx_RefNannyFinishContext();
3582  return __pyx_r;
3583 }
3584 
3585 static PyObject *__pyx_pf_13csubgridError_14calculateSubgridErrorStokes2D_GLS_velocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
3586  PyObject *__pyx_r = NULL;
3587  __Pyx_RefNannyDeclarations
3588  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity", 0);
3589 
3590  /* "csubgridError.pyx":840
3591  * np.ndarray dsubgridErrorV_dp,
3592  * np.ndarray dsubgridErrorV_dv):
3593  * ccalculateSubgridErrorStokes2D_GLS_velocity(dsubgridErrorU_du.shape[0], # <<<<<<<<<<<<<<
3594  * dsubgridErrorU_du.shape[1],
3595  * dsubgridErrorU_du.shape[2],
3596  */
3597  calculateSubgridErrorStokes2D_GLS_velocity((__pyx_v_dsubgridErrorU_du->dimensions[0]), (__pyx_v_dsubgridErrorU_du->dimensions[1]), (__pyx_v_dsubgridErrorU_du->dimensions[2]), 2, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
3598 
3599  /* "csubgridError.pyx":826
3600  * <double*> tau.data)
3601  *
3602  * def calculateSubgridErrorStokes2D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
3603  * np.ndarray a,
3604  * np.ndarray pdeResidualU,
3605  */
3606 
3607  /* function exit code */
3608  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3609  __Pyx_XGIVEREF(__pyx_r);
3610  __Pyx_RefNannyFinishContext();
3611  return __pyx_r;
3612 }
3613 
3614 /* "csubgridError.pyx":858
3615  * <double*> dsubgridErrorV_dp.data,
3616  * <double*> dsubgridErrorV_dv.data)
3617  * def calculateSubgridErrorStokes2D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
3618  * np.ndarray a,
3619  * np.ndarray pdeResidualU,
3620  */
3621 
3622 /* Python wrapper */
3623 static PyObject *__pyx_pw_13csubgridError_17calculateSubgridErrorStokes2D_GLS_velocity_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3624 static PyMethodDef __pyx_mdef_13csubgridError_17calculateSubgridErrorStokes2D_GLS_velocity_sd = {"calculateSubgridErrorStokes2D_GLS_velocity_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_17calculateSubgridErrorStokes2D_GLS_velocity_sd, METH_VARARGS|METH_KEYWORDS, 0};
3625 static PyObject *__pyx_pw_13csubgridError_17calculateSubgridErrorStokes2D_GLS_velocity_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3626  PyArrayObject *__pyx_v_elementDiameter = 0;
3627  PyArrayObject *__pyx_v_a = 0;
3628  PyArrayObject *__pyx_v_pdeResidualU = 0;
3629  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
3630  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
3631  PyArrayObject *__pyx_v_pdeResidualV = 0;
3632  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
3633  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
3634  PyArrayObject *__pyx_v_subgridErrorU = 0;
3635  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
3636  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
3637  PyArrayObject *__pyx_v_subgridErrorV = 0;
3638  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
3639  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
3640  int __pyx_lineno = 0;
3641  const char *__pyx_filename = NULL;
3642  int __pyx_clineno = 0;
3643  PyObject *__pyx_r = 0;
3644  __Pyx_RefNannyDeclarations
3645  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity_sd (wrapper)", 0);
3646  {
3647  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,0};
3648  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3649  if (unlikely(__pyx_kwds)) {
3650  Py_ssize_t kw_args;
3651  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3652  switch (pos_args) {
3653  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3654  CYTHON_FALLTHROUGH;
3655  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3656  CYTHON_FALLTHROUGH;
3657  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3658  CYTHON_FALLTHROUGH;
3659  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3660  CYTHON_FALLTHROUGH;
3661  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3662  CYTHON_FALLTHROUGH;
3663  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3664  CYTHON_FALLTHROUGH;
3665  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3666  CYTHON_FALLTHROUGH;
3667  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3668  CYTHON_FALLTHROUGH;
3669  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3670  CYTHON_FALLTHROUGH;
3671  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3672  CYTHON_FALLTHROUGH;
3673  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3674  CYTHON_FALLTHROUGH;
3675  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3676  CYTHON_FALLTHROUGH;
3677  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3678  CYTHON_FALLTHROUGH;
3679  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3680  CYTHON_FALLTHROUGH;
3681  case 0: break;
3682  default: goto __pyx_L5_argtuple_error;
3683  }
3684  kw_args = PyDict_Size(__pyx_kwds);
3685  switch (pos_args) {
3686  case 0:
3687  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
3688  else goto __pyx_L5_argtuple_error;
3689  CYTHON_FALLTHROUGH;
3690  case 1:
3691  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
3692  else {
3693  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 1); __PYX_ERR(0, 858, __pyx_L3_error)
3694  }
3695  CYTHON_FALLTHROUGH;
3696  case 2:
3697  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
3698  else {
3699  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 2); __PYX_ERR(0, 858, __pyx_L3_error)
3700  }
3701  CYTHON_FALLTHROUGH;
3702  case 3:
3703  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
3704  else {
3705  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 3); __PYX_ERR(0, 858, __pyx_L3_error)
3706  }
3707  CYTHON_FALLTHROUGH;
3708  case 4:
3709  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
3710  else {
3711  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 4); __PYX_ERR(0, 858, __pyx_L3_error)
3712  }
3713  CYTHON_FALLTHROUGH;
3714  case 5:
3715  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
3716  else {
3717  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 5); __PYX_ERR(0, 858, __pyx_L3_error)
3718  }
3719  CYTHON_FALLTHROUGH;
3720  case 6:
3721  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
3722  else {
3723  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 6); __PYX_ERR(0, 858, __pyx_L3_error)
3724  }
3725  CYTHON_FALLTHROUGH;
3726  case 7:
3727  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
3728  else {
3729  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 7); __PYX_ERR(0, 858, __pyx_L3_error)
3730  }
3731  CYTHON_FALLTHROUGH;
3732  case 8:
3733  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
3734  else {
3735  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 8); __PYX_ERR(0, 858, __pyx_L3_error)
3736  }
3737  CYTHON_FALLTHROUGH;
3738  case 9:
3739  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
3740  else {
3741  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 9); __PYX_ERR(0, 858, __pyx_L3_error)
3742  }
3743  CYTHON_FALLTHROUGH;
3744  case 10:
3745  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
3746  else {
3747  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 10); __PYX_ERR(0, 858, __pyx_L3_error)
3748  }
3749  CYTHON_FALLTHROUGH;
3750  case 11:
3751  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
3752  else {
3753  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 11); __PYX_ERR(0, 858, __pyx_L3_error)
3754  }
3755  CYTHON_FALLTHROUGH;
3756  case 12:
3757  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
3758  else {
3759  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 12); __PYX_ERR(0, 858, __pyx_L3_error)
3760  }
3761  CYTHON_FALLTHROUGH;
3762  case 13:
3763  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
3764  else {
3765  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, 13); __PYX_ERR(0, 858, __pyx_L3_error)
3766  }
3767  }
3768  if (unlikely(kw_args > 0)) {
3769  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes2D_GLS_velocity_sd") < 0)) __PYX_ERR(0, 858, __pyx_L3_error)
3770  }
3771  } else if (PyTuple_GET_SIZE(__pyx_args) != 14) {
3772  goto __pyx_L5_argtuple_error;
3773  } else {
3774  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3775  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3776  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3777  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3778  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3779  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3780  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3781  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3782  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3783  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3784  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3785  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3786  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3787  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3788  }
3789  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
3790  __pyx_v_a = ((PyArrayObject *)values[1]);
3791  __pyx_v_pdeResidualU = ((PyArrayObject *)values[2]);
3792  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[3]);
3793  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[4]);
3794  __pyx_v_pdeResidualV = ((PyArrayObject *)values[5]);
3795  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[6]);
3796  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[7]);
3797  __pyx_v_subgridErrorU = ((PyArrayObject *)values[8]);
3798  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[9]);
3799  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[10]);
3800  __pyx_v_subgridErrorV = ((PyArrayObject *)values[11]);
3801  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[12]);
3802  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[13]);
3803  }
3804  goto __pyx_L4_argument_unpacking_done;
3805  __pyx_L5_argtuple_error:;
3806  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_sd", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error)
3807  __pyx_L3_error:;
3808  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes2D_GLS_velocity_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
3809  __Pyx_RefNannyFinishContext();
3810  return NULL;
3811  __pyx_L4_argument_unpacking_done:;
3812  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 858, __pyx_L1_error)
3813  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 859, __pyx_L1_error)
3814  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 860, __pyx_L1_error)
3815  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 861, __pyx_L1_error)
3816  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 862, __pyx_L1_error)
3817  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 863, __pyx_L1_error)
3818  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 864, __pyx_L1_error)
3819  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 865, __pyx_L1_error)
3820  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
3821  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 867, __pyx_L1_error)
3822  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 868, __pyx_L1_error)
3823  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 869, __pyx_L1_error)
3824  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 870, __pyx_L1_error)
3825  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 871, __pyx_L1_error)
3826  __pyx_r = __pyx_pf_13csubgridError_16calculateSubgridErrorStokes2D_GLS_velocity_sd(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv);
3827 
3828  /* function exit code */
3829  goto __pyx_L0;
3830  __pyx_L1_error:;
3831  __pyx_r = NULL;
3832  __pyx_L0:;
3833  __Pyx_RefNannyFinishContext();
3834  return __pyx_r;
3835 }
3836 
3837 static PyObject *__pyx_pf_13csubgridError_16calculateSubgridErrorStokes2D_GLS_velocity_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
3838  PyObject *__pyx_r = NULL;
3839  __Pyx_RefNannyDeclarations
3840  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity_sd", 0);
3841 
3842  /* "csubgridError.pyx":872
3843  * np.ndarray dsubgridErrorV_dp,
3844  * np.ndarray dsubgridErrorV_dv):
3845  * ccalculateSubgridErrorStokes2D_GLS_velocity_sd(dsubgridErrorU_du.shape[0], # <<<<<<<<<<<<<<
3846  * dsubgridErrorU_du.shape[1],
3847  * dsubgridErrorU_du.shape[2],
3848  */
3849  calculateSubgridErrorStokes2D_GLS_velocity_sd((__pyx_v_dsubgridErrorU_du->dimensions[0]), (__pyx_v_dsubgridErrorU_du->dimensions[1]), (__pyx_v_dsubgridErrorU_du->dimensions[2]), 2, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
3850 
3851  /* "csubgridError.pyx":858
3852  * <double*> dsubgridErrorV_dp.data,
3853  * <double*> dsubgridErrorV_dv.data)
3854  * def calculateSubgridErrorStokes2D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
3855  * np.ndarray a,
3856  * np.ndarray pdeResidualU,
3857  */
3858 
3859  /* function exit code */
3860  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3861  __Pyx_XGIVEREF(__pyx_r);
3862  __Pyx_RefNannyFinishContext();
3863  return __pyx_r;
3864 }
3865 
3866 /* "csubgridError.pyx":890
3867  * <double*> dsubgridErrorV_dp.data,
3868  * <double*> dsubgridErrorV_dv.data)
3869  * def calculateSubgridErrorStokes3D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
3870  * np.ndarray a,
3871  * np.ndarray pdeResidualU,
3872  */
3873 
3874 /* Python wrapper */
3875 static PyObject *__pyx_pw_13csubgridError_19calculateSubgridErrorStokes3D_GLS_velocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3876 static PyMethodDef __pyx_mdef_13csubgridError_19calculateSubgridErrorStokes3D_GLS_velocity = {"calculateSubgridErrorStokes3D_GLS_velocity", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_19calculateSubgridErrorStokes3D_GLS_velocity, METH_VARARGS|METH_KEYWORDS, 0};
3877 static PyObject *__pyx_pw_13csubgridError_19calculateSubgridErrorStokes3D_GLS_velocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3878  PyArrayObject *__pyx_v_elementDiameter = 0;
3879  PyArrayObject *__pyx_v_a = 0;
3880  PyArrayObject *__pyx_v_pdeResidualU = 0;
3881  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
3882  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
3883  PyArrayObject *__pyx_v_pdeResidualV = 0;
3884  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
3885  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
3886  PyArrayObject *__pyx_v_pdeResidualW = 0;
3887  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
3888  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
3889  PyArrayObject *__pyx_v_subgridErrorU = 0;
3890  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
3891  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
3892  PyArrayObject *__pyx_v_subgridErrorV = 0;
3893  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
3894  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
3895  PyArrayObject *__pyx_v_subgridErrorW = 0;
3896  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
3897  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
3898  int __pyx_lineno = 0;
3899  const char *__pyx_filename = NULL;
3900  int __pyx_clineno = 0;
3901  PyObject *__pyx_r = 0;
3902  __Pyx_RefNannyDeclarations
3903  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity (wrapper)", 0);
3904  {
3905  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_dw,0};
3906  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3907  if (unlikely(__pyx_kwds)) {
3908  Py_ssize_t kw_args;
3909  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3910  switch (pos_args) {
3911  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3912  CYTHON_FALLTHROUGH;
3913  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3914  CYTHON_FALLTHROUGH;
3915  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3916  CYTHON_FALLTHROUGH;
3917  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3918  CYTHON_FALLTHROUGH;
3919  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3920  CYTHON_FALLTHROUGH;
3921  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3922  CYTHON_FALLTHROUGH;
3923  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3924  CYTHON_FALLTHROUGH;
3925  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3926  CYTHON_FALLTHROUGH;
3927  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3928  CYTHON_FALLTHROUGH;
3929  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3930  CYTHON_FALLTHROUGH;
3931  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3932  CYTHON_FALLTHROUGH;
3933  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3934  CYTHON_FALLTHROUGH;
3935  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3936  CYTHON_FALLTHROUGH;
3937  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3938  CYTHON_FALLTHROUGH;
3939  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3940  CYTHON_FALLTHROUGH;
3941  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3942  CYTHON_FALLTHROUGH;
3943  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3944  CYTHON_FALLTHROUGH;
3945  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3946  CYTHON_FALLTHROUGH;
3947  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3948  CYTHON_FALLTHROUGH;
3949  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3950  CYTHON_FALLTHROUGH;
3951  case 0: break;
3952  default: goto __pyx_L5_argtuple_error;
3953  }
3954  kw_args = PyDict_Size(__pyx_kwds);
3955  switch (pos_args) {
3956  case 0:
3957  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
3958  else goto __pyx_L5_argtuple_error;
3959  CYTHON_FALLTHROUGH;
3960  case 1:
3961  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
3962  else {
3963  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 1); __PYX_ERR(0, 890, __pyx_L3_error)
3964  }
3965  CYTHON_FALLTHROUGH;
3966  case 2:
3967  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
3968  else {
3969  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 2); __PYX_ERR(0, 890, __pyx_L3_error)
3970  }
3971  CYTHON_FALLTHROUGH;
3972  case 3:
3973  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
3974  else {
3975  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 3); __PYX_ERR(0, 890, __pyx_L3_error)
3976  }
3977  CYTHON_FALLTHROUGH;
3978  case 4:
3979  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
3980  else {
3981  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 4); __PYX_ERR(0, 890, __pyx_L3_error)
3982  }
3983  CYTHON_FALLTHROUGH;
3984  case 5:
3985  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
3986  else {
3987  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 5); __PYX_ERR(0, 890, __pyx_L3_error)
3988  }
3989  CYTHON_FALLTHROUGH;
3990  case 6:
3991  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
3992  else {
3993  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 6); __PYX_ERR(0, 890, __pyx_L3_error)
3994  }
3995  CYTHON_FALLTHROUGH;
3996  case 7:
3997  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
3998  else {
3999  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 7); __PYX_ERR(0, 890, __pyx_L3_error)
4000  }
4001  CYTHON_FALLTHROUGH;
4002  case 8:
4003  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
4004  else {
4005  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 8); __PYX_ERR(0, 890, __pyx_L3_error)
4006  }
4007  CYTHON_FALLTHROUGH;
4008  case 9:
4009  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
4010  else {
4011  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 9); __PYX_ERR(0, 890, __pyx_L3_error)
4012  }
4013  CYTHON_FALLTHROUGH;
4014  case 10:
4015  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
4016  else {
4017  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 10); __PYX_ERR(0, 890, __pyx_L3_error)
4018  }
4019  CYTHON_FALLTHROUGH;
4020  case 11:
4021  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
4022  else {
4023  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 11); __PYX_ERR(0, 890, __pyx_L3_error)
4024  }
4025  CYTHON_FALLTHROUGH;
4026  case 12:
4027  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
4028  else {
4029  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 12); __PYX_ERR(0, 890, __pyx_L3_error)
4030  }
4031  CYTHON_FALLTHROUGH;
4032  case 13:
4033  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
4034  else {
4035  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 13); __PYX_ERR(0, 890, __pyx_L3_error)
4036  }
4037  CYTHON_FALLTHROUGH;
4038  case 14:
4039  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
4040  else {
4041  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 14); __PYX_ERR(0, 890, __pyx_L3_error)
4042  }
4043  CYTHON_FALLTHROUGH;
4044  case 15:
4045  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
4046  else {
4047  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 15); __PYX_ERR(0, 890, __pyx_L3_error)
4048  }
4049  CYTHON_FALLTHROUGH;
4050  case 16:
4051  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
4052  else {
4053  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 16); __PYX_ERR(0, 890, __pyx_L3_error)
4054  }
4055  CYTHON_FALLTHROUGH;
4056  case 17:
4057  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
4058  else {
4059  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 17); __PYX_ERR(0, 890, __pyx_L3_error)
4060  }
4061  CYTHON_FALLTHROUGH;
4062  case 18:
4063  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
4064  else {
4065  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 18); __PYX_ERR(0, 890, __pyx_L3_error)
4066  }
4067  CYTHON_FALLTHROUGH;
4068  case 19:
4069  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
4070  else {
4071  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, 19); __PYX_ERR(0, 890, __pyx_L3_error)
4072  }
4073  }
4074  if (unlikely(kw_args > 0)) {
4075  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes3D_GLS_velocity") < 0)) __PYX_ERR(0, 890, __pyx_L3_error)
4076  }
4077  } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
4078  goto __pyx_L5_argtuple_error;
4079  } else {
4080  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4081  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4082  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4083  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4084  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4085  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4086  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4087  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4088  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4089  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4090  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4091  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4092  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4093  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4094  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4095  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4096  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4097  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4098  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4099  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4100  }
4101  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
4102  __pyx_v_a = ((PyArrayObject *)values[1]);
4103  __pyx_v_pdeResidualU = ((PyArrayObject *)values[2]);
4104  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[3]);
4105  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[4]);
4106  __pyx_v_pdeResidualV = ((PyArrayObject *)values[5]);
4107  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[6]);
4108  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[7]);
4109  __pyx_v_pdeResidualW = ((PyArrayObject *)values[8]);
4110  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[9]);
4111  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[10]);
4112  __pyx_v_subgridErrorU = ((PyArrayObject *)values[11]);
4113  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[12]);
4114  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[13]);
4115  __pyx_v_subgridErrorV = ((PyArrayObject *)values[14]);
4116  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[15]);
4117  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[16]);
4118  __pyx_v_subgridErrorW = ((PyArrayObject *)values[17]);
4119  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[18]);
4120  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[19]);
4121  }
4122  goto __pyx_L4_argument_unpacking_done;
4123  __pyx_L5_argtuple_error:;
4124  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 890, __pyx_L3_error)
4125  __pyx_L3_error:;
4126  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes3D_GLS_velocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
4127  __Pyx_RefNannyFinishContext();
4128  return NULL;
4129  __pyx_L4_argument_unpacking_done:;
4130  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
4131  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
4132  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 892, __pyx_L1_error)
4133  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 893, __pyx_L1_error)
4134  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 894, __pyx_L1_error)
4135  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 895, __pyx_L1_error)
4136  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 896, __pyx_L1_error)
4137  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 897, __pyx_L1_error)
4138  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 898, __pyx_L1_error)
4139  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 899, __pyx_L1_error)
4140  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 900, __pyx_L1_error)
4141  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 901, __pyx_L1_error)
4142  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 902, __pyx_L1_error)
4143  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 903, __pyx_L1_error)
4144  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 904, __pyx_L1_error)
4145  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 905, __pyx_L1_error)
4146  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 906, __pyx_L1_error)
4147  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 907, __pyx_L1_error)
4148  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 908, __pyx_L1_error)
4149  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 909, __pyx_L1_error)
4150  __pyx_r = __pyx_pf_13csubgridError_18calculateSubgridErrorStokes3D_GLS_velocity(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_dw);
4151 
4152  /* function exit code */
4153  goto __pyx_L0;
4154  __pyx_L1_error:;
4155  __pyx_r = NULL;
4156  __pyx_L0:;
4157  __Pyx_RefNannyFinishContext();
4158  return __pyx_r;
4159 }
4160 
4161 static PyObject *__pyx_pf_13csubgridError_18calculateSubgridErrorStokes3D_GLS_velocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
4162  PyObject *__pyx_r = NULL;
4163  __Pyx_RefNannyDeclarations
4164  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity", 0);
4165 
4166  /* "csubgridError.pyx":910
4167  * np.ndarray dsubgridErrorW_dp,
4168  * np.ndarray dsubgridErrorW_dw):
4169  * ccalculateSubgridErrorStokes3D_GLS_velocity(dsubgridErrorU_du.shape[0], # <<<<<<<<<<<<<<
4170  * dsubgridErrorU_du.shape[1],
4171  * dsubgridErrorU_du.shape[2],
4172  */
4173  calculateSubgridErrorStokes3D_GLS_velocity((__pyx_v_dsubgridErrorU_du->dimensions[0]), (__pyx_v_dsubgridErrorU_du->dimensions[1]), (__pyx_v_dsubgridErrorU_du->dimensions[2]), 3, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
4174 
4175  /* "csubgridError.pyx":890
4176  * <double*> dsubgridErrorV_dp.data,
4177  * <double*> dsubgridErrorV_dv.data)
4178  * def calculateSubgridErrorStokes3D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
4179  * np.ndarray a,
4180  * np.ndarray pdeResidualU,
4181  */
4182 
4183  /* function exit code */
4184  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4185  __Pyx_XGIVEREF(__pyx_r);
4186  __Pyx_RefNannyFinishContext();
4187  return __pyx_r;
4188 }
4189 
4190 /* "csubgridError.pyx":934
4191  * <double*> dsubgridErrorW_dp.data,
4192  * <double*> dsubgridErrorW_dw.data)
4193  * def calculateSubgridErrorStokes3D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
4194  * np.ndarray a,
4195  * np.ndarray pdeResidualU,
4196  */
4197 
4198 /* Python wrapper */
4199 static PyObject *__pyx_pw_13csubgridError_21calculateSubgridErrorStokes3D_GLS_velocity_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4200 static PyMethodDef __pyx_mdef_13csubgridError_21calculateSubgridErrorStokes3D_GLS_velocity_sd = {"calculateSubgridErrorStokes3D_GLS_velocity_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_21calculateSubgridErrorStokes3D_GLS_velocity_sd, METH_VARARGS|METH_KEYWORDS, 0};
4201 static PyObject *__pyx_pw_13csubgridError_21calculateSubgridErrorStokes3D_GLS_velocity_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4202  PyArrayObject *__pyx_v_elementDiameter = 0;
4203  PyArrayObject *__pyx_v_a = 0;
4204  PyArrayObject *__pyx_v_pdeResidualU = 0;
4205  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
4206  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
4207  PyArrayObject *__pyx_v_pdeResidualV = 0;
4208  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
4209  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
4210  PyArrayObject *__pyx_v_pdeResidualW = 0;
4211  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
4212  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
4213  PyArrayObject *__pyx_v_subgridErrorU = 0;
4214  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
4215  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
4216  PyArrayObject *__pyx_v_subgridErrorV = 0;
4217  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
4218  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
4219  PyArrayObject *__pyx_v_subgridErrorW = 0;
4220  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
4221  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
4222  int __pyx_lineno = 0;
4223  const char *__pyx_filename = NULL;
4224  int __pyx_clineno = 0;
4225  PyObject *__pyx_r = 0;
4226  __Pyx_RefNannyDeclarations
4227  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity_sd (wrapper)", 0);
4228  {
4229  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_dw,0};
4230  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4231  if (unlikely(__pyx_kwds)) {
4232  Py_ssize_t kw_args;
4233  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4234  switch (pos_args) {
4235  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4236  CYTHON_FALLTHROUGH;
4237  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4238  CYTHON_FALLTHROUGH;
4239  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4240  CYTHON_FALLTHROUGH;
4241  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4242  CYTHON_FALLTHROUGH;
4243  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4244  CYTHON_FALLTHROUGH;
4245  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4246  CYTHON_FALLTHROUGH;
4247  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4248  CYTHON_FALLTHROUGH;
4249  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4250  CYTHON_FALLTHROUGH;
4251  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4252  CYTHON_FALLTHROUGH;
4253  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4254  CYTHON_FALLTHROUGH;
4255  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4256  CYTHON_FALLTHROUGH;
4257  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4258  CYTHON_FALLTHROUGH;
4259  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4260  CYTHON_FALLTHROUGH;
4261  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4262  CYTHON_FALLTHROUGH;
4263  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4264  CYTHON_FALLTHROUGH;
4265  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4266  CYTHON_FALLTHROUGH;
4267  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4268  CYTHON_FALLTHROUGH;
4269  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4270  CYTHON_FALLTHROUGH;
4271  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4272  CYTHON_FALLTHROUGH;
4273  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4274  CYTHON_FALLTHROUGH;
4275  case 0: break;
4276  default: goto __pyx_L5_argtuple_error;
4277  }
4278  kw_args = PyDict_Size(__pyx_kwds);
4279  switch (pos_args) {
4280  case 0:
4281  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
4282  else goto __pyx_L5_argtuple_error;
4283  CYTHON_FALLTHROUGH;
4284  case 1:
4285  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
4286  else {
4287  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 1); __PYX_ERR(0, 934, __pyx_L3_error)
4288  }
4289  CYTHON_FALLTHROUGH;
4290  case 2:
4291  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
4292  else {
4293  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 2); __PYX_ERR(0, 934, __pyx_L3_error)
4294  }
4295  CYTHON_FALLTHROUGH;
4296  case 3:
4297  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
4298  else {
4299  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 3); __PYX_ERR(0, 934, __pyx_L3_error)
4300  }
4301  CYTHON_FALLTHROUGH;
4302  case 4:
4303  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
4304  else {
4305  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 4); __PYX_ERR(0, 934, __pyx_L3_error)
4306  }
4307  CYTHON_FALLTHROUGH;
4308  case 5:
4309  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
4310  else {
4311  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 5); __PYX_ERR(0, 934, __pyx_L3_error)
4312  }
4313  CYTHON_FALLTHROUGH;
4314  case 6:
4315  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
4316  else {
4317  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 6); __PYX_ERR(0, 934, __pyx_L3_error)
4318  }
4319  CYTHON_FALLTHROUGH;
4320  case 7:
4321  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
4322  else {
4323  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 7); __PYX_ERR(0, 934, __pyx_L3_error)
4324  }
4325  CYTHON_FALLTHROUGH;
4326  case 8:
4327  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
4328  else {
4329  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 8); __PYX_ERR(0, 934, __pyx_L3_error)
4330  }
4331  CYTHON_FALLTHROUGH;
4332  case 9:
4333  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
4334  else {
4335  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 9); __PYX_ERR(0, 934, __pyx_L3_error)
4336  }
4337  CYTHON_FALLTHROUGH;
4338  case 10:
4339  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
4340  else {
4341  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 10); __PYX_ERR(0, 934, __pyx_L3_error)
4342  }
4343  CYTHON_FALLTHROUGH;
4344  case 11:
4345  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
4346  else {
4347  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 11); __PYX_ERR(0, 934, __pyx_L3_error)
4348  }
4349  CYTHON_FALLTHROUGH;
4350  case 12:
4351  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
4352  else {
4353  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 12); __PYX_ERR(0, 934, __pyx_L3_error)
4354  }
4355  CYTHON_FALLTHROUGH;
4356  case 13:
4357  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
4358  else {
4359  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 13); __PYX_ERR(0, 934, __pyx_L3_error)
4360  }
4361  CYTHON_FALLTHROUGH;
4362  case 14:
4363  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
4364  else {
4365  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 14); __PYX_ERR(0, 934, __pyx_L3_error)
4366  }
4367  CYTHON_FALLTHROUGH;
4368  case 15:
4369  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
4370  else {
4371  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 15); __PYX_ERR(0, 934, __pyx_L3_error)
4372  }
4373  CYTHON_FALLTHROUGH;
4374  case 16:
4375  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
4376  else {
4377  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 16); __PYX_ERR(0, 934, __pyx_L3_error)
4378  }
4379  CYTHON_FALLTHROUGH;
4380  case 17:
4381  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
4382  else {
4383  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 17); __PYX_ERR(0, 934, __pyx_L3_error)
4384  }
4385  CYTHON_FALLTHROUGH;
4386  case 18:
4387  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
4388  else {
4389  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 18); __PYX_ERR(0, 934, __pyx_L3_error)
4390  }
4391  CYTHON_FALLTHROUGH;
4392  case 19:
4393  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
4394  else {
4395  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, 19); __PYX_ERR(0, 934, __pyx_L3_error)
4396  }
4397  }
4398  if (unlikely(kw_args > 0)) {
4399  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes3D_GLS_velocity_sd") < 0)) __PYX_ERR(0, 934, __pyx_L3_error)
4400  }
4401  } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
4402  goto __pyx_L5_argtuple_error;
4403  } else {
4404  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4405  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4406  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4407  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4408  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4409  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4410  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4411  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4412  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4413  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4414  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4415  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4416  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4417  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4418  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4419  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4420  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4421  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4422  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4423  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4424  }
4425  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
4426  __pyx_v_a = ((PyArrayObject *)values[1]);
4427  __pyx_v_pdeResidualU = ((PyArrayObject *)values[2]);
4428  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[3]);
4429  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[4]);
4430  __pyx_v_pdeResidualV = ((PyArrayObject *)values[5]);
4431  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[6]);
4432  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[7]);
4433  __pyx_v_pdeResidualW = ((PyArrayObject *)values[8]);
4434  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[9]);
4435  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[10]);
4436  __pyx_v_subgridErrorU = ((PyArrayObject *)values[11]);
4437  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[12]);
4438  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[13]);
4439  __pyx_v_subgridErrorV = ((PyArrayObject *)values[14]);
4440  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[15]);
4441  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[16]);
4442  __pyx_v_subgridErrorW = ((PyArrayObject *)values[17]);
4443  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[18]);
4444  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[19]);
4445  }
4446  goto __pyx_L4_argument_unpacking_done;
4447  __pyx_L5_argtuple_error:;
4448  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_sd", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 934, __pyx_L3_error)
4449  __pyx_L3_error:;
4450  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes3D_GLS_velocity_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
4451  __Pyx_RefNannyFinishContext();
4452  return NULL;
4453  __pyx_L4_argument_unpacking_done:;
4454  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 934, __pyx_L1_error)
4455  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 935, __pyx_L1_error)
4456  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 936, __pyx_L1_error)
4457  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 937, __pyx_L1_error)
4458  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 938, __pyx_L1_error)
4459  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 939, __pyx_L1_error)
4460  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 940, __pyx_L1_error)
4461  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 941, __pyx_L1_error)
4462  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 942, __pyx_L1_error)
4463  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 943, __pyx_L1_error)
4464  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 944, __pyx_L1_error)
4465  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 945, __pyx_L1_error)
4466  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 946, __pyx_L1_error)
4467  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 947, __pyx_L1_error)
4468  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 948, __pyx_L1_error)
4469  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 949, __pyx_L1_error)
4470  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 950, __pyx_L1_error)
4471  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 951, __pyx_L1_error)
4472  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 952, __pyx_L1_error)
4473  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 953, __pyx_L1_error)
4474  __pyx_r = __pyx_pf_13csubgridError_20calculateSubgridErrorStokes3D_GLS_velocity_sd(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_dw);
4475 
4476  /* function exit code */
4477  goto __pyx_L0;
4478  __pyx_L1_error:;
4479  __pyx_r = NULL;
4480  __pyx_L0:;
4481  __Pyx_RefNannyFinishContext();
4482  return __pyx_r;
4483 }
4484 
4485 static PyObject *__pyx_pf_13csubgridError_20calculateSubgridErrorStokes3D_GLS_velocity_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
4486  PyObject *__pyx_r = NULL;
4487  __Pyx_RefNannyDeclarations
4488  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity_sd", 0);
4489 
4490  /* "csubgridError.pyx":954
4491  * np.ndarray dsubgridErrorW_dp,
4492  * np.ndarray dsubgridErrorW_dw):
4493  * ccalculateSubgridErrorStokes3D_GLS_velocity_sd(dsubgridErrorU_du.shape[0], # <<<<<<<<<<<<<<
4494  * dsubgridErrorU_du.shape[1],
4495  * dsubgridErrorU_du.shape[2],
4496  */
4497  calculateSubgridErrorStokes3D_GLS_velocity_sd((__pyx_v_dsubgridErrorU_du->dimensions[0]), (__pyx_v_dsubgridErrorU_du->dimensions[1]), (__pyx_v_dsubgridErrorU_du->dimensions[2]), 3, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
4498 
4499  /* "csubgridError.pyx":934
4500  * <double*> dsubgridErrorW_dp.data,
4501  * <double*> dsubgridErrorW_dw.data)
4502  * def calculateSubgridErrorStokes3D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
4503  * np.ndarray a,
4504  * np.ndarray pdeResidualU,
4505  */
4506 
4507  /* function exit code */
4508  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4509  __Pyx_XGIVEREF(__pyx_r);
4510  __Pyx_RefNannyFinishContext();
4511  return __pyx_r;
4512 }
4513 
4514 /* "csubgridError.pyx":978
4515  * <double*> dsubgridErrorW_dp.data,
4516  * <double*> dsubgridErrorW_dw.data)
4517  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
4518  * np.ndarray a,
4519  * np.ndarray pdeResidualP,
4520  */
4521 
4522 /* Python wrapper */
4523 static PyObject *__pyx_pw_13csubgridError_23calculateSubgridErrorStokes2D_GLS_velocity_pressure(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4524 static PyMethodDef __pyx_mdef_13csubgridError_23calculateSubgridErrorStokes2D_GLS_velocity_pressure = {"calculateSubgridErrorStokes2D_GLS_velocity_pressure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_23calculateSubgridErrorStokes2D_GLS_velocity_pressure, METH_VARARGS|METH_KEYWORDS, 0};
4525 static PyObject *__pyx_pw_13csubgridError_23calculateSubgridErrorStokes2D_GLS_velocity_pressure(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4526  PyArrayObject *__pyx_v_elementDiameter = 0;
4527  PyArrayObject *__pyx_v_a = 0;
4528  PyArrayObject *__pyx_v_pdeResidualP = 0;
4529  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
4530  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
4531  PyArrayObject *__pyx_v_pdeResidualU = 0;
4532  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
4533  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
4534  PyArrayObject *__pyx_v_pdeResidualV = 0;
4535  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
4536  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
4537  PyArrayObject *__pyx_v_subgridErrorP = 0;
4538  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
4539  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
4540  PyArrayObject *__pyx_v_subgridErrorU = 0;
4541  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
4542  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
4543  PyArrayObject *__pyx_v_subgridErrorV = 0;
4544  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
4545  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
4546  int __pyx_lineno = 0;
4547  const char *__pyx_filename = NULL;
4548  int __pyx_clineno = 0;
4549  PyObject *__pyx_r = 0;
4550  __Pyx_RefNannyDeclarations
4551  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity_pressure (wrapper)", 0);
4552  {
4553  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,0};
4554  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4555  if (unlikely(__pyx_kwds)) {
4556  Py_ssize_t kw_args;
4557  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4558  switch (pos_args) {
4559  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4560  CYTHON_FALLTHROUGH;
4561  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4562  CYTHON_FALLTHROUGH;
4563  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4564  CYTHON_FALLTHROUGH;
4565  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4566  CYTHON_FALLTHROUGH;
4567  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4568  CYTHON_FALLTHROUGH;
4569  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4570  CYTHON_FALLTHROUGH;
4571  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4572  CYTHON_FALLTHROUGH;
4573  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4574  CYTHON_FALLTHROUGH;
4575  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4576  CYTHON_FALLTHROUGH;
4577  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4578  CYTHON_FALLTHROUGH;
4579  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4580  CYTHON_FALLTHROUGH;
4581  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4582  CYTHON_FALLTHROUGH;
4583  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4584  CYTHON_FALLTHROUGH;
4585  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4586  CYTHON_FALLTHROUGH;
4587  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4588  CYTHON_FALLTHROUGH;
4589  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4590  CYTHON_FALLTHROUGH;
4591  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4592  CYTHON_FALLTHROUGH;
4593  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4594  CYTHON_FALLTHROUGH;
4595  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4596  CYTHON_FALLTHROUGH;
4597  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4598  CYTHON_FALLTHROUGH;
4599  case 0: break;
4600  default: goto __pyx_L5_argtuple_error;
4601  }
4602  kw_args = PyDict_Size(__pyx_kwds);
4603  switch (pos_args) {
4604  case 0:
4605  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
4606  else goto __pyx_L5_argtuple_error;
4607  CYTHON_FALLTHROUGH;
4608  case 1:
4609  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
4610  else {
4611  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 1); __PYX_ERR(0, 978, __pyx_L3_error)
4612  }
4613  CYTHON_FALLTHROUGH;
4614  case 2:
4615  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
4616  else {
4617  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 2); __PYX_ERR(0, 978, __pyx_L3_error)
4618  }
4619  CYTHON_FALLTHROUGH;
4620  case 3:
4621  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
4622  else {
4623  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 3); __PYX_ERR(0, 978, __pyx_L3_error)
4624  }
4625  CYTHON_FALLTHROUGH;
4626  case 4:
4627  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
4628  else {
4629  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 4); __PYX_ERR(0, 978, __pyx_L3_error)
4630  }
4631  CYTHON_FALLTHROUGH;
4632  case 5:
4633  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
4634  else {
4635  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 5); __PYX_ERR(0, 978, __pyx_L3_error)
4636  }
4637  CYTHON_FALLTHROUGH;
4638  case 6:
4639  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
4640  else {
4641  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 6); __PYX_ERR(0, 978, __pyx_L3_error)
4642  }
4643  CYTHON_FALLTHROUGH;
4644  case 7:
4645  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
4646  else {
4647  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 7); __PYX_ERR(0, 978, __pyx_L3_error)
4648  }
4649  CYTHON_FALLTHROUGH;
4650  case 8:
4651  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
4652  else {
4653  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 8); __PYX_ERR(0, 978, __pyx_L3_error)
4654  }
4655  CYTHON_FALLTHROUGH;
4656  case 9:
4657  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
4658  else {
4659  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 9); __PYX_ERR(0, 978, __pyx_L3_error)
4660  }
4661  CYTHON_FALLTHROUGH;
4662  case 10:
4663  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
4664  else {
4665  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 10); __PYX_ERR(0, 978, __pyx_L3_error)
4666  }
4667  CYTHON_FALLTHROUGH;
4668  case 11:
4669  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
4670  else {
4671  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 11); __PYX_ERR(0, 978, __pyx_L3_error)
4672  }
4673  CYTHON_FALLTHROUGH;
4674  case 12:
4675  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
4676  else {
4677  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 12); __PYX_ERR(0, 978, __pyx_L3_error)
4678  }
4679  CYTHON_FALLTHROUGH;
4680  case 13:
4681  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
4682  else {
4683  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 13); __PYX_ERR(0, 978, __pyx_L3_error)
4684  }
4685  CYTHON_FALLTHROUGH;
4686  case 14:
4687  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
4688  else {
4689  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 14); __PYX_ERR(0, 978, __pyx_L3_error)
4690  }
4691  CYTHON_FALLTHROUGH;
4692  case 15:
4693  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
4694  else {
4695  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 15); __PYX_ERR(0, 978, __pyx_L3_error)
4696  }
4697  CYTHON_FALLTHROUGH;
4698  case 16:
4699  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
4700  else {
4701  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 16); __PYX_ERR(0, 978, __pyx_L3_error)
4702  }
4703  CYTHON_FALLTHROUGH;
4704  case 17:
4705  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
4706  else {
4707  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 17); __PYX_ERR(0, 978, __pyx_L3_error)
4708  }
4709  CYTHON_FALLTHROUGH;
4710  case 18:
4711  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
4712  else {
4713  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 18); __PYX_ERR(0, 978, __pyx_L3_error)
4714  }
4715  CYTHON_FALLTHROUGH;
4716  case 19:
4717  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
4718  else {
4719  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, 19); __PYX_ERR(0, 978, __pyx_L3_error)
4720  }
4721  }
4722  if (unlikely(kw_args > 0)) {
4723  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes2D_GLS_velocity_pressure") < 0)) __PYX_ERR(0, 978, __pyx_L3_error)
4724  }
4725  } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
4726  goto __pyx_L5_argtuple_error;
4727  } else {
4728  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4729  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4730  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4731  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4732  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4733  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4734  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4735  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4736  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4737  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4738  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4739  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4740  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4741  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4742  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4743  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4744  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4745  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4746  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4747  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4748  }
4749  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
4750  __pyx_v_a = ((PyArrayObject *)values[1]);
4751  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
4752  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
4753  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
4754  __pyx_v_pdeResidualU = ((PyArrayObject *)values[5]);
4755  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[6]);
4756  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[7]);
4757  __pyx_v_pdeResidualV = ((PyArrayObject *)values[8]);
4758  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[9]);
4759  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[10]);
4760  __pyx_v_subgridErrorP = ((PyArrayObject *)values[11]);
4761  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[12]);
4762  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[13]);
4763  __pyx_v_subgridErrorU = ((PyArrayObject *)values[14]);
4764  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[15]);
4765  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[16]);
4766  __pyx_v_subgridErrorV = ((PyArrayObject *)values[17]);
4767  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[18]);
4768  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[19]);
4769  }
4770  goto __pyx_L4_argument_unpacking_done;
4771  __pyx_L5_argtuple_error:;
4772  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 978, __pyx_L3_error)
4773  __pyx_L3_error:;
4774  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes2D_GLS_velocity_pressure", __pyx_clineno, __pyx_lineno, __pyx_filename);
4775  __Pyx_RefNannyFinishContext();
4776  return NULL;
4777  __pyx_L4_argument_unpacking_done:;
4778  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 978, __pyx_L1_error)
4779  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 979, __pyx_L1_error)
4780  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 980, __pyx_L1_error)
4781  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 981, __pyx_L1_error)
4782  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 982, __pyx_L1_error)
4783  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 983, __pyx_L1_error)
4784  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 984, __pyx_L1_error)
4785  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 985, __pyx_L1_error)
4786  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 986, __pyx_L1_error)
4787  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 987, __pyx_L1_error)
4788  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 988, __pyx_L1_error)
4789  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 989, __pyx_L1_error)
4790  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 990, __pyx_L1_error)
4791  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 991, __pyx_L1_error)
4792  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 992, __pyx_L1_error)
4793  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 993, __pyx_L1_error)
4794  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 994, __pyx_L1_error)
4795  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 995, __pyx_L1_error)
4796  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 996, __pyx_L1_error)
4797  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 997, __pyx_L1_error)
4798  __pyx_r = __pyx_pf_13csubgridError_22calculateSubgridErrorStokes2D_GLS_velocity_pressure(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv);
4799 
4800  /* function exit code */
4801  goto __pyx_L0;
4802  __pyx_L1_error:;
4803  __pyx_r = NULL;
4804  __pyx_L0:;
4805  __Pyx_RefNannyFinishContext();
4806  return __pyx_r;
4807 }
4808 
4809 static PyObject *__pyx_pf_13csubgridError_22calculateSubgridErrorStokes2D_GLS_velocity_pressure(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
4810  PyObject *__pyx_r = NULL;
4811  __Pyx_RefNannyDeclarations
4812  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity_pressure", 0);
4813 
4814  /* "csubgridError.pyx":998
4815  * np.ndarray dsubgridErrorV_dp,
4816  * np.ndarray dsubgridErrorV_dv):
4817  * ccalculateSubgridErrorStokes2D_GLS_velocity_pressure(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
4818  * dsubgridErrorP_du.shape[1],
4819  * dsubgridErrorP_du.shape[2],
4820  */
4821  calculateSubgridErrorStokes2D_GLS_velocity_pressure((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 2, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
4822 
4823  /* "csubgridError.pyx":978
4824  * <double*> dsubgridErrorW_dp.data,
4825  * <double*> dsubgridErrorW_dw.data)
4826  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
4827  * np.ndarray a,
4828  * np.ndarray pdeResidualP,
4829  */
4830 
4831  /* function exit code */
4832  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4833  __Pyx_XGIVEREF(__pyx_r);
4834  __Pyx_RefNannyFinishContext();
4835  return __pyx_r;
4836 }
4837 
4838 /* "csubgridError.pyx":1022
4839  * <double*> dsubgridErrorV_dp.data,
4840  * <double*> dsubgridErrorV_dv.data)
4841  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
4842  * np.ndarray a,
4843  * np.ndarray pdeResidualP,
4844  */
4845 
4846 /* Python wrapper */
4847 static PyObject *__pyx_pw_13csubgridError_25calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4848 static PyMethodDef __pyx_mdef_13csubgridError_25calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd = {"calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_25calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd, METH_VARARGS|METH_KEYWORDS, 0};
4849 static PyObject *__pyx_pw_13csubgridError_25calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4850  PyArrayObject *__pyx_v_elementDiameter = 0;
4851  PyArrayObject *__pyx_v_a = 0;
4852  PyArrayObject *__pyx_v_pdeResidualP = 0;
4853  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
4854  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
4855  PyArrayObject *__pyx_v_pdeResidualU = 0;
4856  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
4857  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
4858  PyArrayObject *__pyx_v_pdeResidualV = 0;
4859  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
4860  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
4861  PyArrayObject *__pyx_v_subgridErrorP = 0;
4862  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
4863  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
4864  PyArrayObject *__pyx_v_subgridErrorU = 0;
4865  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
4866  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
4867  PyArrayObject *__pyx_v_subgridErrorV = 0;
4868  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
4869  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
4870  int __pyx_lineno = 0;
4871  const char *__pyx_filename = NULL;
4872  int __pyx_clineno = 0;
4873  PyObject *__pyx_r = 0;
4874  __Pyx_RefNannyDeclarations
4875  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd (wrapper)", 0);
4876  {
4877  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,0};
4878  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4879  if (unlikely(__pyx_kwds)) {
4880  Py_ssize_t kw_args;
4881  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4882  switch (pos_args) {
4883  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4884  CYTHON_FALLTHROUGH;
4885  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4886  CYTHON_FALLTHROUGH;
4887  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4888  CYTHON_FALLTHROUGH;
4889  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4890  CYTHON_FALLTHROUGH;
4891  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4892  CYTHON_FALLTHROUGH;
4893  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4894  CYTHON_FALLTHROUGH;
4895  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4896  CYTHON_FALLTHROUGH;
4897  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4898  CYTHON_FALLTHROUGH;
4899  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4900  CYTHON_FALLTHROUGH;
4901  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4902  CYTHON_FALLTHROUGH;
4903  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4904  CYTHON_FALLTHROUGH;
4905  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4906  CYTHON_FALLTHROUGH;
4907  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4908  CYTHON_FALLTHROUGH;
4909  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4910  CYTHON_FALLTHROUGH;
4911  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4912  CYTHON_FALLTHROUGH;
4913  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4914  CYTHON_FALLTHROUGH;
4915  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4916  CYTHON_FALLTHROUGH;
4917  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4918  CYTHON_FALLTHROUGH;
4919  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4920  CYTHON_FALLTHROUGH;
4921  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4922  CYTHON_FALLTHROUGH;
4923  case 0: break;
4924  default: goto __pyx_L5_argtuple_error;
4925  }
4926  kw_args = PyDict_Size(__pyx_kwds);
4927  switch (pos_args) {
4928  case 0:
4929  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
4930  else goto __pyx_L5_argtuple_error;
4931  CYTHON_FALLTHROUGH;
4932  case 1:
4933  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
4934  else {
4935  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 1); __PYX_ERR(0, 1022, __pyx_L3_error)
4936  }
4937  CYTHON_FALLTHROUGH;
4938  case 2:
4939  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
4940  else {
4941  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 2); __PYX_ERR(0, 1022, __pyx_L3_error)
4942  }
4943  CYTHON_FALLTHROUGH;
4944  case 3:
4945  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
4946  else {
4947  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 3); __PYX_ERR(0, 1022, __pyx_L3_error)
4948  }
4949  CYTHON_FALLTHROUGH;
4950  case 4:
4951  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
4952  else {
4953  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 4); __PYX_ERR(0, 1022, __pyx_L3_error)
4954  }
4955  CYTHON_FALLTHROUGH;
4956  case 5:
4957  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
4958  else {
4959  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 5); __PYX_ERR(0, 1022, __pyx_L3_error)
4960  }
4961  CYTHON_FALLTHROUGH;
4962  case 6:
4963  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
4964  else {
4965  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 6); __PYX_ERR(0, 1022, __pyx_L3_error)
4966  }
4967  CYTHON_FALLTHROUGH;
4968  case 7:
4969  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
4970  else {
4971  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 7); __PYX_ERR(0, 1022, __pyx_L3_error)
4972  }
4973  CYTHON_FALLTHROUGH;
4974  case 8:
4975  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
4976  else {
4977  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 8); __PYX_ERR(0, 1022, __pyx_L3_error)
4978  }
4979  CYTHON_FALLTHROUGH;
4980  case 9:
4981  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
4982  else {
4983  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 9); __PYX_ERR(0, 1022, __pyx_L3_error)
4984  }
4985  CYTHON_FALLTHROUGH;
4986  case 10:
4987  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
4988  else {
4989  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 10); __PYX_ERR(0, 1022, __pyx_L3_error)
4990  }
4991  CYTHON_FALLTHROUGH;
4992  case 11:
4993  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
4994  else {
4995  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 11); __PYX_ERR(0, 1022, __pyx_L3_error)
4996  }
4997  CYTHON_FALLTHROUGH;
4998  case 12:
4999  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
5000  else {
5001  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 12); __PYX_ERR(0, 1022, __pyx_L3_error)
5002  }
5003  CYTHON_FALLTHROUGH;
5004  case 13:
5005  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
5006  else {
5007  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 13); __PYX_ERR(0, 1022, __pyx_L3_error)
5008  }
5009  CYTHON_FALLTHROUGH;
5010  case 14:
5011  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
5012  else {
5013  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 14); __PYX_ERR(0, 1022, __pyx_L3_error)
5014  }
5015  CYTHON_FALLTHROUGH;
5016  case 15:
5017  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
5018  else {
5019  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 15); __PYX_ERR(0, 1022, __pyx_L3_error)
5020  }
5021  CYTHON_FALLTHROUGH;
5022  case 16:
5023  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
5024  else {
5025  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 16); __PYX_ERR(0, 1022, __pyx_L3_error)
5026  }
5027  CYTHON_FALLTHROUGH;
5028  case 17:
5029  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
5030  else {
5031  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 17); __PYX_ERR(0, 1022, __pyx_L3_error)
5032  }
5033  CYTHON_FALLTHROUGH;
5034  case 18:
5035  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
5036  else {
5037  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 18); __PYX_ERR(0, 1022, __pyx_L3_error)
5038  }
5039  CYTHON_FALLTHROUGH;
5040  case 19:
5041  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
5042  else {
5043  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, 19); __PYX_ERR(0, 1022, __pyx_L3_error)
5044  }
5045  }
5046  if (unlikely(kw_args > 0)) {
5047  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd") < 0)) __PYX_ERR(0, 1022, __pyx_L3_error)
5048  }
5049  } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
5050  goto __pyx_L5_argtuple_error;
5051  } else {
5052  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5053  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5054  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5055  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5056  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5057  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5058  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5059  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5060  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5061  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5062  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5063  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5064  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5065  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5066  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5067  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5068  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5069  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5070  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5071  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5072  }
5073  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
5074  __pyx_v_a = ((PyArrayObject *)values[1]);
5075  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
5076  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
5077  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
5078  __pyx_v_pdeResidualU = ((PyArrayObject *)values[5]);
5079  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[6]);
5080  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[7]);
5081  __pyx_v_pdeResidualV = ((PyArrayObject *)values[8]);
5082  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[9]);
5083  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[10]);
5084  __pyx_v_subgridErrorP = ((PyArrayObject *)values[11]);
5085  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[12]);
5086  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[13]);
5087  __pyx_v_subgridErrorU = ((PyArrayObject *)values[14]);
5088  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[15]);
5089  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[16]);
5090  __pyx_v_subgridErrorV = ((PyArrayObject *)values[17]);
5091  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[18]);
5092  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[19]);
5093  }
5094  goto __pyx_L4_argument_unpacking_done;
5095  __pyx_L5_argtuple_error:;
5096  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1022, __pyx_L3_error)
5097  __pyx_L3_error:;
5098  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
5099  __Pyx_RefNannyFinishContext();
5100  return NULL;
5101  __pyx_L4_argument_unpacking_done:;
5102  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1022, __pyx_L1_error)
5103  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1023, __pyx_L1_error)
5104  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1024, __pyx_L1_error)
5105  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1025, __pyx_L1_error)
5106  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1026, __pyx_L1_error)
5107  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1027, __pyx_L1_error)
5108  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1028, __pyx_L1_error)
5109  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1029, __pyx_L1_error)
5110  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1030, __pyx_L1_error)
5111  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1031, __pyx_L1_error)
5112  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1032, __pyx_L1_error)
5113  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1033, __pyx_L1_error)
5114  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1034, __pyx_L1_error)
5115  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
5116  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1036, __pyx_L1_error)
5117  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1037, __pyx_L1_error)
5118  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1038, __pyx_L1_error)
5119  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1039, __pyx_L1_error)
5120  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1040, __pyx_L1_error)
5121  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1041, __pyx_L1_error)
5122  __pyx_r = __pyx_pf_13csubgridError_24calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv);
5123 
5124  /* function exit code */
5125  goto __pyx_L0;
5126  __pyx_L1_error:;
5127  __pyx_r = NULL;
5128  __pyx_L0:;
5129  __Pyx_RefNannyFinishContext();
5130  return __pyx_r;
5131 }
5132 
5133 static PyObject *__pyx_pf_13csubgridError_24calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
5134  PyObject *__pyx_r = NULL;
5135  __Pyx_RefNannyDeclarations
5136  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd", 0);
5137 
5138  /* "csubgridError.pyx":1042
5139  * np.ndarray dsubgridErrorV_dp,
5140  * np.ndarray dsubgridErrorV_dv):
5141  * ccalculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
5142  * dsubgridErrorP_du.shape[1],
5143  * dsubgridErrorP_du.shape[2],
5144  */
5145  calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 2, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
5146 
5147  /* "csubgridError.pyx":1022
5148  * <double*> dsubgridErrorV_dp.data,
5149  * <double*> dsubgridErrorV_dv.data)
5150  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
5151  * np.ndarray a,
5152  * np.ndarray pdeResidualP,
5153  */
5154 
5155  /* function exit code */
5156  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5157  __Pyx_XGIVEREF(__pyx_r);
5158  __Pyx_RefNannyFinishContext();
5159  return __pyx_r;
5160 }
5161 
5162 /* "csubgridError.pyx":1066
5163  * <double*> dsubgridErrorV_dp.data,
5164  * <double*> dsubgridErrorV_dv.data)
5165  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
5166  * np.ndarray a,
5167  * np.ndarray pdeResidualP,
5168  */
5169 
5170 /* Python wrapper */
5171 static PyObject *__pyx_pw_13csubgridError_27calculateSubgridErrorStokes3D_GLS_velocity_pressure(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5172 static PyMethodDef __pyx_mdef_13csubgridError_27calculateSubgridErrorStokes3D_GLS_velocity_pressure = {"calculateSubgridErrorStokes3D_GLS_velocity_pressure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_27calculateSubgridErrorStokes3D_GLS_velocity_pressure, METH_VARARGS|METH_KEYWORDS, 0};
5173 static PyObject *__pyx_pw_13csubgridError_27calculateSubgridErrorStokes3D_GLS_velocity_pressure(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5174  PyArrayObject *__pyx_v_elementDiameter = 0;
5175  PyArrayObject *__pyx_v_a = 0;
5176  PyArrayObject *__pyx_v_pdeResidualP = 0;
5177  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
5178  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
5179  PyArrayObject *__pyx_v_dpdeResidualP_dw = 0;
5180  PyArrayObject *__pyx_v_pdeResidualU = 0;
5181  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
5182  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
5183  PyArrayObject *__pyx_v_pdeResidualV = 0;
5184  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
5185  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
5186  PyArrayObject *__pyx_v_pdeResidualW = 0;
5187  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
5188  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
5189  PyArrayObject *__pyx_v_subgridErrorP = 0;
5190  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
5191  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
5192  PyArrayObject *__pyx_v_dsubgridErrorP_dw = 0;
5193  PyArrayObject *__pyx_v_subgridErrorU = 0;
5194  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
5195  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
5196  PyArrayObject *__pyx_v_subgridErrorV = 0;
5197  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
5198  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
5199  PyArrayObject *__pyx_v_subgridErrorW = 0;
5200  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
5201  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
5202  int __pyx_lineno = 0;
5203  const char *__pyx_filename = NULL;
5204  int __pyx_clineno = 0;
5205  PyObject *__pyx_r = 0;
5206  __Pyx_RefNannyDeclarations
5207  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity_pressure (wrapper)", 0);
5208  {
5209  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_dpdeResidualP_dw,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_dsubgridErrorP_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_dw,0};
5210  PyObject* values[28] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5211  if (unlikely(__pyx_kwds)) {
5212  Py_ssize_t kw_args;
5213  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5214  switch (pos_args) {
5215  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5216  CYTHON_FALLTHROUGH;
5217  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5218  CYTHON_FALLTHROUGH;
5219  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5220  CYTHON_FALLTHROUGH;
5221  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5222  CYTHON_FALLTHROUGH;
5223  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5224  CYTHON_FALLTHROUGH;
5225  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5226  CYTHON_FALLTHROUGH;
5227  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5228  CYTHON_FALLTHROUGH;
5229  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5230  CYTHON_FALLTHROUGH;
5231  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5232  CYTHON_FALLTHROUGH;
5233  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5234  CYTHON_FALLTHROUGH;
5235  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5236  CYTHON_FALLTHROUGH;
5237  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5238  CYTHON_FALLTHROUGH;
5239  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5240  CYTHON_FALLTHROUGH;
5241  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5242  CYTHON_FALLTHROUGH;
5243  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5244  CYTHON_FALLTHROUGH;
5245  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5246  CYTHON_FALLTHROUGH;
5247  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5248  CYTHON_FALLTHROUGH;
5249  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5250  CYTHON_FALLTHROUGH;
5251  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5252  CYTHON_FALLTHROUGH;
5253  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5254  CYTHON_FALLTHROUGH;
5255  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5256  CYTHON_FALLTHROUGH;
5257  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5258  CYTHON_FALLTHROUGH;
5259  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5260  CYTHON_FALLTHROUGH;
5261  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5262  CYTHON_FALLTHROUGH;
5263  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5264  CYTHON_FALLTHROUGH;
5265  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5266  CYTHON_FALLTHROUGH;
5267  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5268  CYTHON_FALLTHROUGH;
5269  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5270  CYTHON_FALLTHROUGH;
5271  case 0: break;
5272  default: goto __pyx_L5_argtuple_error;
5273  }
5274  kw_args = PyDict_Size(__pyx_kwds);
5275  switch (pos_args) {
5276  case 0:
5277  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
5278  else goto __pyx_L5_argtuple_error;
5279  CYTHON_FALLTHROUGH;
5280  case 1:
5281  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5282  else {
5283  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 1); __PYX_ERR(0, 1066, __pyx_L3_error)
5284  }
5285  CYTHON_FALLTHROUGH;
5286  case 2:
5287  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
5288  else {
5289  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 2); __PYX_ERR(0, 1066, __pyx_L3_error)
5290  }
5291  CYTHON_FALLTHROUGH;
5292  case 3:
5293  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
5294  else {
5295  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 3); __PYX_ERR(0, 1066, __pyx_L3_error)
5296  }
5297  CYTHON_FALLTHROUGH;
5298  case 4:
5299  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
5300  else {
5301  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 4); __PYX_ERR(0, 1066, __pyx_L3_error)
5302  }
5303  CYTHON_FALLTHROUGH;
5304  case 5:
5305  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dw)) != 0)) kw_args--;
5306  else {
5307  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 5); __PYX_ERR(0, 1066, __pyx_L3_error)
5308  }
5309  CYTHON_FALLTHROUGH;
5310  case 6:
5311  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
5312  else {
5313  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 6); __PYX_ERR(0, 1066, __pyx_L3_error)
5314  }
5315  CYTHON_FALLTHROUGH;
5316  case 7:
5317  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
5318  else {
5319  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 7); __PYX_ERR(0, 1066, __pyx_L3_error)
5320  }
5321  CYTHON_FALLTHROUGH;
5322  case 8:
5323  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
5324  else {
5325  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 8); __PYX_ERR(0, 1066, __pyx_L3_error)
5326  }
5327  CYTHON_FALLTHROUGH;
5328  case 9:
5329  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
5330  else {
5331  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 9); __PYX_ERR(0, 1066, __pyx_L3_error)
5332  }
5333  CYTHON_FALLTHROUGH;
5334  case 10:
5335  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
5336  else {
5337  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 10); __PYX_ERR(0, 1066, __pyx_L3_error)
5338  }
5339  CYTHON_FALLTHROUGH;
5340  case 11:
5341  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
5342  else {
5343  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 11); __PYX_ERR(0, 1066, __pyx_L3_error)
5344  }
5345  CYTHON_FALLTHROUGH;
5346  case 12:
5347  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
5348  else {
5349  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 12); __PYX_ERR(0, 1066, __pyx_L3_error)
5350  }
5351  CYTHON_FALLTHROUGH;
5352  case 13:
5353  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
5354  else {
5355  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 13); __PYX_ERR(0, 1066, __pyx_L3_error)
5356  }
5357  CYTHON_FALLTHROUGH;
5358  case 14:
5359  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
5360  else {
5361  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 14); __PYX_ERR(0, 1066, __pyx_L3_error)
5362  }
5363  CYTHON_FALLTHROUGH;
5364  case 15:
5365  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
5366  else {
5367  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 15); __PYX_ERR(0, 1066, __pyx_L3_error)
5368  }
5369  CYTHON_FALLTHROUGH;
5370  case 16:
5371  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
5372  else {
5373  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 16); __PYX_ERR(0, 1066, __pyx_L3_error)
5374  }
5375  CYTHON_FALLTHROUGH;
5376  case 17:
5377  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
5378  else {
5379  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 17); __PYX_ERR(0, 1066, __pyx_L3_error)
5380  }
5381  CYTHON_FALLTHROUGH;
5382  case 18:
5383  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dw)) != 0)) kw_args--;
5384  else {
5385  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 18); __PYX_ERR(0, 1066, __pyx_L3_error)
5386  }
5387  CYTHON_FALLTHROUGH;
5388  case 19:
5389  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
5390  else {
5391  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 19); __PYX_ERR(0, 1066, __pyx_L3_error)
5392  }
5393  CYTHON_FALLTHROUGH;
5394  case 20:
5395  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
5396  else {
5397  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 20); __PYX_ERR(0, 1066, __pyx_L3_error)
5398  }
5399  CYTHON_FALLTHROUGH;
5400  case 21:
5401  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
5402  else {
5403  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 21); __PYX_ERR(0, 1066, __pyx_L3_error)
5404  }
5405  CYTHON_FALLTHROUGH;
5406  case 22:
5407  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
5408  else {
5409  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 22); __PYX_ERR(0, 1066, __pyx_L3_error)
5410  }
5411  CYTHON_FALLTHROUGH;
5412  case 23:
5413  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
5414  else {
5415  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 23); __PYX_ERR(0, 1066, __pyx_L3_error)
5416  }
5417  CYTHON_FALLTHROUGH;
5418  case 24:
5419  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
5420  else {
5421  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 24); __PYX_ERR(0, 1066, __pyx_L3_error)
5422  }
5423  CYTHON_FALLTHROUGH;
5424  case 25:
5425  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
5426  else {
5427  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 25); __PYX_ERR(0, 1066, __pyx_L3_error)
5428  }
5429  CYTHON_FALLTHROUGH;
5430  case 26:
5431  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
5432  else {
5433  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 26); __PYX_ERR(0, 1066, __pyx_L3_error)
5434  }
5435  CYTHON_FALLTHROUGH;
5436  case 27:
5437  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
5438  else {
5439  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, 27); __PYX_ERR(0, 1066, __pyx_L3_error)
5440  }
5441  }
5442  if (unlikely(kw_args > 0)) {
5443  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes3D_GLS_velocity_pressure") < 0)) __PYX_ERR(0, 1066, __pyx_L3_error)
5444  }
5445  } else if (PyTuple_GET_SIZE(__pyx_args) != 28) {
5446  goto __pyx_L5_argtuple_error;
5447  } else {
5448  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5449  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5450  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5451  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5452  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5453  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5454  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5455  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5456  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5457  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5458  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5459  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5460  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5461  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5462  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5463  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5464  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5465  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5466  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5467  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5468  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5469  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5470  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5471  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5472  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5473  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5474  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5475  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5476  }
5477  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
5478  __pyx_v_a = ((PyArrayObject *)values[1]);
5479  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
5480  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
5481  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
5482  __pyx_v_dpdeResidualP_dw = ((PyArrayObject *)values[5]);
5483  __pyx_v_pdeResidualU = ((PyArrayObject *)values[6]);
5484  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[7]);
5485  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[8]);
5486  __pyx_v_pdeResidualV = ((PyArrayObject *)values[9]);
5487  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[10]);
5488  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[11]);
5489  __pyx_v_pdeResidualW = ((PyArrayObject *)values[12]);
5490  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[13]);
5491  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[14]);
5492  __pyx_v_subgridErrorP = ((PyArrayObject *)values[15]);
5493  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[16]);
5494  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[17]);
5495  __pyx_v_dsubgridErrorP_dw = ((PyArrayObject *)values[18]);
5496  __pyx_v_subgridErrorU = ((PyArrayObject *)values[19]);
5497  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[20]);
5498  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[21]);
5499  __pyx_v_subgridErrorV = ((PyArrayObject *)values[22]);
5500  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[23]);
5501  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[24]);
5502  __pyx_v_subgridErrorW = ((PyArrayObject *)values[25]);
5503  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[26]);
5504  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[27]);
5505  }
5506  goto __pyx_L4_argument_unpacking_done;
5507  __pyx_L5_argtuple_error:;
5508  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 1, 28, 28, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1066, __pyx_L3_error)
5509  __pyx_L3_error:;
5510  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes3D_GLS_velocity_pressure", __pyx_clineno, __pyx_lineno, __pyx_filename);
5511  __Pyx_RefNannyFinishContext();
5512  return NULL;
5513  __pyx_L4_argument_unpacking_done:;
5514  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1066, __pyx_L1_error)
5515  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1067, __pyx_L1_error)
5516  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1068, __pyx_L1_error)
5517  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1069, __pyx_L1_error)
5518  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1070, __pyx_L1_error)
5519  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dw", 0))) __PYX_ERR(0, 1071, __pyx_L1_error)
5520  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1072, __pyx_L1_error)
5521  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1073, __pyx_L1_error)
5522  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1074, __pyx_L1_error)
5523  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1075, __pyx_L1_error)
5524  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1076, __pyx_L1_error)
5525  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1077, __pyx_L1_error)
5526  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 1078, __pyx_L1_error)
5527  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 1079, __pyx_L1_error)
5528  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 1080, __pyx_L1_error)
5529  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1081, __pyx_L1_error)
5530  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1082, __pyx_L1_error)
5531  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1083, __pyx_L1_error)
5532  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dw", 0))) __PYX_ERR(0, 1084, __pyx_L1_error)
5533  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1085, __pyx_L1_error)
5534  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1086, __pyx_L1_error)
5535  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1087, __pyx_L1_error)
5536  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1088, __pyx_L1_error)
5537  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1089, __pyx_L1_error)
5538  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1090, __pyx_L1_error)
5539  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 1091, __pyx_L1_error)
5540  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 1092, __pyx_L1_error)
5541  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 1093, __pyx_L1_error)
5542  __pyx_r = __pyx_pf_13csubgridError_26calculateSubgridErrorStokes3D_GLS_velocity_pressure(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_dpdeResidualP_dw, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_dsubgridErrorP_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_dw);
5543 
5544  /* function exit code */
5545  goto __pyx_L0;
5546  __pyx_L1_error:;
5547  __pyx_r = NULL;
5548  __pyx_L0:;
5549  __Pyx_RefNannyFinishContext();
5550  return __pyx_r;
5551 }
5552 
5553 static PyObject *__pyx_pf_13csubgridError_26calculateSubgridErrorStokes3D_GLS_velocity_pressure(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
5554  PyObject *__pyx_r = NULL;
5555  __Pyx_RefNannyDeclarations
5556  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity_pressure", 0);
5557 
5558  /* "csubgridError.pyx":1094
5559  * np.ndarray dsubgridErrorW_dp,
5560  * np.ndarray dsubgridErrorW_dw):
5561  * ccalculateSubgridErrorStokes3D_GLS_velocity_pressure(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
5562  * dsubgridErrorP_du.shape[1],
5563  * dsubgridErrorP_du.shape[2],
5564  */
5565  calculateSubgridErrorStokes3D_GLS_velocity_pressure((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 3, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_dpdeResidualP_dw->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_dsubgridErrorP_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
5566 
5567  /* "csubgridError.pyx":1066
5568  * <double*> dsubgridErrorV_dp.data,
5569  * <double*> dsubgridErrorV_dv.data)
5570  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
5571  * np.ndarray a,
5572  * np.ndarray pdeResidualP,
5573  */
5574 
5575  /* function exit code */
5576  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5577  __Pyx_XGIVEREF(__pyx_r);
5578  __Pyx_RefNannyFinishContext();
5579  return __pyx_r;
5580 }
5581 
5582 /* "csubgridError.pyx":1126
5583  * <double*> dsubgridErrorW_dp.data,
5584  * <double*> dsubgridErrorW_dw.data)
5585  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
5586  * np.ndarray a,
5587  * np.ndarray pdeResidualP,
5588  */
5589 
5590 /* Python wrapper */
5591 static PyObject *__pyx_pw_13csubgridError_29calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5592 static PyMethodDef __pyx_mdef_13csubgridError_29calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd = {"calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_29calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd, METH_VARARGS|METH_KEYWORDS, 0};
5593 static PyObject *__pyx_pw_13csubgridError_29calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5594  PyArrayObject *__pyx_v_elementDiameter = 0;
5595  PyArrayObject *__pyx_v_a = 0;
5596  PyArrayObject *__pyx_v_pdeResidualP = 0;
5597  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
5598  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
5599  PyArrayObject *__pyx_v_dpdeResidualP_dw = 0;
5600  PyArrayObject *__pyx_v_pdeResidualU = 0;
5601  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
5602  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
5603  PyArrayObject *__pyx_v_pdeResidualV = 0;
5604  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
5605  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
5606  PyArrayObject *__pyx_v_pdeResidualW = 0;
5607  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
5608  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
5609  PyArrayObject *__pyx_v_subgridErrorP = 0;
5610  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
5611  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
5612  PyArrayObject *__pyx_v_dsubgridErrorP_dw = 0;
5613  PyArrayObject *__pyx_v_subgridErrorU = 0;
5614  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
5615  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
5616  PyArrayObject *__pyx_v_subgridErrorV = 0;
5617  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
5618  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
5619  PyArrayObject *__pyx_v_subgridErrorW = 0;
5620  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
5621  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
5622  int __pyx_lineno = 0;
5623  const char *__pyx_filename = NULL;
5624  int __pyx_clineno = 0;
5625  PyObject *__pyx_r = 0;
5626  __Pyx_RefNannyDeclarations
5627  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd (wrapper)", 0);
5628  {
5629  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_dpdeResidualP_dw,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_dsubgridErrorP_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_dw,0};
5630  PyObject* values[28] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5631  if (unlikely(__pyx_kwds)) {
5632  Py_ssize_t kw_args;
5633  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5634  switch (pos_args) {
5635  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5636  CYTHON_FALLTHROUGH;
5637  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5638  CYTHON_FALLTHROUGH;
5639  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5640  CYTHON_FALLTHROUGH;
5641  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5642  CYTHON_FALLTHROUGH;
5643  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5644  CYTHON_FALLTHROUGH;
5645  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5646  CYTHON_FALLTHROUGH;
5647  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5648  CYTHON_FALLTHROUGH;
5649  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5650  CYTHON_FALLTHROUGH;
5651  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5652  CYTHON_FALLTHROUGH;
5653  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5654  CYTHON_FALLTHROUGH;
5655  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5656  CYTHON_FALLTHROUGH;
5657  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5658  CYTHON_FALLTHROUGH;
5659  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5660  CYTHON_FALLTHROUGH;
5661  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5662  CYTHON_FALLTHROUGH;
5663  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5664  CYTHON_FALLTHROUGH;
5665  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5666  CYTHON_FALLTHROUGH;
5667  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5668  CYTHON_FALLTHROUGH;
5669  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5670  CYTHON_FALLTHROUGH;
5671  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5672  CYTHON_FALLTHROUGH;
5673  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5674  CYTHON_FALLTHROUGH;
5675  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5676  CYTHON_FALLTHROUGH;
5677  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5678  CYTHON_FALLTHROUGH;
5679  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5680  CYTHON_FALLTHROUGH;
5681  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5682  CYTHON_FALLTHROUGH;
5683  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5684  CYTHON_FALLTHROUGH;
5685  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5686  CYTHON_FALLTHROUGH;
5687  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5688  CYTHON_FALLTHROUGH;
5689  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5690  CYTHON_FALLTHROUGH;
5691  case 0: break;
5692  default: goto __pyx_L5_argtuple_error;
5693  }
5694  kw_args = PyDict_Size(__pyx_kwds);
5695  switch (pos_args) {
5696  case 0:
5697  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
5698  else goto __pyx_L5_argtuple_error;
5699  CYTHON_FALLTHROUGH;
5700  case 1:
5701  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5702  else {
5703  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 1); __PYX_ERR(0, 1126, __pyx_L3_error)
5704  }
5705  CYTHON_FALLTHROUGH;
5706  case 2:
5707  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
5708  else {
5709  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 2); __PYX_ERR(0, 1126, __pyx_L3_error)
5710  }
5711  CYTHON_FALLTHROUGH;
5712  case 3:
5713  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
5714  else {
5715  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 3); __PYX_ERR(0, 1126, __pyx_L3_error)
5716  }
5717  CYTHON_FALLTHROUGH;
5718  case 4:
5719  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
5720  else {
5721  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 4); __PYX_ERR(0, 1126, __pyx_L3_error)
5722  }
5723  CYTHON_FALLTHROUGH;
5724  case 5:
5725  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dw)) != 0)) kw_args--;
5726  else {
5727  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 5); __PYX_ERR(0, 1126, __pyx_L3_error)
5728  }
5729  CYTHON_FALLTHROUGH;
5730  case 6:
5731  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
5732  else {
5733  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 6); __PYX_ERR(0, 1126, __pyx_L3_error)
5734  }
5735  CYTHON_FALLTHROUGH;
5736  case 7:
5737  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
5738  else {
5739  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 7); __PYX_ERR(0, 1126, __pyx_L3_error)
5740  }
5741  CYTHON_FALLTHROUGH;
5742  case 8:
5743  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
5744  else {
5745  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 8); __PYX_ERR(0, 1126, __pyx_L3_error)
5746  }
5747  CYTHON_FALLTHROUGH;
5748  case 9:
5749  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
5750  else {
5751  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 9); __PYX_ERR(0, 1126, __pyx_L3_error)
5752  }
5753  CYTHON_FALLTHROUGH;
5754  case 10:
5755  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
5756  else {
5757  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 10); __PYX_ERR(0, 1126, __pyx_L3_error)
5758  }
5759  CYTHON_FALLTHROUGH;
5760  case 11:
5761  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
5762  else {
5763  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 11); __PYX_ERR(0, 1126, __pyx_L3_error)
5764  }
5765  CYTHON_FALLTHROUGH;
5766  case 12:
5767  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
5768  else {
5769  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 12); __PYX_ERR(0, 1126, __pyx_L3_error)
5770  }
5771  CYTHON_FALLTHROUGH;
5772  case 13:
5773  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
5774  else {
5775  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 13); __PYX_ERR(0, 1126, __pyx_L3_error)
5776  }
5777  CYTHON_FALLTHROUGH;
5778  case 14:
5779  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
5780  else {
5781  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 14); __PYX_ERR(0, 1126, __pyx_L3_error)
5782  }
5783  CYTHON_FALLTHROUGH;
5784  case 15:
5785  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
5786  else {
5787  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 15); __PYX_ERR(0, 1126, __pyx_L3_error)
5788  }
5789  CYTHON_FALLTHROUGH;
5790  case 16:
5791  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
5792  else {
5793  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 16); __PYX_ERR(0, 1126, __pyx_L3_error)
5794  }
5795  CYTHON_FALLTHROUGH;
5796  case 17:
5797  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
5798  else {
5799  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 17); __PYX_ERR(0, 1126, __pyx_L3_error)
5800  }
5801  CYTHON_FALLTHROUGH;
5802  case 18:
5803  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dw)) != 0)) kw_args--;
5804  else {
5805  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 18); __PYX_ERR(0, 1126, __pyx_L3_error)
5806  }
5807  CYTHON_FALLTHROUGH;
5808  case 19:
5809  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
5810  else {
5811  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 19); __PYX_ERR(0, 1126, __pyx_L3_error)
5812  }
5813  CYTHON_FALLTHROUGH;
5814  case 20:
5815  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
5816  else {
5817  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 20); __PYX_ERR(0, 1126, __pyx_L3_error)
5818  }
5819  CYTHON_FALLTHROUGH;
5820  case 21:
5821  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
5822  else {
5823  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 21); __PYX_ERR(0, 1126, __pyx_L3_error)
5824  }
5825  CYTHON_FALLTHROUGH;
5826  case 22:
5827  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
5828  else {
5829  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 22); __PYX_ERR(0, 1126, __pyx_L3_error)
5830  }
5831  CYTHON_FALLTHROUGH;
5832  case 23:
5833  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
5834  else {
5835  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 23); __PYX_ERR(0, 1126, __pyx_L3_error)
5836  }
5837  CYTHON_FALLTHROUGH;
5838  case 24:
5839  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
5840  else {
5841  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 24); __PYX_ERR(0, 1126, __pyx_L3_error)
5842  }
5843  CYTHON_FALLTHROUGH;
5844  case 25:
5845  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
5846  else {
5847  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 25); __PYX_ERR(0, 1126, __pyx_L3_error)
5848  }
5849  CYTHON_FALLTHROUGH;
5850  case 26:
5851  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
5852  else {
5853  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 26); __PYX_ERR(0, 1126, __pyx_L3_error)
5854  }
5855  CYTHON_FALLTHROUGH;
5856  case 27:
5857  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
5858  else {
5859  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, 27); __PYX_ERR(0, 1126, __pyx_L3_error)
5860  }
5861  }
5862  if (unlikely(kw_args > 0)) {
5863  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd") < 0)) __PYX_ERR(0, 1126, __pyx_L3_error)
5864  }
5865  } else if (PyTuple_GET_SIZE(__pyx_args) != 28) {
5866  goto __pyx_L5_argtuple_error;
5867  } else {
5868  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5869  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5870  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5871  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5872  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5873  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5874  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5875  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5876  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5877  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5878  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5879  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5880  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5881  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5882  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5883  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5884  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
5885  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
5886  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
5887  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
5888  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
5889  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
5890  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
5891  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
5892  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
5893  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
5894  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
5895  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
5896  }
5897  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
5898  __pyx_v_a = ((PyArrayObject *)values[1]);
5899  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
5900  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
5901  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
5902  __pyx_v_dpdeResidualP_dw = ((PyArrayObject *)values[5]);
5903  __pyx_v_pdeResidualU = ((PyArrayObject *)values[6]);
5904  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[7]);
5905  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[8]);
5906  __pyx_v_pdeResidualV = ((PyArrayObject *)values[9]);
5907  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[10]);
5908  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[11]);
5909  __pyx_v_pdeResidualW = ((PyArrayObject *)values[12]);
5910  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[13]);
5911  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[14]);
5912  __pyx_v_subgridErrorP = ((PyArrayObject *)values[15]);
5913  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[16]);
5914  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[17]);
5915  __pyx_v_dsubgridErrorP_dw = ((PyArrayObject *)values[18]);
5916  __pyx_v_subgridErrorU = ((PyArrayObject *)values[19]);
5917  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[20]);
5918  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[21]);
5919  __pyx_v_subgridErrorV = ((PyArrayObject *)values[22]);
5920  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[23]);
5921  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[24]);
5922  __pyx_v_subgridErrorW = ((PyArrayObject *)values[25]);
5923  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[26]);
5924  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[27]);
5925  }
5926  goto __pyx_L4_argument_unpacking_done;
5927  __pyx_L5_argtuple_error:;
5928  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 1, 28, 28, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1126, __pyx_L3_error)
5929  __pyx_L3_error:;
5930  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
5931  __Pyx_RefNannyFinishContext();
5932  return NULL;
5933  __pyx_L4_argument_unpacking_done:;
5934  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1126, __pyx_L1_error)
5935  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1127, __pyx_L1_error)
5936  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1128, __pyx_L1_error)
5937  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1129, __pyx_L1_error)
5938  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1130, __pyx_L1_error)
5939  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dw", 0))) __PYX_ERR(0, 1131, __pyx_L1_error)
5940  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1132, __pyx_L1_error)
5941  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1133, __pyx_L1_error)
5942  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1134, __pyx_L1_error)
5943  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1135, __pyx_L1_error)
5944  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1136, __pyx_L1_error)
5945  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1137, __pyx_L1_error)
5946  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 1138, __pyx_L1_error)
5947  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 1139, __pyx_L1_error)
5948  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 1140, __pyx_L1_error)
5949  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1141, __pyx_L1_error)
5950  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1142, __pyx_L1_error)
5951  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
5952  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dw", 0))) __PYX_ERR(0, 1144, __pyx_L1_error)
5953  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1145, __pyx_L1_error)
5954  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1146, __pyx_L1_error)
5955  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1147, __pyx_L1_error)
5956  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1148, __pyx_L1_error)
5957  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1149, __pyx_L1_error)
5958  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1150, __pyx_L1_error)
5959  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 1151, __pyx_L1_error)
5960  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 1152, __pyx_L1_error)
5961  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 1153, __pyx_L1_error)
5962  __pyx_r = __pyx_pf_13csubgridError_28calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(__pyx_self, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_dpdeResidualP_dw, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_dsubgridErrorP_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_dw);
5963 
5964  /* function exit code */
5965  goto __pyx_L0;
5966  __pyx_L1_error:;
5967  __pyx_r = NULL;
5968  __pyx_L0:;
5969  __Pyx_RefNannyFinishContext();
5970  return __pyx_r;
5971 }
5972 
5973 static PyObject *__pyx_pf_13csubgridError_28calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
5974  PyObject *__pyx_r = NULL;
5975  __Pyx_RefNannyDeclarations
5976  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd", 0);
5977 
5978  /* "csubgridError.pyx":1154
5979  * np.ndarray dsubgridErrorW_dp,
5980  * np.ndarray dsubgridErrorW_dw):
5981  * ccalculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
5982  * dsubgridErrorP_du.shape[1],
5983  * dsubgridErrorP_du.shape[2],
5984  */
5985  calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 3, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_dpdeResidualP_dw->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_dsubgridErrorP_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
5986 
5987  /* "csubgridError.pyx":1126
5988  * <double*> dsubgridErrorW_dp.data,
5989  * <double*> dsubgridErrorW_dw.data)
5990  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
5991  * np.ndarray a,
5992  * np.ndarray pdeResidualP,
5993  */
5994 
5995  /* function exit code */
5996  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5997  __Pyx_XGIVEREF(__pyx_r);
5998  __Pyx_RefNannyFinishContext();
5999  return __pyx_r;
6000 }
6001 
6002 /* "csubgridError.pyx":1186
6003  * <double*> dsubgridErrorW_dp.data,
6004  * <double*> dsubgridErrorW_dw.data)
6005  * def calculateSubgridErrorNavierStokes2D_GLS_tau(double hFactor, # <<<<<<<<<<<<<<
6006  * np.ndarray elementDiameter,
6007  * np.ndarray dmt,
6008  */
6009 
6010 /* Python wrapper */
6011 static PyObject *__pyx_pw_13csubgridError_31calculateSubgridErrorNavierStokes2D_GLS_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6012 static PyMethodDef __pyx_mdef_13csubgridError_31calculateSubgridErrorNavierStokes2D_GLS_tau = {"calculateSubgridErrorNavierStokes2D_GLS_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_31calculateSubgridErrorNavierStokes2D_GLS_tau, METH_VARARGS|METH_KEYWORDS, 0};
6013 static PyObject *__pyx_pw_13csubgridError_31calculateSubgridErrorNavierStokes2D_GLS_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6014  double __pyx_v_hFactor;
6015  PyArrayObject *__pyx_v_elementDiameter = 0;
6016  PyArrayObject *__pyx_v_dmt = 0;
6017  PyArrayObject *__pyx_v_dm = 0;
6018  PyArrayObject *__pyx_v_f = 0;
6019  PyArrayObject *__pyx_v_a = 0;
6020  PyArrayObject *__pyx_v_tau0 = 0;
6021  PyArrayObject *__pyx_v_tau1 = 0;
6022  PyArrayObject *__pyx_v_cfl = 0;
6023  int __pyx_lineno = 0;
6024  const char *__pyx_filename = NULL;
6025  int __pyx_clineno = 0;
6026  PyObject *__pyx_r = 0;
6027  __Pyx_RefNannyDeclarations
6028  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_GLS_tau (wrapper)", 0);
6029  {
6030  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hFactor,&__pyx_n_s_elementDiameter,&__pyx_n_s_dmt,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_cfl,0};
6031  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
6032  if (unlikely(__pyx_kwds)) {
6033  Py_ssize_t kw_args;
6034  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6035  switch (pos_args) {
6036  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6037  CYTHON_FALLTHROUGH;
6038  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6039  CYTHON_FALLTHROUGH;
6040  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6041  CYTHON_FALLTHROUGH;
6042  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6043  CYTHON_FALLTHROUGH;
6044  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6045  CYTHON_FALLTHROUGH;
6046  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6047  CYTHON_FALLTHROUGH;
6048  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6049  CYTHON_FALLTHROUGH;
6050  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6051  CYTHON_FALLTHROUGH;
6052  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6053  CYTHON_FALLTHROUGH;
6054  case 0: break;
6055  default: goto __pyx_L5_argtuple_error;
6056  }
6057  kw_args = PyDict_Size(__pyx_kwds);
6058  switch (pos_args) {
6059  case 0:
6060  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hFactor)) != 0)) kw_args--;
6061  else goto __pyx_L5_argtuple_error;
6062  CYTHON_FALLTHROUGH;
6063  case 1:
6064  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
6065  else {
6066  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 1); __PYX_ERR(0, 1186, __pyx_L3_error)
6067  }
6068  CYTHON_FALLTHROUGH;
6069  case 2:
6070  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
6071  else {
6072  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 2); __PYX_ERR(0, 1186, __pyx_L3_error)
6073  }
6074  CYTHON_FALLTHROUGH;
6075  case 3:
6076  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
6077  else {
6078  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 3); __PYX_ERR(0, 1186, __pyx_L3_error)
6079  }
6080  CYTHON_FALLTHROUGH;
6081  case 4:
6082  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6083  else {
6084  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 4); __PYX_ERR(0, 1186, __pyx_L3_error)
6085  }
6086  CYTHON_FALLTHROUGH;
6087  case 5:
6088  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6089  else {
6090  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 5); __PYX_ERR(0, 1186, __pyx_L3_error)
6091  }
6092  CYTHON_FALLTHROUGH;
6093  case 6:
6094  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
6095  else {
6096  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 6); __PYX_ERR(0, 1186, __pyx_L3_error)
6097  }
6098  CYTHON_FALLTHROUGH;
6099  case 7:
6100  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
6101  else {
6102  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 7); __PYX_ERR(0, 1186, __pyx_L3_error)
6103  }
6104  CYTHON_FALLTHROUGH;
6105  case 8:
6106  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
6107  else {
6108  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, 8); __PYX_ERR(0, 1186, __pyx_L3_error)
6109  }
6110  }
6111  if (unlikely(kw_args > 0)) {
6112  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes2D_GLS_tau") < 0)) __PYX_ERR(0, 1186, __pyx_L3_error)
6113  }
6114  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
6115  goto __pyx_L5_argtuple_error;
6116  } else {
6117  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6118  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6119  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6120  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6121  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6122  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6123  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6124  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6125  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6126  }
6127  __pyx_v_hFactor = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_hFactor == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
6128  __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
6129  __pyx_v_dmt = ((PyArrayObject *)values[2]);
6130  __pyx_v_dm = ((PyArrayObject *)values[3]);
6131  __pyx_v_f = ((PyArrayObject *)values[4]);
6132  __pyx_v_a = ((PyArrayObject *)values[5]);
6133  __pyx_v_tau0 = ((PyArrayObject *)values[6]);
6134  __pyx_v_tau1 = ((PyArrayObject *)values[7]);
6135  __pyx_v_cfl = ((PyArrayObject *)values[8]);
6136  }
6137  goto __pyx_L4_argument_unpacking_done;
6138  __pyx_L5_argtuple_error:;
6139  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1186, __pyx_L3_error)
6140  __pyx_L3_error:;
6141  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes2D_GLS_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
6142  __Pyx_RefNannyFinishContext();
6143  return NULL;
6144  __pyx_L4_argument_unpacking_done:;
6145  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1187, __pyx_L1_error)
6146  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 1188, __pyx_L1_error)
6147  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1189, __pyx_L1_error)
6148  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1190, __pyx_L1_error)
6149  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1191, __pyx_L1_error)
6150  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1192, __pyx_L1_error)
6151  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1193, __pyx_L1_error)
6152  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 1194, __pyx_L1_error)
6153  __pyx_r = __pyx_pf_13csubgridError_30calculateSubgridErrorNavierStokes2D_GLS_tau(__pyx_self, __pyx_v_hFactor, __pyx_v_elementDiameter, __pyx_v_dmt, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_cfl);
6154 
6155  /* function exit code */
6156  goto __pyx_L0;
6157  __pyx_L1_error:;
6158  __pyx_r = NULL;
6159  __pyx_L0:;
6160  __Pyx_RefNannyFinishContext();
6161  return __pyx_r;
6162 }
6163 
6164 static PyObject *__pyx_pf_13csubgridError_30calculateSubgridErrorNavierStokes2D_GLS_tau(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_hFactor, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl) {
6165  PyObject *__pyx_r = NULL;
6166  __Pyx_RefNannyDeclarations
6167  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_GLS_tau", 0);
6168 
6169  /* "csubgridError.pyx":1195
6170  * np.ndarray tau1,
6171  * np.ndarray cfl):
6172  * ccalculateSubgridErrorNavierStokes2D_GLS_tau(f.shape[0], # <<<<<<<<<<<<<<
6173  * f.shape[1],
6174  * f.shape[2],
6175  */
6176  calculateSubgridErrorNavierStokes2D_GLS_tau((__pyx_v_f->dimensions[0]), (__pyx_v_f->dimensions[1]), (__pyx_v_f->dimensions[2]), __pyx_v_hFactor, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_cfl->data));
6177 
6178  /* "csubgridError.pyx":1186
6179  * <double*> dsubgridErrorW_dp.data,
6180  * <double*> dsubgridErrorW_dw.data)
6181  * def calculateSubgridErrorNavierStokes2D_GLS_tau(double hFactor, # <<<<<<<<<<<<<<
6182  * np.ndarray elementDiameter,
6183  * np.ndarray dmt,
6184  */
6185 
6186  /* function exit code */
6187  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6188  __Pyx_XGIVEREF(__pyx_r);
6189  __Pyx_RefNannyFinishContext();
6190  return __pyx_r;
6191 }
6192 
6193 /* "csubgridError.pyx":1207
6194  * <double*> tau1.data,
6195  * <double*> cfl.data)
6196  * def calculateSubgridErrorNavierStokes2D_GLS_tau_sd(double hFactor, # <<<<<<<<<<<<<<
6197  * np.ndarray elementDiameter,
6198  * np.ndarray dmt,
6199  */
6200 
6201 /* Python wrapper */
6202 static PyObject *__pyx_pw_13csubgridError_33calculateSubgridErrorNavierStokes2D_GLS_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6203 static PyMethodDef __pyx_mdef_13csubgridError_33calculateSubgridErrorNavierStokes2D_GLS_tau_sd = {"calculateSubgridErrorNavierStokes2D_GLS_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_33calculateSubgridErrorNavierStokes2D_GLS_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
6204 static PyObject *__pyx_pw_13csubgridError_33calculateSubgridErrorNavierStokes2D_GLS_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6205  double __pyx_v_hFactor;
6206  PyArrayObject *__pyx_v_elementDiameter = 0;
6207  PyArrayObject *__pyx_v_dmt = 0;
6208  PyArrayObject *__pyx_v_dm = 0;
6209  PyArrayObject *__pyx_v_f = 0;
6210  PyArrayObject *__pyx_v_a = 0;
6211  PyArrayObject *__pyx_v_tau0 = 0;
6212  PyArrayObject *__pyx_v_tau1 = 0;
6213  PyArrayObject *__pyx_v_cfl = 0;
6214  int __pyx_lineno = 0;
6215  const char *__pyx_filename = NULL;
6216  int __pyx_clineno = 0;
6217  PyObject *__pyx_r = 0;
6218  __Pyx_RefNannyDeclarations
6219  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_GLS_tau_sd (wrapper)", 0);
6220  {
6221  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hFactor,&__pyx_n_s_elementDiameter,&__pyx_n_s_dmt,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_cfl,0};
6222  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
6223  if (unlikely(__pyx_kwds)) {
6224  Py_ssize_t kw_args;
6225  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6226  switch (pos_args) {
6227  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6228  CYTHON_FALLTHROUGH;
6229  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6230  CYTHON_FALLTHROUGH;
6231  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6232  CYTHON_FALLTHROUGH;
6233  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6234  CYTHON_FALLTHROUGH;
6235  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6236  CYTHON_FALLTHROUGH;
6237  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6238  CYTHON_FALLTHROUGH;
6239  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6240  CYTHON_FALLTHROUGH;
6241  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6242  CYTHON_FALLTHROUGH;
6243  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6244  CYTHON_FALLTHROUGH;
6245  case 0: break;
6246  default: goto __pyx_L5_argtuple_error;
6247  }
6248  kw_args = PyDict_Size(__pyx_kwds);
6249  switch (pos_args) {
6250  case 0:
6251  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hFactor)) != 0)) kw_args--;
6252  else goto __pyx_L5_argtuple_error;
6253  CYTHON_FALLTHROUGH;
6254  case 1:
6255  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
6256  else {
6257  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 1); __PYX_ERR(0, 1207, __pyx_L3_error)
6258  }
6259  CYTHON_FALLTHROUGH;
6260  case 2:
6261  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
6262  else {
6263  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 2); __PYX_ERR(0, 1207, __pyx_L3_error)
6264  }
6265  CYTHON_FALLTHROUGH;
6266  case 3:
6267  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
6268  else {
6269  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 3); __PYX_ERR(0, 1207, __pyx_L3_error)
6270  }
6271  CYTHON_FALLTHROUGH;
6272  case 4:
6273  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6274  else {
6275  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 4); __PYX_ERR(0, 1207, __pyx_L3_error)
6276  }
6277  CYTHON_FALLTHROUGH;
6278  case 5:
6279  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6280  else {
6281  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 5); __PYX_ERR(0, 1207, __pyx_L3_error)
6282  }
6283  CYTHON_FALLTHROUGH;
6284  case 6:
6285  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
6286  else {
6287  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 6); __PYX_ERR(0, 1207, __pyx_L3_error)
6288  }
6289  CYTHON_FALLTHROUGH;
6290  case 7:
6291  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
6292  else {
6293  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 7); __PYX_ERR(0, 1207, __pyx_L3_error)
6294  }
6295  CYTHON_FALLTHROUGH;
6296  case 8:
6297  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
6298  else {
6299  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, 8); __PYX_ERR(0, 1207, __pyx_L3_error)
6300  }
6301  }
6302  if (unlikely(kw_args > 0)) {
6303  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes2D_GLS_tau_sd") < 0)) __PYX_ERR(0, 1207, __pyx_L3_error)
6304  }
6305  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
6306  goto __pyx_L5_argtuple_error;
6307  } else {
6308  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6309  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6310  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6311  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6312  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6313  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6314  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6315  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6316  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6317  }
6318  __pyx_v_hFactor = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_hFactor == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1207, __pyx_L3_error)
6319  __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
6320  __pyx_v_dmt = ((PyArrayObject *)values[2]);
6321  __pyx_v_dm = ((PyArrayObject *)values[3]);
6322  __pyx_v_f = ((PyArrayObject *)values[4]);
6323  __pyx_v_a = ((PyArrayObject *)values[5]);
6324  __pyx_v_tau0 = ((PyArrayObject *)values[6]);
6325  __pyx_v_tau1 = ((PyArrayObject *)values[7]);
6326  __pyx_v_cfl = ((PyArrayObject *)values[8]);
6327  }
6328  goto __pyx_L4_argument_unpacking_done;
6329  __pyx_L5_argtuple_error:;
6330  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1207, __pyx_L3_error)
6331  __pyx_L3_error:;
6332  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes2D_GLS_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
6333  __Pyx_RefNannyFinishContext();
6334  return NULL;
6335  __pyx_L4_argument_unpacking_done:;
6336  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1208, __pyx_L1_error)
6337  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 1209, __pyx_L1_error)
6338  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1210, __pyx_L1_error)
6339  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1211, __pyx_L1_error)
6340  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1212, __pyx_L1_error)
6341  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1213, __pyx_L1_error)
6342  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1214, __pyx_L1_error)
6343  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 1215, __pyx_L1_error)
6344  __pyx_r = __pyx_pf_13csubgridError_32calculateSubgridErrorNavierStokes2D_GLS_tau_sd(__pyx_self, __pyx_v_hFactor, __pyx_v_elementDiameter, __pyx_v_dmt, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_cfl);
6345 
6346  /* function exit code */
6347  goto __pyx_L0;
6348  __pyx_L1_error:;
6349  __pyx_r = NULL;
6350  __pyx_L0:;
6351  __Pyx_RefNannyFinishContext();
6352  return __pyx_r;
6353 }
6354 
6355 static PyObject *__pyx_pf_13csubgridError_32calculateSubgridErrorNavierStokes2D_GLS_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_hFactor, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl) {
6356  PyObject *__pyx_r = NULL;
6357  __Pyx_RefNannyDeclarations
6358  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_GLS_tau_sd", 0);
6359 
6360  /* "csubgridError.pyx":1216
6361  * np.ndarray tau1,
6362  * np.ndarray cfl):
6363  * ccalculateSubgridErrorNavierStokes2D_GLS_tau_sd(f.shape[0], # <<<<<<<<<<<<<<
6364  * f.shape[1],
6365  * f.shape[2],
6366  */
6367  calculateSubgridErrorNavierStokes2D_GLS_tau_sd((__pyx_v_f->dimensions[0]), (__pyx_v_f->dimensions[1]), (__pyx_v_f->dimensions[2]), __pyx_v_hFactor, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_cfl->data));
6368 
6369  /* "csubgridError.pyx":1207
6370  * <double*> tau1.data,
6371  * <double*> cfl.data)
6372  * def calculateSubgridErrorNavierStokes2D_GLS_tau_sd(double hFactor, # <<<<<<<<<<<<<<
6373  * np.ndarray elementDiameter,
6374  * np.ndarray dmt,
6375  */
6376 
6377  /* function exit code */
6378  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6379  __Pyx_XGIVEREF(__pyx_r);
6380  __Pyx_RefNannyFinishContext();
6381  return __pyx_r;
6382 }
6383 
6384 /* "csubgridError.pyx":1228
6385  * <double*> tau1.data,
6386  * <double*> cfl.data)
6387  * def calculateSubgridErrorNavierStokes2D_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
6388  * np.ndarray dmt,
6389  * np.ndarray dm,
6390  */
6391 
6392 /* Python wrapper */
6393 static PyObject *__pyx_pw_13csubgridError_35calculateSubgridErrorNavierStokes2D_generic_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6394 static PyMethodDef __pyx_mdef_13csubgridError_35calculateSubgridErrorNavierStokes2D_generic_tau = {"calculateSubgridErrorNavierStokes2D_generic_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_35calculateSubgridErrorNavierStokes2D_generic_tau, METH_VARARGS|METH_KEYWORDS, 0};
6395 static PyObject *__pyx_pw_13csubgridError_35calculateSubgridErrorNavierStokes2D_generic_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6396  PyArrayObject *__pyx_v_inverseJ = 0;
6397  PyArrayObject *__pyx_v_dmt = 0;
6398  PyArrayObject *__pyx_v_dm = 0;
6399  PyArrayObject *__pyx_v_f = 0;
6400  PyArrayObject *__pyx_v_a = 0;
6401  PyArrayObject *__pyx_v_tau0 = 0;
6402  PyArrayObject *__pyx_v_tau1 = 0;
6403  PyArrayObject *__pyx_v_cfl = 0;
6404  int __pyx_lineno = 0;
6405  const char *__pyx_filename = NULL;
6406  int __pyx_clineno = 0;
6407  PyObject *__pyx_r = 0;
6408  __Pyx_RefNannyDeclarations
6409  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_tau (wrapper)", 0);
6410  {
6411  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inverseJ,&__pyx_n_s_dmt,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_cfl,0};
6412  PyObject* values[8] = {0,0,0,0,0,0,0,0};
6413  if (unlikely(__pyx_kwds)) {
6414  Py_ssize_t kw_args;
6415  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6416  switch (pos_args) {
6417  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6418  CYTHON_FALLTHROUGH;
6419  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6420  CYTHON_FALLTHROUGH;
6421  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6422  CYTHON_FALLTHROUGH;
6423  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6424  CYTHON_FALLTHROUGH;
6425  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6426  CYTHON_FALLTHROUGH;
6427  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6428  CYTHON_FALLTHROUGH;
6429  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6430  CYTHON_FALLTHROUGH;
6431  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6432  CYTHON_FALLTHROUGH;
6433  case 0: break;
6434  default: goto __pyx_L5_argtuple_error;
6435  }
6436  kw_args = PyDict_Size(__pyx_kwds);
6437  switch (pos_args) {
6438  case 0:
6439  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inverseJ)) != 0)) kw_args--;
6440  else goto __pyx_L5_argtuple_error;
6441  CYTHON_FALLTHROUGH;
6442  case 1:
6443  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
6444  else {
6445  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, 1); __PYX_ERR(0, 1228, __pyx_L3_error)
6446  }
6447  CYTHON_FALLTHROUGH;
6448  case 2:
6449  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
6450  else {
6451  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, 2); __PYX_ERR(0, 1228, __pyx_L3_error)
6452  }
6453  CYTHON_FALLTHROUGH;
6454  case 3:
6455  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6456  else {
6457  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, 3); __PYX_ERR(0, 1228, __pyx_L3_error)
6458  }
6459  CYTHON_FALLTHROUGH;
6460  case 4:
6461  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6462  else {
6463  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, 4); __PYX_ERR(0, 1228, __pyx_L3_error)
6464  }
6465  CYTHON_FALLTHROUGH;
6466  case 5:
6467  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
6468  else {
6469  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, 5); __PYX_ERR(0, 1228, __pyx_L3_error)
6470  }
6471  CYTHON_FALLTHROUGH;
6472  case 6:
6473  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
6474  else {
6475  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, 6); __PYX_ERR(0, 1228, __pyx_L3_error)
6476  }
6477  CYTHON_FALLTHROUGH;
6478  case 7:
6479  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
6480  else {
6481  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, 7); __PYX_ERR(0, 1228, __pyx_L3_error)
6482  }
6483  }
6484  if (unlikely(kw_args > 0)) {
6485  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes2D_generic_tau") < 0)) __PYX_ERR(0, 1228, __pyx_L3_error)
6486  }
6487  } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
6488  goto __pyx_L5_argtuple_error;
6489  } else {
6490  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6491  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6492  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6493  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6494  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6495  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6496  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6497  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6498  }
6499  __pyx_v_inverseJ = ((PyArrayObject *)values[0]);
6500  __pyx_v_dmt = ((PyArrayObject *)values[1]);
6501  __pyx_v_dm = ((PyArrayObject *)values[2]);
6502  __pyx_v_f = ((PyArrayObject *)values[3]);
6503  __pyx_v_a = ((PyArrayObject *)values[4]);
6504  __pyx_v_tau0 = ((PyArrayObject *)values[5]);
6505  __pyx_v_tau1 = ((PyArrayObject *)values[6]);
6506  __pyx_v_cfl = ((PyArrayObject *)values[7]);
6507  }
6508  goto __pyx_L4_argument_unpacking_done;
6509  __pyx_L5_argtuple_error:;
6510  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1228, __pyx_L3_error)
6511  __pyx_L3_error:;
6512  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes2D_generic_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
6513  __Pyx_RefNannyFinishContext();
6514  return NULL;
6515  __pyx_L4_argument_unpacking_done:;
6516  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inverseJ), __pyx_ptype_5numpy_ndarray, 1, "inverseJ", 0))) __PYX_ERR(0, 1228, __pyx_L1_error)
6517  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 1229, __pyx_L1_error)
6518  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1230, __pyx_L1_error)
6519  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
6520  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1232, __pyx_L1_error)
6521  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1233, __pyx_L1_error)
6522  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1234, __pyx_L1_error)
6523  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 1235, __pyx_L1_error)
6524  __pyx_r = __pyx_pf_13csubgridError_34calculateSubgridErrorNavierStokes2D_generic_tau(__pyx_self, __pyx_v_inverseJ, __pyx_v_dmt, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_cfl);
6525 
6526  /* function exit code */
6527  goto __pyx_L0;
6528  __pyx_L1_error:;
6529  __pyx_r = NULL;
6530  __pyx_L0:;
6531  __Pyx_RefNannyFinishContext();
6532  return __pyx_r;
6533 }
6534 
6535 static PyObject *__pyx_pf_13csubgridError_34calculateSubgridErrorNavierStokes2D_generic_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl) {
6536  PyObject *__pyx_r = NULL;
6537  __Pyx_RefNannyDeclarations
6538  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_tau", 0);
6539 
6540  /* "csubgridError.pyx":1236
6541  * np.ndarray tau1,
6542  * np.ndarray cfl):
6543  * ccalculateSubgridErrorNavierStokes2D_generic_tau(f.shape[0], # <<<<<<<<<<<<<<
6544  * f.shape[1],
6545  * f.shape[2],
6546  */
6547  calculateSubgridErrorNavierStokes2D_generic_tau((__pyx_v_f->dimensions[0]), (__pyx_v_f->dimensions[1]), (__pyx_v_f->dimensions[2]), ((double *)__pyx_v_inverseJ->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_cfl->data));
6548 
6549  /* "csubgridError.pyx":1228
6550  * <double*> tau1.data,
6551  * <double*> cfl.data)
6552  * def calculateSubgridErrorNavierStokes2D_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
6553  * np.ndarray dmt,
6554  * np.ndarray dm,
6555  */
6556 
6557  /* function exit code */
6558  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6559  __Pyx_XGIVEREF(__pyx_r);
6560  __Pyx_RefNannyFinishContext();
6561  return __pyx_r;
6562 }
6563 
6564 /* "csubgridError.pyx":1247
6565  * <double*> tau1.data,
6566  * <double*> cfl.data)
6567  * def calculateSubgridErrorNavierStokes2D_generic_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
6568  * np.ndarray dmt,
6569  * np.ndarray dm,
6570  */
6571 
6572 /* Python wrapper */
6573 static PyObject *__pyx_pw_13csubgridError_37calculateSubgridErrorNavierStokes2D_generic_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6574 static PyMethodDef __pyx_mdef_13csubgridError_37calculateSubgridErrorNavierStokes2D_generic_tau_sd = {"calculateSubgridErrorNavierStokes2D_generic_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_37calculateSubgridErrorNavierStokes2D_generic_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
6575 static PyObject *__pyx_pw_13csubgridError_37calculateSubgridErrorNavierStokes2D_generic_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6576  PyArrayObject *__pyx_v_inverseJ = 0;
6577  PyArrayObject *__pyx_v_dmt = 0;
6578  PyArrayObject *__pyx_v_dm = 0;
6579  PyArrayObject *__pyx_v_f = 0;
6580  PyArrayObject *__pyx_v_a = 0;
6581  PyArrayObject *__pyx_v_tau0 = 0;
6582  PyArrayObject *__pyx_v_tau1 = 0;
6583  PyArrayObject *__pyx_v_cfl = 0;
6584  int __pyx_lineno = 0;
6585  const char *__pyx_filename = NULL;
6586  int __pyx_clineno = 0;
6587  PyObject *__pyx_r = 0;
6588  __Pyx_RefNannyDeclarations
6589  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_tau_sd (wrapper)", 0);
6590  {
6591  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inverseJ,&__pyx_n_s_dmt,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_cfl,0};
6592  PyObject* values[8] = {0,0,0,0,0,0,0,0};
6593  if (unlikely(__pyx_kwds)) {
6594  Py_ssize_t kw_args;
6595  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6596  switch (pos_args) {
6597  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6598  CYTHON_FALLTHROUGH;
6599  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6600  CYTHON_FALLTHROUGH;
6601  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6602  CYTHON_FALLTHROUGH;
6603  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6604  CYTHON_FALLTHROUGH;
6605  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6606  CYTHON_FALLTHROUGH;
6607  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6608  CYTHON_FALLTHROUGH;
6609  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6610  CYTHON_FALLTHROUGH;
6611  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6612  CYTHON_FALLTHROUGH;
6613  case 0: break;
6614  default: goto __pyx_L5_argtuple_error;
6615  }
6616  kw_args = PyDict_Size(__pyx_kwds);
6617  switch (pos_args) {
6618  case 0:
6619  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inverseJ)) != 0)) kw_args--;
6620  else goto __pyx_L5_argtuple_error;
6621  CYTHON_FALLTHROUGH;
6622  case 1:
6623  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
6624  else {
6625  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, 1); __PYX_ERR(0, 1247, __pyx_L3_error)
6626  }
6627  CYTHON_FALLTHROUGH;
6628  case 2:
6629  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
6630  else {
6631  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, 2); __PYX_ERR(0, 1247, __pyx_L3_error)
6632  }
6633  CYTHON_FALLTHROUGH;
6634  case 3:
6635  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6636  else {
6637  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, 3); __PYX_ERR(0, 1247, __pyx_L3_error)
6638  }
6639  CYTHON_FALLTHROUGH;
6640  case 4:
6641  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6642  else {
6643  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, 4); __PYX_ERR(0, 1247, __pyx_L3_error)
6644  }
6645  CYTHON_FALLTHROUGH;
6646  case 5:
6647  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
6648  else {
6649  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, 5); __PYX_ERR(0, 1247, __pyx_L3_error)
6650  }
6651  CYTHON_FALLTHROUGH;
6652  case 6:
6653  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
6654  else {
6655  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, 6); __PYX_ERR(0, 1247, __pyx_L3_error)
6656  }
6657  CYTHON_FALLTHROUGH;
6658  case 7:
6659  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
6660  else {
6661  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, 7); __PYX_ERR(0, 1247, __pyx_L3_error)
6662  }
6663  }
6664  if (unlikely(kw_args > 0)) {
6665  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes2D_generic_tau_sd") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error)
6666  }
6667  } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
6668  goto __pyx_L5_argtuple_error;
6669  } else {
6670  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6671  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6672  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6673  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6674  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6675  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6676  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6677  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6678  }
6679  __pyx_v_inverseJ = ((PyArrayObject *)values[0]);
6680  __pyx_v_dmt = ((PyArrayObject *)values[1]);
6681  __pyx_v_dm = ((PyArrayObject *)values[2]);
6682  __pyx_v_f = ((PyArrayObject *)values[3]);
6683  __pyx_v_a = ((PyArrayObject *)values[4]);
6684  __pyx_v_tau0 = ((PyArrayObject *)values[5]);
6685  __pyx_v_tau1 = ((PyArrayObject *)values[6]);
6686  __pyx_v_cfl = ((PyArrayObject *)values[7]);
6687  }
6688  goto __pyx_L4_argument_unpacking_done;
6689  __pyx_L5_argtuple_error:;
6690  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error)
6691  __pyx_L3_error:;
6692  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes2D_generic_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
6693  __Pyx_RefNannyFinishContext();
6694  return NULL;
6695  __pyx_L4_argument_unpacking_done:;
6696  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inverseJ), __pyx_ptype_5numpy_ndarray, 1, "inverseJ", 0))) __PYX_ERR(0, 1247, __pyx_L1_error)
6697  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 1248, __pyx_L1_error)
6698  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1249, __pyx_L1_error)
6699  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1250, __pyx_L1_error)
6700  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1251, __pyx_L1_error)
6701  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1252, __pyx_L1_error)
6702  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1253, __pyx_L1_error)
6703  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 1254, __pyx_L1_error)
6704  __pyx_r = __pyx_pf_13csubgridError_36calculateSubgridErrorNavierStokes2D_generic_tau_sd(__pyx_self, __pyx_v_inverseJ, __pyx_v_dmt, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_cfl);
6705 
6706  /* function exit code */
6707  goto __pyx_L0;
6708  __pyx_L1_error:;
6709  __pyx_r = NULL;
6710  __pyx_L0:;
6711  __Pyx_RefNannyFinishContext();
6712  return __pyx_r;
6713 }
6714 
6715 static PyObject *__pyx_pf_13csubgridError_36calculateSubgridErrorNavierStokes2D_generic_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl) {
6716  PyObject *__pyx_r = NULL;
6717  __Pyx_RefNannyDeclarations
6718  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_tau_sd", 0);
6719 
6720  /* "csubgridError.pyx":1255
6721  * np.ndarray tau1,
6722  * np.ndarray cfl):
6723  * ccalculateSubgridErrorNavierStokes2D_generic_tau_sd(f.shape[0], # <<<<<<<<<<<<<<
6724  * f.shape[1],
6725  * f.shape[2],
6726  */
6727  calculateSubgridErrorNavierStokes2D_generic_tau_sd((__pyx_v_f->dimensions[0]), (__pyx_v_f->dimensions[1]), (__pyx_v_f->dimensions[2]), ((double *)__pyx_v_inverseJ->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_cfl->data));
6728 
6729  /* "csubgridError.pyx":1247
6730  * <double*> tau1.data,
6731  * <double*> cfl.data)
6732  * def calculateSubgridErrorNavierStokes2D_generic_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
6733  * np.ndarray dmt,
6734  * np.ndarray dm,
6735  */
6736 
6737  /* function exit code */
6738  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6739  __Pyx_XGIVEREF(__pyx_r);
6740  __Pyx_RefNannyFinishContext();
6741  return __pyx_r;
6742 }
6743 
6744 /* "csubgridError.pyx":1266
6745  * <double*> tau1.data,
6746  * <double*> cfl.data)
6747  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
6748  * np.ndarray dmt,
6749  * np.ndarray dm,
6750  */
6751 
6752 /* Python wrapper */
6753 static PyObject *__pyx_pw_13csubgridError_39calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6754 static PyMethodDef __pyx_mdef_13csubgridError_39calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau = {"calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_39calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau, METH_VARARGS|METH_KEYWORDS, 0};
6755 static PyObject *__pyx_pw_13csubgridError_39calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6756  PyArrayObject *__pyx_v_inverseJ = 0;
6757  PyArrayObject *__pyx_v_dmt = 0;
6758  PyArrayObject *__pyx_v_dm = 0;
6759  PyArrayObject *__pyx_v_f = 0;
6760  PyArrayObject *__pyx_v_a = 0;
6761  PyArrayObject *__pyx_v_dr = 0;
6762  PyArrayObject *__pyx_v_tau0 = 0;
6763  PyArrayObject *__pyx_v_tau1 = 0;
6764  PyArrayObject *__pyx_v_cfl = 0;
6765  int __pyx_lineno = 0;
6766  const char *__pyx_filename = NULL;
6767  int __pyx_clineno = 0;
6768  PyObject *__pyx_r = 0;
6769  __Pyx_RefNannyDeclarations
6770  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau (wrapper)", 0);
6771  {
6772  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inverseJ,&__pyx_n_s_dmt,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_dr,&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_cfl,0};
6773  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
6774  if (unlikely(__pyx_kwds)) {
6775  Py_ssize_t kw_args;
6776  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6777  switch (pos_args) {
6778  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6779  CYTHON_FALLTHROUGH;
6780  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6781  CYTHON_FALLTHROUGH;
6782  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6783  CYTHON_FALLTHROUGH;
6784  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6785  CYTHON_FALLTHROUGH;
6786  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6787  CYTHON_FALLTHROUGH;
6788  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6789  CYTHON_FALLTHROUGH;
6790  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6791  CYTHON_FALLTHROUGH;
6792  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6793  CYTHON_FALLTHROUGH;
6794  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6795  CYTHON_FALLTHROUGH;
6796  case 0: break;
6797  default: goto __pyx_L5_argtuple_error;
6798  }
6799  kw_args = PyDict_Size(__pyx_kwds);
6800  switch (pos_args) {
6801  case 0:
6802  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inverseJ)) != 0)) kw_args--;
6803  else goto __pyx_L5_argtuple_error;
6804  CYTHON_FALLTHROUGH;
6805  case 1:
6806  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
6807  else {
6808  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 1); __PYX_ERR(0, 1266, __pyx_L3_error)
6809  }
6810  CYTHON_FALLTHROUGH;
6811  case 2:
6812  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
6813  else {
6814  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 2); __PYX_ERR(0, 1266, __pyx_L3_error)
6815  }
6816  CYTHON_FALLTHROUGH;
6817  case 3:
6818  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6819  else {
6820  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 3); __PYX_ERR(0, 1266, __pyx_L3_error)
6821  }
6822  CYTHON_FALLTHROUGH;
6823  case 4:
6824  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6825  else {
6826  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 4); __PYX_ERR(0, 1266, __pyx_L3_error)
6827  }
6828  CYTHON_FALLTHROUGH;
6829  case 5:
6830  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dr)) != 0)) kw_args--;
6831  else {
6832  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 5); __PYX_ERR(0, 1266, __pyx_L3_error)
6833  }
6834  CYTHON_FALLTHROUGH;
6835  case 6:
6836  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
6837  else {
6838  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 6); __PYX_ERR(0, 1266, __pyx_L3_error)
6839  }
6840  CYTHON_FALLTHROUGH;
6841  case 7:
6842  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
6843  else {
6844  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 7); __PYX_ERR(0, 1266, __pyx_L3_error)
6845  }
6846  CYTHON_FALLTHROUGH;
6847  case 8:
6848  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
6849  else {
6850  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, 8); __PYX_ERR(0, 1266, __pyx_L3_error)
6851  }
6852  }
6853  if (unlikely(kw_args > 0)) {
6854  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau") < 0)) __PYX_ERR(0, 1266, __pyx_L3_error)
6855  }
6856  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
6857  goto __pyx_L5_argtuple_error;
6858  } else {
6859  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6860  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6861  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6862  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6863  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6864  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6865  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6866  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6867  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6868  }
6869  __pyx_v_inverseJ = ((PyArrayObject *)values[0]);
6870  __pyx_v_dmt = ((PyArrayObject *)values[1]);
6871  __pyx_v_dm = ((PyArrayObject *)values[2]);
6872  __pyx_v_f = ((PyArrayObject *)values[3]);
6873  __pyx_v_a = ((PyArrayObject *)values[4]);
6874  __pyx_v_dr = ((PyArrayObject *)values[5]);
6875  __pyx_v_tau0 = ((PyArrayObject *)values[6]);
6876  __pyx_v_tau1 = ((PyArrayObject *)values[7]);
6877  __pyx_v_cfl = ((PyArrayObject *)values[8]);
6878  }
6879  goto __pyx_L4_argument_unpacking_done;
6880  __pyx_L5_argtuple_error:;
6881  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1266, __pyx_L3_error)
6882  __pyx_L3_error:;
6883  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
6884  __Pyx_RefNannyFinishContext();
6885  return NULL;
6886  __pyx_L4_argument_unpacking_done:;
6887  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inverseJ), __pyx_ptype_5numpy_ndarray, 1, "inverseJ", 0))) __PYX_ERR(0, 1266, __pyx_L1_error)
6888  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 1267, __pyx_L1_error)
6889  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1268, __pyx_L1_error)
6890  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1269, __pyx_L1_error)
6891  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1270, __pyx_L1_error)
6892  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dr), __pyx_ptype_5numpy_ndarray, 1, "dr", 0))) __PYX_ERR(0, 1271, __pyx_L1_error)
6893  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1272, __pyx_L1_error)
6894  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1273, __pyx_L1_error)
6895  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 1274, __pyx_L1_error)
6896  __pyx_r = __pyx_pf_13csubgridError_38calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(__pyx_self, __pyx_v_inverseJ, __pyx_v_dmt, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_dr, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_cfl);
6897 
6898  /* function exit code */
6899  goto __pyx_L0;
6900  __pyx_L1_error:;
6901  __pyx_r = NULL;
6902  __pyx_L0:;
6903  __Pyx_RefNannyFinishContext();
6904  return __pyx_r;
6905 }
6906 
6907 static PyObject *__pyx_pf_13csubgridError_38calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl) {
6908  PyObject *__pyx_r = NULL;
6909  __Pyx_RefNannyDeclarations
6910  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau", 0);
6911 
6912  /* "csubgridError.pyx":1275
6913  * np.ndarray tau1,
6914  * np.ndarray cfl):
6915  * ccalculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(f.shape[0], # <<<<<<<<<<<<<<
6916  * f.shape[1],
6917  * f.shape[2],
6918  */
6919  calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau((__pyx_v_f->dimensions[0]), (__pyx_v_f->dimensions[1]), (__pyx_v_f->dimensions[2]), ((double *)__pyx_v_inverseJ->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_dr->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_cfl->data));
6920 
6921  /* "csubgridError.pyx":1266
6922  * <double*> tau1.data,
6923  * <double*> cfl.data)
6924  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
6925  * np.ndarray dmt,
6926  * np.ndarray dm,
6927  */
6928 
6929  /* function exit code */
6930  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6931  __Pyx_XGIVEREF(__pyx_r);
6932  __Pyx_RefNannyFinishContext();
6933  return __pyx_r;
6934 }
6935 
6936 /* "csubgridError.pyx":1287
6937  * <double*> tau1.data,
6938  * <double*> cfl.data)
6939  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
6940  * np.ndarray dmt,
6941  * np.ndarray dm,
6942  */
6943 
6944 /* Python wrapper */
6945 static PyObject *__pyx_pw_13csubgridError_41calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6946 static PyMethodDef __pyx_mdef_13csubgridError_41calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd = {"calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_41calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
6947 static PyObject *__pyx_pw_13csubgridError_41calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6948  PyArrayObject *__pyx_v_inverseJ = 0;
6949  PyArrayObject *__pyx_v_dmt = 0;
6950  PyArrayObject *__pyx_v_dm = 0;
6951  PyArrayObject *__pyx_v_f = 0;
6952  PyArrayObject *__pyx_v_a = 0;
6953  PyArrayObject *__pyx_v_dr = 0;
6954  PyArrayObject *__pyx_v_tau0 = 0;
6955  PyArrayObject *__pyx_v_tau1 = 0;
6956  PyArrayObject *__pyx_v_cfl = 0;
6957  int __pyx_lineno = 0;
6958  const char *__pyx_filename = NULL;
6959  int __pyx_clineno = 0;
6960  PyObject *__pyx_r = 0;
6961  __Pyx_RefNannyDeclarations
6962  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd (wrapper)", 0);
6963  {
6964  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inverseJ,&__pyx_n_s_dmt,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_dr,&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_cfl,0};
6965  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
6966  if (unlikely(__pyx_kwds)) {
6967  Py_ssize_t kw_args;
6968  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6969  switch (pos_args) {
6970  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6971  CYTHON_FALLTHROUGH;
6972  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6973  CYTHON_FALLTHROUGH;
6974  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6975  CYTHON_FALLTHROUGH;
6976  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6977  CYTHON_FALLTHROUGH;
6978  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6979  CYTHON_FALLTHROUGH;
6980  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6981  CYTHON_FALLTHROUGH;
6982  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6983  CYTHON_FALLTHROUGH;
6984  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6985  CYTHON_FALLTHROUGH;
6986  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6987  CYTHON_FALLTHROUGH;
6988  case 0: break;
6989  default: goto __pyx_L5_argtuple_error;
6990  }
6991  kw_args = PyDict_Size(__pyx_kwds);
6992  switch (pos_args) {
6993  case 0:
6994  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inverseJ)) != 0)) kw_args--;
6995  else goto __pyx_L5_argtuple_error;
6996  CYTHON_FALLTHROUGH;
6997  case 1:
6998  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
6999  else {
7000  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 1); __PYX_ERR(0, 1287, __pyx_L3_error)
7001  }
7002  CYTHON_FALLTHROUGH;
7003  case 2:
7004  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
7005  else {
7006  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 2); __PYX_ERR(0, 1287, __pyx_L3_error)
7007  }
7008  CYTHON_FALLTHROUGH;
7009  case 3:
7010  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
7011  else {
7012  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 3); __PYX_ERR(0, 1287, __pyx_L3_error)
7013  }
7014  CYTHON_FALLTHROUGH;
7015  case 4:
7016  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
7017  else {
7018  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 4); __PYX_ERR(0, 1287, __pyx_L3_error)
7019  }
7020  CYTHON_FALLTHROUGH;
7021  case 5:
7022  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dr)) != 0)) kw_args--;
7023  else {
7024  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 5); __PYX_ERR(0, 1287, __pyx_L3_error)
7025  }
7026  CYTHON_FALLTHROUGH;
7027  case 6:
7028  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
7029  else {
7030  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 6); __PYX_ERR(0, 1287, __pyx_L3_error)
7031  }
7032  CYTHON_FALLTHROUGH;
7033  case 7:
7034  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
7035  else {
7036  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 7); __PYX_ERR(0, 1287, __pyx_L3_error)
7037  }
7038  CYTHON_FALLTHROUGH;
7039  case 8:
7040  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
7041  else {
7042  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, 8); __PYX_ERR(0, 1287, __pyx_L3_error)
7043  }
7044  }
7045  if (unlikely(kw_args > 0)) {
7046  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd") < 0)) __PYX_ERR(0, 1287, __pyx_L3_error)
7047  }
7048  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
7049  goto __pyx_L5_argtuple_error;
7050  } else {
7051  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7052  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7053  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7054  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7055  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7056  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7057  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7058  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7059  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7060  }
7061  __pyx_v_inverseJ = ((PyArrayObject *)values[0]);
7062  __pyx_v_dmt = ((PyArrayObject *)values[1]);
7063  __pyx_v_dm = ((PyArrayObject *)values[2]);
7064  __pyx_v_f = ((PyArrayObject *)values[3]);
7065  __pyx_v_a = ((PyArrayObject *)values[4]);
7066  __pyx_v_dr = ((PyArrayObject *)values[5]);
7067  __pyx_v_tau0 = ((PyArrayObject *)values[6]);
7068  __pyx_v_tau1 = ((PyArrayObject *)values[7]);
7069  __pyx_v_cfl = ((PyArrayObject *)values[8]);
7070  }
7071  goto __pyx_L4_argument_unpacking_done;
7072  __pyx_L5_argtuple_error:;
7073  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1287, __pyx_L3_error)
7074  __pyx_L3_error:;
7075  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
7076  __Pyx_RefNannyFinishContext();
7077  return NULL;
7078  __pyx_L4_argument_unpacking_done:;
7079  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inverseJ), __pyx_ptype_5numpy_ndarray, 1, "inverseJ", 0))) __PYX_ERR(0, 1287, __pyx_L1_error)
7080  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 1288, __pyx_L1_error)
7081  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1289, __pyx_L1_error)
7082  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1290, __pyx_L1_error)
7083  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1291, __pyx_L1_error)
7084  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dr), __pyx_ptype_5numpy_ndarray, 1, "dr", 0))) __PYX_ERR(0, 1292, __pyx_L1_error)
7085  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1293, __pyx_L1_error)
7086  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1294, __pyx_L1_error)
7087  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 1295, __pyx_L1_error)
7088  __pyx_r = __pyx_pf_13csubgridError_40calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(__pyx_self, __pyx_v_inverseJ, __pyx_v_dmt, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_dr, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_cfl);
7089 
7090  /* function exit code */
7091  goto __pyx_L0;
7092  __pyx_L1_error:;
7093  __pyx_r = NULL;
7094  __pyx_L0:;
7095  __Pyx_RefNannyFinishContext();
7096  return __pyx_r;
7097 }
7098 
7099 static PyObject *__pyx_pf_13csubgridError_40calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_cfl) {
7100  PyObject *__pyx_r = NULL;
7101  __Pyx_RefNannyDeclarations
7102  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd", 0);
7103 
7104  /* "csubgridError.pyx":1296
7105  * np.ndarray tau1,
7106  * np.ndarray cfl):
7107  * ccalculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(f.shape[0], # <<<<<<<<<<<<<<
7108  * f.shape[1],
7109  * f.shape[2],
7110  */
7111  calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd((__pyx_v_f->dimensions[0]), (__pyx_v_f->dimensions[1]), (__pyx_v_f->dimensions[2]), ((double *)__pyx_v_inverseJ->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_dr->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_cfl->data));
7112 
7113  /* "csubgridError.pyx":1287
7114  * <double*> tau1.data,
7115  * <double*> cfl.data)
7116  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
7117  * np.ndarray dmt,
7118  * np.ndarray dm,
7119  */
7120 
7121  /* function exit code */
7122  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7123  __Pyx_XGIVEREF(__pyx_r);
7124  __Pyx_RefNannyFinishContext();
7125  return __pyx_r;
7126 }
7127 
7128 /* "csubgridError.pyx":1308
7129  * <double*> tau1.data,
7130  * <double*> cfl.data)
7131  * def calculateSubgridErrorNavierStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
7132  * np.ndarray tau1,
7133  * np.ndarray pdeResidualP,
7134  */
7135 
7136 /* Python wrapper */
7137 static PyObject *__pyx_pw_13csubgridError_43calculateSubgridErrorNavierStokes2D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7138 static PyMethodDef __pyx_mdef_13csubgridError_43calculateSubgridErrorNavierStokes2D_GLS_tauRes = {"calculateSubgridErrorNavierStokes2D_GLS_tauRes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_43calculateSubgridErrorNavierStokes2D_GLS_tauRes, METH_VARARGS|METH_KEYWORDS, 0};
7139 static PyObject *__pyx_pw_13csubgridError_43calculateSubgridErrorNavierStokes2D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7140  PyArrayObject *__pyx_v_tau0 = 0;
7141  PyArrayObject *__pyx_v_tau1 = 0;
7142  PyArrayObject *__pyx_v_pdeResidualP = 0;
7143  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
7144  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
7145  PyArrayObject *__pyx_v_pdeResidualU = 0;
7146  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
7147  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
7148  PyArrayObject *__pyx_v_dpdeResidualU_dv = 0;
7149  PyArrayObject *__pyx_v_pdeResidualV = 0;
7150  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
7151  PyArrayObject *__pyx_v_dpdeResidualV_du = 0;
7152  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
7153  PyArrayObject *__pyx_v_subgridErrorP = 0;
7154  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
7155  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
7156  PyArrayObject *__pyx_v_subgridErrorU = 0;
7157  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
7158  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
7159  PyArrayObject *__pyx_v_dsubgridErrorU_dv = 0;
7160  PyArrayObject *__pyx_v_subgridErrorV = 0;
7161  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
7162  PyArrayObject *__pyx_v_dsubgridErrorV_du = 0;
7163  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
7164  int __pyx_lineno = 0;
7165  const char *__pyx_filename = NULL;
7166  int __pyx_clineno = 0;
7167  PyObject *__pyx_r = 0;
7168  __Pyx_RefNannyDeclarations
7169  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_GLS_tauRes (wrapper)", 0);
7170  {
7171  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_dpdeResidualU_dv,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_du,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_dsubgridErrorU_dv,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_du,&__pyx_n_s_dsubgridErrorV_dv,0};
7172  PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
7173  if (unlikely(__pyx_kwds)) {
7174  Py_ssize_t kw_args;
7175  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7176  switch (pos_args) {
7177  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
7178  CYTHON_FALLTHROUGH;
7179  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
7180  CYTHON_FALLTHROUGH;
7181  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
7182  CYTHON_FALLTHROUGH;
7183  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
7184  CYTHON_FALLTHROUGH;
7185  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
7186  CYTHON_FALLTHROUGH;
7187  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
7188  CYTHON_FALLTHROUGH;
7189  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
7190  CYTHON_FALLTHROUGH;
7191  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
7192  CYTHON_FALLTHROUGH;
7193  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
7194  CYTHON_FALLTHROUGH;
7195  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
7196  CYTHON_FALLTHROUGH;
7197  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
7198  CYTHON_FALLTHROUGH;
7199  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
7200  CYTHON_FALLTHROUGH;
7201  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7202  CYTHON_FALLTHROUGH;
7203  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7204  CYTHON_FALLTHROUGH;
7205  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7206  CYTHON_FALLTHROUGH;
7207  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7208  CYTHON_FALLTHROUGH;
7209  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7210  CYTHON_FALLTHROUGH;
7211  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7212  CYTHON_FALLTHROUGH;
7213  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7214  CYTHON_FALLTHROUGH;
7215  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7216  CYTHON_FALLTHROUGH;
7217  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7218  CYTHON_FALLTHROUGH;
7219  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7220  CYTHON_FALLTHROUGH;
7221  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7222  CYTHON_FALLTHROUGH;
7223  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7224  CYTHON_FALLTHROUGH;
7225  case 0: break;
7226  default: goto __pyx_L5_argtuple_error;
7227  }
7228  kw_args = PyDict_Size(__pyx_kwds);
7229  switch (pos_args) {
7230  case 0:
7231  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
7232  else goto __pyx_L5_argtuple_error;
7233  CYTHON_FALLTHROUGH;
7234  case 1:
7235  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
7236  else {
7237  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 1); __PYX_ERR(0, 1308, __pyx_L3_error)
7238  }
7239  CYTHON_FALLTHROUGH;
7240  case 2:
7241  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
7242  else {
7243  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 2); __PYX_ERR(0, 1308, __pyx_L3_error)
7244  }
7245  CYTHON_FALLTHROUGH;
7246  case 3:
7247  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
7248  else {
7249  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 3); __PYX_ERR(0, 1308, __pyx_L3_error)
7250  }
7251  CYTHON_FALLTHROUGH;
7252  case 4:
7253  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
7254  else {
7255  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 4); __PYX_ERR(0, 1308, __pyx_L3_error)
7256  }
7257  CYTHON_FALLTHROUGH;
7258  case 5:
7259  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
7260  else {
7261  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 5); __PYX_ERR(0, 1308, __pyx_L3_error)
7262  }
7263  CYTHON_FALLTHROUGH;
7264  case 6:
7265  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
7266  else {
7267  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 6); __PYX_ERR(0, 1308, __pyx_L3_error)
7268  }
7269  CYTHON_FALLTHROUGH;
7270  case 7:
7271  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
7272  else {
7273  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 7); __PYX_ERR(0, 1308, __pyx_L3_error)
7274  }
7275  CYTHON_FALLTHROUGH;
7276  case 8:
7277  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dv)) != 0)) kw_args--;
7278  else {
7279  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 8); __PYX_ERR(0, 1308, __pyx_L3_error)
7280  }
7281  CYTHON_FALLTHROUGH;
7282  case 9:
7283  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
7284  else {
7285  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 9); __PYX_ERR(0, 1308, __pyx_L3_error)
7286  }
7287  CYTHON_FALLTHROUGH;
7288  case 10:
7289  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
7290  else {
7291  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 10); __PYX_ERR(0, 1308, __pyx_L3_error)
7292  }
7293  CYTHON_FALLTHROUGH;
7294  case 11:
7295  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_du)) != 0)) kw_args--;
7296  else {
7297  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 11); __PYX_ERR(0, 1308, __pyx_L3_error)
7298  }
7299  CYTHON_FALLTHROUGH;
7300  case 12:
7301  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
7302  else {
7303  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 12); __PYX_ERR(0, 1308, __pyx_L3_error)
7304  }
7305  CYTHON_FALLTHROUGH;
7306  case 13:
7307  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
7308  else {
7309  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 13); __PYX_ERR(0, 1308, __pyx_L3_error)
7310  }
7311  CYTHON_FALLTHROUGH;
7312  case 14:
7313  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
7314  else {
7315  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 14); __PYX_ERR(0, 1308, __pyx_L3_error)
7316  }
7317  CYTHON_FALLTHROUGH;
7318  case 15:
7319  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
7320  else {
7321  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 15); __PYX_ERR(0, 1308, __pyx_L3_error)
7322  }
7323  CYTHON_FALLTHROUGH;
7324  case 16:
7325  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
7326  else {
7327  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 16); __PYX_ERR(0, 1308, __pyx_L3_error)
7328  }
7329  CYTHON_FALLTHROUGH;
7330  case 17:
7331  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
7332  else {
7333  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 17); __PYX_ERR(0, 1308, __pyx_L3_error)
7334  }
7335  CYTHON_FALLTHROUGH;
7336  case 18:
7337  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
7338  else {
7339  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 18); __PYX_ERR(0, 1308, __pyx_L3_error)
7340  }
7341  CYTHON_FALLTHROUGH;
7342  case 19:
7343  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dv)) != 0)) kw_args--;
7344  else {
7345  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 19); __PYX_ERR(0, 1308, __pyx_L3_error)
7346  }
7347  CYTHON_FALLTHROUGH;
7348  case 20:
7349  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
7350  else {
7351  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 20); __PYX_ERR(0, 1308, __pyx_L3_error)
7352  }
7353  CYTHON_FALLTHROUGH;
7354  case 21:
7355  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
7356  else {
7357  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 21); __PYX_ERR(0, 1308, __pyx_L3_error)
7358  }
7359  CYTHON_FALLTHROUGH;
7360  case 22:
7361  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_du)) != 0)) kw_args--;
7362  else {
7363  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 22); __PYX_ERR(0, 1308, __pyx_L3_error)
7364  }
7365  CYTHON_FALLTHROUGH;
7366  case 23:
7367  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
7368  else {
7369  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, 23); __PYX_ERR(0, 1308, __pyx_L3_error)
7370  }
7371  }
7372  if (unlikely(kw_args > 0)) {
7373  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes2D_GLS_tauRes") < 0)) __PYX_ERR(0, 1308, __pyx_L3_error)
7374  }
7375  } else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
7376  goto __pyx_L5_argtuple_error;
7377  } else {
7378  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7379  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7380  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7381  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7382  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7383  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7384  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7385  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7386  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7387  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7388  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7389  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7390  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
7391  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
7392  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
7393  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
7394  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
7395  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
7396  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
7397  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
7398  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
7399  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
7400  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
7401  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
7402  }
7403  __pyx_v_tau0 = ((PyArrayObject *)values[0]);
7404  __pyx_v_tau1 = ((PyArrayObject *)values[1]);
7405  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
7406  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
7407  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
7408  __pyx_v_pdeResidualU = ((PyArrayObject *)values[5]);
7409  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[6]);
7410  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[7]);
7411  __pyx_v_dpdeResidualU_dv = ((PyArrayObject *)values[8]);
7412  __pyx_v_pdeResidualV = ((PyArrayObject *)values[9]);
7413  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[10]);
7414  __pyx_v_dpdeResidualV_du = ((PyArrayObject *)values[11]);
7415  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[12]);
7416  __pyx_v_subgridErrorP = ((PyArrayObject *)values[13]);
7417  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[14]);
7418  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[15]);
7419  __pyx_v_subgridErrorU = ((PyArrayObject *)values[16]);
7420  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[17]);
7421  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[18]);
7422  __pyx_v_dsubgridErrorU_dv = ((PyArrayObject *)values[19]);
7423  __pyx_v_subgridErrorV = ((PyArrayObject *)values[20]);
7424  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[21]);
7425  __pyx_v_dsubgridErrorV_du = ((PyArrayObject *)values[22]);
7426  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[23]);
7427  }
7428  goto __pyx_L4_argument_unpacking_done;
7429  __pyx_L5_argtuple_error:;
7430  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1308, __pyx_L3_error)
7431  __pyx_L3_error:;
7432  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes2D_GLS_tauRes", __pyx_clineno, __pyx_lineno, __pyx_filename);
7433  __Pyx_RefNannyFinishContext();
7434  return NULL;
7435  __pyx_L4_argument_unpacking_done:;
7436  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1308, __pyx_L1_error)
7437  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1309, __pyx_L1_error)
7438  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1310, __pyx_L1_error)
7439  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1311, __pyx_L1_error)
7440  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1312, __pyx_L1_error)
7441  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
7442  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1314, __pyx_L1_error)
7443  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1315, __pyx_L1_error)
7444  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dv", 0))) __PYX_ERR(0, 1316, __pyx_L1_error)
7445  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1317, __pyx_L1_error)
7446  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1318, __pyx_L1_error)
7447  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_du", 0))) __PYX_ERR(0, 1319, __pyx_L1_error)
7448  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1320, __pyx_L1_error)
7449  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1321, __pyx_L1_error)
7450  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1322, __pyx_L1_error)
7451  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1323, __pyx_L1_error)
7452  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1324, __pyx_L1_error)
7453  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1325, __pyx_L1_error)
7454  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1326, __pyx_L1_error)
7455  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dv", 0))) __PYX_ERR(0, 1327, __pyx_L1_error)
7456  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1328, __pyx_L1_error)
7457  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1329, __pyx_L1_error)
7458  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_du", 0))) __PYX_ERR(0, 1330, __pyx_L1_error)
7459  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1331, __pyx_L1_error)
7460  __pyx_r = __pyx_pf_13csubgridError_42calculateSubgridErrorNavierStokes2D_GLS_tauRes(__pyx_self, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_dpdeResidualU_dv, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_du, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_dsubgridErrorU_dv, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_du, __pyx_v_dsubgridErrorV_dv);
7461 
7462  /* function exit code */
7463  goto __pyx_L0;
7464  __pyx_L1_error:;
7465  __pyx_r = NULL;
7466  __pyx_L0:;
7467  __Pyx_RefNannyFinishContext();
7468  return __pyx_r;
7469 }
7470 
7471 static PyObject *__pyx_pf_13csubgridError_42calculateSubgridErrorNavierStokes2D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_dpdeResidualU_dv, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_du, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
7472  PyObject *__pyx_r = NULL;
7473  __Pyx_RefNannyDeclarations
7474  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes2D_GLS_tauRes", 0);
7475 
7476  /* "csubgridError.pyx":1332
7477  * np.ndarray dsubgridErrorV_du,
7478  * np.ndarray dsubgridErrorV_dv):
7479  * ccalculateSubgridErrorNavierStokes2D_GLS_tauRes(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
7480  * dsubgridErrorP_du.shape[1],
7481  * dsubgridErrorP_du.shape[2],
7482  */
7483  calculateSubgridErrorNavierStokes2D_GLS_tauRes((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 2, ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_dpdeResidualU_dv->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_du->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_dsubgridErrorU_dv->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_du->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
7484 
7485  /* "csubgridError.pyx":1308
7486  * <double*> tau1.data,
7487  * <double*> cfl.data)
7488  * def calculateSubgridErrorNavierStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
7489  * np.ndarray tau1,
7490  * np.ndarray pdeResidualP,
7491  */
7492 
7493  /* function exit code */
7494  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7495  __Pyx_XGIVEREF(__pyx_r);
7496  __Pyx_RefNannyFinishContext();
7497  return __pyx_r;
7498 }
7499 
7500 /* "csubgridError.pyx":1360
7501  * <double*> dsubgridErrorV_du.data,
7502  * <double*> dsubgridErrorV_dv.data)
7503  * def calculateSubgridErrorStokes_GLS_tau(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
7504  * np.ndarray dH,
7505  * np.ndarray a,
7506  */
7507 
7508 /* Python wrapper */
7509 static PyObject *__pyx_pw_13csubgridError_45calculateSubgridErrorStokes_GLS_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7510 static PyMethodDef __pyx_mdef_13csubgridError_45calculateSubgridErrorStokes_GLS_tau = {"calculateSubgridErrorStokes_GLS_tau", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_45calculateSubgridErrorStokes_GLS_tau, METH_VARARGS|METH_KEYWORDS, 0};
7511 static PyObject *__pyx_pw_13csubgridError_45calculateSubgridErrorStokes_GLS_tau(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7512  PyArrayObject *__pyx_v_elementDiameter = 0;
7513  PyArrayObject *__pyx_v_dH = 0;
7514  PyArrayObject *__pyx_v_a = 0;
7515  PyArrayObject *__pyx_v_tau0 = 0;
7516  PyArrayObject *__pyx_v_tau1 = 0;
7517  int __pyx_lineno = 0;
7518  const char *__pyx_filename = NULL;
7519  int __pyx_clineno = 0;
7520  PyObject *__pyx_r = 0;
7521  __Pyx_RefNannyDeclarations
7522  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes_GLS_tau (wrapper)", 0);
7523  {
7524  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_dH,&__pyx_n_s_a,&__pyx_n_s_tau0,&__pyx_n_s_tau1,0};
7525  PyObject* values[5] = {0,0,0,0,0};
7526  if (unlikely(__pyx_kwds)) {
7527  Py_ssize_t kw_args;
7528  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7529  switch (pos_args) {
7530  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7531  CYTHON_FALLTHROUGH;
7532  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7533  CYTHON_FALLTHROUGH;
7534  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7535  CYTHON_FALLTHROUGH;
7536  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7537  CYTHON_FALLTHROUGH;
7538  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7539  CYTHON_FALLTHROUGH;
7540  case 0: break;
7541  default: goto __pyx_L5_argtuple_error;
7542  }
7543  kw_args = PyDict_Size(__pyx_kwds);
7544  switch (pos_args) {
7545  case 0:
7546  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
7547  else goto __pyx_L5_argtuple_error;
7548  CYTHON_FALLTHROUGH;
7549  case 1:
7550  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dH)) != 0)) kw_args--;
7551  else {
7552  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau", 1, 5, 5, 1); __PYX_ERR(0, 1360, __pyx_L3_error)
7553  }
7554  CYTHON_FALLTHROUGH;
7555  case 2:
7556  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
7557  else {
7558  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau", 1, 5, 5, 2); __PYX_ERR(0, 1360, __pyx_L3_error)
7559  }
7560  CYTHON_FALLTHROUGH;
7561  case 3:
7562  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
7563  else {
7564  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau", 1, 5, 5, 3); __PYX_ERR(0, 1360, __pyx_L3_error)
7565  }
7566  CYTHON_FALLTHROUGH;
7567  case 4:
7568  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
7569  else {
7570  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau", 1, 5, 5, 4); __PYX_ERR(0, 1360, __pyx_L3_error)
7571  }
7572  }
7573  if (unlikely(kw_args > 0)) {
7574  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes_GLS_tau") < 0)) __PYX_ERR(0, 1360, __pyx_L3_error)
7575  }
7576  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
7577  goto __pyx_L5_argtuple_error;
7578  } else {
7579  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7580  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7581  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7582  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7583  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7584  }
7585  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
7586  __pyx_v_dH = ((PyArrayObject *)values[1]);
7587  __pyx_v_a = ((PyArrayObject *)values[2]);
7588  __pyx_v_tau0 = ((PyArrayObject *)values[3]);
7589  __pyx_v_tau1 = ((PyArrayObject *)values[4]);
7590  }
7591  goto __pyx_L4_argument_unpacking_done;
7592  __pyx_L5_argtuple_error:;
7593  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1360, __pyx_L3_error)
7594  __pyx_L3_error:;
7595  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes_GLS_tau", __pyx_clineno, __pyx_lineno, __pyx_filename);
7596  __Pyx_RefNannyFinishContext();
7597  return NULL;
7598  __pyx_L4_argument_unpacking_done:;
7599  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1360, __pyx_L1_error)
7600  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dH), __pyx_ptype_5numpy_ndarray, 1, "dH", 0))) __PYX_ERR(0, 1361, __pyx_L1_error)
7601  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1362, __pyx_L1_error)
7602  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1363, __pyx_L1_error)
7603  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1364, __pyx_L1_error)
7604  __pyx_r = __pyx_pf_13csubgridError_44calculateSubgridErrorStokes_GLS_tau(__pyx_self, __pyx_v_elementDiameter, __pyx_v_dH, __pyx_v_a, __pyx_v_tau0, __pyx_v_tau1);
7605 
7606  /* function exit code */
7607  goto __pyx_L0;
7608  __pyx_L1_error:;
7609  __pyx_r = NULL;
7610  __pyx_L0:;
7611  __Pyx_RefNannyFinishContext();
7612  return __pyx_r;
7613 }
7614 
7615 static PyObject *__pyx_pf_13csubgridError_44calculateSubgridErrorStokes_GLS_tau(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1) {
7616  PyObject *__pyx_r = NULL;
7617  __Pyx_RefNannyDeclarations
7618  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes_GLS_tau", 0);
7619 
7620  /* "csubgridError.pyx":1365
7621  * np.ndarray tau0,
7622  * np.ndarray tau1):
7623  * ccalculateSubgridErrorStokes_GLS_tau(dH.shape[0], # <<<<<<<<<<<<<<
7624  * dH.shape[1],
7625  * dH.shape[2],
7626  */
7627  calculateSubgridErrorStokes_GLS_tau((__pyx_v_dH->dimensions[0]), (__pyx_v_dH->dimensions[1]), (__pyx_v_dH->dimensions[2]), ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dH->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data));
7628 
7629  /* "csubgridError.pyx":1360
7630  * <double*> dsubgridErrorV_du.data,
7631  * <double*> dsubgridErrorV_dv.data)
7632  * def calculateSubgridErrorStokes_GLS_tau(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
7633  * np.ndarray dH,
7634  * np.ndarray a,
7635  */
7636 
7637  /* function exit code */
7638  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7639  __Pyx_XGIVEREF(__pyx_r);
7640  __Pyx_RefNannyFinishContext();
7641  return __pyx_r;
7642 }
7643 
7644 /* "csubgridError.pyx":1373
7645  * <double*> tau0.data,
7646  * <double*> tau1.data)
7647  * def calculateSubgridErrorStokes_GLS_tau_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
7648  * np.ndarray dH,
7649  * np.ndarray a,
7650  */
7651 
7652 /* Python wrapper */
7653 static PyObject *__pyx_pw_13csubgridError_47calculateSubgridErrorStokes_GLS_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7654 static PyMethodDef __pyx_mdef_13csubgridError_47calculateSubgridErrorStokes_GLS_tau_sd = {"calculateSubgridErrorStokes_GLS_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_47calculateSubgridErrorStokes_GLS_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
7655 static PyObject *__pyx_pw_13csubgridError_47calculateSubgridErrorStokes_GLS_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7656  PyArrayObject *__pyx_v_elementDiameter = 0;
7657  PyArrayObject *__pyx_v_dH = 0;
7658  PyArrayObject *__pyx_v_a = 0;
7659  PyArrayObject *__pyx_v_tau0 = 0;
7660  PyArrayObject *__pyx_v_tau1 = 0;
7661  int __pyx_lineno = 0;
7662  const char *__pyx_filename = NULL;
7663  int __pyx_clineno = 0;
7664  PyObject *__pyx_r = 0;
7665  __Pyx_RefNannyDeclarations
7666  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes_GLS_tau_sd (wrapper)", 0);
7667  {
7668  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_dH,&__pyx_n_s_a,&__pyx_n_s_tau0,&__pyx_n_s_tau1,0};
7669  PyObject* values[5] = {0,0,0,0,0};
7670  if (unlikely(__pyx_kwds)) {
7671  Py_ssize_t kw_args;
7672  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7673  switch (pos_args) {
7674  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7675  CYTHON_FALLTHROUGH;
7676  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7677  CYTHON_FALLTHROUGH;
7678  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7679  CYTHON_FALLTHROUGH;
7680  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7681  CYTHON_FALLTHROUGH;
7682  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7683  CYTHON_FALLTHROUGH;
7684  case 0: break;
7685  default: goto __pyx_L5_argtuple_error;
7686  }
7687  kw_args = PyDict_Size(__pyx_kwds);
7688  switch (pos_args) {
7689  case 0:
7690  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
7691  else goto __pyx_L5_argtuple_error;
7692  CYTHON_FALLTHROUGH;
7693  case 1:
7694  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dH)) != 0)) kw_args--;
7695  else {
7696  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau_sd", 1, 5, 5, 1); __PYX_ERR(0, 1373, __pyx_L3_error)
7697  }
7698  CYTHON_FALLTHROUGH;
7699  case 2:
7700  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
7701  else {
7702  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau_sd", 1, 5, 5, 2); __PYX_ERR(0, 1373, __pyx_L3_error)
7703  }
7704  CYTHON_FALLTHROUGH;
7705  case 3:
7706  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
7707  else {
7708  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau_sd", 1, 5, 5, 3); __PYX_ERR(0, 1373, __pyx_L3_error)
7709  }
7710  CYTHON_FALLTHROUGH;
7711  case 4:
7712  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
7713  else {
7714  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau_sd", 1, 5, 5, 4); __PYX_ERR(0, 1373, __pyx_L3_error)
7715  }
7716  }
7717  if (unlikely(kw_args > 0)) {
7718  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes_GLS_tau_sd") < 0)) __PYX_ERR(0, 1373, __pyx_L3_error)
7719  }
7720  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
7721  goto __pyx_L5_argtuple_error;
7722  } else {
7723  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7724  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7725  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7726  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7727  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7728  }
7729  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
7730  __pyx_v_dH = ((PyArrayObject *)values[1]);
7731  __pyx_v_a = ((PyArrayObject *)values[2]);
7732  __pyx_v_tau0 = ((PyArrayObject *)values[3]);
7733  __pyx_v_tau1 = ((PyArrayObject *)values[4]);
7734  }
7735  goto __pyx_L4_argument_unpacking_done;
7736  __pyx_L5_argtuple_error:;
7737  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes_GLS_tau_sd", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1373, __pyx_L3_error)
7738  __pyx_L3_error:;
7739  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes_GLS_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
7740  __Pyx_RefNannyFinishContext();
7741  return NULL;
7742  __pyx_L4_argument_unpacking_done:;
7743  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1373, __pyx_L1_error)
7744  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dH), __pyx_ptype_5numpy_ndarray, 1, "dH", 0))) __PYX_ERR(0, 1374, __pyx_L1_error)
7745  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1375, __pyx_L1_error)
7746  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1376, __pyx_L1_error)
7747  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1377, __pyx_L1_error)
7748  __pyx_r = __pyx_pf_13csubgridError_46calculateSubgridErrorStokes_GLS_tau_sd(__pyx_self, __pyx_v_elementDiameter, __pyx_v_dH, __pyx_v_a, __pyx_v_tau0, __pyx_v_tau1);
7749 
7750  /* function exit code */
7751  goto __pyx_L0;
7752  __pyx_L1_error:;
7753  __pyx_r = NULL;
7754  __pyx_L0:;
7755  __Pyx_RefNannyFinishContext();
7756  return __pyx_r;
7757 }
7758 
7759 static PyObject *__pyx_pf_13csubgridError_46calculateSubgridErrorStokes_GLS_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1) {
7760  PyObject *__pyx_r = NULL;
7761  __Pyx_RefNannyDeclarations
7762  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes_GLS_tau_sd", 0);
7763 
7764  /* "csubgridError.pyx":1378
7765  * np.ndarray tau0,
7766  * np.ndarray tau1):
7767  * ccalculateSubgridErrorStokes_GLS_tau_sd(dH.shape[0], # <<<<<<<<<<<<<<
7768  * dH.shape[1],
7769  * dH.shape[2],
7770  */
7771  calculateSubgridErrorStokes_GLS_tau_sd((__pyx_v_dH->dimensions[0]), (__pyx_v_dH->dimensions[1]), (__pyx_v_dH->dimensions[2]), ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dH->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data));
7772 
7773  /* "csubgridError.pyx":1373
7774  * <double*> tau0.data,
7775  * <double*> tau1.data)
7776  * def calculateSubgridErrorStokes_GLS_tau_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
7777  * np.ndarray dH,
7778  * np.ndarray a,
7779  */
7780 
7781  /* function exit code */
7782  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7783  __Pyx_XGIVEREF(__pyx_r);
7784  __Pyx_RefNannyFinishContext();
7785  return __pyx_r;
7786 }
7787 
7788 /* "csubgridError.pyx":1386
7789  * <double*> tau0.data,
7790  * <double*> tau1.data)
7791  * def calculateSubgridErrorStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
7792  * np.ndarray tau1,
7793  * np.ndarray pdeResidualP,
7794  */
7795 
7796 /* Python wrapper */
7797 static PyObject *__pyx_pw_13csubgridError_49calculateSubgridErrorStokes2D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7798 static PyMethodDef __pyx_mdef_13csubgridError_49calculateSubgridErrorStokes2D_GLS_tauRes = {"calculateSubgridErrorStokes2D_GLS_tauRes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_49calculateSubgridErrorStokes2D_GLS_tauRes, METH_VARARGS|METH_KEYWORDS, 0};
7799 static PyObject *__pyx_pw_13csubgridError_49calculateSubgridErrorStokes2D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7800  PyArrayObject *__pyx_v_tau0 = 0;
7801  PyArrayObject *__pyx_v_tau1 = 0;
7802  PyArrayObject *__pyx_v_pdeResidualP = 0;
7803  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
7804  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
7805  PyArrayObject *__pyx_v_pdeResidualU = 0;
7806  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
7807  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
7808  PyArrayObject *__pyx_v_pdeResidualV = 0;
7809  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
7810  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
7811  PyArrayObject *__pyx_v_subgridErrorP = 0;
7812  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
7813  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
7814  PyArrayObject *__pyx_v_subgridErrorU = 0;
7815  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
7816  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
7817  PyArrayObject *__pyx_v_subgridErrorV = 0;
7818  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
7819  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
7820  int __pyx_lineno = 0;
7821  const char *__pyx_filename = NULL;
7822  int __pyx_clineno = 0;
7823  PyObject *__pyx_r = 0;
7824  __Pyx_RefNannyDeclarations
7825  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_tauRes (wrapper)", 0);
7826  {
7827  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,0};
7828  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
7829  if (unlikely(__pyx_kwds)) {
7830  Py_ssize_t kw_args;
7831  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7832  switch (pos_args) {
7833  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
7834  CYTHON_FALLTHROUGH;
7835  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
7836  CYTHON_FALLTHROUGH;
7837  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
7838  CYTHON_FALLTHROUGH;
7839  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
7840  CYTHON_FALLTHROUGH;
7841  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
7842  CYTHON_FALLTHROUGH;
7843  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
7844  CYTHON_FALLTHROUGH;
7845  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
7846  CYTHON_FALLTHROUGH;
7847  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
7848  CYTHON_FALLTHROUGH;
7849  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7850  CYTHON_FALLTHROUGH;
7851  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7852  CYTHON_FALLTHROUGH;
7853  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7854  CYTHON_FALLTHROUGH;
7855  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7856  CYTHON_FALLTHROUGH;
7857  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7858  CYTHON_FALLTHROUGH;
7859  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7860  CYTHON_FALLTHROUGH;
7861  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7862  CYTHON_FALLTHROUGH;
7863  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7864  CYTHON_FALLTHROUGH;
7865  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7866  CYTHON_FALLTHROUGH;
7867  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7868  CYTHON_FALLTHROUGH;
7869  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7870  CYTHON_FALLTHROUGH;
7871  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7872  CYTHON_FALLTHROUGH;
7873  case 0: break;
7874  default: goto __pyx_L5_argtuple_error;
7875  }
7876  kw_args = PyDict_Size(__pyx_kwds);
7877  switch (pos_args) {
7878  case 0:
7879  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
7880  else goto __pyx_L5_argtuple_error;
7881  CYTHON_FALLTHROUGH;
7882  case 1:
7883  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
7884  else {
7885  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 1); __PYX_ERR(0, 1386, __pyx_L3_error)
7886  }
7887  CYTHON_FALLTHROUGH;
7888  case 2:
7889  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
7890  else {
7891  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 2); __PYX_ERR(0, 1386, __pyx_L3_error)
7892  }
7893  CYTHON_FALLTHROUGH;
7894  case 3:
7895  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
7896  else {
7897  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 3); __PYX_ERR(0, 1386, __pyx_L3_error)
7898  }
7899  CYTHON_FALLTHROUGH;
7900  case 4:
7901  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
7902  else {
7903  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 4); __PYX_ERR(0, 1386, __pyx_L3_error)
7904  }
7905  CYTHON_FALLTHROUGH;
7906  case 5:
7907  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
7908  else {
7909  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 5); __PYX_ERR(0, 1386, __pyx_L3_error)
7910  }
7911  CYTHON_FALLTHROUGH;
7912  case 6:
7913  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
7914  else {
7915  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 6); __PYX_ERR(0, 1386, __pyx_L3_error)
7916  }
7917  CYTHON_FALLTHROUGH;
7918  case 7:
7919  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
7920  else {
7921  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 7); __PYX_ERR(0, 1386, __pyx_L3_error)
7922  }
7923  CYTHON_FALLTHROUGH;
7924  case 8:
7925  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
7926  else {
7927  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 8); __PYX_ERR(0, 1386, __pyx_L3_error)
7928  }
7929  CYTHON_FALLTHROUGH;
7930  case 9:
7931  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
7932  else {
7933  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 9); __PYX_ERR(0, 1386, __pyx_L3_error)
7934  }
7935  CYTHON_FALLTHROUGH;
7936  case 10:
7937  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
7938  else {
7939  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 10); __PYX_ERR(0, 1386, __pyx_L3_error)
7940  }
7941  CYTHON_FALLTHROUGH;
7942  case 11:
7943  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
7944  else {
7945  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 11); __PYX_ERR(0, 1386, __pyx_L3_error)
7946  }
7947  CYTHON_FALLTHROUGH;
7948  case 12:
7949  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
7950  else {
7951  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 12); __PYX_ERR(0, 1386, __pyx_L3_error)
7952  }
7953  CYTHON_FALLTHROUGH;
7954  case 13:
7955  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
7956  else {
7957  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 13); __PYX_ERR(0, 1386, __pyx_L3_error)
7958  }
7959  CYTHON_FALLTHROUGH;
7960  case 14:
7961  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
7962  else {
7963  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 14); __PYX_ERR(0, 1386, __pyx_L3_error)
7964  }
7965  CYTHON_FALLTHROUGH;
7966  case 15:
7967  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
7968  else {
7969  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 15); __PYX_ERR(0, 1386, __pyx_L3_error)
7970  }
7971  CYTHON_FALLTHROUGH;
7972  case 16:
7973  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
7974  else {
7975  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 16); __PYX_ERR(0, 1386, __pyx_L3_error)
7976  }
7977  CYTHON_FALLTHROUGH;
7978  case 17:
7979  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
7980  else {
7981  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 17); __PYX_ERR(0, 1386, __pyx_L3_error)
7982  }
7983  CYTHON_FALLTHROUGH;
7984  case 18:
7985  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
7986  else {
7987  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 18); __PYX_ERR(0, 1386, __pyx_L3_error)
7988  }
7989  CYTHON_FALLTHROUGH;
7990  case 19:
7991  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
7992  else {
7993  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, 19); __PYX_ERR(0, 1386, __pyx_L3_error)
7994  }
7995  }
7996  if (unlikely(kw_args > 0)) {
7997  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes2D_GLS_tauRes") < 0)) __PYX_ERR(0, 1386, __pyx_L3_error)
7998  }
7999  } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
8000  goto __pyx_L5_argtuple_error;
8001  } else {
8002  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8003  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8004  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8005  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8006  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8007  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8008  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8009  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8010  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8011  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8012  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8013  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8014  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8015  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8016  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8017  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8018  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8019  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8020  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8021  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8022  }
8023  __pyx_v_tau0 = ((PyArrayObject *)values[0]);
8024  __pyx_v_tau1 = ((PyArrayObject *)values[1]);
8025  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
8026  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
8027  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
8028  __pyx_v_pdeResidualU = ((PyArrayObject *)values[5]);
8029  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[6]);
8030  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[7]);
8031  __pyx_v_pdeResidualV = ((PyArrayObject *)values[8]);
8032  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[9]);
8033  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[10]);
8034  __pyx_v_subgridErrorP = ((PyArrayObject *)values[11]);
8035  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[12]);
8036  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[13]);
8037  __pyx_v_subgridErrorU = ((PyArrayObject *)values[14]);
8038  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[15]);
8039  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[16]);
8040  __pyx_v_subgridErrorV = ((PyArrayObject *)values[17]);
8041  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[18]);
8042  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[19]);
8043  }
8044  goto __pyx_L4_argument_unpacking_done;
8045  __pyx_L5_argtuple_error:;
8046  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_GLS_tauRes", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1386, __pyx_L3_error)
8047  __pyx_L3_error:;
8048  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes2D_GLS_tauRes", __pyx_clineno, __pyx_lineno, __pyx_filename);
8049  __Pyx_RefNannyFinishContext();
8050  return NULL;
8051  __pyx_L4_argument_unpacking_done:;
8052  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1386, __pyx_L1_error)
8053  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1387, __pyx_L1_error)
8054  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1388, __pyx_L1_error)
8055  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1389, __pyx_L1_error)
8056  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1390, __pyx_L1_error)
8057  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1391, __pyx_L1_error)
8058  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1392, __pyx_L1_error)
8059  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1393, __pyx_L1_error)
8060  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1394, __pyx_L1_error)
8061  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1395, __pyx_L1_error)
8062  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1396, __pyx_L1_error)
8063  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1397, __pyx_L1_error)
8064  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1398, __pyx_L1_error)
8065  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1399, __pyx_L1_error)
8066  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1400, __pyx_L1_error)
8067  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1401, __pyx_L1_error)
8068  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1402, __pyx_L1_error)
8069  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1403, __pyx_L1_error)
8070  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1404, __pyx_L1_error)
8071  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1405, __pyx_L1_error)
8072  __pyx_r = __pyx_pf_13csubgridError_48calculateSubgridErrorStokes2D_GLS_tauRes(__pyx_self, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv);
8073 
8074  /* function exit code */
8075  goto __pyx_L0;
8076  __pyx_L1_error:;
8077  __pyx_r = NULL;
8078  __pyx_L0:;
8079  __Pyx_RefNannyFinishContext();
8080  return __pyx_r;
8081 }
8082 
8083 static PyObject *__pyx_pf_13csubgridError_48calculateSubgridErrorStokes2D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
8084  PyObject *__pyx_r = NULL;
8085  __Pyx_RefNannyDeclarations
8086  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_GLS_tauRes", 0);
8087 
8088  /* "csubgridError.pyx":1406
8089  * np.ndarray dsubgridErrorV_dp,
8090  * np.ndarray dsubgridErrorV_dv):
8091  * ccalculateSubgridErrorStokes2D_GLS_tauRes(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
8092  * dsubgridErrorP_du.shape[1],
8093  * dsubgridErrorP_du.shape[2],
8094  */
8095  calculateSubgridErrorStokes2D_GLS_tauRes((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 2, ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
8096 
8097  /* "csubgridError.pyx":1386
8098  * <double*> tau0.data,
8099  * <double*> tau1.data)
8100  * def calculateSubgridErrorStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
8101  * np.ndarray tau1,
8102  * np.ndarray pdeResidualP,
8103  */
8104 
8105  /* function exit code */
8106  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8107  __Pyx_XGIVEREF(__pyx_r);
8108  __Pyx_RefNannyFinishContext();
8109  return __pyx_r;
8110 }
8111 
8112 /* "csubgridError.pyx":1430
8113  * <double*> dsubgridErrorV_dp.data,
8114  * <double*> dsubgridErrorV_dv.data)
8115  * def calculateSubgridErrorStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
8116  * np.ndarray tau1,
8117  * np.ndarray pdeResidualP,
8118  */
8119 
8120 /* Python wrapper */
8121 static PyObject *__pyx_pw_13csubgridError_51calculateSubgridErrorStokes3D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8122 static PyMethodDef __pyx_mdef_13csubgridError_51calculateSubgridErrorStokes3D_GLS_tauRes = {"calculateSubgridErrorStokes3D_GLS_tauRes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_51calculateSubgridErrorStokes3D_GLS_tauRes, METH_VARARGS|METH_KEYWORDS, 0};
8123 static PyObject *__pyx_pw_13csubgridError_51calculateSubgridErrorStokes3D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8124  PyArrayObject *__pyx_v_tau0 = 0;
8125  PyArrayObject *__pyx_v_tau1 = 0;
8126  PyArrayObject *__pyx_v_pdeResidualP = 0;
8127  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
8128  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
8129  PyArrayObject *__pyx_v_dpdeResidualP_dw = 0;
8130  PyArrayObject *__pyx_v_pdeResidualU = 0;
8131  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
8132  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
8133  PyArrayObject *__pyx_v_pdeResidualV = 0;
8134  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
8135  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
8136  PyArrayObject *__pyx_v_pdeResidualW = 0;
8137  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
8138  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
8139  PyArrayObject *__pyx_v_subgridErrorP = 0;
8140  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
8141  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
8142  PyArrayObject *__pyx_v_dsubgridErrorP_dw = 0;
8143  PyArrayObject *__pyx_v_subgridErrorU = 0;
8144  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
8145  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
8146  PyArrayObject *__pyx_v_subgridErrorV = 0;
8147  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
8148  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
8149  PyArrayObject *__pyx_v_subgridErrorW = 0;
8150  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
8151  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
8152  int __pyx_lineno = 0;
8153  const char *__pyx_filename = NULL;
8154  int __pyx_clineno = 0;
8155  PyObject *__pyx_r = 0;
8156  __Pyx_RefNannyDeclarations
8157  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_tauRes (wrapper)", 0);
8158  {
8159  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_dpdeResidualP_dw,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_dsubgridErrorP_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_dw,0};
8160  PyObject* values[28] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
8161  if (unlikely(__pyx_kwds)) {
8162  Py_ssize_t kw_args;
8163  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8164  switch (pos_args) {
8165  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
8166  CYTHON_FALLTHROUGH;
8167  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
8168  CYTHON_FALLTHROUGH;
8169  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
8170  CYTHON_FALLTHROUGH;
8171  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
8172  CYTHON_FALLTHROUGH;
8173  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
8174  CYTHON_FALLTHROUGH;
8175  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
8176  CYTHON_FALLTHROUGH;
8177  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
8178  CYTHON_FALLTHROUGH;
8179  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
8180  CYTHON_FALLTHROUGH;
8181  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8182  CYTHON_FALLTHROUGH;
8183  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8184  CYTHON_FALLTHROUGH;
8185  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8186  CYTHON_FALLTHROUGH;
8187  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8188  CYTHON_FALLTHROUGH;
8189  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8190  CYTHON_FALLTHROUGH;
8191  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8192  CYTHON_FALLTHROUGH;
8193  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8194  CYTHON_FALLTHROUGH;
8195  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8196  CYTHON_FALLTHROUGH;
8197  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8198  CYTHON_FALLTHROUGH;
8199  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8200  CYTHON_FALLTHROUGH;
8201  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8202  CYTHON_FALLTHROUGH;
8203  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8204  CYTHON_FALLTHROUGH;
8205  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8206  CYTHON_FALLTHROUGH;
8207  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8208  CYTHON_FALLTHROUGH;
8209  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8210  CYTHON_FALLTHROUGH;
8211  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8212  CYTHON_FALLTHROUGH;
8213  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8214  CYTHON_FALLTHROUGH;
8215  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8216  CYTHON_FALLTHROUGH;
8217  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8218  CYTHON_FALLTHROUGH;
8219  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8220  CYTHON_FALLTHROUGH;
8221  case 0: break;
8222  default: goto __pyx_L5_argtuple_error;
8223  }
8224  kw_args = PyDict_Size(__pyx_kwds);
8225  switch (pos_args) {
8226  case 0:
8227  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
8228  else goto __pyx_L5_argtuple_error;
8229  CYTHON_FALLTHROUGH;
8230  case 1:
8231  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
8232  else {
8233  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 1); __PYX_ERR(0, 1430, __pyx_L3_error)
8234  }
8235  CYTHON_FALLTHROUGH;
8236  case 2:
8237  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
8238  else {
8239  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 2); __PYX_ERR(0, 1430, __pyx_L3_error)
8240  }
8241  CYTHON_FALLTHROUGH;
8242  case 3:
8243  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
8244  else {
8245  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 3); __PYX_ERR(0, 1430, __pyx_L3_error)
8246  }
8247  CYTHON_FALLTHROUGH;
8248  case 4:
8249  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
8250  else {
8251  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 4); __PYX_ERR(0, 1430, __pyx_L3_error)
8252  }
8253  CYTHON_FALLTHROUGH;
8254  case 5:
8255  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dw)) != 0)) kw_args--;
8256  else {
8257  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 5); __PYX_ERR(0, 1430, __pyx_L3_error)
8258  }
8259  CYTHON_FALLTHROUGH;
8260  case 6:
8261  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
8262  else {
8263  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 6); __PYX_ERR(0, 1430, __pyx_L3_error)
8264  }
8265  CYTHON_FALLTHROUGH;
8266  case 7:
8267  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
8268  else {
8269  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 7); __PYX_ERR(0, 1430, __pyx_L3_error)
8270  }
8271  CYTHON_FALLTHROUGH;
8272  case 8:
8273  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
8274  else {
8275  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 8); __PYX_ERR(0, 1430, __pyx_L3_error)
8276  }
8277  CYTHON_FALLTHROUGH;
8278  case 9:
8279  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
8280  else {
8281  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 9); __PYX_ERR(0, 1430, __pyx_L3_error)
8282  }
8283  CYTHON_FALLTHROUGH;
8284  case 10:
8285  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
8286  else {
8287  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 10); __PYX_ERR(0, 1430, __pyx_L3_error)
8288  }
8289  CYTHON_FALLTHROUGH;
8290  case 11:
8291  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
8292  else {
8293  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 11); __PYX_ERR(0, 1430, __pyx_L3_error)
8294  }
8295  CYTHON_FALLTHROUGH;
8296  case 12:
8297  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
8298  else {
8299  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 12); __PYX_ERR(0, 1430, __pyx_L3_error)
8300  }
8301  CYTHON_FALLTHROUGH;
8302  case 13:
8303  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
8304  else {
8305  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 13); __PYX_ERR(0, 1430, __pyx_L3_error)
8306  }
8307  CYTHON_FALLTHROUGH;
8308  case 14:
8309  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
8310  else {
8311  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 14); __PYX_ERR(0, 1430, __pyx_L3_error)
8312  }
8313  CYTHON_FALLTHROUGH;
8314  case 15:
8315  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
8316  else {
8317  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 15); __PYX_ERR(0, 1430, __pyx_L3_error)
8318  }
8319  CYTHON_FALLTHROUGH;
8320  case 16:
8321  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
8322  else {
8323  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 16); __PYX_ERR(0, 1430, __pyx_L3_error)
8324  }
8325  CYTHON_FALLTHROUGH;
8326  case 17:
8327  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
8328  else {
8329  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 17); __PYX_ERR(0, 1430, __pyx_L3_error)
8330  }
8331  CYTHON_FALLTHROUGH;
8332  case 18:
8333  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dw)) != 0)) kw_args--;
8334  else {
8335  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 18); __PYX_ERR(0, 1430, __pyx_L3_error)
8336  }
8337  CYTHON_FALLTHROUGH;
8338  case 19:
8339  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
8340  else {
8341  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 19); __PYX_ERR(0, 1430, __pyx_L3_error)
8342  }
8343  CYTHON_FALLTHROUGH;
8344  case 20:
8345  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
8346  else {
8347  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 20); __PYX_ERR(0, 1430, __pyx_L3_error)
8348  }
8349  CYTHON_FALLTHROUGH;
8350  case 21:
8351  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
8352  else {
8353  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 21); __PYX_ERR(0, 1430, __pyx_L3_error)
8354  }
8355  CYTHON_FALLTHROUGH;
8356  case 22:
8357  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
8358  else {
8359  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 22); __PYX_ERR(0, 1430, __pyx_L3_error)
8360  }
8361  CYTHON_FALLTHROUGH;
8362  case 23:
8363  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
8364  else {
8365  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 23); __PYX_ERR(0, 1430, __pyx_L3_error)
8366  }
8367  CYTHON_FALLTHROUGH;
8368  case 24:
8369  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
8370  else {
8371  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 24); __PYX_ERR(0, 1430, __pyx_L3_error)
8372  }
8373  CYTHON_FALLTHROUGH;
8374  case 25:
8375  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
8376  else {
8377  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 25); __PYX_ERR(0, 1430, __pyx_L3_error)
8378  }
8379  CYTHON_FALLTHROUGH;
8380  case 26:
8381  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
8382  else {
8383  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 26); __PYX_ERR(0, 1430, __pyx_L3_error)
8384  }
8385  CYTHON_FALLTHROUGH;
8386  case 27:
8387  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
8388  else {
8389  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, 27); __PYX_ERR(0, 1430, __pyx_L3_error)
8390  }
8391  }
8392  if (unlikely(kw_args > 0)) {
8393  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes3D_GLS_tauRes") < 0)) __PYX_ERR(0, 1430, __pyx_L3_error)
8394  }
8395  } else if (PyTuple_GET_SIZE(__pyx_args) != 28) {
8396  goto __pyx_L5_argtuple_error;
8397  } else {
8398  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8399  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8400  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8401  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8402  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8403  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8404  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8405  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8406  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8407  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8408  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8409  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8410  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8411  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8412  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8413  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8414  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8415  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8416  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8417  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8418  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
8419  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
8420  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
8421  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
8422  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
8423  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
8424  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
8425  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
8426  }
8427  __pyx_v_tau0 = ((PyArrayObject *)values[0]);
8428  __pyx_v_tau1 = ((PyArrayObject *)values[1]);
8429  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
8430  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
8431  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
8432  __pyx_v_dpdeResidualP_dw = ((PyArrayObject *)values[5]);
8433  __pyx_v_pdeResidualU = ((PyArrayObject *)values[6]);
8434  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[7]);
8435  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[8]);
8436  __pyx_v_pdeResidualV = ((PyArrayObject *)values[9]);
8437  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[10]);
8438  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[11]);
8439  __pyx_v_pdeResidualW = ((PyArrayObject *)values[12]);
8440  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[13]);
8441  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[14]);
8442  __pyx_v_subgridErrorP = ((PyArrayObject *)values[15]);
8443  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[16]);
8444  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[17]);
8445  __pyx_v_dsubgridErrorP_dw = ((PyArrayObject *)values[18]);
8446  __pyx_v_subgridErrorU = ((PyArrayObject *)values[19]);
8447  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[20]);
8448  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[21]);
8449  __pyx_v_subgridErrorV = ((PyArrayObject *)values[22]);
8450  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[23]);
8451  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[24]);
8452  __pyx_v_subgridErrorW = ((PyArrayObject *)values[25]);
8453  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[26]);
8454  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[27]);
8455  }
8456  goto __pyx_L4_argument_unpacking_done;
8457  __pyx_L5_argtuple_error:;
8458  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes3D_GLS_tauRes", 1, 28, 28, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1430, __pyx_L3_error)
8459  __pyx_L3_error:;
8460  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes3D_GLS_tauRes", __pyx_clineno, __pyx_lineno, __pyx_filename);
8461  __Pyx_RefNannyFinishContext();
8462  return NULL;
8463  __pyx_L4_argument_unpacking_done:;
8464  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1430, __pyx_L1_error)
8465  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1431, __pyx_L1_error)
8466  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1432, __pyx_L1_error)
8467  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1433, __pyx_L1_error)
8468  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1434, __pyx_L1_error)
8469  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dw", 0))) __PYX_ERR(0, 1435, __pyx_L1_error)
8470  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1436, __pyx_L1_error)
8471  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1437, __pyx_L1_error)
8472  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1438, __pyx_L1_error)
8473  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1439, __pyx_L1_error)
8474  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1440, __pyx_L1_error)
8475  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1441, __pyx_L1_error)
8476  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 1442, __pyx_L1_error)
8477  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 1443, __pyx_L1_error)
8478  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 1444, __pyx_L1_error)
8479  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1445, __pyx_L1_error)
8480  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1446, __pyx_L1_error)
8481  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1447, __pyx_L1_error)
8482  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dw", 0))) __PYX_ERR(0, 1448, __pyx_L1_error)
8483  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1449, __pyx_L1_error)
8484  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1450, __pyx_L1_error)
8485  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1451, __pyx_L1_error)
8486  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1452, __pyx_L1_error)
8487  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1453, __pyx_L1_error)
8488  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1454, __pyx_L1_error)
8489  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
8490  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 1456, __pyx_L1_error)
8491  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 1457, __pyx_L1_error)
8492  __pyx_r = __pyx_pf_13csubgridError_50calculateSubgridErrorStokes3D_GLS_tauRes(__pyx_self, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_dpdeResidualP_dw, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_dsubgridErrorP_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_dw);
8493 
8494  /* function exit code */
8495  goto __pyx_L0;
8496  __pyx_L1_error:;
8497  __pyx_r = NULL;
8498  __pyx_L0:;
8499  __Pyx_RefNannyFinishContext();
8500  return __pyx_r;
8501 }
8502 
8503 static PyObject *__pyx_pf_13csubgridError_50calculateSubgridErrorStokes3D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
8504  PyObject *__pyx_r = NULL;
8505  __Pyx_RefNannyDeclarations
8506  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes3D_GLS_tauRes", 0);
8507 
8508  /* "csubgridError.pyx":1458
8509  * np.ndarray dsubgridErrorW_dp,
8510  * np.ndarray dsubgridErrorW_dw):
8511  * ccalculateSubgridErrorStokes3D_GLS_tauRes(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
8512  * dsubgridErrorP_du.shape[1],
8513  * dsubgridErrorP_du.shape[2],
8514  */
8515  calculateSubgridErrorStokes3D_GLS_tauRes((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 3, ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_dpdeResidualP_dw->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_dsubgridErrorP_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
8516 
8517  /* "csubgridError.pyx":1430
8518  * <double*> dsubgridErrorV_dp.data,
8519  * <double*> dsubgridErrorV_dv.data)
8520  * def calculateSubgridErrorStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
8521  * np.ndarray tau1,
8522  * np.ndarray pdeResidualP,
8523  */
8524 
8525  /* function exit code */
8526  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8527  __Pyx_XGIVEREF(__pyx_r);
8528  __Pyx_RefNannyFinishContext();
8529  return __pyx_r;
8530 }
8531 
8532 /* "csubgridError.pyx":1490
8533  * <double*> dsubgridErrorW_dp.data,
8534  * <double*> dsubgridErrorW_dw.data)
8535  * def calculateSubgridErrorNavierStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
8536  * np.ndarray tau1,
8537  * np.ndarray pdeResidualP,
8538  */
8539 
8540 /* Python wrapper */
8541 static PyObject *__pyx_pw_13csubgridError_53calculateSubgridErrorNavierStokes3D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8542 static PyMethodDef __pyx_mdef_13csubgridError_53calculateSubgridErrorNavierStokes3D_GLS_tauRes = {"calculateSubgridErrorNavierStokes3D_GLS_tauRes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_53calculateSubgridErrorNavierStokes3D_GLS_tauRes, METH_VARARGS|METH_KEYWORDS, 0};
8543 static PyObject *__pyx_pw_13csubgridError_53calculateSubgridErrorNavierStokes3D_GLS_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8544  PyArrayObject *__pyx_v_tau0 = 0;
8545  PyArrayObject *__pyx_v_tau1 = 0;
8546  PyArrayObject *__pyx_v_pdeResidualP = 0;
8547  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
8548  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
8549  PyArrayObject *__pyx_v_dpdeResidualP_dw = 0;
8550  PyArrayObject *__pyx_v_pdeResidualU = 0;
8551  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
8552  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
8553  PyArrayObject *__pyx_v_dpdeResidualU_dv = 0;
8554  PyArrayObject *__pyx_v_dpdeResidualU_dw = 0;
8555  PyArrayObject *__pyx_v_pdeResidualV = 0;
8556  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
8557  PyArrayObject *__pyx_v_dpdeResidualV_du = 0;
8558  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
8559  PyArrayObject *__pyx_v_dpdeResidualV_dw = 0;
8560  PyArrayObject *__pyx_v_pdeResidualW = 0;
8561  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
8562  PyArrayObject *__pyx_v_dpdeResidualW_du = 0;
8563  PyArrayObject *__pyx_v_dpdeResidualW_dv = 0;
8564  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
8565  PyArrayObject *__pyx_v_subgridErrorP = 0;
8566  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
8567  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
8568  PyArrayObject *__pyx_v_dsubgridErrorP_dw = 0;
8569  PyArrayObject *__pyx_v_subgridErrorU = 0;
8570  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
8571  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
8572  PyArrayObject *__pyx_v_dsubgridErrorU_dv = 0;
8573  PyArrayObject *__pyx_v_dsubgridErrorU_dw = 0;
8574  PyArrayObject *__pyx_v_subgridErrorV = 0;
8575  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
8576  PyArrayObject *__pyx_v_dsubgridErrorV_du = 0;
8577  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
8578  PyArrayObject *__pyx_v_dsubgridErrorV_dw = 0;
8579  PyArrayObject *__pyx_v_subgridErrorW = 0;
8580  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
8581  PyArrayObject *__pyx_v_dsubgridErrorW_du = 0;
8582  PyArrayObject *__pyx_v_dsubgridErrorW_dv = 0;
8583  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
8584  int __pyx_lineno = 0;
8585  const char *__pyx_filename = NULL;
8586  int __pyx_clineno = 0;
8587  PyObject *__pyx_r = 0;
8588  __Pyx_RefNannyDeclarations
8589  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes3D_GLS_tauRes (wrapper)", 0);
8590  {
8591  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tau0,&__pyx_n_s_tau1,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_dpdeResidualP_dw,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_dpdeResidualU_dv,&__pyx_n_s_dpdeResidualU_dw,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_du,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_dpdeResidualV_dw,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_du,&__pyx_n_s_dpdeResidualW_dv,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_dsubgridErrorP_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_dsubgridErrorU_dv,&__pyx_n_s_dsubgridErrorU_dw,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_du,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_dsubgridErrorV_dw,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_du,&__pyx_n_s_dsubgridErrorW_dv,&__pyx_n_s_dsubgridErrorW_dw,0};
8592  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};
8593  if (unlikely(__pyx_kwds)) {
8594  Py_ssize_t kw_args;
8595  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8596  switch (pos_args) {
8597  case 40: values[39] = PyTuple_GET_ITEM(__pyx_args, 39);
8598  CYTHON_FALLTHROUGH;
8599  case 39: values[38] = PyTuple_GET_ITEM(__pyx_args, 38);
8600  CYTHON_FALLTHROUGH;
8601  case 38: values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
8602  CYTHON_FALLTHROUGH;
8603  case 37: values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
8604  CYTHON_FALLTHROUGH;
8605  case 36: values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
8606  CYTHON_FALLTHROUGH;
8607  case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
8608  CYTHON_FALLTHROUGH;
8609  case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
8610  CYTHON_FALLTHROUGH;
8611  case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
8612  CYTHON_FALLTHROUGH;
8613  case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
8614  CYTHON_FALLTHROUGH;
8615  case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
8616  CYTHON_FALLTHROUGH;
8617  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
8618  CYTHON_FALLTHROUGH;
8619  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
8620  CYTHON_FALLTHROUGH;
8621  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
8622  CYTHON_FALLTHROUGH;
8623  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
8624  CYTHON_FALLTHROUGH;
8625  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
8626  CYTHON_FALLTHROUGH;
8627  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
8628  CYTHON_FALLTHROUGH;
8629  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
8630  CYTHON_FALLTHROUGH;
8631  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
8632  CYTHON_FALLTHROUGH;
8633  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
8634  CYTHON_FALLTHROUGH;
8635  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
8636  CYTHON_FALLTHROUGH;
8637  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8638  CYTHON_FALLTHROUGH;
8639  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8640  CYTHON_FALLTHROUGH;
8641  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8642  CYTHON_FALLTHROUGH;
8643  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8644  CYTHON_FALLTHROUGH;
8645  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8646  CYTHON_FALLTHROUGH;
8647  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8648  CYTHON_FALLTHROUGH;
8649  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8650  CYTHON_FALLTHROUGH;
8651  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8652  CYTHON_FALLTHROUGH;
8653  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8654  CYTHON_FALLTHROUGH;
8655  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8656  CYTHON_FALLTHROUGH;
8657  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8658  CYTHON_FALLTHROUGH;
8659  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8660  CYTHON_FALLTHROUGH;
8661  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8662  CYTHON_FALLTHROUGH;
8663  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8664  CYTHON_FALLTHROUGH;
8665  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8666  CYTHON_FALLTHROUGH;
8667  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8668  CYTHON_FALLTHROUGH;
8669  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8670  CYTHON_FALLTHROUGH;
8671  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8672  CYTHON_FALLTHROUGH;
8673  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8674  CYTHON_FALLTHROUGH;
8675  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8676  CYTHON_FALLTHROUGH;
8677  case 0: break;
8678  default: goto __pyx_L5_argtuple_error;
8679  }
8680  kw_args = PyDict_Size(__pyx_kwds);
8681  switch (pos_args) {
8682  case 0:
8683  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau0)) != 0)) kw_args--;
8684  else goto __pyx_L5_argtuple_error;
8685  CYTHON_FALLTHROUGH;
8686  case 1:
8687  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau1)) != 0)) kw_args--;
8688  else {
8689  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 1); __PYX_ERR(0, 1490, __pyx_L3_error)
8690  }
8691  CYTHON_FALLTHROUGH;
8692  case 2:
8693  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
8694  else {
8695  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 2); __PYX_ERR(0, 1490, __pyx_L3_error)
8696  }
8697  CYTHON_FALLTHROUGH;
8698  case 3:
8699  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
8700  else {
8701  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 3); __PYX_ERR(0, 1490, __pyx_L3_error)
8702  }
8703  CYTHON_FALLTHROUGH;
8704  case 4:
8705  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
8706  else {
8707  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 4); __PYX_ERR(0, 1490, __pyx_L3_error)
8708  }
8709  CYTHON_FALLTHROUGH;
8710  case 5:
8711  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dw)) != 0)) kw_args--;
8712  else {
8713  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 5); __PYX_ERR(0, 1490, __pyx_L3_error)
8714  }
8715  CYTHON_FALLTHROUGH;
8716  case 6:
8717  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
8718  else {
8719  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 6); __PYX_ERR(0, 1490, __pyx_L3_error)
8720  }
8721  CYTHON_FALLTHROUGH;
8722  case 7:
8723  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
8724  else {
8725  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 7); __PYX_ERR(0, 1490, __pyx_L3_error)
8726  }
8727  CYTHON_FALLTHROUGH;
8728  case 8:
8729  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
8730  else {
8731  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 8); __PYX_ERR(0, 1490, __pyx_L3_error)
8732  }
8733  CYTHON_FALLTHROUGH;
8734  case 9:
8735  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dv)) != 0)) kw_args--;
8736  else {
8737  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 9); __PYX_ERR(0, 1490, __pyx_L3_error)
8738  }
8739  CYTHON_FALLTHROUGH;
8740  case 10:
8741  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dw)) != 0)) kw_args--;
8742  else {
8743  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 10); __PYX_ERR(0, 1490, __pyx_L3_error)
8744  }
8745  CYTHON_FALLTHROUGH;
8746  case 11:
8747  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
8748  else {
8749  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 11); __PYX_ERR(0, 1490, __pyx_L3_error)
8750  }
8751  CYTHON_FALLTHROUGH;
8752  case 12:
8753  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
8754  else {
8755  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 12); __PYX_ERR(0, 1490, __pyx_L3_error)
8756  }
8757  CYTHON_FALLTHROUGH;
8758  case 13:
8759  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_du)) != 0)) kw_args--;
8760  else {
8761  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 13); __PYX_ERR(0, 1490, __pyx_L3_error)
8762  }
8763  CYTHON_FALLTHROUGH;
8764  case 14:
8765  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
8766  else {
8767  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 14); __PYX_ERR(0, 1490, __pyx_L3_error)
8768  }
8769  CYTHON_FALLTHROUGH;
8770  case 15:
8771  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dw)) != 0)) kw_args--;
8772  else {
8773  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 15); __PYX_ERR(0, 1490, __pyx_L3_error)
8774  }
8775  CYTHON_FALLTHROUGH;
8776  case 16:
8777  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
8778  else {
8779  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 16); __PYX_ERR(0, 1490, __pyx_L3_error)
8780  }
8781  CYTHON_FALLTHROUGH;
8782  case 17:
8783  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
8784  else {
8785  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 17); __PYX_ERR(0, 1490, __pyx_L3_error)
8786  }
8787  CYTHON_FALLTHROUGH;
8788  case 18:
8789  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_du)) != 0)) kw_args--;
8790  else {
8791  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 18); __PYX_ERR(0, 1490, __pyx_L3_error)
8792  }
8793  CYTHON_FALLTHROUGH;
8794  case 19:
8795  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dv)) != 0)) kw_args--;
8796  else {
8797  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 19); __PYX_ERR(0, 1490, __pyx_L3_error)
8798  }
8799  CYTHON_FALLTHROUGH;
8800  case 20:
8801  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
8802  else {
8803  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 20); __PYX_ERR(0, 1490, __pyx_L3_error)
8804  }
8805  CYTHON_FALLTHROUGH;
8806  case 21:
8807  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
8808  else {
8809  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 21); __PYX_ERR(0, 1490, __pyx_L3_error)
8810  }
8811  CYTHON_FALLTHROUGH;
8812  case 22:
8813  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
8814  else {
8815  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 22); __PYX_ERR(0, 1490, __pyx_L3_error)
8816  }
8817  CYTHON_FALLTHROUGH;
8818  case 23:
8819  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
8820  else {
8821  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 23); __PYX_ERR(0, 1490, __pyx_L3_error)
8822  }
8823  CYTHON_FALLTHROUGH;
8824  case 24:
8825  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dw)) != 0)) kw_args--;
8826  else {
8827  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 24); __PYX_ERR(0, 1490, __pyx_L3_error)
8828  }
8829  CYTHON_FALLTHROUGH;
8830  case 25:
8831  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
8832  else {
8833  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 25); __PYX_ERR(0, 1490, __pyx_L3_error)
8834  }
8835  CYTHON_FALLTHROUGH;
8836  case 26:
8837  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
8838  else {
8839  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 26); __PYX_ERR(0, 1490, __pyx_L3_error)
8840  }
8841  CYTHON_FALLTHROUGH;
8842  case 27:
8843  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
8844  else {
8845  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 27); __PYX_ERR(0, 1490, __pyx_L3_error)
8846  }
8847  CYTHON_FALLTHROUGH;
8848  case 28:
8849  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dv)) != 0)) kw_args--;
8850  else {
8851  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 28); __PYX_ERR(0, 1490, __pyx_L3_error)
8852  }
8853  CYTHON_FALLTHROUGH;
8854  case 29:
8855  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dw)) != 0)) kw_args--;
8856  else {
8857  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 29); __PYX_ERR(0, 1490, __pyx_L3_error)
8858  }
8859  CYTHON_FALLTHROUGH;
8860  case 30:
8861  if (likely((values[30] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
8862  else {
8863  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 30); __PYX_ERR(0, 1490, __pyx_L3_error)
8864  }
8865  CYTHON_FALLTHROUGH;
8866  case 31:
8867  if (likely((values[31] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
8868  else {
8869  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 31); __PYX_ERR(0, 1490, __pyx_L3_error)
8870  }
8871  CYTHON_FALLTHROUGH;
8872  case 32:
8873  if (likely((values[32] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_du)) != 0)) kw_args--;
8874  else {
8875  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 32); __PYX_ERR(0, 1490, __pyx_L3_error)
8876  }
8877  CYTHON_FALLTHROUGH;
8878  case 33:
8879  if (likely((values[33] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
8880  else {
8881  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 33); __PYX_ERR(0, 1490, __pyx_L3_error)
8882  }
8883  CYTHON_FALLTHROUGH;
8884  case 34:
8885  if (likely((values[34] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dw)) != 0)) kw_args--;
8886  else {
8887  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 34); __PYX_ERR(0, 1490, __pyx_L3_error)
8888  }
8889  CYTHON_FALLTHROUGH;
8890  case 35:
8891  if (likely((values[35] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
8892  else {
8893  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 35); __PYX_ERR(0, 1490, __pyx_L3_error)
8894  }
8895  CYTHON_FALLTHROUGH;
8896  case 36:
8897  if (likely((values[36] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
8898  else {
8899  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 36); __PYX_ERR(0, 1490, __pyx_L3_error)
8900  }
8901  CYTHON_FALLTHROUGH;
8902  case 37:
8903  if (likely((values[37] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_du)) != 0)) kw_args--;
8904  else {
8905  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 37); __PYX_ERR(0, 1490, __pyx_L3_error)
8906  }
8907  CYTHON_FALLTHROUGH;
8908  case 38:
8909  if (likely((values[38] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dv)) != 0)) kw_args--;
8910  else {
8911  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 38); __PYX_ERR(0, 1490, __pyx_L3_error)
8912  }
8913  CYTHON_FALLTHROUGH;
8914  case 39:
8915  if (likely((values[39] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
8916  else {
8917  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, 39); __PYX_ERR(0, 1490, __pyx_L3_error)
8918  }
8919  }
8920  if (unlikely(kw_args > 0)) {
8921  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes3D_GLS_tauRes") < 0)) __PYX_ERR(0, 1490, __pyx_L3_error)
8922  }
8923  } else if (PyTuple_GET_SIZE(__pyx_args) != 40) {
8924  goto __pyx_L5_argtuple_error;
8925  } else {
8926  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8927  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8928  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8929  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8930  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8931  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8932  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8933  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8934  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8935  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8936  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8937  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8938  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8939  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8940  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8941  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8942  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8943  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8944  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8945  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8946  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
8947  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
8948  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
8949  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
8950  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
8951  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
8952  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
8953  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
8954  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
8955  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
8956  values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
8957  values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
8958  values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
8959  values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
8960  values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
8961  values[35] = PyTuple_GET_ITEM(__pyx_args, 35);
8962  values[36] = PyTuple_GET_ITEM(__pyx_args, 36);
8963  values[37] = PyTuple_GET_ITEM(__pyx_args, 37);
8964  values[38] = PyTuple_GET_ITEM(__pyx_args, 38);
8965  values[39] = PyTuple_GET_ITEM(__pyx_args, 39);
8966  }
8967  __pyx_v_tau0 = ((PyArrayObject *)values[0]);
8968  __pyx_v_tau1 = ((PyArrayObject *)values[1]);
8969  __pyx_v_pdeResidualP = ((PyArrayObject *)values[2]);
8970  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[3]);
8971  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[4]);
8972  __pyx_v_dpdeResidualP_dw = ((PyArrayObject *)values[5]);
8973  __pyx_v_pdeResidualU = ((PyArrayObject *)values[6]);
8974  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[7]);
8975  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[8]);
8976  __pyx_v_dpdeResidualU_dv = ((PyArrayObject *)values[9]);
8977  __pyx_v_dpdeResidualU_dw = ((PyArrayObject *)values[10]);
8978  __pyx_v_pdeResidualV = ((PyArrayObject *)values[11]);
8979  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[12]);
8980  __pyx_v_dpdeResidualV_du = ((PyArrayObject *)values[13]);
8981  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[14]);
8982  __pyx_v_dpdeResidualV_dw = ((PyArrayObject *)values[15]);
8983  __pyx_v_pdeResidualW = ((PyArrayObject *)values[16]);
8984  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[17]);
8985  __pyx_v_dpdeResidualW_du = ((PyArrayObject *)values[18]);
8986  __pyx_v_dpdeResidualW_dv = ((PyArrayObject *)values[19]);
8987  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[20]);
8988  __pyx_v_subgridErrorP = ((PyArrayObject *)values[21]);
8989  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[22]);
8990  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[23]);
8991  __pyx_v_dsubgridErrorP_dw = ((PyArrayObject *)values[24]);
8992  __pyx_v_subgridErrorU = ((PyArrayObject *)values[25]);
8993  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[26]);
8994  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[27]);
8995  __pyx_v_dsubgridErrorU_dv = ((PyArrayObject *)values[28]);
8996  __pyx_v_dsubgridErrorU_dw = ((PyArrayObject *)values[29]);
8997  __pyx_v_subgridErrorV = ((PyArrayObject *)values[30]);
8998  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[31]);
8999  __pyx_v_dsubgridErrorV_du = ((PyArrayObject *)values[32]);
9000  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[33]);
9001  __pyx_v_dsubgridErrorV_dw = ((PyArrayObject *)values[34]);
9002  __pyx_v_subgridErrorW = ((PyArrayObject *)values[35]);
9003  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[36]);
9004  __pyx_v_dsubgridErrorW_du = ((PyArrayObject *)values[37]);
9005  __pyx_v_dsubgridErrorW_dv = ((PyArrayObject *)values[38]);
9006  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[39]);
9007  }
9008  goto __pyx_L4_argument_unpacking_done;
9009  __pyx_L5_argtuple_error:;
9010  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 1, 40, 40, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1490, __pyx_L3_error)
9011  __pyx_L3_error:;
9012  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes3D_GLS_tauRes", __pyx_clineno, __pyx_lineno, __pyx_filename);
9013  __Pyx_RefNannyFinishContext();
9014  return NULL;
9015  __pyx_L4_argument_unpacking_done:;
9016  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau0), __pyx_ptype_5numpy_ndarray, 1, "tau0", 0))) __PYX_ERR(0, 1490, __pyx_L1_error)
9017  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau1), __pyx_ptype_5numpy_ndarray, 1, "tau1", 0))) __PYX_ERR(0, 1491, __pyx_L1_error)
9018  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1492, __pyx_L1_error)
9019  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1493, __pyx_L1_error)
9020  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1494, __pyx_L1_error)
9021  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dw", 0))) __PYX_ERR(0, 1495, __pyx_L1_error)
9022  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1496, __pyx_L1_error)
9023  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1497, __pyx_L1_error)
9024  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1498, __pyx_L1_error)
9025  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dv", 0))) __PYX_ERR(0, 1499, __pyx_L1_error)
9026  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dw", 0))) __PYX_ERR(0, 1500, __pyx_L1_error)
9027  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1501, __pyx_L1_error)
9028  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1502, __pyx_L1_error)
9029  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_du", 0))) __PYX_ERR(0, 1503, __pyx_L1_error)
9030  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1504, __pyx_L1_error)
9031  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dw", 0))) __PYX_ERR(0, 1505, __pyx_L1_error)
9032  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 1506, __pyx_L1_error)
9033  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 1507, __pyx_L1_error)
9034  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_du", 0))) __PYX_ERR(0, 1508, __pyx_L1_error)
9035  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dv", 0))) __PYX_ERR(0, 1509, __pyx_L1_error)
9036  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 1510, __pyx_L1_error)
9037  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1511, __pyx_L1_error)
9038  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1512, __pyx_L1_error)
9039  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1513, __pyx_L1_error)
9040  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dw", 0))) __PYX_ERR(0, 1514, __pyx_L1_error)
9041  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1515, __pyx_L1_error)
9042  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1516, __pyx_L1_error)
9043  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1517, __pyx_L1_error)
9044  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dv", 0))) __PYX_ERR(0, 1518, __pyx_L1_error)
9045  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dw", 0))) __PYX_ERR(0, 1519, __pyx_L1_error)
9046  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1520, __pyx_L1_error)
9047  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1521, __pyx_L1_error)
9048  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_du", 0))) __PYX_ERR(0, 1522, __pyx_L1_error)
9049  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1523, __pyx_L1_error)
9050  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dw", 0))) __PYX_ERR(0, 1524, __pyx_L1_error)
9051  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 1525, __pyx_L1_error)
9052  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 1526, __pyx_L1_error)
9053  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_du", 0))) __PYX_ERR(0, 1527, __pyx_L1_error)
9054  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dv", 0))) __PYX_ERR(0, 1528, __pyx_L1_error)
9055  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 1529, __pyx_L1_error)
9056  __pyx_r = __pyx_pf_13csubgridError_52calculateSubgridErrorNavierStokes3D_GLS_tauRes(__pyx_self, __pyx_v_tau0, __pyx_v_tau1, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_dpdeResidualP_dw, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_dpdeResidualU_dv, __pyx_v_dpdeResidualU_dw, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_du, __pyx_v_dpdeResidualV_dv, __pyx_v_dpdeResidualV_dw, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_du, __pyx_v_dpdeResidualW_dv, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_dsubgridErrorP_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_dsubgridErrorU_dv, __pyx_v_dsubgridErrorU_dw, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_du, __pyx_v_dsubgridErrorV_dv, __pyx_v_dsubgridErrorV_dw, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_du, __pyx_v_dsubgridErrorW_dv, __pyx_v_dsubgridErrorW_dw);
9057 
9058  /* function exit code */
9059  goto __pyx_L0;
9060  __pyx_L1_error:;
9061  __pyx_r = NULL;
9062  __pyx_L0:;
9063  __Pyx_RefNannyFinishContext();
9064  return __pyx_r;
9065 }
9066 
9067 static PyObject *__pyx_pf_13csubgridError_52calculateSubgridErrorNavierStokes3D_GLS_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau0, PyArrayObject *__pyx_v_tau1, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_dpdeResidualU_dv, PyArrayObject *__pyx_v_dpdeResidualU_dw, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_du, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_dpdeResidualV_dw, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_du, PyArrayObject *__pyx_v_dpdeResidualW_dv, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_dsubgridErrorU_dw, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_dsubgridErrorV_dw, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_du, PyArrayObject *__pyx_v_dsubgridErrorW_dv, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
9068  PyObject *__pyx_r = NULL;
9069  __Pyx_RefNannyDeclarations
9070  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes3D_GLS_tauRes", 0);
9071 
9072  /* "csubgridError.pyx":1530
9073  * np.ndarray dsubgridErrorW_dv,
9074  * np.ndarray dsubgridErrorW_dw):
9075  * ccalculateSubgridErrorNavierStokes3D_GLS_tauRes(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
9076  * dsubgridErrorP_du.shape[1],
9077  * dsubgridErrorP_du.shape[2],
9078  */
9079  calculateSubgridErrorNavierStokes3D_GLS_tauRes((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 3, ((double *)__pyx_v_tau0->data), ((double *)__pyx_v_tau1->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_dpdeResidualP_dw->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_dpdeResidualU_dv->data), ((double *)__pyx_v_dpdeResidualU_dw->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_du->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_dpdeResidualV_dw->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_du->data), ((double *)__pyx_v_dpdeResidualW_dv->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_dsubgridErrorP_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_dsubgridErrorU_dv->data), ((double *)__pyx_v_dsubgridErrorU_dw->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_du->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_dsubgridErrorV_dw->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_du->data), ((double *)__pyx_v_dsubgridErrorW_dv->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
9080 
9081  /* "csubgridError.pyx":1490
9082  * <double*> dsubgridErrorW_dp.data,
9083  * <double*> dsubgridErrorW_dw.data)
9084  * def calculateSubgridErrorNavierStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
9085  * np.ndarray tau1,
9086  * np.ndarray pdeResidualP,
9087  */
9088 
9089  /* function exit code */
9090  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9091  __Pyx_XGIVEREF(__pyx_r);
9092  __Pyx_RefNannyFinishContext();
9093  return __pyx_r;
9094 }
9095 
9096 /* "csubgridError.pyx":1574
9097  * <double*> dsubgridErrorW_dv.data,
9098  * <double*> dsubgridErrorW_dw.data)
9099  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
9100  * np.ndarray dm,
9101  * np.ndarray f,
9102  */
9103 
9104 /* Python wrapper */
9105 static PyObject *__pyx_pw_13csubgridError_55calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9106 static PyMethodDef __pyx_mdef_13csubgridError_55calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure = {"calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_55calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure, METH_VARARGS|METH_KEYWORDS, 0};
9107 static PyObject *__pyx_pw_13csubgridError_55calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9108  PyArrayObject *__pyx_v_elementDiameter = 0;
9109  PyArrayObject *__pyx_v_dm = 0;
9110  PyArrayObject *__pyx_v_f = 0;
9111  PyArrayObject *__pyx_v_a = 0;
9112  PyArrayObject *__pyx_v_pdeResidualP = 0;
9113  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
9114  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
9115  PyArrayObject *__pyx_v_dpdeResidualP_dw = 0;
9116  PyArrayObject *__pyx_v_pdeResidualU = 0;
9117  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
9118  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
9119  PyArrayObject *__pyx_v_pdeResidualV = 0;
9120  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
9121  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
9122  PyArrayObject *__pyx_v_pdeResidualW = 0;
9123  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
9124  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
9125  PyArrayObject *__pyx_v_subgridErrorP = 0;
9126  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
9127  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
9128  PyArrayObject *__pyx_v_dsubgridErrorP_dw = 0;
9129  PyArrayObject *__pyx_v_subgridErrorU = 0;
9130  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
9131  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
9132  PyArrayObject *__pyx_v_subgridErrorV = 0;
9133  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
9134  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
9135  PyArrayObject *__pyx_v_subgridErrorW = 0;
9136  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
9137  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
9138  int __pyx_lineno = 0;
9139  const char *__pyx_filename = NULL;
9140  int __pyx_clineno = 0;
9141  PyObject *__pyx_r = 0;
9142  __Pyx_RefNannyDeclarations
9143  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure (wrapper)", 0);
9144  {
9145  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_dpdeResidualP_dw,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_dsubgridErrorP_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_dw,0};
9146  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};
9147  if (unlikely(__pyx_kwds)) {
9148  Py_ssize_t kw_args;
9149  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9150  switch (pos_args) {
9151  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
9152  CYTHON_FALLTHROUGH;
9153  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
9154  CYTHON_FALLTHROUGH;
9155  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
9156  CYTHON_FALLTHROUGH;
9157  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
9158  CYTHON_FALLTHROUGH;
9159  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
9160  CYTHON_FALLTHROUGH;
9161  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
9162  CYTHON_FALLTHROUGH;
9163  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9164  CYTHON_FALLTHROUGH;
9165  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9166  CYTHON_FALLTHROUGH;
9167  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9168  CYTHON_FALLTHROUGH;
9169  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9170  CYTHON_FALLTHROUGH;
9171  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9172  CYTHON_FALLTHROUGH;
9173  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9174  CYTHON_FALLTHROUGH;
9175  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9176  CYTHON_FALLTHROUGH;
9177  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9178  CYTHON_FALLTHROUGH;
9179  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9180  CYTHON_FALLTHROUGH;
9181  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9182  CYTHON_FALLTHROUGH;
9183  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9184  CYTHON_FALLTHROUGH;
9185  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9186  CYTHON_FALLTHROUGH;
9187  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9188  CYTHON_FALLTHROUGH;
9189  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9190  CYTHON_FALLTHROUGH;
9191  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9192  CYTHON_FALLTHROUGH;
9193  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9194  CYTHON_FALLTHROUGH;
9195  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9196  CYTHON_FALLTHROUGH;
9197  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9198  CYTHON_FALLTHROUGH;
9199  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9200  CYTHON_FALLTHROUGH;
9201  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9202  CYTHON_FALLTHROUGH;
9203  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9204  CYTHON_FALLTHROUGH;
9205  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9206  CYTHON_FALLTHROUGH;
9207  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9208  CYTHON_FALLTHROUGH;
9209  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9210  CYTHON_FALLTHROUGH;
9211  case 0: break;
9212  default: goto __pyx_L5_argtuple_error;
9213  }
9214  kw_args = PyDict_Size(__pyx_kwds);
9215  switch (pos_args) {
9216  case 0:
9217  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
9218  else goto __pyx_L5_argtuple_error;
9219  CYTHON_FALLTHROUGH;
9220  case 1:
9221  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
9222  else {
9223  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 1); __PYX_ERR(0, 1574, __pyx_L3_error)
9224  }
9225  CYTHON_FALLTHROUGH;
9226  case 2:
9227  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
9228  else {
9229  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 2); __PYX_ERR(0, 1574, __pyx_L3_error)
9230  }
9231  CYTHON_FALLTHROUGH;
9232  case 3:
9233  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
9234  else {
9235  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 3); __PYX_ERR(0, 1574, __pyx_L3_error)
9236  }
9237  CYTHON_FALLTHROUGH;
9238  case 4:
9239  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
9240  else {
9241  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 4); __PYX_ERR(0, 1574, __pyx_L3_error)
9242  }
9243  CYTHON_FALLTHROUGH;
9244  case 5:
9245  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
9246  else {
9247  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 5); __PYX_ERR(0, 1574, __pyx_L3_error)
9248  }
9249  CYTHON_FALLTHROUGH;
9250  case 6:
9251  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
9252  else {
9253  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 6); __PYX_ERR(0, 1574, __pyx_L3_error)
9254  }
9255  CYTHON_FALLTHROUGH;
9256  case 7:
9257  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dw)) != 0)) kw_args--;
9258  else {
9259  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 7); __PYX_ERR(0, 1574, __pyx_L3_error)
9260  }
9261  CYTHON_FALLTHROUGH;
9262  case 8:
9263  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
9264  else {
9265  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 8); __PYX_ERR(0, 1574, __pyx_L3_error)
9266  }
9267  CYTHON_FALLTHROUGH;
9268  case 9:
9269  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
9270  else {
9271  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 9); __PYX_ERR(0, 1574, __pyx_L3_error)
9272  }
9273  CYTHON_FALLTHROUGH;
9274  case 10:
9275  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
9276  else {
9277  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 10); __PYX_ERR(0, 1574, __pyx_L3_error)
9278  }
9279  CYTHON_FALLTHROUGH;
9280  case 11:
9281  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
9282  else {
9283  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 11); __PYX_ERR(0, 1574, __pyx_L3_error)
9284  }
9285  CYTHON_FALLTHROUGH;
9286  case 12:
9287  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
9288  else {
9289  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 12); __PYX_ERR(0, 1574, __pyx_L3_error)
9290  }
9291  CYTHON_FALLTHROUGH;
9292  case 13:
9293  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
9294  else {
9295  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 13); __PYX_ERR(0, 1574, __pyx_L3_error)
9296  }
9297  CYTHON_FALLTHROUGH;
9298  case 14:
9299  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
9300  else {
9301  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 14); __PYX_ERR(0, 1574, __pyx_L3_error)
9302  }
9303  CYTHON_FALLTHROUGH;
9304  case 15:
9305  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
9306  else {
9307  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 15); __PYX_ERR(0, 1574, __pyx_L3_error)
9308  }
9309  CYTHON_FALLTHROUGH;
9310  case 16:
9311  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
9312  else {
9313  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 16); __PYX_ERR(0, 1574, __pyx_L3_error)
9314  }
9315  CYTHON_FALLTHROUGH;
9316  case 17:
9317  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
9318  else {
9319  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 17); __PYX_ERR(0, 1574, __pyx_L3_error)
9320  }
9321  CYTHON_FALLTHROUGH;
9322  case 18:
9323  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
9324  else {
9325  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 18); __PYX_ERR(0, 1574, __pyx_L3_error)
9326  }
9327  CYTHON_FALLTHROUGH;
9328  case 19:
9329  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
9330  else {
9331  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 19); __PYX_ERR(0, 1574, __pyx_L3_error)
9332  }
9333  CYTHON_FALLTHROUGH;
9334  case 20:
9335  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dw)) != 0)) kw_args--;
9336  else {
9337  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 20); __PYX_ERR(0, 1574, __pyx_L3_error)
9338  }
9339  CYTHON_FALLTHROUGH;
9340  case 21:
9341  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
9342  else {
9343  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 21); __PYX_ERR(0, 1574, __pyx_L3_error)
9344  }
9345  CYTHON_FALLTHROUGH;
9346  case 22:
9347  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
9348  else {
9349  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 22); __PYX_ERR(0, 1574, __pyx_L3_error)
9350  }
9351  CYTHON_FALLTHROUGH;
9352  case 23:
9353  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
9354  else {
9355  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 23); __PYX_ERR(0, 1574, __pyx_L3_error)
9356  }
9357  CYTHON_FALLTHROUGH;
9358  case 24:
9359  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
9360  else {
9361  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 24); __PYX_ERR(0, 1574, __pyx_L3_error)
9362  }
9363  CYTHON_FALLTHROUGH;
9364  case 25:
9365  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
9366  else {
9367  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 25); __PYX_ERR(0, 1574, __pyx_L3_error)
9368  }
9369  CYTHON_FALLTHROUGH;
9370  case 26:
9371  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
9372  else {
9373  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 26); __PYX_ERR(0, 1574, __pyx_L3_error)
9374  }
9375  CYTHON_FALLTHROUGH;
9376  case 27:
9377  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
9378  else {
9379  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 27); __PYX_ERR(0, 1574, __pyx_L3_error)
9380  }
9381  CYTHON_FALLTHROUGH;
9382  case 28:
9383  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
9384  else {
9385  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 28); __PYX_ERR(0, 1574, __pyx_L3_error)
9386  }
9387  CYTHON_FALLTHROUGH;
9388  case 29:
9389  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
9390  else {
9391  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, 29); __PYX_ERR(0, 1574, __pyx_L3_error)
9392  }
9393  }
9394  if (unlikely(kw_args > 0)) {
9395  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure") < 0)) __PYX_ERR(0, 1574, __pyx_L3_error)
9396  }
9397  } else if (PyTuple_GET_SIZE(__pyx_args) != 30) {
9398  goto __pyx_L5_argtuple_error;
9399  } else {
9400  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9401  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9402  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9403  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9404  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9405  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9406  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9407  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9408  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9409  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9410  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9411  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9412  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9413  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9414  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9415  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9416  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9417  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9418  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9419  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9420  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9421  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9422  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9423  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9424  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
9425  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
9426  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
9427  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
9428  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
9429  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
9430  }
9431  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
9432  __pyx_v_dm = ((PyArrayObject *)values[1]);
9433  __pyx_v_f = ((PyArrayObject *)values[2]);
9434  __pyx_v_a = ((PyArrayObject *)values[3]);
9435  __pyx_v_pdeResidualP = ((PyArrayObject *)values[4]);
9436  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[5]);
9437  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[6]);
9438  __pyx_v_dpdeResidualP_dw = ((PyArrayObject *)values[7]);
9439  __pyx_v_pdeResidualU = ((PyArrayObject *)values[8]);
9440  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[9]);
9441  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[10]);
9442  __pyx_v_pdeResidualV = ((PyArrayObject *)values[11]);
9443  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[12]);
9444  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[13]);
9445  __pyx_v_pdeResidualW = ((PyArrayObject *)values[14]);
9446  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[15]);
9447  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[16]);
9448  __pyx_v_subgridErrorP = ((PyArrayObject *)values[17]);
9449  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[18]);
9450  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[19]);
9451  __pyx_v_dsubgridErrorP_dw = ((PyArrayObject *)values[20]);
9452  __pyx_v_subgridErrorU = ((PyArrayObject *)values[21]);
9453  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[22]);
9454  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[23]);
9455  __pyx_v_subgridErrorV = ((PyArrayObject *)values[24]);
9456  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[25]);
9457  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[26]);
9458  __pyx_v_subgridErrorW = ((PyArrayObject *)values[27]);
9459  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[28]);
9460  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[29]);
9461  }
9462  goto __pyx_L4_argument_unpacking_done;
9463  __pyx_L5_argtuple_error:;
9464  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 1, 30, 30, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1574, __pyx_L3_error)
9465  __pyx_L3_error:;
9466  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", __pyx_clineno, __pyx_lineno, __pyx_filename);
9467  __Pyx_RefNannyFinishContext();
9468  return NULL;
9469  __pyx_L4_argument_unpacking_done:;
9470  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1574, __pyx_L1_error)
9471  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1575, __pyx_L1_error)
9472  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1576, __pyx_L1_error)
9473  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1577, __pyx_L1_error)
9474  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1578, __pyx_L1_error)
9475  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1579, __pyx_L1_error)
9476  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1580, __pyx_L1_error)
9477  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dw", 0))) __PYX_ERR(0, 1581, __pyx_L1_error)
9478  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1582, __pyx_L1_error)
9479  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1583, __pyx_L1_error)
9480  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1584, __pyx_L1_error)
9481  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1585, __pyx_L1_error)
9482  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1586, __pyx_L1_error)
9483  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1587, __pyx_L1_error)
9484  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 1588, __pyx_L1_error)
9485  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 1589, __pyx_L1_error)
9486  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 1590, __pyx_L1_error)
9487  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1591, __pyx_L1_error)
9488  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1592, __pyx_L1_error)
9489  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1593, __pyx_L1_error)
9490  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dw", 0))) __PYX_ERR(0, 1594, __pyx_L1_error)
9491  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1595, __pyx_L1_error)
9492  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1596, __pyx_L1_error)
9493  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1597, __pyx_L1_error)
9494  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1598, __pyx_L1_error)
9495  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1599, __pyx_L1_error)
9496  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1600, __pyx_L1_error)
9497  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 1601, __pyx_L1_error)
9498  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 1602, __pyx_L1_error)
9499  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 1603, __pyx_L1_error)
9500  __pyx_r = __pyx_pf_13csubgridError_54calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(__pyx_self, __pyx_v_elementDiameter, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_dpdeResidualP_dw, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_dsubgridErrorP_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_dw);
9501 
9502  /* function exit code */
9503  goto __pyx_L0;
9504  __pyx_L1_error:;
9505  __pyx_r = NULL;
9506  __pyx_L0:;
9507  __Pyx_RefNannyFinishContext();
9508  return __pyx_r;
9509 }
9510 
9511 static PyObject *__pyx_pf_13csubgridError_54calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
9512  PyObject *__pyx_r = NULL;
9513  __Pyx_RefNannyDeclarations
9514  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure", 0);
9515 
9516  /* "csubgridError.pyx":1604
9517  * np.ndarray dsubgridErrorW_dp,
9518  * np.ndarray dsubgridErrorW_dw):
9519  * ccalculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
9520  * dsubgridErrorP_du.shape[1],
9521  * dsubgridErrorP_du.shape[2],
9522  */
9523  calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 3, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_dpdeResidualP_dw->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_dsubgridErrorP_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
9524 
9525  /* "csubgridError.pyx":1574
9526  * <double*> dsubgridErrorW_dv.data,
9527  * <double*> dsubgridErrorW_dw.data)
9528  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
9529  * np.ndarray dm,
9530  * np.ndarray f,
9531  */
9532 
9533  /* function exit code */
9534  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9535  __Pyx_XGIVEREF(__pyx_r);
9536  __Pyx_RefNannyFinishContext();
9537  return __pyx_r;
9538 }
9539 
9540 /* "csubgridError.pyx":1638
9541  * <double*> dsubgridErrorW_dp.data,
9542  * <double*> dsubgridErrorW_dw.data)
9543  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
9544  * np.ndarray dm,
9545  * np.ndarray f,
9546  */
9547 
9548 /* Python wrapper */
9549 static PyObject *__pyx_pw_13csubgridError_57calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9550 static PyMethodDef __pyx_mdef_13csubgridError_57calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd = {"calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_57calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd, METH_VARARGS|METH_KEYWORDS, 0};
9551 static PyObject *__pyx_pw_13csubgridError_57calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9552  PyArrayObject *__pyx_v_elementDiameter = 0;
9553  PyArrayObject *__pyx_v_dm = 0;
9554  PyArrayObject *__pyx_v_f = 0;
9555  PyArrayObject *__pyx_v_a = 0;
9556  PyArrayObject *__pyx_v_pdeResidualP = 0;
9557  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
9558  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
9559  PyArrayObject *__pyx_v_dpdeResidualP_dw = 0;
9560  PyArrayObject *__pyx_v_pdeResidualU = 0;
9561  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
9562  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
9563  PyArrayObject *__pyx_v_pdeResidualV = 0;
9564  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
9565  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
9566  PyArrayObject *__pyx_v_pdeResidualW = 0;
9567  PyArrayObject *__pyx_v_dpdeResidualW_dp = 0;
9568  PyArrayObject *__pyx_v_dpdeResidualW_dw = 0;
9569  PyArrayObject *__pyx_v_subgridErrorP = 0;
9570  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
9571  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
9572  PyArrayObject *__pyx_v_dsubgridErrorP_dw = 0;
9573  PyArrayObject *__pyx_v_subgridErrorU = 0;
9574  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
9575  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
9576  PyArrayObject *__pyx_v_subgridErrorV = 0;
9577  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
9578  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
9579  PyArrayObject *__pyx_v_subgridErrorW = 0;
9580  PyArrayObject *__pyx_v_dsubgridErrorW_dp = 0;
9581  PyArrayObject *__pyx_v_dsubgridErrorW_dw = 0;
9582  int __pyx_lineno = 0;
9583  const char *__pyx_filename = NULL;
9584  int __pyx_clineno = 0;
9585  PyObject *__pyx_r = 0;
9586  __Pyx_RefNannyDeclarations
9587  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd (wrapper)", 0);
9588  {
9589  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_dm,&__pyx_n_s_f,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_dpdeResidualP_dw,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_pdeResidualW,&__pyx_n_s_dpdeResidualW_dp,&__pyx_n_s_dpdeResidualW_dw,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_dsubgridErrorP_dw,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_dv,&__pyx_n_s_subgridErrorW,&__pyx_n_s_dsubgridErrorW_dp,&__pyx_n_s_dsubgridErrorW_dw,0};
9590  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};
9591  if (unlikely(__pyx_kwds)) {
9592  Py_ssize_t kw_args;
9593  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9594  switch (pos_args) {
9595  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
9596  CYTHON_FALLTHROUGH;
9597  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
9598  CYTHON_FALLTHROUGH;
9599  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
9600  CYTHON_FALLTHROUGH;
9601  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
9602  CYTHON_FALLTHROUGH;
9603  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
9604  CYTHON_FALLTHROUGH;
9605  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
9606  CYTHON_FALLTHROUGH;
9607  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9608  CYTHON_FALLTHROUGH;
9609  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9610  CYTHON_FALLTHROUGH;
9611  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9612  CYTHON_FALLTHROUGH;
9613  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9614  CYTHON_FALLTHROUGH;
9615  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9616  CYTHON_FALLTHROUGH;
9617  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9618  CYTHON_FALLTHROUGH;
9619  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9620  CYTHON_FALLTHROUGH;
9621  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9622  CYTHON_FALLTHROUGH;
9623  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9624  CYTHON_FALLTHROUGH;
9625  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9626  CYTHON_FALLTHROUGH;
9627  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9628  CYTHON_FALLTHROUGH;
9629  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9630  CYTHON_FALLTHROUGH;
9631  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9632  CYTHON_FALLTHROUGH;
9633  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9634  CYTHON_FALLTHROUGH;
9635  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9636  CYTHON_FALLTHROUGH;
9637  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9638  CYTHON_FALLTHROUGH;
9639  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9640  CYTHON_FALLTHROUGH;
9641  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9642  CYTHON_FALLTHROUGH;
9643  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9644  CYTHON_FALLTHROUGH;
9645  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9646  CYTHON_FALLTHROUGH;
9647  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9648  CYTHON_FALLTHROUGH;
9649  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9650  CYTHON_FALLTHROUGH;
9651  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9652  CYTHON_FALLTHROUGH;
9653  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9654  CYTHON_FALLTHROUGH;
9655  case 0: break;
9656  default: goto __pyx_L5_argtuple_error;
9657  }
9658  kw_args = PyDict_Size(__pyx_kwds);
9659  switch (pos_args) {
9660  case 0:
9661  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
9662  else goto __pyx_L5_argtuple_error;
9663  CYTHON_FALLTHROUGH;
9664  case 1:
9665  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
9666  else {
9667  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 1); __PYX_ERR(0, 1638, __pyx_L3_error)
9668  }
9669  CYTHON_FALLTHROUGH;
9670  case 2:
9671  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
9672  else {
9673  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 2); __PYX_ERR(0, 1638, __pyx_L3_error)
9674  }
9675  CYTHON_FALLTHROUGH;
9676  case 3:
9677  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
9678  else {
9679  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 3); __PYX_ERR(0, 1638, __pyx_L3_error)
9680  }
9681  CYTHON_FALLTHROUGH;
9682  case 4:
9683  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
9684  else {
9685  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 4); __PYX_ERR(0, 1638, __pyx_L3_error)
9686  }
9687  CYTHON_FALLTHROUGH;
9688  case 5:
9689  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
9690  else {
9691  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 5); __PYX_ERR(0, 1638, __pyx_L3_error)
9692  }
9693  CYTHON_FALLTHROUGH;
9694  case 6:
9695  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
9696  else {
9697  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 6); __PYX_ERR(0, 1638, __pyx_L3_error)
9698  }
9699  CYTHON_FALLTHROUGH;
9700  case 7:
9701  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dw)) != 0)) kw_args--;
9702  else {
9703  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 7); __PYX_ERR(0, 1638, __pyx_L3_error)
9704  }
9705  CYTHON_FALLTHROUGH;
9706  case 8:
9707  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
9708  else {
9709  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 8); __PYX_ERR(0, 1638, __pyx_L3_error)
9710  }
9711  CYTHON_FALLTHROUGH;
9712  case 9:
9713  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
9714  else {
9715  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 9); __PYX_ERR(0, 1638, __pyx_L3_error)
9716  }
9717  CYTHON_FALLTHROUGH;
9718  case 10:
9719  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
9720  else {
9721  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 10); __PYX_ERR(0, 1638, __pyx_L3_error)
9722  }
9723  CYTHON_FALLTHROUGH;
9724  case 11:
9725  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
9726  else {
9727  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 11); __PYX_ERR(0, 1638, __pyx_L3_error)
9728  }
9729  CYTHON_FALLTHROUGH;
9730  case 12:
9731  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
9732  else {
9733  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 12); __PYX_ERR(0, 1638, __pyx_L3_error)
9734  }
9735  CYTHON_FALLTHROUGH;
9736  case 13:
9737  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
9738  else {
9739  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 13); __PYX_ERR(0, 1638, __pyx_L3_error)
9740  }
9741  CYTHON_FALLTHROUGH;
9742  case 14:
9743  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualW)) != 0)) kw_args--;
9744  else {
9745  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 14); __PYX_ERR(0, 1638, __pyx_L3_error)
9746  }
9747  CYTHON_FALLTHROUGH;
9748  case 15:
9749  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dp)) != 0)) kw_args--;
9750  else {
9751  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 15); __PYX_ERR(0, 1638, __pyx_L3_error)
9752  }
9753  CYTHON_FALLTHROUGH;
9754  case 16:
9755  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualW_dw)) != 0)) kw_args--;
9756  else {
9757  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 16); __PYX_ERR(0, 1638, __pyx_L3_error)
9758  }
9759  CYTHON_FALLTHROUGH;
9760  case 17:
9761  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
9762  else {
9763  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 17); __PYX_ERR(0, 1638, __pyx_L3_error)
9764  }
9765  CYTHON_FALLTHROUGH;
9766  case 18:
9767  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
9768  else {
9769  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 18); __PYX_ERR(0, 1638, __pyx_L3_error)
9770  }
9771  CYTHON_FALLTHROUGH;
9772  case 19:
9773  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
9774  else {
9775  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 19); __PYX_ERR(0, 1638, __pyx_L3_error)
9776  }
9777  CYTHON_FALLTHROUGH;
9778  case 20:
9779  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dw)) != 0)) kw_args--;
9780  else {
9781  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 20); __PYX_ERR(0, 1638, __pyx_L3_error)
9782  }
9783  CYTHON_FALLTHROUGH;
9784  case 21:
9785  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
9786  else {
9787  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 21); __PYX_ERR(0, 1638, __pyx_L3_error)
9788  }
9789  CYTHON_FALLTHROUGH;
9790  case 22:
9791  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
9792  else {
9793  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 22); __PYX_ERR(0, 1638, __pyx_L3_error)
9794  }
9795  CYTHON_FALLTHROUGH;
9796  case 23:
9797  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
9798  else {
9799  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 23); __PYX_ERR(0, 1638, __pyx_L3_error)
9800  }
9801  CYTHON_FALLTHROUGH;
9802  case 24:
9803  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
9804  else {
9805  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 24); __PYX_ERR(0, 1638, __pyx_L3_error)
9806  }
9807  CYTHON_FALLTHROUGH;
9808  case 25:
9809  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
9810  else {
9811  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 25); __PYX_ERR(0, 1638, __pyx_L3_error)
9812  }
9813  CYTHON_FALLTHROUGH;
9814  case 26:
9815  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
9816  else {
9817  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 26); __PYX_ERR(0, 1638, __pyx_L3_error)
9818  }
9819  CYTHON_FALLTHROUGH;
9820  case 27:
9821  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorW)) != 0)) kw_args--;
9822  else {
9823  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 27); __PYX_ERR(0, 1638, __pyx_L3_error)
9824  }
9825  CYTHON_FALLTHROUGH;
9826  case 28:
9827  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dp)) != 0)) kw_args--;
9828  else {
9829  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 28); __PYX_ERR(0, 1638, __pyx_L3_error)
9830  }
9831  CYTHON_FALLTHROUGH;
9832  case 29:
9833  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorW_dw)) != 0)) kw_args--;
9834  else {
9835  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, 29); __PYX_ERR(0, 1638, __pyx_L3_error)
9836  }
9837  }
9838  if (unlikely(kw_args > 0)) {
9839  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd") < 0)) __PYX_ERR(0, 1638, __pyx_L3_error)
9840  }
9841  } else if (PyTuple_GET_SIZE(__pyx_args) != 30) {
9842  goto __pyx_L5_argtuple_error;
9843  } else {
9844  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9845  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9846  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9847  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9848  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9849  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9850  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9851  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9852  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9853  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9854  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9855  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9856  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9857  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9858  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9859  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9860  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9861  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9862  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9863  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9864  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9865  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9866  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9867  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9868  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
9869  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
9870  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
9871  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
9872  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
9873  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
9874  }
9875  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
9876  __pyx_v_dm = ((PyArrayObject *)values[1]);
9877  __pyx_v_f = ((PyArrayObject *)values[2]);
9878  __pyx_v_a = ((PyArrayObject *)values[3]);
9879  __pyx_v_pdeResidualP = ((PyArrayObject *)values[4]);
9880  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[5]);
9881  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[6]);
9882  __pyx_v_dpdeResidualP_dw = ((PyArrayObject *)values[7]);
9883  __pyx_v_pdeResidualU = ((PyArrayObject *)values[8]);
9884  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[9]);
9885  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[10]);
9886  __pyx_v_pdeResidualV = ((PyArrayObject *)values[11]);
9887  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[12]);
9888  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[13]);
9889  __pyx_v_pdeResidualW = ((PyArrayObject *)values[14]);
9890  __pyx_v_dpdeResidualW_dp = ((PyArrayObject *)values[15]);
9891  __pyx_v_dpdeResidualW_dw = ((PyArrayObject *)values[16]);
9892  __pyx_v_subgridErrorP = ((PyArrayObject *)values[17]);
9893  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[18]);
9894  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[19]);
9895  __pyx_v_dsubgridErrorP_dw = ((PyArrayObject *)values[20]);
9896  __pyx_v_subgridErrorU = ((PyArrayObject *)values[21]);
9897  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[22]);
9898  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[23]);
9899  __pyx_v_subgridErrorV = ((PyArrayObject *)values[24]);
9900  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[25]);
9901  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[26]);
9902  __pyx_v_subgridErrorW = ((PyArrayObject *)values[27]);
9903  __pyx_v_dsubgridErrorW_dp = ((PyArrayObject *)values[28]);
9904  __pyx_v_dsubgridErrorW_dw = ((PyArrayObject *)values[29]);
9905  }
9906  goto __pyx_L4_argument_unpacking_done;
9907  __pyx_L5_argtuple_error:;
9908  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 1, 30, 30, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1638, __pyx_L3_error)
9909  __pyx_L3_error:;
9910  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
9911  __Pyx_RefNannyFinishContext();
9912  return NULL;
9913  __pyx_L4_argument_unpacking_done:;
9914  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1638, __pyx_L1_error)
9915  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1, "dm", 0))) __PYX_ERR(0, 1639, __pyx_L1_error)
9916  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_5numpy_ndarray, 1, "f", 0))) __PYX_ERR(0, 1640, __pyx_L1_error)
9917  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1641, __pyx_L1_error)
9918  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1642, __pyx_L1_error)
9919  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1643, __pyx_L1_error)
9920  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1644, __pyx_L1_error)
9921  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dw", 0))) __PYX_ERR(0, 1645, __pyx_L1_error)
9922  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1646, __pyx_L1_error)
9923  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1647, __pyx_L1_error)
9924  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1648, __pyx_L1_error)
9925  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1649, __pyx_L1_error)
9926  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1650, __pyx_L1_error)
9927  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1651, __pyx_L1_error)
9928  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualW), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualW", 0))) __PYX_ERR(0, 1652, __pyx_L1_error)
9929  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dp", 0))) __PYX_ERR(0, 1653, __pyx_L1_error)
9930  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualW_dw), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualW_dw", 0))) __PYX_ERR(0, 1654, __pyx_L1_error)
9931  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1655, __pyx_L1_error)
9932  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1656, __pyx_L1_error)
9933  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1657, __pyx_L1_error)
9934  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dw", 0))) __PYX_ERR(0, 1658, __pyx_L1_error)
9935  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1659, __pyx_L1_error)
9936  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1660, __pyx_L1_error)
9937  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1661, __pyx_L1_error)
9938  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1662, __pyx_L1_error)
9939  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1663, __pyx_L1_error)
9940  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1664, __pyx_L1_error)
9941  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorW), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorW", 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
9942  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dp", 0))) __PYX_ERR(0, 1666, __pyx_L1_error)
9943  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorW_dw), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorW_dw", 0))) __PYX_ERR(0, 1667, __pyx_L1_error)
9944  __pyx_r = __pyx_pf_13csubgridError_56calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(__pyx_self, __pyx_v_elementDiameter, __pyx_v_dm, __pyx_v_f, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_dpdeResidualP_dw, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_pdeResidualW, __pyx_v_dpdeResidualW_dp, __pyx_v_dpdeResidualW_dw, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_dsubgridErrorP_dw, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_dv, __pyx_v_subgridErrorW, __pyx_v_dsubgridErrorW_dp, __pyx_v_dsubgridErrorW_dw);
9945 
9946  /* function exit code */
9947  goto __pyx_L0;
9948  __pyx_L1_error:;
9949  __pyx_r = NULL;
9950  __pyx_L0:;
9951  __Pyx_RefNannyFinishContext();
9952  return __pyx_r;
9953 }
9954 
9955 static PyObject *__pyx_pf_13csubgridError_56calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_f, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_dpdeResidualP_dw, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_pdeResidualW, PyArrayObject *__pyx_v_dpdeResidualW_dp, PyArrayObject *__pyx_v_dpdeResidualW_dw, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_dsubgridErrorP_dw, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_dv, PyArrayObject *__pyx_v_subgridErrorW, PyArrayObject *__pyx_v_dsubgridErrorW_dp, PyArrayObject *__pyx_v_dsubgridErrorW_dw) {
9956  PyObject *__pyx_r = NULL;
9957  __Pyx_RefNannyDeclarations
9958  __Pyx_RefNannySetupContext("calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd", 0);
9959 
9960  /* "csubgridError.pyx":1668
9961  * np.ndarray dsubgridErrorW_dp,
9962  * np.ndarray dsubgridErrorW_dw):
9963  * ccalculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
9964  * dsubgridErrorP_du.shape[1],
9965  * dsubgridErrorP_du.shape[2],
9966  */
9967  calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 3, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_dm->data), ((double *)__pyx_v_f->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_dpdeResidualP_dw->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_pdeResidualW->data), ((double *)__pyx_v_dpdeResidualW_dp->data), ((double *)__pyx_v_dpdeResidualW_dw->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_dsubgridErrorP_dw->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_dv->data), ((double *)__pyx_v_subgridErrorW->data), ((double *)__pyx_v_dsubgridErrorW_dp->data), ((double *)__pyx_v_dsubgridErrorW_dw->data));
9968 
9969  /* "csubgridError.pyx":1638
9970  * <double*> dsubgridErrorW_dp.data,
9971  * <double*> dsubgridErrorW_dw.data)
9972  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
9973  * np.ndarray dm,
9974  * np.ndarray f,
9975  */
9976 
9977  /* function exit code */
9978  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9979  __Pyx_XGIVEREF(__pyx_r);
9980  __Pyx_RefNannyFinishContext();
9981  return __pyx_r;
9982 }
9983 
9984 /* "csubgridError.pyx":1702
9985  * <double*> dsubgridErrorW_dp.data,
9986  * <double*> dsubgridErrorW_dw.data)
9987  * def calculateSubgridErrorStokes2D_1(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
9988  * np.ndarray u,
9989  * np.ndarray v,
9990  */
9991 
9992 /* Python wrapper */
9993 static PyObject *__pyx_pw_13csubgridError_59calculateSubgridErrorStokes2D_1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9994 static PyMethodDef __pyx_mdef_13csubgridError_59calculateSubgridErrorStokes2D_1 = {"calculateSubgridErrorStokes2D_1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_59calculateSubgridErrorStokes2D_1, METH_VARARGS|METH_KEYWORDS, 0};
9995 static PyObject *__pyx_pw_13csubgridError_59calculateSubgridErrorStokes2D_1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9996  PyArrayObject *__pyx_v_elementDiameter = 0;
9997  PyArrayObject *__pyx_v_u = 0;
9998  PyArrayObject *__pyx_v_v = 0;
9999  PyArrayObject *__pyx_v_a = 0;
10000  PyArrayObject *__pyx_v_pdeResidualP = 0;
10001  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
10002  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
10003  PyArrayObject *__pyx_v_pdeResidualU = 0;
10004  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
10005  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
10006  PyArrayObject *__pyx_v_pdeResidualV = 0;
10007  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
10008  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
10009  PyArrayObject *__pyx_v_subgridErrorP = 0;
10010  PyArrayObject *__pyx_v_dsubgridErrorP_dp = 0;
10011  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
10012  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
10013  PyArrayObject *__pyx_v_subgridErrorU = 0;
10014  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
10015  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
10016  PyArrayObject *__pyx_v_dsubgridErrorU_dv = 0;
10017  PyArrayObject *__pyx_v_subgridErrorV = 0;
10018  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
10019  PyArrayObject *__pyx_v_dsubgridErrorV_du = 0;
10020  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
10021  int __pyx_lineno = 0;
10022  const char *__pyx_filename = NULL;
10023  int __pyx_clineno = 0;
10024  PyObject *__pyx_r = 0;
10025  __Pyx_RefNannyDeclarations
10026  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_1 (wrapper)", 0);
10027  {
10028  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_u,&__pyx_n_s_v,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_dp,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_dsubgridErrorU_dv,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_du,&__pyx_n_s_dsubgridErrorV_dv,0};
10029  PyObject* values[25] = {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};
10030  if (unlikely(__pyx_kwds)) {
10031  Py_ssize_t kw_args;
10032  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10033  switch (pos_args) {
10034  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
10035  CYTHON_FALLTHROUGH;
10036  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10037  CYTHON_FALLTHROUGH;
10038  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10039  CYTHON_FALLTHROUGH;
10040  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10041  CYTHON_FALLTHROUGH;
10042  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10043  CYTHON_FALLTHROUGH;
10044  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10045  CYTHON_FALLTHROUGH;
10046  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10047  CYTHON_FALLTHROUGH;
10048  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10049  CYTHON_FALLTHROUGH;
10050  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10051  CYTHON_FALLTHROUGH;
10052  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10053  CYTHON_FALLTHROUGH;
10054  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10055  CYTHON_FALLTHROUGH;
10056  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10057  CYTHON_FALLTHROUGH;
10058  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10059  CYTHON_FALLTHROUGH;
10060  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10061  CYTHON_FALLTHROUGH;
10062  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10063  CYTHON_FALLTHROUGH;
10064  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10065  CYTHON_FALLTHROUGH;
10066  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10067  CYTHON_FALLTHROUGH;
10068  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10069  CYTHON_FALLTHROUGH;
10070  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10071  CYTHON_FALLTHROUGH;
10072  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10073  CYTHON_FALLTHROUGH;
10074  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10075  CYTHON_FALLTHROUGH;
10076  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10077  CYTHON_FALLTHROUGH;
10078  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10079  CYTHON_FALLTHROUGH;
10080  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10081  CYTHON_FALLTHROUGH;
10082  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10083  CYTHON_FALLTHROUGH;
10084  case 0: break;
10085  default: goto __pyx_L5_argtuple_error;
10086  }
10087  kw_args = PyDict_Size(__pyx_kwds);
10088  switch (pos_args) {
10089  case 0:
10090  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
10091  else goto __pyx_L5_argtuple_error;
10092  CYTHON_FALLTHROUGH;
10093  case 1:
10094  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--;
10095  else {
10096  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 1); __PYX_ERR(0, 1702, __pyx_L3_error)
10097  }
10098  CYTHON_FALLTHROUGH;
10099  case 2:
10100  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
10101  else {
10102  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 2); __PYX_ERR(0, 1702, __pyx_L3_error)
10103  }
10104  CYTHON_FALLTHROUGH;
10105  case 3:
10106  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
10107  else {
10108  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 3); __PYX_ERR(0, 1702, __pyx_L3_error)
10109  }
10110  CYTHON_FALLTHROUGH;
10111  case 4:
10112  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
10113  else {
10114  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 4); __PYX_ERR(0, 1702, __pyx_L3_error)
10115  }
10116  CYTHON_FALLTHROUGH;
10117  case 5:
10118  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
10119  else {
10120  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 5); __PYX_ERR(0, 1702, __pyx_L3_error)
10121  }
10122  CYTHON_FALLTHROUGH;
10123  case 6:
10124  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
10125  else {
10126  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 6); __PYX_ERR(0, 1702, __pyx_L3_error)
10127  }
10128  CYTHON_FALLTHROUGH;
10129  case 7:
10130  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
10131  else {
10132  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 7); __PYX_ERR(0, 1702, __pyx_L3_error)
10133  }
10134  CYTHON_FALLTHROUGH;
10135  case 8:
10136  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
10137  else {
10138  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 8); __PYX_ERR(0, 1702, __pyx_L3_error)
10139  }
10140  CYTHON_FALLTHROUGH;
10141  case 9:
10142  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
10143  else {
10144  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 9); __PYX_ERR(0, 1702, __pyx_L3_error)
10145  }
10146  CYTHON_FALLTHROUGH;
10147  case 10:
10148  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
10149  else {
10150  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 10); __PYX_ERR(0, 1702, __pyx_L3_error)
10151  }
10152  CYTHON_FALLTHROUGH;
10153  case 11:
10154  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
10155  else {
10156  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 11); __PYX_ERR(0, 1702, __pyx_L3_error)
10157  }
10158  CYTHON_FALLTHROUGH;
10159  case 12:
10160  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
10161  else {
10162  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 12); __PYX_ERR(0, 1702, __pyx_L3_error)
10163  }
10164  CYTHON_FALLTHROUGH;
10165  case 13:
10166  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
10167  else {
10168  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 13); __PYX_ERR(0, 1702, __pyx_L3_error)
10169  }
10170  CYTHON_FALLTHROUGH;
10171  case 14:
10172  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dp)) != 0)) kw_args--;
10173  else {
10174  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 14); __PYX_ERR(0, 1702, __pyx_L3_error)
10175  }
10176  CYTHON_FALLTHROUGH;
10177  case 15:
10178  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
10179  else {
10180  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 15); __PYX_ERR(0, 1702, __pyx_L3_error)
10181  }
10182  CYTHON_FALLTHROUGH;
10183  case 16:
10184  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
10185  else {
10186  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 16); __PYX_ERR(0, 1702, __pyx_L3_error)
10187  }
10188  CYTHON_FALLTHROUGH;
10189  case 17:
10190  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
10191  else {
10192  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 17); __PYX_ERR(0, 1702, __pyx_L3_error)
10193  }
10194  CYTHON_FALLTHROUGH;
10195  case 18:
10196  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
10197  else {
10198  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 18); __PYX_ERR(0, 1702, __pyx_L3_error)
10199  }
10200  CYTHON_FALLTHROUGH;
10201  case 19:
10202  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
10203  else {
10204  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 19); __PYX_ERR(0, 1702, __pyx_L3_error)
10205  }
10206  CYTHON_FALLTHROUGH;
10207  case 20:
10208  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dv)) != 0)) kw_args--;
10209  else {
10210  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 20); __PYX_ERR(0, 1702, __pyx_L3_error)
10211  }
10212  CYTHON_FALLTHROUGH;
10213  case 21:
10214  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
10215  else {
10216  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 21); __PYX_ERR(0, 1702, __pyx_L3_error)
10217  }
10218  CYTHON_FALLTHROUGH;
10219  case 22:
10220  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
10221  else {
10222  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 22); __PYX_ERR(0, 1702, __pyx_L3_error)
10223  }
10224  CYTHON_FALLTHROUGH;
10225  case 23:
10226  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_du)) != 0)) kw_args--;
10227  else {
10228  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 23); __PYX_ERR(0, 1702, __pyx_L3_error)
10229  }
10230  CYTHON_FALLTHROUGH;
10231  case 24:
10232  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
10233  else {
10234  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, 24); __PYX_ERR(0, 1702, __pyx_L3_error)
10235  }
10236  }
10237  if (unlikely(kw_args > 0)) {
10238  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes2D_1") < 0)) __PYX_ERR(0, 1702, __pyx_L3_error)
10239  }
10240  } else if (PyTuple_GET_SIZE(__pyx_args) != 25) {
10241  goto __pyx_L5_argtuple_error;
10242  } else {
10243  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10244  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10245  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10246  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10247  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10248  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10249  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10250  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10251  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10252  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10253  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10254  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10255  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10256  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10257  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10258  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10259  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10260  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10261  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10262  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10263  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10264  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10265  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10266  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10267  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
10268  }
10269  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
10270  __pyx_v_u = ((PyArrayObject *)values[1]);
10271  __pyx_v_v = ((PyArrayObject *)values[2]);
10272  __pyx_v_a = ((PyArrayObject *)values[3]);
10273  __pyx_v_pdeResidualP = ((PyArrayObject *)values[4]);
10274  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[5]);
10275  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[6]);
10276  __pyx_v_pdeResidualU = ((PyArrayObject *)values[7]);
10277  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[8]);
10278  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[9]);
10279  __pyx_v_pdeResidualV = ((PyArrayObject *)values[10]);
10280  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[11]);
10281  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[12]);
10282  __pyx_v_subgridErrorP = ((PyArrayObject *)values[13]);
10283  __pyx_v_dsubgridErrorP_dp = ((PyArrayObject *)values[14]);
10284  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[15]);
10285  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[16]);
10286  __pyx_v_subgridErrorU = ((PyArrayObject *)values[17]);
10287  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[18]);
10288  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[19]);
10289  __pyx_v_dsubgridErrorU_dv = ((PyArrayObject *)values[20]);
10290  __pyx_v_subgridErrorV = ((PyArrayObject *)values[21]);
10291  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[22]);
10292  __pyx_v_dsubgridErrorV_du = ((PyArrayObject *)values[23]);
10293  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[24]);
10294  }
10295  goto __pyx_L4_argument_unpacking_done;
10296  __pyx_L5_argtuple_error:;
10297  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1", 1, 25, 25, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1702, __pyx_L3_error)
10298  __pyx_L3_error:;
10299  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes2D_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
10300  __Pyx_RefNannyFinishContext();
10301  return NULL;
10302  __pyx_L4_argument_unpacking_done:;
10303  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
10304  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_5numpy_ndarray, 1, "u", 0))) __PYX_ERR(0, 1703, __pyx_L1_error)
10305  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 1704, __pyx_L1_error)
10306  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1705, __pyx_L1_error)
10307  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1706, __pyx_L1_error)
10308  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1707, __pyx_L1_error)
10309  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1708, __pyx_L1_error)
10310  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1709, __pyx_L1_error)
10311  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1710, __pyx_L1_error)
10312  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1711, __pyx_L1_error)
10313  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1712, __pyx_L1_error)
10314  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1713, __pyx_L1_error)
10315  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1714, __pyx_L1_error)
10316  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1715, __pyx_L1_error)
10317  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dp", 0))) __PYX_ERR(0, 1716, __pyx_L1_error)
10318  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1717, __pyx_L1_error)
10319  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1718, __pyx_L1_error)
10320  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1719, __pyx_L1_error)
10321  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1720, __pyx_L1_error)
10322  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1721, __pyx_L1_error)
10323  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dv", 0))) __PYX_ERR(0, 1722, __pyx_L1_error)
10324  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1723, __pyx_L1_error)
10325  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1724, __pyx_L1_error)
10326  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_du", 0))) __PYX_ERR(0, 1725, __pyx_L1_error)
10327  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1726, __pyx_L1_error)
10328  __pyx_r = __pyx_pf_13csubgridError_58calculateSubgridErrorStokes2D_1(__pyx_self, __pyx_v_elementDiameter, __pyx_v_u, __pyx_v_v, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_dp, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_dsubgridErrorU_dv, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_du, __pyx_v_dsubgridErrorV_dv);
10329 
10330  /* function exit code */
10331  goto __pyx_L0;
10332  __pyx_L1_error:;
10333  __pyx_r = NULL;
10334  __pyx_L0:;
10335  __Pyx_RefNannyFinishContext();
10336  return __pyx_r;
10337 }
10338 
10339 static PyObject *__pyx_pf_13csubgridError_58calculateSubgridErrorStokes2D_1(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_dp, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
10340  PyObject *__pyx_r = NULL;
10341  __Pyx_RefNannyDeclarations
10342  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_1", 0);
10343 
10344  /* "csubgridError.pyx":1727
10345  * np.ndarray dsubgridErrorV_du,
10346  * np.ndarray dsubgridErrorV_dv):
10347  * ccalculateSubgridErrorStokes2D_1(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
10348  * dsubgridErrorP_du.shape[1],
10349  * dsubgridErrorP_du.shape[2],
10350  */
10351  calculateSubgridErrorStokes2D_1((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 2, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_u->data), ((double *)__pyx_v_v->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_dp->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_dsubgridErrorU_dv->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_du->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
10352 
10353  /* "csubgridError.pyx":1702
10354  * <double*> dsubgridErrorW_dp.data,
10355  * <double*> dsubgridErrorW_dw.data)
10356  * def calculateSubgridErrorStokes2D_1(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
10357  * np.ndarray u,
10358  * np.ndarray v,
10359  */
10360 
10361  /* function exit code */
10362  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10363  __Pyx_XGIVEREF(__pyx_r);
10364  __Pyx_RefNannyFinishContext();
10365  return __pyx_r;
10366 }
10367 
10368 /* "csubgridError.pyx":1756
10369  * <double*> dsubgridErrorV_du.data,
10370  * <double*> dsubgridErrorV_dv.data)
10371  * def calculateSubgridErrorStokes2D_1_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
10372  * np.ndarray u,
10373  * np.ndarray v,
10374  */
10375 
10376 /* Python wrapper */
10377 static PyObject *__pyx_pw_13csubgridError_61calculateSubgridErrorStokes2D_1_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10378 static PyMethodDef __pyx_mdef_13csubgridError_61calculateSubgridErrorStokes2D_1_sd = {"calculateSubgridErrorStokes2D_1_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_61calculateSubgridErrorStokes2D_1_sd, METH_VARARGS|METH_KEYWORDS, 0};
10379 static PyObject *__pyx_pw_13csubgridError_61calculateSubgridErrorStokes2D_1_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10380  PyArrayObject *__pyx_v_elementDiameter = 0;
10381  PyArrayObject *__pyx_v_u = 0;
10382  PyArrayObject *__pyx_v_v = 0;
10383  PyArrayObject *__pyx_v_a = 0;
10384  PyArrayObject *__pyx_v_pdeResidualP = 0;
10385  PyArrayObject *__pyx_v_dpdeResidualP_du = 0;
10386  PyArrayObject *__pyx_v_dpdeResidualP_dv = 0;
10387  PyArrayObject *__pyx_v_pdeResidualU = 0;
10388  PyArrayObject *__pyx_v_dpdeResidualU_dp = 0;
10389  PyArrayObject *__pyx_v_dpdeResidualU_du = 0;
10390  PyArrayObject *__pyx_v_pdeResidualV = 0;
10391  PyArrayObject *__pyx_v_dpdeResidualV_dp = 0;
10392  PyArrayObject *__pyx_v_dpdeResidualV_dv = 0;
10393  PyArrayObject *__pyx_v_subgridErrorP = 0;
10394  PyArrayObject *__pyx_v_dsubgridErrorP_dp = 0;
10395  PyArrayObject *__pyx_v_dsubgridErrorP_du = 0;
10396  PyArrayObject *__pyx_v_dsubgridErrorP_dv = 0;
10397  PyArrayObject *__pyx_v_subgridErrorU = 0;
10398  PyArrayObject *__pyx_v_dsubgridErrorU_dp = 0;
10399  PyArrayObject *__pyx_v_dsubgridErrorU_du = 0;
10400  PyArrayObject *__pyx_v_dsubgridErrorU_dv = 0;
10401  PyArrayObject *__pyx_v_subgridErrorV = 0;
10402  PyArrayObject *__pyx_v_dsubgridErrorV_dp = 0;
10403  PyArrayObject *__pyx_v_dsubgridErrorV_du = 0;
10404  PyArrayObject *__pyx_v_dsubgridErrorV_dv = 0;
10405  int __pyx_lineno = 0;
10406  const char *__pyx_filename = NULL;
10407  int __pyx_clineno = 0;
10408  PyObject *__pyx_r = 0;
10409  __Pyx_RefNannyDeclarations
10410  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_1_sd (wrapper)", 0);
10411  {
10412  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDiameter,&__pyx_n_s_u,&__pyx_n_s_v,&__pyx_n_s_a,&__pyx_n_s_pdeResidualP,&__pyx_n_s_dpdeResidualP_du,&__pyx_n_s_dpdeResidualP_dv,&__pyx_n_s_pdeResidualU,&__pyx_n_s_dpdeResidualU_dp,&__pyx_n_s_dpdeResidualU_du,&__pyx_n_s_pdeResidualV,&__pyx_n_s_dpdeResidualV_dp,&__pyx_n_s_dpdeResidualV_dv,&__pyx_n_s_subgridErrorP,&__pyx_n_s_dsubgridErrorP_dp,&__pyx_n_s_dsubgridErrorP_du,&__pyx_n_s_dsubgridErrorP_dv,&__pyx_n_s_subgridErrorU,&__pyx_n_s_dsubgridErrorU_dp,&__pyx_n_s_dsubgridErrorU_du,&__pyx_n_s_dsubgridErrorU_dv,&__pyx_n_s_subgridErrorV,&__pyx_n_s_dsubgridErrorV_dp,&__pyx_n_s_dsubgridErrorV_du,&__pyx_n_s_dsubgridErrorV_dv,0};
10413  PyObject* values[25] = {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};
10414  if (unlikely(__pyx_kwds)) {
10415  Py_ssize_t kw_args;
10416  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10417  switch (pos_args) {
10418  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
10419  CYTHON_FALLTHROUGH;
10420  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10421  CYTHON_FALLTHROUGH;
10422  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10423  CYTHON_FALLTHROUGH;
10424  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10425  CYTHON_FALLTHROUGH;
10426  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10427  CYTHON_FALLTHROUGH;
10428  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10429  CYTHON_FALLTHROUGH;
10430  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10431  CYTHON_FALLTHROUGH;
10432  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10433  CYTHON_FALLTHROUGH;
10434  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10435  CYTHON_FALLTHROUGH;
10436  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10437  CYTHON_FALLTHROUGH;
10438  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10439  CYTHON_FALLTHROUGH;
10440  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10441  CYTHON_FALLTHROUGH;
10442  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10443  CYTHON_FALLTHROUGH;
10444  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10445  CYTHON_FALLTHROUGH;
10446  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10447  CYTHON_FALLTHROUGH;
10448  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10449  CYTHON_FALLTHROUGH;
10450  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10451  CYTHON_FALLTHROUGH;
10452  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10453  CYTHON_FALLTHROUGH;
10454  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10455  CYTHON_FALLTHROUGH;
10456  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10457  CYTHON_FALLTHROUGH;
10458  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10459  CYTHON_FALLTHROUGH;
10460  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10461  CYTHON_FALLTHROUGH;
10462  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10463  CYTHON_FALLTHROUGH;
10464  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10465  CYTHON_FALLTHROUGH;
10466  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10467  CYTHON_FALLTHROUGH;
10468  case 0: break;
10469  default: goto __pyx_L5_argtuple_error;
10470  }
10471  kw_args = PyDict_Size(__pyx_kwds);
10472  switch (pos_args) {
10473  case 0:
10474  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
10475  else goto __pyx_L5_argtuple_error;
10476  CYTHON_FALLTHROUGH;
10477  case 1:
10478  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--;
10479  else {
10480  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 1); __PYX_ERR(0, 1756, __pyx_L3_error)
10481  }
10482  CYTHON_FALLTHROUGH;
10483  case 2:
10484  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
10485  else {
10486  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 2); __PYX_ERR(0, 1756, __pyx_L3_error)
10487  }
10488  CYTHON_FALLTHROUGH;
10489  case 3:
10490  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
10491  else {
10492  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 3); __PYX_ERR(0, 1756, __pyx_L3_error)
10493  }
10494  CYTHON_FALLTHROUGH;
10495  case 4:
10496  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualP)) != 0)) kw_args--;
10497  else {
10498  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 4); __PYX_ERR(0, 1756, __pyx_L3_error)
10499  }
10500  CYTHON_FALLTHROUGH;
10501  case 5:
10502  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_du)) != 0)) kw_args--;
10503  else {
10504  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 5); __PYX_ERR(0, 1756, __pyx_L3_error)
10505  }
10506  CYTHON_FALLTHROUGH;
10507  case 6:
10508  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualP_dv)) != 0)) kw_args--;
10509  else {
10510  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 6); __PYX_ERR(0, 1756, __pyx_L3_error)
10511  }
10512  CYTHON_FALLTHROUGH;
10513  case 7:
10514  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualU)) != 0)) kw_args--;
10515  else {
10516  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 7); __PYX_ERR(0, 1756, __pyx_L3_error)
10517  }
10518  CYTHON_FALLTHROUGH;
10519  case 8:
10520  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_dp)) != 0)) kw_args--;
10521  else {
10522  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 8); __PYX_ERR(0, 1756, __pyx_L3_error)
10523  }
10524  CYTHON_FALLTHROUGH;
10525  case 9:
10526  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualU_du)) != 0)) kw_args--;
10527  else {
10528  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 9); __PYX_ERR(0, 1756, __pyx_L3_error)
10529  }
10530  CYTHON_FALLTHROUGH;
10531  case 10:
10532  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pdeResidualV)) != 0)) kw_args--;
10533  else {
10534  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 10); __PYX_ERR(0, 1756, __pyx_L3_error)
10535  }
10536  CYTHON_FALLTHROUGH;
10537  case 11:
10538  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dp)) != 0)) kw_args--;
10539  else {
10540  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 11); __PYX_ERR(0, 1756, __pyx_L3_error)
10541  }
10542  CYTHON_FALLTHROUGH;
10543  case 12:
10544  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dpdeResidualV_dv)) != 0)) kw_args--;
10545  else {
10546  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 12); __PYX_ERR(0, 1756, __pyx_L3_error)
10547  }
10548  CYTHON_FALLTHROUGH;
10549  case 13:
10550  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorP)) != 0)) kw_args--;
10551  else {
10552  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 13); __PYX_ERR(0, 1756, __pyx_L3_error)
10553  }
10554  CYTHON_FALLTHROUGH;
10555  case 14:
10556  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dp)) != 0)) kw_args--;
10557  else {
10558  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 14); __PYX_ERR(0, 1756, __pyx_L3_error)
10559  }
10560  CYTHON_FALLTHROUGH;
10561  case 15:
10562  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_du)) != 0)) kw_args--;
10563  else {
10564  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 15); __PYX_ERR(0, 1756, __pyx_L3_error)
10565  }
10566  CYTHON_FALLTHROUGH;
10567  case 16:
10568  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorP_dv)) != 0)) kw_args--;
10569  else {
10570  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 16); __PYX_ERR(0, 1756, __pyx_L3_error)
10571  }
10572  CYTHON_FALLTHROUGH;
10573  case 17:
10574  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorU)) != 0)) kw_args--;
10575  else {
10576  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 17); __PYX_ERR(0, 1756, __pyx_L3_error)
10577  }
10578  CYTHON_FALLTHROUGH;
10579  case 18:
10580  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dp)) != 0)) kw_args--;
10581  else {
10582  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 18); __PYX_ERR(0, 1756, __pyx_L3_error)
10583  }
10584  CYTHON_FALLTHROUGH;
10585  case 19:
10586  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_du)) != 0)) kw_args--;
10587  else {
10588  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 19); __PYX_ERR(0, 1756, __pyx_L3_error)
10589  }
10590  CYTHON_FALLTHROUGH;
10591  case 20:
10592  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorU_dv)) != 0)) kw_args--;
10593  else {
10594  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 20); __PYX_ERR(0, 1756, __pyx_L3_error)
10595  }
10596  CYTHON_FALLTHROUGH;
10597  case 21:
10598  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subgridErrorV)) != 0)) kw_args--;
10599  else {
10600  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 21); __PYX_ERR(0, 1756, __pyx_L3_error)
10601  }
10602  CYTHON_FALLTHROUGH;
10603  case 22:
10604  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dp)) != 0)) kw_args--;
10605  else {
10606  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 22); __PYX_ERR(0, 1756, __pyx_L3_error)
10607  }
10608  CYTHON_FALLTHROUGH;
10609  case 23:
10610  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_du)) != 0)) kw_args--;
10611  else {
10612  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 23); __PYX_ERR(0, 1756, __pyx_L3_error)
10613  }
10614  CYTHON_FALLTHROUGH;
10615  case 24:
10616  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dsubgridErrorV_dv)) != 0)) kw_args--;
10617  else {
10618  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, 24); __PYX_ERR(0, 1756, __pyx_L3_error)
10619  }
10620  }
10621  if (unlikely(kw_args > 0)) {
10622  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorStokes2D_1_sd") < 0)) __PYX_ERR(0, 1756, __pyx_L3_error)
10623  }
10624  } else if (PyTuple_GET_SIZE(__pyx_args) != 25) {
10625  goto __pyx_L5_argtuple_error;
10626  } else {
10627  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10628  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10629  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10630  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10631  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10632  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10633  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10634  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10635  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10636  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10637  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10638  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10639  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10640  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10641  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10642  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10643  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10644  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10645  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10646  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10647  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10648  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10649  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10650  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10651  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
10652  }
10653  __pyx_v_elementDiameter = ((PyArrayObject *)values[0]);
10654  __pyx_v_u = ((PyArrayObject *)values[1]);
10655  __pyx_v_v = ((PyArrayObject *)values[2]);
10656  __pyx_v_a = ((PyArrayObject *)values[3]);
10657  __pyx_v_pdeResidualP = ((PyArrayObject *)values[4]);
10658  __pyx_v_dpdeResidualP_du = ((PyArrayObject *)values[5]);
10659  __pyx_v_dpdeResidualP_dv = ((PyArrayObject *)values[6]);
10660  __pyx_v_pdeResidualU = ((PyArrayObject *)values[7]);
10661  __pyx_v_dpdeResidualU_dp = ((PyArrayObject *)values[8]);
10662  __pyx_v_dpdeResidualU_du = ((PyArrayObject *)values[9]);
10663  __pyx_v_pdeResidualV = ((PyArrayObject *)values[10]);
10664  __pyx_v_dpdeResidualV_dp = ((PyArrayObject *)values[11]);
10665  __pyx_v_dpdeResidualV_dv = ((PyArrayObject *)values[12]);
10666  __pyx_v_subgridErrorP = ((PyArrayObject *)values[13]);
10667  __pyx_v_dsubgridErrorP_dp = ((PyArrayObject *)values[14]);
10668  __pyx_v_dsubgridErrorP_du = ((PyArrayObject *)values[15]);
10669  __pyx_v_dsubgridErrorP_dv = ((PyArrayObject *)values[16]);
10670  __pyx_v_subgridErrorU = ((PyArrayObject *)values[17]);
10671  __pyx_v_dsubgridErrorU_dp = ((PyArrayObject *)values[18]);
10672  __pyx_v_dsubgridErrorU_du = ((PyArrayObject *)values[19]);
10673  __pyx_v_dsubgridErrorU_dv = ((PyArrayObject *)values[20]);
10674  __pyx_v_subgridErrorV = ((PyArrayObject *)values[21]);
10675  __pyx_v_dsubgridErrorV_dp = ((PyArrayObject *)values[22]);
10676  __pyx_v_dsubgridErrorV_du = ((PyArrayObject *)values[23]);
10677  __pyx_v_dsubgridErrorV_dv = ((PyArrayObject *)values[24]);
10678  }
10679  goto __pyx_L4_argument_unpacking_done;
10680  __pyx_L5_argtuple_error:;
10681  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorStokes2D_1_sd", 1, 25, 25, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1756, __pyx_L3_error)
10682  __pyx_L3_error:;
10683  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorStokes2D_1_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
10684  __Pyx_RefNannyFinishContext();
10685  return NULL;
10686  __pyx_L4_argument_unpacking_done:;
10687  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1756, __pyx_L1_error)
10688  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_5numpy_ndarray, 1, "u", 0))) __PYX_ERR(0, 1757, __pyx_L1_error)
10689  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1, "v", 0))) __PYX_ERR(0, 1758, __pyx_L1_error)
10690  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1759, __pyx_L1_error)
10691  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualP), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualP", 0))) __PYX_ERR(0, 1760, __pyx_L1_error)
10692  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_du", 0))) __PYX_ERR(0, 1761, __pyx_L1_error)
10693  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualP_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualP_dv", 0))) __PYX_ERR(0, 1762, __pyx_L1_error)
10694  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualU), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualU", 0))) __PYX_ERR(0, 1763, __pyx_L1_error)
10695  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_dp", 0))) __PYX_ERR(0, 1764, __pyx_L1_error)
10696  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualU_du), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualU_du", 0))) __PYX_ERR(0, 1765, __pyx_L1_error)
10697  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pdeResidualV), __pyx_ptype_5numpy_ndarray, 1, "pdeResidualV", 0))) __PYX_ERR(0, 1766, __pyx_L1_error)
10698  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dp), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dp", 0))) __PYX_ERR(0, 1767, __pyx_L1_error)
10699  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dpdeResidualV_dv), __pyx_ptype_5numpy_ndarray, 1, "dpdeResidualV_dv", 0))) __PYX_ERR(0, 1768, __pyx_L1_error)
10700  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorP), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorP", 0))) __PYX_ERR(0, 1769, __pyx_L1_error)
10701  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dp", 0))) __PYX_ERR(0, 1770, __pyx_L1_error)
10702  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_du", 0))) __PYX_ERR(0, 1771, __pyx_L1_error)
10703  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorP_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorP_dv", 0))) __PYX_ERR(0, 1772, __pyx_L1_error)
10704  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorU), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorU", 0))) __PYX_ERR(0, 1773, __pyx_L1_error)
10705  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dp", 0))) __PYX_ERR(0, 1774, __pyx_L1_error)
10706  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_du", 0))) __PYX_ERR(0, 1775, __pyx_L1_error)
10707  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorU_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorU_dv", 0))) __PYX_ERR(0, 1776, __pyx_L1_error)
10708  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subgridErrorV), __pyx_ptype_5numpy_ndarray, 1, "subgridErrorV", 0))) __PYX_ERR(0, 1777, __pyx_L1_error)
10709  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dp), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dp", 0))) __PYX_ERR(0, 1778, __pyx_L1_error)
10710  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_du), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_du", 0))) __PYX_ERR(0, 1779, __pyx_L1_error)
10711  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dsubgridErrorV_dv), __pyx_ptype_5numpy_ndarray, 1, "dsubgridErrorV_dv", 0))) __PYX_ERR(0, 1780, __pyx_L1_error)
10712  __pyx_r = __pyx_pf_13csubgridError_60calculateSubgridErrorStokes2D_1_sd(__pyx_self, __pyx_v_elementDiameter, __pyx_v_u, __pyx_v_v, __pyx_v_a, __pyx_v_pdeResidualP, __pyx_v_dpdeResidualP_du, __pyx_v_dpdeResidualP_dv, __pyx_v_pdeResidualU, __pyx_v_dpdeResidualU_dp, __pyx_v_dpdeResidualU_du, __pyx_v_pdeResidualV, __pyx_v_dpdeResidualV_dp, __pyx_v_dpdeResidualV_dv, __pyx_v_subgridErrorP, __pyx_v_dsubgridErrorP_dp, __pyx_v_dsubgridErrorP_du, __pyx_v_dsubgridErrorP_dv, __pyx_v_subgridErrorU, __pyx_v_dsubgridErrorU_dp, __pyx_v_dsubgridErrorU_du, __pyx_v_dsubgridErrorU_dv, __pyx_v_subgridErrorV, __pyx_v_dsubgridErrorV_dp, __pyx_v_dsubgridErrorV_du, __pyx_v_dsubgridErrorV_dv);
10713 
10714  /* function exit code */
10715  goto __pyx_L0;
10716  __pyx_L1_error:;
10717  __pyx_r = NULL;
10718  __pyx_L0:;
10719  __Pyx_RefNannyFinishContext();
10720  return __pyx_r;
10721 }
10722 
10723 static PyObject *__pyx_pf_13csubgridError_60calculateSubgridErrorStokes2D_1_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_u, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_pdeResidualP, PyArrayObject *__pyx_v_dpdeResidualP_du, PyArrayObject *__pyx_v_dpdeResidualP_dv, PyArrayObject *__pyx_v_pdeResidualU, PyArrayObject *__pyx_v_dpdeResidualU_dp, PyArrayObject *__pyx_v_dpdeResidualU_du, PyArrayObject *__pyx_v_pdeResidualV, PyArrayObject *__pyx_v_dpdeResidualV_dp, PyArrayObject *__pyx_v_dpdeResidualV_dv, PyArrayObject *__pyx_v_subgridErrorP, PyArrayObject *__pyx_v_dsubgridErrorP_dp, PyArrayObject *__pyx_v_dsubgridErrorP_du, PyArrayObject *__pyx_v_dsubgridErrorP_dv, PyArrayObject *__pyx_v_subgridErrorU, PyArrayObject *__pyx_v_dsubgridErrorU_dp, PyArrayObject *__pyx_v_dsubgridErrorU_du, PyArrayObject *__pyx_v_dsubgridErrorU_dv, PyArrayObject *__pyx_v_subgridErrorV, PyArrayObject *__pyx_v_dsubgridErrorV_dp, PyArrayObject *__pyx_v_dsubgridErrorV_du, PyArrayObject *__pyx_v_dsubgridErrorV_dv) {
10724  PyObject *__pyx_r = NULL;
10725  __Pyx_RefNannyDeclarations
10726  __Pyx_RefNannySetupContext("calculateSubgridErrorStokes2D_1_sd", 0);
10727 
10728  /* "csubgridError.pyx":1781
10729  * np.ndarray dsubgridErrorV_du,
10730  * np.ndarray dsubgridErrorV_dv):
10731  * ccalculateSubgridErrorStokes2D_1_sd(dsubgridErrorP_du.shape[0], # <<<<<<<<<<<<<<
10732  * dsubgridErrorP_du.shape[1],
10733  * dsubgridErrorP_du.shape[2],
10734  */
10735  calculateSubgridErrorStokes2D_1_sd((__pyx_v_dsubgridErrorP_du->dimensions[0]), (__pyx_v_dsubgridErrorP_du->dimensions[1]), (__pyx_v_dsubgridErrorP_du->dimensions[2]), 2, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_u->data), ((double *)__pyx_v_v->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_pdeResidualP->data), ((double *)__pyx_v_dpdeResidualP_du->data), ((double *)__pyx_v_dpdeResidualP_dv->data), ((double *)__pyx_v_pdeResidualU->data), ((double *)__pyx_v_dpdeResidualU_dp->data), ((double *)__pyx_v_dpdeResidualU_du->data), ((double *)__pyx_v_pdeResidualV->data), ((double *)__pyx_v_dpdeResidualV_dp->data), ((double *)__pyx_v_dpdeResidualV_dv->data), ((double *)__pyx_v_subgridErrorP->data), ((double *)__pyx_v_dsubgridErrorP_dp->data), ((double *)__pyx_v_dsubgridErrorP_du->data), ((double *)__pyx_v_dsubgridErrorP_dv->data), ((double *)__pyx_v_subgridErrorU->data), ((double *)__pyx_v_dsubgridErrorU_dp->data), ((double *)__pyx_v_dsubgridErrorU_du->data), ((double *)__pyx_v_dsubgridErrorU_dv->data), ((double *)__pyx_v_subgridErrorV->data), ((double *)__pyx_v_dsubgridErrorV_dp->data), ((double *)__pyx_v_dsubgridErrorV_du->data), ((double *)__pyx_v_dsubgridErrorV_dv->data));
10736 
10737  /* "csubgridError.pyx":1756
10738  * <double*> dsubgridErrorV_du.data,
10739  * <double*> dsubgridErrorV_dv.data)
10740  * def calculateSubgridErrorStokes2D_1_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
10741  * np.ndarray u,
10742  * np.ndarray v,
10743  */
10744 
10745  /* function exit code */
10746  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10747  __Pyx_XGIVEREF(__pyx_r);
10748  __Pyx_RefNannyFinishContext();
10749  return __pyx_r;
10750 }
10751 
10752 /* "csubgridError.pyx":1810
10753  * <double*> dsubgridErrorV_du.data,
10754  * <double*> dsubgridErrorV_dv.data)
10755  * def calculateSubgridErrorShallowWater1D(double g, # <<<<<<<<<<<<<<
10756  * np.ndarray elementDiameter,
10757  * np.ndarray h,
10758  */
10759 
10760 /* Python wrapper */
10761 static PyObject *__pyx_pw_13csubgridError_63calculateSubgridErrorShallowWater1D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10762 static PyMethodDef __pyx_mdef_13csubgridError_63calculateSubgridErrorShallowWater1D = {"calculateSubgridErrorShallowWater1D", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_63calculateSubgridErrorShallowWater1D, METH_VARARGS|METH_KEYWORDS, 0};
10763 static PyObject *__pyx_pw_13csubgridError_63calculateSubgridErrorShallowWater1D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10764  double __pyx_v_g;
10765  PyArrayObject *__pyx_v_elementDiameter = 0;
10766  PyArrayObject *__pyx_v_h = 0;
10767  PyArrayObject *__pyx_v_hu = 0;
10768  PyArrayObject *__pyx_v_cfl_1 = 0;
10769  PyArrayObject *__pyx_v_cfl_2 = 0;
10770  int __pyx_lineno = 0;
10771  const char *__pyx_filename = NULL;
10772  int __pyx_clineno = 0;
10773  PyObject *__pyx_r = 0;
10774  __Pyx_RefNannyDeclarations
10775  __Pyx_RefNannySetupContext("calculateSubgridErrorShallowWater1D (wrapper)", 0);
10776  {
10777  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_elementDiameter,&__pyx_n_s_h,&__pyx_n_s_hu,&__pyx_n_s_cfl_1,&__pyx_n_s_cfl_2,0};
10778  PyObject* values[6] = {0,0,0,0,0,0};
10779  if (unlikely(__pyx_kwds)) {
10780  Py_ssize_t kw_args;
10781  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10782  switch (pos_args) {
10783  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10784  CYTHON_FALLTHROUGH;
10785  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10786  CYTHON_FALLTHROUGH;
10787  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10788  CYTHON_FALLTHROUGH;
10789  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10790  CYTHON_FALLTHROUGH;
10791  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10792  CYTHON_FALLTHROUGH;
10793  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10794  CYTHON_FALLTHROUGH;
10795  case 0: break;
10796  default: goto __pyx_L5_argtuple_error;
10797  }
10798  kw_args = PyDict_Size(__pyx_kwds);
10799  switch (pos_args) {
10800  case 0:
10801  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
10802  else goto __pyx_L5_argtuple_error;
10803  CYTHON_FALLTHROUGH;
10804  case 1:
10805  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
10806  else {
10807  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater1D", 1, 6, 6, 1); __PYX_ERR(0, 1810, __pyx_L3_error)
10808  }
10809  CYTHON_FALLTHROUGH;
10810  case 2:
10811  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
10812  else {
10813  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater1D", 1, 6, 6, 2); __PYX_ERR(0, 1810, __pyx_L3_error)
10814  }
10815  CYTHON_FALLTHROUGH;
10816  case 3:
10817  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hu)) != 0)) kw_args--;
10818  else {
10819  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater1D", 1, 6, 6, 3); __PYX_ERR(0, 1810, __pyx_L3_error)
10820  }
10821  CYTHON_FALLTHROUGH;
10822  case 4:
10823  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl_1)) != 0)) kw_args--;
10824  else {
10825  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater1D", 1, 6, 6, 4); __PYX_ERR(0, 1810, __pyx_L3_error)
10826  }
10827  CYTHON_FALLTHROUGH;
10828  case 5:
10829  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl_2)) != 0)) kw_args--;
10830  else {
10831  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater1D", 1, 6, 6, 5); __PYX_ERR(0, 1810, __pyx_L3_error)
10832  }
10833  }
10834  if (unlikely(kw_args > 0)) {
10835  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorShallowWater1D") < 0)) __PYX_ERR(0, 1810, __pyx_L3_error)
10836  }
10837  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
10838  goto __pyx_L5_argtuple_error;
10839  } else {
10840  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10841  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10842  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10843  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10844  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10845  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10846  }
10847  __pyx_v_g = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_g == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1810, __pyx_L3_error)
10848  __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
10849  __pyx_v_h = ((PyArrayObject *)values[2]);
10850  __pyx_v_hu = ((PyArrayObject *)values[3]);
10851  __pyx_v_cfl_1 = ((PyArrayObject *)values[4]);
10852  __pyx_v_cfl_2 = ((PyArrayObject *)values[5]);
10853  }
10854  goto __pyx_L4_argument_unpacking_done;
10855  __pyx_L5_argtuple_error:;
10856  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater1D", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1810, __pyx_L3_error)
10857  __pyx_L3_error:;
10858  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorShallowWater1D", __pyx_clineno, __pyx_lineno, __pyx_filename);
10859  __Pyx_RefNannyFinishContext();
10860  return NULL;
10861  __pyx_L4_argument_unpacking_done:;
10862  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1811, __pyx_L1_error)
10863  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_h), __pyx_ptype_5numpy_ndarray, 1, "h", 0))) __PYX_ERR(0, 1812, __pyx_L1_error)
10864  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hu), __pyx_ptype_5numpy_ndarray, 1, "hu", 0))) __PYX_ERR(0, 1813, __pyx_L1_error)
10865  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl_1), __pyx_ptype_5numpy_ndarray, 1, "cfl_1", 0))) __PYX_ERR(0, 1814, __pyx_L1_error)
10866  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl_2), __pyx_ptype_5numpy_ndarray, 1, "cfl_2", 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
10867  __pyx_r = __pyx_pf_13csubgridError_62calculateSubgridErrorShallowWater1D(__pyx_self, __pyx_v_g, __pyx_v_elementDiameter, __pyx_v_h, __pyx_v_hu, __pyx_v_cfl_1, __pyx_v_cfl_2);
10868 
10869  /* function exit code */
10870  goto __pyx_L0;
10871  __pyx_L1_error:;
10872  __pyx_r = NULL;
10873  __pyx_L0:;
10874  __Pyx_RefNannyFinishContext();
10875  return __pyx_r;
10876 }
10877 
10878 static PyObject *__pyx_pf_13csubgridError_62calculateSubgridErrorShallowWater1D(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_g, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_h, PyArrayObject *__pyx_v_hu, PyArrayObject *__pyx_v_cfl_1, PyArrayObject *__pyx_v_cfl_2) {
10879  PyObject *__pyx_r = NULL;
10880  __Pyx_RefNannyDeclarations
10881  __Pyx_RefNannySetupContext("calculateSubgridErrorShallowWater1D", 0);
10882 
10883  /* "csubgridError.pyx":1816
10884  * np.ndarray cfl_1,
10885  * np.ndarray cfl_2):
10886  * ccalculateSubgridErrorShallowWater1D(h.shape[0], # <<<<<<<<<<<<<<
10887  * h.shape[1],
10888  * g,
10889  */
10890  calculateSubgridErrorShallowWater1D((__pyx_v_h->dimensions[0]), (__pyx_v_h->dimensions[1]), __pyx_v_g, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_h->data), ((double *)__pyx_v_hu->data), ((double *)__pyx_v_cfl_1->data), ((double *)__pyx_v_cfl_2->data));
10891 
10892  /* "csubgridError.pyx":1810
10893  * <double*> dsubgridErrorV_du.data,
10894  * <double*> dsubgridErrorV_dv.data)
10895  * def calculateSubgridErrorShallowWater1D(double g, # <<<<<<<<<<<<<<
10896  * np.ndarray elementDiameter,
10897  * np.ndarray h,
10898  */
10899 
10900  /* function exit code */
10901  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10902  __Pyx_XGIVEREF(__pyx_r);
10903  __Pyx_RefNannyFinishContext();
10904  return __pyx_r;
10905 }
10906 
10907 /* "csubgridError.pyx":1824
10908  * <double*> cfl_1.data,
10909  * <double*> cfl_2.data)
10910  * def calculateSubgridErrorShallowWater2D(double g, # <<<<<<<<<<<<<<
10911  * np.ndarray elementDiameter,
10912  * np.ndarray h,
10913  */
10914 
10915 /* Python wrapper */
10916 static PyObject *__pyx_pw_13csubgridError_65calculateSubgridErrorShallowWater2D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10917 static PyMethodDef __pyx_mdef_13csubgridError_65calculateSubgridErrorShallowWater2D = {"calculateSubgridErrorShallowWater2D", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_65calculateSubgridErrorShallowWater2D, METH_VARARGS|METH_KEYWORDS, 0};
10918 static PyObject *__pyx_pw_13csubgridError_65calculateSubgridErrorShallowWater2D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10919  double __pyx_v_g;
10920  PyArrayObject *__pyx_v_elementDiameter = 0;
10921  PyArrayObject *__pyx_v_h = 0;
10922  PyArrayObject *__pyx_v_hu = 0;
10923  PyArrayObject *__pyx_v_hv = 0;
10924  PyArrayObject *__pyx_v_cfl_1 = 0;
10925  PyArrayObject *__pyx_v_cfl_2 = 0;
10926  PyArrayObject *__pyx_v_cfl_3 = 0;
10927  int __pyx_lineno = 0;
10928  const char *__pyx_filename = NULL;
10929  int __pyx_clineno = 0;
10930  PyObject *__pyx_r = 0;
10931  __Pyx_RefNannyDeclarations
10932  __Pyx_RefNannySetupContext("calculateSubgridErrorShallowWater2D (wrapper)", 0);
10933  {
10934  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_elementDiameter,&__pyx_n_s_h,&__pyx_n_s_hu,&__pyx_n_s_hv,&__pyx_n_s_cfl_1,&__pyx_n_s_cfl_2,&__pyx_n_s_cfl_3,0};
10935  PyObject* values[8] = {0,0,0,0,0,0,0,0};
10936  if (unlikely(__pyx_kwds)) {
10937  Py_ssize_t kw_args;
10938  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10939  switch (pos_args) {
10940  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10941  CYTHON_FALLTHROUGH;
10942  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10943  CYTHON_FALLTHROUGH;
10944  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10945  CYTHON_FALLTHROUGH;
10946  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10947  CYTHON_FALLTHROUGH;
10948  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10949  CYTHON_FALLTHROUGH;
10950  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10951  CYTHON_FALLTHROUGH;
10952  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10953  CYTHON_FALLTHROUGH;
10954  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10955  CYTHON_FALLTHROUGH;
10956  case 0: break;
10957  default: goto __pyx_L5_argtuple_error;
10958  }
10959  kw_args = PyDict_Size(__pyx_kwds);
10960  switch (pos_args) {
10961  case 0:
10962  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
10963  else goto __pyx_L5_argtuple_error;
10964  CYTHON_FALLTHROUGH;
10965  case 1:
10966  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
10967  else {
10968  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, 1); __PYX_ERR(0, 1824, __pyx_L3_error)
10969  }
10970  CYTHON_FALLTHROUGH;
10971  case 2:
10972  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
10973  else {
10974  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, 2); __PYX_ERR(0, 1824, __pyx_L3_error)
10975  }
10976  CYTHON_FALLTHROUGH;
10977  case 3:
10978  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hu)) != 0)) kw_args--;
10979  else {
10980  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, 3); __PYX_ERR(0, 1824, __pyx_L3_error)
10981  }
10982  CYTHON_FALLTHROUGH;
10983  case 4:
10984  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hv)) != 0)) kw_args--;
10985  else {
10986  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, 4); __PYX_ERR(0, 1824, __pyx_L3_error)
10987  }
10988  CYTHON_FALLTHROUGH;
10989  case 5:
10990  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl_1)) != 0)) kw_args--;
10991  else {
10992  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, 5); __PYX_ERR(0, 1824, __pyx_L3_error)
10993  }
10994  CYTHON_FALLTHROUGH;
10995  case 6:
10996  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl_2)) != 0)) kw_args--;
10997  else {
10998  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, 6); __PYX_ERR(0, 1824, __pyx_L3_error)
10999  }
11000  CYTHON_FALLTHROUGH;
11001  case 7:
11002  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl_3)) != 0)) kw_args--;
11003  else {
11004  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, 7); __PYX_ERR(0, 1824, __pyx_L3_error)
11005  }
11006  }
11007  if (unlikely(kw_args > 0)) {
11008  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorShallowWater2D") < 0)) __PYX_ERR(0, 1824, __pyx_L3_error)
11009  }
11010  } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
11011  goto __pyx_L5_argtuple_error;
11012  } else {
11013  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11014  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11015  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11016  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11017  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11018  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11019  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11020  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11021  }
11022  __pyx_v_g = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_g == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error)
11023  __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
11024  __pyx_v_h = ((PyArrayObject *)values[2]);
11025  __pyx_v_hu = ((PyArrayObject *)values[3]);
11026  __pyx_v_hv = ((PyArrayObject *)values[4]);
11027  __pyx_v_cfl_1 = ((PyArrayObject *)values[5]);
11028  __pyx_v_cfl_2 = ((PyArrayObject *)values[6]);
11029  __pyx_v_cfl_3 = ((PyArrayObject *)values[7]);
11030  }
11031  goto __pyx_L4_argument_unpacking_done;
11032  __pyx_L5_argtuple_error:;
11033  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorShallowWater2D", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1824, __pyx_L3_error)
11034  __pyx_L3_error:;
11035  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorShallowWater2D", __pyx_clineno, __pyx_lineno, __pyx_filename);
11036  __Pyx_RefNannyFinishContext();
11037  return NULL;
11038  __pyx_L4_argument_unpacking_done:;
11039  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1825, __pyx_L1_error)
11040  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_h), __pyx_ptype_5numpy_ndarray, 1, "h", 0))) __PYX_ERR(0, 1826, __pyx_L1_error)
11041  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hu), __pyx_ptype_5numpy_ndarray, 1, "hu", 0))) __PYX_ERR(0, 1827, __pyx_L1_error)
11042  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hv), __pyx_ptype_5numpy_ndarray, 1, "hv", 0))) __PYX_ERR(0, 1828, __pyx_L1_error)
11043  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl_1), __pyx_ptype_5numpy_ndarray, 1, "cfl_1", 0))) __PYX_ERR(0, 1829, __pyx_L1_error)
11044  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl_2), __pyx_ptype_5numpy_ndarray, 1, "cfl_2", 0))) __PYX_ERR(0, 1830, __pyx_L1_error)
11045  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl_3), __pyx_ptype_5numpy_ndarray, 1, "cfl_3", 0))) __PYX_ERR(0, 1831, __pyx_L1_error)
11046  __pyx_r = __pyx_pf_13csubgridError_64calculateSubgridErrorShallowWater2D(__pyx_self, __pyx_v_g, __pyx_v_elementDiameter, __pyx_v_h, __pyx_v_hu, __pyx_v_hv, __pyx_v_cfl_1, __pyx_v_cfl_2, __pyx_v_cfl_3);
11047 
11048  /* function exit code */
11049  goto __pyx_L0;
11050  __pyx_L1_error:;
11051  __pyx_r = NULL;
11052  __pyx_L0:;
11053  __Pyx_RefNannyFinishContext();
11054  return __pyx_r;
11055 }
11056 
11057 static PyObject *__pyx_pf_13csubgridError_64calculateSubgridErrorShallowWater2D(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_g, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_h, PyArrayObject *__pyx_v_hu, PyArrayObject *__pyx_v_hv, PyArrayObject *__pyx_v_cfl_1, PyArrayObject *__pyx_v_cfl_2, PyArrayObject *__pyx_v_cfl_3) {
11058  PyObject *__pyx_r = NULL;
11059  __Pyx_RefNannyDeclarations
11060  __Pyx_RefNannySetupContext("calculateSubgridErrorShallowWater2D", 0);
11061 
11062  /* "csubgridError.pyx":1832
11063  * np.ndarray cfl_2,
11064  * np.ndarray cfl_3):
11065  * ccalculateSubgridErrorShallowWater2D(h.shape[0], # <<<<<<<<<<<<<<
11066  * h.shape[1],
11067  * g,
11068  */
11069  calculateSubgridErrorShallowWater2D((__pyx_v_h->dimensions[0]), (__pyx_v_h->dimensions[1]), __pyx_v_g, ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_h->data), ((double *)__pyx_v_hu->data), ((double *)__pyx_v_hv->data), ((double *)__pyx_v_cfl_1->data), ((double *)__pyx_v_cfl_2->data), ((double *)__pyx_v_cfl_3->data));
11070 
11071  /* "csubgridError.pyx":1824
11072  * <double*> cfl_1.data,
11073  * <double*> cfl_2.data)
11074  * def calculateSubgridErrorShallowWater2D(double g, # <<<<<<<<<<<<<<
11075  * np.ndarray elementDiameter,
11076  * np.ndarray h,
11077  */
11078 
11079  /* function exit code */
11080  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11081  __Pyx_XGIVEREF(__pyx_r);
11082  __Pyx_RefNannyFinishContext();
11083  return __pyx_r;
11084 }
11085 
11086 /* "csubgridError.pyx":1842
11087  * <double*> cfl_2.data,
11088  * <double*> cfl_3.data)
11089  * def calculateSubgridError_Harari_tau_sd(int nSpace, # <<<<<<<<<<<<<<
11090  * double dt,
11091  * np.ndarray rowptr,
11092  */
11093 
11094 /* Python wrapper */
11095 static PyObject *__pyx_pw_13csubgridError_67calculateSubgridError_Harari_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11096 static PyMethodDef __pyx_mdef_13csubgridError_67calculateSubgridError_Harari_tau_sd = {"calculateSubgridError_Harari_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_67calculateSubgridError_Harari_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
11097 static PyObject *__pyx_pw_13csubgridError_67calculateSubgridError_Harari_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11098  int __pyx_v_nSpace;
11099  double __pyx_v_dt;
11100  PyArrayObject *__pyx_v_rowptr = 0;
11101  PyArrayObject *__pyx_v_colind = 0;
11102  PyArrayObject *__pyx_v_elementDiameter = 0;
11103  PyArrayObject *__pyx_v_a = 0;
11104  PyArrayObject *__pyx_v_tau = 0;
11105  int __pyx_lineno = 0;
11106  const char *__pyx_filename = NULL;
11107  int __pyx_clineno = 0;
11108  PyObject *__pyx_r = 0;
11109  __Pyx_RefNannyDeclarations
11110  __Pyx_RefNannySetupContext("calculateSubgridError_Harari_tau_sd (wrapper)", 0);
11111  {
11112  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nSpace,&__pyx_n_s_dt,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_elementDiameter,&__pyx_n_s_a,&__pyx_n_s_tau,0};
11113  PyObject* values[7] = {0,0,0,0,0,0,0};
11114  if (unlikely(__pyx_kwds)) {
11115  Py_ssize_t kw_args;
11116  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11117  switch (pos_args) {
11118  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11119  CYTHON_FALLTHROUGH;
11120  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11121  CYTHON_FALLTHROUGH;
11122  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11123  CYTHON_FALLTHROUGH;
11124  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11125  CYTHON_FALLTHROUGH;
11126  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11127  CYTHON_FALLTHROUGH;
11128  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11129  CYTHON_FALLTHROUGH;
11130  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11131  CYTHON_FALLTHROUGH;
11132  case 0: break;
11133  default: goto __pyx_L5_argtuple_error;
11134  }
11135  kw_args = PyDict_Size(__pyx_kwds);
11136  switch (pos_args) {
11137  case 0:
11138  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
11139  else goto __pyx_L5_argtuple_error;
11140  CYTHON_FALLTHROUGH;
11141  case 1:
11142  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
11143  else {
11144  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_Harari_tau_sd", 1, 7, 7, 1); __PYX_ERR(0, 1842, __pyx_L3_error)
11145  }
11146  CYTHON_FALLTHROUGH;
11147  case 2:
11148  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11149  else {
11150  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_Harari_tau_sd", 1, 7, 7, 2); __PYX_ERR(0, 1842, __pyx_L3_error)
11151  }
11152  CYTHON_FALLTHROUGH;
11153  case 3:
11154  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11155  else {
11156  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_Harari_tau_sd", 1, 7, 7, 3); __PYX_ERR(0, 1842, __pyx_L3_error)
11157  }
11158  CYTHON_FALLTHROUGH;
11159  case 4:
11160  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDiameter)) != 0)) kw_args--;
11161  else {
11162  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_Harari_tau_sd", 1, 7, 7, 4); __PYX_ERR(0, 1842, __pyx_L3_error)
11163  }
11164  CYTHON_FALLTHROUGH;
11165  case 5:
11166  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
11167  else {
11168  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_Harari_tau_sd", 1, 7, 7, 5); __PYX_ERR(0, 1842, __pyx_L3_error)
11169  }
11170  CYTHON_FALLTHROUGH;
11171  case 6:
11172  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
11173  else {
11174  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_Harari_tau_sd", 1, 7, 7, 6); __PYX_ERR(0, 1842, __pyx_L3_error)
11175  }
11176  }
11177  if (unlikely(kw_args > 0)) {
11178  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_Harari_tau_sd") < 0)) __PYX_ERR(0, 1842, __pyx_L3_error)
11179  }
11180  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
11181  goto __pyx_L5_argtuple_error;
11182  } else {
11183  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11184  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11185  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11186  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11187  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11188  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11189  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11190  }
11191  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1842, __pyx_L3_error)
11192  __pyx_v_dt = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1843, __pyx_L3_error)
11193  __pyx_v_rowptr = ((PyArrayObject *)values[2]);
11194  __pyx_v_colind = ((PyArrayObject *)values[3]);
11195  __pyx_v_elementDiameter = ((PyArrayObject *)values[4]);
11196  __pyx_v_a = ((PyArrayObject *)values[5]);
11197  __pyx_v_tau = ((PyArrayObject *)values[6]);
11198  }
11199  goto __pyx_L4_argument_unpacking_done;
11200  __pyx_L5_argtuple_error:;
11201  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_Harari_tau_sd", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1842, __pyx_L3_error)
11202  __pyx_L3_error:;
11203  __Pyx_AddTraceback("csubgridError.calculateSubgridError_Harari_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11204  __Pyx_RefNannyFinishContext();
11205  return NULL;
11206  __pyx_L4_argument_unpacking_done:;
11207  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1844, __pyx_L1_error)
11208  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1845, __pyx_L1_error)
11209  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_ptype_5numpy_ndarray, 1, "elementDiameter", 0))) __PYX_ERR(0, 1846, __pyx_L1_error)
11210  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1847, __pyx_L1_error)
11211  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 1848, __pyx_L1_error)
11212  __pyx_r = __pyx_pf_13csubgridError_66calculateSubgridError_Harari_tau_sd(__pyx_self, __pyx_v_nSpace, __pyx_v_dt, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_elementDiameter, __pyx_v_a, __pyx_v_tau);
11213 
11214  /* function exit code */
11215  goto __pyx_L0;
11216  __pyx_L1_error:;
11217  __pyx_r = NULL;
11218  __pyx_L0:;
11219  __Pyx_RefNannyFinishContext();
11220  return __pyx_r;
11221 }
11222 
11223 static PyObject *__pyx_pf_13csubgridError_66calculateSubgridError_Harari_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_nSpace, double __pyx_v_dt, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_tau) {
11224  PyObject *__pyx_r = NULL;
11225  __Pyx_RefNannyDeclarations
11226  __Pyx_RefNannySetupContext("calculateSubgridError_Harari_tau_sd", 0);
11227 
11228  /* "csubgridError.pyx":1849
11229  * np.ndarray a,
11230  * np.ndarray tau):
11231  * ccalculateSubgridError_Harari_tau_sd(tau.shape[0], # <<<<<<<<<<<<<<
11232  * tau.shape[1],
11233  * nSpace,
11234  */
11235  calculateSubgridError_Harari_tau_sd((__pyx_v_tau->dimensions[0]), (__pyx_v_tau->dimensions[1]), __pyx_v_nSpace, __pyx_v_dt, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((double *)__pyx_v_elementDiameter->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_tau->data));
11236 
11237  /* "csubgridError.pyx":1842
11238  * <double*> cfl_2.data,
11239  * <double*> cfl_3.data)
11240  * def calculateSubgridError_Harari_tau_sd(int nSpace, # <<<<<<<<<<<<<<
11241  * double dt,
11242  * np.ndarray rowptr,
11243  */
11244 
11245  /* function exit code */
11246  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11247  __Pyx_XGIVEREF(__pyx_r);
11248  __Pyx_RefNannyFinishContext();
11249  return __pyx_r;
11250 }
11251 
11252 /* "csubgridError.pyx":1858
11253  * <double*> a.data,
11254  * <double*> tau.data)
11255  * def calculateSubgridErrorGradient_tauRes(np.ndarray tau_gradient, # <<<<<<<<<<<<<<
11256  * np.ndarray grad_pdeResidual,
11257  * np.ndarray grad_subgridError):
11258  */
11259 
11260 /* Python wrapper */
11261 static PyObject *__pyx_pw_13csubgridError_69calculateSubgridErrorGradient_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11262 static PyMethodDef __pyx_mdef_13csubgridError_69calculateSubgridErrorGradient_tauRes = {"calculateSubgridErrorGradient_tauRes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_69calculateSubgridErrorGradient_tauRes, METH_VARARGS|METH_KEYWORDS, 0};
11263 static PyObject *__pyx_pw_13csubgridError_69calculateSubgridErrorGradient_tauRes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11264  PyArrayObject *__pyx_v_tau_gradient = 0;
11265  PyArrayObject *__pyx_v_grad_pdeResidual = 0;
11266  PyArrayObject *__pyx_v_grad_subgridError = 0;
11267  int __pyx_lineno = 0;
11268  const char *__pyx_filename = NULL;
11269  int __pyx_clineno = 0;
11270  PyObject *__pyx_r = 0;
11271  __Pyx_RefNannyDeclarations
11272  __Pyx_RefNannySetupContext("calculateSubgridErrorGradient_tauRes (wrapper)", 0);
11273  {
11274  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tau_gradient,&__pyx_n_s_grad_pdeResidual,&__pyx_n_s_grad_subgridError,0};
11275  PyObject* values[3] = {0,0,0};
11276  if (unlikely(__pyx_kwds)) {
11277  Py_ssize_t kw_args;
11278  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11279  switch (pos_args) {
11280  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11281  CYTHON_FALLTHROUGH;
11282  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11283  CYTHON_FALLTHROUGH;
11284  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11285  CYTHON_FALLTHROUGH;
11286  case 0: break;
11287  default: goto __pyx_L5_argtuple_error;
11288  }
11289  kw_args = PyDict_Size(__pyx_kwds);
11290  switch (pos_args) {
11291  case 0:
11292  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau_gradient)) != 0)) kw_args--;
11293  else goto __pyx_L5_argtuple_error;
11294  CYTHON_FALLTHROUGH;
11295  case 1:
11296  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_pdeResidual)) != 0)) kw_args--;
11297  else {
11298  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorGradient_tauRes", 1, 3, 3, 1); __PYX_ERR(0, 1858, __pyx_L3_error)
11299  }
11300  CYTHON_FALLTHROUGH;
11301  case 2:
11302  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_subgridError)) != 0)) kw_args--;
11303  else {
11304  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorGradient_tauRes", 1, 3, 3, 2); __PYX_ERR(0, 1858, __pyx_L3_error)
11305  }
11306  }
11307  if (unlikely(kw_args > 0)) {
11308  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridErrorGradient_tauRes") < 0)) __PYX_ERR(0, 1858, __pyx_L3_error)
11309  }
11310  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
11311  goto __pyx_L5_argtuple_error;
11312  } else {
11313  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11314  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11315  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11316  }
11317  __pyx_v_tau_gradient = ((PyArrayObject *)values[0]);
11318  __pyx_v_grad_pdeResidual = ((PyArrayObject *)values[1]);
11319  __pyx_v_grad_subgridError = ((PyArrayObject *)values[2]);
11320  }
11321  goto __pyx_L4_argument_unpacking_done;
11322  __pyx_L5_argtuple_error:;
11323  __Pyx_RaiseArgtupleInvalid("calculateSubgridErrorGradient_tauRes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1858, __pyx_L3_error)
11324  __pyx_L3_error:;
11325  __Pyx_AddTraceback("csubgridError.calculateSubgridErrorGradient_tauRes", __pyx_clineno, __pyx_lineno, __pyx_filename);
11326  __Pyx_RefNannyFinishContext();
11327  return NULL;
11328  __pyx_L4_argument_unpacking_done:;
11329  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau_gradient), __pyx_ptype_5numpy_ndarray, 1, "tau_gradient", 0))) __PYX_ERR(0, 1858, __pyx_L1_error)
11330  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_pdeResidual), __pyx_ptype_5numpy_ndarray, 1, "grad_pdeResidual", 0))) __PYX_ERR(0, 1859, __pyx_L1_error)
11331  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_subgridError), __pyx_ptype_5numpy_ndarray, 1, "grad_subgridError", 0))) __PYX_ERR(0, 1860, __pyx_L1_error)
11332  __pyx_r = __pyx_pf_13csubgridError_68calculateSubgridErrorGradient_tauRes(__pyx_self, __pyx_v_tau_gradient, __pyx_v_grad_pdeResidual, __pyx_v_grad_subgridError);
11333 
11334  /* function exit code */
11335  goto __pyx_L0;
11336  __pyx_L1_error:;
11337  __pyx_r = NULL;
11338  __pyx_L0:;
11339  __Pyx_RefNannyFinishContext();
11340  return __pyx_r;
11341 }
11342 
11343 static PyObject *__pyx_pf_13csubgridError_68calculateSubgridErrorGradient_tauRes(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_tau_gradient, PyArrayObject *__pyx_v_grad_pdeResidual, PyArrayObject *__pyx_v_grad_subgridError) {
11344  PyObject *__pyx_r = NULL;
11345  __Pyx_RefNannyDeclarations
11346  __Pyx_RefNannySetupContext("calculateSubgridErrorGradient_tauRes", 0);
11347 
11348  /* "csubgridError.pyx":1861
11349  * np.ndarray grad_pdeResidual,
11350  * np.ndarray grad_subgridError):
11351  * ccalculateSubgridErrorGradient_tauRes(grad_subgridError.shape[0], # <<<<<<<<<<<<<<
11352  * grad_subgridError.shape[1],
11353  * grad_subgridError.shape[2],
11354  */
11355  calculateSubgridErrorGradient_tauRes((__pyx_v_grad_subgridError->dimensions[0]), (__pyx_v_grad_subgridError->dimensions[1]), (__pyx_v_grad_subgridError->dimensions[2]), ((double *)__pyx_v_tau_gradient->data), ((double *)__pyx_v_grad_pdeResidual->data), ((double *)__pyx_v_grad_subgridError->data));
11356 
11357  /* "csubgridError.pyx":1858
11358  * <double*> a.data,
11359  * <double*> tau.data)
11360  * def calculateSubgridErrorGradient_tauRes(np.ndarray tau_gradient, # <<<<<<<<<<<<<<
11361  * np.ndarray grad_pdeResidual,
11362  * np.ndarray grad_subgridError):
11363  */
11364 
11365  /* function exit code */
11366  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11367  __Pyx_XGIVEREF(__pyx_r);
11368  __Pyx_RefNannyFinishContext();
11369  return __pyx_r;
11370 }
11371 
11372 /* "csubgridError.pyx":1867
11373  * <double*> grad_pdeResidual.data,
11374  * <double*> grad_subgridError.data)
11375  * def calculateSubgridError_ADR_Sangalli_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
11376  * np.ndarray colind,
11377  * np.ndarray inverseJ,
11378  */
11379 
11380 /* Python wrapper */
11381 static PyObject *__pyx_pw_13csubgridError_71calculateSubgridError_ADR_Sangalli_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11382 static PyMethodDef __pyx_mdef_13csubgridError_71calculateSubgridError_ADR_Sangalli_tau_sd = {"calculateSubgridError_ADR_Sangalli_tau_sd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13csubgridError_71calculateSubgridError_ADR_Sangalli_tau_sd, METH_VARARGS|METH_KEYWORDS, 0};
11383 static PyObject *__pyx_pw_13csubgridError_71calculateSubgridError_ADR_Sangalli_tau_sd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11384  PyArrayObject *__pyx_v_rowptr = 0;
11385  PyArrayObject *__pyx_v_colind = 0;
11386  PyArrayObject *__pyx_v_inverseJ = 0;
11387  PyArrayObject *__pyx_v_dmt = 0;
11388  PyArrayObject *__pyx_v_df = 0;
11389  PyArrayObject *__pyx_v_a = 0;
11390  PyArrayObject *__pyx_v_da = 0;
11391  PyArrayObject *__pyx_v_grad_phi = 0;
11392  PyArrayObject *__pyx_v_dphi = 0;
11393  PyArrayObject *__pyx_v_dr = 0;
11394  PyArrayObject *__pyx_v_pe = 0;
11395  PyArrayObject *__pyx_v_cfl = 0;
11396  PyArrayObject *__pyx_v_tau = 0;
11397  PyArrayObject *__pyx_v_tau_gradient = 0;
11398  int __pyx_lineno = 0;
11399  const char *__pyx_filename = NULL;
11400  int __pyx_clineno = 0;
11401  PyObject *__pyx_r = 0;
11402  __Pyx_RefNannyDeclarations
11403  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_Sangalli_tau_sd (wrapper)", 0);
11404  {
11405  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_inverseJ,&__pyx_n_s_dmt,&__pyx_n_s_df,&__pyx_n_s_a,&__pyx_n_s_da,&__pyx_n_s_grad_phi,&__pyx_n_s_dphi,&__pyx_n_s_dr,&__pyx_n_s_pe,&__pyx_n_s_cfl,&__pyx_n_s_tau,&__pyx_n_s_tau_gradient,0};
11406  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11407  if (unlikely(__pyx_kwds)) {
11408  Py_ssize_t kw_args;
11409  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11410  switch (pos_args) {
11411  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11412  CYTHON_FALLTHROUGH;
11413  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11414  CYTHON_FALLTHROUGH;
11415  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11416  CYTHON_FALLTHROUGH;
11417  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11418  CYTHON_FALLTHROUGH;
11419  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11420  CYTHON_FALLTHROUGH;
11421  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11422  CYTHON_FALLTHROUGH;
11423  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11424  CYTHON_FALLTHROUGH;
11425  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11426  CYTHON_FALLTHROUGH;
11427  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11428  CYTHON_FALLTHROUGH;
11429  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11430  CYTHON_FALLTHROUGH;
11431  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11432  CYTHON_FALLTHROUGH;
11433  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11434  CYTHON_FALLTHROUGH;
11435  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11436  CYTHON_FALLTHROUGH;
11437  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11438  CYTHON_FALLTHROUGH;
11439  case 0: break;
11440  default: goto __pyx_L5_argtuple_error;
11441  }
11442  kw_args = PyDict_Size(__pyx_kwds);
11443  switch (pos_args) {
11444  case 0:
11445  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11446  else goto __pyx_L5_argtuple_error;
11447  CYTHON_FALLTHROUGH;
11448  case 1:
11449  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11450  else {
11451  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 1); __PYX_ERR(0, 1867, __pyx_L3_error)
11452  }
11453  CYTHON_FALLTHROUGH;
11454  case 2:
11455  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inverseJ)) != 0)) kw_args--;
11456  else {
11457  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 2); __PYX_ERR(0, 1867, __pyx_L3_error)
11458  }
11459  CYTHON_FALLTHROUGH;
11460  case 3:
11461  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
11462  else {
11463  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 3); __PYX_ERR(0, 1867, __pyx_L3_error)
11464  }
11465  CYTHON_FALLTHROUGH;
11466  case 4:
11467  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
11468  else {
11469  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 4); __PYX_ERR(0, 1867, __pyx_L3_error)
11470  }
11471  CYTHON_FALLTHROUGH;
11472  case 5:
11473  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
11474  else {
11475  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 5); __PYX_ERR(0, 1867, __pyx_L3_error)
11476  }
11477  CYTHON_FALLTHROUGH;
11478  case 6:
11479  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
11480  else {
11481  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 6); __PYX_ERR(0, 1867, __pyx_L3_error)
11482  }
11483  CYTHON_FALLTHROUGH;
11484  case 7:
11485  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_phi)) != 0)) kw_args--;
11486  else {
11487  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 7); __PYX_ERR(0, 1867, __pyx_L3_error)
11488  }
11489  CYTHON_FALLTHROUGH;
11490  case 8:
11491  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dphi)) != 0)) kw_args--;
11492  else {
11493  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 8); __PYX_ERR(0, 1867, __pyx_L3_error)
11494  }
11495  CYTHON_FALLTHROUGH;
11496  case 9:
11497  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dr)) != 0)) kw_args--;
11498  else {
11499  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 9); __PYX_ERR(0, 1867, __pyx_L3_error)
11500  }
11501  CYTHON_FALLTHROUGH;
11502  case 10:
11503  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pe)) != 0)) kw_args--;
11504  else {
11505  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 10); __PYX_ERR(0, 1867, __pyx_L3_error)
11506  }
11507  CYTHON_FALLTHROUGH;
11508  case 11:
11509  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfl)) != 0)) kw_args--;
11510  else {
11511  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 11); __PYX_ERR(0, 1867, __pyx_L3_error)
11512  }
11513  CYTHON_FALLTHROUGH;
11514  case 12:
11515  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
11516  else {
11517  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 12); __PYX_ERR(0, 1867, __pyx_L3_error)
11518  }
11519  CYTHON_FALLTHROUGH;
11520  case 13:
11521  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau_gradient)) != 0)) kw_args--;
11522  else {
11523  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, 13); __PYX_ERR(0, 1867, __pyx_L3_error)
11524  }
11525  }
11526  if (unlikely(kw_args > 0)) {
11527  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculateSubgridError_ADR_Sangalli_tau_sd") < 0)) __PYX_ERR(0, 1867, __pyx_L3_error)
11528  }
11529  } else if (PyTuple_GET_SIZE(__pyx_args) != 14) {
11530  goto __pyx_L5_argtuple_error;
11531  } else {
11532  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11533  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11534  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11535  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11536  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11537  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11538  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11539  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11540  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11541  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11542  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11543  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11544  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11545  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11546  }
11547  __pyx_v_rowptr = ((PyArrayObject *)values[0]);
11548  __pyx_v_colind = ((PyArrayObject *)values[1]);
11549  __pyx_v_inverseJ = ((PyArrayObject *)values[2]);
11550  __pyx_v_dmt = ((PyArrayObject *)values[3]);
11551  __pyx_v_df = ((PyArrayObject *)values[4]);
11552  __pyx_v_a = ((PyArrayObject *)values[5]);
11553  __pyx_v_da = ((PyArrayObject *)values[6]);
11554  __pyx_v_grad_phi = ((PyArrayObject *)values[7]);
11555  __pyx_v_dphi = ((PyArrayObject *)values[8]);
11556  __pyx_v_dr = ((PyArrayObject *)values[9]);
11557  __pyx_v_pe = ((PyArrayObject *)values[10]);
11558  __pyx_v_cfl = ((PyArrayObject *)values[11]);
11559  __pyx_v_tau = ((PyArrayObject *)values[12]);
11560  __pyx_v_tau_gradient = ((PyArrayObject *)values[13]);
11561  }
11562  goto __pyx_L4_argument_unpacking_done;
11563  __pyx_L5_argtuple_error:;
11564  __Pyx_RaiseArgtupleInvalid("calculateSubgridError_ADR_Sangalli_tau_sd", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1867, __pyx_L3_error)
11565  __pyx_L3_error:;
11566  __Pyx_AddTraceback("csubgridError.calculateSubgridError_ADR_Sangalli_tau_sd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11567  __Pyx_RefNannyFinishContext();
11568  return NULL;
11569  __pyx_L4_argument_unpacking_done:;
11570  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 1867, __pyx_L1_error)
11571  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1, "colind", 0))) __PYX_ERR(0, 1868, __pyx_L1_error)
11572  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inverseJ), __pyx_ptype_5numpy_ndarray, 1, "inverseJ", 0))) __PYX_ERR(0, 1869, __pyx_L1_error)
11573  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1, "dmt", 0))) __PYX_ERR(0, 1870, __pyx_L1_error)
11574  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1, "df", 0))) __PYX_ERR(0, 1871, __pyx_L1_error)
11575  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1872, __pyx_L1_error)
11576  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_5numpy_ndarray, 1, "da", 0))) __PYX_ERR(0, 1873, __pyx_L1_error)
11577  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_phi), __pyx_ptype_5numpy_ndarray, 1, "grad_phi", 0))) __PYX_ERR(0, 1874, __pyx_L1_error)
11578  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dphi), __pyx_ptype_5numpy_ndarray, 1, "dphi", 0))) __PYX_ERR(0, 1875, __pyx_L1_error)
11579  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dr), __pyx_ptype_5numpy_ndarray, 1, "dr", 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
11580  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pe), __pyx_ptype_5numpy_ndarray, 1, "pe", 0))) __PYX_ERR(0, 1877, __pyx_L1_error)
11581  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfl), __pyx_ptype_5numpy_ndarray, 1, "cfl", 0))) __PYX_ERR(0, 1878, __pyx_L1_error)
11582  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau), __pyx_ptype_5numpy_ndarray, 1, "tau", 0))) __PYX_ERR(0, 1879, __pyx_L1_error)
11583  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tau_gradient), __pyx_ptype_5numpy_ndarray, 1, "tau_gradient", 0))) __PYX_ERR(0, 1880, __pyx_L1_error)
11584  __pyx_r = __pyx_pf_13csubgridError_70calculateSubgridError_ADR_Sangalli_tau_sd(__pyx_self, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_inverseJ, __pyx_v_dmt, __pyx_v_df, __pyx_v_a, __pyx_v_da, __pyx_v_grad_phi, __pyx_v_dphi, __pyx_v_dr, __pyx_v_pe, __pyx_v_cfl, __pyx_v_tau, __pyx_v_tau_gradient);
11585 
11586  /* function exit code */
11587  goto __pyx_L0;
11588  __pyx_L1_error:;
11589  __pyx_r = NULL;
11590  __pyx_L0:;
11591  __Pyx_RefNannyFinishContext();
11592  return __pyx_r;
11593 }
11594 
11595 static PyObject *__pyx_pf_13csubgridError_70calculateSubgridError_ADR_Sangalli_tau_sd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_inverseJ, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_da, PyArrayObject *__pyx_v_grad_phi, PyArrayObject *__pyx_v_dphi, PyArrayObject *__pyx_v_dr, PyArrayObject *__pyx_v_pe, PyArrayObject *__pyx_v_cfl, PyArrayObject *__pyx_v_tau, PyArrayObject *__pyx_v_tau_gradient) {
11596  PyObject *__pyx_r = NULL;
11597  __Pyx_RefNannyDeclarations
11598  __Pyx_RefNannySetupContext("calculateSubgridError_ADR_Sangalli_tau_sd", 0);
11599 
11600  /* "csubgridError.pyx":1881
11601  * np.ndarray tau,
11602  * np.ndarray tau_gradient):
11603  * ccalculateSubgridError_ADR_Sangalli_tau_sd(df.shape[0], # <<<<<<<<<<<<<<
11604  * df.shape[1],
11605  * df.shape[2],
11606  */
11607  calculateSubgridError_ADR_Sangalli_tau_sd((__pyx_v_df->dimensions[0]), (__pyx_v_df->dimensions[1]), (__pyx_v_df->dimensions[2]), ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_colind->data), ((double *)__pyx_v_inverseJ->data), ((double *)__pyx_v_dmt->data), ((double *)__pyx_v_df->data), ((double *)__pyx_v_a->data), ((double *)__pyx_v_da->data), ((double *)__pyx_v_grad_phi->data), ((double *)__pyx_v_dphi->data), ((double *)__pyx_v_dr->data), ((double *)__pyx_v_pe->data), ((double *)__pyx_v_cfl->data), ((double *)__pyx_v_tau->data), ((double *)__pyx_v_tau_gradient->data));
11608 
11609  /* "csubgridError.pyx":1867
11610  * <double*> grad_pdeResidual.data,
11611  * <double*> grad_subgridError.data)
11612  * def calculateSubgridError_ADR_Sangalli_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
11613  * np.ndarray colind,
11614  * np.ndarray inverseJ,
11615  */
11616 
11617  /* function exit code */
11618  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11619  __Pyx_XGIVEREF(__pyx_r);
11620  __Pyx_RefNannyFinishContext();
11621  return __pyx_r;
11622 }
11623 
11624 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
11625  * ctypedef npy_cdouble complex_t
11626  *
11627  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
11628  * return PyArray_MultiIterNew(1, <void*>a)
11629  *
11630  */
11631 
11632 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
11633  PyObject *__pyx_r = NULL;
11634  __Pyx_RefNannyDeclarations
11635  PyObject *__pyx_t_1 = NULL;
11636  int __pyx_lineno = 0;
11637  const char *__pyx_filename = NULL;
11638  int __pyx_clineno = 0;
11639  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
11640 
11641  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
11642  *
11643  * cdef inline object PyArray_MultiIterNew1(a):
11644  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
11645  *
11646  * cdef inline object PyArray_MultiIterNew2(a, b):
11647  */
11648  __Pyx_XDECREF(__pyx_r);
11649  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
11650  __Pyx_GOTREF(__pyx_t_1);
11651  __pyx_r = __pyx_t_1;
11652  __pyx_t_1 = 0;
11653  goto __pyx_L0;
11654 
11655  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
11656  * ctypedef npy_cdouble complex_t
11657  *
11658  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
11659  * return PyArray_MultiIterNew(1, <void*>a)
11660  *
11661  */
11662 
11663  /* function exit code */
11664  __pyx_L1_error:;
11665  __Pyx_XDECREF(__pyx_t_1);
11666  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
11667  __pyx_r = 0;
11668  __pyx_L0:;
11669  __Pyx_XGIVEREF(__pyx_r);
11670  __Pyx_RefNannyFinishContext();
11671  return __pyx_r;
11672 }
11673 
11674 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
11675  * return PyArray_MultiIterNew(1, <void*>a)
11676  *
11677  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
11678  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
11679  *
11680  */
11681 
11682 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
11683  PyObject *__pyx_r = NULL;
11684  __Pyx_RefNannyDeclarations
11685  PyObject *__pyx_t_1 = NULL;
11686  int __pyx_lineno = 0;
11687  const char *__pyx_filename = NULL;
11688  int __pyx_clineno = 0;
11689  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
11690 
11691  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
11692  *
11693  * cdef inline object PyArray_MultiIterNew2(a, b):
11694  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
11695  *
11696  * cdef inline object PyArray_MultiIterNew3(a, b, c):
11697  */
11698  __Pyx_XDECREF(__pyx_r);
11699  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
11700  __Pyx_GOTREF(__pyx_t_1);
11701  __pyx_r = __pyx_t_1;
11702  __pyx_t_1 = 0;
11703  goto __pyx_L0;
11704 
11705  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
11706  * return PyArray_MultiIterNew(1, <void*>a)
11707  *
11708  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
11709  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
11710  *
11711  */
11712 
11713  /* function exit code */
11714  __pyx_L1_error:;
11715  __Pyx_XDECREF(__pyx_t_1);
11716  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
11717  __pyx_r = 0;
11718  __pyx_L0:;
11719  __Pyx_XGIVEREF(__pyx_r);
11720  __Pyx_RefNannyFinishContext();
11721  return __pyx_r;
11722 }
11723 
11724 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
11725  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
11726  *
11727  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
11728  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
11729  *
11730  */
11731 
11732 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
11733  PyObject *__pyx_r = NULL;
11734  __Pyx_RefNannyDeclarations
11735  PyObject *__pyx_t_1 = NULL;
11736  int __pyx_lineno = 0;
11737  const char *__pyx_filename = NULL;
11738  int __pyx_clineno = 0;
11739  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
11740 
11741  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
11742  *
11743  * cdef inline object PyArray_MultiIterNew3(a, b, c):
11744  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
11745  *
11746  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
11747  */
11748  __Pyx_XDECREF(__pyx_r);
11749  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
11750  __Pyx_GOTREF(__pyx_t_1);
11751  __pyx_r = __pyx_t_1;
11752  __pyx_t_1 = 0;
11753  goto __pyx_L0;
11754 
11755  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
11756  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
11757  *
11758  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
11759  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
11760  *
11761  */
11762 
11763  /* function exit code */
11764  __pyx_L1_error:;
11765  __Pyx_XDECREF(__pyx_t_1);
11766  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
11767  __pyx_r = 0;
11768  __pyx_L0:;
11769  __Pyx_XGIVEREF(__pyx_r);
11770  __Pyx_RefNannyFinishContext();
11771  return __pyx_r;
11772 }
11773 
11774 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
11775  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
11776  *
11777  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
11778  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
11779  *
11780  */
11781 
11782 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
11783  PyObject *__pyx_r = NULL;
11784  __Pyx_RefNannyDeclarations
11785  PyObject *__pyx_t_1 = NULL;
11786  int __pyx_lineno = 0;
11787  const char *__pyx_filename = NULL;
11788  int __pyx_clineno = 0;
11789  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
11790 
11791  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
11792  *
11793  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
11794  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
11795  *
11796  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
11797  */
11798  __Pyx_XDECREF(__pyx_r);
11799  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
11800  __Pyx_GOTREF(__pyx_t_1);
11801  __pyx_r = __pyx_t_1;
11802  __pyx_t_1 = 0;
11803  goto __pyx_L0;
11804 
11805  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
11806  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
11807  *
11808  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
11809  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
11810  *
11811  */
11812 
11813  /* function exit code */
11814  __pyx_L1_error:;
11815  __Pyx_XDECREF(__pyx_t_1);
11816  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
11817  __pyx_r = 0;
11818  __pyx_L0:;
11819  __Pyx_XGIVEREF(__pyx_r);
11820  __Pyx_RefNannyFinishContext();
11821  return __pyx_r;
11822 }
11823 
11824 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
11825  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
11826  *
11827  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
11828  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
11829  *
11830  */
11831 
11832 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
11833  PyObject *__pyx_r = NULL;
11834  __Pyx_RefNannyDeclarations
11835  PyObject *__pyx_t_1 = NULL;
11836  int __pyx_lineno = 0;
11837  const char *__pyx_filename = NULL;
11838  int __pyx_clineno = 0;
11839  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
11840 
11841  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
11842  *
11843  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
11844  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
11845  *
11846  * cdef inline tuple PyDataType_SHAPE(dtype d):
11847  */
11848  __Pyx_XDECREF(__pyx_r);
11849  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
11850  __Pyx_GOTREF(__pyx_t_1);
11851  __pyx_r = __pyx_t_1;
11852  __pyx_t_1 = 0;
11853  goto __pyx_L0;
11854 
11855  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
11856  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
11857  *
11858  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
11859  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
11860  *
11861  */
11862 
11863  /* function exit code */
11864  __pyx_L1_error:;
11865  __Pyx_XDECREF(__pyx_t_1);
11866  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
11867  __pyx_r = 0;
11868  __pyx_L0:;
11869  __Pyx_XGIVEREF(__pyx_r);
11870  __Pyx_RefNannyFinishContext();
11871  return __pyx_r;
11872 }
11873 
11874 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
11875  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
11876  *
11877  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
11878  * if PyDataType_HASSUBARRAY(d):
11879  * return <tuple>d.subarray.shape
11880  */
11881 
11882 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
11883  PyObject *__pyx_r = NULL;
11884  __Pyx_RefNannyDeclarations
11885  int __pyx_t_1;
11886  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
11887 
11888  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
11889  *
11890  * cdef inline tuple PyDataType_SHAPE(dtype d):
11891  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
11892  * return <tuple>d.subarray.shape
11893  * else:
11894  */
11895  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
11896  if (__pyx_t_1) {
11897 
11898  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
11899  * cdef inline tuple PyDataType_SHAPE(dtype d):
11900  * if PyDataType_HASSUBARRAY(d):
11901  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
11902  * else:
11903  * return ()
11904  */
11905  __Pyx_XDECREF(__pyx_r);
11906  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
11907  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
11908  goto __pyx_L0;
11909 
11910  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
11911  *
11912  * cdef inline tuple PyDataType_SHAPE(dtype d):
11913  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
11914  * return <tuple>d.subarray.shape
11915  * else:
11916  */
11917  }
11918 
11919  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
11920  * return <tuple>d.subarray.shape
11921  * else:
11922  * return () # <<<<<<<<<<<<<<
11923  *
11924  *
11925  */
11926  /*else*/ {
11927  __Pyx_XDECREF(__pyx_r);
11928  __Pyx_INCREF(__pyx_empty_tuple);
11929  __pyx_r = __pyx_empty_tuple;
11930  goto __pyx_L0;
11931  }
11932 
11933  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
11934  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
11935  *
11936  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
11937  * if PyDataType_HASSUBARRAY(d):
11938  * return <tuple>d.subarray.shape
11939  */
11940 
11941  /* function exit code */
11942  __pyx_L0:;
11943  __Pyx_XGIVEREF(__pyx_r);
11944  __Pyx_RefNannyFinishContext();
11945  return __pyx_r;
11946 }
11947 
11948 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
11949  * int _import_umath() except -1
11950  *
11951  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
11952  * Py_INCREF(base) # important to do this before stealing the reference below!
11953  * PyArray_SetBaseObject(arr, base)
11954  */
11955 
11956 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
11957  __Pyx_RefNannyDeclarations
11958  __Pyx_RefNannySetupContext("set_array_base", 0);
11959 
11960  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
11961  *
11962  * cdef inline void set_array_base(ndarray arr, object base):
11963  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
11964  * PyArray_SetBaseObject(arr, base)
11965  *
11966  */
11967  Py_INCREF(__pyx_v_base);
11968 
11969  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
11970  * cdef inline void set_array_base(ndarray arr, object base):
11971  * Py_INCREF(base) # important to do this before stealing the reference below!
11972  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
11973  *
11974  * cdef inline object get_array_base(ndarray arr):
11975  */
11976  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
11977 
11978  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
11979  * int _import_umath() except -1
11980  *
11981  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
11982  * Py_INCREF(base) # important to do this before stealing the reference below!
11983  * PyArray_SetBaseObject(arr, base)
11984  */
11985 
11986  /* function exit code */
11987  __Pyx_RefNannyFinishContext();
11988 }
11989 
11990 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
11991  * PyArray_SetBaseObject(arr, base)
11992  *
11993  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
11994  * base = PyArray_BASE(arr)
11995  * if base is NULL:
11996  */
11997 
11998 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
11999  PyObject *__pyx_v_base;
12000  PyObject *__pyx_r = NULL;
12001  __Pyx_RefNannyDeclarations
12002  int __pyx_t_1;
12003  __Pyx_RefNannySetupContext("get_array_base", 0);
12004 
12005  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
12006  *
12007  * cdef inline object get_array_base(ndarray arr):
12008  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
12009  * if base is NULL:
12010  * return None
12011  */
12012  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
12013 
12014  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
12015  * cdef inline object get_array_base(ndarray arr):
12016  * base = PyArray_BASE(arr)
12017  * if base is NULL: # <<<<<<<<<<<<<<
12018  * return None
12019  * return <object>base
12020  */
12021  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
12022  if (__pyx_t_1) {
12023 
12024  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
12025  * base = PyArray_BASE(arr)
12026  * if base is NULL:
12027  * return None # <<<<<<<<<<<<<<
12028  * return <object>base
12029  *
12030  */
12031  __Pyx_XDECREF(__pyx_r);
12032  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12033  goto __pyx_L0;
12034 
12035  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
12036  * cdef inline object get_array_base(ndarray arr):
12037  * base = PyArray_BASE(arr)
12038  * if base is NULL: # <<<<<<<<<<<<<<
12039  * return None
12040  * return <object>base
12041  */
12042  }
12043 
12044  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
12045  * if base is NULL:
12046  * return None
12047  * return <object>base # <<<<<<<<<<<<<<
12048  *
12049  * # Versions of the import_* functions which are more suitable for
12050  */
12051  __Pyx_XDECREF(__pyx_r);
12052  __Pyx_INCREF(((PyObject *)__pyx_v_base));
12053  __pyx_r = ((PyObject *)__pyx_v_base);
12054  goto __pyx_L0;
12055 
12056  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
12057  * PyArray_SetBaseObject(arr, base)
12058  *
12059  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
12060  * base = PyArray_BASE(arr)
12061  * if base is NULL:
12062  */
12063 
12064  /* function exit code */
12065  __pyx_L0:;
12066  __Pyx_XGIVEREF(__pyx_r);
12067  __Pyx_RefNannyFinishContext();
12068  return __pyx_r;
12069 }
12070 
12071 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
12072  * # Versions of the import_* functions which are more suitable for
12073  * # Cython code.
12074  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
12075  * try:
12076  * __pyx_import_array()
12077  */
12078 
12079 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
12080  int __pyx_r;
12081  __Pyx_RefNannyDeclarations
12082  PyObject *__pyx_t_1 = NULL;
12083  PyObject *__pyx_t_2 = NULL;
12084  PyObject *__pyx_t_3 = NULL;
12085  int __pyx_t_4;
12086  PyObject *__pyx_t_5 = NULL;
12087  PyObject *__pyx_t_6 = NULL;
12088  PyObject *__pyx_t_7 = NULL;
12089  PyObject *__pyx_t_8 = NULL;
12090  int __pyx_lineno = 0;
12091  const char *__pyx_filename = NULL;
12092  int __pyx_clineno = 0;
12093  __Pyx_RefNannySetupContext("import_array", 0);
12094 
12095  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
12096  * # Cython code.
12097  * cdef inline int import_array() except -1:
12098  * try: # <<<<<<<<<<<<<<
12099  * __pyx_import_array()
12100  * except Exception:
12101  */
12102  {
12103  __Pyx_PyThreadState_declare
12104  __Pyx_PyThreadState_assign
12105  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12106  __Pyx_XGOTREF(__pyx_t_1);
12107  __Pyx_XGOTREF(__pyx_t_2);
12108  __Pyx_XGOTREF(__pyx_t_3);
12109  /*try:*/ {
12110 
12111  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
12112  * cdef inline int import_array() except -1:
12113  * try:
12114  * __pyx_import_array() # <<<<<<<<<<<<<<
12115  * except Exception:
12116  * raise ImportError("numpy.core.multiarray failed to import")
12117  */
12118  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
12119 
12120  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
12121  * # Cython code.
12122  * cdef inline int import_array() except -1:
12123  * try: # <<<<<<<<<<<<<<
12124  * __pyx_import_array()
12125  * except Exception:
12126  */
12127  }
12128  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12129  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12130  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12131  goto __pyx_L8_try_end;
12132  __pyx_L3_error:;
12133 
12134  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
12135  * try:
12136  * __pyx_import_array()
12137  * except Exception: # <<<<<<<<<<<<<<
12138  * raise ImportError("numpy.core.multiarray failed to import")
12139  *
12140  */
12141  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
12142  if (__pyx_t_4) {
12143  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
12144  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
12145  __Pyx_GOTREF(__pyx_t_5);
12146  __Pyx_GOTREF(__pyx_t_6);
12147  __Pyx_GOTREF(__pyx_t_7);
12148 
12149  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
12150  * __pyx_import_array()
12151  * except Exception:
12152  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
12153  *
12154  * cdef inline int import_umath() except -1:
12155  */
12156  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
12157  __Pyx_GOTREF(__pyx_t_8);
12158  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
12159  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12160  __PYX_ERR(1, 945, __pyx_L5_except_error)
12161  }
12162  goto __pyx_L5_except_error;
12163  __pyx_L5_except_error:;
12164 
12165  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
12166  * # Cython code.
12167  * cdef inline int import_array() except -1:
12168  * try: # <<<<<<<<<<<<<<
12169  * __pyx_import_array()
12170  * except Exception:
12171  */
12172  __Pyx_XGIVEREF(__pyx_t_1);
12173  __Pyx_XGIVEREF(__pyx_t_2);
12174  __Pyx_XGIVEREF(__pyx_t_3);
12175  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12176  goto __pyx_L1_error;
12177  __pyx_L8_try_end:;
12178  }
12179 
12180  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
12181  * # Versions of the import_* functions which are more suitable for
12182  * # Cython code.
12183  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
12184  * try:
12185  * __pyx_import_array()
12186  */
12187 
12188  /* function exit code */
12189  __pyx_r = 0;
12190  goto __pyx_L0;
12191  __pyx_L1_error:;
12192  __Pyx_XDECREF(__pyx_t_5);
12193  __Pyx_XDECREF(__pyx_t_6);
12194  __Pyx_XDECREF(__pyx_t_7);
12195  __Pyx_XDECREF(__pyx_t_8);
12196  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
12197  __pyx_r = -1;
12198  __pyx_L0:;
12199  __Pyx_RefNannyFinishContext();
12200  return __pyx_r;
12201 }
12202 
12203 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
12204  * raise ImportError("numpy.core.multiarray failed to import")
12205  *
12206  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
12207  * try:
12208  * _import_umath()
12209  */
12210 
12211 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
12212  int __pyx_r;
12213  __Pyx_RefNannyDeclarations
12214  PyObject *__pyx_t_1 = NULL;
12215  PyObject *__pyx_t_2 = NULL;
12216  PyObject *__pyx_t_3 = NULL;
12217  int __pyx_t_4;
12218  PyObject *__pyx_t_5 = NULL;
12219  PyObject *__pyx_t_6 = NULL;
12220  PyObject *__pyx_t_7 = NULL;
12221  PyObject *__pyx_t_8 = NULL;
12222  int __pyx_lineno = 0;
12223  const char *__pyx_filename = NULL;
12224  int __pyx_clineno = 0;
12225  __Pyx_RefNannySetupContext("import_umath", 0);
12226 
12227  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
12228  *
12229  * cdef inline int import_umath() except -1:
12230  * try: # <<<<<<<<<<<<<<
12231  * _import_umath()
12232  * except Exception:
12233  */
12234  {
12235  __Pyx_PyThreadState_declare
12236  __Pyx_PyThreadState_assign
12237  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12238  __Pyx_XGOTREF(__pyx_t_1);
12239  __Pyx_XGOTREF(__pyx_t_2);
12240  __Pyx_XGOTREF(__pyx_t_3);
12241  /*try:*/ {
12242 
12243  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
12244  * cdef inline int import_umath() except -1:
12245  * try:
12246  * _import_umath() # <<<<<<<<<<<<<<
12247  * except Exception:
12248  * raise ImportError("numpy.core.umath failed to import")
12249  */
12250  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
12251 
12252  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
12253  *
12254  * cdef inline int import_umath() except -1:
12255  * try: # <<<<<<<<<<<<<<
12256  * _import_umath()
12257  * except Exception:
12258  */
12259  }
12260  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12261  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12262  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12263  goto __pyx_L8_try_end;
12264  __pyx_L3_error:;
12265 
12266  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
12267  * try:
12268  * _import_umath()
12269  * except Exception: # <<<<<<<<<<<<<<
12270  * raise ImportError("numpy.core.umath failed to import")
12271  *
12272  */
12273  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
12274  if (__pyx_t_4) {
12275  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
12276  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
12277  __Pyx_GOTREF(__pyx_t_5);
12278  __Pyx_GOTREF(__pyx_t_6);
12279  __Pyx_GOTREF(__pyx_t_7);
12280 
12281  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
12282  * _import_umath()
12283  * except Exception:
12284  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
12285  *
12286  * cdef inline int import_ufunc() except -1:
12287  */
12288  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
12289  __Pyx_GOTREF(__pyx_t_8);
12290  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
12291  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12292  __PYX_ERR(1, 951, __pyx_L5_except_error)
12293  }
12294  goto __pyx_L5_except_error;
12295  __pyx_L5_except_error:;
12296 
12297  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
12298  *
12299  * cdef inline int import_umath() except -1:
12300  * try: # <<<<<<<<<<<<<<
12301  * _import_umath()
12302  * except Exception:
12303  */
12304  __Pyx_XGIVEREF(__pyx_t_1);
12305  __Pyx_XGIVEREF(__pyx_t_2);
12306  __Pyx_XGIVEREF(__pyx_t_3);
12307  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12308  goto __pyx_L1_error;
12309  __pyx_L8_try_end:;
12310  }
12311 
12312  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
12313  * raise ImportError("numpy.core.multiarray failed to import")
12314  *
12315  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
12316  * try:
12317  * _import_umath()
12318  */
12319 
12320  /* function exit code */
12321  __pyx_r = 0;
12322  goto __pyx_L0;
12323  __pyx_L1_error:;
12324  __Pyx_XDECREF(__pyx_t_5);
12325  __Pyx_XDECREF(__pyx_t_6);
12326  __Pyx_XDECREF(__pyx_t_7);
12327  __Pyx_XDECREF(__pyx_t_8);
12328  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
12329  __pyx_r = -1;
12330  __pyx_L0:;
12331  __Pyx_RefNannyFinishContext();
12332  return __pyx_r;
12333 }
12334 
12335 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
12336  * raise ImportError("numpy.core.umath failed to import")
12337  *
12338  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
12339  * try:
12340  * _import_umath()
12341  */
12342 
12343 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
12344  int __pyx_r;
12345  __Pyx_RefNannyDeclarations
12346  PyObject *__pyx_t_1 = NULL;
12347  PyObject *__pyx_t_2 = NULL;
12348  PyObject *__pyx_t_3 = NULL;
12349  int __pyx_t_4;
12350  PyObject *__pyx_t_5 = NULL;
12351  PyObject *__pyx_t_6 = NULL;
12352  PyObject *__pyx_t_7 = NULL;
12353  PyObject *__pyx_t_8 = NULL;
12354  int __pyx_lineno = 0;
12355  const char *__pyx_filename = NULL;
12356  int __pyx_clineno = 0;
12357  __Pyx_RefNannySetupContext("import_ufunc", 0);
12358 
12359  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
12360  *
12361  * cdef inline int import_ufunc() except -1:
12362  * try: # <<<<<<<<<<<<<<
12363  * _import_umath()
12364  * except Exception:
12365  */
12366  {
12367  __Pyx_PyThreadState_declare
12368  __Pyx_PyThreadState_assign
12369  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
12370  __Pyx_XGOTREF(__pyx_t_1);
12371  __Pyx_XGOTREF(__pyx_t_2);
12372  __Pyx_XGOTREF(__pyx_t_3);
12373  /*try:*/ {
12374 
12375  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
12376  * cdef inline int import_ufunc() except -1:
12377  * try:
12378  * _import_umath() # <<<<<<<<<<<<<<
12379  * except Exception:
12380  * raise ImportError("numpy.core.umath failed to import")
12381  */
12382  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
12383 
12384  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
12385  *
12386  * cdef inline int import_ufunc() except -1:
12387  * try: # <<<<<<<<<<<<<<
12388  * _import_umath()
12389  * except Exception:
12390  */
12391  }
12392  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12393  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12394  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12395  goto __pyx_L8_try_end;
12396  __pyx_L3_error:;
12397 
12398  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
12399  * try:
12400  * _import_umath()
12401  * except Exception: # <<<<<<<<<<<<<<
12402  * raise ImportError("numpy.core.umath failed to import")
12403  *
12404  */
12405  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
12406  if (__pyx_t_4) {
12407  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
12408  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
12409  __Pyx_GOTREF(__pyx_t_5);
12410  __Pyx_GOTREF(__pyx_t_6);
12411  __Pyx_GOTREF(__pyx_t_7);
12412 
12413  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
12414  * _import_umath()
12415  * except Exception:
12416  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
12417  *
12418  * cdef extern from *:
12419  */
12420  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
12421  __Pyx_GOTREF(__pyx_t_8);
12422  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
12423  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12424  __PYX_ERR(1, 957, __pyx_L5_except_error)
12425  }
12426  goto __pyx_L5_except_error;
12427  __pyx_L5_except_error:;
12428 
12429  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
12430  *
12431  * cdef inline int import_ufunc() except -1:
12432  * try: # <<<<<<<<<<<<<<
12433  * _import_umath()
12434  * except Exception:
12435  */
12436  __Pyx_XGIVEREF(__pyx_t_1);
12437  __Pyx_XGIVEREF(__pyx_t_2);
12438  __Pyx_XGIVEREF(__pyx_t_3);
12439  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
12440  goto __pyx_L1_error;
12441  __pyx_L8_try_end:;
12442  }
12443 
12444  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
12445  * raise ImportError("numpy.core.umath failed to import")
12446  *
12447  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
12448  * try:
12449  * _import_umath()
12450  */
12451 
12452  /* function exit code */
12453  __pyx_r = 0;
12454  goto __pyx_L0;
12455  __pyx_L1_error:;
12456  __Pyx_XDECREF(__pyx_t_5);
12457  __Pyx_XDECREF(__pyx_t_6);
12458  __Pyx_XDECREF(__pyx_t_7);
12459  __Pyx_XDECREF(__pyx_t_8);
12460  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
12461  __pyx_r = -1;
12462  __pyx_L0:;
12463  __Pyx_RefNannyFinishContext();
12464  return __pyx_r;
12465 }
12466 
12467 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
12468  *
12469  *
12470  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
12471  * """
12472  * Cython equivalent of `isinstance(obj, np.timedelta64)`
12473  */
12474 
12475 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
12476  int __pyx_r;
12477  __Pyx_RefNannyDeclarations
12478  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
12479 
12480  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
12481  * bool
12482  * """
12483  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
12484  *
12485  *
12486  */
12487  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
12488  goto __pyx_L0;
12489 
12490  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
12491  *
12492  *
12493  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
12494  * """
12495  * Cython equivalent of `isinstance(obj, np.timedelta64)`
12496  */
12497 
12498  /* function exit code */
12499  __pyx_L0:;
12500  __Pyx_RefNannyFinishContext();
12501  return __pyx_r;
12502 }
12503 
12504 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
12505  *
12506  *
12507  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
12508  * """
12509  * Cython equivalent of `isinstance(obj, np.datetime64)`
12510  */
12511 
12512 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
12513  int __pyx_r;
12514  __Pyx_RefNannyDeclarations
12515  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
12516 
12517  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
12518  * bool
12519  * """
12520  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
12521  *
12522  *
12523  */
12524  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
12525  goto __pyx_L0;
12526 
12527  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
12528  *
12529  *
12530  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
12531  * """
12532  * Cython equivalent of `isinstance(obj, np.datetime64)`
12533  */
12534 
12535  /* function exit code */
12536  __pyx_L0:;
12537  __Pyx_RefNannyFinishContext();
12538  return __pyx_r;
12539 }
12540 
12541 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
12542  *
12543  *
12544  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
12545  * """
12546  * returns the int64 value underlying scalar numpy datetime64 object
12547  */
12548 
12549 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
12550  npy_datetime __pyx_r;
12551 
12552  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
12553  * also needed. That can be found using `get_datetime64_unit`.
12554  * """
12555  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
12556  *
12557  *
12558  */
12559  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
12560  goto __pyx_L0;
12561 
12562  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
12563  *
12564  *
12565  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
12566  * """
12567  * returns the int64 value underlying scalar numpy datetime64 object
12568  */
12569 
12570  /* function exit code */
12571  __pyx_L0:;
12572  return __pyx_r;
12573 }
12574 
12575 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
12576  *
12577  *
12578  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
12579  * """
12580  * returns the int64 value underlying scalar numpy timedelta64 object
12581  */
12582 
12583 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
12584  npy_timedelta __pyx_r;
12585 
12586  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
12587  * returns the int64 value underlying scalar numpy timedelta64 object
12588  * """
12589  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
12590  *
12591  *
12592  */
12593  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
12594  goto __pyx_L0;
12595 
12596  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
12597  *
12598  *
12599  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
12600  * """
12601  * returns the int64 value underlying scalar numpy timedelta64 object
12602  */
12603 
12604  /* function exit code */
12605  __pyx_L0:;
12606  return __pyx_r;
12607 }
12608 
12609 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
12610  *
12611  *
12612  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
12613  * """
12614  * returns the unit part of the dtype for a numpy datetime64 object.
12615  */
12616 
12617 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
12618  NPY_DATETIMEUNIT __pyx_r;
12619 
12620  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
12621  * returns the unit part of the dtype for a numpy datetime64 object.
12622  * """
12623  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
12624  */
12625  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
12626  goto __pyx_L0;
12627 
12628  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
12629  *
12630  *
12631  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
12632  * """
12633  * returns the unit part of the dtype for a numpy datetime64 object.
12634  */
12635 
12636  /* function exit code */
12637  __pyx_L0:;
12638  return __pyx_r;
12639 }
12640 
12641 static PyMethodDef __pyx_methods[] = {
12642  {0, 0, 0, 0}
12643 };
12644 
12645 #if PY_MAJOR_VERSION >= 3
12646 #if CYTHON_PEP489_MULTI_PHASE_INIT
12647 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
12648 static int __pyx_pymod_exec_csubgridError(PyObject* module); /*proto*/
12649 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
12650  {Py_mod_create, (void*)__pyx_pymod_create},
12651  {Py_mod_exec, (void*)__pyx_pymod_exec_csubgridError},
12652  {0, NULL}
12653 };
12654 #endif
12655 
12656 static struct PyModuleDef __pyx_moduledef = {
12657  PyModuleDef_HEAD_INIT,
12658  "csubgridError",
12659  0, /* m_doc */
12660  #if CYTHON_PEP489_MULTI_PHASE_INIT
12661  0, /* m_size */
12662  #else
12663  -1, /* m_size */
12664  #endif
12665  __pyx_methods /* m_methods */,
12666  #if CYTHON_PEP489_MULTI_PHASE_INIT
12667  __pyx_moduledef_slots, /* m_slots */
12668  #else
12669  NULL, /* m_reload */
12670  #endif
12671  NULL, /* m_traverse */
12672  NULL, /* m_clear */
12673  NULL /* m_free */
12674 };
12675 #endif
12676 #ifndef CYTHON_SMALL_CODE
12677 #if defined(__clang__)
12678  #define CYTHON_SMALL_CODE
12679 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
12680  #define CYTHON_SMALL_CODE __attribute__((cold))
12681 #else
12682  #define CYTHON_SMALL_CODE
12683 #endif
12684 #endif
12685 
12686 static __Pyx_StringTabEntry __pyx_string_tab[] = {
12687  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
12688  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
12689  {&__pyx_n_s_calculateSubgridErrorGradient_ta, __pyx_k_calculateSubgridErrorGradient_ta, sizeof(__pyx_k_calculateSubgridErrorGradient_ta), 0, 0, 1, 1},
12690  {&__pyx_n_s_calculateSubgridErrorNavierStoke, __pyx_k_calculateSubgridErrorNavierStoke, sizeof(__pyx_k_calculateSubgridErrorNavierStoke), 0, 0, 1, 1},
12691  {&__pyx_n_s_calculateSubgridErrorNavierStoke_10, __pyx_k_calculateSubgridErrorNavierStoke_10, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_10), 0, 0, 1, 1},
12692  {&__pyx_n_s_calculateSubgridErrorNavierStoke_2, __pyx_k_calculateSubgridErrorNavierStoke_2, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_2), 0, 0, 1, 1},
12693  {&__pyx_n_s_calculateSubgridErrorNavierStoke_3, __pyx_k_calculateSubgridErrorNavierStoke_3, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_3), 0, 0, 1, 1},
12694  {&__pyx_n_s_calculateSubgridErrorNavierStoke_4, __pyx_k_calculateSubgridErrorNavierStoke_4, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_4), 0, 0, 1, 1},
12695  {&__pyx_n_s_calculateSubgridErrorNavierStoke_5, __pyx_k_calculateSubgridErrorNavierStoke_5, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_5), 0, 0, 1, 1},
12696  {&__pyx_n_s_calculateSubgridErrorNavierStoke_6, __pyx_k_calculateSubgridErrorNavierStoke_6, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_6), 0, 0, 1, 1},
12697  {&__pyx_n_s_calculateSubgridErrorNavierStoke_7, __pyx_k_calculateSubgridErrorNavierStoke_7, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_7), 0, 0, 1, 1},
12698  {&__pyx_n_s_calculateSubgridErrorNavierStoke_8, __pyx_k_calculateSubgridErrorNavierStoke_8, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_8), 0, 0, 1, 1},
12699  {&__pyx_n_s_calculateSubgridErrorNavierStoke_9, __pyx_k_calculateSubgridErrorNavierStoke_9, sizeof(__pyx_k_calculateSubgridErrorNavierStoke_9), 0, 0, 1, 1},
12700  {&__pyx_n_s_calculateSubgridErrorShallowWate, __pyx_k_calculateSubgridErrorShallowWate, sizeof(__pyx_k_calculateSubgridErrorShallowWate), 0, 0, 1, 1},
12701  {&__pyx_n_s_calculateSubgridErrorShallowWate_2, __pyx_k_calculateSubgridErrorShallowWate_2, sizeof(__pyx_k_calculateSubgridErrorShallowWate_2), 0, 0, 1, 1},
12702  {&__pyx_n_s_calculateSubgridErrorStokes2D_1, __pyx_k_calculateSubgridErrorStokes2D_1, sizeof(__pyx_k_calculateSubgridErrorStokes2D_1), 0, 0, 1, 1},
12703  {&__pyx_n_s_calculateSubgridErrorStokes2D_1_2, __pyx_k_calculateSubgridErrorStokes2D_1_2, sizeof(__pyx_k_calculateSubgridErrorStokes2D_1_2), 0, 0, 1, 1},
12704  {&__pyx_n_s_calculateSubgridErrorStokes2D_GL, __pyx_k_calculateSubgridErrorStokes2D_GL, sizeof(__pyx_k_calculateSubgridErrorStokes2D_GL), 0, 0, 1, 1},
12705  {&__pyx_n_s_calculateSubgridErrorStokes2D_GL_2, __pyx_k_calculateSubgridErrorStokes2D_GL_2, sizeof(__pyx_k_calculateSubgridErrorStokes2D_GL_2), 0, 0, 1, 1},
12706  {&__pyx_n_s_calculateSubgridErrorStokes2D_GL_3, __pyx_k_calculateSubgridErrorStokes2D_GL_3, sizeof(__pyx_k_calculateSubgridErrorStokes2D_GL_3), 0, 0, 1, 1},
12707  {&__pyx_n_s_calculateSubgridErrorStokes2D_GL_4, __pyx_k_calculateSubgridErrorStokes2D_GL_4, sizeof(__pyx_k_calculateSubgridErrorStokes2D_GL_4), 0, 0, 1, 1},
12708  {&__pyx_n_s_calculateSubgridErrorStokes2D_GL_5, __pyx_k_calculateSubgridErrorStokes2D_GL_5, sizeof(__pyx_k_calculateSubgridErrorStokes2D_GL_5), 0, 0, 1, 1},
12709  {&__pyx_n_s_calculateSubgridErrorStokes3D_GL, __pyx_k_calculateSubgridErrorStokes3D_GL, sizeof(__pyx_k_calculateSubgridErrorStokes3D_GL), 0, 0, 1, 1},
12710  {&__pyx_n_s_calculateSubgridErrorStokes3D_GL_2, __pyx_k_calculateSubgridErrorStokes3D_GL_2, sizeof(__pyx_k_calculateSubgridErrorStokes3D_GL_2), 0, 0, 1, 1},
12711  {&__pyx_n_s_calculateSubgridErrorStokes3D_GL_3, __pyx_k_calculateSubgridErrorStokes3D_GL_3, sizeof(__pyx_k_calculateSubgridErrorStokes3D_GL_3), 0, 0, 1, 1},
12712  {&__pyx_n_s_calculateSubgridErrorStokes3D_GL_4, __pyx_k_calculateSubgridErrorStokes3D_GL_4, sizeof(__pyx_k_calculateSubgridErrorStokes3D_GL_4), 0, 0, 1, 1},
12713  {&__pyx_n_s_calculateSubgridErrorStokes3D_GL_5, __pyx_k_calculateSubgridErrorStokes3D_GL_5, sizeof(__pyx_k_calculateSubgridErrorStokes3D_GL_5), 0, 0, 1, 1},
12714  {&__pyx_n_s_calculateSubgridErrorStokes_GLS, __pyx_k_calculateSubgridErrorStokes_GLS, sizeof(__pyx_k_calculateSubgridErrorStokes_GLS), 0, 0, 1, 1},
12715  {&__pyx_n_s_calculateSubgridErrorStokes_GLS_2, __pyx_k_calculateSubgridErrorStokes_GLS_2, sizeof(__pyx_k_calculateSubgridErrorStokes_GLS_2), 0, 0, 1, 1},
12716  {&__pyx_n_s_calculateSubgridError_ADR_Sangal, __pyx_k_calculateSubgridError_ADR_Sangal, sizeof(__pyx_k_calculateSubgridError_ADR_Sangal), 0, 0, 1, 1},
12717  {&__pyx_n_s_calculateSubgridError_ADR_generi, __pyx_k_calculateSubgridError_ADR_generi, sizeof(__pyx_k_calculateSubgridError_ADR_generi), 0, 0, 1, 1},
12718  {&__pyx_n_s_calculateSubgridError_ADR_generi_2, __pyx_k_calculateSubgridError_ADR_generi_2, sizeof(__pyx_k_calculateSubgridError_ADR_generi_2), 0, 0, 1, 1},
12719  {&__pyx_n_s_calculateSubgridError_ADR_tau, __pyx_k_calculateSubgridError_ADR_tau, sizeof(__pyx_k_calculateSubgridError_ADR_tau), 0, 0, 1, 1},
12720  {&__pyx_n_s_calculateSubgridError_ADR_tau_sd, __pyx_k_calculateSubgridError_ADR_tau_sd, sizeof(__pyx_k_calculateSubgridError_ADR_tau_sd), 0, 0, 1, 1},
12721  {&__pyx_n_s_calculateSubgridError_A_tau, __pyx_k_calculateSubgridError_A_tau, sizeof(__pyx_k_calculateSubgridError_A_tau), 0, 0, 1, 1},
12722  {&__pyx_n_s_calculateSubgridError_HJ_tau, __pyx_k_calculateSubgridError_HJ_tau, sizeof(__pyx_k_calculateSubgridError_HJ_tau), 0, 0, 1, 1},
12723  {&__pyx_n_s_calculateSubgridError_Harari_tau, __pyx_k_calculateSubgridError_Harari_tau, sizeof(__pyx_k_calculateSubgridError_Harari_tau), 0, 0, 1, 1},
12724  {&__pyx_n_s_calculateSubgridError_tauRes, __pyx_k_calculateSubgridError_tauRes, sizeof(__pyx_k_calculateSubgridError_tauRes), 0, 0, 1, 1},
12725  {&__pyx_n_s_cfl, __pyx_k_cfl, sizeof(__pyx_k_cfl), 0, 0, 1, 1},
12726  {&__pyx_n_s_cfl_1, __pyx_k_cfl_1, sizeof(__pyx_k_cfl_1), 0, 0, 1, 1},
12727  {&__pyx_n_s_cfl_2, __pyx_k_cfl_2, sizeof(__pyx_k_cfl_2), 0, 0, 1, 1},
12728  {&__pyx_n_s_cfl_3, __pyx_k_cfl_3, sizeof(__pyx_k_cfl_3), 0, 0, 1, 1},
12729  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
12730  {&__pyx_n_s_colind, __pyx_k_colind, sizeof(__pyx_k_colind), 0, 0, 1, 1},
12731  {&__pyx_n_s_csubgridError, __pyx_k_csubgridError, sizeof(__pyx_k_csubgridError), 0, 0, 1, 1},
12732  {&__pyx_n_s_dH, __pyx_k_dH, sizeof(__pyx_k_dH), 0, 0, 1, 1},
12733  {&__pyx_n_s_da, __pyx_k_da, sizeof(__pyx_k_da), 0, 0, 1, 1},
12734  {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
12735  {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1},
12736  {&__pyx_n_s_dmt, __pyx_k_dmt, sizeof(__pyx_k_dmt), 0, 0, 1, 1},
12737  {&__pyx_n_s_dpdeResidual, __pyx_k_dpdeResidual, sizeof(__pyx_k_dpdeResidual), 0, 0, 1, 1},
12738  {&__pyx_n_s_dpdeResidualP_du, __pyx_k_dpdeResidualP_du, sizeof(__pyx_k_dpdeResidualP_du), 0, 0, 1, 1},
12739  {&__pyx_n_s_dpdeResidualP_dv, __pyx_k_dpdeResidualP_dv, sizeof(__pyx_k_dpdeResidualP_dv), 0, 0, 1, 1},
12740  {&__pyx_n_s_dpdeResidualP_dw, __pyx_k_dpdeResidualP_dw, sizeof(__pyx_k_dpdeResidualP_dw), 0, 0, 1, 1},
12741  {&__pyx_n_s_dpdeResidualU_dp, __pyx_k_dpdeResidualU_dp, sizeof(__pyx_k_dpdeResidualU_dp), 0, 0, 1, 1},
12742  {&__pyx_n_s_dpdeResidualU_du, __pyx_k_dpdeResidualU_du, sizeof(__pyx_k_dpdeResidualU_du), 0, 0, 1, 1},
12743  {&__pyx_n_s_dpdeResidualU_dv, __pyx_k_dpdeResidualU_dv, sizeof(__pyx_k_dpdeResidualU_dv), 0, 0, 1, 1},
12744  {&__pyx_n_s_dpdeResidualU_dw, __pyx_k_dpdeResidualU_dw, sizeof(__pyx_k_dpdeResidualU_dw), 0, 0, 1, 1},
12745  {&__pyx_n_s_dpdeResidualV_dp, __pyx_k_dpdeResidualV_dp, sizeof(__pyx_k_dpdeResidualV_dp), 0, 0, 1, 1},
12746  {&__pyx_n_s_dpdeResidualV_du, __pyx_k_dpdeResidualV_du, sizeof(__pyx_k_dpdeResidualV_du), 0, 0, 1, 1},
12747  {&__pyx_n_s_dpdeResidualV_dv, __pyx_k_dpdeResidualV_dv, sizeof(__pyx_k_dpdeResidualV_dv), 0, 0, 1, 1},
12748  {&__pyx_n_s_dpdeResidualV_dw, __pyx_k_dpdeResidualV_dw, sizeof(__pyx_k_dpdeResidualV_dw), 0, 0, 1, 1},
12749  {&__pyx_n_s_dpdeResidualW_dp, __pyx_k_dpdeResidualW_dp, sizeof(__pyx_k_dpdeResidualW_dp), 0, 0, 1, 1},
12750  {&__pyx_n_s_dpdeResidualW_du, __pyx_k_dpdeResidualW_du, sizeof(__pyx_k_dpdeResidualW_du), 0, 0, 1, 1},
12751  {&__pyx_n_s_dpdeResidualW_dv, __pyx_k_dpdeResidualW_dv, sizeof(__pyx_k_dpdeResidualW_dv), 0, 0, 1, 1},
12752  {&__pyx_n_s_dpdeResidualW_dw, __pyx_k_dpdeResidualW_dw, sizeof(__pyx_k_dpdeResidualW_dw), 0, 0, 1, 1},
12753  {&__pyx_n_s_dphi, __pyx_k_dphi, sizeof(__pyx_k_dphi), 0, 0, 1, 1},
12754  {&__pyx_n_s_dr, __pyx_k_dr, sizeof(__pyx_k_dr), 0, 0, 1, 1},
12755  {&__pyx_n_s_dsubgridError, __pyx_k_dsubgridError, sizeof(__pyx_k_dsubgridError), 0, 0, 1, 1},
12756  {&__pyx_n_s_dsubgridErrorP_dp, __pyx_k_dsubgridErrorP_dp, sizeof(__pyx_k_dsubgridErrorP_dp), 0, 0, 1, 1},
12757  {&__pyx_n_s_dsubgridErrorP_du, __pyx_k_dsubgridErrorP_du, sizeof(__pyx_k_dsubgridErrorP_du), 0, 0, 1, 1},
12758  {&__pyx_n_s_dsubgridErrorP_dv, __pyx_k_dsubgridErrorP_dv, sizeof(__pyx_k_dsubgridErrorP_dv), 0, 0, 1, 1},
12759  {&__pyx_n_s_dsubgridErrorP_dw, __pyx_k_dsubgridErrorP_dw, sizeof(__pyx_k_dsubgridErrorP_dw), 0, 0, 1, 1},
12760  {&__pyx_n_s_dsubgridErrorU_dp, __pyx_k_dsubgridErrorU_dp, sizeof(__pyx_k_dsubgridErrorU_dp), 0, 0, 1, 1},
12761  {&__pyx_n_s_dsubgridErrorU_du, __pyx_k_dsubgridErrorU_du, sizeof(__pyx_k_dsubgridErrorU_du), 0, 0, 1, 1},
12762  {&__pyx_n_s_dsubgridErrorU_dv, __pyx_k_dsubgridErrorU_dv, sizeof(__pyx_k_dsubgridErrorU_dv), 0, 0, 1, 1},
12763  {&__pyx_n_s_dsubgridErrorU_dw, __pyx_k_dsubgridErrorU_dw, sizeof(__pyx_k_dsubgridErrorU_dw), 0, 0, 1, 1},
12764  {&__pyx_n_s_dsubgridErrorV_dp, __pyx_k_dsubgridErrorV_dp, sizeof(__pyx_k_dsubgridErrorV_dp), 0, 0, 1, 1},
12765  {&__pyx_n_s_dsubgridErrorV_du, __pyx_k_dsubgridErrorV_du, sizeof(__pyx_k_dsubgridErrorV_du), 0, 0, 1, 1},
12766  {&__pyx_n_s_dsubgridErrorV_dv, __pyx_k_dsubgridErrorV_dv, sizeof(__pyx_k_dsubgridErrorV_dv), 0, 0, 1, 1},
12767  {&__pyx_n_s_dsubgridErrorV_dw, __pyx_k_dsubgridErrorV_dw, sizeof(__pyx_k_dsubgridErrorV_dw), 0, 0, 1, 1},
12768  {&__pyx_n_s_dsubgridErrorW_dp, __pyx_k_dsubgridErrorW_dp, sizeof(__pyx_k_dsubgridErrorW_dp), 0, 0, 1, 1},
12769  {&__pyx_n_s_dsubgridErrorW_du, __pyx_k_dsubgridErrorW_du, sizeof(__pyx_k_dsubgridErrorW_du), 0, 0, 1, 1},
12770  {&__pyx_n_s_dsubgridErrorW_dv, __pyx_k_dsubgridErrorW_dv, sizeof(__pyx_k_dsubgridErrorW_dv), 0, 0, 1, 1},
12771  {&__pyx_n_s_dsubgridErrorW_dw, __pyx_k_dsubgridErrorW_dw, sizeof(__pyx_k_dsubgridErrorW_dw), 0, 0, 1, 1},
12772  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
12773  {&__pyx_n_s_elementDiameter, __pyx_k_elementDiameter, sizeof(__pyx_k_elementDiameter), 0, 0, 1, 1},
12774  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
12775  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
12776  {&__pyx_n_s_grad_pdeResidual, __pyx_k_grad_pdeResidual, sizeof(__pyx_k_grad_pdeResidual), 0, 0, 1, 1},
12777  {&__pyx_n_s_grad_phi, __pyx_k_grad_phi, sizeof(__pyx_k_grad_phi), 0, 0, 1, 1},
12778  {&__pyx_n_s_grad_subgridError, __pyx_k_grad_subgridError, sizeof(__pyx_k_grad_subgridError), 0, 0, 1, 1},
12779  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
12780  {&__pyx_n_s_hFactor, __pyx_k_hFactor, sizeof(__pyx_k_hFactor), 0, 0, 1, 1},
12781  {&__pyx_n_s_hu, __pyx_k_hu, sizeof(__pyx_k_hu), 0, 0, 1, 1},
12782  {&__pyx_n_s_hv, __pyx_k_hv, sizeof(__pyx_k_hv), 0, 0, 1, 1},
12783  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
12784  {&__pyx_n_s_inverseJ, __pyx_k_inverseJ, sizeof(__pyx_k_inverseJ), 0, 0, 1, 1},
12785  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
12786  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
12787  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
12788  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
12789  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
12790  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
12791  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
12792  {&__pyx_n_s_pdeResidual, __pyx_k_pdeResidual, sizeof(__pyx_k_pdeResidual), 0, 0, 1, 1},
12793  {&__pyx_n_s_pdeResidualP, __pyx_k_pdeResidualP, sizeof(__pyx_k_pdeResidualP), 0, 0, 1, 1},
12794  {&__pyx_n_s_pdeResidualU, __pyx_k_pdeResidualU, sizeof(__pyx_k_pdeResidualU), 0, 0, 1, 1},
12795  {&__pyx_n_s_pdeResidualV, __pyx_k_pdeResidualV, sizeof(__pyx_k_pdeResidualV), 0, 0, 1, 1},
12796  {&__pyx_n_s_pdeResidualW, __pyx_k_pdeResidualW, sizeof(__pyx_k_pdeResidualW), 0, 0, 1, 1},
12797  {&__pyx_n_s_pe, __pyx_k_pe, sizeof(__pyx_k_pe), 0, 0, 1, 1},
12798  {&__pyx_kp_s_proteus_csubgridError_pyx, __pyx_k_proteus_csubgridError_pyx, sizeof(__pyx_k_proteus_csubgridError_pyx), 0, 0, 1, 0},
12799  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
12800  {&__pyx_n_s_stabilization, __pyx_k_stabilization, sizeof(__pyx_k_stabilization), 0, 0, 1, 1},
12801  {&__pyx_n_s_subgridError, __pyx_k_subgridError, sizeof(__pyx_k_subgridError), 0, 0, 1, 1},
12802  {&__pyx_n_s_subgridErrorP, __pyx_k_subgridErrorP, sizeof(__pyx_k_subgridErrorP), 0, 0, 1, 1},
12803  {&__pyx_n_s_subgridErrorU, __pyx_k_subgridErrorU, sizeof(__pyx_k_subgridErrorU), 0, 0, 1, 1},
12804  {&__pyx_n_s_subgridErrorV, __pyx_k_subgridErrorV, sizeof(__pyx_k_subgridErrorV), 0, 0, 1, 1},
12805  {&__pyx_n_s_subgridErrorW, __pyx_k_subgridErrorW, sizeof(__pyx_k_subgridErrorW), 0, 0, 1, 1},
12806  {&__pyx_n_s_tau, __pyx_k_tau, sizeof(__pyx_k_tau), 0, 0, 1, 1},
12807  {&__pyx_n_s_tau0, __pyx_k_tau0, sizeof(__pyx_k_tau0), 0, 0, 1, 1},
12808  {&__pyx_n_s_tau1, __pyx_k_tau1, sizeof(__pyx_k_tau1), 0, 0, 1, 1},
12809  {&__pyx_n_s_tau_gradient, __pyx_k_tau_gradient, sizeof(__pyx_k_tau_gradient), 0, 0, 1, 1},
12810  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
12811  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
12812  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
12813  {0, 0, 0, 0, 0, 0, 0}
12814 };
12815 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
12816  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
12817  return 0;
12818  __pyx_L1_error:;
12819  return -1;
12820 }
12821 
12822 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
12823  __Pyx_RefNannyDeclarations
12824  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
12825 
12826  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
12827  * __pyx_import_array()
12828  * except Exception:
12829  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
12830  *
12831  * cdef inline int import_umath() except -1:
12832  */
12833  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
12834  __Pyx_GOTREF(__pyx_tuple_);
12835  __Pyx_GIVEREF(__pyx_tuple_);
12836 
12837  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
12838  * _import_umath()
12839  * except Exception:
12840  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
12841  *
12842  * cdef inline int import_ufunc() except -1:
12843  */
12844  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
12845  __Pyx_GOTREF(__pyx_tuple__2);
12846  __Pyx_GIVEREF(__pyx_tuple__2);
12847 
12848  /* "csubgridError.pyx":670
12849  * double* tau,
12850  * double* tau_gradient)
12851  * def calculateSubgridError_tauRes(np.ndarray tau, # <<<<<<<<<<<<<<
12852  * np.ndarray pdeResidual,
12853  * np.ndarray dpdeResidual,
12854  */
12855  __pyx_tuple__3 = PyTuple_Pack(5, __pyx_n_s_tau, __pyx_n_s_pdeResidual, __pyx_n_s_dpdeResidual, __pyx_n_s_subgridError, __pyx_n_s_dsubgridError); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 670, __pyx_L1_error)
12856  __Pyx_GOTREF(__pyx_tuple__3);
12857  __Pyx_GIVEREF(__pyx_tuple__3);
12858  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_tauRes, 670, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 670, __pyx_L1_error)
12859 
12860  /* "csubgridError.pyx":683
12861  * <double*> subgridError.data,
12862  * <double*> dsubgridError.data)
12863  * def calculateSubgridError_ADR_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
12864  * np.ndarray dmt,
12865  * np.ndarray df,
12866  */
12867  __pyx_tuple__5 = PyTuple_Pack(11, __pyx_n_s_inverseJ, __pyx_n_s_dmt, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_grad_phi, __pyx_n_s_dphi, __pyx_n_s_dr, __pyx_n_s_pe, __pyx_n_s_cfl, __pyx_n_s_tau); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 683, __pyx_L1_error)
12868  __Pyx_GOTREF(__pyx_tuple__5);
12869  __Pyx_GIVEREF(__pyx_tuple__5);
12870  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(11, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_ADR_generi, 683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 683, __pyx_L1_error)
12871 
12872  /* "csubgridError.pyx":708
12873  * <double*> cfl.data,
12874  * <double*> tau.data)
12875  * def calculateSubgridError_ADR_generic_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
12876  * np.ndarray colind,
12877  * np.ndarray inverseJ,
12878  */
12879  __pyx_tuple__7 = PyTuple_Pack(13, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_inverseJ, __pyx_n_s_dmt, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_grad_phi, __pyx_n_s_dphi, __pyx_n_s_dr, __pyx_n_s_pe, __pyx_n_s_cfl, __pyx_n_s_tau); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 708, __pyx_L1_error)
12880  __Pyx_GOTREF(__pyx_tuple__7);
12881  __Pyx_GIVEREF(__pyx_tuple__7);
12882  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(13, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_ADR_generi_2, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 708, __pyx_L1_error)
12883 
12884  /* "csubgridError.pyx":737
12885  * <double*> cfl.data,
12886  * <double*> tau.data)
12887  * def calculateSubgridError_ADR_tau(char stabilization, # <<<<<<<<<<<<<<
12888  * np.ndarray elementDiameter,
12889  * np.ndarray dmt,
12890  */
12891  __pyx_tuple__9 = PyTuple_Pack(12, __pyx_n_s_stabilization, __pyx_n_s_elementDiameter, __pyx_n_s_dmt, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_grad_phi, __pyx_n_s_dphi, __pyx_n_s_dr, __pyx_n_s_pe, __pyx_n_s_cfl, __pyx_n_s_tau); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 737, __pyx_L1_error)
12892  __Pyx_GOTREF(__pyx_tuple__9);
12893  __Pyx_GIVEREF(__pyx_tuple__9);
12894  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(12, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_ADR_tau, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 737, __pyx_L1_error)
12895 
12896  /* "csubgridError.pyx":764
12897  * <double*> cfl.data,
12898  * <double*> tau.data)
12899  * def calculateSubgridError_ADR_tau_sd(char stabilization, # <<<<<<<<<<<<<<
12900  * np.ndarray rowptr,
12901  * np.ndarray colind,
12902  */
12903  __pyx_tuple__11 = PyTuple_Pack(14, __pyx_n_s_stabilization, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_elementDiameter, __pyx_n_s_dmt, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_grad_phi, __pyx_n_s_dphi, __pyx_n_s_dr, __pyx_n_s_pe, __pyx_n_s_cfl, __pyx_n_s_tau); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 764, __pyx_L1_error)
12904  __Pyx_GOTREF(__pyx_tuple__11);
12905  __Pyx_GIVEREF(__pyx_tuple__11);
12906  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(14, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_ADR_tau_sd, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 764, __pyx_L1_error)
12907 
12908  /* "csubgridError.pyx":795
12909  * <double*> cfl.data,
12910  * <double*> tau.data)
12911  * def calculateSubgridError_A_tau(char stabilization, # <<<<<<<<<<<<<<
12912  * np.ndarray elementDiameter,
12913  * np.ndarray dmt,
12914  */
12915  __pyx_tuple__13 = PyTuple_Pack(6, __pyx_n_s_stabilization, __pyx_n_s_elementDiameter, __pyx_n_s_dmt, __pyx_n_s_df, __pyx_n_s_cfl, __pyx_n_s_tau); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 795, __pyx_L1_error)
12916  __Pyx_GOTREF(__pyx_tuple__13);
12917  __Pyx_GIVEREF(__pyx_tuple__13);
12918  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_A_tau, 795, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 795, __pyx_L1_error)
12919 
12920  /* "csubgridError.pyx":810
12921  * <double*> cfl.data,
12922  * <double*> tau.data)
12923  * def calculateSubgridError_HJ_tau(char stabilization, # <<<<<<<<<<<<<<
12924  * np.ndarray elementDiameter,
12925  * np.ndarray dmt,
12926  */
12927  __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_stabilization, __pyx_n_s_elementDiameter, __pyx_n_s_dmt, __pyx_n_s_dH, __pyx_n_s_cfl, __pyx_n_s_tau); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 810, __pyx_L1_error)
12928  __Pyx_GOTREF(__pyx_tuple__15);
12929  __Pyx_GIVEREF(__pyx_tuple__15);
12930  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_HJ_tau, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 810, __pyx_L1_error)
12931 
12932  /* "csubgridError.pyx":826
12933  * <double*> tau.data)
12934  *
12935  * def calculateSubgridErrorStokes2D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
12936  * np.ndarray a,
12937  * np.ndarray pdeResidualU,
12938  */
12939  __pyx_tuple__17 = PyTuple_Pack(14, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 826, __pyx_L1_error)
12940  __Pyx_GOTREF(__pyx_tuple__17);
12941  __Pyx_GIVEREF(__pyx_tuple__17);
12942  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(14, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes2D_GL, 826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 826, __pyx_L1_error)
12943 
12944  /* "csubgridError.pyx":858
12945  * <double*> dsubgridErrorV_dp.data,
12946  * <double*> dsubgridErrorV_dv.data)
12947  * def calculateSubgridErrorStokes2D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
12948  * np.ndarray a,
12949  * np.ndarray pdeResidualU,
12950  */
12951  __pyx_tuple__19 = PyTuple_Pack(14, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 858, __pyx_L1_error)
12952  __Pyx_GOTREF(__pyx_tuple__19);
12953  __Pyx_GIVEREF(__pyx_tuple__19);
12954  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(14, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes2D_GL_2, 858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 858, __pyx_L1_error)
12955 
12956  /* "csubgridError.pyx":890
12957  * <double*> dsubgridErrorV_dp.data,
12958  * <double*> dsubgridErrorV_dv.data)
12959  * def calculateSubgridErrorStokes3D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
12960  * np.ndarray a,
12961  * np.ndarray pdeResidualU,
12962  */
12963  __pyx_tuple__21 = PyTuple_Pack(20, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 890, __pyx_L1_error)
12964  __Pyx_GOTREF(__pyx_tuple__21);
12965  __Pyx_GIVEREF(__pyx_tuple__21);
12966  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(20, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes3D_GL, 890, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 890, __pyx_L1_error)
12967 
12968  /* "csubgridError.pyx":934
12969  * <double*> dsubgridErrorW_dp.data,
12970  * <double*> dsubgridErrorW_dw.data)
12971  * def calculateSubgridErrorStokes3D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
12972  * np.ndarray a,
12973  * np.ndarray pdeResidualU,
12974  */
12975  __pyx_tuple__23 = PyTuple_Pack(20, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 934, __pyx_L1_error)
12976  __Pyx_GOTREF(__pyx_tuple__23);
12977  __Pyx_GIVEREF(__pyx_tuple__23);
12978  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(20, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes3D_GL_2, 934, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 934, __pyx_L1_error)
12979 
12980  /* "csubgridError.pyx":978
12981  * <double*> dsubgridErrorW_dp.data,
12982  * <double*> dsubgridErrorW_dw.data)
12983  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
12984  * np.ndarray a,
12985  * np.ndarray pdeResidualP,
12986  */
12987  __pyx_tuple__25 = PyTuple_Pack(20, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 978, __pyx_L1_error)
12988  __Pyx_GOTREF(__pyx_tuple__25);
12989  __Pyx_GIVEREF(__pyx_tuple__25);
12990  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(20, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes2D_GL_3, 978, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 978, __pyx_L1_error)
12991 
12992  /* "csubgridError.pyx":1022
12993  * <double*> dsubgridErrorV_dp.data,
12994  * <double*> dsubgridErrorV_dv.data)
12995  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
12996  * np.ndarray a,
12997  * np.ndarray pdeResidualP,
12998  */
12999  __pyx_tuple__27 = PyTuple_Pack(20, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1022, __pyx_L1_error)
13000  __Pyx_GOTREF(__pyx_tuple__27);
13001  __Pyx_GIVEREF(__pyx_tuple__27);
13002  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(20, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes2D_GL_4, 1022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 1022, __pyx_L1_error)
13003 
13004  /* "csubgridError.pyx":1066
13005  * <double*> dsubgridErrorV_dp.data,
13006  * <double*> dsubgridErrorV_dv.data)
13007  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13008  * np.ndarray a,
13009  * np.ndarray pdeResidualP,
13010  */
13011  __pyx_tuple__29 = PyTuple_Pack(28, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_dpdeResidualP_dw, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_dsubgridErrorP_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1066, __pyx_L1_error)
13012  __Pyx_GOTREF(__pyx_tuple__29);
13013  __Pyx_GIVEREF(__pyx_tuple__29);
13014  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(28, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes3D_GL_3, 1066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 1066, __pyx_L1_error)
13015 
13016  /* "csubgridError.pyx":1126
13017  * <double*> dsubgridErrorW_dp.data,
13018  * <double*> dsubgridErrorW_dw.data)
13019  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13020  * np.ndarray a,
13021  * np.ndarray pdeResidualP,
13022  */
13023  __pyx_tuple__31 = PyTuple_Pack(28, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_dpdeResidualP_dw, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_dsubgridErrorP_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1126, __pyx_L1_error)
13024  __Pyx_GOTREF(__pyx_tuple__31);
13025  __Pyx_GIVEREF(__pyx_tuple__31);
13026  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(28, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes3D_GL_4, 1126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 1126, __pyx_L1_error)
13027 
13028  /* "csubgridError.pyx":1186
13029  * <double*> dsubgridErrorW_dp.data,
13030  * <double*> dsubgridErrorW_dw.data)
13031  * def calculateSubgridErrorNavierStokes2D_GLS_tau(double hFactor, # <<<<<<<<<<<<<<
13032  * np.ndarray elementDiameter,
13033  * np.ndarray dmt,
13034  */
13035  __pyx_tuple__33 = PyTuple_Pack(9, __pyx_n_s_hFactor, __pyx_n_s_elementDiameter, __pyx_n_s_dmt, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_cfl); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1186, __pyx_L1_error)
13036  __Pyx_GOTREF(__pyx_tuple__33);
13037  __Pyx_GIVEREF(__pyx_tuple__33);
13038  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(9, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke, 1186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 1186, __pyx_L1_error)
13039 
13040  /* "csubgridError.pyx":1207
13041  * <double*> tau1.data,
13042  * <double*> cfl.data)
13043  * def calculateSubgridErrorNavierStokes2D_GLS_tau_sd(double hFactor, # <<<<<<<<<<<<<<
13044  * np.ndarray elementDiameter,
13045  * np.ndarray dmt,
13046  */
13047  __pyx_tuple__35 = PyTuple_Pack(9, __pyx_n_s_hFactor, __pyx_n_s_elementDiameter, __pyx_n_s_dmt, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_cfl); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1207, __pyx_L1_error)
13048  __Pyx_GOTREF(__pyx_tuple__35);
13049  __Pyx_GIVEREF(__pyx_tuple__35);
13050  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(9, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_2, 1207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 1207, __pyx_L1_error)
13051 
13052  /* "csubgridError.pyx":1228
13053  * <double*> tau1.data,
13054  * <double*> cfl.data)
13055  * def calculateSubgridErrorNavierStokes2D_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13056  * np.ndarray dmt,
13057  * np.ndarray dm,
13058  */
13059  __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_inverseJ, __pyx_n_s_dmt, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_cfl); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1228, __pyx_L1_error)
13060  __Pyx_GOTREF(__pyx_tuple__37);
13061  __Pyx_GIVEREF(__pyx_tuple__37);
13062  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_3, 1228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 1228, __pyx_L1_error)
13063 
13064  /* "csubgridError.pyx":1247
13065  * <double*> tau1.data,
13066  * <double*> cfl.data)
13067  * def calculateSubgridErrorNavierStokes2D_generic_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13068  * np.ndarray dmt,
13069  * np.ndarray dm,
13070  */
13071  __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_inverseJ, __pyx_n_s_dmt, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_cfl); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1247, __pyx_L1_error)
13072  __Pyx_GOTREF(__pyx_tuple__39);
13073  __Pyx_GIVEREF(__pyx_tuple__39);
13074  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_4, 1247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1247, __pyx_L1_error)
13075 
13076  /* "csubgridError.pyx":1266
13077  * <double*> tau1.data,
13078  * <double*> cfl.data)
13079  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13080  * np.ndarray dmt,
13081  * np.ndarray dm,
13082  */
13083  __pyx_tuple__41 = PyTuple_Pack(9, __pyx_n_s_inverseJ, __pyx_n_s_dmt, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_dr, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_cfl); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1266, __pyx_L1_error)
13084  __Pyx_GOTREF(__pyx_tuple__41);
13085  __Pyx_GIVEREF(__pyx_tuple__41);
13086  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(9, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_5, 1266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 1266, __pyx_L1_error)
13087 
13088  /* "csubgridError.pyx":1287
13089  * <double*> tau1.data,
13090  * <double*> cfl.data)
13091  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13092  * np.ndarray dmt,
13093  * np.ndarray dm,
13094  */
13095  __pyx_tuple__43 = PyTuple_Pack(9, __pyx_n_s_inverseJ, __pyx_n_s_dmt, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_dr, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_cfl); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1287, __pyx_L1_error)
13096  __Pyx_GOTREF(__pyx_tuple__43);
13097  __Pyx_GIVEREF(__pyx_tuple__43);
13098  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(9, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_6, 1287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 1287, __pyx_L1_error)
13099 
13100  /* "csubgridError.pyx":1308
13101  * <double*> tau1.data,
13102  * <double*> cfl.data)
13103  * def calculateSubgridErrorNavierStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13104  * np.ndarray tau1,
13105  * np.ndarray pdeResidualP,
13106  */
13107  __pyx_tuple__45 = PyTuple_Pack(24, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_dpdeResidualU_dv, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_du, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_dsubgridErrorU_dv, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_du, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1308, __pyx_L1_error)
13108  __Pyx_GOTREF(__pyx_tuple__45);
13109  __Pyx_GIVEREF(__pyx_tuple__45);
13110  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(24, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_7, 1308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1308, __pyx_L1_error)
13111 
13112  /* "csubgridError.pyx":1360
13113  * <double*> dsubgridErrorV_du.data,
13114  * <double*> dsubgridErrorV_dv.data)
13115  * def calculateSubgridErrorStokes_GLS_tau(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13116  * np.ndarray dH,
13117  * np.ndarray a,
13118  */
13119  __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_elementDiameter, __pyx_n_s_dH, __pyx_n_s_a, __pyx_n_s_tau0, __pyx_n_s_tau1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1360, __pyx_L1_error)
13120  __Pyx_GOTREF(__pyx_tuple__47);
13121  __Pyx_GIVEREF(__pyx_tuple__47);
13122  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes_GLS, 1360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 1360, __pyx_L1_error)
13123 
13124  /* "csubgridError.pyx":1373
13125  * <double*> tau0.data,
13126  * <double*> tau1.data)
13127  * def calculateSubgridErrorStokes_GLS_tau_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13128  * np.ndarray dH,
13129  * np.ndarray a,
13130  */
13131  __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_elementDiameter, __pyx_n_s_dH, __pyx_n_s_a, __pyx_n_s_tau0, __pyx_n_s_tau1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1373, __pyx_L1_error)
13132  __Pyx_GOTREF(__pyx_tuple__49);
13133  __Pyx_GIVEREF(__pyx_tuple__49);
13134  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes_GLS_2, 1373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 1373, __pyx_L1_error)
13135 
13136  /* "csubgridError.pyx":1386
13137  * <double*> tau0.data,
13138  * <double*> tau1.data)
13139  * def calculateSubgridErrorStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13140  * np.ndarray tau1,
13141  * np.ndarray pdeResidualP,
13142  */
13143  __pyx_tuple__51 = PyTuple_Pack(20, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1386, __pyx_L1_error)
13144  __Pyx_GOTREF(__pyx_tuple__51);
13145  __Pyx_GIVEREF(__pyx_tuple__51);
13146  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(20, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes2D_GL_5, 1386, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 1386, __pyx_L1_error)
13147 
13148  /* "csubgridError.pyx":1430
13149  * <double*> dsubgridErrorV_dp.data,
13150  * <double*> dsubgridErrorV_dv.data)
13151  * def calculateSubgridErrorStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13152  * np.ndarray tau1,
13153  * np.ndarray pdeResidualP,
13154  */
13155  __pyx_tuple__53 = PyTuple_Pack(28, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_dpdeResidualP_dw, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_dsubgridErrorP_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1430, __pyx_L1_error)
13156  __Pyx_GOTREF(__pyx_tuple__53);
13157  __Pyx_GIVEREF(__pyx_tuple__53);
13158  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(28, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes3D_GL_5, 1430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 1430, __pyx_L1_error)
13159 
13160  /* "csubgridError.pyx":1490
13161  * <double*> dsubgridErrorW_dp.data,
13162  * <double*> dsubgridErrorW_dw.data)
13163  * def calculateSubgridErrorNavierStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13164  * np.ndarray tau1,
13165  * np.ndarray pdeResidualP,
13166  */
13167  __pyx_tuple__55 = PyTuple_Pack(40, __pyx_n_s_tau0, __pyx_n_s_tau1, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_dpdeResidualP_dw, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_dpdeResidualU_dv, __pyx_n_s_dpdeResidualU_dw, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_du, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_dpdeResidualV_dw, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_du, __pyx_n_s_dpdeResidualW_dv, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_dsubgridErrorP_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_dsubgridErrorU_dv, __pyx_n_s_dsubgridErrorU_dw, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_du, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_dsubgridErrorV_dw, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_du, __pyx_n_s_dsubgridErrorW_dv, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1490, __pyx_L1_error)
13168  __Pyx_GOTREF(__pyx_tuple__55);
13169  __Pyx_GIVEREF(__pyx_tuple__55);
13170  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(40, 0, 40, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_8, 1490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 1490, __pyx_L1_error)
13171 
13172  /* "csubgridError.pyx":1574
13173  * <double*> dsubgridErrorW_dv.data,
13174  * <double*> dsubgridErrorW_dw.data)
13175  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13176  * np.ndarray dm,
13177  * np.ndarray f,
13178  */
13179  __pyx_tuple__57 = PyTuple_Pack(30, __pyx_n_s_elementDiameter, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_dpdeResidualP_dw, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_dsubgridErrorP_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1574, __pyx_L1_error)
13180  __Pyx_GOTREF(__pyx_tuple__57);
13181  __Pyx_GIVEREF(__pyx_tuple__57);
13182  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(30, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_9, 1574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 1574, __pyx_L1_error)
13183 
13184  /* "csubgridError.pyx":1638
13185  * <double*> dsubgridErrorW_dp.data,
13186  * <double*> dsubgridErrorW_dw.data)
13187  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13188  * np.ndarray dm,
13189  * np.ndarray f,
13190  */
13191  __pyx_tuple__59 = PyTuple_Pack(30, __pyx_n_s_elementDiameter, __pyx_n_s_dm, __pyx_n_s_f, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_dpdeResidualP_dw, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_pdeResidualW, __pyx_n_s_dpdeResidualW_dp, __pyx_n_s_dpdeResidualW_dw, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_dsubgridErrorP_dw, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_dv, __pyx_n_s_subgridErrorW, __pyx_n_s_dsubgridErrorW_dp, __pyx_n_s_dsubgridErrorW_dw); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1638, __pyx_L1_error)
13192  __Pyx_GOTREF(__pyx_tuple__59);
13193  __Pyx_GIVEREF(__pyx_tuple__59);
13194  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(30, 0, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorNavierStoke_10, 1638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 1638, __pyx_L1_error)
13195 
13196  /* "csubgridError.pyx":1702
13197  * <double*> dsubgridErrorW_dp.data,
13198  * <double*> dsubgridErrorW_dw.data)
13199  * def calculateSubgridErrorStokes2D_1(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13200  * np.ndarray u,
13201  * np.ndarray v,
13202  */
13203  __pyx_tuple__61 = PyTuple_Pack(25, __pyx_n_s_elementDiameter, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_dp, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_dsubgridErrorU_dv, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_du, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1702, __pyx_L1_error)
13204  __Pyx_GOTREF(__pyx_tuple__61);
13205  __Pyx_GIVEREF(__pyx_tuple__61);
13206  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(25, 0, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes2D_1, 1702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1702, __pyx_L1_error)
13207 
13208  /* "csubgridError.pyx":1756
13209  * <double*> dsubgridErrorV_du.data,
13210  * <double*> dsubgridErrorV_dv.data)
13211  * def calculateSubgridErrorStokes2D_1_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13212  * np.ndarray u,
13213  * np.ndarray v,
13214  */
13215  __pyx_tuple__63 = PyTuple_Pack(25, __pyx_n_s_elementDiameter, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_a, __pyx_n_s_pdeResidualP, __pyx_n_s_dpdeResidualP_du, __pyx_n_s_dpdeResidualP_dv, __pyx_n_s_pdeResidualU, __pyx_n_s_dpdeResidualU_dp, __pyx_n_s_dpdeResidualU_du, __pyx_n_s_pdeResidualV, __pyx_n_s_dpdeResidualV_dp, __pyx_n_s_dpdeResidualV_dv, __pyx_n_s_subgridErrorP, __pyx_n_s_dsubgridErrorP_dp, __pyx_n_s_dsubgridErrorP_du, __pyx_n_s_dsubgridErrorP_dv, __pyx_n_s_subgridErrorU, __pyx_n_s_dsubgridErrorU_dp, __pyx_n_s_dsubgridErrorU_du, __pyx_n_s_dsubgridErrorU_dv, __pyx_n_s_subgridErrorV, __pyx_n_s_dsubgridErrorV_dp, __pyx_n_s_dsubgridErrorV_du, __pyx_n_s_dsubgridErrorV_dv); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1756, __pyx_L1_error)
13216  __Pyx_GOTREF(__pyx_tuple__63);
13217  __Pyx_GIVEREF(__pyx_tuple__63);
13218  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(25, 0, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorStokes2D_1_2, 1756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1756, __pyx_L1_error)
13219 
13220  /* "csubgridError.pyx":1810
13221  * <double*> dsubgridErrorV_du.data,
13222  * <double*> dsubgridErrorV_dv.data)
13223  * def calculateSubgridErrorShallowWater1D(double g, # <<<<<<<<<<<<<<
13224  * np.ndarray elementDiameter,
13225  * np.ndarray h,
13226  */
13227  __pyx_tuple__65 = PyTuple_Pack(6, __pyx_n_s_g, __pyx_n_s_elementDiameter, __pyx_n_s_h, __pyx_n_s_hu, __pyx_n_s_cfl_1, __pyx_n_s_cfl_2); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1810, __pyx_L1_error)
13228  __Pyx_GOTREF(__pyx_tuple__65);
13229  __Pyx_GIVEREF(__pyx_tuple__65);
13230  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorShallowWate, 1810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 1810, __pyx_L1_error)
13231 
13232  /* "csubgridError.pyx":1824
13233  * <double*> cfl_1.data,
13234  * <double*> cfl_2.data)
13235  * def calculateSubgridErrorShallowWater2D(double g, # <<<<<<<<<<<<<<
13236  * np.ndarray elementDiameter,
13237  * np.ndarray h,
13238  */
13239  __pyx_tuple__67 = PyTuple_Pack(8, __pyx_n_s_g, __pyx_n_s_elementDiameter, __pyx_n_s_h, __pyx_n_s_hu, __pyx_n_s_hv, __pyx_n_s_cfl_1, __pyx_n_s_cfl_2, __pyx_n_s_cfl_3); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1824, __pyx_L1_error)
13240  __Pyx_GOTREF(__pyx_tuple__67);
13241  __Pyx_GIVEREF(__pyx_tuple__67);
13242  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorShallowWate_2, 1824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 1824, __pyx_L1_error)
13243 
13244  /* "csubgridError.pyx":1842
13245  * <double*> cfl_2.data,
13246  * <double*> cfl_3.data)
13247  * def calculateSubgridError_Harari_tau_sd(int nSpace, # <<<<<<<<<<<<<<
13248  * double dt,
13249  * np.ndarray rowptr,
13250  */
13251  __pyx_tuple__69 = PyTuple_Pack(7, __pyx_n_s_nSpace, __pyx_n_s_dt, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_elementDiameter, __pyx_n_s_a, __pyx_n_s_tau); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1842, __pyx_L1_error)
13252  __Pyx_GOTREF(__pyx_tuple__69);
13253  __Pyx_GIVEREF(__pyx_tuple__69);
13254  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_Harari_tau, 1842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1842, __pyx_L1_error)
13255 
13256  /* "csubgridError.pyx":1858
13257  * <double*> a.data,
13258  * <double*> tau.data)
13259  * def calculateSubgridErrorGradient_tauRes(np.ndarray tau_gradient, # <<<<<<<<<<<<<<
13260  * np.ndarray grad_pdeResidual,
13261  * np.ndarray grad_subgridError):
13262  */
13263  __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_tau_gradient, __pyx_n_s_grad_pdeResidual, __pyx_n_s_grad_subgridError); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1858, __pyx_L1_error)
13264  __Pyx_GOTREF(__pyx_tuple__71);
13265  __Pyx_GIVEREF(__pyx_tuple__71);
13266  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridErrorGradient_ta, 1858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1858, __pyx_L1_error)
13267 
13268  /* "csubgridError.pyx":1867
13269  * <double*> grad_pdeResidual.data,
13270  * <double*> grad_subgridError.data)
13271  * def calculateSubgridError_ADR_Sangalli_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
13272  * np.ndarray colind,
13273  * np.ndarray inverseJ,
13274  */
13275  __pyx_tuple__73 = PyTuple_Pack(14, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_inverseJ, __pyx_n_s_dmt, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_da, __pyx_n_s_grad_phi, __pyx_n_s_dphi, __pyx_n_s_dr, __pyx_n_s_pe, __pyx_n_s_cfl, __pyx_n_s_tau, __pyx_n_s_tau_gradient); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1867, __pyx_L1_error)
13276  __Pyx_GOTREF(__pyx_tuple__73);
13277  __Pyx_GIVEREF(__pyx_tuple__73);
13278  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(14, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csubgridError_pyx, __pyx_n_s_calculateSubgridError_ADR_Sangal, 1867, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1867, __pyx_L1_error)
13279  __Pyx_RefNannyFinishContext();
13280  return 0;
13281  __pyx_L1_error:;
13282  __Pyx_RefNannyFinishContext();
13283  return -1;
13284 }
13285 
13286 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
13287  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
13288  return 0;
13289  __pyx_L1_error:;
13290  return -1;
13291 }
13292 
13293 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
13294 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
13295 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
13296 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
13297 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
13298 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
13299 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
13300 
13301 static int __Pyx_modinit_global_init_code(void) {
13302  __Pyx_RefNannyDeclarations
13303  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
13304  /*--- Global init code ---*/
13305  __Pyx_RefNannyFinishContext();
13306  return 0;
13307 }
13308 
13309 static int __Pyx_modinit_variable_export_code(void) {
13310  __Pyx_RefNannyDeclarations
13311  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
13312  /*--- Variable export code ---*/
13313  __Pyx_RefNannyFinishContext();
13314  return 0;
13315 }
13316 
13317 static int __Pyx_modinit_function_export_code(void) {
13318  __Pyx_RefNannyDeclarations
13319  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
13320  /*--- Function export code ---*/
13321  __Pyx_RefNannyFinishContext();
13322  return 0;
13323 }
13324 
13325 static int __Pyx_modinit_type_init_code(void) {
13326  __Pyx_RefNannyDeclarations
13327  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
13328  /*--- Type init code ---*/
13329  __Pyx_RefNannyFinishContext();
13330  return 0;
13331 }
13332 
13333 static int __Pyx_modinit_type_import_code(void) {
13334  __Pyx_RefNannyDeclarations
13335  PyObject *__pyx_t_1 = NULL;
13336  int __pyx_lineno = 0;
13337  const char *__pyx_filename = NULL;
13338  int __pyx_clineno = 0;
13339  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
13340  /*--- Type import code ---*/
13341  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
13342  __Pyx_GOTREF(__pyx_t_1);
13343  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
13344  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
13345  sizeof(PyTypeObject),
13346  #else
13347  sizeof(PyHeapTypeObject),
13348  #endif
13349  __Pyx_ImportType_CheckSize_Warn);
13350  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
13351  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13352  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
13353  __Pyx_GOTREF(__pyx_t_1);
13354  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
13355  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
13356  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
13357  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
13358  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
13359  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
13360  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
13361  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
13362  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13363  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
13364  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13365  if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
13366  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13367  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
13368  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13369  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
13370  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13371  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
13372  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13373  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
13374  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13375  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
13376  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13377  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
13378  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13379  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
13380  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
13381  if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
13382  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
13383  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
13384  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13385  __Pyx_RefNannyFinishContext();
13386  return 0;
13387  __pyx_L1_error:;
13388  __Pyx_XDECREF(__pyx_t_1);
13389  __Pyx_RefNannyFinishContext();
13390  return -1;
13391 }
13392 
13393 static int __Pyx_modinit_variable_import_code(void) {
13394  __Pyx_RefNannyDeclarations
13395  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
13396  /*--- Variable import code ---*/
13397  __Pyx_RefNannyFinishContext();
13398  return 0;
13399 }
13400 
13401 static int __Pyx_modinit_function_import_code(void) {
13402  __Pyx_RefNannyDeclarations
13403  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
13404  /*--- Function import code ---*/
13405  __Pyx_RefNannyFinishContext();
13406  return 0;
13407 }
13408 
13409 
13410 #ifndef CYTHON_NO_PYINIT_EXPORT
13411 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
13412 #elif PY_MAJOR_VERSION < 3
13413 #ifdef __cplusplus
13414 #define __Pyx_PyMODINIT_FUNC extern "C" void
13415 #else
13416 #define __Pyx_PyMODINIT_FUNC void
13417 #endif
13418 #else
13419 #ifdef __cplusplus
13420 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
13421 #else
13422 #define __Pyx_PyMODINIT_FUNC PyObject *
13423 #endif
13424 #endif
13425 
13426 
13427 #if PY_MAJOR_VERSION < 3
13428 __Pyx_PyMODINIT_FUNC initcsubgridError(void) CYTHON_SMALL_CODE; /*proto*/
13429 __Pyx_PyMODINIT_FUNC initcsubgridError(void)
13430 #else
13431 __Pyx_PyMODINIT_FUNC PyInit_csubgridError(void) CYTHON_SMALL_CODE; /*proto*/
13432 __Pyx_PyMODINIT_FUNC PyInit_csubgridError(void)
13433 #if CYTHON_PEP489_MULTI_PHASE_INIT
13434 {
13435  return PyModuleDef_Init(&__pyx_moduledef);
13436 }
13437 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
13438  #if PY_VERSION_HEX >= 0x030700A1
13439  static PY_INT64_T main_interpreter_id = -1;
13440  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
13441  if (main_interpreter_id == -1) {
13442  main_interpreter_id = current_id;
13443  return (unlikely(current_id == -1)) ? -1 : 0;
13444  } else if (unlikely(main_interpreter_id != current_id))
13445  #else
13446  static PyInterpreterState *main_interpreter = NULL;
13447  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
13448  if (!main_interpreter) {
13449  main_interpreter = current_interpreter;
13450  } else if (unlikely(main_interpreter != current_interpreter))
13451  #endif
13452  {
13453  PyErr_SetString(
13454  PyExc_ImportError,
13455  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
13456  return -1;
13457  }
13458  return 0;
13459 }
13460 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
13461  PyObject *value = PyObject_GetAttrString(spec, from_name);
13462  int result = 0;
13463  if (likely(value)) {
13464  if (allow_none || value != Py_None) {
13465  result = PyDict_SetItemString(moddict, to_name, value);
13466  }
13467  Py_DECREF(value);
13468  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
13469  PyErr_Clear();
13470  } else {
13471  result = -1;
13472  }
13473  return result;
13474 }
13475 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
13476  PyObject *module = NULL, *moddict, *modname;
13477  if (__Pyx_check_single_interpreter())
13478  return NULL;
13479  if (__pyx_m)
13480  return __Pyx_NewRef(__pyx_m);
13481  modname = PyObject_GetAttrString(spec, "name");
13482  if (unlikely(!modname)) goto bad;
13483  module = PyModule_NewObject(modname);
13484  Py_DECREF(modname);
13485  if (unlikely(!module)) goto bad;
13486  moddict = PyModule_GetDict(module);
13487  if (unlikely(!moddict)) goto bad;
13488  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
13489  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
13490  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
13491  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
13492  return module;
13493 bad:
13494  Py_XDECREF(module);
13495  return NULL;
13496 }
13497 
13498 
13499 static CYTHON_SMALL_CODE int __pyx_pymod_exec_csubgridError(PyObject *__pyx_pyinit_module)
13500 #endif
13501 #endif
13502 {
13503  PyObject *__pyx_t_1 = NULL;
13504  int __pyx_lineno = 0;
13505  const char *__pyx_filename = NULL;
13506  int __pyx_clineno = 0;
13507  __Pyx_RefNannyDeclarations
13508  #if CYTHON_PEP489_MULTI_PHASE_INIT
13509  if (__pyx_m) {
13510  if (__pyx_m == __pyx_pyinit_module) return 0;
13511  PyErr_SetString(PyExc_RuntimeError, "Module 'csubgridError' has already been imported. Re-initialisation is not supported.");
13512  return -1;
13513  }
13514  #elif PY_MAJOR_VERSION >= 3
13515  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
13516  #endif
13517  #if CYTHON_REFNANNY
13518 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
13519 if (!__Pyx_RefNanny) {
13520  PyErr_Clear();
13521  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
13522  if (!__Pyx_RefNanny)
13523  Py_FatalError("failed to import 'refnanny' module");
13524 }
13525 #endif
13526  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_csubgridError(void)", 0);
13527  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13528  #ifdef __Pxy_PyFrame_Initialize_Offsets
13529  __Pxy_PyFrame_Initialize_Offsets();
13530  #endif
13531  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
13532  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
13533  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
13534  #ifdef __Pyx_CyFunction_USED
13535  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13536  #endif
13537  #ifdef __Pyx_FusedFunction_USED
13538  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13539  #endif
13540  #ifdef __Pyx_Coroutine_USED
13541  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13542  #endif
13543  #ifdef __Pyx_Generator_USED
13544  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13545  #endif
13546  #ifdef __Pyx_AsyncGen_USED
13547  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13548  #endif
13549  #ifdef __Pyx_StopAsyncIteration_USED
13550  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13551  #endif
13552  /*--- Library function declarations ---*/
13553  /*--- Threads initialization code ---*/
13554  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
13555  PyEval_InitThreads();
13556  #endif
13557  /*--- Module creation code ---*/
13558  #if CYTHON_PEP489_MULTI_PHASE_INIT
13559  __pyx_m = __pyx_pyinit_module;
13560  Py_INCREF(__pyx_m);
13561  #else
13562  #if PY_MAJOR_VERSION < 3
13563  __pyx_m = Py_InitModule4("csubgridError", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
13564  #else
13565  __pyx_m = PyModule_Create(&__pyx_moduledef);
13566  #endif
13567  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
13568  #endif
13569  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
13570  Py_INCREF(__pyx_d);
13571  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
13572  Py_INCREF(__pyx_b);
13573  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
13574  Py_INCREF(__pyx_cython_runtime);
13575  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
13576  /*--- Initialize various global constants etc. ---*/
13577  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13578  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
13579  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13580  #endif
13581  if (__pyx_module_is_main_csubgridError) {
13582  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13583  }
13584  #if PY_MAJOR_VERSION >= 3
13585  {
13586  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
13587  if (!PyDict_GetItemString(modules, "csubgridError")) {
13588  if (unlikely(PyDict_SetItemString(modules, "csubgridError", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
13589  }
13590  }
13591  #endif
13592  /*--- Builtin init code ---*/
13593  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13594  /*--- Constants init code ---*/
13595  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13596  /*--- Global type/function init code ---*/
13597  (void)__Pyx_modinit_global_init_code();
13598  (void)__Pyx_modinit_variable_export_code();
13599  (void)__Pyx_modinit_function_export_code();
13600  (void)__Pyx_modinit_type_init_code();
13601  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
13602  (void)__Pyx_modinit_variable_import_code();
13603  (void)__Pyx_modinit_function_import_code();
13604  /*--- Execution code ---*/
13605  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
13606  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13607  #endif
13608 
13609  /* "csubgridError.pyx":2
13610  * # A type of -*- python -*- file
13611  * import numpy as np # <<<<<<<<<<<<<<
13612  * cimport numpy as np
13613  * cdef extern from "subgridError.h":
13614  */
13615  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
13616  __Pyx_GOTREF(__pyx_t_1);
13617  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
13618  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13619 
13620  /* "csubgridError.pyx":670
13621  * double* tau,
13622  * double* tau_gradient)
13623  * def calculateSubgridError_tauRes(np.ndarray tau, # <<<<<<<<<<<<<<
13624  * np.ndarray pdeResidual,
13625  * np.ndarray dpdeResidual,
13626  */
13627  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_1calculateSubgridError_tauRes, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
13628  __Pyx_GOTREF(__pyx_t_1);
13629  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_tauRes, __pyx_t_1) < 0) __PYX_ERR(0, 670, __pyx_L1_error)
13630  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13631 
13632  /* "csubgridError.pyx":683
13633  * <double*> subgridError.data,
13634  * <double*> dsubgridError.data)
13635  * def calculateSubgridError_ADR_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13636  * np.ndarray dmt,
13637  * np.ndarray df,
13638  */
13639  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_3calculateSubgridError_ADR_generic_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
13640  __Pyx_GOTREF(__pyx_t_1);
13641  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_ADR_generi, __pyx_t_1) < 0) __PYX_ERR(0, 683, __pyx_L1_error)
13642  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13643 
13644  /* "csubgridError.pyx":708
13645  * <double*> cfl.data,
13646  * <double*> tau.data)
13647  * def calculateSubgridError_ADR_generic_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
13648  * np.ndarray colind,
13649  * np.ndarray inverseJ,
13650  */
13651  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_5calculateSubgridError_ADR_generic_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error)
13652  __Pyx_GOTREF(__pyx_t_1);
13653  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_ADR_generi_2, __pyx_t_1) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
13654  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13655 
13656  /* "csubgridError.pyx":737
13657  * <double*> cfl.data,
13658  * <double*> tau.data)
13659  * def calculateSubgridError_ADR_tau(char stabilization, # <<<<<<<<<<<<<<
13660  * np.ndarray elementDiameter,
13661  * np.ndarray dmt,
13662  */
13663  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_7calculateSubgridError_ADR_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
13664  __Pyx_GOTREF(__pyx_t_1);
13665  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_ADR_tau, __pyx_t_1) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
13666  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13667 
13668  /* "csubgridError.pyx":764
13669  * <double*> cfl.data,
13670  * <double*> tau.data)
13671  * def calculateSubgridError_ADR_tau_sd(char stabilization, # <<<<<<<<<<<<<<
13672  * np.ndarray rowptr,
13673  * np.ndarray colind,
13674  */
13675  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_9calculateSubgridError_ADR_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
13676  __Pyx_GOTREF(__pyx_t_1);
13677  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_ADR_tau_sd, __pyx_t_1) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
13678  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13679 
13680  /* "csubgridError.pyx":795
13681  * <double*> cfl.data,
13682  * <double*> tau.data)
13683  * def calculateSubgridError_A_tau(char stabilization, # <<<<<<<<<<<<<<
13684  * np.ndarray elementDiameter,
13685  * np.ndarray dmt,
13686  */
13687  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_11calculateSubgridError_A_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
13688  __Pyx_GOTREF(__pyx_t_1);
13689  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_A_tau, __pyx_t_1) < 0) __PYX_ERR(0, 795, __pyx_L1_error)
13690  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13691 
13692  /* "csubgridError.pyx":810
13693  * <double*> cfl.data,
13694  * <double*> tau.data)
13695  * def calculateSubgridError_HJ_tau(char stabilization, # <<<<<<<<<<<<<<
13696  * np.ndarray elementDiameter,
13697  * np.ndarray dmt,
13698  */
13699  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_13calculateSubgridError_HJ_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error)
13700  __Pyx_GOTREF(__pyx_t_1);
13701  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_HJ_tau, __pyx_t_1) < 0) __PYX_ERR(0, 810, __pyx_L1_error)
13702  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13703 
13704  /* "csubgridError.pyx":826
13705  * <double*> tau.data)
13706  *
13707  * def calculateSubgridErrorStokes2D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13708  * np.ndarray a,
13709  * np.ndarray pdeResidualU,
13710  */
13711  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_15calculateSubgridErrorStokes2D_GLS_velocity, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
13712  __Pyx_GOTREF(__pyx_t_1);
13713  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes2D_GL, __pyx_t_1) < 0) __PYX_ERR(0, 826, __pyx_L1_error)
13714  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13715 
13716  /* "csubgridError.pyx":858
13717  * <double*> dsubgridErrorV_dp.data,
13718  * <double*> dsubgridErrorV_dv.data)
13719  * def calculateSubgridErrorStokes2D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13720  * np.ndarray a,
13721  * np.ndarray pdeResidualU,
13722  */
13723  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_17calculateSubgridErrorStokes2D_GLS_velocity_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
13724  __Pyx_GOTREF(__pyx_t_1);
13725  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes2D_GL_2, __pyx_t_1) < 0) __PYX_ERR(0, 858, __pyx_L1_error)
13726  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13727 
13728  /* "csubgridError.pyx":890
13729  * <double*> dsubgridErrorV_dp.data,
13730  * <double*> dsubgridErrorV_dv.data)
13731  * def calculateSubgridErrorStokes3D_GLS_velocity(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13732  * np.ndarray a,
13733  * np.ndarray pdeResidualU,
13734  */
13735  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_19calculateSubgridErrorStokes3D_GLS_velocity, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
13736  __Pyx_GOTREF(__pyx_t_1);
13737  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes3D_GL, __pyx_t_1) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
13738  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13739 
13740  /* "csubgridError.pyx":934
13741  * <double*> dsubgridErrorW_dp.data,
13742  * <double*> dsubgridErrorW_dw.data)
13743  * def calculateSubgridErrorStokes3D_GLS_velocity_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13744  * np.ndarray a,
13745  * np.ndarray pdeResidualU,
13746  */
13747  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_21calculateSubgridErrorStokes3D_GLS_velocity_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error)
13748  __Pyx_GOTREF(__pyx_t_1);
13749  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes3D_GL_2, __pyx_t_1) < 0) __PYX_ERR(0, 934, __pyx_L1_error)
13750  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13751 
13752  /* "csubgridError.pyx":978
13753  * <double*> dsubgridErrorW_dp.data,
13754  * <double*> dsubgridErrorW_dw.data)
13755  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13756  * np.ndarray a,
13757  * np.ndarray pdeResidualP,
13758  */
13759  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_23calculateSubgridErrorStokes2D_GLS_velocity_pressure, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
13760  __Pyx_GOTREF(__pyx_t_1);
13761  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes2D_GL_3, __pyx_t_1) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
13762  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13763 
13764  /* "csubgridError.pyx":1022
13765  * <double*> dsubgridErrorV_dp.data,
13766  * <double*> dsubgridErrorV_dv.data)
13767  * def calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13768  * np.ndarray a,
13769  * np.ndarray pdeResidualP,
13770  */
13771  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_25calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error)
13772  __Pyx_GOTREF(__pyx_t_1);
13773  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes2D_GL_4, __pyx_t_1) < 0) __PYX_ERR(0, 1022, __pyx_L1_error)
13774  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13775 
13776  /* "csubgridError.pyx":1066
13777  * <double*> dsubgridErrorV_dp.data,
13778  * <double*> dsubgridErrorV_dv.data)
13779  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13780  * np.ndarray a,
13781  * np.ndarray pdeResidualP,
13782  */
13783  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_27calculateSubgridErrorStokes3D_GLS_velocity_pressure, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
13784  __Pyx_GOTREF(__pyx_t_1);
13785  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes3D_GL_3, __pyx_t_1) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
13786  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13787 
13788  /* "csubgridError.pyx":1126
13789  * <double*> dsubgridErrorW_dp.data,
13790  * <double*> dsubgridErrorW_dw.data)
13791  * def calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13792  * np.ndarray a,
13793  * np.ndarray pdeResidualP,
13794  */
13795  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_29calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
13796  __Pyx_GOTREF(__pyx_t_1);
13797  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes3D_GL_4, __pyx_t_1) < 0) __PYX_ERR(0, 1126, __pyx_L1_error)
13798  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13799 
13800  /* "csubgridError.pyx":1186
13801  * <double*> dsubgridErrorW_dp.data,
13802  * <double*> dsubgridErrorW_dw.data)
13803  * def calculateSubgridErrorNavierStokes2D_GLS_tau(double hFactor, # <<<<<<<<<<<<<<
13804  * np.ndarray elementDiameter,
13805  * np.ndarray dmt,
13806  */
13807  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_31calculateSubgridErrorNavierStokes2D_GLS_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error)
13808  __Pyx_GOTREF(__pyx_t_1);
13809  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke, __pyx_t_1) < 0) __PYX_ERR(0, 1186, __pyx_L1_error)
13810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13811 
13812  /* "csubgridError.pyx":1207
13813  * <double*> tau1.data,
13814  * <double*> cfl.data)
13815  * def calculateSubgridErrorNavierStokes2D_GLS_tau_sd(double hFactor, # <<<<<<<<<<<<<<
13816  * np.ndarray elementDiameter,
13817  * np.ndarray dmt,
13818  */
13819  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_33calculateSubgridErrorNavierStokes2D_GLS_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error)
13820  __Pyx_GOTREF(__pyx_t_1);
13821  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_2, __pyx_t_1) < 0) __PYX_ERR(0, 1207, __pyx_L1_error)
13822  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13823 
13824  /* "csubgridError.pyx":1228
13825  * <double*> tau1.data,
13826  * <double*> cfl.data)
13827  * def calculateSubgridErrorNavierStokes2D_generic_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13828  * np.ndarray dmt,
13829  * np.ndarray dm,
13830  */
13831  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_35calculateSubgridErrorNavierStokes2D_generic_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error)
13832  __Pyx_GOTREF(__pyx_t_1);
13833  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_3, __pyx_t_1) < 0) __PYX_ERR(0, 1228, __pyx_L1_error)
13834  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13835 
13836  /* "csubgridError.pyx":1247
13837  * <double*> tau1.data,
13838  * <double*> cfl.data)
13839  * def calculateSubgridErrorNavierStokes2D_generic_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13840  * np.ndarray dmt,
13841  * np.ndarray dm,
13842  */
13843  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_37calculateSubgridErrorNavierStokes2D_generic_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L1_error)
13844  __Pyx_GOTREF(__pyx_t_1);
13845  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_4, __pyx_t_1) < 0) __PYX_ERR(0, 1247, __pyx_L1_error)
13846  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13847 
13848  /* "csubgridError.pyx":1266
13849  * <double*> tau1.data,
13850  * <double*> cfl.data)
13851  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13852  * np.ndarray dmt,
13853  * np.ndarray dm,
13854  */
13855  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_39calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error)
13856  __Pyx_GOTREF(__pyx_t_1);
13857  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_5, __pyx_t_1) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
13858  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13859 
13860  /* "csubgridError.pyx":1287
13861  * <double*> tau1.data,
13862  * <double*> cfl.data)
13863  * def calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(np.ndarray inverseJ, # <<<<<<<<<<<<<<
13864  * np.ndarray dmt,
13865  * np.ndarray dm,
13866  */
13867  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_41calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
13868  __Pyx_GOTREF(__pyx_t_1);
13869  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_6, __pyx_t_1) < 0) __PYX_ERR(0, 1287, __pyx_L1_error)
13870  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13871 
13872  /* "csubgridError.pyx":1308
13873  * <double*> tau1.data,
13874  * <double*> cfl.data)
13875  * def calculateSubgridErrorNavierStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13876  * np.ndarray tau1,
13877  * np.ndarray pdeResidualP,
13878  */
13879  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_43calculateSubgridErrorNavierStokes2D_GLS_tauRes, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __pyx_L1_error)
13880  __Pyx_GOTREF(__pyx_t_1);
13881  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_7, __pyx_t_1) < 0) __PYX_ERR(0, 1308, __pyx_L1_error)
13882  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13883 
13884  /* "csubgridError.pyx":1360
13885  * <double*> dsubgridErrorV_du.data,
13886  * <double*> dsubgridErrorV_dv.data)
13887  * def calculateSubgridErrorStokes_GLS_tau(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13888  * np.ndarray dH,
13889  * np.ndarray a,
13890  */
13891  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_45calculateSubgridErrorStokes_GLS_tau, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error)
13892  __Pyx_GOTREF(__pyx_t_1);
13893  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes_GLS, __pyx_t_1) < 0) __PYX_ERR(0, 1360, __pyx_L1_error)
13894  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13895 
13896  /* "csubgridError.pyx":1373
13897  * <double*> tau0.data,
13898  * <double*> tau1.data)
13899  * def calculateSubgridErrorStokes_GLS_tau_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13900  * np.ndarray dH,
13901  * np.ndarray a,
13902  */
13903  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_47calculateSubgridErrorStokes_GLS_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
13904  __Pyx_GOTREF(__pyx_t_1);
13905  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes_GLS_2, __pyx_t_1) < 0) __PYX_ERR(0, 1373, __pyx_L1_error)
13906  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13907 
13908  /* "csubgridError.pyx":1386
13909  * <double*> tau0.data,
13910  * <double*> tau1.data)
13911  * def calculateSubgridErrorStokes2D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13912  * np.ndarray tau1,
13913  * np.ndarray pdeResidualP,
13914  */
13915  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_49calculateSubgridErrorStokes2D_GLS_tauRes, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
13916  __Pyx_GOTREF(__pyx_t_1);
13917  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes2D_GL_5, __pyx_t_1) < 0) __PYX_ERR(0, 1386, __pyx_L1_error)
13918  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13919 
13920  /* "csubgridError.pyx":1430
13921  * <double*> dsubgridErrorV_dp.data,
13922  * <double*> dsubgridErrorV_dv.data)
13923  * def calculateSubgridErrorStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13924  * np.ndarray tau1,
13925  * np.ndarray pdeResidualP,
13926  */
13927  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_51calculateSubgridErrorStokes3D_GLS_tauRes, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
13928  __Pyx_GOTREF(__pyx_t_1);
13929  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes3D_GL_5, __pyx_t_1) < 0) __PYX_ERR(0, 1430, __pyx_L1_error)
13930  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13931 
13932  /* "csubgridError.pyx":1490
13933  * <double*> dsubgridErrorW_dp.data,
13934  * <double*> dsubgridErrorW_dw.data)
13935  * def calculateSubgridErrorNavierStokes3D_GLS_tauRes(np.ndarray tau0, # <<<<<<<<<<<<<<
13936  * np.ndarray tau1,
13937  * np.ndarray pdeResidualP,
13938  */
13939  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_53calculateSubgridErrorNavierStokes3D_GLS_tauRes, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error)
13940  __Pyx_GOTREF(__pyx_t_1);
13941  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_8, __pyx_t_1) < 0) __PYX_ERR(0, 1490, __pyx_L1_error)
13942  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13943 
13944  /* "csubgridError.pyx":1574
13945  * <double*> dsubgridErrorW_dv.data,
13946  * <double*> dsubgridErrorW_dw.data)
13947  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13948  * np.ndarray dm,
13949  * np.ndarray f,
13950  */
13951  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_55calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
13952  __Pyx_GOTREF(__pyx_t_1);
13953  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_9, __pyx_t_1) < 0) __PYX_ERR(0, 1574, __pyx_L1_error)
13954  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13955 
13956  /* "csubgridError.pyx":1638
13957  * <double*> dsubgridErrorW_dp.data,
13958  * <double*> dsubgridErrorW_dw.data)
13959  * def calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13960  * np.ndarray dm,
13961  * np.ndarray f,
13962  */
13963  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_57calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
13964  __Pyx_GOTREF(__pyx_t_1);
13965  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorNavierStoke_10, __pyx_t_1) < 0) __PYX_ERR(0, 1638, __pyx_L1_error)
13966  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13967 
13968  /* "csubgridError.pyx":1702
13969  * <double*> dsubgridErrorW_dp.data,
13970  * <double*> dsubgridErrorW_dw.data)
13971  * def calculateSubgridErrorStokes2D_1(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13972  * np.ndarray u,
13973  * np.ndarray v,
13974  */
13975  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_59calculateSubgridErrorStokes2D_1, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1702, __pyx_L1_error)
13976  __Pyx_GOTREF(__pyx_t_1);
13977  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes2D_1, __pyx_t_1) < 0) __PYX_ERR(0, 1702, __pyx_L1_error)
13978  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13979 
13980  /* "csubgridError.pyx":1756
13981  * <double*> dsubgridErrorV_du.data,
13982  * <double*> dsubgridErrorV_dv.data)
13983  * def calculateSubgridErrorStokes2D_1_sd(np.ndarray elementDiameter, # <<<<<<<<<<<<<<
13984  * np.ndarray u,
13985  * np.ndarray v,
13986  */
13987  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_61calculateSubgridErrorStokes2D_1_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error)
13988  __Pyx_GOTREF(__pyx_t_1);
13989  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorStokes2D_1_2, __pyx_t_1) < 0) __PYX_ERR(0, 1756, __pyx_L1_error)
13990  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13991 
13992  /* "csubgridError.pyx":1810
13993  * <double*> dsubgridErrorV_du.data,
13994  * <double*> dsubgridErrorV_dv.data)
13995  * def calculateSubgridErrorShallowWater1D(double g, # <<<<<<<<<<<<<<
13996  * np.ndarray elementDiameter,
13997  * np.ndarray h,
13998  */
13999  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_63calculateSubgridErrorShallowWater1D, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1810, __pyx_L1_error)
14000  __Pyx_GOTREF(__pyx_t_1);
14001  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorShallowWate, __pyx_t_1) < 0) __PYX_ERR(0, 1810, __pyx_L1_error)
14002  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14003 
14004  /* "csubgridError.pyx":1824
14005  * <double*> cfl_1.data,
14006  * <double*> cfl_2.data)
14007  * def calculateSubgridErrorShallowWater2D(double g, # <<<<<<<<<<<<<<
14008  * np.ndarray elementDiameter,
14009  * np.ndarray h,
14010  */
14011  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_65calculateSubgridErrorShallowWater2D, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
14012  __Pyx_GOTREF(__pyx_t_1);
14013  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorShallowWate_2, __pyx_t_1) < 0) __PYX_ERR(0, 1824, __pyx_L1_error)
14014  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14015 
14016  /* "csubgridError.pyx":1842
14017  * <double*> cfl_2.data,
14018  * <double*> cfl_3.data)
14019  * def calculateSubgridError_Harari_tau_sd(int nSpace, # <<<<<<<<<<<<<<
14020  * double dt,
14021  * np.ndarray rowptr,
14022  */
14023  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_67calculateSubgridError_Harari_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
14024  __Pyx_GOTREF(__pyx_t_1);
14025  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_Harari_tau, __pyx_t_1) < 0) __PYX_ERR(0, 1842, __pyx_L1_error)
14026  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14027 
14028  /* "csubgridError.pyx":1858
14029  * <double*> a.data,
14030  * <double*> tau.data)
14031  * def calculateSubgridErrorGradient_tauRes(np.ndarray tau_gradient, # <<<<<<<<<<<<<<
14032  * np.ndarray grad_pdeResidual,
14033  * np.ndarray grad_subgridError):
14034  */
14035  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_69calculateSubgridErrorGradient_tauRes, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
14036  __Pyx_GOTREF(__pyx_t_1);
14037  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridErrorGradient_ta, __pyx_t_1) < 0) __PYX_ERR(0, 1858, __pyx_L1_error)
14038  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14039 
14040  /* "csubgridError.pyx":1867
14041  * <double*> grad_pdeResidual.data,
14042  * <double*> grad_subgridError.data)
14043  * def calculateSubgridError_ADR_Sangalli_tau_sd(np.ndarray rowptr, # <<<<<<<<<<<<<<
14044  * np.ndarray colind,
14045  * np.ndarray inverseJ,
14046  */
14047  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13csubgridError_71calculateSubgridError_ADR_Sangalli_tau_sd, NULL, __pyx_n_s_csubgridError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1867, __pyx_L1_error)
14048  __Pyx_GOTREF(__pyx_t_1);
14049  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateSubgridError_ADR_Sangal, __pyx_t_1) < 0) __PYX_ERR(0, 1867, __pyx_L1_error)
14050  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14051 
14052  /* "csubgridError.pyx":1
14053  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
14054  * import numpy as np
14055  * cimport numpy as np
14056  */
14057  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
14058  __Pyx_GOTREF(__pyx_t_1);
14059  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14060  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14061 
14062  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
14063  *
14064  *
14065  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
14066  * """
14067  * returns the unit part of the dtype for a numpy datetime64 object.
14068  */
14069 
14070  /*--- Wrapped vars code ---*/
14071 
14072  goto __pyx_L0;
14073  __pyx_L1_error:;
14074  __Pyx_XDECREF(__pyx_t_1);
14075  if (__pyx_m) {
14076  if (__pyx_d) {
14077  __Pyx_AddTraceback("init csubgridError", __pyx_clineno, __pyx_lineno, __pyx_filename);
14078  }
14079  Py_CLEAR(__pyx_m);
14080  } else if (!PyErr_Occurred()) {
14081  PyErr_SetString(PyExc_ImportError, "init csubgridError");
14082  }
14083  __pyx_L0:;
14084  __Pyx_RefNannyFinishContext();
14085  #if CYTHON_PEP489_MULTI_PHASE_INIT
14086  return (__pyx_m != NULL) ? 0 : -1;
14087  #elif PY_MAJOR_VERSION >= 3
14088  return __pyx_m;
14089  #else
14090  return;
14091  #endif
14092 }
14093 
14094 /* --- Runtime support code --- */
14095 /* Refnanny */
14096 #if CYTHON_REFNANNY
14097 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
14098  PyObject *m = NULL, *p = NULL;
14099  void *r = NULL;
14100  m = PyImport_ImportModule(modname);
14101  if (!m) goto end;
14102  p = PyObject_GetAttrString(m, "RefNannyAPI");
14103  if (!p) goto end;
14104  r = PyLong_AsVoidPtr(p);
14105 end:
14106  Py_XDECREF(p);
14107  Py_XDECREF(m);
14108  return (__Pyx_RefNannyAPIStruct *)r;
14109 }
14110 #endif
14111 
14112 /* RaiseArgTupleInvalid */
14113 static void __Pyx_RaiseArgtupleInvalid(
14114  const char* func_name,
14115  int exact,
14116  Py_ssize_t num_min,
14117  Py_ssize_t num_max,
14118  Py_ssize_t num_found)
14119 {
14120  Py_ssize_t num_expected;
14121  const char *more_or_less;
14122  if (num_found < num_min) {
14123  num_expected = num_min;
14124  more_or_less = "at least";
14125  } else {
14126  num_expected = num_max;
14127  more_or_less = "at most";
14128  }
14129  if (exact) {
14130  more_or_less = "exactly";
14131  }
14132  PyErr_Format(PyExc_TypeError,
14133  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
14134  func_name, more_or_less, num_expected,
14135  (num_expected == 1) ? "" : "s", num_found);
14136 }
14137 
14138 /* RaiseDoubleKeywords */
14139 static void __Pyx_RaiseDoubleKeywordsError(
14140  const char* func_name,
14141  PyObject* kw_name)
14142 {
14143  PyErr_Format(PyExc_TypeError,
14144  #if PY_MAJOR_VERSION >= 3
14145  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
14146  #else
14147  "%s() got multiple values for keyword argument '%s'", func_name,
14148  PyString_AsString(kw_name));
14149  #endif
14150 }
14151 
14152 /* ParseKeywords */
14153 static int __Pyx_ParseOptionalKeywords(
14154  PyObject *kwds,
14155  PyObject **argnames[],
14156  PyObject *kwds2,
14157  PyObject *values[],
14158  Py_ssize_t num_pos_args,
14159  const char* function_name)
14160 {
14161  PyObject *key = 0, *value = 0;
14162  Py_ssize_t pos = 0;
14163  PyObject*** name;
14164  PyObject*** first_kw_arg = argnames + num_pos_args;
14165  while (PyDict_Next(kwds, &pos, &key, &value)) {
14166  name = first_kw_arg;
14167  while (*name && (**name != key)) name++;
14168  if (*name) {
14169  values[name-argnames] = value;
14170  continue;
14171  }
14172  name = first_kw_arg;
14173  #if PY_MAJOR_VERSION < 3
14174  if (likely(PyString_Check(key))) {
14175  while (*name) {
14176  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
14177  && _PyString_Eq(**name, key)) {
14178  values[name-argnames] = value;
14179  break;
14180  }
14181  name++;
14182  }
14183  if (*name) continue;
14184  else {
14185  PyObject*** argname = argnames;
14186  while (argname != first_kw_arg) {
14187  if ((**argname == key) || (
14188  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
14189  && _PyString_Eq(**argname, key))) {
14190  goto arg_passed_twice;
14191  }
14192  argname++;
14193  }
14194  }
14195  } else
14196  #endif
14197  if (likely(PyUnicode_Check(key))) {
14198  while (*name) {
14199  int cmp = (**name == key) ? 0 :
14200  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
14201  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
14202  #endif
14203  PyUnicode_Compare(**name, key);
14204  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
14205  if (cmp == 0) {
14206  values[name-argnames] = value;
14207  break;
14208  }
14209  name++;
14210  }
14211  if (*name) continue;
14212  else {
14213  PyObject*** argname = argnames;
14214  while (argname != first_kw_arg) {
14215  int cmp = (**argname == key) ? 0 :
14216  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
14217  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
14218  #endif
14219  PyUnicode_Compare(**argname, key);
14220  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
14221  if (cmp == 0) goto arg_passed_twice;
14222  argname++;
14223  }
14224  }
14225  } else
14226  goto invalid_keyword_type;
14227  if (kwds2) {
14228  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
14229  } else {
14230  goto invalid_keyword;
14231  }
14232  }
14233  return 0;
14234 arg_passed_twice:
14235  __Pyx_RaiseDoubleKeywordsError(function_name, key);
14236  goto bad;
14237 invalid_keyword_type:
14238  PyErr_Format(PyExc_TypeError,
14239  "%.200s() keywords must be strings", function_name);
14240  goto bad;
14241 invalid_keyword:
14242  PyErr_Format(PyExc_TypeError,
14243  #if PY_MAJOR_VERSION < 3
14244  "%.200s() got an unexpected keyword argument '%.200s'",
14245  function_name, PyString_AsString(key));
14246  #else
14247  "%s() got an unexpected keyword argument '%U'",
14248  function_name, key);
14249  #endif
14250 bad:
14251  return -1;
14252 }
14253 
14254 /* ArgTypeTest */
14255 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
14256 {
14257  if (unlikely(!type)) {
14258  PyErr_SetString(PyExc_SystemError, "Missing type object");
14259  return 0;
14260  }
14261  else if (exact) {
14262  #if PY_MAJOR_VERSION == 2
14263  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
14264  #endif
14265  }
14266  else {
14267  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
14268  }
14269  PyErr_Format(PyExc_TypeError,
14270  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
14271  name, type->tp_name, Py_TYPE(obj)->tp_name);
14272  return 0;
14273 }
14274 
14275 /* PyObjectGetAttrStr */
14276 #if CYTHON_USE_TYPE_SLOTS
14277 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
14278  PyTypeObject* tp = Py_TYPE(obj);
14279  if (likely(tp->tp_getattro))
14280  return tp->tp_getattro(obj, attr_name);
14281 #if PY_MAJOR_VERSION < 3
14282  if (likely(tp->tp_getattr))
14283  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
14284 #endif
14285  return PyObject_GetAttr(obj, attr_name);
14286 }
14287 #endif
14288 
14289 /* GetBuiltinName */
14290 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
14291  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
14292  if (unlikely(!result)) {
14293  PyErr_Format(PyExc_NameError,
14294 #if PY_MAJOR_VERSION >= 3
14295  "name '%U' is not defined", name);
14296 #else
14297  "name '%.200s' is not defined", PyString_AS_STRING(name));
14298 #endif
14299  }
14300  return result;
14301 }
14302 
14303 /* GetTopmostException */
14304 #if CYTHON_USE_EXC_INFO_STACK
14305 static _PyErr_StackItem *
14306 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
14307 {
14308  _PyErr_StackItem *exc_info = tstate->exc_info;
14309  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
14310  exc_info->previous_item != NULL)
14311  {
14312  exc_info = exc_info->previous_item;
14313  }
14314  return exc_info;
14315 }
14316 #endif
14317 
14318 /* SaveResetException */
14319 #if CYTHON_FAST_THREAD_STATE
14320 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
14321  #if CYTHON_USE_EXC_INFO_STACK
14322  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
14323  *type = exc_info->exc_type;
14324  *value = exc_info->exc_value;
14325  *tb = exc_info->exc_traceback;
14326  #else
14327  *type = tstate->exc_type;
14328  *value = tstate->exc_value;
14329  *tb = tstate->exc_traceback;
14330  #endif
14331  Py_XINCREF(*type);
14332  Py_XINCREF(*value);
14333  Py_XINCREF(*tb);
14334 }
14335 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
14336  PyObject *tmp_type, *tmp_value, *tmp_tb;
14337  #if CYTHON_USE_EXC_INFO_STACK
14338  _PyErr_StackItem *exc_info = tstate->exc_info;
14339  tmp_type = exc_info->exc_type;
14340  tmp_value = exc_info->exc_value;
14341  tmp_tb = exc_info->exc_traceback;
14342  exc_info->exc_type = type;
14343  exc_info->exc_value = value;
14344  exc_info->exc_traceback = tb;
14345  #else
14346  tmp_type = tstate->exc_type;
14347  tmp_value = tstate->exc_value;
14348  tmp_tb = tstate->exc_traceback;
14349  tstate->exc_type = type;
14350  tstate->exc_value = value;
14351  tstate->exc_traceback = tb;
14352  #endif
14353  Py_XDECREF(tmp_type);
14354  Py_XDECREF(tmp_value);
14355  Py_XDECREF(tmp_tb);
14356 }
14357 #endif
14358 
14359 /* PyErrExceptionMatches */
14360 #if CYTHON_FAST_THREAD_STATE
14361 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
14362  Py_ssize_t i, n;
14363  n = PyTuple_GET_SIZE(tuple);
14364 #if PY_MAJOR_VERSION >= 3
14365  for (i=0; i<n; i++) {
14366  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
14367  }
14368 #endif
14369  for (i=0; i<n; i++) {
14370  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
14371  }
14372  return 0;
14373 }
14374 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
14375  PyObject *exc_type = tstate->curexc_type;
14376  if (exc_type == err) return 1;
14377  if (unlikely(!exc_type)) return 0;
14378  if (unlikely(PyTuple_Check(err)))
14379  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
14380  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
14381 }
14382 #endif
14383 
14384 /* GetException */
14385 #if CYTHON_FAST_THREAD_STATE
14386 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
14387 #else
14388 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
14389 #endif
14390 {
14391  PyObject *local_type, *local_value, *local_tb;
14392 #if CYTHON_FAST_THREAD_STATE
14393  PyObject *tmp_type, *tmp_value, *tmp_tb;
14394  local_type = tstate->curexc_type;
14395  local_value = tstate->curexc_value;
14396  local_tb = tstate->curexc_traceback;
14397  tstate->curexc_type = 0;
14398  tstate->curexc_value = 0;
14399  tstate->curexc_traceback = 0;
14400 #else
14401  PyErr_Fetch(&local_type, &local_value, &local_tb);
14402 #endif
14403  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
14404 #if CYTHON_FAST_THREAD_STATE
14405  if (unlikely(tstate->curexc_type))
14406 #else
14407  if (unlikely(PyErr_Occurred()))
14408 #endif
14409  goto bad;
14410  #if PY_MAJOR_VERSION >= 3
14411  if (local_tb) {
14412  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
14413  goto bad;
14414  }
14415  #endif
14416  Py_XINCREF(local_tb);
14417  Py_XINCREF(local_type);
14418  Py_XINCREF(local_value);
14419  *type = local_type;
14420  *value = local_value;
14421  *tb = local_tb;
14422 #if CYTHON_FAST_THREAD_STATE
14423  #if CYTHON_USE_EXC_INFO_STACK
14424  {
14425  _PyErr_StackItem *exc_info = tstate->exc_info;
14426  tmp_type = exc_info->exc_type;
14427  tmp_value = exc_info->exc_value;
14428  tmp_tb = exc_info->exc_traceback;
14429  exc_info->exc_type = local_type;
14430  exc_info->exc_value = local_value;
14431  exc_info->exc_traceback = local_tb;
14432  }
14433  #else
14434  tmp_type = tstate->exc_type;
14435  tmp_value = tstate->exc_value;
14436  tmp_tb = tstate->exc_traceback;
14437  tstate->exc_type = local_type;
14438  tstate->exc_value = local_value;
14439  tstate->exc_traceback = local_tb;
14440  #endif
14441  Py_XDECREF(tmp_type);
14442  Py_XDECREF(tmp_value);
14443  Py_XDECREF(tmp_tb);
14444 #else
14445  PyErr_SetExcInfo(local_type, local_value, local_tb);
14446 #endif
14447  return 0;
14448 bad:
14449  *type = 0;
14450  *value = 0;
14451  *tb = 0;
14452  Py_XDECREF(local_type);
14453  Py_XDECREF(local_value);
14454  Py_XDECREF(local_tb);
14455  return -1;
14456 }
14457 
14458 /* PyObjectCall */
14459 #if CYTHON_COMPILING_IN_CPYTHON
14460 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
14461  PyObject *result;
14462  ternaryfunc call = Py_TYPE(func)->tp_call;
14463  if (unlikely(!call))
14464  return PyObject_Call(func, arg, kw);
14465  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
14466  return NULL;
14467  result = (*call)(func, arg, kw);
14468  Py_LeaveRecursiveCall();
14469  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
14470  PyErr_SetString(
14471  PyExc_SystemError,
14472  "NULL result without error in PyObject_Call");
14473  }
14474  return result;
14475 }
14476 #endif
14477 
14478 /* PyErrFetchRestore */
14479 #if CYTHON_FAST_THREAD_STATE
14480 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
14481  PyObject *tmp_type, *tmp_value, *tmp_tb;
14482  tmp_type = tstate->curexc_type;
14483  tmp_value = tstate->curexc_value;
14484  tmp_tb = tstate->curexc_traceback;
14485  tstate->curexc_type = type;
14486  tstate->curexc_value = value;
14487  tstate->curexc_traceback = tb;
14488  Py_XDECREF(tmp_type);
14489  Py_XDECREF(tmp_value);
14490  Py_XDECREF(tmp_tb);
14491 }
14492 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
14493  *type = tstate->curexc_type;
14494  *value = tstate->curexc_value;
14495  *tb = tstate->curexc_traceback;
14496  tstate->curexc_type = 0;
14497  tstate->curexc_value = 0;
14498  tstate->curexc_traceback = 0;
14499 }
14500 #endif
14501 
14502 /* RaiseException */
14503 #if PY_MAJOR_VERSION < 3
14504 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
14505  CYTHON_UNUSED PyObject *cause) {
14506  __Pyx_PyThreadState_declare
14507  Py_XINCREF(type);
14508  if (!value || value == Py_None)
14509  value = NULL;
14510  else
14511  Py_INCREF(value);
14512  if (!tb || tb == Py_None)
14513  tb = NULL;
14514  else {
14515  Py_INCREF(tb);
14516  if (!PyTraceBack_Check(tb)) {
14517  PyErr_SetString(PyExc_TypeError,
14518  "raise: arg 3 must be a traceback or None");
14519  goto raise_error;
14520  }
14521  }
14522  if (PyType_Check(type)) {
14523 #if CYTHON_COMPILING_IN_PYPY
14524  if (!value) {
14525  Py_INCREF(Py_None);
14526  value = Py_None;
14527  }
14528 #endif
14529  PyErr_NormalizeException(&type, &value, &tb);
14530  } else {
14531  if (value) {
14532  PyErr_SetString(PyExc_TypeError,
14533  "instance exception may not have a separate value");
14534  goto raise_error;
14535  }
14536  value = type;
14537  type = (PyObject*) Py_TYPE(type);
14538  Py_INCREF(type);
14539  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
14540  PyErr_SetString(PyExc_TypeError,
14541  "raise: exception class must be a subclass of BaseException");
14542  goto raise_error;
14543  }
14544  }
14545  __Pyx_PyThreadState_assign
14546  __Pyx_ErrRestore(type, value, tb);
14547  return;
14548 raise_error:
14549  Py_XDECREF(value);
14550  Py_XDECREF(type);
14551  Py_XDECREF(tb);
14552  return;
14553 }
14554 #else
14555 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
14556  PyObject* owned_instance = NULL;
14557  if (tb == Py_None) {
14558  tb = 0;
14559  } else if (tb && !PyTraceBack_Check(tb)) {
14560  PyErr_SetString(PyExc_TypeError,
14561  "raise: arg 3 must be a traceback or None");
14562  goto bad;
14563  }
14564  if (value == Py_None)
14565  value = 0;
14566  if (PyExceptionInstance_Check(type)) {
14567  if (value) {
14568  PyErr_SetString(PyExc_TypeError,
14569  "instance exception may not have a separate value");
14570  goto bad;
14571  }
14572  value = type;
14573  type = (PyObject*) Py_TYPE(value);
14574  } else if (PyExceptionClass_Check(type)) {
14575  PyObject *instance_class = NULL;
14576  if (value && PyExceptionInstance_Check(value)) {
14577  instance_class = (PyObject*) Py_TYPE(value);
14578  if (instance_class != type) {
14579  int is_subclass = PyObject_IsSubclass(instance_class, type);
14580  if (!is_subclass) {
14581  instance_class = NULL;
14582  } else if (unlikely(is_subclass == -1)) {
14583  goto bad;
14584  } else {
14585  type = instance_class;
14586  }
14587  }
14588  }
14589  if (!instance_class) {
14590  PyObject *args;
14591  if (!value)
14592  args = PyTuple_New(0);
14593  else if (PyTuple_Check(value)) {
14594  Py_INCREF(value);
14595  args = value;
14596  } else
14597  args = PyTuple_Pack(1, value);
14598  if (!args)
14599  goto bad;
14600  owned_instance = PyObject_Call(type, args, NULL);
14601  Py_DECREF(args);
14602  if (!owned_instance)
14603  goto bad;
14604  value = owned_instance;
14605  if (!PyExceptionInstance_Check(value)) {
14606  PyErr_Format(PyExc_TypeError,
14607  "calling %R should have returned an instance of "
14608  "BaseException, not %R",
14609  type, Py_TYPE(value));
14610  goto bad;
14611  }
14612  }
14613  } else {
14614  PyErr_SetString(PyExc_TypeError,
14615  "raise: exception class must be a subclass of BaseException");
14616  goto bad;
14617  }
14618  if (cause) {
14619  PyObject *fixed_cause;
14620  if (cause == Py_None) {
14621  fixed_cause = NULL;
14622  } else if (PyExceptionClass_Check(cause)) {
14623  fixed_cause = PyObject_CallObject(cause, NULL);
14624  if (fixed_cause == NULL)
14625  goto bad;
14626  } else if (PyExceptionInstance_Check(cause)) {
14627  fixed_cause = cause;
14628  Py_INCREF(fixed_cause);
14629  } else {
14630  PyErr_SetString(PyExc_TypeError,
14631  "exception causes must derive from "
14632  "BaseException");
14633  goto bad;
14634  }
14635  PyException_SetCause(value, fixed_cause);
14636  }
14637  PyErr_SetObject(type, value);
14638  if (tb) {
14639 #if CYTHON_COMPILING_IN_PYPY
14640  PyObject *tmp_type, *tmp_value, *tmp_tb;
14641  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
14642  Py_INCREF(tb);
14643  PyErr_Restore(tmp_type, tmp_value, tb);
14644  Py_XDECREF(tmp_tb);
14645 #else
14646  PyThreadState *tstate = __Pyx_PyThreadState_Current;
14647  PyObject* tmp_tb = tstate->curexc_traceback;
14648  if (tb != tmp_tb) {
14649  Py_INCREF(tb);
14650  tstate->curexc_traceback = tb;
14651  Py_XDECREF(tmp_tb);
14652  }
14653 #endif
14654  }
14655 bad:
14656  Py_XDECREF(owned_instance);
14657  return;
14658 }
14659 #endif
14660 
14661 /* TypeImport */
14662 #ifndef __PYX_HAVE_RT_ImportType
14663 #define __PYX_HAVE_RT_ImportType
14664 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
14665  size_t size, enum __Pyx_ImportType_CheckSize check_size)
14666 {
14667  PyObject *result = 0;
14668  char warning[200];
14669  Py_ssize_t basicsize;
14670 #ifdef Py_LIMITED_API
14671  PyObject *py_basicsize;
14672 #endif
14673  result = PyObject_GetAttrString(module, class_name);
14674  if (!result)
14675  goto bad;
14676  if (!PyType_Check(result)) {
14677  PyErr_Format(PyExc_TypeError,
14678  "%.200s.%.200s is not a type object",
14679  module_name, class_name);
14680  goto bad;
14681  }
14682 #ifndef Py_LIMITED_API
14683  basicsize = ((PyTypeObject *)result)->tp_basicsize;
14684 #else
14685  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
14686  if (!py_basicsize)
14687  goto bad;
14688  basicsize = PyLong_AsSsize_t(py_basicsize);
14689  Py_DECREF(py_basicsize);
14690  py_basicsize = 0;
14691  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
14692  goto bad;
14693 #endif
14694  if ((size_t)basicsize < size) {
14695  PyErr_Format(PyExc_ValueError,
14696  "%.200s.%.200s size changed, may indicate binary incompatibility. "
14697  "Expected %zd from C header, got %zd from PyObject",
14698  module_name, class_name, size, basicsize);
14699  goto bad;
14700  }
14701  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
14702  PyErr_Format(PyExc_ValueError,
14703  "%.200s.%.200s size changed, may indicate binary incompatibility. "
14704  "Expected %zd from C header, got %zd from PyObject",
14705  module_name, class_name, size, basicsize);
14706  goto bad;
14707  }
14708  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
14709  PyOS_snprintf(warning, sizeof(warning),
14710  "%s.%s size changed, may indicate binary incompatibility. "
14711  "Expected %zd from C header, got %zd from PyObject",
14712  module_name, class_name, size, basicsize);
14713  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
14714  }
14715  return (PyTypeObject *)result;
14716 bad:
14717  Py_XDECREF(result);
14718  return NULL;
14719 }
14720 #endif
14721 
14722 /* Import */
14723 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
14724  PyObject *empty_list = 0;
14725  PyObject *module = 0;
14726  PyObject *global_dict = 0;
14727  PyObject *empty_dict = 0;
14728  PyObject *list;
14729  #if PY_MAJOR_VERSION < 3
14730  PyObject *py_import;
14731  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
14732  if (!py_import)
14733  goto bad;
14734  #endif
14735  if (from_list)
14736  list = from_list;
14737  else {
14738  empty_list = PyList_New(0);
14739  if (!empty_list)
14740  goto bad;
14741  list = empty_list;
14742  }
14743  global_dict = PyModule_GetDict(__pyx_m);
14744  if (!global_dict)
14745  goto bad;
14746  empty_dict = PyDict_New();
14747  if (!empty_dict)
14748  goto bad;
14749  {
14750  #if PY_MAJOR_VERSION >= 3
14751  if (level == -1) {
14752  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
14753  module = PyImport_ImportModuleLevelObject(
14754  name, global_dict, empty_dict, list, 1);
14755  if (!module) {
14756  if (!PyErr_ExceptionMatches(PyExc_ImportError))
14757  goto bad;
14758  PyErr_Clear();
14759  }
14760  }
14761  level = 0;
14762  }
14763  #endif
14764  if (!module) {
14765  #if PY_MAJOR_VERSION < 3
14766  PyObject *py_level = PyInt_FromLong(level);
14767  if (!py_level)
14768  goto bad;
14769  module = PyObject_CallFunctionObjArgs(py_import,
14770  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
14771  Py_DECREF(py_level);
14772  #else
14773  module = PyImport_ImportModuleLevelObject(
14774  name, global_dict, empty_dict, list, level);
14775  #endif
14776  }
14777  }
14778 bad:
14779  #if PY_MAJOR_VERSION < 3
14780  Py_XDECREF(py_import);
14781  #endif
14782  Py_XDECREF(empty_list);
14783  Py_XDECREF(empty_dict);
14784  return module;
14785 }
14786 
14787 /* PyDictVersioning */
14788 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
14789 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
14790  PyObject *dict = Py_TYPE(obj)->tp_dict;
14791  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
14792 }
14793 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
14794  PyObject **dictptr = NULL;
14795  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
14796  if (offset) {
14797 #if CYTHON_COMPILING_IN_CPYTHON
14798  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
14799 #else
14800  dictptr = _PyObject_GetDictPtr(obj);
14801 #endif
14802  }
14803  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
14804 }
14805 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
14806  PyObject *dict = Py_TYPE(obj)->tp_dict;
14807  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
14808  return 0;
14809  return obj_dict_version == __Pyx_get_object_dict_version(obj);
14810 }
14811 #endif
14812 
14813 /* CLineInTraceback */
14814 #ifndef CYTHON_CLINE_IN_TRACEBACK
14815 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
14816  PyObject *use_cline;
14817  PyObject *ptype, *pvalue, *ptraceback;
14818 #if CYTHON_COMPILING_IN_CPYTHON
14819  PyObject **cython_runtime_dict;
14820 #endif
14821  if (unlikely(!__pyx_cython_runtime)) {
14822  return c_line;
14823  }
14824  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
14825 #if CYTHON_COMPILING_IN_CPYTHON
14826  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
14827  if (likely(cython_runtime_dict)) {
14828  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
14829  use_cline, *cython_runtime_dict,
14830  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
14831  } else
14832 #endif
14833  {
14834  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
14835  if (use_cline_obj) {
14836  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
14837  Py_DECREF(use_cline_obj);
14838  } else {
14839  PyErr_Clear();
14840  use_cline = NULL;
14841  }
14842  }
14843  if (!use_cline) {
14844  c_line = 0;
14845  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
14846  }
14847  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
14848  c_line = 0;
14849  }
14850  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
14851  return c_line;
14852 }
14853 #endif
14854 
14855 /* CodeObjectCache */
14856 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
14857  int start = 0, mid = 0, end = count - 1;
14858  if (end >= 0 && code_line > entries[end].code_line) {
14859  return count;
14860  }
14861  while (start < end) {
14862  mid = start + (end - start) / 2;
14863  if (code_line < entries[mid].code_line) {
14864  end = mid;
14865  } else if (code_line > entries[mid].code_line) {
14866  start = mid + 1;
14867  } else {
14868  return mid;
14869  }
14870  }
14871  if (code_line <= entries[mid].code_line) {
14872  return mid;
14873  } else {
14874  return mid + 1;
14875  }
14876 }
14877 static PyCodeObject *__pyx_find_code_object(int code_line) {
14878  PyCodeObject* code_object;
14879  int pos;
14880  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
14881  return NULL;
14882  }
14883  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
14884  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
14885  return NULL;
14886  }
14887  code_object = __pyx_code_cache.entries[pos].code_object;
14888  Py_INCREF(code_object);
14889  return code_object;
14890 }
14891 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
14892  int pos, i;
14893  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
14894  if (unlikely(!code_line)) {
14895  return;
14896  }
14897  if (unlikely(!entries)) {
14898  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
14899  if (likely(entries)) {
14900  __pyx_code_cache.entries = entries;
14901  __pyx_code_cache.max_count = 64;
14902  __pyx_code_cache.count = 1;
14903  entries[0].code_line = code_line;
14904  entries[0].code_object = code_object;
14905  Py_INCREF(code_object);
14906  }
14907  return;
14908  }
14909  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
14910  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
14911  PyCodeObject* tmp = entries[pos].code_object;
14912  entries[pos].code_object = code_object;
14913  Py_DECREF(tmp);
14914  return;
14915  }
14916  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
14917  int new_max = __pyx_code_cache.max_count + 64;
14918  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
14919  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
14920  if (unlikely(!entries)) {
14921  return;
14922  }
14923  __pyx_code_cache.entries = entries;
14924  __pyx_code_cache.max_count = new_max;
14925  }
14926  for (i=__pyx_code_cache.count; i>pos; i--) {
14927  entries[i] = entries[i-1];
14928  }
14929  entries[pos].code_line = code_line;
14930  entries[pos].code_object = code_object;
14931  __pyx_code_cache.count++;
14932  Py_INCREF(code_object);
14933 }
14934 
14935 /* AddTraceback */
14936 #include "compile.h"
14937 #include "frameobject.h"
14938 #include "traceback.h"
14939 #if PY_VERSION_HEX >= 0x030b00a6
14940  #ifndef Py_BUILD_CORE
14941  #define Py_BUILD_CORE 1
14942  #endif
14943  #include "internal/pycore_frame.h"
14944 #endif
14945 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
14946  const char *funcname, int c_line,
14947  int py_line, const char *filename) {
14948  PyCodeObject *py_code = NULL;
14949  PyObject *py_funcname = NULL;
14950  #if PY_MAJOR_VERSION < 3
14951  PyObject *py_srcfile = NULL;
14952  py_srcfile = PyString_FromString(filename);
14953  if (!py_srcfile) goto bad;
14954  #endif
14955  if (c_line) {
14956  #if PY_MAJOR_VERSION < 3
14957  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14958  if (!py_funcname) goto bad;
14959  #else
14960  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14961  if (!py_funcname) goto bad;
14962  funcname = PyUnicode_AsUTF8(py_funcname);
14963  if (!funcname) goto bad;
14964  #endif
14965  }
14966  else {
14967  #if PY_MAJOR_VERSION < 3
14968  py_funcname = PyString_FromString(funcname);
14969  if (!py_funcname) goto bad;
14970  #endif
14971  }
14972  #if PY_MAJOR_VERSION < 3
14973  py_code = __Pyx_PyCode_New(
14974  0,
14975  0,
14976  0,
14977  0,
14978  0,
14979  __pyx_empty_bytes, /*PyObject *code,*/
14980  __pyx_empty_tuple, /*PyObject *consts,*/
14981  __pyx_empty_tuple, /*PyObject *names,*/
14982  __pyx_empty_tuple, /*PyObject *varnames,*/
14983  __pyx_empty_tuple, /*PyObject *freevars,*/
14984  __pyx_empty_tuple, /*PyObject *cellvars,*/
14985  py_srcfile, /*PyObject *filename,*/
14986  py_funcname, /*PyObject *name,*/
14987  py_line,
14988  __pyx_empty_bytes /*PyObject *lnotab*/
14989  );
14990  Py_DECREF(py_srcfile);
14991  #else
14992  py_code = PyCode_NewEmpty(filename, funcname, py_line);
14993  #endif
14994  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
14995  return py_code;
14996 bad:
14997  Py_XDECREF(py_funcname);
14998  #if PY_MAJOR_VERSION < 3
14999  Py_XDECREF(py_srcfile);
15000  #endif
15001  return NULL;
15002 }
15003 static void __Pyx_AddTraceback(const char *funcname, int c_line,
15004  int py_line, const char *filename) {
15005  PyCodeObject *py_code = 0;
15006  PyFrameObject *py_frame = 0;
15007  PyThreadState *tstate = __Pyx_PyThreadState_Current;
15008  PyObject *ptype, *pvalue, *ptraceback;
15009  if (c_line) {
15010  c_line = __Pyx_CLineForTraceback(tstate, c_line);
15011  }
15012  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
15013  if (!py_code) {
15014  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
15015  py_code = __Pyx_CreateCodeObjectForTraceback(
15016  funcname, c_line, py_line, filename);
15017  if (!py_code) {
15018  /* If the code object creation fails, then we should clear the
15019  fetched exception references and propagate the new exception */
15020  Py_XDECREF(ptype);
15021  Py_XDECREF(pvalue);
15022  Py_XDECREF(ptraceback);
15023  goto bad;
15024  }
15025  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
15026  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
15027  }
15028  py_frame = PyFrame_New(
15029  tstate, /*PyThreadState *tstate,*/
15030  py_code, /*PyCodeObject *code,*/
15031  __pyx_d, /*PyObject *globals,*/
15032  0 /*PyObject *locals*/
15033  );
15034  if (!py_frame) goto bad;
15035  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
15036  PyTraceBack_Here(py_frame);
15037 bad:
15038  Py_XDECREF(py_code);
15039  Py_XDECREF(py_frame);
15040 }
15041 
15042 /* CIntFromPyVerify */
15043 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
15044  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
15045 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
15046  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
15047 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
15048  {\
15049  func_type value = func_value;\
15050  if (sizeof(target_type) < sizeof(func_type)) {\
15051  if (unlikely(value != (func_type) (target_type) value)) {\
15052  func_type zero = 0;\
15053  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
15054  return (target_type) -1;\
15055  if (is_unsigned && unlikely(value < zero))\
15056  goto raise_neg_overflow;\
15057  else\
15058  goto raise_overflow;\
15059  }\
15060  }\
15061  return (target_type) value;\
15062  }
15063 
15064 /* Declarations */
15065 #if CYTHON_CCOMPLEX
15066  #ifdef __cplusplus
15067  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
15068  return ::std::complex< float >(x, y);
15069  }
15070  #else
15071  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
15072  return x + y*(__pyx_t_float_complex)_Complex_I;
15073  }
15074  #endif
15075 #else
15076  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
15077  __pyx_t_float_complex z;
15078  z.real = x;
15079  z.imag = y;
15080  return z;
15081  }
15082 #endif
15083 
15084 /* Arithmetic */
15085 #if CYTHON_CCOMPLEX
15086 #else
15087  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
15088  return (a.real == b.real) && (a.imag == b.imag);
15089  }
15090  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
15091  __pyx_t_float_complex z;
15092  z.real = a.real + b.real;
15093  z.imag = a.imag + b.imag;
15094  return z;
15095  }
15096  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
15097  __pyx_t_float_complex z;
15098  z.real = a.real - b.real;
15099  z.imag = a.imag - b.imag;
15100  return z;
15101  }
15102  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
15103  __pyx_t_float_complex z;
15104  z.real = a.real * b.real - a.imag * b.imag;
15105  z.imag = a.real * b.imag + a.imag * b.real;
15106  return z;
15107  }
15108  #if 1
15109  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
15110  if (b.imag == 0) {
15111  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
15112  } else if (fabsf(b.real) >= fabsf(b.imag)) {
15113  if (b.real == 0 && b.imag == 0) {
15114  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
15115  } else {
15116  float r = b.imag / b.real;
15117  float s = (float)(1.0) / (b.real + b.imag * r);
15118  return __pyx_t_float_complex_from_parts(
15119  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
15120  }
15121  } else {
15122  float r = b.real / b.imag;
15123  float s = (float)(1.0) / (b.imag + b.real * r);
15124  return __pyx_t_float_complex_from_parts(
15125  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
15126  }
15127  }
15128  #else
15129  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
15130  if (b.imag == 0) {
15131  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
15132  } else {
15133  float denom = b.real * b.real + b.imag * b.imag;
15134  return __pyx_t_float_complex_from_parts(
15135  (a.real * b.real + a.imag * b.imag) / denom,
15136  (a.imag * b.real - a.real * b.imag) / denom);
15137  }
15138  }
15139  #endif
15140  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
15141  __pyx_t_float_complex z;
15142  z.real = -a.real;
15143  z.imag = -a.imag;
15144  return z;
15145  }
15146  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
15147  return (a.real == 0) && (a.imag == 0);
15148  }
15149  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
15150  __pyx_t_float_complex z;
15151  z.real = a.real;
15152  z.imag = -a.imag;
15153  return z;
15154  }
15155  #if 1
15156  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
15157  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
15158  return sqrtf(z.real*z.real + z.imag*z.imag);
15159  #else
15160  return hypotf(z.real, z.imag);
15161  #endif
15162  }
15163  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
15164  __pyx_t_float_complex z;
15165  float r, lnr, theta, z_r, z_theta;
15166  if (b.imag == 0 && b.real == (int)b.real) {
15167  if (b.real < 0) {
15168  float denom = a.real * a.real + a.imag * a.imag;
15169  a.real = a.real / denom;
15170  a.imag = -a.imag / denom;
15171  b.real = -b.real;
15172  }
15173  switch ((int)b.real) {
15174  case 0:
15175  z.real = 1;
15176  z.imag = 0;
15177  return z;
15178  case 1:
15179  return a;
15180  case 2:
15181  return __Pyx_c_prod_float(a, a);
15182  case 3:
15183  z = __Pyx_c_prod_float(a, a);
15184  return __Pyx_c_prod_float(z, a);
15185  case 4:
15186  z = __Pyx_c_prod_float(a, a);
15187  return __Pyx_c_prod_float(z, z);
15188  }
15189  }
15190  if (a.imag == 0) {
15191  if (a.real == 0) {
15192  return a;
15193  } else if (b.imag == 0) {
15194  z.real = powf(a.real, b.real);
15195  z.imag = 0;
15196  return z;
15197  } else if (a.real > 0) {
15198  r = a.real;
15199  theta = 0;
15200  } else {
15201  r = -a.real;
15202  theta = atan2f(0.0, -1.0);
15203  }
15204  } else {
15205  r = __Pyx_c_abs_float(a);
15206  theta = atan2f(a.imag, a.real);
15207  }
15208  lnr = logf(r);
15209  z_r = expf(lnr * b.real - theta * b.imag);
15210  z_theta = theta * b.real + lnr * b.imag;
15211  z.real = z_r * cosf(z_theta);
15212  z.imag = z_r * sinf(z_theta);
15213  return z;
15214  }
15215  #endif
15216 #endif
15217 
15218 /* Declarations */
15219 #if CYTHON_CCOMPLEX
15220  #ifdef __cplusplus
15221  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
15222  return ::std::complex< double >(x, y);
15223  }
15224  #else
15225  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
15226  return x + y*(__pyx_t_double_complex)_Complex_I;
15227  }
15228  #endif
15229 #else
15230  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
15231  __pyx_t_double_complex z;
15232  z.real = x;
15233  z.imag = y;
15234  return z;
15235  }
15236 #endif
15237 
15238 /* Arithmetic */
15239 #if CYTHON_CCOMPLEX
15240 #else
15241  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
15242  return (a.real == b.real) && (a.imag == b.imag);
15243  }
15244  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
15245  __pyx_t_double_complex z;
15246  z.real = a.real + b.real;
15247  z.imag = a.imag + b.imag;
15248  return z;
15249  }
15250  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
15251  __pyx_t_double_complex z;
15252  z.real = a.real - b.real;
15253  z.imag = a.imag - b.imag;
15254  return z;
15255  }
15256  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
15257  __pyx_t_double_complex z;
15258  z.real = a.real * b.real - a.imag * b.imag;
15259  z.imag = a.real * b.imag + a.imag * b.real;
15260  return z;
15261  }
15262  #if 1
15263  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
15264  if (b.imag == 0) {
15265  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
15266  } else if (fabs(b.real) >= fabs(b.imag)) {
15267  if (b.real == 0 && b.imag == 0) {
15268  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
15269  } else {
15270  double r = b.imag / b.real;
15271  double s = (double)(1.0) / (b.real + b.imag * r);
15272  return __pyx_t_double_complex_from_parts(
15273  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
15274  }
15275  } else {
15276  double r = b.real / b.imag;
15277  double s = (double)(1.0) / (b.imag + b.real * r);
15278  return __pyx_t_double_complex_from_parts(
15279  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
15280  }
15281  }
15282  #else
15283  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
15284  if (b.imag == 0) {
15285  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
15286  } else {
15287  double denom = b.real * b.real + b.imag * b.imag;
15288  return __pyx_t_double_complex_from_parts(
15289  (a.real * b.real + a.imag * b.imag) / denom,
15290  (a.imag * b.real - a.real * b.imag) / denom);
15291  }
15292  }
15293  #endif
15294  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
15295  __pyx_t_double_complex z;
15296  z.real = -a.real;
15297  z.imag = -a.imag;
15298  return z;
15299  }
15300  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
15301  return (a.real == 0) && (a.imag == 0);
15302  }
15303  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
15304  __pyx_t_double_complex z;
15305  z.real = a.real;
15306  z.imag = -a.imag;
15307  return z;
15308  }
15309  #if 1
15310  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
15311  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
15312  return sqrt(z.real*z.real + z.imag*z.imag);
15313  #else
15314  return hypot(z.real, z.imag);
15315  #endif
15316  }
15317  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
15318  __pyx_t_double_complex z;
15319  double r, lnr, theta, z_r, z_theta;
15320  if (b.imag == 0 && b.real == (int)b.real) {
15321  if (b.real < 0) {
15322  double denom = a.real * a.real + a.imag * a.imag;
15323  a.real = a.real / denom;
15324  a.imag = -a.imag / denom;
15325  b.real = -b.real;
15326  }
15327  switch ((int)b.real) {
15328  case 0:
15329  z.real = 1;
15330  z.imag = 0;
15331  return z;
15332  case 1:
15333  return a;
15334  case 2:
15335  return __Pyx_c_prod_double(a, a);
15336  case 3:
15337  z = __Pyx_c_prod_double(a, a);
15338  return __Pyx_c_prod_double(z, a);
15339  case 4:
15340  z = __Pyx_c_prod_double(a, a);
15341  return __Pyx_c_prod_double(z, z);
15342  }
15343  }
15344  if (a.imag == 0) {
15345  if (a.real == 0) {
15346  return a;
15347  } else if (b.imag == 0) {
15348  z.real = pow(a.real, b.real);
15349  z.imag = 0;
15350  return z;
15351  } else if (a.real > 0) {
15352  r = a.real;
15353  theta = 0;
15354  } else {
15355  r = -a.real;
15356  theta = atan2(0.0, -1.0);
15357  }
15358  } else {
15359  r = __Pyx_c_abs_double(a);
15360  theta = atan2(a.imag, a.real);
15361  }
15362  lnr = log(r);
15363  z_r = exp(lnr * b.real - theta * b.imag);
15364  z_theta = theta * b.real + lnr * b.imag;
15365  z.real = z_r * cos(z_theta);
15366  z.imag = z_r * sin(z_theta);
15367  return z;
15368  }
15369  #endif
15370 #endif
15371 
15372 /* CIntFromPy */
15373 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
15374 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15375 #pragma GCC diagnostic push
15376 #pragma GCC diagnostic ignored "-Wconversion"
15377 #endif
15378  const char neg_one = (char) -1, const_zero = (char) 0;
15379 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15380 #pragma GCC diagnostic pop
15381 #endif
15382  const int is_unsigned = neg_one > const_zero;
15383 #if PY_MAJOR_VERSION < 3
15384  if (likely(PyInt_Check(x))) {
15385  if (sizeof(char) < sizeof(long)) {
15386  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
15387  } else {
15388  long val = PyInt_AS_LONG(x);
15389  if (is_unsigned && unlikely(val < 0)) {
15390  goto raise_neg_overflow;
15391  }
15392  return (char) val;
15393  }
15394  } else
15395 #endif
15396  if (likely(PyLong_Check(x))) {
15397  if (is_unsigned) {
15398 #if CYTHON_USE_PYLONG_INTERNALS
15399  const digit* digits = ((PyLongObject*)x)->ob_digit;
15400  switch (Py_SIZE(x)) {
15401  case 0: return (char) 0;
15402  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
15403  case 2:
15404  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
15405  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15406  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15407  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
15408  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
15409  }
15410  }
15411  break;
15412  case 3:
15413  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
15414  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15415  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15416  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
15417  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
15418  }
15419  }
15420  break;
15421  case 4:
15422  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
15423  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15424  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15425  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
15426  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
15427  }
15428  }
15429  break;
15430  }
15431 #endif
15432 #if CYTHON_COMPILING_IN_CPYTHON
15433  if (unlikely(Py_SIZE(x) < 0)) {
15434  goto raise_neg_overflow;
15435  }
15436 #else
15437  {
15438  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
15439  if (unlikely(result < 0))
15440  return (char) -1;
15441  if (unlikely(result == 1))
15442  goto raise_neg_overflow;
15443  }
15444 #endif
15445  if (sizeof(char) <= sizeof(unsigned long)) {
15446  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
15447 #ifdef HAVE_LONG_LONG
15448  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
15449  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
15450 #endif
15451  }
15452  } else {
15453 #if CYTHON_USE_PYLONG_INTERNALS
15454  const digit* digits = ((PyLongObject*)x)->ob_digit;
15455  switch (Py_SIZE(x)) {
15456  case 0: return (char) 0;
15457  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
15458  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
15459  case -2:
15460  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
15461  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15462  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15463  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
15464  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
15465  }
15466  }
15467  break;
15468  case 2:
15469  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
15470  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15471  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15472  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
15473  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
15474  }
15475  }
15476  break;
15477  case -3:
15478  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
15479  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15480  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15481  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
15482  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
15483  }
15484  }
15485  break;
15486  case 3:
15487  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
15488  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15489  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15490  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
15491  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
15492  }
15493  }
15494  break;
15495  case -4:
15496  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
15497  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15498  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15499  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
15500  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
15501  }
15502  }
15503  break;
15504  case 4:
15505  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
15506  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15507  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15508  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
15509  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
15510  }
15511  }
15512  break;
15513  }
15514 #endif
15515  if (sizeof(char) <= sizeof(long)) {
15516  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
15517 #ifdef HAVE_LONG_LONG
15518  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
15519  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
15520 #endif
15521  }
15522  }
15523  {
15524 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
15525  PyErr_SetString(PyExc_RuntimeError,
15526  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
15527 #else
15528  char val;
15529  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
15530  #if PY_MAJOR_VERSION < 3
15531  if (likely(v) && !PyLong_Check(v)) {
15532  PyObject *tmp = v;
15533  v = PyNumber_Long(tmp);
15534  Py_DECREF(tmp);
15535  }
15536  #endif
15537  if (likely(v)) {
15538  int one = 1; int is_little = (int)*(unsigned char *)&one;
15539  unsigned char *bytes = (unsigned char *)&val;
15540  int ret = _PyLong_AsByteArray((PyLongObject *)v,
15541  bytes, sizeof(val),
15542  is_little, !is_unsigned);
15543  Py_DECREF(v);
15544  if (likely(!ret))
15545  return val;
15546  }
15547 #endif
15548  return (char) -1;
15549  }
15550  } else {
15551  char val;
15552  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
15553  if (!tmp) return (char) -1;
15554  val = __Pyx_PyInt_As_char(tmp);
15555  Py_DECREF(tmp);
15556  return val;
15557  }
15558 raise_overflow:
15559  PyErr_SetString(PyExc_OverflowError,
15560  "value too large to convert to char");
15561  return (char) -1;
15562 raise_neg_overflow:
15563  PyErr_SetString(PyExc_OverflowError,
15564  "can't convert negative value to char");
15565  return (char) -1;
15566 }
15567 
15568 /* CIntFromPy */
15569 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
15570 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15571 #pragma GCC diagnostic push
15572 #pragma GCC diagnostic ignored "-Wconversion"
15573 #endif
15574  const int neg_one = (int) -1, const_zero = (int) 0;
15575 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15576 #pragma GCC diagnostic pop
15577 #endif
15578  const int is_unsigned = neg_one > const_zero;
15579 #if PY_MAJOR_VERSION < 3
15580  if (likely(PyInt_Check(x))) {
15581  if (sizeof(int) < sizeof(long)) {
15582  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
15583  } else {
15584  long val = PyInt_AS_LONG(x);
15585  if (is_unsigned && unlikely(val < 0)) {
15586  goto raise_neg_overflow;
15587  }
15588  return (int) val;
15589  }
15590  } else
15591 #endif
15592  if (likely(PyLong_Check(x))) {
15593  if (is_unsigned) {
15594 #if CYTHON_USE_PYLONG_INTERNALS
15595  const digit* digits = ((PyLongObject*)x)->ob_digit;
15596  switch (Py_SIZE(x)) {
15597  case 0: return (int) 0;
15598  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
15599  case 2:
15600  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
15601  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15602  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15603  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
15604  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15605  }
15606  }
15607  break;
15608  case 3:
15609  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
15610  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15611  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15612  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
15613  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15614  }
15615  }
15616  break;
15617  case 4:
15618  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
15619  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15620  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15621  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
15622  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15623  }
15624  }
15625  break;
15626  }
15627 #endif
15628 #if CYTHON_COMPILING_IN_CPYTHON
15629  if (unlikely(Py_SIZE(x) < 0)) {
15630  goto raise_neg_overflow;
15631  }
15632 #else
15633  {
15634  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
15635  if (unlikely(result < 0))
15636  return (int) -1;
15637  if (unlikely(result == 1))
15638  goto raise_neg_overflow;
15639  }
15640 #endif
15641  if (sizeof(int) <= sizeof(unsigned long)) {
15642  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
15643 #ifdef HAVE_LONG_LONG
15644  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
15645  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
15646 #endif
15647  }
15648  } else {
15649 #if CYTHON_USE_PYLONG_INTERNALS
15650  const digit* digits = ((PyLongObject*)x)->ob_digit;
15651  switch (Py_SIZE(x)) {
15652  case 0: return (int) 0;
15653  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
15654  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
15655  case -2:
15656  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
15657  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15658  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15659  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
15660  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15661  }
15662  }
15663  break;
15664  case 2:
15665  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
15666  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15667  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15668  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
15669  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15670  }
15671  }
15672  break;
15673  case -3:
15674  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
15675  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15676  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15677  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
15678  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15679  }
15680  }
15681  break;
15682  case 3:
15683  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
15684  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15685  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15686  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
15687  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15688  }
15689  }
15690  break;
15691  case -4:
15692  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
15693  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15694  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15695  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
15696  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15697  }
15698  }
15699  break;
15700  case 4:
15701  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
15702  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15703  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15704  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
15705  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15706  }
15707  }
15708  break;
15709  }
15710 #endif
15711  if (sizeof(int) <= sizeof(long)) {
15712  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
15713 #ifdef HAVE_LONG_LONG
15714  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
15715  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
15716 #endif
15717  }
15718  }
15719  {
15720 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
15721  PyErr_SetString(PyExc_RuntimeError,
15722  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
15723 #else
15724  int val;
15725  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
15726  #if PY_MAJOR_VERSION < 3
15727  if (likely(v) && !PyLong_Check(v)) {
15728  PyObject *tmp = v;
15729  v = PyNumber_Long(tmp);
15730  Py_DECREF(tmp);
15731  }
15732  #endif
15733  if (likely(v)) {
15734  int one = 1; int is_little = (int)*(unsigned char *)&one;
15735  unsigned char *bytes = (unsigned char *)&val;
15736  int ret = _PyLong_AsByteArray((PyLongObject *)v,
15737  bytes, sizeof(val),
15738  is_little, !is_unsigned);
15739  Py_DECREF(v);
15740  if (likely(!ret))
15741  return val;
15742  }
15743 #endif
15744  return (int) -1;
15745  }
15746  } else {
15747  int val;
15748  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
15749  if (!tmp) return (int) -1;
15750  val = __Pyx_PyInt_As_int(tmp);
15751  Py_DECREF(tmp);
15752  return val;
15753  }
15754 raise_overflow:
15755  PyErr_SetString(PyExc_OverflowError,
15756  "value too large to convert to int");
15757  return (int) -1;
15758 raise_neg_overflow:
15759  PyErr_SetString(PyExc_OverflowError,
15760  "can't convert negative value to int");
15761  return (int) -1;
15762 }
15763 
15764 /* CIntToPy */
15765 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
15766 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15767 #pragma GCC diagnostic push
15768 #pragma GCC diagnostic ignored "-Wconversion"
15769 #endif
15770  const long neg_one = (long) -1, const_zero = (long) 0;
15771 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15772 #pragma GCC diagnostic pop
15773 #endif
15774  const int is_unsigned = neg_one > const_zero;
15775  if (is_unsigned) {
15776  if (sizeof(long) < sizeof(long)) {
15777  return PyInt_FromLong((long) value);
15778  } else if (sizeof(long) <= sizeof(unsigned long)) {
15779  return PyLong_FromUnsignedLong((unsigned long) value);
15780 #ifdef HAVE_LONG_LONG
15781  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
15782  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
15783 #endif
15784  }
15785  } else {
15786  if (sizeof(long) <= sizeof(long)) {
15787  return PyInt_FromLong((long) value);
15788 #ifdef HAVE_LONG_LONG
15789  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
15790  return PyLong_FromLongLong((PY_LONG_LONG) value);
15791 #endif
15792  }
15793  }
15794  {
15795  int one = 1; int little = (int)*(unsigned char *)&one;
15796  unsigned char *bytes = (unsigned char *)&value;
15797  return _PyLong_FromByteArray(bytes, sizeof(long),
15798  little, !is_unsigned);
15799  }
15800 }
15801 
15802 /* CIntFromPy */
15803 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
15804 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15805 #pragma GCC diagnostic push
15806 #pragma GCC diagnostic ignored "-Wconversion"
15807 #endif
15808  const long neg_one = (long) -1, const_zero = (long) 0;
15809 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15810 #pragma GCC diagnostic pop
15811 #endif
15812  const int is_unsigned = neg_one > const_zero;
15813 #if PY_MAJOR_VERSION < 3
15814  if (likely(PyInt_Check(x))) {
15815  if (sizeof(long) < sizeof(long)) {
15816  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
15817  } else {
15818  long val = PyInt_AS_LONG(x);
15819  if (is_unsigned && unlikely(val < 0)) {
15820  goto raise_neg_overflow;
15821  }
15822  return (long) val;
15823  }
15824  } else
15825 #endif
15826  if (likely(PyLong_Check(x))) {
15827  if (is_unsigned) {
15828 #if CYTHON_USE_PYLONG_INTERNALS
15829  const digit* digits = ((PyLongObject*)x)->ob_digit;
15830  switch (Py_SIZE(x)) {
15831  case 0: return (long) 0;
15832  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
15833  case 2:
15834  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
15835  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15836  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15837  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
15838  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
15839  }
15840  }
15841  break;
15842  case 3:
15843  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
15844  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15845  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15846  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
15847  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
15848  }
15849  }
15850  break;
15851  case 4:
15852  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
15853  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15854  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15855  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
15856  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
15857  }
15858  }
15859  break;
15860  }
15861 #endif
15862 #if CYTHON_COMPILING_IN_CPYTHON
15863  if (unlikely(Py_SIZE(x) < 0)) {
15864  goto raise_neg_overflow;
15865  }
15866 #else
15867  {
15868  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
15869  if (unlikely(result < 0))
15870  return (long) -1;
15871  if (unlikely(result == 1))
15872  goto raise_neg_overflow;
15873  }
15874 #endif
15875  if (sizeof(long) <= sizeof(unsigned long)) {
15876  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
15877 #ifdef HAVE_LONG_LONG
15878  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
15879  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
15880 #endif
15881  }
15882  } else {
15883 #if CYTHON_USE_PYLONG_INTERNALS
15884  const digit* digits = ((PyLongObject*)x)->ob_digit;
15885  switch (Py_SIZE(x)) {
15886  case 0: return (long) 0;
15887  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
15888  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
15889  case -2:
15890  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
15891  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15892  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15893  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
15894  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15895  }
15896  }
15897  break;
15898  case 2:
15899  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
15900  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
15901  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15902  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
15903  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15904  }
15905  }
15906  break;
15907  case -3:
15908  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
15909  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15910  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15911  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
15912  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15913  }
15914  }
15915  break;
15916  case 3:
15917  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
15918  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
15919  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15920  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
15921  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15922  }
15923  }
15924  break;
15925  case -4:
15926  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
15927  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15928  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15929  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
15930  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15931  }
15932  }
15933  break;
15934  case 4:
15935  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
15936  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
15937  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15938  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
15939  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15940  }
15941  }
15942  break;
15943  }
15944 #endif
15945  if (sizeof(long) <= sizeof(long)) {
15946  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
15947 #ifdef HAVE_LONG_LONG
15948  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
15949  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
15950 #endif
15951  }
15952  }
15953  {
15954 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
15955  PyErr_SetString(PyExc_RuntimeError,
15956  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
15957 #else
15958  long val;
15959  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
15960  #if PY_MAJOR_VERSION < 3
15961  if (likely(v) && !PyLong_Check(v)) {
15962  PyObject *tmp = v;
15963  v = PyNumber_Long(tmp);
15964  Py_DECREF(tmp);
15965  }
15966  #endif
15967  if (likely(v)) {
15968  int one = 1; int is_little = (int)*(unsigned char *)&one;
15969  unsigned char *bytes = (unsigned char *)&val;
15970  int ret = _PyLong_AsByteArray((PyLongObject *)v,
15971  bytes, sizeof(val),
15972  is_little, !is_unsigned);
15973  Py_DECREF(v);
15974  if (likely(!ret))
15975  return val;
15976  }
15977 #endif
15978  return (long) -1;
15979  }
15980  } else {
15981  long val;
15982  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
15983  if (!tmp) return (long) -1;
15984  val = __Pyx_PyInt_As_long(tmp);
15985  Py_DECREF(tmp);
15986  return val;
15987  }
15988 raise_overflow:
15989  PyErr_SetString(PyExc_OverflowError,
15990  "value too large to convert to long");
15991  return (long) -1;
15992 raise_neg_overflow:
15993  PyErr_SetString(PyExc_OverflowError,
15994  "can't convert negative value to long");
15995  return (long) -1;
15996 }
15997 
15998 /* FastTypeChecks */
15999 #if CYTHON_COMPILING_IN_CPYTHON
16000 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
16001  while (a) {
16002  a = a->tp_base;
16003  if (a == b)
16004  return 1;
16005  }
16006  return b == &PyBaseObject_Type;
16007 }
16008 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
16009  PyObject *mro;
16010  if (a == b) return 1;
16011  mro = a->tp_mro;
16012  if (likely(mro)) {
16013  Py_ssize_t i, n;
16014  n = PyTuple_GET_SIZE(mro);
16015  for (i = 0; i < n; i++) {
16016  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
16017  return 1;
16018  }
16019  return 0;
16020  }
16021  return __Pyx_InBases(a, b);
16022 }
16023 #if PY_MAJOR_VERSION == 2
16024 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
16025  PyObject *exception, *value, *tb;
16026  int res;
16027  __Pyx_PyThreadState_declare
16028  __Pyx_PyThreadState_assign
16029  __Pyx_ErrFetch(&exception, &value, &tb);
16030  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
16031  if (unlikely(res == -1)) {
16032  PyErr_WriteUnraisable(err);
16033  res = 0;
16034  }
16035  if (!res) {
16036  res = PyObject_IsSubclass(err, exc_type2);
16037  if (unlikely(res == -1)) {
16038  PyErr_WriteUnraisable(err);
16039  res = 0;
16040  }
16041  }
16042  __Pyx_ErrRestore(exception, value, tb);
16043  return res;
16044 }
16045 #else
16046 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
16047  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
16048  if (!res) {
16049  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
16050  }
16051  return res;
16052 }
16053 #endif
16054 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
16055  Py_ssize_t i, n;
16056  assert(PyExceptionClass_Check(exc_type));
16057  n = PyTuple_GET_SIZE(tuple);
16058 #if PY_MAJOR_VERSION >= 3
16059  for (i=0; i<n; i++) {
16060  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
16061  }
16062 #endif
16063  for (i=0; i<n; i++) {
16064  PyObject *t = PyTuple_GET_ITEM(tuple, i);
16065  #if PY_MAJOR_VERSION < 3
16066  if (likely(exc_type == t)) return 1;
16067  #endif
16068  if (likely(PyExceptionClass_Check(t))) {
16069  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
16070  } else {
16071  }
16072  }
16073  return 0;
16074 }
16075 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
16076  if (likely(err == exc_type)) return 1;
16077  if (likely(PyExceptionClass_Check(err))) {
16078  if (likely(PyExceptionClass_Check(exc_type))) {
16079  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
16080  } else if (likely(PyTuple_Check(exc_type))) {
16081  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
16082  } else {
16083  }
16084  }
16085  return PyErr_GivenExceptionMatches(err, exc_type);
16086 }
16087 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
16088  assert(PyExceptionClass_Check(exc_type1));
16089  assert(PyExceptionClass_Check(exc_type2));
16090  if (likely(err == exc_type1 || err == exc_type2)) return 1;
16091  if (likely(PyExceptionClass_Check(err))) {
16092  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
16093  }
16094  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
16095 }
16096 #endif
16097 
16098 /* CheckBinaryVersion */
16099 static int __Pyx_check_binary_version(void) {
16100  char ctversion[5];
16101  int same=1, i, found_dot;
16102  const char* rt_from_call = Py_GetVersion();
16103  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
16104  found_dot = 0;
16105  for (i = 0; i < 4; i++) {
16106  if (!ctversion[i]) {
16107  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
16108  break;
16109  }
16110  if (rt_from_call[i] != ctversion[i]) {
16111  same = 0;
16112  break;
16113  }
16114  }
16115  if (!same) {
16116  char rtversion[5] = {'\0'};
16117  char message[200];
16118  for (i=0; i<4; ++i) {
16119  if (rt_from_call[i] == '.') {
16120  if (found_dot) break;
16121  found_dot = 1;
16122  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
16123  break;
16124  }
16125  rtversion[i] = rt_from_call[i];
16126  }
16127  PyOS_snprintf(message, sizeof(message),
16128  "compiletime version %s of module '%.100s' "
16129  "does not match runtime version %s",
16130  ctversion, __Pyx_MODULE_NAME, rtversion);
16131  return PyErr_WarnEx(NULL, message, 1);
16132  }
16133  return 0;
16134 }
16135 
16136 /* InitStrings */
16137 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
16138  while (t->p) {
16139  #if PY_MAJOR_VERSION < 3
16140  if (t->is_unicode) {
16141  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
16142  } else if (t->intern) {
16143  *t->p = PyString_InternFromString(t->s);
16144  } else {
16145  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
16146  }
16147  #else
16148  if (t->is_unicode | t->is_str) {
16149  if (t->intern) {
16150  *t->p = PyUnicode_InternFromString(t->s);
16151  } else if (t->encoding) {
16152  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
16153  } else {
16154  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
16155  }
16156  } else {
16157  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
16158  }
16159  #endif
16160  if (!*t->p)
16161  return -1;
16162  if (PyObject_Hash(*t->p) == -1)
16163  return -1;
16164  ++t;
16165  }
16166  return 0;
16167 }
16168 
16169 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
16170  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
16171 }
16172 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
16173  Py_ssize_t ignore;
16174  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
16175 }
16176 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
16177 #if !CYTHON_PEP393_ENABLED
16178 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16179  char* defenc_c;
16180  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
16181  if (!defenc) return NULL;
16182  defenc_c = PyBytes_AS_STRING(defenc);
16183 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16184  {
16185  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
16186  char* c;
16187  for (c = defenc_c; c < end; c++) {
16188  if ((unsigned char) (*c) >= 128) {
16189  PyUnicode_AsASCIIString(o);
16190  return NULL;
16191  }
16192  }
16193  }
16194 #endif
16195  *length = PyBytes_GET_SIZE(defenc);
16196  return defenc_c;
16197 }
16198 #else
16199 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16200  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
16201 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16202  if (likely(PyUnicode_IS_ASCII(o))) {
16203  *length = PyUnicode_GET_LENGTH(o);
16204  return PyUnicode_AsUTF8(o);
16205  } else {
16206  PyUnicode_AsASCIIString(o);
16207  return NULL;
16208  }
16209 #else
16210  return PyUnicode_AsUTF8AndSize(o, length);
16211 #endif
16212 }
16213 #endif
16214 #endif
16215 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16216 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
16217  if (
16218 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16219  __Pyx_sys_getdefaultencoding_not_ascii &&
16220 #endif
16221  PyUnicode_Check(o)) {
16222  return __Pyx_PyUnicode_AsStringAndSize(o, length);
16223  } else
16224 #endif
16225 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
16226  if (PyByteArray_Check(o)) {
16227  *length = PyByteArray_GET_SIZE(o);
16228  return PyByteArray_AS_STRING(o);
16229  } else
16230 #endif
16231  {
16232  char* result;
16233  int r = PyBytes_AsStringAndSize(o, &result, length);
16234  if (unlikely(r < 0)) {
16235  return NULL;
16236  } else {
16237  return result;
16238  }
16239  }
16240 }
16241 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
16242  int is_true = x == Py_True;
16243  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
16244  else return PyObject_IsTrue(x);
16245 }
16246 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
16247  int retval;
16248  if (unlikely(!x)) return -1;
16249  retval = __Pyx_PyObject_IsTrue(x);
16250  Py_DECREF(x);
16251  return retval;
16252 }
16253 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
16254 #if PY_MAJOR_VERSION >= 3
16255  if (PyLong_Check(result)) {
16256  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
16257  "__int__ returned non-int (type %.200s). "
16258  "The ability to return an instance of a strict subclass of int "
16259  "is deprecated, and may be removed in a future version of Python.",
16260  Py_TYPE(result)->tp_name)) {
16261  Py_DECREF(result);
16262  return NULL;
16263  }
16264  return result;
16265  }
16266 #endif
16267  PyErr_Format(PyExc_TypeError,
16268  "__%.4s__ returned non-%.4s (type %.200s)",
16269  type_name, type_name, Py_TYPE(result)->tp_name);
16270  Py_DECREF(result);
16271  return NULL;
16272 }
16273 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
16274 #if CYTHON_USE_TYPE_SLOTS
16275  PyNumberMethods *m;
16276 #endif
16277  const char *name = NULL;
16278  PyObject *res = NULL;
16279 #if PY_MAJOR_VERSION < 3
16280  if (likely(PyInt_Check(x) || PyLong_Check(x)))
16281 #else
16282  if (likely(PyLong_Check(x)))
16283 #endif
16284  return __Pyx_NewRef(x);
16285 #if CYTHON_USE_TYPE_SLOTS
16286  m = Py_TYPE(x)->tp_as_number;
16287  #if PY_MAJOR_VERSION < 3
16288  if (m && m->nb_int) {
16289  name = "int";
16290  res = m->nb_int(x);
16291  }
16292  else if (m && m->nb_long) {
16293  name = "long";
16294  res = m->nb_long(x);
16295  }
16296  #else
16297  if (likely(m && m->nb_int)) {
16298  name = "int";
16299  res = m->nb_int(x);
16300  }
16301  #endif
16302 #else
16303  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
16304  res = PyNumber_Int(x);
16305  }
16306 #endif
16307  if (likely(res)) {
16308 #if PY_MAJOR_VERSION < 3
16309  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
16310 #else
16311  if (unlikely(!PyLong_CheckExact(res))) {
16312 #endif
16313  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
16314  }
16315  }
16316  else if (!PyErr_Occurred()) {
16317  PyErr_SetString(PyExc_TypeError,
16318  "an integer is required");
16319  }
16320  return res;
16321 }
16322 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
16323  Py_ssize_t ival;
16324  PyObject *x;
16325 #if PY_MAJOR_VERSION < 3
16326  if (likely(PyInt_CheckExact(b))) {
16327  if (sizeof(Py_ssize_t) >= sizeof(long))
16328  return PyInt_AS_LONG(b);
16329  else
16330  return PyInt_AsSsize_t(b);
16331  }
16332 #endif
16333  if (likely(PyLong_CheckExact(b))) {
16334  #if CYTHON_USE_PYLONG_INTERNALS
16335  const digit* digits = ((PyLongObject*)b)->ob_digit;
16336  const Py_ssize_t size = Py_SIZE(b);
16337  if (likely(__Pyx_sst_abs(size) <= 1)) {
16338  ival = likely(size) ? digits[0] : 0;
16339  if (size == -1) ival = -ival;
16340  return ival;
16341  } else {
16342  switch (size) {
16343  case 2:
16344  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
16345  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
16346  }
16347  break;
16348  case -2:
16349  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
16350  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
16351  }
16352  break;
16353  case 3:
16354  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
16355  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
16356  }
16357  break;
16358  case -3:
16359  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
16360  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
16361  }
16362  break;
16363  case 4:
16364  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
16365  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
16366  }
16367  break;
16368  case -4:
16369  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
16370  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
16371  }
16372  break;
16373  }
16374  }
16375  #endif
16376  return PyLong_AsSsize_t(b);
16377  }
16378  x = PyNumber_Index(b);
16379  if (!x) return -1;
16380  ival = PyInt_AsSsize_t(x);
16381  Py_DECREF(x);
16382  return ival;
16383 }
16384 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
16385  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
16386  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
16387 #if PY_MAJOR_VERSION < 3
16388  } else if (likely(PyInt_CheckExact(o))) {
16389  return PyInt_AS_LONG(o);
16390 #endif
16391  } else {
16392  Py_ssize_t ival;
16393  PyObject *x;
16394  x = PyNumber_Index(o);
16395  if (!x) return -1;
16396  ival = PyInt_AsLong(x);
16397  Py_DECREF(x);
16398  return ival;
16399  }
16400 }
16401 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
16402  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
16403 }
16404 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
16405  return PyInt_FromSize_t(ival);
16406 }
16407 
16408 
16409 #endif /* Py_PYTHON_H */
calculateSubgridError_A_tau
void calculateSubgridError_A_tau(int nElements_global, int nQuadraturePoints_element, int nSpace, char stabilization, double *elementDiameter, double *dmt, double *df, double *cfl, double *tau)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation.
Definition: subgridError.c:971
calculateSubgridErrorStokes2D_GLS_tauRes
void calculateSubgridErrorStokes2D_GLS_tauRes(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *tau0, double *tau1, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:2685
calculateSubgridError_tauRes
void calculateSubgridError_tauRes(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, double *tau, double *pdeResidual, double *dpdeResidual, double *subgridError, double *dsubgridError)
Calculate the ASGS subgrid error given tau and the strong residual.
Definition: subgridError.c:12
calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd
void calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv)
Definition: subgridError.c:1498
calculateSubgridErrorNavierStokes3D_GLS_tauRes
void calculateSubgridErrorNavierStokes3D_GLS_tauRes(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *tau0, double *tau1, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *dpdeResidualP_dw, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *dpdeResidualU_dv, double *dpdeResidualU_dw, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_du, double *dpdeResidualV_dv, double *dpdeResidualV_dw, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_du, double *dpdeResidualW_dv, double *dpdeResidualW_dw, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *dsubgridErrorP_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *dsubgridErrorU_dv, double *dsubgridErrorU_dw, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_du, double *dsubgridErrorV_dv, double *dsubgridErrorV_dw, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_du, double *dsubgridErrorW_dv, double *dsubgridErrorW_dw)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:2950
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau
void calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau(int nElements_global, int nQuadraturePoints_element, int nSpace, double *inverseJ, double *dmt, double *dm, double *f, double *a, double *dr, double *tau0, double *tau1, double *cfl)
Definition: subgridError.c:2304
calculateSubgridErrorStokes_GLS_tau
void calculateSubgridErrorStokes_GLS_tau(int nElements_global, int nQuadraturePoints_element, int nSpace, double *elementDiameter, double *pfac, double *a, double *tau0, double *tau1)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:2632
calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure
void calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *dm, double *f, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *dpdeResidualP_dw, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_dw, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *dsubgridErrorP_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_dw)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:3163
n
Int n
Definition: Headers.h:28
subgridError.h
C implementations of subgrid error calculations.
calculateSubgridErrorStokes3D_GLS_velocity_pressure
void calculateSubgridErrorStokes3D_GLS_velocity_pressure(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *dpdeResidualP_dw, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_dw, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *dsubgridErrorP_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_dw)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:1617
calculateSubgridErrorStokes2D_GLS_velocity_sd
void calculateSubgridErrorStokes2D_GLS_velocity_sd(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv)
Definition: subgridError.c:1072
calculateSubgridErrorGradient_tauRes
void calculateSubgridErrorGradient_tauRes(int nElements_global, int nQuadraturePoints_element, int nSpace, double *tau_gradient, double *grad_pdeResidual, double *grad_subgridError)
Calculate the ASGS subgrid error given tau and the strong residual.
Definition: subgridError.c:4064
calculateSubgridErrorStokes3D_GLS_tauRes
void calculateSubgridErrorStokes3D_GLS_tauRes(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *tau0, double *tau1, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *dpdeResidualP_dw, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_dw, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *dsubgridErrorP_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_dw)
3D version of Stokes GLS tau
Definition: subgridError.c:2797
calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd
void calculateSubgridErrorStokes3D_GLS_velocity_pressure_sd(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *dpdeResidualP_dw, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_dw, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *dsubgridErrorP_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_dw)
Definition: subgridError.c:1763
calculateSubgridErrorStokes_GLS_tau_sd
void calculateSubgridErrorStokes_GLS_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, double *elementDiameter, double *pfac, double *a, double *tau0, double *tau1)
Definition: subgridError.c:2657
calculateSubgridErrorStokes3D_GLS_velocity
void calculateSubgridErrorStokes3D_GLS_velocity(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_dw)
Calculate the subgrid error for velocity in 3D Stokes equation with a GLS-like formula.
Definition: subgridError.c:1157
v
Double v
Definition: Headers.h:95
calculateSubgridErrorShallowWater1D
void calculateSubgridErrorShallowWater1D(int nElements_global, int nQuadraturePoints_element, double g, double *elementDiameter, double *h, double *hu, double *cfl_1, double *cfl_2)
Definition: subgridError.c:3966
T
Double T
Definition: Headers.h:87
calculateSubgridErrorStokes2D_1_sd
void calculateSubgridErrorStokes2D_1_sd(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *u, double *v, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorP, double *dsubgridErrorP_dp, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *dsubgridErrorU_dv, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_du, double *dsubgridErrorV_dv)
Definition: subgridError.c:3715
z
Double * z
Definition: Headers.h:49
calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd
void calculateSubgridErrorNavierStokes2D_generic_withBodyForce_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, double *inverseJ, double *dmt, double *dm, double *f, double *a, double *dr, double *tau0, double *tau1, double *cfl)
Definition: subgridError.c:2400
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
calculateSubgridErrorStokes2D_1
void calculateSubgridErrorStokes2D_1(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *u, double *v, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorP, double *dsubgridErrorP_dp, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *dsubgridErrorU_dv, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_du, double *dsubgridErrorV_dv)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:3464
calculateSubgridErrorShallowWater2D
void calculateSubgridErrorShallowWater2D(int nElements_global, int nQuadraturePoints_element, double g, double *elementDiameter, double *h, double *hu, double *hv, double *cfl_1, double *cfl_2, double *cfl_3)
Definition: subgridError.c:3988
calculateSubgridErrorStokes2D_GLS_velocity
void calculateSubgridErrorStokes2D_GLS_velocity(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv)
Calculate the subgrid error for velocity in 2D Stokes equation with a GLS-like formula.
Definition: subgridError.c:990
calculateSubgridErrorNavierStokes2D_generic_tau_sd
void calculateSubgridErrorNavierStokes2D_generic_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, double *inverseJ, double *dmt, double *dm, double *f, double *a, double *tau0, double *tau1, double *cfl)
Definition: subgridError.c:2215
calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd
void calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *dm, double *f, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *dpdeResidualP_dw, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_dw, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *dsubgridErrorP_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_dw)
Definition: subgridError.c:3312
calculateSubgridError_ADR_generic_tau
void calculateSubgridError_ADR_generic_tau(int nElements_global, int nQuadraturePoints_element, int nSpace, double *inverseJ, double *dmt, double *df, double *a, double *da, double *grad_phi, double *dphi, double *dr, double *pe, double *cfl, double *tau)
Definition: subgridError.c:580
calculateSubgridErrorNavierStokes2D_GLS_tau_sd
void calculateSubgridErrorNavierStokes2D_GLS_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, double hFactor, double *elementDiameter, double *dmt, double *dm, double *f, double *a, double *tau0, double *tau1, double *cfl)
Definition: subgridError.c:2020
calculateSubgridErrorNavierStokes2D_GLS_tau
void calculateSubgridErrorNavierStokes2D_GLS_tau(int nElements_global, int nQuadraturePoints_element, int nSpace, double hFactor, double *elementDiameter, double *dmt, double *dm, double *f, double *a, double *tau0, double *tau1, double *cfl)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:1914
calculateSubgridError_ADR_tau_sd
void calculateSubgridError_ADR_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, int *rowptr, int *colind, char stabilization, double *elementDiameter, double *dmt, double *df, double *a, double *da, double *grad_phi, double *dphi, double *dr, double *pe, double *cfl, double *tau)
Definition: subgridError.c:851
calculateSubgridErrorStokes3D_GLS_velocity_sd
void calculateSubgridErrorStokes3D_GLS_velocity_sd(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp, double *dpdeResidualW_dw, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW, double *dsubgridErrorW_dp, double *dsubgridErrorW_dw)
Definition: subgridError.c:1268
calculateSubgridError_ADR_generic_tau_sd
void calculateSubgridError_ADR_generic_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, int *rowptr, int *colind, double *inverseJ, double *dmt, double *df, double *a, double *da, double *grad_phi, double *dphi, double *dr, double *pe, double *cfl, double *tau)
Definition: subgridError.c:699
calculateSubgridErrorStokes2D_GLS_velocity_pressure
void calculateSubgridErrorStokes2D_GLS_velocity_pressure(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *elementDiameter, double *a, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_dv)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:1382
calculateSubgridError_Harari_tau_sd
void calculateSubgridError_Harari_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, double dt, int *rowptr, int *colind, double *elementDiameter, double *a, double *tau)
Definition: subgridError.c:4017
r
Double r
Definition: Headers.h:83
calculateSubgridErrorNavierStokes2D_GLS_tauRes
void calculateSubgridErrorNavierStokes2D_GLS_tauRes(int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element, int nSpace, double *tau0, double *tau1, double *pdeResidualP, double *dpdeResidualP_du, double *dpdeResidualP_dv, double *pdeResidualU, double *dpdeResidualU_dp, double *dpdeResidualU_du, double *dpdeResidualU_dv, double *pdeResidualV, double *dpdeResidualV_dp, double *dpdeResidualV_du, double *dpdeResidualV_dv, double *subgridErrorP, double *dsubgridErrorP_du, double *dsubgridErrorP_dv, double *subgridErrorU, double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *dsubgridErrorU_dv, double *subgridErrorV, double *dsubgridErrorV_dp, double *dsubgridErrorV_du, double *dsubgridErrorV_dv)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation using the ...
Definition: subgridError.c:2499
calculateSubgridError_ADR_tau
void calculateSubgridError_ADR_tau(int nElements_global, int nQuadraturePoints_element, int nSpace, char stabilization, double *elementDiameter, double *dmt, double *df, double *a, double *da, double *grad_phi, double *dphi, double *dr, double *pe, double *cfl, double *tau)
Calculate the stabilization parameter for the scalar advection-diffusion-reaction equation.
Definition: subgridError.c:826
calculateSubgridError_ADR_Sangalli_tau_sd
void calculateSubgridError_ADR_Sangalli_tau_sd(int nElements_global, int nQuadraturePoints_element, int nSpace, int *rowptr, int *colind, double *inverseJ, double *dmt, double *df, double *a, double *da, double *grad_phi, double *dphi, double *dr, double *pe, double *cfl, double *tau, double *tau_gradient)
Definition: subgridError.c:4244
calculateSubgridErrorNavierStokes2D_generic_tau
void calculateSubgridErrorNavierStokes2D_generic_tau(int nElements_global, int nQuadraturePoints_element, int nSpace, double *inverseJ, double *dmt, double *dm, double *f, double *a, double *tau0, double *tau1, double *cfl)
Definition: subgridError.c:2125
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8