proteus  1.8.1
C/C++/Fortran libraries
cpartitioning.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.30 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89  #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
90  #endif
91 #elif defined(PYSTON_VERSION)
92  #define CYTHON_COMPILING_IN_PYPY 0
93  #define CYTHON_COMPILING_IN_PYSTON 1
94  #define CYTHON_COMPILING_IN_CPYTHON 0
95  #ifndef CYTHON_USE_TYPE_SLOTS
96  #define CYTHON_USE_TYPE_SLOTS 1
97  #endif
98  #undef CYTHON_USE_PYTYPE_LOOKUP
99  #define CYTHON_USE_PYTYPE_LOOKUP 0
100  #undef CYTHON_USE_ASYNC_SLOTS
101  #define CYTHON_USE_ASYNC_SLOTS 0
102  #undef CYTHON_USE_PYLIST_INTERNALS
103  #define CYTHON_USE_PYLIST_INTERNALS 0
104  #ifndef CYTHON_USE_UNICODE_INTERNALS
105  #define CYTHON_USE_UNICODE_INTERNALS 1
106  #endif
107  #undef CYTHON_USE_UNICODE_WRITER
108  #define CYTHON_USE_UNICODE_WRITER 0
109  #undef CYTHON_USE_PYLONG_INTERNALS
110  #define CYTHON_USE_PYLONG_INTERNALS 0
111  #ifndef CYTHON_AVOID_BORROWED_REFS
112  #define CYTHON_AVOID_BORROWED_REFS 0
113  #endif
114  #ifndef CYTHON_ASSUME_SAFE_MACROS
115  #define CYTHON_ASSUME_SAFE_MACROS 1
116  #endif
117  #ifndef CYTHON_UNPACK_METHODS
118  #define CYTHON_UNPACK_METHODS 1
119  #endif
120  #undef CYTHON_FAST_THREAD_STATE
121  #define CYTHON_FAST_THREAD_STATE 0
122  #undef CYTHON_FAST_PYCALL
123  #define CYTHON_FAST_PYCALL 0
124  #undef CYTHON_PEP489_MULTI_PHASE_INIT
125  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126  #undef CYTHON_USE_TP_FINALIZE
127  #define CYTHON_USE_TP_FINALIZE 0
128  #undef CYTHON_USE_DICT_VERSIONS
129  #define CYTHON_USE_DICT_VERSIONS 0
130  #undef CYTHON_USE_EXC_INFO_STACK
131  #define CYTHON_USE_EXC_INFO_STACK 0
132  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
134  #endif
135 #else
136  #define CYTHON_COMPILING_IN_PYPY 0
137  #define CYTHON_COMPILING_IN_PYSTON 0
138  #define CYTHON_COMPILING_IN_CPYTHON 1
139  #ifndef CYTHON_USE_TYPE_SLOTS
140  #define CYTHON_USE_TYPE_SLOTS 1
141  #endif
142  #if PY_VERSION_HEX < 0x02070000
143  #undef CYTHON_USE_PYTYPE_LOOKUP
144  #define CYTHON_USE_PYTYPE_LOOKUP 0
145  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146  #define CYTHON_USE_PYTYPE_LOOKUP 1
147  #endif
148  #if PY_MAJOR_VERSION < 3
149  #undef CYTHON_USE_ASYNC_SLOTS
150  #define CYTHON_USE_ASYNC_SLOTS 0
151  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152  #define CYTHON_USE_ASYNC_SLOTS 1
153  #endif
154  #if PY_VERSION_HEX < 0x02070000
155  #undef CYTHON_USE_PYLONG_INTERNALS
156  #define CYTHON_USE_PYLONG_INTERNALS 0
157  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158  #define CYTHON_USE_PYLONG_INTERNALS 1
159  #endif
160  #ifndef CYTHON_USE_PYLIST_INTERNALS
161  #define CYTHON_USE_PYLIST_INTERNALS 1
162  #endif
163  #ifndef CYTHON_USE_UNICODE_INTERNALS
164  #define CYTHON_USE_UNICODE_INTERNALS 1
165  #endif
166  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167  #undef CYTHON_USE_UNICODE_WRITER
168  #define CYTHON_USE_UNICODE_WRITER 0
169  #elif !defined(CYTHON_USE_UNICODE_WRITER)
170  #define CYTHON_USE_UNICODE_WRITER 1
171  #endif
172  #ifndef CYTHON_AVOID_BORROWED_REFS
173  #define CYTHON_AVOID_BORROWED_REFS 0
174  #endif
175  #ifndef CYTHON_ASSUME_SAFE_MACROS
176  #define CYTHON_ASSUME_SAFE_MACROS 1
177  #endif
178  #ifndef CYTHON_UNPACK_METHODS
179  #define CYTHON_UNPACK_METHODS 1
180  #endif
181  #if PY_VERSION_HEX >= 0x030B00A4
182  #undef CYTHON_FAST_THREAD_STATE
183  #define CYTHON_FAST_THREAD_STATE 0
184  #elif !defined(CYTHON_FAST_THREAD_STATE)
185  #define CYTHON_FAST_THREAD_STATE 1
186  #endif
187  #ifndef CYTHON_FAST_PYCALL
188  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
189  #endif
190  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
192  #endif
193  #ifndef CYTHON_USE_TP_FINALIZE
194  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
195  #endif
196  #ifndef CYTHON_USE_DICT_VERSIONS
197  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
198  #endif
199  #if PY_VERSION_HEX >= 0x030B00A4
200  #undef CYTHON_USE_EXC_INFO_STACK
201  #define CYTHON_USE_EXC_INFO_STACK 0
202  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
204  #endif
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
207  #endif
208 #endif
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
211 #endif
212 #if CYTHON_USE_PYLONG_INTERNALS
213  #if PY_MAJOR_VERSION < 3
214  #include "longintrepr.h"
215  #endif
216  #undef SHIFT
217  #undef BASE
218  #undef MASK
219  #ifdef SIZEOF_VOID_P
220  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221  #endif
222 #endif
223 #ifndef __has_attribute
224  #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227  #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230  #if defined(__GNUC__)
231  #define CYTHON_RESTRICT __restrict__
232  #elif defined(_MSC_VER) && _MSC_VER >= 1400
233  #define CYTHON_RESTRICT __restrict
234  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235  #define CYTHON_RESTRICT restrict
236  #else
237  #define CYTHON_RESTRICT
238  #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
244 # else
245 # define CYTHON_UNUSED
246 # endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 # define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 # else
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 # endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
263 # else
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269  #ifndef _MSC_STDINT_H_
270  #if _MSC_VER < 1300
271  typedef unsigned char uint8_t;
272  typedef unsigned int uint32_t;
273  #else
274  typedef unsigned __int8 uint8_t;
275  typedef unsigned __int32 uint32_t;
276  #endif
277  #endif
278 #else
279  #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282  #if defined(__cplusplus) && __cplusplus >= 201103L
283  #if __has_cpp_attribute(fallthrough)
284  #define CYTHON_FALLTHROUGH [[fallthrough]]
285  #elif __has_cpp_attribute(clang::fallthrough)
286  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287  #elif __has_cpp_attribute(gnu::fallthrough)
288  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289  #endif
290  #endif
291  #ifndef CYTHON_FALLTHROUGH
292  #if __has_attribute(fallthrough)
293  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294  #else
295  #define CYTHON_FALLTHROUGH
296  #endif
297  #endif
298  #if defined(__clang__ ) && defined(__apple_build_version__)
299  #if __apple_build_version__ < 7000000
300  #undef CYTHON_FALLTHROUGH
301  #define CYTHON_FALLTHROUGH
302  #endif
303  #endif
304 #endif
305 
306 #ifndef __cplusplus
307  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
308 #endif
309 #ifndef CYTHON_INLINE
310  #if defined(__clang__)
311  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312  #else
313  #define CYTHON_INLINE inline
314  #endif
315 #endif
316 template<typename T>
317 void __Pyx_call_destructor(T& x) {
318  x.~T();
319 }
320 template<typename T>
321 class __Pyx_FakeReference {
322  public:
323  __Pyx_FakeReference() : ptr(NULL) { }
324  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
325  T *operator->() { return ptr; }
326  T *operator&() { return ptr; }
327  operator T&() { return *ptr; }
328  template<typename U> bool operator ==(U other) { return *ptr == other; }
329  template<typename U> bool operator !=(U other) { return *ptr != other; }
330  private:
331  T *ptr;
332 };
333 
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335  #define Py_OptimizeFlag 0
336 #endif
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343  #define __Pyx_DefaultClassType PyClass_Type
344 #else
345  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346  #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
349  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
350  PyObject *fv, PyObject *cell, PyObject* fn,
351  PyObject *name, int fline, PyObject *lnos) {
352  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354  const char *fn_cstr=NULL;
355  const char *name_cstr=NULL;
356  PyCodeObject* co=NULL;
357  PyObject *type, *value, *traceback;
358  PyErr_Fetch(&type, &value, &traceback);
359  if (!(kwds=PyDict_New())) goto end;
360  if (!(argcount=PyLong_FromLong(a))) goto end;
361  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
362  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
363  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
364  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
365  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
366  if (!(nlocals=PyLong_FromLong(l))) goto end;
367  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
368  if (!(stacksize=PyLong_FromLong(s))) goto end;
369  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
370  if (!(flags=PyLong_FromLong(f))) goto end;
371  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
372  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
373  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
374  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
375  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
376  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
377  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
378  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
379  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
380  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
381  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
382  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
383  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
384  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
385  Py_XDECREF((PyObject*)co);
386  co = (PyCodeObject*)call_result;
387  call_result = NULL;
388  if (0) {
389  cleanup_code_too:
390  Py_XDECREF((PyObject*)co);
391  co = NULL;
392  }
393  end:
394  Py_XDECREF(kwds);
395  Py_XDECREF(argcount);
396  Py_XDECREF(posonlyargcount);
397  Py_XDECREF(kwonlyargcount);
398  Py_XDECREF(nlocals);
399  Py_XDECREF(stacksize);
400  Py_XDECREF(replace);
401  Py_XDECREF(call_result);
402  Py_XDECREF(empty);
403  if (type) {
404  PyErr_Restore(type, value, traceback);
405  }
406  return co;
407  }
408 #else
409  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
411 #endif
412  #define __Pyx_DefaultClassType PyType_Type
413 #endif
414 #ifndef Py_TPFLAGS_CHECKTYPES
415  #define Py_TPFLAGS_CHECKTYPES 0
416 #endif
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418  #define Py_TPFLAGS_HAVE_INDEX 0
419 #endif
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
422 #endif
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424  #define Py_TPFLAGS_HAVE_FINALIZE 0
425 #endif
426 #ifndef METH_STACKLESS
427  #define METH_STACKLESS 0
428 #endif
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430  #ifndef METH_FASTCALL
431  #define METH_FASTCALL 0x80
432  #endif
433  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
434  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
435  Py_ssize_t nargs, PyObject *kwnames);
436 #else
437  #define __Pyx_PyCFunctionFast _PyCFunctionFast
438  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
439 #endif
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
443 #else
444 #define __Pyx_PyFastCFunction_Check(func) 0
445 #endif
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447  #define PyObject_Malloc(s) PyMem_Malloc(s)
448  #define PyObject_Free(p) PyMem_Free(p)
449  #define PyObject_Realloc(p) PyMem_Realloc(p)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454  #define PyMem_RawFree(p) PyMem_Free(p)
455 #endif
456 #if CYTHON_COMPILING_IN_PYSTON
457  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
459 #else
460  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
462 #endif
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464  #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468  #define __Pyx_PyThreadState_Current PyThreadState_GET()
469 #else
470  #define __Pyx_PyThreadState_Current _PyThreadState_Current
471 #endif
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
477  *key = PyThread_create_key();
478  return 0;
479 }
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
481  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
482  *key = Py_tss_NEEDS_INIT;
483  return key;
484 }
485 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
486  PyObject_Free(key);
487 }
488 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
489  return *key != Py_tss_NEEDS_INIT;
490 }
491 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
492  PyThread_delete_key(*key);
493  *key = Py_tss_NEEDS_INIT;
494 }
495 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
496  return PyThread_set_key_value(*key, value);
497 }
498 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
499  return PyThread_get_key_value(*key);
500 }
501 #endif
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
504 #else
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
506 #endif
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
510 #else
511  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
513 #endif
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
516 #else
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
518 #endif
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520  #define CYTHON_PEP393_ENABLED 1
521  #if defined(PyUnicode_IS_READY)
522  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523  0 : _PyUnicode_Ready((PyObject *)(op)))
524  #else
525  #define __Pyx_PyUnicode_READY(op) (0)
526  #endif
527  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
537  #else
538  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
539  #endif
540  #else
541  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
542  #endif
543 #else
544  #define CYTHON_PEP393_ENABLED 0
545  #define PyUnicode_1BYTE_KIND 1
546  #define PyUnicode_2BYTE_KIND 2
547  #define PyUnicode_4BYTE_KIND 4
548  #define __Pyx_PyUnicode_READY(op) (0)
549  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY
559  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
561 #else
562  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
565 #endif
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
568 #endif
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
571 #endif
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
574 #endif
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
579 #else
580  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
581 #endif
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583  #define PyObject_ASCII(o) PyObject_Repr(o)
584 #endif
585 #if PY_MAJOR_VERSION >= 3
586  #define PyBaseString_Type PyUnicode_Type
587  #define PyStringObject PyUnicodeObject
588  #define PyString_Type PyUnicode_Type
589  #define PyString_Check PyUnicode_Check
590  #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592  #define PyObject_Unicode PyObject_Str
593 #endif
594 #endif
595 #if PY_MAJOR_VERSION >= 3
596  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
598 #else
599  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
601 #endif
602 #ifndef PySet_CheckExact
603  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
604 #endif
605 #if PY_VERSION_HEX >= 0x030900A4
606  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
608 #else
609  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
611 #endif
612 #if CYTHON_ASSUME_SAFE_MACROS
613  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
614 #else
615  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
616 #endif
617 #if PY_MAJOR_VERSION >= 3
618  #define PyIntObject PyLongObject
619  #define PyInt_Type PyLong_Type
620  #define PyInt_Check(op) PyLong_Check(op)
621  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622  #define PyInt_FromString PyLong_FromString
623  #define PyInt_FromUnicode PyLong_FromUnicode
624  #define PyInt_FromLong PyLong_FromLong
625  #define PyInt_FromSize_t PyLong_FromSize_t
626  #define PyInt_FromSsize_t PyLong_FromSsize_t
627  #define PyInt_AsLong PyLong_AsLong
628  #define PyInt_AS_LONG PyLong_AS_LONG
629  #define PyInt_AsSsize_t PyLong_AsSsize_t
630  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632  #define PyNumber_Int PyNumber_Long
633 #endif
634 #if PY_MAJOR_VERSION >= 3
635  #define PyBoolObject PyLongObject
636 #endif
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638  #ifndef PyUnicode_InternFromString
639  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
640  #endif
641 #endif
642 #if PY_VERSION_HEX < 0x030200A4
643  typedef long Py_hash_t;
644  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
646 #else
647  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
649 #endif
650 #if PY_MAJOR_VERSION >= 3
651  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
652 #else
653  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
654 #endif
655 #if CYTHON_USE_ASYNC_SLOTS
656  #if PY_VERSION_HEX >= 0x030500B1
657  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
659  #else
660  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
661  #endif
662 #else
663  #define __Pyx_PyType_AsAsync(obj) NULL
664 #endif
665 #ifndef __Pyx_PyAsyncMethodsStruct
666  typedef struct {
667  unaryfunc am_await;
668  unaryfunc am_aiter;
669  unaryfunc am_anext;
670  } __Pyx_PyAsyncMethodsStruct;
671 #endif
672 
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674  #if !defined(_USE_MATH_DEFINES)
675  #define _USE_MATH_DEFINES
676  #endif
677 #endif
678 #include <math.h>
679 #ifdef NAN
680 #define __PYX_NAN() ((float) NAN)
681 #else
682 static CYTHON_INLINE float __PYX_NAN() {
683  float value;
684  memset(&value, 0xFF, sizeof(value));
685  return value;
686 }
687 #endif
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
690 #else
691 #define __Pyx_truncl truncl
692 #endif
693 
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
698 
699 #ifndef __PYX_EXTERN_C
700  #ifdef __cplusplus
701  #define __PYX_EXTERN_C extern "C"
702  #else
703  #define __PYX_EXTERN_C extern
704  #endif
705 #endif
706 
707 #define __PYX_HAVE__cpartitioning
708 #define __PYX_HAVE_API__cpartitioning
709 /* Early includes */
710 #include <string.h>
711 #include <stdio.h>
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
717 
718  /* NumPy API declarations from "numpy/__init__.pxd" */
719 
720 #include "mpi.h"
721 #include "mesh.h"
722 #include "partitioning.h"
723 #include "pythread.h"
724 #include <stdlib.h>
725 #include "pystate.h"
726 #ifdef _OPENMP
727 #include <omp.h>
728 #endif /* _OPENMP */
729 
730 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
731 #define CYTHON_WITHOUT_ASSERTIONS
732 #endif
733 
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;
736 
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;
757 }
758 #if defined (__cplusplus) && __cplusplus >= 201103L
759  #include <cstdlib>
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)
771 #else
772  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
773 #endif
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
784 #else
785  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
786  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
787 #endif
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;
806  while (*u_end++) ;
807  return (size_t)(u_end - u - 1);
808 }
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))
825 #else
826 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
827 #endif
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))
831 #else
832 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
833 #endif
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) {
838  PyObject* sys;
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");
844  if (!sys) goto bad;
845  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
846  Py_DECREF(sys);
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;
852  } else {
853  char ascii_chars[128];
854  int c;
855  for (c = 0; c < 128; c++) {
856  ascii_chars[c] = c;
857  }
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) {
863  PyErr_Format(
864  PyExc_ValueError,
865  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
866  default_encoding_c);
867  goto bad;
868  }
869  Py_DECREF(ascii_chars_u);
870  Py_DECREF(ascii_chars_b);
871  }
872  Py_DECREF(default_encoding);
873  return 0;
874 bad:
875  Py_XDECREF(default_encoding);
876  Py_XDECREF(ascii_chars_u);
877  Py_XDECREF(ascii_chars_b);
878  return -1;
879 }
880 #endif
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)
883 #else
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) {
888  PyObject* sys;
889  PyObject* default_encoding = NULL;
890  char* default_encoding_c;
891  sys = PyImport_ImportModule("sys");
892  if (!sys) goto bad;
893  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
894  Py_DECREF(sys);
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);
902  return 0;
903 bad:
904  Py_XDECREF(default_encoding);
905  return -1;
906 }
907 #endif
908 #endif
909 
910 
911 /* Test for GCC > 2.95 */
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)
915 #else /* !__GNUC__ or GCC < 2.95 */
916  #define likely(x) (x)
917  #define unlikely(x) (x)
918 #endif /* __GNUC__ */
919 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
920 
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;
932 
933 /* Header.proto */
934 #if !defined(CYTHON_CCOMPLEX)
935  #if defined(__cplusplus)
936  #define CYTHON_CCOMPLEX 1
937  #elif defined(_Complex_I)
938  #define CYTHON_CCOMPLEX 1
939  #else
940  #define CYTHON_CCOMPLEX 0
941  #endif
942 #endif
943 #if CYTHON_CCOMPLEX
944  #ifdef __cplusplus
945  #include <complex>
946  #else
947  #include <complex.h>
948  #endif
949 #endif
950 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
951  #undef _Complex_I
952  #define _Complex_I 1.0fj
953 #endif
954 
955 
956 static const char *__pyx_f[] = {
957  "proteus/cpartitioning.pyx",
958  "__init__.pxd",
959  "stringsource",
960  "type.pxd",
961  "MPI.pxd",
962  "proteus/cmeshTools.pxd",
963 };
964 /* ForceInitThreads.proto */
965 #ifndef __PYX_FORCE_INIT_THREADS
966  #define __PYX_FORCE_INIT_THREADS 0
967 #endif
968 
969 /* NoFastGil.proto */
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()
975 
976 /* BufferFormatStructs.proto */
977 #define IS_UNSIGNED(type) (((type) -1) > 0)
978 struct __Pyx_StructField_;
979 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
980 typedef struct {
981  const char* name;
982  struct __Pyx_StructField_* fields;
983  size_t size;
984  size_t arraysize[8];
985  int ndim;
986  char typegroup;
987  char is_unsigned;
988  int flags;
989 } __Pyx_TypeInfo;
990 typedef struct __Pyx_StructField_ {
991  __Pyx_TypeInfo* type;
992  const char* name;
993  size_t offset;
994 } __Pyx_StructField;
995 typedef struct {
996  __Pyx_StructField* field;
997  size_t parent_offset;
998 } __Pyx_BufFmt_StackElem;
999 typedef struct {
1000  __Pyx_StructField root;
1001  __Pyx_BufFmt_StackElem* head;
1002  size_t fmt_offset;
1003  size_t new_count, enc_count;
1004  size_t struct_alignment;
1005  int is_complex;
1006  char enc_type;
1007  char new_packmode;
1008  char enc_packmode;
1009  char is_valid_array;
1010 } __Pyx_BufFmt_Context;
1011 
1012 /* Atomics.proto */
1013 #include <pythread.h>
1014 #ifndef CYTHON_ATOMICS
1015  #define CYTHON_ATOMICS 1
1016 #endif
1017 #define __pyx_atomic_int_type int
1018 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1019  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1020  !defined(__i386__)
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"
1025  #endif
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")
1034  #endif
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"
1040  #endif
1041 #else
1042  #undef CYTHON_ATOMICS
1043  #define CYTHON_ATOMICS 0
1044  #ifdef __PYX_DEBUG_ATOMICS
1045  #warning "Not using atomics"
1046  #endif
1047 #endif
1048 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1049 #if CYTHON_ATOMICS
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)
1054 #else
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)
1059 #endif
1060 
1061 /* MemviewSliceStruct.proto */
1062 struct __pyx_memoryview_obj;
1063 typedef struct {
1064  struct __pyx_memoryview_obj *memview;
1065  char *data;
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])
1071 
1072 
1073 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1074  * # in Cython to enable them only on the right systems.
1075  *
1076  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1077  * ctypedef npy_int16 int16_t
1078  * ctypedef npy_int32 int32_t
1079  */
1080 typedef npy_int8 __pyx_t_5numpy_int8_t;
1081 
1082 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1083  *
1084  * ctypedef npy_int8 int8_t
1085  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1086  * ctypedef npy_int32 int32_t
1087  * ctypedef npy_int64 int64_t
1088  */
1089 typedef npy_int16 __pyx_t_5numpy_int16_t;
1090 
1091 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1092  * ctypedef npy_int8 int8_t
1093  * ctypedef npy_int16 int16_t
1094  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1095  * ctypedef npy_int64 int64_t
1096  * #ctypedef npy_int96 int96_t
1097  */
1098 typedef npy_int32 __pyx_t_5numpy_int32_t;
1099 
1100 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1101  * ctypedef npy_int16 int16_t
1102  * ctypedef npy_int32 int32_t
1103  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1104  * #ctypedef npy_int96 int96_t
1105  * #ctypedef npy_int128 int128_t
1106  */
1107 typedef npy_int64 __pyx_t_5numpy_int64_t;
1108 
1109 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1110  * #ctypedef npy_int128 int128_t
1111  *
1112  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1113  * ctypedef npy_uint16 uint16_t
1114  * ctypedef npy_uint32 uint32_t
1115  */
1116 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1117 
1118 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1119  *
1120  * ctypedef npy_uint8 uint8_t
1121  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1122  * ctypedef npy_uint32 uint32_t
1123  * ctypedef npy_uint64 uint64_t
1124  */
1125 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1126 
1127 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1128  * ctypedef npy_uint8 uint8_t
1129  * ctypedef npy_uint16 uint16_t
1130  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1131  * ctypedef npy_uint64 uint64_t
1132  * #ctypedef npy_uint96 uint96_t
1133  */
1134 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1135 
1136 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1137  * ctypedef npy_uint16 uint16_t
1138  * ctypedef npy_uint32 uint32_t
1139  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1140  * #ctypedef npy_uint96 uint96_t
1141  * #ctypedef npy_uint128 uint128_t
1142  */
1143 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1144 
1145 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1146  * #ctypedef npy_uint128 uint128_t
1147  *
1148  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1149  * ctypedef npy_float64 float64_t
1150  * #ctypedef npy_float80 float80_t
1151  */
1152 typedef npy_float32 __pyx_t_5numpy_float32_t;
1153 
1154 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1155  *
1156  * ctypedef npy_float32 float32_t
1157  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1158  * #ctypedef npy_float80 float80_t
1159  * #ctypedef npy_float128 float128_t
1160  */
1161 typedef npy_float64 __pyx_t_5numpy_float64_t;
1162 
1163 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1164  * # The int types are mapped a bit surprising --
1165  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1166  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1167  * ctypedef npy_longlong long_t
1168  * ctypedef npy_longlong longlong_t
1169  */
1170 typedef npy_long __pyx_t_5numpy_int_t;
1171 
1172 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1173  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1174  * ctypedef npy_long int_t
1175  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1176  * ctypedef npy_longlong longlong_t
1177  *
1178  */
1179 typedef npy_longlong __pyx_t_5numpy_long_t;
1180 
1181 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1182  * ctypedef npy_long int_t
1183  * ctypedef npy_longlong long_t
1184  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1185  *
1186  * ctypedef npy_ulong uint_t
1187  */
1188 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1189 
1190 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1191  * ctypedef npy_longlong longlong_t
1192  *
1193  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1194  * ctypedef npy_ulonglong ulong_t
1195  * ctypedef npy_ulonglong ulonglong_t
1196  */
1197 typedef npy_ulong __pyx_t_5numpy_uint_t;
1198 
1199 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1200  *
1201  * ctypedef npy_ulong uint_t
1202  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1203  * ctypedef npy_ulonglong ulonglong_t
1204  *
1205  */
1206 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1207 
1208 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1209  * ctypedef npy_ulong uint_t
1210  * ctypedef npy_ulonglong ulong_t
1211  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1212  *
1213  * ctypedef npy_intp intp_t
1214  */
1215 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1216 
1217 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1218  * ctypedef npy_ulonglong ulonglong_t
1219  *
1220  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1221  * ctypedef npy_uintp uintp_t
1222  *
1223  */
1224 typedef npy_intp __pyx_t_5numpy_intp_t;
1225 
1226 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1227  *
1228  * ctypedef npy_intp intp_t
1229  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1230  *
1231  * ctypedef npy_double float_t
1232  */
1233 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1234 
1235 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1236  * ctypedef npy_uintp uintp_t
1237  *
1238  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1239  * ctypedef npy_double double_t
1240  * ctypedef npy_longdouble longdouble_t
1241  */
1242 typedef npy_double __pyx_t_5numpy_float_t;
1243 
1244 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1245  *
1246  * ctypedef npy_double float_t
1247  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1248  * ctypedef npy_longdouble longdouble_t
1249  *
1250  */
1251 typedef npy_double __pyx_t_5numpy_double_t;
1252 
1253 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1254  * ctypedef npy_double float_t
1255  * ctypedef npy_double double_t
1256  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1257  *
1258  * ctypedef npy_cfloat cfloat_t
1259  */
1260 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1261 /* Declarations.proto */
1262 #if CYTHON_CCOMPLEX
1263  #ifdef __cplusplus
1264  typedef ::std::complex< float > __pyx_t_float_complex;
1265  #else
1266  typedef float _Complex __pyx_t_float_complex;
1267  #endif
1268 #else
1269  typedef struct { float real, imag; } __pyx_t_float_complex;
1270 #endif
1271 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1272 
1273 /* Declarations.proto */
1274 #if CYTHON_CCOMPLEX
1275  #ifdef __cplusplus
1276  typedef ::std::complex< double > __pyx_t_double_complex;
1277  #else
1278  typedef double _Complex __pyx_t_double_complex;
1279  #endif
1280 #else
1281  typedef struct { double real, imag; } __pyx_t_double_complex;
1282 #endif
1283 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1284 
1285 
1286 /*--- Type declarations ---*/
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;
1311 
1312 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1313  * ctypedef npy_longdouble longdouble_t
1314  *
1315  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1316  * ctypedef npy_cdouble cdouble_t
1317  * ctypedef npy_clongdouble clongdouble_t
1318  */
1319 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1320 
1321 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1322  *
1323  * ctypedef npy_cfloat cfloat_t
1324  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1325  * ctypedef npy_clongdouble clongdouble_t
1326  *
1327  */
1328 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1329 
1330 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1331  * ctypedef npy_cfloat cfloat_t
1332  * ctypedef npy_cdouble cdouble_t
1333  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1334  *
1335  * ctypedef npy_cdouble complex_t
1336  */
1337 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1338 
1339 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1340  * ctypedef npy_clongdouble clongdouble_t
1341  *
1342  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1343  *
1344  * cdef inline object PyArray_MultiIterNew1(a):
1345  */
1346 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1347 
1348 /* "mpi4py/MPI.pxd":28
1349  * ctypedef MPI_Count Count "MPI_Count"
1350  *
1351  * ctypedef public api class Datatype [ # <<<<<<<<<<<<<<
1352  * type PyMPIDatatype_Type,
1353  * object PyMPIDatatypeObject,
1354  */
1355 struct PyMPIDatatypeObject {
1356  PyObject_HEAD
1357  MPI_Datatype ob_mpi;
1358  unsigned int flags;
1359  PyObject *__weakref__;
1360 };
1361 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1362 
1363 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1364 
1365 /* "mpi4py/MPI.pxd":36
1366  * cdef object __weakref__
1367  *
1368  * ctypedef public api class Status [ # <<<<<<<<<<<<<<
1369  * type PyMPIStatus_Type,
1370  * object PyMPIStatusObject,
1371  */
1372 struct PyMPIStatusObject {
1373  PyObject_HEAD
1374  MPI_Status ob_mpi;
1375  unsigned int flags;
1376  PyObject *__weakref__;
1377 };
1378 typedef struct PyMPIStatusObject PyMPIStatusObject;
1379 
1380 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1381 
1382 /* "mpi4py/MPI.pxd":44
1383  * cdef object __weakref__
1384  *
1385  * ctypedef public api class Request [ # <<<<<<<<<<<<<<
1386  * type PyMPIRequest_Type,
1387  * object PyMPIRequestObject,
1388  */
1389 struct PyMPIRequestObject {
1390  PyObject_HEAD
1391  MPI_Request ob_mpi;
1392  unsigned int flags;
1393  PyObject *__weakref__;
1394  PyObject *ob_buf;
1395 };
1396 typedef struct PyMPIRequestObject PyMPIRequestObject;
1397 
1398 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1399 
1400 /* "mpi4py/MPI.pxd":53
1401  * cdef object ob_buf
1402  *
1403  * ctypedef public api class Prequest(Request) [ # <<<<<<<<<<<<<<
1404  * type PyMPIPrequest_Type,
1405  * object PyMPIPrequestObject,
1406  */
1407 struct PyMPIPrequestObject {
1408  struct PyMPIRequestObject __pyx_base;
1409 };
1410 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1411 
1412 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1413 
1414 /* "mpi4py/MPI.pxd":59
1415  * pass
1416  *
1417  * ctypedef public api class Grequest(Request) [ # <<<<<<<<<<<<<<
1418  * type PyMPIGrequest_Type,
1419  * object PyMPIGrequestObject,
1420  */
1421 struct PyMPIGrequestObject {
1422  struct PyMPIRequestObject __pyx_base;
1423  MPI_Request ob_grequest;
1424 };
1425 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1426 
1427 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1428 
1429 /* "mpi4py/MPI.pxd":65
1430  * cdef MPI_Request ob_grequest
1431  *
1432  * ctypedef public api class Message [ # <<<<<<<<<<<<<<
1433  * type PyMPIMessage_Type,
1434  * object PyMPIMessageObject,
1435  */
1436 struct PyMPIMessageObject {
1437  PyObject_HEAD
1438  MPI_Message ob_mpi;
1439  unsigned int flags;
1440  PyObject *__weakref__;
1441  PyObject *ob_buf;
1442 };
1443 typedef struct PyMPIMessageObject PyMPIMessageObject;
1444 
1445 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1446 
1447 /* "mpi4py/MPI.pxd":74
1448  * cdef object ob_buf
1449  *
1450  * ctypedef public api class Op [ # <<<<<<<<<<<<<<
1451  * type PyMPIOp_Type,
1452  * object PyMPIOpObject,
1453  */
1454 struct PyMPIOpObject {
1455  PyObject_HEAD
1456  MPI_Op ob_mpi;
1457  unsigned int flags;
1458  PyObject *__weakref__;
1459  PyObject *(*ob_func)(PyObject *, PyObject *);
1460  int ob_usrid;
1461 };
1462 typedef struct PyMPIOpObject PyMPIOpObject;
1463 
1464 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1465 
1466 /* "mpi4py/MPI.pxd":84
1467  * cdef int ob_usrid
1468  *
1469  * ctypedef public api class Group [ # <<<<<<<<<<<<<<
1470  * type PyMPIGroup_Type,
1471  * object PyMPIGroupObject,
1472  */
1473 struct PyMPIGroupObject {
1474  PyObject_HEAD
1475  MPI_Group ob_mpi;
1476  unsigned int flags;
1477  PyObject *__weakref__;
1478 };
1479 typedef struct PyMPIGroupObject PyMPIGroupObject;
1480 
1481 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1482 
1483 /* "mpi4py/MPI.pxd":92
1484  * cdef object __weakref__
1485  *
1486  * ctypedef public api class Info [ # <<<<<<<<<<<<<<
1487  * type PyMPIInfo_Type,
1488  * object PyMPIInfoObject,
1489  */
1490 struct PyMPIInfoObject {
1491  PyObject_HEAD
1492  MPI_Info ob_mpi;
1493  unsigned int flags;
1494  PyObject *__weakref__;
1495 };
1496 typedef struct PyMPIInfoObject PyMPIInfoObject;
1497 
1498 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1499 
1500 /* "mpi4py/MPI.pxd":100
1501  * cdef object __weakref__
1502  *
1503  * ctypedef public api class Errhandler [ # <<<<<<<<<<<<<<
1504  * type PyMPIErrhandler_Type,
1505  * object PyMPIErrhandlerObject,
1506  */
1507 struct PyMPIErrhandlerObject {
1508  PyObject_HEAD
1509  MPI_Errhandler ob_mpi;
1510  unsigned int flags;
1511  PyObject *__weakref__;
1512 };
1513 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1514 
1515 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1516 
1517 /* "mpi4py/MPI.pxd":108
1518  * cdef object __weakref__
1519  *
1520  * ctypedef public api class Comm [ # <<<<<<<<<<<<<<
1521  * type PyMPIComm_Type,
1522  * object PyMPICommObject,
1523  */
1524 struct PyMPICommObject {
1525  PyObject_HEAD
1526  MPI_Comm ob_mpi;
1527  unsigned int flags;
1528  PyObject *__weakref__;
1529 };
1530 typedef struct PyMPICommObject PyMPICommObject;
1531 
1532 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1533 
1534 /* "mpi4py/MPI.pxd":116
1535  * cdef object __weakref__
1536  *
1537  * ctypedef public api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
1538  * type PyMPIIntracomm_Type,
1539  * object PyMPIIntracommObject,
1540  */
1541 struct PyMPIIntracommObject {
1542  struct PyMPICommObject __pyx_base;
1543 };
1544 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1545 
1546 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1547 
1548 /* "mpi4py/MPI.pxd":122
1549  * pass
1550  *
1551  * ctypedef public api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
1552  * type PyMPITopocomm_Type,
1553  * object PyMPITopocommObject,
1554  */
1555 struct PyMPITopocommObject {
1556  struct PyMPIIntracommObject __pyx_base;
1557 };
1558 typedef struct PyMPITopocommObject PyMPITopocommObject;
1559 
1560 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1561 
1562 /* "mpi4py/MPI.pxd":128
1563  * pass
1564  *
1565  * ctypedef public api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
1566  * type PyMPICartcomm_Type,
1567  * object PyMPICartcommObject,
1568  */
1569 struct PyMPICartcommObject {
1570  struct PyMPITopocommObject __pyx_base;
1571 };
1572 typedef struct PyMPICartcommObject PyMPICartcommObject;
1573 
1574 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1575 
1576 /* "mpi4py/MPI.pxd":134
1577  * pass
1578  *
1579  * ctypedef public api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1580  * type PyMPIGraphcomm_Type,
1581  * object PyMPIGraphcommObject,
1582  */
1583 struct PyMPIGraphcommObject {
1584  struct PyMPITopocommObject __pyx_base;
1585 };
1586 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1587 
1588 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1589 
1590 /* "mpi4py/MPI.pxd":140
1591  * pass
1592  *
1593  * ctypedef public api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1594  * type PyMPIDistgraphcomm_Type,
1595  * object PyMPIDistgraphcommObject,
1596  */
1597 struct PyMPIDistgraphcommObject {
1598  struct PyMPITopocommObject __pyx_base;
1599 };
1600 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1601 
1602 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1603 
1604 /* "mpi4py/MPI.pxd":146
1605  * pass
1606  *
1607  * ctypedef public api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
1608  * type PyMPIIntercomm_Type,
1609  * object PyMPIIntercommObject,
1610  */
1611 struct PyMPIIntercommObject {
1612  struct PyMPICommObject __pyx_base;
1613 };
1614 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1615 
1616 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1617 
1618 /* "mpi4py/MPI.pxd":152
1619  * pass
1620  *
1621  * ctypedef public api class Win [ # <<<<<<<<<<<<<<
1622  * type PyMPIWin_Type,
1623  * object PyMPIWinObject,
1624  */
1625 struct PyMPIWinObject {
1626  PyObject_HEAD
1627  MPI_Win ob_mpi;
1628  unsigned int flags;
1629  PyObject *__weakref__;
1630  PyObject *ob_mem;
1631 };
1632 typedef struct PyMPIWinObject PyMPIWinObject;
1633 
1634 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1635 
1636 /* "mpi4py/MPI.pxd":161
1637  * cdef object ob_mem
1638  *
1639  * ctypedef public api class File [ # <<<<<<<<<<<<<<
1640  * type PyMPIFile_Type,
1641  * object PyMPIFileObject,
1642  */
1643 struct PyMPIFileObject {
1644  PyObject_HEAD
1645  MPI_File ob_mpi;
1646  unsigned int flags;
1647  PyObject *__weakref__;
1648 };
1649 typedef struct PyMPIFileObject PyMPIFileObject;
1650 
1651 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1652 
1653 /* "cmeshTools.pxd":5
1654  * cimport mesh as cppm
1655  *
1656  * cdef class CMesh: # <<<<<<<<<<<<<<
1657  * cdef cppm.Mesh mesh
1658  * cdef public:
1659  */
1660 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1661  PyObject_HEAD
1662  struct Mesh mesh;
1663  int nElements_global;
1664  int nNodes_global;
1665  int nNodes_element;
1671  int max_nElements_node;
1672  int nEdges_global;
1674  PyArrayObject *elementNodesArray;
1675  PyArrayObject *nodeElementsArray;
1676  PyArrayObject *nodeElementOffsets;
1677  PyArrayObject *elementNeighborsArray;
1678  PyArrayObject *elementBoundariesArray;
1679  PyArrayObject *elementBoundaryNodesArray;
1680  PyArrayObject *elementBoundaryElementsArray;
1682  PyArrayObject *interiorElementBoundariesArray;
1683  PyArrayObject *exteriorElementBoundariesArray;
1684  PyArrayObject *edgeNodesArray;
1685  PyArrayObject *nodeStarArray;
1686  PyArrayObject *nodeStarOffsets;
1687  PyArrayObject *elementMaterialTypes;
1688  PyArrayObject *elementBoundaryMaterialTypes;
1689  PyArrayObject *nodeMaterialTypes;
1690  PyArrayObject *nodeArray;
1691  int nx;
1692  int ny;
1693  int nz;
1694  int px;
1695  int py;
1696  int pz;
1697  PyArrayObject *elementIJK;
1698  PyArrayObject *weights;
1699  PyArrayObject *U_KNOT;
1700  PyArrayObject *V_KNOT;
1701  PyArrayObject *W_KNOT;
1702  PyArrayObject *elementDiametersArray;
1703  PyArrayObject *elementInnerDiametersArray;
1704  PyArrayObject *elementBoundaryDiametersArray;
1705  PyArrayObject *elementBarycentersArray;
1706  PyArrayObject *elementBoundaryBarycentersArray;
1707  PyArrayObject *nodeDiametersArray;
1708  PyArrayObject *nodeSupportArray;
1709  double h;
1710  double hMin;
1711  double sigmaMax;
1712  double volume;
1713 };
1714 
1715 
1716 /* "View.MemoryView":105
1717  *
1718  * @cname("__pyx_array")
1719  * cdef class array: # <<<<<<<<<<<<<<
1720  *
1721  * cdef:
1722  */
1723 struct __pyx_array_obj {
1724  PyObject_HEAD
1725  struct __pyx_vtabstruct_array *__pyx_vtab;
1726  char *data;
1727  Py_ssize_t len;
1728  char *format;
1729  int ndim;
1730  Py_ssize_t *_shape;
1731  Py_ssize_t *_strides;
1732  Py_ssize_t itemsize;
1733  PyObject *mode;
1734  PyObject *_format;
1735  void (*callback_free_data)(void *);
1736  int free_data;
1737  int dtype_is_object;
1738 };
1739 
1740 
1741 /* "View.MemoryView":279
1742  *
1743  * @cname('__pyx_MemviewEnum')
1744  * cdef class Enum(object): # <<<<<<<<<<<<<<
1745  * cdef object name
1746  * def __init__(self, name):
1747  */
1748 struct __pyx_MemviewEnum_obj {
1749  PyObject_HEAD
1750  PyObject *name;
1751 };
1752 
1753 
1754 /* "View.MemoryView":330
1755  *
1756  * @cname('__pyx_memoryview')
1757  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1758  *
1759  * cdef object obj
1760  */
1761 struct __pyx_memoryview_obj {
1762  PyObject_HEAD
1763  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1764  PyObject *obj;
1765  PyObject *_size;
1766  PyObject *_array_interface;
1767  PyThread_type_lock lock;
1768  __pyx_atomic_int acquisition_count[2];
1769  __pyx_atomic_int *acquisition_count_aligned_p;
1770  Py_buffer view;
1771  int flags;
1772  int dtype_is_object;
1773  __Pyx_TypeInfo *typeinfo;
1774 };
1775 
1776 
1777 /* "View.MemoryView":965
1778  *
1779  * @cname('__pyx_memoryviewslice')
1780  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1781  * "Internal class for passing memoryview slices to Python"
1782  *
1783  */
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 *);
1790 };
1791 
1792 
1793 
1794 /* "View.MemoryView":105
1795  *
1796  * @cname("__pyx_array")
1797  * cdef class array: # <<<<<<<<<<<<<<
1798  *
1799  * cdef:
1800  */
1801 
1802 struct __pyx_vtabstruct_array {
1803  PyObject *(*get_memview)(struct __pyx_array_obj *);
1804 };
1805 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1806 
1807 
1808 /* "View.MemoryView":330
1809  *
1810  * @cname('__pyx_memoryview')
1811  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1812  *
1813  * cdef object obj
1814  */
1815 
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 *);
1824 };
1825 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1826 
1827 
1828 /* "View.MemoryView":965
1829  *
1830  * @cname('__pyx_memoryviewslice')
1831  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1832  * "Internal class for passing memoryview slices to Python"
1833  *
1834  */
1835 
1836 struct __pyx_vtabstruct__memoryviewslice {
1837  struct __pyx_vtabstruct_memoryview __pyx_base;
1838 };
1839 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1840 
1841 /* --- Runtime support code (head) --- */
1842 /* Refnanny.proto */
1843 #ifndef CYTHON_REFNANNY
1844  #define CYTHON_REFNANNY 0
1845 #endif
1846 #if CYTHON_REFNANNY
1847  typedef struct {
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;
1858 #ifdef WITH_THREAD
1859  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1860  if (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);\
1864  } else {\
1865  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1866  }
1867 #else
1868  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1869  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1870 #endif
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)
1881 #else
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)
1893 #endif
1894 #define __Pyx_XDECREF_SET(r, v) do {\
1895  PyObject *tmp = (PyObject *) r;\
1896  r = v; __Pyx_XDECREF(tmp);\
1897  } while (0)
1898 #define __Pyx_DECREF_SET(r, v) do {\
1899  PyObject *tmp = (PyObject *) r;\
1900  r = v; __Pyx_DECREF(tmp);\
1901  } while (0)
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)
1904 
1905 /* RaiseArgTupleInvalid.proto */
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);
1908 
1909 /* RaiseDoubleKeywords.proto */
1910 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1911 
1912 /* ParseKeywords.proto */
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);
1916 
1917 /* ArgTypeTest.proto */
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);
1922 
1923 /* PyObjectGetAttrStr.proto */
1924 #if CYTHON_USE_TYPE_SLOTS
1925 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1926 #else
1927 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1928 #endif
1929 
1930 /* GetBuiltinName.proto */
1931 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1932 
1933 /* PyDictVersioning.proto */
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;\
1945  } else {\
1946  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1947  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1948  }\
1949 }
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);
1953 #else
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);
1957 #endif
1958 
1959 /* GetModuleGlobalName.proto */
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);\
1967 }
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);\
1972 }
1973 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1974 #else
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);
1978 #endif
1979 
1980 /* PyIntBinop.proto */
1981 #if !CYTHON_COMPILING_IN_PYPY
1982 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1983 #else
1984 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1985  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1986 #endif
1987 
1988 /* PyCFunctionFastCall.proto */
1989 #if CYTHON_FAST_PYCCALL
1990 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1991 #else
1992 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1993 #endif
1994 
1995 /* PyFunctionFastCall.proto */
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);
2001 #else
2002 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2003 #endif
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)
2008 #endif
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
2015  #endif
2016  #include "internal/pycore_frame.h"
2017 #endif
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
2024 #endif
2025 
2026 /* PyObjectCall.proto */
2027 #if CYTHON_COMPILING_IN_CPYTHON
2028 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2029 #else
2030 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2031 #endif
2032 
2033 /* PyObjectCall2Args.proto */
2034 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2035 
2036 /* PyObjectCallMethO.proto */
2037 #if CYTHON_COMPILING_IN_CPYTHON
2038 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2039 #endif
2040 
2041 /* PyObjectCallOneArg.proto */
2042 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2043 
2044 /* PyObjectCallNoArg.proto */
2045 #if CYTHON_COMPILING_IN_CPYTHON
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2047 #else
2048 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2049 #endif
2050 
2051 /* GetTopmostException.proto */
2052 #if CYTHON_USE_EXC_INFO_STACK
2053 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2054 #endif
2055 
2056 /* PyThreadStateGet.proto */
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
2061 #else
2062 #define __Pyx_PyThreadState_declare
2063 #define __Pyx_PyThreadState_assign
2064 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
2065 #endif
2066 
2067 /* SaveResetException.proto */
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);
2073 #else
2074 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2075 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2076 #endif
2077 
2078 /* PyErrExceptionMatches.proto */
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);
2082 #else
2083 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2084 #endif
2085 
2086 /* GetException.proto */
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);
2090 #else
2091 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2092 #endif
2093 
2094 /* PyErrFetchRestore.proto */
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))
2105 #else
2106 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2107 #endif
2108 #else
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)
2117 #endif
2118 
2119 /* RaiseException.proto */
2120 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2121 
2122 /* IncludeStringH.proto */
2123 #include <string.h>
2124 
2125 /* BytesEquals.proto */
2126 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2127 
2128 /* UnicodeEquals.proto */
2129 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2130 
2131 /* StrEquals.proto */
2132 #if PY_MAJOR_VERSION >= 3
2133 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2134 #else
2135 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2136 #endif
2137 
2138 /* DivInt[Py_ssize_t].proto */
2139 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2140 
2141 /* UnaryNegOverflows.proto */
2142 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2143  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2144 
2145 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2146 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2147 /* GetAttr.proto */
2148 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2149 
2150 /* GetItemInt.proto */
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);
2171 
2172 /* ObjectGetItem.proto */
2173 #if CYTHON_USE_TYPE_SLOTS
2174 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2175 #else
2176 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2177 #endif
2178 
2179 /* decode_c_string_utf16.proto */
2180 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2181  int byteorder = 0;
2182  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2183 }
2184 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2185  int byteorder = -1;
2186  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2187 }
2188 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2189  int byteorder = 1;
2190  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2191 }
2192 
2193 /* decode_c_string.proto */
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));
2198 
2199 /* GetAttr3.proto */
2200 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2201 
2202 /* RaiseTooManyValuesToUnpack.proto */
2203 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2204 
2205 /* RaiseNeedMoreValuesToUnpack.proto */
2206 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2207 
2208 /* RaiseNoneIterError.proto */
2209 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2210 
2211 /* ExtTypeTest.proto */
2212 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2213 
2214 /* SwapException.proto */
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);
2218 #else
2219 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2220 #endif
2221 
2222 /* Import.proto */
2223 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2224 
2225 /* FastTypeChecks.proto */
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);
2231 #else
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))
2235 #endif
2236 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2237 
2238 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2239 /* ListCompAppend.proto */
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)) {
2245  Py_INCREF(x);
2246  PyList_SET_ITEM(list, len, x);
2247  __Pyx_SET_SIZE(list, len + 1);
2248  return 0;
2249  }
2250  return PyList_Append(list, x);
2251 }
2252 #else
2253 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2254 #endif
2255 
2256 /* ListExtend.proto */
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))
2261  return -1;
2262  Py_DECREF(none);
2263  return 0;
2264 #else
2265  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2266 #endif
2267 }
2268 
2269 /* ListAppend.proto */
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))) {
2275  Py_INCREF(x);
2276  PyList_SET_ITEM(list, len, x);
2277  __Pyx_SET_SIZE(list, len + 1);
2278  return 0;
2279  }
2280  return PyList_Append(list, x);
2281 }
2282 #else
2283 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2284 #endif
2285 
2286 /* None.proto */
2287 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2288 
2289 /* DivInt[long].proto */
2290 static CYTHON_INLINE long __Pyx_div_long(long, long);
2291 
2292 /* PySequenceContains.proto */
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));
2296 }
2297 
2298 /* ImportFrom.proto */
2299 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2300 
2301 /* HasAttr.proto */
2302 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2303 
2304 /* StringJoin.proto */
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))
2308 #else
2309 #define __Pyx_PyString_Join PyUnicode_Join
2310 #define __Pyx_PyBaseString_Join PyUnicode_Join
2311 #endif
2312 #if CYTHON_COMPILING_IN_CPYTHON
2313  #if PY_MAJOR_VERSION < 3
2314  #define __Pyx_PyBytes_Join _PyString_Join
2315  #else
2316  #define __Pyx_PyBytes_Join _PyBytes_Join
2317  #endif
2318 #else
2319 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2320 #endif
2321 
2322 /* PyObject_Unicode.proto */
2323 #if PY_MAJOR_VERSION >= 3
2324 #define __Pyx_PyObject_Unicode(obj)\
2325  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2326 #else
2327 #define __Pyx_PyObject_Unicode(obj)\
2328  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2329 #endif
2330 
2331 /* PyObject_GenericGetAttrNoDict.proto */
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);
2334 #else
2335 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2336 #endif
2337 
2338 /* PyObject_GenericGetAttr.proto */
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);
2341 #else
2342 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2343 #endif
2344 
2345 /* SetVTable.proto */
2346 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2347 
2348 /* PyObjectGetAttrStrNoError.proto */
2349 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2350 
2351 /* SetupReduce.proto */
2352 static int __Pyx_setup_reduce(PyObject* type_obj);
2353 
2354 /* TypeImport.proto */
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
2361 };
2362 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2363 #endif
2364 
2365 /* CLineInTraceback.proto */
2366 #ifdef CYTHON_CLINE_IN_TRACEBACK
2367 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2368 #else
2369 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2370 #endif
2371 
2372 /* CodeObjectCache.proto */
2373 typedef struct {
2374  PyCodeObject* code_object;
2375  int code_line;
2376 } __Pyx_CodeObjectCacheEntry;
2377 struct __Pyx_CodeObjectCache {
2378  int count;
2379  int max_count;
2380  __Pyx_CodeObjectCacheEntry* entries;
2381 };
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);
2386 
2387 /* AddTraceback.proto */
2388 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2389  int py_line, const char *filename);
2390 
2391 /* GCCDiagnostics.proto */
2392 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2393 #define __Pyx_HAS_GCC_DIAGNOSTIC
2394 #endif
2395 
2396 /* MemviewDtypeToObject.proto */
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);
2399 
2400 /* RealImag.proto */
2401 #if CYTHON_CCOMPLEX
2402  #ifdef __cplusplus
2403  #define __Pyx_CREAL(z) ((z).real())
2404  #define __Pyx_CIMAG(z) ((z).imag())
2405  #else
2406  #define __Pyx_CREAL(z) (__real__(z))
2407  #define __Pyx_CIMAG(z) (__imag__(z))
2408  #endif
2409 #else
2410  #define __Pyx_CREAL(z) ((z).real)
2411  #define __Pyx_CIMAG(z) ((z).imag)
2412 #endif
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))
2417 #else
2418  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2419  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2420 #endif
2421 
2422 /* Arithmetic.proto */
2423 #if CYTHON_CCOMPLEX
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))
2430  #ifdef __cplusplus
2431  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2432  #define __Pyx_c_conj_float(z) (::std::conj(z))
2433  #if 1
2434  #define __Pyx_c_abs_float(z) (::std::abs(z))
2435  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2436  #endif
2437  #else
2438  #define __Pyx_c_is_zero_float(z) ((z)==0)
2439  #define __Pyx_c_conj_float(z) (conjf(z))
2440  #if 1
2441  #define __Pyx_c_abs_float(z) (cabsf(z))
2442  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2443  #endif
2444  #endif
2445 #else
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);
2454  #if 1
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);
2457  #endif
2458 #endif
2459 
2460 /* Arithmetic.proto */
2461 #if CYTHON_CCOMPLEX
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))
2468  #ifdef __cplusplus
2469  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2470  #define __Pyx_c_conj_double(z) (::std::conj(z))
2471  #if 1
2472  #define __Pyx_c_abs_double(z) (::std::abs(z))
2473  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2474  #endif
2475  #else
2476  #define __Pyx_c_is_zero_double(z) ((z)==0)
2477  #define __Pyx_c_conj_double(z) (conj(z))
2478  #if 1
2479  #define __Pyx_c_abs_double(z) (cabs(z))
2480  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2481  #endif
2482  #endif
2483 #else
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);
2492  #if 1
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);
2495  #endif
2496 #endif
2497 
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);
2501 #else
2502  #define __Pyx_GetBuffer PyObject_GetBuffer
2503  #define __Pyx_ReleaseBuffer PyBuffer_Release
2504 #endif
2505 
2506 
2507 /* BufferStructDeclare.proto */
2508 typedef struct {
2509  Py_ssize_t shape, strides, suboffsets;
2510 } __Pyx_Buf_DimInfo;
2511 typedef struct {
2512  size_t refcount;
2513  Py_buffer pybuffer;
2514 } __Pyx_Buffer;
2515 typedef struct {
2516  __Pyx_Buffer *rcbuffer;
2517  char *data;
2518  __Pyx_Buf_DimInfo diminfo[8];
2519 } __Pyx_LocalBuf_ND;
2520 
2521 /* MemviewSliceIsContig.proto */
2522 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2523 
2524 /* OverlappingSlices.proto */
2525 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2526  __Pyx_memviewslice *slice2,
2527  int ndim, size_t itemsize);
2528 
2529 /* Capsule.proto */
2530 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2531 
2532 /* CIntFromPy.proto */
2533 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2534 
2535 /* CIntToPy.proto */
2536 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2537 
2538 /* TypeInfoToFormat.proto */
2539 struct __pyx_typeinfo_string {
2540  char string[3];
2541 };
2542 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2543 
2544 /* MemviewSliceCopyTemplate.proto */
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);
2550 
2551 /* MemviewSliceInit.proto */
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,
2563  int ndim,
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);
2576 
2577 /* CIntFromPy.proto */
2578 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2579 
2580 /* CIntToPy.proto */
2581 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2582 
2583 /* CIntFromPy.proto */
2584 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2585 
2586 /* CheckBinaryVersion.proto */
2587 static int __Pyx_check_binary_version(void);
2588 
2589 /* InitStrings.proto */
2590 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2591 
2592 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2593 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2594 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2595 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
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); /* proto*/
2597 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2598 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2599 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2600 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2601 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2602 
2603 /* Module declarations from 'cpython.buffer' */
2604 
2605 /* Module declarations from 'libc.string' */
2606 
2607 /* Module declarations from 'libc.stdio' */
2608 
2609 /* Module declarations from '__builtin__' */
2610 
2611 /* Module declarations from 'cpython.type' */
2612 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2613 
2614 /* Module declarations from 'cpython' */
2615 
2616 /* Module declarations from 'cpython.object' */
2617 
2618 /* Module declarations from 'cpython.ref' */
2619 
2620 /* Module declarations from 'cpython.mem' */
2621 
2622 /* Module declarations from 'numpy' */
2623 
2624 /* Module declarations from 'numpy' */
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;
2640 
2641 /* Module declarations from 'mpi4py.libmpi' */
2642 
2643 /* Module declarations from 'mpi4py.MPI' */
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;
2663 
2664 /* Module declarations from 'libcpp' */
2665 
2666 /* Module declarations from 'mesh' */
2667 
2668 /* Module declarations from 'proteus' */
2669 
2670 /* Module declarations from 'proteus.mesh' */
2671 
2672 /* Module declarations from 'proteus.cmeshTools' */
2673 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2674 
2675 /* Module declarations from 'proteus.partitioning' */
2676 
2677 /* Module declarations from 'cpartitioning' */
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 *); /*proto*/
2690 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2691 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2692 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2693 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2694 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2695 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
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); /*proto*/
2697 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2698 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2699 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2700 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2701 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2702 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2703 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2704 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2705 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2706 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2707 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2708 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2709 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2710 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2711 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2712 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2713 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2714 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2715 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2716 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2717 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2718 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2719 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2720 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2721 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2722 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
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;
2727 
2728 /* Implementation of 'cpartitioning' */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
3028 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3029 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3030 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3031 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3032 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
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); /* proto */
3034 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
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); /* proto */
3036 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3037 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3038 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3039 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
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); /* proto */
3041 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3042 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
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); /* proto */
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); /* proto */
3045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3046 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3047 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3048 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3049 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3050 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3051 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3052 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3053 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3054 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3055 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3056 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3057 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3058 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3059 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3060 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3061 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
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); /* proto */
3063 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3064 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3065 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
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); /* proto */
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); /* proto */
3068 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3069 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3070 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3071 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
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;
3122 /* Late includes */
3123 
3124 /* "cpartitioning.pyx":20
3125  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3126  *
3127  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3128  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3129  * c_partitionElements(comm.ob_mpi,
3130  */
3131 
3132 /* Python wrapper */
3133 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
3146  {
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)) {
3150  Py_ssize_t kw_args;
3151  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3152  switch (pos_args) {
3153  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3154  CYTHON_FALLTHROUGH;
3155  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3156  CYTHON_FALLTHROUGH;
3157  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3158  CYTHON_FALLTHROUGH;
3159  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3160  CYTHON_FALLTHROUGH;
3161  case 0: break;
3162  default: goto __pyx_L5_argtuple_error;
3163  }
3164  kw_args = PyDict_Size(__pyx_kwds);
3165  switch (pos_args) {
3166  case 0:
3167  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3168  else goto __pyx_L5_argtuple_error;
3169  CYTHON_FALLTHROUGH;
3170  case 1:
3171  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3172  else {
3173  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 20, __pyx_L3_error)
3174  }
3175  CYTHON_FALLTHROUGH;
3176  case 2:
3177  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3178  else {
3179  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 20, __pyx_L3_error)
3180  }
3181  CYTHON_FALLTHROUGH;
3182  case 3:
3183  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3184  else {
3185  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 20, __pyx_L3_error)
3186  }
3187  }
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)
3190  }
3191  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3192  goto __pyx_L5_argtuple_error;
3193  } else {
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);
3198  }
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]);
3203  }
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)
3207  __pyx_L3_error:;
3208  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3209  __Pyx_RefNannyFinishContext();
3210  return NULL;
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);
3216 
3217  /* function exit code */
3218  goto __pyx_L0;
3219  __pyx_L1_error:;
3220  __pyx_r = NULL;
3221  __pyx_L0:;
3222  __Pyx_RefNannyFinishContext();
3223  return __pyx_r;
3224 }
3225 
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;
3232  int *__pyx_t_4;
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);
3247 
3248  /* "cpartitioning.pyx":21
3249  *
3250  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3251  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3252  * c_partitionElements(comm.ob_mpi,
3253  * cmesh.mesh,
3254  */
3255  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3256 
3257  /* "cpartitioning.pyx":22
3258  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3259  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3260  * c_partitionElements(comm.ob_mpi, # <<<<<<<<<<<<<<
3261  * cmesh.mesh,
3262  * nLayersOfOverlap)
3263  */
3264  (void)(proteus::partitionElements(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3265 
3266  /* "cpartitioning.pyx":25
3267  * cmesh.mesh,
3268  * nLayersOfOverlap)
3269  * return ( # <<<<<<<<<<<<<<
3270  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3271  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3272  */
3273  __Pyx_XDECREF(__pyx_r);
3274 
3275  /* "cpartitioning.pyx":26
3276  * nLayersOfOverlap)
3277  * return (
3278  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3279  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3280  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3281  */
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;
3295  if (!__pyx_t_4) {
3296  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3297  __PYX_ERR(0, 26, __pyx_L1_error)
3298  }
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;
3308  __pyx_t_2 = NULL;
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);
3316  }
3317  }
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;
3324 
3325  /* "cpartitioning.pyx":27
3326  * return (
3327  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3328  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3329  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3330  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3331  */
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;
3338  if (!__pyx_t_4) {
3339  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3340  __PYX_ERR(0, 27, __pyx_L1_error)
3341  }
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;
3351  __pyx_t_8 = NULL;
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);
3359  }
3360  }
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;
3367 
3368  /* "cpartitioning.pyx":28
3369  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3370  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3371  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3372  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3373  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3374  */
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;
3388  if (!__pyx_t_4) {
3389  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3390  __PYX_ERR(0, 28, __pyx_L1_error)
3391  }
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;
3401  __pyx_t_8 = NULL;
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);
3409  }
3410  }
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;
3417 
3418  /* "cpartitioning.pyx":29
3419  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3420  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3421  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3422  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3423  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3424  */
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;
3431  if (!__pyx_t_4) {
3432  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3433  __PYX_ERR(0, 29, __pyx_L1_error)
3434  }
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;
3444  __pyx_t_10 = NULL;
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);
3452  }
3453  }
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;
3460 
3461  /* "cpartitioning.pyx":30
3462  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3463  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3464  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3465  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3466  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3467  */
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;
3481  if (!__pyx_t_4) {
3482  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3483  __PYX_ERR(0, 30, __pyx_L1_error)
3484  }
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;
3494  __pyx_t_10 = NULL;
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);
3502  }
3503  }
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;
3510 
3511  /* "cpartitioning.pyx":31
3512  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3513  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3514  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3515  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3516  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3517  */
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;
3524  if (!__pyx_t_4) {
3525  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3526  __PYX_ERR(0, 31, __pyx_L1_error)
3527  }
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;
3537  __pyx_t_12 = NULL;
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);
3545  }
3546  }
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;
3553 
3554  /* "cpartitioning.pyx":32
3555  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3556  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3557  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3558  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3559  * )
3560  */
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;
3574  if (!__pyx_t_4) {
3575  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3576  __PYX_ERR(0, 32, __pyx_L1_error)
3577  }
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;
3587  __pyx_t_12 = NULL;
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);
3595  }
3596  }
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;
3603 
3604  /* "cpartitioning.pyx":33
3605  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3606  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3607  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
3608  * )
3609  *
3610  */
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;
3617  if (!__pyx_t_4) {
3618  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3619  __PYX_ERR(0, 33, __pyx_L1_error)
3620  }
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;
3630  __pyx_t_14 = NULL;
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);
3638  }
3639  }
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;
3646 
3647  /* "cpartitioning.pyx":26
3648  * nLayersOfOverlap)
3649  * return (
3650  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3651  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3652  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3653  */
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);
3672  __pyx_t_1 = 0;
3673  __pyx_t_3 = 0;
3674  __pyx_t_5 = 0;
3675  __pyx_t_2 = 0;
3676  __pyx_t_9 = 0;
3677  __pyx_t_8 = 0;
3678  __pyx_t_11 = 0;
3679  __pyx_t_10 = 0;
3680  __pyx_r = __pyx_t_13;
3681  __pyx_t_13 = 0;
3682  goto __pyx_L0;
3683 
3684  /* "cpartitioning.pyx":20
3685  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3686  *
3687  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3688  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3689  * c_partitionElements(comm.ob_mpi,
3690  */
3691 
3692  /* function exit code */
3693  __pyx_L1_error:;
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);
3707  __pyx_r = NULL;
3708  __pyx_L0:;
3709  __Pyx_XGIVEREF(__pyx_r);
3710  __Pyx_RefNannyFinishContext();
3711  return __pyx_r;
3712 }
3713 
3714 /* "cpartitioning.pyx":36
3715  * )
3716  *
3717  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3718  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3719  * c_partitionNodes(comm.ob_mpi,
3720  */
3721 
3722 /* Python wrapper */
3723 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
3736  {
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)) {
3740  Py_ssize_t kw_args;
3741  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3742  switch (pos_args) {
3743  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3744  CYTHON_FALLTHROUGH;
3745  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3746  CYTHON_FALLTHROUGH;
3747  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3748  CYTHON_FALLTHROUGH;
3749  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3750  CYTHON_FALLTHROUGH;
3751  case 0: break;
3752  default: goto __pyx_L5_argtuple_error;
3753  }
3754  kw_args = PyDict_Size(__pyx_kwds);
3755  switch (pos_args) {
3756  case 0:
3757  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3758  else goto __pyx_L5_argtuple_error;
3759  CYTHON_FALLTHROUGH;
3760  case 1:
3761  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3762  else {
3763  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 36, __pyx_L3_error)
3764  }
3765  CYTHON_FALLTHROUGH;
3766  case 2:
3767  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3768  else {
3769  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 36, __pyx_L3_error)
3770  }
3771  CYTHON_FALLTHROUGH;
3772  case 3:
3773  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3774  else {
3775  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 36, __pyx_L3_error)
3776  }
3777  }
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)
3780  }
3781  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3782  goto __pyx_L5_argtuple_error;
3783  } else {
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);
3788  }
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]);
3793  }
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)
3797  __pyx_L3_error:;
3798  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3799  __Pyx_RefNannyFinishContext();
3800  return NULL;
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);
3806 
3807  /* function exit code */
3808  goto __pyx_L0;
3809  __pyx_L1_error:;
3810  __pyx_r = NULL;
3811  __pyx_L0:;
3812  __Pyx_RefNannyFinishContext();
3813  return __pyx_r;
3814 }
3815 
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;
3822  int *__pyx_t_4;
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);
3837 
3838  /* "cpartitioning.pyx":37
3839  *
3840  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3841  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3842  * c_partitionNodes(comm.ob_mpi,
3843  * cmesh.mesh,
3844  */
3845  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3846 
3847  /* "cpartitioning.pyx":38
3848  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3849  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3850  * c_partitionNodes(comm.ob_mpi, # <<<<<<<<<<<<<<
3851  * cmesh.mesh,
3852  * nLayersOfOverlap)
3853  */
3854  (void)(proteus::partitionNodes(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3855 
3856  /* "cpartitioning.pyx":41
3857  * cmesh.mesh,
3858  * nLayersOfOverlap)
3859  * return ( # <<<<<<<<<<<<<<
3860  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3861  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3862  */
3863  __Pyx_XDECREF(__pyx_r);
3864 
3865  /* "cpartitioning.pyx":42
3866  * nLayersOfOverlap)
3867  * return (
3868  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3869  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3870  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3871  */
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;
3885  if (!__pyx_t_4) {
3886  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3887  __PYX_ERR(0, 42, __pyx_L1_error)
3888  }
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;
3898  __pyx_t_2 = NULL;
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);
3906  }
3907  }
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;
3914 
3915  /* "cpartitioning.pyx":43
3916  * return (
3917  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3918  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3919  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3920  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3921  */
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;
3928  if (!__pyx_t_4) {
3929  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3930  __PYX_ERR(0, 43, __pyx_L1_error)
3931  }
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;
3941  __pyx_t_8 = NULL;
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);
3949  }
3950  }
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;
3957 
3958  /* "cpartitioning.pyx":44
3959  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3960  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3961  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3962  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3963  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3964  */
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;
3978  if (!__pyx_t_4) {
3979  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3980  __PYX_ERR(0, 44, __pyx_L1_error)
3981  }
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;
3991  __pyx_t_8 = NULL;
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);
3999  }
4000  }
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;
4007 
4008  /* "cpartitioning.pyx":45
4009  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4010  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4011  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4012  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4013  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4014  */
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;
4021  if (!__pyx_t_4) {
4022  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4023  __PYX_ERR(0, 45, __pyx_L1_error)
4024  }
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;
4034  __pyx_t_10 = NULL;
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);
4042  }
4043  }
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;
4050 
4051  /* "cpartitioning.pyx":46
4052  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4053  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4054  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4055  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4056  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4057  */
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;
4071  if (!__pyx_t_4) {
4072  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4073  __PYX_ERR(0, 46, __pyx_L1_error)
4074  }
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;
4084  __pyx_t_10 = NULL;
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);
4092  }
4093  }
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;
4100 
4101  /* "cpartitioning.pyx":47
4102  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4103  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4104  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4105  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4106  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4107  */
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;
4114  if (!__pyx_t_4) {
4115  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4116  __PYX_ERR(0, 47, __pyx_L1_error)
4117  }
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;
4127  __pyx_t_12 = NULL;
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);
4135  }
4136  }
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;
4143 
4144  /* "cpartitioning.pyx":48
4145  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4146  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4147  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4148  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4149  * )
4150  */
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;
4164  if (!__pyx_t_4) {
4165  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4166  __PYX_ERR(0, 48, __pyx_L1_error)
4167  }
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;
4177  __pyx_t_12 = NULL;
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);
4185  }
4186  }
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;
4193 
4194  /* "cpartitioning.pyx":49
4195  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4196  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4197  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4198  * )
4199  *
4200  */
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;
4207  if (!__pyx_t_4) {
4208  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4209  __PYX_ERR(0, 49, __pyx_L1_error)
4210  }
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;
4220  __pyx_t_14 = NULL;
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);
4228  }
4229  }
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;
4236 
4237  /* "cpartitioning.pyx":42
4238  * nLayersOfOverlap)
4239  * return (
4240  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4241  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4242  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4243  */
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);
4262  __pyx_t_1 = 0;
4263  __pyx_t_3 = 0;
4264  __pyx_t_5 = 0;
4265  __pyx_t_2 = 0;
4266  __pyx_t_9 = 0;
4267  __pyx_t_8 = 0;
4268  __pyx_t_11 = 0;
4269  __pyx_t_10 = 0;
4270  __pyx_r = __pyx_t_13;
4271  __pyx_t_13 = 0;
4272  goto __pyx_L0;
4273 
4274  /* "cpartitioning.pyx":36
4275  * )
4276  *
4277  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4278  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4279  * c_partitionNodes(comm.ob_mpi,
4280  */
4281 
4282  /* function exit code */
4283  __pyx_L1_error:;
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);
4297  __pyx_r = NULL;
4298  __pyx_L0:;
4299  __Pyx_XGIVEREF(__pyx_r);
4300  __Pyx_RefNannyFinishContext();
4301  return __pyx_r;
4302 }
4303 
4304 /* "cpartitioning.pyx":52
4305  * )
4306  *
4307  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4308  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4309  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4310  */
4311 
4312 /* Python wrapper */
4313 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
4325  {
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)) {
4329  Py_ssize_t kw_args;
4330  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4331  switch (pos_args) {
4332  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4333  CYTHON_FALLTHROUGH;
4334  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4335  CYTHON_FALLTHROUGH;
4336  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4337  CYTHON_FALLTHROUGH;
4338  case 0: break;
4339  default: goto __pyx_L5_argtuple_error;
4340  }
4341  kw_args = PyDict_Size(__pyx_kwds);
4342  switch (pos_args) {
4343  case 0:
4344  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4345  else goto __pyx_L5_argtuple_error;
4346  CYTHON_FALLTHROUGH;
4347  case 1:
4348  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4349  else {
4350  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 52, __pyx_L3_error)
4351  }
4352  CYTHON_FALLTHROUGH;
4353  case 2:
4354  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4355  else {
4356  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 52, __pyx_L3_error)
4357  }
4358  }
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)
4361  }
4362  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4363  goto __pyx_L5_argtuple_error;
4364  } else {
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);
4368  }
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]);
4372  }
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)
4376  __pyx_L3_error:;
4377  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4378  __Pyx_RefNannyFinishContext();
4379  return NULL;
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);
4385 
4386  /* function exit code */
4387  goto __pyx_L0;
4388  __pyx_L1_error:;
4389  __pyx_r = NULL;
4390  __pyx_L0:;
4391  __Pyx_RefNannyFinishContext();
4392  return __pyx_r;
4393 }
4394 
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;
4401  int *__pyx_t_4;
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);
4416 
4417  /* "cpartitioning.pyx":54
4418  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4419  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4420  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4421  * return (
4422  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4423  */
4424  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4425 
4426  /* "cpartitioning.pyx":55
4427  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4428  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4429  * return ( # <<<<<<<<<<<<<<
4430  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4431  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4432  */
4433  __Pyx_XDECREF(__pyx_r);
4434 
4435  /* "cpartitioning.pyx":56
4436  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4437  * return (
4438  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4439  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4440  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4441  */
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;
4455  if (!__pyx_t_4) {
4456  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4457  __PYX_ERR(0, 56, __pyx_L1_error)
4458  }
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;
4468  __pyx_t_2 = NULL;
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);
4476  }
4477  }
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;
4484 
4485  /* "cpartitioning.pyx":57
4486  * return (
4487  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4488  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
4489  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4490  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4491  */
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;
4498  if (!__pyx_t_4) {
4499  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4500  __PYX_ERR(0, 57, __pyx_L1_error)
4501  }
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;
4511  __pyx_t_8 = NULL;
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);
4519  }
4520  }
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;
4527 
4528  /* "cpartitioning.pyx":58
4529  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4530  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4531  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4532  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4533  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4534  */
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;
4548  if (!__pyx_t_4) {
4549  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4550  __PYX_ERR(0, 58, __pyx_L1_error)
4551  }
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;
4561  __pyx_t_8 = NULL;
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);
4569  }
4570  }
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;
4577 
4578  /* "cpartitioning.pyx":59
4579  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4580  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4581  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4582  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4583  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4584  */
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;
4591  if (!__pyx_t_4) {
4592  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4593  __PYX_ERR(0, 59, __pyx_L1_error)
4594  }
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;
4604  __pyx_t_10 = NULL;
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);
4612  }
4613  }
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;
4620 
4621  /* "cpartitioning.pyx":60
4622  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4623  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4624  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4625  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4626  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4627  */
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;
4641  if (!__pyx_t_4) {
4642  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4643  __PYX_ERR(0, 60, __pyx_L1_error)
4644  }
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;
4654  __pyx_t_10 = NULL;
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);
4662  }
4663  }
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;
4670 
4671  /* "cpartitioning.pyx":61
4672  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4673  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4674  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4675  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4676  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4677  */
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;
4684  if (!__pyx_t_4) {
4685  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4686  __PYX_ERR(0, 61, __pyx_L1_error)
4687  }
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;
4697  __pyx_t_12 = NULL;
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);
4705  }
4706  }
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;
4713 
4714  /* "cpartitioning.pyx":62
4715  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4716  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4717  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4718  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4719  * )
4720  */
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;
4734  if (!__pyx_t_4) {
4735  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4736  __PYX_ERR(0, 62, __pyx_L1_error)
4737  }
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;
4747  __pyx_t_12 = NULL;
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);
4755  }
4756  }
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;
4763 
4764  /* "cpartitioning.pyx":63
4765  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4766  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4767  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4768  * )
4769  *
4770  */
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;
4777  if (!__pyx_t_4) {
4778  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4779  __PYX_ERR(0, 63, __pyx_L1_error)
4780  }
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;
4790  __pyx_t_14 = NULL;
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);
4798  }
4799  }
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;
4806 
4807  /* "cpartitioning.pyx":56
4808  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4809  * return (
4810  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4811  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4812  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4813  */
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);
4832  __pyx_t_1 = 0;
4833  __pyx_t_3 = 0;
4834  __pyx_t_5 = 0;
4835  __pyx_t_2 = 0;
4836  __pyx_t_9 = 0;
4837  __pyx_t_8 = 0;
4838  __pyx_t_11 = 0;
4839  __pyx_t_10 = 0;
4840  __pyx_r = __pyx_t_13;
4841  __pyx_t_13 = 0;
4842  goto __pyx_L0;
4843 
4844  /* "cpartitioning.pyx":52
4845  * )
4846  *
4847  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4848  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4849  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4850  */
4851 
4852  /* function exit code */
4853  __pyx_L1_error:;
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);
4867  __pyx_r = NULL;
4868  __pyx_L0:;
4869  __Pyx_XGIVEREF(__pyx_r);
4870  __Pyx_RefNannyFinishContext();
4871  return __pyx_r;
4872 }
4873 
4874 /* "cpartitioning.pyx":66
4875  * )
4876  *
4877  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4878  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4879  * if not isinstance(filebase, bytes):
4880  */
4881 
4882 /* Python wrapper */
4883 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
4898  {
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)) {
4902  Py_ssize_t kw_args;
4903  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4904  switch (pos_args) {
4905  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4906  CYTHON_FALLTHROUGH;
4907  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4908  CYTHON_FALLTHROUGH;
4909  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4910  CYTHON_FALLTHROUGH;
4911  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4912  CYTHON_FALLTHROUGH;
4913  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4914  CYTHON_FALLTHROUGH;
4915  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4916  CYTHON_FALLTHROUGH;
4917  case 0: break;
4918  default: goto __pyx_L5_argtuple_error;
4919  }
4920  kw_args = PyDict_Size(__pyx_kwds);
4921  switch (pos_args) {
4922  case 0:
4923  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4924  else goto __pyx_L5_argtuple_error;
4925  CYTHON_FALLTHROUGH;
4926  case 1:
4927  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4928  else {
4929  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 66, __pyx_L3_error)
4930  }
4931  CYTHON_FALLTHROUGH;
4932  case 2:
4933  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4934  else {
4935  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 66, __pyx_L3_error)
4936  }
4937  CYTHON_FALLTHROUGH;
4938  case 3:
4939  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4940  else {
4941  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 66, __pyx_L3_error)
4942  }
4943  CYTHON_FALLTHROUGH;
4944  case 4:
4945  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4946  else {
4947  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 66, __pyx_L3_error)
4948  }
4949  CYTHON_FALLTHROUGH;
4950  case 5:
4951  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4952  else {
4953  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 66, __pyx_L3_error)
4954  }
4955  }
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)
4958  }
4959  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4960  goto __pyx_L5_argtuple_error;
4961  } else {
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);
4968  }
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]);
4975  }
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)
4979  __pyx_L3_error:;
4980  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4981  __Pyx_RefNannyFinishContext();
4982  return NULL;
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);
4988 
4989  /* function exit code */
4990  goto __pyx_L0;
4991  __pyx_L1_error:;
4992  __pyx_r = NULL;
4993  __pyx_L0:;
4994  __Pyx_RefNannyFinishContext();
4995  return __pyx_r;
4996 }
4997 
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
5001  int __pyx_t_1;
5002  int __pyx_t_2;
5003  PyObject *__pyx_t_3 = NULL;
5004  PyObject *__pyx_t_4 = NULL;
5005  PyObject *__pyx_t_5 = NULL;
5006  char *__pyx_t_6;
5007  int *__pyx_t_7;
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);
5023 
5024  /* "cpartitioning.pyx":67
5025  *
5026  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5027  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
5028  * if not isinstance(filebase, bytes):
5029  * filebase = filebase.encode()
5030  */
5031  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5032 
5033  /* "cpartitioning.pyx":68
5034  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5035  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5036  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5037  * filebase = filebase.encode()
5038  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5039  */
5040  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5041  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5042  if (__pyx_t_2) {
5043 
5044  /* "cpartitioning.pyx":69
5045  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5046  * if not isinstance(filebase, bytes):
5047  * filebase = filebase.encode() # <<<<<<<<<<<<<<
5048  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5049  * <const char*>(<char*>filebase),
5050  */
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);
5053  __pyx_t_5 = NULL;
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);
5061  }
5062  }
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);
5069  __pyx_t_3 = 0;
5070 
5071  /* "cpartitioning.pyx":68
5072  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5073  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5074  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5075  * filebase = filebase.encode()
5076  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5077  */
5078  }
5079 
5080  /* "cpartitioning.pyx":71
5081  * filebase = filebase.encode()
5082  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5083  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
5084  * indexBase,
5085  * cmesh.mesh,
5086  */
5087  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
5088 
5089  /* "cpartitioning.pyx":70
5090  * if not isinstance(filebase, bytes):
5091  * filebase = filebase.encode()
5092  * c_partitionNodesFromTetgenFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
5093  * <const char*>(<char*>filebase),
5094  * indexBase,
5095  */
5096  (void)(proteus::partitionNodesFromTetgenFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
5097 
5098  /* "cpartitioning.pyx":75
5099  * cmesh.mesh,
5100  * nLayersOfOverlap)
5101  * return ( # <<<<<<<<<<<<<<
5102  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5103  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5104  */
5105  __Pyx_XDECREF(__pyx_r);
5106 
5107  /* "cpartitioning.pyx":76
5108  * nLayersOfOverlap)
5109  * return (
5110  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5111  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5112  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5113  */
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;
5127  if (!__pyx_t_7) {
5128  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5129  __PYX_ERR(0, 76, __pyx_L1_error)
5130  }
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;
5140  __pyx_t_4 = NULL;
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);
5148  }
5149  }
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;
5156 
5157  /* "cpartitioning.pyx":77
5158  * return (
5159  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5160  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5161  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5162  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5163  */
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;
5170  if (!__pyx_t_7) {
5171  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5172  __PYX_ERR(0, 77, __pyx_L1_error)
5173  }
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;
5183  __pyx_t_11 = NULL;
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);
5191  }
5192  }
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;
5199 
5200  /* "cpartitioning.pyx":78
5201  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5202  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5203  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5204  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5205  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5206  */
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;
5220  if (!__pyx_t_7) {
5221  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5222  __PYX_ERR(0, 78, __pyx_L1_error)
5223  }
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;
5233  __pyx_t_11 = NULL;
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);
5241  }
5242  }
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;
5249 
5250  /* "cpartitioning.pyx":79
5251  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5252  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5253  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5254  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5255  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5256  */
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;
5263  if (!__pyx_t_7) {
5264  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5265  __PYX_ERR(0, 79, __pyx_L1_error)
5266  }
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;
5276  __pyx_t_13 = NULL;
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);
5284  }
5285  }
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;
5292 
5293  /* "cpartitioning.pyx":80
5294  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5295  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5296  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5297  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5298  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5299  */
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;
5313  if (!__pyx_t_7) {
5314  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5315  __PYX_ERR(0, 80, __pyx_L1_error)
5316  }
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;
5326  __pyx_t_13 = NULL;
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);
5334  }
5335  }
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;
5342 
5343  /* "cpartitioning.pyx":81
5344  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5345  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5346  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
5347  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5348  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5349  */
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;
5356  if (!__pyx_t_7) {
5357  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5358  __PYX_ERR(0, 81, __pyx_L1_error)
5359  }
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;
5369  __pyx_t_15 = NULL;
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);
5377  }
5378  }
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;
5385 
5386  /* "cpartitioning.pyx":82
5387  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5388  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5389  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5390  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5391  * )
5392  */
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;
5406  if (!__pyx_t_7) {
5407  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5408  __PYX_ERR(0, 82, __pyx_L1_error)
5409  }
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;
5419  __pyx_t_15 = NULL;
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);
5427  }
5428  }
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;
5435 
5436  /* "cpartitioning.pyx":83
5437  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5438  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5439  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
5440  * )
5441  *
5442  */
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;
5449  if (!__pyx_t_7) {
5450  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5451  __PYX_ERR(0, 83, __pyx_L1_error)
5452  }
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;
5462  __pyx_t_17 = NULL;
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);
5470  }
5471  }
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;
5478 
5479  /* "cpartitioning.pyx":76
5480  * nLayersOfOverlap)
5481  * return (
5482  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5483  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5484  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5485  */
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);
5504  __pyx_t_3 = 0;
5505  __pyx_t_5 = 0;
5506  __pyx_t_8 = 0;
5507  __pyx_t_4 = 0;
5508  __pyx_t_12 = 0;
5509  __pyx_t_11 = 0;
5510  __pyx_t_14 = 0;
5511  __pyx_t_13 = 0;
5512  __pyx_r = __pyx_t_16;
5513  __pyx_t_16 = 0;
5514  goto __pyx_L0;
5515 
5516  /* "cpartitioning.pyx":66
5517  * )
5518  *
5519  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5520  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5521  * if not isinstance(filebase, bytes):
5522  */
5523 
5524  /* function exit code */
5525  __pyx_L1_error:;
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);
5539  __pyx_r = NULL;
5540  __pyx_L0:;
5541  __Pyx_XDECREF(__pyx_v_filebase);
5542  __Pyx_XGIVEREF(__pyx_r);
5543  __Pyx_RefNannyFinishContext();
5544  return __pyx_r;
5545 }
5546 
5547 /* "cpartitioning.pyx":86
5548  * )
5549  *
5550  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5551  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5552  * if not isinstance(filebase, bytes):
5553  */
5554 
5555 /* Python wrapper */
5556 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
5571  {
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)) {
5575  Py_ssize_t kw_args;
5576  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5577  switch (pos_args) {
5578  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5579  CYTHON_FALLTHROUGH;
5580  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5581  CYTHON_FALLTHROUGH;
5582  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5583  CYTHON_FALLTHROUGH;
5584  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5585  CYTHON_FALLTHROUGH;
5586  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5587  CYTHON_FALLTHROUGH;
5588  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5589  CYTHON_FALLTHROUGH;
5590  case 0: break;
5591  default: goto __pyx_L5_argtuple_error;
5592  }
5593  kw_args = PyDict_Size(__pyx_kwds);
5594  switch (pos_args) {
5595  case 0:
5596  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5597  else goto __pyx_L5_argtuple_error;
5598  CYTHON_FALLTHROUGH;
5599  case 1:
5600  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
5601  else {
5602  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 1); __PYX_ERR(0, 86, __pyx_L3_error)
5603  }
5604  CYTHON_FALLTHROUGH;
5605  case 2:
5606  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
5607  else {
5608  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 2); __PYX_ERR(0, 86, __pyx_L3_error)
5609  }
5610  CYTHON_FALLTHROUGH;
5611  case 3:
5612  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
5613  else {
5614  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 3); __PYX_ERR(0, 86, __pyx_L3_error)
5615  }
5616  CYTHON_FALLTHROUGH;
5617  case 4:
5618  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5619  else {
5620  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 4); __PYX_ERR(0, 86, __pyx_L3_error)
5621  }
5622  CYTHON_FALLTHROUGH;
5623  case 5:
5624  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5625  else {
5626  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 5); __PYX_ERR(0, 86, __pyx_L3_error)
5627  }
5628  }
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)
5631  }
5632  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5633  goto __pyx_L5_argtuple_error;
5634  } else {
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);
5641  }
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]);
5648  }
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)
5652  __pyx_L3_error:;
5653  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5654  __Pyx_RefNannyFinishContext();
5655  return NULL;
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);
5661 
5662  /* function exit code */
5663  goto __pyx_L0;
5664  __pyx_L1_error:;
5665  __pyx_r = NULL;
5666  __pyx_L0:;
5667  __Pyx_RefNannyFinishContext();
5668  return __pyx_r;
5669 }
5670 
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
5674  int __pyx_t_1;
5675  int __pyx_t_2;
5676  PyObject *__pyx_t_3 = NULL;
5677  PyObject *__pyx_t_4 = NULL;
5678  PyObject *__pyx_t_5 = NULL;
5679  char *__pyx_t_6;
5680  int *__pyx_t_7;
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);
5696 
5697  /* "cpartitioning.pyx":87
5698  *
5699  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5700  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
5701  * if not isinstance(filebase, bytes):
5702  * filebase = filebase.encode()
5703  */
5704  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5705 
5706  /* "cpartitioning.pyx":88
5707  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5708  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5709  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5710  * filebase = filebase.encode()
5711  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5712  */
5713  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5714  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5715  if (__pyx_t_2) {
5716 
5717  /* "cpartitioning.pyx":89
5718  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5719  * if not isinstance(filebase, bytes):
5720  * filebase = filebase.encode() # <<<<<<<<<<<<<<
5721  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5722  * <const char*>(<char*>filebase),
5723  */
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);
5726  __pyx_t_5 = NULL;
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);
5734  }
5735  }
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);
5742  __pyx_t_3 = 0;
5743 
5744  /* "cpartitioning.pyx":88
5745  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5746  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5747  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5748  * filebase = filebase.encode()
5749  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5750  */
5751  }
5752 
5753  /* "cpartitioning.pyx":91
5754  * filebase = filebase.encode()
5755  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5756  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
5757  * indexBase,
5758  * cmesh.mesh,
5759  */
5760  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
5761 
5762  /* "cpartitioning.pyx":90
5763  * if not isinstance(filebase, bytes):
5764  * filebase = filebase.encode()
5765  * c_partitionNodesFromTriangleFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
5766  * <const char*>(<char*>filebase),
5767  * indexBase,
5768  */
5769  (void)(proteus::partitionNodesFromTriangleFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
5770 
5771  /* "cpartitioning.pyx":95
5772  * cmesh.mesh,
5773  * nLayersOfOverlap)
5774  * return ( # <<<<<<<<<<<<<<
5775  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5776  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5777  */
5778  __Pyx_XDECREF(__pyx_r);
5779 
5780  /* "cpartitioning.pyx":96
5781  * nLayersOfOverlap)
5782  * return (
5783  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5784  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5785  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5786  */
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;
5800  if (!__pyx_t_7) {
5801  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5802  __PYX_ERR(0, 96, __pyx_L1_error)
5803  }
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;
5813  __pyx_t_4 = NULL;
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);
5821  }
5822  }
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;
5829 
5830  /* "cpartitioning.pyx":97
5831  * return (
5832  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5833  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5834  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5835  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5836  */
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;
5843  if (!__pyx_t_7) {
5844  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5845  __PYX_ERR(0, 97, __pyx_L1_error)
5846  }
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;
5856  __pyx_t_11 = NULL;
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);
5864  }
5865  }
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;
5872 
5873  /* "cpartitioning.pyx":98
5874  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5875  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5876  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5877  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5878  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5879  */
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;
5893  if (!__pyx_t_7) {
5894  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5895  __PYX_ERR(0, 98, __pyx_L1_error)
5896  }
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;
5906  __pyx_t_11 = NULL;
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);
5914  }
5915  }
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;
5922 
5923  /* "cpartitioning.pyx":99
5924  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5925  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5926  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5927  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5928  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5929  */
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;
5936  if (!__pyx_t_7) {
5937  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5938  __PYX_ERR(0, 99, __pyx_L1_error)
5939  }
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;
5949  __pyx_t_13 = NULL;
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);
5957  }
5958  }
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;
5965 
5966  /* "cpartitioning.pyx":100
5967  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5968  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5969  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5970  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5971  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5972  */
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;
5986  if (!__pyx_t_7) {
5987  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5988  __PYX_ERR(0, 100, __pyx_L1_error)
5989  }
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;
5999  __pyx_t_13 = NULL;
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);
6007  }
6008  }
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;
6015 
6016  /* "cpartitioning.pyx":101
6017  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
6018  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
6019  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
6020  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
6021  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
6022  */
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;
6029  if (!__pyx_t_7) {
6030  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
6031  __PYX_ERR(0, 101, __pyx_L1_error)
6032  }
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;
6042  __pyx_t_15 = NULL;
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);
6050  }
6051  }
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;
6058 
6059  /* "cpartitioning.pyx":102
6060  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
6061  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
6062  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
6063  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
6064  * )
6065  */
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;
6079  if (!__pyx_t_7) {
6080  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
6081  __PYX_ERR(0, 102, __pyx_L1_error)
6082  }
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;
6092  __pyx_t_15 = NULL;
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);
6100  }
6101  }
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;
6108 
6109  /* "cpartitioning.pyx":103
6110  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
6111  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
6112  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
6113  * )
6114  *
6115  */
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;
6122  if (!__pyx_t_7) {
6123  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
6124  __PYX_ERR(0, 103, __pyx_L1_error)
6125  }
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;
6135  __pyx_t_17 = NULL;
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);
6143  }
6144  }
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;
6151 
6152  /* "cpartitioning.pyx":96
6153  * nLayersOfOverlap)
6154  * return (
6155  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
6156  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
6157  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
6158  */
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);
6177  __pyx_t_3 = 0;
6178  __pyx_t_5 = 0;
6179  __pyx_t_8 = 0;
6180  __pyx_t_4 = 0;
6181  __pyx_t_12 = 0;
6182  __pyx_t_11 = 0;
6183  __pyx_t_14 = 0;
6184  __pyx_t_13 = 0;
6185  __pyx_r = __pyx_t_16;
6186  __pyx_t_16 = 0;
6187  goto __pyx_L0;
6188 
6189  /* "cpartitioning.pyx":86
6190  * )
6191  *
6192  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
6193  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
6194  * if not isinstance(filebase, bytes):
6195  */
6196 
6197  /* function exit code */
6198  __pyx_L1_error:;
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);
6212  __pyx_r = NULL;
6213  __pyx_L0:;
6214  __Pyx_XDECREF(__pyx_v_filebase);
6215  __Pyx_XGIVEREF(__pyx_r);
6216  __Pyx_RefNannyFinishContext();
6217  return __pyx_r;
6218 }
6219 
6220 /* "cpartitioning.pyx":106
6221  * )
6222  *
6223  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6224  * int nSpace,
6225  * cmeshTools.CMesh cmesh,
6226  */
6227 
6228 /* Python wrapper */
6229 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
6233  int __pyx_v_nSpace;
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);
6254  {
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)) {
6258  Py_ssize_t kw_args;
6259  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6260  switch (pos_args) {
6261  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6262  CYTHON_FALLTHROUGH;
6263  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6264  CYTHON_FALLTHROUGH;
6265  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6266  CYTHON_FALLTHROUGH;
6267  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6268  CYTHON_FALLTHROUGH;
6269  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6270  CYTHON_FALLTHROUGH;
6271  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6272  CYTHON_FALLTHROUGH;
6273  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6274  CYTHON_FALLTHROUGH;
6275  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6276  CYTHON_FALLTHROUGH;
6277  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6278  CYTHON_FALLTHROUGH;
6279  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6280  CYTHON_FALLTHROUGH;
6281  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6282  CYTHON_FALLTHROUGH;
6283  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6284  CYTHON_FALLTHROUGH;
6285  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6286  CYTHON_FALLTHROUGH;
6287  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6288  CYTHON_FALLTHROUGH;
6289  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6290  CYTHON_FALLTHROUGH;
6291  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6292  CYTHON_FALLTHROUGH;
6293  case 0: break;
6294  default: goto __pyx_L5_argtuple_error;
6295  }
6296  kw_args = PyDict_Size(__pyx_kwds);
6297  switch (pos_args) {
6298  case 0:
6299  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6300  else goto __pyx_L5_argtuple_error;
6301  CYTHON_FALLTHROUGH;
6302  case 1:
6303  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6304  else {
6305  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 106, __pyx_L3_error)
6306  }
6307  CYTHON_FALLTHROUGH;
6308  case 2:
6309  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6310  else {
6311  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 106, __pyx_L3_error)
6312  }
6313  CYTHON_FALLTHROUGH;
6314  case 3:
6315  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6316  else {
6317  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 106, __pyx_L3_error)
6318  }
6319  CYTHON_FALLTHROUGH;
6320  case 4:
6321  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6322  else {
6323  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 106, __pyx_L3_error)
6324  }
6325  CYTHON_FALLTHROUGH;
6326  case 5:
6327  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6328  else {
6329  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 106, __pyx_L3_error)
6330  }
6331  CYTHON_FALLTHROUGH;
6332  case 6:
6333  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6334  else {
6335  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 106, __pyx_L3_error)
6336  }
6337  CYTHON_FALLTHROUGH;
6338  case 7:
6339  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6340  else {
6341  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 106, __pyx_L3_error)
6342  }
6343  CYTHON_FALLTHROUGH;
6344  case 8:
6345  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6346  else {
6347  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 106, __pyx_L3_error)
6348  }
6349  CYTHON_FALLTHROUGH;
6350  case 9:
6351  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6352  else {
6353  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 106, __pyx_L3_error)
6354  }
6355  CYTHON_FALLTHROUGH;
6356  case 10:
6357  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;