3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
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+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
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
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)
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
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
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
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
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
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
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
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
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
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
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
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
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
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
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)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
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
237 #define CYTHON_RESTRICT
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__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
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]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
307 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
309 #ifndef CYTHON_INLINE
310 #if defined(__clang__)
311 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
313 #define CYTHON_INLINE inline
317 void __Pyx_call_destructor(
T& x) {
321 class __Pyx_FakeReference {
323 __Pyx_FakeReference() : ptr(NULL) { }
324 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
325 T *operator->() {
return ptr; }
326 T *operator&() {
return ptr; }
327 operator T&() {
return *ptr; }
328 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
329 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335 #define Py_OptimizeFlag 0
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343 #define __Pyx_DefaultClassType PyClass_Type
345 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346 #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
349 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
350 PyObject *fv, PyObject *cell, PyObject* fn,
351 PyObject *name,
int fline, PyObject *lnos) {
352 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354 const char *fn_cstr=NULL;
355 const char *name_cstr=NULL;
356 PyCodeObject* co=NULL;
357 PyObject *type, *value, *traceback;
358 PyErr_Fetch(&type, &value, &traceback);
359 if (!(kwds=PyDict_New()))
goto end;
360 if (!(argcount=PyLong_FromLong(a)))
goto end;
361 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
362 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
363 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
364 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
365 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
366 if (!(nlocals=PyLong_FromLong(l)))
goto end;
367 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
368 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
369 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
370 if (!(flags=PyLong_FromLong(
f)))
goto end;
371 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
372 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
373 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
374 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
375 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
376 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
377 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
378 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
379 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
380 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
381 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
382 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
383 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
384 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
385 Py_XDECREF((PyObject*)co);
386 co = (PyCodeObject*)call_result;
390 Py_XDECREF((PyObject*)co);
395 Py_XDECREF(argcount);
396 Py_XDECREF(posonlyargcount);
397 Py_XDECREF(kwonlyargcount);
399 Py_XDECREF(stacksize);
401 Py_XDECREF(call_result);
404 PyErr_Restore(type, value, traceback);
409 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
412 #define __Pyx_DefaultClassType PyType_Type
414 #ifndef Py_TPFLAGS_CHECKTYPES
415 #define Py_TPFLAGS_CHECKTYPES 0
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418 #define Py_TPFLAGS_HAVE_INDEX 0
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424 #define Py_TPFLAGS_HAVE_FINALIZE 0
426 #ifndef METH_STACKLESS
427 #define METH_STACKLESS 0
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430 #ifndef METH_FASTCALL
431 #define METH_FASTCALL 0x80
433 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
434 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
435 Py_ssize_t nargs, PyObject *kwnames);
437 #define __Pyx_PyCFunctionFast _PyCFunctionFast
438 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
444 #define __Pyx_PyFastCFunction_Check(func) 0
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447 #define PyObject_Malloc(s) PyMem_Malloc(s)
448 #define PyObject_Free(p) PyMem_Free(p)
449 #define PyObject_Realloc(p) PyMem_Realloc(p)
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454 #define PyMem_RawFree(p) PyMem_Free(p)
456 #if CYTHON_COMPILING_IN_PYSTON
457 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
460 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464 #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468 #define __Pyx_PyThreadState_Current PyThreadState_GET()
470 #define __Pyx_PyThreadState_Current _PyThreadState_Current
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
477 *key = PyThread_create_key();
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
481 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
482 *key = Py_tss_NEEDS_INIT;
485 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
488 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
489 return *key != Py_tss_NEEDS_INIT;
491 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
492 PyThread_delete_key(*key);
493 *key = Py_tss_NEEDS_INIT;
495 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
496 return PyThread_set_key_value(*key, value);
498 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
499 return PyThread_get_key_value(*key);
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
511 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520 #define CYTHON_PEP393_ENABLED 1
521 #if defined(PyUnicode_IS_READY)
522 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523 0 : _PyUnicode_Ready((PyObject *)(op)))
525 #define __Pyx_PyUnicode_READY(op) (0)
527 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
538 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
541 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
544 #define CYTHON_PEP393_ENABLED 0
545 #define PyUnicode_1BYTE_KIND 1
546 #define PyUnicode_2BYTE_KIND 2
547 #define PyUnicode_4BYTE_KIND 4
548 #define __Pyx_PyUnicode_READY(op) (0)
549 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
558 #if CYTHON_COMPILING_IN_PYPY
559 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
562 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
580 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583 #define PyObject_ASCII(o) PyObject_Repr(o)
585 #if PY_MAJOR_VERSION >= 3
586 #define PyBaseString_Type PyUnicode_Type
587 #define PyStringObject PyUnicodeObject
588 #define PyString_Type PyUnicode_Type
589 #define PyString_Check PyUnicode_Check
590 #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592 #define PyObject_Unicode PyObject_Str
595 #if PY_MAJOR_VERSION >= 3
596 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
599 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
602 #ifndef PySet_CheckExact
603 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
605 #if PY_VERSION_HEX >= 0x030900A4
606 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
609 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
612 #if CYTHON_ASSUME_SAFE_MACROS
613 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
615 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
617 #if PY_MAJOR_VERSION >= 3
618 #define PyIntObject PyLongObject
619 #define PyInt_Type PyLong_Type
620 #define PyInt_Check(op) PyLong_Check(op)
621 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622 #define PyInt_FromString PyLong_FromString
623 #define PyInt_FromUnicode PyLong_FromUnicode
624 #define PyInt_FromLong PyLong_FromLong
625 #define PyInt_FromSize_t PyLong_FromSize_t
626 #define PyInt_FromSsize_t PyLong_FromSsize_t
627 #define PyInt_AsLong PyLong_AsLong
628 #define PyInt_AS_LONG PyLong_AS_LONG
629 #define PyInt_AsSsize_t PyLong_AsSsize_t
630 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632 #define PyNumber_Int PyNumber_Long
634 #if PY_MAJOR_VERSION >= 3
635 #define PyBoolObject PyLongObject
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638 #ifndef PyUnicode_InternFromString
639 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
642 #if PY_VERSION_HEX < 0x030200A4
643 typedef long Py_hash_t;
644 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
647 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
650 #if PY_MAJOR_VERSION >= 3
651 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
653 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
655 #if CYTHON_USE_ASYNC_SLOTS
656 #if PY_VERSION_HEX >= 0x030500B1
657 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
660 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
663 #define __Pyx_PyType_AsAsync(obj) NULL
665 #ifndef __Pyx_PyAsyncMethodsStruct
670 } __Pyx_PyAsyncMethodsStruct;
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674 #if !defined(_USE_MATH_DEFINES)
675 #define _USE_MATH_DEFINES
680 #define __PYX_NAN() ((float) NAN)
682 static CYTHON_INLINE
float __PYX_NAN() {
684 memset(&value, 0xFF,
sizeof(value));
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
691 #define __Pyx_truncl truncl
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
699 #ifndef __PYX_EXTERN_C
701 #define __PYX_EXTERN_C extern "C"
703 #define __PYX_EXTERN_C extern
707 #define __PYX_HAVE__cpartitioning
708 #define __PYX_HAVE_API__cpartitioning
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
723 #include "pythread.h"
730 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
731 #define CYTHON_WITHOUT_ASSERTIONS
734 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
735 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
738 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
739 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
740 #define __PYX_DEFAULT_STRING_ENCODING ""
741 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
742 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
743 #define __Pyx_uchar_cast(c) ((unsigned char)c)
744 #define __Pyx_long_cast(x) ((long)x)
745 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
746 (sizeof(type) < sizeof(Py_ssize_t)) ||\
747 (sizeof(type) > sizeof(Py_ssize_t) &&\
748 likely(v < (type)PY_SSIZE_T_MAX ||\
749 v == (type)PY_SSIZE_T_MAX) &&\
750 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
751 v == (type)PY_SSIZE_T_MIN))) ||\
752 (sizeof(type) == sizeof(Py_ssize_t) &&\
753 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
754 v == (type)PY_SSIZE_T_MAX))) )
755 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
756 return (
size_t) i < (size_t) limit;
758 #if defined (__cplusplus) && __cplusplus >= 201103L
760 #define __Pyx_sst_abs(value) std::abs(value)
761 #elif SIZEOF_INT >= SIZEOF_SIZE_T
762 #define __Pyx_sst_abs(value) abs(value)
763 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
764 #define __Pyx_sst_abs(value) labs(value)
765 #elif defined (_MSC_VER)
766 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
767 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
768 #define __Pyx_sst_abs(value) llabs(value)
769 #elif defined (__GNUC__)
770 #define __Pyx_sst_abs(value) __builtin_llabs(value)
772 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
774 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
775 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
776 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
777 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
778 #define __Pyx_PyBytes_FromString PyBytes_FromString
779 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
780 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
781 #if PY_MAJOR_VERSION < 3
782 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
783 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
785 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
786 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
788 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
793 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
794 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
798 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
799 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
800 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
801 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
802 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
803 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
804 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
805 const Py_UNICODE *u_end =
u;
807 return (
size_t)(u_end -
u - 1);
809 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
810 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
811 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
812 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
813 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
814 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
815 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
816 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
817 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
818 #define __Pyx_PySequence_Tuple(obj)\
819 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
820 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
821 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
822 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
823 #if CYTHON_ASSUME_SAFE_MACROS
824 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
826 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
828 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
829 #if PY_MAJOR_VERSION >= 3
830 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
832 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
834 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
835 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
836 static int __Pyx_sys_getdefaultencoding_not_ascii;
837 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
839 PyObject* default_encoding = NULL;
840 PyObject* ascii_chars_u = NULL;
841 PyObject* ascii_chars_b = NULL;
842 const char* default_encoding_c;
843 sys = PyImport_ImportModule(
"sys");
845 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
847 if (!default_encoding)
goto bad;
848 default_encoding_c = PyBytes_AsString(default_encoding);
849 if (!default_encoding_c)
goto bad;
850 if (strcmp(default_encoding_c,
"ascii") == 0) {
851 __Pyx_sys_getdefaultencoding_not_ascii = 0;
853 char ascii_chars[128];
855 for (
c = 0;
c < 128;
c++) {
858 __Pyx_sys_getdefaultencoding_not_ascii = 1;
859 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
860 if (!ascii_chars_u)
goto bad;
861 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
862 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
865 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
869 Py_DECREF(ascii_chars_u);
870 Py_DECREF(ascii_chars_b);
872 Py_DECREF(default_encoding);
875 Py_XDECREF(default_encoding);
876 Py_XDECREF(ascii_chars_u);
877 Py_XDECREF(ascii_chars_b);
881 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
884 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
885 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
886 static char* __PYX_DEFAULT_STRING_ENCODING;
887 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
889 PyObject* default_encoding = NULL;
890 char* default_encoding_c;
891 sys = PyImport_ImportModule(
"sys");
893 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
895 if (!default_encoding)
goto bad;
896 default_encoding_c = PyBytes_AsString(default_encoding);
897 if (!default_encoding_c)
goto bad;
898 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
899 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
900 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
901 Py_DECREF(default_encoding);
904 Py_XDECREF(default_encoding);
912 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
913 #define likely(x) __builtin_expect(!!(x), 1)
914 #define unlikely(x) __builtin_expect(!!(x), 0)
916 #define likely(x) (x)
917 #define unlikely(x) (x)
919 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
921 static PyObject *__pyx_m = NULL;
922 static PyObject *__pyx_d;
923 static PyObject *__pyx_b;
924 static PyObject *__pyx_cython_runtime = NULL;
925 static PyObject *__pyx_empty_tuple;
926 static PyObject *__pyx_empty_bytes;
927 static PyObject *__pyx_empty_unicode;
928 static int __pyx_lineno;
929 static int __pyx_clineno = 0;
930 static const char * __pyx_cfilenm= __FILE__;
931 static const char *__pyx_filename;
934 #if !defined(CYTHON_CCOMPLEX)
935 #if defined(__cplusplus)
936 #define CYTHON_CCOMPLEX 1
937 #elif defined(_Complex_I)
938 #define CYTHON_CCOMPLEX 1
940 #define CYTHON_CCOMPLEX 0
950 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
952 #define _Complex_I 1.0fj
956 static const char *__pyx_f[] = {
957 "proteus/cpartitioning.pyx",
962 "proteus/cmeshTools.pxd",
965 #ifndef __PYX_FORCE_INIT_THREADS
966 #define __PYX_FORCE_INIT_THREADS 0
970 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
971 #define __Pyx_PyGILState_Release PyGILState_Release
972 #define __Pyx_FastGIL_Remember()
973 #define __Pyx_FastGIL_Forget()
974 #define __Pyx_FastGilFuncInit()
977 #define IS_UNSIGNED(type) (((type) -1) > 0)
978 struct __Pyx_StructField_;
979 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
982 struct __Pyx_StructField_* fields;
990 typedef struct __Pyx_StructField_ {
991 __Pyx_TypeInfo* type;
996 __Pyx_StructField* field;
997 size_t parent_offset;
998 } __Pyx_BufFmt_StackElem;
1000 __Pyx_StructField root;
1001 __Pyx_BufFmt_StackElem* head;
1003 size_t new_count, enc_count;
1004 size_t struct_alignment;
1009 char is_valid_array;
1010 } __Pyx_BufFmt_Context;
1013 #include <pythread.h>
1014 #ifndef CYTHON_ATOMICS
1015 #define CYTHON_ATOMICS 1
1017 #define __pyx_atomic_int_type int
1018 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1019 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1021 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
1022 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
1023 #ifdef __PYX_DEBUG_ATOMICS
1024 #warning "Using GNU atomics"
1026 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
1027 #include <Windows.h>
1028 #undef __pyx_atomic_int_type
1029 #define __pyx_atomic_int_type LONG
1030 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
1031 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
1032 #ifdef __PYX_DEBUG_ATOMICS
1033 #pragma message ("Using MSVC atomics")
1035 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
1036 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
1037 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
1038 #ifdef __PYX_DEBUG_ATOMICS
1039 #warning "Using Intel atomics"
1042 #undef CYTHON_ATOMICS
1043 #define CYTHON_ATOMICS 0
1044 #ifdef __PYX_DEBUG_ATOMICS
1045 #warning "Not using atomics"
1048 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1050 #define __pyx_add_acquisition_count(memview)\
1051 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1052 #define __pyx_sub_acquisition_count(memview)\
1053 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1055 #define __pyx_add_acquisition_count(memview)\
1056 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1057 #define __pyx_sub_acquisition_count(memview)\
1058 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1062 struct __pyx_memoryview_obj;
1064 struct __pyx_memoryview_obj *memview;
1066 Py_ssize_t shape[8];
1067 Py_ssize_t strides[8];
1068 Py_ssize_t suboffsets[8];
1069 } __Pyx_memviewslice;
1070 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1080 typedef npy_int8 __pyx_t_5numpy_int8_t;
1089 typedef npy_int16 __pyx_t_5numpy_int16_t;
1098 typedef npy_int32 __pyx_t_5numpy_int32_t;
1107 typedef npy_int64 __pyx_t_5numpy_int64_t;
1116 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1125 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1134 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1143 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1152 typedef npy_float32 __pyx_t_5numpy_float32_t;
1161 typedef npy_float64 __pyx_t_5numpy_float64_t;
1170 typedef npy_long __pyx_t_5numpy_int_t;
1179 typedef npy_longlong __pyx_t_5numpy_long_t;
1188 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1197 typedef npy_ulong __pyx_t_5numpy_uint_t;
1206 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1215 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1224 typedef npy_intp __pyx_t_5numpy_intp_t;
1233 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1242 typedef npy_double __pyx_t_5numpy_float_t;
1251 typedef npy_double __pyx_t_5numpy_double_t;
1260 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1264 typedef ::std::complex< float > __pyx_t_float_complex;
1266 typedef float _Complex __pyx_t_float_complex;
1269 typedef struct {
float real, imag; } __pyx_t_float_complex;
1271 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1276 typedef ::std::complex< double > __pyx_t_double_complex;
1278 typedef double _Complex __pyx_t_double_complex;
1281 typedef struct {
double real, imag; } __pyx_t_double_complex;
1283 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1287 struct PyMPIDatatypeObject;
1288 struct PyMPIStatusObject;
1289 struct PyMPIRequestObject;
1290 struct PyMPIPrequestObject;
1291 struct PyMPIGrequestObject;
1292 struct PyMPIMessageObject;
1293 struct PyMPIOpObject;
1294 struct PyMPIGroupObject;
1295 struct PyMPIInfoObject;
1296 struct PyMPIErrhandlerObject;
1297 struct PyMPICommObject;
1298 struct PyMPIIntracommObject;
1299 struct PyMPITopocommObject;
1300 struct PyMPICartcommObject;
1301 struct PyMPIGraphcommObject;
1302 struct PyMPIDistgraphcommObject;
1303 struct PyMPIIntercommObject;
1304 struct PyMPIWinObject;
1305 struct PyMPIFileObject;
1306 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1307 struct __pyx_array_obj;
1308 struct __pyx_MemviewEnum_obj;
1309 struct __pyx_memoryview_obj;
1310 struct __pyx_memoryviewslice_obj;
1319 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1328 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1337 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1346 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1355 struct PyMPIDatatypeObject {
1357 MPI_Datatype ob_mpi;
1359 PyObject *__weakref__;
1361 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1363 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1372 struct PyMPIStatusObject {
1376 PyObject *__weakref__;
1378 typedef struct PyMPIStatusObject PyMPIStatusObject;
1380 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1389 struct PyMPIRequestObject {
1393 PyObject *__weakref__;
1396 typedef struct PyMPIRequestObject PyMPIRequestObject;
1398 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1407 struct PyMPIPrequestObject {
1408 struct PyMPIRequestObject __pyx_base;
1410 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1412 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1421 struct PyMPIGrequestObject {
1422 struct PyMPIRequestObject __pyx_base;
1423 MPI_Request ob_grequest;
1425 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1427 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1436 struct PyMPIMessageObject {
1440 PyObject *__weakref__;
1443 typedef struct PyMPIMessageObject PyMPIMessageObject;
1445 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1454 struct PyMPIOpObject {
1458 PyObject *__weakref__;
1459 PyObject *(*ob_func)(PyObject *, PyObject *);
1462 typedef struct PyMPIOpObject PyMPIOpObject;
1464 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1473 struct PyMPIGroupObject {
1477 PyObject *__weakref__;
1479 typedef struct PyMPIGroupObject PyMPIGroupObject;
1481 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1490 struct PyMPIInfoObject {
1494 PyObject *__weakref__;
1496 typedef struct PyMPIInfoObject PyMPIInfoObject;
1498 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1507 struct PyMPIErrhandlerObject {
1509 MPI_Errhandler ob_mpi;
1511 PyObject *__weakref__;
1513 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1515 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1524 struct PyMPICommObject {
1528 PyObject *__weakref__;
1530 typedef struct PyMPICommObject PyMPICommObject;
1532 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1541 struct PyMPIIntracommObject {
1542 struct PyMPICommObject __pyx_base;
1544 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1546 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1555 struct PyMPITopocommObject {
1556 struct PyMPIIntracommObject __pyx_base;
1558 typedef struct PyMPITopocommObject PyMPITopocommObject;
1560 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1569 struct PyMPICartcommObject {
1570 struct PyMPITopocommObject __pyx_base;
1572 typedef struct PyMPICartcommObject PyMPICartcommObject;
1574 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1583 struct PyMPIGraphcommObject {
1584 struct PyMPITopocommObject __pyx_base;
1586 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1588 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1597 struct PyMPIDistgraphcommObject {
1598 struct PyMPITopocommObject __pyx_base;
1600 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1602 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1611 struct PyMPIIntercommObject {
1612 struct PyMPICommObject __pyx_base;
1614 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1616 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1625 struct PyMPIWinObject {
1629 PyObject *__weakref__;
1632 typedef struct PyMPIWinObject PyMPIWinObject;
1634 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1643 struct PyMPIFileObject {
1647 PyObject *__weakref__;
1649 typedef struct PyMPIFileObject PyMPIFileObject;
1651 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1660 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1723 struct __pyx_array_obj {
1725 struct __pyx_vtabstruct_array *__pyx_vtab;
1731 Py_ssize_t *_strides;
1732 Py_ssize_t itemsize;
1735 void (*callback_free_data)(
void *);
1737 int dtype_is_object;
1748 struct __pyx_MemviewEnum_obj {
1761 struct __pyx_memoryview_obj {
1763 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1766 PyObject *_array_interface;
1767 PyThread_type_lock lock;
1768 __pyx_atomic_int acquisition_count[2];
1769 __pyx_atomic_int *acquisition_count_aligned_p;
1772 int dtype_is_object;
1773 __Pyx_TypeInfo *typeinfo;
1784 struct __pyx_memoryviewslice_obj {
1785 struct __pyx_memoryview_obj __pyx_base;
1786 __Pyx_memviewslice from_slice;
1787 PyObject *from_object;
1788 PyObject *(*to_object_func)(
char *);
1789 int (*to_dtype_func)(
char *, PyObject *);
1802 struct __pyx_vtabstruct_array {
1803 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1805 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1816 struct __pyx_vtabstruct_memoryview {
1817 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1818 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1819 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1820 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1821 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1822 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1823 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1825 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1836 struct __pyx_vtabstruct__memoryviewslice {
1837 struct __pyx_vtabstruct_memoryview __pyx_base;
1839 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1843 #ifndef CYTHON_REFNANNY
1844 #define CYTHON_REFNANNY 0
1848 void (*INCREF)(
void*, PyObject*, int);
1849 void (*DECREF)(
void*, PyObject*, int);
1850 void (*GOTREF)(
void*, PyObject*, int);
1851 void (*GIVEREF)(
void*, PyObject*, int);
1852 void* (*SetupContext)(
const char*, int,
const char*);
1853 void (*FinishContext)(
void**);
1854 } __Pyx_RefNannyAPIStruct;
1855 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1856 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1857 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1859 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1861 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1862 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1863 PyGILState_Release(__pyx_gilstate_save);\
1865 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1868 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1869 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1871 #define __Pyx_RefNannyFinishContext()\
1872 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1873 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1874 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1875 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1876 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1877 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1878 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1879 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1880 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1882 #define __Pyx_RefNannyDeclarations
1883 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1884 #define __Pyx_RefNannyFinishContext()
1885 #define __Pyx_INCREF(r) Py_INCREF(r)
1886 #define __Pyx_DECREF(r) Py_DECREF(r)
1887 #define __Pyx_GOTREF(r)
1888 #define __Pyx_GIVEREF(r)
1889 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1890 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1891 #define __Pyx_XGOTREF(r)
1892 #define __Pyx_XGIVEREF(r)
1894 #define __Pyx_XDECREF_SET(r, v) do {\
1895 PyObject *tmp = (PyObject *) r;\
1896 r = v; __Pyx_XDECREF(tmp);\
1898 #define __Pyx_DECREF_SET(r, v) do {\
1899 PyObject *tmp = (PyObject *) r;\
1900 r = v; __Pyx_DECREF(tmp);\
1902 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1903 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1906 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1907 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1910 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1913 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1914 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1915 const char* function_name);
1918 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1919 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1920 __Pyx__ArgTypeTest(obj, type, name, exact))
1921 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1924 #if CYTHON_USE_TYPE_SLOTS
1925 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1927 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1931 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1934 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1935 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1936 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1937 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1938 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1939 (cache_var) = (value);
1940 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1941 static PY_UINT64_T __pyx_dict_version = 0;\
1942 static PyObject *__pyx_dict_cached_value = NULL;\
1943 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1944 (VAR) = __pyx_dict_cached_value;\
1946 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1947 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1950 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1951 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1952 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1954 #define __PYX_GET_DICT_VERSION(dict) (0)
1955 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1956 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1960 #if CYTHON_USE_DICT_VERSIONS
1961 #define __Pyx_GetModuleGlobalName(var, name) {\
1962 static PY_UINT64_T __pyx_dict_version = 0;\
1963 static PyObject *__pyx_dict_cached_value = NULL;\
1964 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1965 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1966 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1968 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1969 PY_UINT64_T __pyx_dict_version;\
1970 PyObject *__pyx_dict_cached_value;\
1971 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1973 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1975 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1976 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1977 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1981 #if !CYTHON_COMPILING_IN_PYPY
1982 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1984 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1985 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1989 #if CYTHON_FAST_PYCCALL
1990 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1992 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1996 #if CYTHON_FAST_PYCALL
1997 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1998 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1999 #if 1 || PY_VERSION_HEX < 0x030600B1
2000 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2002 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2004 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2005 (sizeof(char [1 - 2*!(cond)]) - 1)
2006 #ifndef Py_MEMBER_SIZE
2007 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2009 #if CYTHON_FAST_PYCALL
2010 static size_t __pyx_pyframe_localsplus_offset = 0;
2011 #include "frameobject.h"
2012 #if PY_VERSION_HEX >= 0x030b00a6
2013 #ifndef Py_BUILD_CORE
2014 #define Py_BUILD_CORE 1
2016 #include "internal/pycore_frame.h"
2018 #define __Pxy_PyFrame_Initialize_Offsets()\
2019 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2020 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2021 #define __Pyx_PyFrame_GetLocalsplus(frame)\
2022 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2023 #endif // CYTHON_FAST_PYCALL
2027 #if CYTHON_COMPILING_IN_CPYTHON
2028 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2030 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2034 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
2037 #if CYTHON_COMPILING_IN_CPYTHON
2038 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2042 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2045 #if CYTHON_COMPILING_IN_CPYTHON
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2048 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2052 #if CYTHON_USE_EXC_INFO_STACK
2053 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2057 #if CYTHON_FAST_THREAD_STATE
2058 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2059 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2060 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
2062 #define __Pyx_PyThreadState_declare
2063 #define __Pyx_PyThreadState_assign
2064 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
2068 #if CYTHON_FAST_THREAD_STATE
2069 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2070 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2071 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2072 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2074 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2075 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2079 #if CYTHON_FAST_THREAD_STATE
2080 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2081 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2083 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2087 #if CYTHON_FAST_THREAD_STATE
2088 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2089 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2091 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2095 #if CYTHON_FAST_THREAD_STATE
2096 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2097 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2098 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2099 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2100 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2101 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2102 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2103 #if CYTHON_COMPILING_IN_CPYTHON
2104 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2106 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2109 #define __Pyx_PyErr_Clear() PyErr_Clear()
2110 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2111 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2112 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2113 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2114 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2115 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2116 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2120 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2126 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
2129 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2132 #if PY_MAJOR_VERSION >= 3
2133 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2135 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2139 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2142 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2143 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2145 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2146 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2148 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2151 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2152 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2153 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2154 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2155 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2156 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2157 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2158 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2159 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2160 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2161 int wraparound,
int boundscheck);
2162 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2163 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2164 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2165 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2166 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2167 int wraparound,
int boundscheck);
2168 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2169 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2170 int is_list,
int wraparound,
int boundscheck);
2173 #if CYTHON_USE_TYPE_SLOTS
2174 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2176 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2180 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2182 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2184 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2186 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2188 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2190 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2194 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2195 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2196 const char* encoding,
const char* errors,
2197 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2200 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2203 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2206 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2209 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2212 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2215 #if CYTHON_FAST_THREAD_STATE
2216 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2217 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2219 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2223 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2226 #if CYTHON_COMPILING_IN_CPYTHON
2227 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2228 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2229 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2230 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2232 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2233 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2234 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2236 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2238 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2240 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2241 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2242 PyListObject*
L = (PyListObject*) list;
2243 Py_ssize_t len = Py_SIZE(list);
2244 if (likely(
L->allocated > len)) {
2246 PyList_SET_ITEM(list, len, x);
2247 __Pyx_SET_SIZE(list, len + 1);
2250 return PyList_Append(list, x);
2253 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2257 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2258 #if CYTHON_COMPILING_IN_CPYTHON
2259 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2260 if (unlikely(!none))
2265 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2270 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2271 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2272 PyListObject*
L = (PyListObject*) list;
2273 Py_ssize_t len = Py_SIZE(list);
2274 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2276 PyList_SET_ITEM(list, len, x);
2277 __Pyx_SET_SIZE(list, len + 1);
2280 return PyList_Append(list, x);
2283 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2287 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2290 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2293 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2294 int result = PySequence_Contains(seq, item);
2295 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2299 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2302 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2305 #if PY_MAJOR_VERSION < 3
2306 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2307 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2309 #define __Pyx_PyString_Join PyUnicode_Join
2310 #define __Pyx_PyBaseString_Join PyUnicode_Join
2312 #if CYTHON_COMPILING_IN_CPYTHON
2313 #if PY_MAJOR_VERSION < 3
2314 #define __Pyx_PyBytes_Join _PyString_Join
2316 #define __Pyx_PyBytes_Join _PyBytes_Join
2319 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2323 #if PY_MAJOR_VERSION >= 3
2324 #define __Pyx_PyObject_Unicode(obj)\
2325 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2327 #define __Pyx_PyObject_Unicode(obj)\
2328 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2332 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2333 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2335 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2339 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2340 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2342 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2346 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2349 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2352 static int __Pyx_setup_reduce(PyObject* type_obj);
2355 #ifndef __PYX_HAVE_RT_ImportType_proto
2356 #define __PYX_HAVE_RT_ImportType_proto
2357 enum __Pyx_ImportType_CheckSize {
2358 __Pyx_ImportType_CheckSize_Error = 0,
2359 __Pyx_ImportType_CheckSize_Warn = 1,
2360 __Pyx_ImportType_CheckSize_Ignore = 2
2362 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2366 #ifdef CYTHON_CLINE_IN_TRACEBACK
2367 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2369 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2374 PyCodeObject* code_object;
2376 } __Pyx_CodeObjectCacheEntry;
2377 struct __Pyx_CodeObjectCache {
2380 __Pyx_CodeObjectCacheEntry* entries;
2382 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2383 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2384 static PyCodeObject *__pyx_find_code_object(
int code_line);
2385 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2388 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2389 int py_line,
const char *filename);
2392 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2393 #define __Pyx_HAS_GCC_DIAGNOSTIC
2397 static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp);
2398 static CYTHON_INLINE
int __pyx_memview_set_int(
const char *itemp, PyObject *obj);
2403 #define __Pyx_CREAL(z) ((z).real())
2404 #define __Pyx_CIMAG(z) ((z).imag())
2406 #define __Pyx_CREAL(z) (__real__(z))
2407 #define __Pyx_CIMAG(z) (__imag__(z))
2410 #define __Pyx_CREAL(z) ((z).real)
2411 #define __Pyx_CIMAG(z) ((z).imag)
2413 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2414 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2415 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2416 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2418 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2419 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2424 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2425 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2426 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2427 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2428 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2429 #define __Pyx_c_neg_float(a) (-(a))
2431 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2432 #define __Pyx_c_conj_float(z) (::std::conj(z))
2434 #define __Pyx_c_abs_float(z) (::std::abs(z))
2435 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2438 #define __Pyx_c_is_zero_float(z) ((z)==0)
2439 #define __Pyx_c_conj_float(z) (conjf(z))
2441 #define __Pyx_c_abs_float(z) (cabsf(z))
2442 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2446 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2447 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2448 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2449 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2450 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2451 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2452 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2453 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2455 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2456 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2462 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2463 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2464 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2465 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2466 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2467 #define __Pyx_c_neg_double(a) (-(a))
2469 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2470 #define __Pyx_c_conj_double(z) (::std::conj(z))
2472 #define __Pyx_c_abs_double(z) (::std::abs(z))
2473 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2476 #define __Pyx_c_is_zero_double(z) ((z)==0)
2477 #define __Pyx_c_conj_double(z) (conj(z))
2479 #define __Pyx_c_abs_double(z) (cabs(z))
2480 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2484 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2485 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2486 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2487 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2488 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2489 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2490 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2491 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2493 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2494 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2498 #if PY_MAJOR_VERSION < 3
2499 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2500 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2502 #define __Pyx_GetBuffer PyObject_GetBuffer
2503 #define __Pyx_ReleaseBuffer PyBuffer_Release
2509 Py_ssize_t shape, strides, suboffsets;
2510 } __Pyx_Buf_DimInfo;
2516 __Pyx_Buffer *rcbuffer;
2518 __Pyx_Buf_DimInfo diminfo[8];
2519 } __Pyx_LocalBuf_ND;
2522 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2525 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2526 __Pyx_memviewslice *slice2,
2527 int ndim,
size_t itemsize);
2530 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2533 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2536 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2539 struct __pyx_typeinfo_string {
2542 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2545 static __Pyx_memviewslice
2546 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2547 const char *mode,
int ndim,
2548 size_t sizeof_dtype,
int contig_flag,
2549 int dtype_is_object);
2552 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2553 #define __Pyx_MEMVIEW_DIRECT 1
2554 #define __Pyx_MEMVIEW_PTR 2
2555 #define __Pyx_MEMVIEW_FULL 4
2556 #define __Pyx_MEMVIEW_CONTIG 8
2557 #define __Pyx_MEMVIEW_STRIDED 16
2558 #define __Pyx_MEMVIEW_FOLLOW 32
2559 #define __Pyx_IS_C_CONTIG 1
2560 #define __Pyx_IS_F_CONTIG 2
2561 static int __Pyx_init_memviewslice(
2562 struct __pyx_memoryview_obj *memview,
2564 __Pyx_memviewslice *memviewslice,
2565 int memview_is_new_reference);
2566 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
2567 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2568 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
2569 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2570 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2571 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2572 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2573 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2574 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2575 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2578 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2581 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2584 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2587 static int __Pyx_check_binary_version(
void);
2590 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2592 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2593 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2594 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2595 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2596 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2597 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2598 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2599 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2600 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2601 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2612 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2625 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2626 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2627 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2628 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2629 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2630 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2631 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2632 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2633 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2634 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2635 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2636 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2637 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2638 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2639 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2644 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2645 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2646 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2647 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2648 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2649 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2650 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2651 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2652 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2653 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2654 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2655 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2656 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2657 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2658 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2659 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2660 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2661 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2662 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2673 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2678 static PyTypeObject *__pyx_array_type = 0;
2679 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2680 static PyTypeObject *__pyx_memoryview_type = 0;
2681 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2682 static PyObject *
generic = 0;
2683 static PyObject *strided = 0;
2684 static PyObject *indirect = 0;
2685 static PyObject *contiguous = 0;
2686 static PyObject *indirect_contiguous = 0;
2687 static int __pyx_memoryview_thread_locks_used;
2688 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2689 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2690 static void *__pyx_align_pointer(
void *,
size_t);
2691 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2692 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2693 static PyObject *_unellipsify(PyObject *,
int);
2694 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2695 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2696 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2697 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2698 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2699 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2700 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2701 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2702 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2703 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2704 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2705 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2706 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2707 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2708 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2709 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2710 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2711 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2712 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2713 static int __pyx_memoryview_err(PyObject *,
char *);
2714 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2715 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2716 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2717 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2718 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2719 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2720 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2721 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2722 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *);
2723 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2724 #define __Pyx_MODULE_NAME "cpartitioning"
2725 extern int __pyx_module_is_main_cpartitioning;
2726 int __pyx_module_is_main_cpartitioning = 0;
2729 static PyObject *__pyx_builtin_ImportError;
2730 static PyObject *__pyx_builtin_ValueError;
2731 static PyObject *__pyx_builtin_MemoryError;
2732 static PyObject *__pyx_builtin_enumerate;
2733 static PyObject *__pyx_builtin_range;
2734 static PyObject *__pyx_builtin_TypeError;
2735 static PyObject *__pyx_builtin_Ellipsis;
2736 static PyObject *__pyx_builtin_id;
2737 static PyObject *__pyx_builtin_IndexError;
2738 static const char __pyx_k_O[] =
"O";
2739 static const char __pyx_k_T[] =
"T{";
2740 static const char __pyx_k_c[] =
"c";
2741 static const char __pyx_k_s[] =
"(%s)";
2742 static const char __pyx_k_id[] =
"id";
2743 static const char __pyx_k_np[] =
"np";
2744 static const char __pyx_k__22[] =
"^";
2745 static const char __pyx_k__23[] =
"";
2746 static const char __pyx_k__24[] =
":";
2747 static const char __pyx_k__25[] =
"}";
2748 static const char __pyx_k__26[] =
",";
2749 static const char __pyx_k_new[] =
"__new__";
2750 static const char __pyx_k_obj[] =
"obj";
2751 static const char __pyx_k_Comm[] =
"Comm";
2752 static const char __pyx_k_base[] =
"base";
2753 static const char __pyx_k_comm[] =
"comm";
2754 static const char __pyx_k_dict[] =
"__dict__";
2755 static const char __pyx_k_join[] =
"join";
2756 static const char __pyx_k_main[] =
"__main__";
2757 static const char __pyx_k_mode[] =
"mode";
2758 static const char __pyx_k_name[] =
"name";
2759 static const char __pyx_k_ndim[] =
"ndim";
2760 static const char __pyx_k_pack[] =
"pack";
2761 static const char __pyx_k_size[] =
"size";
2762 static const char __pyx_k_step[] =
"step";
2763 static const char __pyx_k_stop[] =
"stop";
2764 static const char __pyx_k_test[] =
"__test__";
2765 static const char __pyx_k_ASCII[] =
"ASCII";
2766 static const char __pyx_k_class[] =
"__class__";
2767 static const char __pyx_k_cmesh[] =
"cmesh";
2768 static const char __pyx_k_error[] =
"error";
2769 static const char __pyx_k_flags[] =
"flags";
2770 static const char __pyx_k_numpy[] =
"numpy";
2771 static const char __pyx_k_range[] =
"range";
2772 static const char __pyx_k_shape[] =
"shape";
2773 static const char __pyx_k_start[] =
"start";
2774 static const char __pyx_k_encode[] =
"encode";
2775 static const char __pyx_k_format[] =
"format";
2776 static const char __pyx_k_import[] =
"__import__";
2777 static const char __pyx_k_nSpace[] =
"nSpace";
2778 static const char __pyx_k_name_2[] =
"__name__";
2779 static const char __pyx_k_pickle[] =
"pickle";
2780 static const char __pyx_k_reduce[] =
"__reduce__";
2781 static const char __pyx_k_struct[] =
"struct";
2782 static const char __pyx_k_unpack[] =
"unpack";
2783 static const char __pyx_k_update[] =
"update";
2784 static const char __pyx_k_asarray[] =
"asarray";
2785 static const char __pyx_k_fortran[] =
"fortran";
2786 static const char __pyx_k_memview[] =
"memview";
2787 static const char __pyx_k_proteus[] =
"proteus";
2788 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2789 static const char __pyx_k_filebase[] =
"filebase";
2790 static const char __pyx_k_getstate[] =
"__getstate__";
2791 static const char __pyx_k_itemsize[] =
"itemsize";
2792 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2793 static const char __pyx_k_setstate[] =
"__setstate__";
2794 static const char __pyx_k_TypeError[] =
"TypeError";
2795 static const char __pyx_k_enumerate[] =
"enumerate";
2796 static const char __pyx_k_indexBase[] =
"indexBase";
2797 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2798 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2799 static const char __pyx_k_IndexError[] =
"IndexError";
2800 static const char __pyx_k_ValueError[] =
"ValueError";
2801 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2802 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2803 static const char __pyx_k_ImportError[] =
"ImportError";
2804 static const char __pyx_k_MemoryError[] =
"MemoryError";
2805 static const char __pyx_k_PickleError[] =
"PickleError";
2806 static const char __pyx_k_nDOF_element[] =
"nDOF_element";
2807 static const char __pyx_k_proteus_Comm[] =
"proteus_Comm";
2808 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2809 static const char __pyx_k_stringsource[] =
"stringsource";
2810 static const char __pyx_k_cpartitioning[] =
"cpartitioning";
2811 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2812 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2813 static const char __pyx_k_nDOF_subdomain[] =
"nDOF_subdomain";
2814 static const char __pyx_k_partitionNodes[] =
"partitionNodes";
2815 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2816 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2817 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2818 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2819 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2820 static const char __pyx_k_subdomain_cmesh[] =
"subdomain_cmesh";
2821 static const char __pyx_k_dg_subdomain_l2g[] =
"dg_subdomain_l2g";
2822 static const char __pyx_k_nLayersOfOverlap[] =
"nLayersOfOverlap";
2823 static const char __pyx_k_max_dof_neighbors[] =
"max_dof_neighbors";
2824 static const char __pyx_k_partitionElements[] =
"partitionElements";
2825 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2826 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2827 static const char __pyx_k_nDOF_all_processes[] =
"nDOF_all_processes";
2828 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2829 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2830 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2831 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2832 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2833 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2834 static const char __pyx_k_quadratic_lagrangeNodes[] =
"quadratic_lagrangeNodes";
2835 static const char __pyx_k_quadratic_subdomain_l2g[] =
"quadratic_subdomain_l2g";
2836 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2837 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2838 static const char __pyx_k_proteus_cpartitioning_pyx[] =
"proteus/cpartitioning.pyx";
2839 static const char __pyx_k_edgeOffsets_subdomain_owned[] =
"edgeOffsets_subdomain_owned";
2840 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2841 static const char __pyx_k_nodeOffsets_subdomain_owned[] =
"nodeOffsets_subdomain_owned";
2842 static const char __pyx_k_convertPUMIPartitionToPython[] =
"convertPUMIPartitionToPython";
2843 static const char __pyx_k_dgNumbering_subdomain2global[] =
"dgNumbering_subdomain2global";
2844 static const char __pyx_k_partitionNodesFromTetgenFiles[] =
"partitionNodesFromTetgenFiles";
2845 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2846 static const char __pyx_k_dg_dof_offsets_subdomain_owned[] =
"dg_dof_offsets_subdomain_owned";
2847 static const char __pyx_k_edgeNumbering_subdomain2global[] =
"edgeNumbering_subdomain2global";
2848 static const char __pyx_k_elementOffsets_subdomain_owned[] =
"elementOffsets_subdomain_owned";
2849 static const char __pyx_k_nodeNumbering_subdomain2global[] =
"nodeNumbering_subdomain2global";
2850 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2851 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2852 static const char __pyx_k_partitionNodesFromTriangleFiles[] =
"partitionNodesFromTriangleFiles";
2853 static const char __pyx_k_quadratic_dof_offsets_subdomain[] =
"quadratic_dof_offsets_subdomain_owned";
2854 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2855 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2856 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2857 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2858 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2859 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2860 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2861 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2862 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2863 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2864 static const char __pyx_k_buildDiscontinuousGalerkinLocal2[] =
"buildDiscontinuousGalerkinLocal2GlobalMappings";
2865 static const char __pyx_k_buildQuadraticCubeLocal2GlobalMa[] =
"buildQuadraticCubeLocal2GlobalMappings";
2866 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob[] =
"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!";
2867 static const char __pyx_k_buildQuadraticLocal2GlobalMappin[] =
"buildQuadraticLocal2GlobalMappings";
2868 static const char __pyx_k_elementBoundaryNumbering_subdoma[] =
"elementBoundaryNumbering_subdomain2global";
2869 static const char __pyx_k_elementBoundaryOffsets_subdomain[] =
"elementBoundaryOffsets_subdomain_owned";
2870 static const char __pyx_k_elementNumbering_subdomain2globa[] =
"elementNumbering_subdomain2global";
2871 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2872 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2873 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2874 static const char __pyx_k_quadraticNumbering_subdomain2glo[] =
"quadraticNumbering_subdomain2global";
2875 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2876 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob_2[] =
"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!";
2877 static PyObject *__pyx_n_s_ASCII;
2878 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2879 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2880 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2881 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2882 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2883 static PyObject *__pyx_n_s_Comm;
2884 static PyObject *__pyx_n_s_Ellipsis;
2885 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2886 static PyObject *__pyx_n_s_ImportError;
2887 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2888 static PyObject *__pyx_n_s_IndexError;
2889 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2890 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2891 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2892 static PyObject *__pyx_n_s_MemoryError;
2893 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2894 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2895 static PyObject *__pyx_n_b_O;
2896 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2897 static PyObject *__pyx_n_s_PickleError;
2898 static PyObject *__pyx_kp_b_T;
2899 static PyObject *__pyx_n_s_TypeError;
2900 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2901 static PyObject *__pyx_n_s_ValueError;
2902 static PyObject *__pyx_n_s_View_MemoryView;
2903 static PyObject *__pyx_kp_b__22;
2904 static PyObject *__pyx_kp_b__23;
2905 static PyObject *__pyx_kp_b__24;
2906 static PyObject *__pyx_kp_b__25;
2907 static PyObject *__pyx_kp_u__26;
2908 static PyObject *__pyx_n_s_allocate_buffer;
2909 static PyObject *__pyx_n_s_asarray;
2910 static PyObject *__pyx_n_s_base;
2911 static PyObject *__pyx_n_s_buildDiscontinuousGalerkinLocal2;
2912 static PyObject *__pyx_n_s_buildQuadraticCubeLocal2GlobalMa;
2913 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob;
2914 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2;
2915 static PyObject *__pyx_n_s_buildQuadraticLocal2GlobalMappin;
2916 static PyObject *__pyx_n_s_c;
2917 static PyObject *__pyx_n_u_c;
2918 static PyObject *__pyx_n_s_class;
2919 static PyObject *__pyx_n_s_cline_in_traceback;
2920 static PyObject *__pyx_n_s_cmesh;
2921 static PyObject *__pyx_n_s_comm;
2922 static PyObject *__pyx_kp_s_contiguous_and_direct;
2923 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2924 static PyObject *__pyx_n_s_convertPUMIPartitionToPython;
2925 static PyObject *__pyx_n_s_cpartitioning;
2926 static PyObject *__pyx_n_s_dgNumbering_subdomain2global;
2927 static PyObject *__pyx_n_s_dg_dof_offsets_subdomain_owned;
2928 static PyObject *__pyx_n_s_dg_subdomain_l2g;
2929 static PyObject *__pyx_n_s_dict;
2930 static PyObject *__pyx_n_s_dtype_is_object;
2931 static PyObject *__pyx_n_s_edgeNumbering_subdomain2global;
2932 static PyObject *__pyx_n_s_edgeOffsets_subdomain_owned;
2933 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
2934 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
2935 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
2936 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
2937 static PyObject *__pyx_n_s_encode;
2938 static PyObject *__pyx_n_s_enumerate;
2939 static PyObject *__pyx_n_s_error;
2940 static PyObject *__pyx_n_s_filebase;
2941 static PyObject *__pyx_n_s_flags;
2942 static PyObject *__pyx_n_s_format;
2943 static PyObject *__pyx_n_s_fortran;
2944 static PyObject *__pyx_n_u_fortran;
2945 static PyObject *__pyx_n_s_getstate;
2946 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2947 static PyObject *__pyx_n_s_id;
2948 static PyObject *__pyx_n_s_import;
2949 static PyObject *__pyx_n_s_indexBase;
2950 static PyObject *__pyx_n_s_itemsize;
2951 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2952 static PyObject *__pyx_n_s_join;
2953 static PyObject *__pyx_n_s_main;
2954 static PyObject *__pyx_n_s_max_dof_neighbors;
2955 static PyObject *__pyx_n_s_memview;
2956 static PyObject *__pyx_n_s_mode;
2957 static PyObject *__pyx_n_s_nDOF_all_processes;
2958 static PyObject *__pyx_n_s_nDOF_element;
2959 static PyObject *__pyx_n_s_nDOF_subdomain;
2960 static PyObject *__pyx_n_s_nLayersOfOverlap;
2961 static PyObject *__pyx_n_s_nSpace;
2962 static PyObject *__pyx_n_s_name;
2963 static PyObject *__pyx_n_s_name_2;
2964 static PyObject *__pyx_n_s_ndim;
2965 static PyObject *__pyx_n_s_new;
2966 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2967 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
2968 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
2969 static PyObject *__pyx_n_s_np;
2970 static PyObject *__pyx_n_s_numpy;
2971 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2972 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2973 static PyObject *__pyx_n_s_obj;
2974 static PyObject *__pyx_n_s_pack;
2975 static PyObject *__pyx_n_s_partitionElements;
2976 static PyObject *__pyx_n_s_partitionNodes;
2977 static PyObject *__pyx_n_s_partitionNodesFromTetgenFiles;
2978 static PyObject *__pyx_n_s_partitionNodesFromTriangleFiles;
2979 static PyObject *__pyx_n_s_pickle;
2980 static PyObject *__pyx_n_s_proteus;
2981 static PyObject *__pyx_n_s_proteus_Comm;
2982 static PyObject *__pyx_kp_s_proteus_cpartitioning_pyx;
2983 static PyObject *__pyx_n_s_pyx_PickleError;
2984 static PyObject *__pyx_n_s_pyx_checksum;
2985 static PyObject *__pyx_n_s_pyx_getbuffer;
2986 static PyObject *__pyx_n_s_pyx_result;
2987 static PyObject *__pyx_n_s_pyx_state;
2988 static PyObject *__pyx_n_s_pyx_type;
2989 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2990 static PyObject *__pyx_n_s_pyx_vtable;
2991 static PyObject *__pyx_n_s_quadraticNumbering_subdomain2glo;
2992 static PyObject *__pyx_n_s_quadratic_dof_offsets_subdomain;
2993 static PyObject *__pyx_n_s_quadratic_lagrangeNodes;
2994 static PyObject *__pyx_n_s_quadratic_subdomain_l2g;
2995 static PyObject *__pyx_n_s_range;
2996 static PyObject *__pyx_n_s_reduce;
2997 static PyObject *__pyx_n_s_reduce_cython;
2998 static PyObject *__pyx_n_s_reduce_ex;
2999 static PyObject *__pyx_kp_u_s;
3000 static PyObject *__pyx_n_s_setstate;
3001 static PyObject *__pyx_n_s_setstate_cython;
3002 static PyObject *__pyx_n_s_shape;
3003 static PyObject *__pyx_n_s_size;
3004 static PyObject *__pyx_n_s_start;
3005 static PyObject *__pyx_n_s_step;
3006 static PyObject *__pyx_n_s_stop;
3007 static PyObject *__pyx_kp_s_strided_and_direct;
3008 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3009 static PyObject *__pyx_kp_s_strided_and_indirect;
3010 static PyObject *__pyx_kp_s_stringsource;
3011 static PyObject *__pyx_n_s_struct;
3012 static PyObject *__pyx_n_s_subdomain_cmesh;
3013 static PyObject *__pyx_n_s_test;
3014 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3015 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3016 static PyObject *__pyx_n_s_unpack;
3017 static PyObject *__pyx_n_s_update;
3018 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3019 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3020 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED
struct PyMPICommObject *__pyx_v_comm,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3021 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3022 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3023 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nSpace,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes);
3024 static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nSpace,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes);
3025 static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nDOF_element,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global);
3026 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
3027 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3028 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3029 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3030 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3031 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3032 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3033 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
3034 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3035 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3036 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3037 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3038 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3039 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3040 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
3041 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3042 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3043 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
3044 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3046 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3047 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3048 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3049 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3050 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3051 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3052 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3053 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3054 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3055 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3056 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3057 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3058 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3059 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3060 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3061 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3062 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3063 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3064 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3065 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3066 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3067 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
3068 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3069 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3070 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3071 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3072 static PyObject *__pyx_int_0;
3073 static PyObject *__pyx_int_1;
3074 static PyObject *__pyx_int_112105877;
3075 static PyObject *__pyx_int_136983863;
3076 static PyObject *__pyx_int_184977713;
3077 static PyObject *__pyx_int_neg_1;
3078 static PyObject *__pyx_tuple_;
3079 static PyObject *__pyx_tuple__2;
3080 static PyObject *__pyx_tuple__3;
3081 static PyObject *__pyx_tuple__4;
3082 static PyObject *__pyx_tuple__5;
3083 static PyObject *__pyx_tuple__6;
3084 static PyObject *__pyx_tuple__7;
3085 static PyObject *__pyx_tuple__8;
3086 static PyObject *__pyx_tuple__9;
3087 static PyObject *__pyx_slice__17;
3088 static PyObject *__pyx_tuple__10;
3089 static PyObject *__pyx_tuple__11;
3090 static PyObject *__pyx_tuple__12;
3091 static PyObject *__pyx_tuple__13;
3092 static PyObject *__pyx_tuple__14;
3093 static PyObject *__pyx_tuple__15;
3094 static PyObject *__pyx_tuple__16;
3095 static PyObject *__pyx_tuple__18;
3096 static PyObject *__pyx_tuple__19;
3097 static PyObject *__pyx_tuple__20;
3098 static PyObject *__pyx_tuple__21;
3099 static PyObject *__pyx_tuple__27;
3100 static PyObject *__pyx_tuple__29;
3101 static PyObject *__pyx_tuple__31;
3102 static PyObject *__pyx_tuple__33;
3103 static PyObject *__pyx_tuple__35;
3104 static PyObject *__pyx_tuple__37;
3105 static PyObject *__pyx_tuple__39;
3106 static PyObject *__pyx_tuple__41;
3107 static PyObject *__pyx_tuple__43;
3108 static PyObject *__pyx_tuple__44;
3109 static PyObject *__pyx_tuple__45;
3110 static PyObject *__pyx_tuple__46;
3111 static PyObject *__pyx_tuple__47;
3112 static PyObject *__pyx_tuple__48;
3113 static PyObject *__pyx_codeobj__28;
3114 static PyObject *__pyx_codeobj__30;
3115 static PyObject *__pyx_codeobj__32;
3116 static PyObject *__pyx_codeobj__34;
3117 static PyObject *__pyx_codeobj__36;
3118 static PyObject *__pyx_codeobj__38;
3119 static PyObject *__pyx_codeobj__40;
3120 static PyObject *__pyx_codeobj__42;
3121 static PyObject *__pyx_codeobj__49;
3133 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3134 static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {
"partitionElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, METH_VARARGS|METH_KEYWORDS, 0};
3135 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3136 struct PyMPICommObject *__pyx_v_comm = 0;
3137 int __pyx_v_nLayersOfOverlap;
3138 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3139 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3140 int __pyx_lineno = 0;
3141 const char *__pyx_filename = NULL;
3142 int __pyx_clineno = 0;
3143 PyObject *__pyx_r = 0;
3144 __Pyx_RefNannyDeclarations
3145 __Pyx_RefNannySetupContext(
"partitionElements (wrapper)", 0);
3147 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3148 PyObject* values[4] = {0,0,0,0};
3149 if (unlikely(__pyx_kwds)) {
3151 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3153 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3155 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3157 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3159 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3162 default:
goto __pyx_L5_argtuple_error;
3164 kw_args = PyDict_Size(__pyx_kwds);
3167 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3168 else goto __pyx_L5_argtuple_error;
3171 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3173 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 20, __pyx_L3_error)
3177 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3179 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 20, __pyx_L3_error)
3183 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3185 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 20, __pyx_L3_error)
3188 if (unlikely(kw_args > 0)) {
3189 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionElements") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
3191 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3192 goto __pyx_L5_argtuple_error;
3194 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3195 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3196 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3197 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3199 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
3200 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
3201 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3202 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3204 goto __pyx_L4_argument_unpacking_done;
3205 __pyx_L5_argtuple_error:;
3206 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 20, __pyx_L3_error)
3208 __Pyx_AddTraceback(
"cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3209 __Pyx_RefNannyFinishContext();
3211 __pyx_L4_argument_unpacking_done:;
3212 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3213 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3214 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3215 __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3222 __Pyx_RefNannyFinishContext();
3226 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3227 PyObject *__pyx_r = NULL;
3228 __Pyx_RefNannyDeclarations
3229 PyObject *__pyx_t_1 = NULL;
3230 PyObject *__pyx_t_2 = NULL;
3231 PyObject *__pyx_t_3 = NULL;
3233 PyObject *__pyx_t_5 = NULL;
3234 Py_ssize_t __pyx_t_6;
3235 struct __pyx_array_obj *__pyx_t_7 = NULL;
3236 PyObject *__pyx_t_8 = NULL;
3237 PyObject *__pyx_t_9 = NULL;
3238 PyObject *__pyx_t_10 = NULL;
3239 PyObject *__pyx_t_11 = NULL;
3240 PyObject *__pyx_t_12 = NULL;
3241 PyObject *__pyx_t_13 = NULL;
3242 PyObject *__pyx_t_14 = NULL;
3243 int __pyx_lineno = 0;
3244 const char *__pyx_filename = NULL;
3245 int __pyx_clineno = 0;
3246 __Pyx_RefNannySetupContext(
"partitionElements", 0);
3255 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3273 __Pyx_XDECREF(__pyx_r);
3282 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3283 __Pyx_GOTREF(__pyx_t_2);
3284 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3285 __Pyx_GOTREF(__pyx_t_3);
3286 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3287 __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3288 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3289 __Pyx_GOTREF(__pyx_t_2);
3290 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3291 __Pyx_GOTREF(__pyx_t_5);
3292 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3293 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L1_error)
3294 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3296 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3297 __PYX_ERR(0, 26, __pyx_L1_error)
3299 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3300 __Pyx_GOTREF(__pyx_t_2);
3301 __pyx_t_5 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3302 __Pyx_GOTREF(__pyx_t_5);
3303 __pyx_t_7 = __pyx_array_new(__pyx_t_5,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_4);
3304 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error)
3305 __Pyx_GOTREF(__pyx_t_7);
3306 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3307 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3309 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3310 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3311 if (likely(__pyx_t_2)) {
3312 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3313 __Pyx_INCREF(__pyx_t_2);
3314 __Pyx_INCREF(
function);
3315 __Pyx_DECREF_SET(__pyx_t_3,
function);
3318 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3319 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3320 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3321 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
3322 __Pyx_GOTREF(__pyx_t_1);
3323 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3332 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3333 __Pyx_GOTREF(__pyx_t_2);
3334 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3335 __Pyx_GOTREF(__pyx_t_5);
3336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3337 __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3339 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3340 __PYX_ERR(0, 27, __pyx_L1_error)
3342 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3343 __Pyx_GOTREF(__pyx_t_8);
3344 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3345 __Pyx_GOTREF(__pyx_t_2);
3346 __pyx_t_7 = __pyx_array_new(__pyx_t_2,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3347 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
3348 __Pyx_GOTREF(__pyx_t_7);
3349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3350 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3352 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3353 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3354 if (likely(__pyx_t_8)) {
3355 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3356 __Pyx_INCREF(__pyx_t_8);
3357 __Pyx_INCREF(
function);
3358 __Pyx_DECREF_SET(__pyx_t_5,
function);
3361 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3362 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3363 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3364 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
3365 __Pyx_GOTREF(__pyx_t_3);
3366 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3375 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3376 __Pyx_GOTREF(__pyx_t_8);
3377 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3378 __Pyx_GOTREF(__pyx_t_2);
3379 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3380 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3381 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3382 __Pyx_GOTREF(__pyx_t_8);
3383 __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3384 __Pyx_GOTREF(__pyx_t_9);
3385 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3386 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error)
3387 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3389 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3390 __PYX_ERR(0, 28, __pyx_L1_error)
3392 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3393 __Pyx_GOTREF(__pyx_t_8);
3394 __pyx_t_9 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3395 __Pyx_GOTREF(__pyx_t_9);
3396 __pyx_t_7 = __pyx_array_new(__pyx_t_9,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3397 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
3398 __Pyx_GOTREF(__pyx_t_7);
3399 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3400 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3402 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3403 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3404 if (likely(__pyx_t_8)) {
3405 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3406 __Pyx_INCREF(__pyx_t_8);
3407 __Pyx_INCREF(
function);
3408 __Pyx_DECREF_SET(__pyx_t_2,
function);
3411 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3412 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3413 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3414 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error)
3415 __Pyx_GOTREF(__pyx_t_5);
3416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3425 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3426 __Pyx_GOTREF(__pyx_t_8);
3427 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error)
3428 __Pyx_GOTREF(__pyx_t_9);
3429 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3430 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3432 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3433 __PYX_ERR(0, 29, __pyx_L1_error)
3435 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3436 __Pyx_GOTREF(__pyx_t_10);
3437 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3438 __Pyx_GOTREF(__pyx_t_8);
3439 __pyx_t_7 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
3440 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
3441 __Pyx_GOTREF(__pyx_t_7);
3442 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3443 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3445 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3446 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3447 if (likely(__pyx_t_10)) {
3448 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
3449 __Pyx_INCREF(__pyx_t_10);
3450 __Pyx_INCREF(
function);
3451 __Pyx_DECREF_SET(__pyx_t_9,
function);
3454 __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3455 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3456 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3457 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
3458 __Pyx_GOTREF(__pyx_t_2);
3459 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3468 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3469 __Pyx_GOTREF(__pyx_t_10);
3470 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
3471 __Pyx_GOTREF(__pyx_t_8);
3472 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3473 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3474 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3475 __Pyx_GOTREF(__pyx_t_10);
3476 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3477 __Pyx_GOTREF(__pyx_t_11);
3478 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3479 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L1_error)
3480 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3482 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3483 __PYX_ERR(0, 30, __pyx_L1_error)
3485 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3486 __Pyx_GOTREF(__pyx_t_10);
3487 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3488 __Pyx_GOTREF(__pyx_t_11);
3489 __pyx_t_7 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
3490 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
3491 __Pyx_GOTREF(__pyx_t_7);
3492 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3493 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3495 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3496 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3497 if (likely(__pyx_t_10)) {
3498 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
3499 __Pyx_INCREF(__pyx_t_10);
3500 __Pyx_INCREF(
function);
3501 __Pyx_DECREF_SET(__pyx_t_8,
function);
3504 __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3505 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3506 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3507 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 30, __pyx_L1_error)
3508 __Pyx_GOTREF(__pyx_t_9);
3509 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3518 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3519 __Pyx_GOTREF(__pyx_t_10);
3520 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 31, __pyx_L1_error)
3521 __Pyx_GOTREF(__pyx_t_11);
3522 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3523 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3525 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3526 __PYX_ERR(0, 31, __pyx_L1_error)
3528 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3529 __Pyx_GOTREF(__pyx_t_12);
3530 __pyx_t_10 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_10);
3532 __pyx_t_7 = __pyx_array_new(__pyx_t_10,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
3533 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
3534 __Pyx_GOTREF(__pyx_t_7);
3535 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3536 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3538 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3539 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
3540 if (likely(__pyx_t_12)) {
3541 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
3542 __Pyx_INCREF(__pyx_t_12);
3543 __Pyx_INCREF(
function);
3544 __Pyx_DECREF_SET(__pyx_t_11,
function);
3547 __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
3548 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3549 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3550 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 31, __pyx_L1_error)
3551 __Pyx_GOTREF(__pyx_t_8);
3552 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3561 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3562 __Pyx_GOTREF(__pyx_t_12);
3563 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error)
3564 __Pyx_GOTREF(__pyx_t_10);
3565 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3566 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
3567 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3568 __Pyx_GOTREF(__pyx_t_12);
3569 __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3570 __Pyx_GOTREF(__pyx_t_13);
3571 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3572 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error)
3573 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3575 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3576 __PYX_ERR(0, 32, __pyx_L1_error)
3578 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3579 __Pyx_GOTREF(__pyx_t_12);
3580 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3581 __Pyx_GOTREF(__pyx_t_13);
3582 __pyx_t_7 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
3583 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
3584 __Pyx_GOTREF(__pyx_t_7);
3585 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3586 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3588 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3589 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
3590 if (likely(__pyx_t_12)) {
3591 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
3592 __Pyx_INCREF(__pyx_t_12);
3593 __Pyx_INCREF(
function);
3594 __Pyx_DECREF_SET(__pyx_t_10,
function);
3597 __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
3598 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3599 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3600 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 32, __pyx_L1_error)
3601 __Pyx_GOTREF(__pyx_t_11);
3602 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3611 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3612 __Pyx_GOTREF(__pyx_t_12);
3613 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 33, __pyx_L1_error)
3614 __Pyx_GOTREF(__pyx_t_13);
3615 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3616 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
3618 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3619 __PYX_ERR(0, 33, __pyx_L1_error)
3621 __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 33, __pyx_L1_error)
3622 __Pyx_GOTREF(__pyx_t_14);
3623 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3624 __Pyx_GOTREF(__pyx_t_12);
3625 __pyx_t_7 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_14), (
char *)
"c", (
char *) __pyx_t_4);
3626 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)
3627 __Pyx_GOTREF(__pyx_t_7);
3628 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3629 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3631 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
3632 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3633 if (likely(__pyx_t_14)) {
3634 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
3635 __Pyx_INCREF(__pyx_t_14);
3636 __Pyx_INCREF(
function);
3637 __Pyx_DECREF_SET(__pyx_t_13,
function);
3640 __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
3641 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3642 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3643 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 33, __pyx_L1_error)
3644 __Pyx_GOTREF(__pyx_t_10);
3645 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3654 __pyx_t_13 = PyTuple_New(8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 26, __pyx_L1_error)
3655 __Pyx_GOTREF(__pyx_t_13);
3656 __Pyx_GIVEREF(__pyx_t_1);
3657 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
3658 __Pyx_GIVEREF(__pyx_t_3);
3659 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
3660 __Pyx_GIVEREF(__pyx_t_5);
3661 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
3662 __Pyx_GIVEREF(__pyx_t_2);
3663 PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
3664 __Pyx_GIVEREF(__pyx_t_9);
3665 PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
3666 __Pyx_GIVEREF(__pyx_t_8);
3667 PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
3668 __Pyx_GIVEREF(__pyx_t_11);
3669 PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
3670 __Pyx_GIVEREF(__pyx_t_10);
3671 PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
3680 __pyx_r = __pyx_t_13;
3694 __Pyx_XDECREF(__pyx_t_1);
3695 __Pyx_XDECREF(__pyx_t_2);
3696 __Pyx_XDECREF(__pyx_t_3);
3697 __Pyx_XDECREF(__pyx_t_5);
3698 __Pyx_XDECREF(((PyObject *)__pyx_t_7));
3699 __Pyx_XDECREF(__pyx_t_8);
3700 __Pyx_XDECREF(__pyx_t_9);
3701 __Pyx_XDECREF(__pyx_t_10);
3702 __Pyx_XDECREF(__pyx_t_11);
3703 __Pyx_XDECREF(__pyx_t_12);
3704 __Pyx_XDECREF(__pyx_t_13);
3705 __Pyx_XDECREF(__pyx_t_14);
3706 __Pyx_AddTraceback(
"cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3709 __Pyx_XGIVEREF(__pyx_r);
3710 __Pyx_RefNannyFinishContext();
3723 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3724 static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {
"partitionNodes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, METH_VARARGS|METH_KEYWORDS, 0};
3725 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3726 struct PyMPICommObject *__pyx_v_comm = 0;
3727 int __pyx_v_nLayersOfOverlap;
3728 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3729 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3730 int __pyx_lineno = 0;
3731 const char *__pyx_filename = NULL;
3732 int __pyx_clineno = 0;
3733 PyObject *__pyx_r = 0;
3734 __Pyx_RefNannyDeclarations
3735 __Pyx_RefNannySetupContext(
"partitionNodes (wrapper)", 0);
3737 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3738 PyObject* values[4] = {0,0,0,0};
3739 if (unlikely(__pyx_kwds)) {
3741 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3743 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3745 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3747 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3749 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3752 default:
goto __pyx_L5_argtuple_error;
3754 kw_args = PyDict_Size(__pyx_kwds);
3757 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3758 else goto __pyx_L5_argtuple_error;
3761 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3763 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 36, __pyx_L3_error)
3767 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3769 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 36, __pyx_L3_error)
3773 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3775 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 36, __pyx_L3_error)
3778 if (unlikely(kw_args > 0)) {
3779 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionNodes") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
3781 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3782 goto __pyx_L5_argtuple_error;
3784 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3785 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3786 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3787 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3789 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
3790 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
3791 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3792 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3794 goto __pyx_L4_argument_unpacking_done;
3795 __pyx_L5_argtuple_error:;
3796 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
3798 __Pyx_AddTraceback(
"cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3799 __Pyx_RefNannyFinishContext();
3801 __pyx_L4_argument_unpacking_done:;
3802 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3803 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3804 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3805 __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3812 __Pyx_RefNannyFinishContext();
3816 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3817 PyObject *__pyx_r = NULL;
3818 __Pyx_RefNannyDeclarations
3819 PyObject *__pyx_t_1 = NULL;
3820 PyObject *__pyx_t_2 = NULL;
3821 PyObject *__pyx_t_3 = NULL;
3823 PyObject *__pyx_t_5 = NULL;
3824 Py_ssize_t __pyx_t_6;
3825 struct __pyx_array_obj *__pyx_t_7 = NULL;
3826 PyObject *__pyx_t_8 = NULL;
3827 PyObject *__pyx_t_9 = NULL;
3828 PyObject *__pyx_t_10 = NULL;
3829 PyObject *__pyx_t_11 = NULL;
3830 PyObject *__pyx_t_12 = NULL;
3831 PyObject *__pyx_t_13 = NULL;
3832 PyObject *__pyx_t_14 = NULL;
3833 int __pyx_lineno = 0;
3834 const char *__pyx_filename = NULL;
3835 int __pyx_clineno = 0;
3836 __Pyx_RefNannySetupContext(
"partitionNodes", 0);
3845 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3863 __Pyx_XDECREF(__pyx_r);
3872 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3873 __Pyx_GOTREF(__pyx_t_2);
3874 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3875 __Pyx_GOTREF(__pyx_t_3);
3876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3877 __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3878 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_2);
3880 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3881 __Pyx_GOTREF(__pyx_t_5);
3882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3883 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error)
3884 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3886 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3887 __PYX_ERR(0, 42, __pyx_L1_error)
3889 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3890 __Pyx_GOTREF(__pyx_t_2);
3891 __pyx_t_5 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3892 __Pyx_GOTREF(__pyx_t_5);
3893 __pyx_t_7 = __pyx_array_new(__pyx_t_5,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_4);
3894 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3895 __Pyx_GOTREF(__pyx_t_7);
3896 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3899 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3900 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3901 if (likely(__pyx_t_2)) {
3902 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3903 __Pyx_INCREF(__pyx_t_2);
3904 __Pyx_INCREF(
function);
3905 __Pyx_DECREF_SET(__pyx_t_3,
function);
3908 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3909 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3910 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3911 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
3912 __Pyx_GOTREF(__pyx_t_1);
3913 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3922 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3923 __Pyx_GOTREF(__pyx_t_2);
3924 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
3925 __Pyx_GOTREF(__pyx_t_5);
3926 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3927 __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3929 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3930 __PYX_ERR(0, 43, __pyx_L1_error)
3932 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_8);
3934 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3935 __Pyx_GOTREF(__pyx_t_2);
3936 __pyx_t_7 = __pyx_array_new(__pyx_t_2,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3937 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3938 __Pyx_GOTREF(__pyx_t_7);
3939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3940 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3942 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3943 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3944 if (likely(__pyx_t_8)) {
3945 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3946 __Pyx_INCREF(__pyx_t_8);
3947 __Pyx_INCREF(
function);
3948 __Pyx_DECREF_SET(__pyx_t_5,
function);
3951 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3952 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3953 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3954 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3955 __Pyx_GOTREF(__pyx_t_3);
3956 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3965 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3966 __Pyx_GOTREF(__pyx_t_8);
3967 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3968 __Pyx_GOTREF(__pyx_t_2);
3969 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3970 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3971 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3972 __Pyx_GOTREF(__pyx_t_8);
3973 __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3974 __Pyx_GOTREF(__pyx_t_9);
3975 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3976 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
3977 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3979 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3980 __PYX_ERR(0, 44, __pyx_L1_error)
3982 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3983 __Pyx_GOTREF(__pyx_t_8);
3984 __pyx_t_9 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3985 __Pyx_GOTREF(__pyx_t_9);
3986 __pyx_t_7 = __pyx_array_new(__pyx_t_9,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3987 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
3988 __Pyx_GOTREF(__pyx_t_7);
3989 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3990 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3992 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3993 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3994 if (likely(__pyx_t_8)) {
3995 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3996 __Pyx_INCREF(__pyx_t_8);
3997 __Pyx_INCREF(
function);
3998 __Pyx_DECREF_SET(__pyx_t_2,
function);
4001 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4002 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4003 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4004 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error)
4005 __Pyx_GOTREF(__pyx_t_5);
4006 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4015 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
4016 __Pyx_GOTREF(__pyx_t_8);
4017 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
4018 __Pyx_GOTREF(__pyx_t_9);
4019 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4020 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4022 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4023 __PYX_ERR(0, 45, __pyx_L1_error)
4025 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
4026 __Pyx_GOTREF(__pyx_t_10);
4027 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
4028 __Pyx_GOTREF(__pyx_t_8);
4029 __pyx_t_7 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4030 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
4031 __Pyx_GOTREF(__pyx_t_7);
4032 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4033 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4035 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4036 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4037 if (likely(__pyx_t_10)) {
4038 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
4039 __Pyx_INCREF(__pyx_t_10);
4040 __Pyx_INCREF(
function);
4041 __Pyx_DECREF_SET(__pyx_t_9,
function);
4044 __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4045 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4046 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4047 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
4048 __Pyx_GOTREF(__pyx_t_2);
4049 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4058 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4059 __Pyx_GOTREF(__pyx_t_10);
4060 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
4061 __Pyx_GOTREF(__pyx_t_8);
4062 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4063 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4064 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4065 __Pyx_GOTREF(__pyx_t_10);
4066 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
4067 __Pyx_GOTREF(__pyx_t_11);
4068 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4069 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
4070 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4072 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4073 __PYX_ERR(0, 46, __pyx_L1_error)
4075 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4076 __Pyx_GOTREF(__pyx_t_10);
4077 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
4078 __Pyx_GOTREF(__pyx_t_11);
4079 __pyx_t_7 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4080 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error)
4081 __Pyx_GOTREF(__pyx_t_7);
4082 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4083 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4085 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4086 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4087 if (likely(__pyx_t_10)) {
4088 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
4089 __Pyx_INCREF(__pyx_t_10);
4090 __Pyx_INCREF(
function);
4091 __Pyx_DECREF_SET(__pyx_t_8,
function);
4094 __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4095 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4096 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4097 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error)
4098 __Pyx_GOTREF(__pyx_t_9);
4099 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4108 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4109 __Pyx_GOTREF(__pyx_t_10);
4110 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
4111 __Pyx_GOTREF(__pyx_t_11);
4112 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4113 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4115 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4116 __PYX_ERR(0, 47, __pyx_L1_error)
4118 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4119 __Pyx_GOTREF(__pyx_t_12);
4120 __pyx_t_10 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4121 __Pyx_GOTREF(__pyx_t_10);
4122 __pyx_t_7 = __pyx_array_new(__pyx_t_10,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4123 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
4124 __Pyx_GOTREF(__pyx_t_7);
4125 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4126 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4128 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4129 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4130 if (likely(__pyx_t_12)) {
4131 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
4132 __Pyx_INCREF(__pyx_t_12);
4133 __Pyx_INCREF(
function);
4134 __Pyx_DECREF_SET(__pyx_t_11,
function);
4137 __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4138 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4139 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4140 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error)
4141 __Pyx_GOTREF(__pyx_t_8);
4142 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4151 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4152 __Pyx_GOTREF(__pyx_t_12);
4153 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
4154 __Pyx_GOTREF(__pyx_t_10);
4155 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4156 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4157 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4158 __Pyx_GOTREF(__pyx_t_12);
4159 __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4160 __Pyx_GOTREF(__pyx_t_13);
4161 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4162 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error)
4163 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4165 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4166 __PYX_ERR(0, 48, __pyx_L1_error)
4168 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4169 __Pyx_GOTREF(__pyx_t_12);
4170 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4171 __Pyx_GOTREF(__pyx_t_13);
4172 __pyx_t_7 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4173 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4174 __Pyx_GOTREF(__pyx_t_7);
4175 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4176 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4178 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4179 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4180 if (likely(__pyx_t_12)) {
4181 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
4182 __Pyx_INCREF(__pyx_t_12);
4183 __Pyx_INCREF(
function);
4184 __Pyx_DECREF_SET(__pyx_t_10,
function);
4187 __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4188 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4189 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4190 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 48, __pyx_L1_error)
4191 __Pyx_GOTREF(__pyx_t_11);
4192 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4201 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4202 __Pyx_GOTREF(__pyx_t_12);
4203 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 49, __pyx_L1_error)
4204 __Pyx_GOTREF(__pyx_t_13);
4205 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4206 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4208 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4209 __PYX_ERR(0, 49, __pyx_L1_error)
4211 __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 49, __pyx_L1_error)
4212 __Pyx_GOTREF(__pyx_t_14);
4213 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4214 __Pyx_GOTREF(__pyx_t_12);
4215 __pyx_t_7 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_14), (
char *)
"c", (
char *) __pyx_t_4);
4216 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error)
4217 __Pyx_GOTREF(__pyx_t_7);
4218 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4219 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4221 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4222 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4223 if (likely(__pyx_t_14)) {
4224 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
4225 __Pyx_INCREF(__pyx_t_14);
4226 __Pyx_INCREF(
function);
4227 __Pyx_DECREF_SET(__pyx_t_13,
function);
4230 __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4231 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4232 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4233 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error)
4234 __Pyx_GOTREF(__pyx_t_10);
4235 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4244 __pyx_t_13 = PyTuple_New(8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 42, __pyx_L1_error)
4245 __Pyx_GOTREF(__pyx_t_13);
4246 __Pyx_GIVEREF(__pyx_t_1);
4247 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4248 __Pyx_GIVEREF(__pyx_t_3);
4249 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4250 __Pyx_GIVEREF(__pyx_t_5);
4251 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4252 __Pyx_GIVEREF(__pyx_t_2);
4253 PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4254 __Pyx_GIVEREF(__pyx_t_9);
4255 PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4256 __Pyx_GIVEREF(__pyx_t_8);
4257 PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4258 __Pyx_GIVEREF(__pyx_t_11);
4259 PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4260 __Pyx_GIVEREF(__pyx_t_10);
4261 PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4270 __pyx_r = __pyx_t_13;
4284 __Pyx_XDECREF(__pyx_t_1);
4285 __Pyx_XDECREF(__pyx_t_2);
4286 __Pyx_XDECREF(__pyx_t_3);
4287 __Pyx_XDECREF(__pyx_t_5);
4288 __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4289 __Pyx_XDECREF(__pyx_t_8);
4290 __Pyx_XDECREF(__pyx_t_9);
4291 __Pyx_XDECREF(__pyx_t_10);
4292 __Pyx_XDECREF(__pyx_t_11);
4293 __Pyx_XDECREF(__pyx_t_12);
4294 __Pyx_XDECREF(__pyx_t_13);
4295 __Pyx_XDECREF(__pyx_t_14);
4296 __Pyx_AddTraceback(
"cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299 __Pyx_XGIVEREF(__pyx_r);
4300 __Pyx_RefNannyFinishContext();
4313 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4314 static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {
"convertPUMIPartitionToPython", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, METH_VARARGS|METH_KEYWORDS, 0};
4315 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4316 CYTHON_UNUSED
struct PyMPICommObject *__pyx_v_comm = 0;
4317 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4318 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4319 int __pyx_lineno = 0;
4320 const char *__pyx_filename = NULL;
4321 int __pyx_clineno = 0;
4322 PyObject *__pyx_r = 0;
4323 __Pyx_RefNannyDeclarations
4324 __Pyx_RefNannySetupContext(
"convertPUMIPartitionToPython (wrapper)", 0);
4326 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4327 PyObject* values[3] = {0,0,0};
4328 if (unlikely(__pyx_kwds)) {
4330 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4332 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4334 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4336 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4339 default:
goto __pyx_L5_argtuple_error;
4341 kw_args = PyDict_Size(__pyx_kwds);
4344 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4345 else goto __pyx_L5_argtuple_error;
4348 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4350 __Pyx_RaiseArgtupleInvalid(
"convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 52, __pyx_L3_error)
4354 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4356 __Pyx_RaiseArgtupleInvalid(
"convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 52, __pyx_L3_error)
4359 if (unlikely(kw_args > 0)) {
4360 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"convertPUMIPartitionToPython") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
4362 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4363 goto __pyx_L5_argtuple_error;
4365 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4366 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4367 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4369 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
4370 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4371 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
4373 goto __pyx_L4_argument_unpacking_done;
4374 __pyx_L5_argtuple_error:;
4375 __Pyx_RaiseArgtupleInvalid(
"convertPUMIPartitionToPython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
4377 __Pyx_AddTraceback(
"cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4378 __Pyx_RefNannyFinishContext();
4380 __pyx_L4_argument_unpacking_done:;
4381 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4382 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4383 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4384 __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4391 __Pyx_RefNannyFinishContext();
4395 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED
struct PyMPICommObject *__pyx_v_comm,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4396 PyObject *__pyx_r = NULL;
4397 __Pyx_RefNannyDeclarations
4398 PyObject *__pyx_t_1 = NULL;
4399 PyObject *__pyx_t_2 = NULL;
4400 PyObject *__pyx_t_3 = NULL;
4402 PyObject *__pyx_t_5 = NULL;
4403 Py_ssize_t __pyx_t_6;
4404 struct __pyx_array_obj *__pyx_t_7 = NULL;
4405 PyObject *__pyx_t_8 = NULL;
4406 PyObject *__pyx_t_9 = NULL;
4407 PyObject *__pyx_t_10 = NULL;
4408 PyObject *__pyx_t_11 = NULL;
4409 PyObject *__pyx_t_12 = NULL;
4410 PyObject *__pyx_t_13 = NULL;
4411 PyObject *__pyx_t_14 = NULL;
4412 int __pyx_lineno = 0;
4413 const char *__pyx_filename = NULL;
4414 int __pyx_clineno = 0;
4415 __Pyx_RefNannySetupContext(
"convertPUMIPartitionToPython", 0);
4424 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4433 __Pyx_XDECREF(__pyx_r);
4442 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4443 __Pyx_GOTREF(__pyx_t_2);
4444 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4445 __Pyx_GOTREF(__pyx_t_3);
4446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4447 __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4448 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4449 __Pyx_GOTREF(__pyx_t_2);
4450 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4451 __Pyx_GOTREF(__pyx_t_5);
4452 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4453 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
4454 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4456 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4457 __PYX_ERR(0, 56, __pyx_L1_error)
4459 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4460 __Pyx_GOTREF(__pyx_t_2);
4461 __pyx_t_5 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4462 __Pyx_GOTREF(__pyx_t_5);
4463 __pyx_t_7 = __pyx_array_new(__pyx_t_5,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_4);
4464 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
4465 __Pyx_GOTREF(__pyx_t_7);
4466 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4467 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4469 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4470 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4471 if (likely(__pyx_t_2)) {
4472 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4473 __Pyx_INCREF(__pyx_t_2);
4474 __Pyx_INCREF(
function);
4475 __Pyx_DECREF_SET(__pyx_t_3,
function);
4478 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
4479 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4480 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4481 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
4482 __Pyx_GOTREF(__pyx_t_1);
4483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4492 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4493 __Pyx_GOTREF(__pyx_t_2);
4494 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
4495 __Pyx_GOTREF(__pyx_t_5);
4496 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4497 __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
4499 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4500 __PYX_ERR(0, 57, __pyx_L1_error)
4502 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4503 __Pyx_GOTREF(__pyx_t_8);
4504 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4505 __Pyx_GOTREF(__pyx_t_2);
4506 __pyx_t_7 = __pyx_array_new(__pyx_t_2,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
4507 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
4508 __Pyx_GOTREF(__pyx_t_7);
4509 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4510 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4512 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4513 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
4514 if (likely(__pyx_t_8)) {
4515 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
4516 __Pyx_INCREF(__pyx_t_8);
4517 __Pyx_INCREF(
function);
4518 __Pyx_DECREF_SET(__pyx_t_5,
function);
4521 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
4522 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4523 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4524 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
4525 __Pyx_GOTREF(__pyx_t_3);
4526 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4535 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4536 __Pyx_GOTREF(__pyx_t_8);
4537 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
4538 __Pyx_GOTREF(__pyx_t_2);
4539 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4540 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
4541 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4542 __Pyx_GOTREF(__pyx_t_8);
4543 __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4544 __Pyx_GOTREF(__pyx_t_9);
4545 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4546 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
4547 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4549 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4550 __PYX_ERR(0, 58, __pyx_L1_error)
4552 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4553 __Pyx_GOTREF(__pyx_t_8);
4554 __pyx_t_9 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4555 __Pyx_GOTREF(__pyx_t_9);
4556 __pyx_t_7 = __pyx_array_new(__pyx_t_9,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
4557 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
4558 __Pyx_GOTREF(__pyx_t_7);
4559 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4560 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4562 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4563 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
4564 if (likely(__pyx_t_8)) {
4565 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4566 __Pyx_INCREF(__pyx_t_8);
4567 __Pyx_INCREF(
function);
4568 __Pyx_DECREF_SET(__pyx_t_2,
function);
4571 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4572 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4573 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4574 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
4575 __Pyx_GOTREF(__pyx_t_5);
4576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4585 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4586 __Pyx_GOTREF(__pyx_t_8);
4587 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
4588 __Pyx_GOTREF(__pyx_t_9);
4589 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4590 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4592 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4593 __PYX_ERR(0, 59, __pyx_L1_error)
4595 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4596 __Pyx_GOTREF(__pyx_t_10);
4597 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4598 __Pyx_GOTREF(__pyx_t_8);
4599 __pyx_t_7 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4600 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
4601 __Pyx_GOTREF(__pyx_t_7);
4602 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4603 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4605 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4606 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4607 if (likely(__pyx_t_10)) {
4608 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
4609 __Pyx_INCREF(__pyx_t_10);
4610 __Pyx_INCREF(
function);
4611 __Pyx_DECREF_SET(__pyx_t_9,
function);
4614 __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4615 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4616 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4617 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
4618 __Pyx_GOTREF(__pyx_t_2);
4619 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4628 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4629 __Pyx_GOTREF(__pyx_t_10);
4630 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
4631 __Pyx_GOTREF(__pyx_t_8);
4632 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4633 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4634 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4635 __Pyx_GOTREF(__pyx_t_10);
4636 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4637 __Pyx_GOTREF(__pyx_t_11);
4638 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4639 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
4640 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4642 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4643 __PYX_ERR(0, 60, __pyx_L1_error)
4645 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4646 __Pyx_GOTREF(__pyx_t_10);
4647 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4648 __Pyx_GOTREF(__pyx_t_11);
4649 __pyx_t_7 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4650 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
4651 __Pyx_GOTREF(__pyx_t_7);
4652 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4653 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4655 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4656 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4657 if (likely(__pyx_t_10)) {
4658 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
4659 __Pyx_INCREF(__pyx_t_10);
4660 __Pyx_INCREF(
function);
4661 __Pyx_DECREF_SET(__pyx_t_8,
function);
4664 __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4665 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4666 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4667 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error)
4668 __Pyx_GOTREF(__pyx_t_9);
4669 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4678 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4679 __Pyx_GOTREF(__pyx_t_10);
4680 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
4681 __Pyx_GOTREF(__pyx_t_11);
4682 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4683 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4685 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4686 __PYX_ERR(0, 61, __pyx_L1_error)
4688 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4689 __Pyx_GOTREF(__pyx_t_12);
4690 __pyx_t_10 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4691 __Pyx_GOTREF(__pyx_t_10);
4692 __pyx_t_7 = __pyx_array_new(__pyx_t_10,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4693 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
4694 __Pyx_GOTREF(__pyx_t_7);
4695 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4696 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4698 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4699 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4700 if (likely(__pyx_t_12)) {
4701 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
4702 __Pyx_INCREF(__pyx_t_12);
4703 __Pyx_INCREF(
function);
4704 __Pyx_DECREF_SET(__pyx_t_11,
function);
4707 __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4708 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4709 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4710 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
4711 __Pyx_GOTREF(__pyx_t_8);
4712 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4721 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4722 __Pyx_GOTREF(__pyx_t_12);
4723 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
4724 __Pyx_GOTREF(__pyx_t_10);
4725 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4726 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4727 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4728 __Pyx_GOTREF(__pyx_t_12);
4729 __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4730 __Pyx_GOTREF(__pyx_t_13);
4731 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4732 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
4733 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4735 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4736 __PYX_ERR(0, 62, __pyx_L1_error)
4738 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4739 __Pyx_GOTREF(__pyx_t_12);
4740 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4741 __Pyx_GOTREF(__pyx_t_13);
4742 __pyx_t_7 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4743 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
4744 __Pyx_GOTREF(__pyx_t_7);
4745 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4746 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4748 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4749 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4750 if (likely(__pyx_t_12)) {
4751 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
4752 __Pyx_INCREF(__pyx_t_12);
4753 __Pyx_INCREF(
function);
4754 __Pyx_DECREF_SET(__pyx_t_10,
function);
4757 __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4758 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4759 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4760 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 62, __pyx_L1_error)
4761 __Pyx_GOTREF(__pyx_t_11);
4762 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4771 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4772 __Pyx_GOTREF(__pyx_t_12);
4773 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 63, __pyx_L1_error)
4774 __Pyx_GOTREF(__pyx_t_13);
4775 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4776 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4778 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4779 __PYX_ERR(0, 63, __pyx_L1_error)
4781 __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4782 __Pyx_GOTREF(__pyx_t_14);
4783 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4784 __Pyx_GOTREF(__pyx_t_12);
4785 __pyx_t_7 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_14), (
char *)
"c", (
char *) __pyx_t_4);
4786 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error)
4787 __Pyx_GOTREF(__pyx_t_7);
4788 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4789 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4791 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4792 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4793 if (likely(__pyx_t_14)) {
4794 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
4795 __Pyx_INCREF(__pyx_t_14);
4796 __Pyx_INCREF(
function);
4797 __Pyx_DECREF_SET(__pyx_t_13,
function);
4800 __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4801 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4802 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4803 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 63, __pyx_L1_error)
4804 __Pyx_GOTREF(__pyx_t_10);
4805 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4814 __pyx_t_13 = PyTuple_New(8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error)
4815 __Pyx_GOTREF(__pyx_t_13);
4816 __Pyx_GIVEREF(__pyx_t_1);
4817 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4818 __Pyx_GIVEREF(__pyx_t_3);
4819 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4820 __Pyx_GIVEREF(__pyx_t_5);
4821 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4822 __Pyx_GIVEREF(__pyx_t_2);
4823 PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4824 __Pyx_GIVEREF(__pyx_t_9);
4825 PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4826 __Pyx_GIVEREF(__pyx_t_8);
4827 PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4828 __Pyx_GIVEREF(__pyx_t_11);
4829 PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4830 __Pyx_GIVEREF(__pyx_t_10);
4831 PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4840 __pyx_r = __pyx_t_13;
4854 __Pyx_XDECREF(__pyx_t_1);
4855 __Pyx_XDECREF(__pyx_t_2);
4856 __Pyx_XDECREF(__pyx_t_3);
4857 __Pyx_XDECREF(__pyx_t_5);
4858 __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4859 __Pyx_XDECREF(__pyx_t_8);
4860 __Pyx_XDECREF(__pyx_t_9);
4861 __Pyx_XDECREF(__pyx_t_10);
4862 __Pyx_XDECREF(__pyx_t_11);
4863 __Pyx_XDECREF(__pyx_t_12);
4864 __Pyx_XDECREF(__pyx_t_13);
4865 __Pyx_XDECREF(__pyx_t_14);
4866 __Pyx_AddTraceback(
"cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4869 __Pyx_XGIVEREF(__pyx_r);
4870 __Pyx_RefNannyFinishContext();
4883 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4884 static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {
"partitionNodesFromTetgenFiles", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, METH_VARARGS|METH_KEYWORDS, 0};
4885 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4886 struct PyMPICommObject *__pyx_v_comm = 0;
4887 PyObject *__pyx_v_filebase = 0;
4888 int __pyx_v_indexBase;
4889 int __pyx_v_nLayersOfOverlap;
4890 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4891 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4892 int __pyx_lineno = 0;
4893 const char *__pyx_filename = NULL;
4894 int __pyx_clineno = 0;
4895 PyObject *__pyx_r = 0;
4896 __Pyx_RefNannyDeclarations
4897 __Pyx_RefNannySetupContext(
"partitionNodesFromTetgenFiles (wrapper)", 0);
4899 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4900 PyObject* values[6] = {0,0,0,0,0,0};
4901 if (unlikely(__pyx_kwds)) {
4903 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4905 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4907 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4909 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4911 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4913 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4915 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4918 default:
goto __pyx_L5_argtuple_error;
4920 kw_args = PyDict_Size(__pyx_kwds);
4923 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4924 else goto __pyx_L5_argtuple_error;
4927 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4929 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 66, __pyx_L3_error)
4933 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4935 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 66, __pyx_L3_error)
4939 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4941 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 66, __pyx_L3_error)
4945 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4947 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 66, __pyx_L3_error)
4951 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4953 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 66, __pyx_L3_error)
4956 if (unlikely(kw_args > 0)) {
4957 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionNodesFromTetgenFiles") < 0)) __PYX_ERR(0, 66, __pyx_L3_error)
4959 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4960 goto __pyx_L5_argtuple_error;
4962 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4963 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4964 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4965 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4966 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4967 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4969 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
4970 __pyx_v_filebase = values[1];
4971 __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_indexBase == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4972 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4973 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
4974 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
4976 goto __pyx_L4_argument_unpacking_done;
4977 __pyx_L5_argtuple_error:;
4978 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 66, __pyx_L3_error)
4980 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4981 __Pyx_RefNannyFinishContext();
4983 __pyx_L4_argument_unpacking_done:;
4984 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4985 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4986 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4987 __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4994 __Pyx_RefNannyFinishContext();
4998 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4999 PyObject *__pyx_r = NULL;
5000 __Pyx_RefNannyDeclarations
5003 PyObject *__pyx_t_3 = NULL;
5004 PyObject *__pyx_t_4 = NULL;
5005 PyObject *__pyx_t_5 = NULL;
5008 PyObject *__pyx_t_8 = NULL;
5009 Py_ssize_t __pyx_t_9;
5010 struct __pyx_array_obj *__pyx_t_10 = NULL;
5011 PyObject *__pyx_t_11 = NULL;
5012 PyObject *__pyx_t_12 = NULL;
5013 PyObject *__pyx_t_13 = NULL;
5014 PyObject *__pyx_t_14 = NULL;
5015 PyObject *__pyx_t_15 = NULL;
5016 PyObject *__pyx_t_16 = NULL;
5017 PyObject *__pyx_t_17 = NULL;
5018 int __pyx_lineno = 0;
5019 const char *__pyx_filename = NULL;
5020 int __pyx_clineno = 0;
5021 __Pyx_RefNannySetupContext(
"partitionNodesFromTetgenFiles", 0);
5022 __Pyx_INCREF(__pyx_v_filebase);
5031 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5040 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5041 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5051 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
5052 __Pyx_GOTREF(__pyx_t_4);
5054 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5055 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5056 if (likely(__pyx_t_5)) {
5057 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5058 __Pyx_INCREF(__pyx_t_5);
5059 __Pyx_INCREF(
function);
5060 __Pyx_DECREF_SET(__pyx_t_4,
function);
5063 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
5064 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5065 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
5066 __Pyx_GOTREF(__pyx_t_3);
5067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5068 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
5087 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
5105 __Pyx_XDECREF(__pyx_r);
5114 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5115 __Pyx_GOTREF(__pyx_t_4);
5116 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5117 __Pyx_GOTREF(__pyx_t_5);
5118 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5119 __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5120 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5121 __Pyx_GOTREF(__pyx_t_4);
5122 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5123 __Pyx_GOTREF(__pyx_t_8);
5124 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5125 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error)
5126 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5128 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5129 __PYX_ERR(0, 76, __pyx_L1_error)
5131 __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5132 __Pyx_GOTREF(__pyx_t_4);
5133 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5134 __Pyx_GOTREF(__pyx_t_8);
5135 __pyx_t_10 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_4), (
char *)
"c", (
char *) __pyx_t_7);
5136 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
5137 __Pyx_GOTREF(__pyx_t_10);
5138 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5139 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5141 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5142 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5143 if (likely(__pyx_t_4)) {
5144 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
5145 __Pyx_INCREF(__pyx_t_4);
5146 __Pyx_INCREF(
function);
5147 __Pyx_DECREF_SET(__pyx_t_5,
function);
5150 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5151 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5152 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5153 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5154 __Pyx_GOTREF(__pyx_t_3);
5155 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5164 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5165 __Pyx_GOTREF(__pyx_t_4);
5166 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
5167 __Pyx_GOTREF(__pyx_t_8);
5168 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5169 __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5171 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5172 __PYX_ERR(0, 77, __pyx_L1_error)
5174 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5175 __Pyx_GOTREF(__pyx_t_11);
5176 __pyx_t_4 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5177 __Pyx_GOTREF(__pyx_t_4);
5178 __pyx_t_10 = __pyx_array_new(__pyx_t_4,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5179 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L1_error)
5180 __Pyx_GOTREF(__pyx_t_10);
5181 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5182 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5184 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5185 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5186 if (likely(__pyx_t_11)) {
5187 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5188 __Pyx_INCREF(__pyx_t_11);
5189 __Pyx_INCREF(
function);
5190 __Pyx_DECREF_SET(__pyx_t_8,
function);
5193 __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5194 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5195 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5196 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
5197 __Pyx_GOTREF(__pyx_t_5);
5198 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5207 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5208 __Pyx_GOTREF(__pyx_t_11);
5209 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
5210 __Pyx_GOTREF(__pyx_t_4);
5211 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5212 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5213 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5214 __Pyx_GOTREF(__pyx_t_11);
5215 __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5216 __Pyx_GOTREF(__pyx_t_12);
5217 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5218 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
5219 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5221 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5222 __PYX_ERR(0, 78, __pyx_L1_error)
5224 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5225 __Pyx_GOTREF(__pyx_t_11);
5226 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_12);
5228 __pyx_t_10 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5229 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5230 __Pyx_GOTREF(__pyx_t_10);
5231 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5232 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5234 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5235 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5236 if (likely(__pyx_t_11)) {
5237 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5238 __Pyx_INCREF(__pyx_t_11);
5239 __Pyx_INCREF(
function);
5240 __Pyx_DECREF_SET(__pyx_t_4,
function);
5243 __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5244 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5245 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5246 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
5247 __Pyx_GOTREF(__pyx_t_8);
5248 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5257 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5258 __Pyx_GOTREF(__pyx_t_11);
5259 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L1_error)
5260 __Pyx_GOTREF(__pyx_t_12);
5261 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5262 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5264 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5265 __PYX_ERR(0, 79, __pyx_L1_error)
5267 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5268 __Pyx_GOTREF(__pyx_t_13);
5269 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5270 __Pyx_GOTREF(__pyx_t_11);
5271 __pyx_t_10 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5272 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error)
5273 __Pyx_GOTREF(__pyx_t_10);
5274 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5275 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5277 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5278 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5279 if (likely(__pyx_t_13)) {
5280 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
5281 __Pyx_INCREF(__pyx_t_13);
5282 __Pyx_INCREF(
function);
5283 __Pyx_DECREF_SET(__pyx_t_12,
function);
5286 __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5287 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5288 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5289 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
5290 __Pyx_GOTREF(__pyx_t_4);
5291 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5300 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5301 __Pyx_GOTREF(__pyx_t_13);
5302 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L1_error)
5303 __Pyx_GOTREF(__pyx_t_11);
5304 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5305 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5306 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5307 __Pyx_GOTREF(__pyx_t_13);
5308 __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5309 __Pyx_GOTREF(__pyx_t_14);
5310 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5311 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5312 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5314 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5315 __PYX_ERR(0, 80, __pyx_L1_error)
5317 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5318 __Pyx_GOTREF(__pyx_t_13);
5319 __pyx_t_14 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5320 __Pyx_GOTREF(__pyx_t_14);
5321 __pyx_t_10 = __pyx_array_new(__pyx_t_14,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5322 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error)
5323 __Pyx_GOTREF(__pyx_t_10);
5324 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5325 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5327 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5328 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5329 if (likely(__pyx_t_13)) {
5330 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
5331 __Pyx_INCREF(__pyx_t_13);
5332 __Pyx_INCREF(
function);
5333 __Pyx_DECREF_SET(__pyx_t_11,
function);
5336 __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5337 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5338 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5339 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L1_error)
5340 __Pyx_GOTREF(__pyx_t_12);
5341 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5350 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5351 __Pyx_GOTREF(__pyx_t_13);
5352 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 81, __pyx_L1_error)
5353 __Pyx_GOTREF(__pyx_t_14);
5354 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5355 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5357 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5358 __PYX_ERR(0, 81, __pyx_L1_error)
5360 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5361 __Pyx_GOTREF(__pyx_t_15);
5362 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5363 __Pyx_GOTREF(__pyx_t_13);
5364 __pyx_t_10 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
5365 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L1_error)
5366 __Pyx_GOTREF(__pyx_t_10);
5367 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5368 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5370 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5371 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5372 if (likely(__pyx_t_15)) {
5373 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
5374 __Pyx_INCREF(__pyx_t_15);
5375 __Pyx_INCREF(
function);
5376 __Pyx_DECREF_SET(__pyx_t_14,
function);
5379 __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5380 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5381 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5382 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 81, __pyx_L1_error)
5383 __Pyx_GOTREF(__pyx_t_11);
5384 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5393 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5394 __Pyx_GOTREF(__pyx_t_15);
5395 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error)
5396 __Pyx_GOTREF(__pyx_t_13);
5397 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5398 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5399 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5400 __Pyx_GOTREF(__pyx_t_15);
5401 __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5402 __Pyx_GOTREF(__pyx_t_16);
5403 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5404 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
5405 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5407 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5408 __PYX_ERR(0, 82, __pyx_L1_error)
5410 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5411 __Pyx_GOTREF(__pyx_t_15);
5412 __pyx_t_16 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5413 __Pyx_GOTREF(__pyx_t_16);
5414 __pyx_t_10 = __pyx_array_new(__pyx_t_16,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
5415 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
5416 __Pyx_GOTREF(__pyx_t_10);
5417 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5418 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5420 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5421 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5422 if (likely(__pyx_t_15)) {
5423 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
5424 __Pyx_INCREF(__pyx_t_15);
5425 __Pyx_INCREF(
function);
5426 __Pyx_DECREF_SET(__pyx_t_13,
function);
5429 __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5430 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5431 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5432 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 82, __pyx_L1_error)
5433 __Pyx_GOTREF(__pyx_t_14);
5434 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5443 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5444 __Pyx_GOTREF(__pyx_t_15);
5445 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 83, __pyx_L1_error)
5446 __Pyx_GOTREF(__pyx_t_16);
5447 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5448 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
5450 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5451 __PYX_ERR(0, 83, __pyx_L1_error)
5453 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 83, __pyx_L1_error)
5454 __Pyx_GOTREF(__pyx_t_17);
5455 __pyx_t_15 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5456 __Pyx_GOTREF(__pyx_t_15);
5457 __pyx_t_10 = __pyx_array_new(__pyx_t_15,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_17), (
char *)
"c", (
char *) __pyx_t_7);
5458 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 83, __pyx_L1_error)
5459 __Pyx_GOTREF(__pyx_t_10);
5460 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5461 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5463 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
5464 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
5465 if (likely(__pyx_t_17)) {
5466 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_16);
5467 __Pyx_INCREF(__pyx_t_17);
5468 __Pyx_INCREF(
function);
5469 __Pyx_DECREF_SET(__pyx_t_16,
function);
5472 __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
5473 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5474 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5475 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 83, __pyx_L1_error)
5476 __Pyx_GOTREF(__pyx_t_13);
5477 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5486 __pyx_t_16 = PyTuple_New(8);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 76, __pyx_L1_error)
5487 __Pyx_GOTREF(__pyx_t_16);
5488 __Pyx_GIVEREF(__pyx_t_3);
5489 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
5490 __Pyx_GIVEREF(__pyx_t_5);
5491 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
5492 __Pyx_GIVEREF(__pyx_t_8);
5493 PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
5494 __Pyx_GIVEREF(__pyx_t_4);
5495 PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
5496 __Pyx_GIVEREF(__pyx_t_12);
5497 PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
5498 __Pyx_GIVEREF(__pyx_t_11);
5499 PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
5500 __Pyx_GIVEREF(__pyx_t_14);
5501 PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
5502 __Pyx_GIVEREF(__pyx_t_13);
5503 PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
5512 __pyx_r = __pyx_t_16;
5526 __Pyx_XDECREF(__pyx_t_3);
5527 __Pyx_XDECREF(__pyx_t_4);
5528 __Pyx_XDECREF(__pyx_t_5);
5529 __Pyx_XDECREF(__pyx_t_8);
5530 __Pyx_XDECREF(((PyObject *)__pyx_t_10));
5531 __Pyx_XDECREF(__pyx_t_11);
5532 __Pyx_XDECREF(__pyx_t_12);
5533 __Pyx_XDECREF(__pyx_t_13);
5534 __Pyx_XDECREF(__pyx_t_14);
5535 __Pyx_XDECREF(__pyx_t_15);
5536 __Pyx_XDECREF(__pyx_t_16);
5537 __Pyx_XDECREF(__pyx_t_17);
5538 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5541 __Pyx_XDECREF(__pyx_v_filebase);
5542 __Pyx_XGIVEREF(__pyx_r);
5543 __Pyx_RefNannyFinishContext();
5556 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5557 static PyMethodDef __pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles = {
"partitionNodesFromTriangleFiles", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles, METH_VARARGS|METH_KEYWORDS, 0};
5558 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5559 struct PyMPICommObject *__pyx_v_comm = 0;
5560 PyObject *__pyx_v_filebase = 0;
5561 int __pyx_v_indexBase;
5562 int __pyx_v_nLayersOfOverlap;
5563 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5564 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5565 int __pyx_lineno = 0;
5566 const char *__pyx_filename = NULL;
5567 int __pyx_clineno = 0;
5568 PyObject *__pyx_r = 0;
5569 __Pyx_RefNannyDeclarations
5570 __Pyx_RefNannySetupContext(
"partitionNodesFromTriangleFiles (wrapper)", 0);
5572 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
5573 PyObject* values[6] = {0,0,0,0,0,0};
5574 if (unlikely(__pyx_kwds)) {
5576 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5578 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5580 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5582 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5584 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5586 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5588 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5591 default:
goto __pyx_L5_argtuple_error;
5593 kw_args = PyDict_Size(__pyx_kwds);
5596 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5597 else goto __pyx_L5_argtuple_error;
5600 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
5602 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 1); __PYX_ERR(0, 86, __pyx_L3_error)
5606 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
5608 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 2); __PYX_ERR(0, 86, __pyx_L3_error)
5612 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
5614 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 3); __PYX_ERR(0, 86, __pyx_L3_error)
5618 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5620 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 4); __PYX_ERR(0, 86, __pyx_L3_error)
5624 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5626 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 5); __PYX_ERR(0, 86, __pyx_L3_error)
5629 if (unlikely(kw_args > 0)) {
5630 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionNodesFromTriangleFiles") < 0)) __PYX_ERR(0, 86, __pyx_L3_error)
5632 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5633 goto __pyx_L5_argtuple_error;
5635 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5636 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5637 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5638 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5639 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5640 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5642 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
5643 __pyx_v_filebase = values[1];
5644 __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_indexBase == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5645 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5646 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
5647 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
5649 goto __pyx_L4_argument_unpacking_done;
5650 __pyx_L5_argtuple_error:;
5651 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error)
5653 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5654 __Pyx_RefNannyFinishContext();
5656 __pyx_L4_argument_unpacking_done:;
5657 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5658 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5659 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5660 __pyx_r = __pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
5667 __Pyx_RefNannyFinishContext();
5671 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
5672 PyObject *__pyx_r = NULL;
5673 __Pyx_RefNannyDeclarations
5676 PyObject *__pyx_t_3 = NULL;
5677 PyObject *__pyx_t_4 = NULL;
5678 PyObject *__pyx_t_5 = NULL;
5681 PyObject *__pyx_t_8 = NULL;
5682 Py_ssize_t __pyx_t_9;
5683 struct __pyx_array_obj *__pyx_t_10 = NULL;
5684 PyObject *__pyx_t_11 = NULL;
5685 PyObject *__pyx_t_12 = NULL;
5686 PyObject *__pyx_t_13 = NULL;
5687 PyObject *__pyx_t_14 = NULL;
5688 PyObject *__pyx_t_15 = NULL;
5689 PyObject *__pyx_t_16 = NULL;
5690 PyObject *__pyx_t_17 = NULL;
5691 int __pyx_lineno = 0;
5692 const char *__pyx_filename = NULL;
5693 int __pyx_clineno = 0;
5694 __Pyx_RefNannySetupContext(
"partitionNodesFromTriangleFiles", 0);
5695 __Pyx_INCREF(__pyx_v_filebase);
5704 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5713 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5714 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5724 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
5725 __Pyx_GOTREF(__pyx_t_4);
5727 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5728 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5729 if (likely(__pyx_t_5)) {
5730 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5731 __Pyx_INCREF(__pyx_t_5);
5732 __Pyx_INCREF(
function);
5733 __Pyx_DECREF_SET(__pyx_t_4,
function);
5736 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
5737 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5738 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
5739 __Pyx_GOTREF(__pyx_t_3);
5740 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5741 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
5760 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
5778 __Pyx_XDECREF(__pyx_r);
5787 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5788 __Pyx_GOTREF(__pyx_t_4);
5789 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
5790 __Pyx_GOTREF(__pyx_t_5);
5791 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5792 __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5793 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5794 __Pyx_GOTREF(__pyx_t_4);
5795 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5796 __Pyx_GOTREF(__pyx_t_8);
5797 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5798 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
5799 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5801 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5802 __PYX_ERR(0, 96, __pyx_L1_error)
5804 __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5805 __Pyx_GOTREF(__pyx_t_4);
5806 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5807 __Pyx_GOTREF(__pyx_t_8);
5808 __pyx_t_10 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_4), (
char *)
"c", (
char *) __pyx_t_7);
5809 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error)
5810 __Pyx_GOTREF(__pyx_t_10);
5811 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5814 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5815 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5816 if (likely(__pyx_t_4)) {
5817 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
5818 __Pyx_INCREF(__pyx_t_4);
5819 __Pyx_INCREF(
function);
5820 __Pyx_DECREF_SET(__pyx_t_5,
function);
5823 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5824 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5825 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5826 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
5827 __Pyx_GOTREF(__pyx_t_3);
5828 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5837 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5838 __Pyx_GOTREF(__pyx_t_4);
5839 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error)
5840 __Pyx_GOTREF(__pyx_t_8);
5841 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5842 __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5844 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5845 __PYX_ERR(0, 97, __pyx_L1_error)
5847 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L1_error)
5848 __Pyx_GOTREF(__pyx_t_11);
5849 __pyx_t_4 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5850 __Pyx_GOTREF(__pyx_t_4);
5851 __pyx_t_10 = __pyx_array_new(__pyx_t_4,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5852 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 97, __pyx_L1_error)
5853 __Pyx_GOTREF(__pyx_t_10);
5854 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5855 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5857 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5858 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5859 if (likely(__pyx_t_11)) {
5860 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5861 __Pyx_INCREF(__pyx_t_11);
5862 __Pyx_INCREF(
function);
5863 __Pyx_DECREF_SET(__pyx_t_8,
function);
5866 __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5867 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5868 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5869 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
5870 __Pyx_GOTREF(__pyx_t_5);
5871 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5880 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5881 __Pyx_GOTREF(__pyx_t_11);
5882 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
5883 __Pyx_GOTREF(__pyx_t_4);
5884 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5885 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5886 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5887 __Pyx_GOTREF(__pyx_t_11);
5888 __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5889 __Pyx_GOTREF(__pyx_t_12);
5890 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5891 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
5892 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5894 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5895 __PYX_ERR(0, 98, __pyx_L1_error)
5897 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_11);
5899 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5900 __Pyx_GOTREF(__pyx_t_12);
5901 __pyx_t_10 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5902 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error)
5903 __Pyx_GOTREF(__pyx_t_10);
5904 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5905 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5907 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5908 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5909 if (likely(__pyx_t_11)) {
5910 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5911 __Pyx_INCREF(__pyx_t_11);
5912 __Pyx_INCREF(
function);
5913 __Pyx_DECREF_SET(__pyx_t_4,
function);
5916 __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5917 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5918 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5919 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_8);
5921 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5930 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5931 __Pyx_GOTREF(__pyx_t_11);
5932 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L1_error)
5933 __Pyx_GOTREF(__pyx_t_12);
5934 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5935 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5937 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5938 __PYX_ERR(0, 99, __pyx_L1_error)
5940 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L1_error)
5941 __Pyx_GOTREF(__pyx_t_13);
5942 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5943 __Pyx_GOTREF(__pyx_t_11);
5944 __pyx_t_10 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5945 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L1_error)
5946 __Pyx_GOTREF(__pyx_t_10);
5947 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5948 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5950 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5951 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5952 if (likely(__pyx_t_13)) {
5953 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
5954 __Pyx_INCREF(__pyx_t_13);
5955 __Pyx_INCREF(
function);
5956 __Pyx_DECREF_SET(__pyx_t_12,
function);
5959 __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5960 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5961 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5962 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
5963 __Pyx_GOTREF(__pyx_t_4);
5964 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5973 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5974 __Pyx_GOTREF(__pyx_t_13);
5975 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L1_error)
5976 __Pyx_GOTREF(__pyx_t_11);
5977 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5978 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5979 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5980 __Pyx_GOTREF(__pyx_t_13);
5981 __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5982 __Pyx_GOTREF(__pyx_t_14);
5983 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5984 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
5985 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5987 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5988 __PYX_ERR(0, 100, __pyx_L1_error)
5990 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5991 __Pyx_GOTREF(__pyx_t_13);
5992 __pyx_t_14 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5993 __Pyx_GOTREF(__pyx_t_14);
5994 __pyx_t_10 = __pyx_array_new(__pyx_t_14,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5995 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 100, __pyx_L1_error)
5996 __Pyx_GOTREF(__pyx_t_10);
5997 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5998 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6000 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
6001 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
6002 if (likely(__pyx_t_13)) {
6003 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
6004 __Pyx_INCREF(__pyx_t_13);
6005 __Pyx_INCREF(
function);
6006 __Pyx_DECREF_SET(__pyx_t_11,
function);
6009 __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
6010 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6011 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6012 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L1_error)
6013 __Pyx_GOTREF(__pyx_t_12);
6014 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6023 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
6024 __Pyx_GOTREF(__pyx_t_13);
6025 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 101, __pyx_L1_error)
6026 __Pyx_GOTREF(__pyx_t_14);
6027 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6028 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
6030 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
6031 __PYX_ERR(0, 101, __pyx_L1_error)
6033 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 101, __pyx_L1_error)
6034 __Pyx_GOTREF(__pyx_t_15);
6035 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
6036 __Pyx_GOTREF(__pyx_t_13);
6037 __pyx_t_10 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
6038 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 101, __pyx_L1_error)
6039 __Pyx_GOTREF(__pyx_t_10);
6040 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6041 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6043 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
6044 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
6045 if (likely(__pyx_t_15)) {
6046 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
6047 __Pyx_INCREF(__pyx_t_15);
6048 __Pyx_INCREF(
function);
6049 __Pyx_DECREF_SET(__pyx_t_14,
function);
6052 __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
6053 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6054 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6055 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 101, __pyx_L1_error)
6056 __Pyx_GOTREF(__pyx_t_11);
6057 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6066 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6067 __Pyx_GOTREF(__pyx_t_15);
6068 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 102, __pyx_L1_error)
6069 __Pyx_GOTREF(__pyx_t_13);
6070 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6071 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
6072 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6073 __Pyx_GOTREF(__pyx_t_15);
6074 __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
6075 __Pyx_GOTREF(__pyx_t_16);
6076 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6077 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error)
6078 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6080 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
6081 __PYX_ERR(0, 102, __pyx_L1_error)
6083 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6084 __Pyx_GOTREF(__pyx_t_15);
6085 __pyx_t_16 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
6086 __Pyx_GOTREF(__pyx_t_16);
6087 __pyx_t_10 = __pyx_array_new(__pyx_t_16,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
6088 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 102, __pyx_L1_error)
6089 __Pyx_GOTREF(__pyx_t_10);
6090 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6091 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6093 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
6094 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
6095 if (likely(__pyx_t_15)) {
6096 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
6097 __Pyx_INCREF(__pyx_t_15);
6098 __Pyx_INCREF(
function);
6099 __Pyx_DECREF_SET(__pyx_t_13,
function);
6102 __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
6103 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6104 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6105 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 102, __pyx_L1_error)
6106 __Pyx_GOTREF(__pyx_t_14);
6107 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6116 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6117 __Pyx_GOTREF(__pyx_t_15);
6118 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L1_error)
6119 __Pyx_GOTREF(__pyx_t_16);
6120 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6121 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
6123 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
6124 __PYX_ERR(0, 103, __pyx_L1_error)
6126 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 103, __pyx_L1_error)
6127 __Pyx_GOTREF(__pyx_t_17);
6128 __pyx_t_15 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6129 __Pyx_GOTREF(__pyx_t_15);
6130 __pyx_t_10 = __pyx_array_new(__pyx_t_15,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_17), (
char *)
"c", (
char *) __pyx_t_7);
6131 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error)
6132 __Pyx_GOTREF(__pyx_t_10);
6133 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6134 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6136 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
6137 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
6138 if (likely(__pyx_t_17)) {
6139 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_16);
6140 __Pyx_INCREF(__pyx_t_17);
6141 __Pyx_INCREF(
function);
6142 __Pyx_DECREF_SET(__pyx_t_16,
function);
6145 __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
6146 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6147 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6148 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 103, __pyx_L1_error)
6149 __Pyx_GOTREF(__pyx_t_13);
6150 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6159 __pyx_t_16 = PyTuple_New(8);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 96, __pyx_L1_error)
6160 __Pyx_GOTREF(__pyx_t_16);
6161 __Pyx_GIVEREF(__pyx_t_3);
6162 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
6163 __Pyx_GIVEREF(__pyx_t_5);
6164 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
6165 __Pyx_GIVEREF(__pyx_t_8);
6166 PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
6167 __Pyx_GIVEREF(__pyx_t_4);
6168 PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
6169 __Pyx_GIVEREF(__pyx_t_12);
6170 PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
6171 __Pyx_GIVEREF(__pyx_t_11);
6172 PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
6173 __Pyx_GIVEREF(__pyx_t_14);
6174 PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
6175 __Pyx_GIVEREF(__pyx_t_13);
6176 PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
6185 __pyx_r = __pyx_t_16;
6199 __Pyx_XDECREF(__pyx_t_3);
6200 __Pyx_XDECREF(__pyx_t_4);
6201 __Pyx_XDECREF(__pyx_t_5);
6202 __Pyx_XDECREF(__pyx_t_8);
6203 __Pyx_XDECREF(((PyObject *)__pyx_t_10));
6204 __Pyx_XDECREF(__pyx_t_11);
6205 __Pyx_XDECREF(__pyx_t_12);
6206 __Pyx_XDECREF(__pyx_t_13);
6207 __Pyx_XDECREF(__pyx_t_14);
6208 __Pyx_XDECREF(__pyx_t_15);
6209 __Pyx_XDECREF(__pyx_t_16);
6210 __Pyx_XDECREF(__pyx_t_17);
6211 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
6214 __Pyx_XDECREF(__pyx_v_filebase);
6215 __Pyx_XGIVEREF(__pyx_r);
6216 __Pyx_RefNannyFinishContext();
6229 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6230 static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings = {
"buildQuadraticLocal2GlobalMappings", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6231 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6232 struct PyMPICommObject *__pyx_v_comm = 0;
6234 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6235 CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6236 PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6237 PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
6238 PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
6239 PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
6240 PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6241 PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
6242 PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
6243 PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
6244 PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
6245 PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
6246 PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
6247 PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
6248 int __pyx_lineno = 0;
6249 const char *__pyx_filename = NULL;
6250 int __pyx_clineno = 0;
6251 PyObject *__pyx_r = 0;
6252 __Pyx_RefNannyDeclarations
6253 __Pyx_RefNannySetupContext(
"buildQuadraticLocal2GlobalMappings (wrapper)", 0);
6255 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
6256 PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6257 if (unlikely(__pyx_kwds)) {
6259 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6261 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6263 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6265 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6267 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6269 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6271 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6273 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6275 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6277 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6279 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6281 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6283 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6285 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6287 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6289 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6291 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6294 default:
goto __pyx_L5_argtuple_error;
6296 kw_args = PyDict_Size(__pyx_kwds);
6299 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6300 else goto __pyx_L5_argtuple_error;
6303 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6305 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 106, __pyx_L3_error)
6309 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6311 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 106, __pyx_L3_error)
6315 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6317 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 106, __pyx_L3_error)
6321 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6323 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 106, __pyx_L3_error)
6327 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6329 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 106, __pyx_L3_error)
6333 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6335 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 106, __pyx_L3_error)
6339 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6341 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 106, __pyx_L3_error)
6345 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6347 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 106, __pyx_L3_error)
6351 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6353 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 106, __pyx_L3_error)
6357 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;